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
1584558_0
class HiddenSingleMaskFactory extends SDKMaskFactory { public static boolean isHiddenSingle(SDKSquare s, SDKBoard board) { LinkedList<SDKSquare> zsqrs = board.getSquaresInZone(s); zsqrs.remove(s); LinkedList<SDKSquare> csqrs = board.getSquaresInCol(s.col); csqrs.remove(s); LinkedList<SDKSquare> rsqrs = boar...
int[][] test = {{0,0,0,0,0,0,0,0,0}, {0,0,5,0,8,0,4,0,0}, {0,4,6,7,2,9,0,5,1}, {9,6,0,3,5,0,0,8,0}, {0,0,0,0,6,0,9,3,5}, {0,8,3,0,1,4,0,2,7}, {1,7,0,5,0,0,2,0,3}, {0,0,9,0,0,1,0,6,8}, {0,5,4,2,3,8,7,0,0}}; SDKBoard board = new SDKBoard(); board.loadSimpleBoard(test); board.updateConstrai...
[FOCAL] public static boolean HiddenSingleMaskFactory.isHiddenSingle(SDKSquare s, SDKBoard board) [CLASS] class HiddenSingleMaskFactory extends SDKMaskFactory [METRICS] loc=22 cc=4 branches=0 loops=3 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] SDKBoard.getSquaresInZone/1, LinkedList<SDKSquare>.remove/1, SDKBoard.getS...
/* static context [FOCAL] public static boolean HiddenSingleMaskFactory.isHiddenSingle(SDKSquare s, SDKBoard board) [PATH1] foreach(SDKSquare s2 : rsqrs)=T -> exit loop -> foreach(SDKSquare s2 : csqrs)=F -> foreach(SDKSquare s2 : zsqrs)=F -> return rowPossibles.size() == 1 || colPossibles.size() == 1 || zonePossibl... ...
/* static context [FOCAL] public static boolean HiddenSingleMaskFactory.isHiddenSingle(SDKSquare s, SDKBoard board) [PATH1] foreach(SDKSquare s2 : rsqrs)=T -> exit loop -> foreach(SDKSquare s2 : csqrs)=F -> foreach(SDKSquare s2 : zsqrs)=F -> return rowPossibles.size() == 1 || colPossibles.size() == 1 || zonePossibl... ...
true
ok
{"focal": {"class": "HiddenSingleMaskFactory", "name": "isHiddenSingle", "signature": "boolean isHiddenSingle(SDKSquare s, SDKBoard board)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "SDKSquare"}, {"name": "board", "type": "SDKBoard"}], "return_type": "boolean"}, "class_info": {"na...
1589946_11
class AttributeModelAdapter { public static AttributeSearchResponse fromCatalogAPI(AttributeResponse result) { AttributeSearchResponse attributeSearchResponse = new AttributeSearchResponse(); if (inputIsValid(result)) { return attributeSearchResponse; } AttributeRespo...
AttributeResponse attributeResponse = generateAttributeResponse(); AttributeSearchResponse attributeSearchResponse = AttributeModelAdapter.fromCatalogAPI(attributeResponse); assertTrue(responsesAreEqual(generateExpectedAttributeSearchResponse(), attributeSearchResponse)); } }
[FOCAL] public static AttributeSearchResponse AttributeModelAdapter.fromCatalogAPI(AttributeResponse result) [CLASS] class AttributeModelAdapter [METRICS] loc=22 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] boolean inputIsValid(AttributeResponse result) [CALLS-EXTERNAL] AttributeResponse.getAtt...
/* static context [FOCAL] public static AttributeSearchResponse AttributeModelAdapter.fromCatalogAPI(AttributeResponse result) [PATH1] if(inputIsValid(result))=F -> foreach(AttributeType attributeType : resultAttributes.getAttribute())=T -> exit loop -> return attributeSearchResponse [PATH2] if(inputIsValid(result))=T ...
/* static context [FOCAL] public static AttributeSearchResponse AttributeModelAdapter.fromCatalogAPI(AttributeResponse result) [PATH1] if(inputIsValid(result))=F -> foreach(AttributeType attributeType : resultAttributes.getAttribute())=T -> exit loop -> return attributeSearchResponse [PATH2] if(inputIsValid(result))=T ...
true
ok
{"focal": {"class": "AttributeModelAdapter", "name": "fromCatalogAPI", "signature": "AttributeSearchResponse fromCatalogAPI(AttributeResponse result)", "start_line": 3, "modifiers": "public static", "params": [{"name": "result", "type": "AttributeResponse"}], "return_type": "AttributeSearchResponse"}, "class_info": {"n...
1592475_4
class ResultTraverser { public void traverse( Object instance, Selector selector, HierarchicalModel<?> model, YogaRequestContext context ) throws IOException { if (instance != null) { if (instance instanceof Iterable) { traverseIterable( (Iter...
HashMap<Object,Object> map = new HashMap<Object, Object>(); map.put("someKey", "someValue"); map.put("anotherKey", "anotherValue"); BasicTestDataLeaf input = new BasicTestDataLeaf(); input.setId(10); input.setName("name"); input.setOther("other"); map.put(...
[FOCAL] public void ResultTraverser.traverse(Object instance, Selector selector, HierarchicalModel<?> model, YogaRequestContext context) [CLASS] class ResultTraverser [METRICS] loc=23 cc=4 branches=3 loops=0 returns=0 throws=0 nesting=3 [CALLS-INTERNAL] void traverseIterable(Iterable<?> iterable, Selector selector, Lis...
/* static context [FOCAL] public void ResultTraverser.traverse(Object instance, Selector selector, HierarchicalModel<?> model, YogaRequestContext context) [PATH1] if(instance != null)=T -> if(instance instanceof Iterable)=F -> if(instance instanceof Map)=T [PATH2] if(instance != null)=F [PATH3] if(instance != null)=T -...
/* static context [FOCAL] public void ResultTraverser.traverse(Object instance, Selector selector, HierarchicalModel<?> model, YogaRequestContext context) [PATH1] if(instance != null)=T -> if(instance instanceof Iterable)=F -> if(instance instanceof Map)=T [PATH2] if(instance != null)=F [PATH3] if(instance != null)=T -...
true
ok
{"focal": {"class": "ResultTraverser", "name": "traverse", "signature": "void traverse(Object instance, Selector selector, HierarchicalModel<?> model, YogaRequestContext context) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "instance", "type": "Object"}, {"name": "selector", "type": ...
1603876_2
class FlagManager { public FeatureFlags getFlag(String flagName) { return (FeatureFlags) invokeStaticMethod("valueOf", new Object[] { flagName }, String.class); } private FlagManager(Class<?> featureFlagsClass); public void init(); public static FlagManager get(Class<?> featureFlagsClass); ...
FeatureFlags flag = manager.getFlag("ONE"); assertEquals("get flag ONE", Flags.ONE, flag); flag = manager.getFlag("THREE"); assertEquals("get flag THREE", Flags.THREE, flag); flag = manager.getFlag("YOU SHALL NOT EXIST"); assertEquals("get flag YOU SHALL NOT EXIST", null, flag); } }
[FOCAL] public FeatureFlags FlagManager.getFlag(String flagName) [CLASS] class FlagManager [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Object invokeStaticMethod(String methodName, Object[] args, Class<?>... parameterTypes) [INPUTS] branches=- | result=flagName [DATAFLOW] flagNa...
/* static context [FOCAL] public FeatureFlags FlagManager.getFlag(String flagName) [INPUTS] branches=- | result=flagName [CALLS-INTERNAL] Object invokeStaticMethod(String methodName, Object[] args, Class<?>... parameterTypes) */
/* static context [FOCAL] public FeatureFlags FlagManager.getFlag(String flagName) [INPUTS] branches=- | result=flagName [CALLS-INTERNAL] Object invokeStaticMethod(String methodName, Object[] args, Class<?>... parameterTypes) */ class FlagManager { public FeatureFlags getFlag(String flagName) { return (FeatureFla...
true
ok
{"focal": {"class": "FlagManager", "name": "getFlag", "signature": "FeatureFlags getFlag(String flagName)", "start_line": 3, "modifiers": "public", "params": [{"name": "flagName", "type": "String"}], "return_type": "FeatureFlags"}, "class_info": {"name": "FlagManager", "kind": "class", "modifiers": "", "superclass": nu...
1604565_0
class MultiGraph implements Graph { public Iterable<Vertex> getVertices() { Collection<Iterable<Vertex>> base = new LinkedList<Iterable<Vertex>>(); for (int pos = 0; pos < bases.length; pos++) { base.add(new MultiVertexIterable(pos)); } return new MultiIterable<Vertex>...
int count = 0; Set<Object> ids = new HashSet<Object>(); for (Vertex v : graph.getVertices()) { assertTrue(v instanceof MultiVertex); ids.add(v.getId()); count++; } assertEquals(5, count); assertEquals(5, ids.size()); assertTru...
[FOCAL] public Iterable<Vertex> MultiGraph.getVertices() [CLASS] class MultiGraph implements Graph [METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Collection<Iterable<Vertex>>.add/1 [NEW] LinkedList<Iterable<Vertex>>, MultiVertexIterable, MultiIterable<Vertex> [PATH1] for(pos < bas...
/* static context [FOCAL] public Iterable<Vertex> MultiGraph.getVertices() [PATH1] for(pos < bases.length)=T -> exit loop -> return new MultiIterable<Vertex>(base) [PATH2] for(pos < bases.length)=F -> return new MultiIterable<Vertex>(base) [NEW] LinkedList<Iterable<Vertex>>, MultiVertexIterable, MultiIterable<Vertex> [...
/* static context [FOCAL] public Iterable<Vertex> MultiGraph.getVertices() [PATH1] for(pos < bases.length)=T -> exit loop -> return new MultiIterable<Vertex>(base) [PATH2] for(pos < bases.length)=F -> return new MultiIterable<Vertex>(base) [NEW] LinkedList<Iterable<Vertex>>, MultiVertexIterable, MultiIterable<Vertex> [...
true
ok
{"focal": {"class": "MultiGraph", "name": "getVertices", "signature": "Iterable<Vertex> getVertices()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Iterable<Vertex>"}, "class_info": {"name": "MultiGraph", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Graph", "fields": [{...
1605107_158
class DemTile { @Deprecated public void computeGeoCorners(final SLCImage meta, final Orbit orbit, final Window tile) throws Exception { double[] phiAndLambda; final double l0 = tile.linelo; final double lN = tile.linehi; final double p0 = tile.pixlo; final double pN = ...
demTile.computeGeoCorners(masterMeta, masterOrbit, masterTileWindow); double phiMin_EXPECTED = 0.65198531114095126; Assert.assertEquals(phiMin_EXPECTED, demTile.phiMin, DELTA_08); double phiMax_EXPECTED = 0.65803878531122906; Assert.assertEquals(phiMax_EXPECTED, demTile.phiMax...
[FOCAL] @Deprecated public void DemTile.computeGeoCorners(SLCImage meta, Orbit orbit, Window tile) [CLASS] class DemTile [METRICS] loc=52 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void defineExtraPhiLam() [CALLS-EXTERNAL] Orbit.lp2ell/2, Math.min/2, Math.max/2 [NEW] Point [EXCEPTIONS] declar...
/* static context [FOCAL] @Deprecated public void DemTile.computeGeoCorners(SLCImage meta, Orbit orbit, Window tile) [COLLABORATORS] param orbit:Orbit lp2ell/2 [EXCEPTIONS] declares Exception [CALLS-INTERNAL] void defineExtraPhiLam() [NEW] Point [CALLS-EXTERNAL] Orbit.lp2ell/2, Math.min/2, Math.max/2 */
/* static context [FOCAL] @Deprecated public void DemTile.computeGeoCorners(SLCImage meta, Orbit orbit, Window tile) [COLLABORATORS] param orbit:Orbit lp2ell/2 [EXCEPTIONS] declares Exception [CALLS-INTERNAL] void defineExtraPhiLam() [NEW] Point [CALLS-EXTERNAL] Orbit.lp2ell/2, Math.min/2, Math.max/2 */ class DemTile {...
true
ok
{"focal": {"class": "DemTile", "name": "computeGeoCorners", "signature": "void computeGeoCorners(SLCImage meta, Orbit orbit, Window tile) throws Exception", "start_line": 3, "modifiers": "@Deprecated public", "params": [{"name": "meta", "type": "SLCImage"}, {"name": "orbit", "type": "Orbit"}, {"name": "tile", "type": "...
1608936_6
class ArrayHelper { public static <T> int indexOf(T[] array, T element) { for ( int i = 0; i < array.length; i++ ) { if ( array[i].equals( element ) ) { return i; } } return -1; } public static String[] toStringArray(Collection coll); public static String[][] to2DStringArray(Collection coll); pub...
Object[] array = new Integer[]{ 1, 2, 3 }; Object element = 3; int expResult = 2; int result = ArrayHelper.indexOf( array, element ); assertEquals( expResult, result ); } }
[FOCAL] public static int ArrayHelper.indexOf(T[] array, T element) [CLASS] class ArrayHelper [METRICS] loc=8 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] array[i].equals/1 [PATH1] for(i < array.length)=T -> if(array[i].equals( element ))=F -> exit loop -> return -1 [PATH2] for(i < array.length...
/* static context [FOCAL] public static int ArrayHelper.indexOf(T[] array, T element) [PATH1] for(i < array.length)=T -> if(array[i].equals( element ))=F -> exit loop -> return -1 [PATH2] for(i < array.length)=T -> if(array[i].equals( element ))=T -> return i [PATH3] for(i < array.length)=F -> return -1 [INPUTS] branch...
/* static context [FOCAL] public static int ArrayHelper.indexOf(T[] array, T element) [PATH1] for(i < array.length)=T -> if(array[i].equals( element ))=F -> exit loop -> return -1 [PATH2] for(i < array.length)=T -> if(array[i].equals( element ))=T -> return i [PATH3] for(i < array.length)=F -> return -1 [INPUTS] branch...
true
ok
{"focal": {"class": "ArrayHelper", "name": "indexOf", "signature": "int indexOf(T[] array, T element)", "start_line": 3, "modifiers": "public static", "params": [{"name": "array", "type": "T[]"}, {"name": "element", "type": "T"}], "return_type": "int"}, "class_info": {"name": "ArrayHelper", "kind": "class", "modifiers"...
1613090_15
class LazyHCatRecord extends HCatRecord { @Override public Object get(int fieldNum) { try { StructField fref = soi.getAllStructFieldRefs().get(fieldNum); return HCatRecordSerDe.serializeField( soi.getStructFieldData(wrappedObject, fref), fref....
HCatRecord r = new LazyHCatRecord(getHCatRecord(), getObjectInspector()); Assert.assertEquals(INT_CONST, ((Integer) r.get(0)).intValue()); Assert.assertEquals(LONG_CONST, ((Long) r.get(1)).longValue()); Assert.assertEquals(DOUBLE_CONST, ((Double) r.get(2)).doubleValue(), 0); Asse...
[FOCAL] @Override public Object LazyHCatRecord.get(int fieldNum) [CLASS] class LazyHCatRecord extends HCatRecord [METRICS] loc=11 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] soi.getAllStructFieldRefs().get/1, soi.getAllStructFieldRefs/0, HCatRecordSerDe.serializeField/2, soi.getStructFieldData...
/* static context [FOCAL] @Override public Object LazyHCatRecord.get(int fieldNum) [THROWS-WHEN] IllegalStateException when try-body throws [PATH1] try-body throws -> throw new IllegalStateException("SerDe Exception deserializing",e) [PATH2] return HCatRecordSerDe.serializeField( soi.getStructFieldData(wrappedObjec... ...
/* static context [FOCAL] @Override public Object LazyHCatRecord.get(int fieldNum) [THROWS-WHEN] IllegalStateException when try-body throws [PATH1] try-body throws -> throw new IllegalStateException("SerDe Exception deserializing",e) [PATH2] return HCatRecordSerDe.serializeField( soi.getStructFieldData(wrappedObjec... ...
true
ok
{"focal": {"class": "LazyHCatRecord", "name": "get", "signature": "Object get(int fieldNum)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "fieldNum", "type": "int"}], "return_type": "Object"}, "class_info": {"name": "LazyHCatRecord", "kind": "class", "modifiers": "", "superclass": "HCatRecord"...
1619254_27
class SimpleDegree implements Degree { public Degree min(Degree comp) { return new SimpleDegree( Math.min(this.getValue(), comp.getValue()) ); } public SimpleDegree(); public SimpleDegree(double degree); public SimpleDegree(String degree); public void setValue(double value); pu...
SimpleDegree s1 = new SimpleDegree(0.6); SimpleDegree s2 = new SimpleDegree(0.3); Degree s4 = s1.min(s2); assertEquals(new SimpleDegree(0.6),s1); assertEquals(new SimpleDegree(0.3),s2); assertEquals(s2,s4); } }
[FOCAL] public Degree SimpleDegree.min(Degree comp) [CLASS] class SimpleDegree implements Degree [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] double getValue() [CALLS-EXTERNAL] Math.min/2, Degree.getValue/0 [NEW] SimpleDegree [INPUTS] branches=- | result=comp [COLLABORATORS] par...
/* static context [FOCAL] public Degree SimpleDegree.min(Degree comp) [INPUTS] branches=- | result=comp [COLLABORATORS] param comp:Degree getValue/0 [CALLS-INTERNAL] double getValue() [NEW] SimpleDegree [CALLS-EXTERNAL] Math.min/2, Degree.getValue/0 */
/* static context [FOCAL] public Degree SimpleDegree.min(Degree comp) [INPUTS] branches=- | result=comp [COLLABORATORS] param comp:Degree getValue/0 [CALLS-INTERNAL] double getValue() [NEW] SimpleDegree [CALLS-EXTERNAL] Math.min/2, Degree.getValue/0 */ class SimpleDegree implements Degree { public Degree min(Degre...
true
ok
{"focal": {"class": "SimpleDegree", "name": "min", "signature": "Degree min(Degree comp)", "start_line": 3, "modifiers": "public", "params": [{"name": "comp", "type": "Degree"}], "return_type": "Degree"}, "class_info": {"name": "SimpleDegree", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Degree"...
1619733_7
class Parser { public Database parse( File file ) throws IOException { // Read the file into a single string ... String ddl = readFile(file); // Create the object that will parse the file ... DdlParsers parsers = new DdlParsers(); AstNode node = parsers.parse(ddl, file.getN...
database = parser.parse(testFile("create_schema.ddl")); assertThat(database.getName(), is("POSTGRES")); Schema schema = database.getSchema("hollywood", false); assertThat(schema.getName(), is("hollywood")); Table table = schema.getTable("films", false); assertThat(table.g...
[FOCAL] public Database Parser.parse(File file) [CLASS] class Parser [METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Database processStatements(AstNode node); String readFile(File file) [CALLS-EXTERNAL] DdlParsers.parse/2, File.getName/0, System.out.println/1, AstNode.toString/0 [...
/* static context [FOCAL] public Database Parser.parse(File file) [INPUTS] branches=- | result=file [COLLABORATORS] param file:File getName/0 [EXCEPTIONS] declares IOException [CALLS-INTERNAL] Database processStatements(AstNode node); String readFile(File file) [NEW] DdlParsers [CALLS-EXTERNAL] DdlParsers.parse/2, File...
/* static context [FOCAL] public Database Parser.parse(File file) [INPUTS] branches=- | result=file [COLLABORATORS] param file:File getName/0 [EXCEPTIONS] declares IOException [CALLS-INTERNAL] Database processStatements(AstNode node); String readFile(File file) [NEW] DdlParsers [CALLS-EXTERNAL] DdlParsers.parse/2, File...
true
ok
{"focal": {"class": "Parser", "name": "parse", "signature": "Database parse(File file) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "file", "type": "File"}], "return_type": "Database"}, "class_info": {"name": "Parser", "kind": "class", "modifiers": "", "superclass": null, "interfaces...
1626780_5
class SqlDao implements AutoCloseable { public SubjectRef getOrCreateSubjectRef(String type, String name) throws SQLException { final SubjectRef ret = SubjectRef.unresolved(type, name); allocateSubjectRef(ret); return ret; } public SqlDao(SqlDataStore ds); protected String ge...
try (SqlDao dao = sqlStore.getDao()) { assertFalse(dao.getSubjectRef("group", "admin").isPresent()); SubjectRef created = dao.getOrCreateSubjectRef("group", "admin"); SubjectRef fetched = dao.getSubjectRef("group", "admin").get(); assertEquals(created.getId(), fet...
[FOCAL] public SubjectRef SqlDao.getOrCreateSubjectRef(String type, String name) [CLASS] class SqlDao implements AutoCloseable [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void allocateSubjectRef(SubjectRef ref) [CALLS-EXTERNAL] SubjectRef.unresolved/2 [EXCEPTIONS] declares SQLE...
/* static context [FOCAL] public SubjectRef SqlDao.getOrCreateSubjectRef(String type, String name) [INPUTS] branches=- | result=name, type [EXCEPTIONS] declares SQLException [CALLS-INTERNAL] void allocateSubjectRef(SubjectRef ref) [CALLS-EXTERNAL] SubjectRef.unresolved/2 */
/* static context [FOCAL] public SubjectRef SqlDao.getOrCreateSubjectRef(String type, String name) [INPUTS] branches=- | result=name, type [EXCEPTIONS] declares SQLException [CALLS-INTERNAL] void allocateSubjectRef(SubjectRef ref) [CALLS-EXTERNAL] SubjectRef.unresolved/2 */ class SqlDao implements AutoCloseable { ...
true
ok
{"focal": {"class": "SqlDao", "name": "getOrCreateSubjectRef", "signature": "SubjectRef getOrCreateSubjectRef(String type, String name) throws SQLException", "start_line": 3, "modifiers": "public", "params": [{"name": "type", "type": "String"}, {"name": "name", "type": "String"}], "return_type": "SubjectRef"}, "class_i...
1628050_3
class APIAuthentication { public static void validate (APICredential cred, SecretKey secretKey, byte[]... payLoad) throws NoSuchAlgorithmException, InvalidKeyException { if (!VERSION.equals(cred.getVersion())) throw new IllegalArgumentException ("unsupported.version"); assertNotNull(pay...
try { byte[] payLoad = UUID.randomUUID().toString().getBytes(); KeyGenerator gen = KeyGenerator.getInstance("HmacSHA256"); SecretKey badSecretKey = gen.generateKey(); APIAuthentication.validate( APICredential.builder() .version(APIA...
[FOCAL] public static void APIAuthentication.validate(APICredential cred, SecretKey secretKey, byte[]... payLoad) [CLASS] class APIAuthentication [METRICS] loc=9 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1 [CALLS-INTERNAL] byte[] computeHash(SecretKey secretKey, long timestamp, String nonce, byte[]... payLoad)...
/* static context [FOCAL] public static void APIAuthentication.validate(APICredential cred, SecretKey secretKey, byte[]... payLoad) [THROWS-WHEN] IllegalArgumentException when !VERSION.equals(cred.getVersion()) [PATH1] if(!VERSION.equals(cred.getVersion()))=T -> throw new IllegalArgumentException ("unsupported.version"...
/* static context [FOCAL] public static void APIAuthentication.validate(APICredential cred, SecretKey secretKey, byte[]... payLoad) [THROWS-WHEN] IllegalArgumentException when !VERSION.equals(cred.getVersion()) [PATH1] if(!VERSION.equals(cred.getVersion()))=T -> throw new IllegalArgumentException ("unsupported.version"...
true
ok
{"focal": {"class": "APIAuthentication", "name": "validate", "signature": "void validate(APICredential cred, SecretKey secretKey, byte[]... payLoad) throws NoSuchAlgorithmException, InvalidKeyException", "start_line": 3, "modifiers": "public static", "params": [{"name": "cred", "type": "APICredential"}, {"name": "secre...
1639726_10
class SOAPMailSender extends MailSender { public MimeMessage createMessage(String from, String to, String cc, String subject, SOAPMessage soapMessage) throws ConnectionException { return createMessage(from, to, cc, subject, soapMessage, createSession()); } public SOAPMailSender(String...
SOAPMessage soapMessage = null; MimeMessage mimeMsg = null; MimeHeaders mimeHeaders = new MimeHeaders(); InputStream contentStream = FIXTURE_LOADER.getResourceAsStream("mime_message_content.dat"); mimeHeaders.setHeader("Content-Type", "text/xml; charset=utf-8"); ...
[FOCAL] public MimeMessage SOAPMailSender.createMessage(String from, String to, String cc, String subject, SOAPMessage soapMessage) [CLASS] class SOAPMailSender extends MailSender [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] MimeMessage createMessage(String from, String to, Stri...
/* static context [FOCAL] public MimeMessage SOAPMailSender.createMessage(String from, String to, String cc, String subject, SOAPMessage soapMessage) [INPUTS] branches=- | result=cc, from, soapMessage, subject, to [EXCEPTIONS] declares ConnectionException [CALLS-INTERNAL] MimeMessage createMessage(String from, String t...
/* static context [FOCAL] public MimeMessage SOAPMailSender.createMessage(String from, String to, String cc, String subject, SOAPMessage soapMessage) [INPUTS] branches=- | result=cc, from, soapMessage, subject, to [EXCEPTIONS] declares ConnectionException [CALLS-INTERNAL] MimeMessage createMessage(String from, String t...
true
ok
{"focal": {"class": "SOAPMailSender", "name": "createMessage", "signature": "MimeMessage createMessage(String from, String to, String cc, String subject, SOAPMessage soapMessage) throws ConnectionException", "start_line": 3, "modifiers": "public", "params": [{"name": "from", "type": "String"}, {"name": "to", "type": "S...
1644461_572
class SqlQueryParser implements QueryParser { protected NamedSelector parseNamedSelector( TokenStream tokens, TypeSystem typeSystem ) { SelectorName name = parseSelectorName(tokens, typeSystem); SelectorName alias = null; if (tokens.canConsume...
NamedSelector selector = parser.parseNamedSelector(tokens("name AS alias"), typeSystem); assertThat(selector.name(), is(selectorName("name"))); assertThat(selector.alias(), is(selectorName("alias"))); assertThat(selector.aliasOrName(), is(selectorName("alias"))); } }
[FOCAL] protected NamedSelector SqlQueryParser.parseNamedSelector(TokenStream tokens, TypeSystem typeSystem) [CLASS] class SqlQueryParser implements QueryParser [METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] SelectorName parseSelectorName(TokenStream tokens, TypeSystem typeSystem)...
/* static context [FOCAL] protected NamedSelector SqlQueryParser.parseNamedSelector(TokenStream tokens, TypeSystem typeSystem) [PATH1] if(tokens.canConsume("AS"))=T -> return new NamedSelector(name, alias) [PATH2] if(tokens.canConsume("AS"))=F -> return new NamedSelector(name, alias) [NEW] NamedSelector */
/* static context [FOCAL] protected NamedSelector SqlQueryParser.parseNamedSelector(TokenStream tokens, TypeSystem typeSystem) [PATH1] if(tokens.canConsume("AS"))=T -> return new NamedSelector(name, alias) [PATH2] if(tokens.canConsume("AS"))=F -> return new NamedSelector(name, alias) [NEW] NamedSelector */ class SqlQue...
true
ok
{"focal": {"class": "SqlQueryParser", "name": "parseNamedSelector", "signature": "NamedSelector parseNamedSelector(TokenStream tokens, TypeSystem typeSystem)", "start_line": 3, "modifiers": "protected", "params": [{"name": "tokens", "type": "TokenStream"}, {"name": "typeSystem", "type": "TypeSystem"}], "return_type": "...
1644585_55
class HasJsonPath extends TypeSafeMatcher<JsonNode> { @Override public void describeTo(Description description) { description.appendText("a JSON object matching JSONpath \"" + jsonPath + "\""); if (matcher != null) { description.appendText(" with "); matcher.des...
// bugfix for issue #47 hasJsonPath = new HasJsonPath<Object>("$.foo"); StringDescription sd = new StringDescription(); hasJsonPath.describeTo(sd); assertThat(sd.toString(), is("a JSON object matching JSONpath \"$.foo\"")); } }
[FOCAL] @Override public void HasJsonPath.describeTo(Description description) [CLASS] class HasJsonPath extends TypeSafeMatcher<JsonNode> [METRICS] loc=10 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] Description.appendText/1, matcher.describeTo/1 [PATH1] if(matcher != null)=T [PATH2] if(matcher...
/* static context [FOCAL] @Override public void HasJsonPath.describeTo(Description description) [PATH1] if(matcher != null)=T [PATH2] if(matcher != null)=F [COLLABORATORS] param description:Description appendText/1; field matcher describeTo/1 [CALLS-EXTERNAL] Description.appendText/1, matcher.describeTo/1 */
/* static context [FOCAL] @Override public void HasJsonPath.describeTo(Description description) [PATH1] if(matcher != null)=T [PATH2] if(matcher != null)=F [COLLABORATORS] param description:Description appendText/1; field matcher describeTo/1 [CALLS-EXTERNAL] Description.appendText/1, matcher.describeTo/1 */ class HasJ...
true
ok
{"focal": {"class": "HasJsonPath", "name": "describeTo", "signature": "void describeTo(Description description)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "description", "type": "Description"}], "return_type": "void"}, "class_info": {"name": "HasJsonPath", "kind": "class", "modifiers": "", ...
1645877_7
class GenericDataSource implements DataSource { @Override public String getResourceName() { return resourceName; } public GenericDataSource(InputStream inputStream, String resourceName); @Override public URI getUri(); @Override public InputStream getInputStream(); } class GenericDataSourceTest { @Test ...
GenericDataSource staticDataSource = new GenericDataSource(null, "resource"); assertThat(staticDataSource.getResourceName(), IsEqual.equalTo("resource")); } }
[FOCAL] @Override public String GenericDataSource.getResourceName() [CLASS] class GenericDataSource implements DataSource [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] GenericDataSource(InputStream inputStream, String resourceName); URI getUri(); InputStream getInputStream() [TEST...
/* static context [FOCAL] @Override public String GenericDataSource.getResourceName() */
/* static context [FOCAL] @Override public String GenericDataSource.getResourceName() */ class GenericDataSource implements DataSource { @Override public String getResourceName() { return resourceName; } public GenericDataSource(InputStream inputStream, String resourceName); @Override public URI getUri(); @...
true
ok
{"focal": {"class": "GenericDataSource", "name": "getResourceName", "signature": "String getResourceName()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "GenericDataSource", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "DataSour...
1660918_16
class Dependencies { public static boolean areEquivalent(Dependency l, Dependency r) { if (l == r) { return true; } if ((l == null) && (r == null)) { return true; } else if ((l == null) || (r == null)) { return false; } retur...
Dependency depOne = DependencyBuilder.create().setGroupId("org.jboss.errai").setArtifactId("errai-cdi-client") .setPackaging("jar"); Dependency depTwo = DependencyBuilder.create().setGroupId("org.jboss.errai").setArtifactId("errai-cdi-client") .setPackaging("test-jar"); A...
[FOCAL] public static boolean Dependencies.areEquivalent(Dependency l, Dependency r) [CLASS] class Dependencies [METRICS] loc=17 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=2 [CALLS-INTERNAL] boolean areEquivalent(Coordinate l, Coordinate r) [CALLS-EXTERNAL] Dependency.getCoordinate/0 [PATH1] if(l == r)=F -> if(...
/* static context [FOCAL] public static boolean Dependencies.areEquivalent(Dependency l, Dependency r) [PATH1] if(l == r)=F -> if((l == null) && (r == null))=F -> if((l == null) || (r == null))=T -> return false [PATH2] if(l == r)=T -> return true [PATH3] if(l == r)=F -> if((l == null) && (r == null))=F -> if((l == nul...
/* static context [FOCAL] public static boolean Dependencies.areEquivalent(Dependency l, Dependency r) [PATH1] if(l == r)=F -> if((l == null) && (r == null))=F -> if((l == null) || (r == null))=T -> return false [PATH2] if(l == r)=T -> return true [PATH3] if(l == r)=F -> if((l == null) && (r == null))=F -> if((l == nul...
true
ok
{"focal": {"class": "Dependencies", "name": "areEquivalent", "signature": "boolean areEquivalent(Dependency l, Dependency r)", "start_line": 3, "modifiers": "public static", "params": [{"name": "l", "type": "Dependency"}, {"name": "r", "type": "Dependency"}], "return_type": "boolean"}, "class_info": {"name": "Dependenc...
1666060_2
class HoltWintersComputer { public double getAlpha() { return alpha; } public HoltWintersComputer(double alpha); public HoltWintersComputer(double alpha, double beta); public HoltWintersComputer(double alpha, double beta, double gamma, int period); public void addNextValue(doub...
// series<-ts(c(315.42, 316.31, 316.50, 317.56, 318.13, 318.00, 316.39, 314.65, 313.68, 313.18, 314.66, 315.43)) double[] series = {315.42, 316.31, 316.50, 317.56, 318.13, 318.00, 316.39, 314.65, 313.68, 313.18, 314.66, 315.43}; // smooth<-HoltWinters(co2, alpha=0.8, beta=FALSE, gamma=FALSE) ...
[FOCAL] public double HoltWintersComputer.getAlpha() [CLASS] class HoltWintersComputer [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] HoltWintersComputer(double alpha); HoltWintersComputer(double alpha, double beta); HoltWintersComputer(double alpha, double beta, double gamma, int ...
/* static context [FOCAL] public double HoltWintersComputer.getAlpha() */
/* static context [FOCAL] public double HoltWintersComputer.getAlpha() */ class HoltWintersComputer { public double getAlpha() { return alpha; } public HoltWintersComputer(double alpha); public HoltWintersComputer(double alpha, double beta); public HoltWintersComputer(double alpha, ...
true
ok
{"focal": {"class": "HoltWintersComputer", "name": "getAlpha", "signature": "double getAlpha()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "double"}, "class_info": {"name": "HoltWintersComputer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "CO...
1670551_43
class TupleQuery extends TwigQuery { public void add(final NodeQuery query, final NodeBooleanClause.Occur occur) { super.addChild(query, occur); } public TupleQuery(); public TupleQuery(final int level); public TupleQuery(final boolean disableCoord); public TupleQuery(final int level, final boolea...
this.addDocument("\"bbb\" . "); final Query query = tuple() .optional(nbq(must("ddd")), nbq(must("eee"))) .getLuceneProxyQuery(); final BooleanQuery q = new BooleanQuery(); q.add(new TermQuery(new Term(DEFAULT_TEST_FIELD, "bbb")), BooleanClause.Occur.SHOULD); q.add(query, BooleanClause...
[FOCAL] public void TupleQuery.add(NodeQuery query, NodeBooleanClause.Occur occur) [CLASS] class TupleQuery extends TwigQuery [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] TwigQuery.addChild/2 [DATAFLOW] occur@param->L2; query@param->L2 [CLASS-MEMBERS] TupleQuery(); TupleQuery(in...
/* static context [FOCAL] public void TupleQuery.add(NodeQuery query, NodeBooleanClause.Occur occur) [CALLS-EXTERNAL] TwigQuery.addChild/2 */
/* static context [FOCAL] public void TupleQuery.add(NodeQuery query, NodeBooleanClause.Occur occur) [CALLS-EXTERNAL] TwigQuery.addChild/2 */ class TupleQuery extends TwigQuery { public void add(final NodeQuery query, final NodeBooleanClause.Occur occur) { super.addChild(query, occur); } public TupleQuery(...
true
ok
{"focal": {"class": "TupleQuery", "name": "add", "signature": "void add(NodeQuery query, NodeBooleanClause.Occur occur)", "start_line": 3, "modifiers": "public", "params": [{"name": "query", "type": "NodeQuery"}, {"name": "occur", "type": "NodeBooleanClause.Occur"}], "return_type": "void"}, "class_info": {"name": "Tupl...
1672467_0
class Utf8StringUtils { public static List<String> utf8byteSizeSplit(String s, int maxChunkBytes) { if (maxChunkBytes < 6) { throw new IllegalArgumentException("Max UTF-8 chunk size cannot be less than 6"); } byte[] bytes = s.getBytes(UTF8); List<String> result = new Ar...
int runs = 10 + random.nextInt(10); System.out.println("Running " + runs + " random UTF-8 string-split tests..."); for (int r=0; r<runs; r++) { String source = RandomStringUtils.random(100000); int size = 6 + random.nextInt(1000); List<String> splitList = Utf8...
[FOCAL] public static List<String> Utf8StringUtils.utf8byteSizeSplit(String s, int maxChunkBytes) [CLASS] class Utf8StringUtils [METRICS] loc=27 cc=5 branches=3 loops=1 returns=1 throws=1 nesting=2 [CALLS-INTERNAL] int utf8CharBytes(byte b) [CALLS-EXTERNAL] String.getBytes/1, List<String>.add/1 [NEW] IllegalArgumentExc...
/* static context [FOCAL] public static List<String> Utf8StringUtils.utf8byteSizeSplit(String s, int maxChunkBytes) [THROWS-WHEN] IllegalArgumentException when maxChunkBytes < 6 [PATH1] if(maxChunkBytes < 6)=F -> foreach(byte b : bytes)=T -> if(chunkLength + utf8CharBytes(b) > maxChunkBytes)=T -> exit loop -> if(chunkL...
/* static context [FOCAL] public static List<String> Utf8StringUtils.utf8byteSizeSplit(String s, int maxChunkBytes) [THROWS-WHEN] IllegalArgumentException when maxChunkBytes < 6 [PATH1] if(maxChunkBytes < 6)=F -> foreach(byte b : bytes)=T -> if(chunkLength + utf8CharBytes(b) > maxChunkBytes)=T -> exit loop -> if(chunkL...
true
ok
{"focal": {"class": "Utf8StringUtils", "name": "utf8byteSizeSplit", "signature": "List<String> utf8byteSizeSplit(String s, int maxChunkBytes)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "String"}, {"name": "maxChunkBytes", "type": "int"}], "return_type": "List<String>"}, "class_inf...
1676303_13
class ComplianceActivityUnmarshaller implements Unmarshaller<Activity> { @Override public final Activity unmarshall(final String s) { try { return mapper.readValue(s, ComplianceActivity.class).toActivity(); } catch (final IOException | UncheckedIOException e) { logger.wa...
final String s = "{\"user_undelete\":{\"id\":796250066,\"timestamp_ms\":\"1432228149062\"}}"; final Activity result = unmarshaller.unmarshall(s); assertEquals(ComplianceActivity.Verb.USER_UNDELETE, result.getVerb()); assertEquals("796250066", result.getActor().getId()); assertEqu...
[FOCAL] @Override public final Activity ComplianceActivityUnmarshaller.unmarshall(String s) [CLASS] class ComplianceActivityUnmarshaller implements Unmarshaller<Activity> [METRICS] loc=9 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] mapper.readValue(s, ComplianceActivity.class).toActivity/0, map...
/* static context [FOCAL] @Override public final Activity ComplianceActivityUnmarshaller.unmarshall(String s) [PATH1] try-body throws -> return null [PATH2] return mapper.readValue(s, ComplianceActivity.class).toActivity() [INPUTS] branches=- | result=s [COLLABORATORS] field mapper readValue/2 [EXCEPTIONS] catches fina...
/* static context [FOCAL] @Override public final Activity ComplianceActivityUnmarshaller.unmarshall(String s) [PATH1] try-body throws -> return null [PATH2] return mapper.readValue(s, ComplianceActivity.class).toActivity() [INPUTS] branches=- | result=s [COLLABORATORS] field mapper readValue/2 [EXCEPTIONS] catches fina...
true
ok
{"focal": {"class": "ComplianceActivityUnmarshaller", "name": "unmarshall", "signature": "Activity unmarshall(String s)", "start_line": 3, "modifiers": "@Override public final", "params": [{"name": "s", "type": "String"}], "return_type": "Activity"}, "class_info": {"name": "ComplianceActivityUnmarshaller", "kind": "cla...
1688262_32
class SafeCast { public static int toInt(Object o, int def) { if (!(o instanceof Integer)) { return def; } return (Integer) o; } public static long toLong(Object o, long def); public static byte toByte(Object o, byte def); public static float toFloat(Object o, float def); public static byte[] toByteAr...
assertTrue("Unable to process valid cast", SafeCast.toInt(new Integer(22), 7) == 22); assertTrue("Default did not work (wrong type)", SafeCast.toInt(new Long(22), 7) == 7); assertTrue("Default did not work (null)", SafeCast.toInt(null, 9) == 9); } }
[FOCAL] public static int SafeCast.toInt(Object o, int def) [CLASS] class SafeCast [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [PATH1] if(!(o instanceof Integer))=T -> return def [PATH2] if(!(o instanceof Integer))=F -> return (Integer) o [INPUTS] branches=o | result=def, o [DATAFLOW] def@param...
/* static context [FOCAL] public static int SafeCast.toInt(Object o, int def) [PATH1] if(!(o instanceof Integer))=T -> return def [PATH2] if(!(o instanceof Integer))=F -> return (Integer) o [INPUTS] branches=o | result=def, o */
/* static context [FOCAL] public static int SafeCast.toInt(Object o, int def) [PATH1] if(!(o instanceof Integer))=T -> return def [PATH2] if(!(o instanceof Integer))=F -> return (Integer) o [INPUTS] branches=o | result=def, o */ class SafeCast { public static int toInt(Object o, int def) { if (!(o instanceof Intege...
true
ok
{"focal": {"class": "SafeCast", "name": "toInt", "signature": "int toInt(Object o, int def)", "start_line": 3, "modifiers": "public static", "params": [{"name": "o", "type": "Object"}, {"name": "def", "type": "int"}], "return_type": "int"}, "class_info": {"name": "SafeCast", "kind": "class", "modifiers": "", "superclas...
1707059_12
class Enunciate implements Runnable { protected Graph<String, DefaultEdge> buildModuleGraph(Map<String, ? extends EnunciateModule> modules) { Graph<String, DefaultEdge> graph = new DefaultDirectedGraph<String, DefaultEdge>(DefaultEdge.class); for (String moduleName : modules.keySet()) { graph.addVertex...
final Map<String, TestModule> myModules = new HashMap<String, TestModule>(); List<String> moduleCallOrder = new ArrayList<String>(); myModules.put("a", new TestModule("a", moduleCallOrder)); myModules.put("b", new TestModule("b", moduleCallOrder)); myModules.put("c", new TestModule("c", moduleCallOr...
[FOCAL] protected Graph<String, DefaultEdge> Enunciate.buildModuleGraph(Map<String, ? extends EnunciateModule> modules) [CLASS] class Enunciate implements Runnable [METRICS] loc=56 cc=15 branches=7 loops=7 returns=1 throws=2 nesting=5 [CALLS-EXTERNAL] Map<String, ? extends EnunciateModule>.keySet/0, Graph<String, Defau...
/* static context [FOCAL] protected Graph<String, DefaultEdge> Enunciate.buildModuleGraph(Map<String, ? extends EnunciateModule> modules) [EXCEPTIONS] throws EnunciateException [FIELDS] read=apiRegistry */
/* static context [FOCAL] protected Graph<String, DefaultEdge> Enunciate.buildModuleGraph(Map<String, ? extends EnunciateModule> modules) [EXCEPTIONS] throws EnunciateException [FIELDS] read=apiRegistry */ class Enunciate implements Runnable { protected Graph<String, DefaultEdge> buildModuleGraph(Map<String, ? exten...
true
ok
{"focal": {"class": "Enunciate", "name": "buildModuleGraph", "signature": "Graph<String, DefaultEdge> buildModuleGraph(Map<String, ? extends EnunciateModule> modules)", "start_line": 3, "modifiers": "protected", "params": [{"name": "modules", "type": "Map<String, ? extends EnunciateModule>"}], "return_type": "Graph<Str...
1710792_5
class PythonJob { static BoxerUnboxer<?,? extends Writable> createOutputType(String type) { if ("text".equals(type)) { return new TextBoxerUnboxer(); } else if ("long".equals(type)) { return new LongBoxerUnboxer(); } else if ("double".equals(type)) { return new DoubleBoxerUnboxe...
assertTrue(PythonJob.createOutputType("json") instanceof JsonBoxerUnboxer); } }
[FOCAL] static BoxerUnboxer<?,? extends Writable> PythonJob.createOutputType(String type) [CLASS] class PythonJob [METRICS] loc=18 cc=6 branches=5 loops=0 returns=6 throws=0 nesting=5 [CALLS-EXTERNAL] "text".equals/1, "long".equals/1, "double".equals/1, "json".equals/1, "bytes".equals/1 [NEW] TextBoxerUnboxer, LongBoxe...
/* static context [FOCAL] static BoxerUnboxer<?,? extends Writable> PythonJob.createOutputType(String type) [PATH1] if("text".equals(type))=F -> if("long".equals(type))=F -> if("double".equals(type))=F -> if("json".equals(type))=F -> if("bytes".equals(type))=T -> return new BytesBoxerUnboxer() [PATH2] if("text".equals(...
/* static context [FOCAL] static BoxerUnboxer<?,? extends Writable> PythonJob.createOutputType(String type) [PATH1] if("text".equals(type))=F -> if("long".equals(type))=F -> if("double".equals(type))=F -> if("json".equals(type))=F -> if("bytes".equals(type))=T -> return new BytesBoxerUnboxer() [PATH2] if("text".equals(...
true
ok
{"focal": {"class": "PythonJob", "name": "createOutputType", "signature": "BoxerUnboxer<?,? extends Writable> createOutputType(String type)", "start_line": 3, "modifiers": "static", "params": [{"name": "type", "type": "String"}], "return_type": "BoxerUnboxer<?,? extends Writable>"}, "class_info": {"name": "PythonJob", ...
1711412_0
class SassCompilingFilter implements Filter { public void setCompiler(Compiler compiler) { this.compiler = compiler; } public void init(FilterConfig filterConfig); public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain); private void wa...
com.darrinholst.sass_java.Compiler compiler = mock(Compiler.class); filter.setCompiler(compiler); initFilter(); verify(compiler).compile(); } }
[FOCAL] public void SassCompilingFilter.setCompiler(Compiler compiler) [CLASS] class SassCompilingFilter implements Filter [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=compiler [STATE] compiler [DATAFLOW] compiler@param->L2 [CLASS-MEMBERS] void init(FilterConfig filterConfig); voi...
/* static context [FOCAL] public void SassCompilingFilter.setCompiler(Compiler compiler) [STATE] compiler [FIELDS] write=compiler */
/* static context [FOCAL] public void SassCompilingFilter.setCompiler(Compiler compiler) [STATE] compiler [FIELDS] write=compiler */ class SassCompilingFilter implements Filter { public void setCompiler(Compiler compiler) { this.compiler = compiler; } public void init(FilterConfig filterConfig); ...
true
ok
{"focal": {"class": "SassCompilingFilter", "name": "setCompiler", "signature": "void setCompiler(Compiler compiler)", "start_line": 3, "modifiers": "public", "params": [{"name": "compiler", "type": "Compiler"}], "return_type": "void"}, "class_info": {"name": "SassCompilingFilter", "kind": "class", "modifiers": "", "sup...
1711467_210
class TableProcessor extends AbstractEntityFieldProcessor { @Override public void process(Class clazz, EntityMetadata metadata) { if (LOG.isDebugEnabled()) LOG.debug("Processing @Entity(" + clazz.getName() + ") for Persistence Object."); populateMetadata(metadata, clazz, puProp...
final String persistenceUnit = "rdbms"; EntityMetadata metadata; PersistenceUnitMetadata puMetadata = new PersistenceUnitMetadata(); puMetadata.setPersistenceUnitName(persistenceUnit); Map<String, Object> props = new HashMap<String, Object>(); props.put(Constants.PERSI...
[FOCAL] @Override public void TableProcessor.process(Class clazz, EntityMetadata metadata) [CLASS] class TableProcessor extends AbstractEntityFieldProcessor [METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void populateMetadata(EntityMetadata metadata, Class<X> clazz, Map puProperti...
/* static context [FOCAL] @Override public void TableProcessor.process(Class clazz, EntityMetadata metadata) [PATH1] if(LOG.isDebugEnabled())=T [PATH2] if(LOG.isDebugEnabled())=F [COLLABORATORS] param clazz:Class getName/0 [CALLS-INTERNAL] void populateMetadata(EntityMetadata metadata, Class<X> clazz, Map puProperties)...
/* static context [FOCAL] @Override public void TableProcessor.process(Class clazz, EntityMetadata metadata) [PATH1] if(LOG.isDebugEnabled())=T [PATH2] if(LOG.isDebugEnabled())=F [COLLABORATORS] param clazz:Class getName/0 [CALLS-INTERNAL] void populateMetadata(EntityMetadata metadata, Class<X> clazz, Map puProperties)...
true
ok
{"focal": {"class": "TableProcessor", "name": "process", "signature": "void process(Class clazz, EntityMetadata metadata)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "clazz", "type": "Class"}, {"name": "metadata", "type": "EntityMetadata"}], "return_type": "void"}, "class_info": {"name": "Ta...
1720284_21
class StatusesServiceImpl implements StatusesService { @Override public List<Status> getStatus(Repository repository, String sha1) { if (repository == null) { throw new NullPointerException("Repository can't be null"); } if (sha1 == null) { throw new NullPointerException("SHA1 can't be null"); } log...
assertThat(service.getStatus(test, "ac61d48e3020f61c4d7a19709494f37065c87d34")).containsExactly(Status.NEW); } }
[FOCAL] @Override public List<Status> StatusesServiceImpl.getStatus(Repository repository, String sha1) [CLASS] class StatusesServiceImpl implements StatusesService [METRICS] loc=37 cc=9 branches=5 loops=1 returns=2 throws=2 nesting=2 [CALLS-INTERNAL] State getState(String sha1); boolean containsCommit(Repository repos...
/* static context [FOCAL] @Override public List<Status> StatusesServiceImpl.getStatus(Repository repository, String sha1) [THROWS-WHEN] NullPointerException when repository == null [THROWS-WHEN] NullPointerException when !(repository == null) && sha1 == null [PATH1] if(repository == null)=F -> if(sha1 == null)=F -> if(...
/* static context [FOCAL] @Override public List<Status> StatusesServiceImpl.getStatus(Repository repository, String sha1) [THROWS-WHEN] NullPointerException when repository == null [THROWS-WHEN] NullPointerException when !(repository == null) && sha1 == null [PATH1] if(repository == null)=F -> if(sha1 == null)=F -> if(...
true
ok
{"focal": {"class": "StatusesServiceImpl", "name": "getStatus", "signature": "List<Status> getStatus(Repository repository, String sha1)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "repository", "type": "Repository"}, {"name": "sha1", "type": "String"}], "return_type": "List<Status>"}, "clas...
1724015_6
class MavenUtil { static String artifactToMvn(Artifact artifact) { return artifactToMvn(RepositoryUtils.toArtifact(artifact)); } static String mvnToAether(String name); private static boolean present(String part); static String aetherToMvn(String name); static String pathFromMaven(Stri...
assertEquals("mvn:org.foo/org.foo.bar/1.0-SNAPSHOT", artifactToMvn(new DefaultArtifact("org.foo:org.foo.bar:1.0-SNAPSHOT"))); assertEquals("mvn:org.foo/org.foo.bar/1.0-SNAPSHOT/kar", artifactToMvn(new DefaultArtifact("org.foo:org.foo.bar:kar:1.0-SNAPSHOT"))); assertEquals("mvn:org.foo/org.foo.ba...
[FOCAL] static String MavenUtil.artifactToMvn(Artifact artifact) [CLASS] class MavenUtil [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String artifactToMvn(org.sonatype.aether.artifact.Artifact artifact) [CALLS-EXTERNAL] RepositoryUtils.toArtifact/1 [INPUTS] branches=- | result=a...
/* static context [FOCAL] static String MavenUtil.artifactToMvn(Artifact artifact) [INPUTS] branches=- | result=artifact [CALLS-INTERNAL] String artifactToMvn(org.sonatype.aether.artifact.Artifact artifact) [CALLS-EXTERNAL] RepositoryUtils.toArtifact/1 */
/* static context [FOCAL] static String MavenUtil.artifactToMvn(Artifact artifact) [INPUTS] branches=- | result=artifact [CALLS-INTERNAL] String artifactToMvn(org.sonatype.aether.artifact.Artifact artifact) [CALLS-EXTERNAL] RepositoryUtils.toArtifact/1 */ class MavenUtil { static String artifactToMvn(Artifact arti...
true
ok
{"focal": {"class": "MavenUtil", "name": "artifactToMvn", "signature": "String artifactToMvn(Artifact artifact)", "start_line": 3, "modifiers": "static", "params": [{"name": "artifact", "type": "Artifact"}], "return_type": "String"}, "class_info": {"name": "MavenUtil", "kind": "class", "modifiers": "", "superclass": nu...
1742658_4
class TextAreaItem extends FormItem<String> { @Override public void resetMetaData() { super.resetMetaData(); textArea.setValue(null); } public TextAreaItem(String name, String title); public TextAreaItem(String name, String title, boolean required); private void setup(); ...
TextAreaItem tai = new TextAreaItem("a", "b"); Assert.assertFalse("Precondition", tai.isModified()); ValueChangeEvent<String> event = new ValueChangeEvent<String>("Some value") {}; tai.valueChangeHandler.onValueChange(event); Assert.assertTrue(tai.isModified()); tai.reset...
[FOCAL] @Override public void TextAreaItem.resetMetaData() [CLASS] class TextAreaItem extends FormItem<String> [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] FormItem<String>.resetMetaData/0, textArea.setValue/1 [COLLABORATORS] field textArea setValue/1 [CLASS-MEMBERS] TextAreaIte...
/* static context [FOCAL] @Override public void TextAreaItem.resetMetaData() [COLLABORATORS] field textArea setValue/1 [CALLS-EXTERNAL] FormItem<String>.resetMetaData/0, textArea.setValue/1 */
/* static context [FOCAL] @Override public void TextAreaItem.resetMetaData() [COLLABORATORS] field textArea setValue/1 [CALLS-EXTERNAL] FormItem<String>.resetMetaData/0, textArea.setValue/1 */ class TextAreaItem extends FormItem<String> { @Override public void resetMetaData() { super.resetMetaData(); ...
true
ok
{"focal": {"class": "TextAreaItem", "name": "resetMetaData", "signature": "void resetMetaData()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "TextAreaItem", "kind": "class", "modifiers": "", "superclass": "FormItem<String>", "interfaces": null, "fields...
1743723_2
class ScriptingServiceImpl extends AbstractService implements ScriptingService { @Override public synchronized List<ScriptContext> load(File scriptDescriptor) throws Exception { Preconditions.checkNotNull(scriptDescriptor, "scriptDescriptor"); final JAXBContext c = JAXBContext.newInstance(ScriptInfo.class, ...
final List<ScriptContext> contexts = service.load(new File( "src/test/resources/scripting/testcase.xml")); Assert.assertEquals(1, contexts.size()); final ScriptContext context = contexts.get(0); Class<?> clazz = context.getClassLoader().loadClass( "test.ScriptingCompilerTest"); Assert.assertNotNull(cl...
[FOCAL] @Override public synchronized List<ScriptContext> ScriptingServiceImpl.load(File scriptDescriptor) [CLASS] class ScriptingServiceImpl extends AbstractService implements ScriptingService [METRICS] loc=21 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] ScriptContext createContext(ScriptInfo ...
/* static context [FOCAL] @Override public synchronized List<ScriptContext> ScriptingServiceImpl.load(File scriptDescriptor) [PATH1] foreach(ScriptInfo si : list.getScriptInfos())=T -> if(context != null)=T -> exit loop -> return contexts [PATH2] foreach(ScriptInfo si : list.getScriptInfos())=F -> return contexts [PATH...
/* static context [FOCAL] @Override public synchronized List<ScriptContext> ScriptingServiceImpl.load(File scriptDescriptor) [PATH1] foreach(ScriptInfo si : list.getScriptInfos())=T -> if(context != null)=T -> exit loop -> return contexts [PATH2] foreach(ScriptInfo si : list.getScriptInfos())=F -> return contexts [PATH...
true
ok
{"focal": {"class": "ScriptingServiceImpl", "name": "load", "signature": "List<ScriptContext> load(File scriptDescriptor) throws Exception", "start_line": 4, "modifiers": "@Override public synchronized", "params": [{"name": "scriptDescriptor", "type": "File"}], "return_type": "List<ScriptContext>"}, "class_info": {"nam...
1757703_8
class Utils { public static <T> List<T> moveValuesToIndex(List<? extends T> values, List<? extends T> moveValues, int index, boolean allowAdd) { int size = values.size(); if (index > size) { throw new ArrayIndexOutOfBoundsException("Index: " + index + ", Size: " + values.size()); ...
List<String> values = Arrays.asList("1", "2", "3", "4"); List<String> moveValues = Arrays.asList("1", "2"); List<String> expected = Arrays.asList("3", "1", "2", "4"); boolean allowAdd = false; assertEquals(expected, Utils.moveValuesToIndex(values, moveValues, 3, allowAdd...
[FOCAL] public static List<T> Utils.moveValuesToIndex(List<? extends T> values, List<? extends T> moveValues, int index, boolean allowAdd) [CLASS] class Utils [METRICS] loc=40 cc=8 branches=5 loops=2 returns=2 throws=2 nesting=3 [CALLS-EXTERNAL] List<? extends T>.size/0, List<? extends T>.isEmpty/0, List<T>.indexOf/1, ...
/* static context [FOCAL] public static List<T> Utils.moveValuesToIndex(List<? extends T> values, List<? extends T> moveValues, int index, boolean allowAdd) [THROWS-WHEN] ArrayIndexOutOfBoundsException when index > size [THROWS-WHEN] RuntimeException when !(index > size) && !moveValues.isEmpty() && foreach(T moveValue ...
/* static context [FOCAL] public static List<T> Utils.moveValuesToIndex(List<? extends T> values, List<? extends T> moveValues, int index, boolean allowAdd) [THROWS-WHEN] ArrayIndexOutOfBoundsException when index > size [THROWS-WHEN] RuntimeException when !(index > size) && !moveValues.isEmpty() && foreach(T moveValue ...
true
ok
{"focal": {"class": "Utils", "name": "moveValuesToIndex", "signature": "List<T> moveValuesToIndex(List<? extends T> values, List<? extends T> moveValues, int index, boolean allowAdd)", "start_line": 3, "modifiers": "public static", "params": [{"name": "values", "type": "List<? extends T>"}, {"name": "moveValues", "type...
1767164_19
class ValidationController { @RequestMapping(value = "{canonicalClassName:.+}", method = RequestMethod.GET) public ModelConstraint getConstraintsForClassName(@PathVariable String canonicalClassName, @RequestParam(required = false) String locale) { Locale loc = null; try { if (loca...
this.validationController.getConstraintsForClassName("knownClassName", "fr"); verify(this.validationService).getConstraintsForClassName(eq("knownClassName"), any(Locale.class)); } }
[FOCAL] @RequestMapping(value = "{canonicalClassName:.+}", method = RequestMethod.GET) public ModelConstraint ValidationController.getConstraintsForClassName(String canonicalClassName, String locale) [CLASS] class ValidationController [METRICS] loc=14 cc=3 branches=1 loops=0 returns=1 throws=1 nesting=2 [CALLS-INTERNAL...
/* static context [FOCAL] @RequestMapping(value = "{canonicalClassName:.+}", method = RequestMethod.GET) public ModelConstraint ValidationController.getConstraintsForClassName(String canonicalClassName, String locale) [THROWS-WHEN] NotFoundException when try-body throws [PATH1] try-body throws -> throw new NotFoundExce...
/* static context [FOCAL] @RequestMapping(value = "{canonicalClassName:.+}", method = RequestMethod.GET) public ModelConstraint ValidationController.getConstraintsForClassName(String canonicalClassName, String locale) [THROWS-WHEN] NotFoundException when try-body throws [PATH1] try-body throws -> throw new NotFoundExce...
true
ok
{"focal": {"class": "ValidationController", "name": "getConstraintsForClassName", "signature": "ModelConstraint getConstraintsForClassName(String canonicalClassName, String locale)", "start_line": 3, "modifiers": "@RequestMapping(value = \"{canonicalClassName:.+}\", method = RequestMethod.GET) public", "params": [{"nam...
1767458_8
class TripItTemplate extends AbstractOAuth1ApiBinding implements TripIt { public List<Trip> getUpcomingTrips() { return getRestTemplate().getForObject("https://api.tripit.com/v1/list/trip/traveler/true/past/false?format=json", TripList.class).getList(); } public TripItTemplate(String consumerKey, String consume...
mockServer.expect(requestTo("https://api.tripit.com/v1/list/trip/traveler/true/past/false?format=json")) .andExpect(method(GET)) .andRespond(withSuccess(new ClassPathResource("no-trips.json", getClass()), MediaType.APPLICATION_JSON)); List<Trip> trips = tripIt.getUpcomingTrips(); assertNotNull(trips); a...
[FOCAL] public List<Trip> TripItTemplate.getUpcomingTrips() [CLASS] class TripItTemplate extends AbstractOAuth1ApiBinding implements TripIt [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] getRestTemplate().getForObject("https://api.tripit.com/v1....getList/0, getRestTemplate().getF...
/* static context [FOCAL] public List<Trip> TripItTemplate.getUpcomingTrips() [CALLS-EXTERNAL] getRestTemplate().getForObject("https://api.tripit.com/v1....getList/0, getRestTemplate().getForObject/2, getRestTemplate/0 (inherited) */
/* static context [FOCAL] public List<Trip> TripItTemplate.getUpcomingTrips() [CALLS-EXTERNAL] getRestTemplate().getForObject("https://api.tripit.com/v1....getList/0, getRestTemplate().getForObject/2, getRestTemplate/0 (inherited) */ class TripItTemplate extends AbstractOAuth1ApiBinding implements TripIt { public Lis...
true
ok
{"focal": {"class": "TripItTemplate", "name": "getUpcomingTrips", "signature": "List<Trip> getUpcomingTrips()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Trip>"}, "class_info": {"name": "TripItTemplate", "kind": "class", "modifiers": "", "superclass": "AbstractOAuth1ApiBinding", "interf...
1767567_18
class JavaSourceParser { public static Map<String, String[]> methodToParamNamesMap( String javaSrcFile, Class<?> clazz) { Map<String, String[]> map = new HashMap<String, String[]>(); try { JavaDocBuilder builder = new JavaDocBuilder(); builder.addSource(new File(javaSrcFile)); JavaClass jc = buil...
Class<?> clazz = JavaSourceSample.class; String javaSrcFile = getTestSourcePath(clazz); Map<String, String[]> map = JavaSourceParser.methodToParamNamesMap(javaSrcFile, clazz); Assert.assertNotNull("Map should not be null", map); dump(map); Assert.assertTrue("Should have found 'dosomething' method", ma...
[FOCAL] public static Map<String, String[]> JavaSourceParser.methodToParamNamesMap(String javaSrcFile, Class<?> clazz) [CLASS] class JavaSourceParser [METRICS] loc=26 cc=4 branches=1 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] String[] getParameterNames(JavaMethod method) [CALLS-EXTERNAL] JavaDocBuilder.addSo...
/* static context [FOCAL] public static Map<String, String[]> JavaSourceParser.methodToParamNamesMap(String javaSrcFile, Class<?> clazz) [PATH1] foreach(JavaMethod method : methods)=T -> if(method.isPublic() && !method.isStatic())=T -> exit loop -> return map [PATH2] try-body throws -> return map [PATH3] foreach(JavaMe...
/* static context [FOCAL] public static Map<String, String[]> JavaSourceParser.methodToParamNamesMap(String javaSrcFile, Class<?> clazz) [PATH1] foreach(JavaMethod method : methods)=T -> if(method.isPublic() && !method.isStatic())=T -> exit loop -> return map [PATH2] try-body throws -> return map [PATH3] foreach(JavaMe...
true
ok
{"focal": {"class": "JavaSourceParser", "name": "methodToParamNamesMap", "signature": "Map<String, String[]> methodToParamNamesMap(String javaSrcFile, Class<?> clazz)", "start_line": 3, "modifiers": "public static", "params": [{"name": "javaSrcFile", "type": "String"}, {"name": "clazz", "type": "Class<?>"}], "return_ty...
1768217_49
class TimelineTemplate extends AbstractTwitterOperations implements TimelineOperations { public List<Tweet> getUserTimeline() { return getUserTimeline(20, 0, 0); } public TimelineTemplate(RestTemplate restTemplate, boolean isAuthorizedForUser, boolean isAuthorizedForApp); public List<Tweet> getHomeTimeline();...
mockServer.expect(requestTo("https://api.twitter.com/1.1/statuses/user_timeline.json?count=15&user_id=2&include_entities=true")) .andExpect(method(GET)) .andRespond(withSuccess(jsonResource("timeline"), APPLICATION_JSON)); List<Tweet> timeline = twitter.timelineOperations().getUserTimeline(2, 15); assertT...
[FOCAL] public List<Tweet> TimelineTemplate.getUserTimeline() [CLASS] class TimelineTemplate extends AbstractTwitterOperations implements TimelineOperations [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] List<Tweet> getUserTimeline(int pageSize, long sinceId, long maxId) [CLASS-ME...
/* static context [FOCAL] public List<Tweet> TimelineTemplate.getUserTimeline() [CALLS-INTERNAL] List<Tweet> getUserTimeline(int pageSize, long sinceId, long maxId) */
/* static context [FOCAL] public List<Tweet> TimelineTemplate.getUserTimeline() [CALLS-INTERNAL] List<Tweet> getUserTimeline(int pageSize, long sinceId, long maxId) */ class TimelineTemplate extends AbstractTwitterOperations implements TimelineOperations { public List<Tweet> getUserTimeline() { return getUserTimeli...
true
ok
{"focal": {"class": "TimelineTemplate", "name": "getUserTimeline", "signature": "List<Tweet> getUserTimeline()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Tweet>"}, "class_info": {"name": "TimelineTemplate", "kind": "class", "modifiers": "", "superclass": "AbstractTwitterOperations", "i...
1768307_34
class Sql2o { @Deprecated public Query createQuery(String query, boolean returnGeneratedKeys) { return new Connection(this, true).createQuery(query, returnGeneratedKeys); } public Sql2o(String jndiLookup); public Sql2o(String url, String user, String pass); public Sql2o(String url, ...
createAndFillUserTable(); ResultSetIterable<User> allUsers = sql2o.createQuery("select * from User").executeAndFetchLazy(User.class); Iterator<User> usersIterator = allUsers.iterator(); // call hasNext a few times, should have no effect usersIterator.hasNext(); usersIt...
[FOCAL] @Deprecated public Query Sql2o.createQuery(String query, boolean returnGeneratedKeys) [CLASS] class Sql2o [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] new Connection(this, true).createQuery/2 [NEW] Connection [INPUTS] branches=- | result=query, returnGeneratedKeys [DATAF...
/* static context [FOCAL] @Deprecated public Query Sql2o.createQuery(String query, boolean returnGeneratedKeys) [INPUTS] branches=- | result=query, returnGeneratedKeys [NEW] Connection [CALLS-EXTERNAL] new Connection(this, true).createQuery/2 */
/* static context [FOCAL] @Deprecated public Query Sql2o.createQuery(String query, boolean returnGeneratedKeys) [INPUTS] branches=- | result=query, returnGeneratedKeys [NEW] Connection [CALLS-EXTERNAL] new Connection(this, true).createQuery/2 */ class Sql2o { @Deprecated public Query createQuery(String query, ...
true
ok
{"focal": {"class": "Sql2o", "name": "createQuery", "signature": "Query createQuery(String query, boolean returnGeneratedKeys)", "start_line": 3, "modifiers": "@Deprecated public", "params": [{"name": "query", "type": "String"}, {"name": "returnGeneratedKeys", "type": "boolean"}], "return_type": "Query"}, "class_info":...
1768380_12
class FacebookAdapter implements ApiAdapter<Facebook> { public void setConnectionValues(Facebook facebook, ConnectionValues values) { User profile = facebook.fetchObject("me", User.class, "id", "name", "link"); values.setProviderUserId(profile.getId()); values.setDisplayName(profile.getName()); values.setProf...
User user = new User("12345678", "Craig Walls", "Craig", "Walls", null, null); Field linkField = user.getClass().getDeclaredField("link"); linkField.setAccessible(true); linkField.set(user, "https://www.facebook.com/975041837"); Mockito.when(facebook.fetchObject("me", User.class, "id", "name", "link")).thenRe...
[FOCAL] public void FacebookAdapter.setConnectionValues(Facebook facebook, ConnectionValues values) [CLASS] class FacebookAdapter implements ApiAdapter<Facebook> [METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] Facebook.fetchObject/5, ConnectionValues.setProviderUserId/1, User.getId...
/* static context [FOCAL] public void FacebookAdapter.setConnectionValues(Facebook facebook, ConnectionValues values) [COLLABORATORS] param facebook:Facebook fetchObject/5,getBaseGraphApiUrl/0; param values:ConnectionValues setProviderUserId/1,setDisplayName/1,setProfileUrl/1,setImageUrl/1 [CALLS-EXTERNAL] Facebook.fet...
/* static context [FOCAL] public void FacebookAdapter.setConnectionValues(Facebook facebook, ConnectionValues values) [COLLABORATORS] param facebook:Facebook fetchObject/5,getBaseGraphApiUrl/0; param values:ConnectionValues setProviderUserId/1,setDisplayName/1,setProfileUrl/1,setImageUrl/1 [CALLS-EXTERNAL] Facebook.fet...
true
ok
{"focal": {"class": "FacebookAdapter", "name": "setConnectionValues", "signature": "void setConnectionValues(Facebook facebook, ConnectionValues values)", "start_line": 3, "modifiers": "public", "params": [{"name": "facebook", "type": "Facebook"}, {"name": "values", "type": "ConnectionValues"}], "return_type": "void"},...
1772628_1
class BusinessSLA { public BusinessServiceLevel computeServiceLevel(long responseTime,Date timeStamp){ //assume that the service is at it best shape BusinessServiceLevel sl=BusinessServiceLevel.GOLD; //check if its gold if(goldPeriod.inPeriod(timeStamp)&&responseTime>maxGold){ //it s not so its silver ...
BusinessSLA sla= new BusinessSLA(70, 80, 85, new HoursPeriod(0, 1440), new HoursPeriod(420, 1320), new HoursPeriod(600, 1080), "smarttravel.com", "meteo_service","slaName"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd_HH:mm"); int responseTime=84; Date timeStamp=format.parse("2012-08-21_1...
[FOCAL] public BusinessServiceLevel BusinessSLA.computeServiceLevel(long responseTime, Date timeStamp) [CLASS] class BusinessSLA [METRICS] loc=22 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] goldPeriod.inPeriod/1, silverPeriod.inPeriod/1, bronzePeriod.inPeriod/1 [PATH1] if(goldPeriod.inPeriod(t...
/* static context [FOCAL] public BusinessServiceLevel BusinessSLA.computeServiceLevel(long responseTime, Date timeStamp) [PATH1] if(goldPeriod.inPeriod(timeStamp)&&responseTime>maxGold)=T -> if(silverPeriod.inPeriod(timeStamp)&&responseTime>maxSilver)=T -> if(bronzePeriod.inPeriod(timeStamp)&&responseTime>maxBronze)=T ...
/* static context [FOCAL] public BusinessServiceLevel BusinessSLA.computeServiceLevel(long responseTime, Date timeStamp) [PATH1] if(goldPeriod.inPeriod(timeStamp)&&responseTime>maxGold)=T -> if(silverPeriod.inPeriod(timeStamp)&&responseTime>maxSilver)=T -> if(bronzePeriod.inPeriod(timeStamp)&&responseTime>maxBronze)=T ...
true
ok
{"focal": {"class": "BusinessSLA", "name": "computeServiceLevel", "signature": "BusinessServiceLevel computeServiceLevel(long responseTime, Date timeStamp)", "start_line": 3, "modifiers": "public", "params": [{"name": "responseTime", "type": "long"}, {"name": "timeStamp", "type": "Date"}], "return_type": "BusinessServi...
1772983_15
class RateLimiterUtils extends CounterAbstractPolicy { public Boolean getFinalresult(String val) throws Exception { List<String> expression = simplifyExpression(val, new LinkedList<String>()); int cnt = 0; Boolean lastoutput = null; String lastlogicalOperation = null; for (String a : expression) { if...
Boolean flag; flag = limiterUtils.getFinalresult("1>2&&3>6"); assertEquals("\"1>2||3>6\" should be false", false, flag); flag = limiterUtils.getFinalresult(" 1 > 3 && 4 > 6 && 5 >7 "); assertEquals("\" 1 > 3 || 4 > 6 || 5 >7 \" should be false", false, flag); flag = limiterUtils.getFinalresul...
[FOCAL] public Boolean RateLimiterUtils.getFinalresult(String val) [CLASS] class RateLimiterUtils extends CounterAbstractPolicy [METRICS] loc=61 cc=13 branches=11 loops=1 returns=1 throws=0 nesting=8 [CALLS-INTERNAL] Boolean proccesOperation(boolean lastoutput, boolean current, String lastlogicalOperation); List<String...
/* static context [FOCAL] public Boolean RateLimiterUtils.getFinalresult(String val) [PATH1] foreach(String a : expression)=T -> if(a != null)=T -> if("true".equalsIgnoreCase(a))=F -> if("false".equalsIgnoreCase(a))=F -> if(("||").equalsIgnoreCase(a))=F -> if(("&&").equalsIgnoreCase(a))=T -> if(cnt == 0)#4=F -> if(last...
/* static context [FOCAL] public Boolean RateLimiterUtils.getFinalresult(String val) [PATH1] foreach(String a : expression)=T -> if(a != null)=T -> if("true".equalsIgnoreCase(a))=F -> if("false".equalsIgnoreCase(a))=F -> if(("||").equalsIgnoreCase(a))=F -> if(("&&").equalsIgnoreCase(a))=T -> if(cnt == 0)#4=F -> if(last...
true
ok
{"focal": {"class": "RateLimiterUtils", "name": "getFinalresult", "signature": "Boolean getFinalresult(String val) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "val", "type": "String"}], "return_type": "Boolean"}, "class_info": {"name": "RateLimiterUtils", "kind": "class", "modifiers":...
1783046_2
class KubernetesDiscoveryService implements DiscoveryService { @Override public Set<String> discoverMembers() { LOGGER.debug("CELLAR KUBERNETES: query pods with labeled with [{}={}]", kubernetesPodLabelKey, kubernetesPodLabelValue); Set<String> members = new HashSet<String>(); try { ...
reset(kubernetesClient); expect(kubernetesClient.pods()).andThrow(new RuntimeException("Test exception")); replay(kubernetesClient); // Should return empty set because exception was caught and logged assertTrue(service.discoverMembers().isEmpty()); } }
[FOCAL] @Override public Set<String> KubernetesDiscoveryService.discoverMembers() [CLASS] class KubernetesDiscoveryService implements DiscoveryService [METRICS] loc=17 cc=4 branches=1 loops=1 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] LOGGER.debug/3, kubernetesClient.pods().list/0, KubernetesClient.pods/0, PodList.g...
class KubernetesDiscoveryService implements DiscoveryService { @Override public Set<String> discoverMembers() { LOGGER.debug("CELLAR KUBERNETES: query pods with labeled with [{}={}]", kubernetesPodLabelKey, kubernetesPodLabelValue); Set<String> members = new HashSet<String>(); try { ...
false
ok
{"focal": {"class": "KubernetesDiscoveryService", "name": "discoverMembers", "signature": "Set<String> discoverMembers()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Set<String>"}, "class_info": {"name": "KubernetesDiscoveryService", "kind": "class", "modifiers": "", "superclass": n...
1783083_0
class HtmlDimensions { public static String formatSize(String size) { if (size != null) { String incomingSize = size.trim(); if (incomingSize.length() > 0) { char lastChar = incomingSize.charAt(incomingSize.length() - 1); if (Character.isDigit(lastCha...
assertEquals("100px", HtmlDimensions.formatSize("100")); assertEquals("100px", HtmlDimensions.formatSize("100 ")); assertEquals("100px", HtmlDimensions.formatSize(" 100")); assertEquals("100px", HtmlDimensions.formatSize(" 100 ")); assertEquals("t100px", HtmlDimensions.for...
[FOCAL] public static String HtmlDimensions.formatSize(String size) [CLASS] class HtmlDimensions [METRICS] loc=12 cc=4 branches=3 loops=0 returns=2 throws=0 nesting=3 [CALLS-EXTERNAL] String.trim/0, String.length/0, String.charAt/1, Character.isDigit/1 [PATH1] if(size != null)=T -> if(incomingSize.length() > 0)=T -> if...
/* static context [FOCAL] public static String HtmlDimensions.formatSize(String size) [PATH1] if(size != null)=T -> if(incomingSize.length() > 0)=T -> if(Character.isDigit(lastChar))=T -> return incomingSize + "px" [PATH2] if(size != null)=F -> return size [PATH3] if(size != null)=T -> if(incomingSize.length() > 0)=F -...
/* static context [FOCAL] public static String HtmlDimensions.formatSize(String size) [PATH1] if(size != null)=T -> if(incomingSize.length() > 0)=T -> if(Character.isDigit(lastChar))=T -> return incomingSize + "px" [PATH2] if(size != null)=F -> return size [PATH3] if(size != null)=T -> if(incomingSize.length() > 0)=F -...
true
ok
{"focal": {"class": "HtmlDimensions", "name": "formatSize", "signature": "String formatSize(String size)", "start_line": 3, "modifiers": "public static", "params": [{"name": "size", "type": "String"}], "return_type": "String"}, "class_info": {"name": "HtmlDimensions", "kind": "class", "modifiers": "", "superclass": nul...
1784501_0
class ColumnType { @Override public boolean equals(Object t) { if (t == null || getClass() != t.getClass()) { return false; } else { ColumnType other = (ColumnType) t; return m_type == other.getType() && Objects.equals(m_typeCode, other.getTypeCode()); } } public ColumnType(fina...
ColumnType typeBool = new ColumnType(-7, "bool"); ColumnType typeBoolean = new ColumnType(16, "boolean"); ColumnType typeBool2 = new ColumnType(-7, "bool"); assertEquals("Expected bool types are equal", typeBool, typeBool2); assertNotSame("Expected bool and boolean are not equal", typeBool, typeB...
[FOCAL] @Override public boolean ColumnType.equals(Object t) [CLASS] class ColumnType [METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] getClass/0 (inherited), Object.getClass/0, ColumnType.getType/0, Objects.equals/2, ColumnType.getTypeCode/0 [PATH1] if(t == null || getClass() != t....
/* static context [FOCAL] @Override public boolean ColumnType.equals(Object t) [PATH1] if(t == null || getClass() != t.getClass())=T -> return false [PATH2] if(t == null || getClass() != t.getClass())=F -> return m_type == other.getType() && Objects.equals(m_typeCode, other.getTy... [INPUTS] branches=t | result=t [CALL...
/* static context [FOCAL] @Override public boolean ColumnType.equals(Object t) [PATH1] if(t == null || getClass() != t.getClass())=T -> return false [PATH2] if(t == null || getClass() != t.getClass())=F -> return m_type == other.getType() && Objects.equals(m_typeCode, other.getTy... [INPUTS] branches=t | result=t [CALL...
true
ok
{"focal": {"class": "ColumnType", "name": "equals", "signature": "boolean equals(Object t)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "t", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "ColumnType", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ...
1795594_16
class BucketNameValidatorRepo { public static Validator<String> getBucketNameValidator(final String restrictionValue) { if (restrictionValue != null && "extended".equalsIgnoreCase(restrictionValue)) { return extendedValidator; } else if (restrictionValue != null && "dns-compliant".equalsIgnoreCase(rest...
String restriction = "extended"; String largeName = String.format("%0" + 10 + "d", 0).replace("0", "abcdefghij"); assertTrue("expected that a " + largeName.length() + "-character name would be okay", BucketNameValidatorRepo.getBucketNameValidator(restriction) .check(largeName)); largeName = Stri...
[FOCAL] public static Validator<String> BucketNameValidatorRepo.getBucketNameValidator(String restrictionValue) [CLASS] class BucketNameValidatorRepo [METRICS] loc=19 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=3 [CALLS-EXTERNAL] "extended".equalsIgnoreCase/1, "dns-compliant".equalsIgnoreCase/1, LOG.error/1, val...
/* static context [FOCAL] public static Validator<String> BucketNameValidatorRepo.getBucketNameValidator(String restrictionValue) [PATH1] if(restrictionValue != null && "extended".equalsIgnoreCase(restrictionValue))=F -> if(restrictionValue != null && "dns-compliant".equalsIgnoreCase(restrictionValue))=T -> return dnsC...
/* static context [FOCAL] public static Validator<String> BucketNameValidatorRepo.getBucketNameValidator(String restrictionValue) [PATH1] if(restrictionValue != null && "extended".equalsIgnoreCase(restrictionValue))=F -> if(restrictionValue != null && "dns-compliant".equalsIgnoreCase(restrictionValue))=T -> return dnsC...
true
ok
{"focal": {"class": "BucketNameValidatorRepo", "name": "getBucketNameValidator", "signature": "Validator<String> getBucketNameValidator(String restrictionValue)", "start_line": 3, "modifiers": "public static", "params": [{"name": "restrictionValue", "type": "String"}], "return_type": "Validator<String>"}, "class_info":...
1797376_538
class XYSeries extends Series implements Cloneable, Serializable { public void updateByIndex(int index, Number y) { XYDataItem item = getRawDataItem(index); // figure out if we need to iterate through all the y-values boolean iterate = false; double oldY = item.getYValue(); ...
XYSeries s1 = new XYSeries("S1"); s1.add(1.0, 1.1); s1.add(2.0, 2.2); s1.add(3.0, 3.3); assertEquals(1.1, s1.getMinY(), EPSILON); assertEquals(3.3, s1.getMaxY(), EPSILON); s1.updateByIndex(0, -5.0); assertEquals(-5.0, s1.getMinY(), EPSILON); asse...
[FOCAL] public void XYSeries.updateByIndex(int index, Number y) [CLASS] class XYSeries extends Series implements Cloneable, Serializable [METRICS] loc=20 cc=4 branches=3 loops=0 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] XYDataItem getRawDataItem(int index); double maxIgnoreNaN(double a, double b); double minIgnoreN...
/* static context [FOCAL] public void XYSeries.updateByIndex(int index, Number y) [PATH1] if(!Double.isNaN(oldY))=T -> if(iterate)=F -> if(y != null)=T [PATH2] if(!Double.isNaN(oldY))=F -> if(iterate)=T [PATH3] if(!Double.isNaN(oldY))=T -> if(iterate)=F -> if(y != null)=F [INPUTS] branches=index, y | result=- [COLLABOR...
/* static context [FOCAL] public void XYSeries.updateByIndex(int index, Number y) [PATH1] if(!Double.isNaN(oldY))=T -> if(iterate)=F -> if(y != null)=T [PATH2] if(!Double.isNaN(oldY))=F -> if(iterate)=T [PATH3] if(!Double.isNaN(oldY))=T -> if(iterate)=F -> if(y != null)=F [INPUTS] branches=index, y | result=- [COLLABOR...
true
ok
{"focal": {"class": "XYSeries", "name": "updateByIndex", "signature": "void updateByIndex(int index, Number y)", "start_line": 3, "modifiers": "public", "params": [{"name": "index", "type": "int"}, {"name": "y", "type": "Number"}], "return_type": "void"}, "class_info": {"name": "XYSeries", "kind": "class", "modifiers":...
1810705_22
class SiteSwitcherRequestFilter extends OncePerRequestFilter { public String getServerName() { return serverName; } public SiteSwitcherRequestFilter(); public SiteSwitcherRequestFilter(SiteUrlFactory normalSiteUrlFactory, SiteUrlFactory mobileSiteUrlFactory, SiteUrlFactory tabletSiteUrlFactory, SitePrefere...
device.setDeviceType(DeviceType.MOBILE); SiteSwitcherRequestFilter urlPath = new SiteSwitcherRequestFilter(); MockFilterConfig filterConfig = new MockFilterConfig(); filterConfig.addInitParameter("switcherMode", "urlPath"); filterConfig.addInitParameter("mobilePath", "/mob"); filterConfig.addInitParameter("...
[FOCAL] public String SiteSwitcherRequestFilter.getServerName() [CLASS] class SiteSwitcherRequestFilter extends OncePerRequestFilter [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] SiteSwitcherRequestFilter(); SiteSwitcherRequestFilter(SiteUrlFactory normalSiteUrlFactory, SiteUrlFac...
/* static context [FOCAL] public String SiteSwitcherRequestFilter.getServerName() */
/* static context [FOCAL] public String SiteSwitcherRequestFilter.getServerName() */ class SiteSwitcherRequestFilter extends OncePerRequestFilter { public String getServerName() { return serverName; } public SiteSwitcherRequestFilter(); public SiteSwitcherRequestFilter(SiteUrlFactory normalSiteUrlFactory, Sit...
true
ok
{"focal": {"class": "SiteSwitcherRequestFilter", "name": "getServerName", "signature": "String getServerName()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "SiteSwitcherRequestFilter", "kind": "class", "modifiers": "", "superclass": "OncePerRequestFilter", "in...
1810897_0
class HomeController { @RequestMapping(value = "states", method = RequestMethod.GET, produces = "application/json") public @ResponseBody List<State> fetchStatesJson() { logger.info("fetching JSON states"); return getStates(); } @RequestMapping(method = RequestMethod.GET) public String home(); @RequestMapping...
List<State> states = controller.fetchStatesJson(); assertNotNull(states); assertEquals(50, states.size()); assertEquals("ALABAMA", states.get(0).getName()); } }
[FOCAL] @RequestMapping(value = "states", method = RequestMethod.GET, produces = "application/json") public @ResponseBody List<State> HomeController.fetchStatesJson() [CLASS] class HomeController [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] List<State> getStates() [CALLS-EXTERNA...
/* static context [FOCAL] @RequestMapping(value = "states", method = RequestMethod.GET, produces = "application/json") public @ResponseBody List<State> HomeController.fetchStatesJson() [CALLS-INTERNAL] List<State> getStates() [CALLS-EXTERNAL] logger.info/1 */
/* static context [FOCAL] @RequestMapping(value = "states", method = RequestMethod.GET, produces = "application/json") public @ResponseBody List<State> HomeController.fetchStatesJson() [CALLS-INTERNAL] List<State> getStates() [CALLS-EXTERNAL] logger.info/1 */ class HomeController { @RequestMapping(value = "states", m...
true
ok
{"focal": {"class": "HomeController", "name": "fetchStatesJson", "signature": "List<State> fetchStatesJson()", "start_line": 3, "modifiers": "@RequestMapping(value = \"states\", method = RequestMethod.GET, produces = \"application/json\") public @ResponseBody", "params": [], "return_type": "List<State>"}, "class_info":...
1812602_16
class ObjectNameWithRefFilter implements ObjectFilter { @Override public List<DescribeSObjectResult> filter(List<DescribeSObjectResult> dsrs) { for (DescribeSObjectResult dsr : dsrs) { objectMap.put(dsr.getName(), dsr); } filterObjectAndReferences(objectNames); retu...
DescribeSObjectResult dsrIn = new DescribeSObjectResult(); dsrIn.setName("Object_Name_In__c"); DescribeSObjectResult dsrRef = new DescribeSObjectResult(); dsrRef.setName("RefObject__c"); Field refField = new Field(); refField.setName("RefField__c"); ...
[FOCAL] @Override public List<DescribeSObjectResult> ObjectNameWithRefFilter.filter(List<DescribeSObjectResult> dsrs) [CLASS] class ObjectNameWithRefFilter implements ObjectFilter [METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] void filterObjectAndReferences(Set<String> objectNameS...
/* static context [FOCAL] @Override public List<DescribeSObjectResult> ObjectNameWithRefFilter.filter(List<DescribeSObjectResult> dsrs) [PATH1] foreach(DescribeSObjectResult dsr : dsrs)=T -> exit loop -> return filteredResult [PATH2] foreach(DescribeSObjectResult dsr : dsrs)=F -> return filteredResult [INPUTS] branches...
/* static context [FOCAL] @Override public List<DescribeSObjectResult> ObjectNameWithRefFilter.filter(List<DescribeSObjectResult> dsrs) [PATH1] foreach(DescribeSObjectResult dsr : dsrs)=T -> exit loop -> return filteredResult [PATH2] foreach(DescribeSObjectResult dsr : dsrs)=F -> return filteredResult [INPUTS] branches...
true
ok
{"focal": {"class": "ObjectNameWithRefFilter", "name": "filter", "signature": "List<DescribeSObjectResult> filter(List<DescribeSObjectResult> dsrs)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "dsrs", "type": "List<DescribeSObjectResult>"}], "return_type": "List<DescribeSObjectResult>"}, "cla...
1814028_2
class MockSocket { public static UniversalMockRecorder expectCall() { return StaticConnectionFactory.expectCall(); } protected MockSocket(); public static void reset(); public static List<RequestSocketData> recordedConnections(); public static SocketData emptyResponse(); public static SocketData data(byte[...
expectCall().andReturn(new DefaultSocketData("HTTP/1.0 200 OK\n\nTest".getBytes())); HttpClient httpclient = new DefaultHttpClient(); HttpGet httpget = new HttpGet(ADDRESS); HttpResponse response = httpclient.execute(httpget); assertEquals("Test", printStream(response.getEntity().getContent())); } }
[FOCAL] public static UniversalMockRecorder MockSocket.expectCall() [CLASS] class MockSocket [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] StaticConnectionFactory.expectCall/0 [CLASS-MEMBERS] MockSocket(); void reset(); List<RequestSocketData> recordedConnections(); SocketData em...
/* static context [FOCAL] public static UniversalMockRecorder MockSocket.expectCall() [CALLS-EXTERNAL] StaticConnectionFactory.expectCall/0 */
/* static context [FOCAL] public static UniversalMockRecorder MockSocket.expectCall() [CALLS-EXTERNAL] StaticConnectionFactory.expectCall/0 */ class MockSocket { public static UniversalMockRecorder expectCall() { return StaticConnectionFactory.expectCall(); } protected MockSocket(); public static void reset()...
true
ok
{"focal": {"class": "MockSocket", "name": "expectCall", "signature": "UniversalMockRecorder expectCall()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "UniversalMockRecorder"}, "class_info": {"name": "MockSocket", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ...
1839196_7
class FXForm extends AbstractFXForm { public void setSource(T source) { this.source.set(source); } public FXForm(); public FXForm(T source); public FXForm(FactoryProvider editorFactoryProvider); public FXForm(T source, FactoryProvider editorFactoryProvider); public FXForm(Fact...
TestBean testBean = new TestBean(); FXForm fxForm = new FXForm(testBean); Assert.assertEquals(4, fxForm.getElements().size()); fxForm.setSource(null); Assert.assertEquals(0, fxForm.getElements().size()); } }
[FOCAL] public void FXForm.setSource(T source) [CLASS] class FXForm extends AbstractFXForm [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] this.source.set/1 [FIELDS] read=source [COLLABORATORS] param source:T set/1 [DATAFLOW] source@param->L2 [CLASS-MEMBERS] FXForm(); FXForm(T sour...
/* static context [FOCAL] public void FXForm.setSource(T source) [COLLABORATORS] param source:T set/1 [FIELDS] read=source [CALLS-EXTERNAL] this.source.set/1 */
/* static context [FOCAL] public void FXForm.setSource(T source) [COLLABORATORS] param source:T set/1 [FIELDS] read=source [CALLS-EXTERNAL] this.source.set/1 */ class FXForm extends AbstractFXForm { public void setSource(T source) { this.source.set(source); } public FXForm(); public FXForm(T...
true
ok
{"focal": {"class": "FXForm", "name": "setSource", "signature": "void setSource(T source)", "start_line": 3, "modifiers": "public", "params": [{"name": "source", "type": "T"}], "return_type": "void"}, "class_info": {"name": "FXForm", "kind": "class", "modifiers": "", "superclass": "AbstractFXForm", "interfaces": null, ...
1860892_0
class TopBar extends JPanel { protected void fireStartTask() { fireEvent(new Event() { @Override public void fire(final Listener listener) { listener.startTask(); } }); } public TopBar(final UIEventsExecutor executor, final TopBarModel model, final ErrorLogScreen errorLogScreen, NewAndNoteworth...
menuOperator.pushStartTaskmenu(); Assert.assertThat(exexex.happened, notNullValue()); } }
[FOCAL] protected void TopBar.fireStartTask() [CLASS] class TopBar extends JPanel [METRICS] loc=10 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void fireEvent(Event event) [CALLS-EXTERNAL] listener.startTask/0 [NEW] Event [COLLABORATORS] field listener startTask/0 [CLASS-MEMBERS] TopBar(UIEvent...
/* static context [FOCAL] protected void TopBar.fireStartTask() [COLLABORATORS] field listener startTask/0 [CALLS-INTERNAL] void fireEvent(Event event) [NEW] Event [CALLS-EXTERNAL] listener.startTask/0 */
/* static context [FOCAL] protected void TopBar.fireStartTask() [COLLABORATORS] field listener startTask/0 [CALLS-INTERNAL] void fireEvent(Event event) [NEW] Event [CALLS-EXTERNAL] listener.startTask/0 */ class TopBar extends JPanel { protected void fireStartTask() { fireEvent(new Event() { @Override public ...
true
ok
{"focal": {"class": "TopBar", "name": "fireStartTask", "signature": "void fireStartTask()", "start_line": 3, "modifiers": "protected", "params": [], "return_type": "void"}, "class_info": {"name": "TopBar", "kind": "class", "modifiers": "", "superclass": "JPanel", "interfaces": null, "fields": [{"name": "menuOperator", ...
1862490_2
class Expressions { public static String resolve(final Properties props, final String expression) { if (expression == null) return null; final StringBuilder builder = new StringBuilder(); final char[] chars = expression.toCharArray(); final int len = chars.length; int state ...
Assert.assertEquals("test property value", Expressions.resolve(PROPERTIES, "${test.property}")); Assert.assertEquals("defaultValue", Expressions.resolve(PROPERTIES, "${invalid.property:defaultValue}")); } }
[FOCAL] public static String Expressions.resolve(Properties props, String expression) [CLASS] class Expressions [METRICS] loc=113 cc=24 branches=13 loops=1 returns=2 throws=1 nesting=6 [CALLS-EXTERNAL] String.toCharArray/0, StringBuilder.append/1, builder.append('$').append/1, expression.substring(nameStart, i).trim/0,...
/* static context [FOCAL] public static String Expressions.resolve(Properties props, String expression) [PATH1] if(expression == null)=F -> for(i < len)=T -> switch(state)#1=case GOT_OPEN_BRACE -> switch(ch)#3=case ',' -> if(name.startsWith("env."))=T -> if(val != null)=F -> if(ch == ',')=F -> if(ch == ':')=T -> exit l...
/* static context [FOCAL] public static String Expressions.resolve(Properties props, String expression) [PATH1] if(expression == null)=F -> for(i < len)=T -> switch(state)#1=case GOT_OPEN_BRACE -> switch(ch)#3=case ',' -> if(name.startsWith("env."))=T -> if(val != null)=F -> if(ch == ',')=F -> if(ch == ':')=T -> exit l...
true
ok
{"focal": {"class": "Expressions", "name": "resolve", "signature": "String resolve(Properties props, String expression)", "start_line": 3, "modifiers": "public static", "params": [{"name": "props", "type": "Properties"}, {"name": "expression", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Expres...
1862492_0
class OutputStreamHandler extends WriterHandler { public void setWriter(final Writer writer) { synchronized (outputLock) { super.setWriter(writer); final OutputStream oldStream = this.outputStream; outputStream = null; safeFlush(oldStream); safeCl...
handler = new ConsoleHandler(Target.CONSOLE, NO_FORMATTER); handler.setErrorManager(AssertingErrorManager.of()); handler.setWriter(out); handler.setEncoding("UTF-8"); assertThat(handler.getEncoding(), is("UTF-8")); handler.publish(new ExtLogRecord(Level.INFO, "Hello World...
[FOCAL] public void OutputStreamHandler.setWriter(Writer writer) [CLASS] class OutputStreamHandler extends WriterHandler [METRICS] loc=9 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] WriterHandler.setWriter/1, safeFlush/1 (inherited), safeClose/1 (inherited) [FIELDS] read=outputStream [DATAFLOW]...
/* static context [FOCAL] public void OutputStreamHandler.setWriter(Writer writer) [FIELDS] read=outputStream [CALLS-EXTERNAL] WriterHandler.setWriter/1, safeFlush/1 (inherited), safeClose/1 (inherited) */
/* static context [FOCAL] public void OutputStreamHandler.setWriter(Writer writer) [FIELDS] read=outputStream [CALLS-EXTERNAL] WriterHandler.setWriter/1, safeFlush/1 (inherited), safeClose/1 (inherited) */ class OutputStreamHandler extends WriterHandler { public void setWriter(final Writer writer) { synchr...
true
ok
{"focal": {"class": "OutputStreamHandler", "name": "setWriter", "signature": "void setWriter(Writer writer)", "start_line": 3, "modifiers": "public", "params": [{"name": "writer", "type": "Writer"}], "return_type": "void"}, "class_info": {"name": "OutputStreamHandler", "kind": "class", "modifiers": "", "superclass": "W...
1863627_0
class AssignmentFromZK implements Assignment, IZkChildListener, IZkStateListener, IZkDataListener { @Override public ClusterNode assignClusterNode() { lock.lock(); try { while (!currentlyOwningTask.get()) { taskAcquired.awaitUninterruptibly(); } }...
TaskSetup taskSetup = new TaskSetup(zookeeperAddress); final String clusterName = "test-s4-cluster"; taskSetup.clean(clusterName); taskSetup.setup(clusterName, 10); final CountDownLatch latch = new CountDownLatch(10); for (int i = 0; i < 10; i++) { Runnable ru...
[FOCAL] @Override public ClusterNode AssignmentFromZK.assignClusterNode() [CLASS] class AssignmentFromZK implements Assignment, IZkChildListener, IZkStateListener, IZkDataListener [METRICS] loc=15 cc=3 branches=0 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] lock.lock/0, currentlyOwningTask.get/0, taskAcquired....
/* static context [FOCAL] @Override public ClusterNode AssignmentFromZK.assignClusterNode() [PATH1] while(!currentlyOwningTask.get())=T -> exit loop -> return clusterNodeRef.get() [PATH2] try-body throws -> return null [PATH3] while(!currentlyOwningTask.get())=F -> return clusterNodeRef.get() [COLLABORATORS] field lock...
/* static context [FOCAL] @Override public ClusterNode AssignmentFromZK.assignClusterNode() [PATH1] while(!currentlyOwningTask.get())=T -> exit loop -> return clusterNodeRef.get() [PATH2] try-body throws -> return null [PATH3] while(!currentlyOwningTask.get())=F -> return clusterNodeRef.get() [COLLABORATORS] field lock...
true
ok
{"focal": {"class": "AssignmentFromZK", "name": "assignClusterNode", "signature": "ClusterNode assignClusterNode()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "ClusterNode"}, "class_info": {"name": "AssignmentFromZK", "kind": "class", "modifiers": "", "superclass": null, "interfaces...
1867246_60
class SAMLProcessingFilter extends AbstractAuthenticationProcessingFilter { public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException { try { SAMLMessageContext context = contextProvider.getLocalEntity(request, respons...
Authentication token = new UsernamePasswordAuthenticationToken("user", "pass"); AuthenticationManager manager = createMock(AuthenticationManager.class); processingFiler.setAuthenticationManager(manager); expect(request.getContextPath()).andReturn("/saml"); expect(processor.retr...
[FOCAL] public Authentication SAMLProcessingFilter.attemptAuthentication(HttpServletRequest request, HttpServletResponse response) [CLASS] class SAMLProcessingFilter extends AbstractAuthenticationProcessingFilter [METRICS] loc=22 cc=5 branches=0 loops=0 returns=1 throws=4 nesting=1 [CALLS-EXTERNAL] contextProvider.getL...
/* static context [FOCAL] public Authentication SAMLProcessingFilter.attemptAuthentication(HttpServletRequest request, HttpServletResponse response) [THROWS-WHEN] SAMLRuntimeException when try-body throws [PATH1] try-body throws -> throw new SAMLRuntimeException("Incoming SAML message is invalid", e) [PATH2] return get...
/* static context [FOCAL] public Authentication SAMLProcessingFilter.attemptAuthentication(HttpServletRequest request, HttpServletResponse response) [THROWS-WHEN] SAMLRuntimeException when try-body throws [PATH1] try-body throws -> throw new SAMLRuntimeException("Incoming SAML message is invalid", e) [PATH2] return get...
true
ok
{"focal": {"class": "SAMLProcessingFilter", "name": "attemptAuthentication", "signature": "Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException", "start_line": 3, "modifiers": "public", "params": [{"name": "request", "type": "HttpServletRequest"},...
1870998_31
class AgeUtils { public static Period getAge(LocalDate birthDate) { return getAge(birthDate, LocalDate.now()); } public static int getFullAge(Date birthDate); public static int getFullAge(Calendar birthDate); public static int getFullAge(LocalDate birthDate); public static int getFullAge(LocalDate fro...
LocalDate now = LocalDate.now(); int currentYear = now.getYear(); LocalDate birthDate = LocalDate.of(2010, 2, 1); Period age = AgeUtils.getAge(birthDate); // P6Y1M21D Assert.assertEquals(currentYear - birthDate.getYear(), age.getYears()); Assert.assertEquals(now.getMonthValue() - birthDate.getMo...
[FOCAL] public static Period AgeUtils.getAge(LocalDate birthDate) [CLASS] class AgeUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Period getAge(LocalDate fromDate, LocalDate toDate) [CALLS-EXTERNAL] LocalDate.now/0 [INPUTS] branches=- | result=birthDate [DATAFLOW] birthDate@...
/* static context [FOCAL] public static Period AgeUtils.getAge(LocalDate birthDate) [INPUTS] branches=- | result=birthDate [CALLS-INTERNAL] Period getAge(LocalDate fromDate, LocalDate toDate) [CALLS-EXTERNAL] LocalDate.now/0 */
/* static context [FOCAL] public static Period AgeUtils.getAge(LocalDate birthDate) [INPUTS] branches=- | result=birthDate [CALLS-INTERNAL] Period getAge(LocalDate fromDate, LocalDate toDate) [CALLS-EXTERNAL] LocalDate.now/0 */ class AgeUtils { public static Period getAge(LocalDate birthDate) { return getAge(bir...
true
ok
{"focal": {"class": "AgeUtils", "name": "getAge", "signature": "Period getAge(LocalDate birthDate)", "start_line": 3, "modifiers": "public static", "params": [{"name": "birthDate", "type": "LocalDate"}], "return_type": "Period"}, "class_info": {"name": "AgeUtils", "kind": "class", "modifiers": "", "superclass": null, "...
1872106_0
class CustomerManagerEJB { static boolean nameIsValid(String name) { return name.matches("[\\p{L}-]+"); } @TransactionAttribute(TransactionAttributeType.REQUIRED) public void createCustomer(String name); @TransactionAttribute(TransactionAttributeType.NEVER) @SuppressWarnings("unchecked") publi...
assertTrue(CustomerManagerEJB.nameIsValid("Jan")); assertFalse(CustomerManagerEJB.nameIsValid("Jan1")); assertTrue(CustomerManagerEJB.nameIsValid("Jan-Piet")); assertFalse(CustomerManagerEJB.nameIsValid("Jan_Piet")); assertTrue(CustomerManagerEJB.nameIsValid("gefräßig")); } ...
[FOCAL] static boolean CustomerManagerEJB.nameIsValid(String name) [CLASS] class CustomerManagerEJB [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.matches/1 [INPUTS] branches=- | result=name [DATAFLOW] name@param->L2 [CLASS-MEMBERS] void createCustomer(String name); List<Cu...
/* static context [FOCAL] static boolean CustomerManagerEJB.nameIsValid(String name) [INPUTS] branches=- | result=name [CALLS-EXTERNAL] String.matches/1 */
/* static context [FOCAL] static boolean CustomerManagerEJB.nameIsValid(String name) [INPUTS] branches=- | result=name [CALLS-EXTERNAL] String.matches/1 */ class CustomerManagerEJB { static boolean nameIsValid(String name) { return name.matches("[\\p{L}-]+"); } @TransactionAttribute(TransactionAtt...
true
ok
{"focal": {"class": "CustomerManagerEJB", "name": "nameIsValid", "signature": "boolean nameIsValid(String name)", "start_line": 3, "modifiers": "static", "params": [{"name": "name", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "CustomerManagerEJB", "kind": "class", "modifiers": "", "superclass"...
1875775_1
class TaglibReader { public FaceletTaglibType getTaglib() { return taglib; } public TaglibReader(); public HashMap<String, FaceletTaglibTagType> getTagMap(); FaceletTaglibType parseTablib(); InputStream getStream(); public List<FaceletTaglibTagAttributeType> getDefaultAttribute...
TaglibReader taglibReader = new TaglibReader(); Assert.assertNotNull(taglibReader.getTaglib()); } }
[FOCAL] public FaceletTaglibType TaglibReader.getTaglib() [CLASS] class TaglibReader [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] TaglibReader(); HashMap<String, FaceletTaglibTagType> getTagMap(); FaceletTaglibType parseTablib(); InputStream getStream(); List<FaceletTaglibTagAttr...
/* static context [FOCAL] public FaceletTaglibType TaglibReader.getTaglib() */
/* static context [FOCAL] public FaceletTaglibType TaglibReader.getTaglib() */ class TaglibReader { public FaceletTaglibType getTaglib() { return taglib; } public TaglibReader(); public HashMap<String, FaceletTaglibTagType> getTagMap(); FaceletTaglibType parseTablib(); InputStream ...
true
ok
{"focal": {"class": "TaglibReader", "name": "getTaglib", "signature": "FaceletTaglibType getTaglib()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "FaceletTaglibType"}, "class_info": {"name": "TaglibReader", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [],...
1878370_11
class JavaSourceAssert { public static JavaMethod assertMethodExists(File java, CharSequence methodSignature) throws IOException { JavaDocBuilder builder = new JavaDocBuilder(); JavaSource src = builder.addSource(java); JavaClass jc = getClassName(src, java); Map<String, JavaMethod...
File java = getSampleDataJavaSource("SampleInterface.java"); JavaSourceAssert.assertMethodExists(java, "public void notexists()"); } }
[FOCAL] public static JavaMethod JavaSourceAssert.assertMethodExists(File java, CharSequence methodSignature) [CLASS] class JavaSourceAssert [METRICS] loc=25 cc=5 branches=2 loops=2 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] JavaClass getClassName(JavaSource src, File java); String getCompleteMethodSignature(JavaMet...
/* static context [FOCAL] public static JavaMethod JavaSourceAssert.assertMethodExists(File java, CharSequence methodSignature) [PATH1] foreach(JavaMethod method : jc.getMethods())=T -> if(!method.isConstructor())=T -> exit loop -> if(!sigs.containsKey(methodSignature))=T -> foreach(String sig : sigs.keySet())=F -> ret...
/* static context [FOCAL] public static JavaMethod JavaSourceAssert.assertMethodExists(File java, CharSequence methodSignature) [PATH1] foreach(JavaMethod method : jc.getMethods())=T -> if(!method.isConstructor())=T -> exit loop -> if(!sigs.containsKey(methodSignature))=T -> foreach(String sig : sigs.keySet())=F -> ret...
true
ok
{"focal": {"class": "JavaSourceAssert", "name": "assertMethodExists", "signature": "JavaMethod assertMethodExists(File java, CharSequence methodSignature) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "java", "type": "File"}, {"name": "methodSignature", "type": "CharSequence"}]...
1886360_35
class Library { public static int[] listTotients(int n) { if (n < 0) throw new IllegalArgumentException("Negative array size"); int[] result = new int[n + 1]; for (int i = 0; i <= n; i++) result[i] = i; for (int i = 2; i <= n; i++) { if (result[i] == i) { // i is prime for (int j = i; j <= n;...
int[] totients = Library.listTotients(1000); for (int i = 1; i < totients.length; i++) assertEquals(Library.totient(i), totients[i]); } }
[FOCAL] public static int[] Library.listTotients(int n) [CLASS] class Library [METRICS] loc=15 cc=6 branches=2 loops=3 returns=1 throws=1 nesting=3 [NEW] IllegalArgumentException [EXCEPTIONS] throws IllegalArgumentException [THROWS-WHEN] IllegalArgumentException when n < 0 [PATH1] if(n < 0)=F -> for(i <= n)#1=F -> for(...
/* static context [FOCAL] public static int[] Library.listTotients(int n) [THROWS-WHEN] IllegalArgumentException when n < 0 [PATH1] if(n < 0)=F -> for(i <= n)#1=F -> for(i <= n)#2=T -> if(result[i] == i)=T -> for(j <= n)=F -> exit loop -> return result [PATH2] if(n < 0)=T -> throw new IllegalArgumentException("Negative...
/* static context [FOCAL] public static int[] Library.listTotients(int n) [THROWS-WHEN] IllegalArgumentException when n < 0 [PATH1] if(n < 0)=F -> for(i <= n)#1=F -> for(i <= n)#2=T -> if(result[i] == i)=T -> for(j <= n)=F -> exit loop -> return result [PATH2] if(n < 0)=T -> throw new IllegalArgumentException("Negative...
true
ok
{"focal": {"class": "Library", "name": "listTotients", "signature": "int[] listTotients(int n)", "start_line": 3, "modifiers": "public static", "params": [{"name": "n", "type": "int"}], "return_type": "int[]"}, "class_info": {"name": "Library", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "...
1889681_12
class MantisConnector { @Nonnull Collection<FilterData> getFilters(@Nonnull ProjectData project) throws RemoteException { return Arrays.asList(connectPortType.mc_filter_get(USERNAME, PASSWORD, project.getId())); } MantisConnector(); @Nonnull Collection<ProjectData> getProjects(); @N...
MantisConnector connector = new MantisConnector(); List<ProjectData> filteredProjects = getFilteredProjects(connector); for (ProjectData project : filteredProjects) { Collection<FilterData> filters = connector.getFilters(project); assertTrue( filter...
[FOCAL] @Nonnull Collection<FilterData> MantisConnector.getFilters(ProjectData project) [CLASS] class MantisConnector [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Arrays.asList/1, connectPortType.mc_filter_get/3, ProjectData.getId/0 [EXCEPTIONS] declares RemoteException [INPUTS]...
/* static context [FOCAL] @Nonnull Collection<FilterData> MantisConnector.getFilters(ProjectData project) [INPUTS] branches=- | result=project [COLLABORATORS] field connectPortType mc_filter_get/3; param project:ProjectData getId/0 [EXCEPTIONS] declares RemoteException [CALLS-EXTERNAL] Arrays.asList/1, connectPortType....
/* static context [FOCAL] @Nonnull Collection<FilterData> MantisConnector.getFilters(ProjectData project) [INPUTS] branches=- | result=project [COLLABORATORS] field connectPortType mc_filter_get/3; param project:ProjectData getId/0 [EXCEPTIONS] declares RemoteException [CALLS-EXTERNAL] Arrays.asList/1, connectPortType....
true
ok
{"focal": {"class": "MantisConnector", "name": "getFilters", "signature": "Collection<FilterData> getFilters(ProjectData project) throws RemoteException", "start_line": 3, "modifiers": "@Nonnull", "params": [{"name": "project", "type": "ProjectData"}], "return_type": "Collection<FilterData>"}, "class_info": {"name": "M...
1894664_13
class SearchTemplate extends AbstractYammerOperations implements SearchOperations { public SearchResults search(String searchString){ return search(searchString, 1); } public SearchTemplate(RestTemplate restTemplate); public SearchResults search(String searchString, int page); public SearchResults search(Str...
mockServer.expect(requestTo("https://www.yammer.com/api/v1/search.json?search=foo&page=2&number_per_page=20")).andExpect(method(GET)) .andRespond(withSuccess(jsonResource("testdata/yammer-search-results"), APPLICATION_JSON)); SearchResults searchResults = yammerTemplate.searchOperations().search("foo",2); asser...
[FOCAL] public SearchResults SearchTemplate.search(String searchString) [CLASS] class SearchTemplate extends AbstractYammerOperations implements SearchOperations [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] SearchResults search(String searchString, int page) [INPUTS] branches=- ...
/* static context [FOCAL] public SearchResults SearchTemplate.search(String searchString) [INPUTS] branches=- | result=searchString [CALLS-INTERNAL] SearchResults search(String searchString, int page) */
/* static context [FOCAL] public SearchResults SearchTemplate.search(String searchString) [INPUTS] branches=- | result=searchString [CALLS-INTERNAL] SearchResults search(String searchString, int page) */ class SearchTemplate extends AbstractYammerOperations implements SearchOperations { public SearchResults search(St...
true
ok
{"focal": {"class": "SearchTemplate", "name": "search", "signature": "SearchResults search(String searchString)", "start_line": 3, "modifiers": "public", "params": [{"name": "searchString", "type": "String"}], "return_type": "SearchResults"}, "class_info": {"name": "SearchTemplate", "kind": "class", "modifiers": "", "s...
1905463_3
class MockingPropertyResolver implements PredefinedVariableResolver.NewVariableEncounteredListener { public Object getValue(Object target, Object property) throws GenericElEvaluationException, PropertyNotFoundException { return this.getValue(target, property, getTypeOfCollectionOrBean(target, p...
assertThat(resolver.getValue(new Object[0], 456) // SUPPRESS CHECKSTYLE , is(instanceOf(MockObjectOfUnknownType.class))); } }
[FOCAL] public Object MockingPropertyResolver.getValue(Object target, Object property) [CLASS] class MockingPropertyResolver implements PredefinedVariableResolver.NewVariableEncounteredListener [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Class<?> getTypeOfCollectionOrBean(Objec...
/* static context [FOCAL] public Object MockingPropertyResolver.getValue(Object target, Object property) [INPUTS] branches=- | result=property, target [EXCEPTIONS] declares GenericElEvaluationException, PropertyNotFoundException [CALLS-INTERNAL] Class<?> getTypeOfCollectionOrBean(Object target, Object property); Object...
/* static context [FOCAL] public Object MockingPropertyResolver.getValue(Object target, Object property) [INPUTS] branches=- | result=property, target [EXCEPTIONS] declares GenericElEvaluationException, PropertyNotFoundException [CALLS-INTERNAL] Class<?> getTypeOfCollectionOrBean(Object target, Object property); Object...
true
ok
{"focal": {"class": "MockingPropertyResolver", "name": "getValue", "signature": "Object getValue(Object target, Object property) throws GenericElEvaluationException, PropertyNotFoundException", "start_line": 3, "modifiers": "public", "params": [{"name": "target", "type": "Object"}, {"name": "property", "type": "Object"...
1913648_0
class SyncDB { public Map<String,Integer> getMods () { return new HashMap<String,Integer>(_mods); } protected SyncDB(Platform platform); public int version(); public boolean hasUnsyncedChanges(); public Map<String,String> getDelta(); public void noteSync(int version, Map<String,I...
Protocol.Session session = testSession(); TestDB one = new TestDB(), two = new TestDB(); one.trueBool.update(true); one.maxInt.update(42); one.maxLong.update(400L); one.serverString.update("foo"); one.unionSet.add("one"); one.unionSet.add("two"); ...
[FOCAL] public Map<String,Integer> SyncDB.getMods() [CLASS] class SyncDB [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] HashMap<String,Integer> [CLASS-MEMBERS] SyncDB(Platform platform); int version(); boolean hasUnsyncedChanges(); Map<String,String> getDelta(); void noteSync(int version, Ma...
/* static context [FOCAL] public Map<String,Integer> SyncDB.getMods() [NEW] HashMap<String,Integer> */
/* static context [FOCAL] public Map<String,Integer> SyncDB.getMods() [NEW] HashMap<String,Integer> */ class SyncDB { public Map<String,Integer> getMods () { return new HashMap<String,Integer>(_mods); } protected SyncDB(Platform platform); public int version(); public boolean hasUnsynced...
true
ok
{"focal": {"class": "SyncDB", "name": "getMods", "signature": "Map<String,Integer> getMods()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Map<String,Integer>"}, "class_info": {"name": "SyncDB", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": ...
1925457_60
class Strings { public static String getDegreesMinutesSeconds(double decimaldegrees, boolean isLatitude) { String cardinality = (decimaldegrees<0) ? "S":"N"; if(!isLatitude){ cardinality = (decimaldegrees<0) ? "W":"E"; } //Remove negative sign decimaldegrees = ...
double lat = 11.812244d; String expected = "11° 48' 44.0784\" N"; String actual = Strings.getDegreesMinutesSeconds(lat, true); assertThat("Degree Decimals converted to Degree Minute Seconds", actual, is(expected)); } }
[FOCAL] public static String Strings.getDegreesMinutesSeconds(double decimaldegrees, boolean isLatitude) [CLASS] class Strings [METRICS] loc=30 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Math.abs/1, Math.floor/1, Math.round/1 [PATH1] if(!isLatitude)=T -> if(sec==60)=T -> if(min==60)=T -> retu...
/* static context [FOCAL] public static String Strings.getDegreesMinutesSeconds(double decimaldegrees, boolean isLatitude) [PATH1] if(!isLatitude)=T -> if(sec==60)=T -> if(min==60)=T -> return ("" + deg + "° " + min + "' " + sec + "\" " + cardinality) [PATH2] if(!isLatitude)=F -> if(sec==60)=F -> if(min==60)=F -> retur...
/* static context [FOCAL] public static String Strings.getDegreesMinutesSeconds(double decimaldegrees, boolean isLatitude) [PATH1] if(!isLatitude)=T -> if(sec==60)=T -> if(min==60)=T -> return ("" + deg + "° " + min + "' " + sec + "\" " + cardinality) [PATH2] if(!isLatitude)=F -> if(sec==60)=F -> if(min==60)=F -> retur...
true
ok
{"focal": {"class": "Strings", "name": "getDegreesMinutesSeconds", "signature": "String getDegreesMinutesSeconds(double decimaldegrees, boolean isLatitude)", "start_line": 3, "modifiers": "public static", "params": [{"name": "decimaldegrees", "type": "double"}, {"name": "isLatitude", "type": "boolean"}], "return_type":...
1931685_3
class Route { public StompletActivator match(String destination) { Matcher routeMatcher = this.regexp.matcher( destination ); if (routeMatcher.matches()) { Map<String, String> matches = new HashMap<String, String>(); for (int i = 0; i < this.segmentNames.length; ++i) { ...
Route route = new Route( "/stocks/:exchange/:stock", null ); StompletActivator match = route.match( "/stocks/NASDAQ/AAPL" ); assertNotNull( match ); assertEquals( "NASDAQ", match.get( "exchange" ) ); assertEquals( "AAPL", match.get( "stock" ) ); match = ...
[FOCAL] public StompletActivator Route.match(String destination) [CLASS] class Route [METRICS] loc=14 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] this.regexp.matcher/1, Matcher.matches/0, Map<String, String>.put/2, Matcher.group/1 [NEW] HashMap<String, String>, StompletActivator [FIELDS] read=...
/* static context [FOCAL] public StompletActivator Route.match(String destination) [PATH1] if(routeMatcher.matches())=T -> for(i < this.segmentNames.length)=T -> exit loop -> return new StompletActivator( this, destination, matches ) [PATH2] if(routeMatcher.matches())=F -> return null [PATH3] if(routeMatcher.matches())...
/* static context [FOCAL] public StompletActivator Route.match(String destination) [PATH1] if(routeMatcher.matches())=T -> for(i < this.segmentNames.length)=T -> exit loop -> return new StompletActivator( this, destination, matches ) [PATH2] if(routeMatcher.matches())=F -> return null [PATH3] if(routeMatcher.matches())...
true
ok
{"focal": {"class": "Route", "name": "match", "signature": "StompletActivator match(String destination)", "start_line": 3, "modifiers": "public", "params": [{"name": "destination", "type": "String"}], "return_type": "StompletActivator"}, "class_info": {"name": "Route", "kind": "class", "modifiers": "", "superclass": nu...
1933490_4
class World { public String getName() { return name; } public World( String name, int moons ); public World(); public int getMoons(); @Override public String toString(); public void addRocketRouteTo( World otherWorld ); public boolean canBeReachedFrom( World otherWorld )...
World w = new World(); assertNull(w.getName()); } }
[FOCAL] public String World.getName() [CLASS] class World [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] World(String name, int moons); World(); int getMoons(); String toString(); void addRocketRouteTo(World otherWorld); boolean canBeReachedFrom(World otherWorld) [TEST] WorldTest: ...
/* static context [FOCAL] public String World.getName() */
/* static context [FOCAL] public String World.getName() */ class World { public String getName() { return name; } public World( String name, int moons ); public World(); public int getMoons(); @Override public String toString(); public void addRocketRouteTo( World otherWorld...
true
ok
{"focal": {"class": "World", "name": "getName", "signature": "String getName()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "World", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "template", "type": "Neo4jTemplat...
1944249_13
class Editor { public void setText(@Nonnull String text) { Check.isMainThread(); onTextChanged(EditorState.create(text, text.length())); } @Inject public Editor(@Nonnull Application application, @Nonnull SharedPreferences preferences, @Nonnull Engine engine); public void init(); ...
EditorState viewState = setTextAndGet("test"); Assert.assertEquals("test", viewState.getTextString()); Assert.assertEquals(4, viewState.selection); viewState = setTextAndGet("testtest"); Assert.assertEquals("testtest", viewState.getTextString()); Assert.assertEquals(8, ...
[FOCAL] public void Editor.setText(String text) [CLASS] class Editor [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void onTextChanged(EditorState newState) [CALLS-EXTERNAL] Check.isMainThread/0, EditorState.create/2, String.length/0 [DATAFLOW] text@param->L3 [CLASS-MEMBERS] Edito...
/* static context [FOCAL] public void Editor.setText(String text) [CALLS-INTERNAL] void onTextChanged(EditorState newState) [CALLS-EXTERNAL] Check.isMainThread/0, EditorState.create/2, String.length/0 */
/* static context [FOCAL] public void Editor.setText(String text) [CALLS-INTERNAL] void onTextChanged(EditorState newState) [CALLS-EXTERNAL] Check.isMainThread/0, EditorState.create/2, String.length/0 */ class Editor { public void setText(@Nonnull String text) { Check.isMainThread(); onTextChanged(...
true
ok
{"focal": {"class": "Editor", "name": "setText", "signature": "void setText(String text)", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}], "return_type": "void"}, "class_info": {"name": "Editor", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": ...
1946637_20
class Decoder { public static String path(final CharSequence path) { return decode(path, false); } public static String query(final CharSequence query); public static String decode(final CharSequence path, final boolean query); } class DecoderTest { @Test public void pathQuotationMark() ...
assertEquals("/foo\"bar", Decoder.path("/foo%22bar")); assertEquals("/foo\"bar", Decoder.path("/foo\"bar")); } }
[FOCAL] public static String Decoder.path(CharSequence path) [CLASS] class Decoder [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String decode(CharSequence path, boolean query) [INPUTS] branches=- | result=path [DATAFLOW] path@param->L3 [CLASS-MEMBERS] String query(CharSequence q...
/* static context [FOCAL] public static String Decoder.path(CharSequence path) [INPUTS] branches=- | result=path [CALLS-INTERNAL] String decode(CharSequence path, boolean query) */
/* static context [FOCAL] public static String Decoder.path(CharSequence path) [INPUTS] branches=- | result=path [CALLS-INTERNAL] String decode(CharSequence path, boolean query) */ class Decoder { public static String path(final CharSequence path) { return decode(path, false); } public static String...
true
ok
{"focal": {"class": "Decoder", "name": "path", "signature": "String path(CharSequence path)", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "CharSequence"}], "return_type": "String"}, "class_info": {"name": "Decoder", "kind": "class", "modifiers": "", "superclass": null, "interfaces...
1951088_0
class PhotosetsInterface { public Photoset getInfo(String photosetId) throws FlickrException, IOException, JSONException { List<Parameter> parameters = new ArrayList<Parameter>(); parameters.add(new Parameter("method", METHOD_GET_INFO)); boolean signed = OAuthUtils.hasSigned(); if (signed) { parameters...
Photoset photoset = f.getPhotosetsInterface().getInfo(PHOTOSET_ID); assertNotNull(photoset); assertEquals(PHOTOSET_ID, photoset.getId()); } }
[FOCAL] public Photoset PhotosetsInterface.getInfo(String photosetId) [CLASS] class PhotosetsInterface [METRICS] loc=28 cc=4 branches=3 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] Photoset parsePhotoset(JSONObject photosetElement) [CALLS-EXTERNAL] List<Parameter>.add/1, OAuthUtils.hasSigned/0, OAuthUtils.addO...
/* static context [FOCAL] public Photoset PhotosetsInterface.getInfo(String photosetId) [THROWS-WHEN] FlickrException when signed && signed && response.isError() [THROWS-WHEN] FlickrException when signed && !signed && response.isError() [THROWS-WHEN] FlickrException when !signed && signed && response.isError() [THROWS-...
/* static context [FOCAL] public Photoset PhotosetsInterface.getInfo(String photosetId) [THROWS-WHEN] FlickrException when signed && signed && response.isError() [THROWS-WHEN] FlickrException when signed && !signed && response.isError() [THROWS-WHEN] FlickrException when !signed && signed && response.isError() [THROWS-...
true
ok
{"focal": {"class": "PhotosetsInterface", "name": "getInfo", "signature": "Photoset getInfo(String photosetId) throws FlickrException, IOException, JSONException", "start_line": 3, "modifiers": "public", "params": [{"name": "photosetId", "type": "String"}], "return_type": "Photoset"}, "class_info": {"name": "PhotosetsI...
1953808_0
class WorldMap implements Updatable<PositionUpdate<T>> { public Collection<T> getAllAt(WorldPosition position) { Collection<T> objects = positions.get(position); if (objects == null) { return Collections.emptyList(); } else { return Collections.unmodifiableCollection(objects); } } public void put(T o...
WorldMap<String> map = new WorldMap<>(); Collection<String> objects = map.getAllAt(new WorldPosition(62135, -18635)); assertNotNull(objects); assertTrue(objects.isEmpty()); } }
[FOCAL] public Collection<T> WorldMap.getAllAt(WorldPosition position) [CLASS] class WorldMap implements Updatable<PositionUpdate<T>> [METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] positions.get/1, Collections.emptyList/0, Collections.unmodifiableCollection/1 [PATH1] if(objects ==...
/* static context [FOCAL] public Collection<T> WorldMap.getAllAt(WorldPosition position) [PATH1] if(objects == null)=T -> return Collections.emptyList() [PATH2] if(objects == null)=F -> return Collections.unmodifiableCollection(objects) [INPUTS] branches=position | result=position [COLLABORATORS] field positions get/1 ...
/* static context [FOCAL] public Collection<T> WorldMap.getAllAt(WorldPosition position) [PATH1] if(objects == null)=T -> return Collections.emptyList() [PATH2] if(objects == null)=F -> return Collections.unmodifiableCollection(objects) [INPUTS] branches=position | result=position [COLLABORATORS] field positions get/1 ...
true
ok
{"focal": {"class": "WorldMap", "name": "getAllAt", "signature": "Collection<T> getAllAt(WorldPosition position)", "start_line": 3, "modifiers": "public", "params": [{"name": "position", "type": "WorldPosition"}], "return_type": "Collection<T>"}, "class_info": {"name": "WorldMap", "kind": "class", "modifiers": "", "sup...
1956196_2
class DateDisplay { int getStyle(String style) { int formatType = -1; if("long".equals(style)) { formatType = DateFormat.LONG; } else if("medium".equals(style)) { formatType = DateFormat.MEDIUM; } else if("full".equals(style)) { for...
DateDisplay component = new DateDisplay(); assertEquals(component.getStyle("long"), DateFormat.LONG); assertEquals(component.getStyle("short"), DateFormat.SHORT); assertEquals(component.getStyle("full"), DateFormat.FULL); assertEquals(component.getStyle("medium"), DateFormat.MEDIUM)...
[FOCAL] int DateDisplay.getStyle(String style) [CLASS] class DateDisplay [METRICS] loc=21 cc=5 branches=4 loops=0 returns=1 throws=0 nesting=4 [CALLS-EXTERNAL] "long".equals/1, "medium".equals/1, "full".equals/1, "short".equals/1 [PATH1] if("long".equals(style))=F -> if("medium".equals(style))=F -> if("full".equals(sty...
/* static context [FOCAL] int DateDisplay.getStyle(String style) [PATH1] if("long".equals(style))=F -> if("medium".equals(style))=F -> if("full".equals(style))=F -> if("short".equals(style))=T -> return formatType [PATH2] if("long".equals(style))=T -> return formatType [PATH3] if("long".equals(style))=F -> if("medium"....
/* static context [FOCAL] int DateDisplay.getStyle(String style) [PATH1] if("long".equals(style))=F -> if("medium".equals(style))=F -> if("full".equals(style))=F -> if("short".equals(style))=T -> return formatType [PATH2] if("long".equals(style))=T -> return formatType [PATH3] if("long".equals(style))=F -> if("medium"....
true
ok
{"focal": {"class": "DateDisplay", "name": "getStyle", "signature": "int getStyle(String style)", "start_line": 3, "modifiers": "", "params": [{"name": "style", "type": "String"}], "return_type": "int"}, "class_info": {"name": "DateDisplay", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fie...
1961837_10
class RequestStrategyImplAnyInteresting implements RequestStrategy { @Override public Piece choosePiece(BitSet interesting, Piece[] pieces) { List<Piece> onlyInterestingPieces = new ArrayList<Piece>(); for (Piece p : pieces) { if (interesting.get(p.getIndex())) onlyInterestingPieces.add(p); } ...
Piece actual = myRequestStrategy.choosePiece(new BitSet(), myPieces); Assert.assertNull(actual); } }
[FOCAL] @Override public Piece RequestStrategyImplAnyInteresting.choosePiece(BitSet interesting, Piece[] pieces) [CLASS] class RequestStrategyImplAnyInteresting implements RequestStrategy [METRICS] loc=9 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] BitSet.get/1, Piece.getIndex/0, List<Piece>.ad...
/* static context [FOCAL] @Override public Piece RequestStrategyImplAnyInteresting.choosePiece(BitSet interesting, Piece[] pieces) [PATH1] foreach(Piece p : pieces)=T -> if(interesting.get(p.getIndex()))=T -> exit loop -> if(onlyInterestingPieces.isEmpty())=T -> return null [PATH2] foreach(Piece p : pieces)=F -> if(onl...
/* static context [FOCAL] @Override public Piece RequestStrategyImplAnyInteresting.choosePiece(BitSet interesting, Piece[] pieces) [PATH1] foreach(Piece p : pieces)=T -> if(interesting.get(p.getIndex()))=T -> exit loop -> if(onlyInterestingPieces.isEmpty())=T -> return null [PATH2] foreach(Piece p : pieces)=F -> if(onl...
true
ok
{"focal": {"class": "RequestStrategyImplAnyInteresting", "name": "choosePiece", "signature": "Piece choosePiece(BitSet interesting, Piece[] pieces)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "interesting", "type": "BitSet"}, {"name": "pieces", "type": "Piece[]"}], "return_type": "Piece"}, "...
1970932_193
class OptionHelper { public static String substVars(String val, PropertyContainer pc1) { return substVars(val, pc1, null); } public static Object instantiateByClassName(String className, Class<?> superClass, Context context); public static Object instantiateBy...
String noSubst = "hello world"; String result = OptionHelper.substVars(noSubst, context); assertEquals(noSubst, result); } }
[FOCAL] public static String OptionHelper.substVars(String val, PropertyContainer pc1) [CLASS] class OptionHelper [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String substVars(String input, PropertyContainer pc0, PropertyContainer pc1) [INPUTS] branches=- | result=pc1, val [DATA...
/* static context [FOCAL] public static String OptionHelper.substVars(String val, PropertyContainer pc1) [INPUTS] branches=- | result=pc1, val [CALLS-INTERNAL] String substVars(String input, PropertyContainer pc0, PropertyContainer pc1) */
/* static context [FOCAL] public static String OptionHelper.substVars(String val, PropertyContainer pc1) [INPUTS] branches=- | result=pc1, val [CALLS-INTERNAL] String substVars(String input, PropertyContainer pc0, PropertyContainer pc1) */ class OptionHelper { public static String substVars(String val, PropertyConta...
true
ok
{"focal": {"class": "OptionHelper", "name": "substVars", "signature": "String substVars(String val, PropertyContainer pc1)", "start_line": 3, "modifiers": "public static", "params": [{"name": "val", "type": "String"}, {"name": "pc1", "type": "PropertyContainer"}], "return_type": "String"}, "class_info": {"name": "Optio...
1971346_2
class MessagePackGenerator extends GeneratorBase { @Override public void close() throws IOException { try { flush(); } finally { if (isEnabled(Feature.AUTO_CLOSE_TARGET)) { MessagePacker messagePacker = getMessagePacker(); ...
File tempFile = createTempFile(); OutputStream out = new FileOutputStream(tempFile); MessagePackFactory messagePackFactory = new MessagePackFactory(); ObjectMapper objectMapper = new ObjectMapper(messagePackFactory); objectMapper.configure(JsonGenerator.Feature.AUTO_CLOSE_TARGET,...
[FOCAL] @Override public void MessagePackGenerator.close() [CLASS] class MessagePackGenerator extends GeneratorBase [METRICS] loc=14 cc=3 branches=1 loops=0 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] MessagePacker getMessagePacker(); void flush() [CALLS-EXTERNAL] isEnabled/1 (inherited), MessagePacker.close/0 [EXCEP...
/* static context [FOCAL] @Override public void MessagePackGenerator.close() [PATH1] try-body throws -> if(isEnabled(Feature.AUTO_CLOSE_TARGET))=T [PATH2] if(isEnabled(Feature.AUTO_CLOSE_TARGET))=F [EXCEPTIONS] declares IOException [CALLS-INTERNAL] MessagePacker getMessagePacker(); void flush() [CALLS-EXTERNAL] isEnabl...
/* static context [FOCAL] @Override public void MessagePackGenerator.close() [PATH1] try-body throws -> if(isEnabled(Feature.AUTO_CLOSE_TARGET))=T [PATH2] if(isEnabled(Feature.AUTO_CLOSE_TARGET))=F [EXCEPTIONS] declares IOException [CALLS-INTERNAL] MessagePacker getMessagePacker(); void flush() [CALLS-EXTERNAL] isEnabl...
true
ok
{"focal": {"class": "MessagePackGenerator", "name": "close", "signature": "void close() throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "MessagePackGenerator", "kind": "class", "modifiers": "", "superclass": "GeneratorBase", "interfaces...
1971919_26
class ReplicationSink { public void replicateEntries(HLog.Entry[] entries) throws IOException { if (entries.length == 0) { return; } // Very simple optimization where we batch sequences of rows going // to the same table. try { long totalReplicated = 0; // Map of table => ...
HLog.Entry[] entries = new HLog.Entry[3]; for(int i = 0; i < 3; i++) { entries[i] = createEntry(TABLE_NAME1, i, KeyValue.Type.Put); } SINK.replicateEntries(entries); entries = new HLog.Entry[3]; entries[0] = createEntry(TABLE_NAME1, 0, KeyValue.Type.DeleteColumn); entries[1] = createE...
[FOCAL] public void ReplicationSink.replicateEntries(HLog.Entry[] entries) [CLASS] class ReplicationSink [METRICS] loc=62 cc=12 branches=6 loops=4 returns=1 throws=1 nesting=6 [CALLS-INTERNAL] void delete(byte[] tableName, Delete delete); void put(byte[] tableName, List<Put> puts) [CALLS-EXTERNAL] HLog.Entry.getEdit/0,...
/* static context [FOCAL] public void ReplicationSink.replicateEntries(HLog.Entry[] entries) [THROWS-WHEN] ex when !(entries.length == 0) && try-body throws [PATH1] if(entries.length == 0)=F -> foreach(HLog.Entry entry : entries)=T -> if(kvs.get(0).isDelete())=T -> foreach(KeyValue kv : kvs)#1=T -> if(kv.isDeleteFamily...
/* static context [FOCAL] public void ReplicationSink.replicateEntries(HLog.Entry[] entries) [THROWS-WHEN] ex when !(entries.length == 0) && try-body throws [PATH1] if(entries.length == 0)=F -> foreach(HLog.Entry entry : entries)=T -> if(kvs.get(0).isDelete())=T -> foreach(KeyValue kv : kvs)#1=T -> if(kv.isDeleteFamily...
true
ok
{"focal": {"class": "ReplicationSink", "name": "replicateEntries", "signature": "void replicateEntries(HLog.Entry[] entries) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "entries", "type": "HLog.Entry[]"}], "return_type": "void"}, "class_info": {"name": "ReplicationSink", "kind": "cl...
1980382_73
class FsEntryHBaseCommon { public static byte typeVal(Object o) { if (o instanceof Long || o instanceof Integer) { return LONG; } else if (o instanceof String) { return STRING; } else if (o instanceof Date) { return DATE; } else if (o instanceof Map || o instanceof List)...
assertEquals(DATE, typeVal(new Date())); } }
[FOCAL] public static byte FsEntryHBaseCommon.typeVal(Object o) [CLASS] class FsEntryHBaseCommon [METRICS] loc=26 cc=8 branches=7 loops=0 returns=8 throws=0 nesting=7 [PATH1] if(o instanceof Long || o instanceof Integer)=F -> if(o instanceof String)=F -> if(o instanceof Date)=F -> if(o instanceof Map || o instanceof Li...
/* static context [FOCAL] public static byte FsEntryHBaseCommon.typeVal(Object o) [PATH1] if(o instanceof Long || o instanceof Integer)=F -> if(o instanceof String)=F -> if(o instanceof Date)=F -> if(o instanceof Map || o instanceof List)=F -> if(o instanceof byte[])=F -> if(o instanceof BufferProxy)=F -> if(o instance...
/* static context [FOCAL] public static byte FsEntryHBaseCommon.typeVal(Object o) [PATH1] if(o instanceof Long || o instanceof Integer)=F -> if(o instanceof String)=F -> if(o instanceof Date)=F -> if(o instanceof Map || o instanceof List)=F -> if(o instanceof byte[])=F -> if(o instanceof BufferProxy)=F -> if(o instance...
true
ok
{"focal": {"class": "FsEntryHBaseCommon", "name": "typeVal", "signature": "byte typeVal(Object o)", "start_line": 3, "modifiers": "public static", "params": [{"name": "o", "type": "Object"}], "return_type": "byte"}, "class_info": {"name": "FsEntryHBaseCommon", "kind": "class", "modifiers": "", "superclass": null, "inte...
1981819_4
class CategoryStringGenerator { public static List<String> getPostgresCategoryString(String searchString, Map<String, String> mapPrefix, String prefixSplit ) { List<String> finalList = new ArrayList<String>(); if (searchString == null || !(searchString.trim().length() > 0)) { finalL...
List<String> result = CategoryStringGenerator.getPostgresCategoryString(SINGLE_CAT, Collections.EMPTY_MAP, null ); assertEquals( result.size(), 1 ); assertEquals(result.get( 0 ), SINGLE_CAT_RESULT); } }
[FOCAL] public static List<String> CategoryStringGenerator.getPostgresCategoryString(String searchString, Map<String, String> mapPrefix, String prefixSplit) [CLASS] class CategoryStringGenerator [METRICS] loc=58 cc=7 branches=5 loops=1 returns=2 throws=1 nesting=4 [CALLS-INTERNAL] List<String> parse(String searchString...
/* static context [FOCAL] public static List<String> CategoryStringGenerator.getPostgresCategoryString(String searchString, Map<String, String> mapPrefix, String prefixSplit) [THROWS-WHEN] IllegalArgumentException when !(searchString == null || !(searchString.trim().length() > 0)) && foreach(String cat : categories)=T ...
/* static context [FOCAL] public static List<String> CategoryStringGenerator.getPostgresCategoryString(String searchString, Map<String, String> mapPrefix, String prefixSplit) [THROWS-WHEN] IllegalArgumentException when !(searchString == null || !(searchString.trim().length() > 0)) && foreach(String cat : categories)=T ...
true
ok
{"focal": {"class": "CategoryStringGenerator", "name": "getPostgresCategoryString", "signature": "List<String> getPostgresCategoryString(String searchString, Map<String, String> mapPrefix, String prefixSplit)", "start_line": 3, "modifiers": "public static", "params": [{"name": "searchString", "type": "String"}, {"name"...
1982584_1
class PGNUtils { public static String toNormalizedSAN(final String pChaine) { assert pChaine != null; final StringBuilder res = new StringBuilder(pChaine); // Le marqueur 'P' pour les pions est possible avec PGN, pas avec SAN... if (res.charAt(0) == 'P') { res.deleteCharAt(0); } ...
assertEquals("e3", toNormalizedSAN("e3")); assertEquals("e3", toNormalizedSAN("Pe3")); assertEquals("a8Q", toNormalizedSAN("a8Q")); assertEquals("a8Q", toNormalizedSAN("a8=Q")); assertEquals("Rd6", toNormalizedSAN("Rd6")); assertEquals("Rd6", toNormalizedSAN("Rd6?")); assertEquals("Rd6", toN...
[FOCAL] public static String PGNUtils.toNormalizedSAN(String pChaine) [CLASS] class PGNUtils [METRICS] loc=36 cc=5 branches=1 loops=3 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] StringBuilder.charAt/1, StringBuilder.deleteCharAt/1, StringBuilder.indexOf/1, StringBuilder.length/0, "?!".indexOf/1, StringBuilder.toStrin...
/* static context [FOCAL] public static String PGNUtils.toNormalizedSAN(String pChaine) [PATH1] if(res.charAt(0) == 'P')=T -> while(p >= 0)#1=T -> exit loop -> while((res.length() > 0) && ("?!".indexOf(res.charAt(res.length() - 1)) >= 0))=F -> while(p >= 0)#2=F -> return res.toString() [PATH2] if(res.charAt(0) == 'P')=...
/* static context [FOCAL] public static String PGNUtils.toNormalizedSAN(String pChaine) [PATH1] if(res.charAt(0) == 'P')=T -> while(p >= 0)#1=T -> exit loop -> while((res.length() > 0) && ("?!".indexOf(res.charAt(res.length() - 1)) >= 0))=F -> while(p >= 0)#2=F -> return res.toString() [PATH2] if(res.charAt(0) == 'P')=...
true
ok
{"focal": {"class": "PGNUtils", "name": "toNormalizedSAN", "signature": "String toNormalizedSAN(String pChaine)", "start_line": 3, "modifiers": "public static", "params": [{"name": "pChaine", "type": "String"}], "return_type": "String"}, "class_info": {"name": "PGNUtils", "kind": "class", "modifiers": "", "superclass":...
1984080_19
class RoadSegment extends DefaultWeightedEdge implements Iterable<Vehicle> { public void outFlow(double dt, double simulationTime, long iterationCount) { updateSignalPointsBeforeOutflow(simulationTime); for (final LaneSegment laneSegment : laneSegments) { laneSegment.outFlow(dt, simulat...
RoadSegment.resetNextId(); Vehicle.resetNextId(); final int laneCount = 1; final RoadSegment r0 = new RoadSegment(1000.0, laneCount); final RoadSegment r1 = new RoadSegment(5000.0, laneCount); // join r0 and r1 so vehicles move from r0 to r1 Link.addJoin(r0, r1);...
[FOCAL] public void RoadSegment.outFlow(double dt, double simulationTime, long iterationCount) [CLASS] class RoadSegment extends DefaultWeightedEdge implements Iterable<Vehicle> [METRICS] loc=11 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void updateSignalPointsBeforeOutflow(double simulationT...
class RoadSegment extends DefaultWeightedEdge implements Iterable<Vehicle> { public void outFlow(double dt, double simulationTime, long iterationCount) { updateSignalPointsBeforeOutflow(simulationTime); for (final LaneSegment laneSegment : laneSegments) { laneSegment.outFlow(dt, simulat...
false
ok
{"focal": {"class": "RoadSegment", "name": "outFlow", "signature": "void outFlow(double dt, double simulationTime, long iterationCount)", "start_line": 3, "modifiers": "public", "params": [{"name": "dt", "type": "double"}, {"name": "simulationTime", "type": "double"}, {"name": "iterationCount", "type": "long"}], "retur...
2003641_100
class SpecFilter { public OpenAPI filter(OpenAPI openAPI, OpenAPISpecFilter filter, Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers) { OpenAPI filteredOpenAPI = filterOpenAPI(filter, openAPI, params, cookies, headers); if (filteredOpenAPI == null) { ...
final OpenAPI openAPI = getOpenAPI(RESOURCE_DEPRECATED_OPERATIONS); final RemoveUnreferencedDefinitionsFilter remover = new RemoveUnreferencedDefinitionsFilter(); final OpenAPI filtered = new SpecFilter().filter(openAPI, remover, null, null, null); Operation operation = filtered.getPath...
[FOCAL] public OpenAPI SpecFilter.filter(OpenAPI openAPI, OpenAPISpecFilter filter, Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers) [CLASS] class SpecFilter [METRICS] loc=103 cc=16 branches=12 loops=3 returns=2 throws=0 nesting=6 [CALLS-INTERNAL] Map<String, Schema> fil...
class SpecFilter { public OpenAPI filter(OpenAPI openAPI, OpenAPISpecFilter filter, Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers) { OpenAPI filteredOpenAPI = filterOpenAPI(filter, openAPI, params, cookies, headers); if (filteredOpenAPI == null) { ...
false
ok
{"focal": {"class": "SpecFilter", "name": "filter", "signature": "OpenAPI filter(OpenAPI openAPI, OpenAPISpecFilter filter, Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers)", "start_line": 3, "modifiers": "public", "params": [{"name": "openAPI", "type": "OpenAPI"}, {"nam...
2008119_4
class EntityResource extends ServerResource { @Get("json") public Representation getEntity() { // extract necessary information from the context CollabinateReader reader = (CollabinateReader)getContext() .getAttributes().get("collabinateReader"); String tenantId = getAttribute("tenantId"); String entity...
Tag etag = get().getEntity().getTag(); Request request = getRequest(Method.DELETE, null); Conditions conditions = new Conditions(); conditions.getMatch().add(etag); request.setConditions(conditions); assertEquals(Status.SUCCESS_NO_CONTENT, getResponse(request).getStatus()); } }
[FOCAL] @Get("json") public Representation EntityResource.getEntity() [CLASS] class EntityResource extends ServerResource [METRICS] loc=19 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] getContext() .getAttributes().get/1, getContext().getAttributes/0, getContext/0 (inherited), getAttribute/1 (in...
/* static context [FOCAL] @Get("json") public Representation EntityResource.getEntity() [NEW] StringRepresentation, Tag [CALLS-EXTERNAL] getContext() .getAttributes().get/1, getContext().getAttributes/0, getContext/0 (inherited), getAttribute/1 (inherited), reader.getEntity(tenantId, entityId).toString/0, CollabinateRe...
/* static context [FOCAL] @Get("json") public Representation EntityResource.getEntity() [NEW] StringRepresentation, Tag [CALLS-EXTERNAL] getContext() .getAttributes().get/1, getContext().getAttributes/0, getContext/0 (inherited), getAttribute/1 (inherited), reader.getEntity(tenantId, entityId).toString/0, CollabinateRe...
true
ok
{"focal": {"class": "EntityResource", "name": "getEntity", "signature": "Representation getEntity()", "start_line": 3, "modifiers": "@Get(\"json\") public", "params": [], "return_type": "Representation"}, "class_info": {"name": "EntityResource", "kind": "class", "modifiers": "", "superclass": "ServerResource", "interfa...
2009311_17
class ReadOnlyInterceptor implements Serializable { @AroundInvoke public Object markReadOnly(InvocationContext ic) throws Exception { try { return ic.proceed(); } finally { utTransactionHolder.getUserTransaction().setRollbackOnly(); } } public ReadOnlyInterceptor(); public ReadOnly...
transactionFactory.expectNoTransaction(); transactionFactory.expectBeginTransaction(); transactionFactory.expectSetRollbackOnly(); transactionFactory.expectRollbackTransaction(); transactionFactory.replay(); try { // a mock that expects two proceed calls and returns the read only interc...
[FOCAL] @AroundInvoke public Object ReadOnlyInterceptor.markReadOnly(InvocationContext ic) [CLASS] class ReadOnlyInterceptor implements Serializable [METRICS] loc=8 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] InvocationContext.proceed/0, utTransactionHolder.getUserTransaction().setRollbackOnly...
/* static context [FOCAL] @AroundInvoke public Object ReadOnlyInterceptor.markReadOnly(InvocationContext ic) [PATH1] return ic.proceed() [PATH2] try-body throws [INPUTS] branches=- | result=ic [COLLABORATORS] param ic:InvocationContext proceed/0; field utTransactionHolder getUserTransaction/0 [EXCEPTIONS] declares Exce...
/* static context [FOCAL] @AroundInvoke public Object ReadOnlyInterceptor.markReadOnly(InvocationContext ic) [PATH1] return ic.proceed() [PATH2] try-body throws [INPUTS] branches=- | result=ic [COLLABORATORS] param ic:InvocationContext proceed/0; field utTransactionHolder getUserTransaction/0 [EXCEPTIONS] declares Exce...
true
ok
{"focal": {"class": "ReadOnlyInterceptor", "name": "markReadOnly", "signature": "Object markReadOnly(InvocationContext ic) throws Exception", "start_line": 3, "modifiers": "@AroundInvoke public", "params": [{"name": "ic", "type": "InvocationContext"}], "return_type": "Object"}, "class_info": {"name": "ReadOnlyIntercept...
2009635_0
class PkgInt { public int unpack(int i) { return ( (this.data[i>>this.indexShift] >> ((i&this.shiftMask)<<this.bitShift)) & this.unitMask ); } public PkgInt( int indexShift, int shiftMask, int bitShift, int unitMa...
int[] data = new int[] { PkgInt.pack4bits(0, 1, 2, 3, 4, 5, 6, 7), PkgInt.pack4bits(8, 9, 10, 11, 12, 13, 14, 15) }; PkgInt pkg = new PkgInt( PkgInt.INDEX_SHIFT_4BITS, PkgInt.SHIFT_MASK_4BITS, PkgInt.BIT_SHI...
[FOCAL] public int PkgInt.unpack(int i) [CLASS] class PkgInt [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=bitShift, data, indexShift, shiftMask, unitMask [INPUTS] branches=- | result=i [DATAFLOW] i@param->L3 [CLASS-MEMBERS] PkgInt(int indexShift, int shiftMask, int bitShift, int un...
/* static context [FOCAL] public int PkgInt.unpack(int i) [INPUTS] branches=- | result=i [FIELDS] read=bitShift, data, indexShift, shiftMask, unitMask */
/* static context [FOCAL] public int PkgInt.unpack(int i) [INPUTS] branches=- | result=i [FIELDS] read=bitShift, data, indexShift, shiftMask, unitMask */ class PkgInt { public int unpack(int i) { return ( (this.data[i>>this.indexShift] >> ((i&this.shiftMask)<<this.bitShift)) & this.unit...
true
ok
{"focal": {"class": "PkgInt", "name": "unpack", "signature": "int unpack(int i)", "start_line": 3, "modifiers": "public", "params": [{"name": "i", "type": "int"}], "return_type": "int"}, "class_info": {"name": "PkgInt", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [...
2011647_130
class ATransformable3D implements IGraphNodeMember { public Quaternion getOrientation(Quaternion quat) { quat.setAll(mOrientation); return quat; } public ATransformable3D(); protected void markModelMatrixDirty(); public boolean onRecalculateModelMatrix(Matrix4 parentMatrix); ...
Quaternion result = transformable.getOrientation(); assertEquals(1, result.w, 1e-10); assertEquals(0, result.x, 1e-10); assertEquals(0, result.y, 1e-10); assertEquals(0, result.z, 1e-10); } }
[FOCAL] public Quaternion ATransformable3D.getOrientation(Quaternion quat) [CLASS] class ATransformable3D implements IGraphNodeMember [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Quaternion.setAll/1 [INPUTS] branches=- | result=quat [COLLABORATORS] param quat:Quaternion setAll/1...
/* static context [FOCAL] public Quaternion ATransformable3D.getOrientation(Quaternion quat) [INPUTS] branches=- | result=quat [COLLABORATORS] param quat:Quaternion setAll/1 [CALLS-EXTERNAL] Quaternion.setAll/1 */
/* static context [FOCAL] public Quaternion ATransformable3D.getOrientation(Quaternion quat) [INPUTS] branches=- | result=quat [COLLABORATORS] param quat:Quaternion setAll/1 [CALLS-EXTERNAL] Quaternion.setAll/1 */ class ATransformable3D implements IGraphNodeMember { public Quaternion getOrientation(Quaternion quat...
true
ok
{"focal": {"class": "ATransformable3D", "name": "getOrientation", "signature": "Quaternion getOrientation(Quaternion quat)", "start_line": 3, "modifiers": "public", "params": [{"name": "quat", "type": "Quaternion"}], "return_type": "Quaternion"}, "class_info": {"name": "ATransformable3D", "kind": "class", "modifiers": ...
2023409_11
class LogRepositoryReadJdbc implements LogRepositoryRead { @Override public void getStatementsGroupByFilledSQL(final LogSearchCriteria searchCriteria, final ResultSetAnalyzer analyzer) { final StringBuilder sql = new StringBuilder( "select * from (select min(id) as ID, state...
final List<StatementFullyExecutedLog> logs = insert3Logs(); final StatementFullyExecutedLog log1 = logs.get(0); repositoryUpdate.addTxCompletionLog(new TxCompleteLog(log1.getConnectionUuid(), System.currentTimeMillis(), TxCompletionType.COMMIT, 321, "mythread", null)); f...
[FOCAL] @Override public void LogRepositoryReadJdbc.getStatementsGroupByFilledSQL(LogSearchCriteria searchCriteria, ResultSetAnalyzer analyzer) [CLASS] class LogRepositoryReadJdbc implements LogRepositoryRead [METRICS] loc=40 cc=6 branches=4 loops=0 returns=0 throws=1 nesting=2 [CALLS-INTERNAL] boolean addWhereClause(S...
/* static context [FOCAL] @Override public void LogRepositoryReadJdbc.getStatementsGroupByFilledSQL(LogSearchCriteria searchCriteria, ResultSetAnalyzer analyzer) [THROWS-WHEN] RuntimeException when searchCriteria.getFilter() != null && searchCriteria.getMinDurationNanos() != null && searchCriteria.getSqlPassThroughFilt...
/* static context [FOCAL] @Override public void LogRepositoryReadJdbc.getStatementsGroupByFilledSQL(LogSearchCriteria searchCriteria, ResultSetAnalyzer analyzer) [THROWS-WHEN] RuntimeException when searchCriteria.getFilter() != null && searchCriteria.getMinDurationNanos() != null && searchCriteria.getSqlPassThroughFilt...
true
ok
{"focal": {"class": "LogRepositoryReadJdbc", "name": "getStatementsGroupByFilledSQL", "signature": "void getStatementsGroupByFilledSQL(LogSearchCriteria searchCriteria, ResultSetAnalyzer analyzer)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "searchCriteria", "type": "LogSearchCriteria"}, {"n...
2036666_0
class DefaultCouchManager implements LocalCouch { public static int findFreePort() throws IOException { ServerSocket server = new ServerSocket(0); int port = server.getLocalPort(); server.close(); return port; } public void setCouchDownloader(CouchDownloader couchDownloader); p...
int port = DefaultCouchManager.findFreePort(); System.out.println("Port: " + port); assertTrue(port > 0); } }
[FOCAL] public static int DefaultCouchManager.findFreePort() [CLASS] class DefaultCouchManager implements LocalCouch [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ServerSocket.getLocalPort/0, ServerSocket.close/0 [NEW] ServerSocket [EXCEPTIONS] declares IOException [DATAFLOW] por...
/* static context [FOCAL] public static int DefaultCouchManager.findFreePort() [EXCEPTIONS] declares IOException [NEW] ServerSocket [CALLS-EXTERNAL] ServerSocket.getLocalPort/0, ServerSocket.close/0 */
/* static context [FOCAL] public static int DefaultCouchManager.findFreePort() [EXCEPTIONS] declares IOException [NEW] ServerSocket [CALLS-EXTERNAL] ServerSocket.getLocalPort/0, ServerSocket.close/0 */ class DefaultCouchManager implements LocalCouch { public static int findFreePort() throws IOException { Ser...
true
ok
{"focal": {"class": "DefaultCouchManager", "name": "findFreePort", "signature": "int findFreePort() throws IOException", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "int"}, "class_info": {"name": "DefaultCouchManager", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "...
2037955_0
class JsonSerDe extends AbstractSerDe { @Override public Object deserialize(Writable w) throws SerDeException { Text rowText = (Text) w; deserializedDataSize = rowText.getBytes().length; // Try parsing row into JSON object Object jObj = null; try { ...
JsonSerDe instance = new JsonSerDe(); initialize(instance); System.out.println("deserialize"); Writable w = new Text("{\"one\":true,\"three\":[\"red\",\"yellow\",\"orange\"],\"two\":19.5,\"four\":\"poop\"}"); JSONObject result = (JSONObject) instance.deserialize(w); ...
[FOCAL] @Override public Object JsonSerDe.deserialize(Writable w) [CLASS] class JsonSerDe extends AbstractSerDe [METRICS] loc=29 cc=5 branches=2 loops=0 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] void onMalformedJson(String msg) [CALLS-EXTERNAL] Text.getBytes/0, rowText.toString().trim/0, Text.toString/0, String.sta...
/* static context [FOCAL] @Override public Object JsonSerDe.deserialize(Writable w) [PATH1] if(txt.startsWith("{"))=F -> if(txt.startsWith("["))=T -> return jObj [PATH2] try-body throws -> return jObj [PATH3] if(txt.startsWith("{"))=T -> return jObj [PATH4] if(txt.startsWith("{"))=F -> if(txt.startsWith("["))=F -> retu...
/* static context [FOCAL] @Override public Object JsonSerDe.deserialize(Writable w) [PATH1] if(txt.startsWith("{"))=F -> if(txt.startsWith("["))=T -> return jObj [PATH2] try-body throws -> return jObj [PATH3] if(txt.startsWith("{"))=T -> return jObj [PATH4] if(txt.startsWith("{"))=F -> if(txt.startsWith("["))=F -> retu...
true
ok
{"focal": {"class": "JsonSerDe", "name": "deserialize", "signature": "Object deserialize(Writable w) throws SerDeException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "w", "type": "Writable"}], "return_type": "Object"}, "class_info": {"name": "JsonSerDe", "kind": "class", "modifiers": "", "s...
2038852_35
class HostValidator implements ResourceValidator<Host> { @Override public ValidatorResult validate(Host host, Object ctx) { return validator.validate(host, ctx); } public HostValidator(); @Override public Validator<Host> getValidator(); private HostValidator hv; private Host hos...
host.setClusterId(null); res = hv.validate(host, POST); assertFalse(resultMessage(res, POST), res.passedValidation()); } }
[FOCAL] @Override public ValidatorResult HostValidator.validate(Host host, Object ctx) [CLASS] class HostValidator implements ResourceValidator<Host> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] validator.validate/2 [INPUTS] branches=- | result=ctx, host [COLLABORATORS] field va...
/* static context [FOCAL] @Override public ValidatorResult HostValidator.validate(Host host, Object ctx) [INPUTS] branches=- | result=ctx, host [COLLABORATORS] field validator validate/2 [CALLS-EXTERNAL] validator.validate/2 */
/* static context [FOCAL] @Override public ValidatorResult HostValidator.validate(Host host, Object ctx) [INPUTS] branches=- | result=ctx, host [COLLABORATORS] field validator validate/2 [CALLS-EXTERNAL] validator.validate/2 */ class HostValidator implements ResourceValidator<Host> { @Override public Validator...
true
ok
{"focal": {"class": "HostValidator", "name": "validate", "signature": "ValidatorResult validate(Host host, Object ctx)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "host", "type": "Host"}, {"name": "ctx", "type": "Object"}], "return_type": "ValidatorResult"}, "class_info": {"name": "HostValid...
2044534_5
class AbstractMessageHandler implements CommunicationsHandler { private boolean write(ByteBuffer[] buffers) { try { long written = handler.getChannel().write(buffers); if (getLog().isTraceEnabled()) { getLog().trace(format("%s bytes written", written)); }...
final NoSecurityImpl wireSecurity = new NoSecurityImpl(); MsgHandler msgHandler = new MsgHandler(wireSecurity); SocketChannelHandler handler = mock(SocketChannelHandler.class); SocketChannel channel = mock(SocketChannel.class); final List<SerializedMsg> msgs = new ArrayList<Seri...
[FOCAL] private boolean AbstractMessageHandler.write(ByteBuffer[] buffers) [CLASS] class AbstractMessageHandler implements CommunicationsHandler [METRICS] loc=35 cc=10 branches=7 loops=0 returns=5 throws=0 nesting=4 [CALLS-INTERNAL] Logger getLog(); boolean isClose(IOException ioe); void close(); void error() [CALLS-EX...
/* static context [FOCAL] private boolean AbstractMessageHandler.write(ByteBuffer[] buffers) [PATH1] if(getLog().isTraceEnabled())#1=T -> if(written < 0)=F -> if(buffers[buffers.length - 1].hasRemaining())=T -> if(plusWritten < 0)=F -> if(getLog().isTraceEnabled())#2=T -> return true [PATH2] try-body throws -> if(getLo...
/* static context [FOCAL] private boolean AbstractMessageHandler.write(ByteBuffer[] buffers) [PATH1] if(getLog().isTraceEnabled())#1=T -> if(written < 0)=F -> if(buffers[buffers.length - 1].hasRemaining())=T -> if(plusWritten < 0)=F -> if(getLog().isTraceEnabled())#2=T -> return true [PATH2] try-body throws -> if(getLo...
true
ok
{"focal": {"class": "AbstractMessageHandler", "name": "write", "signature": "boolean write(ByteBuffer[] buffers)", "start_line": 3, "modifiers": "private", "params": [{"name": "buffers", "type": "ByteBuffer[]"}], "return_type": "boolean"}, "class_info": {"name": "AbstractMessageHandler", "kind": "class", "modifiers": "...
2046220_5
class CodeGenParser { public DBDatabase loadDbModel() { DBDatabase db = new InMemoryDatabase(); try { con = openJDBCConnection(config); populateDatabase(db); } catch (SQLException e) { throw new RuntimeException("Unable to read database m...
final DBDatabase db = parser.loadDbModel(); final DBTable departments = db.getTable("DEPARTMENTS"); final DBTable employees = db.getTable("EMPLOYEES"); assertNotNull("Expected DEPARTMENTS table.", departments); assertNotNull("Expected EMPLOYEES table.", employees); final Lis...
[FOCAL] public DBDatabase CodeGenParser.loadDbModel() [CLASS] class CodeGenParser [METRICS] loc=16 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] Connection openJDBCConnection(CodeGenConfig config); void populateDatabase(DBDatabase db) [CALLS-EXTERNAL] SQLException.getMessage/0, DBUtil.close/2 [N...
/* static context [FOCAL] public DBDatabase CodeGenParser.loadDbModel() [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException("Unable to read database metadata: " + e.getMe... [PATH2] return db [EXCEPTIONS] throws RuntimeException; catches SQLException e [CALLS-INTERN...
/* static context [FOCAL] public DBDatabase CodeGenParser.loadDbModel() [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException("Unable to read database metadata: " + e.getMe... [PATH2] return db [EXCEPTIONS] throws RuntimeException; catches SQLException e [CALLS-INTERN...
true
ok
{"focal": {"class": "CodeGenParser", "name": "loadDbModel", "signature": "DBDatabase loadDbModel()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "DBDatabase"}, "class_info": {"name": "CodeGenParser", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "...
2055952_0
class Datapoint { public String toString() { return "X=" + mX + ", Y=" + mY; } public Datapoint(); public Datapoint(long x, long y); } class DatapointTest { @Test public void toStringReturnsValue() throws Exception {
Datapoint p1 = new Datapoint(); Datapoint p2 = new Datapoint(12, 45); String s1 = p1.toString(); String s2 = p2.toString(); assertTrue(p1.mX == 0); assertTrue(p1.mY == 0); assertTrue(s1.equals("X=" + p1.mX + ", Y=" + p1.mY)); assertTrue(s2.equals("X=" + p2.mX + ", Y=" + p2.mY)); } }
[FOCAL] public String Datapoint.toString() [CLASS] class Datapoint [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Datapoint(); Datapoint(long x, long y) [TEST] DatapointTest: @Test public void toStringReturnsValue() throws Exception
/* static context [FOCAL] public String Datapoint.toString() */
/* static context [FOCAL] public String Datapoint.toString() */ class Datapoint { public String toString() { return "X=" + mX + ", Y=" + mY; } public Datapoint(); public Datapoint(long x, long y); } class DatapointTest { @Test public void toStringReturnsValue() throws Exception {
true
ok
{"focal": {"class": "Datapoint", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Datapoint", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Datapoi...
2058044_1
class TypeConverter { public static Value asResource(java.net.URI uri) { return Values.literal(uri.toString()); } public static Value asLiteral(Object o); public static Value asLiteral(Date date); public static Value asLiteral(java.net.URI uri); public static Value asLiteral(Integer i); public static Value a...
URI b = null; try { b = new URI("http://stardog.com"); } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } Value resource = TypeConverter.asResource(b); assertNotNull(resource); } }
[FOCAL] public static Value TypeConverter.asResource(java.net.URI uri) [CLASS] class TypeConverter [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Values.literal/1, java.net.URI.toString/0 [INPUTS] branches=- | result=uri [COLLABORATORS] param uri:java.net.URI toString/0 [DATAFLOW]...
/* static context [FOCAL] public static Value TypeConverter.asResource(java.net.URI uri) [INPUTS] branches=- | result=uri [COLLABORATORS] param uri:java.net.URI toString/0 [CALLS-EXTERNAL] Values.literal/1, java.net.URI.toString/0 */
/* static context [FOCAL] public static Value TypeConverter.asResource(java.net.URI uri) [INPUTS] branches=- | result=uri [COLLABORATORS] param uri:java.net.URI toString/0 [CALLS-EXTERNAL] Values.literal/1, java.net.URI.toString/0 */ class TypeConverter { public static Value asResource(java.net.URI uri) { return Va...
true
ok
{"focal": {"class": "TypeConverter", "name": "asResource", "signature": "Value asResource(java.net.URI uri)", "start_line": 3, "modifiers": "public static", "params": [{"name": "uri", "type": "java.net.URI"}], "return_type": "Value"}, "class_info": {"name": "TypeConverter", "kind": "class", "modifiers": "", "superclass...
2064018_16
class Annotate { public static List<Annotation> readLabelFile(final Reader fileReader) throws IOException { List<Annotation> annotations = new ArrayList<Annotation>(); BufferedReader reader = new BufferedReader(fileReader); String line; while ((line = reader.readLine())...
URL url = AnnotateTest.class.getResource("/test-labels.txt"); Reader reader = new InputStreamReader(url.openStream()); List<Annotation> annotations = Annotate.readLabelFile(reader); Annotation a1 = annotations.get(0); assertEquals(new CIDR("0.0.0.0/8"), a1.getCidr()); as...
[FOCAL] public static List<Annotation> Annotate.readLabelFile(Reader fileReader) [CLASS] class Annotate [METRICS] loc=17 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] BufferedReader.readLine/0, String.split/1, List<Annotation>.add/1 [NEW] ArrayList<Annotation>, BufferedReader, Annotation, CIDR [...
/* static context [FOCAL] public static List<Annotation> Annotate.readLabelFile(Reader fileReader) [PATH1] while((line = reader.readLine()) != null)=T -> exit loop -> return annotations [PATH2] while((line = reader.readLine()) != null)=F -> return annotations [INPUTS] branches=fileReader | result=- [EXCEPTIONS] declare...
/* static context [FOCAL] public static List<Annotation> Annotate.readLabelFile(Reader fileReader) [PATH1] while((line = reader.readLine()) != null)=T -> exit loop -> return annotations [PATH2] while((line = reader.readLine()) != null)=F -> return annotations [INPUTS] branches=fileReader | result=- [EXCEPTIONS] declare...
true
ok
{"focal": {"class": "Annotate", "name": "readLabelFile", "signature": "List<Annotation> readLabelFile(Reader fileReader) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "fileReader", "type": "Reader"}], "return_type": "List<Annotation>"}, "class_info": {"name": "Annotate", "kind"...
2073724_0
class BWPalette extends ColorPalette { @Override public int getColorInt(float intensity) { return (intensity > 0.5) ? 0xffffffff: 0xff000000; } @Override public int[] getColorsInt(); } class BWPaletteTest { @Test public void getColorInt() throws Exception {
BWPalette bwp = new BWPalette(); //return black for < 0.5, white otherwise assertEquals(0xff000000, bwp.getColorInt(0.1f)); assertEquals(0xffffffff, bwp.getColorInt(0.9f)); } }
[FOCAL] @Override public int BWPalette.getColorInt(float intensity) [CLASS] class BWPalette extends ColorPalette [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=intensity [DATAFLOW] intensity@param->L3 [CLASS-MEMBERS] int[] getColorsInt() [TEST] BWPaletteTest: @Test pub...
/* static context [FOCAL] @Override public int BWPalette.getColorInt(float intensity) [INPUTS] branches=- | result=intensity */
/* static context [FOCAL] @Override public int BWPalette.getColorInt(float intensity) [INPUTS] branches=- | result=intensity */ class BWPalette extends ColorPalette { @Override public int getColorInt(float intensity) { return (intensity > 0.5) ? 0xffffffff: 0xff000000; } @Override public int[] getColorsInt(); ...
true
ok
{"focal": {"class": "BWPalette", "name": "getColorInt", "signature": "int getColorInt(float intensity)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "intensity", "type": "float"}], "return_type": "int"}, "class_info": {"name": "BWPalette", "kind": "class", "modifiers": "", "superclass": "Color...
2080454_21
class SongTo extends TrackTo implements AlbumAndSongInfo { @Override public boolean equals(final Object other) { if (!(other instanceof SongTo)) return false; SongTo castOther = (SongTo) other; return new EqualsBuilder().appendSuper(super.equals(other)) .append(getType(), castOther.getType()) .appen...
Date dateAdded = new Date(); Date dateModified = new Date(); Date skipDate = new Date(); SongTo song1 = new SongTo("Invisible", "Rainbow in the Dark", "Dio", "Dio", 1983, "Dio", "Rock", false, dateAdded, dateModified, new RatingTo(100), 100, skipDate, 0, true, new RatingTo(100), false, 7, 1, 100); ...
[FOCAL] @Override public boolean SongTo.equals(Object other) [CLASS] class SongTo extends TrackTo implements AlbumAndSongInfo [METRICS] loc=17 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] TrackToType getType(); boolean isPodcast() [CALLS-EXTERNAL] new EqualsBuilder().appendSuper(super.equals(ot...
/* static context [FOCAL] @Override public boolean SongTo.equals(Object other) [PATH1] if(!(other instanceof SongTo))=T -> return false [PATH2] if(!(other instanceof SongTo))=F -> return new EqualsBuilder().appendSuper(super.equals(other)) .append(getTyp... [INPUTS] branches=other | result=other [CALLS-INTERNAL] TrackT...
/* static context [FOCAL] @Override public boolean SongTo.equals(Object other) [PATH1] if(!(other instanceof SongTo))=T -> return false [PATH2] if(!(other instanceof SongTo))=F -> return new EqualsBuilder().appendSuper(super.equals(other)) .append(getTyp... [INPUTS] branches=other | result=other [CALLS-INTERNAL] TrackT...
true
ok
{"focal": {"class": "SongTo", "name": "equals", "signature": "boolean equals(Object other)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "other", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "SongTo", "kind": "class", "modifiers": "", "superclass": "TrackTo", "interfac...
2088736_251
class InjectionAnnotations extends AbstractAnnotations implements FluentLabelProvider { @Override public By buildBy() { if (mobileElement) { return defaultElementByBuilder.buildBy(); } By fieldBy = fieldAnnotations.buildBy(); By classBy = classAnnotations.buildBy(); ...
Field accessibilityField = this.getClass().getDeclaredField("iosAccessibilityId"); InjectionAnnotations annotations = new InjectionAnnotations(accessibilityField, getIosCapablities()); By by = annotations.buildBy(); assertThat(by).isInstanceOf(ContentMappedBy.class) .isEq...
[FOCAL] @Override public By InjectionAnnotations.buildBy() [CLASS] class InjectionAnnotations extends AbstractAnnotations implements FluentLabelProvider [METRICS] loc=13 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] defaultElementByBuilder.buildBy/0, fieldAnnotations.buildBy/0, classAnnotations....
/* static context [FOCAL] @Override public By InjectionAnnotations.buildBy() [PATH1] if(mobileElement)=F -> if(classBy != null && fieldBy instanceof ByIdOrName)=T -> return classBy [PATH2] if(mobileElement)=T -> return defaultElementByBuilder.buildBy() [PATH3] if(mobileElement)=F -> if(classBy != null && fieldBy instan...
/* static context [FOCAL] @Override public By InjectionAnnotations.buildBy() [PATH1] if(mobileElement)=F -> if(classBy != null && fieldBy instanceof ByIdOrName)=T -> return classBy [PATH2] if(mobileElement)=T -> return defaultElementByBuilder.buildBy() [PATH3] if(mobileElement)=F -> if(classBy != null && fieldBy instan...
true
ok
{"focal": {"class": "InjectionAnnotations", "name": "buildBy", "signature": "By buildBy()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "By"}, "class_info": {"name": "InjectionAnnotations", "kind": "class", "modifiers": "", "superclass": "AbstractAnnotations", "interfaces": "FluentLab...
2090979_0
class TcpConnectionFactoryFactoryBean extends AbstractFactoryBean<AbstractConnectionFactory> implements Lifecycle, BeanNameAware, ApplicationEventPublisherAware, ApplicationContextAware { public void setHost(String host) { Assert.notNull(host, "Host may not be null"); this.host = host; } public TcpConnectionF...
TcpConnectionFactoryFactoryBean fb = new TcpConnectionFactoryFactoryBean(); fb.setHost("foo"); fb.setBeanFactory(mock(BeanFactory.class)); fb.afterPropertiesSet(); // INT-3578 IllegalArgumentException on 'readDelay' assertThat(TestUtils.getPropertyValue(fb.getObject(), "readDelay")).isEqualTo(100L); } }
[FOCAL] public void TcpConnectionFactoryFactoryBean.setHost(String host) [CLASS] class TcpConnectionFactoryFactoryBean extends AbstractFactoryBean<AbstractConnectionFactory> implements Lifecycle, BeanNameAware, ApplicationEventPublisherAware, ApplicationContextAware [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 thr...
/* static context [FOCAL] public void TcpConnectionFactoryFactoryBean.setHost(String host) [STATE] host [FIELDS] write=host [CALLS-EXTERNAL] Assert.notNull/2 */
/* static context [FOCAL] public void TcpConnectionFactoryFactoryBean.setHost(String host) [STATE] host [FIELDS] write=host [CALLS-EXTERNAL] Assert.notNull/2 */ class TcpConnectionFactoryFactoryBean extends AbstractFactoryBean<AbstractConnectionFactory> implements Lifecycle, BeanNameAware, ApplicationEventPublisherAwar...
true
ok
{"focal": {"class": "TcpConnectionFactoryFactoryBean", "name": "setHost", "signature": "void setHost(String host)", "start_line": 3, "modifiers": "public", "params": [{"name": "host", "type": "String"}], "return_type": "void"}, "class_info": {"name": "TcpConnectionFactoryFactoryBean", "kind": "class", "modifiers": "", ...
2101910_9
class DbImpl implements DB { @Override public Snapshot getSnapshot() { checkBackgroundException(); mutex.lock(); try { return new SnapshotImpl(versions.getCurrent(), versions.getLastSequence()); } finally { mutex.unlock(); } } ...
DbStringWrapper db = new DbStringWrapper(new Options(), databaseDir); // Try with both a short key and a long key for (int i = 0; i < 2; i++) { String key = (i == 0) ? "foo" : longString(200, 'x'); db.put(key, "v1"); Snapshot s1 = db.getSnapshot(); ...
[FOCAL] @Override public Snapshot DbImpl.getSnapshot() [CLASS] class DbImpl implements DB [METRICS] loc=12 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] void checkBackgroundException() [CALLS-EXTERNAL] mutex.lock/0, versions.getCurrent/0, versions.getLastSequence/0, mutex.unlock/0 [NEW] Snapshot...
/* static context [FOCAL] @Override public Snapshot DbImpl.getSnapshot() [PATH1] return new SnapshotImpl(versions.getCurrent(), versions.getLastSequence()) [PATH2] try-body throws [COLLABORATORS] field mutex lock/0,unlock/0; field versions getCurrent/0,getLastSequence/0 [CALLS-INTERNAL] void checkBackgroundException() ...
/* static context [FOCAL] @Override public Snapshot DbImpl.getSnapshot() [PATH1] return new SnapshotImpl(versions.getCurrent(), versions.getLastSequence()) [PATH2] try-body throws [COLLABORATORS] field mutex lock/0,unlock/0; field versions getCurrent/0,getLastSequence/0 [CALLS-INTERNAL] void checkBackgroundException() ...
true
ok
{"focal": {"class": "DbImpl", "name": "getSnapshot", "signature": "Snapshot getSnapshot()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Snapshot"}, "class_info": {"name": "DbImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "DB", "fields": [{"name": "STRESS_F...
2111687_3
class LessCompiler { public String compile(URL sourceURL) throws UnableToCompleteException { // TODO: this won't work if the .less file is in a jar... LessCompilerContext context = new LessCompilerContext(logger, sourceURL.getFile()); try { Function<LessCompilerContext, String> compiler = LessCom...
String output = compile("nested-imports.less"); assertThat(output, not(equalTo("undefined"))); } }
[FOCAL] public String LessCompiler.compile(URL sourceURL) [CLASS] class LessCompiler [METRICS] loc=13 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] URL.getFile/0, LessCompiler.newCompiler/0, Function<LessCompilerContext, String>.apply/1, ConsoleTreeLogger.log/3, Exception.getMessage/0 [NEW] Less...
/* static context [FOCAL] public String LessCompiler.compile(URL sourceURL) [THROWS-WHEN] UnableToCompleteException when try-body throws [PATH1] try-body throws -> throw new UnableToCompleteException() [PATH2] return compiler.apply(context) [INPUTS] branches=- | result=sourceURL, logger [COLLABORATORS] param sourceURL:...
/* static context [FOCAL] public String LessCompiler.compile(URL sourceURL) [THROWS-WHEN] UnableToCompleteException when try-body throws [PATH1] try-body throws -> throw new UnableToCompleteException() [PATH2] return compiler.apply(context) [INPUTS] branches=- | result=sourceURL, logger [COLLABORATORS] param sourceURL:...
true
ok
{"focal": {"class": "LessCompiler", "name": "compile", "signature": "String compile(URL sourceURL) throws UnableToCompleteException", "start_line": 3, "modifiers": "public", "params": [{"name": "sourceURL", "type": "URL"}], "return_type": "String"}, "class_info": {"name": "LessCompiler", "kind": "class", "modifiers": "...
2112231_3
class BracketSettingsReader { public static void readInto(SettingsMap settingsMap, String rawSettings) { String[] settings = rawSettings.split(";"); for (String setting : settings) { String[] settingParts = setting.split("=", 2); String settingName = settingParts...
SettingsMap settingsMap = new SimpleSettingsMap("Test", false); BracketSettingsReader.readInto(settingsMap, "Author=Some Author;Description=Some description"); assertEquals("Some Author", settingsMap.getSetting(WorldStandardValues.AUTHOR)); assertEquals("Some description", settingsMap....
[FOCAL] public static void BracketSettingsReader.readInto(SettingsMap settingsMap, String rawSettings) [CLASS] class BracketSettingsReader [METRICS] loc=24 cc=5 branches=3 loops=1 returns=0 throws=0 nesting=3 [CALLS-EXTERNAL] String.split/1, String.split/2, settingParts[0].toLowerCase().trim/0, settingParts[0].toLowerC...
/* static context [FOCAL] public static void BracketSettingsReader.readInto(SettingsMap settingsMap, String rawSettings) [PATH1] foreach(String setting : settings)=T -> if(settingName.isEmpty())=F -> if(settingParts.length == 1)=F -> if(settingParts.length == 2)=T -> exit loop [PATH2] foreach(String setting : settings)...
/* static context [FOCAL] public static void BracketSettingsReader.readInto(SettingsMap settingsMap, String rawSettings) [PATH1] foreach(String setting : settings)=T -> if(settingName.isEmpty())=F -> if(settingParts.length == 1)=F -> if(settingParts.length == 2)=T -> exit loop [PATH2] foreach(String setting : settings)...
true
ok
{"focal": {"class": "BracketSettingsReader", "name": "readInto", "signature": "void readInto(SettingsMap settingsMap, String rawSettings)", "start_line": 3, "modifiers": "public static", "params": [{"name": "settingsMap", "type": "SettingsMap"}, {"name": "rawSettings", "type": "String"}], "return_type": "void"}, "class...