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
11543457_128
class FeedLocationStore implements ConfigurationChangeListener { public static FeedLocationStore get(){ return instance; } private FeedLocationStore(); @Override public void onAdd(Entity entity); @Override public void onRemove(Entity entity); @Override public void onChange(Entity old...
Feed f1 = createFeed("f1SameLocations"); int initialSize = FeedLocationStore.get().store.getSize(); f1.getLocations().getLocations().add(createLocation(LocationType.DATA, "/projects/cas/data/hourly/2014/09/09/09")); f1.getLocations().getLocations().add(createLocation(Loca...
[FOCAL] public static FeedLocationStore FeedLocationStore.get() [CLASS] class FeedLocationStore implements ConfigurationChangeListener [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] FeedLocationStore(); void onAdd(Entity entity); void onRemove(Entity entity); void onChange(Entity o...
/* static context [FOCAL] public static FeedLocationStore FeedLocationStore.get() */
/* static context [FOCAL] public static FeedLocationStore FeedLocationStore.get() */ class FeedLocationStore implements ConfigurationChangeListener { public static FeedLocationStore get(){ return instance; } private FeedLocationStore(); @Override public void onAdd(Entity entity); @Overri...
true
ok
{"focal": {"class": "FeedLocationStore", "name": "get", "signature": "FeedLocationStore get()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "FeedLocationStore"}, "class_info": {"name": "FeedLocationStore", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Configuration...
11543691_11
class SystemPropertiesConfig implements Config { @Override public List<Path> getClasspath() { String classpath = p.getProperty(CLASSPATH); if (classpath != null) { return parsePathList(classpath); } String classpathFile = p.getProperty(CLASSPATH_FILE); if (cl...
Path file = tempDir.newFile("classpath.txt").toPath(); Files.write(file, Arrays.asList("", "", "")); // empty lines are ignored systemProperties.setProperty(RetrolambdaApi.CLASSPATH_FILE, file.toString()); assertThat("zero values", config().getClasspath(), is(empty())); Files.w...
[FOCAL] @Override public List<Path> SystemPropertiesConfig.getClasspath() [CLASS] class SystemPropertiesConfig implements Config [METRICS] loc=12 cc=3 branches=2 loops=0 returns=2 throws=1 nesting=1 [CALLS-INTERNAL] List<Path> parsePathList(String paths); List<Path> readPathList(Path file) [CALLS-EXTERNAL] p.getPropert...
/* static context [FOCAL] @Override public List<Path> SystemPropertiesConfig.getClasspath() [THROWS-WHEN] IllegalArgumentException when !(classpath != null) && !(classpathFile != null) [PATH1] if(classpath != null)=F -> if(classpathFile != null)=T -> return readPathList(Paths.get(classpathFile)) [PATH2] if(classpath !=...
/* static context [FOCAL] @Override public List<Path> SystemPropertiesConfig.getClasspath() [THROWS-WHEN] IllegalArgumentException when !(classpath != null) && !(classpathFile != null) [PATH1] if(classpath != null)=F -> if(classpathFile != null)=T -> return readPathList(Paths.get(classpathFile)) [PATH2] if(classpath !=...
true
ok
{"focal": {"class": "SystemPropertiesConfig", "name": "getClasspath", "signature": "List<Path> getClasspath()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<Path>"}, "class_info": {"name": "SystemPropertiesConfig", "kind": "class", "modifiers": "", "superclass": null, "interfaces...
11558041_0
class MobileVideoService implements VideoService, Serializable { @Override public MobileSeries[] getAllSeries() throws VideoServiceException { try { return httpClient.get(new URL(MOBILE_URL + "keyword=index&d=" + idevice.getDeviceId()), MobileSeries[].class); } catch (MalformedURLException e) { throw ...
MobileSeries[] series = service.getAllSeries(); assertNotNull(series); } }
[FOCAL] @Override public MobileSeries[] MobileVideoService.getAllSeries() [CLASS] class MobileVideoService implements VideoService, Serializable [METRICS] loc=13 cc=4 branches=0 loops=0 returns=1 throws=3 nesting=1 [CALLS-EXTERNAL] httpClient.get/2, idevice.getDeviceId/0 [NEW] URL, VideoServiceException [EXCEPTIONS] de...
/* static context [FOCAL] @Override public MobileSeries[] MobileVideoService.getAllSeries() [THROWS-WHEN] VideoServiceException when try-body throws [PATH1] try-body throws -> throw new VideoServiceException(e) [PATH2] return httpClient.get(new URL(MOBILE_URL + "keyword=index&d=" + idevice.ge... [COLLABORATORS] field h...
/* static context [FOCAL] @Override public MobileSeries[] MobileVideoService.getAllSeries() [THROWS-WHEN] VideoServiceException when try-body throws [PATH1] try-body throws -> throw new VideoServiceException(e) [PATH2] return httpClient.get(new URL(MOBILE_URL + "keyword=index&d=" + idevice.ge... [COLLABORATORS] field h...
true
ok
{"focal": {"class": "MobileVideoService", "name": "getAllSeries", "signature": "MobileSeries[] getAllSeries() throws VideoServiceException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "MobileSeries[]"}, "class_info": {"name": "MobileVideoService", "kind": "class", "modifiers": "", "s...
11566581_2
class MessageProducer extends CamundaBpmProducer { @Override @SuppressWarnings({ "rawtypes", "unchecked" }) public void process(Exchange exchange) throws Exception { String processInstanceId = exchange.getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID, String.class); String businessKey = exch...
Exchange exchange = mock(Exchange.class); Message message = mock(Message.class); ExecutionQuery query = mock(ExecutionQuery.class); Execution execution = mock(Execution.class); when(exchange.getIn()).thenReturn(message); when(exchange.getProperty(eq(EXCHANGE_HEADER_PROCE...
[FOCAL] @Override @SuppressWarnings({ "rawtypes", "unchecked" }) public void MessageProducer.process(Exchange exchange) [CLASS] class MessageProducer extends CamundaBpmProducer [METRICS] loc=93 cc=15 branches=14 loops=0 returns=0 throws=4 nesting=3 [CALLS-EXTERNAL] Exchange.getProperty/2, ExchangeUtils.prepareVariables...
/* static context [FOCAL] @Override @SuppressWarnings({ "rawtypes", "unchecked" }) public void MessageProducer.process(Exchange exchange) [THROWS-WHEN] RuntimeException when messageName != null && correlationKeyName != null && correlationKeyType != null && correlationKey == null [THROWS-WHEN] RuntimeException when mess...
/* static context [FOCAL] @Override @SuppressWarnings({ "rawtypes", "unchecked" }) public void MessageProducer.process(Exchange exchange) [THROWS-WHEN] RuntimeException when messageName != null && correlationKeyName != null && correlationKeyType != null && correlationKey == null [THROWS-WHEN] RuntimeException when mess...
true
ok
{"focal": {"class": "MessageProducer", "name": "process", "signature": "void process(Exchange exchange) throws Exception", "start_line": 3, "modifiers": "@Override @SuppressWarnings({ \"rawtypes\", \"unchecked\" }) public", "params": [{"name": "exchange", "type": "Exchange"}], "return_type": "void"}, "class_info": {"na...
11608365_5
class ResourceRegistrar { public static void unregister(XAResourceProducer producer) { final ProducerHolder holder = new ProducerHolder(producer); if (!resources.remove(holder)) { if (log.isDebugEnabled()) { log.debug("resource with uniqueName '{}' has not been registered", holder.getU...
assertEquals(1, ResourceRegistrar.getResourcesUniqueNames().size()); ResourceRegistrar.unregister(createMockProducer("xa-rp")); assertEquals(0, ResourceRegistrar.getResourcesUniqueNames().size()); } }
[FOCAL] public static void ResourceRegistrar.unregister(XAResourceProducer producer) [CLASS] class ResourceRegistrar [METRICS] loc=7 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2 [CALLS-EXTERNAL] resources.remove/1, log.isDebugEnabled/0, log.debug/2, ProducerHolder.getUniqueName/0 [NEW] ProducerHolder [PATH1] if...
/* static context [FOCAL] public static void ResourceRegistrar.unregister(XAResourceProducer producer) [PATH1] if(!resources.remove(holder))=T -> if(log.isDebugEnabled())=T [PATH2] if(!resources.remove(holder))=F [PATH3] if(!resources.remove(holder))=T -> if(log.isDebugEnabled())=F [INPUTS] branches=producer | result=-...
/* static context [FOCAL] public static void ResourceRegistrar.unregister(XAResourceProducer producer) [PATH1] if(!resources.remove(holder))=T -> if(log.isDebugEnabled())=T [PATH2] if(!resources.remove(holder))=F [PATH3] if(!resources.remove(holder))=T -> if(log.isDebugEnabled())=F [INPUTS] branches=producer | result=-...
true
ok
{"focal": {"class": "ResourceRegistrar", "name": "unregister", "signature": "void unregister(XAResourceProducer producer)", "start_line": 3, "modifiers": "public static", "params": [{"name": "producer", "type": "XAResourceProducer"}], "return_type": "void"}, "class_info": {"name": "ResourceRegistrar", "kind": "class", ...
11613195_0
class ThumbnailsForCollectionAccessor extends ThumbnailsAccessor { public Map<String, String> getThumbnailsForCollection(int start, int limit, int errorHandlingPolicy) throws TechnicalRuntimeException, IOException, EuropeanaApiProblem { return getThumbnailsForCollection(CommonMetadata.EDM_FIELD_THUMBNAIL_LARGE,...
ThumbnailsForCollectionAccessor tca = new ThumbnailsForCollectionAccessor( TEST_COLLECTION_NAME); //201 = 2* 100 +1 int resultsSize = (2 * ThumbnailsAccessor.DEFAULT_BLOCKSIZE) + 1; //start at second page int startPosition = 0; Map<String, String> thumbnails = tca.getThumbnailsForCollection(startPosi...
[FOCAL] public Map<String, String> ThumbnailsForCollectionAccessor.getThumbnailsForCollection(int start, int limit, int errorHandlingPolicy) [CLASS] class ThumbnailsForCollectionAccessor extends ThumbnailsAccessor [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Map<String, String> ...
/* static context [FOCAL] public Map<String, String> ThumbnailsForCollectionAccessor.getThumbnailsForCollection(int start, int limit, int errorHandlingPolicy) [INPUTS] branches=- | result=errorHandlingPolicy, limit, start [EXCEPTIONS] declares TechnicalRuntimeException, IOException, EuropeanaApiProblem [CALLS-INTERNAL]...
/* static context [FOCAL] public Map<String, String> ThumbnailsForCollectionAccessor.getThumbnailsForCollection(int start, int limit, int errorHandlingPolicy) [INPUTS] branches=- | result=errorHandlingPolicy, limit, start [EXCEPTIONS] declares TechnicalRuntimeException, IOException, EuropeanaApiProblem [CALLS-INTERNAL]...
true
ok
{"focal": {"class": "ThumbnailsForCollectionAccessor", "name": "getThumbnailsForCollection", "signature": "Map<String, String> getThumbnailsForCollection(int start, int limit, int errorHandlingPolicy) throws TechnicalRuntimeException, IOException, EuropeanaApiProblem", "start_line": 3, "modifiers": "public", "params": ...
11656984_397
class ActionRef { @Override public String toString() { return new StringBuilder().append(getClass().getSimpleName()) .append(" [path=") .append(path) .append(", cancel=") ...
assertEquals("ActionRef [path=path2, cancel=true, refs=[ActionRef [path=path, cancel=false, refs=[]]]]", actionRef2.toString()); } }
[FOCAL] @Override public String ActionRef.toString() [CLASS] class ActionRef [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] new StringBuilder().append(getClass().getSimpleName()) .a....toString/0, new StringBuilder().append(getClass().getSimpleName()) .a....append/1, new StringBu...
/* static context [FOCAL] @Override public String ActionRef.toString() [INPUTS] branches=- | result=cancel [FIELDS] read=cancel:boolean [NEW] StringBuilder [CALLS-EXTERNAL] new StringBuilder().append(getClass().getSimpleName()) .a....toString/0, new StringBuilder().append(getClass().getSimpleName()) .a....append/1, new...
/* static context [FOCAL] @Override public String ActionRef.toString() [INPUTS] branches=- | result=cancel [FIELDS] read=cancel:boolean [NEW] StringBuilder [CALLS-EXTERNAL] new StringBuilder().append(getClass().getSimpleName()) .a....toString/0, new StringBuilder().append(getClass().getSimpleName()) .a....append/1, new...
true
ok
{"focal": {"class": "ActionRef", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "ActionRef", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "config", "ty...
11662606_6
class StringUtils { public static String join(Collection<?> collection, String delimiter) { if (collection == null || collection.isEmpty()) { return EMPTY_STRING; } else if (delimiter == null) { delimiter = EMPTY_STRING; } StringBuilder builder = new String...
String string1 = "a"; String string2 = "story"; String string3 = "about"; String string4 = "tests"; String delim = "--"; ArrayList<String> strings = new ArrayList<String>(3); strings.add(string1); strings.add(string2); strings.add(string3); ...
[FOCAL] public static String StringUtils.join(Collection<?> collection, String delimiter) [CLASS] class StringUtils [METRICS] loc=19 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] Collection<?>.isEmpty/0, Collection<?>.iterator/0, Iterator<?>.hasNext/0, builder.append(it.next()).append/1, StringB...
/* static context [FOCAL] public static String StringUtils.join(Collection<?> collection, String delimiter) [PATH1] if(collection == null || collection.isEmpty())=F -> if(delimiter == null)=T -> while(it.hasNext())=T -> exit loop -> return builder.toString() [PATH2] if(collection == null || collection.isEmpty())=T -> r...
/* static context [FOCAL] public static String StringUtils.join(Collection<?> collection, String delimiter) [PATH1] if(collection == null || collection.isEmpty())=F -> if(delimiter == null)=T -> while(it.hasNext())=T -> exit loop -> return builder.toString() [PATH2] if(collection == null || collection.isEmpty())=T -> r...
true
ok
{"focal": {"class": "StringUtils", "name": "join", "signature": "String join(Collection<?> collection, String delimiter)", "start_line": 3, "modifiers": "public static", "params": [{"name": "collection", "type": "Collection<?>"}, {"name": "delimiter", "type": "String"}], "return_type": "String"}, "class_info": {"name":...
11664357_10
class OSMWithTags { public static boolean isTrue(String tagValue) { return ("yes".equals(tagValue) || "1".equals(tagValue) || "true".equals(tagValue)); } public long getId(); public void setId(long id); public void addTag(OSMTag tag); public void addTag(String key, String value); p...
assertTrue(OSMWithTags.isTrue("yes")); assertTrue(OSMWithTags.isTrue("1")); assertTrue(OSMWithTags.isTrue("true")); assertFalse(OSMWithTags.isTrue("no")); assertFalse(OSMWithTags.isTrue("0")); assertFalse(OSMWithTags.isTrue("false")); assertFalse(OSMWithT...
[FOCAL] public static boolean OSMWithTags.isTrue(String tagValue) [CLASS] class OSMWithTags [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] "yes".equals/1, "1".equals/1, "true".equals/1 [INPUTS] branches=- | result=tagValue [DATAFLOW] tagValue@param->L2 [CLASS-MEMBERS] long getId()...
/* static context [FOCAL] public static boolean OSMWithTags.isTrue(String tagValue) [INPUTS] branches=- | result=tagValue [CALLS-EXTERNAL] "yes".equals/1, "1".equals/1, "true".equals/1 */
/* static context [FOCAL] public static boolean OSMWithTags.isTrue(String tagValue) [INPUTS] branches=- | result=tagValue [CALLS-EXTERNAL] "yes".equals/1, "1".equals/1, "true".equals/1 */ class OSMWithTags { public static boolean isTrue(String tagValue) { return ("yes".equals(tagValue) || "1".equals(tagVal...
true
ok
{"focal": {"class": "OSMWithTags", "name": "isTrue", "signature": "boolean isTrue(String tagValue)", "start_line": 3, "modifiers": "public static", "params": [{"name": "tagValue", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "OSMWithTags", "kind": "class", "modifiers": "", "superclass": null, "...
11666990_3
class EndMeetingPageTransformer implements PageTransformer { @Override public void transformPage(View view, float position) { int pageWidth = view.getWidth(); if (position < 0) { view.setAlpha(1 + position * 2); } else { view.setAlpha(1); view.set...
out.transformPage(mockView, 0); verify(mockView).setAlpha(1f); verify(mockView).setTranslationX(0.0f); verify(mockView).setScaleX(1f); verify(mockView).setScaleY(1f); } }
[FOCAL] @Override public void EndMeetingPageTransformer.transformPage(View view, float position) [CLASS] class EndMeetingPageTransformer implements PageTransformer [METRICS] loc=17 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] View.getWidth/0, View.setAlpha/1, View.setTranslationX/1, View.setSca...
/* static context [FOCAL] @Override public void EndMeetingPageTransformer.transformPage(View view, float position) [PATH1] if(position < 0)=T [PATH2] if(position < 0)=F [INPUTS] branches=position | result=- [COLLABORATORS] param view:View getWidth/0,setAlpha/1,setTranslationX/1,setScaleX/1,setScaleY/1 [CALLS-EXTERNAL] ...
/* static context [FOCAL] @Override public void EndMeetingPageTransformer.transformPage(View view, float position) [PATH1] if(position < 0)=T [PATH2] if(position < 0)=F [INPUTS] branches=position | result=- [COLLABORATORS] param view:View getWidth/0,setAlpha/1,setTranslationX/1,setScaleX/1,setScaleY/1 [CALLS-EXTERNAL] ...
true
ok
{"focal": {"class": "EndMeetingPageTransformer", "name": "transformPage", "signature": "void transformPage(View view, float position)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "view", "type": "View"}, {"name": "position", "type": "float"}], "return_type": "void"}, "class_info": {"name": "E...
11668780_7
class ChangesDetector { public void newData(@Nonnull ChangesAdapter adapter, @Nonnull List<T> values, boolean force) { checkNotNull(adapter); checkNotNull(values); final ImmutableList<H> list = FluentIterable.from(values) .tra...
mDetector.newData(mAdapter, ImmutableList.of(new Cat(2, "two")), false); reset(mAdapter); mDetector.newData(mAdapter, ImmutableList.of(new Cat(1, "one"), new Cat(2, "two")), false); verify(mAdapter).notifyItemRangeInserted(0, 1); } }
[FOCAL] public void ChangesDetector.newData(ChangesAdapter adapter, List<T> values, boolean force) [CLASS] class ChangesDetector [METRICS] loc=39 cc=4 branches=2 loops=1 returns=0 throws=0 nesting=3 [CALLS-INTERNAL] int indexOf(List<H> list, int start, H item); int notify(ChangesAdapter adapter, int counter, int toRemo...
/* static context [FOCAL] public void ChangesDetector.newData(ChangesAdapter adapter, List<T> values, boolean force) [PATH1] for(firstListPosition < mItems.size())=T -> if(indexOf >= 0)=T -> if(force || !mDetector.same(first, second))=T -> exit loop [PATH2] for(firstListPosition < mItems.size())=F [PATH3] for(firstList...
/* static context [FOCAL] public void ChangesDetector.newData(ChangesAdapter adapter, List<T> values, boolean force) [PATH1] for(firstListPosition < mItems.size())=T -> if(indexOf >= 0)=T -> if(force || !mDetector.same(first, second))=T -> exit loop [PATH2] for(firstListPosition < mItems.size())=F [PATH3] for(firstList...
true
ok
{"focal": {"class": "ChangesDetector", "name": "newData", "signature": "void newData(ChangesAdapter adapter, List<T> values, boolean force)", "start_line": 3, "modifiers": "public", "params": [{"name": "adapter", "type": "ChangesAdapter"}, {"name": "values", "type": "List<T>"}, {"name": "force", "type": "boolean"}], "r...
11694419_2
class KettleControlBolt extends BaseRichBolt { @Override public void cleanup() { super.cleanup(); notifier.cleanup(); } public KettleControlBolt(String transformationName, Notifier notifier, Set<String> leafSteps); @SuppressWarnings("rawtypes") @Override public void prepare(Map stormConf, To...
KettleControlBolt bolt = new KettleControlBolt(TRANS_NAME, notifier, Collections.singleton(STEP_1)); notifier.cleanup(); EasyMock.expectLastCall(); control.replay(); bolt.cleanup(); control.verify(); } }
[FOCAL] @Override public void KettleControlBolt.cleanup() [CLASS] class KettleControlBolt extends BaseRichBolt [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] BaseRichBolt.cleanup/0, Notifier.cleanup/0 [FIELDS] read=notifier:Notifier [COLLABORATORS] field notifier:Notifier cleanup/...
/* static context [FOCAL] @Override public void KettleControlBolt.cleanup() [COLLABORATORS] field notifier:Notifier cleanup/0 [FIELDS] read=notifier:Notifier [CALLS-EXTERNAL] BaseRichBolt.cleanup/0, Notifier.cleanup/0 */
/* static context [FOCAL] @Override public void KettleControlBolt.cleanup() [COLLABORATORS] field notifier:Notifier cleanup/0 [FIELDS] read=notifier:Notifier [CALLS-EXTERNAL] BaseRichBolt.cleanup/0, Notifier.cleanup/0 */ class KettleControlBolt extends BaseRichBolt { @Override public void cleanup() { super.cle...
true
ok
{"focal": {"class": "KettleControlBolt", "name": "cleanup", "signature": "void cleanup()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "KettleControlBolt", "kind": "class", "modifiers": "", "superclass": "BaseRichBolt", "interfaces": null, "fields": [{"...
11700816_3
class ExampleDataloader implements TGDatasetInterface { @Override public boolean Validator(File file) throws FileNotFoundException, IOException, IllegalAccessException, InstantiationException { // Write your own elaborate validator to see if your LoadFile routine can deal with it String ext = g...
System.out.println("Validator"); ExampleDataloader instance = new ExampleDataloader(); boolean expResult = true; boolean result = instance.Validator(testFile); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. ...
[FOCAL] @Override public boolean ExampleDataloader.Validator(File file) [CLASS] class ExampleDataloader implements TGDatasetInterface [METRICS] loc=33 cc=6 branches=5 loops=0 returns=5 throws=0 nesting=4 [CALLS-INTERNAL] String getExtention(); String getFileExtension(File file) [CALLS-EXTERNAL] String.equalsIgnoreCase/...
/* static context [FOCAL] @Override public boolean ExampleDataloader.Validator(File file) [PATH1] if(ext.equalsIgnoreCase(getExtention()))=T -> if(sc.hasNextLine())=T -> if(loadedString.contains("\t"))=T -> if((loadedString.trim().equalsIgnoreCase("Time explicit") | loadedString.trim().equalsIgnoreCase("Wavelength expl...
/* static context [FOCAL] @Override public boolean ExampleDataloader.Validator(File file) [PATH1] if(ext.equalsIgnoreCase(getExtention()))=T -> if(sc.hasNextLine())=T -> if(loadedString.contains("\t"))=T -> if((loadedString.trim().equalsIgnoreCase("Time explicit") | loadedString.trim().equalsIgnoreCase("Wavelength expl...
true
ok
{"focal": {"class": "ExampleDataloader", "name": "Validator", "signature": "boolean Validator(File file) throws FileNotFoundException, IOException, IllegalAccessException, InstantiationException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "file", "type": "File"}], "return_type": "boolean"}, ...
11711223_9
class StringUtil { private static String splitLine(String str, final int col) { if (str.length() < col) { return str; } // scan from `col` to left for (int i = col - 1; i > 0; i--) { if (str.charAt(i) == ' ') { return str.substring(0, i) + "\...
String longLine = "http://www.kframework.org should be splitted"; Assert.assertEquals( "http://www.kframework.org\nshould be\nsplitted", StringUtil.splitLines(longLine, 10)); Assert.assertEquals( "http://www.kframework.org\nshould be splitted", ...
[FOCAL] private static String StringUtil.splitLine(String str, int col) [CLASS] class StringUtil [METRICS] loc=24 cc=6 branches=3 loops=2 returns=4 throws=0 nesting=2 [CALLS-EXTERNAL] String.length/0, String.charAt/1, String.substring/2, splitLine/2 (inherited), String.substring/1 [PATH1] if(str.length() < col)=F -> fo...
/* static context [FOCAL] private static String StringUtil.splitLine(String str, int col) [PATH1] if(str.length() < col)=F -> for(i > 0)=T -> if(str.charAt(i) == ' ')#1=F -> exit loop -> for(i < str.length())=T -> if(str.charAt(i) == ' ')#2=T -> return str.substring(0, i) + "\n" + splitLine(str.substring(i + 1), col) [...
/* static context [FOCAL] private static String StringUtil.splitLine(String str, int col) [PATH1] if(str.length() < col)=F -> for(i > 0)=T -> if(str.charAt(i) == ' ')#1=F -> exit loop -> for(i < str.length())=T -> if(str.charAt(i) == ' ')#2=T -> return str.substring(0, i) + "\n" + splitLine(str.substring(i + 1), col) [...
true
ok
{"focal": {"class": "StringUtil", "name": "splitLine", "signature": "String splitLine(String str, int col)", "start_line": 3, "modifiers": "private static", "params": [{"name": "str", "type": "String"}, {"name": "col", "type": "int"}], "return_type": "String"}, "class_info": {"name": "StringUtil", "kind": "class", "mod...
11719739_6
class ResourceFinder { public URL findResource(String resource) throws MojoFailureException { URL res = null; // first search relatively to the base directory try { final Path p = basedir.resolve(resource); res = toURL(p.toAbsolutePath()); } catch (final Inv...
assertNotNull(finder.findResource("test.txt")); } }
[FOCAL] public URL ResourceFinder.findResource(String resource) [CLASS] class ResourceFinder [METRICS] loc=49 cc=8 branches=4 loops=0 returns=5 throws=1 nesting=1 [CALLS-INTERNAL] URL toURL(Path path) [CALLS-EXTERNAL] basedir.resolve/1, Path.toAbsolutePath/0, Paths.get/1, String.startsWith/1, String.substring/1, compil...
/* static context [FOCAL] public URL ResourceFinder.findResource(String resource) [THROWS-WHEN] MojoFailureException when try-body throws && !(res != null) && try-body throws && !(res != null) && !(res != null) && !(res != null) && try-body throws [THROWS-WHEN] MojoFailureException when try-body throws && !(res != null...
/* static context [FOCAL] public URL ResourceFinder.findResource(String resource) [THROWS-WHEN] MojoFailureException when try-body throws && !(res != null) && try-body throws && !(res != null) && !(res != null) && !(res != null) && try-body throws [THROWS-WHEN] MojoFailureException when try-body throws && !(res != null...
true
ok
{"focal": {"class": "ResourceFinder", "name": "findResource", "signature": "URL findResource(String resource) throws MojoFailureException", "start_line": 3, "modifiers": "public", "params": [{"name": "resource", "type": "String"}], "return_type": "URL"}, "class_info": {"name": "ResourceFinder", "kind": "class", "modifi...
11724937_0
class FiberKafkaProducer implements Producer<K, V> { @Override public Future<RecordMetadata> send(ProducerRecord<K, V> record) { return send(record, null); } public FiberKafkaProducer(Producer<K, V> producer); @Override public Future<RecordMetadata> send(ProducerRecord<K, V> record, Call...
Fiber<Void> fiber = new Fiber<>(new SuspendableRunnable() { @Override public void run() throws SuspendExecution, InterruptedException { Future<RecordMetadata> f = fiberProducer.send(new ProducerRecord<>("Topic", "Key".getBytes(), "Value".getBytes())); Futu...
[FOCAL] @Override public Future<RecordMetadata> FiberKafkaProducer.send(ProducerRecord<K, V> record) [CLASS] class FiberKafkaProducer implements Producer<K, V> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Future<RecordMetadata> send(ProducerRecord<K, V> record, Callback callback...
/* static context [FOCAL] @Override public Future<RecordMetadata> FiberKafkaProducer.send(ProducerRecord<K, V> record) [INPUTS] branches=- | result=record [CALLS-INTERNAL] Future<RecordMetadata> send(ProducerRecord<K, V> record, Callback callback) */
/* static context [FOCAL] @Override public Future<RecordMetadata> FiberKafkaProducer.send(ProducerRecord<K, V> record) [INPUTS] branches=- | result=record [CALLS-INTERNAL] Future<RecordMetadata> send(ProducerRecord<K, V> record, Callback callback) */ class FiberKafkaProducer implements Producer<K, V> { @Override ...
true
ok
{"focal": {"class": "FiberKafkaProducer", "name": "send", "signature": "Future<RecordMetadata> send(ProducerRecord<K, V> record)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "record", "type": "ProducerRecord<K, V>"}], "return_type": "Future<RecordMetadata>"}, "class_info": {"name": "FiberKafk...
11736323_36
class TypedMap implements Map<String, Object> { public void putAll(Map<? extends String, ? extends Object> arg0) { inner.putAll(convertToTypedObjects(arg0)); } public TypedMap(final RecordType type); public TypedMap(final RecordType type, final Map<? extends String, ? extends Obj...
Map<String, Object> values = new HashMap<String, Object>(); values.put("intValue", 1); values.put("booleanValue", true); String[] stringArray = new String[] { "a", "b", "c" }; values.put("stringArray", stringArray); TypedMap map = new TypedMap(recordType, values); ...
[FOCAL] public void TypedMap.putAll(Map<? extends String, ? extends Object> arg0) [CLASS] class TypedMap implements Map<String, Object> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] Map<String, Object> convertToTypedObjects(Map<? extends String, ? extends Object> map) [CALLS-EXTE...
/* static context [FOCAL] public void TypedMap.putAll(Map<? extends String, ? extends Object> arg0) [COLLABORATORS] field inner putAll/1 [CALLS-INTERNAL] Map<String, Object> convertToTypedObjects(Map<? extends String, ? extends Object> map) [CALLS-EXTERNAL] inner.putAll/1 */
/* static context [FOCAL] public void TypedMap.putAll(Map<? extends String, ? extends Object> arg0) [COLLABORATORS] field inner putAll/1 [CALLS-INTERNAL] Map<String, Object> convertToTypedObjects(Map<? extends String, ? extends Object> map) [CALLS-EXTERNAL] inner.putAll/1 */ class TypedMap implements Map<String, Object...
true
ok
{"focal": {"class": "TypedMap", "name": "putAll", "signature": "void putAll(Map<? extends String, ? extends Object> arg0)", "start_line": 3, "modifiers": "public", "params": [{"name": "arg0", "type": "Map<? extends String, ? extends Object>"}], "return_type": "void"}, "class_info": {"name": "TypedMap", "kind": "class",...
11738699_2
class TimeGenerator implements Runnable { public void stop() { // AstericsErrorHandling.instance.getLogger().fine("Invoking thread // <"+Thread.currentThread().getName()+">, : .stop called"); if (runningTaskFuture != null && !runningTaskFuture.isDone()) { runningTaskFuture.canc...
// fail("Not yet implemented"); } }
[FOCAL] public void TimeGenerator.stop() [CLASS] class TimeGenerator implements Runnable [METRICS] loc=12 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] runningTaskFuture.isDone/0, runningTaskFuture.cancel/1 [PATH1] if(runningTaskFuture != null && !runningTaskFuture.isDone())=T [PATH2] if(running...
/* static context [FOCAL] public void TimeGenerator.stop() [PATH1] if(runningTaskFuture != null && !runningTaskFuture.isDone())=T [PATH2] if(runningTaskFuture != null && !runningTaskFuture.isDone())=F [COLLABORATORS] field runningTaskFuture isDone/0,cancel/1 [CALLS-EXTERNAL] runningTaskFuture.isDone/0, runningTaskFutur...
/* static context [FOCAL] public void TimeGenerator.stop() [PATH1] if(runningTaskFuture != null && !runningTaskFuture.isDone())=T [PATH2] if(runningTaskFuture != null && !runningTaskFuture.isDone())=F [COLLABORATORS] field runningTaskFuture isDone/0,cancel/1 [CALLS-EXTERNAL] runningTaskFuture.isDone/0, runningTaskFutur...
true
ok
{"focal": {"class": "TimeGenerator", "name": "stop", "signature": "void stop()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "TimeGenerator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Runnable", "fields": [], "members": [{"name": "TimeG...
11754395_21
class DefaultWhenHttpClient implements WhenHttpClient { @Override public Promise<HttpClientResponseAndBody> requestAbsAndReadBody(HttpMethod method, String absoluteURI) { return requestAbsAndReadBody(method, absoluteURI, null); } @Inject public DefaultWhenHttpClient(Vertx vertx, When when); ...
Promise<HttpClientResponseAndBody> p = whenHttpClient.requestAbsAndReadBody(HttpMethod.GET, absoluteURI); verify(client).requestAbs(any(), eq(absoluteURI)); verifyResponseAndBody(p); } }
[FOCAL] @Override public Promise<HttpClientResponseAndBody> DefaultWhenHttpClient.requestAbsAndReadBody(HttpMethod method, String absoluteURI) [CLASS] class DefaultWhenHttpClient implements WhenHttpClient [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Promise<HttpClientResponseAnd...
/* static context [FOCAL] @Override public Promise<HttpClientResponseAndBody> DefaultWhenHttpClient.requestAbsAndReadBody(HttpMethod method, String absoluteURI) [INPUTS] branches=- | result=absoluteURI, method [CALLS-INTERNAL] Promise<HttpClientResponseAndBody> requestAbsAndReadBody(HttpMethod method, String absoluteUR...
/* static context [FOCAL] @Override public Promise<HttpClientResponseAndBody> DefaultWhenHttpClient.requestAbsAndReadBody(HttpMethod method, String absoluteURI) [INPUTS] branches=- | result=absoluteURI, method [CALLS-INTERNAL] Promise<HttpClientResponseAndBody> requestAbsAndReadBody(HttpMethod method, String absoluteUR...
true
ok
{"focal": {"class": "DefaultWhenHttpClient", "name": "requestAbsAndReadBody", "signature": "Promise<HttpClientResponseAndBody> requestAbsAndReadBody(HttpMethod method, String absoluteURI)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "method", "type": "HttpMethod"}, {"name": "absoluteURI", "ty...
11765760_0
class PullRequestChainParser { public void parsePullRequestChains(PullRequests<? extends PullRequest> pullRequests) { Map<String, PullRequest> pullRequestsMap = Maps.newHashMap(); for (PullRequest pullRequest : pullRequests.getPullRequests()) { pullRequestsMap.put(pullRequest.getSource(...
BitbucketPullRequest firstPr = createPr("a", "master"); BitbucketPullRequest secondPr = createPr("b", "a"); BitbucketPullRequests pullRequests = new BitbucketPullRequests(); pullRequests.setPullRequests(asList(secondPr, firstPr)); parser.parsePullRequestChains(pullRequests); ...
[FOCAL] public void PullRequestChainParser.parsePullRequestChains(PullRequests<? extends PullRequest> pullRequests) [CLASS] class PullRequestChainParser [METRICS] loc=25 cc=5 branches=1 loops=3 returns=0 throws=0 nesting=3 [CALLS-EXTERNAL] Maps.newHashMap/0, PullRequests<? extends PullRequest>.getPullRequests/0, Map<St...
/* static context [FOCAL] public void PullRequestChainParser.parsePullRequestChains(PullRequests<? extends PullRequest> pullRequests) [PATH1] foreach(PullRequest pullRequest : pullRequests.getPullRequests())=F -> foreach(PullRequest pullRequest : pullRequestsMap.values())=T -> if(destinationPullRequest != null)=T -> do...
/* static context [FOCAL] public void PullRequestChainParser.parsePullRequestChains(PullRequests<? extends PullRequest> pullRequests) [PATH1] foreach(PullRequest pullRequest : pullRequests.getPullRequests())=F -> foreach(PullRequest pullRequest : pullRequestsMap.values())=T -> if(destinationPullRequest != null)=T -> do...
true
ok
{"focal": {"class": "PullRequestChainParser", "name": "parsePullRequestChains", "signature": "void parsePullRequestChains(PullRequests<? extends PullRequest> pullRequests)", "start_line": 3, "modifiers": "public", "params": [{"name": "pullRequests", "type": "PullRequests<? extends PullRequest>"}], "return_type": "void"...
11797725_37
class AbstractSessionHandler extends MessageToMessageCodec<FixMessage, FixMessageBuilder> { @Override public void channelInactive(ChannelHandlerContext ctx) { Attribute<FixSession> fixSessionAttribute = ctx.channel().attr(FIX_SESSION_KEY); if (fixSessionAttribute != null) { FixSessi...
when(channel.attr(AbstractSessionHandler.FIX_SESSION_KEY)).thenReturn(null); sessionHandler.channelInactive(ctx); verify(ctx, never()).fireChannelRead(any(LogoutEvent.class)); } }
[FOCAL] @Override public void AbstractSessionHandler.channelInactive(ChannelHandlerContext ctx) [CLASS] class AbstractSessionHandler extends MessageToMessageCodec<FixMessage, FixMessageBuilder> [METRICS] loc=12 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] Logger getLogger() [CALLS-EXTERNAL] ctx...
/* static context [FOCAL] @Override public void AbstractSessionHandler.channelInactive(ChannelHandlerContext ctx) [PATH1] if(fixSessionAttribute != null)=T -> if(session != null)=T [PATH2] if(fixSessionAttribute != null)=F [PATH3] if(fixSessionAttribute != null)=T -> if(session != null)=F [INPUTS] branches=ctx | result...
/* static context [FOCAL] @Override public void AbstractSessionHandler.channelInactive(ChannelHandlerContext ctx) [PATH1] if(fixSessionAttribute != null)=T -> if(session != null)=T [PATH2] if(fixSessionAttribute != null)=F [PATH3] if(fixSessionAttribute != null)=T -> if(session != null)=F [INPUTS] branches=ctx | result...
true
ok
{"focal": {"class": "AbstractSessionHandler", "name": "channelInactive", "signature": "void channelInactive(ChannelHandlerContext ctx)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "ctx", "type": "ChannelHandlerContext"}], "return_type": "void"}, "class_info": {"name": "AbstractSessionHandler"...
11799054_68
class HeaderParser { protected static int readAfterString(byte[] header, int off) { int start = readToString(header, off); int len = header[start + 2] & 0xFF; return start + len*2 + 3; } public static CustomHeader parse(File map); public static CustomHeader parse(byte[] map); ...
int expected = -1; int actual = HeaderParser.readAfterString(inputString, 15, "PlayerData"); assertEquals(expected, actual); } }
[FOCAL] protected static int HeaderParser.readAfterString(byte[] header, int off) [CLASS] class HeaderParser [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int readToString(byte[] header, int off) [INPUTS] branches=- | result=header, off [DATAFLOW] header@param->L2,L3; len@L3->L5;...
/* static context [FOCAL] protected static int HeaderParser.readAfterString(byte[] header, int off) [INPUTS] branches=- | result=header, off [CALLS-INTERNAL] int readToString(byte[] header, int off) */
/* static context [FOCAL] protected static int HeaderParser.readAfterString(byte[] header, int off) [INPUTS] branches=- | result=header, off [CALLS-INTERNAL] int readToString(byte[] header, int off) */ class HeaderParser { protected static int readAfterString(byte[] header, int off) { int start = readToStr...
true
ok
{"focal": {"class": "HeaderParser", "name": "readAfterString", "signature": "int readAfterString(byte[] header, int off)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "header", "type": "byte[]"}, {"name": "off", "type": "int"}], "return_type": "int"}, "class_info": {"name": "HeaderParser", "ki...
11816589_0
class Main { void execute() { System.out.println(message); } public Main(String message); public static void main(String args[]); } class MainTest { @Test public void testPrintMessage() {
ByteArrayOutputStream binary = new ByteArrayOutputStream(); PrintStream stream = new PrintStream(binary, true); PrintStream defaultStream = System.out; try { System.setOut(stream); new Main("message").execute(); assertThat(binary.toString(), is("messag...
[FOCAL] void Main.execute() [CLASS] class Main [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] System.out.println/1 [CLASS-MEMBERS] Main(String message); void main(String args) [TEST] MainTest: @Test public void testPrintMessage()
/* static context [FOCAL] void Main.execute() [CALLS-EXTERNAL] System.out.println/1 */
/* static context [FOCAL] void Main.execute() [CALLS-EXTERNAL] System.out.println/1 */ class Main { void execute() { System.out.println(message); } public Main(String message); public static void main(String args[]); } class MainTest { @Test public void testPrintMessage() {
true
ok
{"focal": {"class": "Main", "name": "execute", "signature": "void execute()", "start_line": 3, "modifiers": "", "params": [], "return_type": "void"}, "class_info": {"name": "Main", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Main", "kind": "constructor",...
11851236_37
class ApnsClient { public CompletableFuture<Void> close() { log.info("Shutting down."); final CompletableFuture<Void> closeFuture; if (this.isClosed.compareAndSet(false, true)) { closeFuture = new CompletableFuture<>(); this.channelPool.close().addListener((Generi...
final ApnsClient managedGroupClient = new ApnsClientBuilder() .setApnsServer(HOST, PORT) .setSigningKey(this.signingKey) .build(); assertDoesNotThrow(() -> managedGroupClient.close().get()); } }
[FOCAL] public CompletableFuture<Void> ApnsClient.close() [CLASS] class ApnsClient [METRICS] loc=21 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] log.info/1, this.isClosed.compareAndSet/2, this.channelPool.close().addListener/1, this.channelPool.close/0, ApnsClient.this.eventLoopGroup.shutdownGr...
/* static context [FOCAL] public CompletableFuture<Void> ApnsClient.close() [PATH1] if(this.isClosed.compareAndSet(false, true))=T -> return closeFuture [PATH2] if(this.isClosed.compareAndSet(false, true))=F -> return closeFuture [COLLABORATORS] field isClosed compareAndSet/2; field channelPool close/0 [FIELDS] read=ch...
/* static context [FOCAL] public CompletableFuture<Void> ApnsClient.close() [PATH1] if(this.isClosed.compareAndSet(false, true))=T -> return closeFuture [PATH2] if(this.isClosed.compareAndSet(false, true))=F -> return closeFuture [COLLABORATORS] field isClosed compareAndSet/2; field channelPool close/0 [FIELDS] read=ch...
true
ok
{"focal": {"class": "ApnsClient", "name": "close", "signature": "CompletableFuture<Void> close()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "CompletableFuture<Void>"}, "class_info": {"name": "ApnsClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [],...
11880356_8
class DbfRow { public float getFloat(String fieldName) throws DbfException { return getNumber(fieldName).floatValue(); } public DbfRow(DbfHeader header, Charset defaultCharset, Object[] row); public BigDecimal getBigDecimal(String fieldName); public Date getDate(String fieldName); pu...
float value = 10.004f; DbfRow dbfRow = createRow(null, value); assertEquals(0, dbfRow.getFloat(COLUMN_1), 0.5); assertEquals(value, dbfRow.getFloat(COLUMN_2), 0.5); } }
[FOCAL] public float DbfRow.getFloat(String fieldName) [CLASS] class DbfRow [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Number getNumber(String fieldName) [CALLS-EXTERNAL] getNumber(fieldName).floatValue/0 [EXCEPTIONS] declares DbfException [INPUTS] branches=- | result=fieldNam...
/* static context [FOCAL] public float DbfRow.getFloat(String fieldName) [INPUTS] branches=- | result=fieldName [EXCEPTIONS] declares DbfException [CALLS-INTERNAL] Number getNumber(String fieldName) [CALLS-EXTERNAL] getNumber(fieldName).floatValue/0 */
/* static context [FOCAL] public float DbfRow.getFloat(String fieldName) [INPUTS] branches=- | result=fieldName [EXCEPTIONS] declares DbfException [CALLS-INTERNAL] Number getNumber(String fieldName) [CALLS-EXTERNAL] getNumber(fieldName).floatValue/0 */ class DbfRow { public float getFloat(String fieldName) throws ...
true
ok
{"focal": {"class": "DbfRow", "name": "getFloat", "signature": "float getFloat(String fieldName) throws DbfException", "start_line": 3, "modifiers": "public", "params": [{"name": "fieldName", "type": "String"}], "return_type": "float"}, "class_info": {"name": "DbfRow", "kind": "class", "modifiers": "", "superclass": nu...
11896265_5
class CpkApi { @GET @Path( "/default" ) public Response defaultElement() throws IOException { IElement defaultElement = coreService.getDefaultElement(); if ( defaultElement != null ) { try { String url = defaultElement.getPluginId() + API_ROOT + defaultElement.getId(); return CpkUti...
when( cpkApi.coreService.getDefaultElement() ).thenReturn( null ); Response responseResult = null; try { responseResult = cpkApi.defaultElement(); assertEquals( Response.Status.OK.getStatusCode(), responseResult.getStatus() ); assertEquals( cpkApi.DEFAULT_NO_DASHBOARD_MESSAGE, new String( ...
[FOCAL] @GET @Path( "/default" ) public Response CpkApi.defaultElement() [CLASS] class CpkApi [METRICS] loc=16 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=2 [CALLS-INTERNAL] String getEncoding() [CALLS-EXTERNAL] coreService.getDefaultElement/0, IElement.getPluginId/0, IElement.getId/0, CpkUtils.redirect/1, logge...
/* static context [FOCAL] @GET @Path( "/default" ) public Response CpkApi.defaultElement() [PATH1] if(defaultElement != null)=T -> try-body throws -> return Response.serverError().build() [PATH2] if(defaultElement != null)=F -> return Response.ok( DEFAULT_NO_DASHBOARD_MESSAGE.getBytes( getEncoding() )... [PATH3] if(def...
/* static context [FOCAL] @GET @Path( "/default" ) public Response CpkApi.defaultElement() [PATH1] if(defaultElement != null)=T -> try-body throws -> return Response.serverError().build() [PATH2] if(defaultElement != null)=F -> return Response.ok( DEFAULT_NO_DASHBOARD_MESSAGE.getBytes( getEncoding() )... [PATH3] if(def...
true
ok
{"focal": {"class": "CpkApi", "name": "defaultElement", "signature": "Response defaultElement() throws IOException", "start_line": 3, "modifiers": "@GET @Path( \"/default\" ) public", "params": [], "return_type": "Response"}, "class_info": {"name": "CpkApi", "kind": "class", "modifiers": "", "superclass": null, "interf...
11904180_16
class JDBCFactory { public Scheme createScheme( String format, Fields fields, Properties properties ) { LOG.info( "creating {} format with properties {} and fields {}", format, properties, fields ); String selectQuery = properties.getProperty( FORMAT_SELECT_QUERY ); String countQuery = properties....
JDBCFactory factory = new JDBCFactory(); Fields fields = new Fields( "one", "two", "three" ); Properties schemeProperties = new Properties(); schemeProperties.setProperty( JDBCFactory.FORMAT_COLUMNS, "one:two:three" ); schemeProperties.setProperty( JDBCFactory.FORMAT_SELECT_QUERY, "select one, two,...
[FOCAL] public Scheme JDBCFactory.createScheme(String format, Fields fields, Properties properties) [CLASS] class JDBCFactory [METRICS] loc=44 cc=7 branches=6 loops=0 returns=2 throws=1 nesting=2 [CALLS-INTERNAL] Scheme createScheme(Fields fields, String selectQuery, String countQuery, long limit, String[] columnNames,...
/* static context [FOCAL] public Scheme JDBCFactory.createScheme(String format, Fields fields, Properties properties) [THROWS-WHEN] IllegalArgumentException when limitProperty != null && !limitProperty.isEmpty() && selectQuery != null && countQuery == null [THROWS-WHEN] IllegalArgumentException when !(limitProperty != ...
/* static context [FOCAL] public Scheme JDBCFactory.createScheme(String format, Fields fields, Properties properties) [THROWS-WHEN] IllegalArgumentException when limitProperty != null && !limitProperty.isEmpty() && selectQuery != null && countQuery == null [THROWS-WHEN] IllegalArgumentException when !(limitProperty != ...
true
ok
{"focal": {"class": "JDBCFactory", "name": "createScheme", "signature": "Scheme createScheme(String format, Fields fields, Properties properties)", "start_line": 3, "modifiers": "public", "params": [{"name": "format", "type": "String"}, {"name": "fields", "type": "Fields"}, {"name": "properties", "type": "Properties"}]...
11916042_2
class DistributionPomPatcher implements DepgraphPatcher { @Override public void patch( final DiscoveryResult orig, final List<? extends Location> locations, final Map<String, Object> context ) { final DiscoveryResult result = orig; final ProjectVersionRef ref = result...
final Location location = new SimpleLocation( "test-repo", "http://www.nowhere.com/path/to/repo" ); final ProjectVersionRef pvr = new SimpleProjectVersionRef( "group.id", "artifact-id", "1" ); final String pom = BASE + "in-profile-root-provided-dep.pom.xml"; final TestDownload download ...
[FOCAL] @Override public void DistributionPomPatcher.patch(DiscoveryResult orig, List<? extends Location> locations, Map<String, Object> context) [CLASS] class DistributionPomPatcher implements DepgraphPatcher [METRICS] loc=64 cc=7 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] DiscoveryResult.getSele...
/* static context [FOCAL] @Override public void DistributionPomPatcher.patch(DiscoveryResult orig, List<? extends Location> locations, Map<String, Object> context) [PATH1] if(pomView.resolveXPathToNode( assemblyOnPomProjectPath, false ) == null)=F -> foreach(ProjectRelationship<?, ?> rel : result.getAcceptedRelationshi...
/* static context [FOCAL] @Override public void DistributionPomPatcher.patch(DiscoveryResult orig, List<? extends Location> locations, Map<String, Object> context) [PATH1] if(pomView.resolveXPathToNode( assemblyOnPomProjectPath, false ) == null)=F -> foreach(ProjectRelationship<?, ?> rel : result.getAcceptedRelationshi...
true
ok
{"focal": {"class": "DistributionPomPatcher", "name": "patch", "signature": "void patch(DiscoveryResult orig, List<? extends Location> locations, Map<String, Object> context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "orig", "type": "DiscoveryResult"}, {"name": "locations", "type": "List<?...
11943595_64
class MutableSchema extends AbstractSchema implements Serializable, Schema { public MutableSchema addTable(Table table) { _tables.add(table); return this; } public MutableSchema(); public MutableSchema(String name); public MutableSchema(String name, Table... tables); @Override public String getName();...
MutableSchema schema1 = new MutableSchema("foo"); MutableSchema schema2 = new MutableSchema("foo"); assertTrue(schema1.equals(schema2)); assertTrue(schema1.hashCode() == schema2.hashCode()); schema2.addTable(new MutableTable("foo")); assertFalse(schema1.equals(schema2))...
[FOCAL] public MutableSchema MutableSchema.addTable(Table table) [CLASS] class MutableSchema extends AbstractSchema implements Serializable, Schema [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] _tables.add/1 [DATAFLOW] table@param->L2 [CLASS-MEMBERS] MutableSchema(); MutableSchem...
/* static context [FOCAL] public MutableSchema MutableSchema.addTable(Table table) [CALLS-EXTERNAL] _tables.add/1 */
/* static context [FOCAL] public MutableSchema MutableSchema.addTable(Table table) [CALLS-EXTERNAL] _tables.add/1 */ class MutableSchema extends AbstractSchema implements Serializable, Schema { public MutableSchema addTable(Table table) { _tables.add(table); return this; } public MutableSchema(); public M...
true
ok
{"focal": {"class": "MutableSchema", "name": "addTable", "signature": "MutableSchema addTable(Table table)", "start_line": 4, "modifiers": "public", "params": [{"name": "table", "type": "Table"}], "return_type": "MutableSchema"}, "class_info": {"name": "MutableSchema", "kind": "class", "modifiers": "", "superclass": "A...
11971122_38
class CoreDepthFirstVoidVisitor extends DepthFirstVoidVisitor { public PaaSInstance getPaaSInstance() { return paaSInstance; } public ApplicationInstance getApplicationInstance(); public UserInstance getUserInstance(); @Override public void visit(ApplicationProfile n); @Override public...
InputStream is = readFile("paasProfile.txt"); cpp.ReInit(is); CoreDepthFirstVoidVisitor visitor = null; try { Scope scope = cpp.Scope(); visitor = new CoreDepthFirstVoidVisitor(); scope.accept(visitor); } catch (Exception e) { ...
[FOCAL] public PaaSInstance CoreDepthFirstVoidVisitor.getPaaSInstance() [CLASS] class CoreDepthFirstVoidVisitor extends DepthFirstVoidVisitor [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] ApplicationInstance getApplicationInstance(); UserInstance getUserInstance(); void visit(Appl...
/* static context [FOCAL] public PaaSInstance CoreDepthFirstVoidVisitor.getPaaSInstance() */
/* static context [FOCAL] public PaaSInstance CoreDepthFirstVoidVisitor.getPaaSInstance() */ class CoreDepthFirstVoidVisitor extends DepthFirstVoidVisitor { public PaaSInstance getPaaSInstance() { return paaSInstance; } public ApplicationInstance getApplicationInstance(); public UserInstance g...
true
ok
{"focal": {"class": "CoreDepthFirstVoidVisitor", "name": "getPaaSInstance", "signature": "PaaSInstance getPaaSInstance()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "PaaSInstance"}, "class_info": {"name": "CoreDepthFirstVoidVisitor", "kind": "class", "modifiers": "", "superclass": "DepthFirst...
11974846_4
class AccessController extends BaseRegionObserver implements MasterObserver, RegionServerObserver, AccessControllerProtocol { @Override public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, HColumnDescriptor descriptor) throws IOException { requirePermission("modi...
final HColumnDescriptor hcd = new HColumnDescriptor(TEST_FAMILY); hcd.setMaxVersions(10); PrivilegedExceptionAction action = new PrivilegedExceptionAction() { public Object run() throws Exception { ACCESS_CONTROLLER.preModifyColumn(ObserverContext.createAndPrepare(CP_ENV, null), TEST...
[FOCAL] @Override public void AccessController.preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, HColumnDescriptor descriptor) [CLASS] class AccessController extends BaseRegionObserver implements MasterObserver, RegionServerObserver, AccessControllerProtocol [METRICS] loc=5 cc=1 branche...
class AccessController extends BaseRegionObserver implements MasterObserver, RegionServerObserver, AccessControllerProtocol { @Override public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, HColumnDescriptor descriptor) throws IOException { requirePermission("modi...
false
ok
{"focal": {"class": "AccessController", "name": "preModifyColumn", "signature": "void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName, HColumnDescriptor descriptor) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "c", "type": "ObserverContext<...
11992364_6
class FieldInfoResolver { static String cutFieldName(final String string, final int from) { final int nextIndex = from + 1; final int len = string.length(); if (len > nextIndex) { char c = string.charAt(nextIndex); if (c >= 'A' && c <= 'Z') { return s...
assertEquals("a", FieldInfoResolver.cutFieldName("getA", 3)); assertEquals("ab", FieldInfoResolver.cutFieldName("getAb", 3)); assertEquals("AB", FieldInfoResolver.cutFieldName("getAB", 3)); assertEquals("ABc", FieldInfoResolver.cutFieldName("getABc", 3)); assertEquals("ABC", Fiel...
[FOCAL] static String FieldInfoResolver.cutFieldName(String string, int from) [CLASS] class FieldInfoResolver [METRICS] loc=17 cc=4 branches=3 loops=0 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] String.length/0, String.charAt/1, String.substring/1, String.getChars/4 [NEW] String [PATH1] if(len > nextIndex)=T -> if(c ...
/* static context [FOCAL] static String FieldInfoResolver.cutFieldName(String string, int from) [PATH1] if(len > nextIndex)=T -> if(c >= 'A' && c <= 'Z')#1=F -> if(c >= 'A' && c <= 'Z')#2=T -> return new String(buffer) [PATH2] if(len > nextIndex)=T -> if(c >= 'A' && c <= 'Z')#1=T -> return string.substring(from) [PATH3...
/* static context [FOCAL] static String FieldInfoResolver.cutFieldName(String string, int from) [PATH1] if(len > nextIndex)=T -> if(c >= 'A' && c <= 'Z')#1=F -> if(c >= 'A' && c <= 'Z')#2=T -> return new String(buffer) [PATH2] if(len > nextIndex)=T -> if(c >= 'A' && c <= 'Z')#1=T -> return string.substring(from) [PATH3...
true
ok
{"focal": {"class": "FieldInfoResolver", "name": "cutFieldName", "signature": "String cutFieldName(String string, int from)", "start_line": 3, "modifiers": "static", "params": [{"name": "string", "type": "String"}, {"name": "from", "type": "int"}], "return_type": "String"}, "class_info": {"name": "FieldInfoResolver", "...
12002935_3
class XmlHelper { protected void applyModifications(Element modificationsRoot, Element targetRoot) { for(Object object : modificationsRoot.elements()){ if(object instanceof Element){ Element modificationElement = (Element) object; String copy = modificationElemen...
Element modificationsRoot = new DefaultElement("project"); Element targetRoot = new DefaultElement("project"); Document target = DocumentFactory.getInstance().createDocument(targetRoot); Document modifications = DocumentFactory.getInstance().createDocument(modificationsRoot); E...
[FOCAL] protected void XmlHelper.applyModifications(Element modificationsRoot, Element targetRoot) [CLASS] class XmlHelper [METRICS] loc=17 cc=5 branches=3 loops=1 returns=0 throws=0 nesting=4 [CALLS-INTERNAL] void addModification(Element targetRoot, Element modificationElement) [CALLS-EXTERNAL] Element.elements/0, Ele...
/* static context [FOCAL] protected void XmlHelper.applyModifications(Element modificationsRoot, Element targetRoot) [PATH1] foreach(Object object : modificationsRoot.elements())=T -> if(object instanceof Element)=T -> if("true".equals(copy))=F -> if(targetElement == null)=T -> exit loop [PATH2] foreach(Object object :...
/* static context [FOCAL] protected void XmlHelper.applyModifications(Element modificationsRoot, Element targetRoot) [PATH1] foreach(Object object : modificationsRoot.elements())=T -> if(object instanceof Element)=T -> if("true".equals(copy))=F -> if(targetElement == null)=T -> exit loop [PATH2] foreach(Object object :...
true
ok
{"focal": {"class": "XmlHelper", "name": "applyModifications", "signature": "void applyModifications(Element modificationsRoot, Element targetRoot)", "start_line": 3, "modifiers": "protected", "params": [{"name": "modificationsRoot", "type": "Element"}, {"name": "targetRoot", "type": "Element"}], "return_type": "void"}...
12006992_3
class TrezorMessageUtils { public static TrezorMessage.TxInput newTxInput(Transaction tx, int index) { Preconditions.checkNotNull(tx, "Transaction must be present"); Preconditions.checkElementIndex(index, tx.getInputs().size(), "TransactionInput not present at index " + index); // Input index is valid ...
// Arrange Address ourReceivingAddress = FakeTransactions.getElectrumAddressN(new int[] {0,0}); Address ourChangeAddress = FakeTransactions.getElectrumAddressN(new int[] {0,1}); Address random2Address = FakeTransactions.asMainNetAddress("1MKw8vWxvBnaBcrL2yXvZceqyRMoeG2kRn"); // Build a fake transa...
[FOCAL] public static TrezorMessage.TxInput TrezorMessageUtils.newTxInput(Transaction tx, int index) [CLASS] class TrezorMessageUtils [METRICS] loc=35 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] Preconditions.checkNotNull/2, Preconditions.checkElementIndex/3, tx.getInputs().size/0, Transaction...
/* static context [FOCAL] public static TrezorMessage.TxInput TrezorMessageUtils.newTxInput(Transaction tx, int index) [THROWS-WHEN] IllegalStateException when try-body throws [PATH1] try-body throws -> throw new IllegalStateException(e) [PATH2] return builder.build() [COLLABORATORS] param tx:Transaction getInputs/0,ge...
/* static context [FOCAL] public static TrezorMessage.TxInput TrezorMessageUtils.newTxInput(Transaction tx, int index) [THROWS-WHEN] IllegalStateException when try-body throws [PATH1] try-body throws -> throw new IllegalStateException(e) [PATH2] return builder.build() [COLLABORATORS] param tx:Transaction getInputs/0,ge...
true
ok
{"focal": {"class": "TrezorMessageUtils", "name": "newTxInput", "signature": "TrezorMessage.TxInput newTxInput(Transaction tx, int index)", "start_line": 3, "modifiers": "public static", "params": [{"name": "tx", "type": "Transaction"}, {"name": "index", "type": "int"}], "return_type": "TrezorMessage.TxInput"}, "class_...
12046384_0
class ProductCategoryEnricher { public Tuple enrichEvent(Tuple event) { if ("PRODUCT".equals(event.getString("type"))) { List<String> names = new ArrayList<>(event.getFieldNames()); List<Object> values = new ArrayList(event.getValues()); names.add("category"); values.add(getCategory(event.getString("pro...
String event = "{\"user\":\"60571253-8315-40ff-8142-f8d68f9d35f0\",\"product\":\"15\",\"type\":\"PRODUCT\"}"; Tuple enrichedEvent = productCategoryEnricher.enrichEvent(TupleBuilder.fromString(event)); assertEquals("Covers", enrichedEvent.getString("category")); } }
[FOCAL] public Tuple ProductCategoryEnricher.enrichEvent(Tuple event) [CLASS] class ProductCategoryEnricher [METRICS] loc=12 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] String getCategory(String productId) [CALLS-EXTERNAL] "PRODUCT".equals/1, Tuple.getString/1, Tuple.getFieldNames/0, Tuple.get...
/* static context [FOCAL] public Tuple ProductCategoryEnricher.enrichEvent(Tuple event) [PATH1] if("PRODUCT".equals(event.getString("type")))=T -> return TupleBuilder.tuple().ofNamesAndValues(names, values) [PATH2] if("PRODUCT".equals(event.getString("type")))=F -> return null [INPUTS] branches=event | result=event [CO...
/* static context [FOCAL] public Tuple ProductCategoryEnricher.enrichEvent(Tuple event) [PATH1] if("PRODUCT".equals(event.getString("type")))=T -> return TupleBuilder.tuple().ofNamesAndValues(names, values) [PATH2] if("PRODUCT".equals(event.getString("type")))=F -> return null [INPUTS] branches=event | result=event [CO...
true
ok
{"focal": {"class": "ProductCategoryEnricher", "name": "enrichEvent", "signature": "Tuple enrichEvent(Tuple event)", "start_line": 3, "modifiers": "public", "params": [{"name": "event", "type": "Tuple"}], "return_type": "Tuple"}, "class_info": {"name": "ProductCategoryEnricher", "kind": "class", "modifiers": "", "super...
12057541_2
class KoreanCharacterTokenizer extends Tokenizer { @Override public final boolean incrementToken() throws IOException { clearAttributes(); logger.debug("incrementToken"); int length = 0; int start = -1; // this variable is always initialized int end = -1; char[] buffer = termAtt.buffer(); while (...
CharTermAttribute charTermAtt = tokenizer.getAttribute(CharTermAttribute.class); OffsetAttribute offSetAtt = tokenizer.getAttribute(OffsetAttribute.class); while(tokenizer.incrementToken()) { TestToken t = getToken(charTermAtt.toString(), offSetAtt.startOffset(), offSetAtt.endOffset()); System.out.printl...
[FOCAL] @Override public final boolean KoreanCharacterTokenizer.incrementToken() [CLASS] class KoreanCharacterTokenizer extends Tokenizer [METRICS] loc=92 cc=15 branches=14 loops=1 returns=3 throws=0 nesting=5 [CALLS-INTERNAL] boolean isTokenChar(int c); int normalize(int c) [CALLS-EXTERNAL] clearAttributes/0 (inherite...
/* static context [FOCAL] @Override public final boolean KoreanCharacterTokenizer.incrementToken() [PATH1] while(true)=T -> if(bufferIndex >= dataLen)=T -> if(ioBuffer.getLength() == 0)=F -> if(isTokenChar(c))=T -> if(length > 0)#2=T -> if(Character.isDigit(preChar))=F -> if(preChar < 127)=T -> if(Character.isDigit(c))...
/* static context [FOCAL] @Override public final boolean KoreanCharacterTokenizer.incrementToken() [PATH1] while(true)=T -> if(bufferIndex >= dataLen)=T -> if(ioBuffer.getLength() == 0)=F -> if(isTokenChar(c))=T -> if(length > 0)#2=T -> if(Character.isDigit(preChar))=F -> if(preChar < 127)=T -> if(Character.isDigit(c))...
true
ok
{"focal": {"class": "KoreanCharacterTokenizer", "name": "incrementToken", "signature": "boolean incrementToken() throws IOException", "start_line": 3, "modifiers": "@Override public final", "params": [], "return_type": "boolean"}, "class_info": {"name": "KoreanCharacterTokenizer", "kind": "class", "modifiers": "", "sup...
12067623_0
class MultiplicationOperation implements Operation { @Override public int calculate(int a, int b) { return a * b; } @Override public String name(); } class MultiplicationOperationTest { @Test public void testModulus() {
Operation op = new MultiplicationOperation(); assertThat(op.calculate(5, 2)).isEqualTo(10); assertThat(op.calculate(10, 5)).isEqualTo(50); assertThat(op.calculate(4, 2)).isEqualTo(8); } }
[FOCAL] @Override public int MultiplicationOperation.calculate(int a, int b) [CLASS] class MultiplicationOperation implements Operation [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=a, b [DATAFLOW] a@param->L2; b@param->L2 [CLASS-MEMBERS] String name() [TEST] Multipli...
/* static context [FOCAL] @Override public int MultiplicationOperation.calculate(int a, int b) [INPUTS] branches=- | result=a, b */
/* static context [FOCAL] @Override public int MultiplicationOperation.calculate(int a, int b) [INPUTS] branches=- | result=a, b */ class MultiplicationOperation implements Operation { @Override public int calculate(int a, int b) { return a * b; } @Override public String name(); } class MultiplicationOper...
true
ok
{"focal": {"class": "MultiplicationOperation", "name": "calculate", "signature": "int calculate(int a, int b)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "a", "type": "int"}, {"name": "b", "type": "int"}], "return_type": "int"}, "class_info": {"name": "MultiplicationOperation", "kind": "clas...
12117077_49
class Carto { public static Style parse(Object css) throws IOException { Reader reader = Convert.toReader(css).get("Unable to handle input: " + css); return new CartoParser().parse(reader); } } class CartoTest { @Test public void testAttachment() throws Exception {
String css = " #states::glow {"+ " polygon-fill: #888888;"+ " polygon-opacity: 0.25;"+ " comp-op: dst;"+ " }"; Style result = Carto.parse(css); Rule r = result.getRules().get(0); assertEquals(new RGB("#888...
[FOCAL] public static Style Carto.parse(Object css) [CLASS] class Carto [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Convert.toReader(css).get/1, Convert.toReader/1, new CartoParser().parse/1 [NEW] CartoParser [EXCEPTIONS] declares IOException [INPUTS] branches=- | result=css [D...
/* static context [FOCAL] public static Style Carto.parse(Object css) [INPUTS] branches=- | result=css [EXCEPTIONS] declares IOException [NEW] CartoParser [CALLS-EXTERNAL] Convert.toReader(css).get/1, Convert.toReader/1, new CartoParser().parse/1 */
/* static context [FOCAL] public static Style Carto.parse(Object css) [INPUTS] branches=- | result=css [EXCEPTIONS] declares IOException [NEW] CartoParser [CALLS-EXTERNAL] Convert.toReader(css).get/1, Convert.toReader/1, new CartoParser().parse/1 */ class Carto { public static Style parse(Object css) throws IOExce...
true
ok
{"focal": {"class": "Carto", "name": "parse", "signature": "Style parse(Object css) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "css", "type": "Object"}], "return_type": "Style"}, "class_info": {"name": "Carto", "kind": "class", "modifiers": "", "superclass": null, "interface...
12151814_1
class EnumHelper { @SuppressWarnings("unchecked") public static <E extends Enum<? extends Style.HasCssName>> E fromStyleName(final String styleName, final Class<E> enumClass, ...
assertThat(fromStyleName("123 pull-left abc", Pull.class, null), is(Pull.LEFT)); assertThat(fromStyleName("123 pull-right abc", Pull.class, null), is(Pull.RIGHT)); assertThat(fromStyleName("pull-left pull-right abc", Pull.class, null), is(Pull.LEFT)); assertThat(fromStyleName("123 abc", ...
[FOCAL] @SuppressWarnings("unchecked") public static E EnumHelper.fromStyleName(String styleName, Class<E> enumClass, E defaultValue) [CLASS] class EnumHelper [METRICS] loc=20 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] Class<E>.getEnumConstants/0, Style.HasCssName.getCssName/0, StyleHelper.co...
/* static context [FOCAL] @SuppressWarnings("unchecked") public static E EnumHelper.fromStyleName(String styleName, Class<E> enumClass, E defaultValue) [PATH1] if(styleName == null || enumClass == null)=F -> foreach(Enum<? extends Style.HasCssName> constant : enumClass.getEnumConstants())=T -> if(cssClass != null && St...
/* static context [FOCAL] @SuppressWarnings("unchecked") public static E EnumHelper.fromStyleName(String styleName, Class<E> enumClass, E defaultValue) [PATH1] if(styleName == null || enumClass == null)=F -> foreach(Enum<? extends Style.HasCssName> constant : enumClass.getEnumConstants())=T -> if(cssClass != null && St...
true
ok
{"focal": {"class": "EnumHelper", "name": "fromStyleName", "signature": "E fromStyleName(String styleName, Class<E> enumClass, E defaultValue)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public static", "params": [{"name": "styleName", "type": "String"}, {"name": "enumClass", "type": "Class<E>"}, ...
12246820_18
class DelegatingContentHandlerImpl implements FileContentReferenceHandler { @Override public long putFile(File sourceFile, ContentReference targetContentReference) throws ContentIOException { ContentReferenceHandler delegate = getDelegate(targetContentReference); return delegate.putFile(sou...
File sourceFile = new File(this.getClass().getResource( "/content-handler-a/file-a-1.txt").toURI()); String targetFolder = "/content-handler-a"; ContentReference targetContentReference = getTextReference(targetFolder); targetContentReference.setUri(targetContentReference...
[FOCAL] @Override public long DelegatingContentHandlerImpl.putFile(File sourceFile, ContentReference targetContentReference) [CLASS] class DelegatingContentHandlerImpl implements FileContentReferenceHandler [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] ContentReferenceHandler get...
/* static context [FOCAL] @Override public long DelegatingContentHandlerImpl.putFile(File sourceFile, ContentReference targetContentReference) [INPUTS] branches=- | result=sourceFile, targetContentReference [EXCEPTIONS] declares ContentIOException [CALLS-INTERNAL] ContentReferenceHandler getDelegate(ContentReference co...
/* static context [FOCAL] @Override public long DelegatingContentHandlerImpl.putFile(File sourceFile, ContentReference targetContentReference) [INPUTS] branches=- | result=sourceFile, targetContentReference [EXCEPTIONS] declares ContentIOException [CALLS-INTERNAL] ContentReferenceHandler getDelegate(ContentReference co...
true
ok
{"focal": {"class": "DelegatingContentHandlerImpl", "name": "putFile", "signature": "long putFile(File sourceFile, ContentReference targetContentReference) throws ContentIOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "sourceFile", "type": "File"}, {"name": "targetContentReference", ...
12250309_0
class LDAPManager { public void startServer() throws LDAPException { logger.info("Starting LDAP Server Configuration."); File installFile = new File(dataPath); installDir = installFile.getAbsolutePath(); boolean isFreshInstall; if (installFile.exists()) { isFresh...
logger.info("Testing starting and stopping server."); BundleContext mockContext = createMockContext(new File(TMP_FOLDER_NAME)); LDAPManager manager = new LDAPManager(mockContext); HashMap config = new HashMap(); config.put("admin.port", AvailablePortFinder.getNextAvailable()); ...
[FOCAL] public void LDAPManager.startServer() [CLASS] class LDAPManager [METRICS] loc=82 cc=10 branches=3 loops=1 returns=0 throws=5 nesting=4 [CALLS-INTERNAL] void copyDefaultFiles(); void createDirectory(String dir); void createStorePinFiles(); void loadLDIF(InputStream ldifStream); void stopServer() [CALLS-EXTERNAL]...
/* static context [FOCAL] public void LDAPManager.startServer() [THROWS-WHEN] le when installFile.exists() && try-body throws [THROWS-WHEN] LDAPException when installFile.exists() && isFreshInstall && try-body throws [THROWS-WHEN] le when installFile.exists() && isFreshInstall && try-body throws [THROWS-WHEN] le when !...
/* static context [FOCAL] public void LDAPManager.startServer() [THROWS-WHEN] le when installFile.exists() && try-body throws [THROWS-WHEN] LDAPException when installFile.exists() && isFreshInstall && try-body throws [THROWS-WHEN] le when installFile.exists() && isFreshInstall && try-body throws [THROWS-WHEN] le when !...
true
ok
{"focal": {"class": "LDAPManager", "name": "startServer", "signature": "void startServer() throws LDAPException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "LDAPManager", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"nam...
12255838_2
class GuiceVerticleFactory implements VerticleFactory { public GuiceVerticleFactory setInjector(Injector injector) { this.injector = injector; return this; } public Injector getInjector(); @Override public String prefix(); @Override public Verticle createVerticle(String verticleNam...
assertNull(factory.getInjector()); Injector injector = mock(Injector.class); factory.setInjector(injector); assertEquals(injector, factory.getInjector()); } }
[FOCAL] public GuiceVerticleFactory GuiceVerticleFactory.setInjector(Injector injector) [CLASS] class GuiceVerticleFactory implements VerticleFactory [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] write=injector [STATE] injector via getInjector() [DATAFLOW] injector@param->L2 [CLASS-MEMBE...
/* static context [FOCAL] public GuiceVerticleFactory GuiceVerticleFactory.setInjector(Injector injector) [STATE] injector via getInjector() [FIELDS] write=injector */
/* static context [FOCAL] public GuiceVerticleFactory GuiceVerticleFactory.setInjector(Injector injector) [STATE] injector via getInjector() [FIELDS] write=injector */ class GuiceVerticleFactory implements VerticleFactory { public GuiceVerticleFactory setInjector(Injector injector) { this.injector = inject...
true
ok
{"focal": {"class": "GuiceVerticleFactory", "name": "setInjector", "signature": "GuiceVerticleFactory setInjector(Injector injector)", "start_line": 3, "modifiers": "public", "params": [{"name": "injector", "type": "Injector"}], "return_type": "GuiceVerticleFactory"}, "class_info": {"name": "GuiceVerticleFactory", "kin...
12299144_16
class RepositoryUserDetailsService implements UserDetailsService { @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { LOGGER.debug("Loading user by username: {}", username); User user = repository.findByEmail(username); LOGGER.debug("Fou...
when(repositoryMock.findByEmail(EMAIL)).thenReturn(null); catchException(service).loadUserByUsername(EMAIL); Assertions.assertThat(caughtException()) .isExactlyInstanceOf(UsernameNotFoundException.class) .hasMessage("No user found with username: " + EMAIL) ...
[FOCAL] @Override public UserDetails RepositoryUserDetailsService.loadUserByUsername(String username) [CLASS] class RepositoryUserDetailsService implements UserDetailsService [METRICS] loc=25 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] LOGGER.debug/2, repository.findByEmail/1, ExampleUserDetai...
/* static context [FOCAL] @Override public UserDetails RepositoryUserDetailsService.loadUserByUsername(String username) [THROWS-WHEN] UsernameNotFoundException when user == null [PATH1] if(user == null)=T -> throw new UsernameNotFoundException("No user found with username: " + use... [PATH2] if(user == null)=F -> retur...
/* static context [FOCAL] @Override public UserDetails RepositoryUserDetailsService.loadUserByUsername(String username) [THROWS-WHEN] UsernameNotFoundException when user == null [PATH1] if(user == null)=T -> throw new UsernameNotFoundException("No user found with username: " + use... [PATH2] if(user == null)=F -> retur...
true
ok
{"focal": {"class": "RepositoryUserDetailsService", "name": "loadUserByUsername", "signature": "UserDetails loadUserByUsername(String username) throws UsernameNotFoundException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "username", "type": "String"}], "return_type": "UserDetails"}, "class_i...
12299794_3
class UrlUtils { public static String combine(final String... parts) { final StringBuilder sb = new StringBuilder(); for (final String part : parts) { if (isHttpUrl(part) || isHttpsUrl(part)) { sb.setLength(0); } else if (!part.startsWith("/")) { ...
final String result = UrlUtils.combine("http://example.com", "/a", "http://test.com", "b/"); assertThat(result).as("Combined Url").isEqualTo("http://test.com/b"); } }
[FOCAL] public static String UrlUtils.combine(String... parts) [CLASS] class UrlUtils [METRICS] loc=14 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] String sanitizePath(String path); boolean isHttpUrl(String url); boolean isHttpsUrl(String url) [CALLS-EXTERNAL] StringBuilder.setLength/1, String....
/* static context [FOCAL] public static String UrlUtils.combine(String... parts) [PATH1] foreach(String part : parts)=T -> if(isHttpUrl(part) || isHttpsUrl(part))=F -> if(!part.startsWith("/"))=T -> exit loop -> return sb.toString() [PATH2] foreach(String part : parts)=F -> return sb.toString() [PATH3] foreach(String p...
/* static context [FOCAL] public static String UrlUtils.combine(String... parts) [PATH1] foreach(String part : parts)=T -> if(isHttpUrl(part) || isHttpsUrl(part))=F -> if(!part.startsWith("/"))=T -> exit loop -> return sb.toString() [PATH2] foreach(String part : parts)=F -> return sb.toString() [PATH3] foreach(String p...
true
ok
{"focal": {"class": "UrlUtils", "name": "combine", "signature": "String combine(String... parts)", "start_line": 3, "modifiers": "public static", "params": [{"name": "parts", "type": "String..."}], "return_type": "String"}, "class_info": {"name": "UrlUtils", "kind": "class", "modifiers": "", "superclass": null, "interf...
12304596_1
class TemplateEngineRythm implements TemplateEngine { @Override @SuppressWarnings("unchecked") public void invoke(Context context, Result result) { Object object = result.getRenderable(); ResponseStreams responseStreams = context.finalizeHeaders(result); Map map; // if th...
Properties p = new Properties(); p.setProperty("key", "value"); when(ninjaProperties.getAllCurrentNinjaProperties()).thenReturn(p); TemplateEngineRythm rythm = new TemplateEngineRythm(messages, lang, ninjaLogger, exceptionHandler, rythmHelper, templateEng...
[FOCAL] @Override @SuppressWarnings("unchecked") public void TemplateEngineRythm.invoke(Context context, Result result) [CLASS] class TemplateEngineRythm implements TemplateEngine [METRICS] loc=119 cc=10 branches=7 loops=1 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] void handleServerError(Context context, Exception e...
class TemplateEngineRythm implements TemplateEngine { @Override @SuppressWarnings("unchecked") public void invoke(Context context, Result result) { Object object = result.getRenderable(); ResponseStreams responseStreams = context.finalizeHeaders(result); Map map; // if th...
false
ok
{"focal": {"class": "TemplateEngineRythm", "name": "invoke", "signature": "void invoke(Context context, Result result)", "start_line": 3, "modifiers": "@Override @SuppressWarnings(\"unchecked\") public", "params": [{"name": "context", "type": "Context"}, {"name": "result", "type": "Result"}], "return_type": "void"}, "c...
12319410_2
class EsMarshalling { public static XContentBuilder marshall(PoliciesBean bean) throws StorageException { try (XContentBuilder builder = XContentFactory.jsonBuilder()) { preMarshall(bean); builder .startObject() .field("organizationId", bean.getOr...
GatewayBean bean = createBean(GatewayBean.class); XContentBuilder builder = EsMarshalling.marshall(bean); Assert.assertEquals("{\"id\":\"ID\",\"name\":\"NAME\",\"description\":\"DESCRIPTION\",\"type\":\"REST\",\"configuration\":\"CONFIGURATION\",\"createdBy\":\"CREATEDBY\",\"createdOn\":1,\"modi...
[FOCAL] public static XContentBuilder EsMarshalling.marshall(PoliciesBean bean) [CLASS] class EsMarshalling [METRICS] loc=34 cc=4 branches=1 loops=1 returns=1 throws=1 nesting=3 [CALLS-INTERNAL] void postMarshall(Object bean); void preMarshall(Object bean) [CALLS-EXTERNAL] XContentFactory.jsonBuilder/0, builder .startO...
/* static context [FOCAL] public static XContentBuilder EsMarshalling.marshall(PoliciesBean bean) [THROWS-WHEN] StorageException when try-body throws [PATH1] if(policies != null && !policies.isEmpty())=T -> foreach(PolicyBean policy : policies)=T -> exit loop -> return builder [PATH2] try-body throws -> throw new Stora...
/* static context [FOCAL] public static XContentBuilder EsMarshalling.marshall(PoliciesBean bean) [THROWS-WHEN] StorageException when try-body throws [PATH1] if(policies != null && !policies.isEmpty())=T -> foreach(PolicyBean policy : policies)=T -> exit loop -> return builder [PATH2] try-body throws -> throw new Stora...
true
ok
{"focal": {"class": "EsMarshalling", "name": "marshall", "signature": "XContentBuilder marshall(PoliciesBean bean) throws StorageException", "start_line": 3, "modifiers": "public static", "params": [{"name": "bean", "type": "PoliciesBean"}], "return_type": "XContentBuilder"}, "class_info": {"name": "EsMarshalling", "ki...
12343833_0
class PropertyUtils { @SuppressWarnings("unchecked") public static <T> T transform(Class<T> type, String value) throws IllegalArgumentException { if (!VALUE_TRANSFORMER.containsKey(type)) { throw new IllegalArgumentException("unsupported parameter type: " + type); } // since...
Object result = transform(type, val); assertTrue(type.isAssignableFrom(result.getClass())); } }
[FOCAL] @SuppressWarnings("unchecked") public static T PropertyUtils.transform(Class<T> type, String value) [CLASS] class PropertyUtils [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] VALUE_TRANSFORMER.containsKey/1, VALUE_TRANSFORMER.get(type).apply/1, VALUE_TRANSFORMER.get/1 [NEW...
/* static context [FOCAL] @SuppressWarnings("unchecked") public static T PropertyUtils.transform(Class<T> type, String value) [THROWS-WHEN] IllegalArgumentException when !VALUE_TRANSFORMER.containsKey(type) [PATH1] if(!VALUE_TRANSFORMER.containsKey(type))=T -> throw new IllegalArgumentException("unsupported parameter t...
/* static context [FOCAL] @SuppressWarnings("unchecked") public static T PropertyUtils.transform(Class<T> type, String value) [THROWS-WHEN] IllegalArgumentException when !VALUE_TRANSFORMER.containsKey(type) [PATH1] if(!VALUE_TRANSFORMER.containsKey(type))=T -> throw new IllegalArgumentException("unsupported parameter t...
true
ok
{"focal": {"class": "PropertyUtils", "name": "transform", "signature": "T transform(Class<T> type, String value) throws IllegalArgumentException", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public static", "params": [{"name": "type", "type": "Class<T>"}, {"name": "value", "type": "String"}], "retur...
12473833_38
class Utils { public static int myBinarySearch(int[] indices, int key, int begin, int end) { if (indices.length == 0 || begin == end) { return -1; } end--; int mid = begin; while (begin <= end) { mid = (end + begin) >> 1; if (i...
System.out.println("binarySearch"); int[] index = {10, 13, 15, 17, 19}; int key = 25; int begin = 0; int end = 5; int expResult = -6; int result = Utils.myBinarySearch(index, key, begin, end); assertEquals(expResult, result); } }
[FOCAL] public static int Utils.myBinarySearch(int[] indices, int key, int begin, int end) [CLASS] class Utils [METRICS] loc=30 cc=6 branches=4 loops=1 returns=4 throws=0 nesting=3 [PATH1] if(indices.length == 0 || begin == end)=F -> while(begin <= end)=T -> if(indices[mid] < key)#1=F -> if(indices[mid] > key)=T -> exi...
/* static context [FOCAL] public static int Utils.myBinarySearch(int[] indices, int key, int begin, int end) [PATH1] if(indices.length == 0 || begin == end)=F -> while(begin <= end)=T -> if(indices[mid] < key)#1=F -> if(indices[mid] > key)=T -> exit loop -> if(indices[mid] < key)#2=T -> return -mid-2 [PATH2] if(indices...
/* static context [FOCAL] public static int Utils.myBinarySearch(int[] indices, int key, int begin, int end) [PATH1] if(indices.length == 0 || begin == end)=F -> while(begin <= end)=T -> if(indices[mid] < key)#1=F -> if(indices[mid] > key)=T -> exit loop -> if(indices[mid] < key)#2=T -> return -mid-2 [PATH2] if(indices...
true
ok
{"focal": {"class": "Utils", "name": "myBinarySearch", "signature": "int myBinarySearch(int[] indices, int key, int begin, int end)", "start_line": 3, "modifiers": "public static", "params": [{"name": "indices", "type": "int[]"}, {"name": "key", "type": "int"}, {"name": "begin", "type": "int"}, {"name": "end", "type": ...
12485907_12
class MessageParser { public static String normalizeSubject(String subject) { String s = subject; if (s != null) { s = s.replaceAll("\\[.*?\\][^$]","") // remove any brackets at the beginning except the one having end of line after the "]" .replaceAll("^\\s*(-*\\s*[...
assertEquals("Test subject", MessageParser.normalizeSubject(" [] [x x] Re: Vor: Test RE: subject ")); assertEquals("Test subject", MessageParser.normalizeSubject(" Re: Fw: [] [x x] Test RE: [x] [] subject ")); assertEquals("Web Container Integration testing (WCI)", MessageParser.normalizeSubjec...
[FOCAL] public static String MessageParser.normalizeSubject(String subject) [CLASS] class MessageParser [METRICS] loc=12 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] s.replaceAll("\\[.*?\\][^$]","") // remove any brackets a....trim/0, s.replaceAll("\\[.*?\\][^$]","") // remove any brackets a......
/* static context [FOCAL] public static String MessageParser.normalizeSubject(String subject) [PATH1] if(s != null)=T -> return s [PATH2] if(s != null)=F -> return s [INPUTS] branches=subject | result=subject [CALLS-EXTERNAL] s.replaceAll("\\[.*?\\][^$]","") // remove any brackets a....trim/0, s.replaceAll("\\[.*?\\][^...
/* static context [FOCAL] public static String MessageParser.normalizeSubject(String subject) [PATH1] if(s != null)=T -> return s [PATH2] if(s != null)=F -> return s [INPUTS] branches=subject | result=subject [CALLS-EXTERNAL] s.replaceAll("\\[.*?\\][^$]","") // remove any brackets a....trim/0, s.replaceAll("\\[.*?\\][^...
true
ok
{"focal": {"class": "MessageParser", "name": "normalizeSubject", "signature": "String normalizeSubject(String subject)", "start_line": 3, "modifiers": "public static", "params": [{"name": "subject", "type": "String"}], "return_type": "String"}, "class_info": {"name": "MessageParser", "kind": "class", "modifiers": "", "...
12488647_6
class Utils { public static String implode(String separator, List<String> elements){ StringBuffer s = new StringBuffer(); for(int i = 0; i < elements.size(); i++){ if(i > 0){ s.append(" "); } s.append(elements.get(i)); } return s.t...
final String separator = "Bar"; final List<String> elements = new ArrayList<String>(); assertEquals("", Utils.implode(separator, elements)); elements.add("foo"); elements.add("bar"); assertEquals("foo bar", Utils.implode(separator, elements)); } }
[FOCAL] public static String Utils.implode(String separator, List<String> elements) [CLASS] class Utils [METRICS] loc=10 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] List<String>.size/0, StringBuffer.append/1, List<String>.get/1, StringBuffer.toString/0 [NEW] StringBuffer [PATH1] for(i < elemen...
/* static context [FOCAL] public static String Utils.implode(String separator, List<String> elements) [PATH1] for(i < elements.size())=T -> if(i > 0)=T -> exit loop -> return s.toString() [PATH2] for(i < elements.size())=F -> return s.toString() [PATH3] for(i < elements.size())=T -> if(i > 0)=F -> exit loop -> return s...
/* static context [FOCAL] public static String Utils.implode(String separator, List<String> elements) [PATH1] for(i < elements.size())=T -> if(i > 0)=T -> exit loop -> return s.toString() [PATH2] for(i < elements.size())=F -> return s.toString() [PATH3] for(i < elements.size())=T -> if(i > 0)=F -> exit loop -> return s...
true
ok
{"focal": {"class": "Utils", "name": "implode", "signature": "String implode(String separator, List<String> elements)", "start_line": 3, "modifiers": "public static", "params": [{"name": "separator", "type": "String"}, {"name": "elements", "type": "List<String>"}], "return_type": "String"}, "class_info": {"name": "Util...
12497963_1
class MaxStepCriteria implements IBreakCriteria { @Override public boolean shouldBreak(IHierarchicalNodeLayout layout) { if(layout.getDelegate()==null) // TODO : do not point on delegate but on MultiStepLayout.getCounter return false; if(layout.getDelegate().getCounter()>ma...
IHierarchicalNodeLayout mockLayout = mockLayoutCounter(3); MaxStepCriteria c = new MaxStepCriteria(2); Assert.assertFalse(c.shouldBreak(mockLayout)); // non : 0 > 2 Assert.assertFalse(c.shouldBreak(mockLayout)); // non : 1 > 2 Assert.assertFalse(c.shouldBreak(mockLayout)...
[FOCAL] @Override public boolean MaxStepCriteria.shouldBreak(IHierarchicalNodeLayout layout) [CLASS] class MaxStepCriteria implements IBreakCriteria [METRICS] loc=10 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] IHierarchicalNodeLayout.getDelegate/0, layout.getDelegate().getCounter/0 [PATH1] if(...
/* static context [FOCAL] @Override public boolean MaxStepCriteria.shouldBreak(IHierarchicalNodeLayout layout) [PATH1] if(layout.getDelegate()==null)=F -> if(layout.getDelegate().getCounter()>maxSteps)=T -> return true [PATH2] if(layout.getDelegate()==null)=T -> return false [PATH3] if(layout.getDelegate()==null)=F -> ...
/* static context [FOCAL] @Override public boolean MaxStepCriteria.shouldBreak(IHierarchicalNodeLayout layout) [PATH1] if(layout.getDelegate()==null)=F -> if(layout.getDelegate().getCounter()>maxSteps)=T -> return true [PATH2] if(layout.getDelegate()==null)=T -> return false [PATH3] if(layout.getDelegate()==null)=F -> ...
true
ok
{"focal": {"class": "MaxStepCriteria", "name": "shouldBreak", "signature": "boolean shouldBreak(IHierarchicalNodeLayout layout)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "layout", "type": "IHierarchicalNodeLayout"}], "return_type": "boolean"}, "class_info": {"name": "MaxStepCriteria", "kin...
12506813_0
class BM25FQuery extends DisjunctionMaxQuery { public BM25FQuery( Collection<Query> perFieldQueries, Map<String, Float> fieldWeights, Map<String, Float> normFactors) { super(perFieldQueries, 0.0f); this.fieldWeights = fieldWeights; this.normFactors = normFactors; } public BM25FQue...
Directory index = new RAMDirectory(); StandardAnalyzer analyzer = new StandardAnalyzer(); IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_4_10_4, analyzer); IndexWriter w = new IndexWriter(index, config); w.addDocument( doc( 0, "CNT-infused fiber as a ...
[FOCAL] public BM25FQuery.BM25FQuery(Collection<Query> perFieldQueries, Map<String, Float> fieldWeights, Map<String, Float> normFactors) [CLASS] class BM25FQuery extends DisjunctionMaxQuery [METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=fieldWeights, normFactors [STATE] fieldWeights...
class BM25FQuery extends DisjunctionMaxQuery { public BM25FQuery( Collection<Query> perFieldQueries, Map<String, Float> fieldWeights, Map<String, Float> normFactors) { super(perFieldQueries, 0.0f); this.fieldWeights = fieldWeights; this.normFactors = normFactors; } public BM25FQue...
false
ok
{"focal": {"class": "BM25FQuery", "name": "BM25FQuery", "signature": "BM25FQuery(Collection<Query> perFieldQueries, Map<String, Float> fieldWeights, Map<String, Float> normFactors)", "start_line": 3, "modifiers": "public", "params": [{"name": "perFieldQueries", "type": "Collection<Query>"}, {"name": "fieldWeights", "ty...
12508001_17
class QueuedVCatRenderer implements IVCatRenderer<W> { @Override public RenderedFileInfo render(final AbstractAllParams<W> all) throws VCatException { // Build a Job instance for the parameters. final String jobId = HashHelper.sha256Hex(all.getCombined()); Object lock; // Synchronized to jobs, as all code ...
// Use an artifical delay in the test renderer and try to render 100 times at the same time. // testRenderer.createGraphFile(...) should only be called once. testRenderer.setDelay(1000); TestAllParams params = new TestAllParams(); for (int i = 0; i < 99; i++) { new Thread(() -> { try { underTes...
[FOCAL] @Override public RenderedFileInfo QueuedVCatRenderer.render(AbstractAllParams<W> all) [CLASS] class QueuedVCatRenderer implements IVCatRenderer<W> [METRICS] loc=70 cc=6 branches=3 loops=1 returns=1 throws=1 nesting=3 [CALLS-INTERNAL] void runJob(String jobId, AbstractAllParams<W> all) [CALLS-EXTERNAL] HashHelpe...
/* static context [FOCAL] @Override public RenderedFileInfo QueuedVCatRenderer.render(AbstractAllParams<W> all) [THROWS-WHEN] VCatException when this.jobs.containsKey(jobId) && !this.jobsFinished.containsKey(jobId) && try-body throws && waiting > 1 && e != null [THROWS-WHEN] VCatException when this.jobs.containsKey(job...
/* static context [FOCAL] @Override public RenderedFileInfo QueuedVCatRenderer.render(AbstractAllParams<W> all) [THROWS-WHEN] VCatException when this.jobs.containsKey(jobId) && !this.jobsFinished.containsKey(jobId) && try-body throws && waiting > 1 && e != null [THROWS-WHEN] VCatException when this.jobs.containsKey(job...
true
ok
{"focal": {"class": "QueuedVCatRenderer", "name": "render", "signature": "RenderedFileInfo render(AbstractAllParams<W> all) throws VCatException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "all", "type": "AbstractAllParams<W>"}], "return_type": "RenderedFileInfo"}, "class_info": {"name": "Qu...
12520014_8
class SqliteUtil { public static Boolean toBoolean(Integer intValue) { if (intValue == null) { return null; } if (FALSE.equals(intValue)) { return Boolean.FALSE; } return Boolean.TRUE; } private SqliteUtil(); public static void putIfNot...
assertEquals(Boolean.TRUE, SqliteUtil.toBoolean(-1)); } }
[FOCAL] public static Boolean SqliteUtil.toBoolean(Integer intValue) [CLASS] class SqliteUtil [METRICS] loc=9 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] FALSE.equals/1 [PATH1] if(intValue == null)=F -> if(FALSE.equals(intValue))=T -> return Boolean.FALSE [PATH2] if(intValue == null)=T -> retu...
/* static context [FOCAL] public static Boolean SqliteUtil.toBoolean(Integer intValue) [PATH1] if(intValue == null)=F -> if(FALSE.equals(intValue))=T -> return Boolean.FALSE [PATH2] if(intValue == null)=T -> return null [PATH3] if(intValue == null)=F -> if(FALSE.equals(intValue))=F -> return Boolean.TRUE [INPUTS] branc...
/* static context [FOCAL] public static Boolean SqliteUtil.toBoolean(Integer intValue) [PATH1] if(intValue == null)=F -> if(FALSE.equals(intValue))=T -> return Boolean.FALSE [PATH2] if(intValue == null)=T -> return null [PATH3] if(intValue == null)=F -> if(FALSE.equals(intValue))=F -> return Boolean.TRUE [INPUTS] branc...
true
ok
{"focal": {"class": "SqliteUtil", "name": "toBoolean", "signature": "Boolean toBoolean(Integer intValue)", "start_line": 3, "modifiers": "public static", "params": [{"name": "intValue", "type": "Integer"}], "return_type": "Boolean"}, "class_info": {"name": "SqliteUtil", "kind": "class", "modifiers": "", "superclass": n...
12544638_6
class PathBuilder { public static ClassPath buildDefaultClassPath (Application app) { LinkedHashSet<File> classPathEntries = new LinkedHashSet<File>(); for (Resource resource : app.getActiveCodeResources()) { classPathEntries.add(resource.getFinalTarget()); } addClas...
ClassPath classPath = PathBuilder.buildDefaultClassPath(_application); String expectedClassPath = _firstJarFile.getAbsolutePath() + File.pathSeparator + _secondJarFile.getAbsolutePath(); assertEquals(expectedClassPath, classPath.asArgumentString()); } }
[FOCAL] public static ClassPath PathBuilder.buildDefaultClassPath(Application app) [CLASS] class PathBuilder [METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] void addClassPathDirectories(Application app, Set<File> classPathEntries) [CALLS-EXTERNAL] Application.getActiveCodeResources...
/* static context [FOCAL] public static ClassPath PathBuilder.buildDefaultClassPath(Application app) [PATH1] foreach(Resource resource : app.getActiveCodeResources())=T -> exit loop -> return new ClassPath(classPathEntries) [PATH2] foreach(Resource resource : app.getActiveCodeResources())=F -> return new ClassPath(clas...
/* static context [FOCAL] public static ClassPath PathBuilder.buildDefaultClassPath(Application app) [PATH1] foreach(Resource resource : app.getActiveCodeResources())=T -> exit loop -> return new ClassPath(classPathEntries) [PATH2] foreach(Resource resource : app.getActiveCodeResources())=F -> return new ClassPath(clas...
true
ok
{"focal": {"class": "PathBuilder", "name": "buildDefaultClassPath", "signature": "ClassPath buildDefaultClassPath(Application app)", "start_line": 3, "modifiers": "public static", "params": [{"name": "app", "type": "Application"}], "return_type": "ClassPath"}, "class_info": {"name": "PathBuilder", "kind": "class", "mod...
12555873_41
class FilterResolver { public boolean hasInsituFilter() { return parameters.getInsitu() != null; } public FilterResolver(IoParameters parameters); boolean shallBehaveBackwardsCompatible(); public boolean hasMobileFilter(); public boolean isMobileFilter(); public boolean isInsitu...
FilterResolver resolver = createResolver(createDefaults()); Assertions.assertFalse(resolver.hasInsituFilter()); } }
[FOCAL] public boolean FilterResolver.hasInsituFilter() [CLASS] class FilterResolver [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] parameters.getInsitu/0 [COLLABORATORS] field parameters getInsitu/0 [CLASS-MEMBERS] FilterResolver(IoParameters parameters); boolean shallBehaveBackw...
/* static context [FOCAL] public boolean FilterResolver.hasInsituFilter() [COLLABORATORS] field parameters getInsitu/0 [CALLS-EXTERNAL] parameters.getInsitu/0 */
/* static context [FOCAL] public boolean FilterResolver.hasInsituFilter() [COLLABORATORS] field parameters getInsitu/0 [CALLS-EXTERNAL] parameters.getInsitu/0 */ class FilterResolver { public boolean hasInsituFilter() { return parameters.getInsitu() != null; } public FilterResolver(IoParameters p...
true
ok
{"focal": {"class": "FilterResolver", "name": "hasInsituFilter", "signature": "boolean hasInsituFilter()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "FilterResolver", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "me...
12561697_1
class Kelly { private void reloadCacheEntry(CacheEntry cacheEntry) throws ExecutionException, InterruptedException { LoaderCallable<T> loaderCallable = new LoaderCallable<T>(this, cacheProvider, cacheLoader, cacheEntry); executorService.submit(loaderCallable); } @Deprecated public Kelly(C...
CacheProvider<String> cacheProvider = Mockito.mock(CacheProvider.class); CacheLoader<String> cacheLoader = Mockito.mock(CacheLoader.class); CacheEntry<String> cacheEntry = new CacheEntry<String>("dude", "suman karthik", 1); CacheEntry<String> cacheEntry1 = new CacheEntry<String>("dude"...
[FOCAL] private void Kelly.reloadCacheEntry(CacheEntry cacheEntry) [CLASS] class Kelly [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] executorService.submit/1 [NEW] LoaderCallable<T> [EXCEPTIONS] declares ExecutionException, InterruptedException [COLLABORATORS] field executorServi...
/* static context [FOCAL] private void Kelly.reloadCacheEntry(CacheEntry cacheEntry) [COLLABORATORS] field executorService submit/1 [EXCEPTIONS] declares ExecutionException, InterruptedException [NEW] LoaderCallable<T> [CALLS-EXTERNAL] executorService.submit/1 */
/* static context [FOCAL] private void Kelly.reloadCacheEntry(CacheEntry cacheEntry) [COLLABORATORS] field executorService submit/1 [EXCEPTIONS] declares ExecutionException, InterruptedException [NEW] LoaderCallable<T> [CALLS-EXTERNAL] executorService.submit/1 */ class Kelly { private void reloadCacheEntry(CacheEn...
true
ok
{"focal": {"class": "Kelly", "name": "reloadCacheEntry", "signature": "void reloadCacheEntry(CacheEntry cacheEntry) throws ExecutionException, InterruptedException", "start_line": 3, "modifiers": "private", "params": [{"name": "cacheEntry", "type": "CacheEntry"}], "return_type": "void"}, "class_info": {"name": "Kelly",...
12578911_0
class BeetlUtil { public static boolean checkNameing(String str) { char[] commonArray = new char[str.length()]; int len = 0; if (str == null || (len = str.length()) == 0) { return false; } str.getChars(0, len, commonArray, 0); int index = 0; char word = commonArray[index++]; //首字母判断 不为数字 , . ...
// for (int i = 0; i < 1000000; i++) { // Assert.assertTrue(condition); // Assert.assertTrue("checkNameing错误,验证:小写字母",BeetlUtil.checkNameing("abcdefghijklmnopqrstuvwxyz")); // Assert.assertTrue("checkNameing错误,验证:大写字母",BeetlUtil.checkNameing("ABCDEFGHIJKLMNOPQRSTUVWXYZ")); // Assert.assertTrue("checkNameing错误,...
[FOCAL] public static boolean BeetlUtil.checkNameing(String str) [CLASS] class BeetlUtil [METRICS] loc=31 cc=6 branches=5 loops=1 returns=4 throws=0 nesting=4 [CALLS-INTERNAL] void setLog(int index, int errorChar) [CALLS-EXTERNAL] String.length/0, String.getChars/4 [PATH1] if(str == null || (len = str.length()) == 0)=F...
/* static context [FOCAL] public static boolean BeetlUtil.checkNameing(String str) [PATH1] if(str == null || (len = str.length()) == 0)=F -> if(word >= 46 && word <= 57)=F -> if(commonArray[len - 1] == 46)=F -> while(true)=T -> if(word < 36 || word > 122 || chars[word - 36] == 0)=F -> if(index == len)=T -> return true ...
/* static context [FOCAL] public static boolean BeetlUtil.checkNameing(String str) [PATH1] if(str == null || (len = str.length()) == 0)=F -> if(word >= 46 && word <= 57)=F -> if(commonArray[len - 1] == 46)=F -> while(true)=T -> if(word < 36 || word > 122 || chars[word - 36] == 0)=F -> if(index == len)=T -> return true ...
true
ok
{"focal": {"class": "BeetlUtil", "name": "checkNameing", "signature": "boolean checkNameing(String str)", "start_line": 3, "modifiers": "public static", "params": [{"name": "str", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "BeetlUtil", "kind": "class", "modifiers": "", "superclass": null, "in...
12587918_4
class ByteArrayDiffs { public static byte[] undo(byte[] target, byte[] diff) { MemoryDiff md = Serials.deserialize(DefaultSerialization.newInstance(), MemoryDiff.class, diff); return Diffs.apply(new UndoOpQueue(md.queue()), target); } private ByteArrayDiffs(); public static byte[] diff(byte[] orig, byte[] t...
byte[] orig = "Hello World".getBytes(); byte[] target = "Hellish Cruel World".getBytes(); byte[] diff = ByteArrayDiffs.diff(orig, target); byte[] undone = ByteArrayDiffs.undo(target, diff); Assert.assertTrue(Arrays.equals(orig, undone)); } }
[FOCAL] public static byte[] ByteArrayDiffs.undo(byte[] target, byte[] diff) [CLASS] class ByteArrayDiffs [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Serials.deserialize/3, DefaultSerialization.newInstance/0, Diffs.apply/2, MemoryDiff.queue/0 [NEW] UndoOpQueue [INPUTS] branches...
/* static context [FOCAL] public static byte[] ByteArrayDiffs.undo(byte[] target, byte[] diff) [INPUTS] branches=- | result=diff, target [NEW] UndoOpQueue [CALLS-EXTERNAL] Serials.deserialize/3, DefaultSerialization.newInstance/0, Diffs.apply/2, MemoryDiff.queue/0 */
/* static context [FOCAL] public static byte[] ByteArrayDiffs.undo(byte[] target, byte[] diff) [INPUTS] branches=- | result=diff, target [NEW] UndoOpQueue [CALLS-EXTERNAL] Serials.deserialize/3, DefaultSerialization.newInstance/0, Diffs.apply/2, MemoryDiff.queue/0 */ class ByteArrayDiffs { public static byte[] undo(b...
true
ok
{"focal": {"class": "ByteArrayDiffs", "name": "undo", "signature": "byte[] undo(byte[] target, byte[] diff)", "start_line": 3, "modifiers": "public static", "params": [{"name": "target", "type": "byte[]"}, {"name": "diff", "type": "byte[]"}], "return_type": "byte[]"}, "class_info": {"name": "ByteArrayDiffs", "kind": "c...
12590126_3
class LoggableThreading { @Loggable(Loggable.DEBUG) public int foo() { return 1; } } class LoggableThreadingTest { @Test public void loggableThreadTerminates() throws Exception {
new LoggableThreading().foo(); Thread thread = null; final Set<Thread> keys = Thread.getAllStackTraces().keySet(); final Thread[] threads = keys.toArray(new Thread[keys.size()]); for (int idx = 0; idx < threads.length; idx++) { if (threads[idx].getName().equals("jcabi...
[FOCAL] @Loggable(Loggable.DEBUG) public int LoggableThreading.foo() [CLASS] class LoggableThreading [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [TEST] LoggableThreadingTest: @Test public void loggableThreadTerminates() throws Exception
/* static context [FOCAL] @Loggable(Loggable.DEBUG) public int LoggableThreading.foo() */
/* static context [FOCAL] @Loggable(Loggable.DEBUG) public int LoggableThreading.foo() */ class LoggableThreading { @Loggable(Loggable.DEBUG) public int foo() { return 1; } } class LoggableThreadingTest { @Test public void loggableThreadTerminates() throws Exception {
true
ok
{"focal": {"class": "LoggableThreading", "name": "foo", "signature": "int foo()", "start_line": 3, "modifiers": "@Loggable(Loggable.DEBUG) public", "params": [], "return_type": "int"}, "class_info": {"name": "LoggableThreading", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "me...
12593159_0
class HttpClientController { public Author getAuthorByURL(String link, Author a) throws IOException, SamlibParseException, SamlibInterruptException { a.setUrl(link); String str = getURL(mSamLibConfig.getAuthorIndexDate(a), new StringReader()); parseAuthorIndexDateData(a, str); ret...
Author author= new Author(); author=httpClientController.getAuthorByURL(AUTHOR_URI,author); assertTrue(author.getBooks().size()>0); assertTrue(author.getGroupBooks().size()>0); } }
[FOCAL] public Author HttpClientController.getAuthorByURL(String link, Author a) [CLASS] class HttpClientController [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String getURL(List<String> urls, PageReader reader); void parseAuthorIndexDateData(Author a, String text) [CALLS-EXTER...
/* static context [FOCAL] public Author HttpClientController.getAuthorByURL(String link, Author a) [INPUTS] branches=- | result=a [COLLABORATORS] param a:Author setUrl/1; field mSamLibConfig getAuthorIndexDate/1 [EXCEPTIONS] declares IOException, SamlibParseException, SamlibInterruptException [CALLS-INTERNAL] String ge...
/* static context [FOCAL] public Author HttpClientController.getAuthorByURL(String link, Author a) [INPUTS] branches=- | result=a [COLLABORATORS] param a:Author setUrl/1; field mSamLibConfig getAuthorIndexDate/1 [EXCEPTIONS] declares IOException, SamlibParseException, SamlibInterruptException [CALLS-INTERNAL] String ge...
true
ok
{"focal": {"class": "HttpClientController", "name": "getAuthorByURL", "signature": "Author getAuthorByURL(String link, Author a) throws IOException, SamlibParseException, SamlibInterruptException", "start_line": 3, "modifiers": "public", "params": [{"name": "link", "type": "String"}, {"name": "a", "type": "Author"}], "...
12652086_0
class Time implements Comparable<Time> { public static Time fromMillis(long timeInMillis) { int secs = (int) (timeInMillis / 1000); int nsecs = (int) (timeInMillis % 1000) * 1000000; return new Time(secs, nsecs); } public Time(); public Time(int secs, int nsecs); public Time(double secs); p...
assertEquals(new Time(0, 0), Time.fromMillis(0)); assertEquals(new Time(0, 1000000), Time.fromMillis(1)); assertEquals(new Time(1, 0), Time.fromMillis(1000)); assertEquals(new Time(10, 0), Time.fromMillis(10000)); assertEquals(new Time(1, 1000000), Time.fromMillis(1001)); assertEquals(new Time(1...
[FOCAL] public static Time Time.fromMillis(long timeInMillis) [CLASS] class Time implements Comparable<Time> [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] Time [INPUTS] branches=- | result=timeInMillis [DATAFLOW] nsecs@L3->L4; secs@L2->L4; timeInMillis@param->L2,L3 [CLASS-MEMBERS] Time(); T...
/* static context [FOCAL] public static Time Time.fromMillis(long timeInMillis) [INPUTS] branches=- | result=timeInMillis [NEW] Time */
/* static context [FOCAL] public static Time Time.fromMillis(long timeInMillis) [INPUTS] branches=- | result=timeInMillis [NEW] Time */ class Time implements Comparable<Time> { public static Time fromMillis(long timeInMillis) { int secs = (int) (timeInMillis / 1000); int nsecs = (int) (timeInMillis % 1000) *...
true
ok
{"focal": {"class": "Time", "name": "fromMillis", "signature": "Time fromMillis(long timeInMillis)", "start_line": 3, "modifiers": "public static", "params": [{"name": "timeInMillis", "type": "long"}], "return_type": "Time"}, "class_info": {"name": "Time", "kind": "class", "modifiers": "", "superclass": null, "interfac...
12652338_12
class OrderCalc { public long getPriceWithVAT(LineItem lineItem) { CalcLineItem calcLineItem = new CalcLineItem(lineItem); return getCalc().getPriceWithVat(calcLineItem).getCents(); } public OrderCalc(Order order); private Calc getCalc(); private static long sumOfAdjustments(Collection<Discount> d...
//no tax rate LineItem lineItem = new LineItem(); lineItem.setPrice(350L); assertEquals(350L, orderCalc.getPriceWithVAT(lineItem)); } }
[FOCAL] public long OrderCalc.getPriceWithVAT(LineItem lineItem) [CLASS] class OrderCalc [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Calc getCalc() [CALLS-EXTERNAL] getCalc().getPriceWithVat(calcLineItem).getCents/0, getCalc().getPriceWithVat/1 [NEW] CalcLineItem [INPUTS] branc...
/* static context [FOCAL] public long OrderCalc.getPriceWithVAT(LineItem lineItem) [INPUTS] branches=- | result=lineItem [CALLS-INTERNAL] Calc getCalc() [NEW] CalcLineItem [CALLS-EXTERNAL] getCalc().getPriceWithVat(calcLineItem).getCents/0, getCalc().getPriceWithVat/1 */
/* static context [FOCAL] public long OrderCalc.getPriceWithVAT(LineItem lineItem) [INPUTS] branches=- | result=lineItem [CALLS-INTERNAL] Calc getCalc() [NEW] CalcLineItem [CALLS-EXTERNAL] getCalc().getPriceWithVat(calcLineItem).getCents/0, getCalc().getPriceWithVat/1 */ class OrderCalc { public long getPriceWithVAT...
true
ok
{"focal": {"class": "OrderCalc", "name": "getPriceWithVAT", "signature": "long getPriceWithVAT(LineItem lineItem)", "start_line": 3, "modifiers": "public", "params": [{"name": "lineItem", "type": "LineItem"}], "return_type": "long"}, "class_info": {"name": "OrderCalc", "kind": "class", "modifiers": "", "superclass": nu...
12686435_0
class ProxyServer { public FutureTask<ProxyServer> run() { FutureTask<ProxyServer> future = new FutureTask<>(new Callable<ProxyServer>() { @Override public ProxyServer call() throws Exception { // Configure the server. bootstrap = new ServerBootstrap...
proxyServer = new ProxyServer(9090).run().get(); assertTrue(proxyServer != null); } }
[FOCAL] public FutureTask<ProxyServer> ProxyServer.run() [CLASS] class ProxyServer [METRICS] loc=32 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Executors.newCachedThreadPool/0, FiltersChangeNotifier.addFiltersListener/1, bootstrap.setPipelineFactory/1, bootstrap.setOption/2, bootstrap.bind/1, ...
/* static context [FOCAL] public FutureTask<ProxyServer> ProxyServer.run() [COLLABORATORS] field bootstrap setPipelineFactory/1,setOption/2,bind/1 [NEW] FutureTask<>, Callable<ProxyServer>, ServerBootstrap, NioServerSocketChannelFactory, CommonHttpPipeline, AdaptiveReceiveBufferSizePredictor, InetSocketAddress, Thread ...
/* static context [FOCAL] public FutureTask<ProxyServer> ProxyServer.run() [COLLABORATORS] field bootstrap setPipelineFactory/1,setOption/2,bind/1 [NEW] FutureTask<>, Callable<ProxyServer>, ServerBootstrap, NioServerSocketChannelFactory, CommonHttpPipeline, AdaptiveReceiveBufferSizePredictor, InetSocketAddress, Thread ...
true
ok
{"focal": {"class": "ProxyServer", "name": "run", "signature": "FutureTask<ProxyServer> run()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "FutureTask<ProxyServer>"}, "class_info": {"name": "ProxyServer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"na...
12768312_22
class EventsIterator implements Iterator<Serializable> { @Override public boolean hasNext() { return it != null; } public EventsIterator(Iterator<T> cit); private void advance(); @Override public Serializable next(); @Override public void remove(); } class EventsIteratorTest { ...
List<ChangeSet> lcs = new ArrayList<>(); for (int i = 0; i < 10; i++) { List<Integer> data = TestUtils.randomdata(0); assertEquals(data.size(), 0); ChangeSet cs = new DefaultChangeSet("BUCKET", "STREAM", 0, UUID.randomUUID().toString(), data); } Events...
[FOCAL] @Override public boolean EventsIterator.hasNext() [CLASS] class EventsIterator implements Iterator<Serializable> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] EventsIterator(Iterator<T> cit); void advance(); Serializable next(); void remove() [TEST] EventsIteratorTest: @Te...
/* static context [FOCAL] @Override public boolean EventsIterator.hasNext() */
/* static context [FOCAL] @Override public boolean EventsIterator.hasNext() */ class EventsIterator implements Iterator<Serializable> { @Override public boolean hasNext() { return it != null; } public EventsIterator(Iterator<T> cit); private void advance(); @Override public Serializa...
true
ok
{"focal": {"class": "EventsIterator", "name": "hasNext", "signature": "boolean hasNext()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "EventsIterator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Iterator<Serializable>", "fi...
12796207_5
class History implements Iterable<Object> { @NonNull public static Builder emptyBuilder() { return new Builder(Collections.emptyList()); } private History(List<Object> history); @NonNull public static History single(@NonNull Object key); private static Iterator<T> iterateFromBottom(List<Object> histor...
try { History.emptyBuilder().pop(); fail("Should throw"); } catch (IllegalStateException e) { // pass } } }
[FOCAL] @NonNull public static Builder History.emptyBuilder() [CLASS] class History implements Iterable<Object> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Collections.emptyList/0 [NEW] Builder [CLASS-MEMBERS] History(List<Object> history); History single(Object key); Iterator<...
/* static context [FOCAL] @NonNull public static Builder History.emptyBuilder() [NEW] Builder [CALLS-EXTERNAL] Collections.emptyList/0 */
/* static context [FOCAL] @NonNull public static Builder History.emptyBuilder() [NEW] Builder [CALLS-EXTERNAL] Collections.emptyList/0 */ class History implements Iterable<Object> { @NonNull public static Builder emptyBuilder() { return new Builder(Collections.emptyList()); } private History(List<Object> h...
true
ok
{"focal": {"class": "History", "name": "emptyBuilder", "signature": "Builder emptyBuilder()", "start_line": 3, "modifiers": "@NonNull public static", "params": [], "return_type": "Builder"}, "class_info": {"name": "History", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Iterable<Object>", "fields...
12796568_15
class Pair { public String getKey() { return key; } public Pair(final String key, final String value); public String getValue(); @Override public String toString(); Pair pair; } class PairTest { Pair pair; @Test public void testGetKey() {
assertEquals("key", pair.getKey()); } }
[FOCAL] public String Pair.getKey() [CLASS] class Pair [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Pair(String key, String value); String getValue(); String toString() [TEST] PairTest: @Test public void testGetKey() [TEST-FIELDS] Pair pair
/* static context [FOCAL] public String Pair.getKey() */
/* static context [FOCAL] public String Pair.getKey() */ class Pair { public String getKey() { return key; } public Pair(final String key, final String value); public String getValue(); @Override public String toString(); Pair pair; } class PairTest { Pair pair; @Test ...
true
ok
{"focal": {"class": "Pair", "name": "getKey", "signature": "String getKey()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Pair", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "pair", "type": "Pair", "modifiers": ...
12812578_34
class DependencyUtils { public static boolean hasDependency(final PluginContext context, final EssentialsDependency dependency) { final TargetPom targetPom = dependency.getDependencyTargetPom(); if (targetPom == TargetPom.INVALID) { return false; } final Model model = Pr...
final EssentialsDependency dependency = new DependencyRestful(); dependency.setTargetPom("cms"); dependency.setArtifactId("hippo-plugins-shared"); dependency.setVersion("1.01.00-SNAPSHOT"); dependency.setGroupId("org.onehippo.cms7.essentials"); assertEquals(TargetPom.CMS...
[FOCAL] public static boolean DependencyUtils.hasDependency(PluginContext context, EssentialsDependency dependency) [CLASS] class DependencyUtils [METRICS] loc=28 cc=6 branches=4 loops=1 returns=5 throws=0 nesting=3 [CALLS-INTERNAL] boolean isSameDependency(EssentialsDependency dependency, Dependency projectDependency)...
/* static context [FOCAL] public static boolean DependencyUtils.hasDependency(PluginContext context, EssentialsDependency dependency) [PATH1] if(targetPom == TargetPom.INVALID)=F -> foreach(Dependency projectDependency : dependencies)=T -> if(isSameDependency)=T -> if(Strings.isNullOrEmpty(ourVersion))=F -> if(Strings....
/* static context [FOCAL] public static boolean DependencyUtils.hasDependency(PluginContext context, EssentialsDependency dependency) [PATH1] if(targetPom == TargetPom.INVALID)=F -> foreach(Dependency projectDependency : dependencies)=T -> if(isSameDependency)=T -> if(Strings.isNullOrEmpty(ourVersion))=F -> if(Strings....
true
ok
{"focal": {"class": "DependencyUtils", "name": "hasDependency", "signature": "boolean hasDependency(PluginContext context, EssentialsDependency dependency)", "start_line": 3, "modifiers": "public static", "params": [{"name": "context", "type": "PluginContext"}, {"name": "dependency", "type": "EssentialsDependency"}], "...
12847265_23
class MeteredStaticMethodWithExceptions { @ExceptionMetered(name = "illegalArgumentExceptionMeteredStaticMethod", cause = IllegalArgumentException.class) public static void illegalArgumentExceptionMeteredStaticMethod(Runnable runnable) { runnable.run(); } @ExceptionMetered(name = "exceptionMet...
final RuntimeException exception = new IllegalStateException("message"); Runnable runnableThatThrowsIllegalStateException = new Runnable() { @Override public void run() { throw exception; } }; // Call the metered method and assert it h...
[FOCAL] @ExceptionMetered(name = "illegalArgumentExceptionMeteredStaticMethod", cause = IllegalArgumentException.class) publi... void MeteredStaticMethodWithExceptions.illegalArgumentExceptionMeteredStaticMethod(Runnable runnable) [CLASS] class MeteredStaticMethodWithExceptions [METRICS] loc=4 cc=1 branches=0 loops=0 r...
/* static context [FOCAL] @ExceptionMetered(name = "illegalArgumentExceptionMeteredStaticMethod", cause = IllegalArgumentException.class) publi... void MeteredStaticMethodWithExceptions.illegalArgumentExceptionMeteredStaticMethod(Runnable runnable) [COLLABORATORS] param runnable:Runnable run/0 [CALLS-EXTERNAL] Runnable...
/* static context [FOCAL] @ExceptionMetered(name = "illegalArgumentExceptionMeteredStaticMethod", cause = IllegalArgumentException.class) publi... void MeteredStaticMethodWithExceptions.illegalArgumentExceptionMeteredStaticMethod(Runnable runnable) [COLLABORATORS] param runnable:Runnable run/0 [CALLS-EXTERNAL] Runnable...
true
ok
{"focal": {"class": "MeteredStaticMethodWithExceptions", "name": "illegalArgumentExceptionMeteredStaticMethod", "signature": "void illegalArgumentExceptionMeteredStaticMethod(Runnable runnable)", "start_line": 3, "modifiers": "@ExceptionMetered(name = \"illegalArgumentExceptionMeteredStaticMethod\", cause = IllegalArgu...
12854207_1
class DBToolsInit { public void initDBTools(String schemaDir) { DBToolsFiles.copyXsdFileToSchemaDir(schemaDir); DBToolsFiles.copySampleSchemaFileToSchemaDir(schemaDir); } } class DBToolsInitTest { @Test public void testInitDBTools() throws Exception {
String userDir = System.getProperty("user.dir"); String databaseSchemaDir = userDir + "/build/test-src/src/main/database"; DBToolsInit init = new DBToolsInit(); init.initDBTools(databaseSchemaDir); assertTrue("schema.xml exists", new File(databaseSchemaDir, "schema.xml").exists...
[FOCAL] public void DBToolsInit.initDBTools(String schemaDir) [CLASS] class DBToolsInit [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] DBToolsFiles.copyXsdFileToSchemaDir/1, DBToolsFiles.copySampleSchemaFileToSchemaDir/1 [DATAFLOW] schemaDir@param->L2,L3 [TEST] DBToolsInitTest: @T...
/* static context [FOCAL] public void DBToolsInit.initDBTools(String schemaDir) [CALLS-EXTERNAL] DBToolsFiles.copyXsdFileToSchemaDir/1, DBToolsFiles.copySampleSchemaFileToSchemaDir/1 */
/* static context [FOCAL] public void DBToolsInit.initDBTools(String schemaDir) [CALLS-EXTERNAL] DBToolsFiles.copyXsdFileToSchemaDir/1, DBToolsFiles.copySampleSchemaFileToSchemaDir/1 */ class DBToolsInit { public void initDBTools(String schemaDir) { DBToolsFiles.copyXsdFileToSchemaDir(schemaDir); D...
true
ok
{"focal": {"class": "DBToolsInit", "name": "initDBTools", "signature": "void initDBTools(String schemaDir)", "start_line": 3, "modifiers": "public", "params": [{"name": "schemaDir", "type": "String"}], "return_type": "void"}, "class_info": {"name": "DBToolsInit", "kind": "class", "modifiers": "", "superclass": null, "i...
12918104_20
class Git { public static String clone(String URL) throws Exception { File tempDirectory = new File(Configuration.getTemporaryDirectory() + "/" + Calendar.getInstance().getTime().getTime() + ""); Main.printLine("[Info] Cloning from \"" +URL+ "\""); ProcessBuilder builder = new ProcessBuilder("git","clone", U...
boolean exceptionThrown = false; try { Git.clone("https://github.com/non-existing-git-repo"); } catch (Exception e) { exceptionThrown = true; } assertTrue(exceptionThrown); } }
[FOCAL] public static String Git.clone(String URL) [CLASS] class Git [METRICS] loc=22 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] Configuration.getTemporaryDirectory/0, Calendar.getInstance().getTime().getTime/0, Calendar.getInstance().getTime/0, Calendar.getInstance/0, Main.printLine/1, File....
/* static context [FOCAL] public static String Git.clone(String URL) [THROWS-WHEN] Exception when !(exitValue == 0) [PATH1] if(exitValue == 0)=T -> return tempDirectory.getAbsolutePath() [PATH2] if(exitValue == 0)=F -> throw new Exception(exitValue + "") [INPUTS] branches=URL | result=URL [EXCEPTIONS] declares Exceptio...
/* static context [FOCAL] public static String Git.clone(String URL) [THROWS-WHEN] Exception when !(exitValue == 0) [PATH1] if(exitValue == 0)=T -> return tempDirectory.getAbsolutePath() [PATH2] if(exitValue == 0)=F -> throw new Exception(exitValue + "") [INPUTS] branches=URL | result=URL [EXCEPTIONS] declares Exceptio...
true
ok
{"focal": {"class": "Git", "name": "clone", "signature": "String clone(String URL) throws Exception", "start_line": 3, "modifiers": "public static", "params": [{"name": "URL", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Git", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ...
12939200_53
class Log4JLogger extends AbstractInternalLogger { public void debug(String msg) { logger.debug(msg); } Log4JLogger(Logger logger); public void debug(String msg, Throwable cause); public void error(String msg); public void error(String msg, Throwable cause); public void info(Str...
Logger mock = createStrictMock(Logger.class); mock.debug("a", e); replay(mock); InternalLogger logger = new Log4JLogger(mock); logger.debug("a", e); verify(mock); } }
[FOCAL] public void Log4JLogger.debug(String msg) [CLASS] class Log4JLogger extends AbstractInternalLogger [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] logger.debug/1 [DATAFLOW] msg@param->L2 [CLASS-MEMBERS] Log4JLogger(Logger logger); void debug(String msg, Throwable cause); vo...
/* static context [FOCAL] public void Log4JLogger.debug(String msg) [CALLS-EXTERNAL] logger.debug/1 */
/* static context [FOCAL] public void Log4JLogger.debug(String msg) [CALLS-EXTERNAL] logger.debug/1 */ class Log4JLogger extends AbstractInternalLogger { public void debug(String msg) { logger.debug(msg); } Log4JLogger(Logger logger); public void debug(String msg, Throwable cause); publ...
true
ok
{"focal": {"class": "Log4JLogger", "name": "debug", "signature": "void debug(String msg)", "start_line": 3, "modifiers": "public", "params": [{"name": "msg", "type": "String"}], "return_type": "void"}, "class_info": {"name": "Log4JLogger", "kind": "class", "modifiers": "", "superclass": "AbstractInternalLogger", "inter...
12953256_122
class LongUtils { public static int unionSize(LongSortedSet a, LongSortedSet b) { return a.size() + b.size() - intersectSize(a, b); } private LongUtils(); public static Long2DoubleSortedMap frozenMap(Map<Long,Double> map); public static LongSortedSet frozenSet(Collection<Long> longs); ...
assertThat(unionSize(LongSortedSets.EMPTY_SET, LongSortedSets.EMPTY_SET), equalTo(0)); } }
[FOCAL] public static int LongUtils.unionSize(LongSortedSet a, LongSortedSet b) [CLASS] class LongUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int intersectSize(LongSortedSet a, LongSortedSet b) [CALLS-EXTERNAL] LongSortedSet.size/0 [INPUTS] branches=- | result=a, b [COLLA...
/* static context [FOCAL] public static int LongUtils.unionSize(LongSortedSet a, LongSortedSet b) [INPUTS] branches=- | result=a, b [COLLABORATORS] param a:LongSortedSet size/0; param b:LongSortedSet size/0 [CALLS-INTERNAL] int intersectSize(LongSortedSet a, LongSortedSet b) [CALLS-EXTERNAL] LongSortedSet.size/0 */
/* static context [FOCAL] public static int LongUtils.unionSize(LongSortedSet a, LongSortedSet b) [INPUTS] branches=- | result=a, b [COLLABORATORS] param a:LongSortedSet size/0; param b:LongSortedSet size/0 [CALLS-INTERNAL] int intersectSize(LongSortedSet a, LongSortedSet b) [CALLS-EXTERNAL] LongSortedSet.size/0 */ cla...
true
ok
{"focal": {"class": "LongUtils", "name": "unionSize", "signature": "int unionSize(LongSortedSet a, LongSortedSet b)", "start_line": 3, "modifiers": "public static", "params": [{"name": "a", "type": "LongSortedSet"}, {"name": "b", "type": "LongSortedSet"}], "return_type": "int"}, "class_info": {"name": "LongUtils", "kin...
12959153_0
class TagTokenizer implements Tokenizer { @Override @NonNull public List<Range> findTokenRanges(CharSequence charSequence, int start, int end) { ArrayList<Range>result = new ArrayList<>(); if (start == end) { //Can't have a 0 length token return result; } ...
String test = "@bears #tokens"; List<Range> ranges = tokenizer.findTokenRanges(test, 0, test.length()); assertEquals(Arrays.asList(new Range(0, 6), new Range(7, 14)), ranges); assertEquals("@bears", test.substring(ranges.get(0).start, ranges.get(0).end)); assertEquals("#tokens", ...
[FOCAL] @Override @NonNull public List<Range> TagTokenizer.findTokenRanges(CharSequence charSequence, int start, int end) [CLASS] class TagTokenizer implements Tokenizer [METRICS] loc=39 cc=7 branches=5 loops=1 returns=2 throws=0 nesting=3 [CALLS-INTERNAL] boolean isTokenTerminator(char character) [CALLS-EXTERNAL] Char...
/* static context [FOCAL] @Override @NonNull public List<Range> TagTokenizer.findTokenRanges(CharSequence charSequence, int start, int end) [PATH1] if(start == end)=F -> for(cursor < end)=T -> if(isTokenTerminator(character))=T -> if(cursor - 1 > tokenStart)=T -> if(tagPrefixes.contains(character))=T -> exit loop -> if...
/* static context [FOCAL] @Override @NonNull public List<Range> TagTokenizer.findTokenRanges(CharSequence charSequence, int start, int end) [PATH1] if(start == end)=F -> for(cursor < end)=T -> if(isTokenTerminator(character))=T -> if(cursor - 1 > tokenStart)=T -> if(tagPrefixes.contains(character))=T -> exit loop -> if...
true
ok
{"focal": {"class": "TagTokenizer", "name": "findTokenRanges", "signature": "List<Range> findTokenRanges(CharSequence charSequence, int start, int end)", "start_line": 3, "modifiers": "@Override @NonNull public", "params": [{"name": "charSequence", "type": "CharSequence"}, {"name": "start", "type": "int"}, {"name": "en...
12960439_18
class RedundancyCalculator { public ImmutableList<TransferSegment> createStateList(Layout layout, long trimMark) { return layout.getSegments() .stream() // Keep all the segments after the trim mark, except the open one. .filter(segment -> segment.getEnd() != ...
RedundancyCalculator redundancyCalculator = new RedundancyCalculator("localhost"); Layout layout = createNonPresentLayout(); // node is not present anywhere, trim mark starts from the middle of a second segment -> // transfer half of second and third segments Im...
[FOCAL] public ImmutableList<TransferSegment> RedundancyCalculator.createStateList(Layout layout, long trimMark) [CLASS] class RedundancyCalculator [METRICS] loc=44 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] boolean segmentContainsServer(LayoutSegment segment, String server) [CALLS-EXTERNAL] ...
/* static context [FOCAL] public ImmutableList<TransferSegment> RedundancyCalculator.createStateList(Layout layout, long trimMark) [INPUTS] branches=- | result=layout, trimMark [COLLABORATORS] param layout:Layout getSegments/0; field segment getEnd/0,getStart/0,getAllLogServers/0 [CALLS-INTERNAL] boolean segmentContain...
/* static context [FOCAL] public ImmutableList<TransferSegment> RedundancyCalculator.createStateList(Layout layout, long trimMark) [INPUTS] branches=- | result=layout, trimMark [COLLABORATORS] param layout:Layout getSegments/0; field segment getEnd/0,getStart/0,getAllLogServers/0 [CALLS-INTERNAL] boolean segmentContain...
true
ok
{"focal": {"class": "RedundancyCalculator", "name": "createStateList", "signature": "ImmutableList<TransferSegment> createStateList(Layout layout, long trimMark)", "start_line": 3, "modifiers": "public", "params": [{"name": "layout", "type": "Layout"}, {"name": "trimMark", "type": "long"}], "return_type": "ImmutableLis...
12962336_18
class TransactionResult implements Comparable<TransactionResult> { public static TransactionResult fromJSON(JSONObject json) { boolean binary; String metaKey = json.has("meta") ? "meta" : "metaData"; String txKey = json.has("transaction") ? "transaction" : json.has(...
TransactionResult tr = TransactionResult.fromJSON(request_tx_binary_result); assertHelper(tr); tr = new TransactionResult(request_tx_binary_result, Source.request_tx_binary); assertHelper(tr); } }
[FOCAL] public static TransactionResult TransactionResult.fromJSON(JSONObject json) [CLASS] class TransactionResult implements Comparable<TransactionResult> [METRICS] loc=41 cc=7 branches=6 loops=0 returns=1 throws=1 nesting=3 [CALLS-INTERNAL] STObject parseObject(JSONObject json, String key, boolean binary) [CALLS-EXT...
/* static context [FOCAL] public static TransactionResult TransactionResult.fromJSON(JSONObject json) [THROWS-WHEN] RuntimeException when txKey == null && !json.has("TransactionType") [PATH1] if(txKey == null && !json.has("TransactionType"))=F -> if(txKey == null)=F -> if(json.has("hash"))=F -> if(binary)=T -> if(ledge...
/* static context [FOCAL] public static TransactionResult TransactionResult.fromJSON(JSONObject json) [THROWS-WHEN] RuntimeException when txKey == null && !json.has("TransactionType") [PATH1] if(txKey == null && !json.has("TransactionType"))=F -> if(txKey == null)=F -> if(json.has("hash"))=F -> if(binary)=T -> if(ledge...
true
ok
{"focal": {"class": "TransactionResult", "name": "fromJSON", "signature": "TransactionResult fromJSON(JSONObject json)", "start_line": 3, "modifiers": "public static", "params": [{"name": "json", "type": "JSONObject"}], "return_type": "TransactionResult"}, "class_info": {"name": "TransactionResult", "kind": "class", "m...
12963511_14
class Jose4jJWTService implements JWTService { @Override public String encode( String jti, String issuer, String subject, Date currentTime, String method, String path, String contentHashAlgorithm, String contentHash ) throws JWTError { JwtClaims jwtClaims = new JwtClaims(); jwtC...
Map<String, Object> expected = new HashMap<>(); expected.put("jti", "Expected JTI"); expected.put("iss", ENTITY_IDENTIFIER); expected.put("sub", null); expected.put("aud", PLATFORM_IDENTIFIER); expected.put("iat", Long.valueOf(platformDate.getTime() / 1000)); exp...
[FOCAL] @Override public String Jose4jJWTService.encode(String jti, String issuer, String subject, Date currentTime, String method, String path, String contentHashAlgorithm, String contentHash) [CLASS] class Jose4jJWTService implements JWTService [METRICS] loc=42 cc=3 branches=1 loops=0 returns=1 throws=1 nesting=1 [CA...
/* static context [FOCAL] @Override public String Jose4jJWTService.encode(String jti, String issuer, String subject, Date currentTime, String method, String path, String contentHashAlgorithm, String contentHash) [THROWS-WHEN] JWTError when contentHashAlgorithm != null && try-body throws [THROWS-WHEN] JWTError when !(co...
/* static context [FOCAL] @Override public String Jose4jJWTService.encode(String jti, String issuer, String subject, Date currentTime, String method, String path, String contentHashAlgorithm, String contentHash) [THROWS-WHEN] JWTError when contentHashAlgorithm != null && try-body throws [THROWS-WHEN] JWTError when !(co...
true
ok
{"focal": {"class": "Jose4jJWTService", "name": "encode", "signature": "String encode(String jti, String issuer, String subject, Date currentTime, String method, String path, String contentHashAlgorithm, String contentHash) throws JWTError", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "jti", "...
12974177_0
class AffinityLock implements Closeable { @NotNull public static String dumpLocks() { return LOCK_INVENTORY.dumpLocks(); } AffinityLock(int cpuId, boolean base, boolean reservable, LockInventory lockInventory); public static void cpuLayout(@NotNull CpuLayout cpuLayout); @NotNull pub...
LockInventory lockInventory = new LockInventory(VanillaCpuLayout.fromCpuInfo("i7.cpuinfo")); AffinityLock[] locks = { new AffinityLock(0, true, false, lockInventory), new AffinityLock(1, false, false, lockInventory), new AffinityLock(2, false, true, lockIn...
[FOCAL] @NotNull public static String AffinityLock.dumpLocks() [CLASS] class AffinityLock implements Closeable [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] LOCK_INVENTORY.dumpLocks/0 [CLASS-MEMBERS] AffinityLock(int cpuId, boolean base, boolean reservable, LockInventory lockInve...
/* static context [FOCAL] @NotNull public static String AffinityLock.dumpLocks() [CALLS-EXTERNAL] LOCK_INVENTORY.dumpLocks/0 */
/* static context [FOCAL] @NotNull public static String AffinityLock.dumpLocks() [CALLS-EXTERNAL] LOCK_INVENTORY.dumpLocks/0 */ class AffinityLock implements Closeable { @NotNull public static String dumpLocks() { return LOCK_INVENTORY.dumpLocks(); } AffinityLock(int cpuId, boolean base, boo...
true
ok
{"focal": {"class": "AffinityLock", "name": "dumpLocks", "signature": "String dumpLocks()", "start_line": 3, "modifiers": "@NotNull public static", "params": [], "return_type": "String"}, "class_info": {"name": "AffinityLock", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Closeable", "fields": [{...
12983151_0
class FS20CommandHelper { public static FS20Command convertHABCommandToFS20Command(Command command) { if (command instanceof UpDownType) { return convertUpDownType((UpDownType) command); } else if (command instanceof OnOffType) { return convertOnOffType((OnOffType) command);...
Command command = new PercentType(80); FS20Command fs20Command = FS20CommandHelper.convertHABCommandToFS20Command(command); // Test for issue: FS20 - Converting Value to raw-message fails #1635 // see: https://github.com/openhab/openhab/issues/1635 assertNotEquals(fs20Command, FS20Command.UNKNOWN); asser...
[FOCAL] public static FS20Command FS20CommandHelper.convertHABCommandToFS20Command(Command command) [CLASS] class FS20CommandHelper [METRICS] loc=10 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=3 [CALLS-INTERNAL] FS20Command convertOnOffType(OnOffType onOff); FS20Command convertPercentType(PercentType percentType...
/* static context [FOCAL] public static FS20Command FS20CommandHelper.convertHABCommandToFS20Command(Command command) [PATH1] if(command instanceof UpDownType)=F -> if(command instanceof OnOffType)=F -> if(command instanceof PercentType)=T -> return convertPercentType((PercentType) command) [PATH2] if(command instanceo...
/* static context [FOCAL] public static FS20Command FS20CommandHelper.convertHABCommandToFS20Command(Command command) [PATH1] if(command instanceof UpDownType)=F -> if(command instanceof OnOffType)=F -> if(command instanceof PercentType)=T -> return convertPercentType((PercentType) command) [PATH2] if(command instanceo...
true
ok
{"focal": {"class": "FS20CommandHelper", "name": "convertHABCommandToFS20Command", "signature": "FS20Command convertHABCommandToFS20Command(Command command)", "start_line": 3, "modifiers": "public static", "params": [{"name": "command", "type": "Command"}], "return_type": "FS20Command"}, "class_info": {"name": "FS20Com...
13028147_119
class ValidationResult { public void assertOk() { if (hasErrors()) { throw new MrrtReportTemplateValidationException(this); } } public ValidationResult(); public List<ValidationError> getErrors(); public void addError(String description, String messageCode); publi...
expectedException.expect(MrrtReportTemplateValidationException.class); validationResultWithErrors.assertOk(); } }
[FOCAL] public void ValidationResult.assertOk() [CLASS] class ValidationResult [METRICS] loc=5 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1 [CALLS-INTERNAL] boolean hasErrors() [NEW] MrrtReportTemplateValidationException [EXCEPTIONS] throws MrrtReportTemplateValidationException [THROWS-WHEN] MrrtReportTemplateV...
/* static context [FOCAL] public void ValidationResult.assertOk() [THROWS-WHEN] MrrtReportTemplateValidationException when hasErrors() [PATH1] if(hasErrors())=T -> throw new MrrtReportTemplateValidationException(this) [PATH2] if(hasErrors())=F [EXCEPTIONS] throws MrrtReportTemplateValidationException [CALLS-INTERNAL] b...
/* static context [FOCAL] public void ValidationResult.assertOk() [THROWS-WHEN] MrrtReportTemplateValidationException when hasErrors() [PATH1] if(hasErrors())=T -> throw new MrrtReportTemplateValidationException(this) [PATH2] if(hasErrors())=F [EXCEPTIONS] throws MrrtReportTemplateValidationException [CALLS-INTERNAL] b...
true
ok
{"focal": {"class": "ValidationResult", "name": "assertOk", "signature": "void assertOk()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "ValidationResult", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "expectedExce...
13062062_215
class ExtractOptionsPane extends HBox implements TaskParametersBuildStep<ExtractParametersBuilder>, RestorableView, ResettableView { @Override public void restoreStateFrom(Map<String, String> data) { field.setText(Optional.ofNullable(data.get("pages")).orElse(EMPTY)); } ExtractOptionsPane();...
Map<String, String> data = new HashMap<>(); data.put("pages", "100"); WaitForAsyncUtils.waitForAsyncFx(2000, () -> victim.restoreStateFrom(data)); ValidableTextField field = lookup("#extractRanges").queryAs(ValidableTextField.class); assertEquals("100", field.getText()); } }
[FOCAL] @Override public void ExtractOptionsPane.restoreStateFrom(Map<String, String> data) [CLASS] class ExtractOptionsPane extends HBox implements TaskParametersBuildStep<ExtractParametersBuilder>, RestorableView, ResettableView [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] fie...
/* static context [FOCAL] @Override public void ExtractOptionsPane.restoreStateFrom(Map<String, String> data) [COLLABORATORS] field field setText/1; param data:Map<String, String> get/1 [CALLS-EXTERNAL] field.setText/1, Optional.ofNullable(data.get("pages")).orElse/1, Optional.ofNullable/1, Map<String, String>.get/1 */...
/* static context [FOCAL] @Override public void ExtractOptionsPane.restoreStateFrom(Map<String, String> data) [COLLABORATORS] field field setText/1; param data:Map<String, String> get/1 [CALLS-EXTERNAL] field.setText/1, Optional.ofNullable(data.get("pages")).orElse/1, Optional.ofNullable/1, Map<String, String>.get/1 */...
true
ok
{"focal": {"class": "ExtractOptionsPane", "name": "restoreStateFrom", "signature": "void restoreStateFrom(Map<String, String> data)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "data", "type": "Map<String, String>"}], "return_type": "void"}, "class_info": {"name": "ExtractOptionsPane", "kind"...
13073335_8
class OperatorFormatter { public String formatCondition( Operator op, String objectName, String value, boolean parameterized ) { if ( parameterized ) { value = "[param:" + value.replaceAll( "[\\{\\}]", "" ) + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } else if ( op == Operator.IN ) {...
final OperatorFormatter f = new OperatorFormatter(); final String objectName = "[CAT.COL]"; //$NON-NLS-1$ String formatted = f.formatCondition( Operator.IN, objectName, "2| \"value\" ", false ); //$NON-NLS-1$ Assert.assertEquals( "IN([CAT.COL];\"2\";\"value\")", formatted ); //$NON-NLS-1$ } }
[FOCAL] public String OperatorFormatter.formatCondition(Operator op, String objectName, String value, boolean parameterized) [CLASS] class OperatorFormatter [METRICS] loc=58 cc=17 branches=7 loops=1 returns=1 throws=0 nesting=4 [CALLS-EXTERNAL] String.replaceAll/2, IN_EVAL_PAT.matcher/1, Matcher.find/0, StringBuilder.l...
/* static context [FOCAL] public String OperatorFormatter.formatCondition(Operator op, String objectName, String value, boolean parameterized) [PATH1] if(parameterized)=F -> if(op == Operator.IN)=T -> while(m.find())=T -> if(sb.length() > 0)#1=T -> exit loop -> if(sb.length() > 0)#2=T -> switch(op)=default -> if(op.get...
/* static context [FOCAL] public String OperatorFormatter.formatCondition(Operator op, String objectName, String value, boolean parameterized) [PATH1] if(parameterized)=F -> if(op == Operator.IN)=T -> while(m.find())=T -> if(sb.length() > 0)#1=T -> exit loop -> if(sb.length() > 0)#2=T -> switch(op)=default -> if(op.get...
true
ok
{"focal": {"class": "OperatorFormatter", "name": "formatCondition", "signature": "String formatCondition(Operator op, String objectName, String value, boolean parameterized)", "start_line": 3, "modifiers": "public", "params": [{"name": "op", "type": "Operator"}, {"name": "objectName", "type": "String"}, {"name": "value...
13075106_43
class RadixSort { public static void radixSort(int[] input, int n, int[] scratch, int[] countScratch) { if (countScratch.length != 65536) throw new IllegalArgumentException("countScratch.length must be = 65536"); if (input.length < n) throw new IllegalArgumentException("input.length must be >= n");...
Random r = new Random(); final int n = 10000000; int[] test1 = new int[n]; int[] test2 = new int[n]; int[] scratch = new int[n]; int[] countScratch = new int[65536]; for (int z = 0; z < 10; ++z) { for (int i = 0; i < n; i++) { int x = r...
[FOCAL] public static void RadixSort.radixSort(int[] input, int n, int[] scratch, int[] countScratch) [CLASS] class RadixSort [METRICS] loc=33 cc=10 branches=3 loops=6 returns=0 throws=3 nesting=1 [CALLS-EXTERNAL] Arrays.fill/2 [NEW] IllegalArgumentException [EXCEPTIONS] throws IllegalArgumentException [THROWS-WHEN] Il...
/* static context [FOCAL] public static void RadixSort.radixSort(int[] input, int n, int[] scratch, int[] countScratch) [THROWS-WHEN] IllegalArgumentException when countScratch.length != 65536 [THROWS-WHEN] IllegalArgumentException when !(countScratch.length != 65536) && input.length < n [THROWS-WHEN] IllegalArgumentEx...
/* static context [FOCAL] public static void RadixSort.radixSort(int[] input, int n, int[] scratch, int[] countScratch) [THROWS-WHEN] IllegalArgumentException when countScratch.length != 65536 [THROWS-WHEN] IllegalArgumentException when !(countScratch.length != 65536) && input.length < n [THROWS-WHEN] IllegalArgumentEx...
true
ok
{"focal": {"class": "RadixSort", "name": "radixSort", "signature": "void radixSort(int[] input, int n, int[] scratch, int[] countScratch)", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "int[]"}, {"name": "n", "type": "int"}, {"name": "scratch", "type": "int[]"}, {"name": "countScr...
13075200_44
class AbstractGroupsPayload { protected String[] convertToStringArray(final Payload payload, final String payloadMapKey) throws IllegalArgumentException { // historically, null values are allowed in the result, reasons unknown return extractNonNullValueFromMapPayload(payload, payloadMapKey, o -> co...
assertThatThrownBy(() -> subclass.convertToStringArray(makeStubMapPayload(MAP_KEY, null), MAP_KEY)) .isInstanceOf(NullPointerException.class) .hasMessageContaining(MAP_KEY); assertThat(subclass.convertToStringArray(makeStubMapPayload(MAP_KEY, singletonList("footest")), MA...
[FOCAL] protected String[] AbstractGroupsPayload.convertToStringArray(Payload payload, String payloadMapKey) [CLASS] class AbstractGroupsPayload [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] List<T> convertToList(Object o); T extractNonNullValueFromMapPayload(Payload payload, Str...
/* static context [FOCAL] protected String[] AbstractGroupsPayload.convertToStringArray(Payload payload, String payloadMapKey) [INPUTS] branches=- | result=payload, payloadMapKey [EXCEPTIONS] declares IllegalArgumentException [CALLS-INTERNAL] List<T> convertToList(Object o); T extractNonNullValueFromMapPayload(Payload ...
/* static context [FOCAL] protected String[] AbstractGroupsPayload.convertToStringArray(Payload payload, String payloadMapKey) [INPUTS] branches=- | result=payload, payloadMapKey [EXCEPTIONS] declares IllegalArgumentException [CALLS-INTERNAL] List<T> convertToList(Object o); T extractNonNullValueFromMapPayload(Payload ...
true
ok
{"focal": {"class": "AbstractGroupsPayload", "name": "convertToStringArray", "signature": "String[] convertToStringArray(Payload payload, String payloadMapKey) throws IllegalArgumentException", "start_line": 3, "modifiers": "protected", "params": [{"name": "payload", "type": "Payload"}, {"name": "payloadMapKey", "type"...
13077546_22
class StringDictionaryEncoder extends DictionaryEncoder { @Override public int size() { return numElements; } public StringDictionaryEncoder(MemoryEstimate memoryEstimate); public StringDictionaryEncoder(boolean sortKeys, boolean sortByStride, MemoryEstimate memoryEstimate); private int getSi...
String [] v = new String[] {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}; StringDictionaryEncoder dict = buildDictionary(v, true); assertEquals(26, dict.size()); checkContent(dict, v, new int[]{0,...
[FOCAL] @Override public int StringDictionaryEncoder.size() [CLASS] class StringDictionaryEncoder extends DictionaryEncoder [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] StringDictionaryEncoder(MemoryEstimate memoryEstimate); StringDictionaryEncoder(boolean sortKeys, boolean sortB...
/* static context [FOCAL] @Override public int StringDictionaryEncoder.size() */
/* static context [FOCAL] @Override public int StringDictionaryEncoder.size() */ class StringDictionaryEncoder extends DictionaryEncoder { @Override public int size() { return numElements; } public StringDictionaryEncoder(MemoryEstimate memoryEstimate); public StringDictionaryEncoder(boolean sortKeys,...
true
ok
{"focal": {"class": "StringDictionaryEncoder", "name": "size", "signature": "int size()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "StringDictionaryEncoder", "kind": "class", "modifiers": "", "superclass": "DictionaryEncoder", "interfaces": null, "fie...
13095397_0
class JdbcTemplateSqlExecutor implements SqlExecutor { public void execute( final String[] sql, final ExecutorCallback callback ) throws DataAccessException { Exception exceptionDuringExecute = null; DatabaseMeta dbMeta = connectionModel.getDatabaseMeta( ); String url = null; try { url = dbMet...
// set up final DatabaseMeta dbMeta = context.mock(DatabaseMeta.class); context.checking(new Expectations() { { one(dbMeta).getName(); will(returnValue("")); one(dbMeta).getXML(); will(returnValue(null)); allowing(dbMeta).getURL(); will(returnValue("jdbc...
[FOCAL] public void JdbcTemplateSqlExecutor.execute(String[] sql, ExecutorCallback callback) [CLASS] class JdbcTemplateSqlExecutor implements SqlExecutor [METRICS] loc=44 cc=4 branches=1 loops=0 returns=0 throws=1 nesting=2 [CALLS-INTERNAL] String[] removeCommentsAndSemicolons(Schema schema, String[] sql) [CALLS-EXTERN...
/* static context [FOCAL] public void JdbcTemplateSqlExecutor.execute(String[] sql, ExecutorCallback callback) [THROWS-WHEN] DataAccessException when try-body throws [PATH1] try-body throws -> throw new DataAccessException( "DatabaseMeta problem", e ) { private stat... [PATH2] try-body throws -> if(logger.isErrorEnable...
/* static context [FOCAL] public void JdbcTemplateSqlExecutor.execute(String[] sql, ExecutorCallback callback) [THROWS-WHEN] DataAccessException when try-body throws [PATH1] try-body throws -> throw new DataAccessException( "DatabaseMeta problem", e ) { private stat... [PATH2] try-body throws -> if(logger.isErrorEnable...
true
ok
{"focal": {"class": "JdbcTemplateSqlExecutor", "name": "execute", "signature": "void execute(String[] sql, ExecutorCallback callback) throws DataAccessException", "start_line": 3, "modifiers": "public", "params": [{"name": "sql", "type": "String[]"}, {"name": "callback", "type": "ExecutorCallback"}], "return_type": "vo...
13105692_5
class InterfaceReport { public List<Throwable> getErrors() { final List<Throwable> retval = new ArrayList<Throwable>(); for (final TestInfo testInfo : contractTestMap.listTestInfo()) { retval.addAll( testInfo.getErrors() ); } return retval; } public InterfaceRe...
final String[] expectedErrors = { "java.lang.IllegalStateException: Classes annotated with @Contract (class org.xenei.junit.bad.BadNoInject) must include a @Contract.Inject annotation on a public non-abstract declared setter method", }; final ClassPathFilter filter = new NotClassFilter...
[FOCAL] public List<Throwable> InterfaceReport.getErrors() [CLASS] class InterfaceReport [METRICS] loc=7 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] contractTestMap.listTestInfo/0, List<Throwable>.addAll/1, TestInfo.getErrors/0 [NEW] ArrayList<Throwable> [PATH1] foreach(TestInfo testInfo : con...
/* static context [FOCAL] public List<Throwable> InterfaceReport.getErrors() [PATH1] foreach(TestInfo testInfo : contractTestMap.listTestInfo())=T -> exit loop -> return retval [PATH2] foreach(TestInfo testInfo : contractTestMap.listTestInfo())=F -> return retval [COLLABORATORS] field contractTestMap listTestInfo/0 [NE...
/* static context [FOCAL] public List<Throwable> InterfaceReport.getErrors() [PATH1] foreach(TestInfo testInfo : contractTestMap.listTestInfo())=T -> exit loop -> return retval [PATH2] foreach(TestInfo testInfo : contractTestMap.listTestInfo())=F -> return retval [COLLABORATORS] field contractTestMap listTestInfo/0 [NE...
true
ok
{"focal": {"class": "InterfaceReport", "name": "getErrors", "signature": "List<Throwable> getErrors()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Throwable>"}, "class_info": {"name": "InterfaceReport", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [...
13107807_6
class GetStatusSample extends AbstractSample { public static String getUrlString( String realHostname, String port ) { String urlString = "http://" + realHostname + ":" + port + GetStatusServlet.CONTEXT_PATH + "?xml=Y"; urlString = Const.replace( urlString, " ", "%20" ); return urlString; } pu...
assertEquals( "http://sample:1000/kettle/status?xml=Y", GetStatusSample.getUrlString( "sample", "1000" ) ); } }
[FOCAL] public static String GetStatusSample.getUrlString(String realHostname, String port) [CLASS] class GetStatusSample extends AbstractSample [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Const.replace/3 [INPUTS] branches=- | result=port, realHostname [DATAFLOW] port@param->L2...
/* static context [FOCAL] public static String GetStatusSample.getUrlString(String realHostname, String port) [INPUTS] branches=- | result=port, realHostname [CALLS-EXTERNAL] Const.replace/3 */
/* static context [FOCAL] public static String GetStatusSample.getUrlString(String realHostname, String port) [INPUTS] branches=- | result=port, realHostname [CALLS-EXTERNAL] Const.replace/3 */ class GetStatusSample extends AbstractSample { public static String getUrlString( String realHostname, String port ) { ...
true
ok
{"focal": {"class": "GetStatusSample", "name": "getUrlString", "signature": "String getUrlString(String realHostname, String port)", "start_line": 3, "modifiers": "public static", "params": [{"name": "realHostname", "type": "String"}, {"name": "port", "type": "String"}], "return_type": "String"}, "class_info": {"name":...
13126412_15
class Step7Model implements StepModel { public int getHunkSize() { return hunkSize; } public Step7Model(final String sosURL, final File configFile, final boolean generateOfferingFromSensorName, final String offering, final String version, final String binding); public Step7Model(); public Str...
assertThat(model.getHunkSize(), is(5000)); } }
[FOCAL] public int Step7Model.getHunkSize() [CLASS] class Step7Model implements StepModel [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Step7Model(String sosURL, File configFile, boolean generateOfferingFromSensorName, String offering, String version, String binding); Step7Model()...
/* static context [FOCAL] public int Step7Model.getHunkSize() */
/* static context [FOCAL] public int Step7Model.getHunkSize() */ class Step7Model implements StepModel { public int getHunkSize() { return hunkSize; } public Step7Model(final String sosURL, final File configFile, final boolean generateOfferingFromSensorName, final String offering, final String versi...
true
ok
{"focal": {"class": "Step7Model", "name": "getHunkSize", "signature": "int getHunkSize()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "Step7Model", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "StepModel", "fields": [{"name": "model", "type...
13127985_31
class CustomBaseUrlArchive extends AbstractArchive { @Override public String getExtension() { return delegate.getExtension(); } public CustomBaseUrlArchive(Archive delegate, String baseUrl); @Override protected String getBaseUrl(); @Override public String getArchiveName(); @Override public String ...
when(delegate.getExtension()).thenReturn(EXTENSION); assertThat(archive.getExtension()).isEqualTo(EXTENSION); } }
[FOCAL] @Override public String CustomBaseUrlArchive.getExtension() [CLASS] class CustomBaseUrlArchive extends AbstractArchive [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Archive.getExtension/0 [FIELDS] read=delegate:Archive [INPUTS] branches=- | result=delegate [COLLABORATORS]...
/* static context [FOCAL] @Override public String CustomBaseUrlArchive.getExtension() [INPUTS] branches=- | result=delegate [COLLABORATORS] field delegate:Archive getExtension/0 [FIELDS] read=delegate:Archive [CALLS-EXTERNAL] Archive.getExtension/0 */
/* static context [FOCAL] @Override public String CustomBaseUrlArchive.getExtension() [INPUTS] branches=- | result=delegate [COLLABORATORS] field delegate:Archive getExtension/0 [FIELDS] read=delegate:Archive [CALLS-EXTERNAL] Archive.getExtension/0 */ class CustomBaseUrlArchive extends AbstractArchive { @Override ...
true
ok
{"focal": {"class": "CustomBaseUrlArchive", "name": "getExtension", "signature": "String getExtension()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "CustomBaseUrlArchive", "kind": "class", "modifiers": "", "superclass": "AbstractArchive", "interface...
13133836_7
class MetaEditor implements SelectionListener { String[] getSchemas( Database database, DatabaseMeta databaseMeta ) throws KettleDatabaseException { // This is a hack for PMD-907. A NPE can be thrown on getSchema JDBC's implementations. String[] schemas = null; Exception ex = null; try { schema...
try { when( database.getSchemas() ).thenReturn( null ); when( database.getCatalogs() ).thenReturn( EXPECTED_SCHEMAS ); String[] schemas = metaEditor.getSchemas( database, meta ); assertArrayEquals( EXPECTED_SCHEMAS, schemas ); } catch ( KettleDatabaseException e ) { fail( "Should...
[FOCAL] String[] MetaEditor.getSchemas(Database database, DatabaseMeta databaseMeta) [CLASS] class MetaEditor implements SelectionListener [METRICS] loc=25 cc=4 branches=2 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] Database.getSchemas/0, ArrayUtils.isEmpty/1, DatabaseMeta.isMySQLVariant/0, DatabaseMeta.getDa...
/* static context [FOCAL] String[] MetaEditor.getSchemas(Database database, DatabaseMeta databaseMeta) [THROWS-WHEN] KettleDatabaseException when try-body throws && ArrayUtils.isEmpty( schemas ) && ArrayUtils.isEmpty( schemas ) && ex != null [INPUTS] branches=database, databaseMeta | result=database, databaseMeta */
/* static context [FOCAL] String[] MetaEditor.getSchemas(Database database, DatabaseMeta databaseMeta) [THROWS-WHEN] KettleDatabaseException when try-body throws && ArrayUtils.isEmpty( schemas ) && ArrayUtils.isEmpty( schemas ) && ex != null [INPUTS] branches=database, databaseMeta | result=database, databaseMeta */ cl...
true
ok
{"focal": {"class": "MetaEditor", "name": "getSchemas", "signature": "String[] getSchemas(Database database, DatabaseMeta databaseMeta) throws KettleDatabaseException", "start_line": 3, "modifiers": "", "params": [{"name": "database", "type": "Database"}, {"name": "databaseMeta", "type": "DatabaseMeta"}], "return_type"...
13137355_28
class KeyValueParser { public static Map<String, String> parse(String s) { final Map<String, String> result = new HashMap<>(); if (s == null) return result; // Process each line separated by a newline. for (String line : s.split("\n")) { // Parse the line l...
String msg = "========="; final Map<String, String> result = KeyValueParser.parse(msg); assertTrue(result.size() == 0); } }
[FOCAL] public static Map<String, String> KeyValueParser.parse(String s) [CLASS] class KeyValueParser [METRICS] loc=31 cc=7 branches=5 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] String.split/1, String.split/2, parts[0].trim/0, key.trim().equals/1, String.trim/0, Map<String, String>.containsKey/1, log.warn/2,...
/* static context [FOCAL] public static Map<String, String> KeyValueParser.parse(String s) [PATH1] if(s == null)=F -> foreach(String line : s.split("\n"))=T -> if(parts.length == 0)=F -> if(key.trim().equals(""))=F -> if(parts.length > 1 && parts[1] != null)=T -> if(result.containsKey(key))=T -> exit loop -> return res...
/* static context [FOCAL] public static Map<String, String> KeyValueParser.parse(String s) [PATH1] if(s == null)=F -> foreach(String line : s.split("\n"))=T -> if(parts.length == 0)=F -> if(key.trim().equals(""))=F -> if(parts.length > 1 && parts[1] != null)=T -> if(result.containsKey(key))=T -> exit loop -> return res...
true
ok
{"focal": {"class": "KeyValueParser", "name": "parse", "signature": "Map<String, String> parse(String s)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "String"}], "return_type": "Map<String, String>"}, "class_info": {"name": "KeyValueParser", "kind": "class", "modifiers": "", "superc...
13139604_0
class DataUtil { public static void setValueString(DataType d, String value) throws DataException { if (value != null && value.length() > 255) { try { setValue(d, value.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { logger.error(e.getMessage()); logger.error(FactoryException...
logger.info("Setting short data"); DataType data = new DataType(); boolean error = false; try{ DataUtil.setValueString(data, "Example text"); } catch(DataException de){ error = true; } assertFalse("An error was encountered", error); assertTrue("Short data not set", data.getShortData() != null...
[FOCAL] public static void DataUtil.setValueString(DataType d, String value) [CLASS] class DataUtil [METRICS] loc=21 cc=4 branches=2 loops=0 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] void setValue(DataType d, byte[] inValue) [CALLS-EXTERNAL] String.length/0, String.getBytes/1, Logger.error/1, UnsupportedEncodingExc...
/* static context [FOCAL] public static void DataUtil.setValueString(DataType d, String value) [PATH1] if(value != null && value.length() > 255)=T -> try-body throws -> if(d.getMimeType() == null || d.getMimeType().length() == 0)=T [PATH2] if(value != null && value.length() > 255)=F [PATH3] if(value != null && value.le...
/* static context [FOCAL] public static void DataUtil.setValueString(DataType d, String value) [PATH1] if(value != null && value.length() > 255)=T -> try-body throws -> if(d.getMimeType() == null || d.getMimeType().length() == 0)=T [PATH2] if(value != null && value.length() > 255)=F [PATH3] if(value != null && value.le...
true
ok
{"focal": {"class": "DataUtil", "name": "setValueString", "signature": "void setValueString(DataType d, String value) throws DataException", "start_line": 3, "modifiers": "public static", "params": [{"name": "d", "type": "DataType"}, {"name": "value", "type": "String"}], "return_type": "void"}, "class_info": {"name": "...
13160719_0
class YamlMetricsAttributeTableLoader { public Table<String, NewRelicMetric, Boolean> loadTable(@Nonnull InputStream inputStream) throws IOException { Map<String, Map<NewRelicMetric, Boolean>> m = objectReader.forType(new TypeReference<Map<String, Map<NewRelicMetric, Boolean>>>() {}) ...
YamlMetricsAttributeTableLoader loader = new YamlMetricsAttributeTableLoader(); InputStream stream = getClass().getResourceAsStream("testing-config.yml"); Table<String, TableMetricAttributeFilter.NewRelicMetric, Boolean> table = loader.loadTable(stream); assertThat(table.get("name2", Ta...
[FOCAL] public Table<String, NewRelicMetric, Boolean> YamlMetricsAttributeTableLoader.loadTable(InputStream inputStream) [CLASS] class YamlMetricsAttributeTableLoader [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Table<R, C, V> table(Map<R, Map<C, V>> fromTable) [CALLS-EXTERNAL] ...
/* static context [FOCAL] public Table<String, NewRelicMetric, Boolean> YamlMetricsAttributeTableLoader.loadTable(InputStream inputStream) [INPUTS] branches=- | result=inputStream [COLLABORATORS] field objectReader forType/1 [EXCEPTIONS] declares IOException [CALLS-INTERNAL] Table<R, C, V> table(Map<R, Map<C, V>> fromT...
/* static context [FOCAL] public Table<String, NewRelicMetric, Boolean> YamlMetricsAttributeTableLoader.loadTable(InputStream inputStream) [INPUTS] branches=- | result=inputStream [COLLABORATORS] field objectReader forType/1 [EXCEPTIONS] declares IOException [CALLS-INTERNAL] Table<R, C, V> table(Map<R, Map<C, V>> fromT...
true
ok
{"focal": {"class": "YamlMetricsAttributeTableLoader", "name": "loadTable", "signature": "Table<String, NewRelicMetric, Boolean> loadTable(InputStream inputStream) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "inputStream", "type": "InputStream"}], "return_type": "Table<String, NewRe...
13191344_54
class ModifierHelper { public static boolean matchesModifierLevel(AccessModifier modifierLevelOfElement, AccessModifier modifierLevel) { return (modifierLevelOfElement.getLevel() >= modifierLevel.getLevel()); } private ModifierHelper(); public static boolean matchesModifierLevel(int modifierOfElement, AccessM...
assertThat(ModifierHelper.matchesModifierLevel(Modifier.setPrivate(0), AccessModifier.PUBLIC), is(false)); } }
[FOCAL] public static boolean ModifierHelper.matchesModifierLevel(AccessModifier modifierLevelOfElement, AccessModifier modifierLevel) [CLASS] class ModifierHelper [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] AccessModifier.getLevel/0 [INPUTS] branches=- | result=modifierLevel, ...
/* static context [FOCAL] public static boolean ModifierHelper.matchesModifierLevel(AccessModifier modifierLevelOfElement, AccessModifier modifierLevel) [INPUTS] branches=- | result=modifierLevel, modifierLevelOfElement [COLLABORATORS] param modifierLevelOfElement:AccessModifier getLevel/0; param modifierLevel:AccessMo...
/* static context [FOCAL] public static boolean ModifierHelper.matchesModifierLevel(AccessModifier modifierLevelOfElement, AccessModifier modifierLevel) [INPUTS] branches=- | result=modifierLevel, modifierLevelOfElement [COLLABORATORS] param modifierLevelOfElement:AccessModifier getLevel/0; param modifierLevel:AccessMo...
true
ok
{"focal": {"class": "ModifierHelper", "name": "matchesModifierLevel", "signature": "boolean matchesModifierLevel(AccessModifier modifierLevelOfElement, AccessModifier modifierLevel)", "start_line": 3, "modifiers": "public static", "params": [{"name": "modifierLevelOfElement", "type": "AccessModifier"}, {"name": "modifi...
13217403_10
class GoogleHttpClientEdgeGridInterceptor implements HttpExecuteInterceptor { @Override public void intercept(HttpRequest request) throws IOException { try { binding.sign(request, request); } catch (RequestSigningException e) { throw new RuntimeException(e); } ...
HttpRequestFactory requestFactory = createSigningRequestFactory(); URI uri = URI.create("https://endpoint.net/billing-usage/v1/reportSources"); HttpRequest request = requestFactory.buildGetRequest(new GenericUrl(uri)); request.getHeaders().put("Host", "ignored-hostname.com"); //...
[FOCAL] @Override public void GoogleHttpClientEdgeGridInterceptor.intercept(HttpRequest request) [CLASS] class GoogleHttpClientEdgeGridInterceptor implements HttpExecuteInterceptor [METRICS] loc=8 cc=2 branches=0 loops=0 returns=0 throws=1 nesting=1 [CALLS-EXTERNAL] binding.sign/2 [NEW] RuntimeException [EXCEPTIONS] de...
/* static context [FOCAL] @Override public void GoogleHttpClientEdgeGridInterceptor.intercept(HttpRequest request) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [COLLABORATORS] field binding sign/2 [EXCEPTIONS] declares IOException; throws RuntimeException;...
/* static context [FOCAL] @Override public void GoogleHttpClientEdgeGridInterceptor.intercept(HttpRequest request) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [COLLABORATORS] field binding sign/2 [EXCEPTIONS] declares IOException; throws RuntimeException;...
true
ok
{"focal": {"class": "GoogleHttpClientEdgeGridInterceptor", "name": "intercept", "signature": "void intercept(HttpRequest request) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "HttpRequest"}], "return_type": "void"}, "class_info": {"name": "GoogleHttpClien...
13236207_0
class InStream extends InputStream { public static InStream create(String name, ByteBuffer input, CompressionCodec codec, int bufferSize) throws IOException { if (codec == null) { return new UncompressedStream(n...
OutputCollector collect = new OutputCollector(); CompressionCodec codec = new ZlibCodec(); OutStream out = new OutStream("test", 500, codec, collect); PositionCollector[] positions = new PositionCollector[1024]; for(int i=0; i < 1024; ++i) { positions[i] = new PositionCollector(); out.ge...
[FOCAL] public static InStream InStream.create(String name, ByteBuffer input, CompressionCodec codec, int bufferSize) [CLASS] class InStream extends InputStream [METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [NEW] UncompressedStream, CompressedStream [EXCEPTIONS] declares IOException [PATH1] if(c...
/* static context [FOCAL] public static InStream InStream.create(String name, ByteBuffer input, CompressionCodec codec, int bufferSize) [PATH1] if(codec == null)=T -> return new UncompressedStream(name, input) [PATH2] if(codec == null)=F -> return new CompressedStream(name, input, codec, bufferSize) [INPUTS] branches=c...
/* static context [FOCAL] public static InStream InStream.create(String name, ByteBuffer input, CompressionCodec codec, int bufferSize) [PATH1] if(codec == null)=T -> return new UncompressedStream(name, input) [PATH2] if(codec == null)=F -> return new CompressedStream(name, input, codec, bufferSize) [INPUTS] branches=c...
true
ok
{"focal": {"class": "InStream", "name": "create", "signature": "InStream create(String name, ByteBuffer input, CompressionCodec codec, int bufferSize) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}, {"name": "input", "type": "ByteBuffer"}, {"name": "cod...
13272929_2
class ReadOnlyStyledDocumentBuilder { public ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraphs(List<List<SEG>> listOfSegLists, StyleSpans<S> entireDocumentStyleSpans) { return addParagraphList(listOfSegLists, entireDocumentStyleSpans, ignore -> null, Function.identity...
String text = "a"; int textStyle = 1; List<List<String>> singletonList = Collections.singletonList( Collections.singletonList(text) ); int segmentLength = text.length(); int spanLength = segmentLength + 10; StyleSpans<Integer> spans = StyleSpans.s...
[FOCAL] public ReadOnlyStyledDocumentBuilder<PS, SEG, S> ReadOnlyStyledDocumentBuilder.addParagraphs(List<List<SEG>> listOfSegLists, StyleSpans<S> entireDocumentStyleSpans) [CLASS] class ReadOnlyStyledDocumentBuilder [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] ReadOnlyStyledDoc...
/* static context [FOCAL] public ReadOnlyStyledDocumentBuilder<PS, SEG, S> ReadOnlyStyledDocumentBuilder.addParagraphs(List<List<SEG>> listOfSegLists, StyleSpans<S> entireDocumentStyleSpans) [INPUTS] branches=- | result=entireDocumentStyleSpans, listOfSegLists [CALLS-INTERNAL] ReadOnlyStyledDocumentBuilder<PS, SEG, S> ...
/* static context [FOCAL] public ReadOnlyStyledDocumentBuilder<PS, SEG, S> ReadOnlyStyledDocumentBuilder.addParagraphs(List<List<SEG>> listOfSegLists, StyleSpans<S> entireDocumentStyleSpans) [INPUTS] branches=- | result=entireDocumentStyleSpans, listOfSegLists [CALLS-INTERNAL] ReadOnlyStyledDocumentBuilder<PS, SEG, S> ...
true
ok
{"focal": {"class": "ReadOnlyStyledDocumentBuilder", "name": "addParagraphs", "signature": "ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraphs(List<List<SEG>> listOfSegLists, StyleSpans<S> entireDocumentStyleSpans)", "start_line": 3, "modifiers": "public", "params": [{"name": "listOfSegLists", "type": "List<List<S...
13292939_10
class XPathRecord implements Record { @Override public List<Value> getValues(String field) { try { XPathExpression expr = xpath_map.get(field); if (expr == null) { return null; } NodeList lst = (NodeList)expr.evaluate(doc, XPathConstants.N...
List<Value> res3 = rec.getValues("leaf1_attribute"); assertEquals(1, res3.size()); assertEquals("leaf1 attribute", res3.get(0).getAsString()); List<Value> res4 = rec.getValues("all_attributes"); assertEquals(2, res4.size()); assertEquals("leaf1 attribute", res4.get(0).ge...
[FOCAL] @Override public List<Value> XPathRecord.getValues(String field) [CLASS] class XPathRecord implements Record [METRICS] loc=23 cc=5 branches=2 loops=1 returns=3 throws=0 nesting=3 [CALLS-EXTERNAL] xpath_map.get/1, XPathExpression.evaluate/2, NodeList.getLength/0, lst.item(i).getTextContent().trim/0, lst.item(i)....
/* static context [FOCAL] @Override public List<Value> XPathRecord.getValues(String field) [PATH1] if(expr == null)=F -> for(i < lst.getLength())=T -> if(!"".equals(str))=T -> exit loop -> return ret [PATH2] try-body throws -> return null [PATH3] if(expr == null)=T -> return null [PATH4] if(expr == null)=F -> for(i < l...
/* static context [FOCAL] @Override public List<Value> XPathRecord.getValues(String field) [PATH1] if(expr == null)=F -> for(i < lst.getLength())=T -> if(!"".equals(str))=T -> exit loop -> return ret [PATH2] try-body throws -> return null [PATH3] if(expr == null)=T -> return null [PATH4] if(expr == null)=F -> for(i < l...
true
ok
{"focal": {"class": "XPathRecord", "name": "getValues", "signature": "List<Value> getValues(String field)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "field", "type": "String"}], "return_type": "List<Value>"}, "class_info": {"name": "XPathRecord", "kind": "class", "modifiers": "", "superclas...
13317929_25
class NonEmptyStringAnnotationFormatterFactory implements AnnotationFormatterFactory<NonEmpty> { @Override public Parser<String> getParser(NonEmpty annotation, Class<?> fieldType) { return new Parser<String>() { @Override public String parse(String text, Locale locale) ...
// Arrange final String anyString = "Foo"; // Act Parser<String> parser = testee.getParser(null, String.class); // Assert assertThat(parser.parse(null, Locale.getDefault())).isEqualTo(null); assertThat(parser.parse(anyString, null)).isEqualTo(anyString); ...
[FOCAL] @Override public Parser<String> NonEmptyStringAnnotationFormatterFactory.getParser(NonEmpty annotation, Class<?> fieldType) [CLASS] class NonEmptyStringAnnotationFormatterFactory implements AnnotationFormatterFactory<NonEmpty> [METRICS] loc=15 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL...
/* static context [FOCAL] @Override public Parser<String> NonEmptyStringAnnotationFormatterFactory.getParser(NonEmpty annotation, Class<?> fieldType) [INPUTS] branches=- | result=- | unused=annotation, fieldType [NEW] Parser<String> [CALLS-EXTERNAL] StringUtils.hasText/1 */
/* static context [FOCAL] @Override public Parser<String> NonEmptyStringAnnotationFormatterFactory.getParser(NonEmpty annotation, Class<?> fieldType) [INPUTS] branches=- | result=- | unused=annotation, fieldType [NEW] Parser<String> [CALLS-EXTERNAL] StringUtils.hasText/1 */ class NonEmptyStringAnnotationFormatterFactor...
true
ok
{"focal": {"class": "NonEmptyStringAnnotationFormatterFactory", "name": "getParser", "signature": "Parser<String> getParser(NonEmpty annotation, Class<?> fieldType)", "start_line": 4, "modifiers": "@Override public", "params": [{"name": "annotation", "type": "NonEmpty"}, {"name": "fieldType", "type": "Class<?>"}], "ret...