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
5054234_1
class TagValue { protected CharSequence getValue(String key) { CharSequence val = tagValues.get(key); if (val == null) return getDefault(key); else return val; } public TagValue(String data); protected Set<String> tagSet(); protected boolean contai...
TagValue t = new TagValue("\r\n\tp = hi\t"); Assert.assertEquals("hi", t.getValue("p")); } }
[FOCAL] protected CharSequence TagValue.getValue(String key) [CLASS] class TagValue [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] CharSequence getDefault(String key) [CALLS-EXTERNAL] tagValues.get/1 [PATH1] if(val == null)=T -> return getDefault(key) [PATH2] if(val == null)=F -> ...
/* static context [FOCAL] protected CharSequence TagValue.getValue(String key) [PATH1] if(val == null)=T -> return getDefault(key) [PATH2] if(val == null)=F -> return val [INPUTS] branches=key | result=key [COLLABORATORS] field tagValues get/1 [CALLS-INTERNAL] CharSequence getDefault(String key) [CALLS-EXTERNAL] tagVal...
/* static context [FOCAL] protected CharSequence TagValue.getValue(String key) [PATH1] if(val == null)=T -> return getDefault(key) [PATH2] if(val == null)=F -> return val [INPUTS] branches=key | result=key [COLLABORATORS] field tagValues get/1 [CALLS-INTERNAL] CharSequence getDefault(String key) [CALLS-EXTERNAL] tagVal...
true
ok
{"focal": {"class": "TagValue", "name": "getValue", "signature": "CharSequence getValue(String key)", "start_line": 3, "modifiers": "protected", "params": [{"name": "key", "type": "String"}], "return_type": "CharSequence"}, "class_info": {"name": "TagValue", "kind": "class", "modifiers": "", "superclass": null, "interf...
5054237_27
class ArgumentParser { public Integer getNumericValueForTag(String tag, String exceptionMessage) throws SyntaxException { Argument argument = retrieveArgumentIfExists(tag, exceptionMessage); if (argument == null) { return null; } return retrieveNumericValue(argument, exc...
ArgumentParser argumentParser = new ArgumentParser(Lists.newArrayList(ANY_TAG_ARGUMENT, NUMBER_ARGUMENT)); assertThat(argumentParser.getNumericValueForTag(ANY_TAG, EXCEPTION_MESSAGE)).isEqualTo(NUMERIC_VALUE); } }
[FOCAL] public Integer ArgumentParser.getNumericValueForTag(String tag, String exceptionMessage) [CLASS] class ArgumentParser [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] Argument retrieveArgumentIfExists(String tag, String exceptionMessage); Integer retrieveNumericValue(Argumen...
/* static context [FOCAL] public Integer ArgumentParser.getNumericValueForTag(String tag, String exceptionMessage) [PATH1] if(argument == null)=T -> return null [PATH2] if(argument == null)=F -> return retrieveNumericValue(argument, exceptionMessage) [INPUTS] branches=exceptionMessage, tag | result=exceptionMessage, ta...
/* static context [FOCAL] public Integer ArgumentParser.getNumericValueForTag(String tag, String exceptionMessage) [PATH1] if(argument == null)=T -> return null [PATH2] if(argument == null)=F -> return retrieveNumericValue(argument, exceptionMessage) [INPUTS] branches=exceptionMessage, tag | result=exceptionMessage, ta...
true
ok
{"focal": {"class": "ArgumentParser", "name": "getNumericValueForTag", "signature": "Integer getNumericValueForTag(String tag, String exceptionMessage) throws SyntaxException", "start_line": 3, "modifiers": "public", "params": [{"name": "tag", "type": "String"}, {"name": "exceptionMessage", "type": "String"}], "return_...
5061371_1
class IPv4PacketImpl extends AbstractPacket implements IPv4Packet { @Override public int getTotalIPLength() { // byte 3 - 4 return this.headers.getUnsignedShort(2); } public IPv4PacketImpl(final Packet parent, final Buffer headers, final int options, final Buffer payload); @Overr...
final List<IPv4Packet> ipPackets = loadIPPackets("sipp.pcap"); assertThat(ipPackets.get(0).getTotalIPLength(), is(533)); assertThat(ipPackets.get(1).getTotalIPLength(), is(334)); assertThat(ipPackets.get(2).getTotalIPLength(), is(493)); assertThat(ipPackets.get(3).getTotalIPLengt...
[FOCAL] @Override public int IPv4PacketImpl.getTotalIPLength() [CLASS] class IPv4PacketImpl extends AbstractPacket implements IPv4Packet [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] this.headers.getUnsignedShort/1 [FIELDS] read=headers [COLLABORATORS] field headers getUnsignedSh...
/* static context [FOCAL] @Override public int IPv4PacketImpl.getTotalIPLength() [COLLABORATORS] field headers getUnsignedShort/1 [FIELDS] read=headers [CALLS-EXTERNAL] this.headers.getUnsignedShort/1 */
/* static context [FOCAL] @Override public int IPv4PacketImpl.getTotalIPLength() [COLLABORATORS] field headers getUnsignedShort/1 [FIELDS] read=headers [CALLS-EXTERNAL] this.headers.getUnsignedShort/1 */ class IPv4PacketImpl extends AbstractPacket implements IPv4Packet { @Override public int getTotalIPLength()...
true
ok
{"focal": {"class": "IPv4PacketImpl", "name": "getTotalIPLength", "signature": "int getTotalIPLength()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "IPv4PacketImpl", "kind": "class", "modifiers": "", "superclass": "AbstractPacket", "interfaces": "IPv4Pa...
5074598_40
class VersionUpdater { public void run(List<File> files) throws Exception { for (File file : files) { logger.info("processing: " + file.getPath()); try { PomWrapper wrapped = new PomWrapper(file); boolean changed = possibly...
logger.info("*** testAutomaticVersionDetectionRegulaToSnapshot ***"); String oldVersion = "1.0.1"; String newVersion = "1.0.2-SNAPSHOT"; List<File> poms = createTestPoms("basepom.xml", 1); File pom = poms.get(0); updatePom(pom, PomPaths.PROJECT_VERSION, oldVersion); ...
[FOCAL] public void VersionUpdater.run(List<File> files) [CLASS] class VersionUpdater [METRICS] loc=31 cc=5 branches=1 loops=1 returns=0 throws=0 nesting=4 [CALLS-INTERNAL] boolean possiblyUpdateDependencies(PomWrapper wrapped); boolean possiblyUpdateParentVersion(PomWrapper wrapped); boolean possiblyUpdateProjectVersi...
/* static context [FOCAL] public void VersionUpdater.run(List<File> files) [PATH1] foreach(File file : files)=T -> if(changed)=T -> try-body throws -> exit loop [PATH2] foreach(File file : files)=F [PATH3] foreach(File file : files)=T -> if(changed)=F -> exit loop [INPUTS] branches=files | result=- [EXCEPTIONS] declare...
/* static context [FOCAL] public void VersionUpdater.run(List<File> files) [PATH1] foreach(File file : files)=T -> if(changed)=T -> try-body throws -> exit loop [PATH2] foreach(File file : files)=F [PATH3] foreach(File file : files)=T -> if(changed)=F -> exit loop [INPUTS] branches=files | result=- [EXCEPTIONS] declare...
true
ok
{"focal": {"class": "VersionUpdater", "name": "run", "signature": "void run(List<File> files) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "files", "type": "List<File>"}], "return_type": "void"}, "class_info": {"name": "VersionUpdater", "kind": "class", "modifiers": "", "superclass": n...
5084932_20
class JobServiceImpl extends WaspMessageHandlingServiceImpl implements JobService { @Override public List<Job> getJobsAwaitingLibraryCreation(){ List<Job> JobsAwaitingLibraryCreation = new ArrayList<Job>(); for (Job job : getActiveJobs()){ for (Sample sample: job.getSample()){ if (sampleService.isSampleAw...
List<Job> JobsAwaitingLibraryCreation = new ArrayList<Job>(); Job job = new Job(); job.setJobId(1); Sample sample = new Sample(); sample.setSampleId(1); JobSample js = new JobSample(); js.setJobSampleId(1); js.setJob(job); js.setSample(sample); List<JobSample> jobSamples = new Arra...
[FOCAL] @Override public List<Job> JobServiceImpl.getJobsAwaitingLibraryCreation() [CLASS] class JobServiceImpl extends WaspMessageHandlingServiceImpl implements JobService [METRICS] loc=13 cc=4 branches=1 loops=2 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] List<Job> getActiveJobs() [CALLS-EXTERNAL] Job.getSample/0, ...
class JobServiceImpl extends WaspMessageHandlingServiceImpl implements JobService { @Override public List<Job> getJobsAwaitingLibraryCreation(){ List<Job> JobsAwaitingLibraryCreation = new ArrayList<Job>(); for (Job job : getActiveJobs()){ for (Sample sample: job.getSample()){ if (sampleService.isSampleAw...
false
ok
{"focal": {"class": "JobServiceImpl", "name": "getJobsAwaitingLibraryCreation", "signature": "List<Job> getJobsAwaitingLibraryCreation()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<Job>"}, "class_info": {"name": "JobServiceImpl", "kind": "class", "modifiers": "", "superclass":...
5093728_1
class FeatureChecker { public T run() { T result = null; if(context.hasFeature(featureName)) { result = onFeatureEnabled(); } else { result = onFeatureDisabled(); } return result; } public FeatureChecker(FeatureContext storage, String featureName); public abstract T onFeatureEnabled(); publi...
when(context.hasFeature("test.feature")).thenReturn(false); assertEquals("checker should return 'disabledStatus' string", "disabledStatus", checker.run()); } }
[FOCAL] public T FeatureChecker.run() [CLASS] class FeatureChecker [METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] T onFeatureDisabled(); T onFeatureEnabled() [CALLS-EXTERNAL] FeatureContext.hasFeature/1 [FIELDS] read=context:FeatureContext, featureName:String [PATH1] if(context.h...
/* static context [FOCAL] public T FeatureChecker.run() [PATH1] if(context.hasFeature(featureName))=T -> return result [PATH2] if(context.hasFeature(featureName))=F -> return result [INPUTS] branches=context, featureName | result=- [COLLABORATORS] field context:FeatureContext hasFeature/1 [CALLS-INTERNAL] T onFeatureDi...
/* static context [FOCAL] public T FeatureChecker.run() [PATH1] if(context.hasFeature(featureName))=T -> return result [PATH2] if(context.hasFeature(featureName))=F -> return result [INPUTS] branches=context, featureName | result=- [COLLABORATORS] field context:FeatureContext hasFeature/1 [CALLS-INTERNAL] T onFeatureDi...
true
ok
{"focal": {"class": "FeatureChecker", "name": "run", "signature": "T run()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "T"}, "class_info": {"name": "FeatureChecker", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "context", "type": "FeatureContex...
5094929_0
class Sum { static void sum(InputStream in, PrintStream out) { try ( Scanner scanner = new Scanner(in);) { int a = scanner.nextInt(); int b = scanner.nextInt(); int s = a + b; out.print(s); } } public static void main(String[] args); } class SumTest { @Test public...
PipedOutputStream pos = new PipedOutputStream(); InputStream in = new PipedInputStream(pos); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos); pos.write("3\n4\n".getBytes()); Sum.sum(in, out); String output = new String(baos.toB...
[FOCAL] static void Sum.sum(InputStream in, PrintStream out) [CLASS] class Sum [METRICS] loc=9 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] Scanner.nextInt/0, PrintStream.print/1 [NEW] Scanner [COLLABORATORS] param out:PrintStream print/1 [DATAFLOW] a@L4->L6; b@L5->L6; in@param->L2; out@param->...
/* static context [FOCAL] static void Sum.sum(InputStream in, PrintStream out) [COLLABORATORS] param out:PrintStream print/1 [NEW] Scanner [CALLS-EXTERNAL] Scanner.nextInt/0, PrintStream.print/1 */
/* static context [FOCAL] static void Sum.sum(InputStream in, PrintStream out) [COLLABORATORS] param out:PrintStream print/1 [NEW] Scanner [CALLS-EXTERNAL] Scanner.nextInt/0, PrintStream.print/1 */ class Sum { static void sum(InputStream in, PrintStream out) { try ( Scanner scanner = new Scanner(in);) { ...
true
ok
{"focal": {"class": "Sum", "name": "sum", "signature": "void sum(InputStream in, PrintStream out)", "start_line": 3, "modifiers": "static", "params": [{"name": "in", "type": "InputStream"}, {"name": "out", "type": "PrintStream"}], "return_type": "void"}, "class_info": {"name": "Sum", "kind": "class", "modifiers": "", "...
5104280_226
class ANCClient implements ANCSmartRegisterClient { @Override public boolean satisfiesFilter(String filterCriterion) { return name.toLowerCase(Locale.getDefault()).startsWith(filterCriterion.toLowerCase()) || String.valueOf(ec_number).startsWith(filterCriterion) || Strin...
boolean filterMatches = getClient().satisfiesFilter("xyz"); assertFalse(filterMatches); } }
[FOCAL] @Override public boolean ANCClient.satisfiesFilter(String filterCriterion) [CLASS] class ANCClient implements ANCSmartRegisterClient [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] name.toLowerCase(Locale.getDefault()).startsWith/1, name.toLowerCase/1, Locale.getDefault/0, ...
/* static context [FOCAL] @Override public boolean ANCClient.satisfiesFilter(String filterCriterion) [INPUTS] branches=- | result=filterCriterion [COLLABORATORS] field name toLowerCase/1 [CALLS-EXTERNAL] name.toLowerCase(Locale.getDefault()).startsWith/1, name.toLowerCase/1, Locale.getDefault/0, String.toLowerCase/0, S...
/* static context [FOCAL] @Override public boolean ANCClient.satisfiesFilter(String filterCriterion) [INPUTS] branches=- | result=filterCriterion [COLLABORATORS] field name toLowerCase/1 [CALLS-EXTERNAL] name.toLowerCase(Locale.getDefault()).startsWith/1, name.toLowerCase/1, Locale.getDefault/0, String.toLowerCase/0, S...
true
ok
{"focal": {"class": "ANCClient", "name": "satisfiesFilter", "signature": "boolean satisfiesFilter(String filterCriterion)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "filterCriterion", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "ANCClient", "kind": "class", "modifi...
5109749_18
class LocalizationUtil { public static String getEnumLocalizationKey(Enum<?> e) { //Enumy zurnalovanych objektu pouzivaji klice, aby se nemusely prekladat dvakrat if (Localizable.class.isAssignableFrom(e.getClass())) return ((Localizable) e).getKey(); return new StringBuilder(e.getDeclaringClass().getN...
Assert.assertEquals("cz.datalite.localization.TestEnumPlain.FOO", LocalizationUtil.getEnumLocalizationKey(TestEnumPlain.FOO)); try { LocalizationUtil.getEnumLocalizationKey(null); fail("Should fail on NPE"); } catch (NullPointerException expexted) { //expected } Assert.assertEquals("foo.bar", Localiz...
[FOCAL] public static String LocalizationUtil.getEnumLocalizationKey(Enum<?> e) [CLASS] class LocalizationUtil [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Localizable.class.isAssignableFrom/1, Enum<?>.getClass/0, ((Localizable) e).getKey/0, new StringBuilder(e.getDeclaringClass...
/* static context [FOCAL] public static String LocalizationUtil.getEnumLocalizationKey(Enum<?> e) [PATH1] if(Localizable.class.isAssignableFrom(e.getClass()))=T -> return ((Localizable) e).getKey() [PATH2] if(Localizable.class.isAssignableFrom(e.getClass()))=F -> return new StringBuilder(e.getDeclaringClass().getName()...
/* static context [FOCAL] public static String LocalizationUtil.getEnumLocalizationKey(Enum<?> e) [PATH1] if(Localizable.class.isAssignableFrom(e.getClass()))=T -> return ((Localizable) e).getKey() [PATH2] if(Localizable.class.isAssignableFrom(e.getClass()))=F -> return new StringBuilder(e.getDeclaringClass().getName()...
true
ok
{"focal": {"class": "LocalizationUtil", "name": "getEnumLocalizationKey", "signature": "String getEnumLocalizationKey(Enum<?> e)", "start_line": 3, "modifiers": "public static", "params": [{"name": "e", "type": "Enum<?>"}], "return_type": "String"}, "class_info": {"name": "LocalizationUtil", "kind": "class", "modifiers...
5122021_99
class CompositeJSONProvider implements JSONProvider { @Override public JSONObject get() throws JSONException { JSONObject mergedJsonObject = new JSONObject(); for (JSONProvider jsonProvider : jsonProviderList) { JSONObject jsonObject = jsonProvider.get(); mergeInto(mergedJsonObject, jsonObjec...
JSONObject jsonObject = compositeJSONProvider1.get(); Assert.assertEquals(jsonObject.get("key1"), "value1"); Assert.assertEquals(jsonObject.get("key2"), "value2"); Assert.assertEquals(jsonObject.get("key3"), "value3"); Assert.assertEquals(jsonObject.getJSONObject("key4").get("key5"), "value5"); ...
[FOCAL] @Override public JSONObject CompositeJSONProvider.get() [CLASS] class CompositeJSONProvider implements JSONProvider [METRICS] loc=12 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] JSONObject mergeInto(JSONObject destinationJsonObject, JSONObject sourceJsonObject) [CALLS-EXTERNAL] JSONProv...
/* static context [FOCAL] @Override public JSONObject CompositeJSONProvider.get() [PATH1] foreach(JSONProvider jsonProvider : jsonProviderList)=T -> exit loop -> return mergedJsonObject [PATH2] foreach(JSONProvider jsonProvider : jsonProviderList)=F -> return mergedJsonObject [EXCEPTIONS] declares JSONException [CALLS-...
/* static context [FOCAL] @Override public JSONObject CompositeJSONProvider.get() [PATH1] foreach(JSONProvider jsonProvider : jsonProviderList)=T -> exit loop -> return mergedJsonObject [PATH2] foreach(JSONProvider jsonProvider : jsonProviderList)=F -> return mergedJsonObject [EXCEPTIONS] declares JSONException [CALLS-...
true
ok
{"focal": {"class": "CompositeJSONProvider", "name": "get", "signature": "JSONObject get() throws JSONException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "JSONObject"}, "class_info": {"name": "CompositeJSONProvider", "kind": "class", "modifiers": "", "superclass": null, "interface...
5123943_1
class Functions { public static double zeta(double x, double q) { // * Check arguments if(x == 1.0) return Double.POSITIVE_INFINITY; if(q < 1.0) return Double.NaN; if(q <= 0.0) if(q == floor(q)) return Double.POSITIVE_INFINITY; else return Double.NaN; double s = pow(q, -x); double...
assertEquals(1.64493406684822, zeta(2.0), 10E-12); assertEquals(1.13182783346272, zeta(3.456), 10E-12); assertEquals(1.00000089006735, zeta(20.1), 10E-12); assertEquals(2.61237534868548, zeta(1.5), 10E-12); assertEquals(1.34148725725091, zeta(2.5), 10E-12); assertEquals(1.18338365211190, zeta(3.1), 10E-12...
[FOCAL] public static double Functions.zeta(double x, double q) [CLASS] class Functions [METRICS] loc=58 cc=9 branches=6 loops=2 returns=5 throws=0 nesting=2 [CALLS-EXTERNAL] floor/1 (inherited), pow/2 (inherited), abs/1 (inherited) [PATH1] if(x == 1.0)=F -> if(q < 1.0)=F -> if(q <= 0.0)=F -> while((i < 9 || a <= 9.0) ...
/* static context [FOCAL] public static double Functions.zeta(double x, double q) [PATH1] if(x == 1.0)=F -> if(q < 1.0)=F -> if(q <= 0.0)=F -> while((i < 9 || a <= 9.0) && ! done)=T -> if(abs(b/s) < EPSILON)=T -> exit loop -> for(i < 12 && ! done)=T -> if(t < EPSILON)=T -> exit loop -> return s [PATH2] if(x == 1.0)=F -...
/* static context [FOCAL] public static double Functions.zeta(double x, double q) [PATH1] if(x == 1.0)=F -> if(q < 1.0)=F -> if(q <= 0.0)=F -> while((i < 9 || a <= 9.0) && ! done)=T -> if(abs(b/s) < EPSILON)=T -> exit loop -> for(i < 12 && ! done)=T -> if(t < EPSILON)=T -> exit loop -> return s [PATH2] if(x == 1.0)=F -...
true
ok
{"focal": {"class": "Functions", "name": "zeta", "signature": "double zeta(double x, double q)", "start_line": 3, "modifiers": "public static", "params": [{"name": "x", "type": "double"}, {"name": "q", "type": "double"}], "return_type": "double"}, "class_info": {"name": "Functions", "kind": "class", "modifiers": "", "s...
5151102_34
class Timeout { public BigDecimal getTimeToRepetitionInMinutes() { return new BigDecimal(timeToRepetition.orElse(0).doubleValue() / 1000 / 60); } public Timeout(String key, int value); public Timeout(String key, int value, int timeToRepetition, Category category, PlaceOfUse placeOfUse); ...
Timeout timeout = new Timeout(engine, step, value); assertEquals("The timeToRepetition in min should be 0, if there was no value set.", new BigDecimal(0), timeout.getTimeToRepetitionInMinutes()); } }
[FOCAL] public BigDecimal Timeout.getTimeToRepetitionInMinutes() [CLASS] class Timeout [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] timeToRepetition.orElse(0).doubleValue/0, timeToRepetition.orElse/1 [NEW] BigDecimal [COLLABORATORS] field timeToRepetition orElse/1 [CLASS-MEMBERS...
/* static context [FOCAL] public BigDecimal Timeout.getTimeToRepetitionInMinutes() [COLLABORATORS] field timeToRepetition orElse/1 [NEW] BigDecimal [CALLS-EXTERNAL] timeToRepetition.orElse(0).doubleValue/0, timeToRepetition.orElse/1 */
/* static context [FOCAL] public BigDecimal Timeout.getTimeToRepetitionInMinutes() [COLLABORATORS] field timeToRepetition orElse/1 [NEW] BigDecimal [CALLS-EXTERNAL] timeToRepetition.orElse(0).doubleValue/0, timeToRepetition.orElse/1 */ class Timeout { public BigDecimal getTimeToRepetitionInMinutes() { retu...
true
ok
{"focal": {"class": "Timeout", "name": "getTimeToRepetitionInMinutes", "signature": "BigDecimal getTimeToRepetitionInMinutes()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "BigDecimal"}, "class_info": {"name": "Timeout", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null,...
5158290_56
class GEIndividual extends AbstractIndividual { public static GEIndividual getIndividual(final GEGrammar grammar, final Phenotype phen, final Genotype genotype, final Fitness fitness) { final GEIndividual gei; if(grammar instanceof GEGrammar) { gei = new GEIndividual(grammar, phen, genotype, fitness)...
System.out.println("* GEIndividualTest: getIndividual"); GEGrammar geg = new GEGrammar(); Phenotype p = new Phenotype(); int[] ia2 = {0}; Genotype geno2 = new Genotype(); geno2.add(new GEChromosome(1, ia2)); Fitness f = new BasicFitness(); GEIndividual gei...
[FOCAL] public static GEIndividual GEIndividual.getIndividual(GEGrammar grammar, Phenotype phen, Genotype genotype, Fitness fitness) [CLASS] class GEIndividual extends AbstractIndividual [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [NEW] GEIndividual, IllegalArgumentException [EXCEPTIONS] throws...
/* static context [FOCAL] public static GEIndividual GEIndividual.getIndividual(GEGrammar grammar, Phenotype phen, Genotype genotype, Fitness fitness) [THROWS-WHEN] IllegalArgumentException when !(grammar instanceof GEGrammar) [PATH1] if(grammar instanceof GEGrammar)=T -> return gei [PATH2] if(grammar instanceof GEGram...
/* static context [FOCAL] public static GEIndividual GEIndividual.getIndividual(GEGrammar grammar, Phenotype phen, Genotype genotype, Fitness fitness) [THROWS-WHEN] IllegalArgumentException when !(grammar instanceof GEGrammar) [PATH1] if(grammar instanceof GEGrammar)=T -> return gei [PATH2] if(grammar instanceof GEGram...
true
ok
{"focal": {"class": "GEIndividual", "name": "getIndividual", "signature": "GEIndividual getIndividual(GEGrammar grammar, Phenotype phen, Genotype genotype, Fitness fitness)", "start_line": 3, "modifiers": "public static", "params": [{"name": "grammar", "type": "GEGrammar"}, {"name": "phen", "type": "Phenotype"}, {"name...
5171172_70
class MutationFactory { public List<Put> insert(long tableId, final Row row) { return insert(tableId, row, store.getSchema(tableId).getIndices()); } @Inject public MutationFactory(HBaseStore store); @Inject public void setColumnFamily(final @Named(ConfigConstants.COLUMN_FAMILY) String column...
List<Put> puts = factory.insert(tableId, row); byte[] rowCounts = countRowTypes(puts); assertEquals("data row count", 1, rowCounts[DATA_PREFIX]); assertEquals("ascending index count", 2, rowCounts[ASC_PREFIX]); assertEquals("descending index count", 2, rowCounts[DESC_PREFIX]); ...
[FOCAL] public List<Put> MutationFactory.insert(long tableId, Row row) [CLASS] class MutationFactory [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] List<Put> insert(long tableId, Row row, Collection<IndexSchema> indices) [CALLS-EXTERNAL] store.getSchema(tableId).getIndices/0, stor...
/* static context [FOCAL] public List<Put> MutationFactory.insert(long tableId, Row row) [INPUTS] branches=- | result=row, tableId [COLLABORATORS] field store getSchema/1 [CALLS-INTERNAL] List<Put> insert(long tableId, Row row, Collection<IndexSchema> indices) [CALLS-EXTERNAL] store.getSchema(tableId).getIndices/0, sto...
/* static context [FOCAL] public List<Put> MutationFactory.insert(long tableId, Row row) [INPUTS] branches=- | result=row, tableId [COLLABORATORS] field store getSchema/1 [CALLS-INTERNAL] List<Put> insert(long tableId, Row row, Collection<IndexSchema> indices) [CALLS-EXTERNAL] store.getSchema(tableId).getIndices/0, sto...
true
ok
{"focal": {"class": "MutationFactory", "name": "insert", "signature": "List<Put> insert(long tableId, Row row)", "start_line": 3, "modifiers": "public", "params": [{"name": "tableId", "type": "long"}, {"name": "row", "type": "Row"}], "return_type": "List<Put>"}, "class_info": {"name": "MutationFactory", "kind": "class"...
5175291_2
class AdminResource { @GET @Path("/coordinator") @Produces(MediaType.APPLICATION_JSON) public Response getAllCoordinators(@Context UriInfo uriInfo) { Predicate<CoordinatorStatus> coordinatorPredicate = CoordinatorFilterBuilder.build(uriInfo); List<CoordinatorStatus> coordinators = c...
URI requestUri = URI.create("http://localhost/v1/admin/coordinator"); Response response = resource.getAllCoordinators(MockUriInfo.from(requestUri)); assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); assertNull(response.getMetadata().get("Content-Type")); // content ...
[FOCAL] @GET @Path("/coordinator") @Produces(MediaType.APPLICATION_JSON) public Response AdminResource.getAllCoordinators(UriInfo uriInfo) [CLASS] class AdminResource [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] CoordinatorFilterBuilder.build/1, Coordinator.getCoordinators/1, Re...
/* static context [FOCAL] @GET @Path("/coordinator") @Produces(MediaType.APPLICATION_JSON) public Response AdminResource.getAllCoordinators(UriInfo uriInfo) [INPUTS] branches=- | result=uriInfo, coordinator [COLLABORATORS] field coordinator:Coordinator getCoordinators/1,getCoordinators/0 [FIELDS] read=coordinator:Coord...
/* static context [FOCAL] @GET @Path("/coordinator") @Produces(MediaType.APPLICATION_JSON) public Response AdminResource.getAllCoordinators(UriInfo uriInfo) [INPUTS] branches=- | result=uriInfo, coordinator [COLLABORATORS] field coordinator:Coordinator getCoordinators/1,getCoordinators/0 [FIELDS] read=coordinator:Coord...
true
ok
{"focal": {"class": "AdminResource", "name": "getAllCoordinators", "signature": "Response getAllCoordinators(UriInfo uriInfo)", "start_line": 3, "modifiers": "@GET @Path(\"/coordinator\") @Produces(MediaType.APPLICATION_JSON) public", "params": [{"name": "uriInfo", "type": "UriInfo"}], "return_type": "Response"}, "clas...
5176685_4
class AqlQueryBuilder { public AqlQueryBuilder or(AqlItem... items) { if (isNotEmpty(items)) { root.putAll(AqlItem.or((Object[]) items).value()); } return this; } public AqlQueryBuilder item(AqlItem item); public AqlQueryBuilder elements(AqlItem... items); publi...
String result = new AqlQueryBuilder() .or(aqlItem("repo", "myrepo1"), aqlItem("repo", "myrepo2")) .build(); assertThat(result, notNullValue()); assertThat(result, is("items.find(" + "{\"$or\":[" + "{\...
[FOCAL] public AqlQueryBuilder AqlQueryBuilder.or(AqlItem... items) [CLASS] class AqlQueryBuilder [METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] isNotEmpty/1 (inherited), root.putAll/1, AqlItem.or((Object[]) items).value/0, AqlItem.or/1 [PATH1] if(isNotEmpty(items))=T -> return th...
/* static context [FOCAL] public AqlQueryBuilder AqlQueryBuilder.or(AqlItem... items) [PATH1] if(isNotEmpty(items))=T -> return this [PATH2] if(isNotEmpty(items))=F -> return this [INPUTS] branches=items | result=- [COLLABORATORS] field root putAll/1 [CALLS-EXTERNAL] isNotEmpty/1 (inherited), root.putAll/1, AqlItem.or(...
/* static context [FOCAL] public AqlQueryBuilder AqlQueryBuilder.or(AqlItem... items) [PATH1] if(isNotEmpty(items))=T -> return this [PATH2] if(isNotEmpty(items))=F -> return this [INPUTS] branches=items | result=- [COLLABORATORS] field root putAll/1 [CALLS-EXTERNAL] isNotEmpty/1 (inherited), root.putAll/1, AqlItem.or(...
true
ok
{"focal": {"class": "AqlQueryBuilder", "name": "or", "signature": "AqlQueryBuilder or(AqlItem... items)", "start_line": 3, "modifiers": "public", "params": [{"name": "items", "type": "AqlItem..."}], "return_type": "AqlQueryBuilder"}, "class_info": {"name": "AqlQueryBuilder", "kind": "class", "modifiers": "", "superclas...
5185108_32
class Services { @JsonProperty public Set<Service> getServices() { return services; } public Services(String environment, Set<Service> services); @JsonProperty public String getEnvironment(); @Override public boolean equals(Object o); @Override public int hashCode(); @Ove...
Service blue = new Service(Id.<Service>random(), Id.<Node>random(), "blue", "pool", "/location", ImmutableMap.of("key", "value")); Services services = new Services("testing", Sets.newHashSet(blue)); try { services.getServices().add(new Service(Id.<Service>random(), Id.<Node>random()...
[FOCAL] @JsonProperty public Set<Service> Services.getServices() [CLASS] class Services [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Services(String environment, Set<Service> services); String getEnvironment(); boolean equals(Object o); int hashCode(); String toString() [TEST] Te...
/* static context [FOCAL] @JsonProperty public Set<Service> Services.getServices() */
/* static context [FOCAL] @JsonProperty public Set<Service> Services.getServices() */ class Services { @JsonProperty public Set<Service> getServices() { return services; } public Services(String environment, Set<Service> services); @JsonProperty public String getEnvironment(); @O...
true
ok
{"focal": {"class": "Services", "name": "getServices", "signature": "Set<Service> getServices()", "start_line": 3, "modifiers": "@JsonProperty public", "params": [], "return_type": "Set<Service>"}, "class_info": {"name": "Services", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [],...
5194874_8
class HL7TemplateFunctions { public String evaluateTemplate(String templateName, Map<String, Object> bindings) { // what is this user thinking? if (templateName == null) { log.info("Template name is null"); return ""; } HL7Template template = getHl7queryService().getHL7TemplateByName(templateName); ...
// add a simple template to our db HL7Template t = new HL7Template(); t.setName("nonexistantgptemplate"); t.setLanguage(HL7QueryService.LANGUAGE_GROOVY); t.setTemplate("-${ func.getGlobalProperty('nonexistantgp') }-"); Context.getService(HL7QueryService.class).saveHL7Template(t); HL7TemplateFunctions f...
[FOCAL] public String HL7TemplateFunctions.evaluateTemplate(String templateName, Map<String, Object> bindings) [CLASS] class HL7TemplateFunctions [METRICS] loc=17 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-INTERNAL] HL7QueryService getHl7queryService() [CALLS-EXTERNAL] log.info/1, getHl7queryService()....
/* static context [FOCAL] public String HL7TemplateFunctions.evaluateTemplate(String templateName, Map<String, Object> bindings) [PATH1] if(templateName == null)=F -> if(template == null)=T -> return "" [PATH2] if(templateName == null)=F -> if(template == null)=F -> return getHl7queryService().evaluateTemplate(template...
/* static context [FOCAL] public String HL7TemplateFunctions.evaluateTemplate(String templateName, Map<String, Object> bindings) [PATH1] if(templateName == null)=F -> if(template == null)=T -> return "" [PATH2] if(templateName == null)=F -> if(template == null)=F -> return getHl7queryService().evaluateTemplate(template...
true
ok
{"focal": {"class": "HL7TemplateFunctions", "name": "evaluateTemplate", "signature": "String evaluateTemplate(String templateName, Map<String, Object> bindings)", "start_line": 3, "modifiers": "public", "params": [{"name": "templateName", "type": "String"}, {"name": "bindings", "type": "Map<String, Object>"}], "return_...
5203853_12
class StoreService { public Instance newInstance(String sourceAET, Attributes data, Attributes modified, StoreContext storeContext) throws DicomServiceException { StoreParam storeParam = storeContext.getStoreParam(); Availability rnAvailability = storeParam.getRejectionN...
Attributes mpps_create = load("testdata/mpps-create.xml"); IDWithIssuer pid = IDWithIssuer.pidWithIssuer(mpps_create, null); String sourceAET = mpps_create.getString(Tag.PerformedStationAETitle); clearData(pid); StoreParam storeParam = ParamFactory.createStoreParam(); Sto...
[FOCAL] public Instance StoreService.newInstance(String sourceAET, Attributes data, Attributes modified, StoreContext storeContext) [CLASS] class StoreService [METRICS] loc=45 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Code singleCode(Attributes attrs, int seqTag); Collection<ContentItem> cre...
class StoreService { public Instance newInstance(String sourceAET, Attributes data, Attributes modified, StoreContext storeContext) throws DicomServiceException { StoreParam storeParam = storeContext.getStoreParam(); Availability rnAvailability = storeParam.getRejectionN...
false
ok
{"focal": {"class": "StoreService", "name": "newInstance", "signature": "Instance newInstance(String sourceAET, Attributes data, Attributes modified, StoreContext storeContext) throws DicomServiceException", "start_line": 3, "modifiers": "public", "params": [{"name": "sourceAET", "type": "String"}, {"name": "data", "ty...
5208272_30
class GitAdd { public GitAddResponse add(File repositoryPath, GitAddOptions options, List<File> paths) throws IOException, JavaGitException { CheckUtilities.checkFileValidity(repositoryPath.getAbsoluteFile()); IClient client = ClientManager.getInstance().getPreferredClient(); IGitAdd gitAdd = clien...
File file1 = FileUtilities.createFile(repoDirectory, "fileA.txt", "This is file fileA.txt"); File tmpDir = new File(repoDirectory.getPath() + File.separator + "dirA"); if (tmpDir.mkdir()) { File file2 = FileUtilities.createFile(repoDirectory, "dirA" + File.separator + "fileB.txt", "Sample Co...
[FOCAL] public GitAddResponse GitAdd.add(File repositoryPath, GitAddOptions options, List<File> paths) [CLASS] class GitAdd [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] CheckUtilities.checkFileValidity/1, File.getAbsoluteFile/0, ClientManager.getInstance().getPreferredClient/0, ...
/* static context [FOCAL] public GitAddResponse GitAdd.add(File repositoryPath, GitAddOptions options, List<File> paths) [INPUTS] branches=- | result=options, paths, repositoryPath [COLLABORATORS] param repositoryPath:File getAbsoluteFile/0 [EXCEPTIONS] declares IOException, JavaGitException [CALLS-EXTERNAL] CheckUtili...
/* static context [FOCAL] public GitAddResponse GitAdd.add(File repositoryPath, GitAddOptions options, List<File> paths) [INPUTS] branches=- | result=options, paths, repositoryPath [COLLABORATORS] param repositoryPath:File getAbsoluteFile/0 [EXCEPTIONS] declares IOException, JavaGitException [CALLS-EXTERNAL] CheckUtili...
true
ok
{"focal": {"class": "GitAdd", "name": "add", "signature": "GitAddResponse add(File repositoryPath, GitAddOptions options, List<File> paths) throws IOException, JavaGitException", "start_line": 3, "modifiers": "public", "params": [{"name": "repositoryPath", "type": "File"}, {"name": "options", "type": "GitAddOptions"}, ...
5210246_2
class Parameter implements Expression { public int compareTo(Expression e) { if (this == e) return 0; if (e instanceof Parameter) { Parameter o = (Parameter) e; return order - o.order; } else { return getClass().getName().compareTo(e.getClass().getName()); } } public Paramet...
Parameter param2 = new Parameter(); assertTrue(param2.compareTo(param) > 0); assertTrue(param.compareTo(param2) < 0); } }
[FOCAL] public int Parameter.compareTo(Expression e) [CLASS] class Parameter implements Expression [METRICS] loc=11 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] getClass().getName().compareTo/1, getClass().getName/0, getClass/0 (inherited), e.getClass().getName/0, Expression.getClass/0 [PATH1] ...
/* static context [FOCAL] public int Parameter.compareTo(Expression e) [PATH1] if(this == e)=F -> if(e instanceof Parameter)=T -> return order - o.order [PATH2] if(this == e)=T -> return 0 [PATH3] if(this == e)=F -> if(e instanceof Parameter)=F -> return getClass().getName().compareTo(e.getClass().getName()) [INPUTS] b...
/* static context [FOCAL] public int Parameter.compareTo(Expression e) [PATH1] if(this == e)=F -> if(e instanceof Parameter)=T -> return order - o.order [PATH2] if(this == e)=T -> return 0 [PATH3] if(this == e)=F -> if(e instanceof Parameter)=F -> return getClass().getName().compareTo(e.getClass().getName()) [INPUTS] b...
true
ok
{"focal": {"class": "Parameter", "name": "compareTo", "signature": "int compareTo(Expression e)", "start_line": 3, "modifiers": "public", "params": [{"name": "e", "type": "Expression"}], "return_type": "int"}, "class_info": {"name": "Parameter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Expre...
5212656_133
class FieldSelection extends Selection { public Field replaceWithSimpleField(Field.FieldType fieldType) { int leftLength = textSelection.getText().length(); int index = textSelection.getIndex(); prepareSpanContainer(leftLength, index); Field field = null; switch (fieldType) { case DATE_FIELD: field = F...
try { search = new TextNavigation("ReplaceDateTarget", doc); // count the initial date field count. should be 1. OdfContentDom contentDom = doc.getContentDom(); NodeList nodeList = contentDom.getElementsByTagName(TextTimeElement.ELEMENT_NAME.getQName()); int i = nodeList.getLength(); OdfStylesDom st...
[FOCAL] public Field FieldSelection.replaceWithSimpleField(Field.FieldType fieldType) [CLASS] class FieldSelection extends Selection [METRICS] loc=58 cc=19 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] void prepareSpanContainer(int leftLength, int index) [CALLS-EXTERNAL] textSelection.getText().lengt...
/* static context [FOCAL] public Field FieldSelection.replaceWithSimpleField(Field.FieldType fieldType) [THROWS-WHEN] IllegalArgumentException when switch(fieldType)=case HIDDEN_TEXT_FIELD [THROWS-WHEN] IllegalArgumentException when switch(fieldType)=case CONDITION_FIELD [THROWS-WHEN] IllegalArgumentException when swit...
/* static context [FOCAL] public Field FieldSelection.replaceWithSimpleField(Field.FieldType fieldType) [THROWS-WHEN] IllegalArgumentException when switch(fieldType)=case HIDDEN_TEXT_FIELD [THROWS-WHEN] IllegalArgumentException when switch(fieldType)=case CONDITION_FIELD [THROWS-WHEN] IllegalArgumentException when swit...
true
ok
{"focal": {"class": "FieldSelection", "name": "replaceWithSimpleField", "signature": "Field replaceWithSimpleField(Field.FieldType fieldType)", "start_line": 3, "modifiers": "public", "params": [{"name": "fieldType", "type": "Field.FieldType"}], "return_type": "Field"}, "class_info": {"name": "FieldSelection", "kind": ...
5223349_1
class ProtocolFormatter { public static String formatRequest(String url, Position position) { return formatRequest(url, position, null); } public static String formatRequest(String url, Position position, String alarm); } class ProtocolFormatterTest { @Test public void testFormatRequest...
Position position = new Position("123456789012345", new Location("gps"), 0); position.setTime(new Date(0)); String url = ProtocolFormatter.formatRequest("http://localhost:5055", position); assertEquals("http://localhost:5055?id=123456789012345&timestamp=0&lat=0.0&lon=0.0&speed=0.0&bear...
[FOCAL] public static String ProtocolFormatter.formatRequest(String url, Position position) [CLASS] class ProtocolFormatter [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String formatRequest(String url, Position position, String alarm) [INPUTS] branches=- | result=position, url [...
/* static context [FOCAL] public static String ProtocolFormatter.formatRequest(String url, Position position) [INPUTS] branches=- | result=position, url [CALLS-INTERNAL] String formatRequest(String url, Position position, String alarm) */
/* static context [FOCAL] public static String ProtocolFormatter.formatRequest(String url, Position position) [INPUTS] branches=- | result=position, url [CALLS-INTERNAL] String formatRequest(String url, Position position, String alarm) */ class ProtocolFormatter { public static String formatRequest(String url, Pos...
true
ok
{"focal": {"class": "ProtocolFormatter", "name": "formatRequest", "signature": "String formatRequest(String url, Position position)", "start_line": 3, "modifiers": "public static", "params": [{"name": "url", "type": "String"}, {"name": "position", "type": "Position"}], "return_type": "String"}, "class_info": {"name": "...
5225735_6
class EntityNameExtractorFactory { public static EntityNameExtractor<?> forNamedPersistentEntity(String name) { return new NamedPersistentEntityNameExtractor(name); } public static EntityNameExtractor<?> forPersistentEntity(PersistentEntity persistentEntity); public static EntityNameExtractor<...
final EntityNameExtractor entityNameExtractor = forNamedPersistentEntity("name"); assertEquals("Domain Type Object Name", entityNameExtractor.apply(new DomainType())); } }
[FOCAL] public static EntityNameExtractor<?> EntityNameExtractorFactory.forNamedPersistentEntity(String name) [CLASS] class EntityNameExtractorFactory [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] NamedPersistentEntityNameExtractor [INPUTS] branches=- | result=name [DATAFLOW] name@param->L2...
/* static context [FOCAL] public static EntityNameExtractor<?> EntityNameExtractorFactory.forNamedPersistentEntity(String name) [INPUTS] branches=- | result=name [NEW] NamedPersistentEntityNameExtractor */
/* static context [FOCAL] public static EntityNameExtractor<?> EntityNameExtractorFactory.forNamedPersistentEntity(String name) [INPUTS] branches=- | result=name [NEW] NamedPersistentEntityNameExtractor */ class EntityNameExtractorFactory { public static EntityNameExtractor<?> forNamedPersistentEntity(String name)...
true
ok
{"focal": {"class": "EntityNameExtractorFactory", "name": "forNamedPersistentEntity", "signature": "EntityNameExtractor<?> forNamedPersistentEntity(String name)", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}], "return_type": "EntityNameExtractor<?>"}, "class_info": {"name...
5243160_0
class FvdlStAXParser { Fvdl parse(InputStream inputStream) throws ParserConfigurationException, SAXException, IOException { SMInputFactory inputFactory = FortifyUtils.newStaxParser(); try { SMHierarchicCursor rootC = inputFactory.rootElementCursor(inputStream); rootC.advance(); // <FVDL> ...
FvdlStAXParser parser = new FvdlStAXParser(); InputStream inputStream = getClass().getClassLoader().getResourceAsStream("report/dummy-report.xml"); Fvdl fvdl = parser.parse(inputStream); assertThat(fvdl.getBuild().getSourceBasePath()).isEqualTo("/a/dummy/path"); Collection<Vulnerability> vulnerabili...
[FOCAL] Fvdl FvdlStAXParser.parse(InputStream inputStream) [CLASS] class FvdlStAXParser [METRICS] loc=31 cc=6 branches=3 loops=1 returns=1 throws=1 nesting=5 [CALLS-INTERNAL] Build processBuild(SMInputCursor buildC); Collection<Vulnerability> processVulnerabilities(SMInputCursor vulnsC); Description processDescription(...
/* static context [FOCAL] Fvdl FvdlStAXParser.parse(InputStream inputStream) [THROWS-WHEN] IllegalStateException when try-body throws [PATH1] while(childCursor.getNext() != null)=T -> if("Build".equals(nodeName))=F -> if("Description".equals(nodeName))=F -> if("Vulnerabilities".equals(nodeName))=T -> exit loop -> retur...
/* static context [FOCAL] Fvdl FvdlStAXParser.parse(InputStream inputStream) [THROWS-WHEN] IllegalStateException when try-body throws [PATH1] while(childCursor.getNext() != null)=T -> if("Build".equals(nodeName))=F -> if("Description".equals(nodeName))=F -> if("Vulnerabilities".equals(nodeName))=T -> exit loop -> retur...
true
ok
{"focal": {"class": "FvdlStAXParser", "name": "parse", "signature": "Fvdl parse(InputStream inputStream) throws ParserConfigurationException, SAXException, IOException", "start_line": 3, "modifiers": "", "params": [{"name": "inputStream", "type": "InputStream"}], "return_type": "Fvdl"}, "class_info": {"name": "FvdlStAX...
5243237_3
class VersionHelper { public VersionRange range(final int... parts) { checkNotNull(parts); checkArgument(parts.length != 0); StringBuilder buff = new StringBuilder() .append("["); for (int i = 0; i < parts.length; i++) { buff.append(parts[i]); if (i + 1 < parts.length) { ...
VersionRange range = underTest.range(1, 2, 3); log(range); assertThat(range.toString(), is("[1.2.3,1.2.4)")); } }
[FOCAL] public VersionRange VersionHelper.range(int... parts) [CLASS] class VersionHelper [METRICS] loc=32 cc=5 branches=2 loops=2 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] VersionRange parseRange(String pattern) [CALLS-EXTERNAL] checkNotNull/1 (inherited), checkArgument/1 (inherited), new StringBuilder().append/1,...
/* static context [FOCAL] public VersionRange VersionHelper.range(int... parts) [PATH1] for(i < parts.length)#1=T -> if(i + 1 < parts.length)=T -> exit loop -> for(i < parts.length)#2=T -> if(i + 1 == parts.length)=T -> exit loop -> return parseRange(buff.toString()) [PATH2] for(i < parts.length)#1=F -> for(i < parts.l...
/* static context [FOCAL] public VersionRange VersionHelper.range(int... parts) [PATH1] for(i < parts.length)#1=T -> if(i + 1 < parts.length)=T -> exit loop -> for(i < parts.length)#2=T -> if(i + 1 == parts.length)=T -> exit loop -> return parseRange(buff.toString()) [PATH2] for(i < parts.length)#1=F -> for(i < parts.l...
true
ok
{"focal": {"class": "VersionHelper", "name": "range", "signature": "VersionRange range(int... parts)", "start_line": 3, "modifiers": "public", "params": [{"name": "parts", "type": "int..."}], "return_type": "VersionRange"}, "class_info": {"name": "VersionHelper", "kind": "class", "modifiers": "", "superclass": null, "i...
5244017_8
class CalabashCapabilityMatcher implements CapabilityMatcher { @Override public boolean matches(Map<String, Object> nodeCapability, Map<String, Object> requestedCapability) { if (nodeCapability == null || requestedCapability == null) { return false; } for (String key : requestedCapability.keySet(...
CalabashCapabilities reqCapa = new CalabashCapabilities(); reqCapa.setAut(APP); reqCapa.setLocale(LOCALE); reqCapa.setSDKVersion(SDK_VERSION); Assert.assertTrue(matcher.matches(nodeCapability.getRawCapabilities(), reqCapa.getRawCapabilities())); } }
[FOCAL] @Override public boolean CalabashCapabilityMatcher.matches(Map<String, Object> nodeCapability, Map<String, Object> requestedCapability) [CLASS] class CalabashCapabilityMatcher implements CapabilityMatcher [METRICS] loc=19 cc=6 branches=4 loops=1 returns=3 throws=0 nesting=4 [CALLS-EXTERNAL] Map<String, Object>....
/* static context [FOCAL] @Override public boolean CalabashCapabilityMatcher.matches(Map<String, Object> nodeCapability, Map<String, Object> requestedCapability) [PATH1] if(nodeCapability == null || requestedCapability == null)=F -> foreach(String key : requestedCapability.keySet())=T -> if(toConsider.contains(key))=T ...
/* static context [FOCAL] @Override public boolean CalabashCapabilityMatcher.matches(Map<String, Object> nodeCapability, Map<String, Object> requestedCapability) [PATH1] if(nodeCapability == null || requestedCapability == null)=F -> foreach(String key : requestedCapability.keySet())=T -> if(toConsider.contains(key))=T ...
true
ok
{"focal": {"class": "CalabashCapabilityMatcher", "name": "matches", "signature": "boolean matches(Map<String, Object> nodeCapability, Map<String, Object> requestedCapability)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "nodeCapability", "type": "Map<String, Object>"}, {"name": "requestedCapa...
5244445_9
class FeedItemPermutors { @NonNull public static Permutor<FeedItem> getPermutor(@NonNull SortOrder sortOrder) { Comparator<FeedItem> comparator = null; Permutor<FeedItem> permutor = null; switch (sortOrder) { case EPISODE_TITLE_A_Z: comparator = (f1, f2) ->...
Permutor<FeedItem> permutor = FeedItemPermutors.getPermutor(SortOrder.DURATION_LONG_SHORT); List<FeedItem> itemList = getTestList(); itemList.get(1) // itemId 3 .setMedia(null); assertTrue(checkIdOrder(itemList, 1, 3, 2)); // before sorting permutor.reorder(itemL...
[FOCAL] @NonNull public static Permutor<FeedItem> FeedItemPermutors.getPermutor(SortOrder sortOrder) [CLASS] class FeedItemPermutors [METRICS] loc=48 cc=13 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Date pubDate(FeedItem item); String feedTitle(FeedItem item); String itemTitle(FeedItem item); int ...
/* static context [FOCAL] @NonNull public static Permutor<FeedItem> FeedItemPermutors.getPermutor(SortOrder sortOrder) [PATH1] switch(sortOrder)=case EPISODE_TITLE_A_Z -> if(comparator != null)=T -> return permutor [PATH2] switch(sortOrder)=case EPISODE_TITLE_Z_A -> if(comparator != null)=F -> return permutor [PATH3] s...
/* static context [FOCAL] @NonNull public static Permutor<FeedItem> FeedItemPermutors.getPermutor(SortOrder sortOrder) [PATH1] switch(sortOrder)=case EPISODE_TITLE_A_Z -> if(comparator != null)=T -> return permutor [PATH2] switch(sortOrder)=case EPISODE_TITLE_Z_A -> if(comparator != null)=F -> return permutor [PATH3] s...
true
ok
{"focal": {"class": "FeedItemPermutors", "name": "getPermutor", "signature": "Permutor<FeedItem> getPermutor(SortOrder sortOrder)", "start_line": 3, "modifiers": "@NonNull public static", "params": [{"name": "sortOrder", "type": "SortOrder"}], "return_type": "Permutor<FeedItem>"}, "class_info": {"name": "FeedItemPermut...
5258499_1
class TransformingProxyPlugin extends ProxyPlugin { public HttpUrl createHttpsGatewayUrl(String gatewayUrl) throws MalformedURLException, URIException { HttpMethod method = new GetMethod(gatewayUrl); method.setQueryString("ssl=true"); String url = method.getURI().getEscapedURI(); return new HttpUrl(url); ...
String url = "http://www.scotty-transporter.org:9001"; String expected = "http://www.scotty-transporter.org:9001/?ssl=true"; HttpUrl actualUrl = underTest.createHttpsGatewayUrl(url); String actual = actualUrl.toString(); Assert.assertEquals(expected, actual); } }
[FOCAL] public HttpUrl TransformingProxyPlugin.createHttpsGatewayUrl(String gatewayUrl) [CLASS] class TransformingProxyPlugin extends ProxyPlugin [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] HttpMethod.setQueryString/1, method.getURI().getEscapedURI/0, HttpMethod.getURI/0 [NEW] ...
/* static context [FOCAL] public HttpUrl TransformingProxyPlugin.createHttpsGatewayUrl(String gatewayUrl) [INPUTS] branches=- | result=gatewayUrl [EXCEPTIONS] declares MalformedURLException, URIException [NEW] GetMethod, HttpUrl [CALLS-EXTERNAL] HttpMethod.setQueryString/1, method.getURI().getEscapedURI/0, HttpMethod.g...
/* static context [FOCAL] public HttpUrl TransformingProxyPlugin.createHttpsGatewayUrl(String gatewayUrl) [INPUTS] branches=- | result=gatewayUrl [EXCEPTIONS] declares MalformedURLException, URIException [NEW] GetMethod, HttpUrl [CALLS-EXTERNAL] HttpMethod.setQueryString/1, method.getURI().getEscapedURI/0, HttpMethod.g...
true
ok
{"focal": {"class": "TransformingProxyPlugin", "name": "createHttpsGatewayUrl", "signature": "HttpUrl createHttpsGatewayUrl(String gatewayUrl) throws MalformedURLException, URIException", "start_line": 3, "modifiers": "public", "params": [{"name": "gatewayUrl", "type": "String"}], "return_type": "HttpUrl"}, "class_info...
5265034_1
class App { public static MTEF parse(InputStream is) throws ParseException, IOException { PushbackInputStream pis = new PushbackInputStream(is); // hack - throw away 28 byte OLE header pis.read(new byte[28]); return new MTEFParser().parse(pis); } private static final Logger...
InputStream is = AppTest.class.getResourceAsStream("/ole/fraction.bin"); MTEF mtef = App.parse(is); assertEquals("Windows", mtef.getGeneratingPlatform()); XmlGeneratorVisitor visitor = new XmlGeneratorVisitor(); mtef.accept(visitor); Element root = visitor.getRoot(); ...
[FOCAL] public static MTEF App.parse(InputStream is) [CLASS] class App [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] PushbackInputStream.read/1, new MTEFParser().parse/1 [NEW] PushbackInputStream, MTEFParser [EXCEPTIONS] declares ParseException, IOException [INPUTS] branches=- | ...
/* static context [FOCAL] public static MTEF App.parse(InputStream is) [INPUTS] branches=- | result=is [EXCEPTIONS] declares ParseException, IOException [NEW] PushbackInputStream, MTEFParser [CALLS-EXTERNAL] PushbackInputStream.read/1, new MTEFParser().parse/1 */
/* static context [FOCAL] public static MTEF App.parse(InputStream is) [INPUTS] branches=- | result=is [EXCEPTIONS] declares ParseException, IOException [NEW] PushbackInputStream, MTEFParser [CALLS-EXTERNAL] PushbackInputStream.read/1, new MTEFParser().parse/1 */ class App { public static MTEF parse(InputStream is...
true
ok
{"focal": {"class": "App", "name": "parse", "signature": "MTEF parse(InputStream is) throws ParseException, IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "is", "type": "InputStream"}], "return_type": "MTEF"}, "class_info": {"name": "App", "kind": "class", "modifiers": "", "superclass"...
5265087_58
class BalanceIndexOperation extends AbstractIndexOperation { @Override public List<OperationId> execute(MasterContext context, List<MasterOperation> runningOperations) throws Exception { InteractionProtocol protocol = context.getProtocol(); IndexMetaData indexMD = protocol.getIndexMD(_indexName); if (i...
// add nodes and index List<Node> nodes = Mocks.mockNodes(2); List<NodeQueue> nodeQueues = Mocks.publisNodes(_protocol, nodes); deployIndexWithError(); // index deployed on 2 nodes / desired replica is 3 for (NodeQueue nodeqQueue : nodeQueues) { assertEquals(1, nodeqQueue.size()); } ...
[FOCAL] @Override public List<OperationId> BalanceIndexOperation.execute(MasterContext context, List<MasterOperation> runningOperations) [CLASS] class BalanceIndexOperation extends AbstractIndexOperation [METRICS] loc=37 cc=6 branches=3 loops=0 returns=6 throws=0 nesting=2 [CALLS-EXTERNAL] MasterContext.getProtocol/0, ...
/* static context [FOCAL] @Override public List<OperationId> BalanceIndexOperation.execute(MasterContext context, List<MasterOperation> runningOperations) [PATH1] if(indexMD == null)=F -> if(!canAndShouldRegulateReplication(protocol, indexMD))=F -> if(!fileSystem.exists(path))=F -> try-body throws -> return null [PATH2...
/* static context [FOCAL] @Override public List<OperationId> BalanceIndexOperation.execute(MasterContext context, List<MasterOperation> runningOperations) [PATH1] if(indexMD == null)=F -> if(!canAndShouldRegulateReplication(protocol, indexMD))=F -> if(!fileSystem.exists(path))=F -> try-body throws -> return null [PATH2...
true
ok
{"focal": {"class": "BalanceIndexOperation", "name": "execute", "signature": "List<OperationId> execute(MasterContext context, List<MasterOperation> runningOperations) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "MasterContext"}, {"name": "runningOperation...
5279091_17
class GraphVisualizer { String shortName(String key) { Matcher matcher = KEY_PATTERN.matcher(key); if (!matcher.matches()) throw new IllegalArgumentException("Unexpected key: " + key); StringBuilder result = new StringBuilder(); String annotationSimpleName = matcher.group(1); if (annotationSimpl...
String key = fieldKey("annotatedKeyWithParameters"); // We intentionally omit parameters on annotated keys! assertThat(graphVisualizer.shortName(key)).isEqualTo("@Named String"); } }
[FOCAL] String GraphVisualizer.shortName(String key) [CLASS] class GraphVisualizer [METRICS] loc=25 cc=5 branches=4 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] KEY_PATTERN.matcher/1, Matcher.matches/0, Matcher.group/1, result.append('@').append(annotationSimpleName).append/1, result.append('@').append/1, Stri...
/* static context [FOCAL] String GraphVisualizer.shortName(String key) [THROWS-WHEN] IllegalArgumentException when !matcher.matches() [PATH1] if(!matcher.matches())=F -> if(annotationSimpleName != null)=T -> if(typeParameters != null)=T -> if(arrays != null)=T -> return result.toString() [PATH2] if(!matcher.matches())=...
/* static context [FOCAL] String GraphVisualizer.shortName(String key) [THROWS-WHEN] IllegalArgumentException when !matcher.matches() [PATH1] if(!matcher.matches())=F -> if(annotationSimpleName != null)=T -> if(typeParameters != null)=T -> if(arrays != null)=T -> return result.toString() [PATH2] if(!matcher.matches())=...
true
ok
{"focal": {"class": "GraphVisualizer", "name": "shortName", "signature": "String shortName(String key)", "start_line": 3, "modifiers": "", "params": [{"name": "key", "type": "String"}], "return_type": "String"}, "class_info": {"name": "GraphVisualizer", "kind": "class", "modifiers": "", "superclass": null, "interfaces"...
5284141_13
class PathHelper { public static String packageNameToDirName(final String packageName) { return "/" + packageName.replace('.', '/'); } private PathHelper(); public static boolean isValid(final String path); public static boolean isRelative(final String path); public static String getParent(final Str...
public void testPackageNameToDirName() { assertEquals("/foo/bar", packageNameToDirName("foo.bar")); assertEquals("/foo/toto/bar", packageNameToDirName("foo.toto.bar")); assertEquals("/bar", packageNameToDirName("bar")); } }
[FOCAL] public static String PathHelper.packageNameToDirName(String packageName) [CLASS] class PathHelper [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.replace/2 [INPUTS] branches=- | result=packageName [DATAFLOW] packageName@param->L2 [CLASS-MEMBERS] PathHelper(); boolean...
/* static context [FOCAL] public static String PathHelper.packageNameToDirName(String packageName) [INPUTS] branches=- | result=packageName [CALLS-EXTERNAL] String.replace/2 */
/* static context [FOCAL] public static String PathHelper.packageNameToDirName(String packageName) [INPUTS] branches=- | result=packageName [CALLS-EXTERNAL] String.replace/2 */ class PathHelper { public static String packageNameToDirName(final String packageName) { return "/" + packageName.replace('.', '/'); }...
true
ok
{"focal": {"class": "PathHelper", "name": "packageNameToDirName", "signature": "String packageNameToDirName(String packageName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "packageName", "type": "String"}], "return_type": "String"}, "class_info": {"name": "PathHelper", "kind": "class", "modifie...
5291703_32
class ProfileSettings { public <ValueType> MutableProperty<ValueType> getProperty( PropertyDef<?, ValueType> propertyDef) { return new DomTrackingProperty<>(propertyDef); } public ProfileSettings(); private static Document tryCreateDocument(); public static boolean isEventThr...
ProfileSettings settings = new ProfileSettings(); readFromSettings1(settings); List<ConfigPath> configPaths1 = Arrays.asList( getConfigPath("target-platform-name"), getConfigPath("target-platform")); List<ConfigPath> configPaths2 = Arrays.asList( ...
[FOCAL] public MutableProperty<ValueType> ProfileSettings.getProperty(PropertyDef<?, ValueType> propertyDef) [CLASS] class ProfileSettings [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] DomTrackingProperty<> [INPUTS] branches=- | result=propertyDef [DATAFLOW] propertyDef@param->L3 [CLASS-MEM...
/* static context [FOCAL] public MutableProperty<ValueType> ProfileSettings.getProperty(PropertyDef<?, ValueType> propertyDef) [INPUTS] branches=- | result=propertyDef [NEW] DomTrackingProperty<> */
/* static context [FOCAL] public MutableProperty<ValueType> ProfileSettings.getProperty(PropertyDef<?, ValueType> propertyDef) [INPUTS] branches=- | result=propertyDef [NEW] DomTrackingProperty<> */ class ProfileSettings { public <ValueType> MutableProperty<ValueType> getProperty( PropertyDef<?, ValueT...
true
ok
{"focal": {"class": "ProfileSettings", "name": "getProperty", "signature": "MutableProperty<ValueType> getProperty(PropertyDef<?, ValueType> propertyDef)", "start_line": 3, "modifiers": "public", "params": [{"name": "propertyDef", "type": "PropertyDef<?, ValueType>"}], "return_type": "MutableProperty<ValueType>"}, "cla...
5294661_0
class JSONDocTemplateBuilder { public static JSONDocTemplate build(Class<?> clazz, Set<Class<?>> jsondocObjects) { final JSONDocTemplate jsonDocTemplate = new JSONDocTemplate(); if(jsondocObjects.contains(clazz)) { try { Set<JSONDocFieldWrapper> fields = getAllDeclaredFields(clazz); for (JSONDocFi...
ObjectMapper mapper = new ObjectMapper(); Set<Class<?>> classes = Sets.<Class<?>>newHashSet(TemplateObject.class); Map<String, Object> template = JSONDocTemplateBuilder.build(TemplateObject.class, classes); Assert.assertEquals(0, template.get("my_id")); Assert.assertEquals(0, template.get("idint")); Ass...
[FOCAL] public static JSONDocTemplate JSONDocTemplateBuilder.build(Class<?> clazz, Set<Class<?>> jsondocObjects) [CLASS] class JSONDocTemplateBuilder [METRICS] loc=37 cc=7 branches=4 loops=1 returns=1 throws=0 nesting=4 [CALLS-INTERNAL] Object getValue(Class<?> fieldClass, Type fieldGenericType, String fieldName, Set<C...
/* static context [FOCAL] public static JSONDocTemplate JSONDocTemplateBuilder.build(Class<?> clazz, Set<Class<?>> jsondocObjects) [PATH1] if(jsondocObjects.contains(clazz))=T -> foreach(JSONDocFieldWrapper jsondocFieldWrapper : fields)=T -> if(isFinal(field.getModifiers()) && isStatic(field.getModifiers()))=F -> if(ap...
/* static context [FOCAL] public static JSONDocTemplate JSONDocTemplateBuilder.build(Class<?> clazz, Set<Class<?>> jsondocObjects) [PATH1] if(jsondocObjects.contains(clazz))=T -> foreach(JSONDocFieldWrapper jsondocFieldWrapper : fields)=T -> if(isFinal(field.getModifiers()) && isStatic(field.getModifiers()))=F -> if(ap...
true
ok
{"focal": {"class": "JSONDocTemplateBuilder", "name": "build", "signature": "JSONDocTemplate build(Class<?> clazz, Set<Class<?>> jsondocObjects)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clazz", "type": "Class<?>"}, {"name": "jsondocObjects", "type": "Set<Class<?>>"}], "return_type": "JSONDo...
5312808_68
class Acls { public static nfsace4[] compact(nfsace4[] acl) { int size = acl.length; if (size == 0) { return acl; } for(int i = 0; i < size; i++) { nfsace4 a = acl[i]; utf8str_mixed pricipal = a.who; int processedMask = a.access_ma...
nfsace4[] acl = new nfsace4[]{ toACE(new utf8str_mixed("user1"), ACE4_ACCESS_DENIED_ACE_TYPE, ACE4_READ_DATA, ACE4_IDENTIFIER_GROUP), toACE(new utf8str_mixed("user1"), ACE4_ACCESS_DENIED_ACE_TYPE, ACE4_READ_DATA),}; assertEquals(2, Acls.compact(acl).length); } }
[FOCAL] public static nfsace4[] Acls.compact(nfsace4[] acl) [CLASS] class Acls [METRICS] loc=52 cc=11 branches=6 loops=4 returns=2 throws=0 nesting=4 [CALLS-EXTERNAL] utf8str_mixed.equals/1 [PATH1] if(size == 0)=F -> for(i < size)=T -> for(j < size)=T -> if(a.flag.value.value != b.flag.value.value || !pricipal.equals(b...
/* static context [FOCAL] public static nfsace4[] Acls.compact(nfsace4[] acl) [PATH1] if(size == 0)=F -> for(i < size)=T -> for(j < size)=T -> if(a.flag.value.value != b.flag.value.value || !pricipal.equals(b.who))=F -> if(maskToProcess != 0)=T -> if(a.type.value.value == b.type.value.value)=T -> exit loop -> exit loop...
/* static context [FOCAL] public static nfsace4[] Acls.compact(nfsace4[] acl) [PATH1] if(size == 0)=F -> for(i < size)=T -> for(j < size)=T -> if(a.flag.value.value != b.flag.value.value || !pricipal.equals(b.who))=F -> if(maskToProcess != 0)=T -> if(a.type.value.value == b.type.value.value)=T -> exit loop -> exit loop...
true
ok
{"focal": {"class": "Acls", "name": "compact", "signature": "nfsace4[] compact(nfsace4[] acl)", "start_line": 3, "modifiers": "public static", "params": [{"name": "acl", "type": "nfsace4[]"}], "return_type": "nfsace4[]"}, "class_info": {"name": "Acls", "kind": "class", "modifiers": "", "superclass": null, "interfaces":...
5320077_16
class Util { public static String camelToUpper(String name) { StringBuilder buf = new StringBuilder(); for (int i = 0; i < name.length(); i++) { char c = name.charAt(i); if (Character.isUpperCase(c)) { buf.append('_'); } else { c = Character.toUpperCase(c); } buf...
assertEquals("MY_JDBC_DRIVER", Util.camelToUpper("myJdbcDriver")); assertEquals("MY_J_D_B_C_DRIVER", Util.camelToUpper("myJDBCDriver")); assertEquals("AB_CDEF_G_HIJ", Util.camelToUpper("abCdefGHij")); assertEquals("_JDBC_DRIVER", Util.camelToUpper("JdbcDriver")); assertEquals("", Util.camelToUpper("...
[FOCAL] public static String Util.camelToUpper(String name) [CLASS] class Util [METRICS] loc=13 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] String.length/0, String.charAt/1, Character.isUpperCase/1, StringBuilder.append/1, Character.toUpperCase/1, StringBuilder.toString/0 [NEW] StringBuilder [...
/* static context [FOCAL] public static String Util.camelToUpper(String name) [PATH1] for(i < name.length())=T -> if(Character.isUpperCase(c))=T -> exit loop -> return buf.toString() [PATH2] for(i < name.length())=F -> return buf.toString() [INPUTS] branches=name | result=- [NEW] StringBuilder */
/* static context [FOCAL] public static String Util.camelToUpper(String name) [PATH1] for(i < name.length())=T -> if(Character.isUpperCase(c))=T -> exit loop -> return buf.toString() [PATH2] for(i < name.length())=F -> return buf.toString() [INPUTS] branches=name | result=- [NEW] StringBuilder */ class Util { public...
true
ok
{"focal": {"class": "Util", "name": "camelToUpper", "signature": "String camelToUpper(String name)", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Util", "kind": "class", "modifiers": "", "superclass": null, "interfaces":...
5346043_623
class Bag { public static int distance (String str1, String str2){ return distance(Transformations.convertStringToIntArray(str1),Transformations.convertStringToIntArray(str2)); } public static int distance(int str1[], int str2[]); } class TestBag { @Test //jdsalazar public void test1(){
String str1 = "kitten"; String str2 = "sitting"; int res = Bag.distance(str1,str2); Asserts.assertEquals(res, 3); } }
[FOCAL] public static int Bag.distance(String str1, String str2) [CLASS] class Bag [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int distance(int str1, int str2) [CALLS-EXTERNAL] Transformations.convertStringToIntArray/1 [INPUTS] branches=- | result=str1, str2 [DATAFLOW] str1@par...
/* static context [FOCAL] public static int Bag.distance(String str1, String str2) [INPUTS] branches=- | result=str1, str2 [CALLS-INTERNAL] int distance(int str1, int str2) [CALLS-EXTERNAL] Transformations.convertStringToIntArray/1 */
/* static context [FOCAL] public static int Bag.distance(String str1, String str2) [INPUTS] branches=- | result=str1, str2 [CALLS-INTERNAL] int distance(int str1, int str2) [CALLS-EXTERNAL] Transformations.convertStringToIntArray/1 */ class Bag { public static int distance (String str1, String str2){ return distanc...
true
ok
{"focal": {"class": "Bag", "name": "distance", "signature": "int distance(String str1, String str2)", "start_line": 3, "modifiers": "public static", "params": [{"name": "str1", "type": "String"}, {"name": "str2", "type": "String"}], "return_type": "int"}, "class_info": {"name": "Bag", "kind": "class", "modifiers": "", ...
5346068_0
class EtagCache implements Flushable { public EtagCache resetStats() { hits.set(0); misses.set(0); return this; } public EtagCache(final File file, final long size); public static EtagCache create(final File file, final long size); private static String getKey(final String uri); private stat...
String url = setUp(new RequestHandler() { @Override public void handle(Request request, HttpServletResponse response) { response.setHeader(HEADER_ETAG, "1234"); if ("1234".equals(request.getHeader(HEADER_IF_NONE_MATCH))) response.setStatus(HTTP_NOT_MODIFIED); else { ...
[FOCAL] public EtagCache EtagCache.resetStats() [CLASS] class EtagCache implements Flushable [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] hits.set/1, misses.set/1 [COLLABORATORS] field hits set/1; field misses set/1 [CLASS-MEMBERS] EtagCache(File file, long size); EtagCache crea...
/* static context [FOCAL] public EtagCache EtagCache.resetStats() [COLLABORATORS] field hits set/1; field misses set/1 [CALLS-EXTERNAL] hits.set/1, misses.set/1 */
/* static context [FOCAL] public EtagCache EtagCache.resetStats() [COLLABORATORS] field hits set/1; field misses set/1 [CALLS-EXTERNAL] hits.set/1, misses.set/1 */ class EtagCache implements Flushable { public EtagCache resetStats() { hits.set(0); misses.set(0); return this; } public EtagCache(fina...
true
ok
{"focal": {"class": "EtagCache", "name": "resetStats", "signature": "EtagCache resetStats()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "EtagCache"}, "class_info": {"name": "EtagCache", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Flushable", "fields": [], "members": [...
5349536_0
class YahooFinanceWebClient implements ContractDataSource<FundamentalData>, HistoricalDataSource { public OHLC[] getHistoricalData(Contract contract, Date endDate, int numPeriods, int periodUnit) throws IOException { if (!(periodUnit == HistoricalDataSource.PERIOD_1_DAY || periodUnit == HistoricalDataSource.PE...
OHLC data[] = client.getHistoricalData(Contract.stock("MSFT"), new Date(), 20, HistoricalDataSource.PERIOD_1_DAY); assertNotNull(data); assertTrue(data.length > 10); for (OHLC ohlc : data) assertValidOHLC(ohlc); data = client.getHistoricalData(Contract.stock("GOOG"), new Date(), 5, HistoricalDataSource....
[FOCAL] public OHLC[] YahooFinanceWebClient.getHistoricalData(Contract contract, Date endDate, int numPeriods, int periodUnit) [CLASS] class YahooFinanceWebClient implements ContractDataSource<FundamentalData>, HistoricalDataSource [METRICS] loc=61 cc=11 branches=7 loops=2 returns=1 throws=1 nesting=3 [CALLS-EXTERNAL] ...
/* static context [FOCAL] public OHLC[] YahooFinanceWebClient.getHistoricalData(Contract contract, Date endDate, int numPeriods, int periodUnit) [THROWS-WHEN] IllegalArgumentException when (!(periodUnit == HistoricalDataSource.PERIOD_1_DAY || periodUnit == HistoricalDataSource.PERIOD_1_WEEK || periodUnit ... [PATH1] if...
/* static context [FOCAL] public OHLC[] YahooFinanceWebClient.getHistoricalData(Contract contract, Date endDate, int numPeriods, int periodUnit) [THROWS-WHEN] IllegalArgumentException when (!(periodUnit == HistoricalDataSource.PERIOD_1_DAY || periodUnit == HistoricalDataSource.PERIOD_1_WEEK || periodUnit ... [PATH1] if...
true
ok
{"focal": {"class": "YahooFinanceWebClient", "name": "getHistoricalData", "signature": "OHLC[] getHistoricalData(Contract contract, Date endDate, int numPeriods, int periodUnit) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "contract", "type": "Contract"}, {"name": "endDate", "type": ...
5380818_17
class FilesResultMapper { @VisibleForTesting @Nullable String getFilenameFromPath(@Nullable String filePath) { String filename; if (!isEmpty(filePath) && filePath.contains(File.separator) && filePath.contains(".")) { filename = filePath.substring(filePath.lastIndexOf(File.separa...
String path = new FilesResultMapper().getFilenameFromPath("/123/123/123.jpg"); assertEquals("123.jpg", path); } }
[FOCAL] @VisibleForTesting @Nullable String FilesResultMapper.getFilenameFromPath(String filePath) [CLASS] class FilesResultMapper [METRICS] loc=11 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] boolean isEmpty(String string) [CALLS-EXTERNAL] String.contains/1, String.substring/1, String.lastInde...
/* static context [FOCAL] @VisibleForTesting @Nullable String FilesResultMapper.getFilenameFromPath(String filePath) [PATH1] if(!isEmpty(filePath) && filePath.contains(File.separator) && filePath.contains("."))=T -> return filename [PATH2] if(!isEmpty(filePath) && filePath.contains(File.separator) && filePath.contains(...
/* static context [FOCAL] @VisibleForTesting @Nullable String FilesResultMapper.getFilenameFromPath(String filePath) [PATH1] if(!isEmpty(filePath) && filePath.contains(File.separator) && filePath.contains("."))=T -> return filename [PATH2] if(!isEmpty(filePath) && filePath.contains(File.separator) && filePath.contains(...
true
ok
{"focal": {"class": "FilesResultMapper", "name": "getFilenameFromPath", "signature": "String getFilenameFromPath(String filePath)", "start_line": 3, "modifiers": "@VisibleForTesting @Nullable", "params": [{"name": "filePath", "type": "String"}], "return_type": "String"}, "class_info": {"name": "FilesResultMapper", "kin...
5402142_0
class CdiInstantiator extends AbstractCdiInstantiator { @Override public <T extends Component> T createComponent(Class<T> componentClass) { Unmanaged<T> unmanagedClass = new Unmanaged<T>(componentClass); Unmanaged.UnmanagedInstance<T> instance = unmanagedClass.newInstance(); instance.pr...
SingletonComponent component = instantiator .createComponent(SingletonComponent.class); Assert.assertNotNull(component); Assert.assertNotNull(component.beanManager); } }
[FOCAL] @Override public T CdiInstantiator.createComponent(Class<T> componentClass) [CLASS] class CdiInstantiator extends AbstractCdiInstantiator [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Unmanaged<T>.newInstance/0, instance.produce().inject().postConstruct/0, instance.produc...
/* static context [FOCAL] @Override public T CdiInstantiator.createComponent(Class<T> componentClass) [INPUTS] branches=- | result=componentClass [NEW] Unmanaged<T> [CALLS-EXTERNAL] Unmanaged<T>.newInstance/0, instance.produce().inject().postConstruct/0, instance.produce().inject/0, Unmanaged.UnmanagedInstance<T>.produ...
/* static context [FOCAL] @Override public T CdiInstantiator.createComponent(Class<T> componentClass) [INPUTS] branches=- | result=componentClass [NEW] Unmanaged<T> [CALLS-EXTERNAL] Unmanaged<T>.newInstance/0, instance.produce().inject().postConstruct/0, instance.produce().inject/0, Unmanaged.UnmanagedInstance<T>.produ...
true
ok
{"focal": {"class": "CdiInstantiator", "name": "createComponent", "signature": "T createComponent(Class<T> componentClass)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "componentClass", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "CdiInstantiator", "kind": "class", "modi...
5402462_72
class BatchJob implements Job { @Override public JobReport call() { start(); try { openReader(); openWriter(); setStatus(JobStatus.STARTED); while (moreRecords() && !isInterrupted()) { Batch<O> batch = readAndProcessBatch(); ...
when(pipelineListener.beforeRecordProcessing(record1)).thenReturn(record1); when(pipelineListener.beforeRecordProcessing(record2)).thenReturn(record2); doThrow(exception).when(writer).writeRecords(new Batch(record1, record2)); JobReport jobReport = job.call(); assertThat(jobRep...
[FOCAL] @Override public JobReport BatchJob.call() [CLASS] class BatchJob implements Job [METRICS] loc=22 cc=3 branches=0 loops=1 returns=2 throws=0 nesting=2 [CALLS-INTERNAL] Batch<O> readAndProcessBatch(); boolean isInterrupted(); boolean moreRecords(); void closeReader(); void closeWriter(); void fail(Exception exce...
/* static context [FOCAL] @Override public JobReport BatchJob.call() [PATH1] while(moreRecords() && !isInterrupted())=T -> exit loop -> return report [PATH2] try-body throws -> return report [PATH3] while(moreRecords() && !isInterrupted())=F -> return report [EXCEPTIONS] catches Exception exception [CALLS-INTERNAL] Bat...
/* static context [FOCAL] @Override public JobReport BatchJob.call() [PATH1] while(moreRecords() && !isInterrupted())=T -> exit loop -> return report [PATH2] try-body throws -> return report [PATH3] while(moreRecords() && !isInterrupted())=F -> return report [EXCEPTIONS] catches Exception exception [CALLS-INTERNAL] Bat...
true
ok
{"focal": {"class": "BatchJob", "name": "call", "signature": "JobReport call()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "JobReport"}, "class_info": {"name": "BatchJob", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Job", "fields": [{"name": "job", "type": "...
5405905_273
class RemoteDataSetDefAttributesEditor implements IsWidget, org.jbpm.dashboard.dataset.editor.RemoteDataSetDefAttributesEditor { @PostConstruct public void init() { view.init(this); view.initWidgets(queryTarget.view, serverTemplateId.view, dataSource.view, dbSQL.view); queryTarget.setS...
presenter.init(); verify(view, times(1)).init(presenter); verify(view, times(1)).initWidgets(any(DropDownEditor.View.class), any(DropDownEditor.View.class), any(ValueBoxEditor.View.class), any(ValueBoxEditor.View.class)); verify(dataSource, times(1)).addHelpContent(anyString(), anyString...
[FOCAL] @PostConstruct public void RemoteDataSetDefAttributesEditor.init() [CLASS] class RemoteDataSetDefAttributesEditor implements IsWidget, org.jbpm.dashboard.dataset.editor.RemoteDataSetDefAttributesEditor [METRICS] loc=40 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void onServerTemplateLo...
/* static context [FOCAL] @PostConstruct public void RemoteDataSetDefAttributesEditor.init() [COLLABORATORS] field view:RemoteDataSetDefAttributesEditor.View init/1,initWidgets/4; field queryTarget:DropDownEditor setSelectHint/1,newEntry/2,setEntries/1,addHelpContent/3; field serverTemplateId setSelectHint/1,addHelpCon...
/* static context [FOCAL] @PostConstruct public void RemoteDataSetDefAttributesEditor.init() [COLLABORATORS] field view:RemoteDataSetDefAttributesEditor.View init/1,initWidgets/4; field queryTarget:DropDownEditor setSelectHint/1,newEntry/2,setEntries/1,addHelpContent/3; field serverTemplateId setSelectHint/1,addHelpCon...
true
ok
{"focal": {"class": "RemoteDataSetDefAttributesEditor", "name": "init", "signature": "void init()", "start_line": 3, "modifiers": "@PostConstruct public", "params": [], "return_type": "void"}, "class_info": {"name": "RemoteDataSetDefAttributesEditor", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ...
5418564_0
class CreateOnWriteList implements List<E> { @Override public E set(int index, E element) { if (wrapped != null) { return wrapped.set(index, element); } throw new UnsupportedOperationException(); } public abstract List<E> newList(); private List<E> getWrapped(); @Override public boolean add(E e); @Ove...
assertNull(_list); List<String> l = getListPreset(); assertTrue(_list instanceof CreateOnWriteList); assertTrue(l instanceof CreateOnWriteList); assertNull(getListPreset().set(0, "a")); } }
[FOCAL] @Override public E CreateOnWriteList.set(int index, E element) [CLASS] class CreateOnWriteList implements List<E> [METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] wrapped.set/2 [NEW] UnsupportedOperationException [EXCEPTIONS] throws UnsupportedOperationException [THROWS-WHEN...
/* static context [FOCAL] @Override public E CreateOnWriteList.set(int index, E element) [THROWS-WHEN] UnsupportedOperationException when !(wrapped != null) [PATH1] if(wrapped != null)=T -> return wrapped.set(index, element) [PATH2] if(wrapped != null)=F -> throw new UnsupportedOperationException() [INPUTS] branches=- ...
/* static context [FOCAL] @Override public E CreateOnWriteList.set(int index, E element) [THROWS-WHEN] UnsupportedOperationException when !(wrapped != null) [PATH1] if(wrapped != null)=T -> return wrapped.set(index, element) [PATH2] if(wrapped != null)=F -> throw new UnsupportedOperationException() [INPUTS] branches=- ...
true
ok
{"focal": {"class": "CreateOnWriteList", "name": "set", "signature": "E set(int index, E element)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "index", "type": "int"}, {"name": "element", "type": "E"}], "return_type": "E"}, "class_info": {"name": "CreateOnWriteList", "kind": "class", "modifie...
5426219_354
class AnalyticsIndexerService { public int index( Experiment experiment, Map<String, Map<BioentityPropertyName, Set<String>>> bioentityIdToProperties, int batchSize) { List<SolrInputDocument> toLoad = new ArrayList<>(batchSize); int addedIntoThisBatch = 0; int added...
BaselineExperimentDataPoint[] nullArray = {null}; mockExperimentDataPointStreamFactory(experimentDataPointStreamFactory, experiment, nullArray); Map<String, Map<BioentityPropertyName, Set<String>>> bioentityIdToIdentifierSearch = new HashMap<>(); int batchSize = Integer.parseInt(DEFAULT...
[FOCAL] public int AnalyticsIndexerService.index(Experiment experiment, Map<String, Map<BioentityPropertyName, Set<String>>> bioentityIdToProperties, int batchSize) [CLASS] class AnalyticsIndexerService [METRICS] loc=38 cc=5 branches=1 loops=2 returns=1 throws=1 nesting=3 [CALLS-EXTERNAL] ExperimentDataPointStreamFacto...
/* static context [FOCAL] public int AnalyticsIndexerService.index(Experiment experiment, Map<String, Map<BioentityPropertyName, Set<String>>> bioentityIdToProperties, int batchSize) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] while(it.hasNext())=T -> while(addedIntoThisBatch < batchSize && it.hasNext()...
/* static context [FOCAL] public int AnalyticsIndexerService.index(Experiment experiment, Map<String, Map<BioentityPropertyName, Set<String>>> bioentityIdToProperties, int batchSize) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] while(it.hasNext())=T -> while(addedIntoThisBatch < batchSize && it.hasNext()...
true
ok
{"focal": {"class": "AnalyticsIndexerService", "name": "index", "signature": "int index(Experiment experiment, Map<String, Map<BioentityPropertyName, Set<String>>> bioentityIdToProperties, int batchSize)", "start_line": 3, "modifiers": "public", "params": [{"name": "experiment", "type": "Experiment"}, {"name": "bioenti...
5445246_4
class LiteralExtractor implements Extractor<T>, Serializable, PortableObject { public LiteralExtractor() { } public LiteralExtractor(); public LiteralExtractor(T literal); @Override public T extract(Object o); @SuppressWarnings("unchecked") @Override public void readExternal(PofReader reade...
assertEquals("blah", new LiteralExtractor("blah").extract(null)); assertEquals(5, new LiteralExtractor(5).extract(null)); } }
[FOCAL] public LiteralExtractor.LiteralExtractor() [CLASS] class LiteralExtractor implements Extractor<T>, Serializable, PortableObject [METRICS] loc=2 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CLASS-MEMBERS] LiteralExtractor(); LiteralExtractor(T literal); T extract(Object o); void readExternal(PofReader r...
/* static context [FOCAL] public LiteralExtractor.LiteralExtractor() */
/* static context [FOCAL] public LiteralExtractor.LiteralExtractor() */ class LiteralExtractor implements Extractor<T>, Serializable, PortableObject { public LiteralExtractor() { } public LiteralExtractor(); public LiteralExtractor(T literal); @Override public T extract(Object o); @Suppress...
true
ok
{"focal": {"class": "LiteralExtractor", "name": "LiteralExtractor", "signature": "LiteralExtractor()", "start_line": 3, "modifiers": "public", "params": [], "return_type": null}, "class_info": {"name": "LiteralExtractor", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Extractor<T>, Serializable, P...
5449213_0
class TimeZoneRoundingCache { public long round(final long timestamp) { final long rounded = _cache.get(timestamp); if(rounded == _noEntryKey) return roundAndCache(timestamp); else return rounded; } public TimeZoneRoundingCache(final TimeZoneRounding tzRoun...
final int cacheSize = 1000; final int reps = 2000; final long[] input = new long[reps]; final long[] expected = new long[reps]; final long[] actual = new long[reps]; final Chronology chronology = ISOChronology.getInstanceUTC(); final TimeZoneRounding tzRounding = ...
[FOCAL] public long TimeZoneRoundingCache.round(long timestamp) [CLASS] class TimeZoneRoundingCache [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] long roundAndCache(long timestamp) [CALLS-EXTERNAL] _cache.get/1 [PATH1] if(rounded == _noEntryKey)=T -> return roundAndCache(timestam...
/* static context [FOCAL] public long TimeZoneRoundingCache.round(long timestamp) [PATH1] if(rounded == _noEntryKey)=T -> return roundAndCache(timestamp) [PATH2] if(rounded == _noEntryKey)=F -> return rounded [INPUTS] branches=timestamp | result=timestamp [CALLS-INTERNAL] long roundAndCache(long timestamp) [CALLS-EXTER...
/* static context [FOCAL] public long TimeZoneRoundingCache.round(long timestamp) [PATH1] if(rounded == _noEntryKey)=T -> return roundAndCache(timestamp) [PATH2] if(rounded == _noEntryKey)=F -> return rounded [INPUTS] branches=timestamp | result=timestamp [CALLS-INTERNAL] long roundAndCache(long timestamp) [CALLS-EXTER...
true
ok
{"focal": {"class": "TimeZoneRoundingCache", "name": "round", "signature": "long round(long timestamp)", "start_line": 3, "modifiers": "public", "params": [{"name": "timestamp", "type": "long"}], "return_type": "long"}, "class_info": {"name": "TimeZoneRoundingCache", "kind": "class", "modifiers": "", "superclass": null...
5455271_0
class ClusterSubdomainAffinityAlgorithm extends CallIDAffinityBalancerAlgorithm { public void loadSubclusters(String subclustersString) { ConcurrentHashMap<String, List<String>> map = new ConcurrentHashMap<String, List<String>>(); if(subclustersString != null) { subclustersString = subclustersString.replaceAll...
ClusterSubdomainAffinityAlgorithm algorithm = new ClusterSubdomainAffinityAlgorithm(); try { algorithm.loadSubclusters(groups2); } catch (Exception e) { return; } fail("Excpeted excpetion"); } }
[FOCAL] public void ClusterSubdomainAffinityAlgorithm.loadSubclusters(String subclustersString) [CLASS] class ClusterSubdomainAffinityAlgorithm extends CallIDAffinityBalancerAlgorithm [METRICS] loc=27 cc=7 branches=3 loops=3 returns=0 throws=1 nesting=5 [CALLS-EXTERNAL] String.replaceAll/2, String.split/1, group.replac...
/* static context [FOCAL] public void ClusterSubdomainAffinityAlgorithm.loadSubclusters(String subclustersString) [THROWS-WHEN] RuntimeException when subclustersString != null && q<groups.length && foreach(String host : hosts)#1=T && host.length()>0 && hostGroupList.contains(host) [PATH1] if(subclustersString != null)=...
/* static context [FOCAL] public void ClusterSubdomainAffinityAlgorithm.loadSubclusters(String subclustersString) [THROWS-WHEN] RuntimeException when subclustersString != null && q<groups.length && foreach(String host : hosts)#1=T && host.length()>0 && hostGroupList.contains(host) [PATH1] if(subclustersString != null)=...
true
ok
{"focal": {"class": "ClusterSubdomainAffinityAlgorithm", "name": "loadSubclusters", "signature": "void loadSubclusters(String subclustersString)", "start_line": 3, "modifiers": "public", "params": [{"name": "subclustersString", "type": "String"}], "return_type": "void"}, "class_info": {"name": "ClusterSubdomainAffinity...
5455433_389
class Text implements CharSequence { @Override public boolean equals(Object other) { if (other == null) { return false; } if (!(other instanceof Text)) { return false; } Text t = (Text) other; if (this.len != t.len) { return ...
Text t1 = new Text("test"); Text t2 = new Text("test"); assertTrue("Must be equals", t1.equals(t2)); } }
[FOCAL] @Override public boolean Text.equals(Object other) [CLASS] class Text implements CharSequence [METRICS] loc=18 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1 [CALLS-INTERNAL] boolean compareChars(byte[] chars, int pos) [FIELDS] read=len [PATH1] if(other == null)=F -> if(!(other instanceof Text))=F -> if(t...
/* static context [FOCAL] @Override public boolean Text.equals(Object other) [PATH1] if(other == null)=F -> if(!(other instanceof Text))=F -> if(this.len != t.len)=T -> return false [PATH2] if(other == null)=F -> if(!(other instanceof Text))=F -> if(this.len != t.len)=F -> return compareChars(t.chars, t.pos) [PATH3] if...
/* static context [FOCAL] @Override public boolean Text.equals(Object other) [PATH1] if(other == null)=F -> if(!(other instanceof Text))=F -> if(this.len != t.len)=T -> return false [PATH2] if(other == null)=F -> if(!(other instanceof Text))=F -> if(this.len != t.len)=F -> return compareChars(t.chars, t.pos) [PATH3] if...
true
ok
{"focal": {"class": "Text", "name": "equals", "signature": "boolean equals(Object other)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "other", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "Text", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Cha...
5455441_14
class OidContainer { public String getSerializedData() { if (this.data == null) return ""; else { boolean isFirst = true; StringBuilder sb = new StringBuilder(); for (long l : data) { if (isFirst) isFirst = false; ...
public void testEncode() throws Exception { OidContainer oid = new OidContainer(getSourceData()); String s1 = oid.getSerializedData(); assertEquals(s1, getString()); } }
[FOCAL] public String OidContainer.getSerializedData() [CLASS] class OidContainer [METRICS] loc=16 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=3 [CALLS-EXTERNAL] StringBuilder.append/1, StringBuilder.toString/0 [NEW] StringBuilder [FIELDS] read=data [PATH1] if(this.data == null)=F -> foreach(long l : data)=T -> ...
/* static context [FOCAL] public String OidContainer.getSerializedData() [PATH1] if(this.data == null)=F -> foreach(long l : data)=T -> if(isFirst)=T -> exit loop -> return sb.toString() [PATH2] if(this.data == null)=T -> return "" [PATH3] if(this.data == null)=F -> foreach(long l : data)=F -> return sb.toString() [PAT...
/* static context [FOCAL] public String OidContainer.getSerializedData() [PATH1] if(this.data == null)=F -> foreach(long l : data)=T -> if(isFirst)=T -> exit loop -> return sb.toString() [PATH2] if(this.data == null)=T -> return "" [PATH3] if(this.data == null)=F -> foreach(long l : data)=F -> return sb.toString() [PAT...
true
ok
{"focal": {"class": "OidContainer", "name": "getSerializedData", "signature": "String getSerializedData()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "OidContainer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "memb...
5455452_5
class AsnInputStream extends InputStream { public byte[] readIndefinite() throws AsnException, IOException { int startPos = this.pos; this.advanceIndefiniteLength(); byte[] res = new byte[this.pos - startPos - 2]; System.arraycopy(this.buffer, this.start + startPos, res, 0, this.pos - startPos - 2); r...
byte[] data = new byte[] { (byte)0x80, (byte)0x80, 0x09, (byte)0x96, 0x02, 0x24, (byte)0x80, 0x03, 0x00, (byte)0x80, 0x00, (byte)0xf2, (byte)0x81, 0x07, (byte)0x91, 0x13, 0x26, (byte)0x98, (byte)0x86, 0x03, (byte)0xf0, 0x00, 0x00 }; AsnInputStream asnIs = new AsnInputStream(data); int length = asnIs.re...
[FOCAL] public byte[] AsnInputStream.readIndefinite() [CLASS] class AsnInputStream extends InputStream [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void advanceIndefiniteLength() [CALLS-EXTERNAL] System.arraycopy/5 [FIELDS] read=buffer, pos, start [EXCEPTIONS] declares AsnExcep...
/* static context [FOCAL] public byte[] AsnInputStream.readIndefinite() [EXCEPTIONS] declares AsnException, IOException [CALLS-INTERNAL] void advanceIndefiniteLength() [FIELDS] read=buffer, pos, start [CALLS-EXTERNAL] System.arraycopy/5 */
/* static context [FOCAL] public byte[] AsnInputStream.readIndefinite() [EXCEPTIONS] declares AsnException, IOException [CALLS-INTERNAL] void advanceIndefiniteLength() [FIELDS] read=buffer, pos, start [CALLS-EXTERNAL] System.arraycopy/5 */ class AsnInputStream extends InputStream { public byte[] readIndefinite() thro...
true
ok
{"focal": {"class": "AsnInputStream", "name": "readIndefinite", "signature": "byte[] readIndefinite() throws AsnException, IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "byte[]"}, "class_info": {"name": "AsnInputStream", "kind": "class", "modifiers": "", "superclass": "InputStream",...
5455458_5
class AsrSignal { @Override public String toString() { final StringBuilder buffer = new StringBuilder(); if (!initialPrompts.isEmpty()) { buffer.append("ip="); for (int index = 0; index < initialPrompts.size(); index++) { buffer.append(initialPrompts.get(...
String expectedResult = "ip=hello.wav dr=no_name_driver ln=en-US eik=# mrt=100 wit=100 pst=50 hw=57616974 in=dtmf_speech mn=1 mx=1 pr=true"; AsrSignal asrSignal = new AsrSignal(driver, DEFAULT_LANG, initialPrompts, endInputKey, maximumRecTimer, waitingInputTimer, timeAfterSpeech, hotWord...
[FOCAL] @Override public String AsrSignal.toString() [CLASS] class AsrSignal [METRICS] loc=69 cc=24 branches=22 loops=1 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] List<URI>.isEmpty/0, StringBuilder.append/1, List<URI>.size/0, List<URI>.get/1, StringBuilder.length/0, buffer.append("dr=").append/1, buffer.append("ln="...
/* static context [FOCAL] @Override public String AsrSignal.toString() [PATH1] if(!initialPrompts.isEmpty())=T -> for(index < initialPrompts.size())=T -> if(index < initialPrompts.size() - 1)=T -> exit loop -> if(buffer.length() > 0)#1=T -> if(buffer.length() > 0)#2=T -> if(endInputKey != null)=T -> if(buffer.length() ...
/* static context [FOCAL] @Override public String AsrSignal.toString() [PATH1] if(!initialPrompts.isEmpty())=T -> for(index < initialPrompts.size())=T -> if(index < initialPrompts.size() - 1)=T -> exit loop -> if(buffer.length() > 0)#1=T -> if(buffer.length() > 0)#2=T -> if(endInputKey != null)=T -> if(buffer.length() ...
true
ok
{"focal": {"class": "AsrSignal", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "AsrSignal", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "DEFAULT_LANG...
5455474_2
class HomeRoutingManagement implements HomeRoutingManagementMBean { @Override public void addCcMccmnc(String countryCode, String mccMnc, String smsc) throws Exception { CcMccmncImpl ccMccmnc = new CcMccmncImpl(countryCode, mccMnc, smsc); ccMccmncCollection.addCcMccmnc(ccMccmnc); this.st...
public void testFunc() throws Exception { CcMccmncCollection original = new CcMccmncCollection(); original.addCcMccmnc(new CcMccmncImpl("1111", "222", "00001")); original.addCcMccmnc(new CcMccmncImpl("", "555", "")); original.addCcMccmnc(new CcMccmncImpl("3333", "444", null)); ...
[FOCAL] @Override public void HomeRoutingManagement.addCcMccmnc(String countryCode, String mccMnc, String smsc) [CLASS] class HomeRoutingManagement implements HomeRoutingManagementMBean [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void store() [CALLS-EXTERNAL] ccMccmncCollection...
/* static context [FOCAL] @Override public void HomeRoutingManagement.addCcMccmnc(String countryCode, String mccMnc, String smsc) [COLLABORATORS] field ccMccmncCollection addCcMccmnc/1 [EXCEPTIONS] declares Exception [CALLS-INTERNAL] void store() [NEW] CcMccmncImpl [CALLS-EXTERNAL] ccMccmncCollection.addCcMccmnc/1 */
/* static context [FOCAL] @Override public void HomeRoutingManagement.addCcMccmnc(String countryCode, String mccMnc, String smsc) [COLLABORATORS] field ccMccmncCollection addCcMccmnc/1 [EXCEPTIONS] declares Exception [CALLS-INTERNAL] void store() [NEW] CcMccmncImpl [CALLS-EXTERNAL] ccMccmncCollection.addCcMccmnc/1 */ c...
true
ok
{"focal": {"class": "HomeRoutingManagement", "name": "addCcMccmnc", "signature": "void addCcMccmnc(String countryCode, String mccMnc, String smsc) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "countryCode", "type": "String"}, {"name": "mccMnc", "type": "String"}, {"name": "sm...
5487921_15
class Version implements Comparable<Object> { public static int compare(String oneVersion, String anotherVersion) { return new Version(oneVersion).compareTo(new Version(anotherVersion)); } public Version(String version); public boolean isAlpha(); public boolean isBeta(); public boolean isFinal(); public in...
Assert.assertTrue(Version.compare("1.1.3 Alpha", "1.1.3 Beta") < 0); } }
[FOCAL] public static int Version.compare(String oneVersion, String anotherVersion) [CLASS] class Version implements Comparable<Object> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] new Version(oneVersion).compareTo/1 [NEW] Version [INPUTS] branches=- | result=anotherVersion, one...
/* static context [FOCAL] public static int Version.compare(String oneVersion, String anotherVersion) [INPUTS] branches=- | result=anotherVersion, oneVersion [NEW] Version [CALLS-EXTERNAL] new Version(oneVersion).compareTo/1 */
/* static context [FOCAL] public static int Version.compare(String oneVersion, String anotherVersion) [INPUTS] branches=- | result=anotherVersion, oneVersion [NEW] Version [CALLS-EXTERNAL] new Version(oneVersion).compareTo/1 */ class Version implements Comparable<Object> { public static int compare(String oneVersion,...
true
ok
{"focal": {"class": "Version", "name": "compare", "signature": "int compare(String oneVersion, String anotherVersion)", "start_line": 3, "modifiers": "public static", "params": [{"name": "oneVersion", "type": "String"}, {"name": "anotherVersion", "type": "String"}], "return_type": "int"}, "class_info": {"name": "Versio...
5495870_6
class UpdateManager { protected static boolean installedFromMarket(WeakReference<? extends Context> weakContext) { boolean result = false; Context context = weakContext.get(); if (context != null) { try { String installer = context.getPackageManager().getInstall...
// On Android Nougat, installing packages using HockeyApp (using the package manager) will list the following installer identifier when(mockPackageManager.getInstallerPackageName(any(String.class))).thenReturn("com.android.packageinstaller"); // When not on Android Nougat this is considered "sto...
[FOCAL] protected static boolean UpdateManager.installedFromMarket(WeakReference<? extends Context> weakContext) [CLASS] class UpdateManager [METRICS] loc=29 cc=6 branches=4 loops=0 returns=1 throws=0 nesting=4 [CALLS-EXTERNAL] WeakReference<? extends Context>.get/0, context.getPackageManager().getInstallerPackageName/...
/* static context [FOCAL] protected static boolean UpdateManager.installedFromMarket(WeakReference<? extends Context> weakContext) [PATH1] if(context != null)=T -> if(!TextUtils.isEmpty(installer))=T -> if((Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && (TextUtils.equals(installer, INSTALLER_PACKAGE_INSTALLER_NOUGAT...
/* static context [FOCAL] protected static boolean UpdateManager.installedFromMarket(WeakReference<? extends Context> weakContext) [PATH1] if(context != null)=T -> if(!TextUtils.isEmpty(installer))=T -> if((Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && (TextUtils.equals(installer, INSTALLER_PACKAGE_INSTALLER_NOUGAT...
true
ok
{"focal": {"class": "UpdateManager", "name": "installedFromMarket", "signature": "boolean installedFromMarket(WeakReference<? extends Context> weakContext)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "weakContext", "type": "WeakReference<? extends Context>"}], "return_type": "boolean"}, "cla...
5502061_0
class LoggerFactory implements org.slf4j.ILoggerFactory { @Override public org.slf4j.Logger getLogger(String name) { LoggerAdapter logger = loggers.get(name); if (logger == null) { logger = createLogger(name); LoggerAdapter logger2 = loggers.putIfAbsent(name, logger); if (logger2 != null) logger = logg...
Logger log = LoggerFactory.getLogger(LoggerFactoryTest.class); Assert.assertNotNull(log); Logger log2 = LoggerFactory.getLogger(LoggerFactoryTest.class); verifySame(log, log2, true); verifySame(((LoggerAdapter)log).getDelegate(), ((LoggerAdapter)log2).getDelegate(), true); log2 = LoggerFactory.getLogger("an...
[FOCAL] @Override public org.slf4j.Logger LoggerFactory.getLogger(String name) [CLASS] class LoggerFactory implements org.slf4j.ILoggerFactory [METRICS] loc=11 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] LoggerAdapter createLogger(String name) [CALLS-EXTERNAL] loggers.get/1, loggers.putIfAbsen...
/* static context [FOCAL] @Override public org.slf4j.Logger LoggerFactory.getLogger(String name) [PATH1] if(logger == null)=T -> if(logger2 != null)=T -> return logger [PATH2] if(logger == null)=F -> return logger [PATH3] if(logger == null)=T -> if(logger2 != null)=F -> return logger [INPUTS] branches=name | result=nam...
/* static context [FOCAL] @Override public org.slf4j.Logger LoggerFactory.getLogger(String name) [PATH1] if(logger == null)=T -> if(logger2 != null)=T -> return logger [PATH2] if(logger == null)=F -> return logger [PATH3] if(logger == null)=T -> if(logger2 != null)=F -> return logger [INPUTS] branches=name | result=nam...
true
ok
{"focal": {"class": "LoggerFactory", "name": "getLogger", "signature": "org.slf4j.Logger getLogger(String name)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "String"}], "return_type": "org.slf4j.Logger"}, "class_info": {"name": "LoggerFactory", "kind": "class", "modifiers": ""...
5509523_13
class DefaultHost implements Host { @Override public Stats stats() { return this.statistics; } DefaultHost(@NotNull final Bucket bckt); DefaultHost( @NotNull final Bucket bckt, @NotNull final Host.CloudWatch cwatch ); @Override public String toString(); @Ov...
final long sum = 10; final CloudWatch cloudwatch = this.cloudWatch(); final GetMetricStatisticsResult result = new GetMetricStatisticsResult() .withDatapoints(new Datapoint().withSum(Double.valueOf(sum))); Mockito.doReturn(result).when(cloudwatch.get()) .getMetric...
[FOCAL] @Override public Stats DefaultHost.stats() [CLASS] class DefaultHost implements Host [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=statistics [CLASS-MEMBERS] DefaultHost(Bucket bckt); DefaultHost(Bucket bckt, Host.CloudWatch cwatch); String toString(); void close(); Resource...
/* static context [FOCAL] @Override public Stats DefaultHost.stats() [FIELDS] read=statistics */
/* static context [FOCAL] @Override public Stats DefaultHost.stats() [FIELDS] read=statistics */ class DefaultHost implements Host { @Override public Stats stats() { return this.statistics; } DefaultHost(@NotNull final Bucket bckt); DefaultHost( @NotNull final Bucket bckt, ...
true
ok
{"focal": {"class": "DefaultHost", "name": "stats", "signature": "Stats stats()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Stats"}, "class_info": {"name": "DefaultHost", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Host", "fields": [{"name": "thrown", "type...
5510832_6
class ReadOnlyMemory extends RandomAccessMemory { @Override public boolean write(boolean isByteMode, int address, int value) { return false; } public ReadOnlyMemory(String id, int startAddress, short[] data); public ReadOnlyMemory(String id, int startAddress, byte[] data); @Override...
byte[] romData = new byte[] { 0, (byte) 0377 }; ReadOnlyMemory rom = new ReadOnlyMemory("TestRom", 01000, romData); rom.write(true, 01000, 0377); assertEquals(0377 << 8, rom.read(false, 01000)); rom.write(true, 01001, 0); assertEquals(0377 << 8, rom.read(false, 01000)); ...
[FOCAL] @Override public boolean ReadOnlyMemory.write(boolean isByteMode, int address, int value) [CLASS] class ReadOnlyMemory extends RandomAccessMemory [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=- | unused=isByteMode, address, value [CLASS-MEMBERS] ReadOnlyMemory...
/* static context [FOCAL] @Override public boolean ReadOnlyMemory.write(boolean isByteMode, int address, int value) [INPUTS] branches=- | result=- | unused=isByteMode, address, value */
/* static context [FOCAL] @Override public boolean ReadOnlyMemory.write(boolean isByteMode, int address, int value) [INPUTS] branches=- | result=- | unused=isByteMode, address, value */ class ReadOnlyMemory extends RandomAccessMemory { @Override public boolean write(boolean isByteMode, int address, int value) ...
true
ok
{"focal": {"class": "ReadOnlyMemory", "name": "write", "signature": "boolean write(boolean isByteMode, int address, int value)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "isByteMode", "type": "boolean"}, {"name": "address", "type": "int"}, {"name": "value", "type": "int"}], "return_type": "...
5517956_3
class RelationshipComparator implements Comparator<ProjectRelationship<?, ?>> { @Override public int compare( final ProjectRelationship<?, ?> one, final ProjectRelationship<?, ?> two ) { if ( one.getType() == two.getType() ) { if ( one.getPomLocation() .equal...
final ProjectVersionRef nodeW = projectVersion( "w", "w", "1.0" ); final ProjectVersionRef nodeX = projectVersion( "x", "x", "1.0" ); final ProjectVersionRef nodeY = projectVersion( "y", "y", "1.0" ); final ProjectVersionRef nodeZ = projectVersion( "z", "z", "1.0" ); DependencyR...
[FOCAL] @Override public int RelationshipComparator.compare(ProjectRelationship<?, ?> one, ProjectRelationship<?, ?> two) [CLASS] class RelationshipComparator implements Comparator<ProjectRelationship<?, ?>> [METRICS] loc=33 cc=5 branches=4 loops=0 returns=4 throws=0 nesting=3 [CALLS-EXTERNAL] ProjectRelationship<?, ?>...
/* static context [FOCAL] @Override public int RelationshipComparator.compare(ProjectRelationship<?, ?> one, ProjectRelationship<?, ?> two) [PATH1] if(one.getType() == two.getType())=T -> if(( one.getPomLocation() .equals( RelationshipConstants.POM_ROOT_URI ) && !two.getPomLocation() .equals( RelationshipCo...)=F -> if...
/* static context [FOCAL] @Override public int RelationshipComparator.compare(ProjectRelationship<?, ?> one, ProjectRelationship<?, ?> two) [PATH1] if(one.getType() == two.getType())=T -> if(( one.getPomLocation() .equals( RelationshipConstants.POM_ROOT_URI ) && !two.getPomLocation() .equals( RelationshipCo...)=F -> if...
true
ok
{"focal": {"class": "RelationshipComparator", "name": "compare", "signature": "int compare(ProjectRelationship<?, ?> one, ProjectRelationship<?, ?> two)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "one", "type": "ProjectRelationship<?, ?>"}, {"name": "two", "type": "ProjectRelationship<?, ?>...
5529658_109
class LayerBuilder { protected List<ModuleBuildFuture> collectFutures(ModuleList moduleList, HttpServletRequest request) throws IOException { final String sourceMethod = "collectFutures"; //$NON-NLS-1$ final boolean isTraceLogging = log.isLoggable(Level.FINER); if (isTraceLogging) { log.entering(sourceCl...
IAggregator mockAggregator = TestUtils.createMockAggregator(); HttpServletRequest mockRequest = TestUtils.createMockRequest(mockAggregator); ICache mockCache = createMock(ICache.class); IModuleCache mockModuleCache = createMock(IModuleCache.class); expect(mockCache.getModules()).andReturn(mockModuleCache).any...
[FOCAL] protected List<ModuleBuildFuture> LayerBuilder.collectFutures(ModuleList moduleList, HttpServletRequest request) [CLASS] class LayerBuilder [METRICS] loc=76 cc=14 branches=9 loops=1 returns=1 throws=3 nesting=5 [CALLS-EXTERNAL] log.isLoggable/1, log.entering/3, HttpServletRequest.getAttribute/1, aggr.getCacheMa...
class LayerBuilder { protected List<ModuleBuildFuture> collectFutures(ModuleList moduleList, HttpServletRequest request) throws IOException { final String sourceMethod = "collectFutures"; //$NON-NLS-1$ final boolean isTraceLogging = log.isLoggable(Level.FINER); if (isTraceLogging) { log.entering(sourceCl...
false
ok
{"focal": {"class": "LayerBuilder", "name": "collectFutures", "signature": "List<ModuleBuildFuture> collectFutures(ModuleList moduleList, HttpServletRequest request) throws IOException", "start_line": 3, "modifiers": "protected", "params": [{"name": "moduleList", "type": "ModuleList"}, {"name": "request", "type": "Http...
5551767_0
class Preprocessor { public static void main(String[] args) { String file = "C:/Users/Kerwyn/Desktop/pg17989.txt"; String preprocessed_file = ""; try { preprocessed_file = preprocess(file); } catch (FileNotFoundException e) { /* file doesn't exist */ System.err.println(file + " doesn't exists. Pick ...
fail("Not yet implemented"); } }
[FOCAL] public static void Preprocessor.main(String[] args) [CLASS] class Preprocessor [METRICS] loc=21 cc=3 branches=0 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] String preprocess(String file) [CALLS-EXTERNAL] System.err.println/1, JFileChooser.showOpenDialog/1, f.getSelectedFile().getPath/0, JFileChooser.g...
/* static context [FOCAL] public static void Preprocessor.main(String[] args) [PATH1] try-body throws -> try-body throws -> return [INPUTS] branches=- | result=- | unused=args [EXCEPTIONS] catches FileNotFoundException e, FileNotFoundException e1 [CALLS-INTERNAL] String preprocess(String file) [NEW] JFileChooser [CALLS...
/* static context [FOCAL] public static void Preprocessor.main(String[] args) [PATH1] try-body throws -> try-body throws -> return [INPUTS] branches=- | result=- | unused=args [EXCEPTIONS] catches FileNotFoundException e, FileNotFoundException e1 [CALLS-INTERNAL] String preprocess(String file) [NEW] JFileChooser [CALLS...
true
ok
{"focal": {"class": "Preprocessor", "name": "main", "signature": "void main(String[] args)", "start_line": 3, "modifiers": "public static", "params": [{"name": "args", "type": "String[]"}], "return_type": "void"}, "class_info": {"name": "Preprocessor", "kind": "class", "modifiers": "", "superclass": null, "interfaces":...
5561881_3
class Script { public Object run(final String functionReference, final Object... values) { // Create a local copy of the bindings so we can multi-thread. Context context = enterContext(); try { Scriptable object = this.localScope; Iterator<String> parts = Splitter.on('.').split(functionRefere...
final Script s = new Script("test", "function tester() { return test.me(); }", LoadPaths.defaultPath(), "hegemon/test"); Assert.assertEquals("here", s.run("tester")); } }
[FOCAL] public Object Script.run(String functionReference, Object... values) [CLASS] class Script [METRICS] loc=20 cc=4 branches=1 loops=1 returns=1 throws=1 nesting=3 [CALLS-INTERNAL] Context enterContext(); Object unwrap(Object jsObj); Object[] jsValues(Object[] values); void exitContext() [CALLS-EXTERNAL] Splitter.o...
/* static context [FOCAL] public Object Script.run(String functionReference, Object... values) [THROWS-WHEN] IllegalArgumentException when parts.hasNext() && parts.hasNext() [THROWS-WHEN] IllegalArgumentException when !parts.hasNext() [PATH1] while(parts.hasNext())=T -> if(parts.hasNext())=T -> exit loop -> throw new I...
/* static context [FOCAL] public Object Script.run(String functionReference, Object... values) [THROWS-WHEN] IllegalArgumentException when parts.hasNext() && parts.hasNext() [THROWS-WHEN] IllegalArgumentException when !parts.hasNext() [PATH1] while(parts.hasNext())=T -> if(parts.hasNext())=T -> exit loop -> throw new I...
true
ok
{"focal": {"class": "Script", "name": "run", "signature": "Object run(String functionReference, Object... values)", "start_line": 3, "modifiers": "public", "params": [{"name": "functionReference", "type": "String"}, {"name": "values", "type": "Object..."}], "return_type": "Object"}, "class_info": {"name": "Script", "ki...
5598875_74
class ScheduledTaskImpl implements ScheduledTask { public synchronized boolean cancel(boolean block) { switch (state) { case COMPLETED: case CANCELLED: // the task has already completed or been cancelled return false; case RUNNING: ...
setTaskState("RUNNABLE"); Assert.assertTrue(task.cancel(false)); Assert.assertEquals("CANCELLED", getTaskState()); } }
[FOCAL] public synchronized boolean ScheduledTaskImpl.cancel(boolean block) [CLASS] class ScheduledTaskImpl implements ScheduledTask [METRICS] loc=36 cc=10 branches=3 loops=1 returns=5 throws=0 nesting=4 [CALLS-INTERNAL] boolean isDone(); void cancel() [CALLS-EXTERNAL] wait/0 (inherited) [EXCEPTIONS] catches Interrupte...
/* static context [FOCAL] public synchronized boolean ScheduledTaskImpl.cancel(boolean block) [PATH1] switch(state)=case RUNNING -> if(block)=T -> while(state == State.RUNNING)=T -> try-body throws -> exit loop -> if(!isDone())=T -> return true [PATH2] switch(state)=case RUNNING -> if(block)=T -> while(state == State.R...
/* static context [FOCAL] public synchronized boolean ScheduledTaskImpl.cancel(boolean block) [PATH1] switch(state)=case RUNNING -> if(block)=T -> while(state == State.RUNNING)=T -> try-body throws -> exit loop -> if(!isDone())=T -> return true [PATH2] switch(state)=case RUNNING -> if(block)=T -> while(state == State.R...
true
ok
{"focal": {"class": "ScheduledTaskImpl", "name": "cancel", "signature": "boolean cancel(boolean block)", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "block", "type": "boolean"}], "return_type": "boolean"}, "class_info": {"name": "ScheduledTaskImpl", "kind": "class", "modifiers": "", "superc...
5601676_139
class ApplicationConfiguration { public String getApplicationDescription() { return applicationDescription; } public ApplicationConfiguration(); public String getApplicationID(); public void setApplicationID(final String applicationID); public String getApplicationName(); public ...
final String expected = "NAME"; config.setApplicationDescription(expected); assertEquals(expected, config.getApplicationDescription()); } }
[FOCAL] public String ApplicationConfiguration.getApplicationDescription() [CLASS] class ApplicationConfiguration [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] ApplicationConfiguration(); String getApplicationID(); void setApplicationID(String applicationID); String getApplication...
/* static context [FOCAL] public String ApplicationConfiguration.getApplicationDescription() */
/* static context [FOCAL] public String ApplicationConfiguration.getApplicationDescription() */ class ApplicationConfiguration { public String getApplicationDescription() { return applicationDescription; } public ApplicationConfiguration(); public String getApplicationID(); public void s...
true
ok
{"focal": {"class": "ApplicationConfiguration", "name": "getApplicationDescription", "signature": "String getApplicationDescription()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "ApplicationConfiguration", "kind": "class", "modifiers": "", "superclass": null,...
5610434_1
class DataObjectFactory { public static Page createPage(String rawJSON) throws FacebookException { try { JSONObject json = new JSONObject(rawJSON); return pageConstructor.newInstance(json); } catch (InstantiationException e) { throw new FacebookException(e); ...
facebook.setMockJSON("mock_json/page/f4j.json"); Page page = facebook.getPage(); String rawJSON = DataObjectFactory.getRawJSON(page); Page actual = DataObjectFactory.createPage(rawJSON); assertThat(actual, is(page)); assertThat(actual.toString(), is(page.toString())); ...
[FOCAL] public static Page DataObjectFactory.createPage(String rawJSON) [CLASS] class DataObjectFactory [METRICS] loc=14 cc=5 branches=0 loops=0 returns=1 throws=4 nesting=1 [CALLS-EXTERNAL] pageConstructor.newInstance/1 [NEW] JSONObject, FacebookException, AssertionError [EXCEPTIONS] declares FacebookException; throws...
/* static context [FOCAL] public static Page DataObjectFactory.createPage(String rawJSON) [THROWS-WHEN] FacebookException when try-body throws [THROWS-WHEN] AssertionError when try-body throws [PATH1] try-body throws -> throw new FacebookException(e) [PATH2] return pageConstructor.newInstance(json) [PATH3] try-body thr...
/* static context [FOCAL] public static Page DataObjectFactory.createPage(String rawJSON) [THROWS-WHEN] FacebookException when try-body throws [THROWS-WHEN] AssertionError when try-body throws [PATH1] try-body throws -> throw new FacebookException(e) [PATH2] return pageConstructor.newInstance(json) [PATH3] try-body thr...
true
ok
{"focal": {"class": "DataObjectFactory", "name": "createPage", "signature": "Page createPage(String rawJSON) throws FacebookException", "start_line": 3, "modifiers": "public static", "params": [{"name": "rawJSON", "type": "String"}], "return_type": "Page"}, "class_info": {"name": "DataObjectFactory", "kind": "class", "...
5615967_1
class MapCommand extends Command { protected ModelEvent remove(EditorModel em, String key) { elementMap.remove(key); return new DefaultModelEvent(commandName, this, null, null, changed); } protected MapCommand(EAdMap<V> map, V value, String oldKey, String newKey, DependencyNode... changed); protected Mod...
System.out.println("remove"); MapCommand<String> a; for (int i = 0; i < 4; i++) { a = new MapCommand.RemoveFromMap<String>(m1, "key" + i, root); cm.performCommand(a); assert (!m1.containsKey("key" + i)); } for (int i = 0; i < 4; i++) { cm.undoCommand(); assert (m1.containsKey("key" + (4 - i - ...
[FOCAL] protected ModelEvent MapCommand.remove(EditorModel em, String key) [CLASS] class MapCommand extends Command [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] elementMap.remove/1 [NEW] DefaultModelEvent [INPUTS] branches=- | result=- | unused=em [COLLABORATORS] field elementMa...
/* static context [FOCAL] protected ModelEvent MapCommand.remove(EditorModel em, String key) [INPUTS] branches=- | result=- | unused=em [COLLABORATORS] field elementMap remove/1 [NEW] DefaultModelEvent [CALLS-EXTERNAL] elementMap.remove/1 */
/* static context [FOCAL] protected ModelEvent MapCommand.remove(EditorModel em, String key) [INPUTS] branches=- | result=- | unused=em [COLLABORATORS] field elementMap remove/1 [NEW] DefaultModelEvent [CALLS-EXTERNAL] elementMap.remove/1 */ class MapCommand extends Command { protected ModelEvent remove(EditorModel e...
true
ok
{"focal": {"class": "MapCommand", "name": "remove", "signature": "ModelEvent remove(EditorModel em, String key)", "start_line": 3, "modifiers": "protected", "params": [{"name": "em", "type": "EditorModel"}, {"name": "key", "type": "String"}], "return_type": "ModelEvent"}, "class_info": {"name": "MapCommand", "kind": "c...
5626414_3
class ResourceHandlerMapping extends RequestMappingHandlerMapping { @Override protected HandlerMethod lookupHandlerMethod(String lookupPath, HttpServletRequest request) throws Exception { if (lookupPath.startsWith(serviceRootPathWithSlash)) { doHandleMatch(doCreateRequestMappingInfo(), lookupPath, request); ...
final String lookupPath = "/service-root/a/b/c"; Method expectedMethod = resourceController.getClass().getMethod("handle", WebRequest.class, RequestMessageContainer.class); HandlerMethod expected = new HandlerMethod(resourceController, expectedMethod); new NonStrictExpectations() { { // requestに対...
[FOCAL] @Override protected HandlerMethod ResourceHandlerMapping.lookupHandlerMethod(String lookupPath, HttpServletRequest request) [CLASS] class ResourceHandlerMapping extends RequestMappingHandlerMapping [METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] RequestMappingInfo doCreate...
/* static context [FOCAL] @Override protected HandlerMethod ResourceHandlerMapping.lookupHandlerMethod(String lookupPath, HttpServletRequest request) [PATH1] if(lookupPath.startsWith(serviceRootPathWithSlash))=T -> return new HandlerMethod(handler, handlerMethod) [PATH2] if(lookupPath.startsWith(serviceRootPathWithSlas...
/* static context [FOCAL] @Override protected HandlerMethod ResourceHandlerMapping.lookupHandlerMethod(String lookupPath, HttpServletRequest request) [PATH1] if(lookupPath.startsWith(serviceRootPathWithSlash))=T -> return new HandlerMethod(handler, handlerMethod) [PATH2] if(lookupPath.startsWith(serviceRootPathWithSlas...
true
ok
{"focal": {"class": "ResourceHandlerMapping", "name": "lookupHandlerMethod", "signature": "HandlerMethod lookupHandlerMethod(String lookupPath, HttpServletRequest request) throws Exception", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "lookupPath", "type": "String"}, {"name": "request", "ty...
5632139_73
class LibShapeDraw { public String getInstanceId() { return instanceId; } public LibShapeDraw(); public LibShapeDraw(String ownerId); public boolean unregister(); @Deprecated public static String getVersion(); @Deprecated public static boolean isControllerInitialized(); publ...
LibShapeDraw lib2 = new LibShapeDraw(); assertFalse(lib.getInstanceId().equals(lib2.getInstanceId())); } }
[FOCAL] public String LibShapeDraw.getInstanceId() [CLASS] class LibShapeDraw [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] LibShapeDraw(); LibShapeDraw(String ownerId); boolean unregister(); String getVersion(); boolean isControllerInitialized(); LibShapeDraw verifyInitialized();...
/* static context [FOCAL] public String LibShapeDraw.getInstanceId() */
/* static context [FOCAL] public String LibShapeDraw.getInstanceId() */ class LibShapeDraw { public String getInstanceId() { return instanceId; } public LibShapeDraw(); public LibShapeDraw(String ownerId); public boolean unregister(); @Deprecated public static String getVersion(); ...
true
ok
{"focal": {"class": "LibShapeDraw", "name": "getInstanceId", "signature": "String getInstanceId()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "LibShapeDraw", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "lib", ...
5634637_2
class ParquetStorer extends StoreFunc implements StoreMetadata { private Schema getSchema() { try { return Utils.getSchemaFromString(getProperties().getProperty(SCHEMA)); } catch (ParserException e) { throw new RuntimeException("can not get schema from context", e); } } public ParquetSt...
String out = "target/out"; PigServer pigServer = new PigServer(ExecType.LOCAL); Data data = Storage.resetData(pigServer); Collection<Tuple> list = new ArrayList<Tuple>(); for (int i = 0; i < 1000; i++) { list.add(tuple("a"+i, bag(tuple("o", "b")))); } for (int i = 10; i < 2000; i++) { ...
[FOCAL] private Schema ParquetStorer.getSchema() [CLASS] class ParquetStorer extends StoreFunc implements StoreMetadata [METRICS] loc=7 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] Properties getProperties() [CALLS-EXTERNAL] Utils.getSchemaFromString/1, getProperties().getProperty/1 [NEW] Runti...
/* static context [FOCAL] private Schema ParquetStorer.getSchema() [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException("can not get schema from context", e) [PATH2] return Utils.getSchemaFromString(getProperties().getProperty(SCHEMA)) [EXCEPTIONS] throws RuntimeExce...
/* static context [FOCAL] private Schema ParquetStorer.getSchema() [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException("can not get schema from context", e) [PATH2] return Utils.getSchemaFromString(getProperties().getProperty(SCHEMA)) [EXCEPTIONS] throws RuntimeExce...
true
ok
{"focal": {"class": "ParquetStorer", "name": "getSchema", "signature": "Schema getSchema()", "start_line": 3, "modifiers": "private", "params": [], "return_type": "Schema"}, "class_info": {"name": "ParquetStorer", "kind": "class", "modifiers": "", "superclass": "StoreFunc", "interfaces": "StoreMetadata", "fields": [], ...
5661262_0
class TcpClient { public boolean changeCallSiteTarget(String methodType, String oldTarget, String newTarget) throws IOException { Map obj = new LinkedHashMap(); obj.put("call", "changeCallSiteTarget"); obj.put("methodType", methodType); obj.put("oldTarget", oldTarget); obj.p...
final String expected_answer = "{\"result\":\"ok\",\"calledMethod\":\"changeCallSiteTarget\"}" + END_OF_INSTRUCTION; final String sent_call = "changeCallSiteTarget"; final String sent_methodType = "virtual"; final String sent_oldTarget = "HelloWorld.tick:(HelloWorld)void"; final...
[FOCAL] public boolean TcpClient.changeCallSiteTarget(String methodType, String oldTarget, String newTarget) [CLASS] class TcpClient [METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String send(String message); boolean isThatOk(JSONObject obj) [CALLS-EXTERNAL] Map.put/2, JSONValue....
/* static context [FOCAL] public boolean TcpClient.changeCallSiteTarget(String methodType, String oldTarget, String newTarget) [EXCEPTIONS] declares IOException [CALLS-INTERNAL] String send(String message); boolean isThatOk(JSONObject obj) [NEW] LinkedHashMap [CALLS-EXTERNAL] Map.put/2, JSONValue.toJSONString/1, JSONVa...
/* static context [FOCAL] public boolean TcpClient.changeCallSiteTarget(String methodType, String oldTarget, String newTarget) [EXCEPTIONS] declares IOException [CALLS-INTERNAL] String send(String message); boolean isThatOk(JSONObject obj) [NEW] LinkedHashMap [CALLS-EXTERNAL] Map.put/2, JSONValue.toJSONString/1, JSONVa...
true
ok
{"focal": {"class": "TcpClient", "name": "changeCallSiteTarget", "signature": "boolean changeCallSiteTarget(String methodType, String oldTarget, String newTarget) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "methodType", "type": "String"}, {"name": "oldTarget", "type": "String"}, {"...
5683980_4
class SonarQubeTask extends Task { @SuppressWarnings("unchecked") @Override public void execute() { log(Main.getAntVersion()); log("SonarQube Ant Task version: " + SonarQubeTaskUtils.getTaskVersion()); log("Loaded from: " + SonarQubeTaskUtils.getJarPath()); Map<String, String> allProps = new Has...
project = mock(Project.class); Properties props = new Properties(); File out = folder.newFile(); props.put("sonar.scanner.dumpToFile", out.getAbsolutePath()); when(project.getProperties()).thenReturn(props); task = new SonarQubeTask(); File baseDir = folder.newFolder(); when(project.ge...
[FOCAL] @SuppressWarnings("unchecked") @Override public void SonarQubeTask.execute() [CLASS] class SonarQubeTask extends Task [METRICS] loc=23 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Map<String, String> getEnv(); void launchAnalysis(Map<String, String> properties); void putAll(Properties s...
/* static context [FOCAL] @SuppressWarnings("unchecked") @Override public void SonarQubeTask.execute() [PATH1] if(SonarQubeTaskUtils.getAntLoggerLever(getProject()) >= 3)=T -> if("true".equalsIgnoreCase(allProps.get(ScanProperties.SKIP)))=T -> return [PATH2] if(SonarQubeTaskUtils.getAntLoggerLever(getProject()) >= 3)=F...
/* static context [FOCAL] @SuppressWarnings("unchecked") @Override public void SonarQubeTask.execute() [PATH1] if(SonarQubeTaskUtils.getAntLoggerLever(getProject()) >= 3)=T -> if("true".equalsIgnoreCase(allProps.get(ScanProperties.SKIP)))=T -> return [PATH2] if(SonarQubeTaskUtils.getAntLoggerLever(getProject()) >= 3)=F...
true
ok
{"focal": {"class": "SonarQubeTask", "name": "execute", "signature": "void execute()", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") @Override public", "params": [], "return_type": "void"}, "class_info": {"name": "SonarQubeTask", "kind": "class", "modifiers": "", "superclass": "Task", "interfaces": nu...
5704054_2
class BasicClient implements SLIClient { @Override public void update(final Entity e) throws URISyntaxException, MessageProcessingException, IOException, SLIClientException { URL url = URLBuilder.create(restClient.getBaseURL()).entityType(e.getEntityType()).id(e.getId()).build(); Re...
Entity e = new GenericEntity(ResourceNames.STUDENTS, studentData); Response r = mock(Response.class); when(r.getStatus()).thenReturn(204); when(restClient.putRequest(any(URL.class), anyString())).thenReturn(r); underTest.update(e); verify(restClient).putRequest(new URL("h...
[FOCAL] @Override public void BasicClient.update(Entity e) [CLASS] class BasicClient implements SLIClient [METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void checkResponse(Response response, Status status, String msg) [CALLS-EXTERNAL] URLBuilder.create(restClient.getBaseURL()).ent...
/* static context [FOCAL] @Override public void BasicClient.update(Entity e) [COLLABORATORS] field restClient:RESTClient getBaseURL/0,putRequest/2; param e:Entity getEntityType/0,getId/0; field mapper:ObjectMapper writeValueAsString/1 [EXCEPTIONS] declares URISyntaxException, MessageProcessingException, IOException, SL...
/* static context [FOCAL] @Override public void BasicClient.update(Entity e) [COLLABORATORS] field restClient:RESTClient getBaseURL/0,putRequest/2; param e:Entity getEntityType/0,getId/0; field mapper:ObjectMapper writeValueAsString/1 [EXCEPTIONS] declares URISyntaxException, MessageProcessingException, IOException, SL...
true
ok
{"focal": {"class": "BasicClient", "name": "update", "signature": "void update(Entity e) throws URISyntaxException, MessageProcessingException, IOException, SLIClientException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "e", "type": "Entity"}], "return_type": "void"}, "class_info": {"name": ...
5706983_1
class ChartSampleSearch { static public int findSampleLessOrEqual(ChartSampleSequence samples, double x) { synchronized (samples) { ChartSampleSearch binary = new ChartSampleSearch(); if (binary.search(samples, x)) return binary.mid; // Didn't...
double x; int i; // Exact find x = 4.0; i = ChartSampleSearch.findSampleLessOrEqual(samples, x); //System.out.println("Looking for " + x + ", found " + samples.get(i).getX()); assertTrue(i >= 0); assertTrue(i < samples.size()); assertTrue(samples....
[FOCAL] static public int ChartSampleSearch.findSampleLessOrEqual(ChartSampleSequence samples, double x) [CLASS] class ChartSampleSearch [METRICS] loc=17 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=2 [CALLS-EXTERNAL] ChartSampleSearch.search/2 [NEW] ChartSampleSearch [PATH1] if(binary.search(samples, x))=F -> if...
/* static context [FOCAL] static public int ChartSampleSearch.findSampleLessOrEqual(ChartSampleSequence samples, double x) [PATH1] if(binary.search(samples, x))=F -> if(binary.cmp < 0)=F -> if(binary.mid > 0)=T -> return binary.mid-1 [PATH2] if(binary.search(samples, x))=T -> return binary.mid [PATH3] if(binary.search(...
/* static context [FOCAL] static public int ChartSampleSearch.findSampleLessOrEqual(ChartSampleSequence samples, double x) [PATH1] if(binary.search(samples, x))=F -> if(binary.cmp < 0)=F -> if(binary.mid > 0)=T -> return binary.mid-1 [PATH2] if(binary.search(samples, x))=T -> return binary.mid [PATH3] if(binary.search(...
true
ok
{"focal": {"class": "ChartSampleSearch", "name": "findSampleLessOrEqual", "signature": "int findSampleLessOrEqual(ChartSampleSequence samples, double x)", "start_line": 3, "modifiers": "static public", "params": [{"name": "samples", "type": "ChartSampleSequence"}, {"name": "x", "type": "double"}], "return_type": "int"}...
5722110_54
class JTransfoImpl implements JTransfo, ConfigurableJTransfo, ConvertSourceTarget { @Override public <T> T convert(Object source, T target, String... tags) { if (null == source || null == target) { throw new JTransfoException("Source and target are required to be not-null."); } ...
when(reflectionHelper.newInstance(SimpleClassDomain.class)).thenReturn(null); JTransfoException exc = Assertions.assertThrows(JTransfoException.class, () -> jTransfo.convert(new SimpleClassNameTo())); assertThat(exc.getMessage()).startsWith("Cannot create instance of target cla...
[FOCAL] @Override public T JTransfoImpl.convert(Object source, T target, String... tags) [CLASS] class JTransfoImpl implements JTransfo, ConfigurableJTransfo, ConvertSourceTarget [METRICS] loc=20 cc=5 branches=4 loops=0 returns=1 throws=2 nesting=2 [CALLS-INTERNAL] Object replaceObject(Object object) [CALLS-EXTERNAL] t...
/* static context [FOCAL] @Override public T JTransfoImpl.convert(Object source, T target, String... tags) [THROWS-WHEN] JTransfoException when null == source || null == target [THROWS-WHEN] JTransfoException when !(null == source || null == target) && !toHelper.isTo(source) && !toHelper.isTo(target) [PATH1] if(null ==...
/* static context [FOCAL] @Override public T JTransfoImpl.convert(Object source, T target, String... tags) [THROWS-WHEN] JTransfoException when null == source || null == target [THROWS-WHEN] JTransfoException when !(null == source || null == target) && !toHelper.isTo(source) && !toHelper.isTo(target) [PATH1] if(null ==...
true
ok
{"focal": {"class": "JTransfoImpl", "name": "convert", "signature": "T convert(Object source, T target, String... tags)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "source", "type": "Object"}, {"name": "target", "type": "T"}, {"name": "tags", "type": "String..."}], "return_type": "T"}, "clas...
5726012_9
class MicrochipPotentiometerDeviceController { public DeviceControllerDeviceStatus getDeviceStatus() throws IOException { // get status from device int deviceStatus = read(MEMADDR_STATUS); // check formal criterias int reservedValue = deviceStatus & STATUS_RESERVED_MASK; if (reservedValue != STATUS_RESERV...
// test io-exception try { controller.getDeviceStatus(); fail("Excpected IOException (but there is no) because " + "I2CDevice-mock is not initialized yet!"); } catch (IOException e) { // expected } // test for proper write-argument -> see FIGURE 7-5 and TABLE 4-1 testForWriteAndRead((byt...
[FOCAL] public DeviceControllerDeviceStatus MicrochipPotentiometerDeviceController.getDeviceStatus() [CLASS] class MicrochipPotentiometerDeviceController [METRICS] loc=29 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] int read(byte memAddr) [CALLS-EXTERNAL] Integer.toString/2 [NEW] IOException, D...
/* static context [FOCAL] public DeviceControllerDeviceStatus MicrochipPotentiometerDeviceController.getDeviceStatus() [THROWS-WHEN] IOException when reservedValue != STATUS_RESERVED_VALUE [EXCEPTIONS] declares IOException; throws IOException [CALLS-INTERNAL] int read(byte memAddr) */
/* static context [FOCAL] public DeviceControllerDeviceStatus MicrochipPotentiometerDeviceController.getDeviceStatus() [THROWS-WHEN] IOException when reservedValue != STATUS_RESERVED_VALUE [EXCEPTIONS] declares IOException; throws IOException [CALLS-INTERNAL] int read(byte memAddr) */ class MicrochipPotentiometerDevice...
true
ok
{"focal": {"class": "MicrochipPotentiometerDeviceController", "name": "getDeviceStatus", "signature": "DeviceControllerDeviceStatus getDeviceStatus() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "DeviceControllerDeviceStatus"}, "class_info": {"name": "MicrochipPotentiometerD...
5745625_3
class ObjectQueue implements Iterable<T>, Closeable { public abstract int size()public abstract int size(); public abstract int size()public static ObjectQueue<T> create(QueueFile qf, Converter<T> converter); public abstract int size()public static ObjectQueue<T> createInMemory(); public abstract int size()public abs...
assertThat(queue.size()).isEqualTo(3); } }
[FOCAL] public abstract int ObjectQueue.size() [CLASS] class ObjectQueue implements Iterable<T>, Closeable [METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CLASS-MEMBERS] ObjectQueue<T> create(QueueFile qf, Converter<T> converter); ObjectQueue<T> createInMemory(); QueueFile file(); boolean isEmpty(...
/* static context [FOCAL] public abstract int ObjectQueue.size() */
/* static context [FOCAL] public abstract int ObjectQueue.size() */ class ObjectQueue implements Iterable<T>, Closeable { public abstract int size()public abstract int size(); public abstract int size()public static ObjectQueue<T> create(QueueFile qf, Converter<T> converter); public abstract int size()public static O...
true
partial
{"focal": {"class": "ObjectQueue", "name": "size", "signature": "int size()", "start_line": 3, "modifiers": "public abstract", "params": [], "return_type": "int"}, "class_info": {"name": "ObjectQueue", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Iterable<T>, Closeable", "fields": [{"name": "fol...
5754848_4
class TodoResource { @DELETE public void deleteAll() { dao.deleteAll(); } public TodoResource(TodoDao dao); @GET public List<Todo> list(); @GET @Path("{id}") public Todo get(@PathParam("id") String id); @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public Response create(@FormParam("email...
final String id = UUID.randomUUID().toString(); final Todo todo = Todo.newBuilder().id(id).created(new Date()).build(); dao.insert(todo); dao.insert(todo.toBuilder().id("dummy").build()); assertThat(dao.findAll()).hasSize(2); ClientResponse response = client().resource("/todos").delete(ClientR...
[FOCAL] @DELETE public void TodoResource.deleteAll() [CLASS] class TodoResource [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] TodoDao.deleteAll/0 [FIELDS] read=dao:TodoDao [COLLABORATORS] field dao:TodoDao deleteAll/0 [DATAFLOW] this.dao@param->L3 [CLASS-MEMBERS] TodoResource(Tod...
/* static context [FOCAL] @DELETE public void TodoResource.deleteAll() [COLLABORATORS] field dao:TodoDao deleteAll/0 [FIELDS] read=dao:TodoDao [CALLS-EXTERNAL] TodoDao.deleteAll/0 */
/* static context [FOCAL] @DELETE public void TodoResource.deleteAll() [COLLABORATORS] field dao:TodoDao deleteAll/0 [FIELDS] read=dao:TodoDao [CALLS-EXTERNAL] TodoDao.deleteAll/0 */ class TodoResource { @DELETE public void deleteAll() { dao.deleteAll(); } public TodoResource(TodoDao dao); @GET public...
true
ok
{"focal": {"class": "TodoResource", "name": "deleteAll", "signature": "void deleteAll()", "start_line": 3, "modifiers": "@DELETE public", "params": [], "return_type": "void"}, "class_info": {"name": "TodoResource", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "dao", "typ...
5770443_0
class EnumBuilder { public JDefinedClass build() { JPackage _package = determinePackage(); try { definedClass = _package._enum(typeName); } catch (JClassAlreadyExistsException e) { throw new RuntimeException(e.getExistingClass().fullName() + " is already defined in ...
SmiCodeNamingStrategy namingStrategy = new StraightNamingStrategy(""); SmiType type = new SmiType(new IdToken(null, "MyEnum"), new SmiModule(new SmiMib(null, null), new IdToken(null, "MyModule")), SmiPrimitiveType.ENUM); type.getModule().getMib().setCodeNamingStrategy(new StraightNamingStrategy(...
[FOCAL] public JDefinedClass EnumBuilder.build() [CLASS] class EnumBuilder [METRICS] loc=22 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] JPackage determinePackage(); void addConstructor(); void addEnumConstants(); void addFields(); void addInterfaces(); void addJavadocs(); void addNameGetter();...
/* static context [FOCAL] public JDefinedClass EnumBuilder.build() [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e.getExistingClass().fullName() + " is already... [PATH2] return definedClass [EXCEPTIONS] throws RuntimeException; catches JClassAlreadyExistsExce...
/* static context [FOCAL] public JDefinedClass EnumBuilder.build() [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e.getExistingClass().fullName() + " is already... [PATH2] return definedClass [EXCEPTIONS] throws RuntimeException; catches JClassAlreadyExistsExce...
true
ok
{"focal": {"class": "EnumBuilder", "name": "build", "signature": "JDefinedClass build()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "JDefinedClass"}, "class_info": {"name": "EnumBuilder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "codeModel"...
5793618_42
class ServiceLoader { public Collection<T> createAll(final Object... arguments) { Collection<T> instances = new ArrayList<T>(classes.size()); for (String className : classes) { T instance = createInstance(className, arguments); if (instance != null) { instances.add(instance); } } return instanc...
ServiceLoader<?> loader = new ServiceLoader<>(List.class); assertThat(loader.createAll()) .hasSize(2) .hasAtLeastOneElementOfType(ArrayList.class) .hasAtLeastOneElementOfType(LinkedList.class); } }
[FOCAL] public Collection<T> ServiceLoader.createAll(Object... arguments) [CLASS] class ServiceLoader [METRICS] loc=12 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] T createInstance(String className, Object... arguments) [CALLS-EXTERNAL] classes.size/0, Collection<T>.add/1 [NEW] ArrayList<T> [PA...
/* static context [FOCAL] public Collection<T> ServiceLoader.createAll(Object... arguments) [PATH1] foreach(String className : classes)=T -> if(instance != null)=T -> exit loop -> return instances [PATH2] foreach(String className : classes)=F -> return instances [PATH3] foreach(String className : classes)=T -> if(insta...
/* static context [FOCAL] public Collection<T> ServiceLoader.createAll(Object... arguments) [PATH1] foreach(String className : classes)=T -> if(instance != null)=T -> exit loop -> return instances [PATH2] foreach(String className : classes)=F -> return instances [PATH3] foreach(String className : classes)=T -> if(insta...
true
ok
{"focal": {"class": "ServiceLoader", "name": "createAll", "signature": "Collection<T> createAll(Object... arguments)", "start_line": 3, "modifiers": "public", "params": [{"name": "arguments", "type": "Object..."}], "return_type": "Collection<T>"}, "class_info": {"name": "ServiceLoader", "kind": "class", "modifiers": ""...
5793738_15
class TaskVariablesPayloadValidator { public CreateTaskVariablePayload handleCreateTaskVariablePayload(CreateTaskVariablePayload createTaskVariablePayload) { checkNotValidCharactersInVariableName(createTaskVariablePayload.getName(), "Variable has not a valid ...
//given CreateTaskVariablePayload payload = TaskPayloadBuilder.createVariable() .withVariable("date", "1970-01-01T01:01:01.001Z") .build(); //calculate number of milliseconds after 1970-01-01T00:00:00.000Z long time = Duration...
[FOCAL] public CreateTaskVariablePayload TaskVariablesPayloadValidator.handleCreateTaskVariablePayload(CreateTaskVariablePayload createTaskVariablePayload) [CLASS] class TaskVariablesPayloadValidator [METRICS] loc=11 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Optional<Date> handleAsDate(Strin...
/* static context [FOCAL] public CreateTaskVariablePayload TaskVariablesPayloadValidator.handleCreateTaskVariablePayload(CreateTaskVariablePayload createTaskVariablePayload) [PATH1] if(value instanceof String)=T -> return createTaskVariablePayload [PATH2] if(value instanceof String)=F -> return createTaskVariablePayloa...
/* static context [FOCAL] public CreateTaskVariablePayload TaskVariablesPayloadValidator.handleCreateTaskVariablePayload(CreateTaskVariablePayload createTaskVariablePayload) [PATH1] if(value instanceof String)=T -> return createTaskVariablePayload [PATH2] if(value instanceof String)=F -> return createTaskVariablePayloa...
true
ok
{"focal": {"class": "TaskVariablesPayloadValidator", "name": "handleCreateTaskVariablePayload", "signature": "CreateTaskVariablePayload handleCreateTaskVariablePayload(CreateTaskVariablePayload createTaskVariablePayload)", "start_line": 3, "modifiers": "public", "params": [{"name": "createTaskVariablePayload", "type": ...
5832036_1
class SetNetworkListAdapter extends AbstractListAdapter<Network> { @Override public void add(Network network) { switch (network.getType()) { case WIFI: addWiFi( network ); break; case CDMA: case GSM: case WCDMA: ...
SetBackedNetworkList netlist = new SetBackedNetworkList(); System.out.print("Inserting WiFi Large Set into SetBackedNetworkList..."); long start = System.currentTimeMillis(); netlist.addAll(wifiLarge); long end = System.currentTimeMillis(); System.out.println(" Inserted i...
[FOCAL] @Override public void SetNetworkListAdapter.add(Network network) [CLASS] class SetNetworkListAdapter extends AbstractListAdapter<Network> [METRICS] loc=20 cc=8 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void addBluetooth(Network n); void addBluetoothLe(Network n); void addCell(Network n); ...
/* static context [FOCAL] @Override public void SetNetworkListAdapter.add(Network network) [PATH1] switch(network.getType())=case WIFI [PATH2] switch(network.getType())=case LTE [PATH3] switch(network.getType())=case WCDMA [PATH4] switch(network.getType())=case GSM [PATH5] switch(network.getType())=case CDMA [PATH6] sw...
/* static context [FOCAL] @Override public void SetNetworkListAdapter.add(Network network) [PATH1] switch(network.getType())=case WIFI [PATH2] switch(network.getType())=case LTE [PATH3] switch(network.getType())=case WCDMA [PATH4] switch(network.getType())=case GSM [PATH5] switch(network.getType())=case CDMA [PATH6] sw...
true
ok
{"focal": {"class": "SetNetworkListAdapter", "name": "add", "signature": "void add(Network network)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "network", "type": "Network"}], "return_type": "void"}, "class_info": {"name": "SetNetworkListAdapter", "kind": "class", "modifiers": "", "superclas...
5839179_20
class PKPass implements Cloneable, Serializable { public String getForegroundColor() { return foregroundColor; } protected PKPass(); public String getSerialNumber(); public String getPassTypeIdentifier(); public URL getWebServiceURL(); public String getAppLaunchURL(); public ...
assertThat(this.builder .foregroundColor(COLOR_STRING) .build() .getForegroundColor()).isEqualTo(COLOR_STRING); assertThat(this.builder .foregroundColor((String) null) .build() .getForegroundColor()).isNull()...
[FOCAL] public String PKPass.getForegroundColor() [CLASS] class PKPass implements Cloneable, Serializable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] PKPass(); String getSerialNumber(); String getPassTypeIdentifier(); URL getWebServiceURL(); String getAppLaunchURL(); String getA...
/* static context [FOCAL] public String PKPass.getForegroundColor() */
/* static context [FOCAL] public String PKPass.getForegroundColor() */ class PKPass implements Cloneable, Serializable { public String getForegroundColor() { return foregroundColor; } protected PKPass(); public String getSerialNumber(); public String getPassTypeIdentifier(); public U...
true
ok
{"focal": {"class": "PKPass", "name": "getForegroundColor", "signature": "String getForegroundColor()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "PKPass", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Cloneable, Serializable", "fields"...
5841522_1
class JochreIndexBuilder implements Runnable, TokenExtractor { public void updateIndex() { long startTime = System.currentTimeMillis(); try { if (searchStatusHolder.getStatus() != SearchStatus.WAITING) { throw new IndexingUnderwayException(); } JochreSearchManager manager = JochreS...
System.setProperty("config.file", "src/test/resources/test.conf"); ConfigFactory.invalidateCaches(); String configId = "yiddish"; JochreIndexBuilder builder = new JochreIndexBuilder(configId, false); builder.updateIndex(); JochreSearchManager manager = JochreSearchManager.getInstance(configId)...
[FOCAL] public void JochreIndexBuilder.updateIndex() [CLASS] class JochreIndexBuilder implements Runnable, TokenExtractor [METRICS] loc=72 cc=12 branches=2 loops=1 returns=0 throws=5 nesting=4 [CALLS-INTERNAL] void processDocument(JochreSearchManager manager, IndexWriter indexWriter, File documentDir, boolean forceUpda...
/* static context [FOCAL] public void JochreIndexBuilder.updateIndex() [THROWS-WHEN] RuntimeException when try-body throws [THROWS-WHEN] e when try-body throws [THROWS-WHEN] RuntimeException when searchStatusHolder.getStatus() != SearchStatus.WAITING && throw new IndexingUnderwayException() [THROWS-WHEN] e when searchS...
/* static context [FOCAL] public void JochreIndexBuilder.updateIndex() [THROWS-WHEN] RuntimeException when try-body throws [THROWS-WHEN] e when try-body throws [THROWS-WHEN] RuntimeException when searchStatusHolder.getStatus() != SearchStatus.WAITING && throw new IndexingUnderwayException() [THROWS-WHEN] e when searchS...
true
ok
{"focal": {"class": "JochreIndexBuilder", "name": "updateIndex", "signature": "void updateIndex()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "JochreIndexBuilder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Runnable, TokenExtractor", "...
5853673_2
class OracleNamingStrategy extends ImprovedNamingStrategy { @Override public String classToTableName(String className) { return super.classToTableName(className).toUpperCase(); } @Override public String propertyToColumnName(String propertyName); @Override public String tableName(String tableName); @Ov...
OracleNamingStrategy namingStrategy = new OracleNamingStrategy(); for (int i = 0; i < classNames.length; i++) { String tableName = namingStrategy.classToTableName(classNames[i]); assertThat(tableName).isEqualTo(tableNames[i].toUpperCase()); } } }
[FOCAL] @Override public String OracleNamingStrategy.classToTableName(String className) [CLASS] class OracleNamingStrategy extends ImprovedNamingStrategy [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] super.classToTableName(className).toUpperCase/0, ImprovedNamingStrategy.classToT...
/* static context [FOCAL] @Override public String OracleNamingStrategy.classToTableName(String className) [INPUTS] branches=- | result=className [CALLS-EXTERNAL] super.classToTableName(className).toUpperCase/0, ImprovedNamingStrategy.classToTableName/1 */
/* static context [FOCAL] @Override public String OracleNamingStrategy.classToTableName(String className) [INPUTS] branches=- | result=className [CALLS-EXTERNAL] super.classToTableName(className).toUpperCase/0, ImprovedNamingStrategy.classToTableName/1 */ class OracleNamingStrategy extends ImprovedNamingStrategy { @...
true
ok
{"focal": {"class": "OracleNamingStrategy", "name": "classToTableName", "signature": "String classToTableName(String className)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "className", "type": "String"}], "return_type": "String"}, "class_info": {"name": "OracleNamingStrategy", "kind": "class...
5861549_2
class GeneratePnPObservation { boolean renderMarker(List<Point3D_F64> marker, Se3_F64 BodyToCamera, List<Point2D_F64> pixels) { Point3D_F64 p3 = new Point3D_F64(); for (int indexCorner = 0; indexCorner < marker.size(); indexCorner++) { BodyToCamera.transform(marker.get(indexCorner), p3)...
GeneratePnPObservation generator = new GeneratePnPObservation(60,640,480); generator.random = new Random(1234); generator.stdevPixel = 0; List<Point3D_F64> marker = new ArrayList<>(); Se3_F64 BodyToCamera = SpecialEuclideanOps_F64.eulerXyz(0,0,5,0,0,0,null); marker.add(...
[FOCAL] boolean GeneratePnPObservation.renderMarker(List<Point3D_F64> marker, Se3_F64 BodyToCamera, List<Point2D_F64> pixels) [CLASS] class GeneratePnPObservation [METRICS] loc=22 cc=5 branches=3 loops=1 returns=4 throws=0 nesting=2 [CALLS-EXTERNAL] List<Point3D_F64>.size/0, Se3_F64.transform/2, List<Point3D_F64>.get/1...
/* static context [FOCAL] boolean GeneratePnPObservation.renderMarker(List<Point3D_F64> marker, Se3_F64 BodyToCamera, List<Point2D_F64> pixels) [PATH1] for(indexCorner < marker.size())=T -> if(p3.z <= 0)=F -> if(pixel.x < 0 || pixel.x >= imageWidth - 1)=F -> if(pixel.y < 0 || pixel.y >= imageHeight - 1)=F -> exit loop ...
/* static context [FOCAL] boolean GeneratePnPObservation.renderMarker(List<Point3D_F64> marker, Se3_F64 BodyToCamera, List<Point2D_F64> pixels) [PATH1] for(indexCorner < marker.size())=T -> if(p3.z <= 0)=F -> if(pixel.x < 0 || pixel.x >= imageWidth - 1)=F -> if(pixel.y < 0 || pixel.y >= imageHeight - 1)=F -> exit loop ...
true
ok
{"focal": {"class": "GeneratePnPObservation", "name": "renderMarker", "signature": "boolean renderMarker(List<Point3D_F64> marker, Se3_F64 BodyToCamera, List<Point2D_F64> pixels)", "start_line": 3, "modifiers": "", "params": [{"name": "marker", "type": "List<Point3D_F64>"}, {"name": "BodyToCamera", "type": "Se3_F64"}, ...
5874016_2
class LexicalAlignerFromLexicalResource implements AlignmentComponent { @Override public void annotate(JCas aJCas) throws AlignmentComponentException { // get T lemma sequence as one single string String tLemmaSeq = null; // TEXTVIEW Lemma sequences (ordered) as one string, for quick existence check // S...
try { // Annotate the first pair with tokens and lemmas logger.info("Tokenize and lemmatize the sentence pair #1"); JCas pair1 = lap.generateSingleTHPairCAS(t1, h1); // Call the aligner to align T and H of pair 1 logger.info("Aligning pair #1"); alignerWordNetEN.annotate(pair1); lo...
[FOCAL] @Override public void LexicalAlignerFromLexicalResource.annotate(JCas aJCas) [CLASS] class LexicalAlignerFromLexicalResource implements AlignmentComponent [METRICS] loc=56 cc=6 branches=1 loops=2 returns=0 throws=2 nesting=4 [CALLS-INTERNAL] List<Lemma[]> getAllPossibleCandidates(JCas aView); String getLemmasAs...
class LexicalAlignerFromLexicalResource implements AlignmentComponent { @Override public void annotate(JCas aJCas) throws AlignmentComponentException { // get T lemma sequence as one single string String tLemmaSeq = null; // TEXTVIEW Lemma sequences (ordered) as one string, for quick existence check // S...
false
ok
{"focal": {"class": "LexicalAlignerFromLexicalResource", "name": "annotate", "signature": "void annotate(JCas aJCas) throws AlignmentComponentException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "aJCas", "type": "JCas"}], "return_type": "void"}, "class_info": {"name": "LexicalAlignerFromLex...
5947247_22
class CoordinateSequence2D implements CoordinateSequence, Cloneable { public void setOrdinate(int index, int ordinateIndex, double value) { switch (ordinateIndex) { case 0: x[index] = value; break; case 1: y[index] = value; ...
CoordinateSequence2D cs = new CoordinateSequence2D(2); cs.setOrdinate(0, 0, 1.1); cs.setOrdinate(0, 1, 1.2); cs.setOrdinate(1, 0, 2.1); cs.setOrdinate(1, 1, 2.2); assertEquals(1.1, cs.getX(0), TOL); assertEquals(1.2, cs.getY(0), TOL); ass...
[FOCAL] public void CoordinateSequence2D.setOrdinate(int index, int ordinateIndex, double value) [CLASS] class CoordinateSequence2D implements CoordinateSequence, Cloneable [METRICS] loc=14 cc=3 branches=1 loops=0 returns=0 throws=1 nesting=1 [NEW] IllegalArgumentException [EXCEPTIONS] throws IllegalArgumentException [...
/* static context [FOCAL] public void CoordinateSequence2D.setOrdinate(int index, int ordinateIndex, double value) [THROWS-WHEN] IllegalArgumentException when switch(ordinateIndex)=default [PATH1] switch(ordinateIndex)=default -> throw new IllegalArgumentException("invalid ordinate index: " + ordinateI... [PATH2] switc...
/* static context [FOCAL] public void CoordinateSequence2D.setOrdinate(int index, int ordinateIndex, double value) [THROWS-WHEN] IllegalArgumentException when switch(ordinateIndex)=default [PATH1] switch(ordinateIndex)=default -> throw new IllegalArgumentException("invalid ordinate index: " + ordinateI... [PATH2] switc...
true
ok
{"focal": {"class": "CoordinateSequence2D", "name": "setOrdinate", "signature": "void setOrdinate(int index, int ordinateIndex, double value)", "start_line": 3, "modifiers": "public", "params": [{"name": "index", "type": "int"}, {"name": "ordinateIndex", "type": "int"}, {"name": "value", "type": "double"}], "return_typ...
5970660_5
class ICalVCardHelper { public String createDate(Date d) { // Shift the timezone to UTC SimpleDateFormat dateFormatter = new SimpleDateFormat(YEAR_MONTH_DAY_FORMAT); dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC")); // ICal DATE pattern: <yyyyMMdd> return dateFormatter.format(d); } pub...
ICalVCardHelper helper = BEANS.get(ICalVCardHelper.class); Calendar cal = Calendar.getInstance(); cal.setTimeZone(TimeZone.getTimeZone("GMT")); cal.set(2019, 7, 23, 15, 22, 00); // month is 0 based 8 (august) assertEquals("20190823", helper.createDate(cal.getTime())); } }
[FOCAL] public String ICalVCardHelper.createDate(Date d) [CLASS] class ICalVCardHelper [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] SimpleDateFormat.setTimeZone/1, TimeZone.getTimeZone/1, SimpleDateFormat.format/1 [NEW] SimpleDateFormat [INPUTS] branches=- | result=d [DATAFLOW] ...
/* static context [FOCAL] public String ICalVCardHelper.createDate(Date d) [INPUTS] branches=- | result=d [NEW] SimpleDateFormat [CALLS-EXTERNAL] SimpleDateFormat.setTimeZone/1, TimeZone.getTimeZone/1, SimpleDateFormat.format/1 */
/* static context [FOCAL] public String ICalVCardHelper.createDate(Date d) [INPUTS] branches=- | result=d [NEW] SimpleDateFormat [CALLS-EXTERNAL] SimpleDateFormat.setTimeZone/1, TimeZone.getTimeZone/1, SimpleDateFormat.format/1 */ class ICalVCardHelper { public String createDate(Date d) { // Shift the timezone t...
true
ok
{"focal": {"class": "ICalVCardHelper", "name": "createDate", "signature": "String createDate(Date d)", "start_line": 3, "modifiers": "public", "params": [{"name": "d", "type": "Date"}], "return_type": "String"}, "class_info": {"name": "ICalVCardHelper", "kind": "class", "modifiers": "", "superclass": null, "interfaces"...
5973879_0
class ContentTypeValidator implements StorageItemBeforeSave { @Override public void beforeSave(StorageItem storageItem, StorageItemUploadPart part) throws IOException { if (part == null) { return; } String fileContentType = part.getContentType(); if (fileContentTy...
validator.beforeSave(null, null); verify(part, times(0)).getContentType(); } }
[FOCAL] @Override public void ContentTypeValidator.beforeSave(StorageItem storageItem, StorageItemUploadPart part) [CLASS] class ContentTypeValidator implements StorageItemBeforeSave [METRICS] loc=71 cc=6 branches=5 loops=0 returns=3 throws=1 nesting=3 [CALLS-EXTERNAL] StorageItemUploadPart.getContentType/0, Settings.g...
/* static context [FOCAL] @Override public void ContentTypeValidator.beforeSave(StorageItem storageItem, StorageItemUploadPart part) [THROWS-WHEN] IOException when !(part == null) && !(fileContentType == null) && !contentTypeGroups.contains("text/html") && !(part.getFile() == null) && (ptr.startsWith("<!") || ptr.start...
/* static context [FOCAL] @Override public void ContentTypeValidator.beforeSave(StorageItem storageItem, StorageItemUploadPart part) [THROWS-WHEN] IOException when !(part == null) && !(fileContentType == null) && !contentTypeGroups.contains("text/html") && !(part.getFile() == null) && (ptr.startsWith("<!") || ptr.start...
true
ok
{"focal": {"class": "ContentTypeValidator", "name": "beforeSave", "signature": "void beforeSave(StorageItem storageItem, StorageItemUploadPart part) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "storageItem", "type": "StorageItem"}, {"name": "part", "type": "StorageItemUplo...
5999841_31
class LogEntryDAOMysqlImpl extends AbstractTableCreatingDAOImpl implements LogEntryDAO { public List<LogEntry> getLogEntriesForTenant(int tenantId, int offset, int limit) { Preconditions.checkArgument(offset >= 0, "offset must be greater than or equal to 0"); Preconditions.checkArgument(limit >= 0,...
List<LogEntry> logEntries = logEntryDAO.getLogEntriesForTenant(1, 0, 0); assertThat(logEntries, is(not(nullValue()))); assertThat(logEntries.size(), is(0)); } }
[FOCAL] public List<LogEntry> LogEntryDAOMysqlImpl.getLogEntriesForTenant(int tenantId, int offset, int limit) [CLASS] class LogEntryDAOMysqlImpl extends AbstractTableCreatingDAOImpl implements LogEntryDAO [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Preconditions.checkArgument/...
/* static context [FOCAL] public List<LogEntry> LogEntryDAOMysqlImpl.getLogEntriesForTenant(int tenantId, int offset, int limit) [INPUTS] branches=- | result=limit, offset, tenantId [COLLABORATORS] field getLogEntriesForTenant execute/3 [CALLS-EXTERNAL] Preconditions.checkArgument/2, getLogEntriesForTenant.execute/3 */...
/* static context [FOCAL] public List<LogEntry> LogEntryDAOMysqlImpl.getLogEntriesForTenant(int tenantId, int offset, int limit) [INPUTS] branches=- | result=limit, offset, tenantId [COLLABORATORS] field getLogEntriesForTenant execute/3 [CALLS-EXTERNAL] Preconditions.checkArgument/2, getLogEntriesForTenant.execute/3 */...
true
ok
{"focal": {"class": "LogEntryDAOMysqlImpl", "name": "getLogEntriesForTenant", "signature": "List<LogEntry> getLogEntriesForTenant(int tenantId, int offset, int limit)", "start_line": 3, "modifiers": "public", "params": [{"name": "tenantId", "type": "int"}, {"name": "offset", "type": "int"}, {"name": "limit", "type": "i...
6002930_4
class MapNotSerializable extends FieldConstraint { @Override protected void check(MappedClass mc, MappedField mf, Set<ConstraintViolation> ve) { if (mf.isMap()) { if (mf.hasAnnotation(Serialized.class)) { Class<?> keyClass = ReflectionUtils.getParameterizedClass(mf.getField(...
morphia.map(Map1.class); new AssertedFailure() { public void thisMustFail() throws Throwable { morphia.map(Map2.class); } }; new AssertedFailure() { public void thisMustFail() throws Throwable { morphia.map(Map3.class); } }; } }
[FOCAL] @Override protected void MapNotSerializable.check(MappedClass mc, MappedField mf, Set<ConstraintViolation> ve) [CLASS] class MapNotSerializable extends FieldConstraint [METRICS] loc=19 cc=7 branches=6 loops=0 returns=0 throws=0 nesting=4 [CALLS-EXTERNAL] MappedField.isMap/0, MappedField.hasAnnotation/1, Reflect...
/* static context [FOCAL] @Override protected void MapNotSerializable.check(MappedClass mc, MappedField mf, Set<ConstraintViolation> ve) [PATH1] if(mf.isMap())=T -> if(mf.hasAnnotation(Serialized.class))=T -> if(keyClass != null)=T -> if(!Serializable.class.isAssignableFrom(keyClass))#1=T -> if(valueClass != null)=T ->...
/* static context [FOCAL] @Override protected void MapNotSerializable.check(MappedClass mc, MappedField mf, Set<ConstraintViolation> ve) [PATH1] if(mf.isMap())=T -> if(mf.hasAnnotation(Serialized.class))=T -> if(keyClass != null)=T -> if(!Serializable.class.isAssignableFrom(keyClass))#1=T -> if(valueClass != null)=T ->...
true
ok
{"focal": {"class": "MapNotSerializable", "name": "check", "signature": "void check(MappedClass mc, MappedField mf, Set<ConstraintViolation> ve)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "mc", "type": "MappedClass"}, {"name": "mf", "type": "MappedField"}, {"name": "ve", "type": "Set<Con...
6010090_33
class Registry { public Collection<Link> getAll() { return links; } public Registry(final String name, final String title, final List<Link> links); public String getName(); public String getTitle(); public Link findByHref(final URI href); public Link asLinkFor(final URI baseUri);...
final Registry registry = new Registry("foo", "", Collections.<Link>emptyList()); assertTrue(registry.getAll().isEmpty()); } }
[FOCAL] public Collection<Link> Registry.getAll() [CLASS] class Registry [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Registry(String name, String title, List<Link> links); String getName(); String getTitle(); Link findByHref(URI href); Link asLinkFor(URI baseUri) [TEST] Registry...
/* static context [FOCAL] public Collection<Link> Registry.getAll() */
/* static context [FOCAL] public Collection<Link> Registry.getAll() */ class Registry { public Collection<Link> getAll() { return links; } public Registry(final String name, final String title, final List<Link> links); public String getName(); public String getTitle(); public Link fi...
true
ok
{"focal": {"class": "Registry", "name": "getAll", "signature": "Collection<Link> getAll()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Collection<Link>"}, "class_info": {"name": "Registry", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"n...
6017453_1
class Exceptions { public static <T extends Throwable> T anyCauseOf(Throwable ex, Class<T> type) { if (type.isInstance(ex)) { return (T) ex; } Throwable cause = ex.getCause(); if (cause != null) { return anyCauseOf(cause, type); } return null; } private Exceptions(); public static Throwable r...
A top=new A("a",new B("b",new D("d",new B("root")))); Throwable anyCauseOf = Exceptions.anyCauseOf(top,B.class); Assert.assertEquals("type", B.class,anyCauseOf.getClass()); Assert.assertEquals("message", "b",anyCauseOf.getMessage()); anyCauseOf = Exceptions.anyCauseOf(top,C.class); Assert.assert...
[FOCAL] public static T Exceptions.anyCauseOf(Throwable ex, Class<T> type) [CLASS] class Exceptions [METRICS] loc=11 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] Class<T>.isInstance/1, Throwable.getCause/0, anyCauseOf/2 (inherited) [PATH1] if(type.isInstance(ex))=F -> if(cause != null)=T -> ret...
/* static context [FOCAL] public static T Exceptions.anyCauseOf(Throwable ex, Class<T> type) [PATH1] if(type.isInstance(ex))=F -> if(cause != null)=T -> return anyCauseOf(cause, type) [PATH2] if(type.isInstance(ex))=T -> return (T) ex [PATH3] if(type.isInstance(ex))=F -> if(cause != null)=F -> return null [INPUTS] bran...
/* static context [FOCAL] public static T Exceptions.anyCauseOf(Throwable ex, Class<T> type) [PATH1] if(type.isInstance(ex))=F -> if(cause != null)=T -> return anyCauseOf(cause, type) [PATH2] if(type.isInstance(ex))=T -> return (T) ex [PATH3] if(type.isInstance(ex))=F -> if(cause != null)=F -> return null [INPUTS] bran...
true
ok
{"focal": {"class": "Exceptions", "name": "anyCauseOf", "signature": "T anyCauseOf(Throwable ex, Class<T> type)", "start_line": 3, "modifiers": "public static", "params": [{"name": "ex", "type": "Throwable"}, {"name": "type", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "Exceptions", "kind": "class...
6022685_4
class BitmapUtil { public static Picture fromBitmap(Bitmap src) { return inst().fromBitmapImpl(src); } private static BitmapUtil inst(); public static void fromBitmap(Bitmap src, Picture dst); public static Bitmap toBitmap(Picture pic); public static void toBitmap(Picture src, Bitmap d...
Bitmap src = mock(Bitmap.class); when(src.getWidth()).thenReturn(16); when(src.getHeight()).thenReturn(16); doAnswer(new Answer<Void>() { @Override public Void answer(InvocationOnMock invocation) throws Throwable { int[] pix = invocation.getArgumen...
[FOCAL] public static Picture BitmapUtil.fromBitmap(Bitmap src) [CLASS] class BitmapUtil [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] BitmapUtil inst() [CALLS-EXTERNAL] inst().fromBitmapImpl/1 [INPUTS] branches=- | result=src [DATAFLOW] src@param->L2 [CLASS-MEMBERS] BitmapUtil i...
/* static context [FOCAL] public static Picture BitmapUtil.fromBitmap(Bitmap src) [INPUTS] branches=- | result=src [CALLS-INTERNAL] BitmapUtil inst() [CALLS-EXTERNAL] inst().fromBitmapImpl/1 */
/* static context [FOCAL] public static Picture BitmapUtil.fromBitmap(Bitmap src) [INPUTS] branches=- | result=src [CALLS-INTERNAL] BitmapUtil inst() [CALLS-EXTERNAL] inst().fromBitmapImpl/1 */ class BitmapUtil { public static Picture fromBitmap(Bitmap src) { return inst().fromBitmapImpl(src); } p...
true
ok
{"focal": {"class": "BitmapUtil", "name": "fromBitmap", "signature": "Picture fromBitmap(Bitmap src)", "start_line": 3, "modifiers": "public static", "params": [{"name": "src", "type": "Bitmap"}], "return_type": "Picture"}, "class_info": {"name": "BitmapUtil", "kind": "class", "modifiers": "", "superclass": null, "inte...
6064729_0
class HazelcastSerializedBroadcaster extends HazelcastBroadcaster { @Override public void outgoingBroadcast(Object message) { getTopic().publish(message); } } class HazelcastSerializedBroadcasterTest { @Test public void test() {
HazelcastSerializedBroadcaster hazelcastSerializedBroadcaster = spy(new HazelcastSerializedBroadcaster()); ITopic topic = mock(ITopic.class); when(hazelcastSerializedBroadcaster.getTopic()).thenReturn(topic); Object message = new Object(); hazelcastSerializedBroadcaster.outgoingB...
[FOCAL] @Override public void HazelcastSerializedBroadcaster.outgoingBroadcast(Object message) [CLASS] class HazelcastSerializedBroadcaster extends HazelcastBroadcaster [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] getTopic().publish/1, getTopic/0 (inherited) [DATAFLOW] message@p...
/* static context [FOCAL] @Override public void HazelcastSerializedBroadcaster.outgoingBroadcast(Object message) [CALLS-EXTERNAL] getTopic().publish/1, getTopic/0 (inherited) */
/* static context [FOCAL] @Override public void HazelcastSerializedBroadcaster.outgoingBroadcast(Object message) [CALLS-EXTERNAL] getTopic().publish/1, getTopic/0 (inherited) */ class HazelcastSerializedBroadcaster extends HazelcastBroadcaster { @Override public void outgoingBroadcast(Object message) { ...
true
ok
{"focal": {"class": "HazelcastSerializedBroadcaster", "name": "outgoingBroadcast", "signature": "void outgoingBroadcast(Object message)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "message", "type": "Object"}], "return_type": "void"}, "class_info": {"name": "HazelcastSerializedBroadcaster", ...
6090885_1
class RequestHandlerUtil { public static List<String> getGroups(String path, String regex) { List<String> captures = new ArrayList<String>(); Matcher m = Pattern.compile(regex).matcher(path); if (m.lookingAt()) { for (int i = 1; i <= m.groupCount(); i++) { if (m...
List<String> result = RequestHandlerUtil.getGroups("/createStream/2", CreateStreamRequestHandler.PATH_REGEX); assertEquals("one captures expected", 1, result.size()); assertEquals("First is '2'", "2", result.get(0)); } }
[FOCAL] public static List<String> RequestHandlerUtil.getGroups(String path, String regex) [CLASS] class RequestHandlerUtil [METRICS] loc=11 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] Pattern.compile(regex).matcher/1, Pattern.compile/1, Matcher.lookingAt/0, Matcher.groupCount/0, Matcher.group...
/* static context [FOCAL] public static List<String> RequestHandlerUtil.getGroups(String path, String regex) [PATH1] if(m.lookingAt())=T -> for(i <= m.groupCount())=T -> if(m.group(i) != null)=T -> exit loop -> return captures [PATH2] if(m.lookingAt())=F -> return captures [PATH3] if(m.lookingAt())=T -> for(i <= m.grou...
/* static context [FOCAL] public static List<String> RequestHandlerUtil.getGroups(String path, String regex) [PATH1] if(m.lookingAt())=T -> for(i <= m.groupCount())=T -> if(m.group(i) != null)=T -> exit loop -> return captures [PATH2] if(m.lookingAt())=F -> return captures [PATH3] if(m.lookingAt())=T -> for(i <= m.grou...
true
ok
{"focal": {"class": "RequestHandlerUtil", "name": "getGroups", "signature": "List<String> getGroups(String path, String regex)", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "String"}, {"name": "regex", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "Req...
6092163_487
class SocketServerInstanceImpl implements SocketServerInstance { @Override public synchronized <T> T getService(Class<T> iface) { Object service = this.serviceMap.get(iface); if (service == null) { service = Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface...
final FakeObjectChannel channel = new FakeObjectChannel(Arrays.asList(new Handshake(), new SocketTimeoutException())); SocketServerInstanceImpl instance = createInstance(channel); //no remote server is hooked up, so this will timeout ILogon logon = instance.getService(ILogon.class); ...
[FOCAL] @Override public synchronized T SocketServerInstanceImpl.getService(Class<T> iface) [CLASS] class SocketServerInstanceImpl implements SocketServerInstance [METRICS] loc=14 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] this.serviceMap.get/1, Proxy.newProxyInstance/3, this.getClass().getCl...
/* static context [FOCAL] @Override public synchronized T SocketServerInstanceImpl.getService(Class<T> iface) [PATH1] if(service == null)=T -> return iface.cast(service) [PATH2] if(service == null)=F -> return iface.cast(service) [INPUTS] branches=iface | result=iface [COLLABORATORS] field serviceMap get/1,put/2; param...
/* static context [FOCAL] @Override public synchronized T SocketServerInstanceImpl.getService(Class<T> iface) [PATH1] if(service == null)=T -> return iface.cast(service) [PATH2] if(service == null)=F -> return iface.cast(service) [INPUTS] branches=iface | result=iface [COLLABORATORS] field serviceMap get/1,put/2; param...
true
ok
{"focal": {"class": "SocketServerInstanceImpl", "name": "getService", "signature": "T getService(Class<T> iface)", "start_line": 3, "modifiers": "@Override public synchronized", "params": [{"name": "iface", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "SocketServerInstanceImpl", "kind": "class", "m...
6104876_0
class DeviceHeader { @Override public String toString() { StringBuffer outBuf = new StringBuffer(); outBuf.append(this.DeviceType.name()); outBuf.append(": MAC(" + this.GetMacAddressString() + "), "); outBuf.append("IP(" + this.IpAddress.toString() + "), "); outBuf.append("Protocol Ver(" + this...
byte[] headerPacket = { (byte) 0x00, (byte) 0x02, (byte) 0xf7, (byte) 0xf0, (byte) 0xc0, (byte) 0x99, (byte) 0x0a, (byte) 0x49, (byte) 0x26, (byte) 0xa6, (byte) 0x02, (byte) 0x01, (byte) 0x02, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0x03, (byte) 0x00, ...
[FOCAL] @Override public String DeviceHeader.toString() [CLASS] class DeviceHeader [METRICS] loc=14 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String GetMacAddressString() [CALLS-EXTERNAL] StringBuffer.append/1, this.DeviceType.name/0, this.IpAddress.toString/0, StringBuffer.toString/0 [NEW] ...
/* static context [FOCAL] @Override public String DeviceHeader.toString() [CALLS-INTERNAL] String GetMacAddressString() [FIELDS] read=DeviceType, HardwareRevision, IpAddress, LinkSpeed, ProductId, ProtocolVersion, SoftwareRevision, VendorId [NEW] StringBuffer [CALLS-EXTERNAL] StringBuffer.append/1, this.DeviceType.name...
/* static context [FOCAL] @Override public String DeviceHeader.toString() [CALLS-INTERNAL] String GetMacAddressString() [FIELDS] read=DeviceType, HardwareRevision, IpAddress, LinkSpeed, ProductId, ProtocolVersion, SoftwareRevision, VendorId [NEW] StringBuffer [CALLS-EXTERNAL] StringBuffer.append/1, this.DeviceType.name...
true
ok
{"focal": {"class": "DeviceHeader", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "DeviceHeader", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{...
6114161_12
class MathUtil { public static long getPercentile(List<Long> longList, int p, long defaultValue) { if (longList == null || longList.isEmpty()) { return defaultValue; } if (p < 0 || p > 100) { return defaultValue; } int size = longList.size(); if (((long) size * (long) p) % 100L == 0) { // 割り切...
List<Long> list = Arrays.asList(new Long[] { 2L, 4L, 6L, 8L, 10L, 12L, 14L, 16L, 18L, 19L }); assertEquals(18L, MathUtil.getPercentile(list, 90, 0L)); } }
[FOCAL] public static long MathUtil.getPercentile(List<Long> longList, int p, long defaultValue) [CLASS] class MathUtil [METRICS] loc=30 cc=5 branches=4 loops=0 returns=4 throws=0 nesting=2 [CALLS-EXTERNAL] List<Long>.isEmpty/0, List<Long>.size/0, List<Long>.get/1 [PATH1] if(longList == null || longList.isEmpty())=F ->...
/* static context [FOCAL] public static long MathUtil.getPercentile(List<Long> longList, int p, long defaultValue) [PATH1] if(longList == null || longList.isEmpty())=F -> if(p < 0 || p > 100)=F -> if(((long) size * (long) p) % 100L == 0)=F -> if(n >= size)=T -> return longList.get(n) [PATH2] if(longList == null || long...
/* static context [FOCAL] public static long MathUtil.getPercentile(List<Long> longList, int p, long defaultValue) [PATH1] if(longList == null || longList.isEmpty())=F -> if(p < 0 || p > 100)=F -> if(((long) size * (long) p) % 100L == 0)=F -> if(n >= size)=T -> return longList.get(n) [PATH2] if(longList == null || long...
true
ok
{"focal": {"class": "MathUtil", "name": "getPercentile", "signature": "long getPercentile(List<Long> longList, int p, long defaultValue)", "start_line": 3, "modifiers": "public static", "params": [{"name": "longList", "type": "List<Long>"}, {"name": "p", "type": "int"}, {"name": "defaultValue", "type": "long"}], "retur...