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 |
|---|---|---|---|---|---|---|---|---|
55726733_21 | class GradleTooling {
public static ProjectInfo loadProjectInfo(Path projectPath) throws Exception {
ProjectInfo projectInfo = null;
GradleConnector connector = GradleConnector.newConnector();
connector.forProjectDirectory(projectPath.toFile());
ProjectConnection connection = null;
try {
connection =... | ProjectInfo projectInfo = GradleTooling.loadProjectInfo(_wsPath);
Assert.assertNotNull("liferay/portal:7.2.0-ga1", projectInfo.getDockerImageLiferay());
}
} | [FOCAL] public static ProjectInfo GradleTooling.loadProjectInfo(Path projectPath)
[CLASS] class GradleTooling
[METRICS] loc=52 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] GradleConnector.newConnector/0, GradleConnector.forProjectDirectory/1, Path.toFile/0, GradleConnector.connect/0, ProjectCon... | /* static context
[FOCAL] public static ProjectInfo GradleTooling.loadProjectInfo(Path projectPath)
[PATH1] if(connection != null)=T -> return projectInfo
[PATH2] try-body throws -> if(connection != null)=F
[COLLABORATORS] param projectPath:Path toFile/0; field path replaceAll/2
[EXCEPTIONS] declares Exception
[CALLS-E... | /* static context
[FOCAL] public static ProjectInfo GradleTooling.loadProjectInfo(Path projectPath)
[PATH1] if(connection != null)=T -> return projectInfo
[PATH2] try-body throws -> if(connection != null)=F
[COLLABORATORS] param projectPath:Path toFile/0; field path replaceAll/2
[EXCEPTIONS] declares Exception
[CALLS-E... | true | ok | {"focal": {"class": "GradleTooling", "name": "loadProjectInfo", "signature": "ProjectInfo loadProjectInfo(Path projectPath) throws Exception", "start_line": 3, "modifiers": "public static", "params": [{"name": "projectPath", "type": "Path"}], "return_type": "ProjectInfo"}, "class_info": {"name": "GradleTooling", "kind"... |
55814679_1 | class SomeClient implements Client {
@Override
public String getValueFromTheInternet(String id){
return "42";
}
@Override public String putValueToTheInternet(String id, String value);
Client cut;
}
class SomeClientTest {
Client cut;
@Test
public void shouldReturn42() throws Exception {
| assertThat(cut.getValueFromTheInternet("yo")).isEqualTo("42");
}
} | [FOCAL] @Override public String SomeClient.getValueFromTheInternet(String id)
[CLASS] class SomeClient implements Client
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=- | unused=id
[CLASS-MEMBERS] String putValueToTheInternet(String id, String value)
[TEST] SomeClient... | /* static context
[FOCAL] @Override public String SomeClient.getValueFromTheInternet(String id)
[INPUTS] branches=- | result=- | unused=id
*/
| /* static context
[FOCAL] @Override public String SomeClient.getValueFromTheInternet(String id)
[INPUTS] branches=- | result=- | unused=id
*/
class SomeClient implements Client {
@Override
public String getValueFromTheInternet(String id){
return "42";
}
@Override public String putValueToTheInternet(String id, ... | true | ok | {"focal": {"class": "SomeClient", "name": "getValueFromTheInternet", "signature": "String getValueFromTheInternet(String id)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "id", "type": "String"}], "return_type": "String"}, "class_info": {"name": "SomeClient", "kind": "class", "modifiers": "", ... |
55834606_13 | class InterversionConverter {
public <T> T convertToLowerVersion(String targetVersion, Object source) {
Class<?> sourceType = source.getClass();
SupportedVersion supportedVersion = sourceType.getAnnotation(SupportedVersion.class);
if (supportedVersion == null) {
throw new IllegalVersionException(ta... | AddressV1 address = converter.convertToLowerVersion("v1", new AddressV2("Samplestreet 1", " ", new CityV2("12345", "Samplecity")));
assertThat(address.getAddressLine1(), is("Samplestreet 1"));
assertThat(address.getAddressLine2(), is(" "));
assertThat(address.getZipCode(), is("12345"));
assertThat(a... | [FOCAL] public T InterversionConverter.convertToLowerVersion(String targetVersion, Object source)
[CLASS] class InterversionConverter
[METRICS] loc=14 cc=4 branches=3 loops=0 returns=2 throws=2 nesting=1
[CALLS-INTERNAL] T map(Object previous, Class<T> targetType, DefaultVersionContext context)
[CALLS-EXTERNAL] Object.... | /* static context
[FOCAL] public T InterversionConverter.convertToLowerVersion(String targetVersion, Object source)
[THROWS-WHEN] IllegalVersionException when supportedVersion == null
[THROWS-WHEN] IllegalVersionException when !(supportedVersion == null) && !(targetVersion.equals(supportedVersion.version())) && support... | /* static context
[FOCAL] public T InterversionConverter.convertToLowerVersion(String targetVersion, Object source)
[THROWS-WHEN] IllegalVersionException when supportedVersion == null
[THROWS-WHEN] IllegalVersionException when !(supportedVersion == null) && !(targetVersion.equals(supportedVersion.version())) && support... | true | ok | {"focal": {"class": "InterversionConverter", "name": "convertToLowerVersion", "signature": "T convertToLowerVersion(String targetVersion, Object source)", "start_line": 3, "modifiers": "public", "params": [{"name": "targetVersion", "type": "String"}, {"name": "source", "type": "Object"}], "return_type": "T"}, "class_in... |
55874962_1 | class MainActivityPresenter extends BasePresenter {
@Override
public void onUpdateComplete(RequestResult requestResult, ViewModel.QueryEnum query) {
if (query instanceof MainActivityViewModel.QueryEnumMainActivity) {
if (requestResult == null) {
return;
}
... | when(mWeatherRequestResult.getRequestStatus()).thenReturn(RequestStatus.FAILED);
when(mWeatherRequestResult.getThrowable()).thenReturn(new Exception("This is a mocked exception!"));
mPresenter.onUpdateComplete(mWeatherRequestResult, MainActivityViewModel.QueryEnumMainActivity.UPDATE_WEATHER);
... | [FOCAL] @Override public void MainActivityPresenter.onUpdateComplete(RequestResult requestResult, ViewModel.QueryEnum query)
[CLASS] class MainActivityPresenter extends BasePresenter
[METRICS] loc=38 cc=7 branches=6 loops=0 returns=1 throws=1 nesting=5
[CALLS-INTERNAL] void handleWeatherUpdate(MainActivityViewModel.Wea... | /* static context
[FOCAL] @Override public void MainActivityPresenter.onUpdateComplete(RequestResult requestResult, ViewModel.QueryEnum query)
[THROWS-WHEN] IllegalArgumentException when !(query instanceof MainActivityViewModel.QueryEnumMainActivity)
[PATH1] if(query instanceof MainActivityViewModel.QueryEnumMainActivi... | /* static context
[FOCAL] @Override public void MainActivityPresenter.onUpdateComplete(RequestResult requestResult, ViewModel.QueryEnum query)
[THROWS-WHEN] IllegalArgumentException when !(query instanceof MainActivityViewModel.QueryEnumMainActivity)
[PATH1] if(query instanceof MainActivityViewModel.QueryEnumMainActivi... | true | ok | {"focal": {"class": "MainActivityPresenter", "name": "onUpdateComplete", "signature": "void onUpdateComplete(RequestResult requestResult, ViewModel.QueryEnum query)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "requestResult", "type": "RequestResult"}, {"name": "query", "type": "ViewModel.Que... |
55884057_2 | class SwipeLayout extends FrameLayout {
public void startWith(int position) {
makeSureOrientationStrategy();
orientationStrategy.startWith(position);
}
public SwipeLayout(Context context);
public SwipeLayout(Context context, AttributeSet attrs);
public SwipeLayout(Context contex... | swipeLayout.startWith(0);
verify(orientationStrategy).startWith(0);
verifyNoMoreInteractions(orientationStrategy);
}
} | [FOCAL] public void SwipeLayout.startWith(int position)
[CLASS] class SwipeLayout extends FrameLayout
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void makeSureOrientationStrategy()
[CALLS-EXTERNAL] OrientationStrategy.startWith/1
[FIELDS] read=orientationStrategy:OrientationStr... | /* static context
[FOCAL] public void SwipeLayout.startWith(int position)
[COLLABORATORS] field orientationStrategy:OrientationStrategy startWith/1
[CALLS-INTERNAL] void makeSureOrientationStrategy()
[FIELDS] read=orientationStrategy:OrientationStrategy
[CALLS-EXTERNAL] OrientationStrategy.startWith/1
*/
| /* static context
[FOCAL] public void SwipeLayout.startWith(int position)
[COLLABORATORS] field orientationStrategy:OrientationStrategy startWith/1
[CALLS-INTERNAL] void makeSureOrientationStrategy()
[FIELDS] read=orientationStrategy:OrientationStrategy
[CALLS-EXTERNAL] OrientationStrategy.startWith/1
*/
class SwipeLay... | true | ok | {"focal": {"class": "SwipeLayout", "name": "startWith", "signature": "void startWith(int position)", "start_line": 3, "modifiers": "public", "params": [{"name": "position", "type": "int"}], "return_type": "void"}, "class_info": {"name": "SwipeLayout", "kind": "class", "modifiers": "", "superclass": "FrameLayout", "inte... |
55912872_9 | class CollectionUtils {
public static boolean containsUserEstimate(final Collection<Estimate> estimates, final String userName) {
return estimates.stream().anyMatch(input -> input.getUserName().equalsIgnoreCase(userName));
}
private CollectionUtils();
public static boolean containsIgnoreCase... | final Estimate estimate = new Estimate("Rich A", "5");
final Collection<Estimate> estimates = Sets.newHashSet(estimate);
assertFalse(CollectionUtils.containsUserEstimate(estimates, "Jimmy Page"));
}
} | [FOCAL] public static boolean CollectionUtils.containsUserEstimate(Collection<Estimate> estimates, String userName)
[CLASS] class CollectionUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] estimates.stream().anyMatch/1, Collection<Estimate>.stream/0, input.getUserName().equals... | /* static context
[FOCAL] public static boolean CollectionUtils.containsUserEstimate(Collection<Estimate> estimates, String userName)
[INPUTS] branches=- | result=estimates, userName
[COLLABORATORS] param estimates:Collection<Estimate> stream/0; field input getUserName/0
[CALLS-EXTERNAL] estimates.stream().anyMatch/1, ... | /* static context
[FOCAL] public static boolean CollectionUtils.containsUserEstimate(Collection<Estimate> estimates, String userName)
[INPUTS] branches=- | result=estimates, userName
[COLLABORATORS] param estimates:Collection<Estimate> stream/0; field input getUserName/0
[CALLS-EXTERNAL] estimates.stream().anyMatch/1, ... | true | ok | {"focal": {"class": "CollectionUtils", "name": "containsUserEstimate", "signature": "boolean containsUserEstimate(Collection<Estimate> estimates, String userName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "estimates", "type": "Collection<Estimate>"}, {"name": "userName", "type": "String"}], "... |
55965971_1 | class RegularExpressionMatching {
public boolean isMatch(String s, String p) {
return false;
}
private RegularExpressionMatching testObject;
private String[][] sp;
private boolean[] results;
}
class RegularExpressionMatchingTest {
private RegularExpressionMatching testObject;
pr... | for (int i = 0; i < sp.length; i++) {
Assert.assertEquals(results[i], testObject.isMatch(sp[i][0], sp[i][1]));
}
}
} | [FOCAL] public boolean RegularExpressionMatching.isMatch(String s, String p)
[CLASS] class RegularExpressionMatching
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=- | unused=s, p
[TEST] RegularExpressionMatchingTest: @Test public void testAll()
[TEST-FIELDS] RegularEx... | /* static context
[FOCAL] public boolean RegularExpressionMatching.isMatch(String s, String p)
[INPUTS] branches=- | result=- | unused=s, p
*/
| /* static context
[FOCAL] public boolean RegularExpressionMatching.isMatch(String s, String p)
[INPUTS] branches=- | result=- | unused=s, p
*/
class RegularExpressionMatching {
public boolean isMatch(String s, String p) {
return false;
}
private RegularExpressionMatching testObject;
private St... | true | ok | {"focal": {"class": "RegularExpressionMatching", "name": "isMatch", "signature": "boolean isMatch(String s, String p)", "start_line": 3, "modifiers": "public", "params": [{"name": "s", "type": "String"}, {"name": "p", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "RegularExpressionMatching", "ki... |
56003224_5 | class AclServiceOFFlowBuilder {
public static Map<String,List<MatchInfoBase>> programUdpFlow(AceIp acl) {
Map<String,List<MatchInfoBase>> flowMatchesMap = new HashMap<>();
SourcePortRange sourcePortRange = acl.getSourcePortRange();
DestinationPortRange destinationPortRange = acl.getDestinat... | AceIpBuilder builder = new AceIpBuilder();
AceIpv4Builder v4builder = new AceIpv4Builder();
v4builder.setSourceIpv4Network(new Ipv4Prefix("10.1.1.1/24"));
v4builder.setDestinationIpv4Network(new Ipv4Prefix("20.1.1.1/24"));
builder.setAceIpVersion(v4builder.build());
build... | [FOCAL] public static Map<String,List<MatchInfoBase>> AclServiceOFFlowBuilder.programUdpFlow(AceIp acl)
[CLASS] class AclServiceOFFlowBuilder
[METRICS] loc=28 cc=4 branches=3 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] List<MatchInfoBase> addDstIpMatches(AceIp acl); List<MatchInfoBase> addSrcIpMatches(AceIp a... | /* static context
[FOCAL] public static Map<String,List<MatchInfoBase>> AclServiceOFFlowBuilder.programUdpFlow(AceIp acl)
[PATH1] if(sourcePortRange == null && destinationPortRange == null)=F -> if(sourcePortRange != null)=T -> if(destinationPortRange != null)=T -> return flowMatchesMap
[PATH2] if(sourcePortRange == nu... | /* static context
[FOCAL] public static Map<String,List<MatchInfoBase>> AclServiceOFFlowBuilder.programUdpFlow(AceIp acl)
[PATH1] if(sourcePortRange == null && destinationPortRange == null)=F -> if(sourcePortRange != null)=T -> if(destinationPortRange != null)=T -> return flowMatchesMap
[PATH2] if(sourcePortRange == nu... | true | ok | {"focal": {"class": "AclServiceOFFlowBuilder", "name": "programUdpFlow", "signature": "Map<String,List<MatchInfoBase>> programUdpFlow(AceIp acl)", "start_line": 3, "modifiers": "public static", "params": [{"name": "acl", "type": "AceIp"}], "return_type": "Map<String,List<MatchInfoBase>>"}, "class_info": {"name": "AclSe... |
56003499_35 | class TepCommandHelper {
public boolean isInCache(Uint64 dpnId, String ipAddress,
String transportZone) throws TepException {
boolean exists = false;
final VtepsKey vtepkey = new VtepsKey(dpnId);
IpAddress ipAddressObj = IpAddressBuilder.getDefaultInstance(ipAdd... |
try {
tepCommandHelper.createLocalCache(dpId1, tepIp1, transportZone1);
tepCommandHelper.isInCache(dpId1, tepIp1 ,transportZone1);
} catch (TepException e) {
LOG.error(e.getMessage());
}
verify(mockReadTx).read(LogicalDatastoreType.CONFIGURATION,trans... | [FOCAL] public boolean TepCommandHelper.isInCache(Uint64 dpnId, String ipAddress, String transportZone)
[CLASS] class TepCommandHelper
[METRICS] loc=22 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] void handleError(String errorMessage)
[CALLS-EXTERNAL] IpAddressBuilder.getDefaultInstance/1, new ... | class TepCommandHelper {
public boolean isInCache(Uint64 dpnId, String ipAddress,
String transportZone) throws TepException {
boolean exists = false;
final VtepsKey vtepkey = new VtepsKey(dpnId);
IpAddress ipAddressObj = IpAddressBuilder.getDefaultInstance(ipAdd... | false | ok | {"focal": {"class": "TepCommandHelper", "name": "isInCache", "signature": "boolean isInCache(Uint64 dpnId, String ipAddress, String transportZone) throws TepException", "start_line": 3, "modifiers": "public", "params": [{"name": "dpnId", "type": "Uint64"}, {"name": "ipAddress", "type": "String"}, {"name": "transportZon... | |
56008391_27 | class EntanglingClass {
@VisibleForTesting
MethodSpec createEntangleMethod() {
MethodSpec.Builder result = MethodSpec.methodBuilder("entangle")
.addModifiers(PUBLIC)
.addParameter(TypeVariableName.get("T"), "target", FINAL);
result.addStatement("this.target = ta... | MethodSpec entangle = entanglingClass.createEntangleMethod();
assertThat(entangle.parameters, hasSize(1));
}
} | [FOCAL] @VisibleForTesting MethodSpec EntanglingClass.createEntangleMethod()
[CLASS] class EntanglingClass
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] MethodSpec.methodBuilder("entangle") .addModifiers(PUBLIC).addParameter/3, MethodSpec.methodBuilder("entangle").addModifiers/1... | /* static context
[FOCAL] @VisibleForTesting MethodSpec EntanglingClass.createEntangleMethod()
[CALLS-EXTERNAL] MethodSpec.methodBuilder("entangle") .addModifiers(PUBLIC).addParameter/3, MethodSpec.methodBuilder("entangle").addModifiers/1, MethodSpec.methodBuilder/1, TypeVariableName.get/1, MethodSpec.Builder.addStatem... | /* static context
[FOCAL] @VisibleForTesting MethodSpec EntanglingClass.createEntangleMethod()
[CALLS-EXTERNAL] MethodSpec.methodBuilder("entangle") .addModifiers(PUBLIC).addParameter/3, MethodSpec.methodBuilder("entangle").addModifiers/1, MethodSpec.methodBuilder/1, TypeVariableName.get/1, MethodSpec.Builder.addStatem... | true | ok | {"focal": {"class": "EntanglingClass", "name": "createEntangleMethod", "signature": "MethodSpec createEntangleMethod()", "start_line": 3, "modifiers": "@VisibleForTesting", "params": [], "return_type": "MethodSpec"}, "class_info": {"name": "EntanglingClass", "kind": "class", "modifiers": "", "superclass": null, "interf... |
56037404_0 | class MainPresenter implements IMainPresenter {
@Override
public void loadSpinnerData() {
mSpinnerData = mMainModel.loadSpinnerData();
if (mSpinnerData == null || mSpinnerData.size() == 0){
mMainView.showErrorMsg();
return;
}
mMainView.updateSpinnerData(m... | mMainPresenter.loadSpinnerData();
Mockito.verify(mMainModel).loadSpinnerData();
List<String> data = new ArrayList<>();
Mockito.when(mMainModel.loadSpinnerData()).thenReturn(data);
Mockito.verify(mMainView).showErrorMsg();
}
} | [FOCAL] @Override public void MainPresenter.loadSpinnerData()
[CLASS] class MainPresenter implements IMainPresenter
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] IMainModel.loadSpinnerData/0, mSpinnerData.size/0, IMainView.showErrorMsg/0, IMainView.updateSpinnerData/1
[FIELDS] re... | /* static context
[FOCAL] @Override public void MainPresenter.loadSpinnerData()
[PATH1] if(mSpinnerData == null || mSpinnerData.size() == 0)=T -> return
[PATH2] if(mSpinnerData == null || mSpinnerData.size() == 0)=F
[INPUTS] branches=mMainModel | result=-
[COLLABORATORS] field mMainModel:IMainModel loadSpinnerData/0; f... | /* static context
[FOCAL] @Override public void MainPresenter.loadSpinnerData()
[PATH1] if(mSpinnerData == null || mSpinnerData.size() == 0)=T -> return
[PATH2] if(mSpinnerData == null || mSpinnerData.size() == 0)=F
[INPUTS] branches=mMainModel | result=-
[COLLABORATORS] field mMainModel:IMainModel loadSpinnerData/0; f... | true | ok | {"focal": {"class": "MainPresenter", "name": "loadSpinnerData", "signature": "void loadSpinnerData()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "MainPresenter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "IMainPresenter", "fi... |
56039864_3 | class NetworkingModule extends ReactContextBaseJavaModule {
@ReactMethod
/**
* @param timeout value of 0 results in no timeout
*/
public void sendRequest(
final ExecutorToken executorToken,
String method,
String url,
final int requestId,
ReadableArray headers,
ReadableMa... | RCTDeviceEventEmitter emitter = mock(RCTDeviceEventEmitter.class);
ReactApplicationContext context = mock(ReactApplicationContext.class);
when(context.getJSModule(any(ExecutorToken.class), any(Class.class))).thenReturn(emitter);
OkHttpClient httpClient = mock(OkHttpClient.class);
NetworkingModule n... | [FOCAL] @ReactMethod /** * @param timeout value of 0 results in no timeout */ public void NetworkingModule.sendRequest(ExecutorToken executorToken, String method, String url, int requestId, ReadableArray headers, ReadableMap data, boolean useIncrementalUpdates, int timeout)
[CLASS] class NetworkingModule extends ReactC... | class NetworkingModule extends ReactContextBaseJavaModule {
@ReactMethod
/**
* @param timeout value of 0 results in no timeout
*/
public void sendRequest(
final ExecutorToken executorToken,
String method,
String url,
final int requestId,
ReadableArray headers,
ReadableMa... | false | ok | {"focal": {"class": "NetworkingModule", "name": "sendRequest", "signature": "void sendRequest(ExecutorToken executorToken, String method, String url, int requestId, ReadableArray headers, ReadableMap data, boolean useIncrementalUpdates, int timeout)", "start_line": 3, "modifiers": "@ReactMethod /** * @param timeout val... | |
56074333_2 | class GetReceivedCards {
public void get(Callback callback) {
List<Card> receivedCards = database.getReceivedCards();
callback.onGetReceivedCards(receivedCards);
}
@Inject public GetReceivedCards(Database database);
private GetReceivedCards getReceivedCards;
@Mock private Database database;
@Moc... | List<Card> cards = Arrays.asList(new Card(), new Card());
when(database.getReceivedCards()).thenReturn(cards);
getReceivedCards.get(callback);
verify(callback).onGetReceivedCards(eq(cards));
}
} | [FOCAL] public void GetReceivedCards.get(Callback callback)
[CLASS] class GetReceivedCards
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Database.getReceivedCards/0, Callback.onGetReceivedCards/1
[FIELDS] read=database:Database
[COLLABORATORS] field database:Database getReceivedC... | /* static context
[FOCAL] public void GetReceivedCards.get(Callback callback)
[COLLABORATORS] field database:Database getReceivedCards/0; param callback:Callback onGetReceivedCards/1
[FIELDS] read=database:Database
[CALLS-EXTERNAL] Database.getReceivedCards/0, Callback.onGetReceivedCards/1
*/
| /* static context
[FOCAL] public void GetReceivedCards.get(Callback callback)
[COLLABORATORS] field database:Database getReceivedCards/0; param callback:Callback onGetReceivedCards/1
[FIELDS] read=database:Database
[CALLS-EXTERNAL] Database.getReceivedCards/0, Callback.onGetReceivedCards/1
*/
class GetReceivedCards {
... | true | ok | {"focal": {"class": "GetReceivedCards", "name": "get", "signature": "void get(Callback callback)", "start_line": 3, "modifiers": "public", "params": [{"name": "callback", "type": "Callback"}], "return_type": "void"}, "class_info": {"name": "GetReceivedCards", "kind": "class", "modifiers": "", "superclass": null, "inter... |
56108213_42 | class Feed implements Hydratable {
public boolean hasMangaLibraryEntries() {
return mMangaLibraryEntries != null && !mMangaLibraryEntries.isEmpty();
}
public void addAnime(@Nullable final ArrayList<Anime> anime);
@Nullable public ArrayList<Anime> getAnime();
@Nullable public ArrayList<Stri... | assertFalse(mFeed.hasMangaLibraryEntries());
}
} | [FOCAL] public boolean Feed.hasMangaLibraryEntries()
[CLASS] class Feed implements Hydratable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] mMangaLibraryEntries.isEmpty/0
[COLLABORATORS] field mMangaLibraryEntries isEmpty/0
[CLASS-MEMBERS] void addAnime(ArrayList<Anime> anime); A... | /* static context
[FOCAL] public boolean Feed.hasMangaLibraryEntries()
[COLLABORATORS] field mMangaLibraryEntries isEmpty/0
[CALLS-EXTERNAL] mMangaLibraryEntries.isEmpty/0
*/
| /* static context
[FOCAL] public boolean Feed.hasMangaLibraryEntries()
[COLLABORATORS] field mMangaLibraryEntries isEmpty/0
[CALLS-EXTERNAL] mMangaLibraryEntries.isEmpty/0
*/
class Feed implements Hydratable {
public boolean hasMangaLibraryEntries() {
return mMangaLibraryEntries != null && !mMangaLibraryEn... | true | ok | {"focal": {"class": "Feed", "name": "hasMangaLibraryEntries", "signature": "boolean hasMangaLibraryEntries()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "Feed", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Hydratable", "fields": [{"na... |
56132696_0 | class URLValidator extends FieldValidatorSupport {
public void validate(Object object) throws ValidationException {
String fieldName = getFieldName();
// if there is no value - don't do comparison
// if a value is required, a required validator should be added to the field
if (obje... |
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("url", "http://aaa.bb.com");
try {
this.validate(map);
} catch (ValidationException e) {
Assert.fail(e.getMessage());
}
}
} | [FOCAL] public void URLValidator.validate(Object object)
[CLASS] class URLValidator extends FieldValidatorSupport
[METRICS] loc=13 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] getFieldName/0 (inherited), object.toString().length/0, Object.toString/0, object.getClass().equals/1, Object.getClass/... | /* static context
[FOCAL] public void URLValidator.validate(Object object)
[PATH1] if(object == null || object.toString().length() == 0)=T -> return
[PATH2] if(object == null || object.toString().length() == 0)=F -> if(!(object.getClass().equals(String.class)) || !URLUtil.verifyUrl((String) object))=T
[PATH3] if(object... | /* static context
[FOCAL] public void URLValidator.validate(Object object)
[PATH1] if(object == null || object.toString().length() == 0)=T -> return
[PATH2] if(object == null || object.toString().length() == 0)=F -> if(!(object.getClass().equals(String.class)) || !URLUtil.verifyUrl((String) object))=T
[PATH3] if(object... | true | ok | {"focal": {"class": "URLValidator", "name": "validate", "signature": "void validate(Object object) throws ValidationException", "start_line": 3, "modifiers": "public", "params": [{"name": "object", "type": "Object"}], "return_type": "void"}, "class_info": {"name": "URLValidator", "kind": "class", "modifiers": "", "supe... |
56136555_20 | class ClusterDiskSpaceChecker implements DiskSpaceChecker {
@Override
public boolean isSpaceAvailable() throws DiskSpaceCheckerException {
Map<String, DiskSpace> clusterSpace = clusterManager.getDiskSpace();
boolean withinThreshold = true;
for (String server : clusterManager.getServers()) {
DiskSpace ds = ... | final DiskSpace server0Space = new DiskSpace(128L, 1024L);
spaceMap.put(servers[0], server0Space);
final DiskSpace server1Space = new DiskSpace(128L, 512L);
spaceMap.put(servers[1], server1Space);
when(threshold.withinThreshold(server0Space)).thenReturn(true);
when(threshold.withinThreshold(server1Space)).... | [FOCAL] @Override public boolean ClusterDiskSpaceChecker.isSpaceAvailable()
[CLASS] class ClusterDiskSpaceChecker implements DiskSpaceChecker
[METRICS] loc=21 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] ClusterDiskSpaceManager.getDiskSpace/0, ClusterDiskSpaceManager.getServers/0, Map<String, D... | /* static context
[FOCAL] @Override public boolean ClusterDiskSpaceChecker.isSpaceAvailable()
[PATH1] foreach(String server : clusterManager.getServers())=T -> if(ds == null)=F -> if(!threshold.withinThreshold(ds))=T -> exit loop -> return withinThreshold
[PATH2] foreach(String server : clusterManager.getServers())=F -... | /* static context
[FOCAL] @Override public boolean ClusterDiskSpaceChecker.isSpaceAvailable()
[PATH1] foreach(String server : clusterManager.getServers())=T -> if(ds == null)=F -> if(!threshold.withinThreshold(ds))=T -> exit loop -> return withinThreshold
[PATH2] foreach(String server : clusterManager.getServers())=F -... | true | ok | {"focal": {"class": "ClusterDiskSpaceChecker", "name": "isSpaceAvailable", "signature": "boolean isSpaceAvailable() throws DiskSpaceCheckerException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "ClusterDiskSpaceChecker", "kind": "class", "modifiers"... |
56214716_11 | class HBaseTimestampStorage implements TimestampStorage {
@Inject
public HBaseTimestampStorage(Configuration hbaseConfig, HBaseTimestampStorageConfig config) throws IOException {
connection = ConnectionFactory.createConnection(hbaseConfig);
this.table = connection.getTable(TableName.valueOf(con... |
final long INITIAL_TS_VALUE = 0;
HBaseTimestampStorageConfig config = new HBaseTimestampStorageConfig();
HBaseTimestampStorage tsStorage = new HBaseTimestampStorage(hbaseConf, config);
// Test that the first time we get the timestamp is the initial value
assertEquals(tsStorage.... | [FOCAL] @Inject public HBaseTimestampStorage.HBaseTimestampStorage(Configuration hbaseConfig, HBaseTimestampStorageConfig config)
[CLASS] class HBaseTimestampStorage implements TimestampStorage
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] ConnectionFactory.createConnection/1, co... | /* static context
[FOCAL] @Inject public HBaseTimestampStorage.HBaseTimestampStorage(Configuration hbaseConfig, HBaseTimestampStorageConfig config)
[COLLABORATORS] field connection getTable/1; param config:HBaseTimestampStorageConfig getTableName/0,getFamilyName/0
[STATE] cfName, table
[EXCEPTIONS] declares IOException... | /* static context
[FOCAL] @Inject public HBaseTimestampStorage.HBaseTimestampStorage(Configuration hbaseConfig, HBaseTimestampStorageConfig config)
[COLLABORATORS] field connection getTable/1; param config:HBaseTimestampStorageConfig getTableName/0,getFamilyName/0
[STATE] cfName, table
[EXCEPTIONS] declares IOException... | true | ok | {"focal": {"class": "HBaseTimestampStorage", "name": "HBaseTimestampStorage", "signature": "HBaseTimestampStorage(Configuration hbaseConfig, HBaseTimestampStorageConfig config) throws IOException", "start_line": 3, "modifiers": "@Inject public", "params": [{"name": "hbaseConfig", "type": "Configuration"}, {"name": "con... |
56219850_29 | class ObjectUtil {
public static boolean same(Object obj1, Object obj2) {
return obj1 == obj2;
}
public static boolean isNull(Object obj);
public static boolean isNotNull(Object obj);
public static boolean andIsNull(Object... objects);
public static boolean orIsNull(Object... objects);
public static boolean ... | String o1 = new String("1");
String o2 = new String("1");
assertTrue(ObjectUtil.same(o1, o1));
assertFalse(ObjectUtil.same(o1, o2));
}
} | [FOCAL] public static boolean ObjectUtil.same(Object obj1, Object obj2)
[CLASS] class ObjectUtil
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=obj1, obj2
[DATAFLOW] obj1@param->L2; obj2@param->L2
[CLASS-MEMBERS] boolean isNull(Object obj); boolean isNotNull(Object obj... | /* static context
[FOCAL] public static boolean ObjectUtil.same(Object obj1, Object obj2)
[INPUTS] branches=- | result=obj1, obj2
*/
| /* static context
[FOCAL] public static boolean ObjectUtil.same(Object obj1, Object obj2)
[INPUTS] branches=- | result=obj1, obj2
*/
class ObjectUtil {
public static boolean same(Object obj1, Object obj2) {
return obj1 == obj2;
}
public static boolean isNull(Object obj);
public static boolean isNotNull(Object o... | true | ok | {"focal": {"class": "ObjectUtil", "name": "same", "signature": "boolean same(Object obj1, Object obj2)", "start_line": 3, "modifiers": "public static", "params": [{"name": "obj1", "type": "Object"}, {"name": "obj2", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "ObjectUtil", "kind": "class", "mo... |
56249750_0 | class ProdutoDAO {
public BigDecimal somaPrecosPorTipo(TipoPreco tipoPreco) {
TypedQuery<BigDecimal> query = manager
.createQuery("select sum(preco.valor) from Produto p "
+ " join p.precos preco where preco.tipo = :tipoPreco", BigDecimal.class);
query.setParameter("tipoPreco", tipoPreco);
return quer... | List<Produto> livrosImpressos = ProdutoBuilder
.newProduto(TipoPreco.IMPRESSO, BigDecimal.TEN)
.mais(3).buildAll();
List<Produto> livrosEbook = ProdutoBuilder
.newProduto(TipoPreco.EBOOK, BigDecimal.TEN)
.mais(3).buildAll();
livrosImpressos.stream().forEach(produtoDao::gravar);
livrosEboo... | [FOCAL] public BigDecimal ProdutoDAO.somaPrecosPorTipo(TipoPreco tipoPreco)
[CLASS] class ProdutoDAO
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] manager.createQuery/2, TypedQuery<BigDecimal>.setParameter/2, TypedQuery<BigDecimal>.getSingleResult/0
[COLLABORATORS] field manager ... | /* static context
[FOCAL] public BigDecimal ProdutoDAO.somaPrecosPorTipo(TipoPreco tipoPreco)
[COLLABORATORS] field manager createQuery/2
[CALLS-EXTERNAL] manager.createQuery/2, TypedQuery<BigDecimal>.setParameter/2, TypedQuery<BigDecimal>.getSingleResult/0
*/
| /* static context
[FOCAL] public BigDecimal ProdutoDAO.somaPrecosPorTipo(TipoPreco tipoPreco)
[COLLABORATORS] field manager createQuery/2
[CALLS-EXTERNAL] manager.createQuery/2, TypedQuery<BigDecimal>.setParameter/2, TypedQuery<BigDecimal>.getSingleResult/0
*/
class ProdutoDAO {
public BigDecimal somaPrecosPorTipo(Ti... | true | ok | {"focal": {"class": "ProdutoDAO", "name": "somaPrecosPorTipo", "signature": "BigDecimal somaPrecosPorTipo(TipoPreco tipoPreco)", "start_line": 3, "modifiers": "public", "params": [{"name": "tipoPreco", "type": "TipoPreco"}], "return_type": "BigDecimal"}, "class_info": {"name": "ProdutoDAO", "kind": "class", "modifiers"... |
56258294_3 | class ConsulRateLimiter extends AbstractRateLimiter {
@Override
protected void saveRate(Rate rate) {
String value = "";
try {
value = this.objectMapper.writeValueAsString(rate);
} catch (JsonProcessingException e) {
log.error("Failed to serialize Rate", e);
... | JsonProcessingException jsonProcessingException = Mockito.mock(JsonProcessingException.class);
when(objectMapper.writeValueAsString(any())).thenThrow(jsonProcessingException);
ConsulRateLimiter consulRateLimiter = new ConsulRateLimiter(rateLimiterErrorHandler, consulClient, objectMapper);
... | [FOCAL] @Override protected void ConsulRateLimiter.saveRate(Rate rate)
[CLASS] class ConsulRateLimiter extends AbstractRateLimiter
[METRICS] loc=13 cc=3 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] ObjectMapper.writeValueAsString/1, log.error/2, hasText/1 (inherited), ConsulClient.setKVValue/2, Rate... | /* static context
[FOCAL] @Override protected void ConsulRateLimiter.saveRate(Rate rate)
[PATH1] try-body throws -> if(hasText(value))=T
[PATH2] if(hasText(value))=F
[INPUTS] branches=rate, objectMapper | result=-
[COLLABORATORS] field objectMapper:ObjectMapper writeValueAsString/1; field consulClient:ConsulClient setK... | /* static context
[FOCAL] @Override protected void ConsulRateLimiter.saveRate(Rate rate)
[PATH1] try-body throws -> if(hasText(value))=T
[PATH2] if(hasText(value))=F
[INPUTS] branches=rate, objectMapper | result=-
[COLLABORATORS] field objectMapper:ObjectMapper writeValueAsString/1; field consulClient:ConsulClient setK... | true | ok | {"focal": {"class": "ConsulRateLimiter", "name": "saveRate", "signature": "void saveRate(Rate rate)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "rate", "type": "Rate"}], "return_type": "void"}, "class_info": {"name": "ConsulRateLimiter", "kind": "class", "modifiers": "", "superclass": "Ab... |
56258575_13 | class HttpHandler extends NanoHTTPD {
@Override
public Response serve(IHTTPSession session) {
if (!apiAuthEnabled || hasValidCredentials(session)) {
return respond(session);
}
return newFixedLengthResponse(Status.FORBIDDEN, NanoHTTPD.MIME_PLAINTEXT, "Invalid API key\r\n");
... | Configuration config = Configuration.getDefaultConfiguration();
config.global.httpApiAuthEnabled = true;
DiagnosticsApi mxBean = mock(DiagnosticsApi.class);
HttpHandler httpApi = new HttpHandler(config, mxBean);
IHTTPSession session = mock(IHTTPSession.class);
when(sessi... | [FOCAL] @Override public Response HttpHandler.serve(IHTTPSession session)
[CLASS] class HttpHandler extends NanoHTTPD
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] Response respond(IHTTPSession session); boolean hasValidCredentials(IHTTPSession session)
[CALLS-EXTERNAL] newFixedL... | /* static context
[FOCAL] @Override public Response HttpHandler.serve(IHTTPSession session)
[PATH1] if(!apiAuthEnabled || hasValidCredentials(session))=T -> return respond(session)
[PATH2] if(!apiAuthEnabled || hasValidCredentials(session))=F -> return newFixedLengthResponse(Status.FORBIDDEN, NanoHTTPD.MIME_PLAINTEXT, ... | /* static context
[FOCAL] @Override public Response HttpHandler.serve(IHTTPSession session)
[PATH1] if(!apiAuthEnabled || hasValidCredentials(session))=T -> return respond(session)
[PATH2] if(!apiAuthEnabled || hasValidCredentials(session))=F -> return newFixedLengthResponse(Status.FORBIDDEN, NanoHTTPD.MIME_PLAINTEXT, ... | true | ok | {"focal": {"class": "HttpHandler", "name": "serve", "signature": "Response serve(IHTTPSession session)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "session", "type": "IHTTPSession"}], "return_type": "Response"}, "class_info": {"name": "HttpHandler", "kind": "class", "modifiers": "", "supercl... |
56278667_91 | class SearchHostProvider {
public String getSearchHost() {
String scheme = isToolboxEnableHttpScheme ? "http" : aptoideWebServicesScheme;
return "http".equals(scheme) ? scheme + "://" + aptoideWebServicesSearchHost + "/v1/"
: scheme + "://" + aptoideWebServicesSearchSslHost + "/v1/";
}
public S... | SearchHostProvider searchHostProvider =
new SearchHostProvider(false, "https", "buzz.aptoide.com:10001", "buzz.aptoide.com:10002");
String searchHost = searchHostProvider.getSearchHost();
assertEquals(searchHost, "https://buzz.aptoide.com:10002/v1/");
}
} | [FOCAL] public String SearchHostProvider.getSearchHost()
[CLASS] class SearchHostProvider
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] "http".equals/1
[DATAFLOW] scheme@L2->L3
[CLASS-MEMBERS] SearchHostProvider(boolean isToolboxEnableHttpScheme, String aptoideWebServicesScheme, ... | /* static context
[FOCAL] public String SearchHostProvider.getSearchHost()
[CALLS-EXTERNAL] "http".equals/1
*/
| /* static context
[FOCAL] public String SearchHostProvider.getSearchHost()
[CALLS-EXTERNAL] "http".equals/1
*/
class SearchHostProvider {
public String getSearchHost() {
String scheme = isToolboxEnableHttpScheme ? "http" : aptoideWebServicesScheme;
return "http".equals(scheme) ? scheme + "://" + aptoideWebSe... | true | ok | {"focal": {"class": "SearchHostProvider", "name": "getSearchHost", "signature": "String getSearchHost()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "SearchHostProvider", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "... |
56323969_241 | class WorldpayOrderModificationListener extends AbstractEventListener<OrderModificationEvent> {
@Override
protected void onEvent(final OrderModificationEvent orderModificationEvent) {
final OrderNotificationMessage orderNotificationMessage = orderModificationEvent.getOrderNotificationMessage();
... | when(journalReplyMock.getJournalType()).thenReturn(CANCELLED);
testObj.onEvent(orderModificationEventMock);
verify(worldpayCartServiceMock, never()).setWorldpayDeclineCodeOnCart(anyString(), anyString());
verify(modelServiceMock).save(worldpayOrderModificationModelMock);
verify... | [FOCAL] @Override protected void WorldpayOrderModificationListener.onEvent(OrderModificationEvent orderModificationEvent)
[CLASS] class WorldpayOrderModificationListener extends AbstractEventListener<OrderModificationEvent>
[METRICS] loc=15 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void save... | /* static context
[FOCAL] @Override protected void WorldpayOrderModificationListener.onEvent(OrderModificationEvent orderModificationEvent)
[PATH1] if(journalType.equals(REFUSED))=T -> if(transactionType != null)=T
[PATH2] if(journalType.equals(REFUSED))=F -> if(transactionType != null)=F
[INPUTS] branches=orderModific... | /* static context
[FOCAL] @Override protected void WorldpayOrderModificationListener.onEvent(OrderModificationEvent orderModificationEvent)
[PATH1] if(journalType.equals(REFUSED))=T -> if(transactionType != null)=T
[PATH2] if(journalType.equals(REFUSED))=F -> if(transactionType != null)=F
[INPUTS] branches=orderModific... | true | ok | {"focal": {"class": "WorldpayOrderModificationListener", "name": "onEvent", "signature": "void onEvent(OrderModificationEvent orderModificationEvent)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "orderModificationEvent", "type": "OrderModificationEvent"}], "return_type": "void"}, "class_in... |
56365609_5 | class TopicMatcher {
public static boolean match(String topicFilter, String topicName) {
if (!TopicMatcher.isValid(topicFilter, true) || !TopicMatcher.isValid(topicName, false)) { return false; }
if ((topicFilter.startsWith(MULTI_LEVEL_WILDCARD) || topicFilter.startsWith(SINGLE_LEVEL_WILDCARD))
&& topicName.... | Assert.assertThat(TopicMatcher.match("test/1/2", "test/1/2"), IsEqual.equalTo(true));
Assert.assertThat(TopicMatcher.match("test+", "test_1"), IsEqual.equalTo(false));
Assert.assertThat(TopicMatcher.match("test#", "test_1"), IsEqual.equalTo(false));
Assert.assertThat(TopicMatcher.match("+test+", "1_test"), Is... | [FOCAL] public static boolean TopicMatcher.match(String topicFilter, String topicName)
[CLASS] class TopicMatcher
[METRICS] loc=29 cc=8 branches=6 loops=1 returns=6 throws=0 nesting=5
[CALLS-EXTERNAL] TopicMatcher.isValid/2, String.startsWith/1, String.split/1, tfs[i].equals/1
[PATH1] if(!TopicMatcher.isValid(topicFilt... | /* static context
[FOCAL] public static boolean TopicMatcher.match(String topicFilter, String topicName)
[PATH1] if(!TopicMatcher.isValid(topicFilter, true) || !TopicMatcher.isValid(topicName, false))=F -> if(((topicFilter.startsWith(MULTI_LEVEL_WILDCARD) || topicFilter.startsWith(SINGLE_LEVEL_WILDCARD)) && topicName.s... | /* static context
[FOCAL] public static boolean TopicMatcher.match(String topicFilter, String topicName)
[PATH1] if(!TopicMatcher.isValid(topicFilter, true) || !TopicMatcher.isValid(topicName, false))=F -> if(((topicFilter.startsWith(MULTI_LEVEL_WILDCARD) || topicFilter.startsWith(SINGLE_LEVEL_WILDCARD)) && topicName.s... | true | ok | {"focal": {"class": "TopicMatcher", "name": "match", "signature": "boolean match(String topicFilter, String topicName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "topicFilter", "type": "String"}, {"name": "topicName", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "Topic... |
56423934_0 | class JavaIndexArtifact extends IndexArtifact {
@Override
protected Map<String, Boolean> getFileTypes()
{
return fileTypes;
}
public JavaIndexArtifact(String location);
public String getSnapshotVersion();
public void setSnapshotVersion(String snapshotVersion);
@Override publi... | JavaIndexArtifact jia = new JavaIndexArtifact("");
Map<String, Boolean> types = jia.getFileTypes();
assertFalse(types.get("jar"));
assertFalse(types.get("jar.sha1"));
assertFalse(types.get("jar.md5"));
assertFalse(types.get("pom"));
assertFalse(types.get("pom.sha1"));
assertFalse(types.get("pom.md5")... | [FOCAL] @Override protected Map<String, Boolean> JavaIndexArtifact.getFileTypes()
[CLASS] class JavaIndexArtifact extends IndexArtifact
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] JavaIndexArtifact(String location); String getSnapshotVersion(); void setSnapshotVersion(String sna... | /* static context
[FOCAL] @Override protected Map<String, Boolean> JavaIndexArtifact.getFileTypes()
*/
| /* static context
[FOCAL] @Override protected Map<String, Boolean> JavaIndexArtifact.getFileTypes()
*/
class JavaIndexArtifact extends IndexArtifact {
@Override
protected Map<String, Boolean> getFileTypes()
{
return fileTypes;
}
public JavaIndexArtifact(String location);
public Strin... | true | ok | {"focal": {"class": "JavaIndexArtifact", "name": "getFileTypes", "signature": "Map<String, Boolean> getFileTypes()", "start_line": 3, "modifiers": "@Override protected", "params": [], "return_type": "Map<String, Boolean>"}, "class_info": {"name": "JavaIndexArtifact", "kind": "class", "modifiers": "", "superclass": "Ind... |
56433446_0 | class PathStore {
public String[] getPaths()
{
Set<Node> endPoints = mRoot.getEndPoints();
String[] result = new String[endPoints.size()];
int index = 0;
for (Node node : endPoints)
{
result[index] = node.getPath();
index++;
}
re... | PathStore store = new PathStore();
assertEquals("Expected one element length if nothing added", 1, store.getPaths().length);
assertEquals("Expected empty", true, store.isEmpty());
store.add("1");
assertEquals(1, store.getPaths().length);
assertEquals("Expected not empty"... | [FOCAL] public String[] PathStore.getPaths()
[CLASS] class PathStore
[METRICS] loc=14 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] mRoot.getEndPoints/0, Set<Node>.size/0, Node.getPath/0
[PATH1] foreach(Node node : endPoints)=T -> exit loop -> return result
[PATH2] foreach(Node node : endPoints)... | /* static context
[FOCAL] public String[] PathStore.getPaths()
[PATH1] foreach(Node node : endPoints)=T -> exit loop -> return result
[PATH2] foreach(Node node : endPoints)=F -> return result
[COLLABORATORS] field mRoot getEndPoints/0
[CALLS-EXTERNAL] mRoot.getEndPoints/0, Set<Node>.size/0, Node.getPath/0
*/
| /* static context
[FOCAL] public String[] PathStore.getPaths()
[PATH1] foreach(Node node : endPoints)=T -> exit loop -> return result
[PATH2] foreach(Node node : endPoints)=F -> return result
[COLLABORATORS] field mRoot getEndPoints/0
[CALLS-EXTERNAL] mRoot.getEndPoints/0, Set<Node>.size/0, Node.getPath/0
*/
class Path... | true | ok | {"focal": {"class": "PathStore", "name": "getPaths", "signature": "String[] getPaths()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String[]"}, "class_info": {"name": "PathStore", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "cle... |
56442452_47 | class MigraMongo {
public MigraMongoStatus status(String fromVersion) {
final Iterable<MigrationEntry> migrations = migrationHistoryService.findMigrations(fromVersion);
for (MigrationRun migEntry : migrations) {
if (migEntry.getStatus() == MigrationStatus.ERROR) {
return... | // given
when(migEntryService.findMigrations("1"))
.thenReturn(Arrays.asList(createMigrationEntry("1", "2", MigrationStatus.OK)));
// when
final MigraMongoStatus status = migraMongo.status("1");
// then
assertThat(status.status, is(MigrationStatus.OK));
... | [FOCAL] public MigraMongoStatus MigraMongo.status(String fromVersion)
[CLASS] class MigraMongo
[METRICS] loc=17 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] List<T> toList(Iterable<T> iterable)
[CALLS-EXTERNAL] migrationHistoryService.findMigrations/1, MigrationRun.getStatus/0, MigraMongoStatus... | /* static context
[FOCAL] public MigraMongoStatus MigraMongo.status(String fromVersion)
[PATH1] foreach(MigrationRun migEntry : migrations)=T -> if(migEntry.getStatus() == MigrationStatus.ERROR)=F -> if(migEntry.getStatus() == MigrationStatus.IN_PROGRESS)=F -> exit loop -> return MigraMongoStatus.ok().withEntries(toLis... | /* static context
[FOCAL] public MigraMongoStatus MigraMongo.status(String fromVersion)
[PATH1] foreach(MigrationRun migEntry : migrations)=T -> if(migEntry.getStatus() == MigrationStatus.ERROR)=F -> if(migEntry.getStatus() == MigrationStatus.IN_PROGRESS)=F -> exit loop -> return MigraMongoStatus.ok().withEntries(toLis... | true | ok | {"focal": {"class": "MigraMongo", "name": "status", "signature": "MigraMongoStatus status(String fromVersion)", "start_line": 3, "modifiers": "public", "params": [{"name": "fromVersion", "type": "String"}], "return_type": "MigraMongoStatus"}, "class_info": {"name": "MigraMongo", "kind": "class", "modifiers": "", "super... |
56527099_10 | class HttpsConfiguration {
public static Builder builder()
{
return new Builder();
}
private HttpsConfiguration();
public HttpsConfiguration(String serverKeystorePath, String serverKeystorePassword,
String clientKeystorePath, String clientKeystorePassword, String truststorePath,
... | public void testNoTrustPass() throws Exception
{
try
{
HttpsConfiguration.builder()
.serverKeystorePath("sPath")
.serverKeystorePassword("sPass")
.truststorePath("tPath")
.verifyPeerCert("False")
.build()... | [FOCAL] public static Builder HttpsConfiguration.builder()
[CLASS] class HttpsConfiguration
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Builder
[CLASS-MEMBERS] HttpsConfiguration(); HttpsConfiguration(String serverKeystorePath, String serverKeystorePassword, String clientKeystorePath, Str... | /* static context
[FOCAL] public static Builder HttpsConfiguration.builder()
[NEW] Builder
*/
| /* static context
[FOCAL] public static Builder HttpsConfiguration.builder()
[NEW] Builder
*/
class HttpsConfiguration {
public static Builder builder()
{
return new Builder();
}
private HttpsConfiguration();
public HttpsConfiguration(String serverKeystorePath, String serverKeystorePassw... | true | ok | {"focal": {"class": "HttpsConfiguration", "name": "builder", "signature": "Builder builder()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Builder"}, "class_info": {"name": "HttpsConfiguration", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "mem... |
56551000_92 | class TraceContextCodec implements Codec<TextMap> {
@Override
public void inject(JaegerSpanContext spanContext, TextMap carrier) {
char[] chars = new char[TRACEPARENT_HEADER_SIZE];
chars[0] = VERSION.charAt(0);
chars[1] = VERSION.charAt(1);
chars[2] = TRACEPARENT_DELIMITER;
HexCodec.writeHexLon... | Map<String, String> carrier = new HashMap<>();
TextMapAdapter textMap = new TextMapAdapter(carrier);
long traceIdLow = 1;
long spanId = 2;
long parentId = 3;
long traceIdHigh = HexCodec.hexToUnsignedLong("c281c27976c85681", 0, 16);
JaegerSpanContext spanContext = new JaegerSpanContext(traceI... | [FOCAL] @Override public void TraceContextCodec.inject(JaegerSpanContext spanContext, TextMap carrier)
[CLASS] class TraceContextCodec implements Codec<TextMap>
[METRICS] loc=19 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] VERSION.charAt/1, HexCodec.writeHexLong/3, JaegerSpanContext.getTraceIdH... | /* static context
[FOCAL] @Override public void TraceContextCodec.inject(JaegerSpanContext spanContext, TextMap carrier)
[PATH1] if(spanContext.getTraceState() != null && !spanContext.getTraceState().isEmpty())=T
[PATH2] if(spanContext.getTraceState() != null && !spanContext.getTraceState().isEmpty())=F
[INPUTS] branch... | /* static context
[FOCAL] @Override public void TraceContextCodec.inject(JaegerSpanContext spanContext, TextMap carrier)
[PATH1] if(spanContext.getTraceState() != null && !spanContext.getTraceState().isEmpty())=T
[PATH2] if(spanContext.getTraceState() != null && !spanContext.getTraceState().isEmpty())=F
[INPUTS] branch... | true | ok | {"focal": {"class": "TraceContextCodec", "name": "inject", "signature": "void inject(JaegerSpanContext spanContext, TextMap carrier)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "spanContext", "type": "JaegerSpanContext"}, {"name": "carrier", "type": "TextMap"}], "return_type": "void"}, "clas... |
56572755_0 | class JpaProcessor implements BootPlugin {
public void process(Writer writer, List<Class<?>> annotatedList) throws Exception {
Set<String> puNames = new HashSet<String>();
XMLOutputFactory xof = XMLOutputFactory.newInstance();
XMLStreamWriter w = new IndentingXMLStreamWriter(xof.createXMLSt... | JpaProcessor processor = new JpaProcessor();
Map<PersistentUnit, List<? extends AnnotationMirror>> units = new HashMap<>();
PersistentUnit pu = getTestPersitentUnit();
units.put(pu, Collections.emptyList());
URL url = this.getClass().getResource("/expected_persistence.xml");
... | [FOCAL] public void JpaProcessor.process(Writer writer, List<Class<?>> annotatedList)
[CLASS] class JpaProcessor implements BootPlugin
[METRICS] loc=48 cc=6 branches=3 loops=2 returns=0 throws=2 nesting=3
[CALLS-INTERNAL] String getProvider(PersistentUnit pu); void addAnnProperties(Class<?> annotated, Map<String, Strin... | /* static context
[FOCAL] public void JpaProcessor.process(Writer writer, List<Class<?>> annotatedList)
[THROWS-WHEN] IOException when foreach(Class<?> annotated : annotatedList)=T && pu.name() == null || pu.name().isEmpty()
[THROWS-WHEN] IOException when foreach(Class<?> annotated : annotatedList)=T && !(pu.name() == ... | /* static context
[FOCAL] public void JpaProcessor.process(Writer writer, List<Class<?>> annotatedList)
[THROWS-WHEN] IOException when foreach(Class<?> annotated : annotatedList)=T && pu.name() == null || pu.name().isEmpty()
[THROWS-WHEN] IOException when foreach(Class<?> annotated : annotatedList)=T && !(pu.name() == ... | true | ok | {"focal": {"class": "JpaProcessor", "name": "process", "signature": "void process(Writer writer, List<Class<?>> annotatedList) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "writer", "type": "Writer"}, {"name": "annotatedList", "type": "List<Class<?>>"}], "return_type": "void"}, "class_... |
56590318_0 | class ConfigurationTemplatesDao implements TemplatesDao, InitializingBean {
protected TemplateDefinitionImpl loadTemplate(Path p) throws IOException {
ObjectMapper mapper = new ObjectMapper();
TemplateDefinitionImpl t = mapper.readValue(p.toFile(), TemplateDefinitionImpl.class);
return t;
... | ConfigurationTemplatesDao dao = new ConfigurationTemplatesDao(null);
TemplateDefinitionImpl t = dao.loadTemplate(Paths.get(getClass().getResource("/templates-test/overshootUndershoot.json").toURI()));
MatcherAssert.assertThat(t.getId(), CoreMatchers.is("overshootUndershoot"));
MatcherA... | [FOCAL] protected TemplateDefinitionImpl ConfigurationTemplatesDao.loadTemplate(Path p)
[CLASS] class ConfigurationTemplatesDao implements TemplatesDao, InitializingBean
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ObjectMapper.readValue/2, Path.toFile/0
[NEW] ObjectMapper
[EXCE... | /* static context
[FOCAL] protected TemplateDefinitionImpl ConfigurationTemplatesDao.loadTemplate(Path p)
[INPUTS] branches=- | result=p
[COLLABORATORS] param p:Path toFile/0
[EXCEPTIONS] declares IOException
[NEW] ObjectMapper
[CALLS-EXTERNAL] ObjectMapper.readValue/2, Path.toFile/0
*/
| /* static context
[FOCAL] protected TemplateDefinitionImpl ConfigurationTemplatesDao.loadTemplate(Path p)
[INPUTS] branches=- | result=p
[COLLABORATORS] param p:Path toFile/0
[EXCEPTIONS] declares IOException
[NEW] ObjectMapper
[CALLS-EXTERNAL] ObjectMapper.readValue/2, Path.toFile/0
*/
class ConfigurationTemplatesDao ... | true | ok | {"focal": {"class": "ConfigurationTemplatesDao", "name": "loadTemplate", "signature": "TemplateDefinitionImpl loadTemplate(Path p) throws IOException", "start_line": 3, "modifiers": "protected", "params": [{"name": "p", "type": "Path"}], "return_type": "TemplateDefinitionImpl"}, "class_info": {"name": "ConfigurationTem... |
56611216_24 | class OemBO {
public List<OemData> getAllOem() {
List<OemData> allOemData = new ArrayList<OemData>();
try {
List<TblOem> allRecords = tblOemJpaController.findTblOemEntities();
for (TblOem tblOem : allRecords) {
OemData oemData = new OemData(tblOem.getName(),... | System.out.println("getAllOem");
OemBO instance = new OemBO();
// int expResult = 1;
List result = instance.getAllOem();
assertNotNull(result); // don't check for a specific record count because this can change during testing/development
}
} | [FOCAL] public List<OemData> OemBO.getAllOem()
[CLASS] class OemBO
[METRICS] loc=20 cc=4 branches=0 loops=1 returns=1 throws=2 nesting=2
[CALLS-EXTERNAL] tblOemJpaController.findTblOemEntities/0, TblOem.getName/0, TblOem.getDescription/0, List<OemData>.add/1, log.error/2, e.getClass().getSimpleName/0, Exception.getClas... | /* static context
[FOCAL] public List<OemData> OemBO.getAllOem()
[THROWS-WHEN] ase when try-body throws
[THROWS-WHEN] ASException when try-body throws
[PATH1] foreach(TblOem tblOem : allRecords)=T -> exit loop -> return allOemData
[PATH2] try-body throws -> throw ase
[PATH3] try-body throws -> throw new ASException(Err... | /* static context
[FOCAL] public List<OemData> OemBO.getAllOem()
[THROWS-WHEN] ase when try-body throws
[THROWS-WHEN] ASException when try-body throws
[PATH1] foreach(TblOem tblOem : allRecords)=T -> exit loop -> return allOemData
[PATH2] try-body throws -> throw ase
[PATH3] try-body throws -> throw new ASException(Err... | true | ok | {"focal": {"class": "OemBO", "name": "getAllOem", "signature": "List<OemData> getAllOem()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<OemData>"}, "class_info": {"name": "OemBO", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "rnd", "type": ... |
56649404_7 | class StatisticsPresenter implements StatisticsContract.Presenter {
@Override
public void start() {
loadStatistics();
}
public StatisticsPresenter(@NonNull TasksRepository tasksRepository,
@NonNull StatisticsContract.View statisticsView);
private void loadS... | // Given an initialized StatisticsPresenter with no tasks
TASKS.clear();
// When loading of Tasks is requested
mStatisticsPresenter.start();
//Then progress indicator is shown
verify(mStatisticsView).setProgressIndicator(true);
// Callback is captured and invok... | [FOCAL] @Override public void StatisticsPresenter.start()
[CLASS] class StatisticsPresenter implements StatisticsContract.Presenter
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void loadStatistics()
[CLASS-MEMBERS] StatisticsPresenter(TasksRepository tasksRepository, StatisticsC... | /* static context
[FOCAL] @Override public void StatisticsPresenter.start()
[CALLS-INTERNAL] void loadStatistics()
*/
| /* static context
[FOCAL] @Override public void StatisticsPresenter.start()
[CALLS-INTERNAL] void loadStatistics()
*/
class StatisticsPresenter implements StatisticsContract.Presenter {
@Override
public void start() {
loadStatistics();
}
public StatisticsPresenter(@NonNull TasksRepository tas... | true | ok | {"focal": {"class": "StatisticsPresenter", "name": "start", "signature": "void start()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "StatisticsPresenter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "StatisticsContract.Presenter... |
56670932_2 | class PercentageOperator extends Operator<String> {
@Override
public Flag.FlagResultStatus appliesTo(@Nullable String value) throws NumberFormatException {
if (StringUtils.isEmpty(value)) {
return DISABLED;
}
final int val = Integer.parseInt(value);
//If there is no... | PercentageOperator percentageOperator = new PercentageOperator("modulo", 10, 5);
assertEquals(Flag.FlagResultStatus.DISABLED, percentageOperator.appliesTo("0"));
}
} | [FOCAL] @Override public Flag.FlagResultStatus PercentageOperator.appliesTo(String value)
[CLASS] class PercentageOperator extends Operator<String>
[METRICS] loc=16 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] StringUtils.isEmpty/1, Integer.parseInt/1
[EXCEPTIONS] declares NumberFormatException... | /* static context
[FOCAL] @Override public Flag.FlagResultStatus PercentageOperator.appliesTo(String value)
[PATH1] if(StringUtils.isEmpty(value))=F -> if(val == 0)=T -> return DISABLED
[PATH2] if(StringUtils.isEmpty(value))=F -> if(val == 0)=F -> return asPercentage >= shift && asPercentage < (percentage + shift) ? Fl... | /* static context
[FOCAL] @Override public Flag.FlagResultStatus PercentageOperator.appliesTo(String value)
[PATH1] if(StringUtils.isEmpty(value))=F -> if(val == 0)=T -> return DISABLED
[PATH2] if(StringUtils.isEmpty(value))=F -> if(val == 0)=F -> return asPercentage >= shift && asPercentage < (percentage + shift) ? Fl... | true | ok | {"focal": {"class": "PercentageOperator", "name": "appliesTo", "signature": "Flag.FlagResultStatus appliesTo(String value) throws NumberFormatException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "value", "type": "String"}], "return_type": "Flag.FlagResultStatus"}, "class_info": {"name": "Pe... |
56679521_31 | class ConfigurableWeightLoadBalance extends ActiveWeightLoadBalance<T> {
@Override
protected void doSelectToHolder(Request request, List<Referer<T>> refersHolder) {
if (holder == emptyHolder) {
return;
}
RefererListCacheHolder<T> h = this.holder;
int i = 0, j = 0;
... | generate(3, new int[] {2, 3, 5}, new int[] {3, 4, 5});
List<Referer<IHello>> list = new ArrayList<Referer<IHello>>();
balance.doSelectToHolder(new DefaultRequest(), list);
assertTrue(list.size() > 0 && list.size() <= ConfigurableWeightLoadBalance.MAX_REFERER_COUNT);
}
} | [FOCAL] @Override protected void ConfigurableWeightLoadBalance.doSelectToHolder(Request request, List<Referer<T>> refersHolder)
[CLASS] class ConfigurableWeightLoadBalance extends ActiveWeightLoadBalance<T>
[METRICS] loc=21 cc=6 branches=4 loops=1 returns=2 throws=0 nesting=3
[CALLS-INTERNAL] void noAvailableReferer()
... | /* static context
[FOCAL] @Override protected void ConfigurableWeightLoadBalance.doSelectToHolder(Request request, List<Referer<T>> refersHolder)
[PATH1] if(holder == emptyHolder)=F -> while(i++ < getReferers().size())=T -> if(r.isAvailable())=T -> if(++j == MAX_REFERER_COUNT)=F -> exit loop -> if(refersHolder.isEmpty(... | /* static context
[FOCAL] @Override protected void ConfigurableWeightLoadBalance.doSelectToHolder(Request request, List<Referer<T>> refersHolder)
[PATH1] if(holder == emptyHolder)=F -> while(i++ < getReferers().size())=T -> if(r.isAvailable())=T -> if(++j == MAX_REFERER_COUNT)=F -> exit loop -> if(refersHolder.isEmpty(... | true | ok | {"focal": {"class": "ConfigurableWeightLoadBalance", "name": "doSelectToHolder", "signature": "void doSelectToHolder(Request request, List<Referer<T>> refersHolder)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "request", "type": "Request"}, {"name": "refersHolder", "type": "List<Referer<T>... |
56690117_871 | class DefaultChooser extends Chooser {
@Override
public BigInteger getDhServerPublicKey() {
if (context.getServerDhPublicKey() != null) {
return context.getServerDhPublicKey();
} else {
return config.getDefaultServerDhPublicKey();
}
}
DefaultChooser(Tl... | context.setServerDhPublicKey(null);
config.setDefaultServerDhPublicKey(BigInteger.ONE);
assertEquals(BigInteger.ONE, config.getDefaultServerDhPublicKey());
assertEquals(BigInteger.ONE, chooser.getDhServerPublicKey());
context.setServerDhPublicKey(BigInteger.TEN);
assertEq... | [FOCAL] @Override public BigInteger DefaultChooser.getDhServerPublicKey()
[CLASS] class DefaultChooser extends Chooser
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] TlsContext.getServerDhPublicKey/0, Config.getDefaultServerDhPublicKey/0
[FIELDS] read=config:Config, context:TlsCon... | class DefaultChooser extends Chooser {
@Override
public BigInteger getDhServerPublicKey() {
if (context.getServerDhPublicKey() != null) {
return context.getServerDhPublicKey();
} else {
return config.getDefaultServerDhPublicKey();
}
}
DefaultChooser(Tl... | false | ok | {"focal": {"class": "DefaultChooser", "name": "getDhServerPublicKey", "signature": "BigInteger getDhServerPublicKey()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "BigInteger"}, "class_info": {"name": "DefaultChooser", "kind": "class", "modifiers": "", "superclass": "Chooser", "inter... | |
56703957_8 | class RemoveOneTokenFromPhrase extends QueryRelaxerHeuristic {
@Override
public Set<RelaxerSuggestion> createSuggestions(SolrQueryRequest req) {
List<String> tokens = new ArrayList<String>();
int countOfQuotes = 0;
SolrParams params = req.getParams();
String userQuery = params.get(CommonParams... | Set<RelaxerSuggestion> sugs = heuristic.createSuggestions(req(CommonParams.Q, "\"some\" test \""));
verify(sugs, "test \"", "\"some\" \"");
}
} | [FOCAL] @Override public Set<RelaxerSuggestion> RemoveOneTokenFromPhrase.createSuggestions(SolrQueryRequest req)
[CLASS] class RemoveOneTokenFromPhrase extends QueryRelaxerHeuristic
[METRICS] loc=71 cc=11 branches=8 loops=2 returns=2 throws=0 nesting=7
[CALLS-EXTERNAL] SolrQueryRequest.getParams/0, SolrParams.get/1, Re... | /* static context
[FOCAL] @Override public Set<RelaxerSuggestion> RemoveOneTokenFromPhrase.createSuggestions(SolrQueryRequest req)
[PATH1] if((tokens.size() - countOfQuotes) <= 1)=F -> for(i < tokens.size())=T -> if(tokens.get(i).equals("\""))=F -> for(j < tokens.size())=T -> if(tokens.get(j).equals("\""))=T -> if((sta... | /* static context
[FOCAL] @Override public Set<RelaxerSuggestion> RemoveOneTokenFromPhrase.createSuggestions(SolrQueryRequest req)
[PATH1] if((tokens.size() - countOfQuotes) <= 1)=F -> for(i < tokens.size())=T -> if(tokens.get(i).equals("\""))=F -> for(j < tokens.size())=T -> if(tokens.get(j).equals("\""))=T -> if((sta... | true | ok | {"focal": {"class": "RemoveOneTokenFromPhrase", "name": "createSuggestions", "signature": "Set<RelaxerSuggestion> createSuggestions(SolrQueryRequest req)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "req", "type": "SolrQueryRequest"}], "return_type": "Set<RelaxerSuggestion>"}, "class_info": {... |
56717384_36 | class Container extends Box {
public Dimension getUsedSpace() {
Dimension maxBox = Dimension.EMPTY;
for (Level level : levels) {
maxBox = getUsedSpace(level, maxBox);
}
return maxBox;
}
public Container(Container container);
public Container(Dimension dimension, int weight);
public Container(int w,... | assertEquals(new Dimension(0, 0, 0), new Container(0, 0, 0, 0).getUsedSpace());
}
} | [FOCAL] public Dimension Container.getUsedSpace()
[CLASS] class Container extends Box
[METRICS] loc=7 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Dimension getUsedSpace(Level level, Dimension maxBox)
[PATH1] foreach(Level level : levels)=T -> exit loop -> return maxBox
[PATH2] foreach(Level le... | /* static context
[FOCAL] public Dimension Container.getUsedSpace()
[PATH1] foreach(Level level : levels)=T -> exit loop -> return maxBox
[PATH2] foreach(Level level : levels)=F -> return maxBox
[CALLS-INTERNAL] Dimension getUsedSpace(Level level, Dimension maxBox)
*/
| /* static context
[FOCAL] public Dimension Container.getUsedSpace()
[PATH1] foreach(Level level : levels)=T -> exit loop -> return maxBox
[PATH2] foreach(Level level : levels)=F -> return maxBox
[CALLS-INTERNAL] Dimension getUsedSpace(Level level, Dimension maxBox)
*/
class Container extends Box {
public Dimension ge... | true | ok | {"focal": {"class": "Container", "name": "getUsedSpace", "signature": "Dimension getUsedSpace()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Dimension"}, "class_info": {"name": "Container", "kind": "class", "modifiers": "", "superclass": "Box", "interfaces": null, "fields": [], "members": [{"... |
56718024_27 | class ProvisioningProfile implements Comparable<ProvisioningProfile> {
public static ProvisioningProfile find(List<ProvisioningProfile> profiles, String search) {
for (ProvisioningProfile p : profiles) {
if (p.uuid.equals(search) || p.appIdPrefix.equals(search) || p.appIdName != null && p.appId... | ProvisioningProfile p1 = createProfile("Profile 1", "App 1", "DF6YH89WE3", "DF6YH89WE3.*", false, null, "0123456789");
ProvisioningProfile p2 = createProfile("Profile 2", "App 2", "HSKDO63H63", "HSKDO63H63.com.*", false, null, "2123456789");
ProvisioningProfile p3 = createProfile("Profile 3", "A... | [FOCAL] public static ProvisioningProfile ProvisioningProfile.find(List<ProvisioningProfile> profiles, String search)
[CLASS] class ProvisioningProfile implements Comparable<ProvisioningProfile>
[METRICS] loc=9 cc=3 branches=1 loops=1 returns=1 throws=1 nesting=2
[CALLS-EXTERNAL] p.uuid.equals/1, p.appIdPrefix.equals/1... | /* static context
[FOCAL] public static ProvisioningProfile ProvisioningProfile.find(List<ProvisioningProfile> profiles, String search)
[THROWS-WHEN] IllegalArgumentException when foreach(ProvisioningProfile p : profiles)=T && !((p.uuid.equals(search) || p.appIdPrefix.equals(search) || p.appIdName != null && p.appIdNam... | /* static context
[FOCAL] public static ProvisioningProfile ProvisioningProfile.find(List<ProvisioningProfile> profiles, String search)
[THROWS-WHEN] IllegalArgumentException when foreach(ProvisioningProfile p : profiles)=T && !((p.uuid.equals(search) || p.appIdPrefix.equals(search) || p.appIdName != null && p.appIdNam... | true | ok | {"focal": {"class": "ProvisioningProfile", "name": "find", "signature": "ProvisioningProfile find(List<ProvisioningProfile> profiles, String search)", "start_line": 3, "modifiers": "public static", "params": [{"name": "profiles", "type": "List<ProvisioningProfile>"}, {"name": "search", "type": "String"}], "return_type"... |
56729247_1 | class Instrumenter {
public static final void instrument(String rtJar, String outJar)
throws NoSuchAlgorithmException, IOException {
Logger.getGlobal().log(Level.FINE, "Instrumenting " + rtJar + " into " + outJar);
new Instrumenter().process(rtJar, outJar);
}
private Instrumen... | try {
Instrumenter.instrument(Paths.get("resources", "doesnotexist.jar").toString(),
Paths.get("resources", "doesnotexistOut.jar").toString());
fail("Expected an IOException to be thrown");
} catch (IOException exc) {
assertThat(exc... | [FOCAL] public static final void Instrumenter.instrument(String rtJar, String outJar)
[CLASS] class Instrumenter
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Logger.getGlobal().log/2, Logger.getGlobal/0, new Instrumenter().process/2
[NEW] Instrumenter
[EXCEPTIONS] declares NoSuc... | /* static context
[FOCAL] public static final void Instrumenter.instrument(String rtJar, String outJar)
[EXCEPTIONS] declares NoSuchAlgorithmException, IOException
[NEW] Instrumenter
[CALLS-EXTERNAL] Logger.getGlobal().log/2, Logger.getGlobal/0, new Instrumenter().process/2
*/
| /* static context
[FOCAL] public static final void Instrumenter.instrument(String rtJar, String outJar)
[EXCEPTIONS] declares NoSuchAlgorithmException, IOException
[NEW] Instrumenter
[CALLS-EXTERNAL] Logger.getGlobal().log/2, Logger.getGlobal/0, new Instrumenter().process/2
*/
class Instrumenter {
public static fi... | true | ok | {"focal": {"class": "Instrumenter", "name": "instrument", "signature": "void instrument(String rtJar, String outJar) throws NoSuchAlgorithmException, IOException", "start_line": 3, "modifiers": "public static final", "params": [{"name": "rtJar", "type": "String"}, {"name": "outJar", "type": "String"}], "return_type": "... |
56730584_3 | class MD5 {
public static byte[] hash(byte[] source) {
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
return digest.digest(source);
} catch (NoSuchAlgorithmException e) {
logger.error("Failed to find MD5");
}
return null;
}
... | byte[] hash = MD5.hash(TestConstants.msg.getBytes());
Assert.assertEquals(TestConstants.md5HashedBase64Msg, Base64.encodeToString(hash));
}
} | [FOCAL] public static byte[] MD5.hash(byte[] source)
[CLASS] class MD5
[METRICS] loc=9 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] MessageDigest.getInstance/1, MessageDigest.digest/1, logger.error/1
[EXCEPTIONS] catches NoSuchAlgorithmException e
[PATH1] try-body throws -> return null
[PATH2] ... | /* static context
[FOCAL] public static byte[] MD5.hash(byte[] source)
[PATH1] try-body throws -> return null
[PATH2] return digest.digest(source)
[INPUTS] branches=- | result=source
[EXCEPTIONS] catches NoSuchAlgorithmException e
[CALLS-EXTERNAL] MessageDigest.getInstance/1, MessageDigest.digest/1, logger.error/1
*/
| /* static context
[FOCAL] public static byte[] MD5.hash(byte[] source)
[PATH1] try-body throws -> return null
[PATH2] return digest.digest(source)
[INPUTS] branches=- | result=source
[EXCEPTIONS] catches NoSuchAlgorithmException e
[CALLS-EXTERNAL] MessageDigest.getInstance/1, MessageDigest.digest/1, logger.error/1
*/
c... | true | ok | {"focal": {"class": "MD5", "name": "hash", "signature": "byte[] hash(byte[] source)", "start_line": 3, "modifiers": "public static", "params": [{"name": "source", "type": "byte[]"}], "return_type": "byte[]"}, "class_info": {"name": "MD5", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields... |
56735986_14 | class TransactionContextExecutor extends Observable<T> {
public TransactionContextExecutor<T> withSingleTransaction() {
return new TransactionContextExecutor<>(SINGLE_TRANSACTION_TRANSACTION_CONTEXT, provider, connectionConsumer);
}
public TransactionContextExecutor(
TransactionContext transactionConte... | Connection c = mock(Connection.class);
ConnectionPool.of(c)
.execute(connection -> just(null, null))
.withSingleTransaction()
.toBlocking().subscribe(o -> {}, throwable -> {});
verify(c, times(1)).close();
}
} | [FOCAL] public TransactionContextExecutor<T> TransactionContextExecutor.withSingleTransaction()
[CLASS] class TransactionContextExecutor extends Observable<T>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] TransactionContextExecutor<>
[CLASS-MEMBERS] TransactionContextExecutor(TransactionCon... | /* static context
[FOCAL] public TransactionContextExecutor<T> TransactionContextExecutor.withSingleTransaction()
[NEW] TransactionContextExecutor<>
*/
| /* static context
[FOCAL] public TransactionContextExecutor<T> TransactionContextExecutor.withSingleTransaction()
[NEW] TransactionContextExecutor<>
*/
class TransactionContextExecutor extends Observable<T> {
public TransactionContextExecutor<T> withSingleTransaction() {
return new TransactionContextExecutor<>(S... | true | ok | {"focal": {"class": "TransactionContextExecutor", "name": "withSingleTransaction", "signature": "TransactionContextExecutor<T> withSingleTransaction()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "TransactionContextExecutor<T>"}, "class_info": {"name": "TransactionContextExecutor", "kind": "cl... |
56748637_33 | class QuestionWord implements IAnalyzer {
public QuestionWord() {
ArrayList<String> attributeValues = new ArrayList<String>();
attributeValues.add("Who");
attributeValues.add("What");
attributeValues.add("When");
attributeValues.add("Where");
attributeValues.add("Which");
attributeValues.add(Commands... | QuestionWord questionWord = new QuestionWord();
ArrayList<Attribute> fvWekaAttributes = new ArrayList<Attribute>();
fvWekaAttributes.add(questionWord.getAttribute());
new Instances("Test", fvWekaAttributes, 1 );
Instance test = new DenseInstance(fvWekaAttributes.size());
test.setValue(questionWord.getAttrib... | [FOCAL] public QuestionWord.QuestionWord()
[CLASS] class QuestionWord implements IAnalyzer
[METRICS] loc=16 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] ArrayList<String>.add/1
[NEW] ArrayList<String>, Attribute
[FIELDS] read=Commands:String
[DATAFLOW] attributeValues@L3->L4,L5,L6,L7,L8,L9,L10,... | /* static context
[FOCAL] public QuestionWord.QuestionWord()
[FIELDS] read=Commands:String
[NEW] ArrayList<String>, Attribute
[CALLS-EXTERNAL] ArrayList<String>.add/1
*/
| /* static context
[FOCAL] public QuestionWord.QuestionWord()
[FIELDS] read=Commands:String
[NEW] ArrayList<String>, Attribute
[CALLS-EXTERNAL] ArrayList<String>.add/1
*/
class QuestionWord implements IAnalyzer {
public QuestionWord() {
ArrayList<String> attributeValues = new ArrayList<String>();
attributeValue... | true | ok | {"focal": {"class": "QuestionWord", "name": "QuestionWord", "signature": "QuestionWord()", "start_line": 3, "modifiers": "public", "params": [], "return_type": null}, "class_info": {"name": "QuestionWord", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "IAnalyzer", "fields": [{"name": "Commands", "... |
56765949_4 | class MvpConductorLifecycleListener extends Controller.LifecycleListener {
@Override public void preDestroyView(@NonNull Controller controller, @NonNull View view) {
P presenter = getCallback().getPresenter();
if (presenter == null) {
throw new NullPointerException(
"Presenter returned from g... | MvpPresenter<MvpView> presenter = Mockito.mock(MvpPresenter.class);
Controller controller = Mockito.mock(Controller.class);
View view = Mockito.mock(View.class);
MvpConductorDelegateCallback<MvpView, MvpPresenter<MvpView>> callback =
Mockito.mock(MvpConductorDelegateCallback.class);
MvpCon... | [FOCAL] @Override public void MvpConductorLifecycleListener.preDestroyView(Controller controller, View view)
[CLASS] class MvpConductorLifecycleListener extends Controller.LifecycleListener
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1
[CALLS-INTERNAL] MvpConductorDelegateCallback<V, P> getCallba... | /* static context
[FOCAL] @Override public void MvpConductorLifecycleListener.preDestroyView(Controller controller, View view)
[THROWS-WHEN] NullPointerException when presenter == null
[PATH1] if(presenter == null)=T -> throw new NullPointerException( "Presenter returned from getPresenter() i...
[PATH2] if(presenter ==... | /* static context
[FOCAL] @Override public void MvpConductorLifecycleListener.preDestroyView(Controller controller, View view)
[THROWS-WHEN] NullPointerException when presenter == null
[PATH1] if(presenter == null)=T -> throw new NullPointerException( "Presenter returned from getPresenter() i...
[PATH2] if(presenter ==... | true | ok | {"focal": {"class": "MvpConductorLifecycleListener", "name": "preDestroyView", "signature": "void preDestroyView(Controller controller, View view)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "controller", "type": "Controller"}, {"name": "view", "type": "View"}], "return_type": "void"}, "clas... |
56791509_2 | class RESTMockServer {
public static MatchableCall whenPUT(Matcher<RecordedRequest> requestMatcher) {
return RESTMockServer.whenRequested(allOf(isPUT(), requestMatcher));
}
private RESTMockServer();
public static SSLSocketFactory getSSLSocketFactory();
public static X509TrustManager getT... | String path = "/sample";
String worksBody = "works";
MatchableCall matchableCall = RESTMockServer.whenPUT(pathEndsWith(path));
assertNotNull(matchableCall);
assertEquals(0, matchableCall.getNumberOfAnswers());
verify(RESTMockServer.dispatcher, never()).addMatchableCall(ma... | [FOCAL] public static MatchableCall RESTMockServer.whenPUT(Matcher<RecordedRequest> requestMatcher)
[CLASS] class RESTMockServer
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] RESTMockServer.whenRequested/1, allOf/2 (inherited), isPUT/0 (inherited)
[INPUTS] branches=- | result=req... | /* static context
[FOCAL] public static MatchableCall RESTMockServer.whenPUT(Matcher<RecordedRequest> requestMatcher)
[INPUTS] branches=- | result=requestMatcher
[CALLS-EXTERNAL] RESTMockServer.whenRequested/1, allOf/2 (inherited), isPUT/0 (inherited)
*/
| /* static context
[FOCAL] public static MatchableCall RESTMockServer.whenPUT(Matcher<RecordedRequest> requestMatcher)
[INPUTS] branches=- | result=requestMatcher
[CALLS-EXTERNAL] RESTMockServer.whenRequested/1, allOf/2 (inherited), isPUT/0 (inherited)
*/
class RESTMockServer {
public static MatchableCall whenPUT(M... | true | ok | {"focal": {"class": "RESTMockServer", "name": "whenPUT", "signature": "MatchableCall whenPUT(Matcher<RecordedRequest> requestMatcher)", "start_line": 3, "modifiers": "public static", "params": [{"name": "requestMatcher", "type": "Matcher<RecordedRequest>"}], "return_type": "MatchableCall"}, "class_info": {"name": "REST... |
56853150_7 | class TPUAnalysis {
public void run(String configPath, String outputPath, long timeMin, long timeMax, int limit)throws Exception {
FlinkEnvManager fem = new FlinkEnvManager(configPath, "converterJob",
TableIdentifier.RAW_TWITTER_DATA.get(),null);
DataSet<Tuple2<Key,Value>> rawTwit... | tmpSettingsDir.create();
File settings = tmpSettingsDir.newFile("settings");
File output = tmpSettingsDir.newFile("outputcsv");
output.delete();
Connector conn = amc.getConnector();
System.out.println("I am connected as: " + conn.whoami());
conn.tableOperations(... | [FOCAL] public void TPUAnalysis.run(String configPath, String outputPath, long timeMin, long timeMax, int limit)
[CLASS] class TPUAnalysis
[METRICS] loc=28 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] TableIdentifier.RAW_TWITTER_DATA.get/0, FlinkEnvManager.getDataFromAccumulo/0, rawTwitterDataR... | /* static context
[FOCAL] public void TPUAnalysis.run(String configPath, String outputPath, long timeMin, long timeMax, int limit)
[PATH1] if(limit >0)=T
[PATH2] if(limit >0)=F
[INPUTS] branches=limit | result=-
[EXCEPTIONS] declares Exception
[NEW] FlinkEnvManager, TimeFilter, UserTweetMap
[CALLS-EXTERNAL] TableIdenti... | /* static context
[FOCAL] public void TPUAnalysis.run(String configPath, String outputPath, long timeMin, long timeMax, int limit)
[PATH1] if(limit >0)=T
[PATH2] if(limit >0)=F
[INPUTS] branches=limit | result=-
[EXCEPTIONS] declares Exception
[NEW] FlinkEnvManager, TimeFilter, UserTweetMap
[CALLS-EXTERNAL] TableIdenti... | true | ok | {"focal": {"class": "TPUAnalysis", "name": "run", "signature": "void run(String configPath, String outputPath, long timeMin, long timeMax, int limit) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "configPath", "type": "String"}, {"name": "outputPath", "type": "String"}, {"name": "timeMi... |
56855940_6 | class MainActivityPresenter implements DialogInterface.OnClickListener {
public void onTimingClick(String timing) {
sharedPreferences.edit().putBoolean(Constants.APP_LOCK_ACTIVATED, false).apply();
storeTiming(timing);
mainActivityView.showToast(Constants.OVERLAY_DEACTIVATED_MESSAGE);
restoreToDefaul... | mainActivityPresenter.onTimingClick("3 min");
verify(mainActivityView).showToast(Constants.OVERLAY_DEACTIVATED_MESSAGE);
verify(mainActivityView).launchActivity(Utils.getHomeScreenIntent());
verify(mainActivityView).hideTimingGrid();
verify(mainActivityView).showActivateButton();
verify(mainActi... | [FOCAL] public void MainActivityPresenter.onTimingClick(String timing)
[CLASS] class MainActivityPresenter implements DialogInterface.OnClickListener
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void launchHomeScreen(); void restoreToDefault(); void storeTiming(String timing)
[C... | /* static context
[FOCAL] public void MainActivityPresenter.onTimingClick(String timing)
[COLLABORATORS] field sharedPreferences:SharedPreferences edit/0; field mainActivityView:MainActivityView showToast/1
[CALLS-INTERNAL] void launchHomeScreen(); void restoreToDefault(); void storeTiming(String timing)
[FIELDS] read=... | /* static context
[FOCAL] public void MainActivityPresenter.onTimingClick(String timing)
[COLLABORATORS] field sharedPreferences:SharedPreferences edit/0; field mainActivityView:MainActivityView showToast/1
[CALLS-INTERNAL] void launchHomeScreen(); void restoreToDefault(); void storeTiming(String timing)
[FIELDS] read=... | true | ok | {"focal": {"class": "MainActivityPresenter", "name": "onTimingClick", "signature": "void onTimingClick(String timing)", "start_line": 3, "modifiers": "public", "params": [{"name": "timing", "type": "String"}], "return_type": "void"}, "class_info": {"name": "MainActivityPresenter", "kind": "class", "modifiers": "", "sup... |
56890246_2 | class TracerParameters {
@SuppressWarnings({"unchecked", "rawtypes"})
public static Map<String, String> getParameters() {
Properties props = Configuration.loadConfigurationFile();
loadSystemProperties(props);
for (String propName : props.stringPropertyNames()) {
String valu... | Properties props = new Properties();
props.setProperty(TracerParameters.ACCESS_TOKEN, ACCESS_TOKEN);
props.setProperty(TracerParameters.COMPONENT_NAME, COMPONENT_NAME);
props.setProperty(TracerParameters.COLLECTOR_CLIENT, COLLECTOR_CLIENT);
props.setProperty(TracerParameters.COLL... | [FOCAL] @SuppressWarnings({"unchecked", "rawtypes"}) public static Map<String, String> TracerParameters.getParameters()
[CLASS] class TracerParameters
[METRICS] loc=16 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] String hideString(String input); void loadSystemProperties(Properties props)
[CALL... | /* static context
[FOCAL] @SuppressWarnings({"unchecked", "rawtypes"}) public static Map<String, String> TracerParameters.getParameters()
[PATH1] foreach(String propName : props.stringPropertyNames())=T -> if(ACCESS_TOKEN.equals(propName))=T -> exit loop -> return (Map)props
[PATH2] foreach(String propName : props.stri... | /* static context
[FOCAL] @SuppressWarnings({"unchecked", "rawtypes"}) public static Map<String, String> TracerParameters.getParameters()
[PATH1] foreach(String propName : props.stringPropertyNames())=T -> if(ACCESS_TOKEN.equals(propName))=T -> exit loop -> return (Map)props
[PATH2] foreach(String propName : props.stri... | true | ok | {"focal": {"class": "TracerParameters", "name": "getParameters", "signature": "Map<String, String> getParameters()", "start_line": 3, "modifiers": "@SuppressWarnings({\"unchecked\", \"rawtypes\"}) public static", "params": [], "return_type": "Map<String, String>"}, "class_info": {"name": "TracerParameters", "kind": "cl... |
57079254_7 | class StatisticsPresenter implements StatisticsContract.Presenter {
@Override
public void start() {
loadStatistics();
}
public StatisticsPresenter(
@NonNull UseCaseHandler useCaseHandler,
@NonNull StatisticsContract.View statisticsView,
@NonNull GetTasks ge... | // Given an initialized StatisticsPresenter with no tasks
TASKS.clear();
// When loading of Tasks is requested
mStatisticsPresenter.start();
//Then progress indicator is shown
verify(mStatisticsView).setProgressIndicator(true);
// Callback is captured and invok... | [FOCAL] @Override public void StatisticsPresenter.start()
[CLASS] class StatisticsPresenter implements StatisticsContract.Presenter
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void loadStatistics()
[CLASS-MEMBERS] StatisticsPresenter(UseCaseHandler useCaseHandler, StatisticsCon... | /* static context
[FOCAL] @Override public void StatisticsPresenter.start()
[CALLS-INTERNAL] void loadStatistics()
*/
| /* static context
[FOCAL] @Override public void StatisticsPresenter.start()
[CALLS-INTERNAL] void loadStatistics()
*/
class StatisticsPresenter implements StatisticsContract.Presenter {
@Override
public void start() {
loadStatistics();
}
public StatisticsPresenter(
@NonNull UseCas... | true | ok | {"focal": {"class": "StatisticsPresenter", "name": "start", "signature": "void start()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "StatisticsPresenter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "StatisticsContract.Presenter... |
57081740_1 | class BotsHttpClient extends CloseableHttpClient {
@Override
public CloseableHttpResponse execute(HttpUriRequest request) throws IOException, ClientProtocolException {
HttpRequestWrapper wrap = HttpRequestWrapper.wrap(request);
adviseRobotsTxt(wrap.getURI());
wrap.setURI(applyPHP(wrap.getURI()));
r... | Bots bots = BotsUtils.readBots("http://localhost:5000/robots.txt");
BotsHttpClient client = new BotsHttpClient(bots);
HttpGet request = new HttpGet("http://localhost:5000/data.txt");
HttpResponse response = client.execute(request);
assertNotNull("No response", response);
try (InputStre... | [FOCAL] @Override public CloseableHttpResponse BotsHttpClient.execute(HttpUriRequest request)
[CLASS] class BotsHttpClient extends CloseableHttpClient
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] URI applyPHP(URI uri); void adviseRobotsTxt(URI u)
[CALLS-EXTERNAL] HttpRequestWrap... | /* static context
[FOCAL] @Override public CloseableHttpResponse BotsHttpClient.execute(HttpUriRequest request)
[INPUTS] branches=- | result=request, client
[COLLABORATORS] field client:MockServerClient execute/1
[EXCEPTIONS] declares IOException, ClientProtocolException
[CALLS-INTERNAL] URI applyPHP(URI uri); void adv... | /* static context
[FOCAL] @Override public CloseableHttpResponse BotsHttpClient.execute(HttpUriRequest request)
[INPUTS] branches=- | result=request, client
[COLLABORATORS] field client:MockServerClient execute/1
[EXCEPTIONS] declares IOException, ClientProtocolException
[CALLS-INTERNAL] URI applyPHP(URI uri); void adv... | true | ok | {"focal": {"class": "BotsHttpClient", "name": "execute", "signature": "CloseableHttpResponse execute(HttpUriRequest request) throws IOException, ClientProtocolException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "HttpUriRequest"}], "return_type": "CloseableHttpResponse"},... |
57096675_0 | class Functional {
public static <R> Future<List<R>> allOfFutures(List<Future<R>> futures) {
return CompositeFutureImpl.all(futures.toArray(new Future[futures.size()]))
.map(v -> futures.stream()
.map(Future::result)
.collect(Collectors.toList())
);
}
private Functional();
}
c... | List<Future<Integer>> list1 = Arrays.asList(Future.succeededFuture(2),
Future.succeededFuture(9), Future.succeededFuture(17));
Future<List<Integer>> fs1 = Functional.allOfFutures(list1);
List<Integer> cpList = Arrays.asList(2, 9, 17);
assertEquals(fs1.succeeded(), true);
assertEquals(fs1.resul... | [FOCAL] public static Future<List<R>> Functional.allOfFutures(List<Future<R>> futures)
[CLASS] class Functional
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] CompositeFutureImpl.all(futures.toArray(new Future[future....map/1, CompositeFutureImpl.all/1, List<Future<R>>.toArray/1, ... | /* static context
[FOCAL] public static Future<List<R>> Functional.allOfFutures(List<Future<R>> futures)
[INPUTS] branches=- | result=futures
[COLLABORATORS] param futures:List<Future<R>> toArray/1,size/0,stream/0
[CALLS-EXTERNAL] CompositeFutureImpl.all(futures.toArray(new Future[future....map/1, CompositeFutureImpl.a... | /* static context
[FOCAL] public static Future<List<R>> Functional.allOfFutures(List<Future<R>> futures)
[INPUTS] branches=- | result=futures
[COLLABORATORS] param futures:List<Future<R>> toArray/1,size/0,stream/0
[CALLS-EXTERNAL] CompositeFutureImpl.all(futures.toArray(new Future[future....map/1, CompositeFutureImpl.a... | true | ok | {"focal": {"class": "Functional", "name": "allOfFutures", "signature": "Future<List<R>> allOfFutures(List<Future<R>> futures)", "start_line": 3, "modifiers": "public static", "params": [{"name": "futures", "type": "List<Future<R>>"}], "return_type": "Future<List<R>>"}, "class_info": {"name": "Functional", "kind": "clas... |
57125528_11 | class CSVMetadataLoader extends FileWithMetadataAction implements EOCAware {
public String[] readMetadataFields(CSVReader reader) throws IOException {
// read first line from the file, with metadata description
String[] metadataFields = reader.readNext();
if(metadataFields==null)
throw new RuntimeException... | setUp();
CSVReader reader = metadataLoader.createReader();
String[] metadataFields = metadataLoader.readMetadataFields(reader);
assertEquals(4, metadataFields.length);
assertEquals("path",metadataFields[0]);
assertEquals("InputMetadata1",metadataFields[1]);
assertEquals("InputMetadata2",metadataFields[2]... | [FOCAL] public String[] CSVMetadataLoader.readMetadataFields(CSVReader reader)
[CLASS] class CSVMetadataLoader extends FileWithMetadataAction implements EOCAware
[METRICS] loc=24 cc=6 branches=4 loops=1 returns=1 throws=2 nesting=2
[CALLS-EXTERNAL] CSVReader.readNext/0, getParameter/1 (inherited), logger.debug/1, Param... | /* static context
[FOCAL] public String[] CSVMetadataLoader.readMetadataFields(CSVReader reader)
[THROWS-WHEN] RuntimeException when metadataFields==null
[THROWS-WHEN] RuntimeException when !(metadataFields==null) && i < metadataFields.length && value != null && Parameters.PARAM_FILE.equals(metadataFields[i]) && !hasFi... | /* static context
[FOCAL] public String[] CSVMetadataLoader.readMetadataFields(CSVReader reader)
[THROWS-WHEN] RuntimeException when metadataFields==null
[THROWS-WHEN] RuntimeException when !(metadataFields==null) && i < metadataFields.length && value != null && Parameters.PARAM_FILE.equals(metadataFields[i]) && !hasFi... | true | ok | {"focal": {"class": "CSVMetadataLoader", "name": "readMetadataFields", "signature": "String[] readMetadataFields(CSVReader reader) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "reader", "type": "CSVReader"}], "return_type": "String[]"}, "class_info": {"name": "CSVMetadataLoader", "ki... |
57126883_2 | class XicidailiProxyListPageParser implements ProxyListPageParser {
@Override
public List<Proxy> parse(String hmtl) {
Document document = Jsoup.parse(hmtl);
Elements elements = document.select("table[id=ip_list] tr[class]");
List<Proxy> proxyList = new ArrayList<>(elements.size());
... | SimpleHttpClient simpleHttpClient = new SimpleHttpClient(null);
String r = simpleHttpClient.get("http://www.xicidaili.com/wt/1.html");
XicidailiProxyListPageParser pageParser = new XicidailiProxyListPageParser();
List<Proxy> proxyList =pageParser.parse(r);
Assert.assertTrue(proxy... | [FOCAL] @Override public List<Proxy> XicidailiProxyListPageParser.parse(String hmtl)
[CLASS] class XicidailiProxyListPageParser implements ProxyListPageParser
[METRICS] loc=15 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Jsoup.parse/1, Document.select/1, Elements.size/0, element.select("td:eq(1... | /* static context
[FOCAL] @Override public List<Proxy> XicidailiProxyListPageParser.parse(String hmtl)
[PATH1] foreach(Element element : elements)=T -> if(!anonymousFlag || isAnonymous.contains("匿"))=T -> exit loop -> return proxyList
[PATH2] foreach(Element element : elements)=F -> return proxyList
[PATH3] foreach(Ele... | /* static context
[FOCAL] @Override public List<Proxy> XicidailiProxyListPageParser.parse(String hmtl)
[PATH1] foreach(Element element : elements)=T -> if(!anonymousFlag || isAnonymous.contains("匿"))=T -> exit loop -> return proxyList
[PATH2] foreach(Element element : elements)=F -> return proxyList
[PATH3] foreach(Ele... | true | ok | {"focal": {"class": "XicidailiProxyListPageParser", "name": "parse", "signature": "List<Proxy> parse(String hmtl)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "hmtl", "type": "String"}], "return_type": "List<Proxy>"}, "class_info": {"name": "XicidailiProxyListPageParser", "kind": "class", "mo... |
57191077_2 | class HttpDaemon {
public static void registerServlet(String urlPattern, HttpServlet servlet) {
sServletMap.put(urlPattern, servlet);
}
public HttpDaemon(int port);
public HttpDaemon();
public static int getPort();
public static HttpDaemon getSingleton();
public void start();
... | HttpDaemon.registerServlet("/", new HttpServlet() {
@Override
public HttpResponse doGet(HttpRequest request) {
return null;
}
@Override
public HttpResponse doPost(HttpRequest request) {
request.parseMultipartBody(repos... | [FOCAL] public static void HttpDaemon.registerServlet(String urlPattern, HttpServlet servlet)
[CLASS] class HttpDaemon
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] sServletMap.put/2
[COLLABORATORS] field sServletMap put/2
[DATAFLOW] servlet@param->L2; urlPattern@param->L2
[CLASS... | /* static context
[FOCAL] public static void HttpDaemon.registerServlet(String urlPattern, HttpServlet servlet)
[COLLABORATORS] field sServletMap put/2
[CALLS-EXTERNAL] sServletMap.put/2
*/
| /* static context
[FOCAL] public static void HttpDaemon.registerServlet(String urlPattern, HttpServlet servlet)
[COLLABORATORS] field sServletMap put/2
[CALLS-EXTERNAL] sServletMap.put/2
*/
class HttpDaemon {
public static void registerServlet(String urlPattern, HttpServlet servlet) {
sServletMap.put(urlPa... | true | ok | {"focal": {"class": "HttpDaemon", "name": "registerServlet", "signature": "void registerServlet(String urlPattern, HttpServlet servlet)", "start_line": 3, "modifiers": "public static", "params": [{"name": "urlPattern", "type": "String"}, {"name": "servlet", "type": "HttpServlet"}], "return_type": "void"}, "class_info":... |
57194230_3 | class Container {
public String createClasspath(String basedir, String aplVersion) {
try {
Stream<Path> paths = Files.walk(Paths.get(basedir));
String jarsPath = paths
.filter(path -> path.toFile().isDirectory() && path.toFile().getName().contains(aplVersion))
... | Container sut = new Container(1);
String basePath = new File(ContainerTest.class.getClassLoader().getResource("containerTestResources").getPath())
.getAbsolutePath();
assertThat(sut.createClasspath(basePath, "0.2.0")).isEqualTo(basePath);
}
} | [FOCAL] public String Container.createClasspath(String basedir, String aplVersion)
[CLASS] class Container
[METRICS] loc=24 cc=3 branches=1 loops=0 returns=2 throws=1 nesting=2
[CALLS-EXTERNAL] Files.walk/1, Paths.get/1, paths .filter(path -> path.toFile().isDirectory() && path....collect/1, paths .filter(path -> path.... | /* static context
[FOCAL] public String Container.createClasspath(String basedir, String aplVersion)
[THROWS-WHEN] UncheckedIOException when try-body throws
[PATH1] try-body throws -> throw new UncheckedIOException(e)
[PATH2] if(jarsPath.isEmpty())=T -> return basedir
[PATH3] if(jarsPath.isEmpty())=F -> return basedir ... | /* static context
[FOCAL] public String Container.createClasspath(String basedir, String aplVersion)
[THROWS-WHEN] UncheckedIOException when try-body throws
[PATH1] try-body throws -> throw new UncheckedIOException(e)
[PATH2] if(jarsPath.isEmpty())=T -> return basedir
[PATH3] if(jarsPath.isEmpty())=F -> return basedir ... | true | ok | {"focal": {"class": "Container", "name": "createClasspath", "signature": "String createClasspath(String basedir, String aplVersion)", "start_line": 3, "modifiers": "public", "params": [{"name": "basedir", "type": "String"}, {"name": "aplVersion", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Con... |
57202360_28 | class DrawerPresenter extends BaseActivityPresenter<DrawerMvp.View> implements DrawerMvp.Presenter {
@Override
public void onNavigationItemSelected(@IdRes int itemId) {
if (itemId != selectedItemId) {
switch (itemId) {
case R.id.drawer_nav_schedule:
view.... | // Given
presenter.selectedItemId = 0;
// When
presenter.onNavigationItemSelected(R.id.drawer_nav_speakers);
// Then
verify(view).showFragment(any(SpeakersListFragment.class));
}
} | [FOCAL] @Override public void DrawerPresenter.onNavigationItemSelected(int itemId)
[CLASS] class DrawerPresenter extends BaseActivityPresenter<DrawerMvp.View> implements DrawerMvp.Presenter
[METRICS] loc=34 cc=7 branches=2 loops=0 returns=0 throws=1 nesting=2
[CALLS-EXTERNAL] DrawerMvp.View.showFragment/1, new Schedule... | /* static context
[FOCAL] @Override public void DrawerPresenter.onNavigationItemSelected(int itemId)
[THROWS-WHEN] IllegalArgumentException when itemId != selectedItemId && switch(itemId)=default
[PATH1] if(itemId != selectedItemId)=T -> switch(itemId)=default -> throw new IllegalArgumentException()
[PATH2] if(itemId !... | /* static context
[FOCAL] @Override public void DrawerPresenter.onNavigationItemSelected(int itemId)
[THROWS-WHEN] IllegalArgumentException when itemId != selectedItemId && switch(itemId)=default
[PATH1] if(itemId != selectedItemId)=T -> switch(itemId)=default -> throw new IllegalArgumentException()
[PATH2] if(itemId !... | true | ok | {"focal": {"class": "DrawerPresenter", "name": "onNavigationItemSelected", "signature": "void onNavigationItemSelected(int itemId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "itemId", "type": "int"}], "return_type": "void"}, "class_info": {"name": "DrawerPresenter", "kind": "class", "modifi... |
57251243_437 | class BiConsumerWithTracing implements BiConsumer<T, U> {
public static <T, U> BiConsumerWithTracing<T, U> withTracing(BiConsumer<T, U> origBiConsumer) {
return new BiConsumerWithTracing<>(origBiConsumer);
}
public BiConsumerWithTracing(BiConsumer<T, U> origBiConsumer);
public BiConsumerWith... | "true",
"false"
})
@Test
public void pair_constructor_sets_fields_as_expected_when_pair_is_null(boolean useStaticFactory) {
// when
BiConsumerWithTracing instance = (useStaticFactory)
? withTracing(biConsumerMock, (Pair)null)
... | [FOCAL] public static BiConsumerWithTracing<T, U> BiConsumerWithTracing.withTracing(BiConsumer<T, U> origBiConsumer)
[CLASS] class BiConsumerWithTracing implements BiConsumer<T, U>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] BiConsumerWithTracing<>
[INPUTS] branches=- | result=origBiConsu... | /* static context
[FOCAL] public static BiConsumerWithTracing<T, U> BiConsumerWithTracing.withTracing(BiConsumer<T, U> origBiConsumer)
[INPUTS] branches=- | result=origBiConsumer
[NEW] BiConsumerWithTracing<>
*/
| /* static context
[FOCAL] public static BiConsumerWithTracing<T, U> BiConsumerWithTracing.withTracing(BiConsumer<T, U> origBiConsumer)
[INPUTS] branches=- | result=origBiConsumer
[NEW] BiConsumerWithTracing<>
*/
class BiConsumerWithTracing implements BiConsumer<T, U> {
public static <T, U> BiConsumerWithTracing<T,... | true | ok | {"focal": {"class": "BiConsumerWithTracing", "name": "withTracing", "signature": "BiConsumerWithTracing<T, U> withTracing(BiConsumer<T, U> origBiConsumer)", "start_line": 3, "modifiers": "public static", "params": [{"name": "origBiConsumer", "type": "BiConsumer<T, U>"}], "return_type": "BiConsumerWithTracing<T, U>"}, "... |
57261362_3 | class RSAUtils {
public static byte[] encryptByPublicKey(byte[] data, RSAPublicKey publicKey) {
try {
Cipher cipher = Cipher.getInstance(KEY_ALGORITHM_PADDING);
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
// 模长
int key_len = publicKey.getModulus().bitLength(... |
}
public static Pair<RSAPublicKey, RSAPrivateKey> genKeyPair(int rsaKeySize);
public static String encodeBase64(Key key);
public static PrivateKey decodePrivateKey(String key);
public static PublicKey decodePublicKey(String publicKey);
public static String sign(byte[] data, String privateKey);... | [FOCAL] public static byte[] RSAUtils.encryptByPublicKey(byte[] data, RSAPublicKey publicKey)
[CLASS] class RSAUtils
[METRICS] loc=14 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] byte[] doFinal(Cipher cipher, byte[] data, int key_len)
[CALLS-EXTERNAL] Cipher.getInstance/1, Cipher.init/2, public... | /* static context
[FOCAL] public static byte[] RSAUtils.encryptByPublicKey(byte[] data, RSAPublicKey publicKey)
[THROWS-WHEN] CryptoException when try-body throws
[PATH1] try-body throws -> throw new CryptoException("RSA encrypt ex", e)
[PATH2] return doFinal(cipher, data, key_len - 11)
[INPUTS] branches=- | result=dat... | /* static context
[FOCAL] public static byte[] RSAUtils.encryptByPublicKey(byte[] data, RSAPublicKey publicKey)
[THROWS-WHEN] CryptoException when try-body throws
[PATH1] try-body throws -> throw new CryptoException("RSA encrypt ex", e)
[PATH2] return doFinal(cipher, data, key_len - 11)
[INPUTS] branches=- | result=dat... | true | ok | {"focal": {"class": "RSAUtils", "name": "encryptByPublicKey", "signature": "byte[] encryptByPublicKey(byte[] data, RSAPublicKey publicKey)", "start_line": 3, "modifiers": "public static", "params": [{"name": "data", "type": "byte[]"}, {"name": "publicKey", "type": "RSAPublicKey"}], "return_type": "byte[]"}, "class_info... |
57263576_18 | class WXText extends WXComponent {
@Override
public WXTextView getView() {
return (WXTextView) super.getView();
}
public WXText(WXSDKInstance instance, WXDomObject node,
WXVContainer parent, boolean lazy);
@Override protected void initView();
@Override public void updateExtra(Object ... | testBind();
Map<String, Object> prop = new HashMap<>();
prop.put(WXDomPropConstant.WX_ATTR_DISABLED, "false");
prop.put(WXDomPropConstant.WX_OPACITY, 0.8f);
mWXText.updateProperties(prop);
assertTrue(mWXText.getView().isEnabled());
assertTrue(mWXText.getView().get... | [FOCAL] @Override public WXTextView WXText.getView()
[CLASS] class WXText extends WXComponent
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] WXComponent.getView/0
[CLASS-MEMBERS] WXText(WXSDKInstance instance, WXDomObject node, WXVContainer parent, boolean lazy); void initView(); ... | /* static context
[FOCAL] @Override public WXTextView WXText.getView()
[CALLS-EXTERNAL] WXComponent.getView/0
*/
| /* static context
[FOCAL] @Override public WXTextView WXText.getView()
[CALLS-EXTERNAL] WXComponent.getView/0
*/
class WXText extends WXComponent {
@Override
public WXTextView getView() {
return (WXTextView) super.getView();
}
public WXText(WXSDKInstance instance, WXDomObject node,
WXVCon... | true | ok | {"focal": {"class": "WXText", "name": "getView", "signature": "WXTextView getView()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "WXTextView"}, "class_info": {"name": "WXText", "kind": "class", "modifiers": "", "superclass": "WXComponent", "interfaces": null, "fields": [{"name": "mWX... |
57338026_212 | class AwsSecurityContextFilter implements ContainerRequestFilter {
@Override
public void filter(ContainerRequestContext requestContext) throws IOException {
requestContext.setSecurityContext(createSecurityContext());
}
public AwsSecurityContextFilter();
public AwsSecurityContextFilter(Collection<String> allo... | GatewayRequest request = new GatewayRequestBuilder()
.prepareCustomAuthorizerRequest(false)
.build();
SecurityContext sc = filter(request);
assertNull(sc.getUserPrincipal());
}
} | [FOCAL] @Override public void AwsSecurityContextFilter.filter(ContainerRequestContext requestContext)
[CLASS] class AwsSecurityContextFilter implements ContainerRequestFilter
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] SecurityContext createSecurityContext()
[CALLS-EXTERNAL] Co... | /* static context
[FOCAL] @Override public void AwsSecurityContextFilter.filter(ContainerRequestContext requestContext)
[COLLABORATORS] param requestContext:ContainerRequestContext setSecurityContext/1
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] SecurityContext createSecurityContext()
[CALLS-EXTERNAL] ContainerR... | /* static context
[FOCAL] @Override public void AwsSecurityContextFilter.filter(ContainerRequestContext requestContext)
[COLLABORATORS] param requestContext:ContainerRequestContext setSecurityContext/1
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] SecurityContext createSecurityContext()
[CALLS-EXTERNAL] ContainerR... | true | ok | {"focal": {"class": "AwsSecurityContextFilter", "name": "filter", "signature": "void filter(ContainerRequestContext requestContext) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "requestContext", "type": "ContainerRequestContext"}], "return_type": "void"}, "class_info": {"na... |
57401572_44 | class SpringBootAnnotationConfigProvider extends HttpConfigurationProvider {
@Override
@Nullable
public Configuration getConfiguration(final ServletContext servletContext) {
if (!this.properties.isEnabled()) {
return null;
}
// Generate a list of all relevant annotations
final Set<Class<? extends Annot... | this.webApplicationContextRunner
.withPropertyValues("joinfaces.rewrite.annotation-config-provider.enabled=false")
.run(context -> {
SpringBootAnnotationConfigProvider annotationConfigProvider = context.getBean(
SpringBootAnnotationConfigProvider.class);
assertThat(annotationConfigProvider).isNotNu... | [FOCAL] @Override @Nullable public Configuration SpringBootAnnotationConfigProvider.getConfiguration(ServletContext servletContext)
[CLASS] class SpringBootAnnotationConfigProvider extends HttpConfigurationProvider
[METRICS] loc=25 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] Optional<Set<Class... | /* static context
[FOCAL] @Override @Nullable public Configuration SpringBootAnnotationConfigProvider.getConfiguration(ServletContext servletContext)
[PATH1] if(!this.properties.isEnabled())=F -> foreach(AnnotationHandler<Annotation> handler : (Iterable<AnnotationHandler<Annotation>>) ServiceLoader.load(AnnotationHandl... | /* static context
[FOCAL] @Override @Nullable public Configuration SpringBootAnnotationConfigProvider.getConfiguration(ServletContext servletContext)
[PATH1] if(!this.properties.isEnabled())=F -> foreach(AnnotationHandler<Annotation> handler : (Iterable<AnnotationHandler<Annotation>>) ServiceLoader.load(AnnotationHandl... | true | ok | {"focal": {"class": "SpringBootAnnotationConfigProvider", "name": "getConfiguration", "signature": "Configuration getConfiguration(ServletContext servletContext)", "start_line": 3, "modifiers": "@Override @Nullable public", "params": [{"name": "servletContext", "type": "ServletContext"}], "return_type": "Configuration"... |
57461213_51 | class ExaminePlugin extends Plugin {
@VisibleForTesting
void getItemPrice(int id, ItemComposition itemComposition, int quantity)
{
// quantity is at least 1
quantity = Math.max(1, quantity);
final int gePrice = itemManager.getItemPrice(id);
final int alchPrice = itemComposition.getHaPrice();
if (gePrice ... | ItemComposition itemComposition = mock(ItemComposition.class);
when(itemComposition.getName()).thenReturn("Abyssal whip");
when(itemComposition.getHaPrice()).thenReturn(2);
when(itemManager.getItemPrice(ItemID.ABYSSAL_WHIP)).thenReturn(3);
examinePlugin.getItemPrice(ItemID.ABYSSAL_WHIP, itemComposition, 2_000... | [FOCAL] @VisibleForTesting void ExaminePlugin.getItemPrice(int id, ItemComposition itemComposition, int quantity)
[CLASS] class ExaminePlugin extends Plugin
[METRICS] loc=73 cc=7 branches=6 loops=0 returns=0 throws=0 nesting=3
[CALLS-EXTERNAL] Math.max/2, ItemManager.getItemPrice/1, ItemComposition.getHaPrice/0, new Ch... | /* static context
[FOCAL] @VisibleForTesting void ExaminePlugin.getItemPrice(int id, ItemComposition itemComposition, int quantity)
[PATH1] if(gePrice > 0 || alchPrice > 0)=T -> if(quantity > 1)#1=T -> if(gePrice > 0)=T -> if(quantity > 1)#2=T -> if(alchPrice > 0)=T -> if(quantity > 1)#3=T
[PATH2] if(gePrice > 0 || alc... | /* static context
[FOCAL] @VisibleForTesting void ExaminePlugin.getItemPrice(int id, ItemComposition itemComposition, int quantity)
[PATH1] if(gePrice > 0 || alchPrice > 0)=T -> if(quantity > 1)#1=T -> if(gePrice > 0)=T -> if(quantity > 1)#2=T -> if(alchPrice > 0)=T -> if(quantity > 1)#3=T
[PATH2] if(gePrice > 0 || alc... | true | ok | {"focal": {"class": "ExaminePlugin", "name": "getItemPrice", "signature": "void getItemPrice(int id, ItemComposition itemComposition, int quantity)", "start_line": 3, "modifiers": "@VisibleForTesting", "params": [{"name": "id", "type": "int"}, {"name": "itemComposition", "type": "ItemComposition"}, {"name": "quantity",... |
57613683_0 | class Jsouper {
public <T> ElementAdapter<T> adapter(Type type) {
return adapter(type, Util.NO_ANNOTATIONS);
}
public Jsouper(Builder builder);
public ElementAdapter<T> adapter(Type type, Set<? extends Annotation> annotations);
static final String MOVIE_HTML;
final Document document;
}
class Jsou... | Jsouper jsouper = new Jsouper.Builder()
.add(Movie.class, new MovieAdapter())
.build();
ElementAdapter<Movie> elementAdapter = jsouper.adapter(Movie.class);
Movie movie = elementAdapter.fromElement(document);
assertThat(movie).isEqualTo(new Movie("Deadpool", "Sample description", 4));
... | [FOCAL] public ElementAdapter<T> Jsouper.adapter(Type type)
[CLASS] class Jsouper
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ElementAdapter<T> adapter(Type type, Set<? extends Annotation> annotations)
[INPUTS] branches=- | result=type
[DATAFLOW] type@param->L2
[CLASS-MEMBERS] ... | /* static context
[FOCAL] public ElementAdapter<T> Jsouper.adapter(Type type)
[INPUTS] branches=- | result=type
[CALLS-INTERNAL] ElementAdapter<T> adapter(Type type, Set<? extends Annotation> annotations)
*/
| /* static context
[FOCAL] public ElementAdapter<T> Jsouper.adapter(Type type)
[INPUTS] branches=- | result=type
[CALLS-INTERNAL] ElementAdapter<T> adapter(Type type, Set<? extends Annotation> annotations)
*/
class Jsouper {
public <T> ElementAdapter<T> adapter(Type type) {
return adapter(type, Util.NO_ANNOTATION... | true | ok | {"focal": {"class": "Jsouper", "name": "adapter", "signature": "ElementAdapter<T> adapter(Type type)", "start_line": 3, "modifiers": "public", "params": [{"name": "type", "type": "Type"}], "return_type": "ElementAdapter<T>"}, "class_info": {"name": "Jsouper", "kind": "class", "modifiers": "", "superclass": null, "inter... |
57803948_11 | class ReflectUtils {
public static String createJson(Object obj) {
final Map<String, ClassGetSetDTO> map = getFieldsTypeMap(obj.getClass());
String preKey = map.keySet().isEmpty() ? null : map.keySet().iterator().next();
if(map.size() == 1 && preKey != null && preKey.equals(StringConstants.EMPTY)){
ClassGetS... |
Throwable exception = assertThrows(RoboReflectException.class, () -> {
Map<String, PathAttributeDTO> map = new HashMap<>();
map.put("one", new PathAttributeDTO("one1", "1"));
map.put("two", new PathAttributeDTO("two2", "2"));
ReflectUtils.createJson(map);
});
assertTrue(exception.getMessage().starts... | [FOCAL] public static String ReflectUtils.createJson(Object obj)
[CLASS] class ReflectUtils
[METRICS] loc=31 cc=5 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] Map<String, ClassGetSetDTO> getFieldsTypeMap(Class<?> clazz); String createJson(Map<String, ClassGetSetDTO> descriptorMap, Object obj)
[CALLS... | /* static context
[FOCAL] public static String ReflectUtils.createJson(Object obj)
[PATH1] if(map.size() == 1 && preKey != null && preKey.equals(StringConstants.EMPTY))=T -> switch(descriptor.getCollection())=case MAP -> return new StringBuilder() .append(map.entrySet().stream() .map(entry -> n...
[PATH2] if(map.size()... | /* static context
[FOCAL] public static String ReflectUtils.createJson(Object obj)
[PATH1] if(map.size() == 1 && preKey != null && preKey.equals(StringConstants.EMPTY))=T -> switch(descriptor.getCollection())=case MAP -> return new StringBuilder() .append(map.entrySet().stream() .map(entry -> n...
[PATH2] if(map.size()... | true | ok | {"focal": {"class": "ReflectUtils", "name": "createJson", "signature": "String createJson(Object obj)", "start_line": 3, "modifiers": "public static", "params": [{"name": "obj", "type": "Object"}], "return_type": "String"}, "class_info": {"name": "ReflectUtils", "kind": "class", "modifiers": "", "superclass": null, "in... |
57921720_5 | class SetVariablesConfirmation implements Confirmation {
@Override
public boolean validate() {
return setVariableResult != null
&& setVariableResult.length > 0
&& Arrays.stream(setVariableResult)
.allMatch(setVariableResult -> setVariableResult.validate());
}
public SetVariable... | boolean expected = false;
SetVariablesConfirmation sut = new SetVariablesConfirmation();
boolean result = sut.validate();
Assert.assertEquals(expected, result);
}
} | [FOCAL] @Override public boolean SetVariablesConfirmation.validate()
[CLASS] class SetVariablesConfirmation implements Confirmation
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Arrays.stream(setVariableResult).allMatch/1, Arrays.stream/1, setVariableResult.validate/0
[COLLABORAT... | /* static context
[FOCAL] @Override public boolean SetVariablesConfirmation.validate()
[COLLABORATORS] field setVariableResult validate/0
[CALLS-EXTERNAL] Arrays.stream(setVariableResult).allMatch/1, Arrays.stream/1, setVariableResult.validate/0
*/
| /* static context
[FOCAL] @Override public boolean SetVariablesConfirmation.validate()
[COLLABORATORS] field setVariableResult validate/0
[CALLS-EXTERNAL] Arrays.stream(setVariableResult).allMatch/1, Arrays.stream/1, setVariableResult.validate/0
*/
class SetVariablesConfirmation implements Confirmation {
@Override
... | true | ok | {"focal": {"class": "SetVariablesConfirmation", "name": "validate", "signature": "boolean validate()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "SetVariablesConfirmation", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Confir... |
57926203_280 | class SfcIosXeUtils {
static InstanceIdentifier<Local> createLocalSffIid() {
return InstanceIdentifier.builder(Native.class)
.child(ServiceChain.class)
.child(org.opendaylight.yang.gen.v1.urn.ios.rev160308._native.service.chain.ServiceFunctionForwarder.class)
... | InstanceIdentifier<Local> result = SfcIosXeUtils.createLocalSffIid();
// Test IID
InstanceIdentifier<Local> testIid = InstanceIdentifier.builder(Native.class).child(ServiceChain.class)
.child(org.opendaylight.yang.gen.v1.urn.ios.rev160308._native.service.chain.ServiceFunctionForw... | [FOCAL] static InstanceIdentifier<Local> SfcIosXeUtils.createLocalSffIid()
[CLASS] class SfcIosXeUtils
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] InstanceIdentifier.builder(Native.class) .child(ServiceCh....build/0, InstanceIdentifier.builder(Native.class) .child(ServiceCh....... | /* static context
[FOCAL] static InstanceIdentifier<Local> SfcIosXeUtils.createLocalSffIid()
[CALLS-EXTERNAL] InstanceIdentifier.builder(Native.class) .child(ServiceCh....build/0, InstanceIdentifier.builder(Native.class) .child(ServiceCh....child/1, InstanceIdentifier.builder(Native.class).child/1, InstanceIdentifier.b... | /* static context
[FOCAL] static InstanceIdentifier<Local> SfcIosXeUtils.createLocalSffIid()
[CALLS-EXTERNAL] InstanceIdentifier.builder(Native.class) .child(ServiceCh....build/0, InstanceIdentifier.builder(Native.class) .child(ServiceCh....child/1, InstanceIdentifier.builder(Native.class).child/1, InstanceIdentifier.b... | true | ok | {"focal": {"class": "SfcIosXeUtils", "name": "createLocalSffIid", "signature": "InstanceIdentifier<Local> createLocalSffIid()", "start_line": 3, "modifiers": "static", "params": [], "return_type": "InstanceIdentifier<Local>"}, "class_info": {"name": "SfcIosXeUtils", "kind": "class", "modifiers": "", "superclass": null,... |
57942251_1 | class IonParser extends ParserMinimalBase {
@Override
public NumberType getNumberType() throws IOException
{
IonType type = _reader.getType();
if (type != null) {
// Hmmh. Looks like Ion gives little bit looser definition here;
// harder to pin down exact type. But l... | final ObjectReadContext ctxt = ObjectReadContext.empty();
final byte[] data = "{ score:0.291e0 }".getBytes();
IonSystem ion = IonSystemBuilder.standard().build();
final IonValue ionFloat = ion.newFloat(Float.MAX_VALUE);
IonReader reader = ionFloat.getSystem().newReader(data, 0,... | [FOCAL] @Override public NumberType IonParser.getNumberType()
[CLASS] class IonParser extends ParserMinimalBase
[METRICS] loc=28 cc=7 branches=3 loops=0 returns=6 throws=0 nesting=3
[CALLS-EXTERNAL] _reader.getType/0, _reader.getIntegerSize/0
[EXCEPTIONS] declares IOException
[PATH1] if(type != null)=T -> switch(type)=... | /* static context
[FOCAL] @Override public NumberType IonParser.getNumberType()
[PATH1] if(type != null)=T -> switch(type)=case INT -> switch(size)=case INT -> return NumberType.INT
[PATH2] if(type != null)=F -> return null
[PATH3] if(type != null)=T -> switch(type)=case DECIMAL -> return NumberType.BIG_DECIMAL
[PATH4]... | /* static context
[FOCAL] @Override public NumberType IonParser.getNumberType()
[PATH1] if(type != null)=T -> switch(type)=case INT -> switch(size)=case INT -> return NumberType.INT
[PATH2] if(type != null)=F -> return null
[PATH3] if(type != null)=T -> switch(type)=case DECIMAL -> return NumberType.BIG_DECIMAL
[PATH4]... | true | ok | {"focal": {"class": "IonParser", "name": "getNumberType", "signature": "NumberType getNumberType() throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "NumberType"}, "class_info": {"name": "IonParser", "kind": "class", "modifiers": "", "superclass": "ParserMinimalBase", "... |
57951012_835 | class PdfVisibilityExpression extends PdfObjectWrapper<PdfArray> {
public void addOperand(PdfLayer layer) {
getPdfObject().add(layer.getPdfObject());
getPdfObject().setModified();
}
public PdfVisibilityExpression(PdfArray visibilityExpressionArray);
public PdfVisibilityExpression(Pdf... | PdfDocument tempDoc = new PdfDocument(new PdfWriter(new ByteArrayOutputStream()));
// create expression with the AND operator as the first parameter
PdfVisibilityExpression expression = new PdfVisibilityExpression(PdfName.And);
// add two empty dictionaries as the other parameters
... | [FOCAL] public void PdfVisibilityExpression.addOperand(PdfLayer layer)
[CLASS] class PdfVisibilityExpression extends PdfObjectWrapper<PdfArray>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] getPdfObject().add/1, getPdfObject/0 (inherited), PdfLayer.getPdfObject/0, getPdfObject().... | /* static context
[FOCAL] public void PdfVisibilityExpression.addOperand(PdfLayer layer)
[COLLABORATORS] param layer:PdfLayer getPdfObject/0
[CALLS-EXTERNAL] getPdfObject().add/1, getPdfObject/0 (inherited), PdfLayer.getPdfObject/0, getPdfObject().setModified/0
*/
| /* static context
[FOCAL] public void PdfVisibilityExpression.addOperand(PdfLayer layer)
[COLLABORATORS] param layer:PdfLayer getPdfObject/0
[CALLS-EXTERNAL] getPdfObject().add/1, getPdfObject/0 (inherited), PdfLayer.getPdfObject/0, getPdfObject().setModified/0
*/
class PdfVisibilityExpression extends PdfObjectWrapper<... | true | ok | {"focal": {"class": "PdfVisibilityExpression", "name": "addOperand", "signature": "void addOperand(PdfLayer layer)", "start_line": 3, "modifiers": "public", "params": [{"name": "layer", "type": "PdfLayer"}], "return_type": "void"}, "class_info": {"name": "PdfVisibilityExpression", "kind": "class", "modifiers": "", "sup... |
57960070_2 | class Evaluator {
public EvalEntry eval(String stmt) throws Exception {
try {
return (EvalEntry) latteEngine.eval(stmt, latteEngine.getBindings(ScriptContext.ENGINE_SCOPE),
new Config()
.setScannerTy... | assertEquals(1, evaluator.eval("1").result);
assertEquals(2, evaluator.eval("1+1").result);
}
} | [FOCAL] public EvalEntry Evaluator.eval(String stmt)
[CLASS] class Evaluator
[METRICS] loc=9 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] latteEngine.eval/3, latteEngine.getBindings/1, new Config() .setScannerType(scannerType).setVarNamePrefi....setEval/1, new Config() .setScannerType(scannerTy... | /* static context
[FOCAL] public EvalEntry Evaluator.eval(String stmt)
[THROWS-WHEN] (Exception) e.getCause() when try-body throws
[PATH1] try-body throws -> throw (Exception) e.getCause()
[PATH2] return (EvalEntry) latteEngine.eval(stmt, latteEngine.getBindings(ScriptCo...
[INPUTS] branches=- | result=stmt
[COLLABORAT... | /* static context
[FOCAL] public EvalEntry Evaluator.eval(String stmt)
[THROWS-WHEN] (Exception) e.getCause() when try-body throws
[PATH1] try-body throws -> throw (Exception) e.getCause()
[PATH2] return (EvalEntry) latteEngine.eval(stmt, latteEngine.getBindings(ScriptCo...
[INPUTS] branches=- | result=stmt
[COLLABORAT... | true | ok | {"focal": {"class": "Evaluator", "name": "eval", "signature": "EvalEntry eval(String stmt) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "stmt", "type": "String"}], "return_type": "EvalEntry"}, "class_info": {"name": "Evaluator", "kind": "class", "modifiers": "", "superclass": null, "in... |
57984189_4 | class StacktraceHash implements IStacktraceHash {
@Override
public String hash(final IStacktrace st) throws StacktraceHashException {
return hashString(st.getStacktraceText());
}
public StacktraceHash(final String algorithm);
public StacktraceHash();
public String getAlgorithm();
... | StacktraceHash h = new StacktraceHash();
Throwable t1 = null;
Throwable t2 = null;
try {
new TestClass().foo(1);
} catch (RuntimeException e) {
t1 = e;
}
try {
new TestClass().foo(1);
} catch (RuntimeException e) {
... | [FOCAL] @Override public String StacktraceHash.hash(IStacktrace st)
[CLASS] class StacktraceHash implements IStacktraceHash
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String hashString(String string)
[CALLS-EXTERNAL] IStacktrace.getStacktraceText/0
[EXCEPTIONS] declares Stackt... | /* static context
[FOCAL] @Override public String StacktraceHash.hash(IStacktrace st)
[INPUTS] branches=- | result=st
[COLLABORATORS] param st:IStacktrace getStacktraceText/0
[EXCEPTIONS] declares StacktraceHashException
[CALLS-INTERNAL] String hashString(String string)
[CALLS-EXTERNAL] IStacktrace.getStacktraceText/0
... | /* static context
[FOCAL] @Override public String StacktraceHash.hash(IStacktrace st)
[INPUTS] branches=- | result=st
[COLLABORATORS] param st:IStacktrace getStacktraceText/0
[EXCEPTIONS] declares StacktraceHashException
[CALLS-INTERNAL] String hashString(String string)
[CALLS-EXTERNAL] IStacktrace.getStacktraceText/0
... | true | ok | {"focal": {"class": "StacktraceHash", "name": "hash", "signature": "String hash(IStacktrace st) throws StacktraceHashException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "st", "type": "IStacktrace"}], "return_type": "String"}, "class_info": {"name": "StacktraceHash", "kind": "class", "modif... |
57997098_1 | class ActivityDelegate extends AbstractDelegate<ICompositeActivity, ActivityPlugin> {
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (mPlugins.isEmpty()) {
return getOriginal().super_onKeyDown(keyCode, event);
}
final ListIterator<ActivityPlugin> iterator = mPlugins... |
final ActivityPlugin a = spy(new ActivityPlugin());
final ActivityPlugin b = spy(new ActivityPlugin() {
@Override
public boolean onKeyDown(final int keyCode, final KeyEvent event) {
return true;
}
});
final ActivityPlugin c = spy(new A... | [FOCAL] public boolean ActivityDelegate.onKeyDown(int keyCode, KeyEvent event)
[CLASS] class ActivityDelegate extends AbstractDelegate<ICompositeActivity, ActivityPlugin>
[METRICS] loc=21 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] mPlugins.isEmpty/0, getOriginal().super_onKeyDown/2, getOrigin... | class ActivityDelegate extends AbstractDelegate<ICompositeActivity, ActivityPlugin> {
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (mPlugins.isEmpty()) {
return getOriginal().super_onKeyDown(keyCode, event);
}
final ListIterator<ActivityPlugin> iterator = mPlugins... | false | ok | {"focal": {"class": "ActivityDelegate", "name": "onKeyDown", "signature": "boolean onKeyDown(int keyCode, KeyEvent event)", "start_line": 3, "modifiers": "public", "params": [{"name": "keyCode", "type": "int"}, {"name": "event", "type": "KeyEvent"}], "return_type": "boolean"}, "class_info": {"name": "ActivityDelegate",... | |
58086354_147 | class TransportSet implements WithLogId {
final ClientTransport obtainActiveTransport() {
ClientTransport savedTransport = activeTransport;
if (savedTransport != null) {
return savedTransport;
}
synchronized (lock) {
// Check again, since it could have changed before acquiring the lock
... | SocketAddress addr1 = mock(SocketAddress.class);
SocketAddress addr2 = mock(SocketAddress.class);
createTransportSet(addr1, addr2);
// Invocation counters
int transportsAddr1 = 0;
int transportsAddr2 = 0;
int backoff1Consulted = 0;
int backoff2Consulted = 0;
int backoff3Consulted = ... | [FOCAL] final ClientTransport TransportSet.obtainActiveTransport()
[CLASS] class TransportSet implements WithLogId
[METRICS] loc=20 cc=4 branches=3 loops=0 returns=3 throws=0 nesting=3
[CALLS-INTERNAL] void scheduleConnection(DelayedClientTransport delayedTransport)
[CALLS-EXTERNAL] BlockingQueue<MockClientTransportInf... | class TransportSet implements WithLogId {
final ClientTransport obtainActiveTransport() {
ClientTransport savedTransport = activeTransport;
if (savedTransport != null) {
return savedTransport;
}
synchronized (lock) {
// Check again, since it could have changed before acquiring the lock
... | false | ok | {"focal": {"class": "TransportSet", "name": "obtainActiveTransport", "signature": "ClientTransport obtainActiveTransport()", "start_line": 3, "modifiers": "final", "params": [], "return_type": "ClientTransport"}, "class_info": {"name": "TransportSet", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ... | |
58089419_6 | class AdsOptimizationImpl implements AdsOptimization {
@Override
public AdsOptimization selectTopK(int k) {
if (k <= 0) {
throw new IllegalArgumentException("The parameter should be a positive integer.");
}
if (_candidateAds.size() == 0) {
return this;
}
... | System.out.println("selectTopKShouldReturnAValidOutput");
// to do, for candidateAds size > k + 1 and <= k+1
assertEquals(expected, ads.selectTopK(k));
}
} | [FOCAL] @Override public AdsOptimization AdsOptimizationImpl.selectTopK(int k)
[CLASS] class AdsOptimizationImpl implements AdsOptimization
[METRICS] loc=20 cc=4 branches=3 loops=0 returns=2 throws=1 nesting=1
[CALLS-EXTERNAL] _candidateAds.size/0, Collections.sort/2, ads2.getRankScore/0, ads1.getRankScore/0, _candidat... | /* static context
[FOCAL] @Override public AdsOptimization AdsOptimizationImpl.selectTopK(int k)
[THROWS-WHEN] IllegalArgumentException when k <= 0
[PATH1] if(k <= 0)=F -> if(_candidateAds.size() == 0)=F -> if(_candidateAds.size() > k + 1)=T -> return this
[PATH2] if(k <= 0)=T -> throw new IllegalArgumentException("The... | /* static context
[FOCAL] @Override public AdsOptimization AdsOptimizationImpl.selectTopK(int k)
[THROWS-WHEN] IllegalArgumentException when k <= 0
[PATH1] if(k <= 0)=F -> if(_candidateAds.size() == 0)=F -> if(_candidateAds.size() > k + 1)=T -> return this
[PATH2] if(k <= 0)=T -> throw new IllegalArgumentException("The... | true | ok | {"focal": {"class": "AdsOptimizationImpl", "name": "selectTopK", "signature": "AdsOptimization selectTopK(int k)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "k", "type": "int"}], "return_type": "AdsOptimization"}, "class_info": {"name": "AdsOptimizationImpl", "kind": "class", "modifiers": ""... |
58135054_0 | class ScriptExecutionTask implements Runnable {
public int getTaskId() {
return taskId;
}
public ScriptExecutionTask(GameScriptingEngine gameScriptingEngine, ScriptExecutor<S> executor,
int scriptId, GameScript<S> script, ScriptBindings scriptBindings, ScriptInvocationListener scriptInvocationListener);
@O... | ScriptExecutionTask<DummyScript> task1 = new ScriptExecutionTask<DummyScript>(new DummyGameScriptingEngine(),
new DummyScriptExecutor(null), 0, new GlobalGameScript<DummyScript>(new DummyScript("")),
new ScriptBindings(), null);
ScriptExecutionTask<DummyScript> task2 = new ScriptExecutionTask<DummyScript>(n... | [FOCAL] public int ScriptExecutionTask.getTaskId()
[CLASS] class ScriptExecutionTask implements Runnable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] ScriptExecutionTask(GameScriptingEngine gameScriptingEngine, ScriptExecutor<S> executor, int scriptId, GameScript<S> script, Scrip... | /* static context
[FOCAL] public int ScriptExecutionTask.getTaskId()
*/
| /* static context
[FOCAL] public int ScriptExecutionTask.getTaskId()
*/
class ScriptExecutionTask implements Runnable {
public int getTaskId() {
return taskId;
}
public ScriptExecutionTask(GameScriptingEngine gameScriptingEngine, ScriptExecutor<S> executor,
int scriptId, GameScript<S> script, ScriptBindings ... | true | ok | {"focal": {"class": "ScriptExecutionTask", "name": "getTaskId", "signature": "int getTaskId()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "ScriptExecutionTask", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Runnable", "fields": [], "member... |
58142278_0 | class GRPCClient implements HLAPI {
@Override
public int getChainHeight() throws HLAPIException {
BlockCount height = obs.getBlockCount(com.google.protobuf.Empty.getDefaultInstance());
return (int) height.getCount();
}
public GRPCClient(String host, int port, int observerPort);
p... | int height = client.getChainHeight();
log.debug("testGetBlockHeight height=" + height);
assertTrue(height > 0);
}
} | [FOCAL] @Override public int GRPCClient.getChainHeight()
[CLASS] class GRPCClient implements HLAPI
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] obs.getBlockCount/1, com.google.protobuf.Empty.getDefaultInstance/0, BlockCount.getCount/0
[EXCEPTIONS] declares HLAPIException
[COLLAB... | /* static context
[FOCAL] @Override public int GRPCClient.getChainHeight()
[COLLABORATORS] field obs getBlockCount/1
[EXCEPTIONS] declares HLAPIException
[CALLS-EXTERNAL] obs.getBlockCount/1, com.google.protobuf.Empty.getDefaultInstance/0, BlockCount.getCount/0
*/
| /* static context
[FOCAL] @Override public int GRPCClient.getChainHeight()
[COLLABORATORS] field obs getBlockCount/1
[EXCEPTIONS] declares HLAPIException
[CALLS-EXTERNAL] obs.getBlockCount/1, com.google.protobuf.Empty.getDefaultInstance/0, BlockCount.getCount/0
*/
class GRPCClient implements HLAPI {
@Override
... | true | ok | {"focal": {"class": "GRPCClient", "name": "getChainHeight", "signature": "int getChainHeight() throws HLAPIException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "GRPCClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "HLAPI", ... |
58148640_17 | class Journal {
@SuppressLint("EmptyCatchBlock")
/* package */ LinkedHashMap<String, Entry> retrieveEntriesFromJournal() {
maybeSwitchToBackupJournalFile(mDirectory);
File journalFile = new File(mDirectory, JOURNAL_FILE);
if (journalFile.exists()) {
LinkedHashMap<String, Entry> lruEntries = new L... | mJournalFile.delete();
FileWriter writer = new FileWriter(mJournalBkpFile);
writer.write("DIRTY k1\nCLEAN k1 12\n");
writer.close();
LinkedHashMap<String, Entry> entries = mJournal.retrieveEntriesFromJournal();
assertThat(entries.size()).isEqualTo(1);
assertThat(entries.get("k1")).isNotEqual... | [FOCAL] @SuppressLint("EmptyCatchBlock") LinkedHashMap<String, Entry> Journal.retrieveEntriesFromJournal()
[CLASS] class Journal
[METRICS] loc=53 cc=10 branches=6 loops=2 returns=2 throws=0 nesting=5
[CALLS-INTERNAL] void closeQuietly(Closeable closeable); void createJournalWriter(); void deleteFileIfExists(File file);... | /* static context
[FOCAL] @SuppressLint("EmptyCatchBlock") LinkedHashMap<String, Entry> Journal.retrieveEntriesFromJournal()
[PATH1] if(journalFile.exists())=T -> while((line = reader.readLine()) != null)=T -> if(CLEAN_ENTRY_PREFIX.equals(state) && lineParts.length == 3)=F -> if(DIRTY_ENTRY_PREFIX.equals(state) && line... | /* static context
[FOCAL] @SuppressLint("EmptyCatchBlock") LinkedHashMap<String, Entry> Journal.retrieveEntriesFromJournal()
[PATH1] if(journalFile.exists())=T -> while((line = reader.readLine()) != null)=T -> if(CLEAN_ENTRY_PREFIX.equals(state) && lineParts.length == 3)=F -> if(DIRTY_ENTRY_PREFIX.equals(state) && line... | true | ok | {"focal": {"class": "Journal", "name": "retrieveEntriesFromJournal", "signature": "LinkedHashMap<String, Entry> retrieveEntriesFromJournal()", "start_line": 3, "modifiers": "@SuppressLint(\"EmptyCatchBlock\")", "params": [], "return_type": "LinkedHashMap<String, Entry>"}, "class_info": {"name": "Journal", "kind": "clas... |
58163050_0 | class Calculator {
public double add(double a, double b){
return a+b;
}
private Calculator calculator;
private double result;
}
class CalculatorTest {
private Calculator calculator;
private double result;
@Test
public void testAdd() throws Throwable {
|
Assert.assertEquals(5.0,calculator.add(3.0, 2.0),0.01);
}
} | [FOCAL] public double Calculator.add(double a, double b)
[CLASS] class Calculator
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=a, b
[DATAFLOW] a@param->L2; b@param->L2
[TEST] CalculatorTest: @Test public void testAdd() throws Throwable
[TEST-FIELDS] Calculator calcul... | /* static context
[FOCAL] public double Calculator.add(double a, double b)
[INPUTS] branches=- | result=a, b
*/
| /* static context
[FOCAL] public double Calculator.add(double a, double b)
[INPUTS] branches=- | result=a, b
*/
class Calculator {
public double add(double a, double b){
return a+b;
}
private Calculator calculator;
private double result;
}
class CalculatorTest {
private Calculator calcu... | true | ok | {"focal": {"class": "Calculator", "name": "add", "signature": "double add(double a, double b)", "start_line": 3, "modifiers": "public", "params": [{"name": "a", "type": "double"}, {"name": "b", "type": "double"}], "return_type": "double"}, "class_info": {"name": "Calculator", "kind": "class", "modifiers": "", "supercla... |
58194180_516 | class SimpleAclRuleResource {
public static SimpleAclRuleResource fromKafkaResourcePattern(ResourcePattern kafkaResourcePattern) {
String resourceName;
SimpleAclRuleResourceType resourceType;
AclResourcePatternType resourcePattern = null;
switch (kafkaResourcePattern.resourceType()... | // Regular group
ResourcePattern kafkaGroupResourcePattern = new ResourcePattern(ResourceType.GROUP, "my-group", PatternType.LITERAL);
SimpleAclRuleResource expectedGroupResourceRules = new SimpleAclRuleResource("my-group", SimpleAclRuleResourceType.GROUP, AclResourcePatternType.LITERAL);
... | [FOCAL] public static SimpleAclRuleResource SimpleAclRuleResource.fromKafkaResourcePattern(ResourcePattern kafkaResourcePattern)
[CLASS] class SimpleAclRuleResource
[METRICS] loc=64 cc=11 branches=4 loops=0 returns=1 throws=4 nesting=2
[CALLS-EXTERNAL] ResourcePattern.resourceType/0, ResourcePattern.name/0, ResourcePat... | /* static context
[FOCAL] public static SimpleAclRuleResource SimpleAclRuleResource.fromKafkaResourcePattern(ResourcePattern kafkaResourcePattern)
[THROWS-WHEN] IllegalArgumentException when switch(kafkaResourcePattern.resourceType())=case TOPIC && switch(kafkaResourcePattern.patternType())#1=default
[THROWS-WHEN] Ille... | /* static context
[FOCAL] public static SimpleAclRuleResource SimpleAclRuleResource.fromKafkaResourcePattern(ResourcePattern kafkaResourcePattern)
[THROWS-WHEN] IllegalArgumentException when switch(kafkaResourcePattern.resourceType())=case TOPIC && switch(kafkaResourcePattern.patternType())#1=default
[THROWS-WHEN] Ille... | true | ok | {"focal": {"class": "SimpleAclRuleResource", "name": "fromKafkaResourcePattern", "signature": "SimpleAclRuleResource fromKafkaResourcePattern(ResourcePattern kafkaResourcePattern)", "start_line": 3, "modifiers": "public static", "params": [{"name": "kafkaResourcePattern", "type": "ResourcePattern"}], "return_type": "Si... |
58203049_62 | class XMLStartElement {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("<" + getName() + "");
for (int i = 0; i < getNamespaceCount(); ++i) {
sb.append(" xmlns");
String prefix = getNamespacePrefix(i);
if (prefix != null && !prefix.isEmpty(... | XMLStartElement e = new XMLStartElement(null, "test", new String[] { "", "" },
new String[] { "key1", "key2" }, new String[] { "v1", "v2" });
assertEquals("<test key1=\"v1\" key2=\"v2\">", e.toString());
}
} | [FOCAL] @Override public String XMLStartElement.toString()
[CLASS] class XMLStartElement
[METRICS] loc=34 cc=5 branches=2 loops=2 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] String getAttributeLocalName(int i); String getAttributePrefix(int i); String getAttributeValue(int i); String getName(); String getNamespacePre... | /* static context
[FOCAL] @Override public String XMLStartElement.toString()
[PATH1] for(i < getNamespaceCount())=T -> if(prefix != null && !prefix.isEmpty())#1=T -> exit loop -> for(i < getAttributeCount())=T -> if(prefix != null && !prefix.isEmpty())#2=T -> exit loop -> return sb.toString()
[PATH2] for(i < getNamespa... | /* static context
[FOCAL] @Override public String XMLStartElement.toString()
[PATH1] for(i < getNamespaceCount())=T -> if(prefix != null && !prefix.isEmpty())#1=T -> exit loop -> for(i < getAttributeCount())=T -> if(prefix != null && !prefix.isEmpty())#2=T -> exit loop -> return sb.toString()
[PATH2] for(i < getNamespa... | true | ok | {"focal": {"class": "XMLStartElement", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "XMLStartElement", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "member... |
58207096_1 | class MarvelApi {
public MarvelResult<SectionVO> listComics(long characterId, int offset) throws IOException, MarvelException {
Response<SectionDataWrapper> response = mService.listComics(characterId, offset, MAX_FETCH_LIMIT).execute();
if (response.isSuccessful()) {
return DataParser.p... |
// Fetch the comic result and check for not null
MarvelResult<SectionVO> result = mMarvelApi.listComics(CHARACTER_ID, OFFSET);
assertNotNull(result);
// Get the comic list and check for not null
List<SectionVO> entries = result.getEntries();
assertNotNull(entries);
... | [FOCAL] public MarvelResult<SectionVO> MarvelApi.listComics(long characterId, int offset)
[CLASS] class MarvelApi
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] mService.listComics(characterId, offset, MAX_FETCH_LIMIT).execute/0, mService.listComics/3, Response<SectionDataWrapper>... | /* static context
[FOCAL] public MarvelResult<SectionVO> MarvelApi.listComics(long characterId, int offset)
[THROWS-WHEN] MarvelException when !response.isSuccessful()
[PATH1] if(response.isSuccessful())=T -> return DataParser.parse(response.body())
[PATH2] if(response.isSuccessful())=F -> throw new MarvelException(res... | /* static context
[FOCAL] public MarvelResult<SectionVO> MarvelApi.listComics(long characterId, int offset)
[THROWS-WHEN] MarvelException when !response.isSuccessful()
[PATH1] if(response.isSuccessful())=T -> return DataParser.parse(response.body())
[PATH2] if(response.isSuccessful())=F -> throw new MarvelException(res... | true | ok | {"focal": {"class": "MarvelApi", "name": "listComics", "signature": "MarvelResult<SectionVO> listComics(long characterId, int offset) throws IOException, MarvelException", "start_line": 3, "modifiers": "public", "params": [{"name": "characterId", "type": "long"}, {"name": "offset", "type": "int"}], "return_type": "Marv... |
58208693_33 | class ExpandedNodeId {
public String toParseableString() {
StringBuilder sb = new StringBuilder();
if (serverIndex.intValue() != 0) {
sb.append("svr=").append(serverIndex).append(";");
}
if (namespaceUri != null) {
sb.append("nsu=").append(namespaceUri).app... | ExpandedNodeId xni = new ExpandedNodeId(ushort(0), null, "test");
assertEquals("ns=0;s=test", xni.toParseableString());
}
} | [FOCAL] public String ExpandedNodeId.toParseableString()
[CLASS] class ExpandedNodeId
[METRICS] loc=36 cc=8 branches=4 loops=0 returns=1 throws=1 nesting=2
[CALLS-INTERNAL] IdType getType(); Object getIdentifier(); UShort getNamespaceIndex()
[CALLS-EXTERNAL] serverIndex.intValue/0, sb.append("svr=").append(serverIndex)... | /* static context
[FOCAL] public String ExpandedNodeId.toParseableString()
[THROWS-WHEN] IllegalStateException when serverIndex.intValue() != 0 && namespaceUri != null && switch(getType())=default
[THROWS-WHEN] IllegalStateException when serverIndex.intValue() != 0 && !(namespaceUri != null) && switch(getType())=defaul... | /* static context
[FOCAL] public String ExpandedNodeId.toParseableString()
[THROWS-WHEN] IllegalStateException when serverIndex.intValue() != 0 && namespaceUri != null && switch(getType())=default
[THROWS-WHEN] IllegalStateException when serverIndex.intValue() != 0 && !(namespaceUri != null) && switch(getType())=defaul... | true | ok | {"focal": {"class": "ExpandedNodeId", "name": "toParseableString", "signature": "String toParseableString()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "ExpandedNodeId", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"na... |
58223375_0 | class TrackLover {
public synchronized void loveTrack(Track track) {
if (scroballDB.isLoved(track)) {
return;
}
LovedTracksEntry entry = scroballDB.writeLove(track, 0);
pending.add(entry);
lovePending();
eventBus.post(TrackLovedEvent.create());
}
public TrackLover(
LastfmCl... | when(scroballDB.isLoved(any())).thenReturn(true);
trackLover.loveTrack(track1);
verify(scroballDB, never()).writeLove(any(), anyInt());
verifyZeroInteractions(lastfmClient);
}
} | [FOCAL] public synchronized void TrackLover.loveTrack(Track track)
[CLASS] class TrackLover
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] void lovePending()
[CALLS-EXTERNAL] ScroballDB.isLoved/1, ScroballDB.writeLove/2, pending.add/1, eventBus.post/1, TrackLovedEvent.create/0
[F... | /* static context
[FOCAL] public synchronized void TrackLover.loveTrack(Track track)
[PATH1] if(scroballDB.isLoved(track))=T -> return
[PATH2] if(scroballDB.isLoved(track))=F
[INPUTS] branches=track, scroballDB | result=-
[COLLABORATORS] field scroballDB:ScroballDB isLoved/1,writeLove/2; field pending add/1; field even... | /* static context
[FOCAL] public synchronized void TrackLover.loveTrack(Track track)
[PATH1] if(scroballDB.isLoved(track))=T -> return
[PATH2] if(scroballDB.isLoved(track))=F
[INPUTS] branches=track, scroballDB | result=-
[COLLABORATORS] field scroballDB:ScroballDB isLoved/1,writeLove/2; field pending add/1; field even... | true | ok | {"focal": {"class": "TrackLover", "name": "loveTrack", "signature": "void loveTrack(Track track)", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "track", "type": "Track"}], "return_type": "void"}, "class_info": {"name": "TrackLover", "kind": "class", "modifiers": "", "superclass": null, "inte... |
58224198_2 | class RealPosClient implements PosClient {
@Override public void launchPointOfSale() {
List<ResolveInfo> activities = queryChargeActivities();
PackageInfo pointOfSalePackage = findPointOfSaleWithHighestVersion(activities);
Intent pointOfSaleIntent = packageManager.getLaunchIntentForPackage(pointOfSalePac... | client.launchPointOfSale();
Intent expectedIntent = context.getPackageManager().getLaunchIntentForPackage("com.squareup");
verify(context).startActivity(expectedIntent);
}
} | [FOCAL] @Override public void RealPosClient.launchPointOfSale()
[CLASS] class RealPosClient implements PosClient
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] List<ResolveInfo> queryChargeActivities(); PackageInfo findPointOfSaleWithHighestVersion(List<ResolveInfo> activities)
[C... | /* static context
[FOCAL] @Override public void RealPosClient.launchPointOfSale()
[COLLABORATORS] field packageManager getLaunchIntentForPackage/1; field context:Context startActivity/1
[CALLS-INTERNAL] List<ResolveInfo> queryChargeActivities(); PackageInfo findPointOfSaleWithHighestVersion(List<ResolveInfo> activities... | /* static context
[FOCAL] @Override public void RealPosClient.launchPointOfSale()
[COLLABORATORS] field packageManager getLaunchIntentForPackage/1; field context:Context startActivity/1
[CALLS-INTERNAL] List<ResolveInfo> queryChargeActivities(); PackageInfo findPointOfSaleWithHighestVersion(List<ResolveInfo> activities... | true | ok | {"focal": {"class": "RealPosClient", "name": "launchPointOfSale", "signature": "void launchPointOfSale()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "RealPosClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "PosClient", "fie... |
58236838_0 | class EddystoneURL extends EddystoneBase {
public static String decode(byte[] data) {
return null == data ? null : decode(data, 0, data.length);
}
public EddystoneURL(String url, byte[] lockKey, @Advertiser.Mode int mode,
@Advertiser.Power int txPowerLevel, String name);
... | for (Map.Entry<String, byte[]> entry : valid.entrySet()) {
assertEquals(entry.getKey(), EddystoneURL.decode(entry.getValue()));
}
for (Map.Entry<String, byte[]> entry : unexpanded.entrySet()) {
assertEquals(entry.getKey(), EddystoneURL.decode(entry.getValue()));
... | [FOCAL] public static String EddystoneURL.decode(byte[] data)
[CLASS] class EddystoneURL extends EddystoneBase
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String decode(byte[] data, int offset, int length)
[INPUTS] branches=- | result=data
[DATAFLOW] data@param->L2
[CLASS-MEMBE... | /* static context
[FOCAL] public static String EddystoneURL.decode(byte[] data)
[INPUTS] branches=- | result=data
[CALLS-INTERNAL] String decode(byte[] data, int offset, int length)
*/
| /* static context
[FOCAL] public static String EddystoneURL.decode(byte[] data)
[INPUTS] branches=- | result=data
[CALLS-INTERNAL] String decode(byte[] data, int offset, int length)
*/
class EddystoneURL extends EddystoneBase {
public static String decode(byte[] data) {
return null == data ? null : decode(... | true | ok | {"focal": {"class": "EddystoneURL", "name": "decode", "signature": "String decode(byte[] data)", "start_line": 3, "modifiers": "public static", "params": [{"name": "data", "type": "byte[]"}], "return_type": "String"}, "class_info": {"name": "EddystoneURL", "kind": "class", "modifiers": "", "superclass": "EddystoneBase"... |
58270602_3 | class FinishedTorrentsDetector {
public Collection<Torrent> filterFinishedTorrentsToNotify(Collection<Torrent> torrents, Server server) {
long lastUpdateDate = server.getLastUpdateDate();
if (lastUpdateDate <= 0) return Collections.emptySet();
return filterFinishedAfterDate(torrents, lastU... | Server server = new Server("test", "localhost", 9091);
server.setLastUpdateDate(100L);
Collection<Torrent> torrents = ImmutableSet.of(
new Torrent.Builder().doneDate(-1L).build(),
new Torrent.Builder().doneDate(100L).build(),
new Torrent.Builder().... | [FOCAL] public Collection<Torrent> FinishedTorrentsDetector.filterFinishedTorrentsToNotify(Collection<Torrent> torrents, Server server)
[CLASS] class FinishedTorrentsDetector
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] Collection<Torrent> filterFinishedAfterDate(Collection<Torr... | /* static context
[FOCAL] public Collection<Torrent> FinishedTorrentsDetector.filterFinishedTorrentsToNotify(Collection<Torrent> torrents, Server server)
[PATH1] if(lastUpdateDate <= 0)=T -> return Collections.emptySet()
[PATH2] if(lastUpdateDate <= 0)=F -> return filterFinishedAfterDate(torrents, lastUpdateDate)
[INPU... | /* static context
[FOCAL] public Collection<Torrent> FinishedTorrentsDetector.filterFinishedTorrentsToNotify(Collection<Torrent> torrents, Server server)
[PATH1] if(lastUpdateDate <= 0)=T -> return Collections.emptySet()
[PATH2] if(lastUpdateDate <= 0)=F -> return filterFinishedAfterDate(torrents, lastUpdateDate)
[INPU... | true | ok | {"focal": {"class": "FinishedTorrentsDetector", "name": "filterFinishedTorrentsToNotify", "signature": "Collection<Torrent> filterFinishedTorrentsToNotify(Collection<Torrent> torrents, Server server)", "start_line": 3, "modifiers": "public", "params": [{"name": "torrents", "type": "Collection<Torrent>"}, {"name": "serv... |
58279246_1 | class EtcdFlagFieldUpdater {
public void init() {
init(Preconditions.checkNotNull(Strings.emptyToNull(directoryFlag.get())));
}
public EtcdFlagFieldUpdater(FlagFieldRegistry registry);
EtcdFlagFieldUpdater(FlagFieldRegistry registry, List<String> uris, RetryPolicy retryPolicy,
Ex... | client.put(FLAGZ_PATH + "etcd_test_int", "101").send().get();
client.put(FLAGZ_PATH + "etcd_test_string", "etcdinit_overwritten").send().get();
etcdUpdater.init();
assertThat(flagInt.get(), is(101));
assertThat(flagString.get(), is("etcdinit_overwritten"));
assertThat(flagMap.get(), is(flagMap.d... | [FOCAL] public void EtcdFlagFieldUpdater.init()
[CLASS] class EtcdFlagFieldUpdater
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void init(String flagzDirectory)
[CALLS-EXTERNAL] Preconditions.checkNotNull/1, Strings.emptyToNull/1, directoryFlag.get/0
[COLLABORATORS] field direct... | /* static context
[FOCAL] public void EtcdFlagFieldUpdater.init()
[COLLABORATORS] field directoryFlag get/0
[CALLS-INTERNAL] void init(String flagzDirectory)
[CALLS-EXTERNAL] Preconditions.checkNotNull/1, Strings.emptyToNull/1, directoryFlag.get/0
*/
| /* static context
[FOCAL] public void EtcdFlagFieldUpdater.init()
[COLLABORATORS] field directoryFlag get/0
[CALLS-INTERNAL] void init(String flagzDirectory)
[CALLS-EXTERNAL] Preconditions.checkNotNull/1, Strings.emptyToNull/1, directoryFlag.get/0
*/
class EtcdFlagFieldUpdater {
public void init() {
init(Precond... | true | ok | {"focal": {"class": "EtcdFlagFieldUpdater", "name": "init", "signature": "void init()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "EtcdFlagFieldUpdater", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "LOG", "type"... |
58282625_3 | class CommonsLang3RandomStringUtils {
public static String random(final int count) {
return random(count, false, false);
}
public CommonsLang3RandomStringUtils();
public static String randomAscii(final int count);
public static String randomAlphabetic(final int count);
public static ... | final long seed = System.currentTimeMillis();
assertEquals("aaa", CommonsLang3RandomStringUtils.random(3,0,0,false,false,new char[]{'a'},new Random(seed)));
}
} | [FOCAL] public static String CommonsLang3RandomStringUtils.random(int count)
[CLASS] class CommonsLang3RandomStringUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String random(int count, boolean letters, boolean numbers)
[INPUTS] branches=- | result=count
[DATAFLOW] count@pa... | /* static context
[FOCAL] public static String CommonsLang3RandomStringUtils.random(int count)
[INPUTS] branches=- | result=count
[CALLS-INTERNAL] String random(int count, boolean letters, boolean numbers)
*/
| /* static context
[FOCAL] public static String CommonsLang3RandomStringUtils.random(int count)
[INPUTS] branches=- | result=count
[CALLS-INTERNAL] String random(int count, boolean letters, boolean numbers)
*/
class CommonsLang3RandomStringUtils {
public static String random(final int count) {
return random... | true | ok | {"focal": {"class": "CommonsLang3RandomStringUtils", "name": "random", "signature": "String random(int count)", "start_line": 3, "modifiers": "public static", "params": [{"name": "count", "type": "int"}], "return_type": "String"}, "class_info": {"name": "CommonsLang3RandomStringUtils", "kind": "class", "modifiers": "",... |
58301263_6 | class DateConverter {
@SuppressWarnings("unused")
public static Calendar convertModelToCalendar(Model tempModel) {
return new GregorianCalendar(tempModel.getYear(), tempModel.getMonth(), tempModel.getDay(), 0, 0, 0);
}
public DateConverter();
private void initializeData();
private vo... | Model testModel = dc.getTodayNepaliDate();
Calendar testCalendar = dc.convertModelToCalendar(testModel);
assertThat(testModel.getYear(), is(testCalendar.get(Calendar.YEAR)));
assertThat(testModel.getMonth(), is(testCalendar.get(Calendar.MONTH)));
assertThat(testModel.getDay(), ... | [FOCAL] @SuppressWarnings("unused") public static Calendar DateConverter.convertModelToCalendar(Model tempModel)
[CLASS] class DateConverter
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Model.getYear/0, Model.getMonth/0, Model.getDay/0
[NEW] GregorianCalendar
[INPUTS] branches=-... | /* static context
[FOCAL] @SuppressWarnings("unused") public static Calendar DateConverter.convertModelToCalendar(Model tempModel)
[INPUTS] branches=- | result=tempModel
[COLLABORATORS] param tempModel:Model getYear/0,getMonth/0,getDay/0
[NEW] GregorianCalendar
[CALLS-EXTERNAL] Model.getYear/0, Model.getMonth/0, Model.... | /* static context
[FOCAL] @SuppressWarnings("unused") public static Calendar DateConverter.convertModelToCalendar(Model tempModel)
[INPUTS] branches=- | result=tempModel
[COLLABORATORS] param tempModel:Model getYear/0,getMonth/0,getDay/0
[NEW] GregorianCalendar
[CALLS-EXTERNAL] Model.getYear/0, Model.getMonth/0, Model.... | true | ok | {"focal": {"class": "DateConverter", "name": "convertModelToCalendar", "signature": "Calendar convertModelToCalendar(Model tempModel)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unused\") public static", "params": [{"name": "tempModel", "type": "Model"}], "return_type": "Calendar"}, "class_info": {"name": "Dat... |
58311295_21 | class MigrationRepository {
public int getLatestVersion() {
if (migrationScripts.isEmpty()) {
return 0;
}
return migrationScripts.get(migrationScripts.size() - 1).getVersion();
}
public MigrationRepository();
public MigrationRepository(String scriptPath);
publ... | MigrationRepository repository = new MigrationRepository("cassandra/migrationtest/empty");
assertThat(repository.getLatestVersion(), is(equalTo(0)));
}
} | [FOCAL] public int MigrationRepository.getLatestVersion()
[CLASS] class MigrationRepository
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] migrationScripts.isEmpty/0, migrationScripts.get(migrationScripts.size() - 1).getVersion/0, migrationScripts.get/1, migrationScripts.size/0
[P... | /* static context
[FOCAL] public int MigrationRepository.getLatestVersion()
[PATH1] if(migrationScripts.isEmpty())=T -> return 0
[PATH2] if(migrationScripts.isEmpty())=F -> return migrationScripts.get(migrationScripts.size() - 1).getVersion()
[COLLABORATORS] field migrationScripts isEmpty/0,get/1,size/0
[CALLS-EXTERNAL... | /* static context
[FOCAL] public int MigrationRepository.getLatestVersion()
[PATH1] if(migrationScripts.isEmpty())=T -> return 0
[PATH2] if(migrationScripts.isEmpty())=F -> return migrationScripts.get(migrationScripts.size() - 1).getVersion()
[COLLABORATORS] field migrationScripts isEmpty/0,get/1,size/0
[CALLS-EXTERNAL... | true | ok | {"focal": {"class": "MigrationRepository", "name": "getLatestVersion", "signature": "int getLatestVersion()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "MigrationRepository", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"... |
58317819_5 | class Document implements Serializable {
public <DATA extends ResourceIdentifier> ObjectDocument<DATA> asObjectDocument() {
return asObjectDocument(0);
}
public Document();
public Document(Document document);
@Deprecated public boolean include(Resource resource);
@Deprecated public ... | Document document = getDocumentAdapter(Article.class)
.fromJson(TestUtil.fromResource("/single_null.json"));
assertNull(document.asObjectDocument().get());
}
} | [FOCAL] public ObjectDocument<DATA> Document.asObjectDocument()
[CLASS] class Document implements Serializable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ObjectDocument<DATA> asObjectDocument(int position)
[CLASS-MEMBERS] Document(); Document(Document document); boolean includ... | /* static context
[FOCAL] public ObjectDocument<DATA> Document.asObjectDocument()
[CALLS-INTERNAL] ObjectDocument<DATA> asObjectDocument(int position)
*/
| /* static context
[FOCAL] public ObjectDocument<DATA> Document.asObjectDocument()
[CALLS-INTERNAL] ObjectDocument<DATA> asObjectDocument(int position)
*/
class Document implements Serializable {
public <DATA extends ResourceIdentifier> ObjectDocument<DATA> asObjectDocument() {
return asObjectDocument(0);
... | true | ok | {"focal": {"class": "Document", "name": "asObjectDocument", "signature": "ObjectDocument<DATA> asObjectDocument()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ObjectDocument<DATA>"}, "class_info": {"name": "Document", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serial... |
58336236_1 | class SimpleHashLookup {
public void reset() {
nexts = new int[1024];
Arrays.fill(nexts, -1);
hashes = new int[1024];
Arrays.fill(hashes, -1);
heads = new int[1024];
Arrays.fill(heads, -1);
load = (loadFactor * heads.length) >> 10;
size = 0;
}
... |
HashStore store = new HashStore();
int[] vals = serie(2000, -1000, 3);
store.add(vals);
verify(store, vals);
store.reset();
verify(store);
store.add(vals);
verify(store, vals);
}
} | [FOCAL] public void SimpleHashLookup.reset()
[CLASS] class SimpleHashLookup
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Arrays.fill/2
[DATAFLOW] hashes@L5->L6; heads@L7->L8,L9; nexts@L3->L4
[CLASS-MEMBERS] SimpleHashLookup(); K keyAt(int entryId); int keyHash(K key); int fixed... | /* static context
[FOCAL] public void SimpleHashLookup.reset()
[CALLS-EXTERNAL] Arrays.fill/2
*/
| /* static context
[FOCAL] public void SimpleHashLookup.reset()
[CALLS-EXTERNAL] Arrays.fill/2
*/
class SimpleHashLookup {
public void reset() {
nexts = new int[1024];
Arrays.fill(nexts, -1);
hashes = new int[1024];
Arrays.fill(hashes, -1);
heads = new int[1024];
Arr... | true | ok | {"focal": {"class": "SimpleHashLookup", "name": "reset", "signature": "void reset()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "SimpleHashLookup", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Sim... |
58378593_2 | class StringEscapeHelper {
public String unescape(String str) {
int slashIndex = str.indexOf('\\');
if (slashIndex > -1) {
int offset = 0;
StringBuilder unescaped = new StringBuilder(str.length() - 1);
while (slashIndex > -1) {
char c = str.charAt(slashIndex + 1);
char r = (... | StringEscapeHelper escapeHelper = new StringEscapeHelper(
'n', '\n',
't', '\t',
'x', '!'
);
String unescaped = escapeHelper.unescape("\\thello\\nworld\\x");
assertThat(unescaped, is("\thello\nworld!"));
}
} | [FOCAL] public String StringEscapeHelper.unescape(String str)
[CLASS] class StringEscapeHelper
[METRICS] loc=27 cc=5 branches=3 loops=1 returns=2 throws=0 nesting=4
[CALLS-EXTERNAL] String.indexOf/1, String.length/0, String.charAt/1, StringBuilder.append/3, StringBuilder.append/1, String.substring/2, Character.toChars/... | /* static context
[FOCAL] public String StringEscapeHelper.unescape(String str)
[PATH1] if(slashIndex > -1)=T -> while(slashIndex > -1)=T -> if(r != NO_REPLACEMENT)=F -> if(unescapeUnicodeEscapes && c == 'u')=T -> exit loop -> return unescaped.toString()
[PATH2] if(slashIndex > -1)=F -> return str
[PATH3] if(slashIndex... | /* static context
[FOCAL] public String StringEscapeHelper.unescape(String str)
[PATH1] if(slashIndex > -1)=T -> while(slashIndex > -1)=T -> if(r != NO_REPLACEMENT)=F -> if(unescapeUnicodeEscapes && c == 'u')=T -> exit loop -> return unescaped.toString()
[PATH2] if(slashIndex > -1)=F -> return str
[PATH3] if(slashIndex... | true | ok | {"focal": {"class": "StringEscapeHelper", "name": "unescape", "signature": "String unescape(String str)", "start_line": 3, "modifiers": "public", "params": [{"name": "str", "type": "String"}], "return_type": "String"}, "class_info": {"name": "StringEscapeHelper", "kind": "class", "modifiers": "", "superclass": null, "i... |
58413602_0 | class TechForumApiImpl implements TechForumApi {
@NonNull
@Override
public List<Talk> retrieveAllTalks(boolean fromCache) throws IOException {
final List<Talk> response = new ArrayList<>();
if (fromCache) {
List<Talk> cachedResponses = localRepository.getTalkList();
... |
mockWebServer.enqueue(new MockResponse().setBody(SAMPLE_SERVER_DATA));
List<Talk> talks = techForumImpl.retrieveAllTalks(false);
assertNotNull(talks);
assertEquals(1, talks.size());
Talk talk = talks.get(0);
assertEquals("123456", talk.getId());
assertEquals(... | [FOCAL] @NonNull @Override public List<Talk> TechForumApiImpl.retrieveAllTalks(boolean fromCache)
[CLASS] class TechForumApiImpl implements TechForumApi
[METRICS] loc=43 cc=6 branches=4 loops=1 returns=3 throws=1 nesting=2
[CALLS-EXTERNAL] localRepository.getTalkList/0, List<Talk>.addAll/1, remoteRepository.getAllTalks... | /* static context
[FOCAL] @NonNull @Override public List<Talk> TechForumApiImpl.retrieveAllTalks(boolean fromCache)
[THROWS-WHEN] IOException when !fromCache && !talkListResponse.isSuccessful()
[PATH1] if(fromCache)=F -> if(!talkListResponse.isSuccessful())=F -> if(talkList == null)=F -> foreach(Session session : talkL... | /* static context
[FOCAL] @NonNull @Override public List<Talk> TechForumApiImpl.retrieveAllTalks(boolean fromCache)
[THROWS-WHEN] IOException when !fromCache && !talkListResponse.isSuccessful()
[PATH1] if(fromCache)=F -> if(!talkListResponse.isSuccessful())=F -> if(talkList == null)=F -> foreach(Session session : talkL... | true | ok | {"focal": {"class": "TechForumApiImpl", "name": "retrieveAllTalks", "signature": "List<Talk> retrieveAllTalks(boolean fromCache) throws IOException", "start_line": 3, "modifiers": "@NonNull @Override public", "params": [{"name": "fromCache", "type": "boolean"}], "return_type": "List<Talk>"}, "class_info": {"name": "Tec... |
58415158_3 | class WFClient {
public void deleteList(WFList toDelete) throws IOException {
checkLoggedIn();
long time = getClientTimeInSeconds();
Long prevLm = toDelete.lm;
PushPoll.Operation deleteOp;
synchronized (this) {
// set the proxy (and delete it from parent)
... | String rootName = "root_" + UUID.randomUUID().toString();
WFList root = client.createRootList(0, rootName, null);
WFList child = client.createList(root, 0, "child_" + rootName, null);
assertTrue(root.getChildren().contains(child));
client.deleteList(child);
assertFalse(r... | [FOCAL] public void WFClient.deleteList(WFList toDelete)
[CLASS] class WFClient
[METRICS] loc=26 cc=4 branches=3 loops=0 returns=0 throws=0 nesting=3
[CALLS-INTERNAL] WFList getParentList(WFList child); boolean isRootList(WFList list); long getClientTimeInSeconds(); void checkLoggedIn(); void executePushPoll(List<PushP... | /* static context
[FOCAL] public void WFClient.deleteList(WFList toDelete)
[PATH1] if(isRootList(toDelete))=F -> if(parent != null)=T -> if(toDeleteFrom != null)=T
[PATH2] if(isRootList(toDelete))=T -> if(toDeleteFrom != null)=F
[PATH3] if(isRootList(toDelete))=F -> if(parent != null)=F -> if(toDeleteFrom != null)=T
[I... | /* static context
[FOCAL] public void WFClient.deleteList(WFList toDelete)
[PATH1] if(isRootList(toDelete))=F -> if(parent != null)=T -> if(toDeleteFrom != null)=T
[PATH2] if(isRootList(toDelete))=T -> if(toDeleteFrom != null)=F
[PATH3] if(isRootList(toDelete))=F -> if(parent != null)=F -> if(toDeleteFrom != null)=T
[I... | true | ok | {"focal": {"class": "WFClient", "name": "deleteList", "signature": "void deleteList(WFList toDelete) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "toDelete", "type": "WFList"}], "return_type": "void"}, "class_info": {"name": "WFClient", "kind": "class", "modifiers": "", "superclass":... |
58555246_58 | class HAProxySubscriber extends DefaultSubscriber<HAProxyPublisher.HAProxyAction> implements Managed {
@Override
public void onNext(HAProxyPublisher.HAProxyAction action) {
if (action.isRegistration()) {
createNSQConsumer(action.getId());
} else {
deleteNSQConsumer(actio... | // given
@SuppressWarnings("unchecked")
FlowableNSQConsumer<Integer> nsqConsumer1 = mock(FlowableNSQConsumer.class);
when(nsqConsumer1.flowable()).thenReturn(Flowable.range(0, 10));
when(nsqConsumerBuilder.apply("haProxy1")).thenReturn(nsqConsumer1);
@SuppressWarnings("un... | [FOCAL] @Override public void HAProxySubscriber.onNext(HAProxyPublisher.HAProxyAction action)
[CLASS] class HAProxySubscriber extends DefaultSubscriber<HAProxyPublisher.HAProxyAction> implements Managed
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void createNSQConsumer(String i... | /* static context
[FOCAL] @Override public void HAProxySubscriber.onNext(HAProxyPublisher.HAProxyAction action)
[PATH1] if(action.isRegistration())=T
[PATH2] if(action.isRegistration())=F
[INPUTS] branches=action | result=-
[COLLABORATORS] param action:HAProxyPublisher.HAProxyAction isRegistration/0,getId/0
[CALLS-INTE... | /* static context
[FOCAL] @Override public void HAProxySubscriber.onNext(HAProxyPublisher.HAProxyAction action)
[PATH1] if(action.isRegistration())=T
[PATH2] if(action.isRegistration())=F
[INPUTS] branches=action | result=-
[COLLABORATORS] param action:HAProxyPublisher.HAProxyAction isRegistration/0,getId/0
[CALLS-INTE... | true | ok | {"focal": {"class": "HAProxySubscriber", "name": "onNext", "signature": "void onNext(HAProxyPublisher.HAProxyAction action)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "action", "type": "HAProxyPublisher.HAProxyAction"}], "return_type": "void"}, "class_info": {"name": "HAProxySubscriber", "k... |
58644242_1 | class Router {
public void open(String url) {
open(url, new Bundle());
}
public Router(UrlMatcher urlMatcher, RouteCompiler routeCompiler, Context context);
public Router(Context context);
public Router setContext(Context context);
public Context getContext();
public Router mism... | //verify(context);
router.add(new Route("github.com/{vendor}", VendorActivity.class));
router.open("https://github.com/mr5");
}
} | [FOCAL] public void Router.open(String url)
[CLASS] class Router
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void open(String url, Context context)
[NEW] Bundle
[DATAFLOW] url@param->L2
[CLASS-MEMBERS] Router(UrlMatcher urlMatcher, RouteCompiler routeCompiler, Context context);... | /* static context
[FOCAL] public void Router.open(String url)
[CALLS-INTERNAL] void open(String url, Context context)
[NEW] Bundle
*/
| /* static context
[FOCAL] public void Router.open(String url)
[CALLS-INTERNAL] void open(String url, Context context)
[NEW] Bundle
*/
class Router {
public void open(String url) {
open(url, new Bundle());
}
public Router(UrlMatcher urlMatcher, RouteCompiler routeCompiler, Context context);
pu... | true | ok | {"focal": {"class": "Router", "name": "open", "signature": "void open(String url)", "start_line": 3, "modifiers": "public", "params": [{"name": "url", "type": "String"}], "return_type": "void"}, "class_info": {"name": "Router", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name"... |
58712872_12 | class NamedHealthCheck extends HealthCheck {
@Override
public Result execute() {
try {
Result result = check();
if (!result.isHealthy()) {
logger.log(Level.WARNING, "HealthCheck '{0}' is unhealthy: {1}",
new Object[]{getName(), result.getM... | result = HealthCheck.Result.unhealthy("ill");
assertThat(healthCheckException.execute().isHealthy(), is(false));
Mockito.verify(logger, Mockito.times(1)).log(eq(Level.WARNING), anyObject(), (Object[]) anyObject());
}
} | [FOCAL] @Override public Result NamedHealthCheck.execute()
[CLASS] class NamedHealthCheck extends HealthCheck
[METRICS] loc=14 cc=3 branches=1 loops=0 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] String getName()
[CALLS-EXTERNAL] check/0 (inherited), Result.isHealthy/0, Logger.log/3, Result.getMessage/0, Result.unheal... | /* static context
[FOCAL] @Override public Result NamedHealthCheck.execute()
[PATH1] try-body throws -> return Result.unhealthy(e)
[PATH2] if(!result.isHealthy())=T -> return result
[PATH3] if(!result.isHealthy())=F -> return result
[EXCEPTIONS] catches Exception e
[CALLS-INTERNAL] String getName()
[FIELDS] read=logger... | /* static context
[FOCAL] @Override public Result NamedHealthCheck.execute()
[PATH1] try-body throws -> return Result.unhealthy(e)
[PATH2] if(!result.isHealthy())=T -> return result
[PATH3] if(!result.isHealthy())=F -> return result
[EXCEPTIONS] catches Exception e
[CALLS-INTERNAL] String getName()
[FIELDS] read=logger... | true | ok | {"focal": {"class": "NamedHealthCheck", "name": "execute", "signature": "Result execute()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Result"}, "class_info": {"name": "NamedHealthCheck", "kind": "class", "modifiers": "", "superclass": "HealthCheck", "interfaces": null, "fields": [{... |
58730569_11 | class Auditor implements Serializable {
ValueContainer inspectEntity(HasUuid entity) {
DefaultValueContainer result = new DefaultValueContainer();
EntityInspector inspector = new EntityInspector(entity);
for (Method currentAttribute : inspector.getAuditedAttributes()) {
try {
AuditedAttribute auditedAt... |
Auditor auditor = new Auditor();
// uses a BooleanFormatter that generates 0 / 1 instead of false / true.
SimpleBooleanFlagEntity entity = new SimpleBooleanFlagEntity("uuid-1", false);
ValueContainer annotationChanges = auditor.inspectEntity(entity);
String formatted = annotationChanges.getAttributes().get... | [FOCAL] ValueContainer Auditor.inspectEntity(HasUuid entity)
[CLASS] class Auditor implements Serializable
[METRICS] loc=23 cc=5 branches=2 loops=1 returns=1 throws=1 nesting=4
[CALLS-INTERNAL] void logAttributeChange(DefaultValueContainer result, EntityInspector inspector, Method currentAttribute, AuditedAttribute ann... | /* static context
[FOCAL] ValueContainer Auditor.inspectEntity(HasUuid entity)
[THROWS-WHEN] AuditlogException when foreach(Method currentAttribute : inspector.getAuditedAttributes())=T && try-body throws
[PATH1] foreach(Method currentAttribute : inspector.getAuditedAttributes())=T -> if(auditedAttribute != null || !is... | /* static context
[FOCAL] ValueContainer Auditor.inspectEntity(HasUuid entity)
[THROWS-WHEN] AuditlogException when foreach(Method currentAttribute : inspector.getAuditedAttributes())=T && try-body throws
[PATH1] foreach(Method currentAttribute : inspector.getAuditedAttributes())=T -> if(auditedAttribute != null || !is... | true | ok | {"focal": {"class": "Auditor", "name": "inspectEntity", "signature": "ValueContainer inspectEntity(HasUuid entity)", "start_line": 3, "modifiers": "", "params": [{"name": "entity", "type": "HasUuid"}], "return_type": "ValueContainer"}, "class_info": {"name": "Auditor", "kind": "class", "modifiers": "", "superclass": nu... |
58760260_2 | class User extends BaseEntity {
public String getLastName() {
return lastName;
}
protected User();
public User(String firstName, String lastName, String username, String password, String[] roles);
public String getFirstName();
public void setFirstName(String firstName);
public v... | assertEquals("galon", user.getLastName());
assertEquals("rabi", admin.getLastName());
}
} | [FOCAL] public String User.getLastName()
[CLASS] class User extends BaseEntity
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] User(); User(String firstName, String lastName, String username, String password, String[] roles); String getFirstName(); void setFirstName(String firstName... | /* static context
[FOCAL] public String User.getLastName()
*/
| /* static context
[FOCAL] public String User.getLastName()
*/
class User extends BaseEntity {
public String getLastName() {
return lastName;
}
protected User();
public User(String firstName, String lastName, String username, String password, String[] roles);
public String getFirstName()... | true | ok | {"focal": {"class": "User", "name": "getLastName", "signature": "String getLastName()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "User", "kind": "class", "modifiers": "", "superclass": "BaseEntity", "interfaces": null, "fields": [{"name": "utils", "type": "U... |
58766030_1 | class LegacyConverters {
public static LocalDateTime toLocalDateTime( Date date ) {
Calendar c = Calendar.getInstance();
c.setTime( date );
int year = c.get( Calendar.YEAR );
int month = c.get( Calendar.MONTH ) + 1; // Calendar month starts at 0
int day = c.get( Calendar.DAY_OF_MONTH );
int hour = c.get(... | long epochMillis = 31415926535L;
Date date = new Date( epochMillis );
Calendar c = Calendar.getInstance();
c.setTime( date );
int year = c.get( Calendar.YEAR );
int month = c.get( Calendar.MONTH ) + 1;
int day = c.get( Calendar.DAY_OF_MONTH );
int hour = c.get( Calendar.HOUR_OF_DAY );
int minute = c.g... | [FOCAL] public static LocalDateTime LegacyConverters.toLocalDateTime(Date date)
[CLASS] class LegacyConverters
[METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Calendar.getInstance/0, Calendar.setTime/1, Calendar.get/1, LocalDateTime.of/7
[DATAFLOW] c@L2->L3,L4,L5,L6,L7,L8,L9,L10; ... | /* static context
[FOCAL] public static LocalDateTime LegacyConverters.toLocalDateTime(Date date)
[CALLS-EXTERNAL] Calendar.getInstance/0, Calendar.setTime/1, Calendar.get/1, LocalDateTime.of/7
*/
| /* static context
[FOCAL] public static LocalDateTime LegacyConverters.toLocalDateTime(Date date)
[CALLS-EXTERNAL] Calendar.getInstance/0, Calendar.setTime/1, Calendar.get/1, LocalDateTime.of/7
*/
class LegacyConverters {
public static LocalDateTime toLocalDateTime( Date date ) {
Calendar c = Calendar.getInstance()... | true | ok | {"focal": {"class": "LegacyConverters", "name": "toLocalDateTime", "signature": "LocalDateTime toLocalDateTime(Date date)", "start_line": 3, "modifiers": "public static", "params": [{"name": "date", "type": "Date"}], "return_type": "LocalDateTime"}, "class_info": {"name": "LegacyConverters", "kind": "class", "modifiers... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.