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 |
|---|---|---|---|---|---|---|---|---|
100716846_10 | class SpringCloudFunctionInvoker implements FunctionInvoker, Closeable {
@Override
public Optional<OutputEvent> tryInvoke(InvocationContext ctx, InputEvent evt) {
SpringCloudMethod method = loader.getFunction();
Object[] userFunctionParams = coerceParameters(ctx, method, evt);
Object r... | SpringCloudFunction fnWrapper = new SpringCloudFunction(x -> x, new SimpleFunctionInspector());
Object result = invoker.tryInvoke(fnWrapper, new Object[]{ Arrays.asList("hello", "world") });
assertThat(result).isInstanceOf(List.class);
assertThat((List) result).containsSequence("hello"... | [FOCAL] @Override public Optional<OutputEvent> SpringCloudFunctionInvoker.tryInvoke(InvocationContext ctx, InputEvent evt)
[CLASS] class SpringCloudFunctionInvoker implements FunctionInvoker, Closeable
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Object tryInvoke(SpringCloudMeth... | /* static context
[FOCAL] @Override public Optional<OutputEvent> SpringCloudFunctionInvoker.tryInvoke(InvocationContext ctx, InputEvent evt)
[INPUTS] branches=- | result=ctx, evt
[COLLABORATORS] field loader getFunction/0
[CALLS-INTERNAL] Object tryInvoke(SpringCloudMethod method, Object[] userFunctionParams); Object[]... | /* static context
[FOCAL] @Override public Optional<OutputEvent> SpringCloudFunctionInvoker.tryInvoke(InvocationContext ctx, InputEvent evt)
[INPUTS] branches=- | result=ctx, evt
[COLLABORATORS] field loader getFunction/0
[CALLS-INTERNAL] Object tryInvoke(SpringCloudMethod method, Object[] userFunctionParams); Object[]... | true | ok | {"focal": {"class": "SpringCloudFunctionInvoker", "name": "tryInvoke", "signature": "Optional<OutputEvent> tryInvoke(InvocationContext ctx, InputEvent evt)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "ctx", "type": "InvocationContext"}, {"name": "evt", "type": "InputEvent"}], "return_type": ... |
100758796_3 | class MainViewModel extends AndroidViewModel {
void sendColorMsg(MeshId targetMeshId, Colour msgColor) {
try {
if (targetMeshId != null) {
String payload = targetMeshId.toString() + ":" + msgColor.toString();
rmConnector.sendDataReliable(targetMeshId, payload);
... | MeshId targetId = mockMeshId;
Colour msgColor = Colour.RED;
String payload = String.valueOf(targetId) + ":" + msgColor;
//Trigger
spyViewModel.sendColorMsg(targetId, msgColor);
//verify
verify(rightMeshConnector).sendDataReliable(targetId, payload);
veri... | [FOCAL] void MainViewModel.sendColorMsg(MeshId targetMeshId, Colour msgColor)
[CLASS] class MainViewModel extends AndroidViewModel
[METRICS] loc=18 cc=5 branches=1 loops=0 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] MeshId.toString/0, Colour.toString/0, rmConnector.sendDataReliable/2, Log.e/2, RightMeshException.Righ... | /* static context
[FOCAL] void MainViewModel.sendColorMsg(MeshId targetMeshId, Colour msgColor)
[PATH1] try-body throws
[PATH2] if(targetMeshId != null)=T
[PATH3] if(targetMeshId != null)=F
[INPUTS] branches=targetMeshId | result=-
[COLLABORATORS] param targetMeshId:MeshId toString/0; param msgColor:Colour toString/0; ... | /* static context
[FOCAL] void MainViewModel.sendColorMsg(MeshId targetMeshId, Colour msgColor)
[PATH1] try-body throws
[PATH2] if(targetMeshId != null)=T
[PATH3] if(targetMeshId != null)=F
[INPUTS] branches=targetMeshId | result=-
[COLLABORATORS] param targetMeshId:MeshId toString/0; param msgColor:Colour toString/0; ... | true | ok | {"focal": {"class": "MainViewModel", "name": "sendColorMsg", "signature": "void sendColorMsg(MeshId targetMeshId, Colour msgColor)", "start_line": 3, "modifiers": "", "params": [{"name": "targetMeshId", "type": "MeshId"}, {"name": "msgColor", "type": "Colour"}], "return_type": "void"}, "class_info": {"name": "MainViewM... |
100808500_35 | class PutInvariantSpanOp extends Op {
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
PutInvariantSpanOp other = (PutInvariantSpanOp) obj;
if (ripIndex != other.ripIndex)
return fal... | PutInvariantSpanOp op1 = new PutInvariantSpanOp(100, 50, 1, 0);
PutInvariantSpanOp op2 = new PutInvariantSpanOp(101, 50, 1, 0);
assertFalse(op1.equals(op2));
assertFalse(op2.equals(op1));
}
} | [FOCAL] @Override public boolean PutInvariantSpanOp.equals(Object obj)
[CLASS] class PutInvariantSpanOp extends Op
[METRICS] loc=19 cc=8 branches=7 loops=0 returns=8 throws=0 nesting=1
[CALLS-EXTERNAL] Op.equals/1, getClass/0 (inherited), Object.getClass/0
[PATH1] if(this == obj)=F -> if(!super.equals(obj))=F -> if(get... | /* static context
[FOCAL] @Override public boolean PutInvariantSpanOp.equals(Object obj)
[PATH1] if(this == obj)=F -> if(!super.equals(obj))=F -> if(getClass() != obj.getClass())=F -> if(ripIndex != other.ripIndex)=F -> if(invariantStart != other.invariantStart)=F -> if(to != other.to)=F -> if(width != other.width)=T -... | /* static context
[FOCAL] @Override public boolean PutInvariantSpanOp.equals(Object obj)
[PATH1] if(this == obj)=F -> if(!super.equals(obj))=F -> if(getClass() != obj.getClass())=F -> if(ripIndex != other.ripIndex)=F -> if(invariantStart != other.invariantStart)=F -> if(to != other.to)=F -> if(width != other.width)=T -... | true | ok | {"focal": {"class": "PutInvariantSpanOp", "name": "equals", "signature": "boolean equals(Object obj)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "obj", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "PutInvariantSpanOp", "kind": "class", "modifiers": "", "superclass": ... |
100928537_1 | class StateMachine {
public void nextMicrophoneState() {
switch (getMicrophoneState()) {
case BLOCKED:
microphoneState = MicrophoneState.NO_SOUND;
jsonParser.setMicrophoneState("softEmptyNoise");
break;
case NO_SOUND:
m... | assertEquals(MicrophoneState.BLOCKED, stateMachine.getMicrophoneState());
stateMachine.nextMicrophoneState();
assertEquals(MicrophoneState.NO_SOUND, stateMachine.getMicrophoneState());
stateMachine.nextMicrophoneState();
assertEquals(MicrophoneState.NEUTRAL_SOUND, stateMachine.ge... | [FOCAL] public void StateMachine.nextMicrophoneState()
[CLASS] class StateMachine
[METRICS] loc=12 cc=3 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] MicrophoneState getMicrophoneState()
[CALLS-EXTERNAL] jsonParser.setMicrophoneState/1
[PATH1] switch(getMicrophoneState())=case BLOCKED
[PATH2] switch(... | /* static context
[FOCAL] public void StateMachine.nextMicrophoneState()
[PATH1] switch(getMicrophoneState())=case BLOCKED
[PATH2] switch(getMicrophoneState())=case NO_SOUND
[PATH3] switch(getMicrophoneState())=default
[COLLABORATORS] field jsonParser setMicrophoneState/1
[CALLS-INTERNAL] MicrophoneState getMicrophoneS... | /* static context
[FOCAL] public void StateMachine.nextMicrophoneState()
[PATH1] switch(getMicrophoneState())=case BLOCKED
[PATH2] switch(getMicrophoneState())=case NO_SOUND
[PATH3] switch(getMicrophoneState())=default
[COLLABORATORS] field jsonParser setMicrophoneState/1
[CALLS-INTERNAL] MicrophoneState getMicrophoneS... | true | ok | {"focal": {"class": "StateMachine", "name": "nextMicrophoneState", "signature": "void nextMicrophoneState()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "StateMachine", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name":... |
100955538_0 | class Cookie {
public static Cookie parse(String setCookie) {
return parse(System.currentTimeMillis(), setCookie);
}
private Cookie(String name, String value, long expiresAt, String domain, String path,
boolean secure, boolean httpOnly, boolean hostOnly, boolean persistent);
... | assertThat(Cookie.parse("foo")).isNull();
assertThat(Cookie.parse("foo; Path=/")).isNull();
}
} | [FOCAL] public static Cookie Cookie.parse(String setCookie)
[CLASS] class Cookie
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Cookie parse(long currentTimeMillis, String setCookie)
[CALLS-EXTERNAL] System.currentTimeMillis/0
[INPUTS] branches=- | result=setCookie
[DATAFLOW] setC... | /* static context
[FOCAL] public static Cookie Cookie.parse(String setCookie)
[INPUTS] branches=- | result=setCookie
[CALLS-INTERNAL] Cookie parse(long currentTimeMillis, String setCookie)
[CALLS-EXTERNAL] System.currentTimeMillis/0
*/
| /* static context
[FOCAL] public static Cookie Cookie.parse(String setCookie)
[INPUTS] branches=- | result=setCookie
[CALLS-INTERNAL] Cookie parse(long currentTimeMillis, String setCookie)
[CALLS-EXTERNAL] System.currentTimeMillis/0
*/
class Cookie {
public static Cookie parse(String setCookie) {
return pa... | true | ok | {"focal": {"class": "Cookie", "name": "parse", "signature": "Cookie parse(String setCookie)", "start_line": 3, "modifiers": "public static", "params": [{"name": "setCookie", "type": "String"}], "return_type": "Cookie"}, "class_info": {"name": "Cookie", "kind": "class", "modifiers": "", "superclass": null, "interfaces":... |
101047757_15 | class FromConfigurationOperation extends GraphOperation {
@Override
public void callPreProcessing(SimulationState simulationState) {
Integer graphId = this.properties.getIntegerProperty(graphIdName);
Double precisionSeed = this.properties.getDoubleProperty(precisionSeedName);
Boolean insideAreaSeed = this.p... |
public void fromConfiguration_loadsSingleVertexWithPrecision_WithSuccess(String configurationFile) throws Exception {
// Arrange
createConfiguration(configurationFile);
// Arrange
createConfiguration(configurationFile);
SimulationState state = mock(SimulationState.class);
// Act
graphOperation.ca... | [FOCAL] @Override public void FromConfigurationOperation.callPreProcessing(SimulationState simulationState)
[CLASS] class FromConfigurationOperation extends GraphOperation
[METRICS] loc=98 cc=7 branches=3 loops=3 returns=0 throws=0 nesting=5
[CALLS-EXTERNAL] this.properties.getIntegerProperty/1, this.properties.getDoub... | /* static context
[FOCAL] @Override public void FromConfigurationOperation.callPreProcessing(SimulationState simulationState)
[PATH1] foreach(GraphScenarioConfiguration graphScenarioConfiguration : configurations.get(0).getGraphs())=T -> if(graphScenarioConfiguration.getId().intValue() == graphId)=T -> exit loop -> for... | /* static context
[FOCAL] @Override public void FromConfigurationOperation.callPreProcessing(SimulationState simulationState)
[PATH1] foreach(GraphScenarioConfiguration graphScenarioConfiguration : configurations.get(0).getGraphs())=T -> if(graphScenarioConfiguration.getId().intValue() == graphId)=T -> exit loop -> for... | true | ok | {"focal": {"class": "FromConfigurationOperation", "name": "callPreProcessing", "signature": "void callPreProcessing(SimulationState simulationState)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "simulationState", "type": "SimulationState"}], "return_type": "void"}, "class_info": {"name": "Fro... |
101179084_0 | class RxDownloader {
public Single<List<FileContainer>> asList() {
this.subject.subscribe(this.itemsObserver);
this.size = this.files.size();
this.remains = this.size;
Observable<FileContainer> observable = Observable
.fromIterable(this.files)
.observ... | rxDownloader = builder
.strategy(DownloadStrategy.MAX)
.addFile("http://fakeURL.com/error-file.jpg")
.build();
List<FileContainer> res = rxDownloader.asList().blockingGet();
res.forEach(fileContainer -> {
Log.i("RxDownloader", "key" + ... | [FOCAL] public Single<List<FileContainer>> RxDownloader.asList()
[CLASS] class RxDownloader
[METRICS] loc=16 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] Observable<FileContainer> parallelDownloading(Observable<FileContainer> observable); Observable<FileContainer> sequentialDownloading(Observab... | /* static context
[FOCAL] public Single<List<FileContainer>> RxDownloader.asList()
[PATH1] if(ORDER == DownloadStrategy.FLAG_PARALLEL)=F -> if(ORDER == DownloadStrategy.FLAG_SEQUENTIAL)=T -> return observable.toList()
[PATH2] if(ORDER == DownloadStrategy.FLAG_PARALLEL)=T -> return observable.toList()
[PATH3] if(ORDER =... | /* static context
[FOCAL] public Single<List<FileContainer>> RxDownloader.asList()
[PATH1] if(ORDER == DownloadStrategy.FLAG_PARALLEL)=F -> if(ORDER == DownloadStrategy.FLAG_SEQUENTIAL)=T -> return observable.toList()
[PATH2] if(ORDER == DownloadStrategy.FLAG_PARALLEL)=T -> return observable.toList()
[PATH3] if(ORDER =... | true | ok | {"focal": {"class": "RxDownloader", "name": "asList", "signature": "Single<List<FileContainer>> asList()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Single<List<FileContainer>>"}, "class_info": {"name": "RxDownloader", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null,... |
101231823_11 | class IEXPrice implements Comparable<IEXPrice>, Serializable {
@Override
public int compareTo(final IEXPrice iexPrice) {
return compare(this.getNumber(), iexPrice.getNumber());
}
public IEXPrice(final long number);
public long getNumber();
public BigDecimal toBigDecimal();
@Overr... | final long biggerNumber = 12345678L;
final long smallerNumber = 1234567L;
final IEXPrice iexPrice_1 = new IEXPrice(biggerNumber);
final IEXPrice iexPrice_2 = new IEXPrice(smallerNumber);
assertThat(iexPrice_1.compareTo(iexPrice_2)).isEqualTo(1);
}
} | [FOCAL] @Override public int IEXPrice.compareTo(IEXPrice iexPrice)
[CLASS] class IEXPrice implements Comparable<IEXPrice>, Serializable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] long getNumber()
[CALLS-EXTERNAL] compare/2 (inherited), IEXPrice.getNumber/0
[INPUTS] branches=- ... | /* static context
[FOCAL] @Override public int IEXPrice.compareTo(IEXPrice iexPrice)
[INPUTS] branches=- | result=iexPrice
[COLLABORATORS] param iexPrice:IEXPrice getNumber/0
[CALLS-INTERNAL] long getNumber()
[CALLS-EXTERNAL] compare/2 (inherited), IEXPrice.getNumber/0
*/
| /* static context
[FOCAL] @Override public int IEXPrice.compareTo(IEXPrice iexPrice)
[INPUTS] branches=- | result=iexPrice
[COLLABORATORS] param iexPrice:IEXPrice getNumber/0
[CALLS-INTERNAL] long getNumber()
[CALLS-EXTERNAL] compare/2 (inherited), IEXPrice.getNumber/0
*/
class IEXPrice implements Comparable<IEXPrice>,... | true | ok | {"focal": {"class": "IEXPrice", "name": "compareTo", "signature": "int compareTo(IEXPrice iexPrice)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "iexPrice", "type": "IEXPrice"}], "return_type": "int"}, "class_info": {"name": "IEXPrice", "kind": "class", "modifiers": "", "superclass": null, "i... |
101264180_0 | class BookServiceImpl implements BookService {
@Override
@Transactional
public Book saveBook(@NotNull @Valid final Book book) {
LOGGER.debug("Creating {}", book);
Book existing = repository.findOne(book.getId());
if (existing != null) {
throw new BookAlreadyExistsExcepti... | final Book savedBook = stubRepositoryToReturnUserOnSave();
final Book book = UserUtil.createBook();
final Book returnedBook = bookService.saveBook(book);
// verify repository was called with book
verify(bookRepository, times(1)).save(book);
assertEquals("Returned book sho... | [FOCAL] @Override @Transactional public Book BookServiceImpl.saveBook(Book book)
[CLASS] class BookServiceImpl implements BookService
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] LOGGER.debug/2, repository.findOne/1, Book.getId/0, String.format/2, repository.save/1
[NEW] BookAl... | /* static context
[FOCAL] @Override @Transactional public Book BookServiceImpl.saveBook(Book book)
[THROWS-WHEN] BookAlreadyExistsException when existing != null
[PATH1] if(existing != null)=T -> throw new BookAlreadyExistsException( String.format("There already exists...
[PATH2] if(existing != null)=F -> return reposi... | /* static context
[FOCAL] @Override @Transactional public Book BookServiceImpl.saveBook(Book book)
[THROWS-WHEN] BookAlreadyExistsException when existing != null
[PATH1] if(existing != null)=T -> throw new BookAlreadyExistsException( String.format("There already exists...
[PATH2] if(existing != null)=F -> return reposi... | true | ok | {"focal": {"class": "BookServiceImpl", "name": "saveBook", "signature": "Book saveBook(Book book)", "start_line": 3, "modifiers": "@Override @Transactional public", "params": [{"name": "book", "type": "Book"}], "return_type": "Book"}, "class_info": {"name": "BookServiceImpl", "kind": "class", "modifiers": "", "supercla... |
101380382_1 | class MockableClient extends OkHttpClient {
@Override
public Call newCall(Request request) {
if (shouldMockRequest(request)) {
return mockedClient.newCall(request);
} else {
return realClient.newCall(request);
}
}
MockableClient(Registry registry,
... | // Given
givenWhenFunctionReturns(true);
givenEndpointInRegistry(true);
// When
testee.newCall(REQUEST);
// Then
verify(mockClient).newCall(REQUEST);
verify(realClient, never()).newCall(any(Request.class));
}
} | [FOCAL] @Override public Call MockableClient.newCall(Request request)
[CLASS] class MockableClient extends OkHttpClient
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean shouldMockRequest(Request request)
[CALLS-EXTERNAL] mockedClient.newCall/1, OkHttpClient.newCall/1
[FIELDS... | /* static context
[FOCAL] @Override public Call MockableClient.newCall(Request request)
[PATH1] if(shouldMockRequest(request))=T -> return mockedClient.newCall(request)
[PATH2] if(shouldMockRequest(request))=F -> return realClient.newCall(request)
[INPUTS] branches=request | result=request, realClient
[COLLABORATORS] f... | /* static context
[FOCAL] @Override public Call MockableClient.newCall(Request request)
[PATH1] if(shouldMockRequest(request))=T -> return mockedClient.newCall(request)
[PATH2] if(shouldMockRequest(request))=F -> return realClient.newCall(request)
[INPUTS] branches=request | result=request, realClient
[COLLABORATORS] f... | true | ok | {"focal": {"class": "MockableClient", "name": "newCall", "signature": "Call newCall(Request request)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "Request"}], "return_type": "Call"}, "class_info": {"name": "MockableClient", "kind": "class", "modifiers": "", "superclass": "O... |
101408117_12 | class IMemoryImageInputStream extends ImageInputStreamImpl {
@Override
public int read(byte[] buffer, int offset, int length) throws IOException
{
int read = 0;
try {
read = memory.getBytesAt(address, buffer,offset,length);
} catch (MemoryFault f) {
if (f.getAddress() == address) {
/* Couldn't re... | AbstractMemory memory = new MockMemory(ByteOrder.BIG_ENDIAN);
memory.addMemorySource(new MockMemorySource(new byte[] { (byte)0xDE, (byte)0xAD, (byte)0xBE, (byte)0xEF}, 0, 0x10000,
0x10000));
memory.addMemorySource(new UnbackedMemorySource(0x20000, 0x10000, "Deliberately not backed"));
IMemoryImageInp... | [FOCAL] @Override public int IMemoryImageInputStream.read(byte[] buffer, int offset, int length)
[CLASS] class IMemoryImageInputStream extends ImageInputStreamImpl
[METRICS] loc=20 cc=3 branches=1 loops=0 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] memory.getBytesAt/4, MemoryFault.getAddress/0
[EXCEPTIONS] declares I... | /* static context
[FOCAL] @Override public int IMemoryImageInputStream.read(byte[] buffer, int offset, int length)
[PATH1] try-body throws -> if(f.getAddress() == address)=T -> return -1
[PATH2] try-body throws -> if(f.getAddress() == address)=F -> return read
[INPUTS] branches=- | result=buffer, length, offset
[COLLAB... | /* static context
[FOCAL] @Override public int IMemoryImageInputStream.read(byte[] buffer, int offset, int length)
[PATH1] try-body throws -> if(f.getAddress() == address)=T -> return -1
[PATH2] try-body throws -> if(f.getAddress() == address)=F -> return read
[INPUTS] branches=- | result=buffer, length, offset
[COLLAB... | true | ok | {"focal": {"class": "IMemoryImageInputStream", "name": "read", "signature": "int read(byte[] buffer, int offset, int length) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "buffer", "type": "byte[]"}, {"name": "offset", "type": "int"}, {"name": "length", "type": "int"}], "ret... |
101422199_3 | class PgCopyEscaper {
public String escapeForStdIn(String text) {
if (text == null) {
return null;
}
int firstEscapableChar = findFirstEscapableChar(text);
if (firstEscapableChar == -1) {
return text;
}
StringBuilder sb = new StringBuilder(t... | String text = "1234\tvalue\t5678\t";
String escaped = escaper.escapeForStdIn(text);
assertEquals("1234" + ESCAPED_BY_CHAR + FIELD_TERMINATED_CHAR + "value" + ESCAPED_BY_CHAR
+ FIELD_TERMINATED_CHAR + "5678" + ESCAPED_BY_CHAR + FIELD_TERMINATED_CHAR, escaped);
logger.info(... | [FOCAL] public String PgCopyEscaper.escapeForStdIn(String text)
[CLASS] class PgCopyEscaper
[METRICS] loc=24 cc=5 branches=3 loops=1 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] boolean isEscapable(char character); int findFirstEscapableChar(String text)
[CALLS-EXTERNAL] String.substring/2, String.length/0, String.cha... | /* static context
[FOCAL] public String PgCopyEscaper.escapeForStdIn(String text)
[PATH1] if(text == null)=F -> if(firstEscapableChar == -1)=F -> for(i < textLength)=T -> if(isEscapable(textCharacter))=T -> exit loop -> return sb.toString()
[PATH2] if(text == null)=T -> return null
[PATH3] if(text == null)=F -> if(firs... | /* static context
[FOCAL] public String PgCopyEscaper.escapeForStdIn(String text)
[PATH1] if(text == null)=F -> if(firstEscapableChar == -1)=F -> for(i < textLength)=T -> if(isEscapable(textCharacter))=T -> exit loop -> return sb.toString()
[PATH2] if(text == null)=T -> return null
[PATH3] if(text == null)=F -> if(firs... | true | ok | {"focal": {"class": "PgCopyEscaper", "name": "escapeForStdIn", "signature": "String escapeForStdIn(String text)", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "PgCopyEscaper", "kind": "class", "modifiers": "", "superclass": null... |
101436299_2 | class UriUtils {
public static URI getParent(final URI uri) {
if (isRoot(uri)) {
return null;
} else {
//get the parent path (with a slash on the end)
final URI parent = uri.getPath().endsWith("/") ? uri.resolve("..") : uri.resolve(".");
final String ... | final URI uri = URI.create(INTERNAL_URI_PREFIX + "/child/grandchild");
assertEquals("incorrect parent", URI.create(INTERNAL_URI_PREFIX + "/child"), UriUtils.getParent(uri));
}
} | [FOCAL] public static URI UriUtils.getParent(URI uri)
[CLASS] class UriUtils
[METRICS] loc=12 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean isRoot(URI uri)
[CALLS-EXTERNAL] uri.getPath().endsWith/1, URI.getPath/0, URI.resolve/1, URI.toString/0, URI.create/1, String.substring/2, String.le... | /* static context
[FOCAL] public static URI UriUtils.getParent(URI uri)
[PATH1] if(isRoot(uri))=T -> return null
[PATH2] if(isRoot(uri))=F -> return isRoot(parent) ? parent : URI.create(parentStr.substring(0, parentS...
[INPUTS] branches=uri | result=uri
[COLLABORATORS] param uri:URI getPath/0,resolve/1
[CALLS-INTERNAL... | /* static context
[FOCAL] public static URI UriUtils.getParent(URI uri)
[PATH1] if(isRoot(uri))=T -> return null
[PATH2] if(isRoot(uri))=F -> return isRoot(parent) ? parent : URI.create(parentStr.substring(0, parentS...
[INPUTS] branches=uri | result=uri
[COLLABORATORS] param uri:URI getPath/0,resolve/1
[CALLS-INTERNAL... | true | ok | {"focal": {"class": "UriUtils", "name": "getParent", "signature": "URI getParent(URI uri)", "start_line": 3, "modifiers": "public static", "params": [{"name": "uri", "type": "URI"}], "return_type": "URI"}, "class_info": {"name": "UriUtils", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fiel... |
101477481_4 | class TsvParser {
private static Optional<Node> parseNode(String nodeString) {
try {
return Optional.of(NodeFactoryExtra.parseNode(nodeString));
} catch (RiotException e) {
log.error("Parsing of value '{}' failed: {}", nodeString, e.getMessage());
return Optional... | Node parseNode = NodeFactoryExtra.parseNode("\"Hallo \\\"Echo\\\"!\"@de");
assertEquals("de", parseNode.getLiteralLanguage());
assertEquals("Hallo \"Echo\"!", parseNode.getLiteralValue());
}
} | [FOCAL] private static Optional<Node> TsvParser.parseNode(String nodeString)
[CLASS] class TsvParser
[METRICS] loc=8 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Optional.of/1, NodeFactoryExtra.parseNode/1, log.error/3, RiotException.getMessage/0, Optional.empty/0
[EXCEPTIONS] catches RiotExcep... | /* static context
[FOCAL] private static Optional<Node> TsvParser.parseNode(String nodeString)
[PATH1] try-body throws -> return Optional.empty()
[PATH2] return Optional.of(NodeFactoryExtra.parseNode(nodeString))
[INPUTS] branches=- | result=nodeString
[EXCEPTIONS] catches RiotException e
[CALLS-EXTERNAL] Optional.of/1... | /* static context
[FOCAL] private static Optional<Node> TsvParser.parseNode(String nodeString)
[PATH1] try-body throws -> return Optional.empty()
[PATH2] return Optional.of(NodeFactoryExtra.parseNode(nodeString))
[INPUTS] branches=- | result=nodeString
[EXCEPTIONS] catches RiotException e
[CALLS-EXTERNAL] Optional.of/1... | true | ok | {"focal": {"class": "TsvParser", "name": "parseNode", "signature": "Optional<Node> parseNode(String nodeString)", "start_line": 3, "modifiers": "private static", "params": [{"name": "nodeString", "type": "String"}], "return_type": "Optional<Node>"}, "class_info": {"name": "TsvParser", "kind": "class", "modifiers": "", ... |
101495687_0 | class FeaturePluginToMavenDependencyConverter {
static Set<Dependency> convert(Set<IFeaturePlugin> featurePlugins) {
return featurePlugins.stream().map(FeaturePluginToMavenDependencyConverter::convert).collect(Collectors.toSet());
}
private static Dependency convert(IFeaturePlugin featurePlugin);
... |
IFeaturePlugin featurePlugin = Mockito.mock(IFeaturePlugin.class);
Mockito.when(featurePlugin.getId()).thenReturn(FEATURE_PLUGIN_ID_FX);
Mockito.when(featurePlugin.getVersion()).thenReturn(FEATURE_PLUGIN_VERSION_FX);
Set<Dependency> dependencies = FeaturePluginToMavenDependencyConverter.convert(new HashSe... | [FOCAL] static Set<Dependency> FeaturePluginToMavenDependencyConverter.convert(Set<IFeaturePlugin> featurePlugins)
[CLASS] class FeaturePluginToMavenDependencyConverter
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] featurePlugins.stream().map(FeaturePluginToMavenDependenc....coll... | /* static context
[FOCAL] static Set<Dependency> FeaturePluginToMavenDependencyConverter.convert(Set<IFeaturePlugin> featurePlugins)
[INPUTS] branches=- | result=featurePlugins
[COLLABORATORS] param featurePlugins:Set<IFeaturePlugin> stream/0
[CALLS-EXTERNAL] featurePlugins.stream().map(FeaturePluginToMavenDependenc...... | /* static context
[FOCAL] static Set<Dependency> FeaturePluginToMavenDependencyConverter.convert(Set<IFeaturePlugin> featurePlugins)
[INPUTS] branches=- | result=featurePlugins
[COLLABORATORS] param featurePlugins:Set<IFeaturePlugin> stream/0
[CALLS-EXTERNAL] featurePlugins.stream().map(FeaturePluginToMavenDependenc...... | true | ok | {"focal": {"class": "FeaturePluginToMavenDependencyConverter", "name": "convert", "signature": "Set<Dependency> convert(Set<IFeaturePlugin> featurePlugins)", "start_line": 3, "modifiers": "static", "params": [{"name": "featurePlugins", "type": "Set<IFeaturePlugin>"}], "return_type": "Set<Dependency>"}, "class_info": {"... |
101559429_7 | class ActivityResult {
@Override
public String toString() {
return "ActivityResult { ResultCode = " +
resultCode + ", Data = " + data + " }";
}
public ActivityResult(int okResultCode, int resultCode, Intent data);
public Intent getData();
public int getResultCode();
... | String testResult = "ActivityResult { ResultCode" +
" = " + resultCode + ", Data = " + intent + " }";
assertEquals(activityResult.toString(), testResult);
}
} | [FOCAL] @Override public String ActivityResult.toString()
[CLASS] class ActivityResult
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=resultCode:int
[INPUTS] branches=- | result=resultCode
[DATAFLOW] this.resultCode@param->L3
[CLASS-MEMBERS] ActivityResult(int okResultCode, int resul... | /* static context
[FOCAL] @Override public String ActivityResult.toString()
[INPUTS] branches=- | result=resultCode
[FIELDS] read=resultCode:int
*/
| /* static context
[FOCAL] @Override public String ActivityResult.toString()
[INPUTS] branches=- | result=resultCode
[FIELDS] read=resultCode:int
*/
class ActivityResult {
@Override
public String toString() {
return "ActivityResult { ResultCode = " +
resultCode + ", Data = " + data + " }... | true | ok | {"focal": {"class": "ActivityResult", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "ActivityResult", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "in... |
101634406_18 | class ChannelConfigurator {
void sync(@NonNull PolicyConfiguration config) {
if (!config.getChannels().isPresent()) {
LOG.info("No alerts channels for policy {} - skipping...", config.getPolicyName());
return;
}
LOG.info("Synchronizing alerts channels for policy {}..... | // given
AlertsChannel emailChannelInPolicy = channelInPolicy(savedEmailChannel, POLICY_ID, POLICY_ID + 1);
when(alertsChannelsApiMock.list()).thenReturn(ImmutableList.of(
savedUserChannel,
emailChannelInPolicy,
channelInPolicy(savedSlackChannel, P... | [FOCAL] void ChannelConfigurator.sync(PolicyConfiguration config)
[CLASS] class ChannelConfigurator
[METRICS] loc=15 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Set<Integer> createOrUpdatePolicyAlertsChannels(AlertsPolicy policy, Collection<Channel> channelsFromConfig); void cleanupPolicyAlert... | /* static context
[FOCAL] void ChannelConfigurator.sync(PolicyConfiguration config)
[PATH1] if(!config.getChannels().isPresent())=T -> return
[PATH2] if(!config.getChannels().isPresent())=F
[INPUTS] branches=config | result=-
[COLLABORATORS] param config:PolicyConfiguration getChannels/0,getPolicyName/0; field api getA... | /* static context
[FOCAL] void ChannelConfigurator.sync(PolicyConfiguration config)
[PATH1] if(!config.getChannels().isPresent())=T -> return
[PATH2] if(!config.getChannels().isPresent())=F
[INPUTS] branches=config | result=-
[COLLABORATORS] param config:PolicyConfiguration getChannels/0,getPolicyName/0; field api getA... | true | ok | {"focal": {"class": "ChannelConfigurator", "name": "sync", "signature": "void sync(PolicyConfiguration config)", "start_line": 3, "modifiers": "", "params": [{"name": "config", "type": "PolicyConfiguration"}], "return_type": "void"}, "class_info": {"name": "ChannelConfigurator", "kind": "class", "modifiers": "", "super... |
101637037_0 | class EmbeddedJMSBrokerHolder implements AutoCloseable, ConnectionFactoryAccessor, ActiveMQConnectionFactoryAccessor, BrokerURIAccessor {
public static EmbeddedJMSBrokerHolder create(final String name, boolean marshal, boolean persistent) {
final File tempDir = Files.createTempDir();
LOGGER.debug("... | try (final EmbeddedJMSBrokerHolder embeddedJmsBrokerHolder = EmbeddedJMSBrokerHolder
.create("name", false, false)) {
assertNotNull(embeddedJmsBrokerHolder.getBrokerService());
assertFalse(embeddedJmsBrokerHolder.getBrokerService().isStarted());
}
}
} | [FOCAL] public static EmbeddedJMSBrokerHolder EmbeddedJMSBrokerHolder.create(String name, boolean marshal, boolean persistent)
[CLASS] class EmbeddedJMSBrokerHolder implements AutoCloseable, ConnectionFactoryAccessor, ActiveMQConnectionFactoryAccessor, BrokerURIAccessor
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1... | /* static context
[FOCAL] public static EmbeddedJMSBrokerHolder EmbeddedJMSBrokerHolder.create(String name, boolean marshal, boolean persistent)
[INPUTS] branches=- | result=marshal, name, persistent
[CALLS-INTERNAL] BrokerService createAndConfigureBrokerService(BrokerSettings brokerSettings)
[NEW] EmbeddedJMSBrokerHol... | /* static context
[FOCAL] public static EmbeddedJMSBrokerHolder EmbeddedJMSBrokerHolder.create(String name, boolean marshal, boolean persistent)
[INPUTS] branches=- | result=marshal, name, persistent
[CALLS-INTERNAL] BrokerService createAndConfigureBrokerService(BrokerSettings brokerSettings)
[NEW] EmbeddedJMSBrokerHol... | true | ok | {"focal": {"class": "EmbeddedJMSBrokerHolder", "name": "create", "signature": "EmbeddedJMSBrokerHolder create(String name, boolean marshal, boolean persistent)", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}, {"name": "marshal", "type": "boolean"}, {"name": "persistent", "... |
101650961_1 | class ZeebeExpressionResolver implements BeanFactoryAware {
@SuppressWarnings("unchecked")
public <T> T resolve(final String value) {
final String resolvedValue = resolve.apply(value);
if (!(resolvedValue.startsWith("#{") && value.endsWith("}"))) {
return (T) resolvedValue;
}
return (T) thi... | final String normalString = resolver.resolve("normalString");
assertThat(normalString).isEqualTo("normalString");
}
} | [FOCAL] @SuppressWarnings("unchecked") public T ZeebeExpressionResolver.resolve(String value)
[CLASS] class ZeebeExpressionResolver implements BeanFactoryAware
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] resolve.apply/1, String.startsWith/1, String.endsWith/1, ZeebeExpressionR... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public T ZeebeExpressionResolver.resolve(String value)
[PATH1] if(!(resolvedValue.startsWith("#{") && value.endsWith("}")))=T -> return (T) resolvedValue
[PATH2] if(!(resolvedValue.startsWith("#{") && value.endsWith("}")))=F -> return (T) this.resolver.evaluate(r... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public T ZeebeExpressionResolver.resolve(String value)
[PATH1] if(!(resolvedValue.startsWith("#{") && value.endsWith("}")))=T -> return (T) resolvedValue
[PATH2] if(!(resolvedValue.startsWith("#{") && value.endsWith("}")))=F -> return (T) this.resolver.evaluate(r... | true | ok | {"focal": {"class": "ZeebeExpressionResolver", "name": "resolve", "signature": "T resolve(String value)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [{"name": "value", "type": "String"}], "return_type": "T"}, "class_info": {"name": "ZeebeExpressionResolver", "kind": "class", "mod... |
101732174_16 | class WatchTimeout {
public static long availableTimeout(long expectedTimeoutMillis) {
return availableTimeout(expectedTimeoutMillis, 0);
}
private WatchTimeout();
public static long availableTimeout(long expectedTimeoutMillis, long currentTimeoutMillis);
}
class WatchTimeoutTest {
@T... | assertThat(availableTimeout(1_000, 0)).isEqualTo(1_000);
assertThat(availableTimeout(1_000, 1_000)).isEqualTo(1_000);
assertThat(availableTimeout(MAX_MILLIS, 1_000)).isEqualTo(MAX_MILLIS - 1_000);
assertThat(availableTimeout(MAX_MILLIS + 1_000, 0)).isEqualTo(MAX_MILLIS);
assertTh... | [FOCAL] public static long WatchTimeout.availableTimeout(long expectedTimeoutMillis)
[CLASS] class WatchTimeout
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] long availableTimeout(long expectedTimeoutMillis, long currentTimeoutMillis)
[INPUTS] branches=- | result=expectedTimeoutM... | /* static context
[FOCAL] public static long WatchTimeout.availableTimeout(long expectedTimeoutMillis)
[INPUTS] branches=- | result=expectedTimeoutMillis
[CALLS-INTERNAL] long availableTimeout(long expectedTimeoutMillis, long currentTimeoutMillis)
*/
| /* static context
[FOCAL] public static long WatchTimeout.availableTimeout(long expectedTimeoutMillis)
[INPUTS] branches=- | result=expectedTimeoutMillis
[CALLS-INTERNAL] long availableTimeout(long expectedTimeoutMillis, long currentTimeoutMillis)
*/
class WatchTimeout {
public static long availableTimeout(long ex... | true | ok | {"focal": {"class": "WatchTimeout", "name": "availableTimeout", "signature": "long availableTimeout(long expectedTimeoutMillis)", "start_line": 3, "modifiers": "public static", "params": [{"name": "expectedTimeoutMillis", "type": "long"}], "return_type": "long"}, "class_info": {"name": "WatchTimeout", "kind": "class", ... |
101735230_1 | class CommunicationsMediatorImpl implements CommunicationsMediator {
@Override
public void transmitData(String data, Direction direction) {
for (DataReceiver dataReceiver : this.subscribers.get(direction)) {
dataReceiver.dataReceived(data);
}
}
public CommunicationsMediato... | final int[] called = new int[1];
called[0] = 0;
DataReceiver receiver1 = new DataReceiver() {
int[] call = called;
@Override
public void dataReceived(String data) {
call[0]++;
}
};
DataReceiver receiver2 = new Data... | [FOCAL] @Override public void CommunicationsMediatorImpl.transmitData(String data, Direction direction)
[CLASS] class CommunicationsMediatorImpl implements CommunicationsMediator
[METRICS] loc=6 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] this.subscribers.get/1, DataReceiver.dataReceived/1
[FI... | /* static context
[FOCAL] @Override public void CommunicationsMediatorImpl.transmitData(String data, Direction direction)
[PATH1] foreach(DataReceiver dataReceiver : this.subscribers.get(direction))=T -> exit loop
[PATH2] foreach(DataReceiver dataReceiver : this.subscribers.get(direction))=F
[INPUTS] branches=direction... | /* static context
[FOCAL] @Override public void CommunicationsMediatorImpl.transmitData(String data, Direction direction)
[PATH1] foreach(DataReceiver dataReceiver : this.subscribers.get(direction))=T -> exit loop
[PATH2] foreach(DataReceiver dataReceiver : this.subscribers.get(direction))=F
[INPUTS] branches=direction... | true | ok | {"focal": {"class": "CommunicationsMediatorImpl", "name": "transmitData", "signature": "void transmitData(String data, Direction direction)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "data", "type": "String"}, {"name": "direction", "type": "Direction"}], "return_type": "void"}, "class_info"... |
101884957_6 | class NotHerePresenter implements NotHereFragmentContract.Presenter {
@Override
public void onItemClicked(int i) {
ArrayList<OsmObject> intentList = new ArrayList<>();
intentList.add(0, this.alternateList.get(i));
PoiList.getInstance().setPoiList(intentList);
view.startActivity();
}
NotHerePresenter(Not... | notHerePresenter.onItemClicked(0);
verify(view).startActivity();
}
} | [FOCAL] @Override public void NotHerePresenter.onItemClicked(int i)
[CLASS] class NotHerePresenter implements NotHereFragmentContract.Presenter
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] ArrayList<OsmObject>.add/2, this.alternateList.get/1, PoiList.getInstance().setPoiList/1, ... | /* static context
[FOCAL] @Override public void NotHerePresenter.onItemClicked(int i)
[COLLABORATORS] field alternateList get/1; field view:NotHereFragmentContract.View startActivity/0
[FIELDS] read=alternateList, view:NotHereFragmentContract.View
[NEW] ArrayList<>
[CALLS-EXTERNAL] ArrayList<OsmObject>.add/2, this.alte... | /* static context
[FOCAL] @Override public void NotHerePresenter.onItemClicked(int i)
[COLLABORATORS] field alternateList get/1; field view:NotHereFragmentContract.View startActivity/0
[FIELDS] read=alternateList, view:NotHereFragmentContract.View
[NEW] ArrayList<>
[CALLS-EXTERNAL] ArrayList<OsmObject>.add/2, this.alte... | true | ok | {"focal": {"class": "NotHerePresenter", "name": "onItemClicked", "signature": "void onItemClicked(int i)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "i", "type": "int"}], "return_type": "void"}, "class_info": {"name": "NotHerePresenter", "kind": "class", "modifiers": "", "superclass": null, ... |
101970978_0 | class AbstractClient {
protected static void init() {
keywordSet.add("-" + HOST_ARGS);
keywordSet.add("-" + HELP_ARGS);
keywordSet.add("-" + PORT_ARGS);
keywordSet.add("-" + PASSWORD_ARGS);
keywordSet.add("-" + USERNAME_ARGS);
keywordSet.add("-" + ISO8601_ARGS);
keywordSet.add("-" + MAX_P... | AbstractClient.init();
String[] keywords = {AbstractClient.HOST_ARGS, AbstractClient.HELP_ARGS,
AbstractClient.PORT_ARGS,
AbstractClient.PASSWORD_ARGS, AbstractClient.USERNAME_ARGS, AbstractClient.ISO8601_ARGS,
AbstractClient.MAX_PRINT_ROW_COUNT_ARGS,};
for (String keyword : keywords... | [FOCAL] protected static void AbstractClient.init()
[CLASS] class AbstractClient
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] keywordSet.add/1
[COLLABORATORS] field keywordSet add/1
[CLASS-MEMBERS] void output(ResultSet res, boolean printToConsole, String statement, ZoneId zoneI... | /* static context
[FOCAL] protected static void AbstractClient.init()
[COLLABORATORS] field keywordSet add/1
[CALLS-EXTERNAL] keywordSet.add/1
*/
| /* static context
[FOCAL] protected static void AbstractClient.init()
[COLLABORATORS] field keywordSet add/1
[CALLS-EXTERNAL] keywordSet.add/1
*/
class AbstractClient {
protected static void init() {
keywordSet.add("-" + HOST_ARGS);
keywordSet.add("-" + HELP_ARGS);
keywordSet.add("-" + PORT_ARGS);
ke... | true | ok | {"focal": {"class": "AbstractClient", "name": "init", "signature": "void init()", "start_line": 3, "modifiers": "protected static", "params": [], "return_type": "void"}, "class_info": {"name": "AbstractClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "connection", "... |
101989943_11 | class IconHelper {
public static BufferedImage fillBackground(BufferedImage img, Color color) {
BufferedImage nImg = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());
Graphics2D g = nImg.createGraphics();
g.setColor(color);
g.fillRect(0, 0, nImg.getWidth(), nImg.getHeight());
g.drawImage(im... | assertTrue(IconHelper.fillBackground(IconHelper.createColoredFrame(Color.GREEN).image, Color.GREEN) instanceof BufferedImage);
}
} | [FOCAL] public static BufferedImage IconHelper.fillBackground(BufferedImage img, Color color)
[CLASS] class IconHelper
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] BufferedImage.getWidth/0, BufferedImage.getHeight/0, BufferedImage.getType/0, BufferedImage.createGraphics/0, Graph... | /* static context
[FOCAL] public static BufferedImage IconHelper.fillBackground(BufferedImage img, Color color)
[INPUTS] branches=- | result=img
[COLLABORATORS] param img:BufferedImage getWidth/0,getHeight/0,getType/0
[NEW] BufferedImage
[CALLS-EXTERNAL] BufferedImage.getWidth/0, BufferedImage.getHeight/0, BufferedImag... | /* static context
[FOCAL] public static BufferedImage IconHelper.fillBackground(BufferedImage img, Color color)
[INPUTS] branches=- | result=img
[COLLABORATORS] param img:BufferedImage getWidth/0,getHeight/0,getType/0
[NEW] BufferedImage
[CALLS-EXTERNAL] BufferedImage.getWidth/0, BufferedImage.getHeight/0, BufferedImag... | true | ok | {"focal": {"class": "IconHelper", "name": "fillBackground", "signature": "BufferedImage fillBackground(BufferedImage img, Color color)", "start_line": 3, "modifiers": "public static", "params": [{"name": "img", "type": "BufferedImage"}, {"name": "color", "type": "Color"}], "return_type": "BufferedImage"}, "class_info":... |
102026692_2 | class EtcdHeartbeatLease implements AutoCloseable {
public Long getLeaseId() {
initLease();
return leaseId;
}
public EtcdHeartbeatLease(Client etcdClient, HeartbeatProperties properties);
public void initLease();
public void revoke();
@Override public void close();
priva... | Client client = Client.builder()
.endpoints(container.clientEndpoint())
.build();
HeartbeatProperties heartbeatProperties = new HeartbeatProperties();
heartbeatProperties.setInterval(5);
EtcdHeartbeatLease heartbeatLease = new EtcdHeartbeatLease(client, he... | [FOCAL] public Long EtcdHeartbeatLease.getLeaseId()
[CLASS] class EtcdHeartbeatLease implements AutoCloseable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] void initLease()
[CLASS-MEMBERS] EtcdHeartbeatLease(Client etcdClient, HeartbeatProperties properties); void initLease(); vo... | /* static context
[FOCAL] public Long EtcdHeartbeatLease.getLeaseId()
[CALLS-INTERNAL] void initLease()
*/
| /* static context
[FOCAL] public Long EtcdHeartbeatLease.getLeaseId()
[CALLS-INTERNAL] void initLease()
*/
class EtcdHeartbeatLease implements AutoCloseable {
public Long getLeaseId() {
initLease();
return leaseId;
}
public EtcdHeartbeatLease(Client etcdClient, HeartbeatProperties propert... | true | ok | {"focal": {"class": "EtcdHeartbeatLease", "name": "getLeaseId", "signature": "Long getLeaseId()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Long"}, "class_info": {"name": "EtcdHeartbeatLease", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "AutoCloseable", "fields": [{"n... |
102047648_0 | class Counter extends Applet {
private void getBalance(APDU apdu, byte[] buffer) {
Util.setShort(buffer, (byte) 0, balance);
apdu.setOutgoingAndSend((byte) 0, (byte) 2);
}
private Counter();
public static void install(byte[] buffer, short offset, byte length);
public void process... | assertArrayEquals(new byte[]{0x00, 0x00}, getBalance().getData());
}
} | [FOCAL] private void Counter.getBalance(APDU apdu, byte[] buffer)
[CLASS] class Counter extends Applet
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Util.setShort/3, APDU.setOutgoingAndSend/2
[COLLABORATORS] param apdu:APDU setOutgoingAndSend/2
[DATAFLOW] apdu@param->L3; buffer@p... | /* static context
[FOCAL] private void Counter.getBalance(APDU apdu, byte[] buffer)
[COLLABORATORS] param apdu:APDU setOutgoingAndSend/2
[CALLS-EXTERNAL] Util.setShort/3, APDU.setOutgoingAndSend/2
*/
| /* static context
[FOCAL] private void Counter.getBalance(APDU apdu, byte[] buffer)
[COLLABORATORS] param apdu:APDU setOutgoingAndSend/2
[CALLS-EXTERNAL] Util.setShort/3, APDU.setOutgoingAndSend/2
*/
class Counter extends Applet {
private void getBalance(APDU apdu, byte[] buffer) {
Util.setShort(buffer, (b... | true | ok | {"focal": {"class": "Counter", "name": "getBalance", "signature": "void getBalance(APDU apdu, byte[] buffer)", "start_line": 3, "modifiers": "private", "params": [{"name": "apdu", "type": "APDU"}, {"name": "buffer", "type": "byte[]"}], "return_type": "void"}, "class_info": {"name": "Counter", "kind": "class", "modifier... |
102083574_26 | class BrowserBuilder {
static URL findLocalizedResourceURL(String resource, Locale l, IOException[] mal, Class<?> relativeTo) {
URL url = null;
if (l != null) {
url = findResourceURL(resource, "_" + l.getLanguage() + "_" + l.getCountry(), mal, relativeTo);
if (url != null) {... | File zh = new File(dir, "index_zh.html"); zh.createNewFile();
File zhCN = new File(dir, "index_zh_CN.html"); zhCN.createNewFile();
IOException[] mal = { null };
URL url = BrowserBuilder.findLocalizedResourceURL("index.html", Locale.SIMPLIFIED_CHINESE, mal, BrowserBuilder.class);... | [FOCAL] static URL BrowserBuilder.findLocalizedResourceURL(String resource, Locale l, IOException[] mal, Class<?> relativeTo)
[CLASS] class BrowserBuilder
[METRICS] loc=14 cc=4 branches=3 loops=0 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] URL findResourceURL(String resource, String suffix, IOException[] mal, Class<?... | /* static context
[FOCAL] static URL BrowserBuilder.findLocalizedResourceURL(String resource, Locale l, IOException[] mal, Class<?> relativeTo)
[PATH1] if(l != null)=T -> if(url != null)#1=F -> if(url != null)#2=T -> return url
[PATH2] if(l != null)=F -> if(url != null)#2=F -> return findResourceURL(resource, null, mal... | /* static context
[FOCAL] static URL BrowserBuilder.findLocalizedResourceURL(String resource, Locale l, IOException[] mal, Class<?> relativeTo)
[PATH1] if(l != null)=T -> if(url != null)#1=F -> if(url != null)#2=T -> return url
[PATH2] if(l != null)=F -> if(url != null)#2=F -> return findResourceURL(resource, null, mal... | true | ok | {"focal": {"class": "BrowserBuilder", "name": "findLocalizedResourceURL", "signature": "URL findLocalizedResourceURL(String resource, Locale l, IOException[] mal, Class<?> relativeTo)", "start_line": 3, "modifiers": "static", "params": [{"name": "resource", "type": "String"}, {"name": "l", "type": "Locale"}, {"name": "... |
102093756_64 | class EvoSQLRunner implements QueryRunner {
Result convertResult(nl.tudelft.serg.evosql.Result evoSqlResult) {
return new Result(
evoSqlResult.getInputQuery(),
evoSqlResult.getPathResults().stream()
.filter(pr -> pr.getFixture() != null)
... | Result result = new Result("Select * From table", 0);
result.getPathResults().add(buildPathResult(1));
result.getPathResults().add(buildPathResult(2));
EvoSQLRunner evoSQLRunner = new EvoSQLRunner();
nl.tudelft.serg.evosql.brew.data.Result brewResult = evoSQLRunner.convertResult... | [FOCAL] Result EvoSQLRunner.convertResult(nl.tudelft.serg.evosql.Result evoSqlResult)
[CLASS] class EvoSQLRunner implements QueryRunner
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] nl.tudelft.serg.evosql.Result.getInputQuery/0, evoSqlResult.getPathResults().stream() .filter(pr ... | /* static context
[FOCAL] Result EvoSQLRunner.convertResult(nl.tudelft.serg.evosql.Result evoSqlResult)
[INPUTS] branches=- | result=evoSqlResult
[COLLABORATORS] param evoSqlResult:nl.tudelft.serg.evosql.Result getInputQuery/0,getPathResults/0; field pr getFixture/0,isSuccess/0
[NEW] Result
[CALLS-EXTERNAL] nl.tudelft.... | /* static context
[FOCAL] Result EvoSQLRunner.convertResult(nl.tudelft.serg.evosql.Result evoSqlResult)
[INPUTS] branches=- | result=evoSqlResult
[COLLABORATORS] param evoSqlResult:nl.tudelft.serg.evosql.Result getInputQuery/0,getPathResults/0; field pr getFixture/0,isSuccess/0
[NEW] Result
[CALLS-EXTERNAL] nl.tudelft.... | true | ok | {"focal": {"class": "EvoSQLRunner", "name": "convertResult", "signature": "Result convertResult(nl.tudelft.serg.evosql.Result evoSqlResult)", "start_line": 3, "modifiers": "", "params": [{"name": "evoSqlResult", "type": "nl.tudelft.serg.evosql.Result"}], "return_type": "Result"}, "class_info": {"name": "EvoSQLRunner", ... |
102096357_1 | class Vector3D {
public static float scalarMultiply(float[] lhs, float[] rhs) {
return lhs[x]*rhs[x] + lhs[y]*rhs[y] + lhs[z]*rhs[z];
}
public static float[] vectorMultiply(float[] lhs, float[] rhs);
public static float distanceVertices(float[] left, float[] right);
public static float vec... | float vec1[] = {1, 0, 0};
float vec2[] = {0, 1, 0};
float res = Vector3D.scalarMultiply(vec1, vec2);
assertTrue(equal(res, 0));
float v3[] = {5, 0, 0};
float v4[] = {3, -1, 0};
res = Vector3D.scalarMultiply(v3, v4);
assertTrue(equal(res, 15));
}
} | [FOCAL] public static float Vector3D.scalarMultiply(float[] lhs, float[] rhs)
[CLASS] class Vector3D
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=lhs, rhs
[DATAFLOW] lhs@param->L2; rhs@param->L2
[CLASS-MEMBERS] float[] vectorMultiply(float[] lhs, float[] rhs); float ... | /* static context
[FOCAL] public static float Vector3D.scalarMultiply(float[] lhs, float[] rhs)
[INPUTS] branches=- | result=lhs, rhs
*/
| /* static context
[FOCAL] public static float Vector3D.scalarMultiply(float[] lhs, float[] rhs)
[INPUTS] branches=- | result=lhs, rhs
*/
class Vector3D {
public static float scalarMultiply(float[] lhs, float[] rhs) {
return lhs[x]*rhs[x] + lhs[y]*rhs[y] + lhs[z]*rhs[z];
}
public static float[] vec... | true | ok | {"focal": {"class": "Vector3D", "name": "scalarMultiply", "signature": "float scalarMultiply(float[] lhs, float[] rhs)", "start_line": 3, "modifiers": "public static", "params": [{"name": "lhs", "type": "float[]"}, {"name": "rhs", "type": "float[]"}], "return_type": "float"}, "class_info": {"name": "Vector3D", "kind": ... |
102143456_2 | class ProductEventConsumer extends AbstractKafkaConsumer {
@KafkaListener(topics = "${eventing.topic_name}")
public void listen(final ConsumerRecord<String, String> consumerRecord, final Acknowledgment ack) {
super.handleConsumerRecord(consumerRecord, ack);
}
@Inject protected ProductEventCon... | final ProductEventProcessor processor = mockedProcessor(TEMPORARY_ERROR);
productEventConsumer = new ProductEventConsumer(processor, unprocessableEventService);
productEventConsumer.listen(CONSUMER_RECORD,ack);
verify(ack, never()).acknowledge();
verify(processor).processEvent(a... | [FOCAL] @KafkaListener(topics = "${eventing.topic_name}") public void ProductEventConsumer.listen(ConsumerRecord<String, String> consumerRecord, Acknowledgment ack)
[CLASS] class ProductEventConsumer extends AbstractKafkaConsumer
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Abst... | /* static context
[FOCAL] @KafkaListener(topics = "${eventing.topic_name}") public void ProductEventConsumer.listen(ConsumerRecord<String, String> consumerRecord, Acknowledgment ack)
[CALLS-EXTERNAL] AbstractKafkaConsumer.handleConsumerRecord/2
*/
| /* static context
[FOCAL] @KafkaListener(topics = "${eventing.topic_name}") public void ProductEventConsumer.listen(ConsumerRecord<String, String> consumerRecord, Acknowledgment ack)
[CALLS-EXTERNAL] AbstractKafkaConsumer.handleConsumerRecord/2
*/
class ProductEventConsumer extends AbstractKafkaConsumer {
@KafkaLi... | true | ok | {"focal": {"class": "ProductEventConsumer", "name": "listen", "signature": "void listen(ConsumerRecord<String, String> consumerRecord, Acknowledgment ack)", "start_line": 3, "modifiers": "@KafkaListener(topics = \"${eventing.topic_name}\") public", "params": [{"name": "consumerRecord", "type": "ConsumerRecord<String, S... |
102170678_7 | class ApiVerticle extends AbstractVerticle {
private void getProduct(RoutingContext rc) {
String itemId = rc.request().getParam("itemid");
catalogService.getProduct(itemId, ar -> {
if (ar.succeeded()) {
Product product = ar.result();
if (product != null) ... | doAnswer(new Answer<Void>() {
public Void answer(InvocationOnMock invocation){
Handler<AsyncResult<List<Product>>> handler = invocation.getArgument(1);
handler.handle(Future.failedFuture("error"));
return null;
}
}).when(catalogSe... | [FOCAL] private void ApiVerticle.getProduct(RoutingContext rc)
[CLASS] class ApiVerticle extends AbstractVerticle
[METRICS] loc=15 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] rc.request().getParam/1, RoutingContext.request/0, CatalogService.getProduct/2, ar.succeeded/0, ar.result/0, rc.respons... | /* static context
[FOCAL] private void ApiVerticle.getProduct(RoutingContext rc)
[COLLABORATORS] param rc:RoutingContext request/0,response/0,fail/1; field catalogService:CatalogService getProduct/2; field ar succeeded/0,result/0,cause/0
[FIELDS] read=catalogService:CatalogService
[CALLS-EXTERNAL] rc.request().getParam... | /* static context
[FOCAL] private void ApiVerticle.getProduct(RoutingContext rc)
[COLLABORATORS] param rc:RoutingContext request/0,response/0,fail/1; field catalogService:CatalogService getProduct/2; field ar succeeded/0,result/0,cause/0
[FIELDS] read=catalogService:CatalogService
[CALLS-EXTERNAL] rc.request().getParam... | true | ok | {"focal": {"class": "ApiVerticle", "name": "getProduct", "signature": "void getProduct(RoutingContext rc)", "start_line": 3, "modifiers": "private", "params": [{"name": "rc", "type": "RoutingContext"}], "return_type": "void"}, "class_info": {"name": "ApiVerticle", "kind": "class", "modifiers": "", "superclass": "Abstra... |
102229956_2 | class InboxModel implements InteractionContextSink {
public abstract Map<Identifier, InboxTask> getTasks()public abstract Map<Identifier, InboxTask> getTasks();
}
class InboxModelTest {
@Test
public void givenEmptyModelWhenCreatedTaskThenModelHasTask() {
| // Given
InboxModel model = new InMemoryInboxModel();
// When
List<Event> events = new ArrayList<>();
Identifier id = new Identifier(0);
events.add(new CreatedEvent());
InteractionContext context = new InteractionContext("task", -1, new Date(), Collections.<String, String>emptyMap(), new In... | [FOCAL] public abstract Map<Identifier, InboxTask> InboxModel.getTasks()
[CLASS] class InboxModel implements InteractionContextSink
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] Map<Identifier, InboxTask> getTasks()
[TEST] InboxModelTest: @Test public void givenEmptyModelWhenCreat... | /* static context
[FOCAL] public abstract Map<Identifier, InboxTask> InboxModel.getTasks()
*/
| /* static context
[FOCAL] public abstract Map<Identifier, InboxTask> InboxModel.getTasks()
*/
class InboxModel implements InteractionContextSink {
public abstract Map<Identifier, InboxTask> getTasks()public abstract Map<Identifier, InboxTask> getTasks();
}
class InboxModelTest {
@Test
public void givenEmptyMode... | true | partial | {"focal": {"class": "InboxModel", "name": "getTasks", "signature": "Map<Identifier, InboxTask> getTasks()", "start_line": 3, "modifiers": "public abstract", "params": [], "return_type": "Map<Identifier, InboxTask>"}, "class_info": {"name": "InboxModel", "kind": "class", "modifiers": "", "superclass": null, "interfaces"... |
102268868_0 | class Version {
public String toString() {
return mMajor + "." + mMinor + "." + mBuild;
}
public Version(String versionString);
public boolean isEqualTo(Version compareVersion);
public boolean isLowerThan(Version compareVersion);
public boolean ishIGHERThan(Version compareVersion);
... | String testVersion = "7.0.0";
Version version = new Version(testVersion);
assertEquals(version.toString(), testVersion);
}
} | [FOCAL] public String Version.toString()
[CLASS] class Version
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Version(String versionString); boolean isEqualTo(Version compareVersion); boolean isLowerThan(Version compareVersion); boolean ishIGHERThan(Version compareVersion); int get... | /* static context
[FOCAL] public String Version.toString()
*/
| /* static context
[FOCAL] public String Version.toString()
*/
class Version {
public String toString() {
return mMajor + "." + mMinor + "." + mBuild;
}
public Version(String versionString);
public boolean isEqualTo(Version compareVersion);
public boolean isLowerThan(Version compareVersio... | true | ok | {"focal": {"class": "Version", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Version", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Version", "... |
102274375_9 | class JsonBindingExample extends JsonData {
public String annotationPropertiesMapping() {
return JsonbBuilder.create().toJson(magazine);
}
public String serializeBook();
public Book deserializeBook();
public String serializeListOfBooks();
public List<Book> deserializeListOfBooks();
... | JsonBindingExample jsonBindingExample = new JsonBindingExample();
String result = jsonBindingExample.annotationPropertiesMapping();
assertThat(result).isEqualToIgnoringCase(expectedMagazine);
}
} | [FOCAL] public String JsonBindingExample.annotationPropertiesMapping()
[CLASS] class JsonBindingExample extends JsonData
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] JsonbBuilder.create().toJson/1, JsonbBuilder.create/0
[CLASS-MEMBERS] String serializeBook(); Book deserializeBoo... | /* static context
[FOCAL] public String JsonBindingExample.annotationPropertiesMapping()
[CALLS-EXTERNAL] JsonbBuilder.create().toJson/1, JsonbBuilder.create/0
*/
| /* static context
[FOCAL] public String JsonBindingExample.annotationPropertiesMapping()
[CALLS-EXTERNAL] JsonbBuilder.create().toJson/1, JsonbBuilder.create/0
*/
class JsonBindingExample extends JsonData {
public String annotationPropertiesMapping() {
return JsonbBuilder.create().toJson(magazine);
}
... | true | ok | {"focal": {"class": "JsonBindingExample", "name": "annotationPropertiesMapping", "signature": "String annotationPropertiesMapping()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "JsonBindingExample", "kind": "class", "modifiers": "", "superclass": "JsonData", "... |
102328857_0 | class BaseActionImpl {
public BaseActionImpl() {
}
public BaseActionImpl();
public BaseActionImpl(InferenceConfigDefinition kpiDefinition);
protected abstract void execute();
protected String getEsQueryWithDates(JobSchedule schedule, String esQuery);
protected void executeNeo4jGraphQuery();
protected Map<... | assertEquals("AVERAGE",ExecutionActions.AVERAGE.toString());
}
} | [FOCAL] public BaseActionImpl.BaseActionImpl()
[CLASS] class BaseActionImpl
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] BaseActionImpl(); BaseActionImpl(InferenceConfigDefinition kpiDefinition); void execute(); String getEsQueryWithDates(JobSchedule schedule, String esQuery); vo... | /* static context
[FOCAL] public BaseActionImpl.BaseActionImpl()
*/
| /* static context
[FOCAL] public BaseActionImpl.BaseActionImpl()
*/
class BaseActionImpl {
public BaseActionImpl() {
}
public BaseActionImpl();
public BaseActionImpl(InferenceConfigDefinition kpiDefinition);
protected abstract void execute();
protected String getEsQueryWithDates(JobSchedule schedule, String... | true | ok | {"focal": {"class": "BaseActionImpl", "name": "BaseActionImpl", "signature": "BaseActionImpl()", "start_line": 3, "modifiers": "public", "params": [], "return_type": null}, "class_info": {"name": "BaseActionImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "baseActionT... |
102341886_2 | class Reader {
public static void read(Swagger swagger, Set<Class<?>> classes) {
final Reader reader = new Reader(swagger);
for (Class<?> cls : classes) {
final ReaderContext context = new ReaderContext(swagger, cls, cls, "", null, false,
new ArrayList<String>(), new ArrayList<String>(), new ArrayList<Str... | @Test
public void testApplyParameters(){
Swagger swagger = new Swagger();
Reader.read(swagger, new HashMap<Class<?>, Object>(){{
put(InterfaceServiceTest.class, new InterfaceServiceImplTest());
}}, "/h");
// System.out.println(Json.pretty(swagger));
Map<String, Path> paths = swagger.getPaths();
Asser... | [FOCAL] public static void Reader.read(Swagger swagger, Set<Class<?>> classes)
[CLASS] class Reader
[METRICS] loc=9 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] Reader.read/1
[NEW] Reader, ReaderContext, ArrayList<String>, ArrayList<Parameter>
[PATH1] foreach(Class<?> cls : classes)=T -> exit l... | /* static context
[FOCAL] public static void Reader.read(Swagger swagger, Set<Class<?>> classes)
[PATH1] foreach(Class<?> cls : classes)=T -> exit loop
[PATH2] foreach(Class<?> cls : classes)=F
[INPUTS] branches=classes | result=-
[NEW] Reader, ReaderContext, ArrayList<String>, ArrayList<Parameter>
[CALLS-EXTERNAL] Rea... | /* static context
[FOCAL] public static void Reader.read(Swagger swagger, Set<Class<?>> classes)
[PATH1] foreach(Class<?> cls : classes)=T -> exit loop
[PATH2] foreach(Class<?> cls : classes)=F
[INPUTS] branches=classes | result=-
[NEW] Reader, ReaderContext, ArrayList<String>, ArrayList<Parameter>
[CALLS-EXTERNAL] Rea... | true | ok | {"focal": {"class": "Reader", "name": "read", "signature": "void read(Swagger swagger, Set<Class<?>> classes)", "start_line": 3, "modifiers": "public static", "params": [{"name": "swagger", "type": "Swagger"}, {"name": "classes", "type": "Set<Class<?>>"}], "return_type": "void"}, "class_info": {"name": "Reader", "kind"... |
102415104_0 | class HomePresenter extends BasePresenter<HomeContract.View> implements HomeContract.Presenter {
@Override
public void fetchUsers() {
if (this.getView() != null) {
this.getView().onLoading(true);
this.addDisposable(mRepository.fetchUsers(this.getView().getPage()).
... | mPresenter.fetchUsers();
verify(mRepository, times(1)).fetchUsers(2);
}
} | [FOCAL] @Override public void HomePresenter.fetchUsers()
[CLASS] class HomePresenter extends BasePresenter<HomeContract.View> implements HomeContract.Presenter
[METRICS] loc=22 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] HomeContract.View getView()
[CALLS-EXTERNAL] this.getView().onLoading/1, ... | /* static context
[FOCAL] @Override public void HomePresenter.fetchUsers()
[PATH1] if(this.getView() != null)=T
[PATH2] if(this.getView() != null)=F
[COLLABORATORS] field mRepository:HomeContract.Repository fetchUsers/1
[CALLS-INTERNAL] HomeContract.View getView()
[FIELDS] read=mRepository:HomeContract.Repository
[CALL... | /* static context
[FOCAL] @Override public void HomePresenter.fetchUsers()
[PATH1] if(this.getView() != null)=T
[PATH2] if(this.getView() != null)=F
[COLLABORATORS] field mRepository:HomeContract.Repository fetchUsers/1
[CALLS-INTERNAL] HomeContract.View getView()
[FIELDS] read=mRepository:HomeContract.Repository
[CALL... | true | ok | {"focal": {"class": "HomePresenter", "name": "fetchUsers", "signature": "void fetchUsers()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "HomePresenter", "kind": "class", "modifiers": "", "superclass": "BasePresenter<HomeContract.View>", "interfaces": "... |
102444259_0 | class WsProducer extends DefaultProducer {
public static void sendMessage(WebSocket webSocket, String msg, boolean streaming) {
if (streaming && msg.length() > STREAM_BUFFER_SIZE) {
int p = 0;
while (p < msg.length()) {
if (msg.length() - p < STREAM_BUFFER_SIZE) {
webSocket.sendCont... | var wsMockHelper = new WebSocketMockHelper();
// var producerMockDefault = getProducerMock(wsMockHelper, false);
// var producerMockStreaming = getProducerMock(wsMockHelper, true);
getTestByteArrayStream().forEach(bytes -> {
try {
WsProducer.sendMessage(wsMockHe... | [FOCAL] public static void WsProducer.sendMessage(WebSocket webSocket, String msg, boolean streaming)
[CLASS] class WsProducer extends DefaultProducer
[METRICS] loc=20 cc=5 branches=3 loops=1 returns=0 throws=0 nesting=4
[CALLS-EXTERNAL] String.length/0, WebSocket.sendContinuationFrame/3, String.substring/1, WebSocket.... | /* static context
[FOCAL] public static void WsProducer.sendMessage(WebSocket webSocket, String msg, boolean streaming)
[PATH1] if(streaming && msg.length() > STREAM_BUFFER_SIZE)=T -> while(p < msg.length())=T -> if(msg.length() - p < STREAM_BUFFER_SIZE)=F -> if(p == 0)=T -> exit loop
[PATH2] if(streaming && msg.length... | /* static context
[FOCAL] public static void WsProducer.sendMessage(WebSocket webSocket, String msg, boolean streaming)
[PATH1] if(streaming && msg.length() > STREAM_BUFFER_SIZE)=T -> while(p < msg.length())=T -> if(msg.length() - p < STREAM_BUFFER_SIZE)=F -> if(p == 0)=T -> exit loop
[PATH2] if(streaming && msg.length... | true | ok | {"focal": {"class": "WsProducer", "name": "sendMessage", "signature": "void sendMessage(WebSocket webSocket, String msg, boolean streaming)", "start_line": 3, "modifiers": "public static", "params": [{"name": "webSocket", "type": "WebSocket"}, {"name": "msg", "type": "String"}, {"name": "streaming", "type": "boolean"}]... |
102452115_247 | class Tileable implements Entity {
public boolean isReleasable(Direction direction, Marble marble) {
if (tile == null) {
throw new IllegalStateException(TILEABLE_UNPLACED);
}
Tile neighbour = tile.get(direction);
return neighbour != null && neighbour.getTileable().accep... | Tileable tileable = grid.get(0, 1).getTileable();
assertThat(tileable.isReleasable(Direction.RIGHT, marble)).isFalse();
}
} | [FOCAL] public boolean Tileable.isReleasable(Direction direction, Marble marble)
[CLASS] class Tileable implements Entity
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] tile.get/1, neighbour.getTileable().accepts/2, Tile.getTileable/0, Direction.inverse/0
[NEW] IllegalStateExcepti... | /* static context
[FOCAL] public boolean Tileable.isReleasable(Direction direction, Marble marble)
[THROWS-WHEN] IllegalStateException when tile == null
[PATH1] if(tile == null)=T -> throw new IllegalStateException(TILEABLE_UNPLACED)
[PATH2] if(tile == null)=F -> return neighbour != null && neighbour.getTileable().acce... | /* static context
[FOCAL] public boolean Tileable.isReleasable(Direction direction, Marble marble)
[THROWS-WHEN] IllegalStateException when tile == null
[PATH1] if(tile == null)=T -> throw new IllegalStateException(TILEABLE_UNPLACED)
[PATH2] if(tile == null)=F -> return neighbour != null && neighbour.getTileable().acce... | true | ok | {"focal": {"class": "Tileable", "name": "isReleasable", "signature": "boolean isReleasable(Direction direction, Marble marble)", "start_line": 3, "modifiers": "public", "params": [{"name": "direction", "type": "Direction"}, {"name": "marble", "type": "Marble"}], "return_type": "boolean"}, "class_info": {"name": "Tileab... |
102471968_31 | class CreditDraftMapper implements Function<CreditDraftRaw, CreditDraft> {
@Override
@SuppressWarnings("ConstantConditions")
public CreditDraft apply(@NonNull final CreditDraftRaw raw) throws Exception {
assertEssentialParams(raw);
return CreditDraft.builder()
.id... | CreditDraftRaw raw = CreditDataTestUtils.creditDraftRawTestBuilder()
.status("UNEXPECTED")
.build();
CreditDraft draft = mapper.apply(raw);
assertThat(draft.status()).isEqualTo(CreditDraftStatus.UNE... | [FOCAL] @Override @SuppressWarnings("ConstantConditions") public CreditDraft CreditDraftMapper.apply(CreditDraftRaw raw)
[CLASS] class CreditDraftMapper implements Function<CreditDraftRaw, CreditDraft>
[METRICS] loc=15 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] CreditDraftStatus toStatus(Stri... | /* static context
[FOCAL] @Override @SuppressWarnings("ConstantConditions") public CreditDraft CreditDraftMapper.apply(CreditDraftRaw raw)
[INPUTS] branches=- | result=raw
[COLLABORATORS] param raw:CreditDraftRaw id/0,purposeName/0,amount/0,status/0,repaymentInfo/0,imageUrl/0
[EXCEPTIONS] declares Exception
[CALLS-INTE... | /* static context
[FOCAL] @Override @SuppressWarnings("ConstantConditions") public CreditDraft CreditDraftMapper.apply(CreditDraftRaw raw)
[INPUTS] branches=- | result=raw
[COLLABORATORS] param raw:CreditDraftRaw id/0,purposeName/0,amount/0,status/0,repaymentInfo/0,imageUrl/0
[EXCEPTIONS] declares Exception
[CALLS-INTE... | true | ok | {"focal": {"class": "CreditDraftMapper", "name": "apply", "signature": "CreditDraft apply(CreditDraftRaw raw) throws Exception", "start_line": 3, "modifiers": "@Override @SuppressWarnings(\"ConstantConditions\") public", "params": [{"name": "raw", "type": "CreditDraftRaw"}], "return_type": "CreditDraft"}, "class_info":... |
102596286_136 | class PsbAppServiceIdGenerator {
public static Map<String, String> generatePsbAppServiceIdsByAppSvcName(
final String appInstanceName,
final Set<String> appServiceNames,
int psbMaxAppIdLength) {
Map<String, String> psbAppServiceIds =
new HashMap<>(appServ... | Map<String, String> ret = PsbAppServiceIdGenerator.generatePsbAppServiceIdsByAppSvcName(
"cool app",
new HashSet<>(
Arrays.asList("svc a", "svc b", "svc c")),
12 + 11
);
ret.values().forEach(s -> Assert.assertTrue(s + " too... | [FOCAL] public static Map<String, String> PsbAppServiceIdGenerator.generatePsbAppServiceIdsByAppSvcName(String appInstanceName, Set<String> appServiceNames, int psbMaxAppIdLength)
[CLASS] class PsbAppServiceIdGenerator
[METRICS] loc=83 cc=7 branches=4 loops=2 returns=1 throws=0 nesting=4
[CALLS-INTERNAL] String encodeN... | /* static context
[FOCAL] public static Map<String, String> PsbAppServiceIdGenerator.generatePsbAppServiceIdsByAppSvcName(String appInstanceName, Set<String> appServiceNames, int psbMaxAppIdLength)
[PATH1] if(timeSuffix.length() > 11)=T -> foreach(String currAppServiceName : appServiceNames)=T -> if(appInstanceNameLeng... | /* static context
[FOCAL] public static Map<String, String> PsbAppServiceIdGenerator.generatePsbAppServiceIdsByAppSvcName(String appInstanceName, Set<String> appServiceNames, int psbMaxAppIdLength)
[PATH1] if(timeSuffix.length() > 11)=T -> foreach(String currAppServiceName : appServiceNames)=T -> if(appInstanceNameLeng... | true | ok | {"focal": {"class": "PsbAppServiceIdGenerator", "name": "generatePsbAppServiceIdsByAppSvcName", "signature": "Map<String, String> generatePsbAppServiceIdsByAppSvcName(String appInstanceName, Set<String> appServiceNames, int psbMaxAppIdLength)", "start_line": 3, "modifiers": "public static", "params": [{"name": "appInst... |
102608940_2 | class PortfolioServiceImpl implements PortfolioService {
@Override
public void buy(int amount, JsonObject quote, Handler<AsyncResult<Portfolio>> resultHandler) {
if (amount <= 0) {
resultHandler.handle(Future.failedFuture("Cannot buy " + quote.getString("name") + " - the amount must be " +
... | Async async = tc.async();
service.buy(100, quote("A", 10, 20, 10), ar -> {
tc.assertTrue(ar.failed());
tc.assertTrue(ar.cause().getMessage().contains("not enough stocks"));
async.complete();
});
}
} | [FOCAL] @Override public void PortfolioServiceImpl.buy(int amount, JsonObject quote, Handler<AsyncResult<Portfolio>> resultHandler)
[CLASS] class PortfolioServiceImpl implements PortfolioService
[METRICS] loc=30 cc=4 branches=3 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] void sendActionOnTheEventBus(String ac... | /* static context
[FOCAL] @Override public void PortfolioServiceImpl.buy(int amount, JsonObject quote, Handler<AsyncResult<Portfolio>> resultHandler)
[PATH1] if(amount <= 0)=F -> if(quote.getInteger("shares") < amount)=T -> return
[PATH2] if(amount <= 0)=F -> if(quote.getInteger("shares") < amount)=F -> if(portfolio.ge... | /* static context
[FOCAL] @Override public void PortfolioServiceImpl.buy(int amount, JsonObject quote, Handler<AsyncResult<Portfolio>> resultHandler)
[PATH1] if(amount <= 0)=F -> if(quote.getInteger("shares") < amount)=T -> return
[PATH2] if(amount <= 0)=F -> if(quote.getInteger("shares") < amount)=F -> if(portfolio.ge... | true | ok | {"focal": {"class": "PortfolioServiceImpl", "name": "buy", "signature": "void buy(int amount, JsonObject quote, Handler<AsyncResult<Portfolio>> resultHandler)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "amount", "type": "int"}, {"name": "quote", "type": "JsonObject"}, {"name": "resultHandle... |
102874275_21 | class ShaclSailFactory implements SailFactory {
@Override
public Sail getSail(SailImplConfig config) throws SailConfigException {
if (!SAIL_TYPE.equals(config.getType())) {
throw new SailConfigException("Invalid Sail type: " + config.getType());
}
ShaclSail sail = new ShaclSail();
if (config instanceof ... | ShaclSailConfig config = new ShaclSailConfig();
ShaclSail sail = (ShaclSail) subject.getSail(config);
assertMatchesConfig(sail, config);
}
} | [FOCAL] @Override public Sail ShaclSailFactory.getSail(SailImplConfig config)
[CLASS] class ShaclSailFactory implements SailFactory
[METRICS] loc=32 cc=4 branches=3 loops=0 returns=1 throws=1 nesting=2
[CALLS-EXTERNAL] SAIL_TYPE.equals/1, SailImplConfig.getType/0, ShaclSailConfig.isValidationEnabled/0, ShaclSail.enable... | /* static context
[FOCAL] @Override public Sail ShaclSailFactory.getSail(SailImplConfig config)
[THROWS-WHEN] SailConfigException when !SAIL_TYPE.equals(config.getType())
[PATH1] if(!SAIL_TYPE.equals(config.getType()))=F -> if(config instanceof ShaclSailConfig)=T -> if(shaclSailConfig.isValidationEnabled())=T -> return... | /* static context
[FOCAL] @Override public Sail ShaclSailFactory.getSail(SailImplConfig config)
[THROWS-WHEN] SailConfigException when !SAIL_TYPE.equals(config.getType())
[PATH1] if(!SAIL_TYPE.equals(config.getType()))=F -> if(config instanceof ShaclSailConfig)=T -> if(shaclSailConfig.isValidationEnabled())=T -> return... | true | ok | {"focal": {"class": "ShaclSailFactory", "name": "getSail", "signature": "Sail getSail(SailImplConfig config) throws SailConfigException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "config", "type": "SailImplConfig"}], "return_type": "Sail"}, "class_info": {"name": "ShaclSailFactory", "kind":... |
102874374_19 | class Federate extends ConsoleCommand {
@Override
public void execute(String... parameters) throws IOException {
if (parameters.length < 4) {
consoleIO.writeln(getHelpLong());
} else {
LinkedList<String> plist = new LinkedList<>(Arrays.asList(parameters));
plist.remove(); // "federate"
boolean distin... | execute(MEMORY_MEMBER_ID1, FED_ID, MEMORY_MEMBER_ID2);
verifyFailure(MEMORY_MEMBER_ID1 + " already exists.");
}
} | [FOCAL] @Override public void Federate.execute(String... parameters)
[CLASS] class Federate extends ConsoleCommand
[METRICS] loc=18 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] String getHelpLong(); boolean distinctValues(Deque<String> plist); boolean getOptionalParamValue(Deque<String> paramet... | /* static context
[FOCAL] @Override public void Federate.execute(String... parameters)
[PATH1] if(parameters.length < 4)=F -> if(distinctValues(plist))=T
[PATH2] if(parameters.length < 4)=T
[PATH3] if(parameters.length < 4)=F -> if(distinctValues(plist))=F
[INPUTS] branches=parameters | result=-
[COLLABORATORS] field c... | /* static context
[FOCAL] @Override public void Federate.execute(String... parameters)
[PATH1] if(parameters.length < 4)=F -> if(distinctValues(plist))=T
[PATH2] if(parameters.length < 4)=T
[PATH3] if(parameters.length < 4)=F -> if(distinctValues(plist))=F
[INPUTS] branches=parameters | result=-
[COLLABORATORS] field c... | true | ok | {"focal": {"class": "Federate", "name": "execute", "signature": "void execute(String... parameters) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "parameters", "type": "String..."}], "return_type": "void"}, "class_info": {"name": "Federate", "kind": "class", "modifiers": "",... |
102955709_23 | class AsperaFaspManagerWrapper {
public long startTransfer(final String xferId, final String transferSpecStr) {
log.info("Starting transfer with xferId [" + xferId + "]");
if (log.isDebugEnabled()) {
log.debug("Transfer Spec for Session with xferId [" + xferId + "]");
log.debug(AsperaTransferManagerUti... |
PowerMockito
.when(
TransferListener.getInstance(null, null)
).thenReturn(mockTransferListener);
PowerMockito
.when(
faspmanager2.startTransfer(anyString(), isNull(String.class), anyString(), any(TransferListener.class))
).thenReturn(3L);
when(mockLog.isDebugEnabled()).thenReturn(false)... | [FOCAL] public long AsperaFaspManagerWrapper.startTransfer(String xferId, String transferSpecStr)
[CLASS] class AsperaFaspManagerWrapper
[METRICS] loc=15 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] log.info/1, log.isDebugEnabled/0, log.debug/1, AsperaTransferManagerUtils.getRedactedJsonString/... | /* static context
[FOCAL] public long AsperaFaspManagerWrapper.startTransfer(String xferId, String transferSpecStr)
[PATH1] if(log.isDebugEnabled())=T -> return rtn
[PATH2] if(log.isDebugEnabled())=F -> return rtn
[INPUTS] branches=- | result=transferSpecStr, xferId
[COLLABORATORS] field faspmanager2 startTransfer/4; f... | /* static context
[FOCAL] public long AsperaFaspManagerWrapper.startTransfer(String xferId, String transferSpecStr)
[PATH1] if(log.isDebugEnabled())=T -> return rtn
[PATH2] if(log.isDebugEnabled())=F -> return rtn
[INPUTS] branches=- | result=transferSpecStr, xferId
[COLLABORATORS] field faspmanager2 startTransfer/4; f... | true | ok | {"focal": {"class": "AsperaFaspManagerWrapper", "name": "startTransfer", "signature": "long startTransfer(String xferId, String transferSpecStr)", "start_line": 3, "modifiers": "public", "params": [{"name": "xferId", "type": "String"}, {"name": "transferSpecStr", "type": "String"}], "return_type": "long"}, "class_info"... |
102960162_2 | class RouteSimilarity {
public String getRouteString() {
return routeString;
}
public RouteSimilarity(RouteData routeData, String currentRoute);
public RouteSimilarity(String url, String currentRouteParts);
private int calculateSimilarity(String url, String currentRoute);
public Rou... | String[] urls = new String[]{
"navigation/view2",
"navigation2/view1",
"navigation/view1",
"navigation/view4",
"navigation/view5",
"navigation/view6",
"navigation/view7",
"navigation/v... | [FOCAL] public String RouteSimilarity.getRouteString()
[CLASS] class RouteSimilarity
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] RouteSimilarity(RouteData routeData, String currentRoute); RouteSimilarity(String url, String currentRouteParts); int calculateSimilarity(String url, ... | /* static context
[FOCAL] public String RouteSimilarity.getRouteString()
*/
| /* static context
[FOCAL] public String RouteSimilarity.getRouteString()
*/
class RouteSimilarity {
public String getRouteString() {
return routeString;
}
public RouteSimilarity(RouteData routeData, String currentRoute);
public RouteSimilarity(String url, String currentRouteParts);
priv... | true | ok | {"focal": {"class": "RouteSimilarity", "name": "getRouteString", "signature": "String getRouteString()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "RouteSimilarity", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "memb... |
103009179_4 | class SmartOpenIdController extends DelegateController implements Serializable {
@Override
public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) {
final String openIdMode = request.getParameter(OpenIdConstants.OPENID_MODE);
if (StringUtils.equals(openIdM... | request.addParameter("openid.mode", "associate");
final boolean canHandle = smartOpenIdController.canHandle(request, response);
request.removeParameter("openid.mode");
assertEquals(true, canHandle);
}
} | [FOCAL] @Override public boolean SmartOpenIdController.canHandle(HttpServletRequest request, HttpServletResponse response)
[CLASS] class SmartOpenIdController extends DelegateController implements Serializable
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] HttpServletRequest.getP... | /* static context
[FOCAL] @Override public boolean SmartOpenIdController.canHandle(HttpServletRequest request, HttpServletResponse response)
[PATH1] if(StringUtils.equals(openIdMode, OpenIdConstants.ASSOCIATE))=T -> return true
[PATH2] if(StringUtils.equals(openIdMode, OpenIdConstants.ASSOCIATE))=F -> return false
[INP... | /* static context
[FOCAL] @Override public boolean SmartOpenIdController.canHandle(HttpServletRequest request, HttpServletResponse response)
[PATH1] if(StringUtils.equals(openIdMode, OpenIdConstants.ASSOCIATE))=T -> return true
[PATH2] if(StringUtils.equals(openIdMode, OpenIdConstants.ASSOCIATE))=F -> return false
[INP... | true | ok | {"focal": {"class": "SmartOpenIdController", "name": "canHandle", "signature": "boolean canHandle(HttpServletRequest request, HttpServletResponse response)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "HttpServletRequest"}, {"name": "response", "type": "HttpServletResponse"... |
103023961_0 | class CompositionBundle implements Bundle {
private static Function composition(Context context) {
return args -> {
final Composition composition;
switch (args.length) {
case 0:
composition = new Composition();
break;
... | final var context = new Context();
BundleLoader.loadSingle(context, CompositionBundle.class);
assertThat(context.functions(), hasKey("composition"));
assertThat(context.composition(), nullValue());
assertThat(context.variables(), allOf(
not(hasKey("Width")),
... | [FOCAL] private static Function CompositionBundle.composition(Context context)
[CLASS] class CompositionBundle implements Bundle
[METRICS] loc=40 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] args[0].asDouble/0, args[0].asInt/0, args[1].asInt/0, args[2].asDouble/0, PropertyType.PAINT.<Paint>getF... | /* static context
[FOCAL] private static Function CompositionBundle.composition(Context context)
[INPUTS] branches=- | result=context
[COLLABORATORS] param context:Context composition/1,variables/0
[NEW] Composition
[CALLS-EXTERNAL] args[0].asDouble/0, args[0].asInt/0, args[1].asInt/0, args[2].asDouble/0, PropertyType.... | /* static context
[FOCAL] private static Function CompositionBundle.composition(Context context)
[INPUTS] branches=- | result=context
[COLLABORATORS] param context:Context composition/1,variables/0
[NEW] Composition
[CALLS-EXTERNAL] args[0].asDouble/0, args[0].asInt/0, args[1].asInt/0, args[2].asDouble/0, PropertyType.... | true | ok | {"focal": {"class": "CompositionBundle", "name": "composition", "signature": "Function composition(Context context)", "start_line": 3, "modifiers": "private static", "params": [{"name": "context", "type": "Context"}], "return_type": "Function"}, "class_info": {"name": "CompositionBundle", "kind": "class", "modifiers": ... |
103027757_19 | class ShadowResources {
public String getPackageName() {
if (!TextUtils.isEmpty(mPackageName)) {
return mPackageName;
}
String manifestPath = null;
// AndroidManifest.xml 可能目录(不同gradle版本,不同目录,蛋疼)
List<String> manifestPaths = Arrays.asList(
"buil... | Assert.assertEquals("net.yui", resources.getPackageName());
}
} | [FOCAL] public String ShadowResources.getPackageName()
[CLASS] class ShadowResources
[METRICS] loc=54 cc=5 branches=4 loops=0 returns=3 throws=1 nesting=1
[CALLS-INTERNAL] String findExistPath(List<String> paths); String findPath(String name, String dir)
[CALLS-EXTERNAL] TextUtils.isEmpty/1, Arrays.asList/11, new File(... | /* static context
[FOCAL] public String ShadowResources.getPackageName()
[THROWS-WHEN] RuntimeException when TextUtils.isEmpty(mPackageName) && TextUtils.isEmpty(manifestPath) && TextUtils.isEmpty(manifestPath)
[THROWS-WHEN] RuntimeException when TextUtils.isEmpty(mPackageName) && !TextUtils.isEmpty(manifestPath) && Te... | /* static context
[FOCAL] public String ShadowResources.getPackageName()
[THROWS-WHEN] RuntimeException when TextUtils.isEmpty(mPackageName) && TextUtils.isEmpty(manifestPath) && TextUtils.isEmpty(manifestPath)
[THROWS-WHEN] RuntimeException when TextUtils.isEmpty(mPackageName) && !TextUtils.isEmpty(manifestPath) && Te... | true | ok | {"focal": {"class": "ShadowResources", "name": "getPackageName", "signature": "String getPackageName()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "ShadowResources", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name":... |
103109633_0 | class SpansToDependencyLinks implements Function<Iterable<Span>, Iterable<Dependency>> {
protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) {
String clientService = null;
String serverService = null;
for (Span span: sharedSpans) {
for (KeyValue tag: span.... | SpansToDependencyLinks spansToDependencyLinks = new SpansToDependencyLinks("");
Set<Span> sharedSpans = new HashSet<>();
sharedSpans.add(createSpan("clientName", Tags.SPAN_KIND_CLIENT));
sharedSpans.add(createSpan("serverName", Tags.SPAN_KIND_SERVER));
Optional<Dependency> result... | [FOCAL] protected Optional<Dependency> SpansToDependencyLinks.sharedSpanDependency(Set<Span> sharedSpans)
[CLASS] class SpansToDependencyLinks implements Function<Iterable<Span>, Iterable<Dependency>>
[METRICS] loc=18 cc=6 branches=3 loops=2 returns=2 throws=0 nesting=4
[CALLS-EXTERNAL] Span.getTags/0, Tags.SPAN_KIND_C... | /* static context
[FOCAL] protected Optional<Dependency> SpansToDependencyLinks.sharedSpanDependency(Set<Span> sharedSpans)
[PATH1] foreach(Span span : sharedSpans)=T -> foreach(KeyValue tag : span.getTags())=T -> if(Tags.SPAN_KIND_CLIENT.equals(tag.getValueString()) || Tags.SPAN_KIND_PRODUCER.equals(tag.getValueString... | /* static context
[FOCAL] protected Optional<Dependency> SpansToDependencyLinks.sharedSpanDependency(Set<Span> sharedSpans)
[PATH1] foreach(Span span : sharedSpans)=T -> foreach(KeyValue tag : span.getTags())=T -> if(Tags.SPAN_KIND_CLIENT.equals(tag.getValueString()) || Tags.SPAN_KIND_PRODUCER.equals(tag.getValueString... | true | ok | {"focal": {"class": "SpansToDependencyLinks", "name": "sharedSpanDependency", "signature": "Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans)", "start_line": 3, "modifiers": "protected", "params": [{"name": "sharedSpans", "type": "Set<Span>"}], "return_type": "Optional<Dependency>"}, "class_info": {"name... |
103139287_0 | class HelloWorldController {
@RequestMapping("/")
public String sayHello() {
return "Hello,World!";
}
@PostMapping(value = "/request_param") public String requestParam(@RequestParam(value = "name") String name);
@PostMapping(value = "/request_body") public UserInfo requestBody(@RequestPara... | assertEquals("Hello,World!",new HelloWorldController().sayHello());
}
} | [FOCAL] @RequestMapping("/") public String HelloWorldController.sayHello()
[CLASS] class HelloWorldController
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] String requestParam(String name); UserInfo requestBody(String name, UserInfo info); UserInfo requestBody1(UserInfo info)
[TES... | /* static context
[FOCAL] @RequestMapping("/") public String HelloWorldController.sayHello()
*/
| /* static context
[FOCAL] @RequestMapping("/") public String HelloWorldController.sayHello()
*/
class HelloWorldController {
@RequestMapping("/")
public String sayHello() {
return "Hello,World!";
}
@PostMapping(value = "/request_param") public String requestParam(@RequestParam(value = "name") ... | true | ok | {"focal": {"class": "HelloWorldController", "name": "sayHello", "signature": "String sayHello()", "start_line": 3, "modifiers": "@RequestMapping(\"/\") public", "params": [], "return_type": "String"}, "class_info": {"name": "HelloWorldController", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null... |
103151406_0 | class OpenhabSseConnection extends SseConnection implements SseConnection.ISseDataListener {
@Override
protected String buildUrl() {
return mUrl + "/rest/events?topics=" + buildTopic();
}
OpenhabSseConnection();
void addItemValueListener(IStateUpdateListener l);
public void removeI... | OpenhabSseConnection c = new OpenhabSseConnection();
c.setServerUrl("URL");
c.setItemNames("cmdName");
assertEquals("URL/rest/events?topics=smarthome/items/cmdName/command", c.buildUrl());
c.setItemNames("cmdName","item1", "item2");
assertEquals("URL/rest/events?topics=s... | [FOCAL] @Override protected String OpenhabSseConnection.buildUrl()
[CLASS] class OpenhabSseConnection extends SseConnection implements SseConnection.ISseDataListener
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String buildTopic()
[CLASS-MEMBERS] OpenhabSseConnection(); void add... | /* static context
[FOCAL] @Override protected String OpenhabSseConnection.buildUrl()
[CALLS-INTERNAL] String buildTopic()
*/
| /* static context
[FOCAL] @Override protected String OpenhabSseConnection.buildUrl()
[CALLS-INTERNAL] String buildTopic()
*/
class OpenhabSseConnection extends SseConnection implements SseConnection.ISseDataListener {
@Override
protected String buildUrl() {
return mUrl + "/rest/events?topics=" + buildT... | true | ok | {"focal": {"class": "OpenhabSseConnection", "name": "buildUrl", "signature": "String buildUrl()", "start_line": 3, "modifiers": "@Override protected", "params": [], "return_type": "String"}, "class_info": {"name": "OpenhabSseConnection", "kind": "class", "modifiers": "", "superclass": "SseConnection", "interfaces": "Ss... |
103155862_90 | class JSONIndividualMatrixResponse extends JSONBasedIndividualMatrixResponse {
public List<JSON2DSources> getSources() {
return sources;
}
JSONIndividualMatrixResponse(MatrixResult result, MatrixRequest request);
private Double[][] constructMetric(float[] table, MatrixResult result);
pu... | Assert.assertEquals(3, durationsMatrixResponse.getSources().size());
Assert.assertArrayEquals(new Double[]{8.681495, 49.41461}, durationsMatrixResponse.getSources().get(0).getLocation());
}
} | [FOCAL] public List<JSON2DSources> JSONIndividualMatrixResponse.getSources()
[CLASS] class JSONIndividualMatrixResponse extends JSONBasedIndividualMatrixResponse
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] JSONIndividualMatrixResponse(MatrixResult result, MatrixRequest request);... | /* static context
[FOCAL] public List<JSON2DSources> JSONIndividualMatrixResponse.getSources()
*/
| /* static context
[FOCAL] public List<JSON2DSources> JSONIndividualMatrixResponse.getSources()
*/
class JSONIndividualMatrixResponse extends JSONBasedIndividualMatrixResponse {
public List<JSON2DSources> getSources() {
return sources;
}
JSONIndividualMatrixResponse(MatrixResult result, MatrixReq... | true | ok | {"focal": {"class": "JSONIndividualMatrixResponse", "name": "getSources", "signature": "List<JSON2DSources> getSources()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<JSON2DSources>"}, "class_info": {"name": "JSONIndividualMatrixResponse", "kind": "class", "modifiers": "", "superclass": "... |
103232734_56 | class BundleHelper {
static void putNumberParam(Bundle bundle, String key, String number) {
String[] types = {"int", "long", "double", "float"};
boolean found = false;
for (String type : types) {
try {
if (type.equals("int") && !number.toLowerCase().endsWith("l")... | // Given
Bundle bundle = new Bundle();
String intKey = "int";
String intValue = "3";
String longKey = "long";
String longValue = "8L";
String longKey2 = "long2";
String longValue2 = "" + Long.MAX_VALUE;
String doubleKey = "double";
String d... | [FOCAL] static void BundleHelper.putNumberParam(Bundle bundle, String key, String number)
[CLASS] class BundleHelper
[METRICS] loc=37 cc=9 branches=6 loops=1 returns=0 throws=1 nesting=6
[CALLS-EXTERNAL] String.equals/1, number.toLowerCase().endsWith/1, String.toLowerCase/0, Integer.parseInt/1, Bundle.putInt/2, String.... | /* static context
[FOCAL] static void BundleHelper.putNumberParam(Bundle bundle, String key, String number)
[THROWS-WHEN] IllegalArgumentException when foreach(String type : types)=T && try-body throws && !found
[THROWS-WHEN] IllegalArgumentException when foreach(String type : types)=T && type.equals("int") && !number.... | /* static context
[FOCAL] static void BundleHelper.putNumberParam(Bundle bundle, String key, String number)
[THROWS-WHEN] IllegalArgumentException when foreach(String type : types)=T && try-body throws && !found
[THROWS-WHEN] IllegalArgumentException when foreach(String type : types)=T && type.equals("int") && !number.... | true | ok | {"focal": {"class": "BundleHelper", "name": "putNumberParam", "signature": "void putNumberParam(Bundle bundle, String key, String number)", "start_line": 3, "modifiers": "static", "params": [{"name": "bundle", "type": "Bundle"}, {"name": "key", "type": "String"}, {"name": "number", "type": "String"}], "return_type": "v... |
103259097_1 | class LoginPresenter extends BasePresenter<Contract.View> implements Contract.Presenter {
@Override
public boolean isLogined() {
return KeyManager.getToken() != null;
}
public LoginPresenter(Contract.View view);
@Override public void attachView();
private void init();
@Override p... | KeyManager.clear();
Assert.assertEquals(
false,
presenter.isLogined()
);
}
} | [FOCAL] @Override public boolean LoginPresenter.isLogined()
[CLASS] class LoginPresenter extends BasePresenter<Contract.View> implements Contract.Presenter
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] KeyManager.getToken/0
[CLASS-MEMBERS] LoginPresenter(Contract.View view); void... | /* static context
[FOCAL] @Override public boolean LoginPresenter.isLogined()
[CALLS-EXTERNAL] KeyManager.getToken/0
*/
| /* static context
[FOCAL] @Override public boolean LoginPresenter.isLogined()
[CALLS-EXTERNAL] KeyManager.getToken/0
*/
class LoginPresenter extends BasePresenter<Contract.View> implements Contract.Presenter {
@Override
public boolean isLogined() {
return KeyManager.getToken() != null;
}
publi... | true | ok | {"focal": {"class": "LoginPresenter", "name": "isLogined", "signature": "boolean isLogined()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "LoginPresenter", "kind": "class", "modifiers": "", "superclass": "BasePresenter<Contract.View>", "interfaces":... |
103286363_0 | class ResourceBundleService extends TranslationService {
@Override
public String translate(String key) {
return rb.getString(key);
}
public ResourceBundleService(ResourceBundle rb);
public void changeLocale(ResourceBundle newValue);
private final ResourceBundle rbEN;
private fin... | ResourceBundleService rbs = new ResourceBundleService(rbEN);
Assert.assertEquals("Test Form", rbs.translate("form_title"));
try {
rbs.translate("non_existing");
fail();
} catch (MissingResourceException ignored) {}
}
} | [FOCAL] @Override public String ResourceBundleService.translate(String key)
[CLASS] class ResourceBundleService extends TranslationService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] rb.getString/1
[INPUTS] branches=- | result=key
[COLLABORATORS] field rb getString/1
[DATAFLOW]... | /* static context
[FOCAL] @Override public String ResourceBundleService.translate(String key)
[INPUTS] branches=- | result=key
[COLLABORATORS] field rb getString/1
[CALLS-EXTERNAL] rb.getString/1
*/
| /* static context
[FOCAL] @Override public String ResourceBundleService.translate(String key)
[INPUTS] branches=- | result=key
[COLLABORATORS] field rb getString/1
[CALLS-EXTERNAL] rb.getString/1
*/
class ResourceBundleService extends TranslationService {
@Override
public String translate(String key) {
... | true | ok | {"focal": {"class": "ResourceBundleService", "name": "translate", "signature": "String translate(String key)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ResourceBundleService", "kind": "class", "modifiers": "", "sup... |
103328683_2 | class MessageDecryptVerifier {
public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) {
if (isPartEncryptedOrSigned(part)) {
return part;
}
Part foundPart;
foundPart = findPrimaryPartInAlternative(part);
if (foundPart != nul... | List<Part> outputExtraParts = new ArrayList<>();
BodyPart pgpInlinePart = bodypart("text/plain", PGP_INLINE_DATA);
Message message = messageFromBody(
multipart("mixed",
pgpInlinePart,
bodypart("application/octet-stream")
... | [FOCAL] public static Part MessageDecryptVerifier.findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts)
[CLASS] class MessageDecryptVerifier
[METRICS] loc=19 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1
[CALLS-INTERNAL] Part findPrimaryPartInAlternative(Part part); Part findPrimaryPartInMixed... | /* static context
[FOCAL] public static Part MessageDecryptVerifier.findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts)
[PATH1] if(isPartEncryptedOrSigned(part))=F -> if(foundPart != null)#1=F -> if(foundPart != null)#2=T -> return foundPart
[PATH2] if(isPartEncryptedOrSigned(part))=T -> return par... | /* static context
[FOCAL] public static Part MessageDecryptVerifier.findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts)
[PATH1] if(isPartEncryptedOrSigned(part))=F -> if(foundPart != null)#1=F -> if(foundPart != null)#2=T -> return foundPart
[PATH2] if(isPartEncryptedOrSigned(part))=T -> return par... | true | ok | {"focal": {"class": "MessageDecryptVerifier", "name": "findPrimaryEncryptedOrSignedPart", "signature": "Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts)", "start_line": 3, "modifiers": "public static", "params": [{"name": "part", "type": "Part"}, {"name": "outputExtraParts", "type": "List<P... |
103377081_14 | class StringCalculator {
public int add(String input) {
if ("".equals(input))
return 0;
String delimiter = extractDelimiter(input);
String[] numberArray = extractNumbers(input, delimiter);
return sumNumberArray(numberArray);
}
private String[] extractNumbers(String input, String delimi... |
Assert.assertEquals(3, this.calculator.add("1,2,1001"));
}
} | [FOCAL] public int StringCalculator.add(String input)
[CLASS] class StringCalculator
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] String extractDelimiter(String input); String[] extractNumbers(String input, String delimiter); int sumNumberArray(String[] numbers)
[CALLS-EXTERNAL... | /* static context
[FOCAL] public int StringCalculator.add(String input)
[PATH1] if("".equals(input))=T -> return 0
[PATH2] if("".equals(input))=F -> return sumNumberArray(numberArray)
[INPUTS] branches=input | result=input
[CALLS-INTERNAL] String extractDelimiter(String input); String[] extractNumbers(String input, Str... | /* static context
[FOCAL] public int StringCalculator.add(String input)
[PATH1] if("".equals(input))=T -> return 0
[PATH2] if("".equals(input))=F -> return sumNumberArray(numberArray)
[INPUTS] branches=input | result=input
[CALLS-INTERNAL] String extractDelimiter(String input); String[] extractNumbers(String input, Str... | true | ok | {"focal": {"class": "StringCalculator", "name": "add", "signature": "int add(String input)", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "String"}], "return_type": "int"}, "class_info": {"name": "StringCalculator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null... |
103384901_13 | class DataUtils implements Serializable {
public static List<String> parseStringList(Object object) {
if (object == null) {
return null;
}
return Splitter.onPattern("(?:\r?\n)+")
.splitToList(object.toString())
.stream()
.map(Strin... | assertEquals(Lists.newArrayList("\\?.*$-->>", "a-->>b"),
DataUtils.parseStringList("\\?.*$-->>\na-->>b\r\r\n\n"));
}
} | [FOCAL] public static List<String> DataUtils.parseStringList(Object object)
[CLASS] class DataUtils implements Serializable
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Splitter.onPattern("(?:\r?\n)+") .splitToList(object.toSt....collect/1, Splitter.onPattern("(?:\r?\n)+") .spl... | /* static context
[FOCAL] public static List<String> DataUtils.parseStringList(Object object)
[PATH1] if(object == null)=T -> return null
[PATH2] if(object == null)=F -> return Splitter.onPattern("(?:\r?\n)+") .splitToList(object.toString()) .s...
[INPUTS] branches=object | result=object
[COLLABORATORS] field s isEmpty... | /* static context
[FOCAL] public static List<String> DataUtils.parseStringList(Object object)
[PATH1] if(object == null)=T -> return null
[PATH2] if(object == null)=F -> return Splitter.onPattern("(?:\r?\n)+") .splitToList(object.toString()) .s...
[INPUTS] branches=object | result=object
[COLLABORATORS] field s isEmpty... | true | ok | {"focal": {"class": "DataUtils", "name": "parseStringList", "signature": "List<String> parseStringList(Object object)", "start_line": 3, "modifiers": "public static", "params": [{"name": "object", "type": "Object"}], "return_type": "List<String>"}, "class_info": {"name": "DataUtils", "kind": "class", "modifiers": "", "... |
103464837_5 | class JsonUtil {
public static Map<String, String> getJsonPathsForTemplating(Set<Map.Entry<String, JsonElement>> root) {
Map<String, String> paths = new HashMap<>();
searchJsonForTemplate(root, paths, "$");
return paths;
}
private JsonUtil(/* empty */);
public static boolean ... | String template = "{ \"a\" : { \"b\": \"{{value}}\", \"c\": { \"b\": \"{{value}}\"}}, \"c\": { \"b\": \"{{value}}\"}, \"num\": 343, \"bool\": true}";
JsonObject document = (JsonObject) new JsonParser().parse(template);
Map<String, String> paths = JsonUtil.getJsonPathsForTemplating(document);
... | [FOCAL] public static Map<String, String> JsonUtil.getJsonPathsForTemplating(Set<Map.Entry<String, JsonElement>> root)
[CLASS] class JsonUtil
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] void searchJsonForTemplate(Set<Map.Entry<String, JsonElement>> entries, Map<String, String> ... | /* static context
[FOCAL] public static Map<String, String> JsonUtil.getJsonPathsForTemplating(Set<Map.Entry<String, JsonElement>> root)
[CALLS-INTERNAL] void searchJsonForTemplate(Set<Map.Entry<String, JsonElement>> entries, Map<String, String> paths, String currentPath)
[NEW] HashMap<>
*/
| /* static context
[FOCAL] public static Map<String, String> JsonUtil.getJsonPathsForTemplating(Set<Map.Entry<String, JsonElement>> root)
[CALLS-INTERNAL] void searchJsonForTemplate(Set<Map.Entry<String, JsonElement>> entries, Map<String, String> paths, String currentPath)
[NEW] HashMap<>
*/
class JsonUtil {
public... | true | ok | {"focal": {"class": "JsonUtil", "name": "getJsonPathsForTemplating", "signature": "Map<String, String> getJsonPathsForTemplating(Set<Map.Entry<String, JsonElement>> root)", "start_line": 3, "modifiers": "public static", "params": [{"name": "root", "type": "Set<Map.Entry<String, JsonElement>>"}], "return_type": "Map<Str... |
103522601_0 | class ByteCode {
public static void printOpCode(InstructionHandle insHandle, ConstantPoolGen cpg) {
System.out.print("[" + String.format("%02d", insHandle.getPosition()) + "] ");
printOpCode(insHandle.getInstruction(),cpg);
}
public static void printOpCode(Instruction ins, ConstantPoolGen ... | PrintStream sysOut = mock(PrintStream.class);
System.out.println("Sysout hijack!");
PrintStream oldPrintStream = System.out;
try {
System.setOut(sysOut);
InvokeInstruction ins = mock(InvokeInstruction.class);
ConstantPoolGen cpg = mock(ConstantPoolG... | [FOCAL] public static void ByteCode.printOpCode(InstructionHandle insHandle, ConstantPoolGen cpg)
[CLASS] class ByteCode
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void printOpCode(Instruction ins, ConstantPoolGen cpg)
[CALLS-EXTERNAL] System.out.print/1, String.format/2, Inst... | /* static context
[FOCAL] public static void ByteCode.printOpCode(InstructionHandle insHandle, ConstantPoolGen cpg)
[COLLABORATORS] param insHandle:InstructionHandle getPosition/0,getInstruction/0
[CALLS-INTERNAL] void printOpCode(Instruction ins, ConstantPoolGen cpg)
[CALLS-EXTERNAL] System.out.print/1, String.format/... | /* static context
[FOCAL] public static void ByteCode.printOpCode(InstructionHandle insHandle, ConstantPoolGen cpg)
[COLLABORATORS] param insHandle:InstructionHandle getPosition/0,getInstruction/0
[CALLS-INTERNAL] void printOpCode(Instruction ins, ConstantPoolGen cpg)
[CALLS-EXTERNAL] System.out.print/1, String.format/... | true | ok | {"focal": {"class": "ByteCode", "name": "printOpCode", "signature": "void printOpCode(InstructionHandle insHandle, ConstantPoolGen cpg)", "start_line": 3, "modifiers": "public static", "params": [{"name": "insHandle", "type": "InstructionHandle"}, {"name": "cpg", "type": "ConstantPoolGen"}], "return_type": "void"}, "cl... |
103558693_18 | class CategorySpecifications {
public Specification<Category> byUser(User user) {
return (root, query, criteriaBuilder) -> criteriaBuilder.equal(root.get(Category_.masterCategory).get(MasterCategory_.user), user);
}
@Autowired
private CategorySpecifications testSubject;
@Autowired
priv... | User user = userRepository.save(new User("Bob", "€"));
MasterCategory mcMonthly = masterCategoryRepository.save(new MasterCategory().setName("Monthly").setUser(user));
MasterCategory mcSavings = masterCategoryRepository.save(new MasterCategory().setName("Savings").setUser(user));
catego... | [FOCAL] public Specification<Category> CategorySpecifications.byUser(User user)
[CLASS] class CategorySpecifications
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] criteriaBuilder.equal/2, root.get(Category_.masterCategory).get/1, root.get/1
[INPUTS] branches=- | result=user
[COLL... | /* static context
[FOCAL] public Specification<Category> CategorySpecifications.byUser(User user)
[INPUTS] branches=- | result=user
[COLLABORATORS] field criteriaBuilder equal/2; field root get/1
[CALLS-EXTERNAL] criteriaBuilder.equal/2, root.get(Category_.masterCategory).get/1, root.get/1
*/
| /* static context
[FOCAL] public Specification<Category> CategorySpecifications.byUser(User user)
[INPUTS] branches=- | result=user
[COLLABORATORS] field criteriaBuilder equal/2; field root get/1
[CALLS-EXTERNAL] criteriaBuilder.equal/2, root.get(Category_.masterCategory).get/1, root.get/1
*/
class CategorySpecificatio... | true | ok | {"focal": {"class": "CategorySpecifications", "name": "byUser", "signature": "Specification<Category> byUser(User user)", "start_line": 3, "modifiers": "public", "params": [{"name": "user", "type": "User"}], "return_type": "Specification<Category>"}, "class_info": {"name": "CategorySpecifications", "kind": "class", "mo... |
103560333_112 | class RewardRiskRatioCriterion extends AbstractAnalysisCriterion {
@Override
public boolean betterThan(Num criterionValue1, Num criterionValue2) {
return criterionValue1.isGreaterThan(criterionValue2);
}
@Override public Num calculate(BarSeries series, TradingRecord tradingRecord);
@Overri... | AnalysisCriterion criterion = getCriterion();
assertTrue(criterion.betterThan(numOf(3.5), numOf(2.2)));
assertFalse(criterion.betterThan(numOf(1.5), numOf(2.7)));
}
} | [FOCAL] @Override public boolean RewardRiskRatioCriterion.betterThan(Num criterionValue1, Num criterionValue2)
[CLASS] class RewardRiskRatioCriterion extends AbstractAnalysisCriterion
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Num.isGreaterThan/1
[INPUTS] branches=- | result=c... | /* static context
[FOCAL] @Override public boolean RewardRiskRatioCriterion.betterThan(Num criterionValue1, Num criterionValue2)
[INPUTS] branches=- | result=criterionValue1, criterionValue2
[COLLABORATORS] param criterionValue1:Num isGreaterThan/1
[CALLS-EXTERNAL] Num.isGreaterThan/1
*/
| /* static context
[FOCAL] @Override public boolean RewardRiskRatioCriterion.betterThan(Num criterionValue1, Num criterionValue2)
[INPUTS] branches=- | result=criterionValue1, criterionValue2
[COLLABORATORS] param criterionValue1:Num isGreaterThan/1
[CALLS-EXTERNAL] Num.isGreaterThan/1
*/
class RewardRiskRatioCriterion ... | true | ok | {"focal": {"class": "RewardRiskRatioCriterion", "name": "betterThan", "signature": "boolean betterThan(Num criterionValue1, Num criterionValue2)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "criterionValue1", "type": "Num"}, {"name": "criterionValue2", "type": "Num"}], "return_type": "boolean... |
103613782_3 | class RootController {
@RequestMapping(value = {"/"}, method = RequestMethod.GET)
public String rootRedirect() {
return "index";
}
@Autowired
private TestRestTemplate restTemplate;
@Value("${custom.baseurl}")
private String baseurl;
private static final Logger logger;
}
class... | ResponseEntity<String> result = restTemplate.exchange("/",
HttpMethod.GET, new HttpEntity(null), String.class);
logger.info(result.toString());
assertThat(result.getStatusCode()).isEqualTo(HttpStatus.OK);
}
} | [FOCAL] @RequestMapping(value = {"/"}, method = RequestMethod.GET) public String RootController.rootRedirect()
[CLASS] class RootController
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[TEST] RootControllerTest: @Test public void rootRedirect() throws Exception
[TEST-FIELDS] TestRestTemplate res... | /* static context
[FOCAL] @RequestMapping(value = {"/"}, method = RequestMethod.GET) public String RootController.rootRedirect()
*/
| /* static context
[FOCAL] @RequestMapping(value = {"/"}, method = RequestMethod.GET) public String RootController.rootRedirect()
*/
class RootController {
@RequestMapping(value = {"/"}, method = RequestMethod.GET)
public String rootRedirect() {
return "index";
}
@Autowired
private TestRest... | true | ok | {"focal": {"class": "RootController", "name": "rootRedirect", "signature": "String rootRedirect()", "start_line": 3, "modifiers": "@RequestMapping(value = {\"/\"}, method = RequestMethod.GET) public", "params": [], "return_type": "String"}, "class_info": {"name": "RootController", "kind": "class", "modifiers": "", "sup... |
103630840_15 | class TeamService {
public List<UserTeam> listUserTeamsAgree(Team team) throws ShepherException {
if (team == null) {
throw ShepherException.createIllegalParameterException();
}
return userTeamBiz.listByTeam(team.getId(), Status.AGREE);
}
@Transactional public boolean c... | long teamId = 1;
Team team = teamService.get(teamId);
List<UserTeam> applies = teamService.listUserTeamsAgree(team);
Assert.assertNotNull(applies);
Assert.assertEquals(3, applies.size());
}
} | [FOCAL] public List<UserTeam> TeamService.listUserTeamsAgree(Team team)
[CLASS] class TeamService
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] ShepherException.createIllegalParameterException/0, userTeamBiz.listByTeam/2, Team.getId/0
[EXCEPTIONS] declares ShepherException; throw... | /* static context
[FOCAL] public List<UserTeam> TeamService.listUserTeamsAgree(Team team)
[THROWS-WHEN] ShepherException.createIllegalParameterException() when team == null
[PATH1] if(team == null)=T -> throw ShepherException.createIllegalParameterException()
[PATH2] if(team == null)=F -> return userTeamBiz.listByTeam(... | /* static context
[FOCAL] public List<UserTeam> TeamService.listUserTeamsAgree(Team team)
[THROWS-WHEN] ShepherException.createIllegalParameterException() when team == null
[PATH1] if(team == null)=T -> throw ShepherException.createIllegalParameterException()
[PATH2] if(team == null)=F -> return userTeamBiz.listByTeam(... | true | ok | {"focal": {"class": "TeamService", "name": "listUserTeamsAgree", "signature": "List<UserTeam> listUserTeamsAgree(Team team) throws ShepherException", "start_line": 3, "modifiers": "public", "params": [{"name": "team", "type": "Team"}], "return_type": "List<UserTeam>"}, "class_info": {"name": "TeamService", "kind": "cla... |
103653841_10 | class FsMountPoint implements Serializable, Comparable<FsMountPoint> {
public URI toHierarchicalUri() {
final URI hierarchical = this.hierarchical;
return null != hierarchical
? hierarchical
: (this.hierarchical = uri.isOpaque()
? path.toHierarchi... | for (final String[] params : new String[][] {
{ "foo:bar:baz:/x/bö%20m?plö%20k!/bä%20g?zö%20k!/", "baz:/x/bö%20m/bä%20g?zö%20k" },
{ "foo:bar:baz:/x/bööm?plönk!/bäng?zönk!/", "baz:/x/bööm/bäng?zönk" },
{ "foo:bar:baz:/boom?plonk!/bang?zonk!/", "baz:/boom/bang?zonk" },
... | [FOCAL] public URI FsMountPoint.toHierarchicalUri()
[CLASS] class FsMountPoint implements Serializable, Comparable<FsMountPoint>
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] uri.isOpaque/0, path.toHierarchicalUri/0
[FIELDS] read=hierarchical | write=hierarchical
[COLLABORATORS] ... | /* static context
[FOCAL] public URI FsMountPoint.toHierarchicalUri()
[COLLABORATORS] field uri isOpaque/0; field path toHierarchicalUri/0
[STATE] hierarchical
[FIELDS] read=hierarchical | write=hierarchical
[CALLS-EXTERNAL] uri.isOpaque/0, path.toHierarchicalUri/0
*/
| /* static context
[FOCAL] public URI FsMountPoint.toHierarchicalUri()
[COLLABORATORS] field uri isOpaque/0; field path toHierarchicalUri/0
[STATE] hierarchical
[FIELDS] read=hierarchical | write=hierarchical
[CALLS-EXTERNAL] uri.isOpaque/0, path.toHierarchicalUri/0
*/
class FsMountPoint implements Serializable, Compara... | true | ok | {"focal": {"class": "FsMountPoint", "name": "toHierarchicalUri", "signature": "URI toHierarchicalUri()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "URI"}, "class_info": {"name": "FsMountPoint", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serializable, Comparable<FsMou... |
103700346_53 | class EventRestController {
@ApiOperation(value = "This API returns Latest Events per Scenario present in Elastic Search for given App Name", response = ResponseEntity.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "Returned Latest Events per Scenario for given App Name"),
@ApiResponse(code = 4... | setSecuirtyContext(TEAMNAME, USERNAME);
EventRecorder eventRecorder = createEvent(TEAMNAME);
EventRecorder eventSecondRecorder = createEvent(TEAMNAME);
TeamUser teamUser = createTeamUserObject(USERNAME, TEAMNAME);
List<EventRecorder> events = new ArrayList<>();
events.add(eventRecorder);
events.add(event... | [FOCAL] @ApiOperation(value = "This API returns Latest Events per Scenario present in Elastic Search for given App Name", res... ResponseEntity<Object> EventRestController.listLatestEventsByAppName(HttpServletRequest request, String applicationName)
[CLASS] class EventRestController
[METRICS] loc=24 cc=3 branches=2 loo... | /* static context
[FOCAL] @ApiOperation(value = "This API returns Latest Events per Scenario present in Elastic Search for given App Name", res... ResponseEntity<Object> EventRestController.listLatestEventsByAppName(HttpServletRequest request, String applicationName)
*/
| /* static context
[FOCAL] @ApiOperation(value = "This API returns Latest Events per Scenario present in Elastic Search for given App Name", res... ResponseEntity<Object> EventRestController.listLatestEventsByAppName(HttpServletRequest request, String applicationName)
*/
class EventRestController {
@ApiOperation(value... | true | ok | {"focal": {"class": "EventRestController", "name": "listLatestEventsByAppName", "signature": "ResponseEntity<Object> listLatestEventsByAppName(HttpServletRequest request, String applicationName)", "start_line": 3, "modifiers": "@ApiOperation(value = \"This API returns Latest Events per Scenario present in Elastic Searc... |
103764705_39 | class Primality {
public static boolean isPrime(int x) {
if (x <= 1) {
return false;
}
int i = 2;
while (i <= x && x % i != 0) {
i++;
}
return i == x;
}
}
class PrimalityTest {
@Test
public void checkSomePrimeNumbers() {
| int[] primes = new int[] { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41,
43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109,
113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191,
193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269,
271, 277, 281, 283,... | [FOCAL] public static boolean Primality.isPrime(int x)
[CLASS] class Primality
[METRICS] loc=11 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=1
[PATH1] if(x <= 1)=F -> while(i <= x && x % i != 0)=T -> exit loop -> return i == x
[PATH2] if(x <= 1)=T -> return false
[PATH3] if(x <= 1)=F -> while(i <= x && x % i != 0... | /* static context
[FOCAL] public static boolean Primality.isPrime(int x)
[PATH1] if(x <= 1)=F -> while(i <= x && x % i != 0)=T -> exit loop -> return i == x
[PATH2] if(x <= 1)=T -> return false
[PATH3] if(x <= 1)=F -> while(i <= x && x % i != 0)=F -> return i == x
[INPUTS] branches=x | result=x
*/
| /* static context
[FOCAL] public static boolean Primality.isPrime(int x)
[PATH1] if(x <= 1)=F -> while(i <= x && x % i != 0)=T -> exit loop -> return i == x
[PATH2] if(x <= 1)=T -> return false
[PATH3] if(x <= 1)=F -> while(i <= x && x % i != 0)=F -> return i == x
[INPUTS] branches=x | result=x
*/
class Primality {
... | true | ok | {"focal": {"class": "Primality", "name": "isPrime", "signature": "boolean isPrime(int x)", "start_line": 3, "modifiers": "public static", "params": [{"name": "x", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "Primality", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fi... |
104092353_0 | class TomcatVersionValidator extends ValidatorBase implements IConstants, IConfigKeys {
public static String getTomcatVersion(String serverInfo) {
String result = null;
if (serverInfo != null && !serverInfo.isEmpty()) {
Debug.log("TomcatVersionValidator.getTomcatVersion() - validating... |
Assert.assertEquals(IConstants.TOMCAT_VER_60, TomcatVersionValidator.getTomcatVersion(VMWARE_TOMCAT6_SERVERINFO));
Assert.assertEquals(IConstants.TOMCAT_VER_60, TomcatVersionValidator.getTomcatVersion(WINDOWS_TOMCAT6_SERVERINFO));
Assert.assertEquals(IConstants.TOMCAT_VER_60, TomcatVersionValid... | [FOCAL] public static String TomcatVersionValidator.getTomcatVersion(String serverInfo)
[CLASS] class TomcatVersionValidator extends ValidatorBase implements IConstants, IConfigKeys
[METRICS] loc=40 cc=8 branches=7 loops=0 returns=2 throws=0 nesting=5
[CALLS-EXTERNAL] String.isEmpty/0, Debug.log/1, String.indexOf/1, ST... | /* static context
[FOCAL] public static String TomcatVersionValidator.getTomcatVersion(String serverInfo)
[PATH1] if(serverInfo != null && !serverInfo.isEmpty())=T -> if(currentIndex == -1)=F -> if(endIndex == -1)=T -> if(versionLine.startsWith("6.0"))=F -> if(versionLine.startsWith("7.0"))=F -> if(versionLine.startsWi... | /* static context
[FOCAL] public static String TomcatVersionValidator.getTomcatVersion(String serverInfo)
[PATH1] if(serverInfo != null && !serverInfo.isEmpty())=T -> if(currentIndex == -1)=F -> if(endIndex == -1)=T -> if(versionLine.startsWith("6.0"))=F -> if(versionLine.startsWith("7.0"))=F -> if(versionLine.startsWi... | true | ok | {"focal": {"class": "TomcatVersionValidator", "name": "getTomcatVersion", "signature": "String getTomcatVersion(String serverInfo)", "start_line": 3, "modifiers": "public static", "params": [{"name": "serverInfo", "type": "String"}], "return_type": "String"}, "class_info": {"name": "TomcatVersionValidator", "kind": "cl... |
104094274_11 | class RdfObjectLoader {
public static <T> Set<T>
load(
Function<Model, Set<Resource>> resourceSelector,
Class<T> clazz,
Model model
) {
return load(resourceSelector, clazz, model, m -> m, c -> {}, m -> {});
}
private RdfObjectLoader();
public static Set<T> load(
Function<Model, Set<Resourc... |
Set<Person> people = RdfObjectLoader.load(selectAllResources, Person.class, model);
assertThat("", people, hasSize(8));
}
} | [FOCAL] public static Set<T> RdfObjectLoader.load(Function<Model, Set<Resource>> resourceSelector, Class<T> clazz, Model model)
[CLASS] class RdfObjectLoader
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Set<T> load(Function<Model, Set<Resource>> resourceSelector, Class<T> clazz,... | /* static context
[FOCAL] public static Set<T> RdfObjectLoader.load(Function<Model, Set<Resource>> resourceSelector, Class<T> clazz, Model model)
[INPUTS] branches=- | result=clazz, model, resourceSelector
[CALLS-INTERNAL] Set<T> load(Function<Model, Set<Resource>> resourceSelector, Class<T> clazz, Model model, UnaryOp... | /* static context
[FOCAL] public static Set<T> RdfObjectLoader.load(Function<Model, Set<Resource>> resourceSelector, Class<T> clazz, Model model)
[INPUTS] branches=- | result=clazz, model, resourceSelector
[CALLS-INTERNAL] Set<T> load(Function<Model, Set<Resource>> resourceSelector, Class<T> clazz, Model model, UnaryOp... | true | ok | {"focal": {"class": "RdfObjectLoader", "name": "load", "signature": "Set<T> load(Function<Model, Set<Resource>> resourceSelector, Class<T> clazz, Model model)", "start_line": 3, "modifiers": "public static", "params": [{"name": "resourceSelector", "type": "Function<Model, Set<Resource>>"}, {"name": "clazz", "type": "Cl... |
104249541_2 | class CheckInfo {
@CheckingMethodType
public int getTypeCheck() {
return mTypeCheck;
}
public CheckInfo(@Nullable Boolean state,@CheckingMethodType int typeCheck);
@Nullable public Boolean getState();
public void setState(@Nullable Boolean state);
public void setTypeCheck(int typ... | checkInfo.setTypeCheck(CH_TYPE_HOOKS);
assertEquals(checkInfo.getTypeCheck(), CH_TYPE_HOOKS);
}
} | [FOCAL] @CheckingMethodType public int CheckInfo.getTypeCheck()
[CLASS] class CheckInfo
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] CheckInfo(Boolean state, int typeCheck); Boolean getState(); void setState(Boolean state); void setTypeCheck(int typeCheck); boolean equals(Object ... | /* static context
[FOCAL] @CheckingMethodType public int CheckInfo.getTypeCheck()
*/
| /* static context
[FOCAL] @CheckingMethodType public int CheckInfo.getTypeCheck()
*/
class CheckInfo {
@CheckingMethodType
public int getTypeCheck() {
return mTypeCheck;
}
public CheckInfo(@Nullable Boolean state,@CheckingMethodType int typeCheck);
@Nullable public Boolean getState();
... | true | ok | {"focal": {"class": "CheckInfo", "name": "getTypeCheck", "signature": "int getTypeCheck()", "start_line": 3, "modifiers": "@CheckingMethodType public", "params": [], "return_type": "int"}, "class_info": {"name": "CheckInfo", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "... |
104262301_52 | class JWTService {
public long getRTokenExpirationTime() {
// expiration time should come in seconds, that's why the * 1000 and extra-zeros for 2592000 seconds
return sc.getRTokenExpirationTime() > 0
? (sc.getRTokenExpirationTime() * THOUSAND)
: DEFAULT_REFRESH_TOKEN... | long prev = Long.parseLong(String.valueOf(ReflectionTestUtils.getField(sc, "rTokenExpirationTime")));
final long expTime = -10;
ReflectionTestUtils.setField(sc, "rTokenExpirationTime", expTime);
assertTrue("Expiration time for refresh token must be greater than zero",
jwt... | [FOCAL] public long JWTService.getRTokenExpirationTime()
[CLASS] class JWTService
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] SecurityConst.getRTokenExpirationTime/0
[FIELDS] read=sc:SecurityConst
[INPUTS] branches=- | result=sc
[COLLABORATORS] field sc:SecurityConst getRTokenE... | /* static context
[FOCAL] public long JWTService.getRTokenExpirationTime()
[INPUTS] branches=- | result=sc
[COLLABORATORS] field sc:SecurityConst getRTokenExpirationTime/0
[FIELDS] read=sc:SecurityConst
[CALLS-EXTERNAL] SecurityConst.getRTokenExpirationTime/0
*/
| /* static context
[FOCAL] public long JWTService.getRTokenExpirationTime()
[INPUTS] branches=- | result=sc
[COLLABORATORS] field sc:SecurityConst getRTokenExpirationTime/0
[FIELDS] read=sc:SecurityConst
[CALLS-EXTERNAL] SecurityConst.getRTokenExpirationTime/0
*/
class JWTService {
public long getRTokenExpirationTi... | true | ok | {"focal": {"class": "JWTService", "name": "getRTokenExpirationTime", "signature": "long getRTokenExpirationTime()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "long"}, "class_info": {"name": "JWTService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"na... |
104490112_1 | class ECKeyStore {
public void changePassword(char[] password) throws KeyStoreException {
try {
for (String alias : Collections.list(ks.aliases())) {
Entry entry = ks.getEntry(alias, new PasswordProtection(this.password)); // read
ks.setEntry(alias, entry, new Pa... | ECKeyStore ks = new ECKeyStore();
PrivateKey k1 = PrivateKey.fresh(NetworkType.TESTNET);
// add a key
String alias1 = ks.addKey(k1);
// change password
ks.changePassword("test".toCharArray());
// retrieve the key
PrivateKey k2 = ks.getKey(ECKeyStore.get... | [FOCAL] public void ECKeyStore.changePassword(char[] password)
[CLASS] class ECKeyStore
[METRICS] loc=15 cc=3 branches=0 loops=1 returns=0 throws=1 nesting=2
[CALLS-EXTERNAL] Collections.list/1, ks.aliases/0, ks.getEntry/2, ks.setEntry/3, Arrays.fill/2, Arrays.copyOf/2
[NEW] PasswordProtection, KeyStoreException
[FIELD... | /* static context
[FOCAL] public void ECKeyStore.changePassword(char[] password)
[THROWS-WHEN] KeyStoreException when try-body throws
[PATH1] try-body throws -> throw new KeyStoreException(e)
[PATH2] foreach(String alias : Collections.list(ks.aliases()))=T -> exit loop
[PATH3] foreach(String alias : Collections.list(ks... | /* static context
[FOCAL] public void ECKeyStore.changePassword(char[] password)
[THROWS-WHEN] KeyStoreException when try-body throws
[PATH1] try-body throws -> throw new KeyStoreException(e)
[PATH2] foreach(String alias : Collections.list(ks.aliases()))=T -> exit loop
[PATH3] foreach(String alias : Collections.list(ks... | true | ok | {"focal": {"class": "ECKeyStore", "name": "changePassword", "signature": "void changePassword(char[] password) throws KeyStoreException", "start_line": 3, "modifiers": "public", "params": [{"name": "password", "type": "char[]"}], "return_type": "void"}, "class_info": {"name": "ECKeyStore", "kind": "class", "modifiers":... |
104512497_44 | class DeviceBatteryMetricsCollector extends SystemMetricsCollector<DeviceBatteryMetrics> {
@Override
@ThreadSafe(enableChecks = false)
public boolean getSnapshot(DeviceBatteryMetrics snapshot) {
checkNotNull(snapshot, "Null value passed to getSnapshot!");
snapshot.batteryLevelPct = getBatteryLevel(getBat... | ShadowSystemClock.setElapsedRealtime(5000);
when(mContext.registerReceiver(
Matchers.isNull(BroadcastReceiver.class), Matchers.any(IntentFilter.class)))
.thenReturn(createBatteryIntent(BatteryManager.BATTERY_STATUS_CHARGING, 20, 100));
DeviceBatteryMetrics metrics = new DeviceBatteryMetr... | [FOCAL] @Override @ThreadSafe(enableChecks = false) public boolean DeviceBatteryMetricsCollector.getSnapshot(DeviceBatteryMetrics snapshot)
[CLASS] class DeviceBatteryMetricsCollector extends SystemMetricsCollector<DeviceBatteryMetrics>
[METRICS] loc=17 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERN... | /* static context
[FOCAL] @Override @ThreadSafe(enableChecks = false) public boolean DeviceBatteryMetricsCollector.getSnapshot(DeviceBatteryMetrics snapshot)
[PATH1] if(mIsCurrentlyCharging)=T -> return true
[PATH2] if(mIsCurrentlyCharging)=F -> return true
[CALLS-INTERNAL] Intent getBatteryIntent(); float getBatteryLe... | /* static context
[FOCAL] @Override @ThreadSafe(enableChecks = false) public boolean DeviceBatteryMetricsCollector.getSnapshot(DeviceBatteryMetrics snapshot)
[PATH1] if(mIsCurrentlyCharging)=T -> return true
[PATH2] if(mIsCurrentlyCharging)=F -> return true
[CALLS-INTERNAL] Intent getBatteryIntent(); float getBatteryLe... | true | ok | {"focal": {"class": "DeviceBatteryMetricsCollector", "name": "getSnapshot", "signature": "boolean getSnapshot(DeviceBatteryMetrics snapshot)", "start_line": 3, "modifiers": "@Override @ThreadSafe(enableChecks = false) public", "params": [{"name": "snapshot", "type": "DeviceBatteryMetrics"}], "return_type": "boolean"}, ... |
104516152_0 | class PomHelper {
public static boolean updatePomVersions(List<PomUpdateStatus> pomsToChange, List<DependencyVersionChange> changes) throws IOException {
Map<String, String> propertyChanges = new TreeMap<>();
for (PomUpdateStatus status : pomsToChange) {
status.updateVersions(changes, p... | File outDir = Tests.copyPackageSources(getClass());
LOG.info("Updating poms in " + outDir);
File[] files = outDir.listFiles();
assertNotNull("No output files!", files);
assertTrue("No output files!", files.length > 0);
List<PomUpdateStatus> pomsToChange = new ArrayList... | [FOCAL] public static boolean PomHelper.updatePomVersions(List<PomUpdateStatus> pomsToChange, List<DependencyVersionChange> changes)
[CLASS] class PomHelper
[METRICS] loc=19 cc=6 branches=2 loops=3 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] PomUpdateStatus.updateVersions/2, Map<String, String>.isEmpty/0, PomUpdateSt... | /* static context
[FOCAL] public static boolean PomHelper.updatePomVersions(List<PomUpdateStatus> pomsToChange, List<DependencyVersionChange> changes)
[PATH1] foreach(PomUpdateStatus status : pomsToChange)#1=F -> if(!propertyChanges.isEmpty())=T -> foreach(PomUpdateStatus status : pomsToChange)#2=F -> foreach(PomUpdate... | /* static context
[FOCAL] public static boolean PomHelper.updatePomVersions(List<PomUpdateStatus> pomsToChange, List<DependencyVersionChange> changes)
[PATH1] foreach(PomUpdateStatus status : pomsToChange)#1=F -> if(!propertyChanges.isEmpty())=T -> foreach(PomUpdateStatus status : pomsToChange)#2=F -> foreach(PomUpdate... | true | ok | {"focal": {"class": "PomHelper", "name": "updatePomVersions", "signature": "boolean updatePomVersions(List<PomUpdateStatus> pomsToChange, List<DependencyVersionChange> changes) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "pomsToChange", "type": "List<PomUpdateStatus>"}, {"nam... |
104670115_42 | class CamelSinkFactory implements SinkFactory {
@Override public String name() {
return "camel";
}
@Override public Single<Sink<T>> create(Vertx vertx, String name, Config config);
private Vertx vertx;
}
class CamelSinkFactoryTest {
private Vertx vertx;
@Test
public void testName() {
| CamelSinkFactory factory = new CamelSinkFactory();
assertThat(factory.name()).isEqualTo("camel");
}
} | [FOCAL] @Override public String CamelSinkFactory.name()
[CLASS] class CamelSinkFactory implements SinkFactory
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Single<Sink<T>> create(Vertx vertx, String name, Config config)
[TEST] CamelSinkFactoryTest: @Test public void testName()
[TE... | /* static context
[FOCAL] @Override public String CamelSinkFactory.name()
*/
| /* static context
[FOCAL] @Override public String CamelSinkFactory.name()
*/
class CamelSinkFactory implements SinkFactory {
@Override public String name() {
return "camel";
}
@Override public Single<Sink<T>> create(Vertx vertx, String name, Config config);
private Vertx vertx;
}
class CamelS... | true | ok | {"focal": {"class": "CamelSinkFactory", "name": "name", "signature": "String name()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "CamelSinkFactory", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "SinkFactory", "fields": [{"name"... |
104705553_29 | class ObjectMapperJsonSerializer implements JsonSerializer {
@Override
public <T> T clone(T object) {
if (object instanceof Collection) {
Object firstElement = findFirstNonNullElement((Collection) object);
if (firstElement != null && !(firstElement instanceof Serializable)) {
... | List<NonSerializableObject> original = new ArrayList<>();
original.add(new NonSerializableObject("value"));
List<NonSerializableObject> cloned = serializer.clone(original);
assertEquals(original, cloned);
assertNotSame(original, cloned);
}
} | [FOCAL] @Override public T ObjectMapperJsonSerializer.clone(T object)
[CLASS] class ObjectMapperJsonSerializer implements JsonSerializer
[METRICS] loc=26 cc=6 branches=5 loops=0 returns=3 throws=0 nesting=3
[CALLS-INTERNAL] Map.Entry findFirstNonNullEntry(Map<?, ?> map); Object findFirstNonNullElement(Collection collec... | /* static context
[FOCAL] @Override public T ObjectMapperJsonSerializer.clone(T object)
[PATH1] if(object instanceof Collection)=T -> if(firstElement != null && !(firstElement instanceof Serializable))=F -> if(object instanceof Map)=T -> if(firstEntry != null)=T -> if(!(key instanceof Serializable) || !(value instanceo... | /* static context
[FOCAL] @Override public T ObjectMapperJsonSerializer.clone(T object)
[PATH1] if(object instanceof Collection)=T -> if(firstElement != null && !(firstElement instanceof Serializable))=F -> if(object instanceof Map)=T -> if(firstEntry != null)=T -> if(!(key instanceof Serializable) || !(value instanceo... | true | ok | {"focal": {"class": "ObjectMapperJsonSerializer", "name": "clone", "signature": "T clone(T object)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "object", "type": "T"}], "return_type": "T"}, "class_info": {"name": "ObjectMapperJsonSerializer", "kind": "class", "modifiers": "", "superclass": nu... |
104718236_8 | class DBAuthenticator implements IAuthenticator {
@Override
public synchronized boolean checkValid(String clientId, String username, byte[] password) {
// Check Username / Password in DB using sqlQuery
if (username == null || password == null) {
LOG.info("username or password was nu... | final DBAuthenticator dbAuthenticator = new DBAuthenticator(
ORG_H2_DRIVER,
JDBC_H2_MEM_TEST,
"SELECT PASSWORD FROM ACCOUNT WHERE LOGIN=?",
SHA_256);
assertFalse(dbAuthenticator.checkValid(null, "dbuser2", "password".getBytes()));
}
} | [FOCAL] @Override public synchronized boolean DBAuthenticator.checkValid(String clientId, String username, byte[] password)
[CLASS] class DBAuthenticator implements IAuthenticator
[METRICS] loc=24 cc=4 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] Logger.info/1, this.preparedStatement.setString/2, th... | /* static context
[FOCAL] @Override public synchronized boolean DBAuthenticator.checkValid(String clientId, String username, byte[] password)
[PATH1] if(username == null || password == null)=F -> try-body throws -> return false
[PATH2] if(username == null || password == null)=F -> if(r.next())=T -> return foundPwq.equa... | /* static context
[FOCAL] @Override public synchronized boolean DBAuthenticator.checkValid(String clientId, String username, byte[] password)
[PATH1] if(username == null || password == null)=F -> try-body throws -> return false
[PATH2] if(username == null || password == null)=F -> if(r.next())=T -> return foundPwq.equa... | true | ok | {"focal": {"class": "DBAuthenticator", "name": "checkValid", "signature": "boolean checkValid(String clientId, String username, byte[] password)", "start_line": 3, "modifiers": "@Override public synchronized", "params": [{"name": "clientId", "type": "String"}, {"name": "username", "type": "String"}, {"name": "password"... |
104718330_8 | class SmartOpenIdController extends DelegateController implements Serializable {
@Override
public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) {
String openIdMode = request.getParameter("openid.mode");
if (openIdMode != null && openIdMode.equals("assoc... | request.addParameter("openid.mode", "anythingElse");
boolean canHandle = smartOpenIdController.canHandle(request, response);
request.removeParameter("openid.mode");
assertEquals(false, canHandle);
}
} | [FOCAL] @Override public boolean SmartOpenIdController.canHandle(HttpServletRequest request, HttpServletResponse response)
[CLASS] class SmartOpenIdController extends DelegateController implements Serializable
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] HttpServletRequest.getP... | /* static context
[FOCAL] @Override public boolean SmartOpenIdController.canHandle(HttpServletRequest request, HttpServletResponse response)
[PATH1] if(openIdMode != null && openIdMode.equals("associate"))=T -> return true
[PATH2] if(openIdMode != null && openIdMode.equals("associate"))=F -> return false
[INPUTS] branc... | /* static context
[FOCAL] @Override public boolean SmartOpenIdController.canHandle(HttpServletRequest request, HttpServletResponse response)
[PATH1] if(openIdMode != null && openIdMode.equals("associate"))=T -> return true
[PATH2] if(openIdMode != null && openIdMode.equals("associate"))=F -> return false
[INPUTS] branc... | true | ok | {"focal": {"class": "SmartOpenIdController", "name": "canHandle", "signature": "boolean canHandle(HttpServletRequest request, HttpServletResponse response)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "HttpServletRequest"}, {"name": "response", "type": "HttpServletResponse"... |
104770714_18 | class Properties {
public static <T, P extends ObservableValue<T>> void whenPropertyIsSet(P property, Consumer<T> doWhenSet) {
whenPropertyIsSet(property, () -> doWhenSet.accept(property.getValue()));
}
private Properties();
public static P newPropertyWithCallback(Supplier<P> propertyFactory... | final Property<Object> valuedProp = new SimpleObjectProperty<>(new Object());
final Property<Object> listener = new SimpleObjectProperty<>();
whenPropertyIsSet(valuedProp, listener::setValue);
assertThat(listener.getValue()).isEqualTo(valuedProp.getValue());
}
} | [FOCAL] public static void Properties.whenPropertyIsSet(P property, Consumer<T> doWhenSet)
[CLASS] class Properties
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void whenPropertyIsSet(P property, Runnable doWhenSet)
[CALLS-EXTERNAL] Consumer<T>.accept/1, P.getValue/0
[COLLABORAT... | /* static context
[FOCAL] public static void Properties.whenPropertyIsSet(P property, Consumer<T> doWhenSet)
[COLLABORATORS] param doWhenSet:Consumer<T> accept/1; param property:P getValue/0
[CALLS-INTERNAL] void whenPropertyIsSet(P property, Runnable doWhenSet)
[CALLS-EXTERNAL] Consumer<T>.accept/1, P.getValue/0
*/
| /* static context
[FOCAL] public static void Properties.whenPropertyIsSet(P property, Consumer<T> doWhenSet)
[COLLABORATORS] param doWhenSet:Consumer<T> accept/1; param property:P getValue/0
[CALLS-INTERNAL] void whenPropertyIsSet(P property, Runnable doWhenSet)
[CALLS-EXTERNAL] Consumer<T>.accept/1, P.getValue/0
*/
cl... | true | ok | {"focal": {"class": "Properties", "name": "whenPropertyIsSet", "signature": "void whenPropertyIsSet(P property, Consumer<T> doWhenSet)", "start_line": 3, "modifiers": "public static", "params": [{"name": "property", "type": "P"}, {"name": "doWhenSet", "type": "Consumer<T>"}], "return_type": "void"}, "class_info": {"nam... |
104872758_8 | class SystemPropertyListBuilder {
public String build(String type, String key, String value){
StringBuilder sb = new StringBuilder();
sb.append("-D");
sb.append(type);
sb.append('.');
sb.append(key);
sb.append('=');
sb.append(value);
return sb.toString();
}
private SystemPropertyListBuilder builder... | assertEquals("-Dprefix.key=null",builderToTest.build("prefix", "key",null));
}
} | [FOCAL] public String SystemPropertyListBuilder.build(String type, String key, String value)
[CLASS] class SystemPropertyListBuilder
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] StringBuilder.append/1, StringBuilder.toString/0
[NEW] StringBuilder
[DATAFLOW] key@param->L6; sb@L2... | /* static context
[FOCAL] public String SystemPropertyListBuilder.build(String type, String key, String value)
[NEW] StringBuilder
[CALLS-EXTERNAL] StringBuilder.append/1, StringBuilder.toString/0
*/
| /* static context
[FOCAL] public String SystemPropertyListBuilder.build(String type, String key, String value)
[NEW] StringBuilder
[CALLS-EXTERNAL] StringBuilder.append/1, StringBuilder.toString/0
*/
class SystemPropertyListBuilder {
public String build(String type, String key, String value){
StringBuilder sb = new... | true | ok | {"focal": {"class": "SystemPropertyListBuilder", "name": "build", "signature": "String build(String type, String key, String value)", "start_line": 3, "modifiers": "public", "params": [{"name": "type", "type": "String"}, {"name": "key", "type": "String"}, {"name": "value", "type": "String"}], "return_type": "String"}, ... |
104883492_14 | class SeasonDataJdbcDao extends JdbcDaoSupport implements SeasonDataDao {
@Override
public List<SeasonData> fetchAllByYear(Integer year) {
List<SeasonData> ret = null;
String sql = "SELECT t.* FROM " + TABLE_NAME + " t WHERE t.year = ?";
Object[] args = { year };
// Run the query
ret = get... | log.info("*** BEGIN Test ***");
Integer year = 2017;
List<SeasonData> results = classUnderTest.fetchAllByYear(year);
assertEquals(68, results.size());
log.info("*** END Test ***");
}
} | [FOCAL] @Override public List<SeasonData> SeasonDataJdbcDao.fetchAllByYear(Integer year)
[CLASS] class SeasonDataJdbcDao extends JdbcDaoSupport implements SeasonDataDao
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] getJdbcTemplate().query/3, getJdbcTemplate/0 (inherited)
[NEW] S... | /* static context
[FOCAL] @Override public List<SeasonData> SeasonDataJdbcDao.fetchAllByYear(Integer year)
[INPUTS] branches=- | result=year
[NEW] SeasonDataRowMapper
[CALLS-EXTERNAL] getJdbcTemplate().query/3, getJdbcTemplate/0 (inherited)
*/
| /* static context
[FOCAL] @Override public List<SeasonData> SeasonDataJdbcDao.fetchAllByYear(Integer year)
[INPUTS] branches=- | result=year
[NEW] SeasonDataRowMapper
[CALLS-EXTERNAL] getJdbcTemplate().query/3, getJdbcTemplate/0 (inherited)
*/
class SeasonDataJdbcDao extends JdbcDaoSupport implements SeasonDataDao {
... | true | ok | {"focal": {"class": "SeasonDataJdbcDao", "name": "fetchAllByYear", "signature": "List<SeasonData> fetchAllByYear(Integer year)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "year", "type": "Integer"}], "return_type": "List<SeasonData>"}, "class_info": {"name": "SeasonDataJdbcDao", "kind": "cla... |
104889165_120 | class GbifJsonConverter {
public static String toStringPartialJson(SpecificRecordBase... records) {
return toPartialJson(records).toString();
}
public static ObjectNode toJson(SpecificRecordBase... records);
public static ObjectNode toPartialJson(SpecificRecordBase... records);
public static String toSt... |
// Expected
String expected = "{\"id\":\"777\"}";
// State
MultimediaRecord record = MultimediaRecord.newBuilder().setId("777").build();
// When
String result = GbifJsonConverter.toStringPartialJson(record);
// Should
assertEquals(expected, result);
assertTrue(JsonValidationUtils... | [FOCAL] public static String GbifJsonConverter.toStringPartialJson(SpecificRecordBase... records)
[CLASS] class GbifJsonConverter
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ObjectNode toPartialJson(SpecificRecordBase... records)
[CALLS-EXTERNAL] toPartialJson(records).toString... | /* static context
[FOCAL] public static String GbifJsonConverter.toStringPartialJson(SpecificRecordBase... records)
[INPUTS] branches=- | result=records
[CALLS-INTERNAL] ObjectNode toPartialJson(SpecificRecordBase... records)
[CALLS-EXTERNAL] toPartialJson(records).toString/0
*/
| /* static context
[FOCAL] public static String GbifJsonConverter.toStringPartialJson(SpecificRecordBase... records)
[INPUTS] branches=- | result=records
[CALLS-INTERNAL] ObjectNode toPartialJson(SpecificRecordBase... records)
[CALLS-EXTERNAL] toPartialJson(records).toString/0
*/
class GbifJsonConverter {
public stat... | true | ok | {"focal": {"class": "GbifJsonConverter", "name": "toStringPartialJson", "signature": "String toStringPartialJson(SpecificRecordBase... records)", "start_line": 3, "modifiers": "public static", "params": [{"name": "records", "type": "SpecificRecordBase..."}], "return_type": "String"}, "class_info": {"name": "GbifJsonCon... |
104974693_54 | class SessionService implements IService, IInputTranslator {
public Session open(IOFSwitch sw) {
return open(new MessageContext(), sw);
}
public Session open(MessageContext context, IOFSwitch sw);
@Override public void setup(FloodlightModuleContext moduleContext);
@Override public Command ... | IOFSwitch sw = createMock(IOFSwitch.class);
setupSwitchMock(sw, dpId);
swWriteSecondFail(sw);
doneWithSetUp(sw);
CompletableFuture<Optional<OFMessage>> future = null;
try (Session session = subject.open(context, sw)) {
future = session.write(makePacketOut(sw.... | [FOCAL] public Session SessionService.open(IOFSwitch sw)
[CLASS] class SessionService implements IService, IInputTranslator
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Session open(MessageContext context, IOFSwitch sw)
[NEW] MessageContext
[INPUTS] branches=- | result=sw
[DATAF... | /* static context
[FOCAL] public Session SessionService.open(IOFSwitch sw)
[INPUTS] branches=- | result=sw
[CALLS-INTERNAL] Session open(MessageContext context, IOFSwitch sw)
[NEW] MessageContext
*/
| /* static context
[FOCAL] public Session SessionService.open(IOFSwitch sw)
[INPUTS] branches=- | result=sw
[CALLS-INTERNAL] Session open(MessageContext context, IOFSwitch sw)
[NEW] MessageContext
*/
class SessionService implements IService, IInputTranslator {
public Session open(IOFSwitch sw) {
return open... | true | ok | {"focal": {"class": "SessionService", "name": "open", "signature": "Session open(IOFSwitch sw)", "start_line": 3, "modifiers": "public", "params": [{"name": "sw", "type": "IOFSwitch"}], "return_type": "Session"}, "class_info": {"name": "SessionService", "kind": "class", "modifiers": "", "superclass": null, "interfaces"... |
104984928_109 | class ConnectorsResource {
@POST
@Path("/{connector}/restart")
public void restartConnector(final @PathParam("connector") String connector,
final @QueryParam("forward") Boolean forward) throws Throwable {
FutureCallback<Void> cb = new FutureCallback<>();
her... | final Capture<Callback<Void>> cb = Capture.newInstance();
herder.restartConnector(EasyMock.eq(CONNECTOR_NAME), EasyMock.capture(cb));
String ownerUrl = "http://owner:8083";
expectAndCallbackException(cb, new NotAssignedException("not owner test", ownerUrl));
EasyMock.expect(Rest... | [FOCAL] @POST @Path("/{connector}/restart") public void ConnectorsResource.restartConnector(String connector, Boolean forward)
[CLASS] class ConnectorsResource
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] T completeOrForwardRequest(FutureCallback<T> cb, String path, String metho... | /* static context
[FOCAL] @POST @Path("/{connector}/restart") public void ConnectorsResource.restartConnector(String connector, Boolean forward)
[COLLABORATORS] field herder:Herder restartConnector/2
[EXCEPTIONS] declares Throwable
[CALLS-INTERNAL] T completeOrForwardRequest(FutureCallback<T> cb, String path, String me... | /* static context
[FOCAL] @POST @Path("/{connector}/restart") public void ConnectorsResource.restartConnector(String connector, Boolean forward)
[COLLABORATORS] field herder:Herder restartConnector/2
[EXCEPTIONS] declares Throwable
[CALLS-INTERNAL] T completeOrForwardRequest(FutureCallback<T> cb, String path, String me... | true | ok | {"focal": {"class": "ConnectorsResource", "name": "restartConnector", "signature": "void restartConnector(String connector, Boolean forward) throws Throwable", "start_line": 3, "modifiers": "@POST @Path(\"/{connector}/restart\") public", "params": [{"name": "connector", "type": "String"}, {"name": "forward", "type": "B... |
104999768_0 | class CarManufacturer {
public Car manufactureCar(Specification spec) {
Car car = carFactory.createCar(spec);
entityManager.merge(car);
return car;
}
@InjectMocks
private CarManufacturer testObject;
@Mock
private CarFactory carFactory;
@Mock
private EntityManage... | Specification spec = new Specification();
Car car = new Car(spec);
when(entityManager.merge(any())).then(a -> a.getArgument(0));
when(carFactory.createCar(any())).thenReturn(car);
assertThat(testObject.manufactureCar(spec)).isEqualTo(car);
verify(carFactory).createCar(... | [FOCAL] public Car CarManufacturer.manufactureCar(Specification spec)
[CLASS] class CarManufacturer
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] CarFactory.createCar/1, EntityManager.merge/1
[FIELDS] read=carFactory:CarFactory, entityManager:EntityManager
[INPUTS] branches=- | r... | /* static context
[FOCAL] public Car CarManufacturer.manufactureCar(Specification spec)
[INPUTS] branches=- | result=spec, carFactory
[COLLABORATORS] field carFactory:CarFactory createCar/1; field entityManager:EntityManager merge/1
[FIELDS] read=carFactory:CarFactory, entityManager:EntityManager
[CALLS-EXTERNAL] CarFa... | /* static context
[FOCAL] public Car CarManufacturer.manufactureCar(Specification spec)
[INPUTS] branches=- | result=spec, carFactory
[COLLABORATORS] field carFactory:CarFactory createCar/1; field entityManager:EntityManager merge/1
[FIELDS] read=carFactory:CarFactory, entityManager:EntityManager
[CALLS-EXTERNAL] CarFa... | true | ok | {"focal": {"class": "CarManufacturer", "name": "manufactureCar", "signature": "Car manufactureCar(Specification spec)", "start_line": 3, "modifiers": "public", "params": [{"name": "spec", "type": "Specification"}], "return_type": "Car"}, "class_info": {"name": "CarManufacturer", "kind": "class", "modifiers": "", "super... |
105010160_279 | class Entities {
static String unescape(String string) {
return unescape(string, false);
}
private Entities();
public static boolean isNamedEntity(final String name);
public static boolean isBaseNamedEntity(final String name);
public static Character getCharacterByName(String name);
... | String text = "⨔ 𝔮";
String un = "⨔ \uD835\uDD2E"; // 𝔮
assertEquals(un, Entities.unescape(text));
}
} | [FOCAL] static String Entities.unescape(String string)
[CLASS] class Entities
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String unescape(String string, boolean strict)
[INPUTS] branches=- | result=string
[DATAFLOW] string@param->L2
[CLASS-MEMBERS] Entities(); boolean isNamedEn... | /* static context
[FOCAL] static String Entities.unescape(String string)
[INPUTS] branches=- | result=string
[CALLS-INTERNAL] String unescape(String string, boolean strict)
*/
| /* static context
[FOCAL] static String Entities.unescape(String string)
[INPUTS] branches=- | result=string
[CALLS-INTERNAL] String unescape(String string, boolean strict)
*/
class Entities {
static String unescape(String string) {
return unescape(string, false);
}
private Entities();
publi... | true | ok | {"focal": {"class": "Entities", "name": "unescape", "signature": "String unescape(String string)", "start_line": 3, "modifiers": "static", "params": [{"name": "string", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Entities", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nu... |
105032211_6 | class DefaultProviderDataAccessor implements ProviderDataAccessor {
@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED)
public List<ProviderUserModel> getUsersByProviderConfigId(Long providerConfigId) {
if (null == providerConfigId) {
return List.of();
... | ProviderUserEntity providerUserEntity = new ProviderUserEntity(projectOwnerEmail, true, 1L);
ProviderProjectRepository providerProjectRepository = Mockito.mock(ProviderProjectRepository.class);
ProviderUserRepository providerUserRepository = Mockito.mock(ProviderUserRepository.class);
... | [FOCAL] @Override @Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED) public List<ProviderUserModel> DefaultProviderDataAccessor.getUsersByProviderConfigId(Long providerConfigId)
[CLASS] class DefaultProviderDataAccessor implements ProviderDataAccessor
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=... | /* static context
[FOCAL] @Override @Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED) public List<ProviderUserModel> DefaultProviderDataAccessor.getUsersByProviderConfigId(Long providerConfigId)
[PATH1] if(null == providerConfigId)=T -> return List.of()
[PATH2] if(null == providerConfigId)=F -> retu... | /* static context
[FOCAL] @Override @Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED) public List<ProviderUserModel> DefaultProviderDataAccessor.getUsersByProviderConfigId(Long providerConfigId)
[PATH1] if(null == providerConfigId)=T -> return List.of()
[PATH2] if(null == providerConfigId)=F -> retu... | true | ok | {"focal": {"class": "DefaultProviderDataAccessor", "name": "getUsersByProviderConfigId", "signature": "List<ProviderUserModel> getUsersByProviderConfigId(Long providerConfigId)", "start_line": 3, "modifiers": "@Override @Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED) public", "params": [{"name": "... |
105079548_0 | class linkedList {
public linkedList()
{
start = null;
end = null;
size = 0;
}
public linkedList();
public boolean isEmpty();
public int getSize();
public void insertAtStart(int val);
public void insertAtEnd(int val);
public void insertAtPos(int val , int ... | LinkedList<Integer> intList = new LinkedList<Integer>();
assertTrue(intList.add(1));
assertTrue(intList.add(2));
assertEquals(new Integer(1), intList.head());
assertEquals(new Integer(2), intList.tail());
assertTrue(intList.add(3));
assertEquals(new Integer(3), intList.tail());
assertEquals(3, intList.s... | [FOCAL] public linkedList.linkedList()
[CLASS] class linkedList
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] linkedList(); boolean isEmpty(); int getSize(); void insertAtStart(int val); void insertAtEnd(int val); void insertAtPos(int val, int pos); void deleteAtPos(int pos); void... | /* static context
[FOCAL] public linkedList.linkedList()
*/
| /* static context
[FOCAL] public linkedList.linkedList()
*/
class linkedList {
public linkedList()
{
start = null;
end = null;
size = 0;
}
public linkedList();
public boolean isEmpty();
public int getSize();
public void insertAtStart(int val);
public void inse... | true | ok | {"focal": {"class": "linkedList", "name": "linkedList", "signature": "linkedList()", "start_line": 3, "modifiers": "public", "params": [], "return_type": null}, "class_info": {"name": "linkedList", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "linkedList",... |
105089121_1005 | class Utils {
public static String resolvePassword( VariableSpace variables, String password ) {
String resolvedPassword = variables.environmentSubstitute( password );
if ( resolvedPassword != null ) {
// returns resolved decrypted password
return Encr.decryptPasswordOptionallyEncrypted( resolved... | String password = "password";
// is supposed the password stays the same
assertSame( password, Utils.resolvePassword(
Variables.getADefaultVariableSpace(), password ).intern() );
}
} | [FOCAL] public static String Utils.resolvePassword(VariableSpace variables, String password)
[CLASS] class Utils
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] VariableSpace.environmentSubstitute/1, Encr.decryptPasswordOptionallyEncrypted/1
[PATH1] if(resolvedPassword != null)=T ... | /* static context
[FOCAL] public static String Utils.resolvePassword(VariableSpace variables, String password)
[PATH1] if(resolvedPassword != null)=T -> return Encr.decryptPasswordOptionallyEncrypted( resolvedPassword )
[PATH2] if(resolvedPassword != null)=F -> return resolvedPassword
[INPUTS] branches=password, variab... | /* static context
[FOCAL] public static String Utils.resolvePassword(VariableSpace variables, String password)
[PATH1] if(resolvedPassword != null)=T -> return Encr.decryptPasswordOptionallyEncrypted( resolvedPassword )
[PATH2] if(resolvedPassword != null)=F -> return resolvedPassword
[INPUTS] branches=password, variab... | true | ok | {"focal": {"class": "Utils", "name": "resolvePassword", "signature": "String resolvePassword(VariableSpace variables, String password)", "start_line": 3, "modifiers": "public static", "params": [{"name": "variables", "type": "VariableSpace"}, {"name": "password", "type": "String"}], "return_type": "String"}, "class_inf... |
105094044_21 | class ChainContainer implements Cloneable {
public boolean rollback(Block block) {
int length = chain.getAllBlockList().size();
if (block == null || length == 0) {
return false;
}
Block bestBlock = chain.getBestBlock();
if (!block.getHeader().getHash().equals(bes... | testAddAgent();
assertEquals(chainContainer.getCurrentRound().getMemberCount(), 2);
for (int i = 3; i > 0; i--) {
Block bestBlock = chainContainer.getBestBlock();
boolean success = chainContainer.rollback(bestBlock);
assert (success);
}
assert... | [FOCAL] public boolean ChainContainer.rollback(Block block)
[CLASS] class ChainContainer implements Cloneable
[METRICS] loc=74 cc=16 branches=11 loops=4 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] void addBlockInBlockList(Chain chain)
[CALLS-EXTERNAL] chain.getAllBlockList().size/0, chain.getAllBlockList/0, chain.get... | /* static context
[FOCAL] public boolean ChainContainer.rollback(Block block)
[PATH1] if(block == null || length == 0)=F -> if(!block.getHeader().getHash().equals(bestBlock.getHeader().getHash()))=F -> if(length <= 2)=T -> for(i >= 0)#1=T -> if(agent.getDelHeight() == height)=T -> if(agent.getBlockHeight() == height)=T... | /* static context
[FOCAL] public boolean ChainContainer.rollback(Block block)
[PATH1] if(block == null || length == 0)=F -> if(!block.getHeader().getHash().equals(bestBlock.getHeader().getHash()))=F -> if(length <= 2)=T -> for(i >= 0)#1=T -> if(agent.getDelHeight() == height)=T -> if(agent.getBlockHeight() == height)=T... | true | ok | {"focal": {"class": "ChainContainer", "name": "rollback", "signature": "boolean rollback(Block block)", "start_line": 3, "modifiers": "public", "params": [{"name": "block", "type": "Block"}], "return_type": "boolean"}, "class_info": {"name": "ChainContainer", "kind": "class", "modifiers": "", "superclass": null, "inter... |
105104598_8 | class HumidityNotification implements BluetoothNotification<byte[]> {
@Override
public void run(byte[] bytes) {
float temperature = decodeTemperature(bytes[1], bytes[0]);
float humidity = decodeHumidity(bytes[3], bytes[2]);
SensorLog sensorLog = new SensorLog(config.getId(), ImmutableM... | Faker faker = new Faker();
// Really this should be between 0 and 100... but yet again, I don't get Java bytes
double humidity = faker.number().randomDouble(4, 0, 50);
int humidityNorm = (int)(humidity * 65536 / 100);
// -40 + (165 * ((msb << 8) | (lsb & 0xff)) / 65536.0f)
... | [FOCAL] @Override public void HumidityNotification.run(byte[] bytes)
[CLASS] class HumidityNotification implements BluetoothNotification<byte[]>
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] float decodeHumidity(byte msb, byte lsb); float decodeTemperature(byte msb, byte lsb)
[CA... | /* static context
[FOCAL] @Override public void HumidityNotification.run(byte[] bytes)
[COLLABORATORS] field config getId/0; field processor onNext/1
[CALLS-INTERNAL] float decodeHumidity(byte msb, byte lsb); float decodeTemperature(byte msb, byte lsb)
[NEW] SensorLog
[CALLS-EXTERNAL] config.getId/0, ImmutableMap.of/4,... | /* static context
[FOCAL] @Override public void HumidityNotification.run(byte[] bytes)
[COLLABORATORS] field config getId/0; field processor onNext/1
[CALLS-INTERNAL] float decodeHumidity(byte msb, byte lsb); float decodeTemperature(byte msb, byte lsb)
[NEW] SensorLog
[CALLS-EXTERNAL] config.getId/0, ImmutableMap.of/4,... | true | ok | {"focal": {"class": "HumidityNotification", "name": "run", "signature": "void run(byte[] bytes)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "bytes", "type": "byte[]"}], "return_type": "void"}, "class_info": {"name": "HumidityNotification", "kind": "class", "modifiers": "", "superclass": null... |
105110479_3 | class JavaBeanBinder extends BeanBinder {
@Override
public <T> T bind(final PropertyName name, final BindData<T> target, final Binder.Env env, final PropertyBinder propertyBinder) {
boolean hasKnownBindableProperties = env.getSource().containsDescendantOf(name);
Bean<T> bean = Bean.get(target, ... | String name = "hmily.yml";
Map<String, Object> map = new HashMap<>();
map.put("hmily.stringTest", 123);
map.put("hmily.integerTest", "123");
map.put("hmily.doubleTest", "123");
map.put("hmily.longTest", "123");
map.put("hmily.chartTest", "A");
map.put("hmi... | [FOCAL] @Override public T JavaBeanBinder.bind(PropertyName name, BindData<T> target, Binder.Env env, PropertyBinder propertyBinder)
[CLASS] class JavaBeanBinder extends BeanBinder
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean bind(PropertyBinder propertyBinder, Bean<T> ... | /* static context
[FOCAL] @Override public T JavaBeanBinder.bind(PropertyName name, BindData<T> target, Binder.Env env, PropertyBinder propertyBinder)
[PATH1] if(bean == null)=T -> return null
[PATH2] if(bean == null)=F -> return bound ? beanSupplier.get() : null
[INPUTS] branches=env, name, target | result=env, name, ... | /* static context
[FOCAL] @Override public T JavaBeanBinder.bind(PropertyName name, BindData<T> target, Binder.Env env, PropertyBinder propertyBinder)
[PATH1] if(bean == null)=T -> return null
[PATH2] if(bean == null)=F -> return bound ? beanSupplier.get() : null
[INPUTS] branches=env, name, target | result=env, name, ... | true | ok | {"focal": {"class": "JavaBeanBinder", "name": "bind", "signature": "T bind(PropertyName name, BindData<T> target, Binder.Env env, PropertyBinder propertyBinder)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "PropertyName"}, {"name": "target", "type": "BindData<T>"}, {"name": "e... |
105195850_1 | class GenericWindowing implements Windowing {
@Override
public long getFirstContainingTime(long Tl, long Tr, long T) {
assert 0 <= Tl && Tl <= Tr && Tr < T;
long l = T-1 - Tr, r = T-1 - Tl, length = Tr - Tl + 1;
if (!addWindowsUntilLength(length)) {
return -1;
}
... | GenericWindowing exp = new GenericWindowing(new ExponentialWindowLengths(2));
assertEquals(101, exp.getFirstContainingTime(98, 99, 100));
assertEquals(103, exp.getFirstContainingTime(96, 99, 100));
assertEquals(107, exp.getFirstContainingTime(92, 99, 100));
assertEquals(115, exp.... | [FOCAL] @Override public long GenericWindowing.getFirstContainingTime(long Tl, long Tr, long T)
[CLASS] class GenericWindowing implements Windowing
[METRICS] loc=31 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=2
[CALLS-INTERNAL] boolean addWindowsUntilLength(long targetLength); void addWindowsPastMarker(long targ... | /* static context
[FOCAL] @Override public long GenericWindowing.getFirstContainingTime(long Tl, long Tr, long T)
[PATH1] if(!addWindowsUntilLength(length))=F -> if(firstMarker >= l)=F -> if(r <= currWindowR)=T -> return T
[PATH2] if(!addWindowsUntilLength(length))=T -> return -1
[PATH3] if(!addWindowsUntilLength(lengt... | /* static context
[FOCAL] @Override public long GenericWindowing.getFirstContainingTime(long Tl, long Tr, long T)
[PATH1] if(!addWindowsUntilLength(length))=F -> if(firstMarker >= l)=F -> if(r <= currWindowR)=T -> return T
[PATH2] if(!addWindowsUntilLength(length))=T -> return -1
[PATH3] if(!addWindowsUntilLength(lengt... | true | ok | {"focal": {"class": "GenericWindowing", "name": "getFirstContainingTime", "signature": "long getFirstContainingTime(long Tl, long Tr, long T)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "Tl", "type": "long"}, {"name": "Tr", "type": "long"}, {"name": "T", "type": "long"}], "return_type": "lon... |
105200994_7 | class WorldLoader {
@Nullable
public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) {
try {
int x = Integer.parseInt(conf.getString(X));
int y = Integer.parseInt(conf.getString(Y));
int z = Integer.parseInt(conf.getString(Z));
... |
YamlConfiguration conf = new YamlConfiguration();
conf.set(WorldLoader.X, 4);
conf.set(WorldLoader.Y, 0);
conf.set(WorldLoader.Z, -4);
Location loc = WorldLoader.worldlessBlockLocationFromConfig(conf);
Assert.assertNotNull(loc);
}
} | [FOCAL] @Nullable public static Location WorldLoader.worldlessBlockLocationFromConfig(ConfigurationSection conf)
[CLASS] class WorldLoader
[METRICS] loc=11 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Integer.parseInt/1, ConfigurationSection.getString/1
[NEW] Location
[EXCEPTIONS] catches Numbe... | /* static context
[FOCAL] @Nullable public static Location WorldLoader.worldlessBlockLocationFromConfig(ConfigurationSection conf)
[PATH1] try-body throws -> return null
[PATH2] return new Location(null, x, y, z)
[INPUTS] branches=- | result=conf
[COLLABORATORS] param conf:ConfigurationSection getString/1
[EXCEPTIONS] ... | /* static context
[FOCAL] @Nullable public static Location WorldLoader.worldlessBlockLocationFromConfig(ConfigurationSection conf)
[PATH1] try-body throws -> return null
[PATH2] return new Location(null, x, y, z)
[INPUTS] branches=- | result=conf
[COLLABORATORS] param conf:ConfigurationSection getString/1
[EXCEPTIONS] ... | true | ok | {"focal": {"class": "WorldLoader", "name": "worldlessBlockLocationFromConfig", "signature": "Location worldlessBlockLocationFromConfig(ConfigurationSection conf)", "start_line": 3, "modifiers": "@Nullable public static", "params": [{"name": "conf", "type": "ConfigurationSection"}], "return_type": "Location"}, "class_in... |
105203803_1 | class MainPresenter extends BaseTypedPresenter<String, Throwable> {
@Override
public void onViewResumed() {
getView().showData("This is some awesome data");
getView().showError(new RuntimeException("Exceptional Error"));
}
MainPresenter(ITypedView<String, Throwable> view);
@Mock... | mPresenter.onViewResumed();
verify(mView).showError(any(Throwable.class));
}
} | [FOCAL] @Override public void MainPresenter.onViewResumed()
[CLASS] class MainPresenter extends BaseTypedPresenter<String, Throwable>
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] getView().showData/1, getView/0 (inherited), getView().showError/1
[NEW] RuntimeException
[CLASS-MEM... | /* static context
[FOCAL] @Override public void MainPresenter.onViewResumed()
[NEW] RuntimeException
[CALLS-EXTERNAL] getView().showData/1, getView/0 (inherited), getView().showError/1
*/
| /* static context
[FOCAL] @Override public void MainPresenter.onViewResumed()
[NEW] RuntimeException
[CALLS-EXTERNAL] getView().showData/1, getView/0 (inherited), getView().showError/1
*/
class MainPresenter extends BaseTypedPresenter<String, Throwable> {
@Override
public void onViewResumed() {
getView... | true | ok | {"focal": {"class": "MainPresenter", "name": "onViewResumed", "signature": "void onViewResumed()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "MainPresenter", "kind": "class", "modifiers": "", "superclass": "BaseTypedPresenter<String, Throwable>", "int... |
105218129_201 | class JDKImperativeDeckOfCardsAsSortedSet {
public SortedSet<Card> spades()
{
return this.cardsBySuit.get(Suit.SPADES);
}
public JDKImperativeDeckOfCardsAsSortedSet();
private SortedSet<Card> buildCardsAsSortedSet();
private Map<Suit, SortedSet<Card>> buildCardsAsMapBySuit();
pub... | Assert.assertEquals(13, this.jdkDeck.spades().size());
Assert.assertTrue(Iterate.allSatisfy(this.jdkDeck.spades(), Card::isSpades));
}
} | [FOCAL] public SortedSet<Card> JDKImperativeDeckOfCardsAsSortedSet.spades()
[CLASS] class JDKImperativeDeckOfCardsAsSortedSet
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.cardsBySuit.get/1
[FIELDS] read=cardsBySuit
[COLLABORATORS] field cardsBySuit get/1
[CLASS-MEMBERS] JDK... | /* static context
[FOCAL] public SortedSet<Card> JDKImperativeDeckOfCardsAsSortedSet.spades()
[COLLABORATORS] field cardsBySuit get/1
[FIELDS] read=cardsBySuit
[CALLS-EXTERNAL] this.cardsBySuit.get/1
*/
| /* static context
[FOCAL] public SortedSet<Card> JDKImperativeDeckOfCardsAsSortedSet.spades()
[COLLABORATORS] field cardsBySuit get/1
[FIELDS] read=cardsBySuit
[CALLS-EXTERNAL] this.cardsBySuit.get/1
*/
class JDKImperativeDeckOfCardsAsSortedSet {
public SortedSet<Card> spades()
{
return this.cardsBySui... | true | ok | {"focal": {"class": "JDKImperativeDeckOfCardsAsSortedSet", "name": "spades", "signature": "SortedSet<Card> spades()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "SortedSet<Card>"}, "class_info": {"name": "JDKImperativeDeckOfCardsAsSortedSet", "kind": "class", "modifiers": "", "superclass": nul... |
105238970_124 | class UpdateRequestLastModifiedDateOnFundedHandler {
@EventListener
public void handle(final RequestFundedEvent event) {
final Request request = requestRepository.findOne(event.getRequestId())
.orElseThrow(() -> new RuntimeException("Unable to find reque... | final long requestId = 6578L;
final RequestFundedEvent event = RequestFundedEvent.builder().requestId(requestId).build();
final Request request = RequestMother.fundRequestArea51()
.withLastModifiedDate(LocalDateTime.now().minusWeeks(3))
... | [FOCAL] @EventListener public void UpdateRequestLastModifiedDateOnFundedHandler.handle(RequestFundedEvent event)
[CLASS] class UpdateRequestLastModifiedDateOnFundedHandler
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] requestRepository.findOne(event.getRequestId()).orElseThrow/1,... | /* static context
[FOCAL] @EventListener public void UpdateRequestLastModifiedDateOnFundedHandler.handle(RequestFundedEvent event)
[COLLABORATORS] field requestRepository:RequestRepository findOne/1,saveAndFlush/1; param event:RequestFundedEvent getRequestId/0
[FIELDS] read=requestRepository:RequestRepository
[NEW] Run... | /* static context
[FOCAL] @EventListener public void UpdateRequestLastModifiedDateOnFundedHandler.handle(RequestFundedEvent event)
[COLLABORATORS] field requestRepository:RequestRepository findOne/1,saveAndFlush/1; param event:RequestFundedEvent getRequestId/0
[FIELDS] read=requestRepository:RequestRepository
[NEW] Run... | true | ok | {"focal": {"class": "UpdateRequestLastModifiedDateOnFundedHandler", "name": "handle", "signature": "void handle(RequestFundedEvent event)", "start_line": 3, "modifiers": "@EventListener public", "params": [{"name": "event", "type": "RequestFundedEvent"}], "return_type": "void"}, "class_info": {"name": "UpdateRequestLas... |
105269391_1 | class KafkaMetricsSet implements MetricSet {
public Boolean connectionToKafkaTopicsIsSuccess() {
if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) {
StopWatch executionTime = StopWatch.createStarted();
DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptio... | KafkaMetricsSet kafkaMetricsSet = initKafkaMetricSet();
kafkaEmbedded.destroy();
assertFalse(kafkaMetricsSet.connectionToKafkaTopicsIsSuccess());
}
} | [FOCAL] public Boolean KafkaMetricsSet.connectionToKafkaTopicsIsSuccess()
[CLASS] class KafkaMetricsSet implements MetricSet
[METRICS] loc=23 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=3
[CALLS-EXTERNAL] nonNull/1 (inherited), StopWatch.createStarted/0, new DescribeTopicsOptions().timeoutMs/1, AdminClient.creat... | /* static context
[FOCAL] public Boolean KafkaMetricsSet.connectionToKafkaTopicsIsSuccess()
[PATH1] if(nonNull(metricTopics) && nonNull(connectionTimeoutTopic))=T -> try-body throws -> return false
[PATH2] if(nonNull(metricTopics) && nonNull(connectionTimeoutTopic))=F -> return null
[PATH3] if(nonNull(metricTopics) && ... | /* static context
[FOCAL] public Boolean KafkaMetricsSet.connectionToKafkaTopicsIsSuccess()
[PATH1] if(nonNull(metricTopics) && nonNull(connectionTimeoutTopic))=T -> try-body throws -> return false
[PATH2] if(nonNull(metricTopics) && nonNull(connectionTimeoutTopic))=F -> return null
[PATH3] if(nonNull(metricTopics) && ... | true | ok | {"focal": {"class": "KafkaMetricsSet", "name": "connectionToKafkaTopicsIsSuccess", "signature": "Boolean connectionToKafkaTopicsIsSuccess()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Boolean"}, "class_info": {"name": "KafkaMetricsSet", "kind": "class", "modifiers": "", "superclass": null, "... |
105288171_6 | class LazyModuleLoader {
public synchronized Class loadModule(String moduleName, String className)
throws LazyLoadingException {
try {
return mLoaderAlgorithm.loadModule(moduleName, className);
} catch (Throwable t) {
throw new LazyLoadingException(t);
}
}
public LazyModuleLoader(... | // given
Mockito.when(mModulePathsNo1Mock.containsNativeLib()).thenReturn(true);
Mockito.when(mModulePathsNo1Mock.getNativeLibsDirectory()).thenReturn(mNativeLibsDirectoryMock);
// when
Class returnedClass = mObjectUnderTest.loadModule(MODULE_NAME_NO1, LazyModule.class.getName());
// then
... | [FOCAL] public synchronized Class LazyModuleLoader.loadModule(String moduleName, String className)
[CLASS] class LazyModuleLoader
[METRICS] loc=8 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] mLoaderAlgorithm.loadModule/2
[NEW] LazyLoadingException
[EXCEPTIONS] declares LazyLoadingException; thr... | /* static context
[FOCAL] public synchronized Class LazyModuleLoader.loadModule(String moduleName, String className)
[THROWS-WHEN] LazyLoadingException when try-body throws
[PATH1] try-body throws -> throw new LazyLoadingException(t)
[PATH2] return mLoaderAlgorithm.loadModule(moduleName, className)
[INPUTS] branches=- ... | /* static context
[FOCAL] public synchronized Class LazyModuleLoader.loadModule(String moduleName, String className)
[THROWS-WHEN] LazyLoadingException when try-body throws
[PATH1] try-body throws -> throw new LazyLoadingException(t)
[PATH2] return mLoaderAlgorithm.loadModule(moduleName, className)
[INPUTS] branches=- ... | true | ok | {"focal": {"class": "LazyModuleLoader", "name": "loadModule", "signature": "Class loadModule(String moduleName, String className) throws LazyLoadingException", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "moduleName", "type": "String"}, {"name": "className", "type": "String"}], "return_type... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.