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
6123437_2
class ClassSearchUtil { public static String getPropertyFromClassPath(String propertyFileResourcePath,String propertyName ) throws Exception { Properties p = new Properties(); InputStream inStream = null; try { inStream = ClassSearchUtil.class.getClassLoader().getResourceAsStream(propertyFileResourcePath); ...
assertNotNull(ClassSearchUtil.getPropertyFromClassPath("META-INF/jsystemCore.build.properties", "jversion")); } }
[FOCAL] public static String ClassSearchUtil.getPropertyFromClassPath(String propertyFileResourcePath, String propertyName) [CLASS] class ClassSearchUtil [METRICS] loc=16 cc=4 branches=2 loops=0 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] ClassSearchUtil.class.getClassLoader().getResourceAsStream/1, ClassSearchUtil.c...
/* static context [FOCAL] public static String ClassSearchUtil.getPropertyFromClassPath(String propertyFileResourcePath, String propertyName) [PATH1] if(inStream == null)=T -> throw new IOException("Property file not found in classpath. " + property... -> if(inStream != null)=T [PATH2] if(inStream == null)=F -> if(inSt...
/* static context [FOCAL] public static String ClassSearchUtil.getPropertyFromClassPath(String propertyFileResourcePath, String propertyName) [PATH1] if(inStream == null)=T -> throw new IOException("Property file not found in classpath. " + property... -> if(inStream != null)=T [PATH2] if(inStream == null)=F -> if(inSt...
true
ok
{"focal": {"class": "ClassSearchUtil", "name": "getPropertyFromClassPath", "signature": "String getPropertyFromClassPath(String propertyFileResourcePath, String propertyName) throws Exception", "start_line": 3, "modifiers": "public static", "params": [{"name": "propertyFileResourcePath", "type": "String"}, {"name": "pr...
6154058_11
class WonAssembler { @Deprecated public static void assemble(GraphCollection namedSignedGraph, Dataset graphOrigin) throws Exception { Ontology o = prepareSignatureOntology(namedSignedGraph); verifyGraphCollectionContainsExactlyOneNamedGraph(namedSignedGraph); addSignatureTriplesToOrigi...
// The Signingframework reader cannot reproduce the correct graph // structure, it has problems with blank nodes [] parts. // GraphCollection gc = TriGPlusReader.readFile(inFile); // create dataset that contains atom core data graph Dataset testDataset = TestSigningUtils.prepareT...
[FOCAL] @Deprecated public static void WonAssembler.assemble(GraphCollection namedSignedGraph, Dataset graphOrigin) [CLASS] class WonAssembler [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] Ontology prepareSignatureOntology(GraphCollection gc); void addSignatureTriplesToOrigin(Gra...
/* static context [FOCAL] @Deprecated public static void WonAssembler.assemble(GraphCollection namedSignedGraph, Dataset graphOrigin) [EXCEPTIONS] declares Exception [CALLS-INTERNAL] Ontology prepareSignatureOntology(GraphCollection gc); void addSignatureTriplesToOrigin(GraphCollection namedSignedGraph, Ontology o, Dat...
/* static context [FOCAL] @Deprecated public static void WonAssembler.assemble(GraphCollection namedSignedGraph, Dataset graphOrigin) [EXCEPTIONS] declares Exception [CALLS-INTERNAL] Ontology prepareSignatureOntology(GraphCollection gc); void addSignatureTriplesToOrigin(GraphCollection namedSignedGraph, Ontology o, Dat...
true
ok
{"focal": {"class": "WonAssembler", "name": "assemble", "signature": "void assemble(GraphCollection namedSignedGraph, Dataset graphOrigin) throws Exception", "start_line": 3, "modifiers": "@Deprecated public static", "params": [{"name": "namedSignedGraph", "type": "GraphCollection"}, {"name": "graphOrigin", "type": "Da...
6179560_1
class KeySet { public KeySet(byte[] key, byte[] nonce) throws NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, NoSuchPaddingException, InvalidAlgorithmParameterException { MaskGenerationFunction mgf = null; mgf = new MaskGenerationFunction(MessageDigest.getInstance("SHA256")); byte[] s...
byte[] k = {119,-72,44,103,89,-33,-10,45,51,24,-107,-57,-110,63,-104,-46,-118,40,-69,-86,114,31,33,-90,4,118,83,125,-7,16,-65,111,79,-89,61,61,102,68,-101,-40,99,-15,-24,-42,-125,35,115,-89,59,-24,11,-40,-74,89,66,-31,107,-17,-40,125,99,-101,-12,116,-7,102,-115,39,-101,-67,84,-29,-120,-31,-24,-24,-84,10,-79,-74,-21,1...
[FOCAL] public KeySet.KeySet(byte[] key, byte[] nonce) [CLASS] class KeySet [METRICS] loc=48 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] MessageDigest.getInstance/1, System.arraycopy/5, MaskGenerationFunction.generateMask/2, Mac.getInstance/1, Mac.getAlgorithm/0, Mac.init/1, Mac.doFinal/1, "Se...
class KeySet { public KeySet(byte[] key, byte[] nonce) throws NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, NoSuchPaddingException, InvalidAlgorithmParameterException { MaskGenerationFunction mgf = null; mgf = new MaskGenerationFunction(MessageDigest.getInstance("SHA256")); byte[] s...
false
ok
{"focal": {"class": "KeySet", "name": "KeySet", "signature": "KeySet(byte[] key, byte[] nonce) throws NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, NoSuchPaddingException, InvalidAlgorit...", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "byte[]"}, {"name": "nonce"...
6179800_6
class Transformation implements Serializable { public T variable(String name, Object value) { return param(name, value); } public Transformation(Transformation transformation); public Transformation(List<Map> transformations); public Transformation(); public T width(Object value); ...
// using strings Transformation t = new Transformation(); t.variable("$foo", 10) .chain() .ifCondition(faceCount().gt(2)) .crop("scale") .width(new Condition("$foo * 200 / faceCount")) .endIf(); assertEquals(...
[FOCAL] public T Transformation.variable(String name, Object value) [CLASS] class Transformation implements Serializable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] T param(String key, Object value) [INPUTS] branches=- | result=name, value [DATAFLOW] name@param->L2; value@param...
/* static context [FOCAL] public T Transformation.variable(String name, Object value) [INPUTS] branches=- | result=name, value [CALLS-INTERNAL] T param(String key, Object value) */
/* static context [FOCAL] public T Transformation.variable(String name, Object value) [INPUTS] branches=- | result=name, value [CALLS-INTERNAL] T param(String key, Object value) */ class Transformation implements Serializable { public T variable(String name, Object value) { return param(name, value); }...
true
ok
{"focal": {"class": "Transformation", "name": "variable", "signature": "T variable(String name, Object value)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}, {"name": "value", "type": "Object"}], "return_type": "T"}, "class_info": {"name": "Transformation", "kind": "class", "mod...
6187281_10
class QuartzTaskScheduler implements TaskScheduler { @Override public TaskRegistration scheduleTask(TaskConfiguration config, Object bean) throws TaskSchedulerException { if (config == null) { throw new IllegalArgumentException("config is null"); } if (bean == null) { ...
Scheduler scheduler = new FakeQuartzScheduler(); QuartzTaskScheduler quartzTaskScheduler = new QuartzTaskScheduler(); quartzTaskScheduler.setScheduler(scheduler); TestTask task = new TestTask(); TaskRegistration registration = quartzTaskScheduler.scheduleTask( n...
[FOCAL] @Override public TaskRegistration QuartzTaskScheduler.scheduleTask(TaskConfiguration config, Object bean) [CLASS] class QuartzTaskScheduler implements TaskScheduler [METRICS] loc=44 cc=7 branches=5 loops=0 returns=1 throws=5 nesting=3 [CALLS-INTERNAL] Class getJobClass(TaskConfiguration config) [CALLS-EXTERNAL]...
/* static context [FOCAL] @Override public TaskRegistration QuartzTaskScheduler.scheduleTask(TaskConfiguration config, Object bean) [THROWS-WHEN] IllegalArgumentException when config == null [THROWS-WHEN] IllegalArgumentException when !(config == null) && bean == null [THROWS-WHEN] IllegalStateException when !(config =...
/* static context [FOCAL] @Override public TaskRegistration QuartzTaskScheduler.scheduleTask(TaskConfiguration config, Object bean) [THROWS-WHEN] IllegalArgumentException when config == null [THROWS-WHEN] IllegalArgumentException when !(config == null) && bean == null [THROWS-WHEN] IllegalStateException when !(config =...
true
ok
{"focal": {"class": "QuartzTaskScheduler", "name": "scheduleTask", "signature": "TaskRegistration scheduleTask(TaskConfiguration config, Object bean) throws TaskSchedulerException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "config", "type": "TaskConfiguration"}, {"name": "bean", "type": "Ob...
6212860_2
class QuadTree { public Object[] getValues() { final List<Object> arr = new ArrayList<Object>(); this.traverse_(this.root_, new Func() { @Override public void call(QuadTree quadTree, Node node) { arr.add(node.getPoint().getValue()); } }); ...
Object[] values = getTree().getValues(); Arrays.sort(values); String valueString = Arrays.asList(values).toString(); assertEquals("Sorted values should be [Bar, Baz, Bing, Bong, Foo]", "[Bar, Baz, Bing, Bong, Foo]", valueString); } }
[FOCAL] public Object[] QuadTree.getValues() [CLASS] class QuadTree [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void traverse_(Node node, Func func) [CALLS-EXTERNAL] List<Object>.add/1, node.getPoint().getValue/0, node.getPoint/0, List<Object>.toArray/1, List<Object>.size/0 [N...
/* static context [FOCAL] public Object[] QuadTree.getValues() [COLLABORATORS] field node getPoint/0 [CALLS-INTERNAL] void traverse_(Node node, Func func) [FIELDS] read=root_ [NEW] ArrayList<Object>, Func [CALLS-EXTERNAL] List<Object>.add/1, node.getPoint().getValue/0, node.getPoint/0, List<Object>.toArray/1, List<Obje...
/* static context [FOCAL] public Object[] QuadTree.getValues() [COLLABORATORS] field node getPoint/0 [CALLS-INTERNAL] void traverse_(Node node, Func func) [FIELDS] read=root_ [NEW] ArrayList<Object>, Func [CALLS-EXTERNAL] List<Object>.add/1, node.getPoint().getValue/0, node.getPoint/0, List<Object>.toArray/1, List<Obje...
true
ok
{"focal": {"class": "QuadTree", "name": "getValues", "signature": "Object[] getValues()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Object[]"}, "class_info": {"name": "QuadTree", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Qua...
6215833_5
class BTree { public void insert(KeyClass key, ValueClass value) { if (root == null) { root = BTreeNode.createLeaf(null, null); } if (root.ckeckExists(key)) { throw new DuplicateKeyException(); } BTreeNode.InsertResult insertResult ...
tree.insert(1L, 1L); Assert.assertNotNull(tree.getRoot()); Assert.assertArrayEquals(new Long[]{1L}, tree.getRoot().getKeys()); Assert.assertArrayEquals(new Long[]{1L}, tree.getRoot().getValues()); tree.insert(3L, 3L); tree.insert(2L, 2L); ...
[FOCAL] public void BTree.insert(KeyClass key, ValueClass value) [CLASS] class BTree [METRICS] loc=23 cc=4 branches=3 loops=0 returns=0 throws=1 nesting=1 [CALLS-EXTERNAL] BTreeNode.createLeaf/2, root.ckeckExists/1, root.insert/3, BTreeNode.createDirectory/2, BTreeNode.InsertResult.getLeft/0, BTreeNode.InsertResult.get...
/* static context [FOCAL] public void BTree.insert(KeyClass key, ValueClass value) [THROWS-WHEN] DuplicateKeyException when root == null && root.ckeckExists(key) [THROWS-WHEN] DuplicateKeyException when !(root == null) && root.ckeckExists(key) [PATH1] if(root == null)=T -> if(root.ckeckExists(key))=T -> throw new Dupli...
/* static context [FOCAL] public void BTree.insert(KeyClass key, ValueClass value) [THROWS-WHEN] DuplicateKeyException when root == null && root.ckeckExists(key) [THROWS-WHEN] DuplicateKeyException when !(root == null) && root.ckeckExists(key) [PATH1] if(root == null)=T -> if(root.ckeckExists(key))=T -> throw new Dupli...
true
ok
{"focal": {"class": "BTree", "name": "insert", "signature": "void insert(KeyClass key, ValueClass value)", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "KeyClass"}, {"name": "value", "type": "ValueClass"}], "return_type": "void"}, "class_info": {"name": "BTree", "kind": "class", "modifiers...
6257768_8
class AbstractTriple { static Vector splitSpace(String triple){ final Vector results = new Vector(); String remaining = triple; int nextPos; do{ nextPos = remaining.indexOf(' '); if(nextPos >= 0){ results.addElement(remaining.substring(0, nextPos)); remaining = remaining.substring(nextPos + 1...
final Vector splitted = AbstractTriple.splitSpace(" asdf fdsa"); assertEquals(3, splitted.size()); assertEquals("", splitted.get(0)); assertEquals("asdf", splitted.get(1)); assertEquals("fdsa", splitted.get(2)); } }
[FOCAL] static Vector AbstractTriple.splitSpace(String triple) [CLASS] class AbstractTriple [METRICS] loc=17 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] String.indexOf/1, Vector.addElement/1, String.substring/2, String.substring/1 [NEW] Vector [PATH1] if(nextPos >= 0)=T -> do_while(nextPos >= ...
/* static context [FOCAL] static Vector AbstractTriple.splitSpace(String triple) [PATH1] if(nextPos >= 0)=T -> do_while(nextPos >= 0)=F -> return results [PATH2] if(nextPos >= 0)=F -> do_while(nextPos >= 0)=F -> return results [INPUTS] branches=triple | result=- [NEW] Vector [CALLS-EXTERNAL] String.indexOf/1, Vector.ad...
/* static context [FOCAL] static Vector AbstractTriple.splitSpace(String triple) [PATH1] if(nextPos >= 0)=T -> do_while(nextPos >= 0)=F -> return results [PATH2] if(nextPos >= 0)=F -> do_while(nextPos >= 0)=F -> return results [INPUTS] branches=triple | result=- [NEW] Vector [CALLS-EXTERNAL] String.indexOf/1, Vector.ad...
true
ok
{"focal": {"class": "AbstractTriple", "name": "splitSpace", "signature": "Vector splitSpace(String triple)", "start_line": 3, "modifiers": "static", "params": [{"name": "triple", "type": "String"}], "return_type": "Vector"}, "class_info": {"name": "AbstractTriple", "kind": "class", "modifiers": "", "superclass": null, ...
6269725_1
class PageParametersExtensions { public static final boolean isNullOrEmpty(final StringValue stringValue) { return (stringValue == null) || stringValue.isNull() || stringValue.isEmpty(); } public static void addParameters(final IRequestParameters parameters, final Map<String, String[]> parameterMap); public ...
boolean actual = PageParametersExtensions.isNullOrEmpty(null); AssertJUnit.assertTrue("Should be true.", actual); StringValue sv = StringValue.valueOf(""); actual = PageParametersExtensions.isNullOrEmpty(sv); AssertJUnit.assertTrue("Should be true.", actual); final String s = null; sv = StringValue.valueO...
[FOCAL] public static final boolean PageParametersExtensions.isNullOrEmpty(StringValue stringValue) [CLASS] class PageParametersExtensions [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] StringValue.isNull/0, StringValue.isEmpty/0 [INPUTS] branches=- | result=stringValue [COLLABORA...
/* static context [FOCAL] public static final boolean PageParametersExtensions.isNullOrEmpty(StringValue stringValue) [INPUTS] branches=- | result=stringValue [COLLABORATORS] param stringValue:StringValue isNull/0,isEmpty/0 [CALLS-EXTERNAL] StringValue.isNull/0, StringValue.isEmpty/0 */
/* static context [FOCAL] public static final boolean PageParametersExtensions.isNullOrEmpty(StringValue stringValue) [INPUTS] branches=- | result=stringValue [COLLABORATORS] param stringValue:StringValue isNull/0,isEmpty/0 [CALLS-EXTERNAL] StringValue.isNull/0, StringValue.isEmpty/0 */ class PageParametersExtensions {...
true
ok
{"focal": {"class": "PageParametersExtensions", "name": "isNullOrEmpty", "signature": "boolean isNullOrEmpty(StringValue stringValue)", "start_line": 3, "modifiers": "public static final", "params": [{"name": "stringValue", "type": "StringValue"}], "return_type": "boolean"}, "class_info": {"name": "PageParametersExtens...
6275822_36
class Globs { public static ImmutableList<String> glob(final String glob) { Path path = getGlobPath(glob); int globIndex = getGlobIndex(path); if (globIndex < 0) { return of(glob); } return doGlob(path, searchPath(path, globIndex)); } private Globs();...
File file = folder.newFile(); String path = file.getAbsolutePath(); ImmutableList<String> files = Globs.glob(path); assertThat(files.contains(path), is(true)); } }
[FOCAL] public static ImmutableList<String> Globs.glob(String glob) [CLASS] class Globs [METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] ImmutableList<String> doGlob(Path path, Path searchPath); Path getGlobPath(String glob); Path searchPath(Path path, int globIndex); int getGlobIn...
/* static context [FOCAL] public static ImmutableList<String> Globs.glob(String glob) [PATH1] if(globIndex < 0)=T -> return of(glob) [PATH2] if(globIndex < 0)=F -> return doGlob(path, searchPath(path, globIndex)) [INPUTS] branches=glob | result=glob [CALLS-INTERNAL] ImmutableList<String> doGlob(Path path, Path searchPa...
/* static context [FOCAL] public static ImmutableList<String> Globs.glob(String glob) [PATH1] if(globIndex < 0)=T -> return of(glob) [PATH2] if(globIndex < 0)=F -> return doGlob(path, searchPath(path, globIndex)) [INPUTS] branches=glob | result=glob [CALLS-INTERNAL] ImmutableList<String> doGlob(Path path, Path searchPa...
true
ok
{"focal": {"class": "Globs", "name": "glob", "signature": "ImmutableList<String> glob(String glob)", "start_line": 3, "modifiers": "public static", "params": [{"name": "glob", "type": "String"}], "return_type": "ImmutableList<String>"}, "class_info": {"name": "Globs", "kind": "class", "modifiers": "", "superclass": nul...
6278839_0
class ConnectionEvent extends Event { public Connection getConnection() { return this.connection; } public ConnectionEvent(EventType<? extends Event> et, Connector sConnector, Connector rConnector, Connection connection); public Connector getSenderConnector(); public Connector getReceive...
VFlow flow = FlowFactory.newFlow(); VNode n1 = flow.newNode(); Connector sender1 = n1.setMainOutput(n1.addOutput("control")); VNode n2 = flow.newNode(); Connector receiver2 = n2.addInput("control"); n2.setMainInput(receiver2); Connector sender2 = n2.addOutput("co...
[FOCAL] public Connection ConnectionEvent.getConnection() [CLASS] class ConnectionEvent extends Event [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=connection [CLASS-MEMBERS] ConnectionEvent(EventType<? extends Event> et, Connector sConnector, Connector rConnector, Connection connec...
/* static context [FOCAL] public Connection ConnectionEvent.getConnection() [FIELDS] read=connection */
/* static context [FOCAL] public Connection ConnectionEvent.getConnection() [FIELDS] read=connection */ class ConnectionEvent extends Event { public Connection getConnection() { return this.connection; } public ConnectionEvent(EventType<? extends Event> et, Connector sConnector, Connector rConnec...
true
ok
{"focal": {"class": "ConnectionEvent", "name": "getConnection", "signature": "Connection getConnection()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Connection"}, "class_info": {"name": "ConnectionEvent", "kind": "class", "modifiers": "", "superclass": "Event", "interfaces": null, "fields": ...
6280863_22
class SqlPartialParser { public static String parseFromPath(final String path) { try { return fromPathToStringCache.get(path, new Callable<String>() { @Override public String call() throws Exception { return _parseFromPath(path); } }); } catch (ExecutionException e) { throw new Runtim...
try { SqlPartialParser.parseFromPath("/co/jirm/core/sql/partial-test-validate.sql#other"); fail("Should have thrown an exception"); } catch (JirmIllegalStateException e) { assertEquals("Reference '> #stuff' in /co/jirm/core/sql/partial-test-validate.sql at line: 44 does" + "\nNOT MATCH declaration /...
[FOCAL] public static String SqlPartialParser.parseFromPath(String path) [CLASS] class SqlPartialParser [METRICS] loc=20 cc=4 branches=1 loops=0 returns=1 throws=3 nesting=2 [CALLS-INTERNAL] String _parseFromPath(String path) [CALLS-EXTERNAL] fromPathToStringCache.get/2, UncheckedExecutionException.getCause/0 [NEW] Cal...
/* static context [FOCAL] public static String SqlPartialParser.parseFromPath(String path) [THROWS-WHEN] RuntimeException when try-body throws [THROWS-WHEN] (RuntimeException) e.getCause() when try-body throws && e.getCause() instanceof JirmIllegalStateException || e.getCause() instanceof JirmIllegalArgumentException [...
/* static context [FOCAL] public static String SqlPartialParser.parseFromPath(String path) [THROWS-WHEN] RuntimeException when try-body throws [THROWS-WHEN] (RuntimeException) e.getCause() when try-body throws && e.getCause() instanceof JirmIllegalStateException || e.getCause() instanceof JirmIllegalArgumentException [...
true
ok
{"focal": {"class": "SqlPartialParser", "name": "parseFromPath", "signature": "String parseFromPath(String path)", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "String"}], "return_type": "String"}, "class_info": {"name": "SqlPartialParser", "kind": "class", "modifiers": "", "superc...
6281707_79
class LocalOAuthTokenCacheService implements OAuthTokenCacheService { @Override public void cacheToken(Token requestToken) { if (requestToken == null || requestToken.getToken() == null) { return; } tokenCache.put(requestToken.getToken(), requestToken); } @Override p...
oAuthTokenCacheService.cacheToken(null); assertEquals(1, oAuthTokenCacheService.tokenCache.size()); } }
[FOCAL] @Override public void LocalOAuthTokenCacheService.cacheToken(Token requestToken) [CLASS] class LocalOAuthTokenCacheService implements OAuthTokenCacheService [METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Token.getToken/0, tokenCache.put/2 [PATH1] if(requestToken == null ||...
/* static context [FOCAL] @Override public void LocalOAuthTokenCacheService.cacheToken(Token requestToken) [PATH1] if(requestToken == null || requestToken.getToken() == null)=T -> return [PATH2] if(requestToken == null || requestToken.getToken() == null)=F [INPUTS] branches=requestToken | result=- [COLLABORATORS] param...
/* static context [FOCAL] @Override public void LocalOAuthTokenCacheService.cacheToken(Token requestToken) [PATH1] if(requestToken == null || requestToken.getToken() == null)=T -> return [PATH2] if(requestToken == null || requestToken.getToken() == null)=F [INPUTS] branches=requestToken | result=- [COLLABORATORS] param...
true
ok
{"focal": {"class": "LocalOAuthTokenCacheService", "name": "cacheToken", "signature": "void cacheToken(Token requestToken)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "requestToken", "type": "Token"}], "return_type": "void"}, "class_info": {"name": "LocalOAuthTokenCacheService", "kind": "cla...
6290993_103
class OneToManyJoin { public static <K, U, V, T> PCollection<T> oneToManyJoin(PTable<K, U> left, PTable<K, V> right, DoFn<Pair<U, Iterable<V>>, T> postProcessFn, PType<T> ptype) { return oneToManyJoin(left, right, postProcessFn, ptype, -1); } public ...
PTable<Integer, String> left = MemPipeline.typedTableOf(Avros.tableOf(Avros.ints(), Avros.strings()), 1, "one", 2, "two"); PTable<Integer, String> right = MemPipeline.typedTableOf(Avros.tableOf(Avros.ints(), Avros.strings()), 2, "2A", 2, "2B"); PCollection<Pair<String, String>> joined = OneToManyJo...
[FOCAL] public static PCollection<T> OneToManyJoin.oneToManyJoin(PTable<K, U> left, PTable<K, V> right, DoFn<Pair<U, Iterable<V>>, T> postProcessFn, PType<T> ptype) [CLASS] class OneToManyJoin [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] PCollection<T> oneToManyJoin(PTable<K, U>...
/* static context [FOCAL] public static PCollection<T> OneToManyJoin.oneToManyJoin(PTable<K, U> left, PTable<K, V> right, DoFn<Pair<U, Iterable<V>>, T> postProcessFn, PType<T> ptype) [INPUTS] branches=- | result=left, postProcessFn, ptype, right [CALLS-INTERNAL] PCollection<T> oneToManyJoin(PTable<K, U> left, PTable<K,...
/* static context [FOCAL] public static PCollection<T> OneToManyJoin.oneToManyJoin(PTable<K, U> left, PTable<K, V> right, DoFn<Pair<U, Iterable<V>>, T> postProcessFn, PType<T> ptype) [INPUTS] branches=- | result=left, postProcessFn, ptype, right [CALLS-INTERNAL] PCollection<T> oneToManyJoin(PTable<K, U> left, PTable<K,...
true
ok
{"focal": {"class": "OneToManyJoin", "name": "oneToManyJoin", "signature": "PCollection<T> oneToManyJoin(PTable<K, U> left, PTable<K, V> right, DoFn<Pair<U, Iterable<V>>, T> postProcessFn, PType<T> ptype)", "start_line": 3, "modifiers": "public static", "params": [{"name": "left", "type": "PTable<K, U>"}, {"name": "rig...
6293402_212
class RangeValidator extends AbstractValidator<T> { public static <C extends Comparable<? super C>> RangeValidator<C> of( String errorMessage, C minValue, C maxValue) { return new RangeValidator<>(errorMessage, Comparator.nullsFirst(Comparator.naturalOrder()), minValue, ...
assertPasses(10, RangeValidator.of("Must be between -123 and 42", -123, 42)); } }
[FOCAL] public static RangeValidator<C> RangeValidator.of(String errorMessage, C minValue, C maxValue) [CLASS] class RangeValidator extends AbstractValidator<T> [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Comparator.nullsFirst/1, Comparator.naturalOrder/0 [NEW] RangeValidator<>...
/* static context [FOCAL] public static RangeValidator<C> RangeValidator.of(String errorMessage, C minValue, C maxValue) [INPUTS] branches=- | result=errorMessage, maxValue, minValue [NEW] RangeValidator<> [CALLS-EXTERNAL] Comparator.nullsFirst/1, Comparator.naturalOrder/0 */
/* static context [FOCAL] public static RangeValidator<C> RangeValidator.of(String errorMessage, C minValue, C maxValue) [INPUTS] branches=- | result=errorMessage, maxValue, minValue [NEW] RangeValidator<> [CALLS-EXTERNAL] Comparator.nullsFirst/1, Comparator.naturalOrder/0 */ class RangeValidator extends AbstractValida...
true
ok
{"focal": {"class": "RangeValidator", "name": "of", "signature": "RangeValidator<C> of(String errorMessage, C minValue, C maxValue)", "start_line": 3, "modifiers": "public static", "params": [{"name": "errorMessage", "type": "String"}, {"name": "minValue", "type": "C"}, {"name": "maxValue", "type": "C"}], "return_type"...
6331476_36
class SystemMetadata { public Aspect.Builder getAspect() { final Aspect.Builder aspect = Aspect.all(); final All all = ClassReflection.getAnnotation(c, All.class); if (all != null) { aspect.all(all.value()); } final One one = ClassReflection.getAnnotation(c, One....
@All(ComponentX.class) abstract class Test extends BaseSystem { } assertEquals(Aspect.all(ComponentX.class), new SystemMetadata(Test.class).getAspect()); } }
[FOCAL] public Aspect.Builder SystemMetadata.getAspect() [CLASS] class SystemMetadata [METRICS] loc=16 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Aspect.all/0, ClassReflection.getAnnotation/2, Aspect.Builder.all/1, All.value/0, Aspect.Builder.one/1, One.value/0, Aspect.Builder.exclude/1, Excl...
/* static context [FOCAL] public Aspect.Builder SystemMetadata.getAspect() [PATH1] if(all != null)=T -> if(one != null)=T -> if(exclude != null)=T -> return (all != null || exclude != null || one != null) ? aspect : null [PATH2] if(all != null)=F -> if(one != null)=F -> if(exclude != null)=F -> return (all != null || e...
/* static context [FOCAL] public Aspect.Builder SystemMetadata.getAspect() [PATH1] if(all != null)=T -> if(one != null)=T -> if(exclude != null)=T -> return (all != null || exclude != null || one != null) ? aspect : null [PATH2] if(all != null)=F -> if(one != null)=F -> if(exclude != null)=F -> return (all != null || e...
true
ok
{"focal": {"class": "SystemMetadata", "name": "getAspect", "signature": "Aspect.Builder getAspect()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Aspect.Builder"}, "class_info": {"name": "SystemMetadata", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "...
6332635_3
class Header { public String getContentType() { return getFirstValue(CONTENT_TYPE); } public Header(); public Header(InputStream in); public Header(String header); public Header(Header header); public void add(String key, String val); public void add(HeaderField field); public void remove(HeaderField ...
assertTrue(new MimeType(header.getContentType()).match("text/xml")); } }
[FOCAL] public String Header.getContentType() [CLASS] class Header [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String getFirstValue(String name) [CLASS-MEMBERS] Header(); Header(InputStream in); Header(String header); Header(Header header); void add(String key, String val); voi...
/* static context [FOCAL] public String Header.getContentType() [CALLS-INTERNAL] String getFirstValue(String name) */
/* static context [FOCAL] public String Header.getContentType() [CALLS-INTERNAL] String getFirstValue(String name) */ class Header { public String getContentType() { return getFirstValue(CONTENT_TYPE); } public Header(); public Header(InputStream in); public Header(String header); public Header(Header hea...
true
ok
{"focal": {"class": "Header", "name": "getContentType", "signature": "String getContentType()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Header", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "header", "type":...
6357227_0
class MovingAverageUDF extends UDF { public float evaluate( final int numberOfUnits, final Text key, final float value) { LinkedList<Float> list = map.get(key); if (list == null) { list = new LinkedList<Float>(); map.put(key, list); } list.add(value); if (list.size() > numberOfUnits) { list.remo...
MovingAverageUDF udf = new MovingAverageUDF(); Text key = new Text("key"); assertEquals(0.0f, udf.evaluate(0, key, 1.0f), 0.0001f); assertEquals(0.0f, udf.evaluate(0, key, 2.0f), 0.0001f); assertEquals(0.0f, udf.evaluate(0, key, 3.0f), 0.0001f); assertEquals(0.0f, udf.evaluate(0, key, 4.0f), 0.0001f); } }
[FOCAL] public float MovingAverageUDF.evaluate(int numberOfUnits, Text key, float value) [CLASS] class MovingAverageUDF extends UDF [METRICS] loc=19 cc=4 branches=3 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] float sum(LinkedList<Float> list) [CALLS-EXTERNAL] map.get/1, map.put/2, LinkedList<Float>.add/1, Lin...
/* static context [FOCAL] public float MovingAverageUDF.evaluate(int numberOfUnits, Text key, float value) [PATH1] if(list == null)=T -> if(list.size() > numberOfUnits)=T -> if(numberOfUnits == 0)=T -> return 0.0f [PATH2] if(list == null)=F -> if(list.size() > numberOfUnits)=F -> if(numberOfUnits == 0)=F -> return sum(...
/* static context [FOCAL] public float MovingAverageUDF.evaluate(int numberOfUnits, Text key, float value) [PATH1] if(list == null)=T -> if(list.size() > numberOfUnits)=T -> if(numberOfUnits == 0)=T -> return 0.0f [PATH2] if(list == null)=F -> if(list.size() > numberOfUnits)=F -> if(numberOfUnits == 0)=F -> return sum(...
true
ok
{"focal": {"class": "MovingAverageUDF", "name": "evaluate", "signature": "float evaluate(int numberOfUnits, Text key, float value)", "start_line": 3, "modifiers": "public", "params": [{"name": "numberOfUnits", "type": "int"}, {"name": "key", "type": "Text"}, {"name": "value", "type": "float"}], "return_type": "float"},...
6358188_343
class FloatAnyAggregatorFactory extends AggregatorFactory { @Override public VectorAggregator factorizeVector(VectorColumnSelectorFactory selectorFactory) { ColumnCapabilities capabilities = selectorFactory.getColumnCapabilities(fieldName); if (capabilities == null || capabilities.getType().isNumeric()) ...
VectorAggregator aggregator = target.factorizeVector(selectorFactory); Assert.assertNotNull(aggregator); Assert.assertEquals(FloatAnyVectorAggregator.class, aggregator.getClass()); } }
[FOCAL] @Override public VectorAggregator FloatAnyAggregatorFactory.factorizeVector(VectorColumnSelectorFactory selectorFactory) [CLASS] class FloatAnyAggregatorFactory extends AggregatorFactory [METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] VectorColumnSelectorFactory.getColumnC...
/* static context [FOCAL] @Override public VectorAggregator FloatAnyAggregatorFactory.factorizeVector(VectorColumnSelectorFactory selectorFactory) [PATH1] if(capabilities == null || capabilities.getType().isNumeric())=T -> return new FloatAnyVectorAggregator(selectorFactory.makeValueSelector(fiel... [PATH2] if(capabili...
/* static context [FOCAL] @Override public VectorAggregator FloatAnyAggregatorFactory.factorizeVector(VectorColumnSelectorFactory selectorFactory) [PATH1] if(capabilities == null || capabilities.getType().isNumeric())=T -> return new FloatAnyVectorAggregator(selectorFactory.makeValueSelector(fiel... [PATH2] if(capabili...
true
ok
{"focal": {"class": "FloatAnyAggregatorFactory", "name": "factorizeVector", "signature": "VectorAggregator factorizeVector(VectorColumnSelectorFactory selectorFactory)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "selectorFactory", "type": "VectorColumnSelectorFactory"}], "return_type": "Vect...
6370211_54
class DefaultInterviewServiceImpl extends PersistenceManagerAwareService implements InterviewService { public List<StageTransition> getStageTransitions(Interview interview, Stage stage) { StageTransition template = new StageTransition(); template.setInterview(interview); template.setStage(stage.getName()...
DefaultInterviewServiceImpl service = new DefaultInterviewServiceImpl(); service.setPersistenceManager(persistenceManagerMock); // Create an empty list of stage transitions for the test. List<StageTransition> expectedStageTransitions = new ArrayList<StageTransition>(); StageTransition stageTransit...
[FOCAL] public List<StageTransition> DefaultInterviewServiceImpl.getStageTransitions(Interview interview, Stage stage) [CLASS] class DefaultInterviewServiceImpl extends PersistenceManagerAwareService implements InterviewService [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] StageT...
/* static context [FOCAL] public List<StageTransition> DefaultInterviewServiceImpl.getStageTransitions(Interview interview, Stage stage) [COLLABORATORS] param stage:Stage getName/0 [NEW] StageTransition, SortingClause [CALLS-EXTERNAL] StageTransition.setInterview/1, StageTransition.setStage/1, Stage.getName/0, getPersi...
/* static context [FOCAL] public List<StageTransition> DefaultInterviewServiceImpl.getStageTransitions(Interview interview, Stage stage) [COLLABORATORS] param stage:Stage getName/0 [NEW] StageTransition, SortingClause [CALLS-EXTERNAL] StageTransition.setInterview/1, StageTransition.setStage/1, Stage.getName/0, getPersi...
true
ok
{"focal": {"class": "DefaultInterviewServiceImpl", "name": "getStageTransitions", "signature": "List<StageTransition> getStageTransitions(Interview interview, Stage stage)", "start_line": 3, "modifiers": "public", "params": [{"name": "interview", "type": "Interview"}, {"name": "stage", "type": "Stage"}], "return_type":...
6405716_25
class CharacterConverter extends AbstractConverter<Character> { @Override public Character convert(String value) { if (value != null && value.length() > 0) { return value.charAt(0); } return null; } private CharacterConverter underTest; } class Charact...
Character result = underTest.convert(" "); assertEquals(' ', result.charValue()); } }
[FOCAL] @Override public Character CharacterConverter.convert(String value) [CLASS] class CharacterConverter extends AbstractConverter<Character> [METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] String.length/0, String.charAt/1 [PATH1] if(value != null && value.length() > 0)=T -> re...
/* static context [FOCAL] @Override public Character CharacterConverter.convert(String value) [PATH1] if(value != null && value.length() > 0)=T -> return value.charAt(0) [PATH2] if(value != null && value.length() > 0)=F -> return null [INPUTS] branches=value | result=value [CALLS-EXTERNAL] String.length/0, String.charA...
/* static context [FOCAL] @Override public Character CharacterConverter.convert(String value) [PATH1] if(value != null && value.length() > 0)=T -> return value.charAt(0) [PATH2] if(value != null && value.length() > 0)=F -> return null [INPUTS] branches=value | result=value [CALLS-EXTERNAL] String.length/0, String.charA...
true
ok
{"focal": {"class": "CharacterConverter", "name": "convert", "signature": "Character convert(String value)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "value", "type": "String"}], "return_type": "Character"}, "class_info": {"name": "CharacterConverter", "kind": "class", "modifiers": "", "sup...
6434628_5
class PermutationUtil { public static Set<String> permutateSQL(String delimiter, String... frag) { return new PermutationGenerator(frag).setDelimiter(delimiter).permutateSQL(); } } class PermutationUtilTest { @Test public void testPermutate() {
Set<String> set = PermutationUtil.permutateSQL("-", "1"); Assert.assertEquals(1, set.size()); Assert.assertTrue(set.contains("1")); set = PermutationUtil.permutateSQL("-", "1", "1"); Assert.assertEquals(1, set.size()); Assert.assertTrue(set.contains("1-1")); set...
[FOCAL] public static Set<String> PermutationUtil.permutateSQL(String delimiter, String... frag) [CLASS] class PermutationUtil [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] new PermutationGenerator(frag).setDelimiter(delimiter).permutateSQL/0, new PermutationGenerator(frag).setDe...
/* static context [FOCAL] public static Set<String> PermutationUtil.permutateSQL(String delimiter, String... frag) [INPUTS] branches=- | result=delimiter, frag [NEW] PermutationGenerator [CALLS-EXTERNAL] new PermutationGenerator(frag).setDelimiter(delimiter).permutateSQL/0, new PermutationGenerator(frag).setDelimiter/1...
/* static context [FOCAL] public static Set<String> PermutationUtil.permutateSQL(String delimiter, String... frag) [INPUTS] branches=- | result=delimiter, frag [NEW] PermutationGenerator [CALLS-EXTERNAL] new PermutationGenerator(frag).setDelimiter(delimiter).permutateSQL/0, new PermutationGenerator(frag).setDelimiter/1...
true
ok
{"focal": {"class": "PermutationUtil", "name": "permutateSQL", "signature": "Set<String> permutateSQL(String delimiter, String... frag)", "start_line": 3, "modifiers": "public static", "params": [{"name": "delimiter", "type": "String"}, {"name": "frag", "type": "String..."}], "return_type": "Set<String>"}, "class_info"...
6437134_0
class RouteRouteParser extends RouteParser { public Route parse() throws IOException { Route route = new Route(); try { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); ...
// SETUP DATA config.put("name", "Sisimiut - Nuuk"); InputStream is = getClass().getResourceAsStream("/routes/Sisimiut - Nuuk.route"); RouteParser parser = new RouteRouteParser(is, config); // EXECUTE Route r = parser.parse(); // TEST ASSERTIONS...
[FOCAL] public Route RouteRouteParser.parse() [CLASS] class RouteRouteParser extends RouteParser [METRICS] loc=68 cc=6 branches=2 loops=1 returns=1 throws=2 nesting=2 [CALLS-INTERNAL] Element getSummariesElement(Document doc); SortedMap<Integer, Element> getControlPointsElements(Document doc, String name); String getCh...
/* static context [FOCAL] public Route RouteRouteParser.parse() [PATH1] foreach(Entry<Integer, Element> entry : controlPointsElements.entrySet())=T -> exit loop -> if(route.getWaypoints().size() > 0)=T -> if(closeReader)=T -> return route [COLLABORATORS] field defaults getDefaultXtd/0; field reader close/0 */
/* static context [FOCAL] public Route RouteRouteParser.parse() [PATH1] foreach(Entry<Integer, Element> entry : controlPointsElements.entrySet())=T -> exit loop -> if(route.getWaypoints().size() > 0)=T -> if(closeReader)=T -> return route [COLLABORATORS] field defaults getDefaultXtd/0; field reader close/0 */ class Rou...
true
ok
{"focal": {"class": "RouteRouteParser", "name": "parse", "signature": "Route parse() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Route"}, "class_info": {"name": "RouteRouteParser", "kind": "class", "modifiers": "", "superclass": "RouteParser", "interfaces": null, "fields":...
6444116_54
class BanNameCommand extends CommonCommand { @Override public boolean onCommand(final CommonSender sender, CommandParser parser) { final boolean isSilent = parser.isSilent(); if (isSilent && !sender.hasPermission(getPermission() + ".silent")) { sender.sendMessage(Message.getString("sender.error.noPe...
PlayerData player = testUtils.createRandomPlayer(); CommonServer server = spy(plugin.getServer()); CommonSender sender = spy(server.getConsoleSender()); String[] args = new String[]{player.getName(), "test", "-s"}; assert (cmd.onCommand(sender, new CommandParser(plugin, args, 1))); await().unt...
[FOCAL] @Override public boolean BanNameCommand.onCommand(CommonSender sender, CommandParser parser) [CLASS] class BanNameCommand extends CommonCommand [METRICS] loc=84 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=3 [CALLS-EXTERNAL] CommandParser.isSilent/0, CommonSender.hasPermission/1, getPermission/0 (inherite...
/* static context [FOCAL] @Override public boolean BanNameCommand.onCommand(CommonSender sender, CommandParser parser) [PATH1] if(isSilent && !sender.hasPermission(getPermission() + ".silent"))=F -> if(parser.args.length < 2)=F -> if(parser.isInvalidReason())=T -> return true [PATH2] if(isSilent && !sender.hasPermissio...
/* static context [FOCAL] @Override public boolean BanNameCommand.onCommand(CommonSender sender, CommandParser parser) [PATH1] if(isSilent && !sender.hasPermission(getPermission() + ".silent"))=F -> if(parser.args.length < 2)=F -> if(parser.isInvalidReason())=T -> return true [PATH2] if(isSilent && !sender.hasPermissio...
true
ok
{"focal": {"class": "BanNameCommand", "name": "onCommand", "signature": "boolean onCommand(CommonSender sender, CommandParser parser)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "sender", "type": "CommonSender"}, {"name": "parser", "type": "CommandParser"}], "return_type": "boolean"}, "class...
6454766_0
class HazelcastAgent implements DiscoveryAgent, ConfigurationAgent { public boolean isLeader() { boolean leader = false; for (Member member : hazelcast.getCluster().getMembers()) { String zone = member.getStringAttribute("zone"); if (zone == null) { continue;...
HostInfo info = EasyMock.createNiceMock(HostInfo.class); EasyMock.expect(info.getZoneName()).andReturn("zone").anyTimes(); EasyMock.replay(info); HazelcastAgent agent = new HazelcastAgent(SERVICE, info, MONITOR); List<Boolean> listenerFired = new ArrayList<>(); agent.reg...
[FOCAL] public boolean HazelcastAgent.isLeader() [CLASS] class HazelcastAgent implements DiscoveryAgent, ConfigurationAgent [METRICS] loc=16 cc=5 branches=3 loops=1 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] hazelcast.getCluster().getMembers/0, hazelcast.getCluster/0, Member.getStringAttribute/1, info.getZoneName()....
/* static context [FOCAL] public boolean HazelcastAgent.isLeader() [PATH1] foreach(Member member : hazelcast.getCluster().getMembers())=T -> if(zone == null)=F -> if(info.getZoneName().equals(zone))=T -> if(member.localMember())=T -> return leader [PATH2] foreach(Member member : hazelcast.getCluster().getMembers())=T -...
/* static context [FOCAL] public boolean HazelcastAgent.isLeader() [PATH1] foreach(Member member : hazelcast.getCluster().getMembers())=T -> if(zone == null)=F -> if(info.getZoneName().equals(zone))=T -> if(member.localMember())=T -> return leader [PATH2] foreach(Member member : hazelcast.getCluster().getMembers())=T -...
true
ok
{"focal": {"class": "HazelcastAgent", "name": "isLeader", "signature": "boolean isLeader()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "HazelcastAgent", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "DiscoveryAgent, ConfigurationAgent",...
6457784_0
class Freud { public static <A> boolean analyse(A analysedObject, Matcher assertion) { return assertion.matches(analysedObject); } public static FreudRuleBuilder<T> iterateOver(Class<T> type); public static Iterable<Object[]> parameterise(Iterable<A> sourceObjects, int numberOfParameters); ...
assertTrue(Freud.analyse(analysed, CoreMatchers.startsWith("Z"))); } }
[FOCAL] public static boolean Freud.analyse(A analysedObject, Matcher assertion) [CLASS] class Freud [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Matcher.matches/1 [INPUTS] branches=- | result=analysedObject, assertion [COLLABORATORS] param assertion:Matcher matches/1 [DATAFLOW]...
/* static context [FOCAL] public static boolean Freud.analyse(A analysedObject, Matcher assertion) [INPUTS] branches=- | result=analysedObject, assertion [COLLABORATORS] param assertion:Matcher matches/1 [CALLS-EXTERNAL] Matcher.matches/1 */
/* static context [FOCAL] public static boolean Freud.analyse(A analysedObject, Matcher assertion) [INPUTS] branches=- | result=analysedObject, assertion [COLLABORATORS] param assertion:Matcher matches/1 [CALLS-EXTERNAL] Matcher.matches/1 */ class Freud { public static <A> boolean analyse(A analysedObject, Matcher...
true
ok
{"focal": {"class": "Freud", "name": "analyse", "signature": "boolean analyse(A analysedObject, Matcher assertion)", "start_line": 3, "modifiers": "public static", "params": [{"name": "analysedObject", "type": "A"}, {"name": "assertion", "type": "Matcher"}], "return_type": "boolean"}, "class_info": {"name": "Freud", "k...
6476959_9
class App { static String run(File file, String fileTitle, boolean renderHtml) throws IOException, LinkTargetException, EngineException { // Set-up a simple wiki configuration WikiConfig config = DefaultConfigEnWp.generate(); final int wrapCol = 80; // Instantiate a compiler for wiki pages WtEngineImpl e...
String title = "Simple_Page"; URL url = AppTest.class.getResource("/" + title + ".wikitext"); String path = StringTools.decodeUsingDefaultCharset(url.getFile()); String actual = App.run(new File(path), title, false); actual = FileTools.lineEndToUnix(actual); InputStream expectedIs = AppTest.class.getReso...
[FOCAL] static String App.run(File file, String fileTitle, boolean renderHtml) [CLASS] class App [METRICS] loc=53 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] DefaultConfigEnWp.generate/0, PageTitle.make/2, FileUtils.readFileToString/2, Charset.defaultCharset().name/0, Charset.defaultCharset/0,...
/* static context [FOCAL] static String App.run(File file, String fileTitle, boolean renderHtml) [THROWS-WHEN] UnsupportedOperationException when renderHtml [PATH1] if(renderHtml)=T -> throw new UnsupportedOperationException( "HTML rendering is not yet suppo... [PATH2] if(renderHtml)=F -> return (String) p.go(womDoc) [...
/* static context [FOCAL] static String App.run(File file, String fileTitle, boolean renderHtml) [THROWS-WHEN] UnsupportedOperationException when renderHtml [PATH1] if(renderHtml)=T -> throw new UnsupportedOperationException( "HTML rendering is not yet suppo... [PATH2] if(renderHtml)=F -> return (String) p.go(womDoc) [...
true
ok
{"focal": {"class": "App", "name": "run", "signature": "String run(File file, String fileTitle, boolean renderHtml) throws IOException, LinkTargetException, EngineException", "start_line": 3, "modifiers": "static", "params": [{"name": "file", "type": "File"}, {"name": "fileTitle", "type": "String"}, {"name": "renderHtm...
6489406_31
class EventEmittingTrackerImpl implements EventEmittingTracker { static boolean isTrackStale(long lastAnyUpdate, long lastPositionUpdate, long currentUpdate) { long lastUpdate = Math.max(lastAnyUpdate, lastPositionUpdate); boolean trackStale = lastUpdate > 0L && currentUpdate - lastUpdate >= TRACK_...
assertFalse(EventEmittingTrackerImpl.isTrackStale(0, 0, EventEmittingTrackerImpl.TRACK_STALE_MILLIS - 1)); assertFalse(EventEmittingTrackerImpl.isTrackStale(0, 0, EventEmittingTrackerImpl.TRACK_STALE_MILLIS + 1)); long now = new Date(System.currentTimeMillis()).getTime(); assertFalse(E...
[FOCAL] static boolean EventEmittingTrackerImpl.isTrackStale(long lastAnyUpdate, long lastPositionUpdate, long currentUpdate) [CLASS] class EventEmittingTrackerImpl implements EventEmittingTracker [METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Math.max/2, LOG.debug/1 [PATH1] if(tr...
/* static context [FOCAL] static boolean EventEmittingTrackerImpl.isTrackStale(long lastAnyUpdate, long lastPositionUpdate, long currentUpdate) [PATH1] if(trackStale)=T -> return trackStale [PATH2] if(trackStale)=F -> return trackStale [INPUTS] branches=currentUpdate, lastAnyUpdate, lastPositionUpdate | result=currentU...
/* static context [FOCAL] static boolean EventEmittingTrackerImpl.isTrackStale(long lastAnyUpdate, long lastPositionUpdate, long currentUpdate) [PATH1] if(trackStale)=T -> return trackStale [PATH2] if(trackStale)=F -> return trackStale [INPUTS] branches=currentUpdate, lastAnyUpdate, lastPositionUpdate | result=currentU...
true
ok
{"focal": {"class": "EventEmittingTrackerImpl", "name": "isTrackStale", "signature": "boolean isTrackStale(long lastAnyUpdate, long lastPositionUpdate, long currentUpdate)", "start_line": 3, "modifiers": "static", "params": [{"name": "lastAnyUpdate", "type": "long"}, {"name": "lastPositionUpdate", "type": "long"}, {"na...
6500041_18
class FreebaseRDFMapper extends Mapper<LongWritable,Text,Text,Text> { @Override public void map(LongWritable k, Text v,Context c) throws IOException, InterruptedException { String line=v.toString(); if (line.startsWith("@prefix")) { incrementCounter(c,FreebasePrefilterCounter.PREFI...
String ordinaryTriple = "ns:aviation.aircraft.first_flight\tns:type.property.unique\ttrue."; mapper.map(new LongWritable(1L), new Text(ordinaryTriple), context); verify(context).getCounter(FreebasePrefilterCounter.ACCEPTED); verify(context) .write(new Text( "<http...
[FOCAL] @Override public void FreebaseRDFMapper.map(LongWritable k, Text v, Context c) [CLASS] class FreebaseRDFMapper extends Mapper<LongWritable,Text,Text,Text> [METRICS] loc=30 cc=4 branches=2 loops=0 returns=2 throws=0 nesting=2 [CALLS-INTERNAL] List<String> expandTripleParts(String line); void accept(Context out, ...
/* static context [FOCAL] @Override public void FreebaseRDFMapper.map(LongWritable k, Text v, Context c) [PATH1] if(line.startsWith("@prefix"))=F -> try-body throws -> return [PATH2] if(line.startsWith("@prefix"))=T -> return [PATH3] if(line.startsWith("@prefix"))=F -> if(tripleFilter.apply(triple))=T -> return [PATH4]...
/* static context [FOCAL] @Override public void FreebaseRDFMapper.map(LongWritable k, Text v, Context c) [PATH1] if(line.startsWith("@prefix"))=F -> try-body throws -> return [PATH2] if(line.startsWith("@prefix"))=T -> return [PATH3] if(line.startsWith("@prefix"))=F -> if(tripleFilter.apply(triple))=T -> return [PATH4]...
true
ok
{"focal": {"class": "FreebaseRDFMapper", "name": "map", "signature": "void map(LongWritable k, Text v, Context c) throws IOException, InterruptedException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "k", "type": "LongWritable"}, {"name": "v", "type": "Text"}, {"name": "c", "type": "Context"}...
6505114_0
class ClassUtils { public static <T> T createInstanceOfGenericType(Class clazz){ return createInstanceOfGenericType(clazz,0); } public static T createInstanceOfGenericType(Class clazz,int index); public static Class<?> getRawType(Type type); } class ClassUtilsTest { @Test void createIn...
UtilA<Long> utilA = new UtilA<>(); Long dynamic = (Long) ClassUtils.createInstanceOfGenericType(utilA.getClass()); utilA.setDynamicInstace(dynamic); Assert.assertEquals(dynamic.longValue(),0);; } }
[FOCAL] public static T ClassUtils.createInstanceOfGenericType(Class clazz) [CLASS] class ClassUtils [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] T createInstanceOfGenericType(Class clazz, int index) [INPUTS] branches=- | result=clazz [DATAFLOW] clazz@param->L2 [CLASS-MEMBERS] T...
/* static context [FOCAL] public static T ClassUtils.createInstanceOfGenericType(Class clazz) [INPUTS] branches=- | result=clazz [CALLS-INTERNAL] T createInstanceOfGenericType(Class clazz, int index) */
/* static context [FOCAL] public static T ClassUtils.createInstanceOfGenericType(Class clazz) [INPUTS] branches=- | result=clazz [CALLS-INTERNAL] T createInstanceOfGenericType(Class clazz, int index) */ class ClassUtils { public static <T> T createInstanceOfGenericType(Class clazz){ return createInstanceOfG...
true
ok
{"focal": {"class": "ClassUtils", "name": "createInstanceOfGenericType", "signature": "T createInstanceOfGenericType(Class clazz)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clazz", "type": "Class"}], "return_type": "T"}, "class_info": {"name": "ClassUtils", "kind": "class", "modifiers": "", "...
6552338_4
class ConnectionFactoryImpl extends EObjectImpl implements ConnectionFactory { public RecordFactory getRecordFactory() throws ResourceException { try { if (recordFactory == null) { JCoRepository repository = ((ConnectionImpl)getConnection()).getDestination().getRepository(); recordFactory = CciFactoryImp...
// Given ConnectionImpl mockConnection = mock(ConnectionImpl.class); JCoDestination mockDestination = mock(JCoDestination.class); JCoRepository mockRepository = mock(JCoRepository.class); when(mockConnectionManager.allocateConnection(mockManagedConnectionFactory, null)).thenReturn(mockConnection); when(mock...
[FOCAL] public RecordFactory ConnectionFactoryImpl.getRecordFactory() [CLASS] class ConnectionFactoryImpl extends EObjectImpl implements ConnectionFactory [METRICS] loc=12 cc=3 branches=1 loops=0 returns=1 throws=1 nesting=2 [CALLS-INTERNAL] Connection getConnection() [CALLS-EXTERNAL] ((ConnectionImpl)getConnection())....
/* static context [FOCAL] public RecordFactory ConnectionFactoryImpl.getRecordFactory() [THROWS-WHEN] ExceptionBundle.EXCEPTIONS.failedToGetRecordFactory(e) when try-body throws [PATH1] try-body throws -> throw ExceptionBundle.EXCEPTIONS.failedToGetRecordFactory(e) [PATH2] if(recordFactory == null)=T -> return recordFa...
/* static context [FOCAL] public RecordFactory ConnectionFactoryImpl.getRecordFactory() [THROWS-WHEN] ExceptionBundle.EXCEPTIONS.failedToGetRecordFactory(e) when try-body throws [PATH1] try-body throws -> throw ExceptionBundle.EXCEPTIONS.failedToGetRecordFactory(e) [PATH2] if(recordFactory == null)=T -> return recordFa...
true
ok
{"focal": {"class": "ConnectionFactoryImpl", "name": "getRecordFactory", "signature": "RecordFactory getRecordFactory() throws ResourceException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "RecordFactory"}, "class_info": {"name": "ConnectionFactoryImpl", "kind": "class", "modifiers": "", "sup...
6563886_6
class StringConverter implements Converter { public Object convert(String value) { return value; } public String toString(Object value); private StringConverter converter; } class StringConverterTest { private StringConverter converter; @Test public void convert() {
assertEquals("", converter.convert("")); assertEquals("try", converter.convert("try")); assertNull(converter.convert(null)); } }
[FOCAL] public Object StringConverter.convert(String value) [CLASS] class StringConverter implements Converter [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=value [DATAFLOW] value@param->L2 [CLASS-MEMBERS] String toString(Object value) [TEST] StringConverterTest: @Tes...
/* static context [FOCAL] public Object StringConverter.convert(String value) [INPUTS] branches=- | result=value */
/* static context [FOCAL] public Object StringConverter.convert(String value) [INPUTS] branches=- | result=value */ class StringConverter implements Converter { public Object convert(String value) { return value; } public String toString(Object value); private StringConverter converter; } class StringC...
true
ok
{"focal": {"class": "StringConverter", "name": "convert", "signature": "Object convert(String value)", "start_line": 3, "modifiers": "public", "params": [{"name": "value", "type": "String"}], "return_type": "Object"}, "class_info": {"name": "StringConverter", "kind": "class", "modifiers": "", "superclass": null, "inter...
6603193_10
class ArraySet extends AbstractSet<E> { @Override public boolean remove(@Nullable Object element) { int length = array.length; int index = indexOf(element, array, 0, length); if (index < 0) { return false; } Object[] newArray = new Object[length -...
set.addAll(Arrays.asList(0, 1, 2)); assertTrue(set.remove(1)); assertEquals(2, set.size()); assertTrue(set.remove(0)); assertEquals(1, set.size()); assertTrue(set.remove(2)); assertEquals(0, set.size()); } }
[FOCAL] @Override public boolean ArraySet.remove(Object element) [CLASS] class ArraySet extends AbstractSet<E> [METRICS] loc=15 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] int indexOf(Object element, Object[] array, int fromIndex, int toIndex) [CALLS-EXTERNAL] System.arraycopy/5 [PATH1] if(ind...
/* static context [FOCAL] @Override public boolean ArraySet.remove(Object element) [PATH1] if(index < 0)=T -> return false [PATH2] if(index < 0)=F -> return true [INPUTS] branches=element | result=- [CALLS-INTERNAL] int indexOf(Object element, Object[] array, int fromIndex, int toIndex) [CALLS-EXTERNAL] System.arraycop...
/* static context [FOCAL] @Override public boolean ArraySet.remove(Object element) [PATH1] if(index < 0)=T -> return false [PATH2] if(index < 0)=F -> return true [INPUTS] branches=element | result=- [CALLS-INTERNAL] int indexOf(Object element, Object[] array, int fromIndex, int toIndex) [CALLS-EXTERNAL] System.arraycop...
true
ok
{"focal": {"class": "ArraySet", "name": "remove", "signature": "boolean remove(Object element)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "element", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "ArraySet", "kind": "class", "modifiers": "", "superclass": "AbstractSet...
6605842_1
class ZkTopicManager extends AbstractTopicManager implements TopicManager { @Override public void stop() { logger.info("Stopping Topic manager."); // we just unregister it with zookeeper to make it unavailable from hub servers list try { hubManager.unregisterSelf(); ...
ServerConfiguration cfg1 = new CustomServerConfiguration(cfg.getServerPort() + 1), cfg2 = new CustomServerConfiguration( cfg.getServerPort() + 2); // TODO change cfg1 cfg2 params ZkTopicManager tm1 = new ZkTopicManager(zk, cfg1, scheduler), tm2 = new ZkTopicMan...
[FOCAL] @Override public void ZkTopicManager.stop() [CLASS] class ZkTopicManager extends AbstractTopicManager implements TopicManager [METRICS] loc=11 cc=2 branches=0 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] logger.info/1, hubManager.unregisterSelf/0, logger.error/2, AbstractTopicManager.stop/0 [EXCEPTIONS...
/* static context [FOCAL] @Override public void ZkTopicManager.stop() [PATH1] try-body throws [COLLABORATORS] field hubManager unregisterSelf/0 [EXCEPTIONS] catches IOException e [CALLS-EXTERNAL] logger.info/1, hubManager.unregisterSelf/0, logger.error/2, AbstractTopicManager.stop/0 */
/* static context [FOCAL] @Override public void ZkTopicManager.stop() [PATH1] try-body throws [COLLABORATORS] field hubManager unregisterSelf/0 [EXCEPTIONS] catches IOException e [CALLS-EXTERNAL] logger.info/1, hubManager.unregisterSelf/0, logger.error/2, AbstractTopicManager.stop/0 */ class ZkTopicManager extends Abst...
true
ok
{"focal": {"class": "ZkTopicManager", "name": "stop", "signature": "void stop()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "ZkTopicManager", "kind": "class", "modifiers": "", "superclass": "AbstractTopicManager", "interfaces": "TopicManager", "fields...
6662839_98
class TrusGuardLogParser implements LogParser { @Override public Map<String, Object> parse(Map<String, Object> params) { String line = (String) params.get("line"); if (line == null) return null; try { Map<String, Object> m = new HashMap<String, Object>(); Scanner scanner = new Scanner(line); scann...
String line = "1`0`2`1`000000`3`20071009`11:35:41`Low`6`172.16.104.1`3748`211.48.62.132`110`3003``스팸 메일 차단`2`0`circleo@gmail.com`circleo@kornet.net`FW: 광고 ..테스트 메일`"; Map<String, Object> m = new TrusGuardLogParser().parse(line(line)); // check log header assertNotNull(m); assertEquals(1, m.get("version")); ...
[FOCAL] @Override public Map<String, Object> TrusGuardLogParser.parse(Map<String, Object> params) [CLASS] class TrusGuardLogParser implements LogParser [METRICS] loc=32 cc=5 branches=3 loops=0 returns=3 throws=0 nesting=3 [CALLS-INTERNAL] void parseApplicationLog(Scanner scanner, Map<String, Object> m); void parseFirew...
/* static context [FOCAL] @Override public Map<String, Object> TrusGuardLogParser.parse(Map<String, Object> params) [PATH1] if(line == null)=F -> if(type == 1)=F -> if(type == 2)=T -> return m [PATH2] if(line == null)=T -> return null [PATH3] if(line == null)=F -> try-body throws -> return null [PATH4] if(line == null)...
/* static context [FOCAL] @Override public Map<String, Object> TrusGuardLogParser.parse(Map<String, Object> params) [PATH1] if(line == null)=F -> if(type == 1)=F -> if(type == 2)=T -> return m [PATH2] if(line == null)=T -> return null [PATH3] if(line == null)=F -> try-body throws -> return null [PATH4] if(line == null)...
true
ok
{"focal": {"class": "TrusGuardLogParser", "name": "parse", "signature": "Map<String, Object> parse(Map<String, Object> params)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "params", "type": "Map<String, Object>"}], "return_type": "Map<String, Object>"}, "class_info": {"name": "TrusGuardLogPar...
6682435_0
class UsageTimestampTool { void writeTimestamp(File directory, Long timestamp) throws IOException { File timestampFile = new File(directory, TIMESTAMP_FILE_NAME); CheckinUtils.writeObjectToFile(timestampFile, timestamp); } boolean generateAndWriteTimestamp(File directory); public int run(); public ...
LOG.info("Writing timestamp file to temporary directory for tests."); Long timestamp = 5684L; mTool.writeTimestamp(mTempDir.getRoot(), timestamp); LOG.info("Reading back contents of timestamp file and comparing."); assertEquals("timestamp read does not match timestamp that should have been written....
[FOCAL] void UsageTimestampTool.writeTimestamp(File directory, Long timestamp) [CLASS] class UsageTimestampTool [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] CheckinUtils.writeObjectToFile/2 [NEW] File [FIELDS] read=TIMESTAMP_FILE_NAME:String [EXCEPTIONS] declares IOException [DA...
/* static context [FOCAL] void UsageTimestampTool.writeTimestamp(File directory, Long timestamp) [EXCEPTIONS] declares IOException [FIELDS] read=TIMESTAMP_FILE_NAME:String [NEW] File [CALLS-EXTERNAL] CheckinUtils.writeObjectToFile/2 */
/* static context [FOCAL] void UsageTimestampTool.writeTimestamp(File directory, Long timestamp) [EXCEPTIONS] declares IOException [FIELDS] read=TIMESTAMP_FILE_NAME:String [NEW] File [CALLS-EXTERNAL] CheckinUtils.writeObjectToFile/2 */ class UsageTimestampTool { void writeTimestamp(File directory, Long timestamp) th...
true
ok
{"focal": {"class": "UsageTimestampTool", "name": "writeTimestamp", "signature": "void writeTimestamp(File directory, Long timestamp) throws IOException", "start_line": 3, "modifiers": "", "params": [{"name": "directory", "type": "File"}, {"name": "timestamp", "type": "Long"}], "return_type": "void"}, "class_info": {"n...
6719207_30
class CoordinationStructures { public long uniqueVersionId() { IdGenerator idGenerator = hz.getIdGenerator(CoordinationStructures.VERSION_GENERATOR); long id = idGenerator.newId(); int timeSeconds = (int) (System.currentTimeMillis() / 1000); long paddedId = id << 32; return paddedId + timeSeconds...
try { SploutConfiguration config = SploutConfiguration.getTestConfig(); HazelcastInstance hz = Hazelcast.newHazelcastInstance(HazelcastConfigBuilder.build(config)); CoordinationStructures cS = new CoordinationStructures(hz); for (int i = 0; i < 1000; i++) { long version1 = cS.unique...
[FOCAL] public long CoordinationStructures.uniqueVersionId() [CLASS] class CoordinationStructures [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] hz.getIdGenerator/1, IdGenerator.newId/0, System.currentTimeMillis/0 [COLLABORATORS] field hz getIdGenerator/1 [DATAFLOW] id@L3->L5; idG...
/* static context [FOCAL] public long CoordinationStructures.uniqueVersionId() [COLLABORATORS] field hz getIdGenerator/1 [CALLS-EXTERNAL] hz.getIdGenerator/1, IdGenerator.newId/0, System.currentTimeMillis/0 */
/* static context [FOCAL] public long CoordinationStructures.uniqueVersionId() [COLLABORATORS] field hz getIdGenerator/1 [CALLS-EXTERNAL] hz.getIdGenerator/1, IdGenerator.newId/0, System.currentTimeMillis/0 */ class CoordinationStructures { public long uniqueVersionId() { IdGenerator idGenerator = hz.getIdGenera...
true
ok
{"focal": {"class": "CoordinationStructures", "name": "uniqueVersionId", "signature": "long uniqueVersionId()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "long"}, "class_info": {"name": "CoordinationStructures", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields...
6725438_4
class IoUtils { public static void transfer(final InputStream input, final OutputStream output, final BuffersPool buffersPool) throws IOException { final InputStream in = buffersPool == null ? new BufferedInputStream(input, BUFFER_SIZE_8K) : new PoolableBufferedInputStream(input, BUFFER_SIZE_8K, ...
OutputStream output = mock(OutputStream.class); IoUtils.transfer(testInput, output, buffersPool); verify(output, atLeast(1)).write(any(byte[].class), anyInt(), anyInt()); verify(output).flush(); } }
[FOCAL] public static void IoUtils.transfer(InputStream input, OutputStream output, BuffersPool buffersPool) [CLASS] class IoUtils [METRICS] loc=23 cc=4 branches=1 loops=1 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] void closeQuietly(Closeable closeable) [CALLS-EXTERNAL] BuffersPool.get/1, InputStream.read/1, OutputS...
/* static context [FOCAL] public static void IoUtils.transfer(InputStream input, OutputStream output, BuffersPool buffersPool) [PATH1] while((cnt = in.read(buffer)) != EOF)=T -> exit loop -> if(buffersPool != null)=T [PATH2] while((cnt = in.read(buffer)) != EOF)=F -> if(buffersPool != null)=F [PATH3] try-body throws ->...
/* static context [FOCAL] public static void IoUtils.transfer(InputStream input, OutputStream output, BuffersPool buffersPool) [PATH1] while((cnt = in.read(buffer)) != EOF)=T -> exit loop -> if(buffersPool != null)=T [PATH2] while((cnt = in.read(buffer)) != EOF)=F -> if(buffersPool != null)=F [PATH3] try-body throws ->...
true
ok
{"focal": {"class": "IoUtils", "name": "transfer", "signature": "void transfer(InputStream input, OutputStream output, BuffersPool buffersPool) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "InputStream"}, {"name": "output", "type": "OutputStream"}, {"name": "b...
6726370_93
class JenkinsVersion implements Comparable<JenkinsVersion> { public boolean isGreaterThan(String version) { JenkinsVersion create = create(version); return this.cv.compareTo(create.cv) > 0; } public JenkinsVersion(); public JenkinsVersion(String version); public final static Jen...
JenkinsVersion jv = new JenkinsVersion("1.651.1"); assertThat(jv.isGreaterThan("1.651.1")).isFalse(); } }
[FOCAL] public boolean JenkinsVersion.isGreaterThan(String version) [CLASS] class JenkinsVersion implements Comparable<JenkinsVersion> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] JenkinsVersion create(String version) [CALLS-EXTERNAL] this.cv.compareTo/1 [FIELDS] read=cv [INPUTS...
/* static context [FOCAL] public boolean JenkinsVersion.isGreaterThan(String version) [INPUTS] branches=- | result=version [COLLABORATORS] field cv compareTo/1 [CALLS-INTERNAL] JenkinsVersion create(String version) [FIELDS] read=cv [CALLS-EXTERNAL] this.cv.compareTo/1 */
/* static context [FOCAL] public boolean JenkinsVersion.isGreaterThan(String version) [INPUTS] branches=- | result=version [COLLABORATORS] field cv compareTo/1 [CALLS-INTERNAL] JenkinsVersion create(String version) [FIELDS] read=cv [CALLS-EXTERNAL] this.cv.compareTo/1 */ class JenkinsVersion implements Comparable<Jenki...
true
ok
{"focal": {"class": "JenkinsVersion", "name": "isGreaterThan", "signature": "boolean isGreaterThan(String version)", "start_line": 3, "modifiers": "public", "params": [{"name": "version", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "JenkinsVersion", "kind": "class", "modifiers": "", "superclas...
6752107_4
class TimeParserUtil { public static long parseDuration(String duration) { if (duration == null || duration.isEmpty()) { throw new IllegalArgumentException("duration may not be null"); } long toAdd = -1; if (days.matcher(duration).matches()) { Matcher matcher...
assertThat(parseDuration("1m"), is(60000L)); assertThat(parseDuration("2mn"), is(120000L)); assertThat(parseDuration("3min"), is(180000L)); assertThat(parseDuration("10d"), is(864000000L)); assertThat(parseDuration("20h"), is(72000000L)); assertThat(parseDuration("40s"), ...
[FOCAL] public static long TimeParserUtil.parseDuration(String duration) [CLASS] class TimeParserUtil [METRICS] loc=31 cc=8 branches=7 loops=0 returns=1 throws=2 nesting=5 [CALLS-EXTERNAL] String.isEmpty/0, days.matcher(duration).matches/0, days.matcher/1, Matcher.matches/0, Long.parseLong/1, Matcher.group/1, hours.mat...
/* static context [FOCAL] public static long TimeParserUtil.parseDuration(String duration) [THROWS-WHEN] IllegalArgumentException when duration == null || duration.isEmpty() [THROWS-WHEN] IllegalArgumentException when !(duration == null || duration.isEmpty()) && days.matcher(duration).matches() && toAdd == -1 [THROWS-W...
/* static context [FOCAL] public static long TimeParserUtil.parseDuration(String duration) [THROWS-WHEN] IllegalArgumentException when duration == null || duration.isEmpty() [THROWS-WHEN] IllegalArgumentException when !(duration == null || duration.isEmpty()) && days.matcher(duration).matches() && toAdd == -1 [THROWS-W...
true
ok
{"focal": {"class": "TimeParserUtil", "name": "parseDuration", "signature": "long parseDuration(String duration)", "start_line": 3, "modifiers": "public static", "params": [{"name": "duration", "type": "String"}], "return_type": "long"}, "class_info": {"name": "TimeParserUtil", "kind": "class", "modifiers": "", "superc...
6780534_29
class MessagesCloudDataStore implements MessagesDataStore { @Override public Observable<Void> delete(String messageId) { return apiService.deleteMessage(messageId); } public MessagesCloudDataStore(StudIpLegacyApiService apiService); @Override public Observable<List<MessageEntity>> messageInbox(); @Ove...
given(mockApiService.getMessage(FAKE_ID)).willReturn(Observable.empty()); messagesCloudDataStore.delete(FAKE_ID); verify(mockApiService).deleteMessage(FAKE_ID); } }
[FOCAL] @Override public Observable<Void> MessagesCloudDataStore.delete(String messageId) [CLASS] class MessagesCloudDataStore implements MessagesDataStore [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] apiService.deleteMessage/1 [INPUTS] branches=- | result=messageId [COLLABORATO...
/* static context [FOCAL] @Override public Observable<Void> MessagesCloudDataStore.delete(String messageId) [INPUTS] branches=- | result=messageId [COLLABORATORS] field apiService deleteMessage/1 [CALLS-EXTERNAL] apiService.deleteMessage/1 */
/* static context [FOCAL] @Override public Observable<Void> MessagesCloudDataStore.delete(String messageId) [INPUTS] branches=- | result=messageId [COLLABORATORS] field apiService deleteMessage/1 [CALLS-EXTERNAL] apiService.deleteMessage/1 */ class MessagesCloudDataStore implements MessagesDataStore { @Override publ...
true
ok
{"focal": {"class": "MessagesCloudDataStore", "name": "delete", "signature": "Observable<Void> delete(String messageId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "messageId", "type": "String"}], "return_type": "Observable<Void>"}, "class_info": {"name": "MessagesCloudDataStore", "kind": "c...
6791064_5
class CrontabTriggle implements Triggle { public void triggle(Date now) { Map<String, Task> tasks = scheduler.getAllRegistedTask(); Transaction t = Cat.newTransaction("Time-2", "CronTabTriggle"); for (Task task : tasks.values()) { Cat.logEvent("For",""); if (ta...
/* * insert previous task attempt */ TaskAttempt attempt = new TaskAttempt(); attempt.setTaskid(TASKID2); String instanceID = idFactory.newInstanceID(TASKID2); attempt.setInstanceid(instanceID); attempt.setAttemptid(idFactory.newAttemptID(instanceID)); ...
[FOCAL] public void CrontabTriggle.triggle(Date now) [CLASS] class CrontabTriggle implements Triggle [METRICS] loc=56 cc=7 branches=2 loops=2 returns=0 throws=0 nesting=3 [CALLS-INTERNAL] Date getPreviousFireTime(Task task, Date now) [CALLS-EXTERNAL] scheduler.getAllRegistedTask/0, Cat.newTransaction/2, Map<String, Tas...
/* static context [FOCAL] public void CrontabTriggle.triggle(Date now) [PATH1] foreach(Task task : tasks.values())=T -> if(task.getStatus() != TaskStatus.RUNNING)=F -> if(previousFireTime.before(task.getUpdatetime()))=T -> while(nextFireTime.before(now))=F -> exit loop [PATH2] foreach(Task task : tasks.values())=T -> i...
/* static context [FOCAL] public void CrontabTriggle.triggle(Date now) [PATH1] foreach(Task task : tasks.values())=T -> if(task.getStatus() != TaskStatus.RUNNING)=F -> if(previousFireTime.before(task.getUpdatetime()))=T -> while(nextFireTime.before(now))=F -> exit loop [PATH2] foreach(Task task : tasks.values())=T -> i...
true
ok
{"focal": {"class": "CrontabTriggle", "name": "triggle", "signature": "void triggle(Date now)", "start_line": 3, "modifiers": "public", "params": [{"name": "now", "type": "Date"}], "return_type": "void"}, "class_info": {"name": "CrontabTriggle", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Trigg...
6804081_10
class ClassMethodsAnnotatedWith extends AbstractSpecification<Class<?>> { Class<?>[] getAllInterfacesAndClasses(Class<?> clazz) { return getAllInterfacesAndClasses(new Class[] { clazz } ); } public ClassMethodsAnnotatedWith(Class<? extends Annotation> annotation); @Override public boolean is...
assertThat(underTest.getAllInterfacesAndClasses(C2.class)).containsOnly(A2.class , B2.class , C2.class) ; assertThat(underTest.getAllInterfacesAndClasses(C1.class)).containsOnly(A1.class , B1.class , C1.class , Z1.class); } }
[FOCAL] Class<?>[] ClassMethodsAnnotatedWith.getAllInterfacesAndClasses(Class<?> clazz) [CLASS] class ClassMethodsAnnotatedWith extends AbstractSpecification<Class<?>> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Class<?>[] getAllInterfacesAndClasses(Class<?>[] classes) [INPUTS]...
/* static context [FOCAL] Class<?>[] ClassMethodsAnnotatedWith.getAllInterfacesAndClasses(Class<?> clazz) [INPUTS] branches=- | result=clazz [CALLS-INTERNAL] Class<?>[] getAllInterfacesAndClasses(Class<?>[] classes) */
/* static context [FOCAL] Class<?>[] ClassMethodsAnnotatedWith.getAllInterfacesAndClasses(Class<?> clazz) [INPUTS] branches=- | result=clazz [CALLS-INTERNAL] Class<?>[] getAllInterfacesAndClasses(Class<?>[] classes) */ class ClassMethodsAnnotatedWith extends AbstractSpecification<Class<?>> { Class<?>[] getAllInter...
true
ok
{"focal": {"class": "ClassMethodsAnnotatedWith", "name": "getAllInterfacesAndClasses", "signature": "Class<?>[] getAllInterfacesAndClasses(Class<?> clazz)", "start_line": 3, "modifiers": "", "params": [{"name": "clazz", "type": "Class<?>"}], "return_type": "Class<?>[]"}, "class_info": {"name": "ClassMethodsAnnotatedWit...
6810283_20
class AppointmentTypeValidator implements Validator { public void validate(Object obj, Errors errors) { AppointmentType appointmentType = (AppointmentType) obj; if (appointmentType == null) { errors.rejectValue("appointmentType", "error.general"); } else { validateDurationField(errors, appointmentType); ...
String evilName = "<script>alert(1)</script>"; AppointmentType appointmentTypeEvilName = new AppointmentType(evilName, "", 10); appointmentTypeValidator.validate(appointmentTypeEvilName, errors); Mockito.verify(errors).rejectValue("name", "appointmentscheduling.AppointmentType.unsafeName.errorMessage"); } }
[FOCAL] public void AppointmentTypeValidator.validate(Object obj, Errors errors) [CLASS] class AppointmentTypeValidator implements Validator [METRICS] loc=10 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void validateDescriptionField(Errors errors, String description); void validateDurationField...
/* static context [FOCAL] public void AppointmentTypeValidator.validate(Object obj, Errors errors) [PATH1] if(appointmentType == null)=T [PATH2] if(appointmentType == null)=F [INPUTS] branches=obj | result=- [COLLABORATORS] param errors:Errors rejectValue/2 [CALLS-INTERNAL] void validateDescriptionField(Errors errors, ...
/* static context [FOCAL] public void AppointmentTypeValidator.validate(Object obj, Errors errors) [PATH1] if(appointmentType == null)=T [PATH2] if(appointmentType == null)=F [INPUTS] branches=obj | result=- [COLLABORATORS] param errors:Errors rejectValue/2 [CALLS-INTERNAL] void validateDescriptionField(Errors errors, ...
true
ok
{"focal": {"class": "AppointmentTypeValidator", "name": "validate", "signature": "void validate(Object obj, Errors errors)", "start_line": 3, "modifiers": "public", "params": [{"name": "obj", "type": "Object"}, {"name": "errors", "type": "Errors"}], "return_type": "void"}, "class_info": {"name": "AppointmentTypeValidat...
6821657_32
class JsonBodyPattern extends BodyPattern { @Override public MatchField matches(StubMessage request) { String expected = JsonUtils.prettyPrint(pattern); String actual = JsonUtils.prettyPrint(request.getBody()); MatchResult result = matchResult(request); MatchField field = new Ma...
assertPattern("{\"foo\":\"bar\"}").matches("{\"foo\":\"bar\"}"); assertPattern("{\"foo\":\"bar\"}").doesNotMatch("{\"foo\":\"blah\"}"); assertPattern("{\"foo\":\"bar\"}").doesNotMatch("{\"foo2\":\"bar\"}"); assertPattern("{\"foo\":\"bar\"}").doesNotMatch("{}"); } }
[FOCAL] @Override public MatchField JsonBodyPattern.matches(StubMessage request) [CLASS] class JsonBodyPattern extends BodyPattern [METRICS] loc=12 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] MatchResult matchResult(StubMessage request) [CALLS-EXTERNAL] JsonUtils.prettyPrint/1, StubMessage.get...
/* static context [FOCAL] @Override public MatchField JsonBodyPattern.matches(StubMessage request) [PATH1] if(result.isMatch())=T -> return field.asMatch(actual) [PATH2] if(result.isMatch())=F -> return field.asMatchFailure(actual, result.message()) [INPUTS] branches=request | result=request [COLLABORATORS] param reque...
/* static context [FOCAL] @Override public MatchField JsonBodyPattern.matches(StubMessage request) [PATH1] if(result.isMatch())=T -> return field.asMatch(actual) [PATH2] if(result.isMatch())=F -> return field.asMatchFailure(actual, result.message()) [INPUTS] branches=request | result=request [COLLABORATORS] param reque...
true
ok
{"focal": {"class": "JsonBodyPattern", "name": "matches", "signature": "MatchField matches(StubMessage request)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "StubMessage"}], "return_type": "MatchField"}, "class_info": {"name": "JsonBodyPattern", "kind": "class", "modifiers"...
6822394_1121
class AnnotationHandlerChainBuilder extends HandlerChainBuilder { public List<Handler> buildHandlerChainFromClass(Class<?> clz, List<Handler> existingHandlers, QName portQName, QName serviceQName, String bindingID) { LOG.fine("building handler chain"); ...
HandlerTestImpl handlerTestImpl = new HandlerTestImpl(); AnnotationHandlerChainBuilder chainBuilder = new AnnotationHandlerChainBuilder(); QName portQName = new QName("http://apache.org/handler_test", "SoapPortWildcard"); QName serviceQName = new QName("http://apache.org/handler_test", "...
[FOCAL] public List<Handler> AnnotationHandlerChainBuilder.buildHandlerChainFromClass(Class<?> clz, List<Handler> existingHandlers, QName portQName, QName serviceQName, String bindingID) [CLASS] class AnnotationHandlerChainBuilder extends HandlerChainBuilder [METRICS] loc=65 cc=13 branches=6 loops=1 returns=1 throws=5 ...
/* static context [FOCAL] public List<Handler> AnnotationHandlerChainBuilder.buildHandlerChainFromClass(Class<?> clz, List<Handler> existingHandlers, QName portQName, QName serviceQName, String bindingID) [THROWS-WHEN] e when !(hcAnn == null) && try-body throws [THROWS-WHEN] WebServiceException when !(hcAnn == null) &&...
/* static context [FOCAL] public List<Handler> AnnotationHandlerChainBuilder.buildHandlerChainFromClass(Class<?> clz, List<Handler> existingHandlers, QName portQName, QName serviceQName, String bindingID) [THROWS-WHEN] e when !(hcAnn == null) && try-body throws [THROWS-WHEN] WebServiceException when !(hcAnn == null) &&...
true
ok
{"focal": {"class": "AnnotationHandlerChainBuilder", "name": "buildHandlerChainFromClass", "signature": "List<Handler> buildHandlerChainFromClass(Class<?> clz, List<Handler> existingHandlers, QName portQName, QName serviceQName, String bindingID)", "start_line": 3, "modifiers": "public", "params": [{"name": "clz", "typ...
6827663_4
class FibonacciCalculatorImpl implements FibonacciCalculator { @Override public long calculate(int order) { return order < 3 ? 1 : calculate(order-1) + calculate(order-2); } FibonacciCalculatorImpl calc; } class FibonacciCalculatorImplTest { FibonacciCalculatorImpl calc; @Test public void testRecursion...
assertEquals(calc.calculate(10)+calc.calculate(11), calc.calculate(12)); } }
[FOCAL] @Override public long FibonacciCalculatorImpl.calculate(int order) [CLASS] class FibonacciCalculatorImpl implements FibonacciCalculator [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] calculate/1 (inherited) [INPUTS] branches=- | result=order [DATAFLOW] order@param->L3 [TES...
/* static context [FOCAL] @Override public long FibonacciCalculatorImpl.calculate(int order) [INPUTS] branches=- | result=order [CALLS-EXTERNAL] calculate/1 (inherited) */
/* static context [FOCAL] @Override public long FibonacciCalculatorImpl.calculate(int order) [INPUTS] branches=- | result=order [CALLS-EXTERNAL] calculate/1 (inherited) */ class FibonacciCalculatorImpl implements FibonacciCalculator { @Override public long calculate(int order) { return order < 3 ? 1 : calculate(or...
true
ok
{"focal": {"class": "FibonacciCalculatorImpl", "name": "calculate", "signature": "long calculate(int order)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "order", "type": "int"}], "return_type": "long"}, "class_info": {"name": "FibonacciCalculatorImpl", "kind": "class", "modifiers": "", "super...
6830643_0
class AmazonAppNotifier extends SherlockFragmentActivity { @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getSupportMenuInflater(); inflater.inflate(R.menu.activity_main, menu); return true; } @Override protected void onCreate(Bundle savedInst...
Menu mockMenu = mock(Menu.class); activity.onCreateOptionsMenu(mockMenu); verify(mockMenuInflater).inflate(R.menu.activity_main, mockMenu); } }
[FOCAL] @Override public boolean AmazonAppNotifier.onCreateOptionsMenu(Menu menu) [CLASS] class AmazonAppNotifier extends SherlockFragmentActivity [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] getSupportMenuInflater/0 (inherited), MenuInflater.inflate/2 [DATAFLOW] inflater@L3->L4...
/* static context [FOCAL] @Override public boolean AmazonAppNotifier.onCreateOptionsMenu(Menu menu) [CALLS-EXTERNAL] getSupportMenuInflater/0 (inherited), MenuInflater.inflate/2 */
/* static context [FOCAL] @Override public boolean AmazonAppNotifier.onCreateOptionsMenu(Menu menu) [CALLS-EXTERNAL] getSupportMenuInflater/0 (inherited), MenuInflater.inflate/2 */ class AmazonAppNotifier extends SherlockFragmentActivity { @Override public boolean onCreateOptionsMenu(Menu menu) { MenuI...
true
ok
{"focal": {"class": "AmazonAppNotifier", "name": "onCreateOptionsMenu", "signature": "boolean onCreateOptionsMenu(Menu menu)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "menu", "type": "Menu"}], "return_type": "boolean"}, "class_info": {"name": "AmazonAppNotifier", "kind": "class", "modifier...
6833345_0
class NGSessionPool { NGSession take() { synchronized (lock) { if (done) { throw new UnsupportedOperationException("NGSession pool is shutting down"); } NGSession session = idlePool.poll(); if (session == null) { session = instanceCreator.get(); session.start(); ...
NGSessionPool pool = new NGSessionPool(server, 1); NGSession session = pool.take(); assertNotNull(session); } }
[FOCAL] NGSession NGSessionPool.take() [CLASS] class NGSessionPool [METRICS] loc=14 cc=3 branches=2 loops=0 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] idlePool.poll/0, instanceCreator.get/0, NGSession.start/0, workingPool.add/1 [NEW] UnsupportedOperationException [EXCEPTIONS] throws UnsupportedOperationException [TH...
/* static context [FOCAL] NGSession NGSessionPool.take() [THROWS-WHEN] UnsupportedOperationException when done [PATH1] if(done)=F -> if(session == null)=T -> return session [PATH2] if(done)=T -> throw new UnsupportedOperationException("NGSession pool is shutting down") [PATH3] if(done)=F -> if(session == null)=F -> ret...
/* static context [FOCAL] NGSession NGSessionPool.take() [THROWS-WHEN] UnsupportedOperationException when done [PATH1] if(done)=F -> if(session == null)=T -> return session [PATH2] if(done)=T -> throw new UnsupportedOperationException("NGSession pool is shutting down") [PATH3] if(done)=F -> if(session == null)=F -> ret...
true
ok
{"focal": {"class": "NGSessionPool", "name": "take", "signature": "NGSession take()", "start_line": 3, "modifiers": "", "params": [], "return_type": "NGSession"}, "class_info": {"name": "NGSessionPool", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "server", "type": "NGSe...
6848534_3
class WordCountAnalyzer { public TopWordCounts findTop(int number, Comparator<Integer> comparator) { return analyse(new FindTopAnalysis(number, comparator)); } public WordCountAnalyzer(WordCounts wc, boolean par); public WordCountAnalyzer(WordCounts wc, boolean par, int parLevel); publi...
assertEquals(twc, a1.findTop(number, COMP)); } }
[FOCAL] public TopWordCounts WordCountAnalyzer.findTop(int number, Comparator<Integer> comparator) [CLASS] class WordCountAnalyzer [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] T analyse(Analysis<T> a) [NEW] FindTopAnalysis [INPUTS] branches=- | result=comparator, number [DATAFLO...
/* static context [FOCAL] public TopWordCounts WordCountAnalyzer.findTop(int number, Comparator<Integer> comparator) [INPUTS] branches=- | result=comparator, number [CALLS-INTERNAL] T analyse(Analysis<T> a) [NEW] FindTopAnalysis */
/* static context [FOCAL] public TopWordCounts WordCountAnalyzer.findTop(int number, Comparator<Integer> comparator) [INPUTS] branches=- | result=comparator, number [CALLS-INTERNAL] T analyse(Analysis<T> a) [NEW] FindTopAnalysis */ class WordCountAnalyzer { public TopWordCounts findTop(int number, Comparator<Integ...
true
ok
{"focal": {"class": "WordCountAnalyzer", "name": "findTop", "signature": "TopWordCounts findTop(int number, Comparator<Integer> comparator)", "start_line": 3, "modifiers": "public", "params": [{"name": "number", "type": "int"}, {"name": "comparator", "type": "Comparator<Integer>"}], "return_type": "TopWordCounts"}, "cl...
6863498_22
class JiraRESTClient { public static List<IssueDTO> getIssues(String url, String username, String password, String path, String query) { WebClient client = createClient(url); checkAutherization(client, username, password); // Go to baseURI client.back(true); client.path(...
List<IssueDTO> issues = JiraRESTClient.getIssues( properties.getProperty("url"), properties.getProperty("username"), properties.getProperty("password"), JiraRESTClient.PATH_SEARCH, getJiraLabel(properties.getProperty("label"))); assertTrue...
[FOCAL] public static List<IssueDTO> JiraRESTClient.getIssues(String url, String username, String password, String path, String query) [CLASS] class JiraRESTClient [METRICS] loc=22 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] WebClient createClient(String url); void checkAutherization(WebClient...
/* static context [FOCAL] public static List<IssueDTO> JiraRESTClient.getIssues(String url, String username, String password, String path, String query) [PATH1] if(!query.isEmpty())=T -> return searchResult.getIssues() [PATH2] if(!query.isEmpty())=F -> return searchResult.getIssues() [INPUTS] branches=query | result=ur...
/* static context [FOCAL] public static List<IssueDTO> JiraRESTClient.getIssues(String url, String username, String password, String path, String query) [PATH1] if(!query.isEmpty())=T -> return searchResult.getIssues() [PATH2] if(!query.isEmpty())=F -> return searchResult.getIssues() [INPUTS] branches=query | result=ur...
true
ok
{"focal": {"class": "JiraRESTClient", "name": "getIssues", "signature": "List<IssueDTO> getIssues(String url, String username, String password, String path, String query)", "start_line": 3, "modifiers": "public static", "params": [{"name": "url", "type": "String"}, {"name": "username", "type": "String"}, {"name": "pass...
6867673_30
class KeyValues { public Set<String> getKeys() { @SuppressWarnings("unchecked") final Set<String> result = new HashSet<String>(this.values.keySet()); return result; } public KeyValues(); @SuppressWarnings("unchecked") public KeyValues add(final String key, final String value)...
assertThat(keyValues.getKeys(), containsInAnyOrder("name_1", "name_2", "name_3")); } }
[FOCAL] public Set<String> KeyValues.getKeys() [CLASS] class KeyValues [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] this.values.keySet/0 [NEW] HashSet<String> [FIELDS] read=values [COLLABORATORS] field values keySet/0 [DATAFLOW] result@L2->L4 [CLASS-MEMBERS] KeyValues(); KeyValu...
/* static context [FOCAL] public Set<String> KeyValues.getKeys() [COLLABORATORS] field values keySet/0 [FIELDS] read=values [NEW] HashSet<String> [CALLS-EXTERNAL] this.values.keySet/0 */
/* static context [FOCAL] public Set<String> KeyValues.getKeys() [COLLABORATORS] field values keySet/0 [FIELDS] read=values [NEW] HashSet<String> [CALLS-EXTERNAL] this.values.keySet/0 */ class KeyValues { public Set<String> getKeys() { @SuppressWarnings("unchecked") final Set<String> result = new H...
true
ok
{"focal": {"class": "KeyValues", "name": "getKeys", "signature": "Set<String> getKeys()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Set<String>"}, "class_info": {"name": "KeyValues", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "keyValues", "t...
6872642_22
class PersonForm extends BasePage implements Serializable { public String edit() { if (id == null) { id = new Long(getParameter("id")); } person = personManager.get(id); return "edit"; } @Autowired public void setPersonManager(@Qualifier("personManager") Gener...
log.debug("testing edit..."); bean.setId(1L); assertEquals("edit", bean.edit()); assertNotNull(bean.getPerson()); assertFalse(bean.hasErrors()); } }
[FOCAL] public String PersonForm.edit() [CLASS] class PersonForm extends BasePage implements Serializable [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] getParameter/1 (inherited), GenericManager<Person, Long>.get/1 [NEW] Long [FIELDS] read=personManager:GenericManager<Person, Lon...
/* static context [FOCAL] public String PersonForm.edit() [PATH1] if(id == null)=T -> return "edit" [PATH2] if(id == null)=F -> return "edit" [COLLABORATORS] field personManager:GenericManager<Person, Long> get/1 [FIELDS] read=personManager:GenericManager<Person, Long> [NEW] Long [CALLS-EXTERNAL] getParameter/1 (inheri...
/* static context [FOCAL] public String PersonForm.edit() [PATH1] if(id == null)=T -> return "edit" [PATH2] if(id == null)=F -> return "edit" [COLLABORATORS] field personManager:GenericManager<Person, Long> get/1 [FIELDS] read=personManager:GenericManager<Person, Long> [NEW] Long [CALLS-EXTERNAL] getParameter/1 (inheri...
true
ok
{"focal": {"class": "PersonForm", "name": "edit", "signature": "String edit()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "PersonForm", "kind": "class", "modifiers": "", "superclass": "BasePage", "interfaces": "Serializable", "fields": [{"name": "bean", "type...
6879138_0
class SecuredAssembler extends ModelAssembler { @Override public Model open(Assembler a, Resource root, Mode mode) { List<Statement> lst = root.listProperties().toList(); Resource rootModel = getUniqueResource( root, BASE_MODEL ); if (rootModel == null) { throw new AssemblerException( root, String.format...
Resource r = model.createResource( "http://xenei.org/jena/security/test#secModel"); Object o = assembler.open( r ); Assert.assertTrue( o instanceof Model); Assert.assertTrue( o instanceof SecuredModel ); } }
[FOCAL] @Override public Model SecuredAssembler.open(Assembler a, Resource root, Mode mode) [CLASS] class SecuredAssembler extends ModelAssembler [METRICS] loc=68 cc=22 branches=5 loops=0 returns=1 throws=11 nesting=2 [CALLS-EXTERNAL] root.listProperties().toList/0, Resource.listProperties/0, getUniqueResource/2 (inher...
/* static context [FOCAL] @Override public Model SecuredAssembler.open(Assembler a, Resource root, Mode mode) [THROWS-WHEN] AssemblerException when rootModel == null [THROWS-WHEN] AssemblerException when !(rootModel == null) && modelName == null [THROWS-WHEN] AssemblerException when !(rootModel == null) && !(modelName ...
/* static context [FOCAL] @Override public Model SecuredAssembler.open(Assembler a, Resource root, Mode mode) [THROWS-WHEN] AssemblerException when rootModel == null [THROWS-WHEN] AssemblerException when !(rootModel == null) && modelName == null [THROWS-WHEN] AssemblerException when !(rootModel == null) && !(modelName ...
true
ok
{"focal": {"class": "SecuredAssembler", "name": "open", "signature": "Model open(Assembler a, Resource root, Mode mode)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "a", "type": "Assembler"}, {"name": "root", "type": "Resource"}, {"name": "mode", "type": "Mode"}], "return_type": "Model"}, "cl...
6900541_1
class Utils { public static String readableFileSize(long size) { if(size <= 0) return "0 KB"; final String[] units = new String[] { "B", "KB", "MB", "GB", "TB" }; int digitGroups = (int) (Math.log10(size)/Math.log10(1000)); return new DecimalFormat("#,##0.#").format(size/Math.pow(10...
String result = Utils.readableFileSize(0); Assert.assertEquals("0 KB", result); result = Utils.readableFileSize(957498560); Assert.assertEquals("957.5 MB", result); result = Utils.readableFileSize(2579477837L); Assert.assertEquals("2.6 GB", result); result = Ut...
[FOCAL] public static String Utils.readableFileSize(long size) [CLASS] class Utils [METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Math.log10/1, new DecimalFormat("#,##0.#").format/1, Math.pow/2 [NEW] DecimalFormat [PATH1] if(size <= 0)=T -> return "0 KB" [PATH2] if(size <= 0)=F ->...
/* static context [FOCAL] public static String Utils.readableFileSize(long size) [PATH1] if(size <= 0)=T -> return "0 KB" [PATH2] if(size <= 0)=F -> return new DecimalFormat("#,##0.#").format(size/Math.pow(1000, digitGroups... [INPUTS] branches=size | result=size [NEW] DecimalFormat [CALLS-EXTERNAL] Math.log10/1, new D...
/* static context [FOCAL] public static String Utils.readableFileSize(long size) [PATH1] if(size <= 0)=T -> return "0 KB" [PATH2] if(size <= 0)=F -> return new DecimalFormat("#,##0.#").format(size/Math.pow(1000, digitGroups... [INPUTS] branches=size | result=size [NEW] DecimalFormat [CALLS-EXTERNAL] Math.log10/1, new D...
true
ok
{"focal": {"class": "Utils", "name": "readableFileSize", "signature": "String readableFileSize(long size)", "start_line": 3, "modifiers": "public static", "params": [{"name": "size", "type": "long"}], "return_type": "String"}, "class_info": {"name": "Utils", "kind": "class", "modifiers": "", "superclass": null, "interf...
6921975_21
class RequestSigningUtil { public static String createRequestSignature(final String method, final String dateHeader, final String requestUri, ByteSource body, final String secretKey) { final String signatureBase = createSignatureBase(method, dateHeader, requestUri, body); return createRequestSignat...
MockHttpServletRequest request = new MockHttpServletRequest("PUT", "some/URI"); request.addHeader("x-hmac-auth-date", formattedDateOfNow()); request.setContent("{ \"key\": \"value\"}".getBytes()); String encrypted = RequestSigningUtil.createRequestSignature(wrap(request), "secretKey");...
[FOCAL] public static String RequestSigningUtil.createRequestSignature(String method, String dateHeader, String requestUri, ByteSource body, String secretKey) [CLASS] class RequestSigningUtil [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String createRequestSignature(String signa...
/* static context [FOCAL] public static String RequestSigningUtil.createRequestSignature(String method, String dateHeader, String requestUri, ByteSource body, String secretKey) [INPUTS] branches=- | result=body, dateHeader, method, requestUri, secretKey [CALLS-INTERNAL] String createRequestSignature(String signatureBas...
/* static context [FOCAL] public static String RequestSigningUtil.createRequestSignature(String method, String dateHeader, String requestUri, ByteSource body, String secretKey) [INPUTS] branches=- | result=body, dateHeader, method, requestUri, secretKey [CALLS-INTERNAL] String createRequestSignature(String signatureBas...
true
ok
{"focal": {"class": "RequestSigningUtil", "name": "createRequestSignature", "signature": "String createRequestSignature(String method, String dateHeader, String requestUri, ByteSource body, String secretKey)", "start_line": 3, "modifiers": "public static", "params": [{"name": "method", "type": "String"}, {"name": "date...
6944525_585
class RestLiServer implements RestRequestHandler, RestToRestLiRequestHandler, StreamRequestHandler, StreamToRestLiRequestHandler { @Override public void handleRequest(RestRequest request, RequestContext requestContext, Callback<RestResponse> callback) { //This code path c...
//This test verifies the server's ability to accept request attachments and send back response attachments. This is the //main test to verify the wire protocol for streaming. We send a payload that contains the rest.li payload and some attachments //and we send a response back with a rest.li payload and som...
[FOCAL] @Override public void RestLiServer.handleRequest(RestRequest request, RequestContext requestContext, Callback<RestResponse> callback) [CLASS] class RestLiServer implements RestRequestHandler, RestToRestLiRequestHandler, StreamRequestHandler, StreamToRestLiRequestHandler [METRICS] loc=11 cc=2 branches=1 loops=0 ...
class RestLiServer implements RestRequestHandler, RestToRestLiRequestHandler, StreamRequestHandler, StreamToRestLiRequestHandler { @Override public void handleRequest(RestRequest request, RequestContext requestContext, Callback<RestResponse> callback) { //This code path c...
false
ok
{"focal": {"class": "RestLiServer", "name": "handleRequest", "signature": "void handleRequest(RestRequest request, RequestContext requestContext, Callback<RestResponse> callback)", "start_line": 4, "modifiers": "@Override public", "params": [{"name": "request", "type": "RestRequest"}, {"name": "requestContext", "type":...
6946733_5
class HazelcastJobHandleFactory implements JobHandleFactory { public final byte[] getNextJobHandle() { String handle = "H:".concat(clusterHostname).concat(":").concat(String.valueOf(jobHandleCounter.incrementAndGet())); return handle.getBytes(); } public HazelcastJobHandleFactory(Hazelcas...
IAtomicLong mockAtomicLong = mock(IAtomicLong.class); when(mockAtomicLong.incrementAndGet()).thenReturn(1L); HazelcastInstance mockHazelcast = mock(HazelcastInstance.class); when(mockHazelcast.getAtomicLong(anyString())).thenReturn(mockAtomicLong); HazelcastJobHandleFactory ha...
[FOCAL] public final byte[] HazelcastJobHandleFactory.getNextJobHandle() [CLASS] class HazelcastJobHandleFactory implements JobHandleFactory [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] "H:".concat(clusterHostname).concat(":").concat/1, "H:".concat(clusterHostname).concat/1, "H:...
/* static context [FOCAL] public final byte[] HazelcastJobHandleFactory.getNextJobHandle() [COLLABORATORS] field jobHandleCounter incrementAndGet/0 [CALLS-EXTERNAL] "H:".concat(clusterHostname).concat(":").concat/1, "H:".concat(clusterHostname).concat/1, "H:".concat/1, String.valueOf/1, jobHandleCounter.incrementAndGet...
/* static context [FOCAL] public final byte[] HazelcastJobHandleFactory.getNextJobHandle() [COLLABORATORS] field jobHandleCounter incrementAndGet/0 [CALLS-EXTERNAL] "H:".concat(clusterHostname).concat(":").concat/1, "H:".concat(clusterHostname).concat/1, "H:".concat/1, String.valueOf/1, jobHandleCounter.incrementAndGet...
true
ok
{"focal": {"class": "HazelcastJobHandleFactory", "name": "getNextJobHandle", "signature": "byte[] getNextJobHandle()", "start_line": 3, "modifiers": "public final", "params": [], "return_type": "byte[]"}, "class_info": {"name": "HazelcastJobHandleFactory", "kind": "class", "modifiers": "", "superclass": null, "interfac...
6951233_116
class SessionController1_9 extends BaseRestController { @RequestMapping(method = RequestMethod.POST) @ResponseBody @ResponseStatus(value = HttpStatus.OK) public void post(HttpServletRequest request, @RequestBody Map<String, String> body) { String localeStr = body.get("locale"); if (localeStr != null) { Loca...
Locale newLocale = new Locale("sp"); String content = "{\"locale\":\"" + newLocale.toString() + "\"}"; Assert.assertNotEquals(newLocale, Context.getLocale()); controller.post(hsr, new ObjectMapper().readValue(content, HashMap.class)); Assert.assertEquals(newLocale, Context.getLocale()); } }
[FOCAL] @RequestMapping(method = RequestMethod.POST) @ResponseBody @ResponseStatus(value = HttpStatus.OK) public void SessionController1_9.post(HttpServletRequest request, Map<String, String> body) [CLASS] class SessionController1_9 extends BaseRestController [METRICS] loc=32 cc=6 branches=4 loops=0 returns=0 throws=3 ...
/* static context [FOCAL] @RequestMapping(method = RequestMethod.POST) @ResponseBody @ResponseStatus(value = HttpStatus.OK) public void SessionController1_9.post(HttpServletRequest request, Map<String, String> body) [THROWS-WHEN] APIException when localeStr != null && try-body throws [THROWS-WHEN] APIException when loc...
/* static context [FOCAL] @RequestMapping(method = RequestMethod.POST) @ResponseBody @ResponseStatus(value = HttpStatus.OK) public void SessionController1_9.post(HttpServletRequest request, Map<String, String> body) [THROWS-WHEN] APIException when localeStr != null && try-body throws [THROWS-WHEN] APIException when loc...
true
ok
{"focal": {"class": "SessionController1_9", "name": "post", "signature": "void post(HttpServletRequest request, Map<String, String> body)", "start_line": 3, "modifiers": "@RequestMapping(method = RequestMethod.POST) @ResponseBody @ResponseStatus(value = HttpStatus.OK) public", "params": [{"name": "request", "type": "Ht...
6961882_16
class HttpHeaderParser { public static String parseCharset(Map<String, String> headers, String defaultCharset) { String contentType = headers.get(HTTP.CONTENT_TYPE); if (contentType != null) { String[] params = contentType.split(";"); for (int i = 1; i < params.length; i++) ...
// Like the ones we usually see headers.put("Content-Type", "text/plain; charset=utf-8"); assertEquals("utf-8", HttpHeaderParser.parseCharset(headers)); // Charset specified, ignore default charset headers.put("Content-Type", "text/plain; charset=utf-8"); assertEquals("u...
[FOCAL] public static String HttpHeaderParser.parseCharset(Map<String, String> headers, String defaultCharset) [CLASS] class HttpHeaderParser [METRICS] loc=16 cc=5 branches=3 loops=1 returns=2 throws=0 nesting=4 [CALLS-EXTERNAL] Map<String, String>.get/1, String.split/1, params[i].trim().split/1, params[i].trim/0, pair...
/* static context [FOCAL] public static String HttpHeaderParser.parseCharset(Map<String, String> headers, String defaultCharset) [PATH1] if(contentType != null)=T -> for(i < params.length)=T -> if(pair.length == 2)=T -> if(pair[0].equals("charset"))=F -> exit loop -> return defaultCharset [PATH2] if(contentType != null...
/* static context [FOCAL] public static String HttpHeaderParser.parseCharset(Map<String, String> headers, String defaultCharset) [PATH1] if(contentType != null)=T -> for(i < params.length)=T -> if(pair.length == 2)=T -> if(pair[0].equals("charset"))=F -> exit loop -> return defaultCharset [PATH2] if(contentType != null...
true
ok
{"focal": {"class": "HttpHeaderParser", "name": "parseCharset", "signature": "String parseCharset(Map<String, String> headers, String defaultCharset)", "start_line": 3, "modifiers": "public static", "params": [{"name": "headers", "type": "Map<String, String>"}, {"name": "defaultCharset", "type": "String"}], "return_typ...
6972004_6
class MatchersEx { public static <T, V> Matcher<T> compose(final Function<T, ? extends V> transformer, final Matcher<V> matcher) { checkNotNull(transformer, "transformer"); checkNotNull(matcher, "matcher"); return new TypeSafeMatcher<T>() { @Override public void de...
// test boolean result = composeMatcher.matches(input); // verify verify(function).apply(input); verify(matcher).matches(output); assertThat(result, is(true)); } }
[FOCAL] public static Matcher<T> MatchersEx.compose(Function<T, ? extends V> transformer, Matcher<V> matcher) [CLASS] class MatchersEx [METRICS] loc=19 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] checkNotNull/2 (inherited), description.appendText/1, Matcher<V>.describeTo/1, Function<T, ? exten...
/* static context [FOCAL] public static Matcher<T> MatchersEx.compose(Function<T, ? extends V> transformer, Matcher<V> matcher) [INPUTS] branches=- | result=matcher, transformer [COLLABORATORS] field description appendText/1; param matcher:Matcher<V> describeTo/1,matches/1; param transformer:Function<T, ? extends V> ap...
/* static context [FOCAL] public static Matcher<T> MatchersEx.compose(Function<T, ? extends V> transformer, Matcher<V> matcher) [INPUTS] branches=- | result=matcher, transformer [COLLABORATORS] field description appendText/1; param matcher:Matcher<V> describeTo/1,matches/1; param transformer:Function<T, ? extends V> ap...
true
ok
{"focal": {"class": "MatchersEx", "name": "compose", "signature": "Matcher<T> compose(Function<T, ? extends V> transformer, Matcher<V> matcher)", "start_line": 3, "modifiers": "public static", "params": [{"name": "transformer", "type": "Function<T, ? extends V>"}, {"name": "matcher", "type": "Matcher<V>"}], "return_typ...
7010395_8
class Duration { @JsonCreator public static Duration valueOf(String text) { String trimmed = WHITESPACE.removeFrom(text).trim(); return new Duration(quantity(trimmed), unit(trimmed)); } public Duration(double quantity, Unit unit); public long value(); private static double qu...
assertThat(valueOf("1d"), is(new Duration(1L, DAYS))); assertThat(valueOf("1 d"), is(new Duration(1L, DAYS))); assertThat(valueOf("1 day"), is(new Duration(1L, DAYS))); assertThat(valueOf("1 days"), is(new Duration(1L, DAYS))); } }
[FOCAL] @JsonCreator public static Duration Duration.valueOf(String text) [CLASS] class Duration [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Unit unit(String trimmed); double quantity(String trimmed) [CALLS-EXTERNAL] WHITESPACE.removeFrom(text).trim/0, WHITESPACE.removeFrom/1 [...
/* static context [FOCAL] @JsonCreator public static Duration Duration.valueOf(String text) [INPUTS] branches=- | result=text [CALLS-INTERNAL] Unit unit(String trimmed); double quantity(String trimmed) [NEW] Duration [CALLS-EXTERNAL] WHITESPACE.removeFrom(text).trim/0, WHITESPACE.removeFrom/1 */
/* static context [FOCAL] @JsonCreator public static Duration Duration.valueOf(String text) [INPUTS] branches=- | result=text [CALLS-INTERNAL] Unit unit(String trimmed); double quantity(String trimmed) [NEW] Duration [CALLS-EXTERNAL] WHITESPACE.removeFrom(text).trim/0, WHITESPACE.removeFrom/1 */ class Duration { @...
true
ok
{"focal": {"class": "Duration", "name": "valueOf", "signature": "Duration valueOf(String text)", "start_line": 3, "modifiers": "@JsonCreator public static", "params": [{"name": "text", "type": "String"}], "return_type": "Duration"}, "class_info": {"name": "Duration", "kind": "class", "modifiers": "", "superclass": null...
7014975_0
class HashedWheelTimer implements Timer { @Override public TimeOut newTimeout(TimerTask task, long delay, TimeUnit unit) { start(); if (task == null) { throw new NullPointerException("task"); } if (unit == null) { throw new NullPointerException("unit"); } long deadline = System.nanoTime() + unit....
final HashedWheelTimer timer = new HashedWheelTimer(Executors.defaultThreadFactory(), 100, TimeUnit.MILLISECONDS, 32); final AtomicInteger counter = new AtomicInteger(); timer.newTimeout(new TimerTask() { @Override public void run(final TimeOut TimeOut) throws Exception { counter.incrementAndGet();...
[FOCAL] @Override public TimeOut HashedWheelTimer.newTimeout(TimerTask task, long delay, TimeUnit unit) [CLASS] class HashedWheelTimer implements Timer [METRICS] loc=28 cc=5 branches=3 loops=0 returns=1 throws=3 nesting=2 [CALLS-INTERNAL] void start() [CALLS-EXTERNAL] System.nanoTime/0, TimeUnit.toNanos/1, lock.readLoc...
/* static context [FOCAL] @Override public TimeOut HashedWheelTimer.newTimeout(TimerTask task, long delay, TimeUnit unit) [THROWS-WHEN] NullPointerException when task == null [THROWS-WHEN] NullPointerException when !(task == null) && unit == null [THROWS-WHEN] IllegalStateException when !(task == null) && !(unit == nul...
/* static context [FOCAL] @Override public TimeOut HashedWheelTimer.newTimeout(TimerTask task, long delay, TimeUnit unit) [THROWS-WHEN] NullPointerException when task == null [THROWS-WHEN] NullPointerException when !(task == null) && unit == null [THROWS-WHEN] IllegalStateException when !(task == null) && !(unit == nul...
true
ok
{"focal": {"class": "HashedWheelTimer", "name": "newTimeout", "signature": "TimeOut newTimeout(TimerTask task, long delay, TimeUnit unit)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "task", "type": "TimerTask"}, {"name": "delay", "type": "long"}, {"name": "unit", "type": "TimeUnit"}], "retur...
7015517_16
class PluginKeyUtils { public static boolean isValid(String pluginKey) { return StringUtils.isNotBlank(pluginKey) && StringUtils.isAlphanumeric(pluginKey); } private PluginKeyUtils(); @CheckForNull public static String sanitize(@Nullable String mavenArtifactId); private static String keepLettersAndDig...
assertThat(PluginKeyUtils.isValid("foo")).isEqualTo(true); assertThat(PluginKeyUtils.isValid("sonarfooplugin")).isEqualTo(true); assertThat(PluginKeyUtils.isValid("foo6")).isEqualTo(true); assertThat(PluginKeyUtils.isValid("FOO6")).isEqualTo(true); } }
[FOCAL] public static boolean PluginKeyUtils.isValid(String pluginKey) [CLASS] class PluginKeyUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] StringUtils.isNotBlank/1, StringUtils.isAlphanumeric/1 [INPUTS] branches=- | result=pluginKey [DATAFLOW] pluginKey@param->L2 [CLASS-ME...
/* static context [FOCAL] public static boolean PluginKeyUtils.isValid(String pluginKey) [INPUTS] branches=- | result=pluginKey [CALLS-EXTERNAL] StringUtils.isNotBlank/1, StringUtils.isAlphanumeric/1 */
/* static context [FOCAL] public static boolean PluginKeyUtils.isValid(String pluginKey) [INPUTS] branches=- | result=pluginKey [CALLS-EXTERNAL] StringUtils.isNotBlank/1, StringUtils.isAlphanumeric/1 */ class PluginKeyUtils { public static boolean isValid(String pluginKey) { return StringUtils.isNotBlank(pluginK...
true
ok
{"focal": {"class": "PluginKeyUtils", "name": "isValid", "signature": "boolean isValid(String pluginKey)", "start_line": 3, "modifiers": "public static", "params": [{"name": "pluginKey", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "PluginKeyUtils", "kind": "class", "modifiers": "", "superclass...
7022775_194
class TorrentClient { public byte[] getExtensionBytes() { return Arrays.copyOf(extensionBytes, extensionBytes.length); } private TorrentClient(Builder builder); private byte[] createPeerId(); public void download(Torrent torrent, Collection<String> trackerUrls); public void download(Torrent torrent); publi...
ConnectionDegradation connectionDegradationMock = mock(ConnectionDegradation.class); PhaseRegulator phaseRegulatorMock = mock(PhaseRegulator.class); ScheduledExecutorService executorServiceMock = mock(ScheduledExecutorService.class); IPeerConnector peerConnectorMock = mock(IPeerConnector.class); IPeerDistribu...
[FOCAL] public byte[] TorrentClient.getExtensionBytes() [CLASS] class TorrentClient [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Arrays.copyOf/2 [CLASS-MEMBERS] TorrentClient(Builder builder); byte[] createPeerId(); void download(Torrent torrent, Collection<String> trackerUrls);...
/* static context [FOCAL] public byte[] TorrentClient.getExtensionBytes() [CALLS-EXTERNAL] Arrays.copyOf/2 */
/* static context [FOCAL] public byte[] TorrentClient.getExtensionBytes() [CALLS-EXTERNAL] Arrays.copyOf/2 */ class TorrentClient { public byte[] getExtensionBytes() { return Arrays.copyOf(extensionBytes, extensionBytes.length); } private TorrentClient(Builder builder); private byte[] createPeerId(); public ...
true
ok
{"focal": {"class": "TorrentClient", "name": "getExtensionBytes", "signature": "byte[] getExtensionBytes()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "byte[]"}, "class_info": {"name": "TorrentClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "me...
7028076_1
class TwitterServiceImpl implements TwitterService { public RequestToken getRequestToken() { final Twitter twitter = factory.getInstance(); try { return twitter.getOAuthRequestToken(); } catch (TwitterException e) { throw this.wrapException(e); } } p...
assertNotNull(this.service.getRequestToken()); } }
[FOCAL] public RequestToken TwitterServiceImpl.getRequestToken() [CLASS] class TwitterServiceImpl implements TwitterService [METRICS] loc=8 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] TwitterServiceException wrapException(Exception e) [CALLS-EXTERNAL] factory.getInstance/0, Twitter.getOAuthReq...
/* static context [FOCAL] public RequestToken TwitterServiceImpl.getRequestToken() [THROWS-WHEN] this.wrapException(e) when try-body throws [PATH1] try-body throws -> throw this.wrapException(e) [PATH2] return twitter.getOAuthRequestToken() [COLLABORATORS] field factory getInstance/0 [EXCEPTIONS] throws throw this.wrap...
/* static context [FOCAL] public RequestToken TwitterServiceImpl.getRequestToken() [THROWS-WHEN] this.wrapException(e) when try-body throws [PATH1] try-body throws -> throw this.wrapException(e) [PATH2] return twitter.getOAuthRequestToken() [COLLABORATORS] field factory getInstance/0 [EXCEPTIONS] throws throw this.wrap...
true
ok
{"focal": {"class": "TwitterServiceImpl", "name": "getRequestToken", "signature": "RequestToken getRequestToken()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "RequestToken"}, "class_info": {"name": "TwitterServiceImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Twit...
7031510_60
class FileSystem { protected static int maxFileNumber(String baseDir, String database, String date, String prefix, String suffix) { File[] files = visitFiles(baseDir, database, date, prefix, suffix); int max = -1; for (File file : files) { int number = parseNumber(file, prefix, ...
File file0 = new File(testDir, "/puma/20151010/bucket-0.data"); createFile(file0); File file1 = new File(testDir, "/puma/20151010/bucket-1.data"); createFile(file1); File file2 = new File(testDir, "/puma/20151010/bucket-10.data"); createFile(file2); File file3 = new File(testDir, "/puma/20151010/bucket...
[FOCAL] protected static int FileSystem.maxFileNumber(String baseDir, String database, String date, String prefix, String suffix) [CLASS] class FileSystem [METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] File[] visitFiles(String baseDir, String database, String date, String prefix, ...
/* static context [FOCAL] protected static int FileSystem.maxFileNumber(String baseDir, String database, String date, String prefix, String suffix) [PATH1] foreach(File file : files)=T -> exit loop -> return max [PATH2] foreach(File file : files)=F -> return max [INPUTS] branches=baseDir, database, date, prefix, suffix...
/* static context [FOCAL] protected static int FileSystem.maxFileNumber(String baseDir, String database, String date, String prefix, String suffix) [PATH1] foreach(File file : files)=T -> exit loop -> return max [PATH2] foreach(File file : files)=F -> return max [INPUTS] branches=baseDir, database, date, prefix, suffix...
true
ok
{"focal": {"class": "FileSystem", "name": "maxFileNumber", "signature": "int maxFileNumber(String baseDir, String database, String date, String prefix, String suffix)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "baseDir", "type": "String"}, {"name": "database", "type": "String"}, {"name": "d...
7033568_0
class Minigames extends JavaPlugin { public MinigamePlayerManager getPlayerManager() { return this.playerManager; } public Minigames(); protected Minigames(final JavaPluginLoader loader, final PluginDescriptionFile description, final File dataFolder, final File file); public static Comp...
assertNotSame(player.getLocation(),game.getLobbyPosition()); plugin.getPlayerManager().addMinigamePlayer(player); MinigamePlayer mplayer = plugin.getPlayerManager().getMinigamePlayer(player.getUniqueId()); plugin.getPlayerManager().joinMinigame(mplayer, game, false, 0D); LobbySet...
[FOCAL] public MinigamePlayerManager Minigames.getPlayerManager() [CLASS] class Minigames extends JavaPlugin [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=playerManager [CLASS-MEMBERS] Minigames(); Minigames(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder...
/* static context [FOCAL] public MinigamePlayerManager Minigames.getPlayerManager() [FIELDS] read=playerManager */
/* static context [FOCAL] public MinigamePlayerManager Minigames.getPlayerManager() [FIELDS] read=playerManager */ class Minigames extends JavaPlugin { public MinigamePlayerManager getPlayerManager() { return this.playerManager; } public Minigames(); protected Minigames(final JavaPluginLoade...
true
ok
{"focal": {"class": "Minigames", "name": "getPlayerManager", "signature": "MinigamePlayerManager getPlayerManager()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "MinigamePlayerManager"}, "class_info": {"name": "Minigames", "kind": "class", "modifiers": "", "superclass": "JavaPlugin", "interfac...
7043506_11
class StreamAggregator { public static Observable<GroupedObservable<TypeAndNameKey, Map<String, Object>>> aggregateGroupedStreams(Observable<GroupedObservable<InstanceKey, Map<String, Object>>> stream) { return aggregateUsingFlattenedGroupBy(stream); } private StreamAggregator(); @SuppressWa...
TestScheduler scheduler = new TestScheduler(); TestSubject<GroupedObservable<InstanceKey, Map<String, Object>>> stream = TestSubject.create(scheduler); AtomicInteger numGroups = new AtomicInteger(); TestSubscriber<Object> ts = new TestSubscriber<>(); StreamAggregator.aggregateG...
[FOCAL] public static Observable<GroupedObservable<TypeAndNameKey, Map<String, Object>>> StreamAggregator.aggregateGroupedStreams(Observable<GroupedObservable<InstanceKey, Map<String, Object>>> stream) [CLASS] class StreamAggregator [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] O...
/* static context [FOCAL] public static Observable<GroupedObservable<TypeAndNameKey, Map<String, Object>>> StreamAggregator.aggregateGroupedStreams(Observable<GroupedObservable<InstanceKey, Map<String, Object>>> stream) [INPUTS] branches=- | result=stream [CALLS-INTERNAL] Observable<GroupedObservable<TypeAndNameKey, Ma...
/* static context [FOCAL] public static Observable<GroupedObservable<TypeAndNameKey, Map<String, Object>>> StreamAggregator.aggregateGroupedStreams(Observable<GroupedObservable<InstanceKey, Map<String, Object>>> stream) [INPUTS] branches=- | result=stream [CALLS-INTERNAL] Observable<GroupedObservable<TypeAndNameKey, Ma...
true
ok
{"focal": {"class": "StreamAggregator", "name": "aggregateGroupedStreams", "signature": "Observable<GroupedObservable<TypeAndNameKey, Map<String, Object>>> aggregateGroupedStreams(Observable<GroupedObservable<InstanceKey, Map<String, Object>>> stream)", "start_line": 3, "modifiers": "public static", "params": [{"name":...
7056723_44
class MethodCallerBytecodeGenerator extends AbstractClassGenerator { public MethodCaller create() { Object key = KEY_FACTORY.newInstance(callTarget.getTargetMethod(), null); try { return (MethodCaller) super.create(key); } catch (Mock4AjException error) { // NOPMD ...
Object caller = createGenerator(getTimeTarget).create(); assertThat(caller, instanceOf(MethodCaller.class)); } }
[FOCAL] public MethodCaller MethodCallerBytecodeGenerator.create() [CLASS] class MethodCallerBytecodeGenerator extends AbstractClassGenerator [METRICS] loc=14 cc=3 branches=0 loops=0 returns=1 throws=2 nesting=1 [CALLS-EXTERNAL] KEY_FACTORY.newInstance/2, callTarget.getTargetMethod/0, AbstractClassGenerator.create/1 [N...
/* static context [FOCAL] public MethodCaller MethodCallerBytecodeGenerator.create() [THROWS-WHEN] error when try-body throws [THROWS-WHEN] Mock4AjException when try-body throws [PATH1] try-body throws -> throw error [PATH2] return (MethodCaller) super.create(key) [PATH3] try-body throws -> throw new Mock4AjException("...
/* static context [FOCAL] public MethodCaller MethodCallerBytecodeGenerator.create() [THROWS-WHEN] error when try-body throws [THROWS-WHEN] Mock4AjException when try-body throws [PATH1] try-body throws -> throw error [PATH2] return (MethodCaller) super.create(key) [PATH3] try-body throws -> throw new Mock4AjException("...
true
ok
{"focal": {"class": "MethodCallerBytecodeGenerator", "name": "create", "signature": "MethodCaller create()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "MethodCaller"}, "class_info": {"name": "MethodCallerBytecodeGenerator", "kind": "class", "modifiers": "", "superclass": "AbstractClassGenerat...
7072487_3
class EntitlementProducer { public String createEntitlement() { List<String> entitlementStrings = listEntitlements(); if (entitlementStrings.isEmpty()) { return null; } return StringUtils.join(entitlementStrings, ENTITLEMENT_SEPARATOR); } public EntitlementProd...
Membership ms = createMembership(); addPost(ms, "körvezető"); addPost(ms, "jani"); when(mock.findMembershipsForUser(user)).thenReturn(Arrays.asList(ms)); String memberEntitlement = "urn:geant:niif.hu:sch.bme.hu:entitlement:tag:Kir-Dev:1"; String leaderEntitlemnet = "urn:...
[FOCAL] public String EntitlementProducer.createEntitlement() [CLASS] class EntitlementProducer [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] List<String> listEntitlements() [CALLS-EXTERNAL] List<String>.isEmpty/0, StringUtils.join/2 [PATH1] if(entitlementStrings.isEmpty())=T -> ...
/* static context [FOCAL] public String EntitlementProducer.createEntitlement() [PATH1] if(entitlementStrings.isEmpty())=T -> return null [PATH2] if(entitlementStrings.isEmpty())=F -> return StringUtils.join(entitlementStrings, ENTITLEMENT_SEPARATOR) [CALLS-INTERNAL] List<String> listEntitlements() [CALLS-EXTERNAL] Lis...
/* static context [FOCAL] public String EntitlementProducer.createEntitlement() [PATH1] if(entitlementStrings.isEmpty())=T -> return null [PATH2] if(entitlementStrings.isEmpty())=F -> return StringUtils.join(entitlementStrings, ENTITLEMENT_SEPARATOR) [CALLS-INTERNAL] List<String> listEntitlements() [CALLS-EXTERNAL] Lis...
true
ok
{"focal": {"class": "EntitlementProducer", "name": "createEntitlement", "signature": "String createEntitlement()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "EntitlementProducer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fiel...
7091762_2
class CronExpressionDescriptor { public static String getDescription(String expression) throws ParseException { return getDescription(DescriptionTypeEnum.FULL, expression, new Options(), I18nMessages.DEFAULT_LOCALE); } private CronExpressionDescriptor(); public static String getDescription(S...
Assert.assertEquals("Every minute between 11:00 AM and 11:10 AM", CronExpressionDescriptor.getDescription("0-10 11 * * *")); Assert.assertEquals("Every minute between 11:00 and 11:10", CronExpressionDescriptor.getDescription("0-10 11 * * *", Options.twentyFourHour())); Assert.assertEquals("Every...
[FOCAL] public static String CronExpressionDescriptor.getDescription(String expression) [CLASS] class CronExpressionDescriptor [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String getDescription(DescriptionTypeEnum type, String expression, Options options, Locale locale) [NEW] Op...
/* static context [FOCAL] public static String CronExpressionDescriptor.getDescription(String expression) [INPUTS] branches=- | result=expression [EXCEPTIONS] declares ParseException [CALLS-INTERNAL] String getDescription(DescriptionTypeEnum type, String expression, Options options, Locale locale) [NEW] Options */
/* static context [FOCAL] public static String CronExpressionDescriptor.getDescription(String expression) [INPUTS] branches=- | result=expression [EXCEPTIONS] declares ParseException [CALLS-INTERNAL] String getDescription(DescriptionTypeEnum type, String expression, Options options, Locale locale) [NEW] Options */ clas...
true
ok
{"focal": {"class": "CronExpressionDescriptor", "name": "getDescription", "signature": "String getDescription(String expression) throws ParseException", "start_line": 3, "modifiers": "public static", "params": [{"name": "expression", "type": "String"}], "return_type": "String"}, "class_info": {"name": "CronExpressionDe...
7109191_7
class JavaScriptSettings { public static final JavaScriptSettingsBuilder newBuilder() { return new JavaScriptSettingsBuilder() { private JQueryUiBuilder jqueryUiBuilder; private BootstrapJsBuilder bootstrapJsBuilder; @Override public JQueryUiBuilder withJque...
JavaScriptResourceReference fullCore = new JavaScriptResourceReference(getClass(), "full-core"); JavaScriptSettings settings = JavaScriptSettings.newBuilder().withJqueryUi(JQueryUiVersions.v1_9_2) .withAllUiCore(fullCore).endJqueryUi().build(); assertThat(settings.jqueryUi.uiCoreCo...
[FOCAL] public static final JavaScriptSettingsBuilder JavaScriptSettings.newBuilder() [CLASS] class JavaScriptSettings [METRICS] loc=25 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] factory.newBuilder/1, jqueryUiBuilder.build/0, bootstrapJsBuilder.build/0 [NEW] JavaScriptSettingsBuilder, JavaScr...
/* static context [FOCAL] public static final JavaScriptSettingsBuilder JavaScriptSettings.newBuilder() [COLLABORATORS] field factory newBuilder/1; field jqueryUiBuilder build/0; field bootstrapJsBuilder build/0 [NEW] JavaScriptSettingsBuilder, JavaScriptSettings, JQueryUiSettings, BootstrapJsSettings [CALLS-EXTERNAL] ...
/* static context [FOCAL] public static final JavaScriptSettingsBuilder JavaScriptSettings.newBuilder() [COLLABORATORS] field factory newBuilder/1; field jqueryUiBuilder build/0; field bootstrapJsBuilder build/0 [NEW] JavaScriptSettingsBuilder, JavaScriptSettings, JQueryUiSettings, BootstrapJsSettings [CALLS-EXTERNAL] ...
true
ok
{"focal": {"class": "JavaScriptSettings", "name": "newBuilder", "signature": "JavaScriptSettingsBuilder newBuilder()", "start_line": 3, "modifiers": "public static final", "params": [], "return_type": "JavaScriptSettingsBuilder"}, "class_info": {"name": "JavaScriptSettings", "kind": "class", "modifiers": "", "superclas...
7139471_49
class MovieCategorySpinnerOnItemSelectedListener extends BaseSpinnerOnItemSelectedListener implements OnItemSelectedListener { @Override public void onItemSelected(AdapterView<?> viewAdapter, View view, int position, long id) { if (view == null) { return; } setMultiViewVideoActivity(activity); ...
doReturn(mockCategoryInfo).when(mockAdapterView).getItemAtPosition( anyInt()); doReturn("All").when(mockCategoryInfo).getCategory(); doReturn("Action").when(mockCategoryState).getGenreCategory(); doReturn(0).when(spyOnItemSelectedListener).getSavedInstancePosition( any(AdapterView.class)...
[FOCAL] @Override public void MovieCategorySpinnerOnItemSelectedListener.onItemSelected(AdapterView<?> viewAdapter, View view, int position, long id) [CLASS] class MovieCategorySpinnerOnItemSelectedListener extends BaseSpinnerOnItemSelectedListener implements OnItemSelectedListener [METRICS] loc=60 cc=9 branches=7 loop...
/* static context [FOCAL] @Override public void MovieCategorySpinnerOnItemSelectedListener.onItemSelected(AdapterView<?> viewAdapter, View view, int position, long id) [PATH1] if(view == null)=F -> if(savedInstanceCategory != null)=T -> if(item.getLevel() == 0)#1=T -> if(isFirstSelection())=T -> for(i < count)=T -> if(...
/* static context [FOCAL] @Override public void MovieCategorySpinnerOnItemSelectedListener.onItemSelected(AdapterView<?> viewAdapter, View view, int position, long id) [PATH1] if(view == null)=F -> if(savedInstanceCategory != null)=T -> if(item.getLevel() == 0)#1=T -> if(isFirstSelection())=T -> for(i < count)=T -> if(...
true
ok
{"focal": {"class": "MovieCategorySpinnerOnItemSelectedListener", "name": "onItemSelected", "signature": "void onItemSelected(AdapterView<?> viewAdapter, View view, int position, long id)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "viewAdapter", "type": "AdapterView<?>"}, {"name": "view", "...
7144342_0
class Future implements java.util.concurrent.Future<V> { Future(MessagePack messagePack, FutureImpl impl) { this(messagePack, impl, null); } Future(MessagePack messagePack, FutureImpl impl); Future(MessagePack messagePack, FutureImpl impl, Template resultTemplate); public Future(Messa...
EventLoop loop = EventLoop.start(); Server svr = new Server(loop); svr.serve(new TestHandler()); svr.listen(19860); Client cli = new Client("127.0.0.1", 19860, loop); TestInterface c = cli.proxy(TestInterface.class); try { Future<String> f1 = c.m1("...
[FOCAL] Future.Future(MessagePack messagePack, FutureImpl impl) [CLASS] class Future implements java.util.concurrent.Future<V> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [DATAFLOW] impl@param->L2; messagePack@param->L2 [CLASS-MEMBERS] Future(MessagePack messagePack, FutureImpl impl); Future(Me...
/* static context [FOCAL] Future.Future(MessagePack messagePack, FutureImpl impl) */
/* static context [FOCAL] Future.Future(MessagePack messagePack, FutureImpl impl) */ class Future implements java.util.concurrent.Future<V> { Future(MessagePack messagePack, FutureImpl impl) { this(messagePack, impl, null); } Future(MessagePack messagePack, FutureImpl impl); Future(Message...
true
ok
{"focal": {"class": "Future", "name": "Future", "signature": "Future(MessagePack messagePack, FutureImpl impl)", "start_line": 3, "modifiers": "", "params": [{"name": "messagePack", "type": "MessagePack"}, {"name": "impl", "type": "FutureImpl"}], "return_type": null}, "class_info": {"name": "Future", "kind": "class", "...
7170387_1
class DatabaseRequiredInRole extends AbstractRoleValidator { @Override public void validate(@Nullable String database, String role) throws ConfigurationException { /* * Rule only applies to rules in per database policy file */ if(database != null) { Iterable<Authorizable> authorizables = p...
DatabaseRequiredInRole dbRequiredInRole = new DatabaseRequiredInRole(); try { dbRequiredInRole.validate("db1", "server=server1->db=db1->URI=file:///user/hive/warehouse/tab1"); Assert.fail("Expected ConfigurationException"); } catch (ConfigurationException e) { ; } } }
[FOCAL] @Override public void DatabaseRequiredInRole.validate(String database, String role) [CLASS] class DatabaseRequiredInRole extends AbstractRoleValidator [METRICS] loc=42 cc=8 branches=6 loops=1 returns=0 throws=2 nesting=4 [CALLS-EXTERNAL] parseRole/1 (inherited), "true".equalsIgnoreCase/1, System.getProperty/1 [...
/* static context [FOCAL] @Override public void DatabaseRequiredInRole.validate(String database, String role) [THROWS-WHEN] ConfigurationException when database != null && "true".equalsIgnoreCase( System.getProperty(SimplePolicyEngine.ACCESS_ALLOW_URI_PER_DB_POLICYFILE)) && foreach(Authorizable authorizable : authoriza...
/* static context [FOCAL] @Override public void DatabaseRequiredInRole.validate(String database, String role) [THROWS-WHEN] ConfigurationException when database != null && "true".equalsIgnoreCase( System.getProperty(SimplePolicyEngine.ACCESS_ALLOW_URI_PER_DB_POLICYFILE)) && foreach(Authorizable authorizable : authoriza...
true
ok
{"focal": {"class": "DatabaseRequiredInRole", "name": "validate", "signature": "void validate(String database, String role) throws ConfigurationException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "database", "type": "String"}, {"name": "role", "type": "String"}], "return_type": "void"}, "c...
7212262_3
class HazelcastService implements SmartLifecycle { @Override public int getPhase() { return Integer.MAX_VALUE; } public HazelcastService(final Config configuration, final MetricsRegistry metricsRegistry); @Override public void start(); @Override public void stop(); @Override public boolean isRunni...
final HazelcastService objectUnderTest = newObjectUnderTest(); assertEquals("getPhase() should return Integer.MAX_VALUE", Integer.MAX_VALUE, objectUnderTest.getPhase()); } }
[FOCAL] @Override public int HazelcastService.getPhase() [CLASS] class HazelcastService implements SmartLifecycle [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] HazelcastService(Config configuration, MetricsRegistry metricsRegistry); void start(); void stop(); boolean isRunning(); ...
/* static context [FOCAL] @Override public int HazelcastService.getPhase() */
/* static context [FOCAL] @Override public int HazelcastService.getPhase() */ class HazelcastService implements SmartLifecycle { @Override public int getPhase() { return Integer.MAX_VALUE; } public HazelcastService(final Config configuration, final MetricsRegistry metricsRegistry); @Override public ...
true
ok
{"focal": {"class": "HazelcastService", "name": "getPhase", "signature": "int getPhase()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "HazelcastService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "SmartLifecycle", "fields": [],...
7220231_1
class TnefTimeZone { public static TimeZone getTimeZone(int index, boolean observeDaylightSaving, String tzId) throws IOException { if (index < 0 || index > 59) return null; int bias = 0; // UTC offset in minutes int standardBias = 0; // offset in minutes from bias duri...
TimeZone tz = null; RawInputStream ris = null; ris = new RawInputStream(intToleByteArray(13), 0, 4); tz = TnefTimeZone.getTimeZone(ris); Assert.assertFalse(tz == null); Assert.assertTrue(tz.getRawOffset() == -28800000); Assert.assertTrue(tz.getDSTSavings(...
[FOCAL] public static TimeZone TnefTimeZone.getTimeZone(int index, boolean observeDaylightSaving, String tzId) [CLASS] class TnefTimeZone [METRICS] loc=75 cc=7 branches=6 loops=0 returns=3 throws=0 nesting=2 [CALLS-INTERNAL] TimeZone getNoDaylightSavingTimeZoneFromUtcOffset(int utcOffsetInMilliseconds) [CALLS-EXTERNAL]...
/* static context [FOCAL] public static TimeZone TnefTimeZone.getTimeZone(int index, boolean observeDaylightSaving, String tzId) [PATH1] if(index < 0 || index > 59)=F -> if(utcPlus12offset > 12*60)=F -> if(utcPlus12offset < 12*60)=T -> if(indexToDaytimeSavingDatesTable == -1 || !observeDaylightSaving)=F -> if(sLog.isDe...
/* static context [FOCAL] public static TimeZone TnefTimeZone.getTimeZone(int index, boolean observeDaylightSaving, String tzId) [PATH1] if(index < 0 || index > 59)=F -> if(utcPlus12offset > 12*60)=F -> if(utcPlus12offset < 12*60)=T -> if(indexToDaytimeSavingDatesTable == -1 || !observeDaylightSaving)=F -> if(sLog.isDe...
true
ok
{"focal": {"class": "TnefTimeZone", "name": "getTimeZone", "signature": "TimeZone getTimeZone(int index, boolean observeDaylightSaving, String tzId) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "index", "type": "int"}, {"name": "observeDaylightSaving", "type": "boolean"}, {"na...
7257232_7
class Normalisation { public static String canonicaliseURL(String url) { return canonicaliseURL(url, true, true); } public static String sanitiseWARCHeaderValue(String value); public static String canonicaliseHost(String host); public static String fixURLErrors(String url); public stat...
final String[][] TESTS = new String[][]{ {"http://example.com/%C3%86blegr%C3%B8d", "http://example.com/Æblegrød"}, // UTF-8 escapes {"http://example.com/%C3%86blegr%C3", "http://example.com/Æblegr%c3"}, // Half UTF-8 2-byte escape {"http://example.com/Æ...
[FOCAL] public static String Normalisation.canonicaliseURL(String url) [CLASS] class Normalisation [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String canonicaliseURL(String url, boolean allowHighOrder, boolean createUnambiguous) [INPUTS] branches=- | result=url [DATAFLOW] url@p...
/* static context [FOCAL] public static String Normalisation.canonicaliseURL(String url) [INPUTS] branches=- | result=url [CALLS-INTERNAL] String canonicaliseURL(String url, boolean allowHighOrder, boolean createUnambiguous) */
/* static context [FOCAL] public static String Normalisation.canonicaliseURL(String url) [INPUTS] branches=- | result=url [CALLS-INTERNAL] String canonicaliseURL(String url, boolean allowHighOrder, boolean createUnambiguous) */ class Normalisation { public static String canonicaliseURL(String url) { return...
true
ok
{"focal": {"class": "Normalisation", "name": "canonicaliseURL", "signature": "String canonicaliseURL(String url)", "start_line": 3, "modifiers": "public static", "params": [{"name": "url", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Normalisation", "kind": "class", "modifiers": "", "superclass...
7272424_1
class PromoService implements Serializable { public void applyShippingPromotions(ShoppingCart shoppingCart) { if ( shoppingCart != null ) { //PROMO: if cart total is greater than 75, free shipping if ( shoppingCart.getCartItemTotal() >= 75) { shoppingCart.setShippingPromoSavings(shoppingCart.g...
//cart total 0 Assert.assertEquals(0, shoppingCart.getCartItemTotal(), 0); promoService.applyShippingPromotions(shoppingCart); Assert.assertEquals(0, shoppingCart.getShippingTotal(), 0); //cart total 74.99 shoppingCart.setCartItemTotal(74.99); shoppingCart.setShippingTotal(4.99); promoSer...
[FOCAL] public void PromoService.applyShippingPromotions(ShoppingCart shoppingCart) [CLASS] class PromoService implements Serializable [METRICS] loc=15 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2 [CALLS-EXTERNAL] ShoppingCart.getCartItemTotal/0, ShoppingCart.setShippingPromoSavings/1, ShoppingCart.getShippingT...
/* static context [FOCAL] public void PromoService.applyShippingPromotions(ShoppingCart shoppingCart) [PATH1] if(shoppingCart != null)=T -> if(shoppingCart.getCartItemTotal() >= 75)=T [PATH2] if(shoppingCart != null)=F [PATH3] if(shoppingCart != null)=T -> if(shoppingCart.getCartItemTotal() >= 75)=F [INPUTS] branches=s...
/* static context [FOCAL] public void PromoService.applyShippingPromotions(ShoppingCart shoppingCart) [PATH1] if(shoppingCart != null)=T -> if(shoppingCart.getCartItemTotal() >= 75)=T [PATH2] if(shoppingCart != null)=F [PATH3] if(shoppingCart != null)=T -> if(shoppingCart.getCartItemTotal() >= 75)=F [INPUTS] branches=s...
true
ok
{"focal": {"class": "PromoService", "name": "applyShippingPromotions", "signature": "void applyShippingPromotions(ShoppingCart shoppingCart)", "start_line": 3, "modifiers": "public", "params": [{"name": "shoppingCart", "type": "ShoppingCart"}], "return_type": "void"}, "class_info": {"name": "PromoService", "kind": "cla...
7276954_28
class CatalogPathUtils { public static AlluxioURI getTablePathUdb(String dbName, String tableName, String udbType) { return new AlluxioURI(PathUtils .concatPath(ServerConfiguration.get(PropertyKey.TABLE_CATALOG_PATH), dbName, TABLES_ROOT, tableName, udbType)); } private CatalogPathUtils...
String dbName = "dbName"; String tableName = "tableName"; String udbType = "udbType"; AlluxioURI path = CatalogPathUtils.getTablePathUdb(dbName, tableName, udbType); assertEquals(path.getPath(), PathUtils.concatPath(ServerConfiguration.global().get( PropertyKey.TABLE_CATALOG_PATH), dbName, ...
[FOCAL] public static AlluxioURI CatalogPathUtils.getTablePathUdb(String dbName, String tableName, String udbType) [CLASS] class CatalogPathUtils [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] PathUtils.concatPath/5, ServerConfiguration.get/1 [NEW] AlluxioURI [INPUTS] branches=- |...
/* static context [FOCAL] public static AlluxioURI CatalogPathUtils.getTablePathUdb(String dbName, String tableName, String udbType) [INPUTS] branches=- | result=dbName, tableName, udbType [NEW] AlluxioURI [CALLS-EXTERNAL] PathUtils.concatPath/5, ServerConfiguration.get/1 */
/* static context [FOCAL] public static AlluxioURI CatalogPathUtils.getTablePathUdb(String dbName, String tableName, String udbType) [INPUTS] branches=- | result=dbName, tableName, udbType [NEW] AlluxioURI [CALLS-EXTERNAL] PathUtils.concatPath/5, ServerConfiguration.get/1 */ class CatalogPathUtils { public static Al...
true
ok
{"focal": {"class": "CatalogPathUtils", "name": "getTablePathUdb", "signature": "AlluxioURI getTablePathUdb(String dbName, String tableName, String udbType)", "start_line": 3, "modifiers": "public static", "params": [{"name": "dbName", "type": "String"}, {"name": "tableName", "type": "String"}, {"name": "udbType", "typ...
7308129_2
class PingServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { resp.getWriter().write(String.valueOf(new Date().getTime())); } } class PingServletTest { @Test public void test() throws ServletException, IOExcepti...
// given HttpServletResponse resp = Mockito.mock(HttpServletResponse.class); StringWriter sw = new StringWriter(); Mockito.when(resp.getWriter()).thenReturn(new PrintWriter(sw)); // when new PingServlet().doGet(null, resp); // then String s = sw.toString(); assertNotNull(s); long parsedTimestamp =...
[FOCAL] @Override protected void PingServlet.doGet(HttpServletRequest req, HttpServletResponse resp) [CLASS] class PingServlet extends HttpServlet [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] resp.getWriter().write/1, HttpServletResponse.getWriter/0, String.valueOf/1, new Date()...
/* static context [FOCAL] @Override protected void PingServlet.doGet(HttpServletRequest req, HttpServletResponse resp) [INPUTS] branches=- | result=- | unused=req [COLLABORATORS] param resp:HttpServletResponse getWriter/0 [EXCEPTIONS] declares ServletException, IOException [NEW] Date [CALLS-EXTERNAL] resp.getWriter().w...
/* static context [FOCAL] @Override protected void PingServlet.doGet(HttpServletRequest req, HttpServletResponse resp) [INPUTS] branches=- | result=- | unused=req [COLLABORATORS] param resp:HttpServletResponse getWriter/0 [EXCEPTIONS] declares ServletException, IOException [NEW] Date [CALLS-EXTERNAL] resp.getWriter().w...
true
ok
{"focal": {"class": "PingServlet", "name": "doGet", "signature": "void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "req", "type": "HttpServletRequest"}, {"name": "resp", "type": "HttpServletRespon...
7316492_0
class LocalizedString implements Serializable, Cloneable { public String get(Locale locale) { return localized.get(locale); } public LocalizedString(Map<Locale, String> localized); public LocalizedString(); public Map<Locale, String> getLocalized(); @Override public LocalizedString ...
final Locale en_US = Locale.fromJavaLocale(java.util.Locale.US); final Locale he_IL = Locale.fromJavaLocale(new java.util.Locale("he", "IL")); final Map<Locale, String> localized = new LinkedHashMap<>(); localized.put(en_US, "English string with special characters: \"{},\\"); lo...
[FOCAL] public String LocalizedString.get(Locale locale) [CLASS] class LocalizedString implements Serializable, Cloneable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] localized.get/1 [INPUTS] branches=- | result=locale [COLLABORATORS] field localized get/1 [DATAFLOW] locale@para...
/* static context [FOCAL] public String LocalizedString.get(Locale locale) [INPUTS] branches=- | result=locale [COLLABORATORS] field localized get/1 [CALLS-EXTERNAL] localized.get/1 */
/* static context [FOCAL] public String LocalizedString.get(Locale locale) [INPUTS] branches=- | result=locale [COLLABORATORS] field localized get/1 [CALLS-EXTERNAL] localized.get/1 */ class LocalizedString implements Serializable, Cloneable { public String get(Locale locale) { return localized.get(locale)...
true
ok
{"focal": {"class": "LocalizedString", "name": "get", "signature": "String get(Locale locale)", "start_line": 3, "modifiers": "public", "params": [{"name": "locale", "type": "Locale"}], "return_type": "String"}, "class_info": {"name": "LocalizedString", "kind": "class", "modifiers": "", "superclass": null, "interfaces"...
7321072_139
class TextTokenizer { public LinkedList<Token> tokenize(String text) { if (logger.isDebugEnabled()) logger.debug("Tokenizing text: '" + text + "'"); text = text.replaceAll(" +", " "); // remove multiple consequent space chars text = text.trim(); final LinkedList<TextB...
{ final String text = "Fiyatları uçuşa geçti."; final Iterable<String> tokens = getSurfaces(tokenizer.tokenize(text)); assertThat(Lists.newArrayList(tokens), equalTo(Arrays.asList("Fiyatları", "uçuşa", "geçti", "."))); } { final String text = "Fiya...
[FOCAL] public LinkedList<Token> TextTokenizer.tokenize(String text) [CLASS] class TextTokenizer [METRICS] loc=66 cc=12 branches=9 loops=1 returns=1 throws=1 nesting=4 [CALLS-EXTERNAL] logger.isDebugEnabled/0, logger.debug/1, String.replaceAll/2, String.trim/0, textBlockSplitter.splitToTextParts/1, this.textBlockSplitt...
/* static context [FOCAL] public LinkedList<Token> TextTokenizer.tokenize(String text) [THROWS-WHEN] ex when logger.isDebugEnabled() && i <= textBlocks.size() - this.blockSize && logger.isDebugEnabled() && try-body throws && strict [PATH1] if(logger.isDebugEnabled())#1=T -> for(i <= textBlocks.size() - this.blockSize)=...
/* static context [FOCAL] public LinkedList<Token> TextTokenizer.tokenize(String text) [THROWS-WHEN] ex when logger.isDebugEnabled() && i <= textBlocks.size() - this.blockSize && logger.isDebugEnabled() && try-body throws && strict [PATH1] if(logger.isDebugEnabled())#1=T -> for(i <= textBlocks.size() - this.blockSize)=...
true
ok
{"focal": {"class": "TextTokenizer", "name": "tokenize", "signature": "LinkedList<Token> tokenize(String text)", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}], "return_type": "LinkedList<Token>"}, "class_info": {"name": "TextTokenizer", "kind": "class", "modifiers": "", "supercl...
7337208_1
class FileHashComparer { public static Map<String, Long> readHashes( File file ) throws FileNotFoundException { return readHashes( new FileInputStream(file) ); } public static ComparisonResult compareHashesAndDir( File hashes, File dir, IOFileFilter filter ); public static ComparisonResult com...
System.out.println( "readHashFile" ); File hashes = new File("testdata/utils/crc32hashes.txt"); Map<String, Long> result = FileHashComparer.readHashes( hashes ); assertEquals( Long.valueOf(0xf735fe81L), result.get(STR_ORACLE_DS) ); assertEquals( Long.valueOf(0x1...
[FOCAL] public static Map<String, Long> FileHashComparer.readHashes(File file) [CLASS] class FileHashComparer [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Map<String, Long> readHashes(InputStream hashesIS) [NEW] FileInputStream [EXCEPTIONS] declares FileNotFoundException [INPUTS...
/* static context [FOCAL] public static Map<String, Long> FileHashComparer.readHashes(File file) [INPUTS] branches=- | result=file [EXCEPTIONS] declares FileNotFoundException [CALLS-INTERNAL] Map<String, Long> readHashes(InputStream hashesIS) [NEW] FileInputStream */
/* static context [FOCAL] public static Map<String, Long> FileHashComparer.readHashes(File file) [INPUTS] branches=- | result=file [EXCEPTIONS] declares FileNotFoundException [CALLS-INTERNAL] Map<String, Long> readHashes(InputStream hashesIS) [NEW] FileInputStream */ class FileHashComparer { public static Map<Stri...
true
ok
{"focal": {"class": "FileHashComparer", "name": "readHashes", "signature": "Map<String, Long> readHashes(File file) throws FileNotFoundException", "start_line": 3, "modifiers": "public static", "params": [{"name": "file", "type": "File"}], "return_type": "Map<String, Long>"}, "class_info": {"name": "FileHashComparer", ...
7386322_2
class MainController extends AbstractController { @ResourceMapping(GET_TEMPLATES) public void getTemplates(ResourceRequest request, ResourceResponse response, @RequestParam("page") int page, @RequestParam("rows") int rows) throws Exception { try { User user = liferayService.getU...
MockResourceResponse response = new MockResourceResponse(); MockResourceRequest request = new MockResourceRequest(); List <Long> organizationIds = new LinkedList<Long>(); organizationIds.add((long) 1); organizationIds.add((long) 2); when(mockUser.getLast...
[FOCAL] @ResourceMapping(GET_TEMPLATES) public void MainController.getTemplates(ResourceRequest request, ResourceResponse response, int page, int rows) [CLASS] class MainController extends AbstractController [METRICS] loc=14 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] void createOnePageRespons...
/* static context [FOCAL] @ResourceMapping(GET_TEMPLATES) public void MainController.getTemplates(ResourceRequest request, ResourceResponse response, int page, int rows) [PATH1] if(user == null)=T -> return [PATH2] try-body throws [PATH3] if(user == null)=F [INPUTS] branches=request, response | result=- [COLLABORATORS]...
/* static context [FOCAL] @ResourceMapping(GET_TEMPLATES) public void MainController.getTemplates(ResourceRequest request, ResourceResponse response, int page, int rows) [PATH1] if(user == null)=T -> return [PATH2] try-body throws [PATH3] if(user == null)=F [INPUTS] branches=request, response | result=- [COLLABORATORS]...
true
ok
{"focal": {"class": "MainController", "name": "getTemplates", "signature": "void getTemplates(ResourceRequest request, ResourceResponse response, int page, int rows) throws Exception", "start_line": 3, "modifiers": "@ResourceMapping(GET_TEMPLATES) public", "params": [{"name": "request", "type": "ResourceRequest"}, {"na...
7393690_23
class ByteUtil { public static byte[] split(byte[] bytes, int start, int end) { if (bytes == null) { return null; } if (start < 0) { throw new IllegalArgumentException("start < 0"); } if (end > bytes.length) { throw new IllegalArgumentException("end > size"); } if (start > end) { throw new ...
byte[] in = new byte[] {0, 0, 1, 1, 1, 1, 0, 0}; byte[] out = ByteUtil.split(in, 2, 6); Assert.assertArrayEquals(new byte[] {1, 1, 1, 1}, out); System.out.println(String.format("[CRAFT-ATOM-UTIL] (^_^) <%s> Case -> make split. ", CaseCounter.incr(1))); } }
[FOCAL] public static byte[] ByteUtil.split(byte[] bytes, int start, int end) [CLASS] class ByteUtil [METRICS] loc=21 cc=5 branches=4 loops=0 returns=2 throws=3 nesting=1 [CALLS-EXTERNAL] System.arraycopy/5 [NEW] IllegalArgumentException [EXCEPTIONS] throws IllegalArgumentException [THROWS-WHEN] IllegalArgumentExceptio...
/* static context [FOCAL] public static byte[] ByteUtil.split(byte[] bytes, int start, int end) [THROWS-WHEN] IllegalArgumentException when !(bytes == null) && start < 0 [THROWS-WHEN] IllegalArgumentException when !(bytes == null) && !(start < 0) && end > bytes.length [THROWS-WHEN] IllegalArgumentException when !(bytes...
/* static context [FOCAL] public static byte[] ByteUtil.split(byte[] bytes, int start, int end) [THROWS-WHEN] IllegalArgumentException when !(bytes == null) && start < 0 [THROWS-WHEN] IllegalArgumentException when !(bytes == null) && !(start < 0) && end > bytes.length [THROWS-WHEN] IllegalArgumentException when !(bytes...
true
ok
{"focal": {"class": "ByteUtil", "name": "split", "signature": "byte[] split(byte[] bytes, int start, int end)", "start_line": 3, "modifiers": "public static", "params": [{"name": "bytes", "type": "byte[]"}, {"name": "start", "type": "int"}, {"name": "end", "type": "int"}], "return_type": "byte[]"}, "class_info": {"name...
7403823_41
class CheckClasses { @SuppressWarnings("rawtypes") public static List<Class> getCheckClasses() { return CLASSES; } private CheckClasses(); } class CheckClassesTest { @Test public void test() {
for (Class cls : CheckClasses.getCheckClasses()) { String testName = '/' + cls.getName().replace('.', '/') + "Test.class"; assertThat(getClass().getResource(testName)) .overridingErrorMessage("No test for " + cls.getSimpleName()) .isNotNull(); } HtmlRulesDefinition rulesDefiniti...
[FOCAL] @SuppressWarnings("rawtypes") public static List<Class> CheckClasses.getCheckClasses() [CLASS] class CheckClasses [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] CheckClasses() [TEST] CheckClassesTest: @Test public void test()
/* static context [FOCAL] @SuppressWarnings("rawtypes") public static List<Class> CheckClasses.getCheckClasses() */
/* static context [FOCAL] @SuppressWarnings("rawtypes") public static List<Class> CheckClasses.getCheckClasses() */ class CheckClasses { @SuppressWarnings("rawtypes") public static List<Class> getCheckClasses() { return CLASSES; } private CheckClasses(); } class CheckClassesTest { @Test public voi...
true
ok
{"focal": {"class": "CheckClasses", "name": "getCheckClasses", "signature": "List<Class> getCheckClasses()", "start_line": 3, "modifiers": "@SuppressWarnings(\"rawtypes\") public static", "params": [], "return_type": "List<Class>"}, "class_info": {"name": "CheckClasses", "kind": "class", "modifiers": "", "superclass": ...
7403873_31
class XmlSensor implements Sensor { @Override public void execute(SensorContext context) { List<InputFile> inputFiles = new ArrayList<>(); fileSystem.inputFiles(mainFilesPredicate).forEach(inputFiles::add); if (inputFiles.isEmpty()) { return; } boolean isSonarLintContext = context.runti...
init(false); fs.add(createInputFile("src/wrong-ampersand.xhtml")); sensor.execute(context); assertThat(context.allIssues()).isEmpty(); assertLog("Unable to analyse file .*wrong-ampersand.*", true); assertLog("Cause: org.xml.sax.SAXParseException.* Element type \"as\\.length\" must be followed...
[FOCAL] @Override public void XmlSensor.execute(SensorContext context) [CLASS] class XmlSensor implements Sensor [METRICS] loc=32 cc=6 branches=3 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] void scanFile(SensorContext context, InputFile inputFile, boolean isSonarLintContext) [CALLS-EXTERNAL] fileSystem.inputF...
/* static context [FOCAL] @Override public void XmlSensor.execute(SensorContext context) [PATH1] if(inputFiles.isEmpty())=F -> foreach(InputFile inputFile : inputFiles)=T -> if(context.isCancelled())=F -> exit loop -> if(!cancelled)=T [PATH2] if(inputFiles.isEmpty())=T -> return [PATH3] if(inputFiles.isEmpty())=F -> fo...
/* static context [FOCAL] @Override public void XmlSensor.execute(SensorContext context) [PATH1] if(inputFiles.isEmpty())=F -> foreach(InputFile inputFile : inputFiles)=T -> if(context.isCancelled())=F -> exit loop -> if(!cancelled)=T [PATH2] if(inputFiles.isEmpty())=T -> return [PATH3] if(inputFiles.isEmpty())=F -> fo...
true
ok
{"focal": {"class": "XmlSensor", "name": "execute", "signature": "void execute(SensorContext context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "SensorContext"}], "return_type": "void"}, "class_info": {"name": "XmlSensor", "kind": "class", "modifiers": "", "superclass": ...
7410462_0
class SubjectExtractor { public List<String> extract(String[] tokens) throws IOException { return extract(parser.parse(tokens)); } public SubjectExtractor(Parser parser, String confStr, boolean normalize); private void loadConfigString(String confStr); private Set<String> parsePart(Strin...
assertEquals(Arrays.asList("игрушка", "Lava", "кукла", "майя"), subjExtractor.extract("мягкая муз игрушка Lava кукла майя в красном платье".split(" "))); assertEquals(Arrays.asList(new String[]{"сапог"}), subjExtractor.extract(new String[]{"женские", "сапоги"})...
[FOCAL] public List<String> SubjectExtractor.extract(String[] tokens) [CLASS] class SubjectExtractor [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] List<String> extract(Node.Top sent) [CALLS-EXTERNAL] parser.parse/1 [EXCEPTIONS] declares IOException [INPUTS] branches=- | result=to...
/* static context [FOCAL] public List<String> SubjectExtractor.extract(String[] tokens) [INPUTS] branches=- | result=tokens [COLLABORATORS] field parser parse/1 [EXCEPTIONS] declares IOException [CALLS-INTERNAL] List<String> extract(Node.Top sent) [CALLS-EXTERNAL] parser.parse/1 */
/* static context [FOCAL] public List<String> SubjectExtractor.extract(String[] tokens) [INPUTS] branches=- | result=tokens [COLLABORATORS] field parser parse/1 [EXCEPTIONS] declares IOException [CALLS-INTERNAL] List<String> extract(Node.Top sent) [CALLS-EXTERNAL] parser.parse/1 */ class SubjectExtractor { public ...
true
ok
{"focal": {"class": "SubjectExtractor", "name": "extract", "signature": "List<String> extract(String[] tokens) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "tokens", "type": "String[]"}], "return_type": "List<String>"}, "class_info": {"name": "SubjectExtractor", "kind": "class", "mod...
7416235_10
class GraphName { public static GraphName of(String name) { return new GraphName(canonicalize(name)); } private GraphName(String name); public static GraphName newAnonymous(); public static GraphName root(); public static GraphName empty(); private static String canonicalize(String name); public...
assertGraphNameEquals("", GraphName.of("")); assertGraphNameEquals("/", GraphName.of("/")); assertGraphNameEquals("/", GraphName.of("//")); assertGraphNameEquals("/", GraphName.of("///")); assertGraphNameEquals("foo", GraphName.of("foo")); assertGraphNameEquals("foo", GraphName.of("foo/")); ...
[FOCAL] public static GraphName GraphName.of(String name) [CLASS] class GraphName [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String canonicalize(String name) [NEW] GraphName [INPUTS] branches=- | result=name [DATAFLOW] name@param->L2 [CLASS-MEMBERS] GraphName(String name); Gra...
/* static context [FOCAL] public static GraphName GraphName.of(String name) [INPUTS] branches=- | result=name [CALLS-INTERNAL] String canonicalize(String name) [NEW] GraphName */
/* static context [FOCAL] public static GraphName GraphName.of(String name) [INPUTS] branches=- | result=name [CALLS-INTERNAL] String canonicalize(String name) [NEW] GraphName */ class GraphName { public static GraphName of(String name) { return new GraphName(canonicalize(name)); } private GraphName(String...
true
ok
{"focal": {"class": "GraphName", "name": "of", "signature": "GraphName of(String name)", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}], "return_type": "GraphName"}, "class_info": {"name": "GraphName", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nul...
7416278_0
class PollingInputStream extends InputStream { @Override public synchronized int read(byte[] buffer, int offset, int length) throws IOException { int bytesRead = 0; if (length > 0) { while (available() == 0) { // Block until there are bytes to read. Thread.yield(); } synch...
PipedInputStream pipedInputStream = new PipedInputStream(); PipedOutputStream pipedOutputStream = new PipedOutputStream(pipedInputStream); PollingInputStream pollingInputStream = new PollingInputStream(pipedInputStream, Executors.newCachedThreadPool()); byte[] expectedBuffer = new byte[64]; ...
[FOCAL] @Override public synchronized int PollingInputStream.read(byte[] buffer, int offset, int length) [CLASS] class PollingInputStream extends InputStream [METRICS] loc=16 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] int available() [CALLS-EXTERNAL] Thread.yield/0, Math.min/2, System.arrayco...
/* static context [FOCAL] @Override public synchronized int PollingInputStream.read(byte[] buffer, int offset, int length) [PATH1] if(length > 0)=T -> while(available() == 0)=T -> exit loop -> return bytesRead [PATH2] if(length > 0)=F -> return bytesRead [PATH3] if(length > 0)=T -> while(available() == 0)=F -> return b...
/* static context [FOCAL] @Override public synchronized int PollingInputStream.read(byte[] buffer, int offset, int length) [PATH1] if(length > 0)=T -> while(available() == 0)=T -> exit loop -> return bytesRead [PATH2] if(length > 0)=F -> return bytesRead [PATH3] if(length > 0)=T -> while(available() == 0)=F -> return b...
true
ok
{"focal": {"class": "PollingInputStream", "name": "read", "signature": "int read(byte[] buffer, int offset, int length) throws IOException", "start_line": 3, "modifiers": "@Override public synchronized", "params": [{"name": "buffer", "type": "byte[]"}, {"name": "offset", "type": "int"}, {"name": "length", "type": "int"...
7416746_1
class Node { public synchronized Channel getFreeChannel() { for (Channel c : channels) { if (c.isFree()) { c.setFree(false); return c; } } return null; } public Node(AntChipInterface antchip); protected synchronized EventMachine getEvm(); public AntChipInterface getAntChip(); public sync...
when(channel1.isFree()).thenReturn(false); assertNull(node.getFreeChannel()); } }
[FOCAL] public synchronized Channel Node.getFreeChannel() [CLASS] class Node [METRICS] loc=11 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] Channel.isFree/0, Channel.setFree/1 [PATH1] foreach(Channel c : channels)=T -> if(c.isFree())=F -> exit loop -> return null [PATH2] foreach(Channel c : chan...
/* static context [FOCAL] public synchronized Channel Node.getFreeChannel() [PATH1] foreach(Channel c : channels)=T -> if(c.isFree())=F -> exit loop -> return null [PATH2] foreach(Channel c : channels)=T -> if(c.isFree())=T -> return c [PATH3] foreach(Channel c : channels)=F -> return null [CALLS-EXTERNAL] Channel.isFr...
/* static context [FOCAL] public synchronized Channel Node.getFreeChannel() [PATH1] foreach(Channel c : channels)=T -> if(c.isFree())=F -> exit loop -> return null [PATH2] foreach(Channel c : channels)=T -> if(c.isFree())=T -> return c [PATH3] foreach(Channel c : channels)=F -> return null [CALLS-EXTERNAL] Channel.isFr...
true
ok
{"focal": {"class": "Node", "name": "getFreeChannel", "signature": "Channel getFreeChannel()", "start_line": 3, "modifiers": "public synchronized", "params": [], "return_type": "Channel"}, "class_info": {"name": "Node", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "NUMBE...
7420937_193
class GetProcessApplicationNameFromAnnotation implements Supplier<Optional<String>>, UnaryOperator<Optional<String>> { @Override public Optional<String> apply(Optional<String> springApplicationName) { Optional<String> processApplicationName = GetProcessApplicationNameFromAnnotation.getProcessApplicationName.ap...
assumeAnnotatedBeans(Variables.createVariables()); assertThat(function.apply(Optional.of("foo"))).isEqualTo(Optional.of("foo")); } }
[FOCAL] @Override public Optional<String> GetProcessApplicationNameFromAnnotation.apply(Optional<String> springApplicationName) [CLASS] class GetProcessApplicationNameFromAnnotation implements Supplier<Optional<String>>, UnaryOperator<Optional<String>> [METRICS] loc=11 cc=3 branches=2 loops=0 returns=3 throws=0 nesting...
/* static context [FOCAL] @Override public Optional<String> GetProcessApplicationNameFromAnnotation.apply(Optional<String> springApplicationName) [PATH1] if(processApplicationName.isPresent())=F -> if(springApplicationName.isPresent())=T -> return springApplicationName [PATH2] if(processApplicationName.isPresent())=T -...
/* static context [FOCAL] @Override public Optional<String> GetProcessApplicationNameFromAnnotation.apply(Optional<String> springApplicationName) [PATH1] if(processApplicationName.isPresent())=F -> if(springApplicationName.isPresent())=T -> return springApplicationName [PATH2] if(processApplicationName.isPresent())=T -...
true
ok
{"focal": {"class": "GetProcessApplicationNameFromAnnotation", "name": "apply", "signature": "Optional<String> apply(Optional<String> springApplicationName)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "springApplicationName", "type": "Optional<String>"}], "return_type": "Optional<String>"}, ...
7422160_52
class FileUtil { public static String backupFile(File source) { File backup = new File(source.getParent() + "/~" + source.getName()); try { BufferedReader reader = new BufferedReader( new InputStreamReader(new FileInputStream(source))); BufferedWriter writer = new BufferedWriter( new OutputStreamW...
String content = FileUtil.readFile("testing.txt"); FileUtil.backupFile(new File("src/test/resources/testing.txt")); String content2 = FileUtil.readFile("~testing.txt"); Assert.assertEquals(content, content2); try { FileUtil.backupFile(new File("test/missing.txt")); fail("No Exception thrown with missin...
[FOCAL] public static String FileUtil.backupFile(File source) [CLASS] class FileUtil [METRICS] loc=14 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] File.getParent/0, File.getName/0, FileUtil.backupFile/3, File.getAbsolutePath/0, _log.error/2 [NEW] File, BufferedReader, InputStreamReader, FileInp...
/* static context [FOCAL] public static String FileUtil.backupFile(File source) [THROWS-WHEN] InvalidImplementationException when try-body throws [PATH1] try-body throws -> throw new InvalidImplementationException(msg, fe) [PATH2] return FileUtil.backupFile(reader, writer, source.getAbsolutePath()) [INPUTS] branches=- ...
/* static context [FOCAL] public static String FileUtil.backupFile(File source) [THROWS-WHEN] InvalidImplementationException when try-body throws [PATH1] try-body throws -> throw new InvalidImplementationException(msg, fe) [PATH2] return FileUtil.backupFile(reader, writer, source.getAbsolutePath()) [INPUTS] branches=- ...
true
ok
{"focal": {"class": "FileUtil", "name": "backupFile", "signature": "String backupFile(File source)", "start_line": 3, "modifiers": "public static", "params": [{"name": "source", "type": "File"}], "return_type": "String"}, "class_info": {"name": "FileUtil", "kind": "class", "modifiers": "", "superclass": null, "interfac...
7436396_4
class UserDaoJDBC implements UserDao { @Override public User addUser(final User user) { // create date set to now(), only work for mysql final String INSERT_SQL = "insert into t_user (imei, imsi, phone_name,createdate) values (?, ?, ?, now())"; // return this.jdbcTemplate.update(INSERT_SQL, user.getImei(), ...
String newImei = "46022222222222"; int count = userDao.getUserCount(); logger.debug("user count is "+count); User user = new User(); user.setImei(newImei); user.setImsi(newImei); user.setPhoneName("Shanzhai"); logger.info("before add:"+user); user = userDao.addUser(user); //User ID should get...
[FOCAL] @Override public User UserDaoJDBC.addUser(User user) [CLASS] class UserDaoJDBC implements UserDao [METRICS] loc=31 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] jdbcTemplate.update/2, connection.prepareStatement/2, PreparedStatement.setString/2, User.getImei/0, User.getImsi/0, User.getPh...
/* static context [FOCAL] @Override public User UserDaoJDBC.addUser(User user) [INPUTS] branches=- | result=user [COLLABORATORS] field jdbcTemplate update/2; field connection prepareStatement/2; param user:User getImei/0,getImsi/0,getPhoneName/0,setUserId/1 [NEW] GeneratedKeyHolder, PreparedStatementCreator [CALLS-EXTE...
/* static context [FOCAL] @Override public User UserDaoJDBC.addUser(User user) [INPUTS] branches=- | result=user [COLLABORATORS] field jdbcTemplate update/2; field connection prepareStatement/2; param user:User getImei/0,getImsi/0,getPhoneName/0,setUserId/1 [NEW] GeneratedKeyHolder, PreparedStatementCreator [CALLS-EXTE...
true
ok
{"focal": {"class": "UserDaoJDBC", "name": "addUser", "signature": "User addUser(User user)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "user", "type": "User"}], "return_type": "User"}, "class_info": {"name": "UserDaoJDBC", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ...
7438954_5
class ArgumentMerger { public PlungerArguments merge(String cmdTarget, Config config, CommandLine line, Options options) throws Exception { PlungerArguments result = new PlungerArguments(); Target commandTarget = new TargetParser().parse(cmdTarget); Entry entry = config.getEntry(commandTarget.getHost()); if (...
PlungerArguments pa = merge("provider://host:1234/queue.destination", CommandName.CAT, "-n1", "-re"); assertMisc(pa, "cat", true, false); assertTarget(pa, "provider", "host", 1234, null, null, "queue.destination", "destination"); assertTrue(pa.containsCommandArgument("n")); assertTrue(pa.getCommandArgument("...
[FOCAL] public PlungerArguments ArgumentMerger.merge(String cmdTarget, Config config, CommandLine line, Options options) [CLASS] class ArgumentMerger [METRICS] loc=27 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] Target mergeTarget(Target ct, Target et); boolean mergeColors(CommandLine line, Plu...
/* static context [FOCAL] public PlungerArguments ArgumentMerger.merge(String cmdTarget, Config config, CommandLine line, Options options) [PATH1] if((entry != null) && (entry.getTarget() != null))=T -> foreach(Object opt : options.getOptions())=T -> if(option.getOpt() != null && line.hasOption(option.getOpt()))=T -> e...
/* static context [FOCAL] public PlungerArguments ArgumentMerger.merge(String cmdTarget, Config config, CommandLine line, Options options) [PATH1] if((entry != null) && (entry.getTarget() != null))=T -> foreach(Object opt : options.getOptions())=T -> if(option.getOpt() != null && line.hasOption(option.getOpt()))=T -> e...
true
ok
{"focal": {"class": "ArgumentMerger", "name": "merge", "signature": "PlungerArguments merge(String cmdTarget, Config config, CommandLine line, Options options) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "cmdTarget", "type": "String"}, {"name": "config", "type": "Config"}, {"name": "l...
7450263_2
class HessianDecoder extends OneToOneDecoder { @Override protected Object decode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { if (!(msg instanceof ChannelBuffer)) { return msg; } ChannelBuffer buf = (ChannelBuffer) msg; if (buf.hasArray()) { ...
//构造序列化后的hessian字节码 SwallowMessage msg = new SwallowMessage(); msg.setGeneratedTime(new Date()); msg.setMessageId(123L); HashMap<String, String> map = new HashMap<String, String>(); map.put("property-key", "property-value"); msg.setContent("content"); ByteArrayOutputStrea...
[FOCAL] @Override protected Object HessianDecoder.decode(ChannelHandlerContext ctx, Channel channel, Object msg) [CLASS] class HessianDecoder extends OneToOneDecoder [METRICS] loc=19 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] ChannelBuffer.hasArray/0, ChannelBuffer.array/0, ChannelBuffer.arra...
/* static context [FOCAL] @Override protected Object HessianDecoder.decode(ChannelHandlerContext ctx, Channel channel, Object msg) [PATH1] if(!(msg instanceof ChannelBuffer))=F -> if(buf.hasArray())=T -> return in.readObject(Message.class) [PATH2] if(!(msg instanceof ChannelBuffer))=T -> return msg [PATH3] if(!(msg ins...
/* static context [FOCAL] @Override protected Object HessianDecoder.decode(ChannelHandlerContext ctx, Channel channel, Object msg) [PATH1] if(!(msg instanceof ChannelBuffer))=F -> if(buf.hasArray())=T -> return in.readObject(Message.class) [PATH2] if(!(msg instanceof ChannelBuffer))=T -> return msg [PATH3] if(!(msg ins...
true
ok
{"focal": {"class": "HessianDecoder", "name": "decode", "signature": "Object decode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "ctx", "type": "ChannelHandlerContext"}, {"name": "channel", "type": "Channel"}, {"name"...
7455819_22
class GzipCompressionPostHandler extends AbstractHandlerChain { @Override public boolean isApplicable(HandlerContext handlerContext) { // Retrieves the content type from the filtered response String mimeType = handlerContext.getResponse().getContentType(); // Required conditions boolean...
response.setContentType("incompatible-content-type"); HandlerContext handlerContext = new HandlerContext(context, request, response, null); assertThat(handler.isApplicable(handlerContext)).isFalse(); } }
[FOCAL] @Override public boolean GzipCompressionPostHandler.isApplicable(HandlerContext handlerContext) [CLASS] class GzipCompressionPostHandler extends AbstractHandlerChain [METRICS] loc=19 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Set<String> getSupportedMimeTypes(Context context); boolean...
/* static context [FOCAL] @Override public boolean GzipCompressionPostHandler.isApplicable(HandlerContext handlerContext) [INPUTS] branches=- | result=handlerContext [COLLABORATORS] param handlerContext:HandlerContext getResponse/0,getContext/0,getRequest/0 [CALLS-INTERNAL] Set<String> getSupportedMimeTypes(Context con...
/* static context [FOCAL] @Override public boolean GzipCompressionPostHandler.isApplicable(HandlerContext handlerContext) [INPUTS] branches=- | result=handlerContext [COLLABORATORS] param handlerContext:HandlerContext getResponse/0,getContext/0,getRequest/0 [CALLS-INTERNAL] Set<String> getSupportedMimeTypes(Context con...
true
ok
{"focal": {"class": "GzipCompressionPostHandler", "name": "isApplicable", "signature": "boolean isApplicable(HandlerContext handlerContext)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "handlerContext", "type": "HandlerContext"}], "return_type": "boolean"}, "class_info": {"name": "GzipCompres...
7465720_23
class AbstractNativeElementContext implements SearchContext, FindsByTagName, FindsByName, FindsById, FindsByText, FindsByXPath, FindsByPartialText, FindsByClass { protected static List<AndroidElement> searchViews(AbstractNativeElementContext context, View root, ...
// Bottom ViewGroup D = match(); ViewGroup e = ignore(); ViewGroup F = match(); // Middle ViewGroup b = ignore(D, e); ViewGroup C = match(F); // Root ViewGroup root = ignore(b, C); List<View> views = searchViews(root); assertFoun...
[FOCAL] protected static List<AndroidElement> AbstractNativeElementContext.searchViews(AbstractNativeElementContext context, View root, Predicate predicate, boolean findJustOne) [CLASS] class AbstractNativeElementContext implements SearchContext, FindsByTagName, FindsByName, FindsById, FindsByText, FindsByXPath, FindsB...
/* static context [FOCAL] protected static List<AndroidElement> AbstractNativeElementContext.searchViews(AbstractNativeElementContext context, View root, Predicate predicate, boolean findJustOne) [PATH1] if(root == null)=F -> while(!queue.isEmpty())=T -> if(predicate.apply(view))=T -> if(findJustOne)=F -> if(view insta...
/* static context [FOCAL] protected static List<AndroidElement> AbstractNativeElementContext.searchViews(AbstractNativeElementContext context, View root, Predicate predicate, boolean findJustOne) [PATH1] if(root == null)=F -> while(!queue.isEmpty())=T -> if(predicate.apply(view))=T -> if(findJustOne)=F -> if(view insta...
true
ok
{"focal": {"class": "AbstractNativeElementContext", "name": "searchViews", "signature": "List<AndroidElement> searchViews(AbstractNativeElementContext context, View root, Predicate predicate, boolean findJustOne)", "start_line": 11, "modifiers": "protected static", "params": [{"name": "context", "type": "AbstractNative...