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 |
|---|---|---|---|---|---|---|---|---|
13325401_358 | class TypeUtil {
public static ValueMap toValueMap(final Map<String, ?> map) {
final Map<String, Object> objectMap = new LinkedHashMap<String, Object>(map.size());
for (final Map.Entry<String, ?> entry : map.entrySet()) {
objectMap.put(entry.getKey(), entry.getValue());
}
... | final Map<String, String> stringMap = new LinkedHashMap<String, String>();
stringMap.put("one", "uno");
stringMap.put("two", "dos");
stringMap.put("three", "tres");
final Map<String, Object> objectMap = new LinkedHashMap<String, Object>();
objectMap.put("one", "uno");
... | [FOCAL] public static ValueMap TypeUtil.toValueMap(Map<String, ?> map)
[CLASS] class TypeUtil
[METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Map<String, ?>.size/0, Map<String, ?>.entrySet/0, Map<String, Object>.put/2, Map.Entry<String, ?>.getKey/0, Map.Entry<String, ?>.getValue/0
... | /* static context
[FOCAL] public static ValueMap TypeUtil.toValueMap(Map<String, ?> map)
[PATH1] foreach(Map.Entry<String, ?> entry : map.entrySet())=T -> exit loop -> return new ValueMapDecorator(objectMap)
[PATH2] foreach(Map.Entry<String, ?> entry : map.entrySet())=F -> return new ValueMapDecorator(objectMap)
[INPUT... | /* static context
[FOCAL] public static ValueMap TypeUtil.toValueMap(Map<String, ?> map)
[PATH1] foreach(Map.Entry<String, ?> entry : map.entrySet())=T -> exit loop -> return new ValueMapDecorator(objectMap)
[PATH2] foreach(Map.Entry<String, ?> entry : map.entrySet())=F -> return new ValueMapDecorator(objectMap)
[INPUT... | true | ok | {"focal": {"class": "TypeUtil", "name": "toValueMap", "signature": "ValueMap toValueMap(Map<String, ?> map)", "start_line": 3, "modifiers": "public static", "params": [{"name": "map", "type": "Map<String, ?>"}], "return_type": "ValueMap"}, "class_info": {"name": "TypeUtil", "kind": "class", "modifiers": "", "superclass... |
13343738_8 | class JUGMemberServiceBean {
public List<JUGMember> findByExperience(int experience) {
return entityManager.createNamedQuery(
"JUGMember-findByExperience")
.setParameter( 1, experience )
.getResultList();
}
public void save( JUGMember member );
p... | List<JUGMember> list = service.findByExperience(5);
assertNotNull(list);
assertEquals( 2, list.size() );
}
} | [FOCAL] public List<JUGMember> JUGMemberServiceBean.findByExperience(int experience)
[CLASS] class JUGMemberServiceBean
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] entityManager.createNamedQuery( "JUGMember-findByExperien....getResultList/0, entityManager.createNamedQuery( "JUG... | /* static context
[FOCAL] public List<JUGMember> JUGMemberServiceBean.findByExperience(int experience)
[INPUTS] branches=- | result=experience
[COLLABORATORS] field entityManager createNamedQuery/1
[CALLS-EXTERNAL] entityManager.createNamedQuery( "JUGMember-findByExperien....getResultList/0, entityManager.createNamedQu... | /* static context
[FOCAL] public List<JUGMember> JUGMemberServiceBean.findByExperience(int experience)
[INPUTS] branches=- | result=experience
[COLLABORATORS] field entityManager createNamedQuery/1
[CALLS-EXTERNAL] entityManager.createNamedQuery( "JUGMember-findByExperien....getResultList/0, entityManager.createNamedQu... | true | ok | {"focal": {"class": "JUGMemberServiceBean", "name": "findByExperience", "signature": "List<JUGMember> findByExperience(int experience)", "start_line": 3, "modifiers": "public", "params": [{"name": "experience", "type": "int"}], "return_type": "List<JUGMember>"}, "class_info": {"name": "JUGMemberServiceBean", "kind": "c... |
13349691_13 | class LoopPerformances implements Serializable {
public TestPerformances getPerformancesFor(final String msg) {
return map.get(msg);
}
@SuppressWarnings("unchecked") private LoopPerformances();
public LoopPerformances(final long iterations,
final Map<String, Long> timeMap);
... | final TestPerformances tp = loopPerformances
.getPerformancesFor("second");
assertEquals(1000L, tp.getElapsedNanoseconds());
assertEquals(1000L / ITERATIONS, tp.getElapsedNanosecondsPerCycle(), 1E-3);
assertEquals("second", tp.getName());
assertEquals(66.666, tp.g... | [FOCAL] public TestPerformances LoopPerformances.getPerformancesFor(String msg)
[CLASS] class LoopPerformances implements Serializable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] map.get/1
[INPUTS] branches=- | result=msg
[COLLABORATORS] field map get/1
[DATAFLOW] msg@param->L2... | /* static context
[FOCAL] public TestPerformances LoopPerformances.getPerformancesFor(String msg)
[INPUTS] branches=- | result=msg
[COLLABORATORS] field map get/1
[CALLS-EXTERNAL] map.get/1
*/
| /* static context
[FOCAL] public TestPerformances LoopPerformances.getPerformancesFor(String msg)
[INPUTS] branches=- | result=msg
[COLLABORATORS] field map get/1
[CALLS-EXTERNAL] map.get/1
*/
class LoopPerformances implements Serializable {
public TestPerformances getPerformancesFor(final String msg) {
re... | true | ok | {"focal": {"class": "LoopPerformances", "name": "getPerformancesFor", "signature": "TestPerformances getPerformancesFor(String msg)", "start_line": 3, "modifiers": "public", "params": [{"name": "msg", "type": "String"}], "return_type": "TestPerformances"}, "class_info": {"name": "LoopPerformances", "kind": "class", "mo... |
13363729_38 | class HttpHelper {
public List<String> queryXml(String url, String username, String password, String... xpathQueries) throws IOException {
byte[] xmlContent = doGet(url, username, password);
List<String> results = new ArrayList<>();
try {
InputSource is = new InputSource(new Byt... | String xmlResponse = "<xml>" +
"<test>" +
OK_RESPONSE +
"</test>" +
"</xml>";
respond(SC_OK, xmlResponse);
String xPath = "//test/child::text()";
List<String> xmls = httpHelper.queryXml(baseUrl, A_USERNAME, A_PASSWORD, xPat... | [FOCAL] public List<String> HttpHelper.queryXml(String url, String username, String password, String... xpathQueries)
[CLASS] class HttpHelper
[METRICS] loc=24 cc=4 branches=1 loops=1 returns=1 throws=1 nesting=3
[CALLS-INTERNAL] byte[] doGet(String url, String username, String password)
[CALLS-EXTERNAL] documentBuilde... | /* static context
[FOCAL] public List<String> HttpHelper.queryXml(String url, String username, String password, String... xpathQueries)
[THROWS-WHEN] IOException when try-body throws
[PATH1] foreach(String xpathQuery : xpathQueries)=T -> if(result == null || result.isEmpty())=T -> exit loop -> return results
[PATH2] tr... | /* static context
[FOCAL] public List<String> HttpHelper.queryXml(String url, String username, String password, String... xpathQueries)
[THROWS-WHEN] IOException when try-body throws
[PATH1] foreach(String xpathQuery : xpathQueries)=T -> if(result == null || result.isEmpty())=T -> exit loop -> return results
[PATH2] tr... | true | ok | {"focal": {"class": "HttpHelper", "name": "queryXml", "signature": "List<String> queryXml(String url, String username, String password, String... xpathQueries) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "url", "type": "String"}, {"name": "username", "type": "String"}, {"name": "pas... |
13379760_81 | class Formats {
public static String formatAlertMessage(TransactionSeenEvent event) {
// Decode the "transaction seen" event
final Coin amount = event.getAmount();
final Coin modulusAmount;
if (amount.compareTo(Coin.ZERO) >= 0) {
modulusAmount = amount;
} else {
modulusAmount = amou... |
bitcoinConfiguration.setBitcoinSymbol(BitcoinSymbol.ICON.name());
final BitcoinURI bitcoinURI = new BitcoinURI("bitcoin:1AhN6rPdrMuKBGFDKR1k9A8SCLYaNgXhty?amount=0.01&label=Please%20donate%20to%20multibit.org");
assertThat(Formats.formatAlertMessage(bitcoinURI).get()).isEqualTo("Payment \"Please donate t... | [FOCAL] public static String Formats.formatAlertMessage(TransactionSeenEvent event)
[CLASS] class Formats
[METRICS] loc=27 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] TransactionSeenEvent.getAmount/0, Coin.compareTo/1, Coin.negate/0, Formats.formatCoinAsSymbolicText/3, Configurations.currentCo... | /* static context
[FOCAL] public static String Formats.formatAlertMessage(TransactionSeenEvent event)
[PATH1] if(amount.compareTo(Coin.ZERO) >= 0)#1=T -> if(amount.compareTo(Coin.ZERO) >= 0)#2=T -> return Languages.safeText(MessageKey.PAYMENT_RECEIVED_ALERT, messageAmount)
[PATH2] if(amount.compareTo(Coin.ZERO) >= 0)#1... | /* static context
[FOCAL] public static String Formats.formatAlertMessage(TransactionSeenEvent event)
[PATH1] if(amount.compareTo(Coin.ZERO) >= 0)#1=T -> if(amount.compareTo(Coin.ZERO) >= 0)#2=T -> return Languages.safeText(MessageKey.PAYMENT_RECEIVED_ALERT, messageAmount)
[PATH2] if(amount.compareTo(Coin.ZERO) >= 0)#1... | true | ok | {"focal": {"class": "Formats", "name": "formatAlertMessage", "signature": "String formatAlertMessage(TransactionSeenEvent event)", "start_line": 3, "modifiers": "public static", "params": [{"name": "event", "type": "TransactionSeenEvent"}], "return_type": "String"}, "class_info": {"name": "Formats", "kind": "class", "m... |
13383431_28 | class PetriNetController implements Serializable {
public UndoableEdit delete(PetriNetComponent component) throws PetriNetComponentException {
return deleteComponent(component);
}
public PetriNetController(PetriNet model, UndoableEditListener undoListener, GUIAnimator animator,
... | Place place = new DiscretePlace("", "");
net.addPlace(place);
UndoableEdit edit = controller.delete(place);
DeletePetriNetObject deleteAction = new DeletePetriNetObject(place, net);
assertEquals(edit, deleteAction);
}
} | [FOCAL] public UndoableEdit PetriNetController.delete(PetriNetComponent component)
[CLASS] class PetriNetController implements Serializable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] UndoableEdit deleteComponent(PetriNetComponent component)
[EXCEPTIONS] declares PetriNetCompon... | /* static context
[FOCAL] public UndoableEdit PetriNetController.delete(PetriNetComponent component)
[INPUTS] branches=- | result=component
[EXCEPTIONS] declares PetriNetComponentException
[CALLS-INTERNAL] UndoableEdit deleteComponent(PetriNetComponent component)
*/
| /* static context
[FOCAL] public UndoableEdit PetriNetController.delete(PetriNetComponent component)
[INPUTS] branches=- | result=component
[EXCEPTIONS] declares PetriNetComponentException
[CALLS-INTERNAL] UndoableEdit deleteComponent(PetriNetComponent component)
*/
class PetriNetController implements Serializable {
... | true | ok | {"focal": {"class": "PetriNetController", "name": "delete", "signature": "UndoableEdit delete(PetriNetComponent component) throws PetriNetComponentException", "start_line": 3, "modifiers": "public", "params": [{"name": "component", "type": "PetriNetComponent"}], "return_type": "UndoableEdit"}, "class_info": {"name": "P... |
13414290_2 | class Schemas {
public Schema getSchema(int version) {
return new Schema(version);
}
private Schemas(int currentRevision,
Map<String, ImmutableList<? extends TableDefinitionOperation>> tables,
ImmutableMap<Integer, ImmutableMap<String, ImmutableList<? extends TableDowngradeOperation>>> downgrad... | Schemas db = Schemas.Builder
.currentSchema(2900)
.build();
assertThat(db.getSchema(1500)).isNotNull();
}
} | [FOCAL] public Schema Schemas.getSchema(int version)
[CLASS] class Schemas
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Schema
[INPUTS] branches=- | result=version
[DATAFLOW] version@param->L2
[CLASS-MEMBERS] Schemas(int currentRevision, Map<String, ImmutableList<? extends TableDefinitionO... | /* static context
[FOCAL] public Schema Schemas.getSchema(int version)
[INPUTS] branches=- | result=version
[NEW] Schema
*/
| /* static context
[FOCAL] public Schema Schemas.getSchema(int version)
[INPUTS] branches=- | result=version
[NEW] Schema
*/
class Schemas {
public Schema getSchema(int version) {
return new Schema(version);
}
private Schemas(int currentRevision,
Map<String, ImmutableList<? extends TableDefinitionOper... | true | ok | {"focal": {"class": "Schemas", "name": "getSchema", "signature": "Schema getSchema(int version)", "start_line": 3, "modifiers": "public", "params": [{"name": "version", "type": "int"}], "return_type": "Schema"}, "class_info": {"name": "Schemas", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ... |
13471496_3 | class DownloadMediaOptions {
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
boolean firstTime = true;
for (String key : mParams.keySet()) {
builder.append(firstTime ? "?" : "&");
if (firstTime) firstTime = false;
St... | DownloadMediaOptions.Builder builder = new DownloadMediaOptions.Builder();
builder.maxHeight(100)
.maxHeight(200)
.maxHeight(300)
.maxHeight(400);
assertNotNull(builder.build());
String finalURL = builder.build().toString();
asser... | [FOCAL] @Override public String DownloadMediaOptions.toString()
[CLASS] class DownloadMediaOptions
[METRICS] loc=13 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] mParams.keySet/0, StringBuilder.append/1, mParams.get/1, builder.append(key).append("=").append/1, builder.append(key).append/1, Strin... | /* static context
[FOCAL] @Override public String DownloadMediaOptions.toString()
[PATH1] foreach(String key : mParams.keySet())=T -> if(firstTime)=T -> exit loop -> return builder.toString()
[PATH2] foreach(String key : mParams.keySet())=F -> return builder.toString()
[PATH3] foreach(String key : mParams.keySet())=T -... | /* static context
[FOCAL] @Override public String DownloadMediaOptions.toString()
[PATH1] foreach(String key : mParams.keySet())=T -> if(firstTime)=T -> exit loop -> return builder.toString()
[PATH2] foreach(String key : mParams.keySet())=F -> return builder.toString()
[PATH3] foreach(String key : mParams.keySet())=T -... | true | ok | {"focal": {"class": "DownloadMediaOptions", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "DownloadMediaOptions", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [... |
13486560_0 | class MimeTypes {
public String guessMimeType(String path) {
int lastDot = path.lastIndexOf('.');
if (lastDot == -1) {
return null;
}
String extension = path.substring(lastDot + 1);
extension = extension.toLowerCase();
String mimeType = extensionToMimeT... | assertEquals("text/plain", MimeTypes.INSTANCE.guessMimeType("hello.txt"));
assertEquals("application/msword", MimeTypes.INSTANCE.guessMimeType("hello.doc"));
assertEquals("text/html", MimeTypes.INSTANCE.guessMimeType("hello.htm"));
assertEquals("text/html", MimeTypes.INSTANCE.guessMimeTy... | [FOCAL] public String MimeTypes.guessMimeType(String path)
[CLASS] class MimeTypes
[METRICS] loc=12 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] String.lastIndexOf/1, String.substring/1, String.toLowerCase/0, extensionToMimeType.get/1
[PATH1] if(lastDot == -1)=T -> return null
[PATH2] if(lastDo... | /* static context
[FOCAL] public String MimeTypes.guessMimeType(String path)
[PATH1] if(lastDot == -1)=T -> return null
[PATH2] if(lastDot == -1)=F -> return mimeType
[INPUTS] branches=path | result=path
[COLLABORATORS] field extensionToMimeType get/1
[CALLS-EXTERNAL] String.lastIndexOf/1, String.substring/1, String.to... | /* static context
[FOCAL] public String MimeTypes.guessMimeType(String path)
[PATH1] if(lastDot == -1)=T -> return null
[PATH2] if(lastDot == -1)=F -> return mimeType
[INPUTS] branches=path | result=path
[COLLABORATORS] field extensionToMimeType get/1
[CALLS-EXTERNAL] String.lastIndexOf/1, String.substring/1, String.to... | true | ok | {"focal": {"class": "MimeTypes", "name": "guessMimeType", "signature": "String guessMimeType(String path)", "start_line": 3, "modifiers": "public", "params": [{"name": "path", "type": "String"}], "return_type": "String"}, "class_info": {"name": "MimeTypes", "kind": "class", "modifiers": "", "superclass": null, "interfa... |
13486910_2 | class SpringConfigRegistry {
public void removeAllSpringConfig() {
mSpringConfigMap.clear();
}
SpringConfigRegistry(boolean includeDefaultEntry);
public static SpringConfigRegistry getInstance();
public boolean addSpringConfig(SpringConfig springConfig, String configName);
public boolean removeSpri... | SpringConfig configA = new SpringConfig(0, 0);
SpringConfig configB = new SpringConfig(0, 0);
SpringConfig configC = new SpringConfig(0, 0);
mSpringConfigRegistrySpy.addSpringConfig(configA, "a");
mSpringConfigRegistrySpy.addSpringConfig(configB, "b");
mSpringConfigRegistrySpy.addSpringConfig(c... | [FOCAL] public void SpringConfigRegistry.removeAllSpringConfig()
[CLASS] class SpringConfigRegistry
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] mSpringConfigMap.clear/0
[COLLABORATORS] field mSpringConfigMap clear/0
[CLASS-MEMBERS] SpringConfigRegistry(boolean includeDefaultEnt... | /* static context
[FOCAL] public void SpringConfigRegistry.removeAllSpringConfig()
[COLLABORATORS] field mSpringConfigMap clear/0
[CALLS-EXTERNAL] mSpringConfigMap.clear/0
*/
| /* static context
[FOCAL] public void SpringConfigRegistry.removeAllSpringConfig()
[COLLABORATORS] field mSpringConfigMap clear/0
[CALLS-EXTERNAL] mSpringConfigMap.clear/0
*/
class SpringConfigRegistry {
public void removeAllSpringConfig() {
mSpringConfigMap.clear();
}
SpringConfigRegistry(boolean include... | true | ok | {"focal": {"class": "SpringConfigRegistry", "name": "removeAllSpringConfig", "signature": "void removeAllSpringConfig()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "SpringConfigRegistry", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null,... |
13490595_330 | class OkuriganaValidator extends Validator {
@Override
public void validate(Sentence sentence) {
invalidOkurigana.stream().forEach(value -> {
int startPosition = sentence.getContent().indexOf(value);
if (startPosition != -1) {
addLocalized... | String sampleText = "そこを押える時、";
Configuration config = Configuration.builder("ja")
.addValidatorConfig(new ValidatorConfiguration("Okurigana"))
.build();
DocumentParser parser = DocumentParser.MARKDOWN;
List<Document> documents = new ArrayList<>();
... | [FOCAL] @Override public void OkuriganaValidator.validate(Sentence sentence)
[CLASS] class OkuriganaValidator extends Validator
[METRICS] loc=19 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] invalidOkurigana.stream().forEach/1, invalidOkurigana.stream/0, sentence.getContent().indexOf/1, Sentence... | /* static context
[FOCAL] @Override public void OkuriganaValidator.validate(Sentence sentence)
[PATH1] foreach(ExpressionRule rule : invalidOkuriganaTokens)=T -> if(rule.match(sentence.getTokens()))=T -> exit loop
[PATH2] foreach(ExpressionRule rule : invalidOkuriganaTokens)=F
[PATH3] foreach(ExpressionRule rule : inva... | /* static context
[FOCAL] @Override public void OkuriganaValidator.validate(Sentence sentence)
[PATH1] foreach(ExpressionRule rule : invalidOkuriganaTokens)=T -> if(rule.match(sentence.getTokens()))=T -> exit loop
[PATH2] foreach(ExpressionRule rule : invalidOkuriganaTokens)=F
[PATH3] foreach(ExpressionRule rule : inva... | true | ok | {"focal": {"class": "OkuriganaValidator", "name": "validate", "signature": "void validate(Sentence sentence)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "sentence", "type": "Sentence"}], "return_type": "void"}, "class_info": {"name": "OkuriganaValidator", "kind": "class", "modifiers": "", "s... |
13512175_99 | class EntityVersionStoreJdbc extends AbstractVersionStoreJdbc<Id, M, V, EntityUpdateBatch<Id, M, V>, EntityStoreOptions<Id, M, V>> {
@Override
public EntityUpdateBatch<Id, M, V> updateBatch(Id id) {
return updateBatch(singleton(id));
}
@SuppressWarnings("unused") protected EntityVersionStoreJ... | final String comment = "Comment metadata";
final String docId = randomId();
transactionTemplate.execute(status -> {
EntityUpdateBatch<String, String, JEntityVersion<String>> update = entityStore.updateBatch(docId);
ObjectVersion<String> version = ObjectVersion.<String>bui... | [FOCAL] @Override public EntityUpdateBatch<Id, M, V> EntityVersionStoreJdbc.updateBatch(Id id)
[CLASS] class EntityVersionStoreJdbc extends AbstractVersionStoreJdbc<Id, M, V, EntityUpdateBatch<Id, M, V>, EntityStoreOptions<Id, M, V>>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ... | /* static context
[FOCAL] @Override public EntityUpdateBatch<Id, M, V> EntityVersionStoreJdbc.updateBatch(Id id)
[INPUTS] branches=- | result=id
[CALLS-INTERNAL] EntityUpdateBatch<Id, M, V> updateBatch(Collection<Id> docIds)
[CALLS-EXTERNAL] singleton/1 (inherited)
*/
| /* static context
[FOCAL] @Override public EntityUpdateBatch<Id, M, V> EntityVersionStoreJdbc.updateBatch(Id id)
[INPUTS] branches=- | result=id
[CALLS-INTERNAL] EntityUpdateBatch<Id, M, V> updateBatch(Collection<Id> docIds)
[CALLS-EXTERNAL] singleton/1 (inherited)
*/
class EntityVersionStoreJdbc extends AbstractVersio... | true | ok | {"focal": {"class": "EntityVersionStoreJdbc", "name": "updateBatch", "signature": "EntityUpdateBatch<Id, M, V> updateBatch(Id id)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "id", "type": "Id"}], "return_type": "EntityUpdateBatch<Id, M, V>"}, "class_info": {"name": "EntityVersionStoreJdbc", ... |
13521187_28 | class Sprinkles {
public <T> void registerType(Class<T> clazz, TypeSerializer<T> serializer) {
typeSerializers.put(clazz, serializer);
}
private Sprinkles();
private void addStandardTypeSerializers();
public static synchronized Sprinkles init(Context context);
public static synchroni... | Sprinkles s = Sprinkles.init(Robolectric.application);
TypeSerializer serializer = new MyObjectSerializer();
s.registerType(MyObject.class, serializer);
assertEquals(s.getTypeSerializer(MyObject.class), serializer);
}
} | [FOCAL] public void Sprinkles.registerType(Class<T> clazz, TypeSerializer<T> serializer)
[CLASS] class Sprinkles
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] typeSerializers.put/2
[COLLABORATORS] field typeSerializers put/2
[DATAFLOW] clazz@param->L2; serializer@param->L2
[CLASS... | /* static context
[FOCAL] public void Sprinkles.registerType(Class<T> clazz, TypeSerializer<T> serializer)
[COLLABORATORS] field typeSerializers put/2
[CALLS-EXTERNAL] typeSerializers.put/2
*/
| /* static context
[FOCAL] public void Sprinkles.registerType(Class<T> clazz, TypeSerializer<T> serializer)
[COLLABORATORS] field typeSerializers put/2
[CALLS-EXTERNAL] typeSerializers.put/2
*/
class Sprinkles {
public <T> void registerType(Class<T> clazz, TypeSerializer<T> serializer) {
typeSerializers.put... | true | ok | {"focal": {"class": "Sprinkles", "name": "registerType", "signature": "void registerType(Class<T> clazz, TypeSerializer<T> serializer)", "start_line": 3, "modifiers": "public", "params": [{"name": "clazz", "type": "Class<T>"}, {"name": "serializer", "type": "TypeSerializer<T>"}], "return_type": "void"}, "class_info": {... |
13535208_210 | class StringType implements ArgumentType<String> {
public String toObject(String value) {
if (StringUtil.isEmpty(value)) {
return null;
}
return ArgumentUtil.decode(value);
}
public String toText(String value);
private StringType stringType;
}
class StringTypeTes... | assertEquals("", stringType.toObject("''"));
}
} | [FOCAL] public String StringType.toObject(String value)
[CLASS] class StringType implements ArgumentType<String>
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] StringUtil.isEmpty/1, ArgumentUtil.decode/1
[PATH1] if(StringUtil.isEmpty(value))=T -> return null
[PATH2] if(StringUtil.... | /* static context
[FOCAL] public String StringType.toObject(String value)
[PATH1] if(StringUtil.isEmpty(value))=T -> return null
[PATH2] if(StringUtil.isEmpty(value))=F -> return ArgumentUtil.decode(value)
[INPUTS] branches=value | result=value
[CALLS-EXTERNAL] StringUtil.isEmpty/1, ArgumentUtil.decode/1
*/
| /* static context
[FOCAL] public String StringType.toObject(String value)
[PATH1] if(StringUtil.isEmpty(value))=T -> return null
[PATH2] if(StringUtil.isEmpty(value))=F -> return ArgumentUtil.decode(value)
[INPUTS] branches=value | result=value
[CALLS-EXTERNAL] StringUtil.isEmpty/1, ArgumentUtil.decode/1
*/
class Strin... | true | ok | {"focal": {"class": "StringType", "name": "toObject", "signature": "String toObject(String value)", "start_line": 3, "modifiers": "public", "params": [{"name": "value", "type": "String"}], "return_type": "String"}, "class_info": {"name": "StringType", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ... |
13570618_2 | class TaskQueueImpl implements
TaskQueue,
ApplicationListener,
ApplicationEventPublisherAware,
DisposableBean {
@Override
public synchronized void cleanup()
{
logInfoWithQueueName("purging completed tasks");
// clear all tasks from the finished queue
final List<Futur... |
// by default we only have space for 2 completed tasks, but we're going to start 10
testWithMaxFinishedSize(10, 2);
queue.gracefulShutdown(false);
// now make a new queue with space for 10 completed tasks
queue = new TaskQueueImpl(
"testQueue",
3,
Sup... | [FOCAL] @Override public synchronized void TaskQueueImpl.cleanup()
[CLASS] class TaskQueueImpl implements TaskQueue, ApplicationListener, ApplicationEventPublisherAware, DisposableBean
[METRICS] loc=18 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] void logErrorWithQueueName(String msg, Object...... | /* static context
[FOCAL] @Override public synchronized void TaskQueueImpl.cleanup()
[PATH1] foreach(Future<Void> future : completedTasks)=T -> if(null != task)=T -> exit loop
[PATH2] foreach(Future<Void> future : completedTasks)=F
[PATH3] foreach(Future<Void> future : completedTasks)=T -> if(null != task)=F -> exit lo... | /* static context
[FOCAL] @Override public synchronized void TaskQueueImpl.cleanup()
[PATH1] foreach(Future<Void> future : completedTasks)=T -> if(null != task)=T -> exit loop
[PATH2] foreach(Future<Void> future : completedTasks)=F
[PATH3] foreach(Future<Void> future : completedTasks)=T -> if(null != task)=F -> exit lo... | true | ok | {"focal": {"class": "TaskQueueImpl", "name": "cleanup", "signature": "void cleanup()", "start_line": 7, "modifiers": "@Override public synchronized", "params": [], "return_type": "void"}, "class_info": {"name": "TaskQueueImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "TaskQueue, ApplicationL... |
13621351_1 | class CustomRepositoryServiceImpl implements CustomRepositoryService {
@Override
@Transactional(readOnly = true)
public CustomRepository findByName(String name) {
return customRepositoryRepository.findByName(name);
}
@Override @Transactional public CustomRepository save(CustomRepository customRepository);
@Ov... |
CustomRepository customRepository = customRepositoryService.findByName("repo1");
Assert.assertNotNull(customRepository);
Assert.assertEquals("repo1", customRepository.getName());
}
} | [FOCAL] @Override @Transactional(readOnly = true) public CustomRepository CustomRepositoryServiceImpl.findByName(String name)
[CLASS] class CustomRepositoryServiceImpl implements CustomRepositoryService
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] customRepositoryRepository.find... | /* static context
[FOCAL] @Override @Transactional(readOnly = true) public CustomRepository CustomRepositoryServiceImpl.findByName(String name)
[INPUTS] branches=- | result=name
[COLLABORATORS] field customRepositoryRepository findByName/1
[CALLS-EXTERNAL] customRepositoryRepository.findByName/1
*/
| /* static context
[FOCAL] @Override @Transactional(readOnly = true) public CustomRepository CustomRepositoryServiceImpl.findByName(String name)
[INPUTS] branches=- | result=name
[COLLABORATORS] field customRepositoryRepository findByName/1
[CALLS-EXTERNAL] customRepositoryRepository.findByName/1
*/
class CustomReposito... | true | ok | {"focal": {"class": "CustomRepositoryServiceImpl", "name": "findByName", "signature": "CustomRepository findByName(String name)", "start_line": 3, "modifiers": "@Override @Transactional(readOnly = true) public", "params": [{"name": "name", "type": "String"}], "return_type": "CustomRepository"}, "class_info": {"name": "... |
13651430_68 | class ExpressionLanguage {
public static DesiredRateReadWriteExpression<?, Object> formula(String formula) {
DesiredRateExpression<?> exp = parseFormula(formula);
if (exp instanceof LastOfChannelExpression) {
return new DesiredRateReadWriteExpressionImpl<>(exp, org.diirt.datasource.vty... | ReadExpressionTester exp = new ReadExpressionTester(formula("=3==4"));
assertThat(exp.getExpression().getName(), equalTo("(3 == 4)"));
VBoolean result = (VBoolean) exp.getFunction().readValue();
assertThat(result.getValue(), equalTo(false));
}
} | [FOCAL] public static DesiredRateReadWriteExpression<?, Object> ExpressionLanguage.formula(String formula)
[CLASS] class ExpressionLanguage
[METRICS] loc=11 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] DesiredRateExpression<?> parseFormula(String formula); WriteExpression<T> readOnlyWriteExpres... | /* static context
[FOCAL] public static DesiredRateReadWriteExpression<?, Object> ExpressionLanguage.formula(String formula)
[PATH1] if(exp instanceof LastOfChannelExpression)=F -> if(exp instanceof ErrorDesiredRateExpression)=T -> return new DesiredRateReadWriteExpressionImpl<>(exp, readOnlyWriteExpressi...
[PATH2] if... | /* static context
[FOCAL] public static DesiredRateReadWriteExpression<?, Object> ExpressionLanguage.formula(String formula)
[PATH1] if(exp instanceof LastOfChannelExpression)=F -> if(exp instanceof ErrorDesiredRateExpression)=T -> return new DesiredRateReadWriteExpressionImpl<>(exp, readOnlyWriteExpressi...
[PATH2] if... | true | ok | {"focal": {"class": "ExpressionLanguage", "name": "formula", "signature": "DesiredRateReadWriteExpression<?, Object> formula(String formula)", "start_line": 3, "modifiers": "public static", "params": [{"name": "formula", "type": "String"}], "return_type": "DesiredRateReadWriteExpression<?, Object>"}, "class_info": {"na... |
13660977_8 | class AcmeClientSpi {
public X509CertificateChainAndSigningKey obtainCertificateChain(AcmeAccount account, boolean staging, String... domainNames) throws AcmeException {
return obtainCertificateChain(account, staging, null, -1, domainNames);
}
public Map<AcmeResource, URL> getResourceUrls(AcmeAcco... | try {
server = setupTestObtainCertificateWithUnsupportedPublicKey();
AcmeAccount account = populateAccount(ACCOUNT_7_V2);
String domainName = "iraclzlcqgaymrc.com";
obtainCertificateChain("DSA", 2048, account, domainName);
fail("Expected AcmeException ... | [FOCAL] public X509CertificateChainAndSigningKey AcmeClientSpi.obtainCertificateChain(AcmeAccount account, boolean staging, String... domainNames)
[CLASS] class AcmeClientSpi
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] X509CertificateChainAndSigningKey obtainCertificateChain(Ac... | /* static context
[FOCAL] public X509CertificateChainAndSigningKey AcmeClientSpi.obtainCertificateChain(AcmeAccount account, boolean staging, String... domainNames)
[INPUTS] branches=- | result=account, domainNames, staging
[EXCEPTIONS] declares AcmeException
*/
| /* static context
[FOCAL] public X509CertificateChainAndSigningKey AcmeClientSpi.obtainCertificateChain(AcmeAccount account, boolean staging, String... domainNames)
[INPUTS] branches=- | result=account, domainNames, staging
[EXCEPTIONS] declares AcmeException
*/
class AcmeClientSpi {
public X509CertificateChainAnd... | true | ok | {"focal": {"class": "AcmeClientSpi", "name": "obtainCertificateChain", "signature": "X509CertificateChainAndSigningKey obtainCertificateChain(AcmeAccount account, boolean staging, String... domainNames) throws AcmeException", "start_line": 3, "modifiers": "public", "params": [{"name": "account", "type": "AcmeAccount"},... |
13687370_0 | class GwtPlugin implements Plugin<Project> {
@Override
public void apply(final Project project) {
project.getPlugins().apply(GwtCompilerPlugin.class);
project.getPlugins().withType(WarPlugin.class,
(warPlugin) -> project.getPlugins().apply(GwtWarPlugin.class));
}
private Project project;
private TaskCon... | project.getPlugins().apply(WarPlugin.class);
assertThat(tasks.getByName(GwtWarPlugin.TASK_WAR_TEMPLATE), instanceOf(Copy.class));
assertThat(tasks.getByName(GwtWarPlugin.TASK_GWT_DEV), instanceOf(GwtDev.class));
assertThat(tasks.getByName(GwtWarPlugin.TASK_DRAFT_WAR), instanceOf(War.class));
}
} | [FOCAL] @Override public void GwtPlugin.apply(Project project)
[CLASS] class GwtPlugin implements Plugin<Project>
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] project.getPlugins().apply/1, Project.getPlugins/0, project.getPlugins().withType/2
[COLLABORATORS] param project:Projec... | /* static context
[FOCAL] @Override public void GwtPlugin.apply(Project project)
[COLLABORATORS] param project:Project getPlugins/0
[CALLS-EXTERNAL] project.getPlugins().apply/1, Project.getPlugins/0, project.getPlugins().withType/2
*/
| /* static context
[FOCAL] @Override public void GwtPlugin.apply(Project project)
[COLLABORATORS] param project:Project getPlugins/0
[CALLS-EXTERNAL] project.getPlugins().apply/1, Project.getPlugins/0, project.getPlugins().withType/2
*/
class GwtPlugin implements Plugin<Project> {
@Override
public void apply(final Pr... | true | ok | {"focal": {"class": "GwtPlugin", "name": "apply", "signature": "void apply(Project project)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "project", "type": "Project"}], "return_type": "void"}, "class_info": {"name": "GwtPlugin", "kind": "class", "modifiers": "", "superclass": null, "interface... |
13702023_0 | class StringUtils {
public static String implode(String delimiter, String[] strings)
{
if (strings.length == 0)
{
return "";
}
else
{
StringBuilder sb = new StringBuilder(strings[0]);
for (int i = 1; i < strings.length; i++)
... | assertEquals("a.b.c", StringUtils.implode(".", new String[]{"a", "b", "c"}));
}
} | [FOCAL] public static String StringUtils.implode(String delimiter, String[] strings)
[CLASS] class StringUtils
[METRICS] loc=16 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] sb.append(delimiter).append/1, StringBuilder.append/1, StringBuilder.toString/0
[NEW] StringBuilder
[PATH1] if(strings.len... | /* static context
[FOCAL] public static String StringUtils.implode(String delimiter, String[] strings)
[PATH1] if(strings.length == 0)=F -> for(i < strings.length)=T -> exit loop -> return sb.toString()
[PATH2] if(strings.length == 0)=T -> return ""
[PATH3] if(strings.length == 0)=F -> for(i < strings.length)=F -> retu... | /* static context
[FOCAL] public static String StringUtils.implode(String delimiter, String[] strings)
[PATH1] if(strings.length == 0)=F -> for(i < strings.length)=T -> exit loop -> return sb.toString()
[PATH2] if(strings.length == 0)=T -> return ""
[PATH3] if(strings.length == 0)=F -> for(i < strings.length)=F -> retu... | true | ok | {"focal": {"class": "StringUtils", "name": "implode", "signature": "String implode(String delimiter, String[] strings)", "start_line": 3, "modifiers": "public static", "params": [{"name": "delimiter", "type": "String"}, {"name": "strings", "type": "String[]"}], "return_type": "String"}, "class_info": {"name": "StringUt... |
13719326_26 | class MeteredMethodBean {
@Metered(name = "meteredMethod")
public void meteredMethod() {
}
private final static String METER_NAME;
private final static AtomicLong METER_COUNT;
@Inject
private MetricRegistry registry;
@Inject
private MeteredMethodBean bean;
}
class MeteredMethodBe... | assertThat("Meter is not registered correctly", registry.getMeters(), hasKey(METER_NAME));
Meter meter = registry.getMeters().get(METER_NAME);
// Call the metered method and assert it's been marked
bean.meteredMethod();
// Make sure that the meter has been marked
assert... | [FOCAL] @Metered(name = "meteredMethod") public void MeteredMethodBean.meteredMethod()
[CLASS] class MeteredMethodBean
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[TEST] MeteredMethodBeanTest: @Test @InSequence(2) public void callMeteredMethodOnce()
[TEST-FIELDS] String METER_NAME, AtomicLong M... | /* static context
[FOCAL] @Metered(name = "meteredMethod") public void MeteredMethodBean.meteredMethod()
*/
| /* static context
[FOCAL] @Metered(name = "meteredMethod") public void MeteredMethodBean.meteredMethod()
*/
class MeteredMethodBean {
@Metered(name = "meteredMethod")
public void meteredMethod() {
}
private final static String METER_NAME;
private final static AtomicLong METER_COUNT;
@Inject
... | true | ok | {"focal": {"class": "MeteredMethodBean", "name": "meteredMethod", "signature": "void meteredMethod()", "start_line": 3, "modifiers": "@Metered(name = \"meteredMethod\") public", "params": [], "return_type": "void"}, "class_info": {"name": "MeteredMethodBean", "kind": "class", "modifiers": "", "superclass": null, "inter... |
13745124_126 | class DosAttributeProvider extends AttributeProvider {
@Override
public void set(File file, String view, String attribute, Object value, boolean create) {
if (supports(attribute)) {
checkNotCreate(view, attribute, create);
file.setAttribute("dos", attribute, checkType(view, attribute, value, Boolea... | for (String attribute : DOS_ATTRIBUTES) {
assertSetAndGetSucceeds(attribute, true);
assertSetFailsOnCreate(attribute, true);
}
}
} | [FOCAL] @Override public void DosAttributeProvider.set(File file, String view, String attribute, Object value, boolean create)
[CLASS] class DosAttributeProvider extends AttributeProvider
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] supports/1 (inherited), checkNotCreate/3 (inhe... | /* static context
[FOCAL] @Override public void DosAttributeProvider.set(File file, String view, String attribute, Object value, boolean create)
[PATH1] if(supports(attribute))=T
[PATH2] if(supports(attribute))=F
[INPUTS] branches=attribute | result=-
[COLLABORATORS] param file:File setAttribute/3
[CALLS-EXTERNAL] supp... | /* static context
[FOCAL] @Override public void DosAttributeProvider.set(File file, String view, String attribute, Object value, boolean create)
[PATH1] if(supports(attribute))=T
[PATH2] if(supports(attribute))=F
[INPUTS] branches=attribute | result=-
[COLLABORATORS] param file:File setAttribute/3
[CALLS-EXTERNAL] supp... | true | ok | {"focal": {"class": "DosAttributeProvider", "name": "set", "signature": "void set(File file, String view, String attribute, Object value, boolean create)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "file", "type": "File"}, {"name": "view", "type": "String"}, {"name": "attribute", "type": "St... |
13796699_2 | class HttpGet {
public String getSomeThing(String urlStr) throws IOException {
URL url = new URL(urlStr);
HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
urlConn.setConnectTimeout(3000);
urlConn.setRequestMethod("GET");
urlConn.connect();
... | String response = "Hello, The World!";
_mock.start(response, "text/plain");
String content = _httpGet.getSomeThing("http://localhost:9191/hello");
assertEquals(response, content);
}
} | [FOCAL] public String HttpGet.getSomeThing(String urlStr)
[CLASS] class HttpGet
[METRICS] loc=23 cc=3 branches=1 loops=0 returns=2 throws=1 nesting=2
[CALLS-EXTERNAL] URL.openConnection/0, HttpURLConnection.setConnectTimeout/1, HttpURLConnection.setRequestMethod/1, HttpURLConnection.connect/0, HttpURLConnection.getResp... | /* static context
[FOCAL] public String HttpGet.getSomeThing(String urlStr)
[THROWS-WHEN] e when try-body throws
[PATH1] try-body throws -> throw e
[PATH2] if(200 == urlConn.getResponseCode())=T -> return outs.toString("UTF-8")
[PATH3] if(200 == urlConn.getResponseCode())=F -> return null
[INPUTS] branches=urlStr | res... | /* static context
[FOCAL] public String HttpGet.getSomeThing(String urlStr)
[THROWS-WHEN] e when try-body throws
[PATH1] try-body throws -> throw e
[PATH2] if(200 == urlConn.getResponseCode())=T -> return outs.toString("UTF-8")
[PATH3] if(200 == urlConn.getResponseCode())=F -> return null
[INPUTS] branches=urlStr | res... | true | ok | {"focal": {"class": "HttpGet", "name": "getSomeThing", "signature": "String getSomeThing(String urlStr) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "urlStr", "type": "String"}], "return_type": "String"}, "class_info": {"name": "HttpGet", "kind": "class", "modifiers": "", "superclass... |
13865967_128 | class OperationKey {
public Type getType() {
return type;
}
public OperationKey(OperationKey key, String namespace);
public OperationKey(final ServiceVersion version, final String serviceName, final String operationName);
public OperationKey(final ServiceVersion version, final String se... | assertEquals(new OperationKey(new ServiceVersion(1, 1), "b", "c").getType(), OperationKey.Type.Request);
}
} | [FOCAL] public Type OperationKey.getType()
[CLASS] class OperationKey
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] OperationKey(OperationKey key, String namespace); OperationKey(ServiceVersion version, String serviceName, String operationName); OperationKey(ServiceVersion version... | /* static context
[FOCAL] public Type OperationKey.getType()
*/
| /* static context
[FOCAL] public Type OperationKey.getType()
*/
class OperationKey {
public Type getType() {
return type;
}
public OperationKey(OperationKey key, String namespace);
public OperationKey(final ServiceVersion version, final String serviceName, final String operationName);
pu... | true | ok | {"focal": {"class": "OperationKey", "name": "getType", "signature": "Type getType()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Type"}, "class_info": {"name": "OperationKey", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Operati... |
13867926_47 | class ConfigFileCreator {
public void create(String tebase) throws TEException {
File f = new File(tebase);
if (f.exists()) {
try {
process(tebase);
} catch (Exception e) {
e.printStackTrace();
}
} else {
throw new TEBaseNotFoundException(tebase);
}
}
public ConfigFileCreator();
publ... | File tebase = new File(classp, "tebase");
ConfigFileCreator configFileCreator = new ConfigFileCreator();
configFileCreator.create(tebase);
File configFile = new File(tebase, "config.xml");
try {
Document config = builder.parse(configFile);
Node node = XMLU... | [FOCAL] public void ConfigFileCreator.create(String tebase)
[CLASS] class ConfigFileCreator
[METRICS] loc=12 cc=3 branches=1 loops=0 returns=0 throws=1 nesting=2
[CALLS-INTERNAL] void process(String tebase)
[CALLS-EXTERNAL] File.exists/0, Exception.printStackTrace/0
[NEW] File, TEBaseNotFoundException
[EXCEPTIONS] decl... | /* static context
[FOCAL] public void ConfigFileCreator.create(String tebase)
[THROWS-WHEN] TEBaseNotFoundException when !f.exists()
[PATH1] if(f.exists())=T -> try-body throws
[PATH2] if(f.exists())=F -> throw new TEBaseNotFoundException(tebase)
[INPUTS] branches=tebase | result=tebase
[EXCEPTIONS] declares TEExceptio... | /* static context
[FOCAL] public void ConfigFileCreator.create(String tebase)
[THROWS-WHEN] TEBaseNotFoundException when !f.exists()
[PATH1] if(f.exists())=T -> try-body throws
[PATH2] if(f.exists())=F -> throw new TEBaseNotFoundException(tebase)
[INPUTS] branches=tebase | result=tebase
[EXCEPTIONS] declares TEExceptio... | true | ok | {"focal": {"class": "ConfigFileCreator", "name": "create", "signature": "void create(String tebase) throws TEException", "start_line": 3, "modifiers": "public", "params": [{"name": "tebase", "type": "String"}], "return_type": "void"}, "class_info": {"name": "ConfigFileCreator", "kind": "class", "modifiers": "", "superc... |
13869700_0 | class StringMatcher {
public boolean compare(String a, String b){
return true;
}
}
class StringMatcherTest {
@Test
public void accountMC() {
| if (verifyNoPropertyViolation()) {
StringMatcher matcher = new StringMatcher("abc");
matcher.compare("abc", "b");
}
}
} | [FOCAL] public boolean StringMatcher.compare(String a, String b)
[CLASS] class StringMatcher
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=- | unused=a, b
[TEST] StringMatcherTest: @Test public void accountMC() | /* static context
[FOCAL] public boolean StringMatcher.compare(String a, String b)
[INPUTS] branches=- | result=- | unused=a, b
*/
| /* static context
[FOCAL] public boolean StringMatcher.compare(String a, String b)
[INPUTS] branches=- | result=- | unused=a, b
*/
class StringMatcher {
public boolean compare(String a, String b){
return true;
}
}
class StringMatcherTest {
@Test
public void accountMC() {
| true | ok | {"focal": {"class": "StringMatcher", "name": "compare", "signature": "boolean compare(String a, String b)", "start_line": 3, "modifiers": "public", "params": [{"name": "a", "type": "String"}, {"name": "b", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "StringMatcher", "kind": "class", "modifiers... |
13870893_182 | class DeleteManager {
void close() {
for (DeleteOperation op : deleteOperations) {
// There is a rare scenario where the operation gets removed from this set and gets completed concurrently by
// the RequestResponseHandler thread when it is in poll() or handleResponse(). In order to avoid the complet... | setServerResponse(false);
testWithErrorCodes(Collections.singletonMap(ServerErrorCode.No_Error, 9), serverLayout,
RouterErrorCode.RouterClosed, new ErrorCodeChecker() {
@Override
public void testAndAssert(RouterErrorCode expectedError) throws Exception {
future = router.d... | [FOCAL] void DeleteManager.close()
[CLASS] class DeleteManager
[METRICS] loc=14 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] deleteOperations.remove/1, routerMetrics.operationDequeuingRate.mark/0, routerMetrics.operationAbortCount.inc/0, routerMetrics.onDeleteBlobError/1, NonBlockingRouter.comp... | /* static context
[FOCAL] void DeleteManager.close()
[PATH1] foreach(DeleteOperation op : deleteOperations)=T -> if(deleteOperations.remove(op))=T -> exit loop
[PATH2] foreach(DeleteOperation op : deleteOperations)=F
[PATH3] foreach(DeleteOperation op : deleteOperations)=T -> if(deleteOperations.remove(op))=F -> exit l... | /* static context
[FOCAL] void DeleteManager.close()
[PATH1] foreach(DeleteOperation op : deleteOperations)=T -> if(deleteOperations.remove(op))=T -> exit loop
[PATH2] foreach(DeleteOperation op : deleteOperations)=F
[PATH3] foreach(DeleteOperation op : deleteOperations)=T -> if(deleteOperations.remove(op))=F -> exit l... | true | ok | {"focal": {"class": "DeleteManager", "name": "close", "signature": "void close()", "start_line": 3, "modifiers": "", "params": [], "return_type": "void"}, "class_info": {"name": "DeleteManager", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "AWAIT_TIMEOUT_SECONDS", "type"... |
13873695_72 | class FilteringGenerator implements Generator<T> {
@Override
public T next() {
T next;
do {
next = delegate.next();
} while (!predicate.apply(next));
return next;
}
public FilteringGenerator(@Nonnull Generator<T> delegate, @Nonnull Predicate<T> predicate);... | //Given
Generator<Integer> oddNumbers = new FilteringGenerator<>(new RandomFromCollectionGenerator<>(1, 2, 3, 4, 5), new Predicate<Integer>() {
@Override
public boolean apply(Integer input) {
return input % 2 != 0;//only odd numbers
}
});
... | [FOCAL] @Override public T FilteringGenerator.next()
[CLASS] class FilteringGenerator implements Generator<T>
[METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] delegate.next/0, predicate.apply/1
[PATH1] do_while(!predicate.apply(next))=F -> return next
[COLLABORATORS] field delegate ... | /* static context
[FOCAL] @Override public T FilteringGenerator.next()
[PATH1] do_while(!predicate.apply(next))=F -> return next
[COLLABORATORS] field delegate next/0; field predicate apply/1
[CALLS-EXTERNAL] delegate.next/0, predicate.apply/1
*/
| /* static context
[FOCAL] @Override public T FilteringGenerator.next()
[PATH1] do_while(!predicate.apply(next))=F -> return next
[COLLABORATORS] field delegate next/0; field predicate apply/1
[CALLS-EXTERNAL] delegate.next/0, predicate.apply/1
*/
class FilteringGenerator implements Generator<T> {
@Override
pub... | true | ok | {"focal": {"class": "FilteringGenerator", "name": "next", "signature": "T next()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "T"}, "class_info": {"name": "FilteringGenerator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Generator<T>", "fields": [{"name": "ex... |
13886663_2 | class FileCarImage extends AbstractCarImage {
public void loadImage() throws IOException {
if (Files.exists(getFilepath()) && Files.isRegularFile(getFilepath())) {
InputStream inStream = Files.newInputStream(persistablePath.getPath());
loadImage(inStream);
return;
... | file.loadImage();
assertNotNull(file);
assertNotNull(file.getImage());
}
} | [FOCAL] public void FileCarImage.loadImage()
[CLASS] class FileCarImage extends AbstractCarImage
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] Path getFilepath(); void loadImage(InputStream inStream)
[CALLS-EXTERNAL] Files.exists/1, Files.isRegularFile/1, Files.newInputStream/1, ... | /* static context
[FOCAL] public void FileCarImage.loadImage()
[THROWS-WHEN] IOException when !(Files.exists(getFilepath()) && Files.isRegularFile(getFilepath()))
[PATH1] if(Files.exists(getFilepath()) && Files.isRegularFile(getFilepath()))=T -> return
[PATH2] if(Files.exists(getFilepath()) && Files.isRegularFile(getFi... | /* static context
[FOCAL] public void FileCarImage.loadImage()
[THROWS-WHEN] IOException when !(Files.exists(getFilepath()) && Files.isRegularFile(getFilepath()))
[PATH1] if(Files.exists(getFilepath()) && Files.isRegularFile(getFilepath()))=T -> return
[PATH2] if(Files.exists(getFilepath()) && Files.isRegularFile(getFi... | true | ok | {"focal": {"class": "FileCarImage", "name": "loadImage", "signature": "void loadImage() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "FileCarImage", "kind": "class", "modifiers": "", "superclass": "AbstractCarImage", "interfaces": null, "field... |
13893381_10 | class StringUtils {
public static String ConvertArabicToLetters(int num) {
String letters = "";
while (num > 0) {
num--;
letters = Character.toString((char) (65 + (num % 26))) + letters;
num = num / 26;
}
return letters.toString();
}
publ... |
String str = StringUtils.ConvertArabicToLetters(27);
assertTrue(str.equals("AA"));
}
} | [FOCAL] public static String StringUtils.ConvertArabicToLetters(int num)
[CLASS] class StringUtils
[METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Character.toString/1, String.toString/0
[PATH1] while(num > 0)=T -> exit loop -> return letters.toString()
[PATH2] while(num > 0)=F -> ... | /* static context
[FOCAL] public static String StringUtils.ConvertArabicToLetters(int num)
[PATH1] while(num > 0)=T -> exit loop -> return letters.toString()
[PATH2] while(num > 0)=F -> return letters.toString()
[INPUTS] branches=num | result=num
[CALLS-EXTERNAL] Character.toString/1, String.toString/0
*/
| /* static context
[FOCAL] public static String StringUtils.ConvertArabicToLetters(int num)
[PATH1] while(num > 0)=T -> exit loop -> return letters.toString()
[PATH2] while(num > 0)=F -> return letters.toString()
[INPUTS] branches=num | result=num
[CALLS-EXTERNAL] Character.toString/1, String.toString/0
*/
class StringU... | true | ok | {"focal": {"class": "StringUtils", "name": "ConvertArabicToLetters", "signature": "String ConvertArabicToLetters(int num)", "start_line": 3, "modifiers": "public static", "params": [{"name": "num", "type": "int"}], "return_type": "String"}, "class_info": {"name": "StringUtils", "kind": "class", "modifiers": "", "superc... |
13907695_14 | class Rectangle implements Distributable {
public Rectangle newSize(Size aNewSize) {
return new Rectangle(position, aNewSize);
}
public Rectangle();
public Rectangle(Position aPosition, Size aSize);
public boolean contains(Position aPosition);
public Rectangle newPosition(Position a... | Rectangle theOriginal = new Rectangle(new Position(10, 10), new Size(5, 7));
Rectangle theRectangle = theOriginal.newSize(new Size(20, 30));
assertNotSame(theOriginal, theRectangle);
assertTrue(theRectangle.contains(new Position(11, 11)));
assertTrue(theRectangle.contains(new P... | [FOCAL] public Rectangle Rectangle.newSize(Size aNewSize)
[CLASS] class Rectangle implements Distributable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Rectangle
[INPUTS] branches=- | result=aNewSize
[DATAFLOW] aNewSize@param->L2
[CLASS-MEMBERS] Rectangle(); Rectangle(Position aPosition, S... | /* static context
[FOCAL] public Rectangle Rectangle.newSize(Size aNewSize)
[INPUTS] branches=- | result=aNewSize
[NEW] Rectangle
*/
| /* static context
[FOCAL] public Rectangle Rectangle.newSize(Size aNewSize)
[INPUTS] branches=- | result=aNewSize
[NEW] Rectangle
*/
class Rectangle implements Distributable {
public Rectangle newSize(Size aNewSize) {
return new Rectangle(position, aNewSize);
}
public Rectangle();
public Rec... | true | ok | {"focal": {"class": "Rectangle", "name": "newSize", "signature": "Rectangle newSize(Size aNewSize)", "start_line": 3, "modifiers": "public", "params": [{"name": "aNewSize", "type": "Size"}], "return_type": "Rectangle"}, "class_info": {"name": "Rectangle", "kind": "class", "modifiers": "", "superclass": null, "interface... |
13910968_3 | class TodoService {
public void deleteTodo(Long id) {
todoRepository.delete(id);
}
@Autowired public TodoService(TodoRepository todoRepository);
public void saveTodo(Todo todo);
public List<Todo> getTodos();
public List<Todo> getActive();
public List<Todo> getCompleted();
pu... |
service.deleteTodo(123L);
verify(todoRepository).delete(123L);
}
} | [FOCAL] public void TodoService.deleteTodo(Long id)
[CLASS] class TodoService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] TodoRepository.delete/1
[FIELDS] read=todoRepository:TodoRepository
[COLLABORATORS] field todoRepository:TodoRepository delete/1
[DATAFLOW] id@param->L3; th... | /* static context
[FOCAL] public void TodoService.deleteTodo(Long id)
[COLLABORATORS] field todoRepository:TodoRepository delete/1
[FIELDS] read=todoRepository:TodoRepository
[CALLS-EXTERNAL] TodoRepository.delete/1
*/
| /* static context
[FOCAL] public void TodoService.deleteTodo(Long id)
[COLLABORATORS] field todoRepository:TodoRepository delete/1
[FIELDS] read=todoRepository:TodoRepository
[CALLS-EXTERNAL] TodoRepository.delete/1
*/
class TodoService {
public void deleteTodo(Long id) {
todoRepository.delete(id);
}
... | true | ok | {"focal": {"class": "TodoService", "name": "deleteTodo", "signature": "void deleteTodo(Long id)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "Long"}], "return_type": "void"}, "class_info": {"name": "TodoService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "f... |
13928240_0 | class I18Next {
public static boolean isI18NextKeyCandidate(CharSequence key) {
if (key != null && key.length() > 0) {
return key.toString().matches("([a-z0-9]+((\\_)([a-z0-9]+))*)+((\\.)[a-z0-9]+((\\_)([a-z0-9]+))*)+");
} else {
return false;
}
}
public I1... | String[] listKeyValid = {"test.dot", "test.double.dot", "test.test_underscore",
"test.test_double_underscore", "test.test_double_underscore.dot",
"test.dot_double_underscore", "test.test2"};
String[] listKeyInvalid = {"test", "space not accepted", "double..dot"};
... | [FOCAL] public static boolean I18Next.isI18NextKeyCandidate(CharSequence key)
[CLASS] class I18Next
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] CharSequence.length/0, key.toString().matches/1, CharSequence.toString/0
[PATH1] if(key != null && key.length() > 0)=T -> return key.t... | /* static context
[FOCAL] public static boolean I18Next.isI18NextKeyCandidate(CharSequence key)
[PATH1] if(key != null && key.length() > 0)=T -> return key.toString().matches("([a-z0-9]+((\\_)([a-z0-9]+))*)+((\\.)[a-z0-...
[PATH2] if(key != null && key.length() > 0)=F -> return false
[INPUTS] branches=key | result=key
... | /* static context
[FOCAL] public static boolean I18Next.isI18NextKeyCandidate(CharSequence key)
[PATH1] if(key != null && key.length() > 0)=T -> return key.toString().matches("([a-z0-9]+((\\_)([a-z0-9]+))*)+((\\.)[a-z0-...
[PATH2] if(key != null && key.length() > 0)=F -> return false
[INPUTS] branches=key | result=key
... | true | ok | {"focal": {"class": "I18Next", "name": "isI18NextKeyCandidate", "signature": "boolean isI18NextKeyCandidate(CharSequence key)", "start_line": 3, "modifiers": "public static", "params": [{"name": "key", "type": "CharSequence"}], "return_type": "boolean"}, "class_info": {"name": "I18Next", "kind": "class", "modifiers": "... |
13968244_38 | class GenerateProcessor implements PropertiesProcessor {
@Override
public Properties process(Properties in) {
Properties out = new Properties();
for (Entry<Object, Object> entry : in.entrySet()) {
Matcher wordMatcher = Pattern.compile(PropertiesKeywords.GENERATE_WORD_REGEX.getKey())... | GenerateProcessor generateProcessor = new GenerateProcessor();
Properties properties = new Properties();
String dateFormat = "yyyy-MM-dd";
int offSet = -25;
String text = String.format("generate_date(%s;%d)", dateFormat, offSet);
String reg = "[0-9]{4}-[0-9]{2}-[0-9]{2}";... | [FOCAL] @Override public Properties GenerateProcessor.process(Properties in)
[CLASS] class GenerateProcessor implements PropertiesProcessor
[METRICS] loc=44 cc=5 branches=0 loops=4 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Properties.entrySet/0, Pattern.compile(PropertiesKeywords.GENERATE_WORD_REGEX.ge....matcher/1... | /* static context
[FOCAL] @Override public Properties GenerateProcessor.process(Properties in)
[PATH1] foreach(Entry<Object, Object> entry : in.entrySet())=T -> while(wordMatcher.find())=F -> while(numberMatcher.find())=F -> while(dateMatcher.find())=F -> exit loop -> return out
[PATH2] foreach(Entry<Object, Object> en... | /* static context
[FOCAL] @Override public Properties GenerateProcessor.process(Properties in)
[PATH1] foreach(Entry<Object, Object> entry : in.entrySet())=T -> while(wordMatcher.find())=F -> while(numberMatcher.find())=F -> while(dateMatcher.find())=F -> exit loop -> return out
[PATH2] foreach(Entry<Object, Object> en... | true | ok | {"focal": {"class": "GenerateProcessor", "name": "process", "signature": "Properties process(Properties in)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "in", "type": "Properties"}], "return_type": "Properties"}, "class_info": {"name": "GenerateProcessor", "kind": "class", "modifiers": "", "s... |
14057993_4 | class ElasticSearchClient extends DB {
@Override
public int scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) {
try {
final RangeFilterBuilder filter = rangeFilter("_id").gte(startkey);
final SearchResponse res... | System.out.println("scan");
int recordcount = 10;
Set<String> fields = MOCK_DATA.keySet();
Vector<HashMap<String, ByteIterator>> resultParam = new Vector<HashMap<String, ByteIterator>>(10);
int expResult = 0;
int result = instance.scan(MOCK_TABLE, MOCK_KEY1, recordcount, ... | [FOCAL] @Override public int ElasticSearchClient.scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result)
[CLASS] class ElasticSearchClient extends DB
[METRICS] loc=30 cc=4 branches=0 loops=2 returns=2 throws=0 nesting=3
[CALLS-EXTERNAL] rangeFilter("_id").g... | /* static context
[FOCAL] @Override public int ElasticSearchClient.scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result)
[PATH1] foreach(SearchHit hit : response.getHits())=T -> foreach(String field : fields)=F -> exit loop -> return 0
[PATH2] try-body th... | /* static context
[FOCAL] @Override public int ElasticSearchClient.scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result)
[PATH1] foreach(SearchHit hit : response.getHits())=T -> foreach(String field : fields)=F -> exit loop -> return 0
[PATH2] try-body th... | true | ok | {"focal": {"class": "ElasticSearchClient", "name": "scan", "signature": "int scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "table", "type": "String"}, {"name": "startkey", "ty... |
14066577_215 | class TreeViewAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.TreeViewListener {
public void selectModeChanged(org.apache.pivot.wtk.TreeView arg0, org.apache.pivot.wtk.TreeView.SelectMode arg1) {
if (selectModeChanged != null) {
selectModeChanged.call(arg0, arg1);
}
}
... | final boolean[] invoked = new boolean[1];
CallableWithArgs<Void> callable = new CallableWithArgs<Void>() {
public Void call(Object... args) {
invoked[0] = true;
return null;
}
};
assertNull(adapter.getSelectModeChanged());
... | [FOCAL] public void TreeViewAdapter.selectModeChanged(org.apache.pivot.wtk.TreeView arg0, org.apache.pivot.wtk.TreeView.SelectMode arg1)
[CLASS] class TreeViewAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.TreeViewListener
[METRICS] loc=5 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNA... | /* static context
[FOCAL] public void TreeViewAdapter.selectModeChanged(org.apache.pivot.wtk.TreeView arg0, org.apache.pivot.wtk.TreeView.SelectMode arg1)
[PATH1] if(selectModeChanged != null)=T
[PATH2] if(selectModeChanged != null)=F
[COLLABORATORS] field selectModeChanged call/2
[CALLS-EXTERNAL] selectModeChanged.cal... | /* static context
[FOCAL] public void TreeViewAdapter.selectModeChanged(org.apache.pivot.wtk.TreeView arg0, org.apache.pivot.wtk.TreeView.SelectMode arg1)
[PATH1] if(selectModeChanged != null)=T
[PATH2] if(selectModeChanged != null)=F
[COLLABORATORS] field selectModeChanged call/2
[CALLS-EXTERNAL] selectModeChanged.cal... | true | ok | {"focal": {"class": "TreeViewAdapter", "name": "selectModeChanged", "signature": "void selectModeChanged(org.apache.pivot.wtk.TreeView arg0, org.apache.pivot.wtk.TreeView.SelectMode arg1)", "start_line": 3, "modifiers": "public", "params": [{"name": "arg0", "type": "org.apache.pivot.wtk.TreeView"}, {"name": "arg1", "ty... |
14082560_31 | class MatchBasedDiscoveryIO implements DiscoveryIO<E> {
@Override
public Set<Operation<E>> findOperationsProducing(E output) {
Map<E,T> sources = matchGraph.getSourceElementsThatMatch(output);
// For each target, get the services that uses the input
Set<Operation<E>> relevantOps = new H... | // Get all services that can provide y (Op1 and Op2)
Set<Operation<String>> result = matchDiscovery.findOperationsProducing("y");
assertNotNull(result);
assertEquals(2, result.size());
}
} | [FOCAL] @Override public Set<Operation<E>> MatchBasedDiscoveryIO.findOperationsProducing(E output)
[CLASS] class MatchBasedDiscoveryIO implements DiscoveryIO<E>
[METRICS] loc=13 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] matchGraph.getSourceElementsThatMatch/1, Map<E,T>.keySet/0, provider.get... | /* static context
[FOCAL] @Override public Set<Operation<E>> MatchBasedDiscoveryIO.findOperationsProducing(E output)
[PATH1] foreach(E source : sources.keySet())=T -> if(result != null)=T -> exit loop -> return relevantOps
[PATH2] foreach(E source : sources.keySet())=F -> return relevantOps
[PATH3] foreach(E source : s... | /* static context
[FOCAL] @Override public Set<Operation<E>> MatchBasedDiscoveryIO.findOperationsProducing(E output)
[PATH1] foreach(E source : sources.keySet())=T -> if(result != null)=T -> exit loop -> return relevantOps
[PATH2] foreach(E source : sources.keySet())=F -> return relevantOps
[PATH3] foreach(E source : s... | true | ok | {"focal": {"class": "MatchBasedDiscoveryIO", "name": "findOperationsProducing", "signature": "Set<Operation<E>> findOperationsProducing(E output)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "output", "type": "E"}], "return_type": "Set<Operation<E>>"}, "class_info": {"name": "MatchBasedDiscov... |
14083998_16 | class HierarchyScanner extends AbstractScanner {
public List<Edge> getEdges() {
List<Edge> edges = new ArrayList<>();
for (Class<?> clazz : classes) {
Class<?> superclass = clazz.getSuperclass();
if (isDomainClass(superclass)) {
DomainObject child = new Domai... | List<Class<?>> hierarchicalClasses = Lists.newArrayList();
hierarchicalClasses.add(Child.class);
hierarchicalClasses.add(GrandChild.class);
HierarchyScanner scanner = new HierarchyScanner(hierarchicalClasses);
List<Edge> edges = scanner.getEdges();
assertThat(edges, cont... | [FOCAL] public List<Edge> HierarchyScanner.getEdges()
[CLASS] class HierarchyScanner extends AbstractScanner
[METRICS] loc=12 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Class<?>.getSuperclass/0, isDomainClass/1 (inherited), List<Edge>.add/1
[NEW] ArrayList<>, DomainObject, Edge
[PATH1] foreac... | /* static context
[FOCAL] public List<Edge> HierarchyScanner.getEdges()
[PATH1] foreach(Class<?> clazz : classes)=T -> if(isDomainClass(superclass))=T -> exit loop -> return edges
[PATH2] foreach(Class<?> clazz : classes)=F -> return edges
[PATH3] foreach(Class<?> clazz : classes)=T -> if(isDomainClass(superclass))=F -... | /* static context
[FOCAL] public List<Edge> HierarchyScanner.getEdges()
[PATH1] foreach(Class<?> clazz : classes)=T -> if(isDomainClass(superclass))=T -> exit loop -> return edges
[PATH2] foreach(Class<?> clazz : classes)=F -> return edges
[PATH3] foreach(Class<?> clazz : classes)=T -> if(isDomainClass(superclass))=F -... | true | ok | {"focal": {"class": "HierarchyScanner", "name": "getEdges", "signature": "List<Edge> getEdges()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Edge>"}, "class_info": {"name": "HierarchyScanner", "kind": "class", "modifiers": "", "superclass": "AbstractScanner", "interfaces": null, "fields"... |
14094143_12 | class FileFilter {
public boolean match(final File file) {
boolean result = doMmatch(file);
return filterType == INCLUDE ? result : !result;
}
public FileFilter(int matchType, int filterType, boolean appliesToDir, FileFilterRule... rules);
public int getMatchType();
public int getFilterType();
public bool... | FileFilter filter = new FileFilter(FileFilter.MATCH_ALL, FileFilter.INCLUDE, true, alwaysTrue);
assertTrue(filter.match(testNode));
}
} | [FOCAL] public boolean FileFilter.match(File file)
[CLASS] class FileFilter
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] boolean doMmatch(File file)
[INPUTS] branches=- | result=file
[DATAFLOW] file@param->L2; result@L2->L3
[CLASS-MEMBERS] FileFilter(int matchType, int filterTyp... | /* static context
[FOCAL] public boolean FileFilter.match(File file)
[INPUTS] branches=- | result=file
[CALLS-INTERNAL] boolean doMmatch(File file)
*/
| /* static context
[FOCAL] public boolean FileFilter.match(File file)
[INPUTS] branches=- | result=file
[CALLS-INTERNAL] boolean doMmatch(File file)
*/
class FileFilter {
public boolean match(final File file) {
boolean result = doMmatch(file);
return filterType == INCLUDE ? result : !result;
}
public FileFilte... | true | ok | {"focal": {"class": "FileFilter", "name": "match", "signature": "boolean match(File file)", "start_line": 3, "modifiers": "public", "params": [{"name": "file", "type": "File"}], "return_type": "boolean"}, "class_info": {"name": "FileFilter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fie... |
14104548_0 | class ClassSchemaBuilder {
ClassInfo createClassInfo(Class<?> c) {
return createClassInfo(c, Collections.<String>emptySet(), false);
}
ClassSchemaBuilder();
void registerClass(Class<?> c, Set<String> ignoreFields);
void registerClass(Class<?> c, Set<String> ignoreFields, boolean withT... | ClassSchemaBuilder.ClassInfo classInfo = classSchemaBuilder.createClassInfo(TestClass.class);
Assert.assertEquals(7, classInfo.fieldInfos.length);
}
} | [FOCAL] ClassInfo ClassSchemaBuilder.createClassInfo(Class<?> c)
[CLASS] class ClassSchemaBuilder
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ClassInfo createClassInfo(Class<?> c, Set<String> fieldNamesToIgnore, boolean withTransient)
[CALLS-EXTERNAL] Collections.emptySet/0
[IN... | /* static context
[FOCAL] ClassInfo ClassSchemaBuilder.createClassInfo(Class<?> c)
[INPUTS] branches=- | result=c
[CALLS-INTERNAL] ClassInfo createClassInfo(Class<?> c, Set<String> fieldNamesToIgnore, boolean withTransient)
[CALLS-EXTERNAL] Collections.emptySet/0
*/
| /* static context
[FOCAL] ClassInfo ClassSchemaBuilder.createClassInfo(Class<?> c)
[INPUTS] branches=- | result=c
[CALLS-INTERNAL] ClassInfo createClassInfo(Class<?> c, Set<String> fieldNamesToIgnore, boolean withTransient)
[CALLS-EXTERNAL] Collections.emptySet/0
*/
class ClassSchemaBuilder {
ClassInfo createClass... | true | ok | {"focal": {"class": "ClassSchemaBuilder", "name": "createClassInfo", "signature": "ClassInfo createClassInfo(Class<?> c)", "start_line": 3, "modifiers": "", "params": [{"name": "c", "type": "Class<?>"}], "return_type": "ClassInfo"}, "class_info": {"name": "ClassSchemaBuilder", "kind": "class", "modifiers": "", "supercl... |
14105280_19 | class WorkflowFilesDeployer {
URI getTargetJsFileUri(URI uri) throws URISyntaxException {
String path = uri.getPath() + File.separator + config.getWorkflowName() + ".js";
return new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(),
uri.getPort(), path, uri.getQuery(), uri.getFr... | CelosCiContext context = mock(CelosCiContext.class);
WorkflowFilesDeployer deployer = new WorkflowFilesDeployer(context);
doReturn("workflow").when(context).getWorkflowName();
Assert.assertEquals(deployer.getTargetJsFileUri(URI.create("sftp://user@server:999/home")), URI.create("sftp://... | [FOCAL] URI WorkflowFilesDeployer.getTargetJsFileUri(URI uri)
[CLASS] class WorkflowFilesDeployer
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] URI.getPath/0, config.getWorkflowName/0, URI.getScheme/0, URI.getUserInfo/0, URI.getHost/0, URI.getPort/0, URI.getQuery/0, URI.getFragme... | /* static context
[FOCAL] URI WorkflowFilesDeployer.getTargetJsFileUri(URI uri)
[INPUTS] branches=- | result=uri
[COLLABORATORS] param uri:URI getPath/0,getScheme/0,getUserInfo/0,getHost/0,getPort/0,getQuery/0; field config getWorkflowName/0
[EXCEPTIONS] declares URISyntaxException
[NEW] URI
[CALLS-EXTERNAL] URI.getPat... | /* static context
[FOCAL] URI WorkflowFilesDeployer.getTargetJsFileUri(URI uri)
[INPUTS] branches=- | result=uri
[COLLABORATORS] param uri:URI getPath/0,getScheme/0,getUserInfo/0,getHost/0,getPort/0,getQuery/0; field config getWorkflowName/0
[EXCEPTIONS] declares URISyntaxException
[NEW] URI
[CALLS-EXTERNAL] URI.getPat... | true | ok | {"focal": {"class": "WorkflowFilesDeployer", "name": "getTargetJsFileUri", "signature": "URI getTargetJsFileUri(URI uri) throws URISyntaxException", "start_line": 3, "modifiers": "", "params": [{"name": "uri", "type": "URI"}], "return_type": "URI"}, "class_info": {"name": "WorkflowFilesDeployer", "kind": "class", "modi... |
14106147_7 | class ObjectAddedUpdater implements ThreadSafeMultimap.ListUpdater<V> {
@Nullable
@Override
public List<V> update(@Nonnull List<V> values) {
if (values == ThreadSafeMultimap.NO_VALUE) {
return null;
} else if (!Iterables.contains(values, newObject)) {
final List<V> result = ThreadSafeMultimap.copy(values)... | int sizeBefore = multimap.get(3).size();
final TestObject oldObject = multimap.get(3).get(0);
multimap.update(3, new ObjectAddedUpdater<TestObject>(oldObject));
assertEquals(sizeBefore, multimap.get(3).size());
}
} | [FOCAL] @Nullable @Override public List<V> ObjectAddedUpdater.update(List<V> values)
[CLASS] class ObjectAddedUpdater implements ThreadSafeMultimap.ListUpdater<V>
[METRICS] loc=13 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] Iterables.contains/2, ThreadSafeMultimap.copy/1, List<V>.add/1
[PATH1]... | /* static context
[FOCAL] @Nullable @Override public List<V> ObjectAddedUpdater.update(List<V> values)
[PATH1] if(values == ThreadSafeMultimap.NO_VALUE)=F -> if(!Iterables.contains(values, newObject))=T -> return result
[PATH2] if(values == ThreadSafeMultimap.NO_VALUE)=T -> return null
[PATH3] if(values == ThreadSafeMu... | /* static context
[FOCAL] @Nullable @Override public List<V> ObjectAddedUpdater.update(List<V> values)
[PATH1] if(values == ThreadSafeMultimap.NO_VALUE)=F -> if(!Iterables.contains(values, newObject))=T -> return result
[PATH2] if(values == ThreadSafeMultimap.NO_VALUE)=T -> return null
[PATH3] if(values == ThreadSafeMu... | true | ok | {"focal": {"class": "ObjectAddedUpdater", "name": "update", "signature": "List<V> update(List<V> values)", "start_line": 3, "modifiers": "@Nullable @Override public", "params": [{"name": "values", "type": "List<V>"}], "return_type": "List<V>"}, "class_info": {"name": "ObjectAddedUpdater", "kind": "class", "modifiers": ... |
14135467_11 | class BackoffHelper {
public <E extends Exception> void doUntilSuccess(final ExceptionalSupplier<Boolean, E> task)
throws InterruptedException, BackoffStoppedException, E {
doUntilResult(() -> {
Boolean result = task.get();
return Boolean.TRUE.equals(result) ? result : null;
});
}
publ... | ExceptionalSupplier<Boolean, RuntimeException> task =
createMock(new Clazz<ExceptionalSupplier<Boolean, RuntimeException>>() { });
expect(task.get()).andReturn(false);
expect(backoffStrategy.shouldContinue(0L)).andReturn(true);
expect(backoffStrategy.calculateBackoffMs(0L)).andReturn(42L);
... | [FOCAL] public void BackoffHelper.doUntilSuccess(ExceptionalSupplier<Boolean, E> task)
[CLASS] class BackoffHelper
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] T doUntilResult(ExceptionalSupplier<T, E> task)
[CALLS-EXTERNAL] ExceptionalSupplier<Boolean, E>.get/0, Boolean.TRUE.eq... | /* static context
[FOCAL] public void BackoffHelper.doUntilSuccess(ExceptionalSupplier<Boolean, E> task)
[COLLABORATORS] param task:ExceptionalSupplier<Boolean, E> get/0
[EXCEPTIONS] declares InterruptedException, BackoffStoppedException, E
[CALLS-INTERNAL] T doUntilResult(ExceptionalSupplier<T, E> task)
[CALLS-EXTERNA... | /* static context
[FOCAL] public void BackoffHelper.doUntilSuccess(ExceptionalSupplier<Boolean, E> task)
[COLLABORATORS] param task:ExceptionalSupplier<Boolean, E> get/0
[EXCEPTIONS] declares InterruptedException, BackoffStoppedException, E
[CALLS-INTERNAL] T doUntilResult(ExceptionalSupplier<T, E> task)
[CALLS-EXTERNA... | true | ok | {"focal": {"class": "BackoffHelper", "name": "doUntilSuccess", "signature": "void doUntilSuccess(ExceptionalSupplier<Boolean, E> task) throws InterruptedException, BackoffStoppedException, E", "start_line": 3, "modifiers": "public", "params": [{"name": "task", "type": "ExceptionalSupplier<Boolean, E>"}], "return_type":... |
14135469_6 | class StartMojo extends JobActionMojoBase {
@Override
public void execute() throws MojoExecutionException {
final JobOperator jobOperator = getOrCreateOperator();
final ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
final ClassLoader loader = createStartLoader(... | final StartMojo mojo = mojo(StartMojo.class, "jobName", "simple");
mojo.execute();
final String output = BatchEEMojoTestFactory.output(mojo);
final long id = Long.parseLong(output.substring(output.lastIndexOf("#") + 1).trim());
waitForEnd(mojo.getOrCreateOperator(), id);
... | [FOCAL] @Override public void StartMojo.execute()
[CLASS] class StartMojo extends JobActionMojoBase
[METRICS] loc=21 cc=3 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] ClassLoader createStartLoader(ClassLoader parent)
[CALLS-EXTERNAL] getOrCreateOperator/0 (inherited), Thread.currentThread().getConte... | /* static context
[FOCAL] @Override public void StartMojo.execute()
[PATH1] if(wait)=T
[PATH2] if(wait)=F
[PATH3] try-body throws
[EXCEPTIONS] declares MojoExecutionException
[CALLS-INTERNAL] ClassLoader createStartLoader(ClassLoader parent)
[CALLS-EXTERNAL] getOrCreateOperator/0 (inherited), Thread.currentThread().get... | /* static context
[FOCAL] @Override public void StartMojo.execute()
[PATH1] if(wait)=T
[PATH2] if(wait)=F
[PATH3] try-body throws
[EXCEPTIONS] declares MojoExecutionException
[CALLS-INTERNAL] ClassLoader createStartLoader(ClassLoader parent)
[CALLS-EXTERNAL] getOrCreateOperator/0 (inherited), Thread.currentThread().get... | true | ok | {"focal": {"class": "StartMojo", "name": "execute", "signature": "void execute() throws MojoExecutionException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "StartMojo", "kind": "class", "modifiers": "", "superclass": "JobActionMojoBase", "interfaces": ... |
14142718_56 | class JPAContainer implements EntityContainer<T>,
EntityProviderChangeListener<T>, HierarchicalEntityContainer<T>,
Container.Indexed {
public Property getContainerProperty(Object itemId, Object propertyId) {
Item item = getItem(itemId);
return item == null ? null : item.getItemPrope... | Person p = new Person();
p.setFirstName("Joe");
expect(entityProviderMock.getEntity(container, "myId")).andStubReturn(p);
expect(entityProviderMock.getEntity(container, "nonExistent")).andStubReturn(null);
replay(entityProviderMock);
container.setEntityProvider(entityPro... | [FOCAL] public Property JPAContainer.getContainerProperty(Object itemId, Object propertyId)
[CLASS] class JPAContainer implements EntityContainer<T>, EntityProviderChangeListener<T>, HierarchicalEntityContainer<T>, Container.Indexed
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] E... | /* static context
[FOCAL] public Property JPAContainer.getContainerProperty(Object itemId, Object propertyId)
[INPUTS] branches=- | result=itemId, propertyId
[CALLS-INTERNAL] EntityItem<T> getItem(Object itemId)
[CALLS-EXTERNAL] Item.getItemProperty/1
*/
| /* static context
[FOCAL] public Property JPAContainer.getContainerProperty(Object itemId, Object propertyId)
[INPUTS] branches=- | result=itemId, propertyId
[CALLS-INTERNAL] EntityItem<T> getItem(Object itemId)
[CALLS-EXTERNAL] Item.getItemProperty/1
*/
class JPAContainer implements EntityContainer<T>,
EntityP... | true | ok | {"focal": {"class": "JPAContainer", "name": "getContainerProperty", "signature": "Property getContainerProperty(Object itemId, Object propertyId)", "start_line": 5, "modifiers": "public", "params": [{"name": "itemId", "type": "Object"}, {"name": "propertyId", "type": "Object"}], "return_type": "Property"}, "class_info"... |
14145700_383 | class ValueComparisonEvaluator extends QueryEvaluator {
@Override
public boolean evaluate(QueryEvaluationContext ctx) {
ctx.setResult(false);
Object value = rvalue.getValue();
LOGGER.debug("evaluate {} {} {}", field, operator, value);
KeyValueCursor<Path, JsonNode> cursor = ctx.... | QueryExpression q = EvalTestContext.queryExpressionFromJson("{'field':'field4','op':'>','rvalue':3.5}");
QueryEvaluator qe = QueryEvaluator.getInstance(q, md);
QueryEvaluationContext ctx = qe.evaluate(jsonDoc);
Assert.assertTrue(ctx.getResult());
}
} | [FOCAL] @Override public boolean ValueComparisonEvaluator.evaluate(QueryEvaluationContext ctx)
[CLASS] class ValueComparisonEvaluator extends QueryEvaluator
[METRICS] loc=43 cc=7 branches=5 loops=1 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] QueryEvaluationContext.setResult/1, rvalue.getValue/0, LOGGER.debug/4, Query... | /* static context
[FOCAL] @Override public boolean ValueComparisonEvaluator.evaluate(QueryEvaluationContext ctx)
[PATH1] while(cursor.hasNext())=T -> if(value == null)=T -> if(docValueNull)=T -> if(ctx.getResult())=F -> exit loop -> if(value == null && !fieldValueExists && operator == BinaryComparisonOperator._eq)=T ->... | /* static context
[FOCAL] @Override public boolean ValueComparisonEvaluator.evaluate(QueryEvaluationContext ctx)
[PATH1] while(cursor.hasNext())=T -> if(value == null)=T -> if(docValueNull)=T -> if(ctx.getResult())=F -> exit loop -> if(value == null && !fieldValueExists && operator == BinaryComparisonOperator._eq)=T ->... | true | ok | {"focal": {"class": "ValueComparisonEvaluator", "name": "evaluate", "signature": "boolean evaluate(QueryEvaluationContext ctx)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "ctx", "type": "QueryEvaluationContext"}], "return_type": "boolean"}, "class_info": {"name": "ValueComparisonEvaluator", ... |
14173210_42 | class BSN extends BasePacket {
@Override
public IPacket deserialize(byte[] data, int offset, int length)
throws PacketParsingException {
ByteBuffer bb = ByteBuffer.wrap(data, offset, length);
int magic = bb.getInt();
if (magic != BSN_MAGIC) {
throw new PacketPar... | Ethernet pkt = (Ethernet) new Ethernet().deserialize(probePkt, 0, probePkt.length);
assertTrue(Arrays.equals(probePkt, pkt.serialize()));
Ethernet expected = getProbePacket();
assertEquals(expected, pkt);
}
} | [FOCAL] @Override public IPacket BSN.deserialize(byte[] data, int offset, int length)
[CLASS] class BSN extends BasePacket
[METRICS] loc=35 cc=5 branches=3 loops=0 returns=1 throws=3 nesting=2
[CALLS-EXTERNAL] ByteBuffer.wrap/3, ByteBuffer.getInt/0, ByteBuffer.getShort/0, typeClassMap.containsKey/1, typeClassMap.get/1,... | /* static context
[FOCAL] @Override public IPacket BSN.deserialize(byte[] data, int offset, int length)
[THROWS-WHEN] PacketParsingException when magic != BSN_MAGIC
[THROWS-WHEN] PacketParsingException when !(magic != BSN_MAGIC) && this.version != BSN_VERSION_CURRENT
[THROWS-WHEN] RuntimeException when !(magic != BSN_M... | /* static context
[FOCAL] @Override public IPacket BSN.deserialize(byte[] data, int offset, int length)
[THROWS-WHEN] PacketParsingException when magic != BSN_MAGIC
[THROWS-WHEN] PacketParsingException when !(magic != BSN_MAGIC) && this.version != BSN_VERSION_CURRENT
[THROWS-WHEN] RuntimeException when !(magic != BSN_M... | true | ok | {"focal": {"class": "BSN", "name": "deserialize", "signature": "IPacket deserialize(byte[] data, int offset, int length) throws PacketParsingException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "data", "type": "byte[]"}, {"name": "offset", "type": "int"}, {"name": "length", "type": "int"}],... |
14176513_11 | class SpoonCodeInstrument extends JfxInstrument implements Initializable {
String prettyPrintType(final Type type) {
if(type instanceof Class) {
return ((Class<?>) type).getSimpleName();
}
if(type instanceof ParameterizedType) {
final ParameterizedType paramType = (ParameterizedType) type;
return getUn... | final String string = spoonCodeInstrument.prettyPrintType(Stub.class.getMethod("meth").getGenericReturnType());
assertThat(string).isEqualTo("Stub3<CtStatement, ?>");
}
} | [FOCAL] String SpoonCodeInstrument.prettyPrintType(Type type)
[CLASS] class SpoonCodeInstrument extends JfxInstrument implements Initializable
[METRICS] loc=14 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] String getUnqualifiedClassName(String qname)
[CALLS-EXTERNAL] ((Class<?>) type).getSimpleN... | /* static context
[FOCAL] String SpoonCodeInstrument.prettyPrintType(Type type)
[PATH1] if(type instanceof Class)=F -> if(type instanceof ParameterizedType)=T -> return getUnqualifiedClassName(paramType.getRawType().getTypeName()) + Arr...
[PATH2] if(type instanceof Class)=T -> return ((Class<?>) type).getSimpleName()
... | /* static context
[FOCAL] String SpoonCodeInstrument.prettyPrintType(Type type)
[PATH1] if(type instanceof Class)=F -> if(type instanceof ParameterizedType)=T -> return getUnqualifiedClassName(paramType.getRawType().getTypeName()) + Arr...
[PATH2] if(type instanceof Class)=T -> return ((Class<?>) type).getSimpleName()
... | true | ok | {"focal": {"class": "SpoonCodeInstrument", "name": "prettyPrintType", "signature": "String prettyPrintType(Type type)", "start_line": 3, "modifiers": "", "params": [{"name": "type", "type": "Type"}], "return_type": "String"}, "class_info": {"name": "SpoonCodeInstrument", "kind": "class", "modifiers": "", "superclass": ... |
14202062_0 | class GetFlights extends WebServiceGatewaySupport {
public GetFlights(WebServiceMessageFactory messageFactory) {
super(messageFactory);
}
public GetFlights(WebServiceMessageFactory messageFactory);
public void getFlights();
private void writeTicket(Ticket ticket);
private void writeName(Name name);
private... |
Source getFlightsRequest = new StringSource("<GetFlightsRequest xmlns='" + MESSAGES_NS + "'>" + "<from>AMS</from>"
+ "<to>VCE</to>" + "<departureDate>2006-01-31</departureDate>" + "</GetFlightsRequest>");
String flightInfo = "<t:number>KL1653</t:number>"
+ "<t:departureTime>2006-01-31T10:05:00.000+01:00</... | [FOCAL] public GetFlights.GetFlights(WebServiceMessageFactory messageFactory)
[CLASS] class GetFlights extends WebServiceGatewaySupport
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[DATAFLOW] messageFactory@param->L2
[CLASS-MEMBERS] GetFlights(WebServiceMessageFactory messageFactory); void getFl... | /* static context
[FOCAL] public GetFlights.GetFlights(WebServiceMessageFactory messageFactory)
*/
| /* static context
[FOCAL] public GetFlights.GetFlights(WebServiceMessageFactory messageFactory)
*/
class GetFlights extends WebServiceGatewaySupport {
public GetFlights(WebServiceMessageFactory messageFactory) {
super(messageFactory);
}
public GetFlights(WebServiceMessageFactory messageFactory);
public void g... | true | ok | {"focal": {"class": "GetFlights", "name": "GetFlights", "signature": "GetFlights(WebServiceMessageFactory messageFactory)", "start_line": 3, "modifiers": "public", "params": [{"name": "messageFactory", "type": "WebServiceMessageFactory"}], "return_type": null}, "class_info": {"name": "GetFlights", "kind": "class", "mod... |
14212940_20 | class HierarchicalShardSyncer {
public synchronized boolean checkAndCreateLeaseForNewShards(@NonNull final ShardDetector shardDetector,
final LeaseRefresher leaseRefresher, final InitialPositionInStreamExtended initialPosition,
final MetricsScope scope, final boolean ignoreUnexpectedChildSh... | final List<Shard> latestShards = constructShardListForGraphA();
final ArgumentCaptor<Lease> leaseCaptor = ArgumentCaptor.forClass(Lease.class);
when(shardDetector.listShards()).thenReturn(latestShards);
when(dynamoDBLeaseRefresher.listLeases()).thenReturn(Collections.emptyList());
... | [FOCAL] public synchronized boolean HierarchicalShardSyncer.checkAndCreateLeaseForNewShards(ShardDetector shardDetector, LeaseRefresher leaseRefresher, InitialPositionInStreamExtended initialPosition, MetricsScope scope, boolean ignoreUnexpectedChildShards, boolean isLeaseTableEmpty)
[CLASS] class HierarchicalShardSync... | class HierarchicalShardSyncer {
public synchronized boolean checkAndCreateLeaseForNewShards(@NonNull final ShardDetector shardDetector,
final LeaseRefresher leaseRefresher, final InitialPositionInStreamExtended initialPosition,
final MetricsScope scope, final boolean ignoreUnexpectedChildSh... | false | ok | {"focal": {"class": "HierarchicalShardSyncer", "name": "checkAndCreateLeaseForNewShards", "signature": "boolean checkAndCreateLeaseForNewShards(ShardDetector shardDetector, LeaseRefresher leaseRefresher, InitialPositionInStreamExtended initialPosition, MetricsScope scope, boolean ignoreUnexpectedChildShards, boolean is... | |
14230404_5 | class PropertyMatchers {
public static PropertyMatchers overriddenMatchers(String property, Matcher matcher) {
return new PropertyMatchers(newHashSet(entryOf(property, matcher)));
}
private PropertyMatchers(Map<String, Matcher> matchers);
private PropertyMatchers(Set<Map.Entry<String, Matche... | FixtureAssert.assertThat(testMap)
.toMatchSnapshotExactly(overriddenMatchers("x.a", nested(new BaseMatcher<Map>() {
@Override
public boolean matches(Object item) {
Map<String, Object> expected = (Map<String, Obje... | [FOCAL] public static PropertyMatchers PropertyMatchers.overriddenMatchers(String property, Matcher matcher)
[CLASS] class PropertyMatchers
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Map.Entry<String, Matcher> entryOf(String property, Matcher matcher)
[CALLS-EXTERNAL] newHashS... | /* static context
[FOCAL] public static PropertyMatchers PropertyMatchers.overriddenMatchers(String property, Matcher matcher)
[INPUTS] branches=- | result=matcher, property
[CALLS-INTERNAL] Map.Entry<String, Matcher> entryOf(String property, Matcher matcher)
[NEW] PropertyMatchers
[CALLS-EXTERNAL] newHashSet/1 (inheri... | /* static context
[FOCAL] public static PropertyMatchers PropertyMatchers.overriddenMatchers(String property, Matcher matcher)
[INPUTS] branches=- | result=matcher, property
[CALLS-INTERNAL] Map.Entry<String, Matcher> entryOf(String property, Matcher matcher)
[NEW] PropertyMatchers
[CALLS-EXTERNAL] newHashSet/1 (inheri... | true | ok | {"focal": {"class": "PropertyMatchers", "name": "overriddenMatchers", "signature": "PropertyMatchers overriddenMatchers(String property, Matcher matcher)", "start_line": 3, "modifiers": "public static", "params": [{"name": "property", "type": "String"}, {"name": "matcher", "type": "Matcher"}], "return_type": "PropertyM... |
14279760_53 | class NamesAdapter extends BaseAdapter {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView textView = convertView == null ? createView(parent) : (TextView) convertView;
textView.setText(names.get(position));
return textView;
}
public Na... | TextView existingView = new TextView(null);
TextView nameView = (TextView) namesAdapter.getView(2, existingView, new LinearLayout(new Activity()));
assertThat(nameView, sameInstance(existingView));
}
} | [FOCAL] @Override public View NamesAdapter.getView(int position, View convertView, ViewGroup parent)
[CLASS] class NamesAdapter extends BaseAdapter
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] TextView createView(ViewGroup parent)
[CALLS-EXTERNAL] TextView.setText/1, ArrayList<S... | /* static context
[FOCAL] @Override public View NamesAdapter.getView(int position, View convertView, ViewGroup parent)
[INPUTS] branches=- | result=convertView, parent
[COLLABORATORS] field names:ArrayList<String> get/1
[CALLS-INTERNAL] TextView createView(ViewGroup parent)
[FIELDS] read=names:ArrayList<String>
[CALLS-... | /* static context
[FOCAL] @Override public View NamesAdapter.getView(int position, View convertView, ViewGroup parent)
[INPUTS] branches=- | result=convertView, parent
[COLLABORATORS] field names:ArrayList<String> get/1
[CALLS-INTERNAL] TextView createView(ViewGroup parent)
[FIELDS] read=names:ArrayList<String>
[CALLS-... | true | ok | {"focal": {"class": "NamesAdapter", "name": "getView", "signature": "View getView(int position, View convertView, ViewGroup parent)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "position", "type": "int"}, {"name": "convertView", "type": "View"}, {"name": "parent", "type": "ViewGroup"}], "retu... |
14281190_10 | class SpscChannel implements Channel<E> {
@SuppressWarnings("unchecked")
private SpscChannelConsumer<E> newConsumer(Object... args) {
return mapper.newFlyweight(SpscChannelConsumer.class, "ChannelConsumerTemplate.java",
Template.fromFile(Channel.class, "ChannelConsumerTemplate.java"), ... | ChannelConsumer consumer = newConsumer();
shouldWriteAnObject();
assertTrue(consumer.read());
assertEmpty();
}
} | [FOCAL] @SuppressWarnings("unchecked") private SpscChannelConsumer<E> SpscChannel.newConsumer(Object... args)
[CLASS] class SpscChannel implements Channel<E>
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] mapper.newFlyweight/4, Template.fromFile/2
[INPUTS] branches=- | result=args... | /* static context
[FOCAL] @SuppressWarnings("unchecked") private SpscChannelConsumer<E> SpscChannel.newConsumer(Object... args)
[INPUTS] branches=- | result=args
[COLLABORATORS] field mapper newFlyweight/4
[CALLS-EXTERNAL] mapper.newFlyweight/4, Template.fromFile/2
*/
| /* static context
[FOCAL] @SuppressWarnings("unchecked") private SpscChannelConsumer<E> SpscChannel.newConsumer(Object... args)
[INPUTS] branches=- | result=args
[COLLABORATORS] field mapper newFlyweight/4
[CALLS-EXTERNAL] mapper.newFlyweight/4, Template.fromFile/2
*/
class SpscChannel implements Channel<E> {
@Sup... | true | ok | {"focal": {"class": "SpscChannel", "name": "newConsumer", "signature": "SpscChannelConsumer<E> newConsumer(Object... args)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") private", "params": [{"name": "args", "type": "Object..."}], "return_type": "SpscChannelConsumer<E>"}, "class_info": {"name": "Spsc... |
14281911_49 | class FreeFlowAnalysis extends PeriodicAnalysis {
static Position centerOfVessel(Position aisPosition, float hdg, int dimStern, int dimBow, int dimPort, int dimStarboard) {
// Compute direction of half axis alpha
final double thetaDeg = compass2cartesian(hdg);
// Transform latitude/longitu... | Position p;
p = FreeFlowAnalysis.centerOfVessel(Position.create(56, 12), 0f, 0, 0, 0, 0);
assertEquals(56f, p.getLatitude(), 1e-16);
assertEquals(12f, p.getLongitude(), 1e-16);
p = FreeFlowAnalysis.centerOfVessel(Position.create(56, 12), 0f, 50, 50, 10, 10);
assertEqual... | [FOCAL] static Position FreeFlowAnalysis.centerOfVessel(Position aisPosition, float hdg, int dimStern, int dimBow, int dimPort, int dimStarboard)
[CLASS] class FreeFlowAnalysis extends PeriodicAnalysis
[METRICS] loc=24 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] compass2cartesian/1 (inherited)... | /* static context
[FOCAL] static Position FreeFlowAnalysis.centerOfVessel(Position aisPosition, float hdg, int dimStern, int dimBow, int dimPort, int dimStarboard)
[INPUTS] branches=- | result=aisPosition, dimBow, dimPort, dimStarboard, dimStern, hdg
[COLLABORATORS] param aisPosition:Position getLatitude/0,getLongitude... | /* static context
[FOCAL] static Position FreeFlowAnalysis.centerOfVessel(Position aisPosition, float hdg, int dimStern, int dimBow, int dimPort, int dimStarboard)
[INPUTS] branches=- | result=aisPosition, dimBow, dimPort, dimStarboard, dimStern, hdg
[COLLABORATORS] param aisPosition:Position getLatitude/0,getLongitude... | true | ok | {"focal": {"class": "FreeFlowAnalysis", "name": "centerOfVessel", "signature": "Position centerOfVessel(Position aisPosition, float hdg, int dimStern, int dimBow, int dimPort, int dimStarboard)", "start_line": 3, "modifiers": "static", "params": [{"name": "aisPosition", "type": "Position"}, {"name": "hdg", "type": "flo... |
14285346_4 | class ResultSetHelperService implements ResultSetHelper {
public String[] getColumnValues(ResultSet rs) throws SQLException, IOException {
return this.getColumnValues(rs, false, DEFAULT_DATE_FORMAT, DEFAULT_TIMESTAMP_FORMAT);
}
public String[] getColumnNames(ResultSet rs);
public String[] getColumnValues(... | String[] expectedNames = {"BigInt", "Null BigInt"};
String[] realValues = {"100", null};
String[] expectedValues = {"100", ""};
int[] expectedTypes = {Types.BIGINT, Types.BIGINT};
ResultSetMetaData metaData = MockResultSetMetaDataBuilder.buildMetaData(expectedNames, expectedTypes);
ResultSet re... | [FOCAL] public String[] ResultSetHelperService.getColumnValues(ResultSet rs)
[CLASS] class ResultSetHelperService implements ResultSetHelper
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String[] getColumnValues(ResultSet rs, boolean trim, String dateFormatString, String timeForm... | /* static context
[FOCAL] public String[] ResultSetHelperService.getColumnValues(ResultSet rs)
[INPUTS] branches=- | result=rs
[EXCEPTIONS] declares SQLException, IOException
[CALLS-INTERNAL] String[] getColumnValues(ResultSet rs, boolean trim, String dateFormatString, String timeFormatString)
*/
| /* static context
[FOCAL] public String[] ResultSetHelperService.getColumnValues(ResultSet rs)
[INPUTS] branches=- | result=rs
[EXCEPTIONS] declares SQLException, IOException
[CALLS-INTERNAL] String[] getColumnValues(ResultSet rs, boolean trim, String dateFormatString, String timeFormatString)
*/
class ResultSetHelperS... | true | ok | {"focal": {"class": "ResultSetHelperService", "name": "getColumnValues", "signature": "String[] getColumnValues(ResultSet rs) throws SQLException, IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "rs", "type": "ResultSet"}], "return_type": "String[]"}, "class_info": {"name": "ResultSetHelperSer... |
14290433_1 | class DumbPartitioner extends AbstractPartitioner {
@Override
public String getPartition() {
return "";
}
public DumbPartitioner();
@Override public Date getRefresh();
}
class DumbPartitionerTest {
@Test
public void testDumbPartitionerGetPartition(){
| DumbPartitioner d = new DumbPartitioner();
assertEquals("",d.getPartition());
}
} | [FOCAL] @Override public String DumbPartitioner.getPartition()
[CLASS] class DumbPartitioner extends AbstractPartitioner
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] DumbPartitioner(); Date getRefresh()
[TEST] DumbPartitionerTest: @Test public void testDumbPartitionerGetPartition... | /* static context
[FOCAL] @Override public String DumbPartitioner.getPartition()
*/
| /* static context
[FOCAL] @Override public String DumbPartitioner.getPartition()
*/
class DumbPartitioner extends AbstractPartitioner {
@Override
public String getPartition() {
return "";
}
public DumbPartitioner();
@Override public Date getRefresh();
}
class DumbPartitionerTest {
@Test
public ... | true | ok | {"focal": {"class": "DumbPartitioner", "name": "getPartition", "signature": "String getPartition()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "DumbPartitioner", "kind": "class", "modifiers": "", "superclass": "AbstractPartitioner", "interfaces": nu... |
14305692_432 | class ChargingStationEventListener {
@EventHandler
public void handle(ChargingStationCreatedEvent event) {
LOG.debug("ChargingStationCreatedEvent creates [{}] in operator api repo", event.getChargingStationId());
ChargingStation station = new ChargingStation(event.getChargingStationId().getId()... | ChargingStation cs = repository.findOne(CHARGING_STATION_ID.getId());
assertTrue(cs.getConfItems().isEmpty());
listener.handle(new ConfigurationItemsReceivedEvent(CHARGING_STATION_ID, CONFIGURATION_ITEMS, REQUESTED_CONFIGURATION_KEYS, IDENTITY_CONTEXT));
cs = repository.findOne(CHARGING... | [FOCAL] @EventHandler public void ChargingStationEventListener.handle(ChargingStationCreatedEvent event)
[CLASS] class ChargingStationEventListener
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] LOG.debug/2, ChargingStationCreatedEvent.getChargingStationId/0, event.getChargingStat... | /* static context
[FOCAL] @EventHandler public void ChargingStationEventListener.handle(ChargingStationCreatedEvent event)
[COLLABORATORS] param event:ChargingStationCreatedEvent getChargingStationId/0; field repository:ChargingStationRepository createOrUpdate/1
[FIELDS] read=repository:ChargingStationRepository
[NEW] ... | /* static context
[FOCAL] @EventHandler public void ChargingStationEventListener.handle(ChargingStationCreatedEvent event)
[COLLABORATORS] param event:ChargingStationCreatedEvent getChargingStationId/0; field repository:ChargingStationRepository createOrUpdate/1
[FIELDS] read=repository:ChargingStationRepository
[NEW] ... | true | ok | {"focal": {"class": "ChargingStationEventListener", "name": "handle", "signature": "void handle(ChargingStationCreatedEvent event)", "start_line": 3, "modifiers": "@EventHandler public", "params": [{"name": "event", "type": "ChargingStationCreatedEvent"}], "return_type": "void"}, "class_info": {"name": "ChargingStation... |
14333932_44 | class MatrixUtils {
public static RealMatrix transposeTimesSelf(LongObjectMap<float[]> M) {
if (M == null || M.isEmpty()) {
return null;
}
RealMatrix result = null;
for (LongObjectMap.MapEntry<float[]> entry : M.entrySet()) {
float[] vector = entry.getValue();
int dimension = vector... | LongObjectMap<float[]> M = new LongObjectMap<float[]>();
M.put(1L, new float[] {4.0f, -1.0f, -5.0f});
M.put(2L, new float[] {2.0f, 0.0f, 3.0f});
RealMatrix MTM = MatrixUtils.transposeTimesSelf(M);
assertArrayEquals(new double[]{20.0, -4.0, -14.0}, MTM.getRow(0));
assertArrayEquals(new double[]{-... | [FOCAL] public static RealMatrix MatrixUtils.transposeTimesSelf(LongObjectMap<float[]> M)
[CLASS] class MatrixUtils
[METRICS] loc=21 cc=6 branches=2 loops=3 returns=2 throws=0 nesting=3
[CALLS-EXTERNAL] LongObjectMap<float[]>.isEmpty/0, LongObjectMap<float[]>.entrySet/0, LongObjectMap.MapEntry<float[]>.getValue/0, Real... | /* static context
[FOCAL] public static RealMatrix MatrixUtils.transposeTimesSelf(LongObjectMap<float[]> M)
[PATH1] if(M == null || M.isEmpty())=F -> foreach(LongObjectMap.MapEntry<float[]> entry : M.entrySet())=T -> if(result == null)=T -> for(row < dimension)=T -> for(col < dimension)=F -> exit loop -> exit loop -> r... | /* static context
[FOCAL] public static RealMatrix MatrixUtils.transposeTimesSelf(LongObjectMap<float[]> M)
[PATH1] if(M == null || M.isEmpty())=F -> foreach(LongObjectMap.MapEntry<float[]> entry : M.entrySet())=T -> if(result == null)=T -> for(row < dimension)=T -> for(col < dimension)=F -> exit loop -> exit loop -> r... | true | ok | {"focal": {"class": "MatrixUtils", "name": "transposeTimesSelf", "signature": "RealMatrix transposeTimesSelf(LongObjectMap<float[]> M)", "start_line": 3, "modifiers": "public static", "params": [{"name": "M", "type": "LongObjectMap<float[]>"}], "return_type": "RealMatrix"}, "class_info": {"name": "MatrixUtils", "kind":... |
14339501_680 | class XmlFieldExtractor {
public Map<String, String> extract(InputStream xml, String[] fields) {
Map<String, String> parsedFields = Maps.newHashMap();
try {
DocumentBuilder documentBuilder = documentBuilderSupplier.get();
if (documentBuilder == null) {
logger.warn("Could not create Docume... | InputStream mockInputStream = mock(InputStream.class);
String message = "Intentionally throwing IOException";
IOException exception = new IOException(message);
when(mockInputStream.read()).thenThrow(exception);
Map<String, String> ret = xmlFieldExtractor.extract(mockInputStream, new String[] {"trigg... | [FOCAL] public Map<String, String> XmlFieldExtractor.extract(InputStream xml, String[] fields)
[CLASS] class XmlFieldExtractor
[METRICS] loc=27 cc=7 branches=2 loops=1 returns=2 throws=0 nesting=4
[CALLS-INTERNAL] String extract(Document doc, String field)
[CALLS-EXTERNAL] Maps.newHashMap/0, Supplier<DocumentBuilder>.g... | /* static context
[FOCAL] public Map<String, String> XmlFieldExtractor.extract(InputStream xml, String[] fields)
[PATH1] if(documentBuilder == null)=F -> foreach(String field : fields)=T -> try-body throws -> exit loop -> return parsedFields
[PATH2] if(documentBuilder == null)=T -> return parsedFields
[PATH3] if(docume... | /* static context
[FOCAL] public Map<String, String> XmlFieldExtractor.extract(InputStream xml, String[] fields)
[PATH1] if(documentBuilder == null)=F -> foreach(String field : fields)=T -> try-body throws -> exit loop -> return parsedFields
[PATH2] if(documentBuilder == null)=T -> return parsedFields
[PATH3] if(docume... | true | ok | {"focal": {"class": "XmlFieldExtractor", "name": "extract", "signature": "Map<String, String> extract(InputStream xml, String[] fields)", "start_line": 3, "modifiers": "public", "params": [{"name": "xml", "type": "InputStream"}, {"name": "fields", "type": "String[]"}], "return_type": "Map<String, String>"}, "class_info... |
14340523_7 | class AdministratorLoginBean implements Serializable {
public String login() {
return isSuccess ? INDEX_PAGE : LOGIN_PAGE;
}
public void login(final ActionEvent ae);
public void setAdminAuthManager(final AuthenticationManager adminAuthManager);
public String getUsername();
public void... |
Mockito.when(manager.authenticate(request)).thenReturn(request);
final SecurityContext securityContext = Mockito
.mock(SecurityContext.class);
SecurityContextHolder.setContext(securityContext);
setCredentials(username, password);
loginBean.login(null);
assertEquals(loginBean.login(), Administrat... | [FOCAL] public String AdministratorLoginBean.login()
[CLASS] class AdministratorLoginBean implements Serializable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] void login(ActionEvent ae); void setAdminAuthManager(AuthenticationManager adminAuthManager); String getUsername(); void ... | /* static context
[FOCAL] public String AdministratorLoginBean.login()
*/
| /* static context
[FOCAL] public String AdministratorLoginBean.login()
*/
class AdministratorLoginBean implements Serializable {
public String login() {
return isSuccess ? INDEX_PAGE : LOGIN_PAGE;
}
public void login(final ActionEvent ae);
public void setAdminAuthManager(final AuthenticationM... | true | ok | {"focal": {"class": "AdministratorLoginBean", "name": "login", "signature": "String login()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "AdministratorLoginBean", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serializable", "fields": [{"... |
14366444_0 | class LocationExtractor {
public static ILexLocation extractLocation(INode node)
{
try
{
Method method = node.getClass().getMethod("getLocation");
return (ILexLocation) method.invoke(node);
} catch (NoSuchMethodException | SecurityException
| IllegalAccessException | IllegalArgumentException
| In... |
@SuppressWarnings("deprecation")
AInterleavingReplicatedAction node = new AInterleavingReplicatedAction(new LexLocation("test", "Test", 0, 0, 1, 1, 0, 1), null, null, null);
ILexLocation loc = LocationExtractor.extractLocation(node);
Assert.assertNotNull(loc);
Assert.assertEquals("Test", loc.getModule());... | [FOCAL] public static ILexLocation LocationExtractor.extractLocation(INode node)
[CLASS] class LocationExtractor
[METRICS] loc=15 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] node.getClass().getMethod/1, INode.getClass/0, Method.invoke/1, NoSuchMethodException | SecurityException | IllegalAcces... | /* static context
[FOCAL] public static ILexLocation LocationExtractor.extractLocation(INode node)
[PATH1] try-body throws -> return null
[PATH2] return (ILexLocation) method.invoke(node)
[INPUTS] branches=- | result=node
[COLLABORATORS] param node:INode getClass/0
[EXCEPTIONS] catches NoSuchMethodException | SecurityE... | /* static context
[FOCAL] public static ILexLocation LocationExtractor.extractLocation(INode node)
[PATH1] try-body throws -> return null
[PATH2] return (ILexLocation) method.invoke(node)
[INPUTS] branches=- | result=node
[COLLABORATORS] param node:INode getClass/0
[EXCEPTIONS] catches NoSuchMethodException | SecurityE... | true | ok | {"focal": {"class": "LocationExtractor", "name": "extractLocation", "signature": "ILexLocation extractLocation(INode node)", "start_line": 3, "modifiers": "public static", "params": [{"name": "node", "type": "INode"}], "return_type": "ILexLocation"}, "class_info": {"name": "LocationExtractor", "kind": "class", "modifie... |
14372507_0 | class Annotator {
public boolean addAnnotations(InputStream inputClass, File outputClassFile, Collection<String> annotations)
throws Exception {
boolean classIsModified = false;
FileOutputStream outputClass = null;
ClassWriter cw = new ClassWriter(false);
try {
... | Collection<String> annotations = Collections.singletonList(ANNOTATIONS[0]);
inputStreamClass = getInputStream(ClassToAnnotateWithNoise.class);
annotator.addAnnotations(inputStreamClass, outputClassFile, annotations);
assertClassHasAnnotations(outputClassFile, annotations);
}
} | [FOCAL] public boolean Annotator.addAnnotations(InputStream inputClass, File outputClassFile, Collection<String> annotations)
[CLASS] class Annotator
[METRICS] loc=43 cc=7 branches=4 loops=0 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] Collection<String>.contains/1, List<String>.add/1, ClassReader.accept/3, Attributes... | /* static context
[FOCAL] public boolean Annotator.addAnnotations(InputStream inputClass, File outputClassFile, Collection<String> annotations)
[PATH1] if(annotations.contains("SharedStatics"))=T -> if(annotations.contains("MagicPermission"))=T -> if(mcv.classIsModified())=T -> if(outputClass != null)=T -> try-body thr... | /* static context
[FOCAL] public boolean Annotator.addAnnotations(InputStream inputClass, File outputClassFile, Collection<String> annotations)
[PATH1] if(annotations.contains("SharedStatics"))=T -> if(annotations.contains("MagicPermission"))=T -> if(mcv.classIsModified())=T -> if(outputClass != null)=T -> try-body thr... | true | ok | {"focal": {"class": "Annotator", "name": "addAnnotations", "signature": "boolean addAnnotations(InputStream inputClass, File outputClassFile, Collection<String> annotations) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "inputClass", "type": "InputStream"}, {"name": "outputClassFile", "... |
14377751_5 | class AmzaBotUtil {
public static String truncVal(String s) {
if (s == null) {
return "";
}
int len = Math.min(s.length(), 10);
String postfix = "";
if (s.length() > len) {
postfix = "...";
}
return s.substring(0, len) + postfix;
... | Assert.assertEquals(AmzaBotUtil.truncVal(null), "");
Assert.assertEquals(AmzaBotUtil.truncVal(""), "");
String nine = "123456789";
Assert.assertEquals(AmzaBotUtil.truncVal(nine), nine);
String ten = "1234567890";
Assert.assertEquals(AmzaBotUtil.truncVal(ten), ten);
... | [FOCAL] public static String AmzaBotUtil.truncVal(String s)
[CLASS] class AmzaBotUtil
[METRICS] loc=13 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Math.min/2, String.length/0, String.substring/2
[PATH1] if(s == null)=F -> if(s.length() > len)=T -> return s.substring(0, len) + postfix
[PATH2] i... | /* static context
[FOCAL] public static String AmzaBotUtil.truncVal(String s)
[PATH1] if(s == null)=F -> if(s.length() > len)=T -> return s.substring(0, len) + postfix
[PATH2] if(s == null)=T -> return ""
[PATH3] if(s == null)=F -> if(s.length() > len)=F -> return s.substring(0, len) + postfix
[INPUTS] branches=s | res... | /* static context
[FOCAL] public static String AmzaBotUtil.truncVal(String s)
[PATH1] if(s == null)=F -> if(s.length() > len)=T -> return s.substring(0, len) + postfix
[PATH2] if(s == null)=T -> return ""
[PATH3] if(s == null)=F -> if(s.length() > len)=F -> return s.substring(0, len) + postfix
[INPUTS] branches=s | res... | true | ok | {"focal": {"class": "AmzaBotUtil", "name": "truncVal", "signature": "String truncVal(String s)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "String"}], "return_type": "String"}, "class_info": {"name": "AmzaBotUtil", "kind": "class", "modifiers": "", "superclass": null, "interfaces":... |
14393731_0 | class InstantAdapter {
@ToJson public String toJson(Instant instant) {
return instant.toString();
}
@FromJson public Instant fromJson(String value);
private static final Instant EPOCH;
private static final Instant RECENT;
private final Moshi moshi;
private final JsonAdapter<Instant> adapter;
}
cl... | assertThat(adapter.toJson(EPOCH)).isEqualTo("\"1970-01-01T00:00:00Z\"");
assertThat(adapter.toJson(RECENT)).isEqualTo("\"2015-07-31T10:16:59Z\"");
}
} | [FOCAL] @ToJson public String InstantAdapter.toJson(Instant instant)
[CLASS] class InstantAdapter
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Instant.toString/0
[INPUTS] branches=- | result=instant
[COLLABORATORS] param instant:Instant toString/0
[DATAFLOW] instant@param->L2
[C... | /* static context
[FOCAL] @ToJson public String InstantAdapter.toJson(Instant instant)
[INPUTS] branches=- | result=instant
[COLLABORATORS] param instant:Instant toString/0
[CALLS-EXTERNAL] Instant.toString/0
*/
| /* static context
[FOCAL] @ToJson public String InstantAdapter.toJson(Instant instant)
[INPUTS] branches=- | result=instant
[COLLABORATORS] param instant:Instant toString/0
[CALLS-EXTERNAL] Instant.toString/0
*/
class InstantAdapter {
@ToJson public String toJson(Instant instant) {
return instant.toString();
}... | true | ok | {"focal": {"class": "InstantAdapter", "name": "toJson", "signature": "String toJson(Instant instant)", "start_line": 3, "modifiers": "@ToJson public", "params": [{"name": "instant", "type": "Instant"}], "return_type": "String"}, "class_info": {"name": "InstantAdapter", "kind": "class", "modifiers": "", "superclass": nu... |
14398404_63 | class Consistency {
public List<NotConsistentRelation> checkConsitency(String rootPid, boolean repair) throws IOException, ProcessSubtreeException, LexerException, RepositoryException {
TreeProcess deep = new TreeProcess(this.fedoraAccess);
this.fedoraAccess.processSubtree(rootPid, deep);
L... | StatisticsAccessLog acLog = EasyMock.createMock(StatisticsAccessLog.class);
ProcessingIndexFeeder feeder = createMock(ProcessingIndexFeeder.class);
CacheManager cacheManager = CacheManagerBuilder.newCacheManagerBuilder().build();
cacheManager.init();
HazelcastServerNode.ensureHa... | [FOCAL] public List<NotConsistentRelation> Consistency.checkConsitency(String rootPid, boolean repair)
[CLASS] class Consistency
[METRICS] loc=23 cc=6 branches=3 loops=2 returns=1 throws=1 nesting=5
[CALLS-EXTERNAL] this.fedoraAccess.processSubtree/2, TreeProcess.getRelations/0, LOGGER.fine/1, NotConsistentRelation.get... | /* static context
[FOCAL] public List<NotConsistentRelation> Consistency.checkConsitency(String rootPid, boolean repair)
[THROWS-WHEN] RuntimeException when repair && foreach(NotConsistentRelation nRelation : relations)=T && foreach(Triple<String, String, String> t : objectRelations)=T && children.contains(t.getRight()... | /* static context
[FOCAL] public List<NotConsistentRelation> Consistency.checkConsitency(String rootPid, boolean repair)
[THROWS-WHEN] RuntimeException when repair && foreach(NotConsistentRelation nRelation : relations)=T && foreach(Triple<String, String, String> t : objectRelations)=T && children.contains(t.getRight()... | true | ok | {"focal": {"class": "Consistency", "name": "checkConsitency", "signature": "List<NotConsistentRelation> checkConsitency(String rootPid, boolean repair) throws IOException, ProcessSubtreeException, LexerException, RepositoryException", "start_line": 3, "modifiers": "public", "params": [{"name": "rootPid", "type": "Strin... |
14401179_53 | class DetachedChannelPipeline {
public DetachedChannelPipeline addLast(String name, Func0<ChannelHandler> handlerFactory) {
return _guardedAddLast(new HandlerHolder(name, handlerFactory));
}
public DetachedChannelPipeline();
public DetachedChannelPipeline(final Action1<ChannelPipeline> nulla... | pipelineRule.pipeline.addLast(HANDLER_1.getNameIfConfigured(), HANDLER_1.getHandlerFactoryIfConfigured());
pipelineRule.pipeline.addLast(HANDLER_2.getNameIfConfigured(), HANDLER_2.getHandlerFactoryIfConfigured());
assertThat("Unexpected handlers count.", pipelineRule.pipeline.getHoldersInOrder(... | [FOCAL] public DetachedChannelPipeline DetachedChannelPipeline.addLast(String name, Func0<ChannelHandler> handlerFactory)
[CLASS] class DetachedChannelPipeline
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] DetachedChannelPipeline _guardedAddLast(HandlerHolder toAdd)
[NEW] Handler... | /* static context
[FOCAL] public DetachedChannelPipeline DetachedChannelPipeline.addLast(String name, Func0<ChannelHandler> handlerFactory)
[INPUTS] branches=- | result=handlerFactory, name
[CALLS-INTERNAL] DetachedChannelPipeline _guardedAddLast(HandlerHolder toAdd)
[NEW] HandlerHolder
*/
| /* static context
[FOCAL] public DetachedChannelPipeline DetachedChannelPipeline.addLast(String name, Func0<ChannelHandler> handlerFactory)
[INPUTS] branches=- | result=handlerFactory, name
[CALLS-INTERNAL] DetachedChannelPipeline _guardedAddLast(HandlerHolder toAdd)
[NEW] HandlerHolder
*/
class DetachedChannelPipeline... | true | ok | {"focal": {"class": "DetachedChannelPipeline", "name": "addLast", "signature": "DetachedChannelPipeline addLast(String name, Func0<ChannelHandler> handlerFactory)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}, {"name": "handlerFactory", "type": "Func0<ChannelHandler>"}], "retur... |
14426728_4 | class Utils {
static String pluralize(String string) {
string = string.toLowerCase(Locale.US);
if (string.endsWith("s")) {
return string;
} else if (string.endsWith("ay")) {
return string.replaceAll("ay$", "ays");
} else if (string.endsWith("ey")) {
... | String expected = "whiskies";
String actual = Utils.pluralize("Whisky");
assertEquals(expected, actual);
expected = "ytitties";
actual = Utils.pluralize("YTitty");
assertEquals(expected, actual);
expected = "ways";
actual = Utils.pluralize("Way");
... | [FOCAL] static String Utils.pluralize(String string)
[CLASS] class Utils
[METRICS] loc=19 cc=7 branches=6 loops=0 returns=7 throws=0 nesting=6
[CALLS-EXTERNAL] String.toLowerCase/1, String.endsWith/1, String.replaceAll/2
[PATH1] if(string.endsWith("s"))=F -> if(string.endsWith("ay"))=F -> if(string.endsWith("ey"))=F ->... | /* static context
[FOCAL] static String Utils.pluralize(String string)
[PATH1] if(string.endsWith("s"))=F -> if(string.endsWith("ay"))=F -> if(string.endsWith("ey"))=F -> if(string.endsWith("oy"))=F -> if(string.endsWith("uy"))=F -> if(string.endsWith("y"))=T -> return string.replaceAll("y$", "ies")
[PATH2] if(string.e... | /* static context
[FOCAL] static String Utils.pluralize(String string)
[PATH1] if(string.endsWith("s"))=F -> if(string.endsWith("ay"))=F -> if(string.endsWith("ey"))=F -> if(string.endsWith("oy"))=F -> if(string.endsWith("uy"))=F -> if(string.endsWith("y"))=T -> return string.replaceAll("y$", "ies")
[PATH2] if(string.e... | true | ok | {"focal": {"class": "Utils", "name": "pluralize", "signature": "String pluralize(String string)", "start_line": 3, "modifiers": "static", "params": [{"name": "string", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Utils", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ... |
14444698_1 | class InterceptingMessageReceiver implements WebServiceMessageReceiver {
public void receive(MessageContext messageContext) throws Exception {
interceptingTemplate.interceptRequest(messageContext, wrappedMessageReceiver);
}
public InterceptingMessageReceiver(WebServiceMessageReceiver wrappedMessag... | MessageContext messageContext = new DefaultMessageContext(getMessageFactory());
IMocksControl control = createControl();
WebServiceMessageReceiver wrappedMessageReceiver = new WebServiceMessageReceiver(){
public void receive(MessageContext messageContext) throws Exception {
SaajSoapMessage message = ... | [FOCAL] public void InterceptingMessageReceiver.receive(MessageContext messageContext)
[CLASS] class InterceptingMessageReceiver implements WebServiceMessageReceiver
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] interceptingTemplate.interceptRequest/2
[EXCEPTIONS] declares Except... | /* static context
[FOCAL] public void InterceptingMessageReceiver.receive(MessageContext messageContext)
[COLLABORATORS] field interceptingTemplate interceptRequest/2
[EXCEPTIONS] declares Exception
[CALLS-EXTERNAL] interceptingTemplate.interceptRequest/2
*/
| /* static context
[FOCAL] public void InterceptingMessageReceiver.receive(MessageContext messageContext)
[COLLABORATORS] field interceptingTemplate interceptRequest/2
[EXCEPTIONS] declares Exception
[CALLS-EXTERNAL] interceptingTemplate.interceptRequest/2
*/
class InterceptingMessageReceiver implements WebServiceMessag... | true | ok | {"focal": {"class": "InterceptingMessageReceiver", "name": "receive", "signature": "void receive(MessageContext messageContext) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "messageContext", "type": "MessageContext"}], "return_type": "void"}, "class_info": {"name": "InterceptingMessage... |
14469879_4 | class BoolVar extends AbstractVarType<Boolean> {
public static BoolVar boolVar(String id) {
return new BoolVar(id);
}
private BoolVar(String id);
private BoolVar(String id, String regex);
public static BoolVar boolVar(String id, String regex);
@Override public Boolean convert(String... | RestParser parser = parser("/users?active={}", boolVar("isActive"));
RestUrl url = parser.parse("http://www.mail.com/users?active=FaLsE");
assertThat(url, isValid());
assertThat((Boolean) url.variable("isActive"), is(false));
}
} | [FOCAL] public static BoolVar BoolVar.boolVar(String id)
[CLASS] class BoolVar extends AbstractVarType<Boolean>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] BoolVar
[INPUTS] branches=- | result=id
[DATAFLOW] id@param->L2
[CLASS-MEMBERS] BoolVar(String id); BoolVar(String id, String regex);... | /* static context
[FOCAL] public static BoolVar BoolVar.boolVar(String id)
[INPUTS] branches=- | result=id
[NEW] BoolVar
*/
| /* static context
[FOCAL] public static BoolVar BoolVar.boolVar(String id)
[INPUTS] branches=- | result=id
[NEW] BoolVar
*/
class BoolVar extends AbstractVarType<Boolean> {
public static BoolVar boolVar(String id) {
return new BoolVar(id);
}
private BoolVar(String id);
private BoolVar(String... | true | ok | {"focal": {"class": "BoolVar", "name": "boolVar", "signature": "BoolVar boolVar(String id)", "start_line": 3, "modifiers": "public static", "params": [{"name": "id", "type": "String"}], "return_type": "BoolVar"}, "class_info": {"name": "BoolVar", "kind": "class", "modifiers": "", "superclass": "AbstractVarType<Boolean>... |
14490363_74 | class DocumentResourceFacadeImp extends CoreDBServiceFacadeImp<Document, Long> implements DocumentResourceFacade {
@Override
public boolean isDocumentExists(Long id) throws PropertyNotSetException {
DocumentDTO dto = findDocumentByID(id);
return dto != null ? true : false;
}
public DocumentResourceFacadeImp... | try {
entityManager.getTransaction().begin();
documentDTO = documentResourceFacadeImp.addDocument(documentDTO);
entityManager.getTransaction().commit();
Long id = documentDTO.getDocumentID();
boolean result = documentResourceFacadeImp.isDocumentExists(id);
assertEquals(true, result);
entityManag... | [FOCAL] @Override public boolean DocumentResourceFacadeImp.isDocumentExists(Long id)
[CLASS] class DocumentResourceFacadeImp extends CoreDBServiceFacadeImp<Document, Long> implements DocumentResourceFacade
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] DocumentDTO findDocumentByID... | /* static context
[FOCAL] @Override public boolean DocumentResourceFacadeImp.isDocumentExists(Long id)
[INPUTS] branches=- | result=id
[EXCEPTIONS] declares PropertyNotSetException
[CALLS-INTERNAL] DocumentDTO findDocumentByID(Long id)
*/
| /* static context
[FOCAL] @Override public boolean DocumentResourceFacadeImp.isDocumentExists(Long id)
[INPUTS] branches=- | result=id
[EXCEPTIONS] declares PropertyNotSetException
[CALLS-INTERNAL] DocumentDTO findDocumentByID(Long id)
*/
class DocumentResourceFacadeImp extends CoreDBServiceFacadeImp<Document, Long> im... | true | ok | {"focal": {"class": "DocumentResourceFacadeImp", "name": "isDocumentExists", "signature": "boolean isDocumentExists(Long id) throws PropertyNotSetException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "id", "type": "Long"}], "return_type": "boolean"}, "class_info": {"name": "DocumentResourceF... |
14496551_2 | class StringUtils {
public static String collapseLineBreaks(String string) {
return replaceLineBreaks(string, EMPTY);
}
private StringUtils();
public static String byteToHex(byte[] data);
public static String replaceLineBreaksWithSpace(String string);
public static String replaceLine... | Assert.assertNull(StringUtils.collapseLineBreaks(null));
Assert.assertEquals("", StringUtils.collapseLineBreaks(""));
Assert.assertEquals("foobar", StringUtils.collapseLineBreaks("foobar"));
Assert.assertEquals("foo bar", StringUtils.collapseLineBreaks("foo bar"));
Assert.assertE... | [FOCAL] public static String StringUtils.collapseLineBreaks(String string)
[CLASS] class StringUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String replaceLineBreaks(String string, String replace)
[INPUTS] branches=- | result=string
[DATAFLOW] string@param->L2
[CLASS-MEMBER... | /* static context
[FOCAL] public static String StringUtils.collapseLineBreaks(String string)
[INPUTS] branches=- | result=string
[CALLS-INTERNAL] String replaceLineBreaks(String string, String replace)
*/
| /* static context
[FOCAL] public static String StringUtils.collapseLineBreaks(String string)
[INPUTS] branches=- | result=string
[CALLS-INTERNAL] String replaceLineBreaks(String string, String replace)
*/
class StringUtils {
public static String collapseLineBreaks(String string) {
return replaceLineBreaks(... | true | ok | {"focal": {"class": "StringUtils", "name": "collapseLineBreaks", "signature": "String collapseLineBreaks(String string)", "start_line": 3, "modifiers": "public static", "params": [{"name": "string", "type": "String"}], "return_type": "String"}, "class_info": {"name": "StringUtils", "kind": "class", "modifiers": "", "su... |
14505236_4 | class WfsGetFeatureCommand implements CommandHasRequest<WfsGetFeatureRequest, WfsGetFeatureResponse> {
@Override
public void execute(WfsGetFeatureRequest request, WfsGetFeatureResponse response) throws Exception {
FeatureCollection<SimpleFeatureType, SimpleFeature> features = performWfsQuery(request);
int maxCoo... | WfsGetFeatureRequest request = new WfsGetFeatureRequest();
request.setBaseUrl("http://127.0.0.1:"+port+"/wfs");
request.setTypeName("dov-pub-bodem:Bodemassociatiekaart");
request.setCriterion(new FidCriterionDto(new String[] { "Bodemassociatiekaart.1", "Bodemassociatiekaart.2" }));
request.setCrs("EPSG:31370"... | [FOCAL] @Override public void WfsGetFeatureCommand.execute(WfsGetFeatureRequest request, WfsGetFeatureResponse response)
[CLASS] class WfsGetFeatureCommand implements CommandHasRequest<WfsGetFeatureRequest, WfsGetFeatureResponse>
[METRICS] loc=19 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] Bbo... | /* static context
[FOCAL] @Override public void WfsGetFeatureCommand.execute(WfsGetFeatureRequest request, WfsGetFeatureResponse response)
[PATH1] if(null != features.getSchema() && features.getSchema().getCoordinateReferenceSystem() instanceof GeographicCRS)=T
[PATH2] if(null != features.getSchema() && features.getSch... | /* static context
[FOCAL] @Override public void WfsGetFeatureCommand.execute(WfsGetFeatureRequest request, WfsGetFeatureResponse response)
[PATH1] if(null != features.getSchema() && features.getSchema().getCoordinateReferenceSystem() instanceof GeographicCRS)=T
[PATH2] if(null != features.getSchema() && features.getSch... | true | ok | {"focal": {"class": "WfsGetFeatureCommand", "name": "execute", "signature": "void execute(WfsGetFeatureRequest request, WfsGetFeatureResponse response) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "WfsGetFeatureRequest"}, {"name": "response", "type": "WfsGe... |
14514251_160 | class BlockChain extends AbstractBlockChain {
@Override
public boolean add(FilteredBlock block) throws VerificationException, PrunedException {
boolean success = super.add(block);
if (success) {
trackFilteredTransactions(block.getTransactionCount());
}
return success... | assertTrue(testNetChain.add(getBlock1()));
Block b2 = getBlock2();
assertTrue(testNetChain.add(b2));
Block bad = new Block(TESTNET, Block.BLOCK_VERSION_GENESIS);
// Merkle root can be anything here, doesn't matter.
bad.setMerkleRoot(Sha256Hash.wrap("aaaaaaaaaaaaaaaaaaaaaa... | [FOCAL] @Override public boolean BlockChain.add(FilteredBlock block)
[CLASS] class BlockChain extends AbstractBlockChain
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] AbstractBlockChain.add/1, trackFilteredTransactions/1 (inherited), FilteredBlock.getTransactionCount/0
[EXCEPTION... | /* static context
[FOCAL] @Override public boolean BlockChain.add(FilteredBlock block)
[PATH1] if(success)=T -> return success
[PATH2] if(success)=F -> return success
[INPUTS] branches=block | result=block
[COLLABORATORS] param block:FilteredBlock getTransactionCount/0
[EXCEPTIONS] declares VerificationException, Prune... | /* static context
[FOCAL] @Override public boolean BlockChain.add(FilteredBlock block)
[PATH1] if(success)=T -> return success
[PATH2] if(success)=F -> return success
[INPUTS] branches=block | result=block
[COLLABORATORS] param block:FilteredBlock getTransactionCount/0
[EXCEPTIONS] declares VerificationException, Prune... | true | ok | {"focal": {"class": "BlockChain", "name": "add", "signature": "boolean add(FilteredBlock block) throws VerificationException, PrunedException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "block", "type": "FilteredBlock"}], "return_type": "boolean"}, "class_info": {"name": "BlockChain", "kind"... |
14518795_0 | class FirstApplicableAlg implements CombiningAlgorithm {
@Override
public DecisionType combine(DecisionType op1, DecisionType op2) {
if (op1 != DecisionType.NotApplicable) {
return op1;
}
if (op2 != DecisionType.NotApplicable) {
return op2;
}
re... | FirstApplicableAlg alg = new FirstApplicableAlg();
assertTrue(alg.combine(DecisionType.Indeterminate, DecisionType.Permit) == DecisionType.Indeterminate);
assertTrue(alg.combine(DecisionType.NotApplicable, DecisionType.Permit) == DecisionType.Permit);
assertTrue(alg.combine(DecisionType... | [FOCAL] @Override public DecisionType FirstApplicableAlg.combine(DecisionType op1, DecisionType op2)
[CLASS] class FirstApplicableAlg implements CombiningAlgorithm
[METRICS] loc=12 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[PATH1] if(op1 != DecisionType.NotApplicable)=F -> if(op2 != DecisionType.NotApplicabl... | /* static context
[FOCAL] @Override public DecisionType FirstApplicableAlg.combine(DecisionType op1, DecisionType op2)
[PATH1] if(op1 != DecisionType.NotApplicable)=F -> if(op2 != DecisionType.NotApplicable)=T -> return op2
[PATH2] if(op1 != DecisionType.NotApplicable)=T -> return op1
[PATH3] if(op1 != DecisionType.Not... | /* static context
[FOCAL] @Override public DecisionType FirstApplicableAlg.combine(DecisionType op1, DecisionType op2)
[PATH1] if(op1 != DecisionType.NotApplicable)=F -> if(op2 != DecisionType.NotApplicable)=T -> return op2
[PATH2] if(op1 != DecisionType.NotApplicable)=T -> return op1
[PATH3] if(op1 != DecisionType.Not... | true | ok | {"focal": {"class": "FirstApplicableAlg", "name": "combine", "signature": "DecisionType combine(DecisionType op1, DecisionType op2)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "op1", "type": "DecisionType"}, {"name": "op2", "type": "DecisionType"}], "return_type": "DecisionType"}, "class_inf... |
14538599_0 | class FindByKeyQuery extends AbstractPojoQuery<P> {
@Override
protected Object[] convertParameters(Object[] params) {
List<Object> converted = getBinding().getKeyBinding().getKeyParameters(Arrays.asList(params));
return converted.toArray(new Object[converted.size()]);
}
public FindByK... | PojoDao<LogEntry> dao = createPojoDao(LogEntry.class);
Date now = new Date();
LogEntry expected = new LogEntry();
expected.setCategory("cat");
expected.setTimestamp(now);
expected.setMessage("Now is the time for all good men...");
dao.save(expected);
LogE... | [FOCAL] @Override protected Object[] FindByKeyQuery.convertParameters(Object[] params)
[CLASS] class FindByKeyQuery extends AbstractPojoQuery<P>
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] getBinding().getKeyBinding().getKeyParameters/1, getBinding().getKeyBinding/0, getBinding... | /* static context
[FOCAL] @Override protected Object[] FindByKeyQuery.convertParameters(Object[] params)
[INPUTS] branches=- | result=params
[CALLS-EXTERNAL] getBinding().getKeyBinding().getKeyParameters/1, getBinding().getKeyBinding/0, getBinding/0 (inherited), Arrays.asList/1, List<Object>.toArray/1, List<Object>.siz... | /* static context
[FOCAL] @Override protected Object[] FindByKeyQuery.convertParameters(Object[] params)
[INPUTS] branches=- | result=params
[CALLS-EXTERNAL] getBinding().getKeyBinding().getKeyParameters/1, getBinding().getKeyBinding/0, getBinding/0 (inherited), Arrays.asList/1, List<Object>.toArray/1, List<Object>.siz... | true | ok | {"focal": {"class": "FindByKeyQuery", "name": "convertParameters", "signature": "Object[] convertParameters(Object[] params)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "params", "type": "Object[]"}], "return_type": "Object[]"}, "class_info": {"name": "FindByKeyQuery", "kind": "class", "m... |
14561598_13 | class ManifestMatcher implements VersionMatcher {
public VersionMatchResult matches(DeploymentInfo info) {
// Skip if no manifest configuration
if(info.getManifest() == null || info.getManifest().size() == 0) {
return VersionMatchResult.SKIPPED;
}
for (Manifest... | Set<MavenInfo> maven = new HashSet<MavenInfo>();
ManifestInfo manifest = new ManifestInfo(new java.util.jar.Manifest(this.getClass().getResourceAsStream("/org/hotswap/agent/versions/matcher/TEST.MF")));
DeploymentInfo info = new DeploymentInfo(maven, Collections.singleton(manifest));
S... | [FOCAL] public VersionMatchResult ManifestMatcher.matches(DeploymentInfo info)
[CLASS] class ManifestMatcher implements VersionMatcher
[METRICS] loc=22 cc=5 branches=3 loops=1 returns=4 throws=0 nesting=2
[CALLS-INTERNAL] VersionMatchResult match(ManifestInfo manifest)
[CALLS-EXTERNAL] DeploymentInfo.getManifest/0, inf... | /* static context
[FOCAL] public VersionMatchResult ManifestMatcher.matches(DeploymentInfo info)
[PATH1] if(info.getManifest() == null || info.getManifest().size() == 0)=F -> foreach(ManifestInfo manifest : info.getManifest())=T -> if(VersionMatchResult.MATCHED.equals(result))=F -> if(VersionMatchResult.REJECTED.equals... | /* static context
[FOCAL] public VersionMatchResult ManifestMatcher.matches(DeploymentInfo info)
[PATH1] if(info.getManifest() == null || info.getManifest().size() == 0)=F -> foreach(ManifestInfo manifest : info.getManifest())=T -> if(VersionMatchResult.MATCHED.equals(result))=F -> if(VersionMatchResult.REJECTED.equals... | true | ok | {"focal": {"class": "ManifestMatcher", "name": "matches", "signature": "VersionMatchResult matches(DeploymentInfo info)", "start_line": 3, "modifiers": "public", "params": [{"name": "info", "type": "DeploymentInfo"}], "return_type": "VersionMatchResult"}, "class_info": {"name": "ManifestMatcher", "kind": "class", "modi... |
14573998_10 | class Index {
public <R> Stream<T2<Optional<L>, R>> rightOuterJoin(Index<K, R> other) {
return matchAndMerge(other, rightOuterJoinMerger());
}
private Index(Comparator<? super K> comparator, SortedMap<K, Set<L>> indexed);
public static Index<K, L> on(Stream<? extends L> stream, Function<? su... | Index<Character, String> left = Index.on(Stream.of("carrot", "banana", "apple"), indexOnFirstChar);
Index<Character, String> right = Index.on(Stream.of("catamorphism", "banausic", "ballistic", "dirigible"), indexOnFirstChar);
assertThat(left.rightOuterJoin(right).collect(Collectors.toList()), h... | [FOCAL] public Stream<T2<Optional<L>, R>> Index.rightOuterJoin(Index<K, R> other)
[CLASS] class Index
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] BiFunction<Set<L>, Set<R>, Stream<T2<Optional<L>, R>>> rightOuterJoinMerger(); Stream<T> matchAndMerge(Index<K, R> other, BiFunction... | /* static context
[FOCAL] public Stream<T2<Optional<L>, R>> Index.rightOuterJoin(Index<K, R> other)
[INPUTS] branches=- | result=other
[CALLS-INTERNAL] BiFunction<Set<L>, Set<R>, Stream<T2<Optional<L>, R>>> rightOuterJoinMerger(); Stream<T> matchAndMerge(Index<K, R> other, BiFunction<Set<L>, Set<R>, Stream<T>> merger)
... | /* static context
[FOCAL] public Stream<T2<Optional<L>, R>> Index.rightOuterJoin(Index<K, R> other)
[INPUTS] branches=- | result=other
[CALLS-INTERNAL] BiFunction<Set<L>, Set<R>, Stream<T2<Optional<L>, R>>> rightOuterJoinMerger(); Stream<T> matchAndMerge(Index<K, R> other, BiFunction<Set<L>, Set<R>, Stream<T>> merger)
... | true | ok | {"focal": {"class": "Index", "name": "rightOuterJoin", "signature": "Stream<T2<Optional<L>, R>> rightOuterJoin(Index<K, R> other)", "start_line": 3, "modifiers": "public", "params": [{"name": "other", "type": "Index<K, R>"}], "return_type": "Stream<T2<Optional<L>, R>>"}, "class_info": {"name": "Index", "kind": "class",... |
14581444_89 | class Results {
public static Result internalServerError() {
return status(Result.INTERNAL_SERVER_ERROR).noContentIfNone();
}
public static Result status(int statusCode);
public static Result ok();
public static Result ok(Document document);
public static Result ok(JsonNode node);
... | Result result = Results.internalServerError("nope");
assertThat(result.getStatusCode()).isEqualTo(Status.INTERNAL_SERVER_ERROR);
assertThat(result.getRenderable().content()).isEqualTo("nope");
assertThat(result.getContentType()).isEqualTo(MimeTypes.TEXT);
}
} | [FOCAL] public static Result Results.internalServerError()
[CLASS] class Results
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Result status(int statusCode)
[CALLS-EXTERNAL] status(Result.INTERNAL_SERVER_ERROR).noContentIfNone/0
[CLASS-MEMBERS] Result status(int statusCode); Resu... | /* static context
[FOCAL] public static Result Results.internalServerError()
[CALLS-INTERNAL] Result status(int statusCode)
[CALLS-EXTERNAL] status(Result.INTERNAL_SERVER_ERROR).noContentIfNone/0
*/
| /* static context
[FOCAL] public static Result Results.internalServerError()
[CALLS-INTERNAL] Result status(int statusCode)
[CALLS-EXTERNAL] status(Result.INTERNAL_SERVER_ERROR).noContentIfNone/0
*/
class Results {
public static Result internalServerError() {
return status(Result.INTERNAL_SERVER_ERROR).noC... | true | ok | {"focal": {"class": "Results", "name": "internalServerError", "signature": "Result internalServerError()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Result"}, "class_info": {"name": "Results", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "mem... |
14587858_44 | class OSGiELResolver extends BeanELResolver {
@Override
public boolean isReadOnly(ELContext context, Object base, Object property) {
return true;
}
@Override public Object getValue(ELContext context, Object base, Object property);
private Object checkRegisteredServicesByLdapFilter(String filter);
priv... | assertThat(resolver.isReadOnly(null, null, null), is(true));
}
} | [FOCAL] @Override public boolean OSGiELResolver.isReadOnly(ELContext context, Object base, Object property)
[CLASS] class OSGiELResolver extends BeanELResolver
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=- | unused=context, base, property
[CLASS-MEMBERS] Object getV... | /* static context
[FOCAL] @Override public boolean OSGiELResolver.isReadOnly(ELContext context, Object base, Object property)
[INPUTS] branches=- | result=- | unused=context, base, property
*/
| /* static context
[FOCAL] @Override public boolean OSGiELResolver.isReadOnly(ELContext context, Object base, Object property)
[INPUTS] branches=- | result=- | unused=context, base, property
*/
class OSGiELResolver extends BeanELResolver {
@Override
public boolean isReadOnly(ELContext context, Object base, Object p... | true | ok | {"focal": {"class": "OSGiELResolver", "name": "isReadOnly", "signature": "boolean isReadOnly(ELContext context, Object base, Object property)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "ELContext"}, {"name": "base", "type": "Object"}, {"name": "property", "type": "Object"... |
14591946_17 | class ProcessorpathResolver {
public List<File> resolve(RepositorySystemSession session, MavenProject project, List<Dependency> dependencies) throws MojoExecutionException {
// copy&paste from org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DependencyResolutionRequest)
// aether is sad, r... | File basedir = resources.getBasedir();
MavenProject project = maven.readMavenProject(basedir);
maven.newDependency(temp.newFile()).setGroupId("g").setArtifactId("a").setVersion("1").addTo(project);
MavenSession mavenSession = maven.newMavenSession(project);
RepositorySystemSession repoSession = mav... | [FOCAL] public List<File> ProcessorpathResolver.resolve(RepositorySystemSession session, MavenProject project, List<Dependency> dependencies)
[CLASS] class ProcessorpathResolver
[METRICS] loc=60 cc=10 branches=5 loops=3 returns=1 throws=2 nesting=3
[CALLS-EXTERNAL] RepositorySystemSession.getArtifactTypeRegistry/0, Col... | /* static context
[FOCAL] public List<File> ProcessorpathResolver.resolve(RepositorySystemSession session, MavenProject project, List<Dependency> dependencies)
[THROWS-WHEN] MojoExecutionException when foreach(Dependency dependency : dependencies)=T && Strings.isNullOrEmpty(dependency.getVersion()) && artifact != null ... | /* static context
[FOCAL] public List<File> ProcessorpathResolver.resolve(RepositorySystemSession session, MavenProject project, List<Dependency> dependencies)
[THROWS-WHEN] MojoExecutionException when foreach(Dependency dependency : dependencies)=T && Strings.isNullOrEmpty(dependency.getVersion()) && artifact != null ... | true | ok | {"focal": {"class": "ProcessorpathResolver", "name": "resolve", "signature": "List<File> resolve(RepositorySystemSession session, MavenProject project, List<Dependency> dependencies) throws MojoExecutionException", "start_line": 3, "modifiers": "public", "params": [{"name": "session", "type": "RepositorySystemSession"}... |
14612017_22 | class VelocityBodyContent extends BodyContent {
@Override
public void write(char[] cbuf, int off, int len) throws IOException
{
getEnclosingWriter().write(cbuf, off, len);
}
public VelocityBodyContent(JspWriter jspWriter, ASTBlock block,
InternalContextAdapter context);
@... | jspWriter.write(aryEq("hello".toCharArray()), eq(1), eq(3));
replay(jspWriter, block, context);
content.write("hello".toCharArray(), 1, 3);
verify(jspWriter, block, context);
}
} | [FOCAL] @Override public void VelocityBodyContent.write(char[] cbuf, int off, int len)
[CLASS] class VelocityBodyContent extends BodyContent
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] getEnclosingWriter().write/3, getEnclosingWriter/0 (inherited)
[EXCEPTIONS] declares IOExcept... | /* static context
[FOCAL] @Override public void VelocityBodyContent.write(char[] cbuf, int off, int len)
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] getEnclosingWriter().write/3, getEnclosingWriter/0 (inherited)
*/
| /* static context
[FOCAL] @Override public void VelocityBodyContent.write(char[] cbuf, int off, int len)
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] getEnclosingWriter().write/3, getEnclosingWriter/0 (inherited)
*/
class VelocityBodyContent extends BodyContent {
@Override
public void write(char[] cbuf, ... | true | ok | {"focal": {"class": "VelocityBodyContent", "name": "write", "signature": "void write(char[] cbuf, int off, int len) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "cbuf", "type": "char[]"}, {"name": "off", "type": "int"}, {"name": "len", "type": "int"}], "return_type": "void"... |
14616420_40 | class PropertiesBasedTraceeFilterConfiguration implements TraceeFilterConfiguration {
@Override
public Map<String, String> filterDeniedParams(final Map<String, String> unfiltered, final Channel channel) {
final Map<String, String> filtered = new HashMap<>(unfiltered.size());
for (Map.Entry<String, String> entry ... | final Map<String, String> unfiltered = Collections.singletonMap("Foo", "Bar");
assertThat(unit.filterDeniedParams(unfiltered, Channel.IncomingRequest), equalTo(Collections.<String, String>emptyMap()));
}
} | [FOCAL] @Override public Map<String, String> PropertiesBasedTraceeFilterConfiguration.filterDeniedParams(Map<String, String> unfiltered, Channel channel)
[CLASS] class PropertiesBasedTraceeFilterConfiguration implements TraceeFilterConfiguration
[METRICS] loc=10 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CAL... | /* static context
[FOCAL] @Override public Map<String, String> PropertiesBasedTraceeFilterConfiguration.filterDeniedParams(Map<String, String> unfiltered, Channel channel)
[PATH1] foreach(Map.Entry<String, String> entry : unfiltered.entrySet())=T -> if(shouldProcessParam(entry.getKey(), channel))=T -> exit loop -> retu... | /* static context
[FOCAL] @Override public Map<String, String> PropertiesBasedTraceeFilterConfiguration.filterDeniedParams(Map<String, String> unfiltered, Channel channel)
[PATH1] foreach(Map.Entry<String, String> entry : unfiltered.entrySet())=T -> if(shouldProcessParam(entry.getKey(), channel))=T -> exit loop -> retu... | true | ok | {"focal": {"class": "PropertiesBasedTraceeFilterConfiguration", "name": "filterDeniedParams", "signature": "Map<String, String> filterDeniedParams(Map<String, String> unfiltered, Channel channel)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "unfiltered", "type": "Map<String, String>"}, {"name... |
14640193_0 | class MiscUtils {
public static Date parseLogcatTimeStamp(String line) {
Matcher matcher = LOGCAT_TIMESTAMP_PATTERN.matcher(line);
if (matcher.find()) {
int month = Integer.valueOf(matcher.group(1));
int day = Integer.valueOf(matcher.group(2));
int hour = Integ... | Date date = MiscUtils.parseLogcatTimeStamp("03-31 01:04:39.348 14308-14308/com.SecUpwN.AIMSICD I/SignalStrengthTracker: Ignored signal sample for");
assertEquals(2, date.getMonth()); //Month is 0 based
assertEquals(31, date.getDate());
assertEquals(1, date.getHours());
assertEq... | [FOCAL] public static Date MiscUtils.parseLogcatTimeStamp(String line)
[CLASS] class MiscUtils
[METRICS] loc=27 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] LOGCAT_TIMESTAMP_PATTERN.matcher/1, Matcher.find/0, Integer.valueOf/1, Matcher.group/1, Calendar.getInstance/0, Calendar.set/2, Calendar.g... | /* static context
[FOCAL] public static Date MiscUtils.parseLogcatTimeStamp(String line)
[THROWS-WHEN] IllegalArgumentException when !matcher.find()
[PATH1] if(matcher.find())=T -> return calendar.getTime()
[PATH2] if(matcher.find())=F -> throw new IllegalArgumentException("Invalid Line")
[INPUTS] branches=line | resul... | /* static context
[FOCAL] public static Date MiscUtils.parseLogcatTimeStamp(String line)
[THROWS-WHEN] IllegalArgumentException when !matcher.find()
[PATH1] if(matcher.find())=T -> return calendar.getTime()
[PATH2] if(matcher.find())=F -> throw new IllegalArgumentException("Invalid Line")
[INPUTS] branches=line | resul... | true | ok | {"focal": {"class": "MiscUtils", "name": "parseLogcatTimeStamp", "signature": "Date parseLogcatTimeStamp(String line)", "start_line": 3, "modifiers": "public static", "params": [{"name": "line", "type": "String"}], "return_type": "Date"}, "class_info": {"name": "MiscUtils", "kind": "class", "modifiers": "", "superclass... |
14660359_5 | class MigdalorHeaderByteSerializer implements MigdalorHeaderSerializer<BaseMigdalorHeader,String> {
@Override
public String getRevisionAndReposition(ByteBuffer payload) {
int version = payload.getInt();
if (version == PROTOCOL_VERSION){
int schemaVersionSize = payload.getInt();
... | ByteBuffer bytes = ByteBuffer.allocate(10);
bytes.putInt(1);
Assert.assertNull(migdalorHeaderByteSerializer.getRevisionAndReposition(bytes));
}
} | [FOCAL] @Override public String MigdalorHeaderByteSerializer.getRevisionAndReposition(ByteBuffer payload)
[CLASS] class MigdalorHeaderByteSerializer implements MigdalorHeaderSerializer<BaseMigdalorHeader,String>
[METRICS] loc=14 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] ByteBuffer.getInt/0, ... | /* static context
[FOCAL] @Override public String MigdalorHeaderByteSerializer.getRevisionAndReposition(ByteBuffer payload)
[PATH1] if(version == PROTOCOL_VERSION)=T -> return schemaVersion
[PATH2] if(version == PROTOCOL_VERSION)=F -> return null
[INPUTS] branches=payload | result=payload
[COLLABORATORS] param payload:... | /* static context
[FOCAL] @Override public String MigdalorHeaderByteSerializer.getRevisionAndReposition(ByteBuffer payload)
[PATH1] if(version == PROTOCOL_VERSION)=T -> return schemaVersion
[PATH2] if(version == PROTOCOL_VERSION)=F -> return null
[INPUTS] branches=payload | result=payload
[COLLABORATORS] param payload:... | true | ok | {"focal": {"class": "MigdalorHeaderByteSerializer", "name": "getRevisionAndReposition", "signature": "String getRevisionAndReposition(ByteBuffer payload)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "payload", "type": "ByteBuffer"}], "return_type": "String"}, "class_info": {"name": "MigdalorH... |
14661616_12 | class ItemFormatBuilder {
public int getTokenCount(){
return this.tokens.size();
}
public ItemFormatBuilder();
public ItemFormatBuilder(Class<T> targetType);
public Class<T> getTargetType();
public ItemFormatBuilder<T> withStyle(LocalizationContext style);
public ItemFormatBuild... | ItemFormatBuilder<Double> b = new ItemFormatBuilder<Double>(
Double.class);
b.append("1");
b.append("2");
assertEquals(2, b.getTokenCount());
}
} | [FOCAL] public int ItemFormatBuilder.getTokenCount()
[CLASS] class ItemFormatBuilder
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.tokens.size/0
[FIELDS] read=tokens
[COLLABORATORS] field tokens size/0
[CLASS-MEMBERS] ItemFormatBuilder(); ItemFormatBuilder(Class<T> targetTyp... | /* static context
[FOCAL] public int ItemFormatBuilder.getTokenCount()
[COLLABORATORS] field tokens size/0
[FIELDS] read=tokens
[CALLS-EXTERNAL] this.tokens.size/0
*/
| /* static context
[FOCAL] public int ItemFormatBuilder.getTokenCount()
[COLLABORATORS] field tokens size/0
[FIELDS] read=tokens
[CALLS-EXTERNAL] this.tokens.size/0
*/
class ItemFormatBuilder {
public int getTokenCount(){
return this.tokens.size();
}
public ItemFormatBuilder();
public ItemFor... | true | ok | {"focal": {"class": "ItemFormatBuilder", "name": "getTokenCount", "signature": "int getTokenCount()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "ItemFormatBuilder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members"... |
14696091_353 | class DeclaringMethodMatcher extends ElementMatcher.Junction.AbstractBase<T> {
public boolean matches(T target) {
return matcher.matches(target.getDeclaredMethods());
}
public DeclaringMethodMatcher(ElementMatcher<? super MethodList<? extends MethodDescription>> matcher);
@Override public St... | when(typeDescription.getDeclaredMethods()).thenReturn((MethodList) methodList);
when(methodMatcher.matches(methodList)).thenReturn(true);
assertThat(new DeclaringMethodMatcher<TypeDescription>(methodMatcher).matches(typeDescription), is(true));
verify(methodMatcher).matches(methodList);
... | [FOCAL] public boolean DeclaringMethodMatcher.matches(T target)
[CLASS] class DeclaringMethodMatcher extends ElementMatcher.Junction.AbstractBase<T>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] matcher.matches/1, T.getDeclaredMethods/0
[INPUTS] branches=- | result=target
[COLLAB... | /* static context
[FOCAL] public boolean DeclaringMethodMatcher.matches(T target)
[INPUTS] branches=- | result=target
[COLLABORATORS] field matcher matches/1; param target:T getDeclaredMethods/0
[CALLS-EXTERNAL] matcher.matches/1, T.getDeclaredMethods/0
*/
| /* static context
[FOCAL] public boolean DeclaringMethodMatcher.matches(T target)
[INPUTS] branches=- | result=target
[COLLABORATORS] field matcher matches/1; param target:T getDeclaredMethods/0
[CALLS-EXTERNAL] matcher.matches/1, T.getDeclaredMethods/0
*/
class DeclaringMethodMatcher extends ElementMatcher.Junction.Ab... | true | ok | {"focal": {"class": "DeclaringMethodMatcher", "name": "matches", "signature": "boolean matches(T target)", "start_line": 3, "modifiers": "public", "params": [{"name": "target", "type": "T"}], "return_type": "boolean"}, "class_info": {"name": "DeclaringMethodMatcher", "kind": "class", "modifiers": "", "superclass": "Ele... |
14718267_48 | class AllureModelUtils {
public static Label createStoryLabel(String story) {
return createLabel(LabelName.STORY, story);
}
AllureModelUtils();
public static Validator getAllureSchemaValidator();
public static Label createFeatureLabel(String feature);
public static Label createSever... | Label label = AllureModelUtils.createStoryLabel("some-story");
assertThat(label.getValue(), is("some-story"));
assertThat(label.getName(), is(LabelName.STORY.value()));
}
} | [FOCAL] public static Label AllureModelUtils.createStoryLabel(String story)
[CLASS] class AllureModelUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Label createLabel(LabelName name, String value)
[INPUTS] branches=- | result=story
[DATAFLOW] story@param->L2
[CLASS-MEMBERS] A... | /* static context
[FOCAL] public static Label AllureModelUtils.createStoryLabel(String story)
[INPUTS] branches=- | result=story
[CALLS-INTERNAL] Label createLabel(LabelName name, String value)
*/
| /* static context
[FOCAL] public static Label AllureModelUtils.createStoryLabel(String story)
[INPUTS] branches=- | result=story
[CALLS-INTERNAL] Label createLabel(LabelName name, String value)
*/
class AllureModelUtils {
public static Label createStoryLabel(String story) {
return createLabel(LabelName.STO... | true | ok | {"focal": {"class": "AllureModelUtils", "name": "createStoryLabel", "signature": "Label createStoryLabel(String story)", "start_line": 3, "modifiers": "public static", "params": [{"name": "story", "type": "String"}], "return_type": "Label"}, "class_info": {"name": "AllureModelUtils", "kind": "class", "modifiers": "", "... |
14734876_83 | class MultiLayerNetworkHandler implements INetworkHandler {
@Override
public void applyGradient(Gradients gradients, long batchSize) {
BaseNetwork.ModelCounters modelCounters = getModelCounters();
int iterationCount = modelCounters.getIterationCount();
Gradient gradient = gradients.getG... | // Arrange
setup(false);
Gradients gradientsMock = mock(Gradients.class);
final Gradient gradient = mock(Gradient.class);
INDArray gradientGradient = Nd4j.rand(1, 2);
when(gradient.gradient()).thenReturn(gradientGradient);
when(gradientsMock.getGradient(GRADIENT_N... | [FOCAL] @Override public void MultiLayerNetworkHandler.applyGradient(Gradients gradients, long batchSize)
[CLASS] class MultiLayerNetworkHandler implements INetworkHandler
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] BaseNetwork.ModelCounters getModelCounters()
[CALLS-EXTERNAL] ... | /* static context
[FOCAL] @Override public void MultiLayerNetworkHandler.applyGradient(Gradients gradients, long batchSize)
[COLLABORATORS] param gradients:Gradients getGradient/1; field model getUpdater/0,params/0; field configuration setIterationCount/1
[CALLS-INTERNAL] BaseNetwork.ModelCounters getModelCounters()
[C... | /* static context
[FOCAL] @Override public void MultiLayerNetworkHandler.applyGradient(Gradients gradients, long batchSize)
[COLLABORATORS] param gradients:Gradients getGradient/1; field model getUpdater/0,params/0; field configuration setIterationCount/1
[CALLS-INTERNAL] BaseNetwork.ModelCounters getModelCounters()
[C... | true | ok | {"focal": {"class": "MultiLayerNetworkHandler", "name": "applyGradient", "signature": "void applyGradient(Gradients gradients, long batchSize)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "gradients", "type": "Gradients"}, {"name": "batchSize", "type": "long"}], "return_type": "void"}, "class... |
14741882_14 | class ByteArray implements Comparable<ByteArray> {
@Override
public int compareTo(ByteArray that) {
int thisLength = this.byteArrayValue().length;
int res = thisLength - that.byteArrayValue().length;
if (res != 0)
return res;
for (int i = 0; i < thisLength; i++) {
... | byte[] a = new byte[] {1, 2, 3};
byte[] b = new byte[] {2, 3, 1};
assertTrue(new ByteArray(a).compareTo(new ByteArray(b)) < 0);
}
} | [FOCAL] @Override public int ByteArray.compareTo(ByteArray that)
[CLASS] class ByteArray implements Comparable<ByteArray>
[METRICS] loc=13 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] byte[] byteArrayValue()
[CALLS-EXTERNAL] ByteArray.byteArrayValue/0
[PATH1] if(res != 0)#1=F -> for(i < thisLen... | /* static context
[FOCAL] @Override public int ByteArray.compareTo(ByteArray that)
[PATH1] if(res != 0)#1=F -> for(i < thisLength)=T -> if(res != 0)#2=F -> exit loop -> return 0
[PATH2] if(res != 0)#1=T -> return res
[PATH3] if(res != 0)#1=F -> for(i < thisLength)=F -> return 0
[PATH4] if(res != 0)#1=F -> for(i < thisL... | /* static context
[FOCAL] @Override public int ByteArray.compareTo(ByteArray that)
[PATH1] if(res != 0)#1=F -> for(i < thisLength)=T -> if(res != 0)#2=F -> exit loop -> return 0
[PATH2] if(res != 0)#1=T -> return res
[PATH3] if(res != 0)#1=F -> for(i < thisLength)=F -> return 0
[PATH4] if(res != 0)#1=F -> for(i < thisL... | true | ok | {"focal": {"class": "ByteArray", "name": "compareTo", "signature": "int compareTo(ByteArray that)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "that", "type": "ByteArray"}], "return_type": "int"}, "class_info": {"name": "ByteArray", "kind": "class", "modifiers": "", "superclass": null, "inter... |
14755049_47 | class HttpUtil {
public static HttpResponse httpGet(String url, int timeoutms)
throws IOException, URISyntaxException {
return httpGet(url, null, timeoutms);
}
public static HttpResponse httpGet(String url, Map<String, String> requestHeaders, int timeoutms);
public static InputStre... | List<byte[]> responses = HttpUtil.httpGet(urlList, 3, 0);
assertNotNull("null response list", responses);
for (byte[] response : responses) {
assertNotNull("null response", response);
}
}
} | [FOCAL] public static HttpResponse HttpUtil.httpGet(String url, int timeoutms)
[CLASS] class HttpUtil
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] HttpResponse httpGet(String url, Map<String, String> requestHeaders, int timeoutms)
[EXCEPTIONS] declares IOException, URISyntaxExce... | /* static context
[FOCAL] public static HttpResponse HttpUtil.httpGet(String url, int timeoutms)
[INPUTS] branches=- | result=timeoutms, url
[EXCEPTIONS] declares IOException, URISyntaxException
[CALLS-INTERNAL] HttpResponse httpGet(String url, Map<String, String> requestHeaders, int timeoutms)
*/
| /* static context
[FOCAL] public static HttpResponse HttpUtil.httpGet(String url, int timeoutms)
[INPUTS] branches=- | result=timeoutms, url
[EXCEPTIONS] declares IOException, URISyntaxException
[CALLS-INTERNAL] HttpResponse httpGet(String url, Map<String, String> requestHeaders, int timeoutms)
*/
class HttpUtil {
... | true | ok | {"focal": {"class": "HttpUtil", "name": "httpGet", "signature": "HttpResponse httpGet(String url, int timeoutms) throws IOException, URISyntaxException", "start_line": 3, "modifiers": "public static", "params": [{"name": "url", "type": "String"}, {"name": "timeoutms", "type": "int"}], "return_type": "HttpResponse"}, "c... |
14775640_6 | class Actions {
public boolean perform(Class actionClass, Object... args)
throws ArgumentsValidationException {
Action action = getAction(actionClass);
if (action != null && action.isEnabled()) {
if (action.validate(args)) {
Gdx.app.debug("Controller",
ClassReflection.getSimpleName(actionClass)
... | try {
actions.perform(EmptyValidArguments.class);
actions.perform(TwoArgumentsAction.class, "", true);
// the three different possibilities for MultipleValidArguments
actions.perform(MultipleValidArguments.class, "", true);
actions.perform(MultipleValidArguments.class);
actions.perform(MultipleVal... | [FOCAL] public boolean Actions.perform(Class actionClass, Object... args)
[CLASS] class Actions
[METRICS] loc=30 cc=7 branches=6 loops=0 returns=2 throws=1 nesting=4
[CALLS-INTERNAL] String prettyPrintArgs(Object... args); T getAction(Class<T> actionClass); void logAction(Class actionClass, Object... args)
[CALLS-EXTER... | /* static context
[FOCAL] public boolean Actions.perform(Class actionClass, Object... args)
[THROWS-WHEN] ArgumentsValidationException when action != null && action.isEnabled() && !action.validate(args) && action.isTrackable()
[THROWS-WHEN] ArgumentsValidationException when action != null && action.isEnabled() && !acti... | /* static context
[FOCAL] public boolean Actions.perform(Class actionClass, Object... args)
[THROWS-WHEN] ArgumentsValidationException when action != null && action.isEnabled() && !action.validate(args) && action.isTrackable()
[THROWS-WHEN] ArgumentsValidationException when action != null && action.isEnabled() && !acti... | true | ok | {"focal": {"class": "Actions", "name": "perform", "signature": "boolean perform(Class actionClass, Object... args) throws ArgumentsValidationException", "start_line": 3, "modifiers": "public", "params": [{"name": "actionClass", "type": "Class"}, {"name": "args", "type": "Object..."}], "return_type": "boolean"}, "class_... |
14778255_0 | class GitBlitRepository {
public final static Long makeByteValue(String value){
if(value == null || value.isEmpty()){
return null;
}
try{
String size = value;
long f = 1L;
// Using 1000 instead of 1024 to avoid multiplications
size = size.trim().toLowerCase();
if(size.endsWith(" b")){
size... |
Long exp = new Long(12345678901L);
// Check formatting
assertEquals(exp, GitBlitRepository.makeByteValue("123.4567.8901,23456"));
assertEquals(exp, GitBlitRepository.makeByteValue("123,4567,8901.23456"));
assertEquals(exp, GitBlitRepository.makeByteValue("123'4567'8901,23456"));
assertEquals(exp, GitBlit... | [FOCAL] public final static Long GitBlitRepository.makeByteValue(String value)
[CLASS] class GitBlitRepository
[METRICS] loc=54 cc=12 branches=10 loops=0 returns=3 throws=0 nesting=7
[CALLS-EXTERNAL] String.isEmpty/0, size.trim().toLowerCase/0, String.trim/0, String.endsWith/1, size.substring(0, size.length() - 2).trim... | /* static context
[FOCAL] public final static Long GitBlitRepository.makeByteValue(String value)
[PATH1] if(value == null || value.isEmpty())=F -> if(size.endsWith(" b"))=F -> if(size.endsWith(" k"))=F -> if(size.endsWith(" kb"))=F -> if(size.endsWith(" mb"))=F -> if(size.endsWith(" gb"))=F -> if(size.endsWith(" tb"))=... | /* static context
[FOCAL] public final static Long GitBlitRepository.makeByteValue(String value)
[PATH1] if(value == null || value.isEmpty())=F -> if(size.endsWith(" b"))=F -> if(size.endsWith(" k"))=F -> if(size.endsWith(" kb"))=F -> if(size.endsWith(" mb"))=F -> if(size.endsWith(" gb"))=F -> if(size.endsWith(" tb"))=... | true | ok | {"focal": {"class": "GitBlitRepository", "name": "makeByteValue", "signature": "Long makeByteValue(String value)", "start_line": 3, "modifiers": "public final static", "params": [{"name": "value", "type": "String"}], "return_type": "Long"}, "class_info": {"name": "GitBlitRepository", "kind": "class", "modifiers": "", "... |
14792686_0 | class SongsGateway extends BaseApiGateway {
public void querySongsByChannelId(ReportType songType, String currentSongId, int playTime, int channelId, BitRate bitRate, Callback callback) {
if(channelId== ChannelConstantIds.PRIVATE_CHANNEL
||channelId== ChannelConstantIds.FAV){
th... | songsGateway.querySongsByChannelId(ReportType.NEXT_QUEUE, "1", 10, ChannelConstantIds.PRIVATE_CHANNEL,BitRate.HIGH, new Callback());
apiGateway.simulateTextResponse(200, TestResponses.ROCK_CHANNELS_SONGS_JSON, null);
assertNotNull(Douban.songs);
assertThat(Douban.songs.size(), equalTo(2)... | [FOCAL] public void SongsGateway.querySongsByChannelId(ReportType songType, String currentSongId, int playTime, int channelId, BitRate bitRate, Callback callback)
[CLASS] class SongsGateway extends BaseApiGateway
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] apiGateway.makeReques... | /* static context
[FOCAL] public void SongsGateway.querySongsByChannelId(ReportType songType, String currentSongId, int playTime, int channelId, BitRate bitRate, Callback callback)
[PATH1] if(channelId== ChannelConstantIds.PRIVATE_CHANNEL ||channelId== ChannelConstantIds.FAV)=T
[PATH2] if(channelId== ChannelConstantIds... | /* static context
[FOCAL] public void SongsGateway.querySongsByChannelId(ReportType songType, String currentSongId, int playTime, int channelId, BitRate bitRate, Callback callback)
[PATH1] if(channelId== ChannelConstantIds.PRIVATE_CHANNEL ||channelId== ChannelConstantIds.FAV)=T
[PATH2] if(channelId== ChannelConstantIds... | true | ok | {"focal": {"class": "SongsGateway", "name": "querySongsByChannelId", "signature": "void querySongsByChannelId(ReportType songType, String currentSongId, int playTime, int channelId, BitRate bitRate, Callback callback)", "start_line": 3, "modifiers": "public", "params": [{"name": "songType", "type": "ReportType"}, {"nam... |
14795578_4 | class Annotation extends AnnotationBase implements AnnotationImpl {
@Override
public void trim(IntPredicate aIsTrimChar) {
int begin = getBegin();
int end = getEnd();
String text = _casView.getDocumentText();
// If the span is empty, or there is no text, there is nothing to trim
if (begi... | cas.setDocumentText(" a b ");
AnnotationFS ann = cas.createAnnotation(cas.getAnnotationType(), 2, 5);
ann.trim();
assertThat(ann)
.extracting(AnnotationFS::getBegin, AnnotationFS::getEnd, AnnotationFS::getCoveredText)
.containsExactly(3, 4, "b");
}
} | [FOCAL] @Override public void Annotation.trim(IntPredicate aIsTrimChar)
[CLASS] class Annotation extends AnnotationBase implements AnnotationImpl
[METRICS] loc=44 cc=5 branches=2 loops=2 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] int getBegin(); int getEnd(); void setBegin(int v); void setEnd(int v)
[CALLS-EXTERNAL]... | /* static context
[FOCAL] @Override public void Annotation.trim(IntPredicate aIsTrimChar)
[PATH1] if(begin == end || text == null)=F -> while((end > 0) && end > begin && aIsTrimChar.test(backwardsSeekingCodepoint = text.codePointBefore(end)))=T -> exit loop -> while((begin < (text.length() - 1)) && begin < end && aIsTr... | /* static context
[FOCAL] @Override public void Annotation.trim(IntPredicate aIsTrimChar)
[PATH1] if(begin == end || text == null)=F -> while((end > 0) && end > begin && aIsTrimChar.test(backwardsSeekingCodepoint = text.codePointBefore(end)))=T -> exit loop -> while((begin < (text.length() - 1)) && begin < end && aIsTr... | true | ok | {"focal": {"class": "Annotation", "name": "trim", "signature": "void trim(IntPredicate aIsTrimChar)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "aIsTrimChar", "type": "IntPredicate"}], "return_type": "void"}, "class_info": {"name": "Annotation", "kind": "class", "modifiers": "", "superclass"... |
14807800_4 | class Split {
private Split() {
}
private Split();
public static void main(final String[] args);
private static final int USERS;
private static final int ITEMS;
}
class SplitTest {
private static final int USERS;
private static final int ITEMS;
@Test
public void testCros... | DataModelIF<Long, Long> dm = DataModelFactory.getDefaultModel();
for (long u = 1L; u <= USERS; u++) {
for (long i = 1L; i <= ITEMS; i++) {
dm.addPreference(u, i, 1.0 * u * i);
}
}
int nFolds = 5;
DataModelIF<Long, Long>[] splits = null;
... | [FOCAL] private Split.Split()
[CLASS] class Split
[METRICS] loc=2 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] Split(); void main(String[] args)
[TEST] SplitTest: @Test public void testCrossValidation()
[TEST-FIELDS] int USERS, int ITEMS | /* static context
[FOCAL] private Split.Split()
*/
| /* static context
[FOCAL] private Split.Split()
*/
class Split {
private Split() {
}
private Split();
public static void main(final String[] args);
private static final int USERS;
private static final int ITEMS;
}
class SplitTest {
private static final int USERS;
private static f... | true | ok | {"focal": {"class": "Split", "name": "Split", "signature": "Split()", "start_line": 3, "modifiers": "private", "params": [], "return_type": null}, "class_info": {"name": "Split", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "USERS", "type": "int", "modifiers": "private s... |
14829187_93 | class Datasets {
public static boolean moveToTrash(URI uri) {
return deleteWithTrash(uri, true);
}
@SuppressWarnings("unchecked") public static V load(URI uri, Class<E> type);
@SuppressWarnings("unchecked") public static V load(URI uri);
public static V load(String uriString, Class<E> type);
public st... | final URI datasetUri = new URIBuilder(repoUri, "ns", "test")
.with("field", 34)
.build();
TestHelpers.assertThrows("Should reject view URI",
IllegalArgumentException.class, new Runnable() {
@Override
public void run() {
Datasets.moveToTrash(datasetUri);
... | [FOCAL] public static boolean Datasets.moveToTrash(URI uri)
[CLASS] class Datasets
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] boolean deleteWithTrash(URI uri, boolean useTrash)
[INPUTS] branches=- | result=uri
[DATAFLOW] uri@param->L2
[CLASS-MEMBERS] V load(URI uri, Class<E> t... | /* static context
[FOCAL] public static boolean Datasets.moveToTrash(URI uri)
[INPUTS] branches=- | result=uri
[CALLS-INTERNAL] boolean deleteWithTrash(URI uri, boolean useTrash)
*/
| /* static context
[FOCAL] public static boolean Datasets.moveToTrash(URI uri)
[INPUTS] branches=- | result=uri
[CALLS-INTERNAL] boolean deleteWithTrash(URI uri, boolean useTrash)
*/
class Datasets {
public static boolean moveToTrash(URI uri) {
return deleteWithTrash(uri, true);
}
@SuppressWarnings("unchecke... | true | ok | {"focal": {"class": "Datasets", "name": "moveToTrash", "signature": "boolean moveToTrash(URI uri)", "start_line": 3, "modifiers": "public static", "params": [{"name": "uri", "type": "URI"}], "return_type": "boolean"}, "class_info": {"name": "Datasets", "kind": "class", "modifiers": "", "superclass": null, "interfaces":... |
14841479_3 | class ZoneMinderUtils {
public static boolean pingHost(String host) throws IOException {
InetAddress inet = InetAddress.getByName(host);
return inet.isReachable(5000);
}
public static String shutdownZmHost(String host, String username, String password);
}
class ZoneMinderUtilsTest {
@Test
@Ignore
public... | assertTrue(ZoneMinderUtils.pingHost("ubuntu-zm"));
}
} | [FOCAL] public static boolean ZoneMinderUtils.pingHost(String host)
[CLASS] class ZoneMinderUtils
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] InetAddress.getByName/1, InetAddress.isReachable/1
[EXCEPTIONS] declares IOException
[INPUTS] branches=- | result=host
[DATAFLOW] host@p... | /* static context
[FOCAL] public static boolean ZoneMinderUtils.pingHost(String host)
[INPUTS] branches=- | result=host
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] InetAddress.getByName/1, InetAddress.isReachable/1
*/
| /* static context
[FOCAL] public static boolean ZoneMinderUtils.pingHost(String host)
[INPUTS] branches=- | result=host
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] InetAddress.getByName/1, InetAddress.isReachable/1
*/
class ZoneMinderUtils {
public static boolean pingHost(String host) throws IOException {
I... | true | ok | {"focal": {"class": "ZoneMinderUtils", "name": "pingHost", "signature": "boolean pingHost(String host) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "host", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "ZoneMinderUtils", "kind": "class", "modifiers": ""... |
14865444_43 | class ClassUtil {
public static Object invoke(final Object instance, final Method method, final Object... args) {
Assertion.check()
.isNotNull(instance)
.isNotNull(method);
//-----
try {
return method.invoke(instance, args);
} catch (final IllegalAccessException e) {
throw WrappedException.wrap(... | final Method addMethod = ClassUtil.findMethod(MyMath.class, "add", long.class, long.class);
final Object result = ClassUtil.invoke(new MyMath(), addMethod, 4L, 6L);
assertEquals(10L, result);
}
} | [FOCAL] public static Object ClassUtil.invoke(Object instance, Method method, Object... args)
[CLASS] class ClassUtil
[METRICS] loc=13 cc=3 branches=0 loops=0 returns=1 throws=2 nesting=1
[CALLS-EXTERNAL] Assertion.check() .isNotNull(instance).isNotNull/1, Assertion.check().isNotNull/1, Assertion.check/0, Method.invoke... | /* static context
[FOCAL] public static Object ClassUtil.invoke(Object instance, Method method, Object... args)
[THROWS-WHEN] WrappedException.wrap(e, "accès impossible à la méthode : {0} de {1... when try-body throws
[THROWS-WHEN] WrappedException.wrap(e, "Erreur lors de l'appel de la méthode : {0... when try-body thr... | /* static context
[FOCAL] public static Object ClassUtil.invoke(Object instance, Method method, Object... args)
[THROWS-WHEN] WrappedException.wrap(e, "accès impossible à la méthode : {0} de {1... when try-body throws
[THROWS-WHEN] WrappedException.wrap(e, "Erreur lors de l'appel de la méthode : {0... when try-body thr... | true | ok | {"focal": {"class": "ClassUtil", "name": "invoke", "signature": "Object invoke(Object instance, Method method, Object... args)", "start_line": 3, "modifiers": "public static", "params": [{"name": "instance", "type": "Object"}, {"name": "method", "type": "Method"}, {"name": "args", "type": "Object..."}], "return_type": ... |
14882085_0 | class DefaultRequestHandler implements RequestHandler {
@Override
public SiriusResult handleGet(String key) {
String value = RefAppState.repository.get(key);
if (value == null) {
return SiriusResult.none();
}
return SiriusResult.some(value);
}
@Override pu... | String key = "a";
doReturn(null).when(mockRepository).get(key);
assertEquals(SiriusResult.none(), underTest.handleGet(key));
}
} | [FOCAL] @Override public SiriusResult DefaultRequestHandler.handleGet(String key)
[CLASS] class DefaultRequestHandler implements RequestHandler
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] RefAppState.repository.get/1, SiriusResult.none/0, SiriusResult.some/1
[PATH1] if(value =... | /* static context
[FOCAL] @Override public SiriusResult DefaultRequestHandler.handleGet(String key)
[PATH1] if(value == null)=T -> return SiriusResult.none()
[PATH2] if(value == null)=F -> return SiriusResult.some(value)
[INPUTS] branches=key | result=key
[CALLS-EXTERNAL] RefAppState.repository.get/1, SiriusResult.none... | /* static context
[FOCAL] @Override public SiriusResult DefaultRequestHandler.handleGet(String key)
[PATH1] if(value == null)=T -> return SiriusResult.none()
[PATH2] if(value == null)=F -> return SiriusResult.some(value)
[INPUTS] branches=key | result=key
[CALLS-EXTERNAL] RefAppState.repository.get/1, SiriusResult.none... | true | ok | {"focal": {"class": "DefaultRequestHandler", "name": "handleGet", "signature": "SiriusResult handleGet(String key)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "String"}], "return_type": "SiriusResult"}, "class_info": {"name": "DefaultRequestHandler", "kind": "class", "modifier... |
14884127_0 | class ProgressEvent extends GwtEvent<Handler> {
public boolean isLengthComputable()
{
return 0 != _total;
}
public ProgressEvent( final int loaded, final int total );
public static GwtEvent.Type<Handler> getType();
public int getLoaded();
public int getTotal();
@Override public GwtEvent.Type<Han... | assertFalse( new ProgressEvent( 0, 0 ).isLengthComputable() );
assertTrue( new ProgressEvent( 1, 2 ).isLengthComputable() );
}
} | [FOCAL] public boolean ProgressEvent.isLengthComputable()
[CLASS] class ProgressEvent extends GwtEvent<Handler>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] ProgressEvent(int loaded, int total); GwtEvent.Type<Handler> getType(); int getLoaded(); int getTotal(); GwtEvent.Type<Hand... | /* static context
[FOCAL] public boolean ProgressEvent.isLengthComputable()
*/
| /* static context
[FOCAL] public boolean ProgressEvent.isLengthComputable()
*/
class ProgressEvent extends GwtEvent<Handler> {
public boolean isLengthComputable()
{
return 0 != _total;
}
public ProgressEvent( final int loaded, final int total );
public static GwtEvent.Type<Handler> getType();
public... | true | ok | {"focal": {"class": "ProgressEvent", "name": "isLengthComputable", "signature": "boolean isLengthComputable()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "ProgressEvent", "kind": "class", "modifiers": "", "superclass": "GwtEvent<Handler>", "interfaces": null... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.