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
68967191_6624
class GcsPath implements Path, Serializable { @Override public Path resolveSibling(Path other) { throw new UnsupportedOperationException(); } public GcsPath(@Nullable FileSystem fs, @Nullable String bucket, @Nullable String object); public static GcsPath fromUri(URI uri); public static GcsPath fromU...
assertEquals( "gs://bucket/bar/moo", GcsPath.fromUri("gs://bucket/bar/foo").resolveSibling("moo").toString()); assertEquals( "gs://bucket/moo", GcsPath.fromUri("gs://bucket/foo").resolveSibling("moo").toString()); thrown.expect(UnsupportedOperationException.class); GcsPath.fromUr...
[FOCAL] @Override public Path GcsPath.resolveSibling(Path other) [CLASS] class GcsPath implements Path, Serializable [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=1 nesting=0 [NEW] UnsupportedOperationException [EXCEPTIONS] throws UnsupportedOperationException [THROWS-WHEN] UnsupportedOperationException when...
/* static context [FOCAL] @Override public Path GcsPath.resolveSibling(Path other) [THROWS-WHEN] UnsupportedOperationException when always [INPUTS] branches=- | result=- | unused=other [EXCEPTIONS] throws UnsupportedOperationException [NEW] UnsupportedOperationException */
/* static context [FOCAL] @Override public Path GcsPath.resolveSibling(Path other) [THROWS-WHEN] UnsupportedOperationException when always [INPUTS] branches=- | result=- | unused=other [EXCEPTIONS] throws UnsupportedOperationException [NEW] UnsupportedOperationException */ class GcsPath implements Path, Serializable { ...
true
ok
{"focal": {"class": "GcsPath", "name": "resolveSibling", "signature": "Path resolveSibling(Path other)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "other", "type": "Path"}], "return_type": "Path"}, "class_info": {"name": "GcsPath", "kind": "class", "modifiers": "", "superclass": null, "inter...
69026532_22
class User { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; User other = (User) obj; if (id != other.id) return false; return true; } public User(int id, String username, String pa...
User user = new User(1, "homer", "**********"); Assert.assertFalse(user.equals(null)); } }
[FOCAL] @Override public boolean User.equals(Object obj) [CLASS] class User [METRICS] loc=14 cc=5 branches=4 loops=0 returns=5 throws=0 nesting=1 [CALLS-EXTERNAL] getClass/0 (inherited), Object.getClass/0 [PATH1] if(this == obj)=F -> if(obj == null)=F -> if(getClass() != obj.getClass())=F -> if(id != other.id)=T -> ret...
/* static context [FOCAL] @Override public boolean User.equals(Object obj) [PATH1] if(this == obj)=F -> if(obj == null)=F -> if(getClass() != obj.getClass())=F -> if(id != other.id)=T -> return false [PATH2] if(this == obj)=T -> return true [PATH3] if(this == obj)=F -> if(obj == null)=T -> return false [PATH4] if(this ...
/* static context [FOCAL] @Override public boolean User.equals(Object obj) [PATH1] if(this == obj)=F -> if(obj == null)=F -> if(getClass() != obj.getClass())=F -> if(id != other.id)=T -> return false [PATH2] if(this == obj)=T -> return true [PATH3] if(this == obj)=F -> if(obj == null)=T -> return false [PATH4] if(this ...
true
ok
{"focal": {"class": "User", "name": "equals", "signature": "boolean equals(Object obj)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "obj", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "User", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "f...
69044045_2
class JaxRsUrlResolver implements UrlResolver { @Override public String compute(String url, WebContext context) { if (context instanceof JaxRsContext && url != null) { return ((JaxRsContext) context).getAbsolutePath(url, true); } return url; } } class JaxRsUrlResolverT...
WebContext context = mock(WebContext.class); JaxRsUrlResolver resolver = new JaxRsUrlResolver(); String resolvedUrl = resolver.compute("/a/relative/url", context); assertThat(resolvedUrl, is("/a/relative/url")); } }
[FOCAL] @Override public String JaxRsUrlResolver.compute(String url, WebContext context) [CLASS] class JaxRsUrlResolver implements UrlResolver [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] ((JaxRsContext) context).getAbsolutePath/2 [PATH1] if(context instanceof JaxRsContext && ur...
/* static context [FOCAL] @Override public String JaxRsUrlResolver.compute(String url, WebContext context) [PATH1] if(context instanceof JaxRsContext && url != null)=T -> return ((JaxRsContext) context).getAbsolutePath(url, true) [PATH2] if(context instanceof JaxRsContext && url != null)=F -> return url [INPUTS] branch...
/* static context [FOCAL] @Override public String JaxRsUrlResolver.compute(String url, WebContext context) [PATH1] if(context instanceof JaxRsContext && url != null)=T -> return ((JaxRsContext) context).getAbsolutePath(url, true) [PATH2] if(context instanceof JaxRsContext && url != null)=F -> return url [INPUTS] branch...
true
ok
{"focal": {"class": "JaxRsUrlResolver", "name": "compute", "signature": "String compute(String url, WebContext context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "url", "type": "String"}, {"name": "context", "type": "WebContext"}], "return_type": "String"}, "class_info": {"name": "JaxRsUrl...
69047858_9
class ShowReposPresenter implements ShowReposContract.Presenter, ReposCallback { @Override public void restoreStateAndShowRepos(ReposByUsernameUI uiModel) { if (isViewAttached()) { if (uiModel != null) { this.uiModel = uiModel; view.showRepos(uiModel, false /...
// Given a stubbed uiModel uiModel = new ReposByUsernameUI(REPOS_BY_USERNAME_UI_MAP, true /* is cached*/); // When presenter.restoreStateAndShowRepos(uiModel); // Then verify(view).showRepos(uiModel, false /*not going to top*/); } }
[FOCAL] @Override public void ShowReposPresenter.restoreStateAndShowRepos(ReposByUsernameUI uiModel) [CLASS] class ShowReposPresenter implements ShowReposContract.Presenter, ReposCallback [METRICS] loc=9 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] boolean isViewAttached() [CALLS-EXTERNAL] Show...
/* static context [FOCAL] @Override public void ShowReposPresenter.restoreStateAndShowRepos(ReposByUsernameUI uiModel) [PATH1] if(isViewAttached())=T -> if(uiModel != null)=T [PATH2] if(isViewAttached())=F [PATH3] if(isViewAttached())=T -> if(uiModel != null)=F [INPUTS] branches=uiModel | result=- [COLLABORATORS] field...
/* static context [FOCAL] @Override public void ShowReposPresenter.restoreStateAndShowRepos(ReposByUsernameUI uiModel) [PATH1] if(isViewAttached())=T -> if(uiModel != null)=T [PATH2] if(isViewAttached())=F [PATH3] if(isViewAttached())=T -> if(uiModel != null)=F [INPUTS] branches=uiModel | result=- [COLLABORATORS] field...
true
ok
{"focal": {"class": "ShowReposPresenter", "name": "restoreStateAndShowRepos", "signature": "void restoreStateAndShowRepos(ReposByUsernameUI uiModel)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "uiModel", "type": "ReposByUsernameUI"}], "return_type": "void"}, "class_info": {"name": "ShowRepos...
69207015_4
class FunctionHelper { public static FunctionDetails parseFunctionString(String paramString) throws IllegalArgumentException { // trim any whitespace String trimmedLine = paramString.trim(); // trimmed line is the data for the functions FunctionDetails functionDetails = new FunctionDetails(trimmed...
FunctionDetails details = FunctionHelper.parseFunctionString(" dd/mm or next friday "); assertThat(details, is(notNullValue())); assertThat(details.getFunctionData(), is("dd/mm or next friday")); assertThat(details.getFunctionParams(), is(nullValue())); } }
[FOCAL] public static FunctionDetails FunctionHelper.parseFunctionString(String paramString) [CLASS] class FunctionHelper [METRICS] loc=51 cc=5 branches=2 loops=1 returns=1 throws=1 nesting=4 [CALLS-EXTERNAL] String.trim/0, String.contains/1, Arrays.asList/1, String.split/1, ArrayList<String>.isEmpty/0, ArrayList<Strin...
/* static context [FOCAL] public static FunctionDetails FunctionHelper.parseFunctionString(String paramString) [THROWS-WHEN] IllegalArgumentException when try-body throws [PATH1] if(trimmedLine.contains("::"))=T -> while(!tokens.isEmpty())=T -> if(lastSpace != -1 && tokens.size() > 0)=T -> exit loop -> return functionD...
/* static context [FOCAL] public static FunctionDetails FunctionHelper.parseFunctionString(String paramString) [THROWS-WHEN] IllegalArgumentException when try-body throws [PATH1] if(trimmedLine.contains("::"))=T -> while(!tokens.isEmpty())=T -> if(lastSpace != -1 && tokens.size() > 0)=T -> exit loop -> return functionD...
true
ok
{"focal": {"class": "FunctionHelper", "name": "parseFunctionString", "signature": "FunctionDetails parseFunctionString(String paramString) throws IllegalArgumentException", "start_line": 3, "modifiers": "public static", "params": [{"name": "paramString", "type": "String"}], "return_type": "FunctionDetails"}, "class_inf...
69239703_0
class AuthRepositoryImpl implements AuthRepository { @Override public Observable<Boolean> login(LoginDataParams params) { if(params == null || isEmpty(params.getPhoneNumber()) || isEmpty(params.getPinNumber())) { return Observable.error(new VoteException(MessageType.EMPTY_CREDENTIALS)); ...
//when Observable<Boolean> loginResult = authRepository.login(null); //then loginResult.test().assertError(VoteException.class); } }
[FOCAL] @Override public Observable<Boolean> AuthRepositoryImpl.login(LoginDataParams params) [CLASS] class AuthRepositoryImpl implements AuthRepository [METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] isEmpty/1 (inherited), LoginDataParams.getPhoneNumber/0, LoginDataParams.getPinN...
/* static context [FOCAL] @Override public Observable<Boolean> AuthRepositoryImpl.login(LoginDataParams params) [PATH1] if(params == null || isEmpty(params.getPhoneNumber()) || isEmpty(params.getPinNumber()))=T -> return Observable.error(new VoteException(MessageType.EMPTY_CREDENTIALS)) [PATH2] if(params == null || isE...
/* static context [FOCAL] @Override public Observable<Boolean> AuthRepositoryImpl.login(LoginDataParams params) [PATH1] if(params == null || isEmpty(params.getPhoneNumber()) || isEmpty(params.getPinNumber()))=T -> return Observable.error(new VoteException(MessageType.EMPTY_CREDENTIALS)) [PATH2] if(params == null || isE...
true
ok
{"focal": {"class": "AuthRepositoryImpl", "name": "login", "signature": "Observable<Boolean> login(LoginDataParams params)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "params", "type": "LoginDataParams"}], "return_type": "Observable<Boolean>"}, "class_info": {"name": "AuthRepositoryImpl", "k...
69273058_41
class OrCondition implements Condition { @Override public boolean evaluate(Doc doc) { return conditions.stream().anyMatch(condition -> condition.evaluate(doc)); } public OrCondition(List<Condition> conditions); } class OrConditionTest { @Test public void testTwoConditionsFalse() {
OrCondition andCondition = new OrCondition(Arrays.asList(c -> false, c -> false)); Doc doc = createDoc("field1", "value1"); assertThat(andCondition.evaluate(doc)).isFalse(); } }
[FOCAL] @Override public boolean OrCondition.evaluate(Doc doc) [CLASS] class OrCondition implements Condition [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] conditions.stream().anyMatch/1, conditions.stream/0, condition.evaluate/1 [INPUTS] branches=- | result=doc [COLLABORATORS] f...
/* static context [FOCAL] @Override public boolean OrCondition.evaluate(Doc doc) [INPUTS] branches=- | result=doc [COLLABORATORS] field conditions stream/0; field condition evaluate/1 [CALLS-EXTERNAL] conditions.stream().anyMatch/1, conditions.stream/0, condition.evaluate/1 */
/* static context [FOCAL] @Override public boolean OrCondition.evaluate(Doc doc) [INPUTS] branches=- | result=doc [COLLABORATORS] field conditions stream/0; field condition evaluate/1 [CALLS-EXTERNAL] conditions.stream().anyMatch/1, conditions.stream/0, condition.evaluate/1 */ class OrCondition implements Condition { ...
true
ok
{"focal": {"class": "OrCondition", "name": "evaluate", "signature": "boolean evaluate(Doc doc)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "doc", "type": "Doc"}], "return_type": "boolean"}, "class_info": {"name": "OrCondition", "kind": "class", "modifiers": "", "superclass": null, "interface...
69277020_0
class KubernetesAccount extends ContainerAccount implements Cloneable { @JsonProperty("oAuthScopes") public List<String> getOAuthScopes() { return oAuthScopes; } public boolean usesServiceAccount(); public String getKubeconfigFile(); @Override public void makeBootstrappingAccount(ArtifactSourcesConfig...
Yaml yamlParser = new Yaml(); Object parsedYaml = yamlParser.load( Joiner.on('\n') .join( "oauthScopes: [\"lowercase-a\"]", // "oAuthScopes: [\"uppercase-a\"]")); KubernetesAccount account = new StrictObjectMapper().convertV...
[FOCAL] @JsonProperty("oAuthScopes") public List<String> KubernetesAccount.getOAuthScopes() [CLASS] class KubernetesAccount extends ContainerAccount implements Cloneable [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] boolean usesServiceAccount(); String getKubeconfigFile(); void ma...
/* static context [FOCAL] @JsonProperty("oAuthScopes") public List<String> KubernetesAccount.getOAuthScopes() */
/* static context [FOCAL] @JsonProperty("oAuthScopes") public List<String> KubernetesAccount.getOAuthScopes() */ class KubernetesAccount extends ContainerAccount implements Cloneable { @JsonProperty("oAuthScopes") public List<String> getOAuthScopes() { return oAuthScopes; } public boolean usesServiceAccou...
true
ok
{"focal": {"class": "KubernetesAccount", "name": "getOAuthScopes", "signature": "List<String> getOAuthScopes()", "start_line": 3, "modifiers": "@JsonProperty(\"oAuthScopes\") public", "params": [], "return_type": "List<String>"}, "class_info": {"name": "KubernetesAccount", "kind": "class", "modifiers": "", "superclass"...
69284281_234
class CommentConverter { public static CommentDto convert(final Comment comment) { return convert(comment, comment.getParentMessage() != null ? MessageConverter.convert(comment.getParentMessage()) : null); } private CommentConverter(); public static CommentDto convert(final Comment comment, ...
comment.setParentMessage(null); CommentDto commentConverter = CommentConverter.convert(comment); Assert.assertEquals(commentDto.getId(), commentConverter.getId()); Assert.assertEquals(commentDto.getText(), commentConverter.getText()); Assert.assertEquals(commentDto.getAuthor().getId(), commentConverter.getA...
[FOCAL] public static CommentDto CommentConverter.convert(Comment comment) [CLASS] class CommentConverter [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] CommentDto convert(Comment comment, MessageDto parentMessage) [CALLS-EXTERNAL] Comment.getParentMessage/0, MessageConverter.conv...
/* static context [FOCAL] public static CommentDto CommentConverter.convert(Comment comment) [INPUTS] branches=- | result=comment [COLLABORATORS] param comment:Comment getParentMessage/0 [CALLS-INTERNAL] CommentDto convert(Comment comment, MessageDto parentMessage) [CALLS-EXTERNAL] Comment.getParentMessage/0, MessageCo...
/* static context [FOCAL] public static CommentDto CommentConverter.convert(Comment comment) [INPUTS] branches=- | result=comment [COLLABORATORS] param comment:Comment getParentMessage/0 [CALLS-INTERNAL] CommentDto convert(Comment comment, MessageDto parentMessage) [CALLS-EXTERNAL] Comment.getParentMessage/0, MessageCo...
true
ok
{"focal": {"class": "CommentConverter", "name": "convert", "signature": "CommentDto convert(Comment comment)", "start_line": 3, "modifiers": "public static", "params": [{"name": "comment", "type": "Comment"}], "return_type": "CommentDto"}, "class_info": {"name": "CommentConverter", "kind": "class", "modifiers": "", "su...
69289646_19
class RecyclerViewProxy implements ScrollingViewProxy { @Override public void smoothScrollToPositionFromTop(int position, int i) { mRecyclerView.getLinearLayoutManager().scrollToPositionWithOffset(position, i); } public RecyclerViewProxy(LinearRecyclerView recyclerView); @Override public View getView(...
int position = 5; int delta = 32; mRecyclerViewProxy.smoothScrollToPositionFromTop(position, delta); verify(mLayoutManager).scrollToPositionWithOffset(position, delta); } }
[FOCAL] @Override public void RecyclerViewProxy.smoothScrollToPositionFromTop(int position, int i) [CLASS] class RecyclerViewProxy implements ScrollingViewProxy [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] mRecyclerView.getLinearLayoutManager().scrollToPositionWithOffset/2, Line...
/* static context [FOCAL] @Override public void RecyclerViewProxy.smoothScrollToPositionFromTop(int position, int i) [COLLABORATORS] field mRecyclerView:LinearRecyclerView getLinearLayoutManager/0 [FIELDS] read=mRecyclerView:LinearRecyclerView [CALLS-EXTERNAL] mRecyclerView.getLinearLayoutManager().scrollToPositionWith...
/* static context [FOCAL] @Override public void RecyclerViewProxy.smoothScrollToPositionFromTop(int position, int i) [COLLABORATORS] field mRecyclerView:LinearRecyclerView getLinearLayoutManager/0 [FIELDS] read=mRecyclerView:LinearRecyclerView [CALLS-EXTERNAL] mRecyclerView.getLinearLayoutManager().scrollToPositionWith...
true
ok
{"focal": {"class": "RecyclerViewProxy", "name": "smoothScrollToPositionFromTop", "signature": "void smoothScrollToPositionFromTop(int position, int i)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "position", "type": "int"}, {"name": "i", "type": "int"}], "return_type": "void"}, "class_info":...
69363264_27
class Flow extends ModelElement { Flow(String name, UseCase useCase) { super(name, useCase.getModel()); this.useCase = useCase; } Flow(String name, UseCase useCase); public UseCase getUseCase(); public List<FlowStep> getSteps(); public Optional<FlowStep> getFirstStep(); private boolean isStepInThisFlow(...
Model model = modelBuilder .useCase(USE_CASE) .basicFlow() .step(CUSTOMER_ENTERS_TEXT).as(secondActor).user(EntersText.class).system(displaysEnteredText()) .step(CUSTOMER_ENTERS_TEXT_AGAIN).as(secondActor, customer).user(EntersText.class).system(displaysEnteredText()) .step(CUSTOMER_ENTERS_NU...
[FOCAL] Flow.Flow(String name, UseCase useCase) [CLASS] class Flow extends ModelElement [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] UseCase.getModel/0 [FIELDS] write=useCase [COLLABORATORS] param useCase:UseCase getModel/0 [STATE] useCase via getUseCase() [DATAFLOW] name@param-...
/* static context [FOCAL] Flow.Flow(String name, UseCase useCase) [COLLABORATORS] param useCase:UseCase getModel/0 [STATE] useCase via getUseCase() [FIELDS] write=useCase [CALLS-EXTERNAL] UseCase.getModel/0 */
/* static context [FOCAL] Flow.Flow(String name, UseCase useCase) [COLLABORATORS] param useCase:UseCase getModel/0 [STATE] useCase via getUseCase() [FIELDS] write=useCase [CALLS-EXTERNAL] UseCase.getModel/0 */ class Flow extends ModelElement { Flow(String name, UseCase useCase) { super(name, useCase.getModel()); ...
true
ok
{"focal": {"class": "Flow", "name": "Flow", "signature": "Flow(String name, UseCase useCase)", "start_line": 3, "modifiers": "", "params": [{"name": "name", "type": "String"}, {"name": "useCase", "type": "UseCase"}], "return_type": null}, "class_info": {"name": "Flow", "kind": "class", "modifiers": "", "superclass": "M...
69365079_0
class MyAuthPlugin extends AuthPlugin.Adapter { @Override public void initialize( AuthProviderOperations authProviderOperations ) { api = authProviderOperations; api.log().info( "initialized!" ); loadConfig(); } @Override public AuthInfo authenticateAndAuthorize( AuthToken...
// Given MyAuthPlugin plugin = new MyAuthPlugin(); AuthProviderOperations api = mock( AuthProviderOperations.class ); AuthProviderOperations.Log log = mock( AuthProviderOperations.Log.class ); when( api.neo4jHome() ).thenReturn( Paths.get( "" ) ); when( api.log() ).thenR...
[FOCAL] @Override public void MyAuthPlugin.initialize(AuthProviderOperations authProviderOperations) [CLASS] class MyAuthPlugin extends AuthPlugin.Adapter [METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void loadConfig() [CALLS-EXTERNAL] api.log().info/1, api.log/0 [COLLABORATORS] ...
/* static context [FOCAL] @Override public void MyAuthPlugin.initialize(AuthProviderOperations authProviderOperations) [COLLABORATORS] field api log/0 [CALLS-INTERNAL] void loadConfig() [CALLS-EXTERNAL] api.log().info/1, api.log/0 */
/* static context [FOCAL] @Override public void MyAuthPlugin.initialize(AuthProviderOperations authProviderOperations) [COLLABORATORS] field api log/0 [CALLS-INTERNAL] void loadConfig() [CALLS-EXTERNAL] api.log().info/1, api.log/0 */ class MyAuthPlugin extends AuthPlugin.Adapter { @Override public void initial...
true
ok
{"focal": {"class": "MyAuthPlugin", "name": "initialize", "signature": "void initialize(AuthProviderOperations authProviderOperations)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "authProviderOperations", "type": "AuthProviderOperations"}], "return_type": "void"}, "class_info": {"name": "MyA...
69381318_1
class AvroDeserializer implements Deserializer<T> { @SuppressWarnings("unchecked") @Override public T deserialize(String topic, byte[] data) { LOGGER.debug("data to deserialize='{}'", DatatypeConverter.printHexBinary(data)); try { // get the schema Schema schema = targetType.newInstance().get...
User user = User.newBuilder().setName("John Doe").setFavoriteColor("green") .setFavoriteNumber(null).build(); byte[] data = DatatypeConverter.parseHexBinary("104A6F686E20446F6502000A677265656E"); AvroDeserializer<User> avroDeserializer = new AvroDeserializer<>(User.class); assertThat(avroDeser...
[FOCAL] @SuppressWarnings("unchecked") @Override public T AvroDeserializer.deserialize(String topic, byte[] data) [CLASS] class AvroDeserializer implements Deserializer<T> [METRICS] loc=19 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] LOGGER.debug/2, DatatypeConverter.printHexBinary/1, targetTyp...
/* static context [FOCAL] @SuppressWarnings("unchecked") @Override public T AvroDeserializer.deserialize(String topic, byte[] data) [THROWS-WHEN] SerializationException when try-body throws [PATH1] try-body throws -> throw new SerializationException( "Can't deserialize data [" + Arrays.toS... [PATH2] return result [INP...
/* static context [FOCAL] @SuppressWarnings("unchecked") @Override public T AvroDeserializer.deserialize(String topic, byte[] data) [THROWS-WHEN] SerializationException when try-body throws [PATH1] try-body throws -> throw new SerializationException( "Can't deserialize data [" + Arrays.toS... [PATH2] return result [INP...
true
ok
{"focal": {"class": "AvroDeserializer", "name": "deserialize", "signature": "T deserialize(String topic, byte[] data)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") @Override public", "params": [{"name": "topic", "type": "String"}, {"name": "data", "type": "byte[]"}], "return_type": "T"}, "class_info...
69400326_689
class KsqlRestApplication implements Executable { @VisibleForTesting void startKsql(final KsqlConfig ksqlConfigWithPort) { waitForPreconditions(); initialize(ksqlConfigWithPort); } @VisibleForTesting KsqlRestApplication( // CHECKSTYLE_RULES.ON: ParameterNumberCheck final ServiceContext se...
// When: app.startKsql(ksqlConfig); // Then: final InOrder inOrder = Mockito.inOrder(ksqlResource, serverState); verify(ksqlResource).handleKsqlStatements( securityContextArgumentCaptor.capture(), eq(new KsqlRequest(logCreateStatement, Collections.emptyMap(), Collections.emptyMap(),...
[FOCAL] @VisibleForTesting void KsqlRestApplication.startKsql(KsqlConfig ksqlConfigWithPort) [CLASS] class KsqlRestApplication implements Executable [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void initialize(KsqlConfig configWithApplicationServer); void waitForPreconditions() ...
class KsqlRestApplication implements Executable { @VisibleForTesting void startKsql(final KsqlConfig ksqlConfigWithPort) { waitForPreconditions(); initialize(ksqlConfigWithPort); } @VisibleForTesting KsqlRestApplication( // CHECKSTYLE_RULES.ON: ParameterNumberCheck final ServiceContext se...
false
ok
{"focal": {"class": "KsqlRestApplication", "name": "startKsql", "signature": "void startKsql(KsqlConfig ksqlConfigWithPort)", "start_line": 3, "modifiers": "@VisibleForTesting", "params": [{"name": "ksqlConfigWithPort", "type": "KsqlConfig"}], "return_type": "void"}, "class_info": {"name": "KsqlRestApplication", "kind"...
69403823_0
class MaterialActivityChooserBuilder { public void show() { if (mIntent == null || mIntent.getAction() == null) { Log.e(TAG, "Cannot show the share screen - intent is missing or has no action."); return; } Intent materialShareIntent = new Intent(mContext, mActivityCl...
//when builder.show(); //then verifyZeroInteractions(mockContext); } }
[FOCAL] public void MaterialActivityChooserBuilder.show() [CLASS] class MaterialActivityChooserBuilder [METRICS] loc=46 cc=14 branches=12 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] boolean isIncompatibleIntent(Intent secondaryIntent) [CALLS-EXTERNAL] mIntent.getAction/0, Log.e/2, Intent.putExtra/2, secondary...
/* static context [FOCAL] public void MaterialActivityChooserBuilder.show() [PATH1] if(mIntent == null || mIntent.getAction() == null)=F -> if(mTitle != null)=T -> if(mTitleResourceId != 0)=T -> if(mCustomEmptyViewLayoutResourceId != 0)=T -> if(mEmptyViewTitle != null)=T -> if(mEmptyViewTitleResourceId != 0)=T -> if(mE...
/* static context [FOCAL] public void MaterialActivityChooserBuilder.show() [PATH1] if(mIntent == null || mIntent.getAction() == null)=F -> if(mTitle != null)=T -> if(mTitleResourceId != 0)=T -> if(mCustomEmptyViewLayoutResourceId != 0)=T -> if(mEmptyViewTitle != null)=T -> if(mEmptyViewTitleResourceId != 0)=T -> if(mE...
true
ok
{"focal": {"class": "MaterialActivityChooserBuilder", "name": "show", "signature": "void show()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "MaterialActivityChooserBuilder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"...
69469299_29
class WebSocketSubscriptionTransport implements SubscriptionTransport { @Override public void send(OperationClientMessage message) { WebSocket socket = webSocket.get(); if (socket == null) { callback.onFailure(new IllegalStateException("Send attempted on closed connection")); return; } ...
final AtomicReference<Throwable> callbackFailure = new AtomicReference<>(); subscriptionTransport = new WebSocketSubscriptionTransport(webSocketRequest, webSocketFactory, new SubscriptionTransport.Callback() { @Override public void onConnected() { } @Override public void onFailure(Throwable ...
[FOCAL] @Override public void WebSocketSubscriptionTransport.send(OperationClientMessage message) [CLASS] class WebSocketSubscriptionTransport implements SubscriptionTransport [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] webSocket.get/0, callback.onFailure/1, WebSocket.send/1, O...
/* static context [FOCAL] @Override public void WebSocketSubscriptionTransport.send(OperationClientMessage message) [PATH1] if(socket == null)=T -> return [PATH2] if(socket == null)=F [COLLABORATORS] field webSocket get/0; field callback onFailure/1; param message:OperationClientMessage toJsonString/0 [NEW] IllegalStat...
/* static context [FOCAL] @Override public void WebSocketSubscriptionTransport.send(OperationClientMessage message) [PATH1] if(socket == null)=T -> return [PATH2] if(socket == null)=F [COLLABORATORS] field webSocket get/0; field callback onFailure/1; param message:OperationClientMessage toJsonString/0 [NEW] IllegalStat...
true
ok
{"focal": {"class": "WebSocketSubscriptionTransport", "name": "send", "signature": "void send(OperationClientMessage message)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "message", "type": "OperationClientMessage"}], "return_type": "void"}, "class_info": {"name": "WebSocketSubscriptionTransp...
69571507_52
class UDPMessageEncoder { static void writeJson(Span span, Buffer buffer) throws IOException { JsonWriter writer = JsonWriter.of(buffer); writer.beginObject(); writer.name("trace_id"); writer.value(new Buffer() .writeByte('"') .writeByte('1') // version .writeByte('-') ...
Span span = serverSpan.toBuilder() .kind(Span.Kind.CLIENT) .name("get /") .localEndpoint(Endpoint.newBuilder().serviceName("master").build()) .build(); String json = writeJson(span); assertThat(readString(json, "name")).isEqualTo("get /"); } }
[FOCAL] static void UDPMessageEncoder.writeJson(Span span, Buffer buffer) [CLASS] class UDPMessageEncoder [METRICS] loc=298 cc=77 branches=55 loops=3 returns=0 throws=0 nesting=4 [CALLS-EXTERNAL] JsonWriter.of/1, JsonWriter.beginObject/0, JsonWriter.name/1, JsonWriter.value/1, new Buffer() .writeByte('"') .writeByte('1...
class UDPMessageEncoder { static void writeJson(Span span, Buffer buffer) throws IOException { JsonWriter writer = JsonWriter.of(buffer); writer.beginObject(); writer.name("trace_id"); writer.value(new Buffer() .writeByte('"') .writeByte('1') // version .writeByte('-') ...
false
ok
{"focal": {"class": "UDPMessageEncoder", "name": "writeJson", "signature": "void writeJson(Span span, Buffer buffer) throws IOException", "start_line": 3, "modifiers": "static", "params": [{"name": "span", "type": "Span"}, {"name": "buffer", "type": "Buffer"}], "return_type": "void"}, "class_info": {"name": "UDPMessage...
69595482_13
class JdbcStorage implements IStorage { @Override public Collection<LinkedAccount> listLinkedAccounts(String userId) throws StorageException { logger.debug("Getting a list of all Linked Accounts for {}.", userId); try { return this.jdbi.withHandle( handle -> { String...
Collection<LinkedAccount> designs = storage.listLinkedAccounts("user"); Assert.assertNotNull(designs); Assert.assertEquals(0, designs.size()); LinkedAccount account = new LinkedAccount(); Date now = new Date(); account.setType(LinkedAccountType.Bitbucket); ...
[FOCAL] @Override public Collection<LinkedAccount> JdbcStorage.listLinkedAccounts(String userId) [CLASS] class JdbcStorage implements IStorage [METRICS] loc=15 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] logger.debug/2, this.jdbi.withHandle/1, sqlStatements.selectLinkedAccounts/0, handle.creat...
/* static context [FOCAL] @Override public Collection<LinkedAccount> JdbcStorage.listLinkedAccounts(String userId) [THROWS-WHEN] StorageException when try-body throws [PATH1] try-body throws -> throw new StorageException("Error listing linked accounts.", e) [PATH2] return this.jdbi.withHandle( handle -> { String statem...
/* static context [FOCAL] @Override public Collection<LinkedAccount> JdbcStorage.listLinkedAccounts(String userId) [THROWS-WHEN] StorageException when try-body throws [PATH1] try-body throws -> throw new StorageException("Error listing linked accounts.", e) [PATH2] return this.jdbi.withHandle( handle -> { String statem...
true
ok
{"focal": {"class": "JdbcStorage", "name": "listLinkedAccounts", "signature": "Collection<LinkedAccount> listLinkedAccounts(String userId) throws StorageException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "userId", "type": "String"}], "return_type": "Collection<LinkedAccount>"}, "class_inf...
69602447_2
class WekaScoring extends BaseStep implements StepInterface { private WekaScoringModel setModel( String modelFileName ) throws KettleException { // Load the model WekaScoringModel model = null; try { model = WekaScoringData.loadSerializedModel( modelFileName, getLogChannel(), this ); m_data....
WekaScoringModel model = WekaScoringData.loadSerializedModel( CLUSTERING_MODEL, null, new Variables()); assertTrue(model != null); WekaScoringMeta meta = new WekaScoringMeta(); meta.setModel(model); RowMetaInterface rmi = new RowMeta(); meta.getFields(rmi, null, null, null, new Varia...
[FOCAL] private WekaScoringModel WekaScoring.setModel(String modelFileName) [CLASS] class WekaScoring extends BaseStep implements StepInterface [METRICS] loc=18 cc=3 branches=1 loops=0 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] WekaScoringData.loadSerializedModel/3, getLogChannel/0 (inherited), m_data.setModel/1, m_...
/* static context [FOCAL] private WekaScoringModel WekaScoring.setModel(String modelFileName) [THROWS-WHEN] KettleException when try-body throws [PATH1] try-body throws -> throw new KettleException( BaseMessages.getString( WekaScoringMeta.PKG, "... [PATH2] if(m_meta.getFileNameFromField())=T -> return model [PATH3] if(...
/* static context [FOCAL] private WekaScoringModel WekaScoring.setModel(String modelFileName) [THROWS-WHEN] KettleException when try-body throws [PATH1] try-body throws -> throw new KettleException( BaseMessages.getString( WekaScoringMeta.PKG, "... [PATH2] if(m_meta.getFileNameFromField())=T -> return model [PATH3] if(...
true
ok
{"focal": {"class": "WekaScoring", "name": "setModel", "signature": "WekaScoringModel setModel(String modelFileName) throws KettleException", "start_line": 3, "modifiers": "private", "params": [{"name": "modelFileName", "type": "String"}], "return_type": "WekaScoringModel"}, "class_info": {"name": "WekaScoring", "kind"...
69678968_0
class PredictG extends Predict<BaseInformationRecords.BaseInformation> { public static String codeGT(Set<String> to, String from, SortedSet<String> altSet) { IntArrayList codedAlleles = new IntArrayList(); String result = ""; for (String allele : to) { if (from.equals(allele)) ...
SortedSet<String> alts = new ObjectAVLTreeSet<>(); alts.add("G"); Set<String> to = new ObjectArraySet<>(); to.add("G"); to.add("C"); //to = G/C assertEquals("0/1", PredictG.codeGT(to, "C", alts)); to.remove("C"); //to = G/G assertEquals("1"...
[FOCAL] public static String PredictG.codeGT(Set<String> to, String from, SortedSet<String> altSet) [CLASS] class PredictG extends Predict<BaseInformationRecords.BaseInformation> [METRICS] loc=32 cc=8 branches=4 loops=3 returns=2 throws=0 nesting=3 [CALLS-EXTERNAL] String.equals/1, IntArrayList.add/1, IntArrayList.size...
/* static context [FOCAL] public static String PredictG.codeGT(Set<String> to, String from, SortedSet<String> altSet) [PATH1] foreach(String allele : to)=T -> if(from.equals(allele))=T -> foreach(String altAllele : altSet)=T -> if(altAllele.equals(allele))=T -> exit loop -> exit loop -> if(codedAlleles.size() > 0)=T ->...
/* static context [FOCAL] public static String PredictG.codeGT(Set<String> to, String from, SortedSet<String> altSet) [PATH1] foreach(String allele : to)=T -> if(from.equals(allele))=T -> foreach(String altAllele : altSet)=T -> if(altAllele.equals(allele))=T -> exit loop -> exit loop -> if(codedAlleles.size() > 0)=T ->...
true
ok
{"focal": {"class": "PredictG", "name": "codeGT", "signature": "String codeGT(Set<String> to, String from, SortedSet<String> altSet)", "start_line": 3, "modifiers": "public static", "params": [{"name": "to", "type": "Set<String>"}, {"name": "from", "type": "String"}, {"name": "altSet", "type": "SortedSet<String>"}], "r...
69755813_0
class OffersInteractorImpl implements OffersInteractor { @Override public Observable<OfferResponse> loadOffers(int page, String format, int applicationId, String userI...
TestSubscriber<OfferResponse> testSubscriber = new TestSubscriber<>(); // call interactor with some random params interactor.loadOffers(1, Constants.FORMAT_JSON, 2, "userId", "local", "osVersion", 3, "adId", true, "ip", "pub0", Constants.OFFER_TYPES, "device", "apiKey") .subscri...
[FOCAL] @Override public Observable<OfferResponse> OffersInteractorImpl.loadOffers(int page, String format, int applicationId, String userId, String locale, String osVersion, long timestamp, String googleAdId, boolean googleAdIdLimitedTrackingEnabled, String ip, String pub0, int offerTypes, String device, String apiKey...
/* static context [FOCAL] @Override public Observable<OfferResponse> OffersInteractorImpl.loadOffers(int page, String format, int applicationId, String userId, String locale, String osVersion, long timestamp, String googleAdId, boolean googleAdIdLimitedTrackingEnabled, String ip, String pub0, int offerTypes, String dev...
/* static context [FOCAL] @Override public Observable<OfferResponse> OffersInteractorImpl.loadOffers(int page, String format, int applicationId, String userId, String locale, String osVersion, long timestamp, String googleAdId, boolean googleAdIdLimitedTrackingEnabled, String ip, String pub0, int offerTypes, String dev...
true
ok
{"focal": {"class": "OffersInteractorImpl", "name": "loadOffers", "signature": "Observable<OfferResponse> loadOffers(int page, String format, int applicationId, String userId, String locale, String osVersion, long timestamp, String googleAdId, boolean googleAdIdLimitedTrackingEnabled, String ip, String pub0, int offerT...
69791298_0
class MockApi { public List<String> getPredictions(String query) { if (query.length() > 0) { int amountOfResults = 8; return generatePredictions(amountOfResults, query); } return new ArrayList<>(); } protected List<String> generatePredictions(int amountOfR...
MockApi api = new MockApi(); List<String> predictions = api.generatePredictions(5, "a"); assertEquals("abcde", predictions.get(0)); assertEquals("a", predictions.get(predictions.size() - 1)); } }
[FOCAL] public List<String> MockApi.getPredictions(String query) [CLASS] class MockApi [METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] List<String> generatePredictions(int amountOfResults, String query) [CALLS-EXTERNAL] String.length/0 [NEW] ArrayList<> [PATH1] if(query.length() > ...
/* static context [FOCAL] public List<String> MockApi.getPredictions(String query) [PATH1] if(query.length() > 0)=T -> return generatePredictions(amountOfResults, query) [PATH2] if(query.length() > 0)=F -> return new ArrayList<>() [INPUTS] branches=query | result=query [CALLS-INTERNAL] List<String> generatePredictions(...
/* static context [FOCAL] public List<String> MockApi.getPredictions(String query) [PATH1] if(query.length() > 0)=T -> return generatePredictions(amountOfResults, query) [PATH2] if(query.length() > 0)=F -> return new ArrayList<>() [INPUTS] branches=query | result=query [CALLS-INTERNAL] List<String> generatePredictions(...
true
ok
{"focal": {"class": "MockApi", "name": "getPredictions", "signature": "List<String> getPredictions(String query)", "start_line": 3, "modifiers": "public", "params": [{"name": "query", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "MockApi", "kind": "class", "modifiers": "", "superclass": nu...
69807495_8
class CartService { public Single<Cart> addProduct(CartProduct cartProduct) { return cartDataSource.addProduct(cartProduct) .compose(cartPublisher()); } public CartService(CartDataSource cartDataSource, CartStore cartStore); public Observable<Cart> getCart(); public Singl...
CartProduct product = CartProductFactory.newCartProduct(ProductFakeCreator.createProduct(), 1); when(cartDataSource.addProduct(any(CartProduct.class))).thenReturn(Single.just(Cart.EMPTY)); cartService.addProduct(product) .test() .assertComplete(); verify...
[FOCAL] public Single<Cart> CartService.addProduct(CartProduct cartProduct) [CLASS] class CartService [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] SingleTransformer<Cart, Cart> cartPublisher() [CALLS-EXTERNAL] cartDataSource.addProduct(cartProduct).compose/1, CartDataSource.addP...
/* static context [FOCAL] public Single<Cart> CartService.addProduct(CartProduct cartProduct) [INPUTS] branches=- | result=cartProduct, cartDataSource [COLLABORATORS] field cartDataSource:CartDataSource addProduct/1 [CALLS-INTERNAL] SingleTransformer<Cart, Cart> cartPublisher() [FIELDS] read=cartDataSource:CartDataSour...
/* static context [FOCAL] public Single<Cart> CartService.addProduct(CartProduct cartProduct) [INPUTS] branches=- | result=cartProduct, cartDataSource [COLLABORATORS] field cartDataSource:CartDataSource addProduct/1 [CALLS-INTERNAL] SingleTransformer<Cart, Cart> cartPublisher() [FIELDS] read=cartDataSource:CartDataSour...
true
ok
{"focal": {"class": "CartService", "name": "addProduct", "signature": "Single<Cart> addProduct(CartProduct cartProduct)", "start_line": 3, "modifiers": "public", "params": [{"name": "cartProduct", "type": "CartProduct"}], "return_type": "Single<Cart>"}, "class_info": {"name": "CartService", "kind": "class", "modifiers"...
69926042_13
class ContentContainer implements Iterable<Content> { public boolean hasSubContainers() { return (mContentContainers.size() != 0); } public ContentContainer(); public ContentContainer(String name); public static ContentContainer newInstance(String name); public ContentContainer add...
ContentContainer cc = new ContentContainer(); cc.addContentContainer(ContentContainer.newInstance("subTest")); // Test if container has sub containers. assertTrue(cc.hasSubContainers()); } }
[FOCAL] public boolean ContentContainer.hasSubContainers() [CLASS] class ContentContainer implements Iterable<Content> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] mContentContainers.size/0 [COLLABORATORS] field mContentContainers size/0 [CLASS-MEMBERS] ContentContainer(); Conte...
/* static context [FOCAL] public boolean ContentContainer.hasSubContainers() [COLLABORATORS] field mContentContainers size/0 [CALLS-EXTERNAL] mContentContainers.size/0 */
/* static context [FOCAL] public boolean ContentContainer.hasSubContainers() [COLLABORATORS] field mContentContainers size/0 [CALLS-EXTERNAL] mContentContainers.size/0 */ class ContentContainer implements Iterable<Content> { public boolean hasSubContainers() { return (mContentContainers.size() != 0); ...
true
ok
{"focal": {"class": "ContentContainer", "name": "hasSubContainers", "signature": "boolean hasSubContainers()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "ContentContainer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Iterable<Content...
70037033_23
class AuxiliaryInfoUtil { public static String getWordPart(String wordAndAux) { int idx = getSeparatorIndex(wordAndAux); return idx == 0 ? " " : wordAndAux.substring(0, idx); } public static int getSeparatorIndex(String wordAndAux); public static String[] getWordParts(String[] wordAndAuxes); public ...
Assert.assertEquals(" ", AuxiliaryInfoUtil.getWordPart("/POStag")); Assert.assertEquals("1", AuxiliaryInfoUtil.getWordPart("1/POStag")); Assert.assertEquals("word", AuxiliaryInfoUtil.getWordPart("word/POStag")); Assert.assertEquals("word/stuff", AuxiliaryInfoUtil.getWordPart("word/stuff/POStag")); } ...
[FOCAL] public static String AuxiliaryInfoUtil.getWordPart(String wordAndAux) [CLASS] class AuxiliaryInfoUtil [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int getSeparatorIndex(String wordAndAux) [CALLS-EXTERNAL] String.substring/2 [INPUTS] branches=- | result=wordAndAux [DATAFL...
/* static context [FOCAL] public static String AuxiliaryInfoUtil.getWordPart(String wordAndAux) [INPUTS] branches=- | result=wordAndAux [CALLS-INTERNAL] int getSeparatorIndex(String wordAndAux) [CALLS-EXTERNAL] String.substring/2 */
/* static context [FOCAL] public static String AuxiliaryInfoUtil.getWordPart(String wordAndAux) [INPUTS] branches=- | result=wordAndAux [CALLS-INTERNAL] int getSeparatorIndex(String wordAndAux) [CALLS-EXTERNAL] String.substring/2 */ class AuxiliaryInfoUtil { public static String getWordPart(String wordAndAux) { ...
true
ok
{"focal": {"class": "AuxiliaryInfoUtil", "name": "getWordPart", "signature": "String getWordPart(String wordAndAux)", "start_line": 3, "modifiers": "public static", "params": [{"name": "wordAndAux", "type": "String"}], "return_type": "String"}, "class_info": {"name": "AuxiliaryInfoUtil", "kind": "class", "modifiers": "...
70037034_10
class ContextFreeGrammar { public String[] leftMostDerivation(String... words) { ArrayList<String> expansion = new ArrayList<String>(words.length); assert words.length > 0 && startSymbol.equals(words[0]); for (String word : words) { expansion.addAll(getTerminals(word)); } return expansion...
ContextFreeGrammar contextFreeGrammar = new ContextFreeGrammar(nonTerminals, terminals, rules, startSymbol); String[] expansion = contextFreeGrammar.leftMostDerivation("S", "CJ", "S"); assertArrayEquals(new String[]{"the", "man", "works", "and", "the", "man", "works"}, expansion); checkExpansion(expansi...
[FOCAL] public String[] ContextFreeGrammar.leftMostDerivation(String... words) [CLASS] class ContextFreeGrammar [METRICS] loc=11 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Collection<String> getTerminals(String word) [CALLS-EXTERNAL] String.equals/1, ArrayList<String>.addAll/1, ArrayList<Stri...
/* static context [FOCAL] public String[] ContextFreeGrammar.leftMostDerivation(String... words) [PATH1] foreach(String word : words)=T -> exit loop -> return expansion.toArray(new String[expansion.size()]) [PATH2] foreach(String word : words)=F -> return expansion.toArray(new String[expansion.size()]) [INPUTS] branche...
/* static context [FOCAL] public String[] ContextFreeGrammar.leftMostDerivation(String... words) [PATH1] foreach(String word : words)=T -> exit loop -> return expansion.toArray(new String[expansion.size()]) [PATH2] foreach(String word : words)=F -> return expansion.toArray(new String[expansion.size()]) [INPUTS] branche...
true
ok
{"focal": {"class": "ContextFreeGrammar", "name": "leftMostDerivation", "signature": "String[] leftMostDerivation(String... words)", "start_line": 3, "modifiers": "public", "params": [{"name": "words", "type": "String..."}], "return_type": "String[]"}, "class_info": {"name": "ContextFreeGrammar", "kind": "class", "modi...
70038531_27
class AlertTemplateValidator implements Validator<AlertTemplate> { @Override public void validate(AlertTemplate template) throws ValidationException { if (template.getDestination() == null || template.getDestination().trim().isEmpty()) { throw new ValidationException("Alert target can't be empty"); } if (te...
AlertTemplateValidator validator = new AlertTemplateValidator(); AlertTemplate template = new AlertTemplate((short)2); template.setMedia("slack"); template.setSubject("hello"); template.setBody("hello $x"); template.setTemplateName("Template"); template.setDestination("ABC@slack-channel"); try { vali...
[FOCAL] @Override public void AlertTemplateValidator.validate(AlertTemplate template) [CLASS] class AlertTemplateValidator implements Validator<AlertTemplate> [METRICS] loc=55 cc=20 branches=15 loops=2 returns=0 throws=12 nesting=4 [CALLS-EXTERNAL] AlertTemplate.getDestination/0, template.getDestination().trim().isEmpt...
/* static context [FOCAL] @Override public void AlertTemplateValidator.validate(AlertTemplate template) [THROWS-WHEN] ValidationException when template.getDestination() == null || template.getDestination().trim().isEmpty() [THROWS-WHEN] ValidationException when !(template.getDestination() == null || template.getDestina...
/* static context [FOCAL] @Override public void AlertTemplateValidator.validate(AlertTemplate template) [THROWS-WHEN] ValidationException when template.getDestination() == null || template.getDestination().trim().isEmpty() [THROWS-WHEN] ValidationException when !(template.getDestination() == null || template.getDestina...
true
ok
{"focal": {"class": "AlertTemplateValidator", "name": "validate", "signature": "void validate(AlertTemplate template) throws ValidationException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "template", "type": "AlertTemplate"}], "return_type": "void"}, "class_info": {"name": "AlertTemplateVal...
70062587_21
class ImageService { public static boolean bufferedImagesEqualQuick(BufferedImage image1, BufferedImage image2) { DataBuffer dataBuffer1 = image1.getRaster().getDataBuffer(); DataBuffer dataBuffer2 = image2.getRaster().getDataBuffer(); if (dataBuffer1 instanceof DataBufferByte && dataBuffer...
final BufferedImage image1 = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_INDEXED); final BufferedImage image2 = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_INDEXED); boolean result = ImageService.bufferedImagesEqualQuick(image1, image2); assertThat(result, is(true)); ...
[FOCAL] public static boolean ImageService.bufferedImagesEqualQuick(BufferedImage image1, BufferedImage image2) [CLASS] class ImageService [METRICS] loc=28 cc=7 branches=4 loops=2 returns=4 throws=0 nesting=4 [CALLS-EXTERNAL] image1.getRaster().getDataBuffer/0, BufferedImage.getRaster/0, image2.getRaster().getDataBuffe...
/* static context [FOCAL] public static boolean ImageService.bufferedImagesEqualQuick(BufferedImage image1, BufferedImage image2) [PATH1] if(dataBuffer1 instanceof DataBufferByte && dataBuffer2 instanceof DataBufferByte)=F -> if(dataBuffer1 instanceof DataBufferInt && dataBuffer2 instanceof DataBufferInt)=T -> for(bank...
/* static context [FOCAL] public static boolean ImageService.bufferedImagesEqualQuick(BufferedImage image1, BufferedImage image2) [PATH1] if(dataBuffer1 instanceof DataBufferByte && dataBuffer2 instanceof DataBufferByte)=F -> if(dataBuffer1 instanceof DataBufferInt && dataBuffer2 instanceof DataBufferInt)=T -> for(bank...
true
ok
{"focal": {"class": "ImageService", "name": "bufferedImagesEqualQuick", "signature": "boolean bufferedImagesEqualQuick(BufferedImage image1, BufferedImage image2)", "start_line": 3, "modifiers": "public static", "params": [{"name": "image1", "type": "BufferedImage"}, {"name": "image2", "type": "BufferedImage"}], "retur...
70140762_12
class Order implements Serializable { public BigDecimal getTotalSum() { return getItemPriceSum(); } public Order(long orderId, ObjectId userId, List<OrderItem> orderItems, DeliveryAddress deliveryAddress, String sessionId); public Order(); public long getOrderId(); public void setOr...
//double globalDiscount = Double.parseDouble(Config.getProperty("GLOBAL_DISCOUNT")); double globalDiscount = 0; double total = 10.0 - (10.0 * (globalDiscount/100.0)); assertEquals(BigDecimal.valueOf(total).compareTo(order.getTotalSum()), 0); } }
[FOCAL] public BigDecimal Order.getTotalSum() [CLASS] class Order implements Serializable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] BigDecimal getItemPriceSum() [CLASS-MEMBERS] Order(long orderId, ObjectId userId, List<OrderItem> orderItems, DeliveryAddress deliveryAddress, S...
/* static context [FOCAL] public BigDecimal Order.getTotalSum() [CALLS-INTERNAL] BigDecimal getItemPriceSum() */
/* static context [FOCAL] public BigDecimal Order.getTotalSum() [CALLS-INTERNAL] BigDecimal getItemPriceSum() */ class Order implements Serializable { public BigDecimal getTotalSum() { return getItemPriceSum(); } public Order(long orderId, ObjectId userId, List<OrderItem> orderItems, DeliveryAddr...
true
ok
{"focal": {"class": "Order", "name": "getTotalSum", "signature": "BigDecimal getTotalSum()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "BigDecimal"}, "class_info": {"name": "Order", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serializable", "fields": [{"name": "order"...
70146477_40
class BootstrapReplicator { public void run(AtomicBoolean bootstrapInProgress) { if ((boolean) configuration.get(Augmenter.Configuration.BOOTSTRAP) == false) { LOG.info("Skipping active schema bootstrapping"); bootstrapInProgress.set(false); return; } LO...
HashMap<String, Object> configuration = new HashMap<>(); configuration.put(BinaryLogSupplier.Configuration.MYSQL_HOSTNAME, Collections.singletonList(BootstrapReplicatorTest.mysqlBinaryLog.getHost())); configuration.put(BinaryLogSupplier.Configuration.MYSQL_PORT, String.valueOf(BootstrapReplicat...
[FOCAL] public void BootstrapReplicator.run(AtomicBoolean bootstrapInProgress) [CLASS] class BootstrapReplicator [METRICS] loc=66 cc=7 branches=4 loops=1 returns=1 throws=1 nesting=3 [CALLS-EXTERNAL] configuration.get/1, LOG.info/1, AtomicBoolean.set/1, ActiveSchemaManager.createDbIfNotExists/1, Objects.requireNonNull/...
/* static context [FOCAL] public void BootstrapReplicator.run(AtomicBoolean bootstrapInProgress) [THROWS-WHEN] IllegalStateException when !((boolean) configuration.get(Augmenter.Configuration.BOOTSTRAP) == false) && !dbCreated [COLLABORATORS] field configuration get/1; param bootstrapInProgress:AtomicBoolean set/1 */
/* static context [FOCAL] public void BootstrapReplicator.run(AtomicBoolean bootstrapInProgress) [THROWS-WHEN] IllegalStateException when !((boolean) configuration.get(Augmenter.Configuration.BOOTSTRAP) == false) && !dbCreated [COLLABORATORS] field configuration get/1; param bootstrapInProgress:AtomicBoolean set/1 */ c...
true
ok
{"focal": {"class": "BootstrapReplicator", "name": "run", "signature": "void run(AtomicBoolean bootstrapInProgress)", "start_line": 3, "modifiers": "public", "params": [{"name": "bootstrapInProgress", "type": "AtomicBoolean"}], "return_type": "void"}, "class_info": {"name": "BootstrapReplicator", "kind": "class", "modi...
70147050_0
class Property implements Serializable, KeyValuePair { @JsonIgnore public boolean equals(final Object o) { // check if property attributes are equal. if (o == null || !(o instanceof Property)) { return false; } Property compare = (Property)o; try { System.out.pr...
Property p1 = new Property("test", "testString"); Property p2 = new Property("test", "testString"); Assert.assertFalse(p1 == p2); Assert.assertFalse(p1.equals(null)); Assert.assertEquals(p1,p2); } }
[FOCAL] @JsonIgnore public boolean Property.equals(Object o) [CLASS] class Property implements Serializable, KeyValuePair [METRICS] loc=28 cc=4 branches=2 loops=0 returns=4 throws=0 nesting=2 [CALLS-INTERNAL] Object getValue(); String getName(); boolean hasPropertyTheSameDescriptors(Property compare) [CALLS-EXTERNAL] S...
/* static context [FOCAL] @JsonIgnore public boolean Property.equals(Object o) [PATH1] if(o == null || !(o instanceof Property))=F -> try-body throws -> return false [PATH2] if(o == null || !(o instanceof Property))=F -> if(!(this.getName().equals(compare.getName()) && this.getValue().equals(compare.getValue())))=F -> ...
/* static context [FOCAL] @JsonIgnore public boolean Property.equals(Object o) [PATH1] if(o == null || !(o instanceof Property))=F -> try-body throws -> return false [PATH2] if(o == null || !(o instanceof Property))=F -> if(!(this.getName().equals(compare.getName()) && this.getValue().equals(compare.getValue())))=F -> ...
true
ok
{"focal": {"class": "Property", "name": "equals", "signature": "boolean equals(Object o)", "start_line": 3, "modifiers": "@JsonIgnore public", "params": [{"name": "o", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "Property", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "S...
70162405_11
class ExportHCatTable { public static String generateSqlForExportSpec(ExaMetadata meta, ExaExportSpecification exportSpec) { // Mandatory parameters Map<String, String> params = exportSpec.getParameters(); String hcatDB = getMandatoryParameter(params, "HCAT_DB"); String hcatTable =...
ExaExportSpecification exportSpec = mock(ExaExportSpecification.class); ExaMetadata meta = mock(ExaMetadata.class); when(meta.getScriptSchema()).thenReturn("hcat_schema"); Map<String, String> params = new HashMap<>(); addMandatoryParams(params); params.put("COMPRESSION_...
[FOCAL] public static String ExportHCatTable.generateSqlForExportSpec(ExaMetadata meta, ExaExportSpecification exportSpec) [CLASS] class ExportHCatTable [METRICS] loc=134 cc=12 branches=7 loops=1 returns=1 throws=4 nesting=3 [CALLS-INTERNAL] ExaConnectionInformation getJdbcConnection(ExaMetadata meta, String jdbcConnec...
class ExportHCatTable { public static String generateSqlForExportSpec(ExaMetadata meta, ExaExportSpecification exportSpec) { // Mandatory parameters Map<String, String> params = exportSpec.getParameters(); String hcatDB = getMandatoryParameter(params, "HCAT_DB"); String hcatTable =...
false
ok
{"focal": {"class": "ExportHCatTable", "name": "generateSqlForExportSpec", "signature": "String generateSqlForExportSpec(ExaMetadata meta, ExaExportSpecification exportSpec)", "start_line": 3, "modifiers": "public static", "params": [{"name": "meta", "type": "ExaMetadata"}, {"name": "exportSpec", "type": "ExaExportSpec...
70189011_6
class ConfigurationKeyProcessor extends AbstractProcessor { static String calculateConfigurationBeanName(String className, String configurationBeanName) { if (className == null) { throw new IllegalArgumentException("Invalid class name"); } if (configurationBeanName == null || !NAME_PATTERNS.matcher(configura...
softly.assertThat(calculateConfigurationBeanName(ENUM_CLASS, "*ConfBean")).isEqualTo(ENUM_CLASS + "ConfBean"); softly.assertThat(calculateConfigurationBeanName(ENUM_CLASS, "ConfBean*")).isEqualTo("ConfBean" + ENUM_CLASS); softly.assertThat(calculateConfigurationBeanName(ENUM_CLASS, "Anno*Tation")) .isEqualTo(...
[FOCAL] static String ConfigurationKeyProcessor.calculateConfigurationBeanName(String className, String configurationBeanName) [CLASS] class ConfigurationKeyProcessor extends AbstractProcessor [METRICS] loc=9 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1 [CALLS-EXTERNAL] NAME_PATTERNS.matcher(configurationBeanNa...
/* static context [FOCAL] static String ConfigurationKeyProcessor.calculateConfigurationBeanName(String className, String configurationBeanName) [THROWS-WHEN] IllegalArgumentException when className == null [THROWS-WHEN] IllegalArgumentException when !(className == null) && configurationBeanName == null || !NAME_PATTER...
/* static context [FOCAL] static String ConfigurationKeyProcessor.calculateConfigurationBeanName(String className, String configurationBeanName) [THROWS-WHEN] IllegalArgumentException when className == null [THROWS-WHEN] IllegalArgumentException when !(className == null) && configurationBeanName == null || !NAME_PATTER...
true
ok
{"focal": {"class": "ConfigurationKeyProcessor", "name": "calculateConfigurationBeanName", "signature": "String calculateConfigurationBeanName(String className, String configurationBeanName)", "start_line": 3, "modifiers": "static", "params": [{"name": "className", "type": "String"}, {"name": "configurationBeanName", "...
70198875_4
class LottieCompositionFactory { @WorkerThread public static LottieResult<LottieComposition> fromAssetSync(Context context, String fileName) { String cacheKey = "asset_" + fileName; return fromAssetSync(context, fileName, cacheKey); } private LottieCompositionFactory(); public static void setM...
LottieResult<LottieComposition> result = LottieCompositionFactory.fromAssetSync(RuntimeEnvironment.application, "square2.json"); assertEquals(FileNotFoundException.class, result.getException().getClass()); assertNull(result.getValue()); } }
[FOCAL] @WorkerThread public static LottieResult<LottieComposition> LottieCompositionFactory.fromAssetSync(Context context, String fileName) [CLASS] class LottieCompositionFactory [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] LottieResult<LottieComposition> fromAssetSync(Context ...
/* static context [FOCAL] @WorkerThread public static LottieResult<LottieComposition> LottieCompositionFactory.fromAssetSync(Context context, String fileName) [INPUTS] branches=- | result=context, fileName [CALLS-INTERNAL] LottieResult<LottieComposition> fromAssetSync(Context context, String fileName, String cacheKey) ...
/* static context [FOCAL] @WorkerThread public static LottieResult<LottieComposition> LottieCompositionFactory.fromAssetSync(Context context, String fileName) [INPUTS] branches=- | result=context, fileName [CALLS-INTERNAL] LottieResult<LottieComposition> fromAssetSync(Context context, String fileName, String cacheKey) ...
true
ok
{"focal": {"class": "LottieCompositionFactory", "name": "fromAssetSync", "signature": "LottieResult<LottieComposition> fromAssetSync(Context context, String fileName)", "start_line": 3, "modifiers": "@WorkerThread public static", "params": [{"name": "context", "type": "Context"}, {"name": "fileName", "type": "String"}]...
70219747_191
class MCRJPAAccessStore extends MCRAccessStore { @Override public void createAccessDefinition(MCRRuleMapping rulemapping) { if (!existAccessDefinition(rulemapping.getPool(), rulemapping.getObjId())) { Session session = MCRHIBConnection.instance().getSession(); MCRACCESSRULE acc...
final String objID = "test"; final String permission = "maytest"; addRuleMapping(objID, permission, TRUE_RULE.getRid()); startNewTransaction(); assertNotNull( MCRHIBConnection.instance().getSession().get(MCRACCESS.class, new MCRACCESSPK(permission, objID))); } }
[FOCAL] @Override public void MCRJPAAccessStore.createAccessDefinition(MCRRuleMapping rulemapping) [CLASS] class MCRJPAAccessStore extends MCRAccessStore [METRICS] loc=18 cc=3 branches=2 loops=0 returns=0 throws=1 nesting=2 [CALLS-INTERNAL] MCRACCESSRULE getAccessRule(String rid); boolean existAccessDefinition(String p...
/* static context [FOCAL] @Override public void MCRJPAAccessStore.createAccessDefinition(MCRRuleMapping rulemapping) [THROWS-WHEN] NullPointerException when !existAccessDefinition(rulemapping.getPool(), rulemapping.getObjId()) && accessRule == null [PATH1] if(!existAccessDefinition(rulemapping.getPool(), rulemapping.ge...
/* static context [FOCAL] @Override public void MCRJPAAccessStore.createAccessDefinition(MCRRuleMapping rulemapping) [THROWS-WHEN] NullPointerException when !existAccessDefinition(rulemapping.getPool(), rulemapping.getObjId()) && accessRule == null [PATH1] if(!existAccessDefinition(rulemapping.getPool(), rulemapping.ge...
true
ok
{"focal": {"class": "MCRJPAAccessStore", "name": "createAccessDefinition", "signature": "void createAccessDefinition(MCRRuleMapping rulemapping)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "rulemapping", "type": "MCRRuleMapping"}], "return_type": "void"}, "class_info": {"name": "MCRJPAAccess...
70232982_0
class MainPresenter { public void getAwarenessData() { subscription.add( rxAwareness.snapshot().getHeadphoneState() .map(headphoneState -> getHeadphoneStateString(headphoneState.getState())) .subscribe(view::onHeadphoneStateLoaded, throwable -> Log.e(...
HeadphoneState headphoneState = Mockito.mock(HeadphoneState.class); doReturn(HeadphoneState.PLUGGED_IN).when(headphoneState).getState(); doReturn(Single.just(headphoneState)).when(snapshot).getHeadphoneState(); Weather weather = Mockito.mock(Weather.class); doReturn(new int[] {W...
[FOCAL] public void MainPresenter.getAwarenessData() [CLASS] class MainPresenter [METRICS] loc=23 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] String getHeadphoneStateString(int state) [CALLS-EXTERNAL] subscription.add/1, rxAwareness.snapshot().getHeadphoneState() .map(headphone....subscribe/2,...
/* static context [FOCAL] public void MainPresenter.getAwarenessData() [COLLABORATORS] field subscription add/1; field rxAwareness:RxAwareness snapshot/0,fence/0; field headphoneState getState/0; field view onHeadphoneStateLoaded/1; field weather getConditions/0 [CALLS-INTERNAL] String getHeadphoneStateString(int state...
/* static context [FOCAL] public void MainPresenter.getAwarenessData() [COLLABORATORS] field subscription add/1; field rxAwareness:RxAwareness snapshot/0,fence/0; field headphoneState getState/0; field view onHeadphoneStateLoaded/1; field weather getConditions/0 [CALLS-INTERNAL] String getHeadphoneStateString(int state...
true
ok
{"focal": {"class": "MainPresenter", "name": "getAwarenessData", "signature": "void getAwarenessData()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "MainPresenter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "rx...
70371145_13
class ObservableDispatcher extends Dispatcher<Observable<A>, Subscription> { @Override public Subscription dispatch(Observable<A> action) { return action.subscribe(dispatchAction); } public ObservableDispatcher(final Dispatcher<A, ?> dispatcher); } class ObservableDispatcherTest { @Tes...
Reducer<String, String> reducer = new Reducer<String, String>() { @Override public String reduce(String action, String state) { return action; } }; SimpleStore<String> store = new SimpleStore<>("test1"); ObservableDispatcher<String> dis...
[FOCAL] @Override public Subscription ObservableDispatcher.dispatch(Observable<A> action) [CLASS] class ObservableDispatcher extends Dispatcher<Observable<A>, Subscription> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Observable<A>.subscribe/1 [INPUTS] branches=- | result=action...
/* static context [FOCAL] @Override public Subscription ObservableDispatcher.dispatch(Observable<A> action) [INPUTS] branches=- | result=action [COLLABORATORS] param action:Observable<A> subscribe/1 [CALLS-EXTERNAL] Observable<A>.subscribe/1 */
/* static context [FOCAL] @Override public Subscription ObservableDispatcher.dispatch(Observable<A> action) [INPUTS] branches=- | result=action [COLLABORATORS] param action:Observable<A> subscribe/1 [CALLS-EXTERNAL] Observable<A>.subscribe/1 */ class ObservableDispatcher extends Dispatcher<Observable<A>, Subscription> ...
true
ok
{"focal": {"class": "ObservableDispatcher", "name": "dispatch", "signature": "Subscription dispatch(Observable<A> action)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "action", "type": "Observable<A>"}], "return_type": "Subscription"}, "class_info": {"name": "ObservableDispatcher", "kind": "c...
70444046_0
class Pagination extends HorizontalLayout { public Pagination() { } public Pagination(); public Pagination(PaginationResource paginationResource); protected void init(PaginationResource resource); public void setItemsPerPage(int... perPage); public void setTotalCount(long total); pu...
int totalCount = beans().size(); int currentPage = 6; int limit = 20; PaginationResource paginationResource = PaginationResource.newBuilder().setTotal(totalCount).setPage(currentPage).setLimit(limit).build(); init(paginationResource); setItemsPerPage(10, 20, 50, 100); ...
[FOCAL] public Pagination.Pagination() [CLASS] class Pagination extends HorizontalLayout [METRICS] loc=2 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CLASS-MEMBERS] Pagination(); Pagination(PaginationResource paginationResource); void init(PaginationResource resource); void setItemsPerPage(int... perPage); voi...
/* static context [FOCAL] public Pagination.Pagination() */
/* static context [FOCAL] public Pagination.Pagination() */ class Pagination extends HorizontalLayout { public Pagination() { } public Pagination(); public Pagination(PaginationResource paginationResource); protected void init(PaginationResource resource); public void setItemsPerPage(int......
true
ok
{"focal": {"class": "Pagination", "name": "Pagination", "signature": "Pagination()", "start_line": 3, "modifiers": "public", "params": [], "return_type": null}, "class_info": {"name": "Pagination", "kind": "class", "modifiers": "", "superclass": "HorizontalLayout", "interfaces": null, "fields": [{"name": "log", "type":...
70470785_0
class RecordDefineParser { public Table parse(String RecordDefineStr){ //TODO Auto-generated method stub return new Table(); } } class RecordDefineParserTest { @Test public void shouldTestRecordDefineParser() throws Exception{
//Arrangement String RecordDefineStr = "<Records>" + "<Field1>" + "<Name>NewTable</Name>" + "<DataType>String</DataType>" + "<Size>800</Size>" + "<Precision>5</Precision>" + ...
[FOCAL] public Table RecordDefineParser.parse(String RecordDefineStr) [CLASS] class RecordDefineParser [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] Table [INPUTS] branches=- | result=- | unused=RecordDefineStr [TEST] RecordDefineParserTest: @Test public void shouldTestRecordDefineParser() ...
/* static context [FOCAL] public Table RecordDefineParser.parse(String RecordDefineStr) [INPUTS] branches=- | result=- | unused=RecordDefineStr [NEW] Table */
/* static context [FOCAL] public Table RecordDefineParser.parse(String RecordDefineStr) [INPUTS] branches=- | result=- | unused=RecordDefineStr [NEW] Table */ class RecordDefineParser { public Table parse(String RecordDefineStr){ //TODO Auto-generated method stub return new Table(); } } class RecordD...
true
ok
{"focal": {"class": "RecordDefineParser", "name": "parse", "signature": "Table parse(String RecordDefineStr)", "start_line": 3, "modifiers": "public", "params": [{"name": "RecordDefineStr", "type": "String"}], "return_type": "Table"}, "class_info": {"name": "RecordDefineParser", "kind": "class", "modifiers": "", "super...
70515162_54
class AuthenticationService { protected Map<String, String> generateCommonIamPrincipalAuthMetadata( final String iamPrincipalArn) { Map<String, String> metadata = Maps.newHashMap(); metadata.put(CerberusPrincipal.METADATA_KEY_USERNAME, iamPrincipalArn); metadata.put(CerberusPrincipal.METADATA_KEY_I...
authenticationService.adminRoleArns = "arn:aws:iam::0000000000:role/admin"; String principalArn = "arn:aws:sts::0000000000:assumed-role/admin/role-session"; String iamRoleArn = "arn:aws:iam::0000000000:role/admin"; when(awsIamRoleArnParser.convertPrincipalArnToRoleArn(principalArn)).thenReturn(iamRoleA...
[FOCAL] protected Map<String, String> AuthenticationService.generateCommonIamPrincipalAuthMetadata(String iamPrincipalArn) [CLASS] class AuthenticationService [METRICS] loc=25 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Set<String> getAdminRoleArnSet() [CALLS-EXTERNAL] Maps.newHashMap/0, Map<S...
/* static context [FOCAL] protected Map<String, String> AuthenticationService.generateCommonIamPrincipalAuthMetadata(String iamPrincipalArn) [PATH1] if((adminRoleArnSet.contains(iamPrincipalArn) || awsIamRoleArnParser.isAssumedRoleArn(iamPrincipalArn) && adminRoleArnSe...)=T -> return metadata [NEW] HashSet<> */
/* static context [FOCAL] protected Map<String, String> AuthenticationService.generateCommonIamPrincipalAuthMetadata(String iamPrincipalArn) [PATH1] if((adminRoleArnSet.contains(iamPrincipalArn) || awsIamRoleArnParser.isAssumedRoleArn(iamPrincipalArn) && adminRoleArnSe...)=T -> return metadata [NEW] HashSet<> */ class ...
true
ok
{"focal": {"class": "AuthenticationService", "name": "generateCommonIamPrincipalAuthMetadata", "signature": "Map<String, String> generateCommonIamPrincipalAuthMetadata(String iamPrincipalArn)", "start_line": 3, "modifiers": "protected", "params": [{"name": "iamPrincipalArn", "type": "String"}], "return_type": "Map<Stri...
70629319_1
class HotkeySettings extends Settings { @Override public Properties getDefaultProperties() { Properties properties = new Properties(); properties.setProperty("newPlaylist", hotkeyToString(DEFAULT_NEWPLAYLIST)); properties.setProperty("importPlaylist", hotkeyToString(DEFAULT_IMPORTPLAYLIST)); properties...
HotkeySettings settings = new HotkeySettings(); Properties properties = settings.getDefaultProperties(); assertEquals(properties.get("newPlaylist"), "Ctrl+N"); assertEquals(properties.get("importPlaylist"), "Shift+Ctrl+N"); assertEquals(properties.get("undo"), "Ctrl+Z"); assertEquals(properties.get...
[FOCAL] @Override public Properties HotkeySettings.getDefaultProperties() [CLASS] class HotkeySettings extends Settings [METRICS] loc=30 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String hotkeyToString(Hotkey hotkey) [CALLS-EXTERNAL] Properties.setProperty/2 [NEW] Properties [DATAFLOW] proper...
/* static context [FOCAL] @Override public Properties HotkeySettings.getDefaultProperties() [CALLS-INTERNAL] String hotkeyToString(Hotkey hotkey) [NEW] Properties [CALLS-EXTERNAL] Properties.setProperty/2 */
/* static context [FOCAL] @Override public Properties HotkeySettings.getDefaultProperties() [CALLS-INTERNAL] String hotkeyToString(Hotkey hotkey) [NEW] Properties [CALLS-EXTERNAL] Properties.setProperty/2 */ class HotkeySettings extends Settings { @Override public Properties getDefaultProperties() { Properties pro...
true
ok
{"focal": {"class": "HotkeySettings", "name": "getDefaultProperties", "signature": "Properties getDefaultProperties()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Properties"}, "class_info": {"name": "HotkeySettings", "kind": "class", "modifiers": "", "superclass": "Settings", "inte...
70711909_35
class HereAccount { public static TokenEndpoint getTokenEndpoint( HttpProvider httpProvider, ClientCredentialsProvider clientCredentialsProvider) { return new TokenEndpointImpl(reuseClock(clientCredentialsProvider), httpProvider, clientCredentialsProvider, new JacksonSerializer(), n...
HttpProvider mockHttpProvider = Mockito.mock(HttpProvider.class); //HttpProvider spy = Mockito.spy(mockHttpProvider); ClientCredentialsProvider credentials = new ClientCredentialsProvider() { @Override public String getTokenEndpointUrl() { return "https:/...
[FOCAL] public static TokenEndpoint HereAccount.getTokenEndpoint(HttpProvider httpProvider, ClientCredentialsProvider clientCredentialsProvider) [CLASS] class HereAccount [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Clock reuseClock(ClientAuthorizationRequestProvider clientAutho...
/* static context [FOCAL] public static TokenEndpoint HereAccount.getTokenEndpoint(HttpProvider httpProvider, ClientCredentialsProvider clientCredentialsProvider) [INPUTS] branches=- | result=clientCredentialsProvider, httpProvider [CALLS-INTERNAL] Clock reuseClock(ClientAuthorizationRequestProvider clientAuthorization...
/* static context [FOCAL] public static TokenEndpoint HereAccount.getTokenEndpoint(HttpProvider httpProvider, ClientCredentialsProvider clientCredentialsProvider) [INPUTS] branches=- | result=clientCredentialsProvider, httpProvider [CALLS-INTERNAL] Clock reuseClock(ClientAuthorizationRequestProvider clientAuthorization...
true
ok
{"focal": {"class": "HereAccount", "name": "getTokenEndpoint", "signature": "TokenEndpoint getTokenEndpoint(HttpProvider httpProvider, ClientCredentialsProvider clientCredentialsProvider)", "start_line": 3, "modifiers": "public static", "params": [{"name": "httpProvider", "type": "HttpProvider"}, {"name": "clientCreden...
70738287_0
class JavannaGson { public <A extends Annotation> A parse( String json, Class<A> annotation ) { Map<?, ?> map = gson.fromJson( json, Map.class ); return createAnnotation( annotation, map ); } public JavannaGson( Gson gson ); public JavannaGson(); public A parse( Reader reader, C...
Server server = javannaGson.parse( testResource( "/server.json" ), Server.class ); assertEquals( "Super Server", server.name() ); assertEquals( 43, server.port() ); assertEquals( "/var/log/server.log", server.logFile() ); WhiteLists whiteLists = server.whiteLists(); as...
[FOCAL] public A JavannaGson.parse(String json, Class<A> annotation) [CLASS] class JavannaGson [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] A createAnnotation(Class<A> annotation, Map<?, ?> map) [CALLS-EXTERNAL] gson.fromJson/2 [INPUTS] branches=- | result=annotation, json [COLL...
/* static context [FOCAL] public A JavannaGson.parse(String json, Class<A> annotation) [INPUTS] branches=- | result=annotation, json [COLLABORATORS] field gson fromJson/2 [CALLS-INTERNAL] A createAnnotation(Class<A> annotation, Map<?, ?> map) [CALLS-EXTERNAL] gson.fromJson/2 */
/* static context [FOCAL] public A JavannaGson.parse(String json, Class<A> annotation) [INPUTS] branches=- | result=annotation, json [COLLABORATORS] field gson fromJson/2 [CALLS-INTERNAL] A createAnnotation(Class<A> annotation, Map<?, ?> map) [CALLS-EXTERNAL] gson.fromJson/2 */ class JavannaGson { public <A extend...
true
ok
{"focal": {"class": "JavannaGson", "name": "parse", "signature": "A parse(String json, Class<A> annotation)", "start_line": 3, "modifiers": "public", "params": [{"name": "json", "type": "String"}, {"name": "annotation", "type": "Class<A>"}], "return_type": "A"}, "class_info": {"name": "JavannaGson", "kind": "class", "m...
70772509_1
class CrawlerRunner { public void run(final CrawlerSettings crawlerSettings, final List<Memo> memos) throws Exception { CrawlConfig config = crawlerSettings.getCrawlConfig(); PageFetcher pageFetcher = new PageFetcher(config); RobotstxtConfig robotstxtConfig = new RobotstxtConfig(); ...
crawlerRunner.run(crawlerSettings, null); Assert.assertEquals(0L, memos.get(0).getCounter().longValue()); } }
[FOCAL] public void CrawlerRunner.run(CrawlerSettings crawlerSettings, List<Memo> memos) [CLASS] class CrawlerRunner [METRICS] loc=15 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] CrawlerSettings.getCrawlConfig/0, CrawlerSettings.getSeeds/0, CrawlController.addSeed/1, ActionsCrawler.configure/4,...
/* static context [FOCAL] public void CrawlerRunner.run(CrawlerSettings crawlerSettings, List<Memo> memos) [PATH1] foreach(String seed : crawlerSettings.getSeeds())=T -> exit loop [PATH2] foreach(String seed : crawlerSettings.getSeeds())=F [INPUTS] branches=crawlerSettings | result=- [COLLABORATORS] param crawlerSettin...
/* static context [FOCAL] public void CrawlerRunner.run(CrawlerSettings crawlerSettings, List<Memo> memos) [PATH1] foreach(String seed : crawlerSettings.getSeeds())=T -> exit loop [PATH2] foreach(String seed : crawlerSettings.getSeeds())=F [INPUTS] branches=crawlerSettings | result=- [COLLABORATORS] param crawlerSettin...
true
ok
{"focal": {"class": "CrawlerRunner", "name": "run", "signature": "void run(CrawlerSettings crawlerSettings, List<Memo> memos) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "crawlerSettings", "type": "CrawlerSettings"}, {"name": "memos", "type": "List<Memo>"}], "return_type": "void"}, "c...
70780002_17
class DmnJsonConverterUtil implements EditorJsonConstants, DmnStencilConstants { public static boolean migrateModelV3(JsonNode decisionTableNode, ObjectMapper objectMapper) { // migrate to v2 boolean wasMigrated = migrateModel(decisionTableNode, objectMapper); // migrate to v3 if (...
JsonNode testJsonResource = parseJson(JSON_RESOURCE_2); boolean wasMigrated = new DmnJsonConverterUtil().migrateModelV3(testJsonResource, OBJECT_MAPPER); assertThat(wasMigrated).isTrue(); assertThat(testJsonResource.get("modelVersion").asText()).isEqualTo("3"); DmnDefinition d...
[FOCAL] public static boolean DmnJsonConverterUtil.migrateModelV3(JsonNode decisionTableNode, ObjectMapper objectMapper) [CLASS] class DmnJsonConverterUtil implements EditorJsonConstants, DmnStencilConstants [METRICS] loc=66 cc=12 branches=7 loops=3 returns=1 throws=0 nesting=7 [CALLS-INTERNAL] String transformCollecti...
class DmnJsonConverterUtil implements EditorJsonConstants, DmnStencilConstants { public static boolean migrateModelV3(JsonNode decisionTableNode, ObjectMapper objectMapper) { // migrate to v2 boolean wasMigrated = migrateModel(decisionTableNode, objectMapper); // migrate to v3 if (...
false
ok
{"focal": {"class": "DmnJsonConverterUtil", "name": "migrateModelV3", "signature": "boolean migrateModelV3(JsonNode decisionTableNode, ObjectMapper objectMapper)", "start_line": 3, "modifiers": "public static", "params": [{"name": "decisionTableNode", "type": "JsonNode"}, {"name": "objectMapper", "type": "ObjectMapper"...
70781239_1
class MaskImpl implements Mask { @Override public boolean hasUserInput() { if (slots.isEmpty()) { return false; } return slots.getFirstSlot().anyInputToTheRight(); } public MaskImpl(@NonNull Slot[] slots, boolean terminated); public MaskImpl(@NonNull MaskImpl...
assertFalse(mask.hasUserInput()); mask.insertFront("1"); assertTrue(mask.hasUserInput()); mask.removeBackwards(0, 1); assertFalse(mask.hasUserInput()); Mask nullMask = new MaskImpl(new Slot[]{}, true); assertFalse(nullMask.hasUserInput()); } }
[FOCAL] @Override public boolean MaskImpl.hasUserInput() [CLASS] class MaskImpl implements Mask [METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] slots.isEmpty/0, slots.getFirstSlot().anyInputToTheRight/0, slots.getFirstSlot/0 [PATH1] if(slots.isEmpty())=T -> return false [PATH2] if(...
/* static context [FOCAL] @Override public boolean MaskImpl.hasUserInput() [PATH1] if(slots.isEmpty())=T -> return false [PATH2] if(slots.isEmpty())=F -> return slots.getFirstSlot().anyInputToTheRight() [COLLABORATORS] field slots isEmpty/0,getFirstSlot/0 [CALLS-EXTERNAL] slots.isEmpty/0, slots.getFirstSlot().anyInputT...
/* static context [FOCAL] @Override public boolean MaskImpl.hasUserInput() [PATH1] if(slots.isEmpty())=T -> return false [PATH2] if(slots.isEmpty())=F -> return slots.getFirstSlot().anyInputToTheRight() [COLLABORATORS] field slots isEmpty/0,getFirstSlot/0 [CALLS-EXTERNAL] slots.isEmpty/0, slots.getFirstSlot().anyInputT...
true
ok
{"focal": {"class": "MaskImpl", "name": "hasUserInput", "signature": "boolean hasUserInput()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "MaskImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Mask", "fields": [{"name": "ma...
70809374_64
class RestBotTriggerStore implements IRestBotTriggerStore { @Override public BotTriggerConfiguration readBotTrigger(String intent) { try { BotTriggerConfiguration botTriggerConfiguration = botTriggersCache.get(intent); if (botTriggerConfiguration == null) { botTr...
//setup final BotTriggerConfiguration expected = createExpectedBotTriggerConfiguration(); when(botTriggersCache.get(eq(intent))).thenAnswer(invocation -> expected); //test BotTriggerConfiguration actual = restBotTriggerStore.readBotTrigger(intent); //assert Asse...
[FOCAL] @Override public BotTriggerConfiguration RestBotTriggerStore.readBotTrigger(String intent) [CLASS] class RestBotTriggerStore implements IRestBotTriggerStore [METRICS] loc=17 cc=4 branches=1 loops=0 returns=1 throws=2 nesting=2 [CALLS-EXTERNAL] ICache<String, BotTriggerConfiguration>.get/1, IBotTriggerStore.read...
/* static context [FOCAL] @Override public BotTriggerConfiguration RestBotTriggerStore.readBotTrigger(String intent) [THROWS-WHEN] NotFoundException when try-body throws [THROWS-WHEN] InternalServerErrorException when try-body throws [PATH1] try-body throws -> throw new NotFoundException(e.getLocalizedMessage()) [PATH2...
/* static context [FOCAL] @Override public BotTriggerConfiguration RestBotTriggerStore.readBotTrigger(String intent) [THROWS-WHEN] NotFoundException when try-body throws [THROWS-WHEN] InternalServerErrorException when try-body throws [PATH1] try-body throws -> throw new NotFoundException(e.getLocalizedMessage()) [PATH2...
true
ok
{"focal": {"class": "RestBotTriggerStore", "name": "readBotTrigger", "signature": "BotTriggerConfiguration readBotTrigger(String intent)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "intent", "type": "String"}], "return_type": "BotTriggerConfiguration"}, "class_info": {"name": "RestBotTrigger...
70817233_5
class TimeCalculation { @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) static boolean isMinutesDiffMax(DateTime dateTime1, DateTime dateTime2, int maxMinutes) { Period period = new Period(dateTime1, dateTime2); Duration duration = period.toDurationFrom(dateTime1); return Math...
DateTime dateTime1 = getDateTime(3016, 10, 26, 15, 20, 34); Assert.assertFalse(TimeCalculation.isMinutesDiffMax(mReferenceDateTime, dateTime1, 5000)); DateTime dateTime2 = getDateTime(2017, 11, 16, 15, 20, 34); Assert.assertFalse(TimeCalculation.isMinutesDiffMax(mReferenceDateTime, date...
[FOCAL] @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) static boolean TimeCalculation.isMinutesDiffMax(DateTime dateTime1, DateTime dateTime2, int maxMinutes) [CLASS] class TimeCalculation [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Period.toDurationFrom/1, Math.abs/...
/* static context [FOCAL] @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) static boolean TimeCalculation.isMinutesDiffMax(DateTime dateTime1, DateTime dateTime2, int maxMinutes) [INPUTS] branches=- | result=dateTime1, dateTime2, maxMinutes [NEW] Period [CALLS-EXTERNAL] Period.toDurationFrom/1, Math.abs/1, dur...
/* static context [FOCAL] @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) static boolean TimeCalculation.isMinutesDiffMax(DateTime dateTime1, DateTime dateTime2, int maxMinutes) [INPUTS] branches=- | result=dateTime1, dateTime2, maxMinutes [NEW] Period [CALLS-EXTERNAL] Period.toDurationFrom/1, Math.abs/1, dur...
true
ok
{"focal": {"class": "TimeCalculation", "name": "isMinutesDiffMax", "signature": "boolean isMinutesDiffMax(DateTime dateTime1, DateTime dateTime2, int maxMinutes)", "start_line": 3, "modifiers": "@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) static", "params": [{"name": "dateTime1", "type": "DateTime"}, {"na...
70868306_1
class Repo implements Comparable<Repo>, Serializable { public static int getCommitType(String[] splits) { if (splits.length == 4) return COMMIT_TYPE_REMOTE; if (splits.length != 3) return COMMIT_TYPE_TEMP; String type = splits[1]; if ("tags".equals(type)) ...
assertEquals("should be type head", Repo.COMMIT_TYPE_HEAD, Repo.getCommitType("refs/heads/foo")); assertEquals("should be type head", Repo.COMMIT_TYPE_HEAD, Repo.getCommitType("refs/heads/foo/bar")); assertEquals("should be type remote", Repo.COMMIT_TYPE_REMOTE, Repo.getCommitType("refs/remotes/...
[FOCAL] public static int Repo.getCommitType(String[] splits) [CLASS] class Repo implements Comparable<Repo>, Serializable [METRICS] loc=10 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1 [CALLS-EXTERNAL] "tags".equals/1 [PATH1] if(splits.length == 4)=F -> if(splits.length != 3)=F -> if("tags".equals(type))=T -> r...
/* static context [FOCAL] public static int Repo.getCommitType(String[] splits) [PATH1] if(splits.length == 4)=F -> if(splits.length != 3)=F -> if("tags".equals(type))=T -> return COMMIT_TYPE_TAG [PATH2] if(splits.length == 4)=T -> return COMMIT_TYPE_REMOTE [PATH3] if(splits.length == 4)=F -> if(splits.length != 3)=T -...
/* static context [FOCAL] public static int Repo.getCommitType(String[] splits) [PATH1] if(splits.length == 4)=F -> if(splits.length != 3)=F -> if("tags".equals(type))=T -> return COMMIT_TYPE_TAG [PATH2] if(splits.length == 4)=T -> return COMMIT_TYPE_REMOTE [PATH3] if(splits.length == 4)=F -> if(splits.length != 3)=T -...
true
ok
{"focal": {"class": "Repo", "name": "getCommitType", "signature": "int getCommitType(String[] splits)", "start_line": 3, "modifiers": "public static", "params": [{"name": "splits", "type": "String[]"}], "return_type": "int"}, "class_info": {"name": "Repo", "kind": "class", "modifiers": "", "superclass": null, "interfac...
70905504_2
class InstantRunBuildInfo { public boolean hasNoChanges() { return getArtifacts().isEmpty(); } public InstantRunBuildInfo(@NonNull Element root); @NonNull public String getTimeStamp(); public long getSecretToken(); @NonNull public String getVerifierStatus(); public boolean canHot...
InstantRunBuildInfo info = getBuildInfo("instantrun", "build-info-no-artifacts.xml"); assertTrue("If there are no artifacts, then it doesn't matter what the verifier said.", info.hasNoChanges()); info = getBuildInfo("instantrun", "build-info-res.xml"); assertFalse("If there is an artifa...
[FOCAL] public boolean InstantRunBuildInfo.hasNoChanges() [CLASS] class InstantRunBuildInfo [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] List<InstantRunArtifact> getArtifacts() [CALLS-EXTERNAL] getArtifacts().isEmpty/0 [CLASS-MEMBERS] InstantRunBuildInfo(Element root); String ge...
/* static context [FOCAL] public boolean InstantRunBuildInfo.hasNoChanges() [CALLS-INTERNAL] List<InstantRunArtifact> getArtifacts() [CALLS-EXTERNAL] getArtifacts().isEmpty/0 */
/* static context [FOCAL] public boolean InstantRunBuildInfo.hasNoChanges() [CALLS-INTERNAL] List<InstantRunArtifact> getArtifacts() [CALLS-EXTERNAL] getArtifacts().isEmpty/0 */ class InstantRunBuildInfo { public boolean hasNoChanges() { return getArtifacts().isEmpty(); } public InstantRunBuildIn...
true
ok
{"focal": {"class": "InstantRunBuildInfo", "name": "hasNoChanges", "signature": "boolean hasNoChanges()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "InstantRunBuildInfo", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [],...
70948568_133
class Any { @SafeVarargs public static <T> CollectionCase<List<T>, T> nonemptyListOf(Case<T>... cases) { return new CollectionCase.ListCase<T>() .withSizeOf(Any.integer().inRange(1, 100)) .withElementsOf(new UnionCase<>(cases)); } @SafeVarargs public static Case<T> of(Case<T>... cases); @SafeVarargs publ...
Set<List<Integer>> actuals = Any.nonemptyListOf(Any::integer).generateAllOnce(random); assertFalse(actuals.stream().anyMatch(List::isEmpty)); } }
[FOCAL] @SafeVarargs public static CollectionCase<List<T>, T> Any.nonemptyListOf(Case<T>... cases) [CLASS] class Any [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] new CollectionCase.ListCase<T>() .withSizeOf(Any.integer(....withElementsOf/1, new CollectionCase.ListCase<T>().withS...
/* static context [FOCAL] @SafeVarargs public static CollectionCase<List<T>, T> Any.nonemptyListOf(Case<T>... cases) [INPUTS] branches=- | result=cases [NEW] CollectionCase.ListCase<T>, UnionCase<> [CALLS-EXTERNAL] new CollectionCase.ListCase<T>() .withSizeOf(Any.integer(....withElementsOf/1, new CollectionCase.ListCas...
/* static context [FOCAL] @SafeVarargs public static CollectionCase<List<T>, T> Any.nonemptyListOf(Case<T>... cases) [INPUTS] branches=- | result=cases [NEW] CollectionCase.ListCase<T>, UnionCase<> [CALLS-EXTERNAL] new CollectionCase.ListCase<T>() .withSizeOf(Any.integer(....withElementsOf/1, new CollectionCase.ListCas...
true
ok
{"focal": {"class": "Any", "name": "nonemptyListOf", "signature": "CollectionCase<List<T>, T> nonemptyListOf(Case<T>... cases)", "start_line": 3, "modifiers": "@SafeVarargs public static", "params": [{"name": "cases", "type": "Case<T>..."}], "return_type": "CollectionCase<List<T>, T>"}, "class_info": {"name": "Any", "k...
71073678_31
class Converter { public static Calendar getCalendar(Object date, Calendar defaultValue) { Calendar cal = new GregorianCalendar(); if (date instanceof java.util.Date) { cal.setTime((java.util.Date) date); return cal; } else if (date != null) { DateFormat ...
assertEquals(null, Converter.getCalendar("invalid date", null)); } }
[FOCAL] public static Calendar Converter.getCalendar(Object date, Calendar defaultValue) [CLASS] class Converter [METRICS] loc=34 cc=7 branches=2 loops=0 returns=3 throws=0 nesting=6 [CALLS-EXTERNAL] Calendar.setTime/1, DateFormat.getDateInstance/1, DateFormat.parse/1, Object.toString/0 [NEW] GregorianCalendar [EXCEPTI...
/* static context [FOCAL] public static Calendar Converter.getCalendar(Object date, Calendar defaultValue) [PATH1] if(date instanceof java.util.Date)=F -> if(date != null)=T -> try-body throws -> return cal [PATH2] if(date instanceof java.util.Date)=T -> return cal [PATH3] if(date instanceof java.util.Date)=F -> if(dat...
/* static context [FOCAL] public static Calendar Converter.getCalendar(Object date, Calendar defaultValue) [PATH1] if(date instanceof java.util.Date)=F -> if(date != null)=T -> try-body throws -> return cal [PATH2] if(date instanceof java.util.Date)=T -> return cal [PATH3] if(date instanceof java.util.Date)=F -> if(dat...
true
ok
{"focal": {"class": "Converter", "name": "getCalendar", "signature": "Calendar getCalendar(Object date, Calendar defaultValue)", "start_line": 3, "modifiers": "public static", "params": [{"name": "date", "type": "Object"}, {"name": "defaultValue", "type": "Calendar"}], "return_type": "Calendar"}, "class_info": {"name":...
71103781_3
class FailbackRegistry extends AbstractRegistry { @Override public void register(URL url) { if (destroyed.get()) { return; } super.register(url); failedRegistered.remove(url); failedUnregistered.remove(url); try { // 向服务器端发送注册请求 doRegister(url); } catch (Exception e) { Throwable t = e; ...
final CountDownLatch latch = new CountDownLatch(1);//全部共调用4次。成功才会减1. subscribe的失败尝试不会在做了 registry = new MockRegistry(registryUrl, latch); registry.setBad(true); registry.register(serviceUrl); registry.setBad(false); for (int i = 0; i < trytimes; i++) { Sys...
[FOCAL] @Override public void FailbackRegistry.register(URL url) [CLASS] class FailbackRegistry extends AbstractRegistry [METRICS] loc=33 cc=5 branches=3 loops=0 returns=1 throws=1 nesting=3 [CALLS-INTERNAL] void doRegister(URL url) [CALLS-EXTERNAL] destroyed.get/0, AbstractRegistry.register/1, failedRegistered.remove/...
/* static context [FOCAL] @Override public void FailbackRegistry.register(URL url) [THROWS-WHEN] IllegalStateException when !destroyed.get() && try-body throws && check || skipFailback && skipFailback [THROWS-WHEN] IllegalStateException when !destroyed.get() && try-body throws && check || skipFailback && !skipFailback ...
/* static context [FOCAL] @Override public void FailbackRegistry.register(URL url) [THROWS-WHEN] IllegalStateException when !destroyed.get() && try-body throws && check || skipFailback && skipFailback [THROWS-WHEN] IllegalStateException when !destroyed.get() && try-body throws && check || skipFailback && !skipFailback ...
true
ok
{"focal": {"class": "FailbackRegistry", "name": "register", "signature": "void register(URL url)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "url", "type": "URL"}], "return_type": "void"}, "class_info": {"name": "FailbackRegistry", "kind": "class", "modifiers": "", "superclass": "AbstractReg...
71162914_1
class CardValidator implements Validator { public boolean validate(CreditCard creditCard) { Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1); if (Integer.parseInt(lastDigit.toString()) % 2 == 0) { return true; } else { return false; } } publi...
CreditCard creditCard = new CreditCard("12341234", "10/10", 1234, "VISA"); CardValidator cardValidator = new CardValidator(); assertTrue("Credit card should be valid", cardValidator.validate(creditCard)); creditCard.setNumber("2"); assertTrue("Credit card should be valid", cardValidator.validate(c...
[FOCAL] public boolean CardValidator.validate(CreditCard creditCard) [CLASS] class CardValidator implements Validator [METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] creditCard.getNumber().charAt/1, CreditCard.getNumber/0, creditCard.getNumber().length/0, Integer.parseInt/1, Chara...
/* static context [FOCAL] public boolean CardValidator.validate(CreditCard creditCard) [PATH1] if(Integer.parseInt(lastDigit.toString()) % 2 == 0)=T -> return true [PATH2] if(Integer.parseInt(lastDigit.toString()) % 2 == 0)=F -> return false [INPUTS] branches=creditCard | result=- [COLLABORATORS] param creditCard:Credi...
/* static context [FOCAL] public boolean CardValidator.validate(CreditCard creditCard) [PATH1] if(Integer.parseInt(lastDigit.toString()) % 2 == 0)=T -> return true [PATH2] if(Integer.parseInt(lastDigit.toString()) % 2 == 0)=F -> return false [INPUTS] branches=creditCard | result=- [COLLABORATORS] param creditCard:Credi...
true
ok
{"focal": {"class": "CardValidator", "name": "validate", "signature": "boolean validate(CreditCard creditCard)", "start_line": 3, "modifiers": "public", "params": [{"name": "creditCard", "type": "CreditCard"}], "return_type": "boolean"}, "class_info": {"name": "CardValidator", "kind": "class", "modifiers": "", "supercl...
71163137_1
class I18NHelper { public static String getHello(String lang){ return "Hello Time Hacker"; } } class I18NHelperTest { @Test public void runTest() throws Exception{
Assert.assertNotNull(I18NHelper.getHello("en")); } }
[FOCAL] public static String I18NHelper.getHello(String lang) [CLASS] class I18NHelper [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=- | unused=lang [TEST] I18NHelperTest: @Test public void runTest() throws Exception
/* static context [FOCAL] public static String I18NHelper.getHello(String lang) [INPUTS] branches=- | result=- | unused=lang */
/* static context [FOCAL] public static String I18NHelper.getHello(String lang) [INPUTS] branches=- | result=- | unused=lang */ class I18NHelper { public static String getHello(String lang){ return "Hello Time Hacker"; } } class I18NHelperTest { @Test public void runTest() throws Exception{
true
ok
{"focal": {"class": "I18NHelper", "name": "getHello", "signature": "String getHello(String lang)", "start_line": 3, "modifiers": "public static", "params": [{"name": "lang", "type": "String"}], "return_type": "String"}, "class_info": {"name": "I18NHelper", "kind": "class", "modifiers": "", "superclass": null, "interfac...
71171131_6
class AuthorizationClient { public static void openLoginInBrowser(Activity contextActivity, AuthorizationRequest request) { Intent launchBrowser = new Intent(Intent.ACTION_VIEW, request.toUri()); contextActivity.startActivity(launchBrowser); } public AuthorizationClient(Activity activity)...
AuthorizationRequest authorizationRequest = mock(AuthorizationRequest.class); Activity activity = mock(Activity.class); when(authorizationRequest.toUri()).thenReturn(Uri.parse("to://me")); Mockito.doNothing().when(activity).startActivity(any(Intent.class)); ArgumentCaptor<Intent...
[FOCAL] public static void AuthorizationClient.openLoginInBrowser(Activity contextActivity, AuthorizationRequest request) [CLASS] class AuthorizationClient [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] AuthorizationRequest.toUri/0, Activity.startActivity/1 [NEW] Intent [COLLABORA...
/* static context [FOCAL] public static void AuthorizationClient.openLoginInBrowser(Activity contextActivity, AuthorizationRequest request) [COLLABORATORS] param request:AuthorizationRequest toUri/0; param contextActivity:Activity startActivity/1 [NEW] Intent [CALLS-EXTERNAL] AuthorizationRequest.toUri/0, Activity.star...
/* static context [FOCAL] public static void AuthorizationClient.openLoginInBrowser(Activity contextActivity, AuthorizationRequest request) [COLLABORATORS] param request:AuthorizationRequest toUri/0; param contextActivity:Activity startActivity/1 [NEW] Intent [CALLS-EXTERNAL] AuthorizationRequest.toUri/0, Activity.star...
true
ok
{"focal": {"class": "AuthorizationClient", "name": "openLoginInBrowser", "signature": "void openLoginInBrowser(Activity contextActivity, AuthorizationRequest request)", "start_line": 3, "modifiers": "public static", "params": [{"name": "contextActivity", "type": "Activity"}, {"name": "request", "type": "AuthorizationRe...
71183878_8
class ClaimImpl extends BaseClaim { @Override @Nullable public Date asDate() { if (!value.isJsonPrimitive()) { return null; } long ms = Long.parseLong(value.getAsString()) * 1000; return new Date(ms); } ClaimImpl(@NonNull JsonElement value); @Over...
long seconds = Integer.MAX_VALUE + 10000L; JsonElement value = gson.toJsonTree(seconds); ClaimImpl claim = new ClaimImpl(value); Date date = claim.asDate(); assertThat(date, is(notNullValue())); assertThat(date.getTime(), is(seconds * 1000)); assertThat(date.getT...
[FOCAL] @Override @Nullable public Date ClaimImpl.asDate() [CLASS] class ClaimImpl extends BaseClaim [METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] value.isJsonPrimitive/0, Long.parseLong/1, value.getAsString/0 [NEW] Date [PATH1] if(!value.isJsonPrimitive())=T -> return null [PATH...
/* static context [FOCAL] @Override @Nullable public Date ClaimImpl.asDate() [PATH1] if(!value.isJsonPrimitive())=T -> return null [PATH2] if(!value.isJsonPrimitive())=F -> return new Date(ms) [COLLABORATORS] field value isJsonPrimitive/0,getAsString/0 [NEW] Date [CALLS-EXTERNAL] value.isJsonPrimitive/0, Long.parseLong...
/* static context [FOCAL] @Override @Nullable public Date ClaimImpl.asDate() [PATH1] if(!value.isJsonPrimitive())=T -> return null [PATH2] if(!value.isJsonPrimitive())=F -> return new Date(ms) [COLLABORATORS] field value isJsonPrimitive/0,getAsString/0 [NEW] Date [CALLS-EXTERNAL] value.isJsonPrimitive/0, Long.parseLong...
true
ok
{"focal": {"class": "ClaimImpl", "name": "asDate", "signature": "Date asDate()", "start_line": 3, "modifiers": "@Override @Nullable public", "params": [], "return_type": "Date"}, "class_info": {"name": "ClaimImpl", "kind": "class", "modifiers": "", "superclass": "BaseClaim", "interfaces": null, "fields": [{"name": "gso...
71197756_54
class UnpackingJSBundleLoader extends JSBundleLoader { void prepare() { boolean unpacked = false; final File lockFilePath = new File(mContext.getFilesDir(), LOCK_FILE); Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "UnpackingJSBundleLoader.prepare"); // Make sure we don't release the lock by l...
mBuilder.build().prepare(); final File aFile = new File(mDestinationPath, "a_file"); aFile.createNewFile(); when(mMockUnpackers[0].shouldReconstructDir( same(mContext), any(byte[].class))) .thenReturn(true); addUnpackers(); mBuilder.build().prepare(); assertFals...
[FOCAL] void UnpackingJSBundleLoader.prepare() [CLASS] class UnpackingJSBundleLoader extends JSBundleLoader [METRICS] loc=21 cc=3 branches=1 loops=0 returns=0 throws=1 nesting=2 [CALLS-INTERNAL] boolean prepareLocked() [CALLS-EXTERNAL] Context.getFilesDir/0, Systrace.beginSection/2, FileLocker.lock/1, Systrace.endSecti...
/* static context [FOCAL] void UnpackingJSBundleLoader.prepare() [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(ioe) [PATH2] if(unpacked && mOnUnpackedCallback != null)=T [PATH3] if(unpacked && mOnUnpackedCallback != null)=F [COLLABORATORS] field mContext:Conte...
/* static context [FOCAL] void UnpackingJSBundleLoader.prepare() [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(ioe) [PATH2] if(unpacked && mOnUnpackedCallback != null)=T [PATH3] if(unpacked && mOnUnpackedCallback != null)=F [COLLABORATORS] field mContext:Conte...
true
ok
{"focal": {"class": "UnpackingJSBundleLoader", "name": "prepare", "signature": "void prepare()", "start_line": 3, "modifiers": "", "params": [], "return_type": "void"}, "class_info": {"name": "UnpackingJSBundleLoader", "kind": "class", "modifiers": "", "superclass": "JSBundleLoader", "interfaces": null, "fields": [{"na...
71227768_11
class Property extends AbstractProperty { public static Property extractProperty(String propertyDefinition) { Property property = null; if (propertyDefinition != null) { String[] propertyAttributes = propertyDefinition.split(PIPE_REGEX, 2); String name = propertyAttributes[...
// #307 Annotation collée au texte assertProperty(new Property("comment typo|@commentForgot space @required @password", "comment typo", true, null, "", "", true), Property.extractProperty("comment typo|@commentForgot space @required @password")); // #311 assertProperty(...
[FOCAL] public static Property Property.extractProperty(String propertyDefinition) [CLASS] class Property extends AbstractProperty [METRICS] loc=81 cc=15 branches=13 loops=1 returns=1 throws=0 nesting=9 [CALLS-INTERNAL] String extractAnnotationValueLegacyStyle(String annotationDefinition); String extractCommentThatStar...
class Property extends AbstractProperty { public static Property extractProperty(String propertyDefinition) { Property property = null; if (propertyDefinition != null) { String[] propertyAttributes = propertyDefinition.split(PIPE_REGEX, 2); String name = propertyAttributes[...
false
ok
{"focal": {"class": "Property", "name": "extractProperty", "signature": "Property extractProperty(String propertyDefinition)", "start_line": 3, "modifiers": "public static", "params": [{"name": "propertyDefinition", "type": "String"}], "return_type": "Property"}, "class_info": {"name": "Property", "kind": "class", "mod...
71230327_0
class MyService { public String message() { return this.serviceProperties.getMessage(); } public MyService(ServiceProperties serviceProperties); @Autowired private MyService myService; } class MyServiceTest { @Autowired private MyService myService; @Test public void c...
assertThat(myService.message()).isNotNull(); } }
[FOCAL] public String MyService.message() [CLASS] class MyService [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] this.serviceProperties.getMessage/0 [FIELDS] read=serviceProperties [COLLABORATORS] field serviceProperties getMessage/0 [CLASS-MEMBERS] MyService(ServiceProperties ser...
/* static context [FOCAL] public String MyService.message() [COLLABORATORS] field serviceProperties getMessage/0 [FIELDS] read=serviceProperties [CALLS-EXTERNAL] this.serviceProperties.getMessage/0 */
/* static context [FOCAL] public String MyService.message() [COLLABORATORS] field serviceProperties getMessage/0 [FIELDS] read=serviceProperties [CALLS-EXTERNAL] this.serviceProperties.getMessage/0 */ class MyService { public String message() { return this.serviceProperties.getMessage(); } public ...
true
ok
{"focal": {"class": "MyService", "name": "message", "signature": "String message()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "MyService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "myService", "type": "MyS...
71263775_2
class IPFilterParser { public int parseDAT(@NonNull InputStream is, @NonNull IPFilter filter) { int ruleCount = 0; long lineNum = 0; int parseErrorCount = 0; LineIterator it; try { it = IOUtils.lineIterator(is, "UTF-8"); } catch (IOException e) { ...
FakeIPFilter filter = new FakeIPFilter(); try (InputStream is = IOUtils.toInputStream(dat_file, "UTF-8")) { int ruleCount = new IPFilterParser(false).parseDAT(is, filter); assertEquals(dat_expected_ranges.length, ruleCount); List<Pair<String, String>> ranges = filter...
[FOCAL] public int IPFilterParser.parseDAT(InputStream is, IPFilter filter) [CLASS] class IPFilterParser [METRICS] loc=79 cc=12 branches=8 loops=1 returns=2 throws=0 nesting=3 [CALLS-INTERNAL] String parseIpAddress(String ip); void errLog(int parseErrorCount, String prefix, String msg) [CALLS-EXTERNAL] IOUtils.lineIter...
/* static context [FOCAL] public int IPFilterParser.parseDAT(InputStream is, IPFilter filter) [PATH1] while(it.hasNext())=T -> if(line == null || line.isEmpty())=F -> if(line.startsWith("#") || line.startsWith("//"))=F -> if(parts.length == 0)=F -> if(parts.length > 1)=T -> if(accessNum > 127)=F -> if(ips.length != 2)=...
/* static context [FOCAL] public int IPFilterParser.parseDAT(InputStream is, IPFilter filter) [PATH1] while(it.hasNext())=T -> if(line == null || line.isEmpty())=F -> if(line.startsWith("#") || line.startsWith("//"))=F -> if(parts.length == 0)=F -> if(parts.length > 1)=T -> if(accessNum > 127)=F -> if(ips.length != 2)=...
true
ok
{"focal": {"class": "IPFilterParser", "name": "parseDAT", "signature": "int parseDAT(InputStream is, IPFilter filter)", "start_line": 3, "modifiers": "public", "params": [{"name": "is", "type": "InputStream"}, {"name": "filter", "type": "IPFilter"}], "return_type": "int"}, "class_info": {"name": "IPFilterParser", "kind...
71357459_1
class SampleController extends AbstractGriffonController { @MVCMember public void setModel(@Nonnull SampleModel model) { this.model = model; } @ControllerAction public void sayHello(); @Inject private ArtifactManager artifactManager; private SampleController controller; @Rule ...
final SampleModel model = artifactManager.newInstance(SampleModel.class); model.setInput("Griffon"); controller.setModel(model); controller.invokeAction("sayHello"); await().atMost(2, SECONDS) .until(() -> model.getOutput(), notNullValue()); assertEquals("He...
[FOCAL] @MVCMember public void SampleController.setModel(SampleModel model) [CLASS] class SampleController extends AbstractGriffonController [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=model [STATE] model [DATAFLOW] model@param->L3 [CLASS-MEMBERS] void sayHello() [TEST] SampleCon...
/* static context [FOCAL] @MVCMember public void SampleController.setModel(SampleModel model) [STATE] model [FIELDS] write=model */
/* static context [FOCAL] @MVCMember public void SampleController.setModel(SampleModel model) [STATE] model [FIELDS] write=model */ class SampleController extends AbstractGriffonController { @MVCMember public void setModel(@Nonnull SampleModel model) { this.model = model; } @ControllerAction p...
true
ok
{"focal": {"class": "SampleController", "name": "setModel", "signature": "void setModel(SampleModel model)", "start_line": 3, "modifiers": "@MVCMember public", "params": [{"name": "model", "type": "SampleModel"}], "return_type": "void"}, "class_info": {"name": "SampleController", "kind": "class", "modifiers": "", "supe...
71369123_8
class MethodInvoker { RestResponseEntity invoke(Object obj, LambdaProxyRequest request) { MethodInvocationContext context = new MethodInvocationContext(lambdaLocalPath, methodPath, request); try { List<Object> args = paramRetrievers.stream() .map(paramRetriever -> pa...
Method method = TestRestFunction10.class.getMethod("test2", String.class, LambdaProxyRequest.class); MethodInvoker methodInvoker = new MethodInvoker(TestRestFunction10.class, method, "/testRestPath10"); LambdaProxyRequest req = new LambdaProxyRequest(); req.setHttpMethod("POST"); ...
[FOCAL] RestResponseEntity MethodInvoker.invoke(Object obj, LambdaProxyRequest request) [CLASS] class MethodInvoker [METRICS] loc=41 cc=5 branches=2 loops=0 returns=4 throws=0 nesting=2 [CALLS-INTERNAL] Map<String, String> getCrossOriginHeaders(LambdaProxyRequest request) [CALLS-EXTERNAL] paramRetrievers.stream() .map(...
/* static context [FOCAL] RestResponseEntity MethodInvoker.invoke(Object obj, LambdaProxyRequest request) [PATH1] try-body throws -> if(e.getCause() != null)=T -> return new RestResponseEntity.Builder() .withStatusCode(500) .withResult(e... [PATH2] if(result instanceof RestResponseEntity)=T -> return (RestResponseEntit...
/* static context [FOCAL] RestResponseEntity MethodInvoker.invoke(Object obj, LambdaProxyRequest request) [PATH1] try-body throws -> if(e.getCause() != null)=T -> return new RestResponseEntity.Builder() .withStatusCode(500) .withResult(e... [PATH2] if(result instanceof RestResponseEntity)=T -> return (RestResponseEntit...
true
ok
{"focal": {"class": "MethodInvoker", "name": "invoke", "signature": "RestResponseEntity invoke(Object obj, LambdaProxyRequest request)", "start_line": 3, "modifiers": "", "params": [{"name": "obj", "type": "Object"}, {"name": "request", "type": "LambdaProxyRequest"}], "return_type": "RestResponseEntity"}, "class_info":...
71376921_7
class RGson { public <T> Observable<T> read(final String value, final Class<T> classInstance) { return Observable.fromCallable(new Callable<T>() { @Override public T call() throws Exception { return GsonFunctions.readValue(gson, value, classInstance); } ...
final JsonElement jsonElement = null; TestSubscriber<Entity> testSubscriber = new TestSubscriber<Entity>(); Observable<Entity> observable = rGson.read(jsonElement, Entity.class); observable.subscribe(testSubscriber); testSubscriber.assertNoErrors(); List<Entity> list =...
[FOCAL] public Observable<T> RGson.read(String value, Class<T> classInstance) [CLASS] class RGson [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Observable.fromCallable/1, GsonFunctions.readValue/3 [NEW] Callable<T> [INPUTS] branches=- | result=classInstance, value [DATAFLOW] clas...
/* static context [FOCAL] public Observable<T> RGson.read(String value, Class<T> classInstance) [INPUTS] branches=- | result=classInstance, value [NEW] Callable<T> [CALLS-EXTERNAL] Observable.fromCallable/1, GsonFunctions.readValue/3 */
/* static context [FOCAL] public Observable<T> RGson.read(String value, Class<T> classInstance) [INPUTS] branches=- | result=classInstance, value [NEW] Callable<T> [CALLS-EXTERNAL] Observable.fromCallable/1, GsonFunctions.readValue/3 */ class RGson { public <T> Observable<T> read(final String value, final Class<T>...
true
ok
{"focal": {"class": "RGson", "name": "read", "signature": "Observable<T> read(String value, Class<T> classInstance)", "start_line": 3, "modifiers": "public", "params": [{"name": "value", "type": "String"}, {"name": "classInstance", "type": "Class<T>"}], "return_type": "Observable<T>"}, "class_info": {"name": "RGson", "...
71470246_3
class GcsRepository extends AbstractArtifactRepository { private boolean exists(final String sha1) { final Blob blob = gcsStorage.get(gcsProperties.getBucketName(), sha1); if (blob == null) { return false; } return blob.exists(); } public GcsRepository(final St...
final byte[] rndBytes = randomBytes(); final String knownContentType = "application/octet-stream"; when(gcsStorageMock.get(anyString(), anyString())).thenReturn(gcpObjectMock); when(gcpObjectMock.exists()).thenReturn(true); // test storeRandomBytes(rndBytes, knownConten...
[FOCAL] private boolean GcsRepository.exists(String sha1) [CLASS] class GcsRepository extends AbstractArtifactRepository [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] gcsStorage.get/2, gcsProperties.getBucketName/0, Blob.exists/0 [PATH1] if(blob == null)=T -> return false [PATH2]...
/* static context [FOCAL] private boolean GcsRepository.exists(String sha1) [PATH1] if(blob == null)=T -> return false [PATH2] if(blob == null)=F -> return blob.exists() [INPUTS] branches=sha1 | result=sha1 [COLLABORATORS] field gcsStorage get/2; field gcsProperties getBucketName/0 [CALLS-EXTERNAL] gcsStorage.get/2, gc...
/* static context [FOCAL] private boolean GcsRepository.exists(String sha1) [PATH1] if(blob == null)=T -> return false [PATH2] if(blob == null)=F -> return blob.exists() [INPUTS] branches=sha1 | result=sha1 [COLLABORATORS] field gcsStorage get/2; field gcsProperties getBucketName/0 [CALLS-EXTERNAL] gcsStorage.get/2, gc...
true
ok
{"focal": {"class": "GcsRepository", "name": "exists", "signature": "boolean exists(String sha1)", "start_line": 3, "modifiers": "private", "params": [{"name": "sha1", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "GcsRepository", "kind": "class", "modifiers": "", "superclass": "AbstractArtifact...
71492242_3
class TemplateId { public String getRoot() { return root; } public TemplateId(String root, Optional<String> extension); public Optional<String> getExtension(); @Override public int hashCode(); @Override public boolean equals(Object obj); public static TemplateId of(String root, O...
// Arrange final String root = "root"; // Act TemplateId templateId = new TemplateId(root, Optional.empty()); // Assert assertEquals(root, templateId.getRoot()); } }
[FOCAL] public String TemplateId.getRoot() [CLASS] class TemplateId [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] TemplateId(String root, Optional<String> extension); Optional<String> getExtension(); int hashCode(); boolean equals(Object obj); TemplateId of(String root, Optional<S...
/* static context [FOCAL] public String TemplateId.getRoot() */
/* static context [FOCAL] public String TemplateId.getRoot() */ class TemplateId { public String getRoot() { return root; } public TemplateId(String root, Optional<String> extension); public Optional<String> getExtension(); @Override public int hashCode(); @Override public boolean eq...
true
ok
{"focal": {"class": "TemplateId", "name": "getRoot", "signature": "String getRoot()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "TemplateId", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "thrown", "type": "Expe...
71499649_0
class SpringCloudStreamAppGeneratorMojo extends AbstractMojo { @Override public void execute() throws MojoFailureException { // Bom AppBom appBom = new AppBom() .withSpringBootVersion(this.bootVersion) .withAppMetadataMavenPluginVersion(this.appMetadataMavenPluginVersion); AppDefinition app = new AppD...
// disable metadata in container image (Default) SpringCloudStreamAppGeneratorMojo.ContainerImage containerImage = new SpringCloudStreamAppGeneratorMojo.ContainerImage(); containerImage.setEnableMetadata(false); setMojoProperty("containerImage", containerImage); this.springCloudStreamAppMojo.execute(); /...
[FOCAL] @Override public void SpringCloudStreamAppGeneratorMojo.execute() [CLASS] class SpringCloudStreamAppGeneratorMojo extends AbstractMojo [METRICS] loc=75 cc=5 branches=3 loops=0 returns=0 throws=1 nesting=1 [CALLS-INTERNAL] void populateVisiblePropertiesFromFile(List<String> sourceTypeFilters, List<String> nameFi...
/* static context [FOCAL] @Override public void SpringCloudStreamAppGeneratorMojo.execute() [THROWS-WHEN] MojoFailureException when !CollectionUtils.isEmpty(this.metadataSourceTypeFilters) && !CollectionUtils.isEmpty(this.metadataNameFilters) && StringUtils.hasText(this.containerImage.getOrgName()) && try-body throws [...
/* static context [FOCAL] @Override public void SpringCloudStreamAppGeneratorMojo.execute() [THROWS-WHEN] MojoFailureException when !CollectionUtils.isEmpty(this.metadataSourceTypeFilters) && !CollectionUtils.isEmpty(this.metadataNameFilters) && StringUtils.hasText(this.containerImage.getOrgName()) && try-body throws [...
true
ok
{"focal": {"class": "SpringCloudStreamAppGeneratorMojo", "name": "execute", "signature": "void execute() throws MojoFailureException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "SpringCloudStreamAppGeneratorMojo", "kind": "class", "modifiers": "", "su...
71517454_141
class ConsentHelper { public boolean isConsentTermOverlap(ConsentDto consentDto, Date conStartDate, Date conEndDate) { boolean isOverlap = false; Date selStartDate = consentDto.getConsentStart(); Date selEndDate = consentDto.getConsentEnd(); isOverlap = isDatesOverlap(selStartDate, selEndDate, conStartDat...
// Arrange //selected date range consentDto.setConsentStart((Date) dateFormat.parse("06/12/2013 00:00:00")); consentDto.setConsentEnd((Date) dateFormat.parse("06/12/2013 22:59:59")); //Act boolean isOverlap = cst.isConsentTermOverlap(consentDto, conStartDate, conEndDate...
[FOCAL] public boolean ConsentHelper.isConsentTermOverlap(ConsentDto consentDto, Date conStartDate, Date conEndDate) [CLASS] class ConsentHelper [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] boolean isDatesOverlap(Date selStartDate, Date selEndDate, Date actStartDate, Date actEn...
/* static context [FOCAL] public boolean ConsentHelper.isConsentTermOverlap(ConsentDto consentDto, Date conStartDate, Date conEndDate) [INPUTS] branches=- | result=conEndDate, conStartDate, consentDto [COLLABORATORS] param consentDto:ConsentDto getConsentStart/0,getConsentEnd/0 [CALLS-INTERNAL] boolean isDatesOverlap(D...
/* static context [FOCAL] public boolean ConsentHelper.isConsentTermOverlap(ConsentDto consentDto, Date conStartDate, Date conEndDate) [INPUTS] branches=- | result=conEndDate, conStartDate, consentDto [COLLABORATORS] param consentDto:ConsentDto getConsentStart/0,getConsentEnd/0 [CALLS-INTERNAL] boolean isDatesOverlap(D...
true
ok
{"focal": {"class": "ConsentHelper", "name": "isConsentTermOverlap", "signature": "boolean isConsentTermOverlap(ConsentDto consentDto, Date conStartDate, Date conEndDate)", "start_line": 3, "modifiers": "public", "params": [{"name": "consentDto", "type": "ConsentDto"}, {"name": "conStartDate", "type": "Date"}, {"name":...
71636870_6
class PointCalculator { public Point onSwipe() { if (swipeDirection == SwipeDirection.LEFT_TO_RIGHT) { return new Point(parentView.getWidth() - target.getWidth(), target.getY()); } else { return new Point(target.getX(), parentView.getHeight() - target.getHeight()); } } public PointCalcu...
pointCalculatorUT = new PointCalculator(SwipeDirection.LEFT_TO_RIGHT, parentView, targetView, progressCalculator); Point point = pointCalculatorUT.onSwipe(); assertThat(point.x, is(900.0f)); assertThat(point.y, is(0f)); } }
[FOCAL] public Point PointCalculator.onSwipe() [CLASS] class PointCalculator [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] View.getWidth/0, target.getWidth/0, target.getY/0, target.getX/0, View.getHeight/0, target.getHeight/0 [NEW] Point [FIELDS] read=parentView:View [PATH1] if(s...
/* static context [FOCAL] public Point PointCalculator.onSwipe() [PATH1] if(swipeDirection == SwipeDirection.LEFT_TO_RIGHT)=T -> return new Point(parentView.getWidth() - target.getWidth(), target.getY()) [PATH2] if(swipeDirection == SwipeDirection.LEFT_TO_RIGHT)=F -> return new Point(target.getX(), parentView.getHeight...
/* static context [FOCAL] public Point PointCalculator.onSwipe() [PATH1] if(swipeDirection == SwipeDirection.LEFT_TO_RIGHT)=T -> return new Point(parentView.getWidth() - target.getWidth(), target.getY()) [PATH2] if(swipeDirection == SwipeDirection.LEFT_TO_RIGHT)=F -> return new Point(target.getX(), parentView.getHeight...
true
ok
{"focal": {"class": "PointCalculator", "name": "onSwipe", "signature": "Point onSwipe()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Point"}, "class_info": {"name": "PointCalculator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "pointCalculato...
71651118_6
class Stash implements JSONAware, Cloneable { public long parseLong(String k) { return Long.parseLong((String) m.get(k)); } public Stash(Map<String, ?> m); public Stash(); public Stash(Stash m); public static Stash stashFromPairs(Iterable<T> ts, Function<T, Map.Entry<String, Object...
Stash smap = stash("foo", "5", "bar", null); assertEquals(5, smap.parseLong("foo")); assertEquals(5, smap.parseLong("foo", 3)); assertEquals(3, smap.parseLong("bar", 3)); } }
[FOCAL] public long Stash.parseLong(String k) [CLASS] class Stash implements JSONAware, Cloneable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Long.parseLong/1, m.get/1 [INPUTS] branches=- | result=k [COLLABORATORS] field m get/1 [DATAFLOW] k@param->L2
class Stash implements JSONAware, Cloneable { public long parseLong(String k) { return Long.parseLong((String) m.get(k)); } public Stash(Map<String, ?> m); public Stash(); public Stash(Stash m); public static Stash stashFromPairs(Iterable<T> ts, Function<T, Map.Entry<String, Object...
false
ok
{"focal": {"class": "Stash", "name": "parseLong", "signature": "long parseLong(String k)", "start_line": 3, "modifiers": "public", "params": [{"name": "k", "type": "String"}], "return_type": "long"}, "class_info": {"name": "Stash", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "JSONAware, Cloneabl...
71697731_3
class SensorAnnotations { public static void bind(@Nullable Context context) { bind(context, context); } public static void bind(@Nullable Object target, @Nullable Context context); public static void unbind(@Nullable Object target); private static SensorBinder findSensorBinderToBind(@Null...
SensorAnnotations.bind(mContext); assertThat(SensorAnnotations.BINDER_CACHE).isEmpty(); SensorAnnotations.bind(new Object(), mContext); assertThat(SensorAnnotations.BINDER_CACHE).isEmpty(); } }
[FOCAL] public static void SensorAnnotations.bind(Context context) [CLASS] class SensorAnnotations [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void bind(Object target, Context context) [DATAFLOW] context@param->L2 [CLASS-MEMBERS] void bind(Object target, Context context); void ...
/* static context [FOCAL] public static void SensorAnnotations.bind(Context context) [CALLS-INTERNAL] void bind(Object target, Context context) */
/* static context [FOCAL] public static void SensorAnnotations.bind(Context context) [CALLS-INTERNAL] void bind(Object target, Context context) */ class SensorAnnotations { public static void bind(@Nullable Context context) { bind(context, context); } public static void bind(@Nullable Object targe...
true
ok
{"focal": {"class": "SensorAnnotations", "name": "bind", "signature": "void bind(Context context)", "start_line": 3, "modifiers": "public static", "params": [{"name": "context", "type": "Context"}], "return_type": "void"}, "class_info": {"name": "SensorAnnotations", "kind": "class", "modifiers": "", "superclass": null,...
71725051_15
class IotaAPI extends IotaAPICore { @Document public List<String> prepareTransfers(String seed, int security, List<Transfer> transfers, String remainder, List<Input> inputs, ...
List<Transfer> transfers = new ArrayList<>(); transfers.add(new Transfer(TEST_ADDRESS_WITH_CHECKSUM_SECURITY_LEVEL_2, 5, TEST_MESSAGE, TEST_TAG)); List<String> trytes = iotaAPI.prepareTransfers(TEST_SEED1, 2, transfers, null, null, null, false); assertNotNull(trytes, "prepareTransfers ...
[FOCAL] @Document public List<String> IotaAPI.prepareTransfers(String seed, int security, List<Transfer> transfers, String remainder, List<Input> inputs, List<Transaction> tips, boolean validateInputs) [CLASS] class IotaAPI extends IotaAPICore [METRICS] loc=188 cc=26 branches=18 loops=7 returns=4 throws=9 nesting=5 [CA...
class IotaAPI extends IotaAPICore { @Document public List<String> prepareTransfers(String seed, int security, List<Transfer> transfers, String remainder, List<Input> inputs, ...
false
ok
{"focal": {"class": "IotaAPI", "name": "prepareTransfers", "signature": "List<String> prepareTransfers(String seed, int security, List<Transfer> transfers, String remainder, List<Input> inputs, List<Transaction> tips, boolean validateInputs) throws ArgumentException", "start_line": 3, "modifiers": "@Document public", "...
71742185_44
class WxMpServiceImpl implements WxMpService { @Override public boolean oauth2validateAccessToken(WxMpOAuth2AccessToken oAuth2AccessToken) { StringBuilder url = new StringBuilder(); url.append("https://api.weixin.qq.com/sns/auth?"); url.append("access_token=").append(oAuth2AccessToken.getAccessToken())...
Assert.fail("Not yet implemented"); } }
[FOCAL] @Override public boolean WxMpServiceImpl.oauth2validateAccessToken(WxMpOAuth2AccessToken oAuth2AccessToken) [CLASS] class WxMpServiceImpl implements WxMpService [METRICS] loc=17 cc=3 branches=0 loops=0 returns=2 throws=1 nesting=1 [CALLS-INTERNAL] CloseableHttpClient getHttpclient() [CALLS-EXTERNAL] StringBuild...
/* static context [FOCAL] @Override public boolean WxMpServiceImpl.oauth2validateAccessToken(WxMpOAuth2AccessToken oAuth2AccessToken) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] return true [PATH3] try-body throws -> return false [COLLABORATORS] p...
/* static context [FOCAL] @Override public boolean WxMpServiceImpl.oauth2validateAccessToken(WxMpOAuth2AccessToken oAuth2AccessToken) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] return true [PATH3] try-body throws -> return false [COLLABORATORS] p...
true
ok
{"focal": {"class": "WxMpServiceImpl", "name": "oauth2validateAccessToken", "signature": "boolean oauth2validateAccessToken(WxMpOAuth2AccessToken oAuth2AccessToken)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "oAuth2AccessToken", "type": "WxMpOAuth2AccessToken"}], "return_type": "boolean"}, ...
71791406_2
class TokenCode { public int getCurrentProgress() { long cur = System.currentTimeMillis(); TokenCode active = getActive(cur); if (active == null) return 0; long total = active.mUntil - active.mStart; long state = total - (cur - active.mStart); return (in...
int progress = totpToken.generateCodes().getCurrentProgress(); assertTrue(progress > 0); assertTrue(progress < 1000); } }
[FOCAL] public int TokenCode.getCurrentProgress() [CLASS] class TokenCode [METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] TokenCode getActive(long curTime) [CALLS-EXTERNAL] System.currentTimeMillis/0 [PATH1] if(active == null)=T -> return 0 [PATH2] if(active == null)=F -> return (...
/* static context [FOCAL] public int TokenCode.getCurrentProgress() [PATH1] if(active == null)=T -> return 0 [PATH2] if(active == null)=F -> return (int) (state * 1000 / total) [CALLS-INTERNAL] TokenCode getActive(long curTime) [CALLS-EXTERNAL] System.currentTimeMillis/0 */
/* static context [FOCAL] public int TokenCode.getCurrentProgress() [PATH1] if(active == null)=T -> return 0 [PATH2] if(active == null)=F -> return (int) (state * 1000 / total) [CALLS-INTERNAL] TokenCode getActive(long curTime) [CALLS-EXTERNAL] System.currentTimeMillis/0 */ class TokenCode { public int getCurrentP...
true
ok
{"focal": {"class": "TokenCode", "name": "getCurrentProgress", "signature": "int getCurrentProgress()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "TokenCode", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "totpToke...
71833308_4
class ProfileManager { @GET @Path("/{email: [\\w\\.]+@[\\w\\.]+}/subscriptions") @Produces(MediaType.APPLICATION_JSON) public Response getAllSubscriptions(@PathParam("username") String username, @PathParam("email") String subscriberId) { logger.debug("Fetch all subscriptions for subscriber {} b...
public void getAllSubscriptionsTest() { final Response response = target(PATH + username + "/" + email + "/subscriptions") .request() .accept(MediaType.APPLICATION_JSON_TYPE) .get(); assertEquals("Getting all subscriptions failed", 200, response.getSt...
[FOCAL] @GET @Path("/{email: [\\w\\.]+@[\\w\\.]+}/subscriptions") @Produces(MediaType.APPLICATION_JSON) public Response ProfileManager.getAllSubscriptions(String username, String subscriberId) [CLASS] class ProfileManager [METRICS] loc=14 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] logger.debu...
/* static context [FOCAL] @GET @Path("/{email: [\\w\\.]+@[\\w\\.]+}/subscriptions") @Produces(MediaType.APPLICATION_JSON) public Response ProfileManager.getAllSubscriptions(String username, String subscriberId) [PATH1] try-body throws -> return Response.status(Response.Status.NOT_FOUND).build() [PATH2] return Response....
/* static context [FOCAL] @GET @Path("/{email: [\\w\\.]+@[\\w\\.]+}/subscriptions") @Produces(MediaType.APPLICATION_JSON) public Response ProfileManager.getAllSubscriptions(String username, String subscriberId) [PATH1] try-body throws -> return Response.status(Response.Status.NOT_FOUND).build() [PATH2] return Response....
true
ok
{"focal": {"class": "ProfileManager", "name": "getAllSubscriptions", "signature": "Response getAllSubscriptions(String username, String subscriberId)", "start_line": 3, "modifiers": "@GET @Path(\"/{email: [\\\\w\\\\.]+@[\\\\w\\\\.]+}/subscriptions\") @Produces(MediaType.APPLICATION_JSON) public", "params": [{"name": "u...
71840517_23
class AuctionEntity extends PersistentEntity<AuctionCommand, AuctionEvent, AuctionState> { private Persist<AuctionEvent> reply(CommandContext<PlaceBidResult> ctx, PlaceBidResult result) { ctx.reply(result); return ctx.done(); } @Override public Behavior initialBehavior(Optional<AuctionStat...
driver.run(new StartAuction(auction), new PlaceBid(500, bidder1)); Outcome<AuctionEvent, AuctionState> outcome = driver.run(new PlaceBid(4000, bidder1)); assertThat(outcome.events(), allOf( hasItem(bidPlaced(bidder1, 2000, 4000)), hasSize(1) )); ...
[FOCAL] private Persist<AuctionEvent> AuctionEntity.reply(CommandContext<PlaceBidResult> ctx, PlaceBidResult result) [CLASS] class AuctionEntity extends PersistentEntity<AuctionCommand, AuctionEvent, AuctionState> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] CommandContext<Place...
/* static context [FOCAL] private Persist<AuctionEvent> AuctionEntity.reply(CommandContext<PlaceBidResult> ctx, PlaceBidResult result) [INPUTS] branches=- | result=ctx [COLLABORATORS] param ctx:CommandContext<PlaceBidResult> reply/1,done/0 [CALLS-EXTERNAL] CommandContext<PlaceBidResult>.reply/1, CommandContext<PlaceBid...
/* static context [FOCAL] private Persist<AuctionEvent> AuctionEntity.reply(CommandContext<PlaceBidResult> ctx, PlaceBidResult result) [INPUTS] branches=- | result=ctx [COLLABORATORS] param ctx:CommandContext<PlaceBidResult> reply/1,done/0 [CALLS-EXTERNAL] CommandContext<PlaceBidResult>.reply/1, CommandContext<PlaceBid...
true
ok
{"focal": {"class": "AuctionEntity", "name": "reply", "signature": "Persist<AuctionEvent> reply(CommandContext<PlaceBidResult> ctx, PlaceBidResult result)", "start_line": 3, "modifiers": "private", "params": [{"name": "ctx", "type": "CommandContext<PlaceBidResult>"}, {"name": "result", "type": "PlaceBidResult"}], "retu...
71849550_0
class StringUtils { public static String stripTrailingSlash(String stringWithPossibleTrailingSlash){ if (stringWithPossibleTrailingSlash.endsWith("/")){ return stringWithPossibleTrailingSlash.substring(0, stringWithPossibleTrailingSlash.length()-1); } return stringWithPossibleTrailingSlash; ...
assertEquals("https://some.thing/with/a/slash/on/the/end", StringUtils.stripTrailingSlash("https://some.thing/with/a/slash/on/the/end/")); } }
[FOCAL] public static String StringUtils.stripTrailingSlash(String stringWithPossibleTrailingSlash) [CLASS] class StringUtils [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] String.endsWith/1, String.substring/2, String.length/0 [PATH1] if(stringWithPossibleTrailingSlash.endsWith("...
/* static context [FOCAL] public static String StringUtils.stripTrailingSlash(String stringWithPossibleTrailingSlash) [PATH1] if(stringWithPossibleTrailingSlash.endsWith("/"))=T -> return stringWithPossibleTrailingSlash.substring(0, stringWithPossibleTrai... [PATH2] if(stringWithPossibleTrailingSlash.endsWith("/"))=F -...
/* static context [FOCAL] public static String StringUtils.stripTrailingSlash(String stringWithPossibleTrailingSlash) [PATH1] if(stringWithPossibleTrailingSlash.endsWith("/"))=T -> return stringWithPossibleTrailingSlash.substring(0, stringWithPossibleTrai... [PATH2] if(stringWithPossibleTrailingSlash.endsWith("/"))=F -...
true
ok
{"focal": {"class": "StringUtils", "name": "stripTrailingSlash", "signature": "String stripTrailingSlash(String stringWithPossibleTrailingSlash)", "start_line": 3, "modifiers": "public static", "params": [{"name": "stringWithPossibleTrailingSlash", "type": "String"}], "return_type": "String"}, "class_info": {"name": "S...
71876131_7
class NetworkMapper { public List<com.nilhcem.devfestnantes.data.app.model.Session> toAppSessions(@Nullable List<Session> from, @NonNull Map<Integer, com.nilhcem.devfestnantes.data.app.model.Speaker> speakersMap) { if (from == null) { return null; } return stream(from).map(sess...
// Given LocalDateTime startAt = LocalDateTime.now(); Session session = new Session(1, startAt, 20, Room.NONE.id, singletonList(10), "title", "description"); Map<Integer, com.nilhcem.devfestnantes.data.app.model.Speaker> speakersMap = new HashMap<>(); speakersMap.put(10, new com....
[FOCAL] public List<com.nilhcem.devfestnantes.data.app.model.Session> NetworkMapper.toAppSessions(List<Session> from, Map<Integer, com.nilhcem.devfestnantes.data.app.model.Speaker> speakersMap) [CLASS] class NetworkMapper [METRICS] loc=12 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] stream(from...
/* static context [FOCAL] public List<com.nilhcem.devfestnantes.data.app.model.Session> NetworkMapper.toAppSessions(List<Session> from, Map<Integer, com.nilhcem.devfestnantes.data.app.model.Speaker> speakersMap) [PATH1] if(from == null)=T -> return null [PATH2] if(from == null)=F -> return stream(from).map(session -> n...
/* static context [FOCAL] public List<com.nilhcem.devfestnantes.data.app.model.Session> NetworkMapper.toAppSessions(List<Session> from, Map<Integer, com.nilhcem.devfestnantes.data.app.model.Speaker> speakersMap) [PATH1] if(from == null)=T -> return null [PATH2] if(from == null)=F -> return stream(from).map(session -> n...
true
ok
{"focal": {"class": "NetworkMapper", "name": "toAppSessions", "signature": "List<com.nilhcem.devfestnantes.data.app.model.Session> toAppSessions(List<Session> from, Map<Integer, com.nilhcem.devfestnantes.data.app.model.Speaker> speakersMap)", "start_line": 3, "modifiers": "public", "params": [{"name": "from", "type": "...
71912078_0
class PhoneLocationEngine { public PhoneType matchPhone(String number) { // check the number is telephone or cellphone Matcher cellphoneMatcher = cellphonePattern.matcher(number); if(cellphoneMatcher.matches()) { return PhoneType.CELL; } Matcher telephoneMatcher ...
PhoneLocationEngine engine = new PhoneLocationEngine(); PhoneType[] phones = new PhoneType[] { new PhoneType("010-1234567", PhoneLocationEngine.PhoneType.TELE), new PhoneType("0101234567", PhoneLocationEngine.PhoneType.TELE), new PhoneType("17000000000", ...
[FOCAL] public PhoneType PhoneLocationEngine.matchPhone(String number) [CLASS] class PhoneLocationEngine [METRICS] loc=12 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] cellphonePattern.matcher/1, Matcher.matches/0, telephonePattern.matcher/1 [PATH1] if(cellphoneMatcher.matches())=F -> if(telepho...
/* static context [FOCAL] public PhoneType PhoneLocationEngine.matchPhone(String number) [PATH1] if(cellphoneMatcher.matches())=F -> if(telephoneMatcher.matches())=T -> return PhoneType.TELE [PATH2] if(cellphoneMatcher.matches())=T -> return PhoneType.CELL [PATH3] if(cellphoneMatcher.matches())=F -> if(telephoneMatcher...
/* static context [FOCAL] public PhoneType PhoneLocationEngine.matchPhone(String number) [PATH1] if(cellphoneMatcher.matches())=F -> if(telephoneMatcher.matches())=T -> return PhoneType.TELE [PATH2] if(cellphoneMatcher.matches())=T -> return PhoneType.CELL [PATH3] if(cellphoneMatcher.matches())=F -> if(telephoneMatcher...
true
ok
{"focal": {"class": "PhoneLocationEngine", "name": "matchPhone", "signature": "PhoneType matchPhone(String number)", "start_line": 3, "modifiers": "public", "params": [{"name": "number", "type": "String"}], "return_type": "PhoneType"}, "class_info": {"name": "PhoneLocationEngine", "kind": "class", "modifiers": "", "sup...
71924391_3
class UserPresenter { public void start() { mDataSource.getUser(mLoadUserCallback); } public UserPresenter(UserRepository dataSource, UserView view); public void stop(); public void updateUserName(final String userName); private LoadUserCallback createLoadUserCallback(); private ...
//Given that start is called mPresenter.start(); // Callback is captured verify(mUserRepository).getUser(mLoadUserCallbackArgumentCaptor.capture()); // When the user is loaded User user = new User("user name"); mLoadUserCallbackArgumentCaptor.getValue().onUserLoa...
[FOCAL] public void UserPresenter.start() [CLASS] class UserPresenter [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] mDataSource.getUser/1 [COLLABORATORS] field mDataSource getUser/1 [CLASS-MEMBERS] UserPresenter(UserRepository dataSource, UserView view); void stop(); void updateU...
/* static context [FOCAL] public void UserPresenter.start() [COLLABORATORS] field mDataSource getUser/1 [CALLS-EXTERNAL] mDataSource.getUser/1 */
/* static context [FOCAL] public void UserPresenter.start() [COLLABORATORS] field mDataSource getUser/1 [CALLS-EXTERNAL] mDataSource.getUser/1 */ class UserPresenter { public void start() { mDataSource.getUser(mLoadUserCallback); } public UserPresenter(UserRepository dataSource, UserView view); ...
true
ok
{"focal": {"class": "UserPresenter", "name": "start", "signature": "void start()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "UserPresenter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "mUserRepository", "type"...
71975377_141
class ComplexUtils { public static double[] complex2Interleaved(Complex[] c) { int index = 0; final double[] i = new double[c.length * 2]; for (final Complex cc : c) { final int real = index * 2; final int imag = index * 2 + 1; i[real] = cc.getReal(); ...
Assertions.assertThrows(IllegalArgumentException.class, () -> ComplexUtils.complex2Interleaved(c2d, -1) ); } }
[FOCAL] public static double[] ComplexUtils.complex2Interleaved(Complex[] c) [CLASS] class ComplexUtils [METRICS] loc=12 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Complex.getReal/0, Complex.getImaginary/0 [PATH1] foreach(Complex cc : c)=T -> exit loop -> return i [PATH2] foreach(Complex cc :...
class ComplexUtils { public static double[] complex2Interleaved(Complex[] c) { int index = 0; final double[] i = new double[c.length * 2]; for (final Complex cc : c) { final int real = index * 2; final int imag = index * 2 + 1; i[real] = cc.getReal(); ...
false
ok
{"focal": {"class": "ComplexUtils", "name": "complex2Interleaved", "signature": "double[] complex2Interleaved(Complex[] c)", "start_line": 3, "modifiers": "public static", "params": [{"name": "c", "type": "Complex[]"}], "return_type": "double[]"}, "class_info": {"name": "ComplexUtils", "kind": "class", "modifiers": "",...
71982467_4
class KerberosUtil { static final String[] getPrincipalNames(String keytabFileName) throws IOException { Keytab keytab = Keytab.read(new File(keytabFileName)); Set<String> principals = new HashSet<String>(); List<KeytabEntry> entries = keytab.getEntries(); for (KeytabEntry entry : e...
try { KerberosUtil.getPrincipalNames(testKeytab); Assert.fail("Exception should have been thrown"); } catch (IOException e) { //expects exception } } }
[FOCAL] static final String[] KerberosUtil.getPrincipalNames(String keytabFileName) [CLASS] class KerberosUtil [METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Keytab.read/1, Keytab.getEntries/0, Set<String>.add/1, entry.getPrincipalName().replace/2, KeytabEntry.getPrincipalName/0, ...
/* static context [FOCAL] static final String[] KerberosUtil.getPrincipalNames(String keytabFileName) [PATH1] foreach(KeytabEntry entry : entries)=T -> exit loop -> return principals.toArray(new String[0]) [PATH2] foreach(KeytabEntry entry : entries)=F -> return principals.toArray(new String[0]) [INPUTS] branches=keyta...
/* static context [FOCAL] static final String[] KerberosUtil.getPrincipalNames(String keytabFileName) [PATH1] foreach(KeytabEntry entry : entries)=T -> exit loop -> return principals.toArray(new String[0]) [PATH2] foreach(KeytabEntry entry : entries)=F -> return principals.toArray(new String[0]) [INPUTS] branches=keyta...
true
ok
{"focal": {"class": "KerberosUtil", "name": "getPrincipalNames", "signature": "String[] getPrincipalNames(String keytabFileName) throws IOException", "start_line": 3, "modifiers": "static final", "params": [{"name": "keytabFileName", "type": "String"}], "return_type": "String[]"}, "class_info": {"name": "KerberosUtil",...
72001417_0
class CommonUtils { public static boolean isPasswordValid(String password) { if (isEmpty(password)) { return false; } String regex = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,20}$"; Pattern p = Pattern.compile(regex); Matcher matcher = p.matcher(password); ...
assertTrue(CommonUtils.isPasswordValid("12345678abc")); assertFalse(CommonUtils.isPasswordValid("12345678")); assertFalse(CommonUtils.isPasswordValid("123456789")); assertFalse(CommonUtils.isPasswordValid("aa")); assertFalse(CommonUtils.isPasswordValid("aaaaaaaa")); asser...
[FOCAL] public static boolean CommonUtils.isPasswordValid(String password) [CLASS] class CommonUtils [METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] boolean isEmpty(CharSequence str) [CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Matcher.matches/0 [PATH1] if(isEmpty(passwor...
/* static context [FOCAL] public static boolean CommonUtils.isPasswordValid(String password) [PATH1] if(isEmpty(password))=T -> return false [PATH2] if(isEmpty(password))=F -> return matcher.matches() [INPUTS] branches=password | result=password [CALLS-INTERNAL] boolean isEmpty(CharSequence str) [CALLS-EXTERNAL] Patter...
/* static context [FOCAL] public static boolean CommonUtils.isPasswordValid(String password) [PATH1] if(isEmpty(password))=T -> return false [PATH2] if(isEmpty(password))=F -> return matcher.matches() [INPUTS] branches=password | result=password [CALLS-INTERNAL] boolean isEmpty(CharSequence str) [CALLS-EXTERNAL] Patter...
true
ok
{"focal": {"class": "CommonUtils", "name": "isPasswordValid", "signature": "boolean isPasswordValid(String password)", "start_line": 3, "modifiers": "public static", "params": [{"name": "password", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "CommonUtils", "kind": "class", "modifiers": "", "su...
72017294_4
class TextureStyleTranslator implements IStyleDecoder<Texture>, IStyleEncoder<Texture>, IStyleValidator<Texture> { @Override public Texture decode(String style) { if (!style.startsWith("url(") && !style.startsWith("assets(")) return Texture.EMPTY; if (style.startsWith("url(")) ...
Texture textureUVST = new Texture("brokkgui:textures/gui/container_background.png", 16, 16, 32, 32); assertThat(adapter.decode("url(\"brokkgui:textures/gui/container_background.png\", 16, 16,32, 32 )")) .isEqualTo(textureUVST); } }
[FOCAL] @Override public Texture TextureStyleTranslator.decode(String style) [CLASS] class TextureStyleTranslator implements IStyleDecoder<Texture>, IStyleEncoder<Texture>, IStyleValidator<Texture> [METRICS] loc=54 cc=11 branches=9 loops=1 returns=2 throws=0 nesting=6 [CALLS-EXTERNAL] String.startsWith/1, BrokkGuiPlatf...
/* static context [FOCAL] @Override public Texture TextureStyleTranslator.decode(String style) [PATH1] if(!style.startsWith("url(") && !style.startsWith("assets("))=F -> if(style.startsWith("url("))=T -> for(index < split.length)=T -> if(index == 0)=F -> if(split[index].contains("px"))=F -> if(index == 1)=F -> if(index...
/* static context [FOCAL] @Override public Texture TextureStyleTranslator.decode(String style) [PATH1] if(!style.startsWith("url(") && !style.startsWith("assets("))=F -> if(style.startsWith("url("))=T -> for(index < split.length)=T -> if(index == 0)=F -> if(split[index].contains("px"))=F -> if(index == 1)=F -> if(index...
true
ok
{"focal": {"class": "TextureStyleTranslator", "name": "decode", "signature": "Texture decode(String style)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "style", "type": "String"}], "return_type": "Texture"}, "class_info": {"name": "TextureStyleTranslator", "kind": "class", "modifiers": "", "s...
72129238_1
class Json { public static Object parse(String str) { StringStream ss = new StringStream(str); Object result = parseGeneral(ss); if (result instanceof Symbol) throw new IllegalArgumentException("Malformed JSON"); if (!isSymbol(parseGeneral(ss), -1)) throw new IllegalArgumentException("Malformed JSON"); ...
String[] cases = { "", " ", "a", "false\"", "trues", "null1", "*", "00", "01", "08", "+0", "+2", "+2.3", "2.3.4", "2e2e2", "2e++0", "2e+-0", "2e--0", "2f", "0x10", "0 0", "0,0", "0 //", "\"", "\"\\", "\"\\\"", "\"\"\"", "\"\\a\"", ...
[FOCAL] public static Object Json.parse(String str) [CLASS] class Json [METRICS] loc=9 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1 [CALLS-INTERNAL] Object parseGeneral(StringStream ss); boolean isSymbol(Object obj, int chr) [NEW] StringStream, IllegalArgumentException [EXCEPTIONS] throws IllegalArgumentExcepti...
/* static context [FOCAL] public static Object Json.parse(String str) [THROWS-WHEN] IllegalArgumentException when result instanceof Symbol [THROWS-WHEN] IllegalArgumentException when !(result instanceof Symbol) && !isSymbol(parseGeneral(ss), -1) [PATH1] if(result instanceof Symbol)=F -> if(!isSymbol(parseGeneral(ss), -...
/* static context [FOCAL] public static Object Json.parse(String str) [THROWS-WHEN] IllegalArgumentException when result instanceof Symbol [THROWS-WHEN] IllegalArgumentException when !(result instanceof Symbol) && !isSymbol(parseGeneral(ss), -1) [PATH1] if(result instanceof Symbol)=F -> if(!isSymbol(parseGeneral(ss), -...
true
ok
{"focal": {"class": "Json", "name": "parse", "signature": "Object parse(String str)", "start_line": 3, "modifiers": "public static", "params": [{"name": "str", "type": "String"}], "return_type": "Object"}, "class_info": {"name": "Json", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields":...
72188443_6
class SimpleAttributeProvider extends AbstractAttributeProvider { @Override protected HashBasedTable<Optional<String>, Optional<Locale>, String> getAttributeValue(final Collection<Locale> locales, final ProductModel product, final MetaAttributeData metaAttribute) { final HashBasedTable<Optional<String>, Option...
final ProductModel product = new ProductModel(); product.setCode("productCode"); final ComposedTypeModel composedType = new ComposedTypeModel(); final MetaAttributeData metaAttribute = new MetaAttributeData(); metaAttribute.setBaseType(FhAttributeBaseType.FLOAT); metaAttribute.setAttributeId("price"); me...
[FOCAL] @Override protected HashBasedTable<Optional<String>, Optional<Locale>, String> SimpleAttributeProvider.getAttributeValue(Collection<Locale> locales, ProductModel product, MetaAttributeData metaAttribute) [CLASS] class SimpleAttributeProvider extends AbstractAttributeProvider [METRICS] loc=37 cc=4 branches=2 loo...
/* static context [FOCAL] @Override protected HashBasedTable<Optional<String>, Optional<Locale>, String> SimpleAttributeProvider.getAttributeValue(Collection<Locale> locales, ProductModel product, MetaAttributeData metaAttribute) [PATH1] if(typeService.hasAttribute(composedType, qualifier))=T -> if(CollectionUtils.isNo...
/* static context [FOCAL] @Override protected HashBasedTable<Optional<String>, Optional<Locale>, String> SimpleAttributeProvider.getAttributeValue(Collection<Locale> locales, ProductModel product, MetaAttributeData metaAttribute) [PATH1] if(typeService.hasAttribute(composedType, qualifier))=T -> if(CollectionUtils.isNo...
true
ok
{"focal": {"class": "SimpleAttributeProvider", "name": "getAttributeValue", "signature": "HashBasedTable<Optional<String>, Optional<Locale>, String> getAttributeValue(Collection<Locale> locales, ProductModel product, MetaAttributeData metaAttribute)", "start_line": 3, "modifiers": "@Override protected", "params": [{"na...
72240906_14
class IntValidator implements Validator<Integer> { @Override public boolean isSpecificationValid() { return true; } @Override public String getInvalidSpecificationMessage(); } class IntValidatorTest { @Test public void testLessThanOrEqualsToIsSpecificationValid() {
IntValidator.LessThanOrEqualTo instance = new IntValidator.LessThanOrEqualTo(5); assertTrue(instance.isSpecificationValid()); instance = new IntValidator.LessThanOrEqualTo(-999999999); assertTrue(instance.isSpecificationValid()); } }
[FOCAL] @Override public boolean IntValidator.isSpecificationValid() [CLASS] class IntValidator implements Validator<Integer> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] String getInvalidSpecificationMessage() [TEST] IntValidatorTest: @Test public void testLessThanOrEqualsToIsSp...
/* static context [FOCAL] @Override public boolean IntValidator.isSpecificationValid() */
/* static context [FOCAL] @Override public boolean IntValidator.isSpecificationValid() */ class IntValidator implements Validator<Integer> { @Override public boolean isSpecificationValid() { return true; } @Override public String getInvalidSpecificationMessage(); } class IntValidatorTest { @Test public voi...
true
ok
{"focal": {"class": "IntValidator", "name": "isSpecificationValid", "signature": "boolean isSpecificationValid()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "IntValidator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Valida...
72241120_4
class StopwatchImpl extends AbstractStopwatch { @NonNull @Override public Observable<Long> start() { if (timerObservable != null) { LogUtil.d(TAG, "start(). Returning original Observable"); return timerObservable; } LogUtil.d(TAG, "start(). Returning new Obs...
// Setup TestSubscriber<Long> testSubscriber = resetTest(); // Exercise stopwatch.start().subscribe(testSubscriber); advanceTimeBy(5L); // Verify testSubscriber.assertValues(1L, 2L, 3L, 4L, 5L); } }
[FOCAL] @NonNull @Override public Observable<Long> StopwatchImpl.start() [CLASS] class StopwatchImpl extends AbstractStopwatch [METRICS] loc=21 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] boolean isNotPaused() [CALLS-EXTERNAL] LogUtil.d/2, TestTimeProvider.now/0, Observable.interval(1, TIME_UN...
/* static context [FOCAL] @NonNull @Override public Observable<Long> StopwatchImpl.start() [PATH1] if(timerObservable != null)=T -> return timerObservable [PATH2] if(timerObservable != null)=F -> return timerObservable [INPUTS] branches=- | result=timeProvider [COLLABORATORS] field timeProvider:TestTimeProvider now/0 [...
/* static context [FOCAL] @NonNull @Override public Observable<Long> StopwatchImpl.start() [PATH1] if(timerObservable != null)=T -> return timerObservable [PATH2] if(timerObservable != null)=F -> return timerObservable [INPUTS] branches=- | result=timeProvider [COLLABORATORS] field timeProvider:TestTimeProvider now/0 [...
true
ok
{"focal": {"class": "StopwatchImpl", "name": "start", "signature": "Observable<Long> start()", "start_line": 3, "modifiers": "@NonNull @Override public", "params": [], "return_type": "Observable<Long>"}, "class_info": {"name": "StopwatchImpl", "kind": "class", "modifiers": "", "superclass": "AbstractStopwatch", "interf...
72283823_12
class Palindrome { public void init() { final int MAX_LENGTH_OF_WORD = 5; try (Scanner sc = new Scanner(System.in)) { String line = sc.nextLine(); if (line.length() == MAX_LENGTH_OF_WORD) { StringBuilder sbReverseWord = new StringBuilder(); fo...
String testWord = "Камок"; System.setIn(new ByteArrayInputStream(testWord.getBytes())); new Palindrome().init(); assertThat(this.out.toString(), is(String.format("%s is NOT palindrome%s", testWord, sep))); } }
[FOCAL] public void Palindrome.init() [CLASS] class Palindrome [METRICS] loc=19 cc=4 branches=2 loops=1 returns=0 throws=0 nesting=3 [CALLS-INTERNAL] void print(String word, String msg) [CALLS-EXTERNAL] Scanner.nextLine/0, String.length/0, StringBuilder.append/1, String.charAt/1, line.toLowerCase().equals/1, String.toL...
/* static context [FOCAL] public void Palindrome.init() [PATH1] if(line.length() == MAX_LENGTH_OF_WORD)=T -> for(i >= 0)=T -> exit loop -> if(line.toLowerCase().equals(sbReverseWord.toString().toLowerCase()))=T [PATH2] if(line.length() == MAX_LENGTH_OF_WORD)=T -> for(i >= 0)=F -> if(line.toLowerCase().equals(sbReverseW...
/* static context [FOCAL] public void Palindrome.init() [PATH1] if(line.length() == MAX_LENGTH_OF_WORD)=T -> for(i >= 0)=T -> exit loop -> if(line.toLowerCase().equals(sbReverseWord.toString().toLowerCase()))=T [PATH2] if(line.length() == MAX_LENGTH_OF_WORD)=T -> for(i >= 0)=F -> if(line.toLowerCase().equals(sbReverseW...
true
ok
{"focal": {"class": "Palindrome", "name": "init", "signature": "void init()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "Palindrome", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "sep", "type": "String", "modifie...
72366767_64
class ArticleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { @VisibleForTesting int getItemResourceFromType(int viewType) { switch (viewType) { case TYPE_HEADER_IMAGE: return R.layout.article_item_header; case TYPE_TITLE: return R.layout.ar...
assertEquals( R.layout.article_item_header_6, adapter.getItemResourceFromType(ArticleAdapter.TYPE_HEADER_6)); } }
[FOCAL] @VisibleForTesting int ArticleAdapter.getItemResourceFromType(int viewType) [CLASS] class ArticleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> [METRICS] loc=20 cc=15 branches=1 loops=0 returns=15 throws=0 nesting=1 [PATH1] switch(viewType)=case TYPE_HEADER_IMAGE -> return R.layout.article_item_h...
/* static context [FOCAL] @VisibleForTesting int ArticleAdapter.getItemResourceFromType(int viewType) [PATH1] switch(viewType)=case TYPE_HEADER_IMAGE -> return R.layout.article_item_header [PATH2] switch(viewType)=case TYPE_TITLE -> return R.layout.article_item_title [PATH3] switch(viewType)=case TYPE_PARAGRAPH -> retu...
/* static context [FOCAL] @VisibleForTesting int ArticleAdapter.getItemResourceFromType(int viewType) [PATH1] switch(viewType)=case TYPE_HEADER_IMAGE -> return R.layout.article_item_header [PATH2] switch(viewType)=case TYPE_TITLE -> return R.layout.article_item_title [PATH3] switch(viewType)=case TYPE_PARAGRAPH -> retu...
true
ok
{"focal": {"class": "ArticleAdapter", "name": "getItemResourceFromType", "signature": "int getItemResourceFromType(int viewType)", "start_line": 3, "modifiers": "@VisibleForTesting", "params": [{"name": "viewType", "type": "int"}], "return_type": "int"}, "class_info": {"name": "ArticleAdapter", "kind": "class", "modifi...
72403045_22
class Database implements AutoCloseable { public <T> Single<T> apply(Function<? super Connection, ? extends T> function) { return member().map(member -> { try { return function.apply(member.value()); } finally { member.checkin(); } ...
Database db = DatabaseCreator.createDerbyWithStoredProcs(1); db.apply(con -> { try (Statement stmt = con.createStatement()) { CallableStatement st = con.prepareCall("call in1out0rs2(?)"); st.setInt(1, 0); st.execute(); ResultSet...
[FOCAL] public Single<T> Database.apply(Function<? super Connection, ? extends T> function) [CLASS] class Database implements AutoCloseable [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Single<Member<Connection>> member() [CALLS-EXTERNAL] member().map/1, Function<? super Connecti...
/* static context [FOCAL] public Single<T> Database.apply(Function<? super Connection, ? extends T> function) [INPUTS] branches=- | result=function [COLLABORATORS] param function:Function<? super Connection, ? extends T> apply/1; field member value/0,checkin/0 [CALLS-INTERNAL] Single<Member<Connection>> member() [CALLS...
/* static context [FOCAL] public Single<T> Database.apply(Function<? super Connection, ? extends T> function) [INPUTS] branches=- | result=function [COLLABORATORS] param function:Function<? super Connection, ? extends T> apply/1; field member value/0,checkin/0 [CALLS-INTERNAL] Single<Member<Connection>> member() [CALLS...
true
ok
{"focal": {"class": "Database", "name": "apply", "signature": "Single<T> apply(Function<? super Connection, ? extends T> function)", "start_line": 3, "modifiers": "public", "params": [{"name": "function", "type": "Function<? super Connection, ? extends T>"}], "return_type": "Single<T>"}, "class_info": {"name": "Databas...
72428844_19
class ChangesDetector { public void newData(@Nonnull ChangesAdapter adapter, @Nonnull List<? extends T> values, boolean force) { checkNotNull(adapter); checkNotNull(values); final H[] list = apply(values); final ArrayList<H> objects ...
detector.newData(adapter, ImmutableList.of(new Cat(1), new Cat(2), new Cat(3)), false); reset(adapter); detector.newData(adapter, ImmutableList.of(new Cat(1), new Cat(2).withName("two1"), new Cat(3).withName("tree1")), false); verify(adapter).notifyItemRangeChanged(1, 2); } }
[FOCAL] public void ChangesDetector.newData(ChangesAdapter adapter, List<? extends T> values, boolean force) [CLASS] class ChangesDetector [METRICS] loc=60 cc=8 branches=6 loops=1 returns=0 throws=0 nesting=5 [CALLS-INTERNAL] H[] apply(List<? extends T> values); boolean existInList(H[] list, int start, H search); int i...
/* static context [FOCAL] public void ChangesDetector.newData(ChangesAdapter adapter, List<? extends T> values, boolean force) [PATH1] for(successPosition < list.length)=T -> if(i < 0)=F -> if(i == offset)=F -> if(existInList(list, successPosition + 1, first))=T -> if(force || !mDetector.same(item, objects.get(i)))=T -...
/* static context [FOCAL] public void ChangesDetector.newData(ChangesAdapter adapter, List<? extends T> values, boolean force) [PATH1] for(successPosition < list.length)=T -> if(i < 0)=F -> if(i == offset)=F -> if(existInList(list, successPosition + 1, first))=T -> if(force || !mDetector.same(item, objects.get(i)))=T -...
true
ok
{"focal": {"class": "ChangesDetector", "name": "newData", "signature": "void newData(ChangesAdapter adapter, List<? extends T> values, boolean force)", "start_line": 3, "modifiers": "public", "params": [{"name": "adapter", "type": "ChangesAdapter"}, {"name": "values", "type": "List<? extends T>"}, {"name": "force", "ty...
72436214_29
class ConstituencyAssociationService { @Transactional public Try<User> associateToUser(User permissible, UUID constituencyID, UUID userID) { if (!permissible.isAdmin()) { log.error("Non admin attempted to associate user={} to constituency={}. loggedInUser={}", userID, constituencyID, permis...
User admin = user().withRole(Role.ADMIN).build(); User user = user().withConstituencies(new HashSet<>()).build(); Constituency constituency = constituency().build(); given(constituencyRepository.findOne(constituency.getId())).willReturn(constituency); given(userRepository.findOne...
[FOCAL] @Transactional public Try<User> ConstituencyAssociationService.associateToUser(User permissible, UUID constituencyID, UUID userID) [CLASS] class ConstituencyAssociationService [METRICS] loc=25 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1 [CALLS-EXTERNAL] User.isAdmin/0, log.error/4, Try.failure/1, Const...
/* static context [FOCAL] @Transactional public Try<User> ConstituencyAssociationService.associateToUser(User permissible, UUID constituencyID, UUID userID) [PATH1] if(!permissible.isAdmin())=F -> if(constituency == null)=F -> if(foundUser == null)=T -> return Try.failure(new NotFoundFailure("No user with ID " + userID...
/* static context [FOCAL] @Transactional public Try<User> ConstituencyAssociationService.associateToUser(User permissible, UUID constituencyID, UUID userID) [PATH1] if(!permissible.isAdmin())=F -> if(constituency == null)=F -> if(foundUser == null)=T -> return Try.failure(new NotFoundFailure("No user with ID " + userID...
true
ok
{"focal": {"class": "ConstituencyAssociationService", "name": "associateToUser", "signature": "Try<User> associateToUser(User permissible, UUID constituencyID, UUID userID)", "start_line": 3, "modifiers": "@Transactional public", "params": [{"name": "permissible", "type": "User"}, {"name": "constituencyID", "type": "UU...
72462669_13
class StackdriverSpanConsumer implements SpanConsumer { @Override public Call<Void> accept(List<Span> spans) { if (spans.isEmpty()) return Call.create(null); List<com.google.devtools.cloudtrace.v2.Span> stackdriverSpans = SpanTranslator.translate(projectId, spans); BatchWriteSpansRequest reques...
onClientCall( observer -> { observer.onNext(Empty.getDefaultInstance()); observer.onCompleted(); }); spanConsumer.accept(asList(TestObjects.CLIENT_SPAN)).execute(); ArgumentCaptor<BatchWriteSpansRequest> requestCaptor = ArgumentCaptor.forClass(BatchWriteSpansReq...
[FOCAL] @Override public Call<Void> StackdriverSpanConsumer.accept(List<Span> spans) [CLASS] class StackdriverSpanConsumer implements SpanConsumer [METRICS] loc=12 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] List<Span>.isEmpty/0, Call.create/1, SpanTranslator.translate/2, BatchWriteSpansReques...
/* static context [FOCAL] @Override public Call<Void> StackdriverSpanConsumer.accept(List<Span> spans) [PATH1] if(spans.isEmpty())=T -> return Call.create(null) [PATH2] if(spans.isEmpty())=F -> return new BatchWriteSpansCall(grpcClient, request) [INPUTS] branches=spans | result=spans, projectId [COLLABORATORS] param sp...
/* static context [FOCAL] @Override public Call<Void> StackdriverSpanConsumer.accept(List<Span> spans) [PATH1] if(spans.isEmpty())=T -> return Call.create(null) [PATH2] if(spans.isEmpty())=F -> return new BatchWriteSpansCall(grpcClient, request) [INPUTS] branches=spans | result=spans, projectId [COLLABORATORS] param sp...
true
ok
{"focal": {"class": "StackdriverSpanConsumer", "name": "accept", "signature": "Call<Void> accept(List<Span> spans)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "spans", "type": "List<Span>"}], "return_type": "Call<Void>"}, "class_info": {"name": "StackdriverSpanConsumer", "kind": "class", "mo...
72479874_10
class IntentTag extends ParameterizedTag { static void parseAndSetExtra(Bundle target, String name, String value) { Matcher m = EXTRAS_VALUE_CAST_PATTERN.matcher(value); if (m.matches()) { String type = m.group(2); String rawValue = m.group(3); String booleanValu...
IntentTag.parseAndSetExtra(mBundle, "zero", "int(0)"); verify(mBundle).putInt("zero", 0); IntentTag.parseAndSetExtra(mBundle, "one", "int(1)"); verify(mBundle).putInt("one", 1); IntentTag.parseAndSetExtra(mBundle, "neg_one", "int(-1)"); verify(mBundle).putInt("neg_one",...
[FOCAL] static void IntentTag.parseAndSetExtra(Bundle target, String name, String value) [CLASS] class IntentTag extends ParameterizedTag [METRICS] loc=47 cc=12 branches=3 loops=0 returns=1 throws=1 nesting=4 [CALLS-EXTERNAL] EXTRAS_VALUE_CAST_PATTERN.matcher/1, Matcher.matches/0, Matcher.group/1, Bundle.putBoolean/2, ...
/* static context [FOCAL] static void IntentTag.parseAndSetExtra(Bundle target, String name, String value) [THROWS-WHEN] BadParameterException when m.matches() && !(type == null && booleanValue != null) && try-body throws [PATH1] if(m.matches())=T -> if(type == null && booleanValue != null)=F -> try-body throws -> thro...
/* static context [FOCAL] static void IntentTag.parseAndSetExtra(Bundle target, String name, String value) [THROWS-WHEN] BadParameterException when m.matches() && !(type == null && booleanValue != null) && try-body throws [PATH1] if(m.matches())=T -> if(type == null && booleanValue != null)=F -> try-body throws -> thro...
true
ok
{"focal": {"class": "IntentTag", "name": "parseAndSetExtra", "signature": "void parseAndSetExtra(Bundle target, String name, String value)", "start_line": 3, "modifiers": "static", "params": [{"name": "target", "type": "Bundle"}, {"name": "name", "type": "String"}, {"name": "value", "type": "String"}], "return_type": "...
72495006_4
class StackdriverMonitoringReporter extends ScheduledReporter { @Override public void report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers) { String now = new DateTime(cloc...
reporter.report(map("gauge", gauge(1.1f)), this.map(), this.map(), this.map(), this.map()); assertTimeSeries(1, "gauge", GAUGE, T0, 1.1f ); } }
[FOCAL] @Override public void StackdriverMonitoringReporter.report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers) [CLASS] class StackdriverMonitoringReporter extends ScheduledReporter [METRI...
/* static context [FOCAL] @Override public void StackdriverMonitoringReporter.report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers) [PATH1] foreach(Map.Entry<String, Gauge> entry : gauges.en...
/* static context [FOCAL] @Override public void StackdriverMonitoringReporter.report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers) [PATH1] foreach(Map.Entry<String, Gauge> entry : gauges.en...
true
ok
{"focal": {"class": "StackdriverMonitoringReporter", "name": "report", "signature": "void report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers)", "start_line": 3, "modifiers": "@Override pub...
72517914_15
class Geocoding { public Maybe<Address> fromLocation(@NonNull Location location) { return fromLocation(null, location, 1).flatMapMaybe(ADDRESS_MAYBE_FUNCTION); } Geocoding(Context context); Geocoder getGeocoder(Locale locale); public Maybe<Address> fromLocation(Locale locale, @NonNull ...
doReturn(addressList).when(geocoder).getFromLocation(latitude, longitude, 1); geocoding.fromLocation(locale, latitude, longitude, 1).test() .assertValue(addressList) .assertComplete(); verifyGeocoderWithLocale(); } }
[FOCAL] public Maybe<Address> Geocoding.fromLocation(Location location) [CLASS] class Geocoding [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Single<List<Address>> fromLocation(Locale locale, Location location, int maxResults) [CALLS-EXTERNAL] fromLocation(null, location, 1).flat...
/* static context [FOCAL] public Maybe<Address> Geocoding.fromLocation(Location location) [INPUTS] branches=- | result=location [CALLS-INTERNAL] Single<List<Address>> fromLocation(Locale locale, Location location, int maxResults) [CALLS-EXTERNAL] fromLocation(null, location, 1).flatMapMaybe/1 */
/* static context [FOCAL] public Maybe<Address> Geocoding.fromLocation(Location location) [INPUTS] branches=- | result=location [CALLS-INTERNAL] Single<List<Address>> fromLocation(Locale locale, Location location, int maxResults) [CALLS-EXTERNAL] fromLocation(null, location, 1).flatMapMaybe/1 */ class Geocoding { ...
true
ok
{"focal": {"class": "Geocoding", "name": "fromLocation", "signature": "Maybe<Address> fromLocation(Location location)", "start_line": 3, "modifiers": "public", "params": [{"name": "location", "type": "Location"}], "return_type": "Maybe<Address>"}, "class_info": {"name": "Geocoding", "kind": "class", "modifiers": "", "s...
72586987_3
class AES { public static String unPackString(byte[] bytes) throws UnsupportedEncodingException { return new String(unPackBytes(bytes), "UTF-8"); } public static byte[] encrypt(byte[] bytes, byte[] encryptionKey); public static byte[] decrypt(byte[] cipherText, byte[] encryptionKey); publi...
assertThat(AES.unPackString(AES.pack(unpaddedtext)), is(unpaddedtext)); } }
[FOCAL] public static String AES.unPackString(byte[] bytes) [CLASS] class AES [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] byte[] unPackBytes(byte[] bytes) [NEW] String [EXCEPTIONS] declares UnsupportedEncodingException [INPUTS] branches=- | result=bytes [DATAFLOW] bytes@param->...
/* static context [FOCAL] public static String AES.unPackString(byte[] bytes) [INPUTS] branches=- | result=bytes [EXCEPTIONS] declares UnsupportedEncodingException [CALLS-INTERNAL] byte[] unPackBytes(byte[] bytes) [NEW] String */
/* static context [FOCAL] public static String AES.unPackString(byte[] bytes) [INPUTS] branches=- | result=bytes [EXCEPTIONS] declares UnsupportedEncodingException [CALLS-INTERNAL] byte[] unPackBytes(byte[] bytes) [NEW] String */ class AES { public static String unPackString(byte[] bytes) throws UnsupportedEncodin...
true
ok
{"focal": {"class": "AES", "name": "unPackString", "signature": "String unPackString(byte[] bytes) throws UnsupportedEncodingException", "start_line": 3, "modifiers": "public static", "params": [{"name": "bytes", "type": "byte[]"}], "return_type": "String"}, "class_info": {"name": "AES", "kind": "class", "modifiers": "...
72695594_90
class TileInfo { public Map<String, String> getSpriteFilenames() { return spriteFilenames; } TileInfo(Tiles type); public static Map<Tiles, TileInfo> getTileRegistry(); public static boolean hasLoaded(); public static void registerTiles(); private static void registerTile(TileInfo tile); public static vo...
Map<String, String> fileNames = testGasTile.getSpriteFilenames(); assert (fileNames.keySet().size() == 1); assert (fileNames.keySet().contains("DEFAULT")); assert (fileNames.get("DEFAULT").equals("sprites/tiles/air.png")); } }
[FOCAL] public Map<String, String> TileInfo.getSpriteFilenames() [CLASS] class TileInfo [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] TileInfo(Tiles type); Map<Tiles, TileInfo> getTileRegistry(); boolean hasLoaded(); void registerTiles(); void registerTile(TileInfo tile); void cle...
/* static context [FOCAL] public Map<String, String> TileInfo.getSpriteFilenames() */
/* static context [FOCAL] public Map<String, String> TileInfo.getSpriteFilenames() */ class TileInfo { public Map<String, String> getSpriteFilenames() { return spriteFilenames; } TileInfo(Tiles type); public static Map<Tiles, TileInfo> getTileRegistry(); public static boolean hasLoaded(); public static voi...
true
ok
{"focal": {"class": "TileInfo", "name": "getSpriteFilenames", "signature": "Map<String, String> getSpriteFilenames()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Map<String, String>"}, "class_info": {"name": "TileInfo", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null,...
72700804_0
class DecimalUtils { public static String toDecimal(long seconds, int nanoseconds) { StringBuilder sb = new StringBuilder(20) .append(seconds) .append('.'); // 14-Mar-2016, tatu: Although we do not yet (with 2.7) trim trailing zeroes, // for general case, ...
String decimal = DecimalUtils.toDecimal(0, 0); assertEquals("The returned decimal is not correct.", NO_NANOSECS_SER, decimal); decimal = DecimalUtils.toDecimal(15, 72); assertEquals("The returned decimal is not correct.", "15.000000072", decimal); decimal = DecimalUtils.toDecim...
[FOCAL] public static String DecimalUtils.toDecimal(long seconds, int nanoseconds) [CLASS] class DecimalUtils [METRICS] loc=43 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] new StringBuilder(20) .append(seconds).append/1, new StringBuilder(20).append/1, StringBuilder.append/1, StringBuilder.leng...
/* static context [FOCAL] public static String DecimalUtils.toDecimal(long seconds, int nanoseconds) [PATH1] if(nanoseconds == 0L)=F -> while(prepZeroes > 0)=T -> exit loop -> return sb.toString() [PATH2] if(nanoseconds == 0L)=T -> if(seconds == 0L)=T -> return "0.0" [PATH3] if(nanoseconds == 0L)=T -> if(seconds == 0L)...
/* static context [FOCAL] public static String DecimalUtils.toDecimal(long seconds, int nanoseconds) [PATH1] if(nanoseconds == 0L)=F -> while(prepZeroes > 0)=T -> exit loop -> return sb.toString() [PATH2] if(nanoseconds == 0L)=T -> if(seconds == 0L)=T -> return "0.0" [PATH3] if(nanoseconds == 0L)=T -> if(seconds == 0L)...
true
ok
{"focal": {"class": "DecimalUtils", "name": "toDecimal", "signature": "String toDecimal(long seconds, int nanoseconds)", "start_line": 3, "modifiers": "public static", "params": [{"name": "seconds", "type": "long"}, {"name": "nanoseconds", "type": "int"}], "return_type": "String"}, "class_info": {"name": "DecimalUtils"...