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 |
|---|---|---|---|---|---|---|---|---|
48402328_30 | class TerminalCharacter {
public boolean equalsIgnoreCharacter(TerminalCharacter that) {
return style.equals(that.style) && color.equals(that.color);
}
public TerminalCharacter(char c);
public TerminalCharacter(char c, TerminalTextStyle style);
public TerminalCharacter(char c, TerminalC... | TerminalCharacter c1 = new TerminalCharacter('a', new TerminalColor(Color.RED, Color.BLUE));
TerminalCharacter c2 = new TerminalCharacter('b', new TerminalColor(Color.RED, Color.BLUE));
assertTrue(c1.equalsIgnoreCharacter(c2));
}
} | [FOCAL] public boolean TerminalCharacter.equalsIgnoreCharacter(TerminalCharacter that)
[CLASS] class TerminalCharacter
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] style.equals/1, color.equals/1
[INPUTS] branches=- | result=that
[COLLABORATORS] field style equals/1; field color ... | /* static context
[FOCAL] public boolean TerminalCharacter.equalsIgnoreCharacter(TerminalCharacter that)
[INPUTS] branches=- | result=that
[COLLABORATORS] field style equals/1; field color equals/1
[CALLS-EXTERNAL] style.equals/1, color.equals/1
*/
| /* static context
[FOCAL] public boolean TerminalCharacter.equalsIgnoreCharacter(TerminalCharacter that)
[INPUTS] branches=- | result=that
[COLLABORATORS] field style equals/1; field color equals/1
[CALLS-EXTERNAL] style.equals/1, color.equals/1
*/
class TerminalCharacter {
public boolean equalsIgnoreCharacter(Ter... | true | ok | {"focal": {"class": "TerminalCharacter", "name": "equalsIgnoreCharacter", "signature": "boolean equalsIgnoreCharacter(TerminalCharacter that)", "start_line": 3, "modifiers": "public", "params": [{"name": "that", "type": "TerminalCharacter"}], "return_type": "boolean"}, "class_info": {"name": "TerminalCharacter", "kind"... |
48418599_0 | class CommandHandlerProvider implements ApplicationContextAware {
public NewCommandSourceHandler getHandler(final String entity, final String action) {
Preconditions.checkArgument(StringUtils.isNoneEmpty(entity), "An entity must be given!");
Preconditions.checkArgument(StringUtils.isNoneEmpty(actio... | final Long testCommandId = 815L;
final NewCommandSourceHandler registeredHandler = this.commandHandlerProvider.getHandler("HUMAN", "UPDATE");
final CommandProcessingResult result = registeredHandler
.processCommand(JsonCommand.fromExistingCommand(testCommandId, null, null, null... | [FOCAL] public NewCommandSourceHandler CommandHandlerProvider.getHandler(String entity, String action)
[CLASS] class CommandHandlerProvider implements ApplicationContextAware
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] Preconditions.checkArgument/2, StringUtils.isNoneEmpty/1, ... | /* static context
[FOCAL] public NewCommandSourceHandler CommandHandlerProvider.getHandler(String entity, String action)
[THROWS-WHEN] UnsupportedCommandException when !this.registeredHandlers.containsKey(key)
[PATH1] if(!this.registeredHandlers.containsKey(key))=T -> throw new UnsupportedCommandException(key)
[PATH2] ... | /* static context
[FOCAL] public NewCommandSourceHandler CommandHandlerProvider.getHandler(String entity, String action)
[THROWS-WHEN] UnsupportedCommandException when !this.registeredHandlers.containsKey(key)
[PATH1] if(!this.registeredHandlers.containsKey(key))=T -> throw new UnsupportedCommandException(key)
[PATH2] ... | true | ok | {"focal": {"class": "CommandHandlerProvider", "name": "getHandler", "signature": "NewCommandSourceHandler getHandler(String entity, String action)", "start_line": 3, "modifiers": "public", "params": [{"name": "entity", "type": "String"}, {"name": "action", "type": "String"}], "return_type": "NewCommandSourceHandler"}, ... |
48427914_2 | class FileDownloadUtils {
public static long parseContentLengthFromContentRange(String contentRange) {
if (contentRange == null || contentRange.length() == 0) return -1;
final String pattern = "bytes (\\d+)-(\\d+)/\\d+";
try {
final Pattern r = Pattern.compile(pattern);
... | long length = FileDownloadUtils.parseContentLengthFromContentRange("");
assertThat(length).isEqualTo(-1);
}
} | [FOCAL] public static long FileDownloadUtils.parseContentLengthFromContentRange(String contentRange)
[CLASS] class FileDownloadUtils
[METRICS] loc=17 cc=4 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] String.length/0, Pattern.compile/1, Pattern.matcher/1, Matcher.find/0, Long.parseLong/1, Matcher.gro... | /* static context
[FOCAL] public static long FileDownloadUtils.parseContentLengthFromContentRange(String contentRange)
[PATH1] if(contentRange == null || contentRange.length() == 0)=F -> try-body throws -> return -1
[PATH2] if(contentRange == null || contentRange.length() == 0)=F -> if(m.find())=T -> return rangeEnd - ... | /* static context
[FOCAL] public static long FileDownloadUtils.parseContentLengthFromContentRange(String contentRange)
[PATH1] if(contentRange == null || contentRange.length() == 0)=F -> try-body throws -> return -1
[PATH2] if(contentRange == null || contentRange.length() == 0)=F -> if(m.find())=T -> return rangeEnd - ... | true | ok | {"focal": {"class": "FileDownloadUtils", "name": "parseContentLengthFromContentRange", "signature": "long parseContentLengthFromContentRange(String contentRange)", "start_line": 3, "modifiers": "public static", "params": [{"name": "contentRange", "type": "String"}], "return_type": "long"}, "class_info": {"name": "FileD... |
48430544_5 | class GuiceVerticleFactory implements VerticleFactory {
@Override
public Verticle createVerticle(String verticleName, ClassLoader classLoader) throws Exception {
verticleName = VerticleFactory.removePrefix(verticleName);
Class clazz;
if (verticleName.endsWith(".java")) {
Co... | // Arrange
String identifier = GuiceVerticleFactory.PREFIX + ":" + VerticleWithDependency.class.getName();
// Act
Verticle verticle = factory.createVerticle(identifier, this.getClass().getClassLoader());
// Assert
assertThat(verticle).isExactlyInstanceOf(VerticleWithDep... | [FOCAL] @Override public Verticle GuiceVerticleFactory.createVerticle(String verticleName, ClassLoader classLoader)
[CLASS] class GuiceVerticleFactory implements VerticleFactory
[METRICS] loc=15 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] VerticleFactory.removePrefix/1, String.endsWith/1, Comp... | /* static context
[FOCAL] @Override public Verticle GuiceVerticleFactory.createVerticle(String verticleName, ClassLoader classLoader)
[PATH1] if(verticleName.endsWith(".java"))=T -> return (Verticle) this.injector.getInstance(clazz)
[PATH2] if(verticleName.endsWith(".java"))=F -> return (Verticle) this.injector.getInst... | /* static context
[FOCAL] @Override public Verticle GuiceVerticleFactory.createVerticle(String verticleName, ClassLoader classLoader)
[PATH1] if(verticleName.endsWith(".java"))=T -> return (Verticle) this.injector.getInstance(clazz)
[PATH2] if(verticleName.endsWith(".java"))=F -> return (Verticle) this.injector.getInst... | true | ok | {"focal": {"class": "GuiceVerticleFactory", "name": "createVerticle", "signature": "Verticle createVerticle(String verticleName, ClassLoader classLoader) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "verticleName", "type": "String"}, {"name": "classLoader", "type": "ClassLoad... |
48443654_15 | class TimestampUtils {
public static String getISO8601StringForTime(long time) {
return ISO8601Utils.format(new Date(time), true);
}
public static String getReadableDate(long time);
public static Date getDateForISO8601String(String time);
public static Integer getDaysBetweenDates(@Nullable... | String ts = "2017-09-12T23:04:02.000Z";
String formattedString = TimestampUtils.getISO8601StringForTime(1505257442000l);
Assert.assertNotNull(formattedString);
Assert.assertEquals(ts, formattedString);
}
} | [FOCAL] public static String TimestampUtils.getISO8601StringForTime(long time)
[CLASS] class TimestampUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ISO8601Utils.format/2
[NEW] Date
[INPUTS] branches=- | result=time
[DATAFLOW] time@param->L2
[CLASS-MEMBERS] String getReadabl... | /* static context
[FOCAL] public static String TimestampUtils.getISO8601StringForTime(long time)
[INPUTS] branches=- | result=time
[NEW] Date
[CALLS-EXTERNAL] ISO8601Utils.format/2
*/
| /* static context
[FOCAL] public static String TimestampUtils.getISO8601StringForTime(long time)
[INPUTS] branches=- | result=time
[NEW] Date
[CALLS-EXTERNAL] ISO8601Utils.format/2
*/
class TimestampUtils {
public static String getISO8601StringForTime(long time) {
return ISO8601Utils.format(new Date(time),... | true | ok | {"focal": {"class": "TimestampUtils", "name": "getISO8601StringForTime", "signature": "String getISO8601StringForTime(long time)", "start_line": 3, "modifiers": "public static", "params": [{"name": "time", "type": "long"}], "return_type": "String"}, "class_info": {"name": "TimestampUtils", "kind": "class", "modifiers":... |
48446680_4 | class EasyPermissions {
public static void onRequestPermissionsResult(int requestCode,
@NonNull String[] permissions,
@NonNull int[] grantResults,
@NonNull Object...... | EasyPermissions.onRequestPermissionsResult(TestActivity.REQUEST_CODE, ALL_PERMS, SMS_DENIED_RESULT, spyActivity);
verify(spyActivity, times(1))
.onPermissionsGranted(integerCaptor.capture(), listCaptor.capture());
assertThat(integerCaptor.getValue()).isEqualTo(TestActivity.REQUE... | [FOCAL] public static void EasyPermissions.onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults, Object... receivers)
[CLASS] class EasyPermissions
[METRICS] loc=38 cc=9 branches=6 loops=2 returns=0 throws=0 nesting=3
[CALLS-INTERNAL] void runAnnotatedMethods(Object object, int requestCo... | /* static context
[FOCAL] public static void EasyPermissions.onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults, Object... receivers)
[PATH1] for(i < permissions.length)=T -> if(grantResults[i] == PackageManager.PERMISSION_GRANTED)=T -> exit loop -> foreach(Object object : receivers)=T... | /* static context
[FOCAL] public static void EasyPermissions.onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults, Object... receivers)
[PATH1] for(i < permissions.length)=T -> if(grantResults[i] == PackageManager.PERMISSION_GRANTED)=T -> exit loop -> foreach(Object object : receivers)=T... | true | ok | {"focal": {"class": "EasyPermissions", "name": "onRequestPermissionsResult", "signature": "void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults, Object... receivers)", "start_line": 3, "modifiers": "public static", "params": [{"name": "requestCode", "type": "int"}, {"name": "permiss... |
48451041_1 | class BigdataSailRemoteRepositoryConnection implements RepositoryConnection {
@Override
public void export(final RDFHandler handler, final Resource... c)
throws RepositoryException, RDFHandlerException {
exportStatements(null, null, null, true, handler, c);
}
public BigdataSailRemoteRepositoryConnection... | final RDFHandler handler = new RDFHandlerBase();
con.exportStatements(s, p, o, includeInferred, handler, c);
assertEquals(EncodeDecodeValue.encodeValue(s), remote.data.opts.getRequestParam("s"));
assertEquals(EncodeDecodeValue.encodeValue(p), remote.data.opts.getRequestParam("p"));
assertEquals(EncodeDecodeVa... | [FOCAL] @Override public void BigdataSailRemoteRepositoryConnection.export(RDFHandler handler, Resource... c)
[CLASS] class BigdataSailRemoteRepositoryConnection implements RepositoryConnection
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void exportStatements(Resource s, URI p,... | /* static context
[FOCAL] @Override public void BigdataSailRemoteRepositoryConnection.export(RDFHandler handler, Resource... c)
[EXCEPTIONS] declares RepositoryException, RDFHandlerException
[CALLS-INTERNAL] void exportStatements(Resource s, URI p, Value o, boolean includeInferred, RDFHandler handler, Resource... c)
*/... | /* static context
[FOCAL] @Override public void BigdataSailRemoteRepositoryConnection.export(RDFHandler handler, Resource... c)
[EXCEPTIONS] declares RepositoryException, RDFHandlerException
[CALLS-INTERNAL] void exportStatements(Resource s, URI p, Value o, boolean includeInferred, RDFHandler handler, Resource... c)
*/... | true | ok | {"focal": {"class": "BigdataSailRemoteRepositoryConnection", "name": "export", "signature": "void export(RDFHandler handler, Resource... c) throws RepositoryException, RDFHandlerException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "handler", "type": "RDFHandler"}, {"name": "c", "type": "Res... |
48454315_0 | class Transformer implements ClassFileTransformer {
@Override
public byte[] transform(final ClassLoader loader, final String className, final Class<?> classBeingRedefined, final ProtectionDomain protectionDomain, final byte[] classfileBuffer) throws IllegalClassFormatException
{
try
{
... | final ClassNode cn = createClassNode(AsyncFunction.class, cw -> {
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "apply", "(Ljava/lang/Object;)Lcom/ea/async/Task;", null, new String[]{ "java/lang/Exception" });
mv.visitCode();
mv.visitVarInsn(ALOAD, 1);
mv.visitTyp... | [FOCAL] @Override public byte[] Transformer.transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
[CLASS] class Transformer implements ClassFileTransformer
[METRICS] loc=27 cc=4 branches=2 loops=0 returns=3 throws=1 nesting=2
[CALLS-INTE... | /* static context
[FOCAL] @Override public byte[] Transformer.transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
[THROWS-WHEN] exception when try-body throws
[PATH1] if(className != null && className.startsWith("java"))=F -> if(needsI... | /* static context
[FOCAL] @Override public byte[] Transformer.transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
[THROWS-WHEN] exception when try-body throws
[PATH1] if(className != null && className.startsWith("java"))=F -> if(needsI... | true | ok | {"focal": {"class": "Transformer", "name": "transform", "signature": "byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException", "start_line": 3, "modifiers": "@Override public", "params": [{"name":... |
48461129_4 | class Img implements ImgBase<Pixel> {
public int getValue(final int x, final int y){
return this.data[y*this.width + x];
}
public Img(int width, int height);
public Img(Dimension dimension);
public Img(BufferedImage bimg);
public Img(int width, int height, int[] data);
public Img(Dimension dim, int[] da... | Img img = new Img(400, 400);
img.paint(g->{
g.setColor(new Color(0xffff0000));
g.drawLine(0, 0, 400, 400);
});
img.forEach(px->{
if(px.getX() == px.getY()){
assertEquals(0xffff0000, px.getValue());
} else {
assertEquals(0, px.getValue());
}
});
}
} | [FOCAL] public int Img.getValue(int x, int y)
[CLASS] class Img implements ImgBase<Pixel>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=data, width
[INPUTS] branches=- | result=x, y
[DATAFLOW] x@param->L2; y@param->L2
[CLASS-MEMBERS] Img(int width, int height); Img(Dimension dimensi... | /* static context
[FOCAL] public int Img.getValue(int x, int y)
[INPUTS] branches=- | result=x, y
[FIELDS] read=data, width
*/
| /* static context
[FOCAL] public int Img.getValue(int x, int y)
[INPUTS] branches=- | result=x, y
[FIELDS] read=data, width
*/
class Img implements ImgBase<Pixel> {
public int getValue(final int x, final int y){
return this.data[y*this.width + x];
}
public Img(int width, int height);
public Img(Dimension dime... | true | ok | {"focal": {"class": "Img", "name": "getValue", "signature": "int getValue(int x, int y)", "start_line": 3, "modifiers": "public", "params": [{"name": "x", "type": "int"}, {"name": "y", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Img", "kind": "class", "modifiers": "", "superclass": null, "interfaces... |
48485491_32 | class ServiceResponseDecoder implements HttpResponseDecoder<ServiceResponse<T>> {
@Override
public ServiceResponse<T> decode(HttpResponse httpResponse) throws Exception {
Map<String, String> headers = getHeaders(httpResponse);
collectedHeaders.forEach((k, v) -> Optional.ofNullable(localCollecte... | HttpResponse mockHttpResponse = mock(HttpResponse.class);
StatusLine mockStatusLine = mock(StatusLine.class);
HttpEntity mockEntity = mock(HttpEntity.class);
InputStream stream = mock(InputStream.class);
String errorString = "{\"error\":\"testing error\"}";
Map<String, C... | [FOCAL] @Override public ServiceResponse<T> ServiceResponseDecoder.decode(HttpResponse httpResponse)
[CLASS] class ServiceResponseDecoder implements HttpResponseDecoder<ServiceResponse<T>>
[METRICS] loc=71 cc=13 branches=9 loops=0 returns=7 throws=3 nesting=4
[CALLS-INTERNAL] Map<String, String> getHeaders(HttpResponse... | /* static context
[FOCAL] @Override public ServiceResponse<T> ServiceResponseDecoder.decode(HttpResponse httpResponse)
[THROWS-WHEN] IOException when statusCode >= 200 && statusCode <= 299 && !(statusCode == 204) && try-body throws && !(e.getMessage().contains("No content to map due to end-of-input"))
[THROWS-WHEN] IOE... | /* static context
[FOCAL] @Override public ServiceResponse<T> ServiceResponseDecoder.decode(HttpResponse httpResponse)
[THROWS-WHEN] IOException when statusCode >= 200 && statusCode <= 299 && !(statusCode == 204) && try-body throws && !(e.getMessage().contains("No content to map due to end-of-input"))
[THROWS-WHEN] IOE... | true | ok | {"focal": {"class": "ServiceResponseDecoder", "name": "decode", "signature": "ServiceResponse<T> decode(HttpResponse httpResponse) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "httpResponse", "type": "HttpResponse"}], "return_type": "ServiceResponse<T>"}, "class_info": {"name... |
48500629_64 | class FieldDocumentationGenerator {
public FieldDescriptors generateDocumentation(Type baseType, TypeFactory typeFactory)
throws JsonMappingException {
JavaType javaBaseType = typeFactory.constructType(baseType);
List<JavaType> types = resolveAllTypes(javaBaseType, typeFactory, typeMapp... | // given
ObjectMapper mapper = createMapper();
mockFieldComment(FirstLevel.class, "second", "2nd level");
mockFieldComment(SecondLevel.class, "third", "3rd level");
mockFieldComment(ThirdLevel.class, "fourth", "4th level");
mockFieldComment(FourthLevel.class, "fifth", "5t... | [FOCAL] public FieldDescriptors FieldDocumentationGenerator.generateDocumentation(Type baseType, TypeFactory typeFactory)
[CLASS] class FieldDocumentationGenerator
[METRICS] loc=24 cc=4 branches=1 loops=2 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] TypeFactory.constructType/1, resolveAllTypes/3 (inherited), FieldDocu... | /* static context
[FOCAL] public FieldDescriptors FieldDocumentationGenerator.generateDocumentation(Type baseType, TypeFactory typeFactory)
[PATH1] foreach(JavaType type : types)=T -> if(RESOURCES_TYPES.contains(type.getRawClass().getCanonicalName()))=T -> exit loop -> foreach(FieldDescriptor descriptor : visitorWrappe... | /* static context
[FOCAL] public FieldDescriptors FieldDocumentationGenerator.generateDocumentation(Type baseType, TypeFactory typeFactory)
[PATH1] foreach(JavaType type : types)=T -> if(RESOURCES_TYPES.contains(type.getRawClass().getCanonicalName()))=T -> exit loop -> foreach(FieldDescriptor descriptor : visitorWrappe... | true | ok | {"focal": {"class": "FieldDocumentationGenerator", "name": "generateDocumentation", "signature": "FieldDescriptors generateDocumentation(Type baseType, TypeFactory typeFactory) throws JsonMappingException", "start_line": 3, "modifiers": "public", "params": [{"name": "baseType", "type": "Type"}, {"name": "typeFactory", ... |
48520201_2 | class MathUtils {
public static float angle(float x1, float y1, float x2, float y2) {
return (float) Math.toDegrees(Math.atan2(x2 - x1, y2 - y1));
}
public static float barryCentric(Vector3 p1, Vector3 p2, Vector3 p3, Vector2 pos);
public static float dst(float x1, float y1, float x2, float y2... | assertEquals(45.0f, MathUtils.angle(0.0f,0.0f,1.0f,1.0f), 0.0f);
}
} | [FOCAL] public static float MathUtils.angle(float x1, float y1, float x2, float y2)
[CLASS] class MathUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Math.toDegrees/1, Math.atan2/2
[INPUTS] branches=- | result=x1, x2, y1, y2
[DATAFLOW] x1@param->L2; x2@param->L2; y1@param->L2... | /* static context
[FOCAL] public static float MathUtils.angle(float x1, float y1, float x2, float y2)
[INPUTS] branches=- | result=x1, x2, y1, y2
[CALLS-EXTERNAL] Math.toDegrees/1, Math.atan2/2
*/
| /* static context
[FOCAL] public static float MathUtils.angle(float x1, float y1, float x2, float y2)
[INPUTS] branches=- | result=x1, x2, y1, y2
[CALLS-EXTERNAL] Math.toDegrees/1, Math.atan2/2
*/
class MathUtils {
public static float angle(float x1, float y1, float x2, float y2) {
return (float) Math.toDe... | true | ok | {"focal": {"class": "MathUtils", "name": "angle", "signature": "float angle(float x1, float y1, float x2, float y2)", "start_line": 3, "modifiers": "public static", "params": [{"name": "x1", "type": "float"}, {"name": "y1", "type": "float"}, {"name": "x2", "type": "float"}, {"name": "y2", "type": "float"}], "return_typ... |
48524181_1 | class Paperwork {
public String get(String key) {
init();
return json.optString(key);
}
public Paperwork(Context context);
public Paperwork(Context context, String filename);
private void init();
private String getFileContents();
}
class PaperworkTest {
@Test
pub... | final Paperwork paperwork = new Paperwork(RuntimeEnvironment.application);
assertEquals("hell yeah", paperwork.get("testing rocks"));
}
} | [FOCAL] public String Paperwork.get(String key)
[CLASS] class Paperwork
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] void init()
[CALLS-EXTERNAL] json.optString/1
[INPUTS] branches=- | result=key
[COLLABORATORS] field json optString/1
[DATAFLOW] key@param->L4
[CLASS-MEMBERS] Pap... | /* static context
[FOCAL] public String Paperwork.get(String key)
[INPUTS] branches=- | result=key
[COLLABORATORS] field json optString/1
[CALLS-INTERNAL] void init()
[CALLS-EXTERNAL] json.optString/1
*/
| /* static context
[FOCAL] public String Paperwork.get(String key)
[INPUTS] branches=- | result=key
[COLLABORATORS] field json optString/1
[CALLS-INTERNAL] void init()
[CALLS-EXTERNAL] json.optString/1
*/
class Paperwork {
public String get(String key) {
init();
return json.optString(key);
}
... | true | ok | {"focal": {"class": "Paperwork", "name": "get", "signature": "String get(String key)", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Paperwork", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": ... |
48536970_0 | class MapExample {
public static <T, U> Map<T, U> createMap(SimpleEntry<T, U>... entries) {
return Stream.of(entries).collect(toMap(SimpleEntry::getKey, SimpleEntry::getValue));
}
public static void doSth(Map<T, U> map);
}
class MapExampleTest {
@Test
public void shouldCreateAHashMapUsi... | Map<String, Integer> nameAndAge = MapExample.createMap(new SimpleEntry<>("shekhar", 32), new SimpleEntry<>("rahul", 33), new SimpleEntry<>("sameer", 33));
assertThat(nameAndAge.size(), equalTo(3));
}
} | [FOCAL] public static Map<T, U> MapExample.createMap(SimpleEntry<T, U>... entries)
[CLASS] class MapExample
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Stream.of(entries).collect/1, Stream.of/1, toMap/2 (inherited)
[INPUTS] branches=- | result=entries
[DATAFLOW] entries@param->... | /* static context
[FOCAL] public static Map<T, U> MapExample.createMap(SimpleEntry<T, U>... entries)
[INPUTS] branches=- | result=entries
[CALLS-EXTERNAL] Stream.of(entries).collect/1, Stream.of/1, toMap/2 (inherited)
*/
| /* static context
[FOCAL] public static Map<T, U> MapExample.createMap(SimpleEntry<T, U>... entries)
[INPUTS] branches=- | result=entries
[CALLS-EXTERNAL] Stream.of(entries).collect/1, Stream.of/1, toMap/2 (inherited)
*/
class MapExample {
public static <T, U> Map<T, U> createMap(SimpleEntry<T, U>... entries) {
... | true | ok | {"focal": {"class": "MapExample", "name": "createMap", "signature": "Map<T, U> createMap(SimpleEntry<T, U>... entries)", "start_line": 3, "modifiers": "public static", "params": [{"name": "entries", "type": "SimpleEntry<T, U>..."}], "return_type": "Map<T, U>"}, "class_info": {"name": "MapExample", "kind": "class", "mod... |
48556027_3 | class TwitterOauth {
public static String getOautHeaderString(Credentials credentials, String method, String baseUrl, Map<String, String> params) {
String nonce = UUID.randomUUID().toString();
int time = Math.round(System.currentTimeMillis()/1000L);
return getOautHeaderString(credentials, m... | String consumerKey = "xvz1evFS4wEEPTGEFPHBog";
String nonce = "kYjzVBB8Y0ZFabxSWbWovY3uYSQ2pTgmZeNu2VS4cg";
String signature = "tnnArxj06cWHq44gCs1OSKk/jLY=";
int time = 1318622958;
String token = "370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb";
String expected = "OA... | [FOCAL] public static String TwitterOauth.getOautHeaderString(Credentials credentials, String method, String baseUrl, Map<String, String> params)
[CLASS] class TwitterOauth
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String getOautHeaderString(Credentials credentials, String me... | /* static context
[FOCAL] public static String TwitterOauth.getOautHeaderString(Credentials credentials, String method, String baseUrl, Map<String, String> params)
[INPUTS] branches=- | result=baseUrl, credentials, method, params
[CALLS-INTERNAL] String getOautHeaderString(Credentials credentials, String method, String... | /* static context
[FOCAL] public static String TwitterOauth.getOautHeaderString(Credentials credentials, String method, String baseUrl, Map<String, String> params)
[INPUTS] branches=- | result=baseUrl, credentials, method, params
[CALLS-INTERNAL] String getOautHeaderString(Credentials credentials, String method, String... | true | ok | {"focal": {"class": "TwitterOauth", "name": "getOautHeaderString", "signature": "String getOautHeaderString(Credentials credentials, String method, String baseUrl, Map<String, String> params)", "start_line": 3, "modifiers": "public static", "params": [{"name": "credentials", "type": "Credentials"}, {"name": "method", "... |
48577594_47 | class CloudFormation {
public void signalReady(String stackName, String resourceName) {
Preconditions.checkArgument(stackName != null && !stackName.isEmpty());
Preconditions.checkArgument(resourceName != null && !resourceName.isEmpty());
SignalResourceRequest req = new SignalResourceRequest... | HashMap<String, String> tags = new HashMap<>();
tags.put(CloudFormation.TAG_CLOUDFORMATION_LOGICAL_ID, "resourceTag");
tags.put(CloudFormation.TAG_CLOUDFORMATION_STACK_NAME, "stackTag");
Mockito.when(this.ec2Mock.getInstanceTags()).thenReturn(tags);
try {
this.cloudF... | [FOCAL] public void CloudFormation.signalReady(String stackName, String resourceName)
[CLASS] class CloudFormation
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Preconditions.checkArgument/1, String.isEmpty/0, SignalResourceRequest.setLogicalResourceId/1, SignalResourceRequest.s... | /* static context
[FOCAL] public void CloudFormation.signalReady(String stackName, String resourceName)
[COLLABORATORS] field ec2Context getInstanceId/0; field cloudFormationClient signalResource/1
[FIELDS] read=cloudFormationClient, ec2Context
[NEW] SignalResourceRequest
[CALLS-EXTERNAL] Preconditions.checkArgument/1,... | /* static context
[FOCAL] public void CloudFormation.signalReady(String stackName, String resourceName)
[COLLABORATORS] field ec2Context getInstanceId/0; field cloudFormationClient signalResource/1
[FIELDS] read=cloudFormationClient, ec2Context
[NEW] SignalResourceRequest
[CALLS-EXTERNAL] Preconditions.checkArgument/1,... | true | ok | {"focal": {"class": "CloudFormation", "name": "signalReady", "signature": "void signalReady(String stackName, String resourceName)", "start_line": 3, "modifiers": "public", "params": [{"name": "stackName", "type": "String"}, {"name": "resourceName", "type": "String"}], "return_type": "void"}, "class_info": {"name": "Cl... |
48581176_1 | class EventParser {
public static Map<EventEnum, Map<String, Integer>> parseEvent(File file){
if(null==file || !file.exists()) return null;
System.out.println(file.getName()+"===========================");
LOGGER.debug("开始处理文件:{}", file.getName());
LineProcessor<Map<EventEnum, Ma... |
String path=FileUtils.corpousPath+"/train/test-arg.txt";
System.out.println(path);
//String path = this.getClass().getClassLoader().getResource("train/test-arg.txt").getPath();
File file = new File(path);
Assert.assertTrue(null!=file && file.exists());
Map<EventEnum, Map<Strin... | [FOCAL] public static Map<EventEnum, Map<String, Integer>> EventParser.parseEvent(File file)
[CLASS] class EventParser
[METRICS] loc=14 cc=3 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] File.exists/0, System.out.println/1, File.getName/0, Logger.debug/2, Files.readLines/3, Logger.error/2, LineProces... | /* static context
[FOCAL] public static Map<EventEnum, Map<String, Integer>> EventParser.parseEvent(File file)
[PATH1] if(null==file || !file.exists())=F -> try-body throws -> return linePorcessor.getResult()
[PATH2] if(null==file || !file.exists())=T -> return null
[INPUTS] branches=file | result=-
[COLLABORATORS] par... | /* static context
[FOCAL] public static Map<EventEnum, Map<String, Integer>> EventParser.parseEvent(File file)
[PATH1] if(null==file || !file.exists())=F -> try-body throws -> return linePorcessor.getResult()
[PATH2] if(null==file || !file.exists())=T -> return null
[INPUTS] branches=file | result=-
[COLLABORATORS] par... | true | ok | {"focal": {"class": "EventParser", "name": "parseEvent", "signature": "Map<EventEnum, Map<String, Integer>> parseEvent(File file)", "start_line": 3, "modifiers": "public static", "params": [{"name": "file", "type": "File"}], "return_type": "Map<EventEnum, Map<String, Integer>>"}, "class_info": {"name": "EventParser", "... |
48583116_1 | class Trip implements Serializable, Comparable<Trip>, Cloneable {
public final String getNote() {
return mNote;
}
public Trip();
public Trip(final String parName,
final GregorianCalendar parStartDate,
final GregorianCalendar parEndDate,
final S... | assertEquals(mTestTrip.getNote(), TRIP_NOTE);
mTestTrip.setNote(UPDATED_TRIP_NOTE);
assertEquals(mTestTrip.getNote(), UPDATED_TRIP_NOTE);
}
} | [FOCAL] public final String Trip.getNote()
[CLASS] class Trip implements Serializable, Comparable<Trip>, Cloneable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Trip(); Trip(String parName, GregorianCalendar parStartDate, GregorianCalendar parEndDate, String parNote, SortModes par... | /* static context
[FOCAL] public final String Trip.getNote()
*/
| /* static context
[FOCAL] public final String Trip.getNote()
*/
class Trip implements Serializable, Comparable<Trip>, Cloneable {
public final String getNote() {
return mNote;
}
public Trip();
public Trip(final String parName,
final GregorianCalendar parStartDate,
... | true | ok | {"focal": {"class": "Trip", "name": "getNote", "signature": "String getNote()", "start_line": 3, "modifiers": "public final", "params": [], "return_type": "String"}, "class_info": {"name": "Trip", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serializable, Comparable<Trip>, Cloneable", "fields": ... |
48641480_0 | class MainService {
public String doSomething() {
if (restService.executeServerCall()) {
return "Hello world";
} else {
throw new RuntimeException("Error!");
}
}
@Inject public MainService(RestService restService);
@Rule public JUnitDaggerMockRule rule... | when(restService.executeServerCall()).thenReturn(true);
String s = mainService.doSomething();
assertThat(s).isEqualTo("Hello world");
}
} | [FOCAL] public String MainService.doSomething()
[CLASS] class MainService
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] RestService.executeServerCall/0
[NEW] RuntimeException
[FIELDS] read=restService:RestService
[EXCEPTIONS] throws RuntimeException
[THROWS-WHEN] RuntimeException... | /* static context
[FOCAL] public String MainService.doSomething()
[THROWS-WHEN] RuntimeException when !restService.executeServerCall()
[PATH1] if(restService.executeServerCall())=T -> return "Hello world"
[PATH2] if(restService.executeServerCall())=F -> throw new RuntimeException("Error!")
[INPUTS] branches=restService... | /* static context
[FOCAL] public String MainService.doSomething()
[THROWS-WHEN] RuntimeException when !restService.executeServerCall()
[PATH1] if(restService.executeServerCall())=T -> return "Hello world"
[PATH2] if(restService.executeServerCall())=F -> throw new RuntimeException("Error!")
[INPUTS] branches=restService... | true | ok | {"focal": {"class": "MainService", "name": "doSomething", "signature": "String doSomething()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "MainService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "rule", "type... |
48675485_89 | class ContextFilter implements Filter {
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
Map<String, String> attachments = invocation.getAttachments();
if (attachments != null) {
attachments = new HashMap<String, String>(attachments);
att... | URL url = URL.valueOf("test://test:11/test?group=dubbo&version=1.1");
Invoker<DemoService> invoker = new MyInvoker<DemoService>(url);
Invocation invocation = new MockInvocation();
Result result = contextFilter.invoke(invoker, invocation);
assertNull(RpcContext.getContext().getInv... | [FOCAL] public Result ContextFilter.invoke(Invoker<?> invoker, Invocation invocation)
[CLASS] class ContextFilter implements Filter
[METRICS] loc=26 cc=4 branches=2 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Invocation.getAttachments/0, Map<String, String>.remove/1, RpcContext.getContext() .setInvoker(invoke... | /* static context
[FOCAL] public Result ContextFilter.invoke(Invoker<?> invoker, Invocation invocation)
[PATH1] if(attachments != null)=T -> if(invocation instanceof RpcInvocation)=T -> return invoker.invoke(invocation)
[PATH2] if(attachments != null)=F -> if(invocation instanceof RpcInvocation)=F -> try-body throws
[I... | /* static context
[FOCAL] public Result ContextFilter.invoke(Invoker<?> invoker, Invocation invocation)
[PATH1] if(attachments != null)=T -> if(invocation instanceof RpcInvocation)=T -> return invoker.invoke(invocation)
[PATH2] if(attachments != null)=F -> if(invocation instanceof RpcInvocation)=F -> try-body throws
[I... | true | ok | {"focal": {"class": "ContextFilter", "name": "invoke", "signature": "Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException", "start_line": 3, "modifiers": "public", "params": [{"name": "invoker", "type": "Invoker<?>"}, {"name": "invocation", "type": "Invocation"}], "return_type": "Result"}, "clas... |
48688246_1 | class TimestampBasedStreamSource implements StreamSource, DbHostInfo {
static String findLastFileStartLeTimestamp(long targetTimestamp, List<String> binlogFiles,
ExtractValidBeginTimestampFunction beginTimestampFunction) {
int max = binlogFiles.size() - 1;
// 先尝试最后一个文件,最后一个文件的第一个事件时间l... | Assert.assertEquals("mysql-bin.005596",
findLastFileStartLeTimestamp(150L, binlogFiles, extractValidBeginTimestampFunction));
}
} | [FOCAL] static String TimestampBasedStreamSource.findLastFileStartLeTimestamp(long targetTimestamp, List<String> binlogFiles, ExtractValidBeginTimestampFunction beginTimestampFunction)
[CLASS] class TimestampBasedStreamSource implements StreamSource, DbHostInfo
[METRICS] loc=33 cc=7 branches=5 loops=1 returns=4 throws=... | /* static context
[FOCAL] static String TimestampBasedStreamSource.findLastFileStartLeTimestamp(long targetTimestamp, List<String> binlogFiles, ExtractValidBeginTimestampFunction beginTimestampFunction)
[PATH1] if(beginTimestampFunction.extract(binlogFiles.get(max)) <= targetTimestamp)#1=F -> if(max > 0 && targetTimest... | /* static context
[FOCAL] static String TimestampBasedStreamSource.findLastFileStartLeTimestamp(long targetTimestamp, List<String> binlogFiles, ExtractValidBeginTimestampFunction beginTimestampFunction)
[PATH1] if(beginTimestampFunction.extract(binlogFiles.get(max)) <= targetTimestamp)#1=F -> if(max > 0 && targetTimest... | true | ok | {"focal": {"class": "TimestampBasedStreamSource", "name": "findLastFileStartLeTimestamp", "signature": "String findLastFileStartLeTimestamp(long targetTimestamp, List<String> binlogFiles, ExtractValidBeginTimestampFunction beginTimestampFunction)", "start_line": 3, "modifiers": "static", "params": [{"name": "targetTime... |
48699616_1 | class Primes {
public static boolean isPrime(int n) {
for (int i = 2; i < n; i++) {
if (n % i == 0) {
return false;
}
}
return true;
}
public static boolean isPrimeFast(int n);
public static boolean isPrimeWhile(int n);
public static boolean isPrime(long n);
}
class PrimeTe... | long n = Integer.MAX_VALUE;
Assert.assertTrue(Primes.isPrime(n));
}
} | [FOCAL] public static boolean Primes.isPrime(int n)
[CLASS] class Primes
[METRICS] loc=8 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[PATH1] for(i < n)=T -> if(n % i == 0)=F -> exit loop -> return true
[PATH2] for(i < n)=T -> if(n % i == 0)=T -> return false
[PATH3] for(i < n)=F -> return true
[INPUTS] branche... | /* static context
[FOCAL] public static boolean Primes.isPrime(int n)
[PATH1] for(i < n)=T -> if(n % i == 0)=F -> exit loop -> return true
[PATH2] for(i < n)=T -> if(n % i == 0)=T -> return false
[PATH3] for(i < n)=F -> return true
[INPUTS] branches=n | result=-
*/
| /* static context
[FOCAL] public static boolean Primes.isPrime(int n)
[PATH1] for(i < n)=T -> if(n % i == 0)=F -> exit loop -> return true
[PATH2] for(i < n)=T -> if(n % i == 0)=T -> return false
[PATH3] for(i < n)=F -> return true
[INPUTS] branches=n | result=-
*/
class Primes {
public static boolean isPrime(int n)... | true | ok | {"focal": {"class": "Primes", "name": "isPrime", "signature": "boolean isPrime(int n)", "start_line": 3, "modifiers": "public static", "params": [{"name": "n", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "Primes", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields":... |
48709314_5 | class StringBuilderUtils {
public static boolean startsWith(@NonNull StringBuilder stringBuilder, @NonNull String start) {
return stringBuilder.indexOf(start) == 0;
}
public static void replace(@NonNull StringBuilder stringBuilder,
@NonNull String toReplace,
... | StringBuilder stringBuilder = new StringBuilder("1234567890");
Assert.assertTrue(StringBuilderUtils.startsWith(stringBuilder, "1"));
Assert.assertFalse(StringBuilderUtils.startsWith(stringBuilder, "2"));
}
} | [FOCAL] public static boolean StringBuilderUtils.startsWith(StringBuilder stringBuilder, String start)
[CLASS] class StringBuilderUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] StringBuilder.indexOf/1
[INPUTS] branches=- | result=start, stringBuilder
[COLLABORATORS] param st... | /* static context
[FOCAL] public static boolean StringBuilderUtils.startsWith(StringBuilder stringBuilder, String start)
[INPUTS] branches=- | result=start, stringBuilder
[COLLABORATORS] param stringBuilder:StringBuilder indexOf/1
[CALLS-EXTERNAL] StringBuilder.indexOf/1
*/
| /* static context
[FOCAL] public static boolean StringBuilderUtils.startsWith(StringBuilder stringBuilder, String start)
[INPUTS] branches=- | result=start, stringBuilder
[COLLABORATORS] param stringBuilder:StringBuilder indexOf/1
[CALLS-EXTERNAL] StringBuilder.indexOf/1
*/
class StringBuilderUtils {
public static... | true | ok | {"focal": {"class": "StringBuilderUtils", "name": "startsWith", "signature": "boolean startsWith(StringBuilder stringBuilder, String start)", "start_line": 3, "modifiers": "public static", "params": [{"name": "stringBuilder", "type": "StringBuilder"}, {"name": "start", "type": "String"}], "return_type": "boolean"}, "cl... |
48789600_2 | class BootstrapHandler {
public BootstrapResponse bootstrap(final Identity sender, final BootstrapRequest request) {
final String endpoint = request.getEndpointName();
// Start session, checking the BS credentials
final BootstrapSession bsSession = this.bsSessionManager.begin(endpoint, sen... | final MockBootstrapSessionManager bsSessionManager = new MockBootstrapSessionManager(true);
final LwM2mBootstrapRequestSender requestSender = new MockRequestSender(true);
final BootstrapStore bsStore = new BootstrapStore() {
@Override
public BootstrapConfig getBootstrap(... | [FOCAL] public BootstrapResponse BootstrapHandler.bootstrap(Identity sender, BootstrapRequest request)
[CLASS] class BootstrapHandler
[METRICS] loc=27 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] void sendDelete(BootstrapSession bsSession, BootstrapConfig cfg)
[CALLS-EXTERNAL] BootstrapRequest.... | /* static context
[FOCAL] public BootstrapResponse BootstrapHandler.bootstrap(Identity sender, BootstrapRequest request)
[PATH1] if(!bsSession.isAuthorized())=F -> if(cfg == null)=T -> return BootstrapResponse.badRequest("no bootstrap config")
[PATH2] if(!bsSession.isAuthorized())=T -> return BootstrapResponse.badReque... | /* static context
[FOCAL] public BootstrapResponse BootstrapHandler.bootstrap(Identity sender, BootstrapRequest request)
[PATH1] if(!bsSession.isAuthorized())=F -> if(cfg == null)=T -> return BootstrapResponse.badRequest("no bootstrap config")
[PATH2] if(!bsSession.isAuthorized())=T -> return BootstrapResponse.badReque... | true | ok | {"focal": {"class": "BootstrapHandler", "name": "bootstrap", "signature": "BootstrapResponse bootstrap(Identity sender, BootstrapRequest request)", "start_line": 3, "modifiers": "public", "params": [{"name": "sender", "type": "Identity"}, {"name": "request", "type": "BootstrapRequest"}], "return_type": "BootstrapRespon... |
48804926_31 | class KeywordRouter implements Router {
@Override
public Agent[] route(Request request) {
String requestText = request.getText().toLowerCase();
String[] tokens = tokenizer.tokenize(requestText);
if (tokens.length == 0) {
return new Agent[0];
}
Set<Agent> age... | Agent agent1 = mock(Agent.class);
MultiValuedMap params1 = new MultiValuedMap();
params1.addString(KeywordRouter.KEYWORDS, "time");
params1.addString(KeywordRouter.KEYWORDS, "date");
Agent agent2 = mock(Agent.class);
MultiValuedMap params2 = new MultiValuedMap();
... | [FOCAL] @Override public Agent[] KeywordRouter.route(Request request)
[CLASS] class KeywordRouter implements Router
[METRICS] loc=16 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] request.getText().toLowerCase/0, Request.getText/0, tokenizer.tokenize/1, agentMap.containsKey/1, Set<Agent>.add/1, a... | /* static context
[FOCAL] @Override public Agent[] KeywordRouter.route(Request request)
[PATH1] if(tokens.length == 0)=F -> foreach(String token : tokens)=T -> if(agentMap.containsKey(token))=T -> exit loop -> return agents.toArray(new Agent[agents.size()])
[PATH2] if(tokens.length == 0)=T -> return new Agent[0]
[PATH3... | /* static context
[FOCAL] @Override public Agent[] KeywordRouter.route(Request request)
[PATH1] if(tokens.length == 0)=F -> foreach(String token : tokens)=T -> if(agentMap.containsKey(token))=T -> exit loop -> return agents.toArray(new Agent[agents.size()])
[PATH2] if(tokens.length == 0)=T -> return new Agent[0]
[PATH3... | true | ok | {"focal": {"class": "KeywordRouter", "name": "route", "signature": "Agent[] route(Request request)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "Request"}], "return_type": "Agent[]"}, "class_info": {"name": "KeywordRouter", "kind": "class", "modifiers": "", "superclass": nu... |
48812966_0 | class PermitQueue {
@SuppressWarnings("unchecked")
public <RESP> CompletableFuture<RESP> runRequest(Supplier<CompletableFuture<RESP>> processor) {
long countId = counter.getAndIncrement();
long time = System.currentTimeMillis();
CompletableFuture<RESP> future = new CompletableFuture<RESP>();
queue.add(new Q... | CompletableFuture<Long> future1 = new CompletableFuture<Long>();
svc.addToReturn(future1);
CompletableFuture<Long> future2 = new CompletableFuture<Long>();
svc.addToReturn(future2);
CompletableFuture<Long> future3 = new CompletableFuture<Long>();
svc.addToReturn(future3);
queue2.runRequest(() -> svc.ru... | [FOCAL] @SuppressWarnings("unchecked") public CompletableFuture<RESP> PermitQueue.runRequest(Supplier<CompletableFuture<RESP>> processor)
[CLASS] class PermitQueue
[METRICS] loc=23 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] int backupSize(); void processItemFromQueue()
[CALLS-EXTERNAL] counte... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public CompletableFuture<RESP> PermitQueue.runRequest(Supplier<CompletableFuture<RESP>> processor)
[PATH1] if(item != null)=T -> if(timeDelayed > timeMsWarning)=T -> if(backupSize() > queuedBackupWarnThreshold)=T -> return future
[PATH2] if(item != null)=T -> if(... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public CompletableFuture<RESP> PermitQueue.runRequest(Supplier<CompletableFuture<RESP>> processor)
[PATH1] if(item != null)=T -> if(timeDelayed > timeMsWarning)=T -> if(backupSize() > queuedBackupWarnThreshold)=T -> return future
[PATH2] if(item != null)=T -> if(... | true | ok | {"focal": {"class": "PermitQueue", "name": "runRequest", "signature": "CompletableFuture<RESP> runRequest(Supplier<CompletableFuture<RESP>> processor)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [{"name": "processor", "type": "Supplier<CompletableFuture<RESP>>"}], "return_type":... |
48878116_0 | class SessionDao {
public void updateAllSync(List<Session> sessions) {
speakerRelation().deleter().execute();
categoryRelation().deleter().execute();
placeRelation().deleter().execute();
for (Session session : sessions) {
insertSpeaker(session.speaker);
inse... | sessionDao.updateAllSync(SESSIONS);
assertThat(orma.selectFromSpeaker().idEq(SPEAKER_ID1)).hasSize(1);
assertThat(orma.selectFromPlace().idEq(PLACE_ID1)).hasSize(1);
assertThat(orma.selectFromCategory().idEq(CATEGORY_ID1)).hasSize(1);
assertThat(orma.selectFromSession().idEq(SES... | [FOCAL] public void SessionDao.updateAllSync(List<Session> sessions)
[CLASS] class SessionDao
[METRICS] loc=12 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] Category_Relation categoryRelation(); Place_Relation placeRelation(); Session_Relation sessionRelation(); Speaker_Relation speakerRelation(... | /* static context
[FOCAL] public void SessionDao.updateAllSync(List<Session> sessions)
[PATH1] foreach(Session session : sessions)=T -> exit loop
[PATH2] foreach(Session session : sessions)=F
[INPUTS] branches=sessions | result=-
[CALLS-INTERNAL] Category_Relation categoryRelation(); Place_Relation placeRelation(); Ses... | /* static context
[FOCAL] public void SessionDao.updateAllSync(List<Session> sessions)
[PATH1] foreach(Session session : sessions)=T -> exit loop
[PATH2] foreach(Session session : sessions)=F
[INPUTS] branches=sessions | result=-
[CALLS-INTERNAL] Category_Relation categoryRelation(); Place_Relation placeRelation(); Ses... | true | ok | {"focal": {"class": "SessionDao", "name": "updateAllSync", "signature": "void updateAllSync(List<Session> sessions)", "start_line": 3, "modifiers": "public", "params": [{"name": "sessions", "type": "List<Session>"}], "return_type": "void"}, "class_info": {"name": "SessionDao", "kind": "class", "modifiers": "", "supercl... |
48891106_15 | class MatchdirFilter extends Filter {
public void process(ScoreChart scorechart, User user, InetAddress source,
char direction, InodeHandleInterface file, RemoteSlave sourceSlave) {
boolean validPath = _negateExpr != _p.matcher(file.getPath()).matches();
if (validPath) {
... | Properties p = new Properties();
p.put("1.assign", "slave1+100, slave2-100");
p.put("1.match", "/path1/*");
Filter f = new MatchdirFilter(1, p);
ScoreChart sc = new ScoreChart(Arrays.asList(rslaves));
f.process(sc, null, null, Transfer.TRANSFER_SENDING_DOWNLOAD, new Dir... | [FOCAL] public void MatchdirFilter.process(ScoreChart scorechart, User user, InetAddress source, char direction, InodeHandleInterface file, RemoteSlave sourceSlave)
[CLASS] class MatchdirFilter extends Filter
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] _p.matcher(file.getPath()... | /* static context
[FOCAL] public void MatchdirFilter.process(ScoreChart scorechart, User user, InetAddress source, char direction, InodeHandleInterface file, RemoteSlave sourceSlave)
[PATH1] if(validPath)=T
[PATH2] if(validPath)=F
[INPUTS] branches=file | result=- | unused=user, source, direction, sourceSlave
[COLLABOR... | /* static context
[FOCAL] public void MatchdirFilter.process(ScoreChart scorechart, User user, InetAddress source, char direction, InodeHandleInterface file, RemoteSlave sourceSlave)
[PATH1] if(validPath)=T
[PATH2] if(validPath)=F
[INPUTS] branches=file | result=- | unused=user, source, direction, sourceSlave
[COLLABOR... | true | ok | {"focal": {"class": "MatchdirFilter", "name": "process", "signature": "void process(ScoreChart scorechart, User user, InetAddress source, char direction, InodeHandleInterface file, RemoteSlave sourceSlave)", "start_line": 3, "modifiers": "public", "params": [{"name": "scorechart", "type": "ScoreChart"}, {"name": "user"... |
48911497_1 | class StudentHelper {
public static Long extractLongIdFromUniqueId(String uniqueId) {
String[] uniqueIdArray = uniqueId.split("_");
Long longId = Long.valueOf(uniqueIdArray[1]);
return longId;
}
public static String extractDeviceIdFromUniqueId(String uniqueId);
public static St... | String uniqueId = "4113947bec18b7ad_1";
Long longId = StudentHelper.extractLongIdFromUniqueId(uniqueId);
assertThat(longId, is(1L));
}
} | [FOCAL] public static Long StudentHelper.extractLongIdFromUniqueId(String uniqueId)
[CLASS] class StudentHelper
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String.split/1, Long.valueOf/1
[INPUTS] branches=- | result=uniqueId
[DATAFLOW] longId@L3->L4; uniqueId@param->L2; uniqueI... | /* static context
[FOCAL] public static Long StudentHelper.extractLongIdFromUniqueId(String uniqueId)
[INPUTS] branches=- | result=uniqueId
[CALLS-EXTERNAL] String.split/1, Long.valueOf/1
*/
| /* static context
[FOCAL] public static Long StudentHelper.extractLongIdFromUniqueId(String uniqueId)
[INPUTS] branches=- | result=uniqueId
[CALLS-EXTERNAL] String.split/1, Long.valueOf/1
*/
class StudentHelper {
public static Long extractLongIdFromUniqueId(String uniqueId) {
String[] uniqueIdArray = uniqu... | true | ok | {"focal": {"class": "StudentHelper", "name": "extractLongIdFromUniqueId", "signature": "Long extractLongIdFromUniqueId(String uniqueId)", "start_line": 3, "modifiers": "public static", "params": [{"name": "uniqueId", "type": "String"}], "return_type": "Long"}, "class_info": {"name": "StudentHelper", "kind": "class", "m... |
48961876_0 | class UpdatePosEvent {
public int getPosition() {
return position;
}
public UpdatePosEvent(int position);
private static UpdatePosEvent event;
}
class UpdatePosEventTest {
private static UpdatePosEvent event;
@Test
public void test() {
| assertThat(event.getPosition(), is(5));
}
} | [FOCAL] public int UpdatePosEvent.getPosition()
[CLASS] class UpdatePosEvent
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] UpdatePosEvent(int position)
[TEST] UpdatePosEventTest: @Test public void test()
[TEST-FIELDS] UpdatePosEvent event | /* static context
[FOCAL] public int UpdatePosEvent.getPosition()
*/
| /* static context
[FOCAL] public int UpdatePosEvent.getPosition()
*/
class UpdatePosEvent {
public int getPosition() {
return position;
}
public UpdatePosEvent(int position);
private static UpdatePosEvent event;
}
class UpdatePosEventTest {
private static UpdatePosEvent event;
@T... | true | ok | {"focal": {"class": "UpdatePosEvent", "name": "getPosition", "signature": "int getPosition()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "UpdatePosEvent", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "event", "typ... |
49018889_0 | class TransformerConfig {
public Set<Integer> findPeriod(String symbol, String interval) {
String key = (symbol + interval).toLowerCase();
if (!periods.containsKey(key)) {
Node<String> n1 = periodsTree.getOtherwiseChild(symbol, "*");
if (n1 == null)
throw new IllegalArgumentException("... |
InputStream content = new DefaultResourceLoader().getResource("classpath:yml/sample.yml").getInputStream();
Map<String, Object> vals = new Yaml().loadAs(content, Map.class);
Map<String, List<Map>> transformers = (Map) vals.get("transformers");
List<Map<String, String>> numchance = (List) transformers... | [FOCAL] public Set<Integer> TransformerConfig.findPeriod(String symbol, String interval)
[CLASS] class TransformerConfig
[METRICS] loc=24 cc=4 branches=3 loops=0 returns=1 throws=2 nesting=2
[CALLS-EXTERNAL] (symbol + interval).toLowerCase/0, periods.containsKey/1, periodsTree.getOtherwiseChild/2, Node<String>.getOther... | /* static context
[FOCAL] public Set<Integer> TransformerConfig.findPeriod(String symbol, String interval)
[THROWS-WHEN] IllegalArgumentException when !periods.containsKey(key) && n1 == null
[THROWS-WHEN] IllegalArgumentException when !periods.containsKey(key) && !(n1 == null) && n2 == null
[PATH1] if(!periods.contains... | /* static context
[FOCAL] public Set<Integer> TransformerConfig.findPeriod(String symbol, String interval)
[THROWS-WHEN] IllegalArgumentException when !periods.containsKey(key) && n1 == null
[THROWS-WHEN] IllegalArgumentException when !periods.containsKey(key) && !(n1 == null) && n2 == null
[PATH1] if(!periods.contains... | true | ok | {"focal": {"class": "TransformerConfig", "name": "findPeriod", "signature": "Set<Integer> findPeriod(String symbol, String interval)", "start_line": 3, "modifiers": "public", "params": [{"name": "symbol", "type": "String"}, {"name": "interval", "type": "String"}], "return_type": "Set<Integer>"}, "class_info": {"name": ... |
49031895_62 | class Agent extends WorldEntity implements Drawable {
public boolean equip(ToolType type) {
if (!this.canEquip(type)) {
return false;
}
Map<String, String> attributes;
switch (type.displayName()) {
case "Axe":
createNewResource();
... | assertTrue(agent.equip(ToolType.SHOVEL));
assertTrue(agent.equip(ToolType.AXE));
assertTrue(agent.equip(ToolType.HAMMER));
assertTrue(agent.equip(ToolType.HOE));
assertTrue(agent.equip(ToolType.PICKAXE));
assertTrue(agent.equip(ToolType.SICKLE));
assertFalse(agent... | [FOCAL] public boolean Agent.equip(ToolType type)
[CLASS] class Agent extends WorldEntity implements Drawable
[METRICS] loc=57 cc=10 branches=2 loops=0 returns=10 throws=0 nesting=1
[CALLS-INTERNAL] SimpleResource getToolResource(ToolType type); boolean canEquip(ToolType toolType); void createNewResource()
[CALLS-EXTER... | /* static context
[FOCAL] public boolean Agent.equip(ToolType type)
[PATH1] if(!this.canEquip(type))=F -> switch(type.displayName())=case "Axe" -> return true
[PATH2] if(!this.canEquip(type))=T -> return false
[PATH3] if(!this.canEquip(type))=F -> switch(type.displayName())=case "Shovel" -> return true
[PATH4] if(!this... | /* static context
[FOCAL] public boolean Agent.equip(ToolType type)
[PATH1] if(!this.canEquip(type))=F -> switch(type.displayName())=case "Axe" -> return true
[PATH2] if(!this.canEquip(type))=T -> return false
[PATH3] if(!this.canEquip(type))=F -> switch(type.displayName())=case "Shovel" -> return true
[PATH4] if(!this... | true | ok | {"focal": {"class": "Agent", "name": "equip", "signature": "boolean equip(ToolType type)", "start_line": 3, "modifiers": "public", "params": [{"name": "type", "type": "ToolType"}], "return_type": "boolean"}, "class_info": {"name": "Agent", "kind": "class", "modifiers": "", "superclass": "WorldEntity", "interfaces": "Dr... |
49057615_42 | class DockerModuleHandle implements ModuleHandle {
@Override
public Future<Void> start() {
if (dockerPull) {
return pullImage().compose(x -> prepareContainer());
}
return prepareContainer();
}
DockerModuleHandle(Vertx vertx, LaunchDescriptor desc,
String id, Ports port... | Vertx vertx = Vertx.vertx();
LaunchDescriptor ld = new LaunchDescriptor();
ld.setDockerImage("folioci/mod-users:5.0.0-SNAPSHOT");
ld.setDockerPull(false);
Ports ports = new Ports(9232, 9233);
JsonObject conf = new JsonObject().put("dockerUrl", "tcp://localhost:9231");
DockerModuleHandle dh... | [FOCAL] @Override public Future<Void> DockerModuleHandle.start()
[CLASS] class DockerModuleHandle implements ModuleHandle
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] Future<Void> prepareContainer(); Future<Void> pullImage()
[CALLS-EXTERNAL] pullImage().compose/1
[PATH1] if(dock... | /* static context
[FOCAL] @Override public Future<Void> DockerModuleHandle.start()
[PATH1] if(dockerPull)=T -> return pullImage().compose(x -> prepareContainer())
[PATH2] if(dockerPull)=F -> return prepareContainer()
[CALLS-INTERNAL] Future<Void> prepareContainer(); Future<Void> pullImage()
[CALLS-EXTERNAL] pullImage()... | /* static context
[FOCAL] @Override public Future<Void> DockerModuleHandle.start()
[PATH1] if(dockerPull)=T -> return pullImage().compose(x -> prepareContainer())
[PATH2] if(dockerPull)=F -> return prepareContainer()
[CALLS-INTERNAL] Future<Void> prepareContainer(); Future<Void> pullImage()
[CALLS-EXTERNAL] pullImage()... | true | ok | {"focal": {"class": "DockerModuleHandle", "name": "start", "signature": "Future<Void> start()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Future<Void>"}, "class_info": {"name": "DockerModuleHandle", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "ModuleHandle",... |
49067019_7 | class DateTimes {
public static long getNextOccurrence(long now, DayOfWeek dayOfWeek, int hour, int minute) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(now);
calendar.set(Calendar.HOUR_OF_DAY, hour);
calendar.set(Calendar.MINUTE, minute);
if (cal... | Calendar expected = Calendar.getInstance(TimeZone.getTimeZone("Europe/Berlin"));
expected.set(2016, Calendar.JULY, 8, 13, 0, 0);
expected.set(Calendar.MILLISECOND, 0);
assertEquals(expected.getTimeInMillis(), DateTimes.getNextOccurrence(JULY_FIRST_2016, DayOfWeek.FRIDAY, 13, 0));
}
... | [FOCAL] public static long DateTimes.getNextOccurrence(long now, DayOfWeek dayOfWeek, int hour, int minute)
[CLASS] class DateTimes
[METRICS] loc=18 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Calendar.getInstance/0, Calendar.setTimeInMillis/1, Calendar.set/2, Calendar.getTimeInMillis/0, Calen... | /* static context
[FOCAL] public static long DateTimes.getNextOccurrence(long now, DayOfWeek dayOfWeek, int hour, int minute)
[PATH1] if(calendar.getTimeInMillis() <= now)=T -> while(calendar.get(Calendar.DAY_OF_WEEK) != dayOfWeek.calendarConst)=T -> exit loop -> return calendar.getTimeInMillis()
[PATH2] if(calendar.ge... | /* static context
[FOCAL] public static long DateTimes.getNextOccurrence(long now, DayOfWeek dayOfWeek, int hour, int minute)
[PATH1] if(calendar.getTimeInMillis() <= now)=T -> while(calendar.get(Calendar.DAY_OF_WEEK) != dayOfWeek.calendarConst)=T -> exit loop -> return calendar.getTimeInMillis()
[PATH2] if(calendar.ge... | true | ok | {"focal": {"class": "DateTimes", "name": "getNextOccurrence", "signature": "long getNextOccurrence(long now, DayOfWeek dayOfWeek, int hour, int minute)", "start_line": 3, "modifiers": "public static", "params": [{"name": "now", "type": "long"}, {"name": "dayOfWeek", "type": "DayOfWeek"}, {"name": "hour", "type": "int"}... |
49071798_21 | class SamhsaMatcher implements Predicate<ExplanationOfBenefit> {
@Override
public boolean test(ExplanationOfBenefit eob) {
ClaimType claimType = TransformerUtils.getClaimType(eob);
if (claimType == ClaimType.CARRIER) {
return testCarrierOrDmeClaim(eob);
} else if (claimType == ClaimType.DME) {
return tes... | SamhsaMatcher matcher = new SamhsaMatcher();
ExplanationOfBenefit sampleEob = getSampleAClaim(ClaimType.HOSPICE);
Coding sampleEobDiagnosis = sampleEob.getDiagnosisFirstRep().getDiagnosisCodeableConcept().getCodingFirstRep();
sampleEobDiagnosis.setSystem(IcdCode.CODING_SYSTEM_ICD_10).setCode(SAMPLE_SAMHSA_ICD_... | [FOCAL] @Override public boolean SamhsaMatcher.test(ExplanationOfBenefit eob)
[CLASS] class SamhsaMatcher implements Predicate<ExplanationOfBenefit>
[METRICS] loc=22 cc=9 branches=8 loops=0 returns=8 throws=1 nesting=8
[CALLS-INTERNAL] boolean testCarrierOrDmeClaim(ExplanationOfBenefit eob); boolean testHhaClaim(Explan... | /* static context
[FOCAL] @Override public boolean SamhsaMatcher.test(ExplanationOfBenefit eob)
[THROWS-WHEN] BadCodeMonkeyException when !(claimType == ClaimType.CARRIER) && !(claimType == ClaimType.DME) && !(claimType == ClaimType.HHA) && !(claimType == ClaimType.HOSPICE) && !(claimType == ClaimType.INPATIENT) && !(c... | /* static context
[FOCAL] @Override public boolean SamhsaMatcher.test(ExplanationOfBenefit eob)
[THROWS-WHEN] BadCodeMonkeyException when !(claimType == ClaimType.CARRIER) && !(claimType == ClaimType.DME) && !(claimType == ClaimType.HHA) && !(claimType == ClaimType.HOSPICE) && !(claimType == ClaimType.INPATIENT) && !(c... | true | ok | {"focal": {"class": "SamhsaMatcher", "name": "test", "signature": "boolean test(ExplanationOfBenefit eob)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "eob", "type": "ExplanationOfBenefit"}], "return_type": "boolean"}, "class_info": {"name": "SamhsaMatcher", "kind": "class", "modifiers": "", ... |
49078733_0 | class ListPresenter extends BasePresenter<ListArcticleView> {
@Override public void detachView() {
super.detachView();
getBlogPosts.unsubscribe();
}
@Inject public ListPresenter(GetBlogPosts getBlogPosts);
@Override public void attachView(ListArcticleView mvpView);
public void getPosts(int page, b... | presenter.detachView();
Mockito.verify(getPosts).unsubscribe();
}
} | [FOCAL] @Override public void ListPresenter.detachView()
[CLASS] class ListPresenter extends BasePresenter<ListArcticleView>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] BasePresenter<ListArcticleView>.detachView/0, getBlogPosts.unsubscribe/0
[COLLABORATORS] field getBlogPosts u... | /* static context
[FOCAL] @Override public void ListPresenter.detachView()
[COLLABORATORS] field getBlogPosts unsubscribe/0
[CALLS-EXTERNAL] BasePresenter<ListArcticleView>.detachView/0, getBlogPosts.unsubscribe/0
*/
| /* static context
[FOCAL] @Override public void ListPresenter.detachView()
[COLLABORATORS] field getBlogPosts unsubscribe/0
[CALLS-EXTERNAL] BasePresenter<ListArcticleView>.detachView/0, getBlogPosts.unsubscribe/0
*/
class ListPresenter extends BasePresenter<ListArcticleView> {
@Override public void detachView() {
... | true | ok | {"focal": {"class": "ListPresenter", "name": "detachView", "signature": "void detachView()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "ListPresenter", "kind": "class", "modifiers": "", "superclass": "BasePresenter<ListArcticleView>", "interfaces": nu... |
49126308_11 | class ElasticScroll implements DatabaseScrolling {
@Override
public DatabaseScrolling withScrollSize(final int size) {
search.setSize(size);
return this;
}
ElasticScroll(
final Client client,
final SearchRequestBuilder search,
final TimeValue timeValue);
@Override public DatabaseScrol... | scroll.withScrollSize(123);
verify(search).setSize(123);
}
} | [FOCAL] @Override public DatabaseScrolling ElasticScroll.withScrollSize(int size)
[CLASS] class ElasticScroll implements DatabaseScrolling
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] SearchRequestBuilder.setSize/1
[FIELDS] read=search:SearchRequestBuilder
[COLLABORATORS] field ... | /* static context
[FOCAL] @Override public DatabaseScrolling ElasticScroll.withScrollSize(int size)
[COLLABORATORS] field search:SearchRequestBuilder setSize/1
[FIELDS] read=search:SearchRequestBuilder
[CALLS-EXTERNAL] SearchRequestBuilder.setSize/1
*/
| /* static context
[FOCAL] @Override public DatabaseScrolling ElasticScroll.withScrollSize(int size)
[COLLABORATORS] field search:SearchRequestBuilder setSize/1
[FIELDS] read=search:SearchRequestBuilder
[CALLS-EXTERNAL] SearchRequestBuilder.setSize/1
*/
class ElasticScroll implements DatabaseScrolling {
@Override
p... | true | ok | {"focal": {"class": "ElasticScroll", "name": "withScrollSize", "signature": "DatabaseScrolling withScrollSize(int size)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "size", "type": "int"}], "return_type": "DatabaseScrolling"}, "class_info": {"name": "ElasticScroll", "kind": "class", "modifier... |
49135503_26 | class CircularBuffer {
int forwards(final int currentPosition){
if (currentPosition == buffer.length-1){
return 0;
}else{
return currentPosition + 1;
}
}
public CircularBuffer(final int size);
public void write(final byte data);
public void readAll... |
final CircularBuffer buffer = new CircularBuffer(10);
assertEquals(1, buffer.forwards(0));
assertEquals(5, buffer.forwards(4));
assertEquals(0, buffer.forwards(9));
}
} | [FOCAL] int CircularBuffer.forwards(int currentPosition)
[CLASS] class CircularBuffer
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[PATH1] if(currentPosition == buffer.length-1)=T -> return 0
[PATH2] if(currentPosition == buffer.length-1)=F -> return currentPosition + 1
[INPUTS] branches=current... | /* static context
[FOCAL] int CircularBuffer.forwards(int currentPosition)
[PATH1] if(currentPosition == buffer.length-1)=T -> return 0
[PATH2] if(currentPosition == buffer.length-1)=F -> return currentPosition + 1
[INPUTS] branches=currentPosition | result=currentPosition
*/
| /* static context
[FOCAL] int CircularBuffer.forwards(int currentPosition)
[PATH1] if(currentPosition == buffer.length-1)=T -> return 0
[PATH2] if(currentPosition == buffer.length-1)=F -> return currentPosition + 1
[INPUTS] branches=currentPosition | result=currentPosition
*/
class CircularBuffer {
int forwards(fi... | true | ok | {"focal": {"class": "CircularBuffer", "name": "forwards", "signature": "int forwards(int currentPosition)", "start_line": 3, "modifiers": "", "params": [{"name": "currentPosition", "type": "int"}], "return_type": "int"}, "class_info": {"name": "CircularBuffer", "kind": "class", "modifiers": "", "superclass": null, "int... |
49206166_56 | class QuotedStringTokenizer implements ITokenizer {
@Override
public String[] tokenize(String input) {
String[] result = tokenizeWithRegExp(input);
if(trimValues) {
result = StringUtils.trimAllElements(result);
}
return result;
}
public QuotedStringTokeniz... | String input = "\" Value0,Value1 \", Value2";
String[] result = new QuotedStringTokenizer(",", false).tokenize(input);
Assert.assertNotNull(result);
Assert.assertEquals(2, result.length);
Assert.assertEquals(" Value0,Value1 ", result[0]);
Assert.assertEquals(" Value2", ... | [FOCAL] @Override public String[] QuotedStringTokenizer.tokenize(String input)
[CLASS] class QuotedStringTokenizer implements ITokenizer
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String[] tokenizeWithRegExp(String input)
[CALLS-EXTERNAL] StringUtils.trimAllElements/1
[PATH1] ... | /* static context
[FOCAL] @Override public String[] QuotedStringTokenizer.tokenize(String input)
[PATH1] if(trimValues)=T -> return result
[PATH2] if(trimValues)=F -> return result
[INPUTS] branches=- | result=input
[CALLS-INTERNAL] String[] tokenizeWithRegExp(String input)
[CALLS-EXTERNAL] StringUtils.trimAllElements/... | /* static context
[FOCAL] @Override public String[] QuotedStringTokenizer.tokenize(String input)
[PATH1] if(trimValues)=T -> return result
[PATH2] if(trimValues)=F -> return result
[INPUTS] branches=- | result=input
[CALLS-INTERNAL] String[] tokenizeWithRegExp(String input)
[CALLS-EXTERNAL] StringUtils.trimAllElements/... | true | ok | {"focal": {"class": "QuotedStringTokenizer", "name": "tokenize", "signature": "String[] tokenize(String input)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "input", "type": "String"}], "return_type": "String[]"}, "class_info": {"name": "QuotedStringTokenizer", "kind": "class", "modifiers": ""... |
49230474_2 | class Cappuccino {
public static void markAsBusy(@NonNull Object object) {
markAsBusy(nameOf(object));
}
private Cappuccino();
@NonNull public static CappuccinoResourceWatcher newIdlingResourceWatcher(@NonNull Object resource);
@NonNull public static CappuccinoResourceWatcher newIdlingRe... | // This test is doing double-duty, testing both the Object and String versions of the method
CappuccinoResourceWatcher watcher1 = Cappuccino.newIdlingResourceWatcher(ANY_NAME);
CappuccinoResourceWatcher watcher2 = Cappuccino.newIdlingResourceWatcher(new Object());
Cappuccino.markAsBusy(... | [FOCAL] public static void Cappuccino.markAsBusy(Object object)
[CLASS] class Cappuccino
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] String nameOf(Object object); void markAsBusy(String name)
[DATAFLOW] object@param->L2
[CLASS-MEMBERS] Cappuccino(); CappuccinoResourceWatcher ne... | /* static context
[FOCAL] public static void Cappuccino.markAsBusy(Object object)
[CALLS-INTERNAL] String nameOf(Object object); void markAsBusy(String name)
*/
| /* static context
[FOCAL] public static void Cappuccino.markAsBusy(Object object)
[CALLS-INTERNAL] String nameOf(Object object); void markAsBusy(String name)
*/
class Cappuccino {
public static void markAsBusy(@NonNull Object object) {
markAsBusy(nameOf(object));
}
private Cappuccino();
@Non... | true | ok | {"focal": {"class": "Cappuccino", "name": "markAsBusy", "signature": "void markAsBusy(Object object)", "start_line": 3, "modifiers": "public static", "params": [{"name": "object", "type": "Object"}], "return_type": "void"}, "class_info": {"name": "Cappuccino", "kind": "class", "modifiers": "", "superclass": null, "inte... |
49235392_12 | class StandardCrimeModel implements CrimeModel {
@Override
public void setTitle(String title) {
crime.setTitle(title);
}
public StandardCrimeModel(Crime crime);
@Override public Date getDate();
@Override public void setSolved(boolean solved);
}
class StandardCrimeModelTest {
@... | Crime crime = new Crime();
StandardCrimeModel model = new StandardCrimeModel(crime);
model.setTitle("title");
assertThat(crime.getTitle(), is(equalTo("title")));
}
} | [FOCAL] @Override public void StandardCrimeModel.setTitle(String title)
[CLASS] class StandardCrimeModel implements CrimeModel
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] crime.setTitle/1
[COLLABORATORS] field crime setTitle/1
[DATAFLOW] title@param->L3
[CLASS-MEMBERS] Standard... | /* static context
[FOCAL] @Override public void StandardCrimeModel.setTitle(String title)
[COLLABORATORS] field crime setTitle/1
[CALLS-EXTERNAL] crime.setTitle/1
*/
| /* static context
[FOCAL] @Override public void StandardCrimeModel.setTitle(String title)
[COLLABORATORS] field crime setTitle/1
[CALLS-EXTERNAL] crime.setTitle/1
*/
class StandardCrimeModel implements CrimeModel {
@Override
public void setTitle(String title) {
crime.setTitle(title);
}
public ... | true | ok | {"focal": {"class": "StandardCrimeModel", "name": "setTitle", "signature": "void setTitle(String title)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "title", "type": "String"}], "return_type": "void"}, "class_info": {"name": "StandardCrimeModel", "kind": "class", "modifiers": "", "superclass"... |
49250409_4 | class State {
public void setLoading(@Nullable String path) {
if (!isLoaded(path)) {
loadState = LoadState.LOADING;
this.path = path;
}
}
@Nullable public String getPath();
public boolean isDeinit();
public void setDeinit();
public boolean isInit();
... | subject.setLoading(PATH_A);
assertInit(true);
}
} | [FOCAL] public void State.setLoading(String path)
[CLASS] class State
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] boolean isLoaded(String path)
[FIELDS] write=path
[PATH1] if(!isLoaded(path))=T
[PATH2] if(!isLoaded(path))=F
[INPUTS] branches=path | result=-
[STATE] path via get... | /* static context
[FOCAL] public void State.setLoading(String path)
[PATH1] if(!isLoaded(path))=T
[PATH2] if(!isLoaded(path))=F
[INPUTS] branches=path | result=-
[STATE] path via getPath()
[CALLS-INTERNAL] boolean isLoaded(String path)
[FIELDS] write=path
*/
| /* static context
[FOCAL] public void State.setLoading(String path)
[PATH1] if(!isLoaded(path))=T
[PATH2] if(!isLoaded(path))=F
[INPUTS] branches=path | result=-
[STATE] path via getPath()
[CALLS-INTERNAL] boolean isLoaded(String path)
[FIELDS] write=path
*/
class State {
public void setLoading(@Nullable String pa... | true | ok | {"focal": {"class": "State", "name": "setLoading", "signature": "void setLoading(String path)", "start_line": 3, "modifiers": "public", "params": [{"name": "path", "type": "String"}], "return_type": "void"}, "class_info": {"name": "State", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "field... |
49317403_22 | class ScheduleDayPresenter extends BaseFragmentPresenter<ScheduleDayView> {
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
this.view.initSlotsList(scheduleDay.getSlots());
}
public ScheduleDayPresent... | // When
presenter.onViewCreated(null, null);
// Then
verify(view).initSlotsList(slots);
}
} | [FOCAL] @Override public void ScheduleDayPresenter.onViewCreated(View view, Bundle savedInstanceState)
[CLASS] class ScheduleDayPresenter extends BaseFragmentPresenter<ScheduleDayView>
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] BaseFragmentPresenter<ScheduleDayView>.onViewCrea... | /* static context
[FOCAL] @Override public void ScheduleDayPresenter.onViewCreated(View view, Bundle savedInstanceState)
[COLLABORATORS] param view:View initSlotsList/1; field scheduleDay getSlots/0
[FIELDS] read=view:ScheduleDayView
[CALLS-EXTERNAL] BaseFragmentPresenter<ScheduleDayView>.onViewCreated/2, ScheduleDayVi... | /* static context
[FOCAL] @Override public void ScheduleDayPresenter.onViewCreated(View view, Bundle savedInstanceState)
[COLLABORATORS] param view:View initSlotsList/1; field scheduleDay getSlots/0
[FIELDS] read=view:ScheduleDayView
[CALLS-EXTERNAL] BaseFragmentPresenter<ScheduleDayView>.onViewCreated/2, ScheduleDayVi... | true | ok | {"focal": {"class": "ScheduleDayPresenter", "name": "onViewCreated", "signature": "void onViewCreated(View view, Bundle savedInstanceState)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "view", "type": "View"}, {"name": "savedInstanceState", "type": "Bundle"}], "return_type": "void"}, "class_i... |
49339629_39 | class MulticastSender extends UDPSender {
@Override
public void init() throws Exception {
Configuration configuration = getConfiguration();
SocketAddress la = Util.
computeLocalEndpoint(
configuration.getNetworkInterface(),
confi... |
Configuration c = new Configuration();
assertNull(c.getInetAddress());
MulticastSender s = getSenderToTest(c);
try {
s.init();
fail("should have thrown exception");
}
catch(UserErrorException e) {
String msg = e.getMessage();
... | [FOCAL] @Override public void MulticastSender.init()
[CLASS] class MulticastSender extends UDPSender
[METRICS] loc=35 cc=3 branches=2 loops=0 returns=0 throws=2 nesting=1
[CALLS-EXTERNAL] getConfiguration/0 (inherited), Util.computeLocalEndpoint/5, Configuration.getNetworkInterface/0, Configuration.getLocalInetAddress/... | /* static context
[FOCAL] @Override public void MulticastSender.init()
[THROWS-WHEN] UserErrorException when mcastAddress == null
[THROWS-WHEN] UserErrorException when !(mcastAddress == null) && !mcastAddress.isMulticastAddress()
[PATH1] if(mcastAddress == null)=F -> if(!mcastAddress.isMulticastAddress())=T -> throw ne... | /* static context
[FOCAL] @Override public void MulticastSender.init()
[THROWS-WHEN] UserErrorException when mcastAddress == null
[THROWS-WHEN] UserErrorException when !(mcastAddress == null) && !mcastAddress.isMulticastAddress()
[PATH1] if(mcastAddress == null)=F -> if(!mcastAddress.isMulticastAddress())=T -> throw ne... | true | ok | {"focal": {"class": "MulticastSender", "name": "init", "signature": "void init() throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "MulticastSender", "kind": "class", "modifiers": "", "superclass": "UDPSender", "interfaces": null, "fields":... |
49354052_361 | class DefaultByteBufHolder implements ByteBufHolder {
@Override
public String toString() {
return StringUtil.simpleClassName(this) + '(' + contentToString() + ')';
}
public DefaultByteBufHolder(ByteBuf data);
@Override public ByteBuf content();
@Override public ByteBufHolder copy();
... | ByteBufHolder holder = new DefaultByteBufHolder(Unpooled.buffer());
assertEquals(1, holder.refCnt());
assertNotNull(holder.toString());
assertTrue(holder.release());
assertNotNull(holder.toString());
}
} | [FOCAL] @Override public String DefaultByteBufHolder.toString()
[CLASS] class DefaultByteBufHolder implements ByteBufHolder
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String contentToString()
[CALLS-EXTERNAL] StringUtil.simpleClassName/1
[CLASS-MEMBERS] DefaultByteBufHolder(By... | /* static context
[FOCAL] @Override public String DefaultByteBufHolder.toString()
[CALLS-INTERNAL] String contentToString()
[CALLS-EXTERNAL] StringUtil.simpleClassName/1
*/
| /* static context
[FOCAL] @Override public String DefaultByteBufHolder.toString()
[CALLS-INTERNAL] String contentToString()
[CALLS-EXTERNAL] StringUtil.simpleClassName/1
*/
class DefaultByteBufHolder implements ByteBufHolder {
@Override
public String toString() {
return StringUtil.simpleClassName(this)... | true | ok | {"focal": {"class": "DefaultByteBufHolder", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "DefaultByteBufHolder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "ByteBufHolder", ... |
49362377_10 | class ReportHandler {
public synchronized HandleStatus handleReport(Intent intent) {
HandleStatus status = HandleStatus.HANDLED;
boolean isOnline = mNetworkManager.isOnline() && canUseNetwork();
try {
if (null == intent.getExtras()) return status;
int event = intent.... | mConfig.setBulkSize(2);
when(mStorage.addEvent(mTable, DATA)).thenReturn(2);
Intent intent = newReport(SdkEvent.ENQUEUE, reportMap);
mHandler.handleReport(intent);
verify(mStorage, times(1)).addEvent(mTable, DATA);
verify(mStorage, times(1)).getEvents(mTable, mConfig.getB... | [FOCAL] public synchronized HandleStatus ReportHandler.handleReport(Intent intent)
[CLASS] class ReportHandler
[METRICS] loc=49 cc=13 branches=6 loops=2 returns=4 throws=0 nesting=4
[CALLS-INTERNAL] SendStatus send(String data, String url); String createMessage(JSONObject obj, boolean bulk); boolean canUseNetwork(); vo... | /* static context
[FOCAL] public synchronized HandleStatus ReportHandler.handleReport(Intent intent)
[PATH1] if(null == intent.getExtras())=F -> try-body throws -> switch(event)=case SdkEvent.POST_SYNC -> if(isOnline)#2=T -> if(SendStatus.RETRY != send(message, url))=F -> if(isOnline && mConfig.getBulkSize() <= nRows)=... | /* static context
[FOCAL] public synchronized HandleStatus ReportHandler.handleReport(Intent intent)
[PATH1] if(null == intent.getExtras())=F -> try-body throws -> switch(event)=case SdkEvent.POST_SYNC -> if(isOnline)#2=T -> if(SendStatus.RETRY != send(message, url))=F -> if(isOnline && mConfig.getBulkSize() <= nRows)=... | true | ok | {"focal": {"class": "ReportHandler", "name": "handleReport", "signature": "HandleStatus handleReport(Intent intent)", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "intent", "type": "Intent"}], "return_type": "HandleStatus"}, "class_info": {"name": "ReportHandler", "kind": "class", "modifiers... |
49384652_18 | class MasterSlaveJobSummaryServiceImpl extends AbstractService implements MasterSlaveJobSummaryService {
@Override
public synchronized void saveJobSummary(MasterSlaveJobSummary masterSlaveJobSummary) {
MasterSlaveJobData masterSlaveJobData = masterSlaveApiFactory.jobApi().getJob(masterSlaveJobSummary.g... | masterSlaveJobService.saveJob(getSampleJarFile(), "com.zuoxiaolong");
List<MasterSlaveJobSummary> jobSummaries = masterSlaveJobSummaryService.getAllJobSummaries();
MasterSlaveJobSummary jobSummary = jobSummaries.get(0);
jobSummary.setJobCron("0 * * * * ?");
jobSummary.setMisfireP... | [FOCAL] @Override public synchronized void MasterSlaveJobSummaryServiceImpl.saveJobSummary(MasterSlaveJobSummary masterSlaveJobSummary)
[CLASS] class MasterSlaveJobSummaryServiceImpl extends AbstractService implements MasterSlaveJobSummaryService
[METRICS] loc=25 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CA... | /* static context
[FOCAL] @Override public synchronized void MasterSlaveJobSummaryServiceImpl.saveJobSummary(MasterSlaveJobSummary masterSlaveJobSummary)
[PATH1] if(masterSlaveJobData == null)=T
[PATH2] if(masterSlaveJobData == null)=F
[INPUTS] branches=masterSlaveJobSummary | result=-
[COLLABORATORS] field masterSlave... | /* static context
[FOCAL] @Override public synchronized void MasterSlaveJobSummaryServiceImpl.saveJobSummary(MasterSlaveJobSummary masterSlaveJobSummary)
[PATH1] if(masterSlaveJobData == null)=T
[PATH2] if(masterSlaveJobData == null)=F
[INPUTS] branches=masterSlaveJobSummary | result=-
[COLLABORATORS] field masterSlave... | true | ok | {"focal": {"class": "MasterSlaveJobSummaryServiceImpl", "name": "saveJobSummary", "signature": "void saveJobSummary(MasterSlaveJobSummary masterSlaveJobSummary)", "start_line": 3, "modifiers": "@Override public synchronized", "params": [{"name": "masterSlaveJobSummary", "type": "MasterSlaveJobSummary"}], "return_type":... |
49420416_0 | class Fetcher {
public Fetcher skipNulls() {
this.skipNulls = true;
return this;
}
public Fetcher(Cursor cursor);
public static Fetcher of(Cursor cursor);
public Optional<ResultT> toValue(Converter<ResultT> converter);
public List<ResultT> toList(Converter<ResultT> converter)... | when(cursor.getCount()).thenReturn(3);
when(cursor.moveToNext()).thenReturn(true, true, true, false);
when(cursor.getString(0)).thenReturn("First", null, "Third");
Fetcher fetcher = Fetcher.of(cursor).skipNulls();
List<String> result = fetcher.toList(Converter.STRING);
assertThat(result).isNotNu... | [FOCAL] public Fetcher Fetcher.skipNulls()
[CLASS] class Fetcher
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] write=skipNulls
[STATE] skipNulls
[CLASS-MEMBERS] Fetcher(Cursor cursor); Fetcher of(Cursor cursor); Optional<ResultT> toValue(Converter<ResultT> converter); List<ResultT> toLis... | /* static context
[FOCAL] public Fetcher Fetcher.skipNulls()
[STATE] skipNulls
[FIELDS] write=skipNulls
*/
| /* static context
[FOCAL] public Fetcher Fetcher.skipNulls()
[STATE] skipNulls
[FIELDS] write=skipNulls
*/
class Fetcher {
public Fetcher skipNulls() {
this.skipNulls = true;
return this;
}
public Fetcher(Cursor cursor);
public static Fetcher of(Cursor cursor);
public Optional<Re... | true | ok | {"focal": {"class": "Fetcher", "name": "skipNulls", "signature": "Fetcher skipNulls()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Fetcher"}, "class_info": {"name": "Fetcher", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "cursor", "type": "Curs... |
49445030_0 | class IntegerUtils {
public static int log10(long unsigned) {
if (unsigned != 0) {
int digits = maxLog10ForLeadingZeros[Long.numberOfLeadingZeros(unsigned)];
return digits + (unsigned >= powersOf10[digits] ? 1 : 0);
} else {
return 1;
}
}
private... | assertEquals(1, IntegerUtils.log10(1));
assertEquals(1, IntegerUtils.log10(9));
assertEquals(2, IntegerUtils.log10(10));
assertEquals(2, IntegerUtils.log10(11));
assertEquals(2, IntegerUtils.log10(99));
assertEquals(3, IntegerUtils.log10(100));
assertEquals(3, I... | [FOCAL] public static int IntegerUtils.log10(long unsigned)
[CLASS] class IntegerUtils
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Long.numberOfLeadingZeros/1
[PATH1] if(unsigned != 0)=T -> return digits + (unsigned >= powersOf10[digits] ? 1 : 0)
[PATH2] if(unsigned != 0)=F -> ... | /* static context
[FOCAL] public static int IntegerUtils.log10(long unsigned)
[PATH1] if(unsigned != 0)=T -> return digits + (unsigned >= powersOf10[digits] ? 1 : 0)
[PATH2] if(unsigned != 0)=F -> return 1
[INPUTS] branches=unsigned | result=unsigned
[CALLS-EXTERNAL] Long.numberOfLeadingZeros/1
*/
| /* static context
[FOCAL] public static int IntegerUtils.log10(long unsigned)
[PATH1] if(unsigned != 0)=T -> return digits + (unsigned >= powersOf10[digits] ? 1 : 0)
[PATH2] if(unsigned != 0)=F -> return 1
[INPUTS] branches=unsigned | result=unsigned
[CALLS-EXTERNAL] Long.numberOfLeadingZeros/1
*/
class IntegerUtils {
... | true | ok | {"focal": {"class": "IntegerUtils", "name": "log10", "signature": "int log10(long unsigned)", "start_line": 3, "modifiers": "public static", "params": [{"name": "unsigned", "type": "long"}], "return_type": "int"}, "class_info": {"name": "IntegerUtils", "kind": "class", "modifiers": "", "superclass": null, "interfaces":... |
49461308_5 | class RemoteUserFederationProviderFactory implements UserFederationProviderFactory {
@Override
public UserFederationSyncResult syncChangedUsers(KeycloakSessionFactory sessionFactory, String realmId, UserFederationProviderModel model, Date lastSync)
{
throw new UnsupportedOperationException("This fe... | String realmId = UUID.randomUUID().toString();
Date lastSync = new Date();
factory.syncChangedUsers(keycloakSessionFactory, realmId, userFederationProviderModel, lastSync);
verifyZeroInteractions(keycloakSession, keycloakSessionFactory, realmId, userFederationProviderModel, lastSync);
... | [FOCAL] @Override public UserFederationSyncResult RemoteUserFederationProviderFactory.syncChangedUsers(KeycloakSessionFactory sessionFactory, String realmId, UserFederationProviderModel model, Date lastSync)
[CLASS] class RemoteUserFederationProviderFactory implements UserFederationProviderFactory
[METRICS] loc=5 cc=1 ... | /* static context
[FOCAL] @Override public UserFederationSyncResult RemoteUserFederationProviderFactory.syncChangedUsers(KeycloakSessionFactory sessionFactory, String realmId, UserFederationProviderModel model, Date lastSync)
[THROWS-WHEN] UnsupportedOperationException when always
[INPUTS] branches=- | result=- | unuse... | /* static context
[FOCAL] @Override public UserFederationSyncResult RemoteUserFederationProviderFactory.syncChangedUsers(KeycloakSessionFactory sessionFactory, String realmId, UserFederationProviderModel model, Date lastSync)
[THROWS-WHEN] UnsupportedOperationException when always
[INPUTS] branches=- | result=- | unuse... | true | ok | {"focal": {"class": "RemoteUserFederationProviderFactory", "name": "syncChangedUsers", "signature": "UserFederationSyncResult syncChangedUsers(KeycloakSessionFactory sessionFactory, String realmId, UserFederationProviderModel model, Date lastSync)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": ... |
49472222_0 | class FoCorsFilter implements ContainerResponseFilter {
List<String> parseCorsAllowedOrigins(String corsAllowedOriginsStr) {
List<String> resultList = new ArrayList<>();
corsAllowedOriginsStr = StringUtils.trimToNull(corsAllowedOriginsStr);
String[] originArray = StringUtils.split(corsAllowedOriginsStr, ";");
... | FoCorsFilter filter = new FoCorsFilter();
assertArrayEquals(new String[0], filter.parseCorsAllowedOrigins(" ").toArray());
assertArrayEquals(new String[]{"http://foo.com", "https://bar.com:2018"},
filter.parseCorsAllowedOrigins(" http://foo.com ; https://bar.com:2018 ").toArray(... | [FOCAL] List<String> FoCorsFilter.parseCorsAllowedOrigins(String corsAllowedOriginsStr)
[CLASS] class FoCorsFilter implements ContainerResponseFilter
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] StringUtils.trimToNull/1, StringUtils.split/2, Arrays.asList(originArray).stream().... | /* static context
[FOCAL] List<String> FoCorsFilter.parseCorsAllowedOrigins(String corsAllowedOriginsStr)
[PATH1] if(originArray == null || originArray.length == 0)=T -> return resultList
[PATH2] if(originArray == null || originArray.length == 0)=F -> return resultList
[INPUTS] branches=corsAllowedOriginsStr | result=c... | /* static context
[FOCAL] List<String> FoCorsFilter.parseCorsAllowedOrigins(String corsAllowedOriginsStr)
[PATH1] if(originArray == null || originArray.length == 0)=T -> return resultList
[PATH2] if(originArray == null || originArray.length == 0)=F -> return resultList
[INPUTS] branches=corsAllowedOriginsStr | result=c... | true | ok | {"focal": {"class": "FoCorsFilter", "name": "parseCorsAllowedOrigins", "signature": "List<String> parseCorsAllowedOrigins(String corsAllowedOriginsStr)", "start_line": 3, "modifiers": "", "params": [{"name": "corsAllowedOriginsStr", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "FoCorsFilte... |
49473421_2 | class Promote {
public static Condition.Value every(int n) { return new Condition().every(n); public static Condition.Value every(int n) { return new Condition().every(n); }
public static Condition.Value every(int n) { return new Condition().every(n); public static Condition.Value after(int n);
public static Conditio... | assertThat(Promote.every(2).times().show(c, 100, null), is(true));
assertThat(Promote.every(2).times().show(c, 100, null), is(false));
assertThat(Promote.every(2).times().show(c, 100, null), is(true));
assertThat(Promote.every(2).times().show(c, 100, null), is(false));
assertThat(Promote.every(2).times().show... | [FOCAL] public static Condition.Value Promote.every(int n)
[CLASS] class Promote
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] new Condition().every/1
[NEW] Condition
[INPUTS] branches=- | result=n
[DATAFLOW] n@param->L1
[CLASS-MEMBERS] Condition.Value after(int n); Condition.Val... | /* static context
[FOCAL] public static Condition.Value Promote.every(int n)
[INPUTS] branches=- | result=n
[NEW] Condition
[CALLS-EXTERNAL] new Condition().every/1
*/
| /* static context
[FOCAL] public static Condition.Value Promote.every(int n)
[INPUTS] branches=- | result=n
[NEW] Condition
[CALLS-EXTERNAL] new Condition().every/1
*/
class Promote {
public static Condition.Value every(int n) { return new Condition().every(n); public static Condition.Value every(int n) { return new C... | true | ok | {"focal": {"class": "Promote", "name": "every", "signature": "Condition.Value every(int n)", "start_line": 3, "modifiers": "public static", "params": [{"name": "n", "type": "int"}], "return_type": "Condition.Value"}, "class_info": {"name": "Promote", "kind": "class", "modifiers": "", "superclass": null, "interfaces": n... |
49493793_5 | class Binder {
static void bind(SQLiteStmt stmt, int index, Object value) {
if (value == null) {
stmt.bindNull(index);
} else if (value instanceof Integer
|| value instanceof Long
|| value instanceof Short) {
stmt.bindLong(index, ((Number) val... | Binder.bind(mStmt, 6, "test");
Mockito.verify(mStmt).bindString(6, "test");
}
} | [FOCAL] static void Binder.bind(SQLiteStmt stmt, int index, Object value)
[CLASS] class Binder
[METRICS] loc=17 cc=6 branches=5 loops=0 returns=0 throws=1 nesting=5
[CALLS-EXTERNAL] SQLiteStmt.bindNull/1, SQLiteStmt.bindLong/2, ((Number) value).longValue/0, SQLiteStmt.bindDouble/2, ((Number) value).doubleValue/0, SQLit... | /* static context
[FOCAL] static void Binder.bind(SQLiteStmt stmt, int index, Object value)
[THROWS-WHEN] AlchemyException when !(value == null) && !(value instanceof Integer || value instanceof Long || value instanceof Short) && !(value instanceof Number) && !(value instanceof String) && !(value instanceof byte[])
[PA... | /* static context
[FOCAL] static void Binder.bind(SQLiteStmt stmt, int index, Object value)
[THROWS-WHEN] AlchemyException when !(value == null) && !(value instanceof Integer || value instanceof Long || value instanceof Short) && !(value instanceof Number) && !(value instanceof String) && !(value instanceof byte[])
[PA... | true | ok | {"focal": {"class": "Binder", "name": "bind", "signature": "void bind(SQLiteStmt stmt, int index, Object value)", "start_line": 3, "modifiers": "static", "params": [{"name": "stmt", "type": "SQLiteStmt"}, {"name": "index", "type": "int"}, {"name": "value", "type": "Object"}], "return_type": "void"}, "class_info": {"nam... |
49517364_2 | class TokenRegistry implements InvalidClientIdHandler, InternalRegistrationProgressListener {
public void receive(String token) throws JSONException {
Log.d(TAG, "Received token for " + platformType.toString() + ": " + token);
SharedPreferences preferences = PreferenceManager.getDefaultSharedPrefer... | tokenRegistry.receive("mysuperspecialfcmtoken");
verify(factory).newTokenUploadHandler(context, stack);
ArgumentCaptor paramsCaptor = ArgumentCaptor.forClass(StringEntity.class);
verify(client).post(
eq(context),
eq("https://nativepushclient-cluster1.pus... | [FOCAL] public void TokenRegistry.receive(String token)
[CLASS] class TokenRegistry implements InvalidClientIdHandler, InternalRegistrationProgressListener
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] String sharedPreferencesKey(String appKey); void update(String token, String ... | /* static context
[FOCAL] public void TokenRegistry.receive(String token)
[PATH1] if(cachedId == null)=T
[PATH2] if(cachedId == null)=F
[INPUTS] branches=context | result=-
[COLLABORATORS] field platformType toString/0
[EXCEPTIONS] declares JSONException
[CALLS-INTERNAL] String sharedPreferencesKey(String appKey); void... | /* static context
[FOCAL] public void TokenRegistry.receive(String token)
[PATH1] if(cachedId == null)=T
[PATH2] if(cachedId == null)=F
[INPUTS] branches=context | result=-
[COLLABORATORS] field platformType toString/0
[EXCEPTIONS] declares JSONException
[CALLS-INTERNAL] String sharedPreferencesKey(String appKey); void... | true | ok | {"focal": {"class": "TokenRegistry", "name": "receive", "signature": "void receive(String token) throws JSONException", "start_line": 3, "modifiers": "public", "params": [{"name": "token", "type": "String"}], "return_type": "void"}, "class_info": {"name": "TokenRegistry", "kind": "class", "modifiers": "", "superclass":... |
49529486_102 | class PaymentMethodsPresenter extends BasePresenter<PaymentMethods.View> implements PaymentMethods.Actions {
@Override
public void start() {
definePaymentMethodsExclusions();
retrievePaymentMethods();
if (showBankDeals && isViewAttached()) {
getView().showBankDeals();
... | final List<PaymentMethod> paymentMethodsStub = PaymentMethodStub.getAllBySite(Sites.ARGENTINA.getId());
when(paymentMethodsRepository.getPaymentMethods()).thenReturn(new StubSuccessMpCall(paymentMethodsStub));
presenter.start();
verify(view).showProgress();
verify(view).showPay... | [FOCAL] @Override public void PaymentMethodsPresenter.start()
[CLASS] class PaymentMethodsPresenter extends BasePresenter<PaymentMethods.View> implements PaymentMethods.Actions
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void definePaymentMethodsExclusions(); void retrievePayme... | /* static context
[FOCAL] @Override public void PaymentMethodsPresenter.start()
[PATH1] if(showBankDeals && isViewAttached())=T
[PATH2] if(showBankDeals && isViewAttached())=F
[CALLS-INTERNAL] void definePaymentMethodsExclusions(); void retrievePaymentMethods()
[CALLS-EXTERNAL] isViewAttached/0 (inherited), getView().s... | /* static context
[FOCAL] @Override public void PaymentMethodsPresenter.start()
[PATH1] if(showBankDeals && isViewAttached())=T
[PATH2] if(showBankDeals && isViewAttached())=F
[CALLS-INTERNAL] void definePaymentMethodsExclusions(); void retrievePaymentMethods()
[CALLS-EXTERNAL] isViewAttached/0 (inherited), getView().s... | true | ok | {"focal": {"class": "PaymentMethodsPresenter", "name": "start", "signature": "void start()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "PaymentMethodsPresenter", "kind": "class", "modifiers": "", "superclass": "BasePresenter<PaymentMethods.View>", "in... |
49574503_10 | class Either implements Union2<L, R> {
public static <L, R> Either<L, R> right(R value) {
return new Right<>(value);
}
Either();
public static Either<L, R> left(L value);
public abstract boolean isLeft();
public abstract boolean isRight();
@Deprecated public abstract void fold(A... | Either<EventA, EventB> right = Either.right(eventB);
right.continued(actionA, actionB);
verify(actionB).call(eventB);
verifyNoMoreInteractions(actionA);
}
} | [FOCAL] public static Either<L, R> Either.right(R value)
[CLASS] class Either implements Union2<L, R>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Right<>
[INPUTS] branches=- | result=value
[DATAFLOW] value@param->L2
[CLASS-MEMBERS] Either(); Either<L, R> left(L value); boolean isLeft(); b... | /* static context
[FOCAL] public static Either<L, R> Either.right(R value)
[INPUTS] branches=- | result=value
[NEW] Right<>
*/
| /* static context
[FOCAL] public static Either<L, R> Either.right(R value)
[INPUTS] branches=- | result=value
[NEW] Right<>
*/
class Either implements Union2<L, R> {
public static <L, R> Either<L, R> right(R value) {
return new Right<>(value);
}
Either();
public static Either<L, R> left(L v... | true | ok | {"focal": {"class": "Either", "name": "right", "signature": "Either<L, R> right(R value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "R"}], "return_type": "Either<L, R>"}, "class_info": {"name": "Either", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Unio... |
49610798_1 | class KeyboardRow extends ArrayList<KeyboardButton> implements Validable {
public void addAll(List<String> buttonNames) {
buttonNames.forEach(name -> super.add(new KeyboardButton(name)));
}
public boolean add(String text);
public void add(int index, String text);
public boolean contains(St... | final KeyboardRow keyboardRow = new KeyboardRow();
keyboardRow.addAll(new ArrayList<String>());
assertTrue(keyboardRow.isEmpty());
}
} | [FOCAL] public void KeyboardRow.addAll(List<String> buttonNames)
[CLASS] class KeyboardRow extends ArrayList<KeyboardButton> implements Validable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] List<String>.forEach/1, ArrayList<KeyboardButton>.add/1
[NEW] KeyboardButton
[COLLABORAT... | /* static context
[FOCAL] public void KeyboardRow.addAll(List<String> buttonNames)
[COLLABORATORS] param buttonNames:List<String> forEach/1
[NEW] KeyboardButton
[CALLS-EXTERNAL] List<String>.forEach/1, ArrayList<KeyboardButton>.add/1
*/
| /* static context
[FOCAL] public void KeyboardRow.addAll(List<String> buttonNames)
[COLLABORATORS] param buttonNames:List<String> forEach/1
[NEW] KeyboardButton
[CALLS-EXTERNAL] List<String>.forEach/1, ArrayList<KeyboardButton>.add/1
*/
class KeyboardRow extends ArrayList<KeyboardButton> implements Validable {
pub... | true | ok | {"focal": {"class": "KeyboardRow", "name": "addAll", "signature": "void addAll(List<String> buttonNames)", "start_line": 3, "modifiers": "public", "params": [{"name": "buttonNames", "type": "List<String>"}], "return_type": "void"}, "class_info": {"name": "KeyboardRow", "kind": "class", "modifiers": "", "superclass": "A... |
49656131_127 | class Router {
public void launchCreateDeckFlow(Activity activity, NewDeckContext newDeckContext) {
Intent createIntent = new Intent(activity, GetStartedDeckActivity.class);
createIntent.putExtra(AddDeckActivity.INTENT_KEY_DECK, newDeckContext);
activity.startActivityForResult(createIntent,... | Activity activity = mock(Activity.class);
NewDeckContext newDeckContext = mock(NewDeckContext.class);
router.launchCreateDeckFlow(activity, newDeckContext);
ArgumentCaptor<Intent> argument = ArgumentCaptor.forClass(Intent.class);
verify(activity).startActivityForResult(argument... | [FOCAL] public void Router.launchCreateDeckFlow(Activity activity, NewDeckContext newDeckContext)
[CLASS] class Router
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Intent.putExtra/2, Activity.startActivityForResult/2
[NEW] Intent
[COLLABORATORS] param activity:Activity startActi... | /* static context
[FOCAL] public void Router.launchCreateDeckFlow(Activity activity, NewDeckContext newDeckContext)
[COLLABORATORS] param activity:Activity startActivityForResult/2
[NEW] Intent
[CALLS-EXTERNAL] Intent.putExtra/2, Activity.startActivityForResult/2
*/
| /* static context
[FOCAL] public void Router.launchCreateDeckFlow(Activity activity, NewDeckContext newDeckContext)
[COLLABORATORS] param activity:Activity startActivityForResult/2
[NEW] Intent
[CALLS-EXTERNAL] Intent.putExtra/2, Activity.startActivityForResult/2
*/
class Router {
public void launchCreateDeckFlow(... | true | ok | {"focal": {"class": "Router", "name": "launchCreateDeckFlow", "signature": "void launchCreateDeckFlow(Activity activity, NewDeckContext newDeckContext)", "start_line": 3, "modifiers": "public", "params": [{"name": "activity", "type": "Activity"}, {"name": "newDeckContext", "type": "NewDeckContext"}], "return_type": "vo... |
49670957_523 | class Substring implements Function {
@Override
public Literal evaluate(ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException {
if (args.length < 2 || args.length > 3) {
throw new ValueExprEvaluationException("Incorrect number of arguments for SUBSTR: " + args.length);
}
Value argVa... | Literal pattern = f.createLiteral("12345");
Literal startIndex = f.createLiteral(2);
Literal length = f.createLiteral(3);
Literal result = substrFunc.evaluate(f, pattern, startIndex, length);
assertEquals("234", result.getLabel());
}
} | [FOCAL] @Override public Literal Substring.evaluate(ValueFactory valueFactory, Value... args)
[CLASS] class Substring implements Function
[METRICS] loc=77 cc=14 branches=10 loops=0 returns=3 throws=8 nesting=5
[CALLS-INTERNAL] Literal convert(String lexicalValue, Literal literal, ValueFactory valueFactory); int intFrom... | /* static context
[FOCAL] @Override public Literal Substring.evaluate(ValueFactory valueFactory, Value... args)
[THROWS-WHEN] ValueExprEvaluationException when args.length < 2 || args.length > 3
[THROWS-WHEN] ValueExprEvaluationException when !(args.length < 2 || args.length > 3) && args.length > 2 && argValue instance... | /* static context
[FOCAL] @Override public Literal Substring.evaluate(ValueFactory valueFactory, Value... args)
[THROWS-WHEN] ValueExprEvaluationException when args.length < 2 || args.length > 3
[THROWS-WHEN] ValueExprEvaluationException when !(args.length < 2 || args.length > 3) && args.length > 2 && argValue instance... | true | ok | {"focal": {"class": "Substring", "name": "evaluate", "signature": "Literal evaluate(ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "valueFactory", "type": "ValueFactory"}, {"name": "args", "type": "Value..."}], "retur... |
49671662_1 | class WifiConfigStoreParser {
public static List<WifiNetwork> parse(InputStream in)
throws XmlPullParserException, IOException {
List<WifiNetwork> wifiNetworks = new ArrayList<>();
try {
XmlPullParser parser = Xml.newPullParser();
parser.setFeature(XmlPullParser... | InputStream wifiConfigStoreFileStream =
getClass().getClassLoader().getResourceAsStream("test_WifiConfigStore.xml");
List<WifiNetwork> parsedWifiNetworks = WifiConfigStoreParser.parse(wifiConfigStoreFileStream);
assertEquals(expectedWifiNetworks.size(), parsedWifiNetworks.size()... | [FOCAL] public static List<WifiNetwork> WifiConfigStoreParser.parse(InputStream in)
[CLASS] class WifiConfigStoreParser
[METRICS] loc=21 cc=5 branches=2 loops=1 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] List<WifiNetwork> readNetworkList(XmlPullParser parser)
[CALLS-EXTERNAL] Xml.newPullParser/0, XmlPullParser.setFe... | /* static context
[FOCAL] public static List<WifiNetwork> WifiConfigStoreParser.parse(InputStream in)
[PATH1] while(parser.next() != XmlPullParser.END_DOCUMENT)=T -> if(parser.getEventType() != XmlPullParser.START_TAG)=F -> if(parser.getName().equalsIgnoreCase("NetworkList"))=T -> exit loop -> return wifiNetworks
[PATH... | /* static context
[FOCAL] public static List<WifiNetwork> WifiConfigStoreParser.parse(InputStream in)
[PATH1] while(parser.next() != XmlPullParser.END_DOCUMENT)=T -> if(parser.getEventType() != XmlPullParser.START_TAG)=F -> if(parser.getName().equalsIgnoreCase("NetworkList"))=T -> exit loop -> return wifiNetworks
[PATH... | true | ok | {"focal": {"class": "WifiConfigStoreParser", "name": "parse", "signature": "List<WifiNetwork> parse(InputStream in) throws XmlPullParserException, IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "in", "type": "InputStream"}], "return_type": "List<WifiNetwork>"}, "class_info": {"name": "... |
49678622_1 | class ServerBulletinSummary extends ShortServerBulletinSummary {
public UniversalId getUniversalId()
{
return UniversalId.createFromAccountAndLocalId(accountId, getLocalId());
}
public ServerBulletinSummary(UniversalId uidToUse, String lastModifiedToUse, String serverTimestampToUse);
public ServerBulletinSum... | String accountId = "account1";
String localId = "localid1";
String lastModified = "2014-06-07";
String serverTimestamp = "2012-02-04";
UniversalId uid = UniversalId.createFromAccountAndLocalId(accountId, localId);
ShortServerBulletinSummary shortSummary = new ShortServerBulletinSummary(localId, lastModified... | [FOCAL] public UniversalId ServerBulletinSummary.getUniversalId()
[CLASS] class ServerBulletinSummary extends ShortServerBulletinSummary
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] UniversalId.createFromAccountAndLocalId/2, getLocalId/0 (inherited)
[CLASS-MEMBERS] ServerBulleti... | /* static context
[FOCAL] public UniversalId ServerBulletinSummary.getUniversalId()
[CALLS-EXTERNAL] UniversalId.createFromAccountAndLocalId/2, getLocalId/0 (inherited)
*/
| /* static context
[FOCAL] public UniversalId ServerBulletinSummary.getUniversalId()
[CALLS-EXTERNAL] UniversalId.createFromAccountAndLocalId/2, getLocalId/0 (inherited)
*/
class ServerBulletinSummary extends ShortServerBulletinSummary {
public UniversalId getUniversalId()
{
return UniversalId.createFromAccountAndL... | true | ok | {"focal": {"class": "ServerBulletinSummary", "name": "getUniversalId", "signature": "UniversalId getUniversalId()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "UniversalId"}, "class_info": {"name": "ServerBulletinSummary", "kind": "class", "modifiers": "", "superclass": "ShortServerBulletinSum... |
49730727_2 | class Gandalf {
@SuppressWarnings("PMD.AvoidCatchingGenericException")
public void shallIPass(Context context, final GandalfCallback gandalfCallback) {
LoggerUtil.logD("Fetching bootstrap");
new BootstrapApi(context, okHttpClient, bootstrapUrl, customDeserializer, callbackExecutor)
... |
enqueueMockResponse("updateRequired.json");
final CountDownLatch countDownLatch = new CountDownLatch(1);
GandalfCallback mockCallback = getGandalfCallback(countDownLatch);
getGandalfInstance(VERSION_NAME, 6).shallIPass(mockContext, mockCallback);
boolean status = countDownLat... | [FOCAL] @SuppressWarnings("PMD.AvoidCatchingGenericException") public void Gandalf.shallIPass(Context context, GandalfCallback gandalfCallback)
[CLASS] class Gandalf
[METRICS] loc=41 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=4
[CALLS-EXTERNAL] LoggerUtil.logD/1, new BootstrapApi(context, okHttpClient, bootstra... | /* static context
[FOCAL] @SuppressWarnings("PMD.AvoidCatchingGenericException") public void Gandalf.shallIPass(Context context, GandalfCallback gandalfCallback)
[COLLABORATORS] field gateKeeper updateIsRequired/1,showAlert/1,updateIsOptional/1; param gandalfCallback:GandalfCallback onRequiredUpdate/1,onAlert/1,onOptio... | /* static context
[FOCAL] @SuppressWarnings("PMD.AvoidCatchingGenericException") public void Gandalf.shallIPass(Context context, GandalfCallback gandalfCallback)
[COLLABORATORS] field gateKeeper updateIsRequired/1,showAlert/1,updateIsOptional/1; param gandalfCallback:GandalfCallback onRequiredUpdate/1,onAlert/1,onOptio... | true | ok | {"focal": {"class": "Gandalf", "name": "shallIPass", "signature": "void shallIPass(Context context, GandalfCallback gandalfCallback)", "start_line": 3, "modifiers": "@SuppressWarnings(\"PMD.AvoidCatchingGenericException\") public", "params": [{"name": "context", "type": "Context"}, {"name": "gandalfCallback", "type": "... |
49733838_82 | class ExecutorService {
@Scheduled(fixedDelay = 2000, initialDelay = 500)
public void checkExecutors() {
for (Executor executor : executors) {
checkExecutor(executor);
}
startExecutions();
}
@Autowired public ExecutorService(
ExecutionSource executions,... | ExecutionSource executions = Mockito.mock(ExecutionSource.class);
ExecutorEventListener eventListener = null;
Configuration configuration = Mockito.mock(Configuration.class);
Mockito.when(configuration.getExecutorUri()).thenReturn("iri");
ExecutorRestClient restClient = null;
... | [FOCAL] @Scheduled(fixedDelay = 2000, initialDelay = 500) public void ExecutorService.checkExecutors()
[CLASS] class ExecutorService
[METRICS] loc=7 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void checkExecutor(Executor executor); void startExecutions()
[PATH1] foreach(Executor executor : exe... | /* static context
[FOCAL] @Scheduled(fixedDelay = 2000, initialDelay = 500) public void ExecutorService.checkExecutors()
[PATH1] foreach(Executor executor : executors)=T -> exit loop
[PATH2] foreach(Executor executor : executors)=F
[CALLS-INTERNAL] void checkExecutor(Executor executor); void startExecutions()
*/
| /* static context
[FOCAL] @Scheduled(fixedDelay = 2000, initialDelay = 500) public void ExecutorService.checkExecutors()
[PATH1] foreach(Executor executor : executors)=T -> exit loop
[PATH2] foreach(Executor executor : executors)=F
[CALLS-INTERNAL] void checkExecutor(Executor executor); void startExecutions()
*/
class ... | true | ok | {"focal": {"class": "ExecutorService", "name": "checkExecutors", "signature": "void checkExecutors()", "start_line": 3, "modifiers": "@Scheduled(fixedDelay = 2000, initialDelay = 500) public", "params": [], "return_type": "void"}, "class_info": {"name": "ExecutorService", "kind": "class", "modifiers": "", "superclass":... |
49743270_13 | class ExceptionFilters {
public static Predicate<Throwable> markAllExceptions() {
return new AnyThrowable();
}
private ExceptionFilters();
public static Predicate<Throwable> markCheckedExceptions();
}
class ExceptionFiltersTest {
@Test
public void testMarkAll() throws Exception {
| assertTrue(ExceptionFilters.markAllExceptions().test(new Throwable()));
assertTrue(ExceptionFilters.markAllExceptions().test(new RuntimeException()));
assertTrue(ExceptionFilters.markAllExceptions().test(new NullPointerException()));
assertTrue(ExceptionFilters.markAllExceptions().test(n... | [FOCAL] public static Predicate<Throwable> ExceptionFilters.markAllExceptions()
[CLASS] class ExceptionFilters
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] AnyThrowable
[CLASS-MEMBERS] ExceptionFilters(); Predicate<Throwable> markCheckedExceptions()
[TEST] ExceptionFiltersTest: @Test publi... | /* static context
[FOCAL] public static Predicate<Throwable> ExceptionFilters.markAllExceptions()
[NEW] AnyThrowable
*/
| /* static context
[FOCAL] public static Predicate<Throwable> ExceptionFilters.markAllExceptions()
[NEW] AnyThrowable
*/
class ExceptionFilters {
public static Predicate<Throwable> markAllExceptions() {
return new AnyThrowable();
}
private ExceptionFilters();
public static Predicate<Throwable... | true | ok | {"focal": {"class": "ExceptionFilters", "name": "markAllExceptions", "signature": "Predicate<Throwable> markAllExceptions()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Predicate<Throwable>"}, "class_info": {"name": "ExceptionFilters", "kind": "class", "modifiers": "", "superclass": nu... |
49763242_868 | class KeyProvider {
public static Options options(Configuration conf) {
return new Options(conf);
}
public KeyProvider(Configuration conf);
public Configuration getConf();
public boolean isTransient();
public abstract KeyVersion getKeyVersion(String versionName
... | Configuration conf = new Configuration();
conf.set(KeyProvider.DEFAULT_CIPHER_NAME, "myCipher");
conf.setInt(KeyProvider.DEFAULT_BITLENGTH_NAME, 512);
Map<String, String> attributes = new HashMap<String, String>();
attributes.put("a", "A");
KeyProvider.Options options = KeyProvider.options(conf)... | [FOCAL] public static Options KeyProvider.options(Configuration conf)
[CLASS] class KeyProvider
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Options
[INPUTS] branches=- | result=conf
[DATAFLOW] conf@param->L2
[CLASS-MEMBERS] KeyProvider(Configuration conf); Configuration getConf(); boolean... | /* static context
[FOCAL] public static Options KeyProvider.options(Configuration conf)
[INPUTS] branches=- | result=conf
[NEW] Options
*/
| /* static context
[FOCAL] public static Options KeyProvider.options(Configuration conf)
[INPUTS] branches=- | result=conf
[NEW] Options
*/
class KeyProvider {
public static Options options(Configuration conf) {
return new Options(conf);
}
public KeyProvider(Configuration conf);
public Configuration getC... | true | ok | {"focal": {"class": "KeyProvider", "name": "options", "signature": "Options options(Configuration conf)", "start_line": 3, "modifiers": "public static", "params": [{"name": "conf", "type": "Configuration"}], "return_type": "Options"}, "class_info": {"name": "KeyProvider", "kind": "class", "modifiers": "", "superclass":... |
49778000_0 | class BudgetAdapter extends ArrayAdapter<Budget> {
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
// Get the data item for this position
Budget item = getItem(position);
ViewHolder holder;
// Check if an existing view is being reused, oth... | ActivityController activityController = Robolectric.buildActivity(BudgetActivity.class).create();
Activity activity = (Activity)activityController.get();
DBHelper db = new DBHelper(activity);
final String NAME = "name";
final int BUDGET = 100;
final double CURRENT = 50.0... | [FOCAL] @Override public View BudgetAdapter.getView(int position, View convertView, ViewGroup parent)
[CLASS] class BudgetAdapter extends ArrayAdapter<Budget>
[METRICS] loc=37 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] getItem/1 (inherited), LayoutInflater.from(getContext()).inflate/3, Layout... | /* static context
[FOCAL] @Override public View BudgetAdapter.getView(int position, View convertView, ViewGroup parent)
[PATH1] if(convertView == null)=T -> return convertView
[PATH2] if(convertView == null)=F -> return convertView
[INPUTS] branches=convertView | result=convertView, parent
[COLLABORATORS] param convert... | /* static context
[FOCAL] @Override public View BudgetAdapter.getView(int position, View convertView, ViewGroup parent)
[PATH1] if(convertView == null)=T -> return convertView
[PATH2] if(convertView == null)=F -> return convertView
[INPUTS] branches=convertView | result=convertView, parent
[COLLABORATORS] param convert... | true | ok | {"focal": {"class": "BudgetAdapter", "name": "getView", "signature": "View getView(int position, View convertView, ViewGroup parent)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "position", "type": "int"}, {"name": "convertView", "type": "View"}, {"name": "parent", "type": "ViewGroup"}], "ret... |
49818800_19 | class JavaApiConverter {
public static CacheResponse createJavaCacheResponse(final Response response) {
final Headers headers = response.headers();
final ResponseBody body = response.body();
if (response.request().isHttps()) {
final Handshake handshake = response.handshake();
return new Secur... | Request okRequest =
createArbitraryOkRequest().newBuilder()
.url("http://insecure/request")
.post(createRequestBody("RequestBody"))
.build();
ResponseBody responseBody = createResponseBody("ResponseBody");
Response okResponse = createArbitraryOkResponse(okRequest)... | [FOCAL] public static CacheResponse JavaApiConverter.createJavaCacheResponse(Response response)
[CLASS] class JavaApiConverter
[METRICS] loc=67 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] Response.headers/0, Response.body/0, response.request().isHttps/0, Response.request/0, Response.handshake/... | /* static context
[FOCAL] public static CacheResponse JavaApiConverter.createJavaCacheResponse(Response response)
[PATH1] if(response.request().isHttps())=T -> return new SecureCacheResponse() { @Override public String getCipherSuite(...
[PATH2] if(response.request().isHttps())=F -> return new CacheResponse() { @Overri... | /* static context
[FOCAL] public static CacheResponse JavaApiConverter.createJavaCacheResponse(Response response)
[PATH1] if(response.request().isHttps())=T -> return new SecureCacheResponse() { @Override public String getCipherSuite(...
[PATH2] if(response.request().isHttps())=F -> return new CacheResponse() { @Overri... | true | ok | {"focal": {"class": "JavaApiConverter", "name": "createJavaCacheResponse", "signature": "CacheResponse createJavaCacheResponse(Response response)", "start_line": 3, "modifiers": "public static", "params": [{"name": "response", "type": "Response"}], "return_type": "CacheResponse"}, "class_info": {"name": "JavaApiConvert... |
49871069_0 | class RxComboDetector {
@VisibleForTesting
static Flowable<Integer> detect(Flowable<Integer> clicks, final long maxIntervalMillis,
final int minComboTimesCared) {
return clicks.timestamp()
.scan((lastOne, thisOne) -> {
if (thisOne.time() - lastOne.time() ... | Flowable<Integer> mockClicks = Flowable
.create(emitter -> {
emitter.onNext(1);
sleepSilently(50);
emitter.onNext(1);
sleepSilently(50);
emitter.onNext(1);
sleepSilently(50);
... | [FOCAL] @VisibleForTesting static Flowable<Integer> RxComboDetector.detect(Flowable<Integer> clicks, long maxIntervalMillis, int minComboTimesCared)
[CLASS] class RxComboDetector
[METRICS] loc=14 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] clicks.timestamp() .scan((lastOne, thisOne) -> { if (t... | /* static context
[FOCAL] @VisibleForTesting static Flowable<Integer> RxComboDetector.detect(Flowable<Integer> clicks, long maxIntervalMillis, int minComboTimesCared)
[INPUTS] branches=- | result=clicks, maxIntervalMillis, minComboTimesCared
[COLLABORATORS] param clicks:Flowable<Integer> timestamp/0; field thisOne time... | /* static context
[FOCAL] @VisibleForTesting static Flowable<Integer> RxComboDetector.detect(Flowable<Integer> clicks, long maxIntervalMillis, int minComboTimesCared)
[INPUTS] branches=- | result=clicks, maxIntervalMillis, minComboTimesCared
[COLLABORATORS] param clicks:Flowable<Integer> timestamp/0; field thisOne time... | true | ok | {"focal": {"class": "RxComboDetector", "name": "detect", "signature": "Flowable<Integer> detect(Flowable<Integer> clicks, long maxIntervalMillis, int minComboTimesCared)", "start_line": 3, "modifiers": "@VisibleForTesting static", "params": [{"name": "clicks", "type": "Flowable<Integer>"}, {"name": "maxIntervalMillis",... |
49876476_740 | class TableMetaData {
private Map<String, ColumnMetaData> getColumns(final Collection<ColumnMetaData> columnMetaDataList) {
Map<String, ColumnMetaData> result = new LinkedHashMap<>(columnMetaDataList.size(), 1);
for (ColumnMetaData each : columnMetaDataList) {
String lowerColumnName = e... | tableMetaData = new TableMetaData();
assertThat(tableMetaData.getColumns(), is(Collections.emptyMap()));
}
} | [FOCAL] private Map<String, ColumnMetaData> TableMetaData.getColumns(Collection<ColumnMetaData> columnMetaDataList)
[CLASS] class TableMetaData
[METRICS] loc=12 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Collection<ColumnMetaData>.size/0, each.getName().toLowerCase/0, ColumnMetaData.getName/0... | /* static context
[FOCAL] private Map<String, ColumnMetaData> TableMetaData.getColumns(Collection<ColumnMetaData> columnMetaDataList)
[PATH1] foreach(ColumnMetaData each : columnMetaDataList)=T -> if(each.isPrimaryKey())=T -> exit loop -> return Collections.synchronizedMap(result)
[PATH2] foreach(ColumnMetaData each : ... | /* static context
[FOCAL] private Map<String, ColumnMetaData> TableMetaData.getColumns(Collection<ColumnMetaData> columnMetaDataList)
[PATH1] foreach(ColumnMetaData each : columnMetaDataList)=T -> if(each.isPrimaryKey())=T -> exit loop -> return Collections.synchronizedMap(result)
[PATH2] foreach(ColumnMetaData each : ... | true | ok | {"focal": {"class": "TableMetaData", "name": "getColumns", "signature": "Map<String, ColumnMetaData> getColumns(Collection<ColumnMetaData> columnMetaDataList)", "start_line": 3, "modifiers": "private", "params": [{"name": "columnMetaDataList", "type": "Collection<ColumnMetaData>"}], "return_type": "Map<String, ColumnMe... |
49896881_40 | class DataHubImpl implements DataHub {
@Override
public boolean isServerVersionValid(String versionString) {
try{
Versions.MarkLogicVersion serverVersion = versions.getMLVersion(versionString);
if (!(serverVersion.getMajor() == 9 || serverVersion.getMajor() == 10)) {
... | assertFalse(dh.isServerVersionValid("8.0-7"));
}
} | [FOCAL] @Override public boolean DataHubImpl.isServerVersionValid(String versionString)
[CLASS] class DataHubImpl implements DataHub
[METRICS] loc=42 cc=12 branches=10 loops=0 returns=6 throws=1 nesting=4
[CALLS-EXTERNAL] Versions.getMLVersion/1, Versions.MarkLogicVersion.getMajor/0, Versions.MarkLogicVersion.isNightly... | /* static context
[FOCAL] @Override public boolean DataHubImpl.isServerVersionValid(String versionString)
[THROWS-WHEN] ServerValidationException when try-body throws
[PATH1] if(!(serverVersion.getMajor() == 9 || serverVersion.getMajor() == 10))=F -> if(serverVersion.isNightly())=T -> if(serverVersion.getMajor() == 9)#... | /* static context
[FOCAL] @Override public boolean DataHubImpl.isServerVersionValid(String versionString)
[THROWS-WHEN] ServerValidationException when try-body throws
[PATH1] if(!(serverVersion.getMajor() == 9 || serverVersion.getMajor() == 10))=F -> if(serverVersion.isNightly())=T -> if(serverVersion.getMajor() == 9)#... | true | ok | {"focal": {"class": "DataHubImpl", "name": "isServerVersionValid", "signature": "boolean isServerVersionValid(String versionString)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "versionString", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "DataHubImpl", "kind": "class... |
49904163_6 | class Query {
public City getCityByCrime(City c)
{
this.city = c;
String name = c.getName();
name = name.replace("\'", "\'\'");
queryCityData = "SELECT * FROM Cities WHERE city=\'" + name + "\' AND state=\'" + states.get(c.getState()) + "\';";
queryHousingData = "SELECT id, place_name, place_id, p... | for(int i = 0; i < 27; i++)
{
City c = q.getCityData(cities[i][0]);
boolean c_one = true, c_two = true, c_three = true, c_four = true, c_five = true;
if(num[i][0] != -1.0f)
c_one = c.getIndex_nsa() == num[i][0];
if(num[i][1] != -1.0f)
c_two = c.getIndex_sa() == num[i][1];
if(num[i][2]... | [FOCAL] public City Query.getCityByCrime(City c)
[CLASS] class Query
[METRICS] loc=16 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] void runQuery(String conn, String query, String type, int n)
[CALLS-EXTERNAL] City.getName/0, String.replace/2, states.get/1, City.getState/0
[FIELDS] read=city | w... | /* static context
[FOCAL] public City Query.getCityByCrime(City c)
[INPUTS] branches=- | result=c
[COLLABORATORS] param c:City getName/0,getState/0; field states get/1
[STATE] city
[CALLS-INTERNAL] void runQuery(String conn, String query, String type, int n)
[FIELDS] read=city | write=city
[CALLS-EXTERNAL] City.getName... | /* static context
[FOCAL] public City Query.getCityByCrime(City c)
[INPUTS] branches=- | result=c
[COLLABORATORS] param c:City getName/0,getState/0; field states get/1
[STATE] city
[CALLS-INTERNAL] void runQuery(String conn, String query, String type, int n)
[FIELDS] read=city | write=city
[CALLS-EXTERNAL] City.getName... | true | ok | {"focal": {"class": "Query", "name": "getCityByCrime", "signature": "City getCityByCrime(City c)", "start_line": 3, "modifiers": "public", "params": [{"name": "c", "type": "City"}], "return_type": "City"}, "class_info": {"name": "Query", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields"... |
49929380_213 | class ReportGenerator implements IReportGenerator {
protected synchronized void writeRoundTripToFile(RoundTrip roundTrip) {
logger.info("Writing round trip to result file: " + roundTrip);
String resultString = roundTrip.getResults() + "\n";
try {
Files.write(Paths.get(outputFile... | Path path = Files.createTempFile("ReportGeneratorUnitTest", ".txt");
reportGenerator.outputFile = path.toString();
String expected = "2016-03-19T07:01:10,Long,ABC,100,100.23,0,2016-03-20T06:01:10,101.23,0,Short,XYZ,50,250.34,0,251.34,0";
Ticker longTicker = new StockTicker("ABC");
... | [FOCAL] protected synchronized void ReportGenerator.writeRoundTripToFile(RoundTrip roundTrip)
[CLASS] class ReportGenerator implements IReportGenerator
[METRICS] loc=10 cc=2 branches=0 loops=0 returns=0 throws=1 nesting=1
[CALLS-EXTERNAL] logger.info/1, RoundTrip.getResults/0, Files.write/4, Paths.get/1, String.getByte... | /* static context
[FOCAL] protected synchronized void ReportGenerator.writeRoundTripToFile(RoundTrip roundTrip)
[THROWS-WHEN] IllegalStateException when try-body throws
[PATH1] try-body throws -> throw new IllegalStateException(e)
[COLLABORATORS] param roundTrip:RoundTrip getResults/0
[EXCEPTIONS] throws IllegalStateEx... | /* static context
[FOCAL] protected synchronized void ReportGenerator.writeRoundTripToFile(RoundTrip roundTrip)
[THROWS-WHEN] IllegalStateException when try-body throws
[PATH1] try-body throws -> throw new IllegalStateException(e)
[COLLABORATORS] param roundTrip:RoundTrip getResults/0
[EXCEPTIONS] throws IllegalStateEx... | true | ok | {"focal": {"class": "ReportGenerator", "name": "writeRoundTripToFile", "signature": "void writeRoundTripToFile(RoundTrip roundTrip)", "start_line": 3, "modifiers": "protected synchronized", "params": [{"name": "roundTrip", "type": "RoundTrip"}], "return_type": "void"}, "class_info": {"name": "ReportGenerator", "kind": ... |
49950879_41 | class PostLexer implements TokenSource {
@Override
public Token nextToken() {
LOGGER.trace("Entering nextToken()");
if (!heap.isEmpty()) {
return heap.poll();
}
while (true) {
getNextToken();
switch (currToken.getType()) {
case PreprocessorParser.AMPIF:
prepro... | ParseUnit unit = new ParseUnit(new File(SRC_DIR, "lexer15.p"), session);
TokenSource stream = unit.lex();
ProToken tok = (ProToken) stream.nextToken();
assertEquals(tok.getNodeType(), ABLNodeType.PROPARSEDIRECTIVE);
assertEquals(tok.getChannel(), ProToken.PROPARSE_CHANNEL);
tok = (ProToken) str... | [FOCAL] @Override public Token PostLexer.nextToken()
[CLASS] class PostLexer implements TokenSource
[METRICS] loc=41 cc=7 branches=2 loops=1 returns=6 throws=0 nesting=2
[CALLS-INTERNAL] void getNextToken(); void preproElse(); void preproElseif(); void preproEndif(); void preproIf(); void throwMessage(String msg)
[CALL... | /* static context
[FOCAL] @Override public Token PostLexer.nextToken()
[PATH1] if(!heap.isEmpty())=F -> while(true)=T -> switch(currToken.getType())=case PreprocessorParser.AMPIF -> return heap.poll()
[PATH2] if(!heap.isEmpty())=F -> while(true)=T -> switch(currToken.getType())=case PreprocessorParser.AMPENDIF -> retur... | /* static context
[FOCAL] @Override public Token PostLexer.nextToken()
[PATH1] if(!heap.isEmpty())=F -> while(true)=T -> switch(currToken.getType())=case PreprocessorParser.AMPIF -> return heap.poll()
[PATH2] if(!heap.isEmpty())=F -> while(true)=T -> switch(currToken.getType())=case PreprocessorParser.AMPENDIF -> retur... | true | ok | {"focal": {"class": "PostLexer", "name": "nextToken", "signature": "Token nextToken()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Token"}, "class_info": {"name": "PostLexer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "TokenSource", "fields": [{"name": "SRC... |
49979053_5 | class EventsFilter {
public void parse(String query) throws BadRequestResponseException {
this.deviceGuid = null;
this.locationGuid = null;
this.channel = null;
this.startingTimestamp = null;
this.endTimestamp = null;
if (!StringUtils.hasText(query)) {
... |
try {
EventsFilter filter = new EventsFilter();
filter.parse("timestamp:>2007/01/14");
fail();
} catch (final BadRequestResponseException e) {
final String msg = "Not ISO Date: 2007/01/14";
assertEquals(msg, e.getMessage());
}
}
... | [FOCAL] public void EventsFilter.parse(String query)
[CLASS] class EventsFilter
[METRICS] loc=19 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] void parseToken(String filter)
[CALLS-EXTERNAL] StringUtils.hasText/1, String.split/1
[FIELDS] write=channel, deviceGuid, endTimestamp, locationGuid, sta... | /* static context
[FOCAL] public void EventsFilter.parse(String query)
[PATH1] if(!StringUtils.hasText(query))=F -> foreach(String filter : filters)=T -> exit loop
[PATH2] if(!StringUtils.hasText(query))=T -> return
[PATH3] if(!StringUtils.hasText(query))=F -> foreach(String filter : filters)=F
[INPUTS] branches=query ... | /* static context
[FOCAL] public void EventsFilter.parse(String query)
[PATH1] if(!StringUtils.hasText(query))=F -> foreach(String filter : filters)=T -> exit loop
[PATH2] if(!StringUtils.hasText(query))=T -> return
[PATH3] if(!StringUtils.hasText(query))=F -> foreach(String filter : filters)=F
[INPUTS] branches=query ... | true | ok | {"focal": {"class": "EventsFilter", "name": "parse", "signature": "void parse(String query) throws BadRequestResponseException", "start_line": 3, "modifiers": "public", "params": [{"name": "query", "type": "String"}], "return_type": "void"}, "class_info": {"name": "EventsFilter", "kind": "class", "modifiers": "", "supe... |
50041690_6 | class ColorUtil {
public synchronized static String RgbToAnsi(String rgb, ColorSetting colorSetting) {
switch(colorSetting) {
case OFF:
return "";
case ON:
return getClosestTerminalCode(colors.get(rgb), ansiColorsToTerminalCodes);
case EXT... | // set java.awt.headless so that we don't activate the awt bug (see issue #982)
System.setProperty("java.awt.headless", "true");
assertEquals("", ColorUtil.RgbToAnsi("red", ColorSetting.OFF));
assertEquals("\u001b[31m", ColorUtil.RgbToAnsi("red", ColorSetting.ON));
}
} | [FOCAL] public synchronized static String ColorUtil.RgbToAnsi(String rgb, ColorSetting colorSetting)
[CLASS] class ColorUtil
[METRICS] loc=12 cc=4 branches=1 loops=0 returns=3 throws=1 nesting=1
[CALLS-INTERNAL] String getClosestTerminalCode(Color rgb, Map<Color, String> codesMap)
[CALLS-EXTERNAL] colors.get/1
[NEW] Un... | /* static context
[FOCAL] public synchronized static String ColorUtil.RgbToAnsi(String rgb, ColorSetting colorSetting)
[THROWS-WHEN] UnsupportedOperationException when switch(colorSetting)=default
[PATH1] switch(colorSetting)=case OFF -> return ""
[PATH2] switch(colorSetting)=case ON -> return getClosestTerminalCode(co... | /* static context
[FOCAL] public synchronized static String ColorUtil.RgbToAnsi(String rgb, ColorSetting colorSetting)
[THROWS-WHEN] UnsupportedOperationException when switch(colorSetting)=default
[PATH1] switch(colorSetting)=case OFF -> return ""
[PATH2] switch(colorSetting)=case ON -> return getClosestTerminalCode(co... | true | ok | {"focal": {"class": "ColorUtil", "name": "RgbToAnsi", "signature": "String RgbToAnsi(String rgb, ColorSetting colorSetting)", "start_line": 3, "modifiers": "public synchronized static", "params": [{"name": "rgb", "type": "String"}, {"name": "colorSetting", "type": "ColorSetting"}], "return_type": "String"}, "class_info... |
50056934_79 | class ZKLogSegmentMetadataStore implements LogSegmentMetadataStore, Watcher, Children2Callback {
@Override
public void updateLogSegment(Transaction<Object> txn, LogSegmentMetadata segment) {
byte[] finalisedData = segment.getFinalisedData().getBytes(UTF_8);
Op updateOp = Op.setData(segment.getZ... | LogSegmentMetadata segment = createLogSegment(1L, 99L);
Transaction<Object> createTxn = lsmStore.transaction();
lsmStore.createLogSegment(createTxn, segment);
FutureUtils.result(createTxn.execute());
// the log segment should be created
assertNotNull("LogSegment " + segme... | [FOCAL] @Override public void ZKLogSegmentMetadataStore.updateLogSegment(Transaction<Object> txn, LogSegmentMetadata segment)
[CLASS] class ZKLogSegmentMetadataStore implements LogSegmentMetadataStore, Watcher, Children2Callback
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] segme... | /* static context
[FOCAL] @Override public void ZKLogSegmentMetadataStore.updateLogSegment(Transaction<Object> txn, LogSegmentMetadata segment)
[COLLABORATORS] param segment:LogSegmentMetadata getFinalisedData/0,getZkPath/0; param txn:Transaction<Object> addOp/1
[CALLS-EXTERNAL] segment.getFinalisedData().getBytes/1, L... | /* static context
[FOCAL] @Override public void ZKLogSegmentMetadataStore.updateLogSegment(Transaction<Object> txn, LogSegmentMetadata segment)
[COLLABORATORS] param segment:LogSegmentMetadata getFinalisedData/0,getZkPath/0; param txn:Transaction<Object> addOp/1
[CALLS-EXTERNAL] segment.getFinalisedData().getBytes/1, L... | true | ok | {"focal": {"class": "ZKLogSegmentMetadataStore", "name": "updateLogSegment", "signature": "void updateLogSegment(Transaction<Object> txn, LogSegmentMetadata segment)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "txn", "type": "Transaction<Object>"}, {"name": "segment", "type": "LogSegmentMeta... |
50068565_2 | class MapFrequencyFinder implements FrequencyFinder {
@Override
public double getFrequency(NoteName name) {
return notes.get(name);
}
public MapFrequencyFinder();
private MapFrequencyFinder finder;
}
class MapFrequencyFinderTest {
private MapFrequencyFinder finder;
@Test
... | double frequency = finder.getFrequency(NoteName.B);
assertEquals(123.5, frequency, 0.0);
}
} | [FOCAL] @Override public double MapFrequencyFinder.getFrequency(NoteName name)
[CLASS] class MapFrequencyFinder implements FrequencyFinder
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] notes.get/1
[INPUTS] branches=- | result=name
[COLLABORATORS] field notes get/1
[DATAFLOW] name... | /* static context
[FOCAL] @Override public double MapFrequencyFinder.getFrequency(NoteName name)
[INPUTS] branches=- | result=name
[COLLABORATORS] field notes get/1
[CALLS-EXTERNAL] notes.get/1
*/
| /* static context
[FOCAL] @Override public double MapFrequencyFinder.getFrequency(NoteName name)
[INPUTS] branches=- | result=name
[COLLABORATORS] field notes get/1
[CALLS-EXTERNAL] notes.get/1
*/
class MapFrequencyFinder implements FrequencyFinder {
@Override
public double getFrequency(NoteName name) {
... | true | ok | {"focal": {"class": "MapFrequencyFinder", "name": "getFrequency", "signature": "double getFrequency(NoteName name)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "NoteName"}], "return_type": "double"}, "class_info": {"name": "MapFrequencyFinder", "kind": "class", "modifiers": ""... |
50104552_0 | class PdfTextStyle {
public float getFontSize() {
return fontSize;
}
public PdfTextStyle(float fontSize, PdfFont defaultFont, PDColor color, String style);
public PdfTextStyle(String config);
public PdfFont getFont();
public PDColor getColor();
public PDFont getCurrentFontStyle(... | float fontSize = 10.5f;
PDColor red = new PDColor(new float[] {1.0f, 0.0f, 0.0f}, PDDeviceRGB.INSTANCE);
PdfTextStyle config = new PdfTextStyle(fontSize, PdfFont.TIMES_ROMAN, red, "regular");
Assert.assertEquals(fontSize, config.getFontSize(), delta);
}
} | [FOCAL] public float PdfTextStyle.getFontSize()
[CLASS] class PdfTextStyle
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] PdfTextStyle(float fontSize, PdfFont defaultFont, PDColor color, String style); PdfTextStyle(String config); PdfFont getFont(); PDColor getColor(); PDFont getCu... | /* static context
[FOCAL] public float PdfTextStyle.getFontSize()
*/
| /* static context
[FOCAL] public float PdfTextStyle.getFontSize()
*/
class PdfTextStyle {
public float getFontSize() {
return fontSize;
}
public PdfTextStyle(float fontSize, PdfFont defaultFont, PDColor color, String style);
public PdfTextStyle(String config);
public PdfFont getFont();
... | true | ok | {"focal": {"class": "PdfTextStyle", "name": "getFontSize", "signature": "float getFontSize()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "float"}, "class_info": {"name": "PdfTextStyle", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "delta", "typ... |
50105719_75 | class SearchUtils {
public static int kmp(ByteBuffer buf, byte[] sought) {
if (sought == null || sought.length == 0) {
return -1;
}
if (sought.length == 1) {
int i = buf.position();
while (buf.hasRemaining()) {
if (buf.get(i) == sought[0]... | byte[] sought = new byte[]{9};
assertThat(SearchUtils.kmp(buf, sought)).isEqualTo(5);
}
} | [FOCAL] public static int SearchUtils.kmp(ByteBuffer buf, byte[] sought)
[CLASS] class SearchUtils
[METRICS] loc=32 cc=9 branches=6 loops=2 returns=5 throws=0 nesting=3
[CALLS-INTERNAL] int[] kmpTable(byte[] w)
[CALLS-EXTERNAL] ByteBuffer.position/0, ByteBuffer.hasRemaining/0, ByteBuffer.get/1, ByteBuffer.limit/0
[PATH... | /* static context
[FOCAL] public static int SearchUtils.kmp(ByteBuffer buf, byte[] sought)
[PATH1] if(sought == null || sought.length == 0)=F -> if(sought.length == 1)=F -> while(m + i < buf.limit())=T -> if(sought[i] == buf.get(m + i))=T -> if(i == sought.length)=F -> exit loop -> return -1
[PATH2] if(sought == null |... | /* static context
[FOCAL] public static int SearchUtils.kmp(ByteBuffer buf, byte[] sought)
[PATH1] if(sought == null || sought.length == 0)=F -> if(sought.length == 1)=F -> while(m + i < buf.limit())=T -> if(sought[i] == buf.get(m + i))=T -> if(i == sought.length)=F -> exit loop -> return -1
[PATH2] if(sought == null |... | true | ok | {"focal": {"class": "SearchUtils", "name": "kmp", "signature": "int kmp(ByteBuffer buf, byte[] sought)", "start_line": 3, "modifiers": "public static", "params": [{"name": "buf", "type": "ByteBuffer"}, {"name": "sought", "type": "byte[]"}], "return_type": "int"}, "class_info": {"name": "SearchUtils", "kind": "class", "... |
50118546_8 | class ConfigurationStateUpdater {
@VisibleForTesting
PipelineInterpreter.State reload() {
return reloadAndSave();
}
@Inject public ConfigurationStateUpdater(RuleService ruleService,
PipelineService pipelineService,
Pipe... |
final Injector injector = Guice.createInjector(
new InMemoryServicesModule(),
new ProcessorFunctionsModule(),
new SchedulerBindings(),
binder -> binder.install(new FactoryModuleBuilder().build(PipelineInterpreter.State.Factory.class)),
... | [FOCAL] @VisibleForTesting PipelineInterpreter.State ConfigurationStateUpdater.reload()
[CLASS] class ConfigurationStateUpdater
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] PipelineInterpreter.State reloadAndSave()
[CLASS-MEMBERS] ConfigurationStateUpdater(RuleService ruleServic... | /* static context
[FOCAL] @VisibleForTesting PipelineInterpreter.State ConfigurationStateUpdater.reload()
[CALLS-INTERNAL] PipelineInterpreter.State reloadAndSave()
*/
| /* static context
[FOCAL] @VisibleForTesting PipelineInterpreter.State ConfigurationStateUpdater.reload()
[CALLS-INTERNAL] PipelineInterpreter.State reloadAndSave()
*/
class ConfigurationStateUpdater {
@VisibleForTesting
PipelineInterpreter.State reload() {
return reloadAndSave();
}
@Inject pu... | true | ok | {"focal": {"class": "ConfigurationStateUpdater", "name": "reload", "signature": "PipelineInterpreter.State reload()", "start_line": 3, "modifiers": "@VisibleForTesting", "params": [], "return_type": "PipelineInterpreter.State"}, "class_info": {"name": "ConfigurationStateUpdater", "kind": "class", "modifiers": "", "supe... |
50140860_2 | class ObjectMapperModule implements com.google.inject.Module {
public ObjectMapperModule registerModule(Module module)
{
modulesToAdd.add(module);
return this;
}
public ObjectMapperModule();
public ObjectMapperModule(Class<? extends Annotation> annotation);
public ObjectMapperModule(Annotation ... | final Injector injector = Guice.createInjector(
new ObjectMapperModule().registerModule(IntegerAsBase16Module.class, Ann.class),
new Module()
{
@Override
public void configure(Binder binder)
{
... | [FOCAL] public ObjectMapperModule ObjectMapperModule.registerModule(Module module)
[CLASS] class ObjectMapperModule implements com.google.inject.Module
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] modulesToAdd.add/1
[COLLABORATORS] field modulesToAdd add/1
[DATAFLOW] module@para... | /* static context
[FOCAL] public ObjectMapperModule ObjectMapperModule.registerModule(Module module)
[COLLABORATORS] field modulesToAdd add/1
[CALLS-EXTERNAL] modulesToAdd.add/1
*/
| /* static context
[FOCAL] public ObjectMapperModule ObjectMapperModule.registerModule(Module module)
[COLLABORATORS] field modulesToAdd add/1
[CALLS-EXTERNAL] modulesToAdd.add/1
*/
class ObjectMapperModule implements com.google.inject.Module {
public ObjectMapperModule registerModule(Module module)
{
modulesTo... | true | ok | {"focal": {"class": "ObjectMapperModule", "name": "registerModule", "signature": "ObjectMapperModule registerModule(Module module)", "start_line": 3, "modifiers": "public", "params": [{"name": "module", "type": "Module"}], "return_type": "ObjectMapperModule"}, "class_info": {"name": "ObjectMapperModule", "kind": "class... |
50151956_0 | class MessageRestController {
@RequestMapping("/message")
String getMessage() {
return this.message;
}
@Autowired
private ConfigurableEnvironment environment;
@Autowired
private MessageRestController controller;
@Autowired
private ContextRefresher refresher;
}
class ConfigurationClientApplicationTest {
... | assertThat(controller.getMessage()).isNotEqualTo("Hello test");
TestPropertyValues
.of("message:Hello test")
.applyTo(environment);
assertThat(controller.getMessage()).isNotEqualTo("Hello test");
refresher.refresh();
assertThat(controller.getMessage()).isEqualTo("Hello test");
}
} | [FOCAL] @RequestMapping("/message") String MessageRestController.getMessage()
[CLASS] class MessageRestController
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=message
[TEST] ConfigurationClientApplicationTest: @Test public void contextLoads()
[TEST-FIELDS] ConfigurableEnvironment e... | /* static context
[FOCAL] @RequestMapping("/message") String MessageRestController.getMessage()
[FIELDS] read=message
*/
| /* static context
[FOCAL] @RequestMapping("/message") String MessageRestController.getMessage()
[FIELDS] read=message
*/
class MessageRestController {
@RequestMapping("/message")
String getMessage() {
return this.message;
}
@Autowired
private ConfigurableEnvironment environment;
@Autowired
private MessageRes... | true | ok | {"focal": {"class": "MessageRestController", "name": "getMessage", "signature": "String getMessage()", "start_line": 3, "modifiers": "@RequestMapping(\"/message\")", "params": [], "return_type": "String"}, "class_info": {"name": "MessageRestController", "kind": "class", "modifiers": "", "superclass": null, "interfaces"... |
50154902_18 | class WrappingDividerAdapter extends PowerAdapterWrapper {
@Override
public int getItemCount() {
if (getObserverCount() > 0) {
return mItemCount;
}
return getItemCount(super.getItemCount());
}
WrappingDividerAdapter(@NonNull PowerAdapter adapter,
... | configure(5, SHOW_LEADING_AND_TRAILING);
mFakeAdapter.clear();
assertThat(mDividerAdapter.getItemCount()).isEqualTo(2);
verify(mObserver).onItemRangeRemoved(0, 5);
verify(mObserver).onItemRangeInserted(0, 1);
verify(mObserver).onItemRangeInserted(1, 1);
verifyNoMo... | [FOCAL] @Override public int WrappingDividerAdapter.getItemCount()
[CLASS] class WrappingDividerAdapter extends PowerAdapterWrapper
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] int getItemCount(int innerItemCount)
[CALLS-EXTERNAL] getObserverCount/0 (inherited), PowerAdapterWrap... | /* static context
[FOCAL] @Override public int WrappingDividerAdapter.getItemCount()
[PATH1] if(getObserverCount() > 0)=T -> return mItemCount
[PATH2] if(getObserverCount() > 0)=F -> return getItemCount(super.getItemCount())
[CALLS-INTERNAL] int getItemCount(int innerItemCount)
[CALLS-EXTERNAL] getObserverCount/0 (inhe... | /* static context
[FOCAL] @Override public int WrappingDividerAdapter.getItemCount()
[PATH1] if(getObserverCount() > 0)=T -> return mItemCount
[PATH2] if(getObserverCount() > 0)=F -> return getItemCount(super.getItemCount())
[CALLS-INTERNAL] int getItemCount(int innerItemCount)
[CALLS-EXTERNAL] getObserverCount/0 (inhe... | true | ok | {"focal": {"class": "WrappingDividerAdapter", "name": "getItemCount", "signature": "int getItemCount()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "WrappingDividerAdapter", "kind": "class", "modifiers": "", "superclass": "PowerAdapterWrapper", "interfa... |
50179515_11 | class WalletToolsBTC implements IWalletTools {
public MasterPrivateKeyBTC getMasterPrivateKey(String seedMnemonicSeparatedBySpaces, String password, String cryptoCurrency, int standard){
if (password == null) {
password = "";
}
List<String> split = ImmutableList.copyOf(Splitter.... | Assert.assertEquals("xprv9s21ZrQH143K3vrXj7RW2pKgDjYifyseBrZjGSnxm6ik7JeSeQMn3mE7VjvfBQhMj8hBZja7cgs2EshvQQp2Akguei7WPkJiHH7CQtMs9mJ", masterPrivateKey.getPRV());
Assert.assertEquals("xpub6C4oSHiKXiakT4f7Ukj5FDzFmgpNrM3P895aLuymmtvvMuLp5vum1MRrh9SnEzaQBBCY7homGSefdc1HJU46vPzLj8jVcGFzBGC4ZQfVVui", master... | [FOCAL] public MasterPrivateKeyBTC WalletToolsBTC.getMasterPrivateKey(String seedMnemonicSeparatedBySpaces, String password, String cryptoCurrency, int standard)
[CLASS] class WalletToolsBTC implements IWalletTools
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] MasterPrivateKeyBT... | /* static context
[FOCAL] public MasterPrivateKeyBTC WalletToolsBTC.getMasterPrivateKey(String seedMnemonicSeparatedBySpaces, String password, String cryptoCurrency, int standard)
[PATH1] if(password == null)=T -> return getMasterPrivateKey(prv,cryptoCurrency,standard)
[PATH2] if(password == null)=F -> return getMaster... | /* static context
[FOCAL] public MasterPrivateKeyBTC WalletToolsBTC.getMasterPrivateKey(String seedMnemonicSeparatedBySpaces, String password, String cryptoCurrency, int standard)
[PATH1] if(password == null)=T -> return getMasterPrivateKey(prv,cryptoCurrency,standard)
[PATH2] if(password == null)=F -> return getMaster... | true | ok | {"focal": {"class": "WalletToolsBTC", "name": "getMasterPrivateKey", "signature": "MasterPrivateKeyBTC getMasterPrivateKey(String seedMnemonicSeparatedBySpaces, String password, String cryptoCurrency, int standard)", "start_line": 3, "modifiers": "public", "params": [{"name": "seedMnemonicSeparatedBySpaces", "type": "S... |
50185885_14 | class FacebookSubscriber implements FlowableOnSubscribe<LoginResult> {
@Override public void subscribe(FlowableEmitter<LoginResult> emitter) throws Exception {
mCallback = new FacebookCallback<LoginResult>() {
@Override public void onSuccess(LoginResult result) {
if (!emitter.is... | mFacebookSubscriber.subscribe(mEmitter);
when(mEmitter.isCancelled()).thenReturn(true);
mFacebookSubscriber.mCallback.onError(new FacebookException());
verify(mEmitter, never()).onError(any(Throwable.class));
verify(mEmitter, never()).onNext(any(LoginResult.class));
verif... | [FOCAL] @Override public void FacebookSubscriber.subscribe(FlowableEmitter<LoginResult> emitter)
[CLASS] class FacebookSubscriber implements FlowableOnSubscribe<LoginResult>
[METRICS] loc=23 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] FlowableEmitter<LoginResult>.isCancelled/0, FlowableEmitter... | /* static context
[FOCAL] @Override public void FacebookSubscriber.subscribe(FlowableEmitter<LoginResult> emitter)
[COLLABORATORS] param emitter:FlowableEmitter<LoginResult> isCancelled/0,onNext/1,onComplete/0,onError/1; field mRxLogin:RxLogin registerCallback/1
[EXCEPTIONS] declares Exception
[FIELDS] read=mRxLogin:Rx... | /* static context
[FOCAL] @Override public void FacebookSubscriber.subscribe(FlowableEmitter<LoginResult> emitter)
[COLLABORATORS] param emitter:FlowableEmitter<LoginResult> isCancelled/0,onNext/1,onComplete/0,onError/1; field mRxLogin:RxLogin registerCallback/1
[EXCEPTIONS] declares Exception
[FIELDS] read=mRxLogin:Rx... | true | ok | {"focal": {"class": "FacebookSubscriber", "name": "subscribe", "signature": "void subscribe(FlowableEmitter<LoginResult> emitter) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "emitter", "type": "FlowableEmitter<LoginResult>"}], "return_type": "void"}, "class_info": {"name": "... |
50244301_3 | class BitIntegerSet implements Set<Integer>, ReversibleIterable<Integer> {
@NotNull
@Override
public Object[] toArray() {
Object[] array = new Object[cardinality()];
int i = 0;
for (Integer bitIndex : this) {
array[i++] = bitIndex;
}
return array;
}
... | BitIntegerSet intSet = new BitIntegerSet();
int[] result = intSet.toArray((int[]) null);
assertArrayEquals(EMPTY, result);
}
} | [FOCAL] @NotNull @Override public Object[] BitIntegerSet.toArray()
[CLASS] class BitIntegerSet implements Set<Integer>, ReversibleIterable<Integer>
[METRICS] loc=10 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] int cardinality()
[PATH1] foreach(Integer bitIndex : this)=T -> exit loop -> return a... | /* static context
[FOCAL] @NotNull @Override public Object[] BitIntegerSet.toArray()
[PATH1] foreach(Integer bitIndex : this)=T -> exit loop -> return array
[PATH2] foreach(Integer bitIndex : this)=F -> return array
[CALLS-INTERNAL] int cardinality()
*/
| /* static context
[FOCAL] @NotNull @Override public Object[] BitIntegerSet.toArray()
[PATH1] foreach(Integer bitIndex : this)=T -> exit loop -> return array
[PATH2] foreach(Integer bitIndex : this)=F -> return array
[CALLS-INTERNAL] int cardinality()
*/
class BitIntegerSet implements Set<Integer>, ReversibleIterable<In... | true | ok | {"focal": {"class": "BitIntegerSet", "name": "toArray", "signature": "Object[] toArray()", "start_line": 3, "modifiers": "@NotNull @Override public", "params": [], "return_type": "Object[]"}, "class_info": {"name": "BitIntegerSet", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Set<Integer>, Rever... |
50276657_1 | class AbstractAcceptance implements Acceptance {
@Override
public Response handle(Request request) {
Result result = null;
Call call = request.getCall();
try {
Object resObj = serviceInvoker.invoke(call.getService(), call.getGroup(), call.getMethod(),
call.ge... | Request request = new Request(12345, SerializeType.JACKSON, new Call(DemoService.class.getName(), "", 3000,
"hello", new Object[] { "guojinfei", 34 }, new Class<?>[] { String.class, int.class }));
Response response = acceptance.handle(request);
System.out.println(response);
... | [FOCAL] @Override public Response AbstractAcceptance.handle(Request request)
[CLASS] class AbstractAcceptance implements Acceptance
[METRICS] loc=29 cc=6 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Throwable getTargetException(InvocationTargetException e)
[CALLS-EXTERNAL] Request.getCall/0, service... | /* static context
[FOCAL] @Override public Response AbstractAcceptance.handle(Request request)
[PATH1] try-body throws -> return new Response(request.getMessageId(), request.getSerializeType(), re...
[INPUTS] branches=- | result=request
[COLLABORATORS] param request:Request getCall/0,getMessageId/0,getSerializeType/0; ... | /* static context
[FOCAL] @Override public Response AbstractAcceptance.handle(Request request)
[PATH1] try-body throws -> return new Response(request.getMessageId(), request.getSerializeType(), re...
[INPUTS] branches=- | result=request
[COLLABORATORS] param request:Request getCall/0,getMessageId/0,getSerializeType/0; ... | true | ok | {"focal": {"class": "AbstractAcceptance", "name": "handle", "signature": "Response handle(Request request)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "Request"}], "return_type": "Response"}, "class_info": {"name": "AbstractAcceptance", "kind": "class", "modifiers": "", "s... |
50300127_2 | class BasketCalculator {
public float calculatePrice(List<String> books) {
NormalizeBasket normalizeBasket = new NormalizeBasket();
normalizeBasket.addBooks(books);
float amount = 0.0f;
for (SetCollection collection : normalizeBasket.getCollections()) {
int numBooks = collection.numBooks();
... | BasketCalculator basketCalculator = new BasketCalculator();
List<String> basket = givenBasketWithBooks(FIRST_BOOK, FIRST_BOOK);
float amount = basketCalculator.calculatePrice(basket);
assertEquals(8 * 2, amount, DELTA_ZERO);
}
} | [FOCAL] public float BasketCalculator.calculatePrice(List<String> books)
[CLASS] class BasketCalculator
[METRICS] loc=13 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] float calculateDiscount(int numBooks)
[CALLS-EXTERNAL] NormalizeBasket.addBooks/1, NormalizeBasket.getCollections/0, SetCollectio... | /* static context
[FOCAL] public float BasketCalculator.calculatePrice(List<String> books)
[PATH1] foreach(SetCollection collection : normalizeBasket.getCollections())=T -> exit loop -> return amount
[PATH2] foreach(SetCollection collection : normalizeBasket.getCollections())=F -> return amount
[CALLS-INTERNAL] float c... | /* static context
[FOCAL] public float BasketCalculator.calculatePrice(List<String> books)
[PATH1] foreach(SetCollection collection : normalizeBasket.getCollections())=T -> exit loop -> return amount
[PATH2] foreach(SetCollection collection : normalizeBasket.getCollections())=F -> return amount
[CALLS-INTERNAL] float c... | true | ok | {"focal": {"class": "BasketCalculator", "name": "calculatePrice", "signature": "float calculatePrice(List<String> books)", "start_line": 3, "modifiers": "public", "params": [{"name": "books", "type": "List<String>"}], "return_type": "float"}, "class_info": {"name": "BasketCalculator", "kind": "class", "modifiers": "", ... |
50309640_18 | class ConsulAdvertiser {
public boolean register(
final String applicationScheme, final int applicationPort, final int adminPort) {
return register(applicationScheme, applicationPort, adminPort, null);
}
public ConsulAdvertiser(
final Environment environment,
final ConsulFactory configura... | factory.setServicePort(8888);
factory.setServiceAddress("127.0.0.1");
when(agent.isRegistered(anyString())).thenReturn(false);
final ConsulAdvertiser advertiser =
new ConsulAdvertiser(environment, factory, consul, serviceId);
advertiser.register("http", 8080, 8081);
final ImmutableRegi... | [FOCAL] public boolean ConsulAdvertiser.register(String applicationScheme, int applicationPort, int adminPort)
[CLASS] class ConsulAdvertiser
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] boolean register(String applicationScheme, int applicationPort, int adminPort, Collection<St... | /* static context
[FOCAL] public boolean ConsulAdvertiser.register(String applicationScheme, int applicationPort, int adminPort)
[INPUTS] branches=- | result=adminPort, applicationPort, applicationScheme
[CALLS-INTERNAL] boolean register(String applicationScheme, int applicationPort, int adminPort, Collection<String> i... | /* static context
[FOCAL] public boolean ConsulAdvertiser.register(String applicationScheme, int applicationPort, int adminPort)
[INPUTS] branches=- | result=adminPort, applicationPort, applicationScheme
[CALLS-INTERNAL] boolean register(String applicationScheme, int applicationPort, int adminPort, Collection<String> i... | true | ok | {"focal": {"class": "ConsulAdvertiser", "name": "register", "signature": "boolean register(String applicationScheme, int applicationPort, int adminPort)", "start_line": 3, "modifiers": "public", "params": [{"name": "applicationScheme", "type": "String"}, {"name": "applicationPort", "type": "int"}, {"name": "adminPort",... |
50326811_11 | class LowMemorySet extends AbstractSet<T> implements Set<T> {
@Override
public boolean add(T t) {
if (contains(t)) return false;
backing.add(t);
this.sort();
return true;
}
protected LowMemorySet(List<T> list);
public static LowMemorySet<T> create();
public st... | LowMemorySet<String> set = LowMemorySet.copyOf(ELEMENTS);
assertFalse(set.contains("Techcable"));
set.add("Techcable");
assertTrue(set.contains("Techcable"));
set.addAll(ImmutableList.of("Techcable", "PhanaticD", "Dragonslayer293", "Aikar"));
assertTrue(set.contains("Tech... | [FOCAL] @Override public boolean LowMemorySet.add(T t)
[CLASS] class LowMemorySet extends AbstractSet<T> implements Set<T>
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean contains(Object o); void sort()
[CALLS-EXTERNAL] backing.add/1
[PATH1] if(contains(t))=T -> return fals... | /* static context
[FOCAL] @Override public boolean LowMemorySet.add(T t)
[PATH1] if(contains(t))=T -> return false
[PATH2] if(contains(t))=F -> return true
[INPUTS] branches=t | result=-
[COLLABORATORS] field backing add/1
[CALLS-INTERNAL] boolean contains(Object o); void sort()
[CALLS-EXTERNAL] backing.add/1
*/
| /* static context
[FOCAL] @Override public boolean LowMemorySet.add(T t)
[PATH1] if(contains(t))=T -> return false
[PATH2] if(contains(t))=F -> return true
[INPUTS] branches=t | result=-
[COLLABORATORS] field backing add/1
[CALLS-INTERNAL] boolean contains(Object o); void sort()
[CALLS-EXTERNAL] backing.add/1
*/
class ... | true | ok | {"focal": {"class": "LowMemorySet", "name": "add", "signature": "boolean add(T t)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "t", "type": "T"}], "return_type": "boolean"}, "class_info": {"name": "LowMemorySet", "kind": "class", "modifiers": "", "superclass": "AbstractSet<T>", "interfaces": ... |
50371312_4 | class SoapUIRecipeExecutor implements RecipeExecutor {
@Override
public Execution executeRecipe(TestRecipe recipe) {
applyRecipeFilters(recipe);
return postRecipe(recipe, false);
}
@Override public Execution submitRecipe(TestRecipe recipe);
private void applyRecipeFilters(TestRecip... | TestRecipe testRecipe = newTestRecipe(
groovyScriptStep("println 'Hello Earth'")
).buildTestRecipe();
Execution execution = executor.executeRecipe(testRecipe);
assertThat(execution.getId(), is(not(nullValue())));
assertThat(execution.getCurrentStatus(), is(TestJob... | [FOCAL] @Override public Execution SoapUIRecipeExecutor.executeRecipe(TestRecipe recipe)
[CLASS] class SoapUIRecipeExecutor implements RecipeExecutor
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Execution postRecipe(TestRecipe testRecipe, boolean async); void applyRecipeFilters(... | /* static context
[FOCAL] @Override public Execution SoapUIRecipeExecutor.executeRecipe(TestRecipe recipe)
[INPUTS] branches=- | result=recipe
[CALLS-INTERNAL] Execution postRecipe(TestRecipe testRecipe, boolean async); void applyRecipeFilters(TestRecipe recipe)
*/
| /* static context
[FOCAL] @Override public Execution SoapUIRecipeExecutor.executeRecipe(TestRecipe recipe)
[INPUTS] branches=- | result=recipe
[CALLS-INTERNAL] Execution postRecipe(TestRecipe testRecipe, boolean async); void applyRecipeFilters(TestRecipe recipe)
*/
class SoapUIRecipeExecutor implements RecipeExecutor {... | true | ok | {"focal": {"class": "SoapUIRecipeExecutor", "name": "executeRecipe", "signature": "Execution executeRecipe(TestRecipe recipe)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "recipe", "type": "TestRecipe"}], "return_type": "Execution"}, "class_info": {"name": "SoapUIRecipeExecutor", "kind": "cla... |
50380775_9 | class TurbolinksSession implements TurbolinksScrollUpCallback {
public Activity getActivity() {
return activity;
}
private TurbolinksSession(final Context context);
public static TurbolinksSession getNew(Context context);
public static TurbolinksSession getDefault(Context context);
p... | assertThat(turbolinksSession.getActivity()).isNull();
}
} | [FOCAL] public Activity TurbolinksSession.getActivity()
[CLASS] class TurbolinksSession implements TurbolinksScrollUpCallback
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=activity:Activity
[INPUTS] branches=- | result=activity
[DATAFLOW] this.activity@param->L2
[CLASS-MEMBERS] Turb... | /* static context
[FOCAL] public Activity TurbolinksSession.getActivity()
[INPUTS] branches=- | result=activity
[FIELDS] read=activity:Activity
*/
| /* static context
[FOCAL] public Activity TurbolinksSession.getActivity()
[INPUTS] branches=- | result=activity
[FIELDS] read=activity:Activity
*/
class TurbolinksSession implements TurbolinksScrollUpCallback {
public Activity getActivity() {
return activity;
}
private TurbolinksSession(final Con... | true | ok | {"focal": {"class": "TurbolinksSession", "name": "getActivity", "signature": "Activity getActivity()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Activity"}, "class_info": {"name": "TurbolinksSession", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "TurbolinksScrollUpCall... |
50436236_104 | class CopyNumberChange {
CopyNumberChange(@NotNull final List<StructuralVariantLegPloidy> structuralVariants) {
assert (!structuralVariants.isEmpty());
final StructuralVariantLegPloidy template = structuralVariants.get(0);
double copyNumberDifference = copyNumberDifference(template);
... | final StructuralVariantLegPloidy leg1 = svPloidy(-1, 1, 2, 1.6);
final StructuralVariantLegPloidy leg2 = svPloidy(1, 1.5, 2, 1.6);
final List<StructuralVariantLegPloidy> legList = Lists.newArrayList(leg1, leg2);
assertPloidy(2.5, legList);
assertCopyNumberChange(-0.4, legList);
... | [FOCAL] CopyNumberChange.CopyNumberChange(List<StructuralVariantLegPloidy> structuralVariants)
[CLASS] class CopyNumberChange
[METRICS] loc=48 cc=5 branches=3 loops=1 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] boolean isPositive(StructuralVariantLegPloidy ploidy); double copyNumberDifference(StructuralVariantLegPloi... | /* static context
[FOCAL] CopyNumberChange.CopyNumberChange(List<StructuralVariantLegPloidy> structuralVariants)
[PATH1] foreach(StructuralVariantLegPloidy structuralVariant : structuralVariants)=T -> if(isPositive(structuralVariant))=T -> if(Doubles.lessThan(ploidy, minPloidy))=T -> exit loop -> if(upCount > 0 && down... | /* static context
[FOCAL] CopyNumberChange.CopyNumberChange(List<StructuralVariantLegPloidy> structuralVariants)
[PATH1] foreach(StructuralVariantLegPloidy structuralVariant : structuralVariants)=T -> if(isPositive(structuralVariant))=T -> if(Doubles.lessThan(ploidy, minPloidy))=T -> exit loop -> if(upCount > 0 && down... | true | ok | {"focal": {"class": "CopyNumberChange", "name": "CopyNumberChange", "signature": "CopyNumberChange(List<StructuralVariantLegPloidy> structuralVariants)", "start_line": 3, "modifiers": "", "params": [{"name": "structuralVariants", "type": "List<StructuralVariantLegPloidy>"}], "return_type": null}, "class_info": {"name":... |
50446559_84 | class BoltNeo4jStatement extends Neo4jStatement {
public static Statement newInstance(boolean debug, BoltNeo4jConnectionImpl connection, int... rsParams) {
Statement statement = new BoltNeo4jStatement(connection, rsParams);
((Neo4jStatement) statement).setDebug(debug);
return (Statement) Proxy.newProxyInstance(... |
Statement statement = BoltNeo4jStatement.newInstance(false, mockConnectionOpenWithTransactionThatReturns(null));
statement.close();
verify(mockedRS, never()).close();
}
} | [FOCAL] public static Statement BoltNeo4jStatement.newInstance(boolean debug, BoltNeo4jConnectionImpl connection, int... rsParams)
[CLASS] class BoltNeo4jStatement extends Neo4jStatement
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ((Neo4jStatement) statement).setDebug/1, Proxy.... | /* static context
[FOCAL] public static Statement BoltNeo4jStatement.newInstance(boolean debug, BoltNeo4jConnectionImpl connection, int... rsParams)
[INPUTS] branches=- | result=connection, debug, rsParams
[NEW] BoltNeo4jStatement, Neo4jInvocationHandler
[CALLS-EXTERNAL] ((Neo4jStatement) statement).setDebug/1, Proxy.n... | /* static context
[FOCAL] public static Statement BoltNeo4jStatement.newInstance(boolean debug, BoltNeo4jConnectionImpl connection, int... rsParams)
[INPUTS] branches=- | result=connection, debug, rsParams
[NEW] BoltNeo4jStatement, Neo4jInvocationHandler
[CALLS-EXTERNAL] ((Neo4jStatement) statement).setDebug/1, Proxy.n... | true | ok | {"focal": {"class": "BoltNeo4jStatement", "name": "newInstance", "signature": "Statement newInstance(boolean debug, BoltNeo4jConnectionImpl connection, int... rsParams)", "start_line": 3, "modifiers": "public static", "params": [{"name": "debug", "type": "boolean"}, {"name": "connection", "type": "BoltNeo4jConnectionIm... |
50459141_8 | class ChronosController {
@RequestMapping(value="/job/{id}", method=RequestMethod.DELETE)
public @ResponseBody Response deleteJob(@PathVariable("id") Long id)
throws NotFoundException {
JobSpec aJob = getJob(id);
jobDao.deleteJob(aJob.getId());
return SUCCESS;
}
@Autowired public ChronosCon... | JobSpec aJob = getTestJob("Some Job");
when(jobDao.getJob(aJob.getId())).thenReturn(aJob);
MockHttpServletRequestBuilder request = delete(String.format("/api/job/%s", aJob.getId()));
mockMvc.perform(request)
.andExpect(status().isOk())
.andExpect(content().string(success));
verify(jobD... | [FOCAL] @RequestMapping(value="/job/{id}", method=RequestMethod.DELETE) public @ResponseBody Response ChronosController.deleteJob(Long id)
[CLASS] class ChronosController
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] JobSpec getJob(Long id)
[CALLS-EXTERNAL] JobDao.deleteJob/1, Jo... | /* static context
[FOCAL] @RequestMapping(value="/job/{id}", method=RequestMethod.DELETE) public @ResponseBody Response ChronosController.deleteJob(Long id)
[COLLABORATORS] field jobDao:JobDao deleteJob/1
[EXCEPTIONS] declares NotFoundException
[CALLS-INTERNAL] JobSpec getJob(Long id)
[FIELDS] read=jobDao:JobDao
[CALLS... | /* static context
[FOCAL] @RequestMapping(value="/job/{id}", method=RequestMethod.DELETE) public @ResponseBody Response ChronosController.deleteJob(Long id)
[COLLABORATORS] field jobDao:JobDao deleteJob/1
[EXCEPTIONS] declares NotFoundException
[CALLS-INTERNAL] JobSpec getJob(Long id)
[FIELDS] read=jobDao:JobDao
[CALLS... | true | ok | {"focal": {"class": "ChronosController", "name": "deleteJob", "signature": "Response deleteJob(Long id) throws NotFoundException", "start_line": 3, "modifiers": "@RequestMapping(value=\"/job/{id}\", method=RequestMethod.DELETE) public @ResponseBody", "params": [{"name": "id", "type": "Long"}], "return_type": "Response"... |
50552134_4 | class JarUtils {
public static JarFile toJarFile(URL jarURL) throws IOException {
JarFile jarFile = null;
final String jarAbsolutePath = resolveJarAbsolutePath(jarURL);
if (jarAbsolutePath == null)
return null;
jarFile = new JarFile(jarAbsolutePath);
return jarFi... | URL resourceURL = ClassLoaderUtils.getClassResource(classLoader, String.class);
JarFile jarFile = JarUtils.toJarFile(resourceURL);
JarFile rtJarFile = new JarFile(new File(SystemUtils.JAVA_HOME, "/lib/rt.jar"));
Assert.assertNotNull(jarFile);
Assert.assertEquals(rtJarFile.getName... | [FOCAL] public static JarFile JarUtils.toJarFile(URL jarURL)
[CLASS] class JarUtils
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] String resolveJarAbsolutePath(URL jarURL)
[NEW] JarFile
[EXCEPTIONS] declares IOException
[PATH1] if(jarAbsolutePath == null)=T -> return null
[PATH2]... | /* static context
[FOCAL] public static JarFile JarUtils.toJarFile(URL jarURL)
[PATH1] if(jarAbsolutePath == null)=T -> return null
[PATH2] if(jarAbsolutePath == null)=F -> return jarFile
[INPUTS] branches=jarURL | result=jarURL
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] String resolveJarAbsolutePath(URL jarURL... | /* static context
[FOCAL] public static JarFile JarUtils.toJarFile(URL jarURL)
[PATH1] if(jarAbsolutePath == null)=T -> return null
[PATH2] if(jarAbsolutePath == null)=F -> return jarFile
[INPUTS] branches=jarURL | result=jarURL
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] String resolveJarAbsolutePath(URL jarURL... | true | ok | {"focal": {"class": "JarUtils", "name": "toJarFile", "signature": "JarFile toJarFile(URL jarURL) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "jarURL", "type": "URL"}], "return_type": "JarFile"}, "class_info": {"name": "JarUtils", "kind": "class", "modifiers": "", "superclass"... |
50560378_1 | class PostRepository extends AbstractRepository<Post, Long> {
public List<Post> findByKeyword(String keyword) {
return stream().filter(p -> p.getTitle().contains(keyword) || p.getContent().contains(keyword))
.collect(toList());
}
public long countByKeyword(String keyword);
@Ove... | List<Post> foundPosts = posts.findByKeyword("test123");
assertEquals(0, foundPosts.size());
}
} | [FOCAL] public List<Post> PostRepository.findByKeyword(String keyword)
[CLASS] class PostRepository extends AbstractRepository<Post, Long>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] stream().filter(p -> p.getTitle().contains(keyword) || p.....collect/1, stream().filter/1, stre... | /* static context
[FOCAL] public List<Post> PostRepository.findByKeyword(String keyword)
[INPUTS] branches=- | result=keyword
[COLLABORATORS] field p getTitle/0,getContent/0
[CALLS-EXTERNAL] stream().filter(p -> p.getTitle().contains(keyword) || p.....collect/1, stream().filter/1, stream/0 (inherited), p.getTitle().con... | /* static context
[FOCAL] public List<Post> PostRepository.findByKeyword(String keyword)
[INPUTS] branches=- | result=keyword
[COLLABORATORS] field p getTitle/0,getContent/0
[CALLS-EXTERNAL] stream().filter(p -> p.getTitle().contains(keyword) || p.....collect/1, stream().filter/1, stream/0 (inherited), p.getTitle().con... | true | ok | {"focal": {"class": "PostRepository", "name": "findByKeyword", "signature": "List<Post> findByKeyword(String keyword)", "start_line": 3, "modifiers": "public", "params": [{"name": "keyword", "type": "String"}], "return_type": "List<Post>"}, "class_info": {"name": "PostRepository", "kind": "class", "modifiers": "", "sup... |
50571610_0 | class TenantContextHeaderInterceptor implements ClientHttpRequestInterceptor {
public void setHeaderName(String headerName) {
this.headerName = headerName;
}
@Override public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution);
private TenantContextHeaderInterce... | this.interceptor.setHeaderName("context");
List<ClientHttpRequestInterceptor> interceptors = new ArrayList<>();
interceptors.add(this.interceptor);
RestTemplate template = new RestTemplate();
template.setInterceptors(interceptors);
MockRestServiceServer mockServer = MockRestServiceServer.createServer(tem... | [FOCAL] public void TenantContextHeaderInterceptor.setHeaderName(String headerName)
[CLASS] class TenantContextHeaderInterceptor implements ClientHttpRequestInterceptor
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=headerName
[STATE] headerName
[DATAFLOW] headerName@param->L2
[CLAS... | /* static context
[FOCAL] public void TenantContextHeaderInterceptor.setHeaderName(String headerName)
[STATE] headerName
[FIELDS] write=headerName
*/
| /* static context
[FOCAL] public void TenantContextHeaderInterceptor.setHeaderName(String headerName)
[STATE] headerName
[FIELDS] write=headerName
*/
class TenantContextHeaderInterceptor implements ClientHttpRequestInterceptor {
public void setHeaderName(String headerName) {
this.headerName = headerName;
}
@Over... | true | ok | {"focal": {"class": "TenantContextHeaderInterceptor", "name": "setHeaderName", "signature": "void setHeaderName(String headerName)", "start_line": 3, "modifiers": "public", "params": [{"name": "headerName", "type": "String"}], "return_type": "void"}, "class_info": {"name": "TenantContextHeaderInterceptor", "kind": "cla... |
50579018_38 | class Value extends Expirable {
@Override
public Object getValue() {
return value;
}
public Value();
public Value(Object version, long timestamp, Object value);
@Override @SuppressWarnings("unchecked") public boolean isReplaceableBy(long txTimestamp, Object newVersion, Comparator ve... | String expectedValue = "Some value";
Value value = new Value(null, 100L, expectedValue);
assertNull(value.getValue(99L));
}
} | [FOCAL] @Override public Object Value.getValue()
[CLASS] class Value extends Expirable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Value(); Value(Object version, long timestamp, Object value); boolean isReplaceableBy(long txTimestamp, Object newVersion, Comparator versionCompara... | /* static context
[FOCAL] @Override public Object Value.getValue()
*/
| /* static context
[FOCAL] @Override public Object Value.getValue()
*/
class Value extends Expirable {
@Override
public Object getValue() {
return value;
}
public Value();
public Value(Object version, long timestamp, Object value);
@Override @SuppressWarnings("unchecked") public bool... | true | ok | {"focal": {"class": "Value", "name": "getValue", "signature": "Object getValue()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Object"}, "class_info": {"name": "Value", "kind": "class", "modifiers": "", "superclass": "Expirable", "interfaces": null, "fields": [], "members": [{"name":... |
50594316_20 | class GTSEncoder implements Cloneable {
public synchronized void merge(GTSEncoder encoder) throws IOException {
if (this.readonly) {
throw new RuntimeException("Encoder is read-only.");
}
//
// If the current encoder is empty and the base timestamps and wrapping
// keys match, simply reset... | long now = System.currentTimeMillis() * 1000L;
byte[] key = new byte[32];
GTSEncoder encoder1 = new GTSEncoder(now - 1000000L, key);
encoder1.addValue(now, 111L, 11L, new BigDecimal("1.11"));
encoder1.addValue(now + 1000000L, 222L, 22L, new BigDecimal("2.22"));
GTSEncoder encoder2 = ne... | [FOCAL] public synchronized void GTSEncoder.merge(GTSEncoder encoder)
[CLASS] class GTSEncoder implements Cloneable
[METRICS] loc=53 cc=5 branches=3 loops=1 returns=1 throws=1 nesting=2
[CALLS-INTERNAL] int addValue(long timestamp, long location, long elevation, Object value); int size(); void reset(GTSEncoder encoder)... | class GTSEncoder implements Cloneable {
public synchronized void merge(GTSEncoder encoder) throws IOException {
if (this.readonly) {
throw new RuntimeException("Encoder is read-only.");
}
//
// If the current encoder is empty and the base timestamps and wrapping
// keys match, simply reset... | false | ok | {"focal": {"class": "GTSEncoder", "name": "merge", "signature": "void merge(GTSEncoder encoder) throws IOException", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "encoder", "type": "GTSEncoder"}], "return_type": "void"}, "class_info": {"name": "GTSEncoder", "kind": "class", "modifiers": "", ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.