method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
public void test_oneChunk() {
final Var<?> x = Var.var("x");
final Var<?> y = Var.var("y");
final List<IBindingSet> data = new LinkedList<IBindingSet>();
{
IBindingSet bset = null;
{
bset = new ListBindingSet();
bset.set(x, makeLiteral("John"));
bset.set(y, makeLiteral("Mary"));
data.add(bset);
}
{
bset = new ListBindingSet();
bset.set(x, makeLiteral("Mary"));
bset.set(y, makeLiteral("Paul"));
data.add(bset);
}
{
bset = new ListBindingSet();
bset.set(x, makeLiteral("Mary"));
bset.set(y, makeLiteral("Jane"));
data.add(bset);
}
{
bset = new ListBindingSet();
bset.set(x, makeLiteral("Paul"));
bset.set(y, makeLiteral("Leon"));
data.add(bset);
}
{
bset = new ListBindingSet();
bset.set(x, makeLiteral("Paul"));
bset.set(y, makeLiteral("John"));
data.add(bset);
}
{
bset = new ListBindingSet();
bset.set(x, makeLiteral("Leon"));
bset.set(y, makeLiteral("Paul"));
data.add(bset);
}
}
final IQueryClient queryController = new MockQueryController();
final UUID queryId = UUID.randomUUID();
final int bopId = 1;
final int partitionId = 2;
//
final IBindingSet[] source = data.toArray(new IBindingSet[0]);
// build the chunk.
final IChunkMessage<IBindingSet> msg1 = new ThickChunkMessage<IBindingSet>(
queryController, queryId, bopId, partitionId, source);
// same reference.
assertTrue(queryController == msg1.getQueryController());
// encode/decode.
final IChunkMessage<IBindingSet> msg = (IChunkMessage<IBindingSet>) SerializerUtil
.deserialize(SerializerUtil.serialize(msg1));
// equals()
assertEquals(queryController, msg.getQueryController());
assertEquals(queryId, msg.getQueryId());
assertEquals(bopId, msg.getBOpId());
assertEquals(partitionId, msg.getPartitionId());
// the data is inline with the message.
assertTrue(msg.isMaterialized());
assertSameIterator(data.toArray(new IBindingSet[0]),
new Dechunkerator<IBindingSet>(msg.getChunkAccessor()
.iterator()));
}
private static class MockQueryController implements IQueryClient,
Serializable {
private static final long serialVersionUID = 1L;
final private UUID serviceId = UUID.randomUUID();
| void function() { final Var<?> x = Var.var("x"); final Var<?> y = Var.var("y"); final List<IBindingSet> data = new LinkedList<IBindingSet>(); { IBindingSet bset = null; { bset = new ListBindingSet(); bset.set(x, makeLiteral("John")); bset.set(y, makeLiteral("Mary")); data.add(bset); } { bset = new ListBindingSet(); bset.set(x, makeLiteral("Mary")); bset.set(y, makeLiteral("Paul")); data.add(bset); } { bset = new ListBindingSet(); bset.set(x, makeLiteral("Mary")); bset.set(y, makeLiteral("Jane")); data.add(bset); } { bset = new ListBindingSet(); bset.set(x, makeLiteral("Paul")); bset.set(y, makeLiteral("Leon")); data.add(bset); } { bset = new ListBindingSet(); bset.set(x, makeLiteral("Paul")); bset.set(y, makeLiteral("John")); data.add(bset); } { bset = new ListBindingSet(); bset.set(x, makeLiteral("Leon")); bset.set(y, makeLiteral("Paul")); data.add(bset); } } final IQueryClient queryController = new MockQueryController(); final UUID queryId = UUID.randomUUID(); final int bopId = 1; final int partitionId = 2; final IBindingSet[] source = data.toArray(new IBindingSet[0]); final IChunkMessage<IBindingSet> msg1 = new ThickChunkMessage<IBindingSet>( queryController, queryId, bopId, partitionId, source); assertTrue(queryController == msg1.getQueryController()); final IChunkMessage<IBindingSet> msg = (IChunkMessage<IBindingSet>) SerializerUtil .deserialize(SerializerUtil.serialize(msg1)); assertEquals(queryController, msg.getQueryController()); assertEquals(queryId, msg.getQueryId()); assertEquals(bopId, msg.getBOpId()); assertEquals(partitionId, msg.getPartitionId()); assertTrue(msg.isMaterialized()); assertSameIterator(data.toArray(new IBindingSet[0]), new Dechunkerator<IBindingSet>(msg.getChunkAccessor() .iterator())); } private static class MockQueryController implements IQueryClient, Serializable { private static final long serialVersionUID = 1L; final private UUID serviceId = UUID.randomUUID(); | /**
* Unit test for a message with a single chunk of binding sets.
*/ | Unit test for a message with a single chunk of binding sets | test_oneChunk | {
"repo_name": "blazegraph/database",
"path": "bigdata-core-test/bigdata/src/test/com/bigdata/bop/fed/TestThickChunkMessage.java",
"license": "gpl-2.0",
"size": 11079
} | [
"com.bigdata.bop.IBindingSet",
"com.bigdata.bop.Var",
"com.bigdata.bop.bindingSet.ListBindingSet",
"com.bigdata.bop.engine.IChunkMessage",
"com.bigdata.bop.engine.IQueryClient",
"com.bigdata.io.SerializerUtil",
"com.bigdata.striterator.Dechunkerator",
"java.io.Serializable",
"java.util.LinkedList",
"java.util.List",
"java.util.UUID"
] | import com.bigdata.bop.IBindingSet; import com.bigdata.bop.Var; import com.bigdata.bop.bindingSet.ListBindingSet; import com.bigdata.bop.engine.IChunkMessage; import com.bigdata.bop.engine.IQueryClient; import com.bigdata.io.SerializerUtil; import com.bigdata.striterator.Dechunkerator; import java.io.Serializable; import java.util.LinkedList; import java.util.List; import java.util.UUID; | import com.bigdata.bop.*; import com.bigdata.bop.engine.*; import com.bigdata.io.*; import com.bigdata.striterator.*; import java.io.*; import java.util.*; | [
"com.bigdata.bop",
"com.bigdata.io",
"com.bigdata.striterator",
"java.io",
"java.util"
] | com.bigdata.bop; com.bigdata.io; com.bigdata.striterator; java.io; java.util; | 1,515,145 |
public void run(String[] outputNames, boolean enableStats) {
// Release any Tensors from the previous run calls.
closeFetches();
// Add fetches.
for (String o : outputNames) {
fetchNames.add(o);
TensorId tid = TensorId.parse(o);
runner.fetch(tid.name, tid.outputIndex);
}
// Run the session.
try {
if (enableStats) {
Session.Run r = runner.setOptions(RunStats.runOptions()).runAndFetchMetadata();
fetchTensors = r.outputs;
if (runStats == null) {
runStats = new RunStats();
}
runStats.add(r.metadata);
} else {
fetchTensors = runner.run();
}
} catch (RuntimeException e) {
// Ideally the exception would have been let through, but since this interface predates the
// TensorFlow Java API, must return -1.
Log.e(
TAG,
"Failed to run TensorFlow inference with inputs:["
+ TextUtils.join(", ", feedNames)
+ "], outputs:["
+ TextUtils.join(", ", fetchNames)
+ "]");
throw e;
} finally {
// Always release the feeds (to save resources) and reset the runner, this run is
// over.
closeFeeds();
runner = sess.runner();
}
} | void function(String[] outputNames, boolean enableStats) { closeFetches(); for (String o : outputNames) { fetchNames.add(o); TensorId tid = TensorId.parse(o); runner.fetch(tid.name, tid.outputIndex); } try { if (enableStats) { Session.Run r = runner.setOptions(RunStats.runOptions()).runAndFetchMetadata(); fetchTensors = r.outputs; if (runStats == null) { runStats = new RunStats(); } runStats.add(r.metadata); } else { fetchTensors = runner.run(); } } catch (RuntimeException e) { Log.e( TAG, STR + TextUtils.join(STR, feedNames) + STR + TextUtils.join(STR, fetchNames) + "]"); throw e; } finally { closeFeeds(); runner = sess.runner(); } } | /**
* Runs inference between the previously registered input nodes (via feed*) and the requested
* output nodes. Output nodes can then be queried with the fetch* methods.
*
* @param outputNames A list of output nodes which should be filled by the inference pass.
*/ | Runs inference between the previously registered input nodes (via feed*) and the requested output nodes. Output nodes can then be queried with the fetch* methods | run | {
"repo_name": "npuichigo/ttsflow",
"path": "third_party/tensorflow/tensorflow/contrib/android/java/org/tensorflow/contrib/android/TensorFlowInferenceInterface.java",
"license": "apache-2.0",
"size": 17972
} | [
"android.text.TextUtils",
"android.util.Log",
"org.tensorflow.Session"
] | import android.text.TextUtils; import android.util.Log; import org.tensorflow.Session; | import android.text.*; import android.util.*; import org.tensorflow.*; | [
"android.text",
"android.util",
"org.tensorflow"
] | android.text; android.util; org.tensorflow; | 1,795,949 |
public void createLogPanel() {
if ( logPanel == null ) {
TextBox t = new TextBox("Log:", null, 128, TextField.ANY );
t.addCommand( cancel );
t.setCommandListener(this);
logPanel = t;
}
}
| void function() { if ( logPanel == null ) { TextBox t = new TextBox("Log:", null, 128, TextField.ANY ); t.addCommand( cancel ); t.setCommandListener(this); logPanel = t; } } | /**
* Create a simple text area where publications are displayed as they arrive.
*/ | Create a simple text area where publications are displayed as they arrive | createLogPanel | {
"repo_name": "gulliverrr/hestia-engine-dev",
"path": "src/opt/boilercontrol/libs/org.eclipse.paho.jmeclient/org.eclipse.paho.jmeclient.mqttv3.MIDPSample/src/org/eclipse/paho/jmeclient/mqttv3/sampleMIDP/IA92.java",
"license": "gpl-3.0",
"size": 12572
} | [
"javax.microedition.lcdui.TextBox",
"javax.microedition.lcdui.TextField"
] | import javax.microedition.lcdui.TextBox; import javax.microedition.lcdui.TextField; | import javax.microedition.lcdui.*; | [
"javax.microedition"
] | javax.microedition; | 1,085,505 |
public int removeIndex(String indexName) throws CacheException, ForceReattemptException {
int numBuckets = 0;
// remotely originated removeindex
Object ind = this.indexes.get(indexName);
// Check if the returned value is instance of Index (this means the index is
// not in create phase, its created successfully).
if (ind instanceof Index) {
numBuckets = removeIndex((Index) this.indexes.get(indexName), true);
}
return numBuckets;
} | int function(String indexName) throws CacheException, ForceReattemptException { int numBuckets = 0; Object ind = this.indexes.get(indexName); if (ind instanceof Index) { numBuckets = removeIndex((Index) this.indexes.get(indexName), true); } return numBuckets; } | /**
* Gets and removes index by name.
*
* @param indexName name of the index to be removed.
*/ | Gets and removes index by name | removeIndex | {
"repo_name": "davinash/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java",
"license": "apache-2.0",
"size": 383155
} | [
"org.apache.geode.cache.CacheException",
"org.apache.geode.cache.query.Index"
] | import org.apache.geode.cache.CacheException; import org.apache.geode.cache.query.Index; | import org.apache.geode.cache.*; import org.apache.geode.cache.query.*; | [
"org.apache.geode"
] | org.apache.geode; | 2,354,550 |
public static boolean containsMessage(List<String> contents, String msgId) {
for (String it : contents) {
String[] data = SimUtil.split(it);
assertTrue(data.length == 2);
if (data[1].equals(msgId)) return true;
}
return false;
} | static boolean function(List<String> contents, String msgId) { for (String it : contents) { String[] data = SimUtil.split(it); assertTrue(data.length == 2); if (data[1].equals(msgId)) return true; } return false; } | /**
* Stupid O(n) search for message ID based on peerId::msgId
*/ | Stupid O(n) search for message ID based on peerId::msgId | containsMessage | {
"repo_name": "jarlopez/dresden",
"path": "src/test/java/dresden/sim/TestBase.java",
"license": "mit",
"size": 1112
} | [
"java.util.List",
"org.junit.Assert"
] | import java.util.List; import org.junit.Assert; | import java.util.*; import org.junit.*; | [
"java.util",
"org.junit"
] | java.util; org.junit; | 605,693 |
public static SummariseResultsSettings readSummariseResultsSettings(int flags) {
return new ConfigurationReader<>(SummariseResultsSettings.getDefaultInstance()).read(flags);
} | static SummariseResultsSettings function(int flags) { return new ConfigurationReader<>(SummariseResultsSettings.getDefaultInstance()).read(flags); } | /**
* Read the SummariseResultsSettings from the settings file in the settings directory.
*
* @param flags the flags
* @return the SummariseResultsSettings
*/ | Read the SummariseResultsSettings from the settings file in the settings directory | readSummariseResultsSettings | {
"repo_name": "aherbert/GDSC-SMLM",
"path": "src/main/java/uk/ac/sussex/gdsc/smlm/ij/settings/SettingsManager.java",
"license": "gpl-3.0",
"size": 46108
} | [
"uk.ac.sussex.gdsc.smlm.data.config.GUIProtos"
] | import uk.ac.sussex.gdsc.smlm.data.config.GUIProtos; | import uk.ac.sussex.gdsc.smlm.data.config.*; | [
"uk.ac.sussex"
] | uk.ac.sussex; | 1,638,289 |
protected void handleChange() {
lastTemplateChoice = this.comboTemplateNames.getText();
lastAppIdText = this.appIdText.getText();
Tuple<String, File> description = templateNamesAndDescriptions.get(lastTemplateChoice);
templateDescription.setText(description != null ? description.o1 : "");
boolean hasError = false;
if (lastTemplateChoice.equals(CHOOSE_ONE)) {
setChooseOneErrorMessage();
hasError = true;
} else if (lastAppIdText == null || lastAppIdText.trim().length() == 0) {
setErrorMessage("Please fill the application id (registered in Google App Engine).");
hasError = true;
}
if (!hasError) {
setErrorMessage(null);
}
} | void function() { lastTemplateChoice = this.comboTemplateNames.getText(); lastAppIdText = this.appIdText.getText(); Tuple<String, File> description = templateNamesAndDescriptions.get(lastTemplateChoice); templateDescription.setText(description != null ? description.o1 : STRPlease fill the application id (registered in Google App Engine)."); hasError = true; } if (!hasError) { setErrorMessage(null); } } | /**
* When the selection changes, we update the last choice, description and the error message.
*/ | When the selection changes, we update the last choice, description and the error message | handleChange | {
"repo_name": "aptana/Pydev",
"path": "bundles/org.python.pydev.customizations/src/org/python/pydev/customizations/app_engine/wizards/AppEngineTemplatePage.java",
"license": "epl-1.0",
"size": 9797
} | [
"java.io.File",
"org.python.pydev.shared_core.structure.Tuple"
] | import java.io.File; import org.python.pydev.shared_core.structure.Tuple; | import java.io.*; import org.python.pydev.shared_core.structure.*; | [
"java.io",
"org.python.pydev"
] | java.io; org.python.pydev; | 215,182 |
if (input.contains("{{")) {
StringBuffer result = new StringBuffer();
Matcher placeholders = Pattern.compile("\\{\\{(.*?)}}").matcher(input);
while (placeholders.find()) {
if (placeholders.group(1).isEmpty()) {
placeholders.appendReplacement(result, placeholders.group(0));
} else {
String substitution;
switch (placeholders.group(1)) {
case "metricName":
substitution = reportPoint.getMetric();
break;
case "sourceName":
substitution = reportPoint.getHost();
break;
default:
substitution = reportPoint.getAnnotations().get(placeholders.group(1));
}
if (substitution != null) {
placeholders.appendReplacement(result, substitution);
} else {
placeholders.appendReplacement(result, placeholders.group(0));
}
}
}
placeholders.appendTail(result);
return result.toString();
}
return input;
} | if (input.contains("{{")) { StringBuffer result = new StringBuffer(); Matcher placeholders = Pattern.compile(STR).matcher(input); while (placeholders.find()) { if (placeholders.group(1).isEmpty()) { placeholders.appendReplacement(result, placeholders.group(0)); } else { String substitution; switch (placeholders.group(1)) { case STR: substitution = reportPoint.getMetric(); break; case STR: substitution = reportPoint.getHost(); break; default: substitution = reportPoint.getAnnotations().get(placeholders.group(1)); } if (substitution != null) { placeholders.appendReplacement(result, substitution); } else { placeholders.appendReplacement(result, placeholders.group(0)); } } } placeholders.appendTail(result); return result.toString(); } return input; } | /**
* Substitute {{...}} placeholders with corresponding components of the point
* {{metricName}} {{sourceName}} are replaced with the metric name and source respectively
* {{anyTagK}} is replaced with the value of the anyTagK point tag
*
* @param input input string with {{...}} placeholders
* @param reportPoint ReportPoint object to extract components from
* @return string with substituted placeholders
*/ | Substitute {{...}} placeholders with corresponding components of the point {{metricName}} {{sourceName}} are replaced with the metric name and source respectively {{anyTagK}} is replaced with the value of the anyTagK point tag | expandPlaceholders | {
"repo_name": "moribellamy/java",
"path": "proxy/src/main/java/com/wavefront/agent/preprocessor/PreprocessorUtil.java",
"license": "apache-2.0",
"size": 1928
} | [
"java.util.regex.Matcher",
"java.util.regex.Pattern"
] | import java.util.regex.Matcher; import java.util.regex.Pattern; | import java.util.regex.*; | [
"java.util"
] | java.util; | 94,900 |
protected static Set<BundleCoordinate> findReachableApiBundles(final ConfigurableComponent component) {
final Set<BundleCoordinate> reachableApiBundles = new HashSet<>();
try (final NarCloseable closeable = NarCloseable.withComponentNarLoader(component.getClass().getClassLoader())) {
final List<PropertyDescriptor> descriptors = component.getPropertyDescriptors();
if (descriptors != null && !descriptors.isEmpty()) {
for (final PropertyDescriptor descriptor : descriptors) {
final Class<? extends ControllerService> serviceApi = descriptor.getControllerServiceDefinition();
if (serviceApi != null && !component.getClass().getClassLoader().equals(serviceApi.getClassLoader())) {
final Bundle apiBundle = classLoaderBundleLookup.get(serviceApi.getClassLoader());
reachableApiBundles.add(apiBundle.getBundleDetails().getCoordinate());
}
}
}
}
return reachableApiBundles;
} | static Set<BundleCoordinate> function(final ConfigurableComponent component) { final Set<BundleCoordinate> reachableApiBundles = new HashSet<>(); try (final NarCloseable closeable = NarCloseable.withComponentNarLoader(component.getClass().getClassLoader())) { final List<PropertyDescriptor> descriptors = component.getPropertyDescriptors(); if (descriptors != null && !descriptors.isEmpty()) { for (final PropertyDescriptor descriptor : descriptors) { final Class<? extends ControllerService> serviceApi = descriptor.getControllerServiceDefinition(); if (serviceApi != null && !component.getClass().getClassLoader().equals(serviceApi.getClassLoader())) { final Bundle apiBundle = classLoaderBundleLookup.get(serviceApi.getClassLoader()); reachableApiBundles.add(apiBundle.getBundleDetails().getCoordinate()); } } } } return reachableApiBundles; } | /**
* Find the bundle coordinates for any service APIs that are referenced by this component and not part of the same bundle.
*
* @param component the component being instantiated
*/ | Find the bundle coordinates for any service APIs that are referenced by this component and not part of the same bundle | findReachableApiBundles | {
"repo_name": "tequalsme/nifi",
"path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-utils/src/main/java/org/apache/nifi/nar/ExtensionManager.java",
"license": "apache-2.0",
"size": 27115
} | [
"java.util.HashSet",
"java.util.List",
"java.util.Set",
"org.apache.nifi.bundle.Bundle",
"org.apache.nifi.bundle.BundleCoordinate",
"org.apache.nifi.components.ConfigurableComponent",
"org.apache.nifi.components.PropertyDescriptor",
"org.apache.nifi.controller.ControllerService"
] | import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.nifi.bundle.Bundle; import org.apache.nifi.bundle.BundleCoordinate; import org.apache.nifi.components.ConfigurableComponent; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.controller.ControllerService; | import java.util.*; import org.apache.nifi.bundle.*; import org.apache.nifi.components.*; import org.apache.nifi.controller.*; | [
"java.util",
"org.apache.nifi"
] | java.util; org.apache.nifi; | 2,812,108 |
@Override public void exitElsecondition(@NotNull QL4Parser.ElseconditionContext ctx) { } | @Override public void exitElsecondition(@NotNull QL4Parser.ElseconditionContext ctx) { } | /**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/ | The default implementation does nothing | enterElsecondition | {
"repo_name": "software-engineering-amsterdam/poly-ql",
"path": "skatt/QL/gen/QL4/QL4BaseListener.java",
"license": "apache-2.0",
"size": 10344
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 1,696,645 |
public void test_getInstanceLjava_lang_StringLjava_lang_String02() throws NoSuchProviderException {
if (!DEFSupported) {
fail(NotSupportedMsg);
return;
}
try {
KeyManagerFactory.getInstance(null, defaultProviderName);
fail("NoSuchAlgorithmException or NullPointerException should be thrown (algorithm is null");
} catch (NoSuchAlgorithmException e) {
} catch (NullPointerException e) {
}
for (int i = 0; i < invalidValues.length; i++) {
try {
KeyManagerFactory.getInstance(invalidValues[i],
defaultProviderName);
fail("NoSuchAlgorithmException must be thrown (algorithm: "
.concat(invalidValues[i]).concat(")"));
} catch (NoSuchAlgorithmException e) {
}
}
} | void function() throws NoSuchProviderException { if (!DEFSupported) { fail(NotSupportedMsg); return; } try { KeyManagerFactory.getInstance(null, defaultProviderName); fail(STR); } catch (NoSuchAlgorithmException e) { } catch (NullPointerException e) { } for (int i = 0; i < invalidValues.length; i++) { try { KeyManagerFactory.getInstance(invalidValues[i], defaultProviderName); fail(STR .concat(invalidValues[i]).concat(")")); } catch (NoSuchAlgorithmException e) { } } } | /**
* Test for <code>getInstance(String algorithm, String provider)</code>
* method
* Assertion:
* throws NullPointerException when algorithm is null;
* throws NoSuchAlgorithmException when algorithm is not correct;
*/ | Test for <code>getInstance(String algorithm, String provider)</code> method Assertion: throws NullPointerException when algorithm is null; throws NoSuchAlgorithmException when algorithm is not correct | test_getInstanceLjava_lang_StringLjava_lang_String02 | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "libcore/luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactory1Test.java",
"license": "gpl-2.0",
"size": 19947
} | [
"java.security.NoSuchAlgorithmException",
"java.security.NoSuchProviderException",
"javax.net.ssl.KeyManagerFactory"
] | import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import javax.net.ssl.KeyManagerFactory; | import java.security.*; import javax.net.ssl.*; | [
"java.security",
"javax.net"
] | java.security; javax.net; | 1,169,226 |
public BillingService createBillingServiceWithDesc(String code, String region, String date, String description) throws Exception {
BillingService billingService = new BillingService();
EntityDataGenerator.generateTestDataForModelClass(billingService);
billingService.setServiceCode(code);
billingService.setRegion(region);
Date newDate = new Date(dfm.parse(date).getTime());
billingService.setBillingserviceDate(newDate);
billingService.setDescription(description);
return billingService;
} | BillingService function(String code, String region, String date, String description) throws Exception { BillingService billingService = new BillingService(); EntityDataGenerator.generateTestDataForModelClass(billingService); billingService.setServiceCode(code); billingService.setRegion(region); Date newDate = new Date(dfm.parse(date).getTime()); billingService.setBillingserviceDate(newDate); billingService.setDescription(description); return billingService; } | /**
* Creates and populates a new BillingService with a region and description.
* @param code Service code
* @param region Region
* @param date Billing service date
* @param description Description of the billing service.
* @return BillingService
* @throws Exception
*/ | Creates and populates a new BillingService with a region and description | createBillingServiceWithDesc | {
"repo_name": "hexbinary/landing",
"path": "src/test/java/org/oscarehr/common/dao/BillingServiceDaoTest.java",
"license": "gpl-2.0",
"size": 34816
} | [
"java.util.Date",
"org.oscarehr.common.dao.utils.EntityDataGenerator",
"org.oscarehr.common.model.BillingService"
] | import java.util.Date; import org.oscarehr.common.dao.utils.EntityDataGenerator; import org.oscarehr.common.model.BillingService; | import java.util.*; import org.oscarehr.common.dao.utils.*; import org.oscarehr.common.model.*; | [
"java.util",
"org.oscarehr.common"
] | java.util; org.oscarehr.common; | 927,017 |
private int rateEndIndex(ArrayList<Integer> stream)
{
return stream.indexOf(Integer.valueOf(0xcc));
} | int function(ArrayList<Integer> stream) { return stream.indexOf(Integer.valueOf(0xcc)); } | /**
* return index of 0Xcc
*/ | return index of 0Xcc | rateEndIndex | {
"repo_name": "nesl/UniversalSensor",
"path": "linked-src/com/ucla/nesl/aidl/Device.java",
"license": "bsd-3-clause",
"size": 5015
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 382,973 |
public List<String> getTags()
{
return tags;
} | List<String> function() { return tags; } | /**
* The tags to filter by
*
* @return tags
*/ | The tags to filter by | getTags | {
"repo_name": "GrowthcraftCE/Growthcraft-1.11",
"path": "src/main/java/growthcraft/core/api/fluids/TaggedFluidStacks.java",
"license": "agpl-3.0",
"size": 3066
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,545,744 |
public static JsonNode json(AbstractShellCommand context, Iterable<Link> links) {
ObjectMapper mapper = new ObjectMapper();
ArrayNode result = mapper.createArrayNode();
links.forEach(link -> result.add(context.jsonForEntity(link, Link.class)));
return result;
} | static JsonNode function(AbstractShellCommand context, Iterable<Link> links) { ObjectMapper mapper = new ObjectMapper(); ArrayNode result = mapper.createArrayNode(); links.forEach(link -> result.add(context.jsonForEntity(link, Link.class))); return result; } | /**
* Produces a JSON array containing the specified links.
*
* @param context context to use for looking up codecs
* @param links collection of links
* @return JSON array
*/ | Produces a JSON array containing the specified links | json | {
"repo_name": "opennetworkinglab/onos",
"path": "cli/src/main/java/org/onosproject/cli/net/LinksListCommand.java",
"license": "apache-2.0",
"size": 4212
} | [
"com.fasterxml.jackson.databind.JsonNode",
"com.fasterxml.jackson.databind.ObjectMapper",
"com.fasterxml.jackson.databind.node.ArrayNode",
"org.onosproject.cli.AbstractShellCommand",
"org.onosproject.net.Link"
] | import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ArrayNode; import org.onosproject.cli.AbstractShellCommand; import org.onosproject.net.Link; | import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.node.*; import org.onosproject.cli.*; import org.onosproject.net.*; | [
"com.fasterxml.jackson",
"org.onosproject.cli",
"org.onosproject.net"
] | com.fasterxml.jackson; org.onosproject.cli; org.onosproject.net; | 2,277,270 |
protected String saveMediaToContent(MediaData mediaData) {
String mediaPath = getMediaPath(mediaData);
if (mediaData.getMedia() != null && ensureMediaPath(mediaPath)) {
log.debug("=====> Saving media: " + mediaPath);
pushAdvisor();
boolean newResource = true;
try {
contentHostingService.checkResource(mediaPath);
newResource = false;
} catch (Exception e) {
// Just a check, no handling
}
try {
ContentResource chsMedia = null;
if (newResource) {
ContentResourceEdit edit = contentHostingService.addResource(mediaPath);
edit.setContentType(mediaData.getMimeType());
edit.setContent(mediaData.getMedia());
ResourcePropertiesEdit props = edit.getPropertiesEdit();
props.addProperty(ResourceProperties.PROP_DISPLAY_NAME, mediaData.getFilename());
contentHostingService.commitResource(edit);
chsMedia = contentHostingService.getResource(mediaPath);
} else {
chsMedia = contentHostingService.updateResource(mediaPath, mediaData.getMimeType(), mediaData.getMedia());
}
// Free the byte array since it has been stored in content. Hold the new ContentResource
mediaData.setDbMedia(null);
mediaData.setContentResource(chsMedia);
return mediaPath;
} catch (Exception e) {
log.warn("Exception while saving media to content: " + e.toString());
} finally {
popAdvisor();
}
}
return null;
} | String function(MediaData mediaData) { String mediaPath = getMediaPath(mediaData); if (mediaData.getMedia() != null && ensureMediaPath(mediaPath)) { log.debug(STR + mediaPath); pushAdvisor(); boolean newResource = true; try { contentHostingService.checkResource(mediaPath); newResource = false; } catch (Exception e) { } try { ContentResource chsMedia = null; if (newResource) { ContentResourceEdit edit = contentHostingService.addResource(mediaPath); edit.setContentType(mediaData.getMimeType()); edit.setContent(mediaData.getMedia()); ResourcePropertiesEdit props = edit.getPropertiesEdit(); props.addProperty(ResourceProperties.PROP_DISPLAY_NAME, mediaData.getFilename()); contentHostingService.commitResource(edit); chsMedia = contentHostingService.getResource(mediaPath); } else { chsMedia = contentHostingService.updateResource(mediaPath, mediaData.getMimeType(), mediaData.getMedia()); } mediaData.setDbMedia(null); mediaData.setContentResource(chsMedia); return mediaPath; } catch (Exception e) { log.warn(STR + e.toString()); } finally { popAdvisor(); } } return null; } | /**
* Create or update a ContentResource for the media payload of this MediaData.
* @param mediaData the complete MediaData item to save if the media byte array is not null
* @return the ID in Content Hosting of the stored item; null on failure
*/ | Create or update a ContentResource for the media payload of this MediaData | saveMediaToContent | {
"repo_name": "clhedrick/sakai",
"path": "samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacadeQueries.java",
"license": "apache-2.0",
"size": 158496
} | [
"org.sakaiproject.content.api.ContentResource",
"org.sakaiproject.content.api.ContentResourceEdit",
"org.sakaiproject.entity.api.ResourceProperties",
"org.sakaiproject.entity.api.ResourcePropertiesEdit",
"org.sakaiproject.tool.assessment.data.dao.grading.MediaData"
] | import org.sakaiproject.content.api.ContentResource; import org.sakaiproject.content.api.ContentResourceEdit; import org.sakaiproject.entity.api.ResourceProperties; import org.sakaiproject.entity.api.ResourcePropertiesEdit; import org.sakaiproject.tool.assessment.data.dao.grading.MediaData; | import org.sakaiproject.content.api.*; import org.sakaiproject.entity.api.*; import org.sakaiproject.tool.assessment.data.dao.grading.*; | [
"org.sakaiproject.content",
"org.sakaiproject.entity",
"org.sakaiproject.tool"
] | org.sakaiproject.content; org.sakaiproject.entity; org.sakaiproject.tool; | 801,182 |
@Override
public String getEventType() {
return EventTypes.ADD_COMMENT_TO_ARTICLE;
}
| String function() { return EventTypes.ADD_COMMENT_TO_ARTICLE; } | /**
* Gets the event type {@linkplain EventTypes#ADD_COMMENT_TO_ARTICLE}.
*
* @return event type
*/ | Gets the event type EventTypes#ADD_COMMENT_TO_ARTICLE | getEventType | {
"repo_name": "446541492/solo",
"path": "src/main/java/org/b3log/solo/event/comment/ArticleCommentReplyNotifier.java",
"license": "apache-2.0",
"size": 7103
} | [
"org.b3log.solo.event.EventTypes"
] | import org.b3log.solo.event.EventTypes; | import org.b3log.solo.event.*; | [
"org.b3log.solo"
] | org.b3log.solo; | 530,657 |
public void disableProxyFolder (ProxyFolderBean theFolder) throws NullArgumentException {
if (theFolder == null)
throw new NullArgumentException("Can't disable a null Proxy-Folder");
theFolder.setEnabled(false);
} | void function (ProxyFolderBean theFolder) throws NullArgumentException { if (theFolder == null) throw new NullArgumentException(STR); theFolder.setEnabled(false); } | /**
* Diable the passed proxyFolder
*
* @param theFolder the proxy folder to remove
* @param context the context to inspect
* @throws IllegalArgumentException if the context doesn't exist
* @throws NullArgumentException if the argument is null
*/ | Diable the passed proxyFolder | disableProxyFolder | {
"repo_name": "dpoldrugo/proxyma",
"path": "proxyma-core/src/main/java/m/c/m/proxyma/ProxymaFacade.java",
"license": "lgpl-2.1",
"size": 9990
} | [
"org.apache.commons.lang.NullArgumentException"
] | import org.apache.commons.lang.NullArgumentException; | import org.apache.commons.lang.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,670,926 |
public boolean isWatched(Wallet wallet) {
try {
Script script = getScriptPubKey();
return wallet.isWatchedScript(script);
} catch (ScriptException e) {
// Just means we didn't understand the output of this transaction: ignore it.
log.debug("Could not parse tx output script: {}", e.toString());
return false;
}
} | boolean function(Wallet wallet) { try { Script script = getScriptPubKey(); return wallet.isWatchedScript(script); } catch (ScriptException e) { log.debug(STR, e.toString()); return false; } } | /**
* Returns true if this output is to a key, or an address we have the keys for, in the wallet.
*/ | Returns true if this output is to a key, or an address we have the keys for, in the wallet | isWatched | {
"repo_name": "hank/litecoinj-new",
"path": "core/src/main/java/com/google/litecoin/core/TransactionOutput.java",
"license": "apache-2.0",
"size": 14630
} | [
"com.google.litecoin.script.Script"
] | import com.google.litecoin.script.Script; | import com.google.litecoin.script.*; | [
"com.google.litecoin"
] | com.google.litecoin; | 981,468 |
public static Test suite() {
return new TestSuite(MarkerAxisBandTests.class);
}
public MarkerAxisBandTests(String name) {
super(name);
} | static Test function() { return new TestSuite(MarkerAxisBandTests.class); } public MarkerAxisBandTests(String name) { super(name); } | /**
* Returns the tests as a test suite.
*
* @return The test suite.
*/ | Returns the tests as a test suite | suite | {
"repo_name": "ilyessou/jfreechart",
"path": "tests/org/jfree/chart/axis/junit/MarkerAxisBandTests.java",
"license": "lgpl-2.1",
"size": 5163
} | [
"junit.framework.Test",
"junit.framework.TestSuite"
] | import junit.framework.Test; import junit.framework.TestSuite; | import junit.framework.*; | [
"junit.framework"
] | junit.framework; | 1,350,397 |
@ServiceMethod(returns = ReturnType.SINGLE)
public TableInner update(String resourceGroupName, String workspaceName, String tableName, TableInner parameters) {
return updateAsync(resourceGroupName, workspaceName, tableName, parameters).block();
} | @ServiceMethod(returns = ReturnType.SINGLE) TableInner function(String resourceGroupName, String workspaceName, String tableName, TableInner parameters) { return updateAsync(resourceGroupName, workspaceName, tableName, parameters).block(); } | /**
* Updates a Log Analytics workspace table properties.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param workspaceName The name of the workspace.
* @param tableName The name of the table.
* @param parameters The parameters required to update table properties.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return workspace data table definition.
*/ | Updates a Log Analytics workspace table properties | update | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TablesClientImpl.java",
"license": "mit",
"size": 30134
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.loganalytics.fluent.models.TableInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.loganalytics.fluent.models.TableInner; | import com.azure.core.annotation.*; import com.azure.resourcemanager.loganalytics.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 475,427 |
void updateFieldType(FieldType fieldType); | void updateFieldType(FieldType fieldType); | /**
* An API to update the fieldType object.
*
* @param fieldType FieldType
*/ | An API to update the fieldType object | updateFieldType | {
"repo_name": "kuzavas/ephesoft",
"path": "dcma-data-access/src/main/java/com/ephesoft/dcma/da/dao/FieldTypeDao.java",
"license": "agpl-3.0",
"size": 4543
} | [
"com.ephesoft.dcma.da.domain.FieldType"
] | import com.ephesoft.dcma.da.domain.FieldType; | import com.ephesoft.dcma.da.domain.*; | [
"com.ephesoft.dcma"
] | com.ephesoft.dcma; | 2,807,824 |
public boolean onOwnerChanged(GridCacheEntryEx entry, GridCacheMvccCandidate owner) {
// We only care about acquired locks.
if (owner != null) {
IgniteTxAdapter tx = tx(owner.version());
if (tx == null)
tx = nearTx(owner.version());
if (tx != null) {
if (!tx.local()) {
if (log.isDebugEnabled())
log.debug("Found transaction for owner changed event [owner=" + owner + ", entry=" + entry +
", tx=" + tx + ']');
tx.onOwnerChanged(entry, owner);
return true;
}
else if (log.isDebugEnabled())
log.debug("Ignoring local transaction for owner change event: " + tx);
}
else if (log.isDebugEnabled())
log.debug("Transaction not found for owner changed event [owner=" + owner + ", entry=" + entry + ']');
}
return false;
} | boolean function(GridCacheEntryEx entry, GridCacheMvccCandidate owner) { if (owner != null) { IgniteTxAdapter tx = tx(owner.version()); if (tx == null) tx = nearTx(owner.version()); if (tx != null) { if (!tx.local()) { if (log.isDebugEnabled()) log.debug(STR + owner + STR + entry + STR + tx + ']'); tx.onOwnerChanged(entry, owner); return true; } else if (log.isDebugEnabled()) log.debug(STR + tx); } else if (log.isDebugEnabled()) log.debug(STR + owner + STR + entry + ']'); } return false; } | /**
* Callback invoked whenever a member of a transaction acquires
* lock ownership.
*
* @param entry Cache entry.
* @param owner Candidate that won ownership.
* @return {@code True} if transaction was notified, {@code false} otherwise.
*/ | Callback invoked whenever a member of a transaction acquires lock ownership | onOwnerChanged | {
"repo_name": "shurun19851206/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java",
"license": "apache-2.0",
"size": 78538
} | [
"org.apache.ignite.internal.processors.cache.GridCacheEntryEx",
"org.apache.ignite.internal.processors.cache.GridCacheMvccCandidate"
] | import org.apache.ignite.internal.processors.cache.GridCacheEntryEx; import org.apache.ignite.internal.processors.cache.GridCacheMvccCandidate; | import org.apache.ignite.internal.processors.cache.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 2,132,996 |
public Object getAttribute(
final String name,
final Configuration modeConf,
final Map objectModel)
throws ConfigurationException {
Object result = null;
boolean hasBeenCached = false;
try {
if (this.m_cacheAll == true) {
hasBeenCached = m_cache.isKeyInCache(name);
if (hasBeenCached == true && m_cache.get(name)!=null) {
result = m_cache.get(name).getObjectValue();
if (getLogger().isDebugEnabled()) {
getLogger().debug("Locationmap cached location returned for hint: " + name + " value: " + result);
}
} else{
result = getFreshResult(name, objectModel);
}
}
if (hasBeenCached == false) {
result = getFreshResult(name, objectModel);
}
if (result == null) {
String msg = "Locationmap did not return a location for hint " + name;
getLogger().debug(msg);
}
return result;
}
catch (ConfigurationException e) {
throw e;
}
catch (Exception e) {
getLogger().error("Failure processing LocationMap.",e);
}
return null;
} | Object function( final String name, final Configuration modeConf, final Map objectModel) throws ConfigurationException { Object result = null; boolean hasBeenCached = false; try { if (this.m_cacheAll == true) { hasBeenCached = m_cache.isKeyInCache(name); if (hasBeenCached == true && m_cache.get(name)!=null) { result = m_cache.get(name).getObjectValue(); if (getLogger().isDebugEnabled()) { getLogger().debug(STR + name + STR + result); } } else{ result = getFreshResult(name, objectModel); } } if (hasBeenCached == false) { result = getFreshResult(name, objectModel); } if (result == null) { String msg = STR + name; getLogger().debug(msg); } return result; } catch (ConfigurationException e) { throw e; } catch (Exception e) { getLogger().error(STR,e); } return null; } | /**
* Execute the current request against the locationmap returning the
* resulting string.
*/ | Execute the current request against the locationmap returning the resulting string | getAttribute | {
"repo_name": "apache/forrest",
"path": "main/java/org/apache/forrest/locationmap/LocationMapModule.java",
"license": "apache-2.0",
"size": 10234
} | [
"java.util.Map",
"org.apache.avalon.framework.configuration.Configuration",
"org.apache.avalon.framework.configuration.ConfigurationException"
] | import java.util.Map; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; | import java.util.*; import org.apache.avalon.framework.configuration.*; | [
"java.util",
"org.apache.avalon"
] | java.util; org.apache.avalon; | 222,143 |
public PlayerID getRemoteOpponent(final INode localNode, final GameData data) {
// find a local player
PlayerID local = null;
for (final String player : m_playerMapping.keySet()) {
if (m_playerMapping.get(player).equals(localNode)) {
local = data.getPlayerList().getPlayerID(player);
break;
}
}
// we arent playing anyone, return any
if (local == null) {
final String remote = m_playerMapping.keySet().iterator().next();
return data.getPlayerList().getPlayerID(remote);
}
String any = null;
for (final String player : m_playerMapping.keySet()) {
if (!m_playerMapping.get(player).equals(localNode)) {
any = player;
final PlayerID remotePlayerID = data.getPlayerList().getPlayerID(player);
if (!data.getRelationshipTracker().isAllied(local, remotePlayerID)) {
return remotePlayerID;
}
}
}
// no un allied players were found, any will do
return data.getPlayerList().getPlayerID(any);
} | PlayerID function(final INode localNode, final GameData data) { PlayerID local = null; for (final String player : m_playerMapping.keySet()) { if (m_playerMapping.get(player).equals(localNode)) { local = data.getPlayerList().getPlayerID(player); break; } } if (local == null) { final String remote = m_playerMapping.keySet().iterator().next(); return data.getPlayerList().getPlayerID(remote); } String any = null; for (final String player : m_playerMapping.keySet()) { if (!m_playerMapping.get(player).equals(localNode)) { any = player; final PlayerID remotePlayerID = data.getPlayerList().getPlayerID(player); if (!data.getRelationshipTracker().isAllied(local, remotePlayerID)) { return remotePlayerID; } } } return data.getPlayerList().getPlayerID(any); } | /**
* Get a player from an opposing side, if possible, else
* get a player playing at a remote computer, if possible
*
* @param localNode
* local node
* @param data
* game data
* @return player found
*/ | Get a player from an opposing side, if possible, else get a player playing at a remote computer, if possible | getRemoteOpponent | {
"repo_name": "simon33-2/triplea",
"path": "src/games/strategy/engine/data/PlayerManager.java",
"license": "gpl-2.0",
"size": 3239
} | [
"games.strategy.net.INode"
] | import games.strategy.net.INode; | import games.strategy.net.*; | [
"games.strategy.net"
] | games.strategy.net; | 2,061,527 |
public static final boolean endsWithIgnoreCase(String str, String end) {
int strLength = str == null ? 0 : str.length();
int endLength = end == null ? 0 : end.length();
// return false if the string is smaller than the end.
if (endLength > strLength) return false;
// return false if any character of the end are
// not the same in lower case.
for (int i = 1; i <= endLength; i++) {
if (ScannerHelper.toLowerCase(end.charAt(endLength - i))
!= ScannerHelper.toLowerCase(str.charAt(strLength - i))) return false;
}
return true;
} | static final boolean function(String str, String end) { int strLength = str == null ? 0 : str.length(); int endLength = end == null ? 0 : end.length(); if (endLength > strLength) return false; for (int i = 1; i <= endLength; i++) { if (ScannerHelper.toLowerCase(end.charAt(endLength - i)) != ScannerHelper.toLowerCase(str.charAt(strLength - i))) return false; } return true; } | /**
* Returns true iff str.toLowerCase().endsWith(end.toLowerCase()) implementation is not creating
* extra strings.
*/ | Returns true iff str.toLowerCase().endsWith(end.toLowerCase()) implementation is not creating extra strings | endsWithIgnoreCase | {
"repo_name": "sleshchenko/che",
"path": "plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/util/Util.java",
"license": "epl-1.0",
"size": 112301
} | [
"org.eclipse.jdt.internal.compiler.parser.ScannerHelper"
] | import org.eclipse.jdt.internal.compiler.parser.ScannerHelper; | import org.eclipse.jdt.internal.compiler.parser.*; | [
"org.eclipse.jdt"
] | org.eclipse.jdt; | 2,098,828 |
@Test
public void testDelete() throws SQLException {
MetadataReferenceUtils.testDelete(geoPackage);
} | void function() throws SQLException { MetadataReferenceUtils.testDelete(geoPackage); } | /**
* Test deleting
*
* @throws SQLException
*/ | Test deleting | testDelete | {
"repo_name": "ngageoint/geopackage-java",
"path": "src/test/java/mil/nga/geopackage/extension/metadata/reference/MetadataReferenceCreateTest.java",
"license": "mit",
"size": 1165
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,505,816 |
private View createView(LayoutInflater inflater) {
//inflate rootView
//noinspection RedundantCast because in a dialog, we cant know the parent yet
final View rootView = inflater.inflate(R.layout.percentage_tracker_change_lesson_dialog, (ViewGroup) null);
//find all necessary views
mInfoView = (TextView) rootView.findViewById(R.id.infoTextView);
mFinishedAssignmentsPicker = (NumberPicker) rootView.findViewById(R.id.pickerMyVote);
mAvailableAssignmentsPicker = (NumberPicker) rootView.findViewById(R.id.pickerMaxVote);
mResultingPercentageView = (TextView) rootView.findViewById(R.id.subject_fragment_dialog_newentry_overall_percentage);
if (mIsOldLesson)
mOldData = mDataDb.getItem(mLessonId, mMetaId);
if (!mLiveUpdateResultingPercentage)
mResultingPercentageView.setVisibility(View.GONE);
else if (mIsOldLesson)
onPercentageUpdate(mOldData.finishedAssignments, mOldData.availableAssignments);
else
onPercentageUpdate(0, 0);
return rootView;
} | View function(LayoutInflater inflater) { final View rootView = inflater.inflate(R.layout.percentage_tracker_change_lesson_dialog, (ViewGroup) null); mInfoView = (TextView) rootView.findViewById(R.id.infoTextView); mFinishedAssignmentsPicker = (NumberPicker) rootView.findViewById(R.id.pickerMyVote); mAvailableAssignmentsPicker = (NumberPicker) rootView.findViewById(R.id.pickerMaxVote); mResultingPercentageView = (TextView) rootView.findViewById(R.id.subject_fragment_dialog_newentry_overall_percentage); if (mIsOldLesson) mOldData = mDataDb.getItem(mLessonId, mMetaId); if (!mLiveUpdateResultingPercentage) mResultingPercentageView.setVisibility(View.GONE); else if (mIsOldLesson) onPercentageUpdate(mOldData.finishedAssignments, mOldData.availableAssignments); else onPercentageUpdate(0, 0); return rootView; } | /**
* Called after onCreate
*/ | Called after onCreate | createView | {
"repo_name": "enra64/Votenote",
"path": "app/src/main/java/de/oerntec/votenote/percentage_tracker_fragment/AddLessonDialogFragment.java",
"license": "gpl-3.0",
"size": 16317
} | [
"android.view.LayoutInflater",
"android.view.View",
"android.view.ViewGroup",
"android.widget.NumberPicker",
"android.widget.TextView"
] | import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.NumberPicker; import android.widget.TextView; | import android.view.*; import android.widget.*; | [
"android.view",
"android.widget"
] | android.view; android.widget; | 148,164 |
public VpnSiteInner withProvisioningState(ProvisioningState provisioningState) {
this.provisioningState = provisioningState;
return this;
} | VpnSiteInner function(ProvisioningState provisioningState) { this.provisioningState = provisioningState; return this; } | /**
* Set the provisioning state of the VPN site resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'.
*
* @param provisioningState the provisioningState value to set
* @return the VpnSiteInner object itself.
*/ | Set the provisioning state of the VPN site resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' | withProvisioningState | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/network/v2019_07_01/implementation/VpnSiteInner.java",
"license": "mit",
"size": 8016
} | [
"com.microsoft.azure.management.network.v2019_07_01.ProvisioningState"
] | import com.microsoft.azure.management.network.v2019_07_01.ProvisioningState; | import com.microsoft.azure.management.network.v2019_07_01.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 1,151,468 |
Update withTemplate(String templateJson) throws IOException; | Update withTemplate(String templateJson) throws IOException; | /**
* Specifies the template as a JSON string.
*
* @param templateJson the JSON string
* @return the next stage of the deployment update
* @throws IOException exception thrown from serialization/deserialization
*/ | Specifies the template as a JSON string | withTemplate | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Deployment.java",
"license": "mit",
"size": 19995
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 557,824 |
protected BudgetCostShare createBudgetCostShare(FiscalYearSummary fiscalYearSummary) {
return new BudgetCostShare(fiscalYearSummary.getFiscalYear(), fiscalYearSummary.getCostShare(), new ScaleTwoDecimal(0.00), null, null);
} | BudgetCostShare function(FiscalYearSummary fiscalYearSummary) { return new BudgetCostShare(fiscalYearSummary.getFiscalYear(), fiscalYearSummary.getCostShare(), new ScaleTwoDecimal(0.00), null, null); } | /**
* This method is a factory for BudgetCostShares
* @param fiscalYearSummary The fiscal year summary data
* @return A BudgetCostShare
*/ | This method is a factory for BudgetCostShares | createBudgetCostShare | {
"repo_name": "rashikpolus/MIT_KC",
"path": "coeus-impl/src/main/java/org/kuali/coeus/common/budget/impl/distribution/BudgetDistributionServiceImpl.java",
"license": "agpl-3.0",
"size": 8182
} | [
"org.kuali.coeus.common.budget.framework.core.Budget",
"org.kuali.coeus.common.budget.framework.distribution.BudgetCostShare",
"org.kuali.coeus.sys.api.model.ScaleTwoDecimal"
] | import org.kuali.coeus.common.budget.framework.core.Budget; import org.kuali.coeus.common.budget.framework.distribution.BudgetCostShare; import org.kuali.coeus.sys.api.model.ScaleTwoDecimal; | import org.kuali.coeus.common.budget.framework.core.*; import org.kuali.coeus.common.budget.framework.distribution.*; import org.kuali.coeus.sys.api.model.*; | [
"org.kuali.coeus"
] | org.kuali.coeus; | 2,231,916 |
private int get32Bits(int offset) throws MetadataException
{
if (offset+1>=_data.length) {
throw new MetadataException("Attempt to read bytes from outside Jpeg segment data buffer");
}
return ((_data[offset] & 255) << 8) | (_data[offset + 1] & 255);
}
| int function(int offset) throws MetadataException { if (offset+1>=_data.length) { throw new MetadataException(STR); } return ((_data[offset] & 255) << 8) (_data[offset + 1] & 255); } | /**
* Returns an int calculated from two bytes of data at the specified offset (MSB, LSB).
* @param offset position within the data buffer to read first byte
* @return the 32 bit int value, between 0x0000 and 0xFFFF
*/ | Returns an int calculated from two bytes of data at the specified offset (MSB, LSB) | get32Bits | {
"repo_name": "ecologylab/BigSemanticsJava",
"path": "imageMetadataExtractor/src/com/drew/metadata/jpeg/JpegReader.java",
"license": "apache-2.0",
"size": 5491
} | [
"com.drew.metadata.MetadataException"
] | import com.drew.metadata.MetadataException; | import com.drew.metadata.*; | [
"com.drew.metadata"
] | com.drew.metadata; | 1,328,273 |
public ConstantField createConstantField(Class<?> container, String field, Constant annot)
throws ConstantException {
Class<?> type;
try {
type = container.getField(field).getType();
} catch (NoSuchFieldException e) {
throw new ConstantException("Cannot find constant " + annot.name()
+ " (" + container.getSimpleName() + "." + field + ")", e);
}
for (ConstantFieldProvider provider : providers) {
if (provider.canProvide(type))
return provider.getField(type, container, field, annot);
}
throw new ConstantException("No provider found for " + annot.name()
+ " of type " + type.getSimpleName());
} | ConstantField function(Class<?> container, String field, Constant annot) throws ConstantException { Class<?> type; try { type = container.getField(field).getType(); } catch (NoSuchFieldException e) { throw new ConstantException(STR + annot.name() + STR + container.getSimpleName() + "." + field + ")", e); } for (ConstantFieldProvider provider : providers) { if (provider.canProvide(type)) return provider.getField(type, container, field, annot); } throw new ConstantException(STR + annot.name() + STR + type.getSimpleName()); } | /**
* Tries to create a ConstantField from a raw field. Cycles through all the providers
* until one is found that can satisfy.
* <p/>
* @param container the class enclosing the field
* @param field the name of the field
* @param annot the Constant annotation to extract constraints from
* @return the constructed ConstantField
* @throws ConstantException when the field cannot be found, or no provider is found
*/ | Tries to create a ConstantField from a raw field. Cycles through all the providers until one is found that can satisfy. | createConstantField | {
"repo_name": "thorinii/lct",
"path": "src/main/java/me/lachlanap/lct/data/ConstantFieldFactory.java",
"license": "mit",
"size": 2087
} | [
"me.lachlanap.lct.Constant",
"me.lachlanap.lct.ConstantException",
"me.lachlanap.lct.spi.ConstantFieldProvider"
] | import me.lachlanap.lct.Constant; import me.lachlanap.lct.ConstantException; import me.lachlanap.lct.spi.ConstantFieldProvider; | import me.lachlanap.lct.*; import me.lachlanap.lct.spi.*; | [
"me.lachlanap.lct"
] | me.lachlanap.lct; | 418,421 |
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException
{
in.defaultReadObject();
this.data = new short[this.maxSize = this.size];
for (int i = 0; i < this.size; i++)
{
this.data[i] = in.readShort();
}
} | void function(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); this.data = new short[this.maxSize = this.size]; for (int i = 0; i < this.size; i++) { this.data[i] = in.readShort(); } } | /**
* Deserialize object.
*
* @param in
* Input stream.
* @throws IOException
* on IO error.
* @throws ClassNotFoundException
* on class not found.
*/ | Deserialize object | readObject | {
"repo_name": "rjeschke/neetutils-base",
"path": "src/main/java/com/github/rjeschke/neetutils/lists/ShortList.java",
"license": "apache-2.0",
"size": 9717
} | [
"java.io.IOException",
"java.io.ObjectInputStream"
] | import java.io.IOException; import java.io.ObjectInputStream; | import java.io.*; | [
"java.io"
] | java.io; | 2,682,152 |
public final static Chart createStockChart( )
{
ChartWithAxes cwaStock = ChartWithAxesImpl.create( );
// Title
cwaStock.getTitle( ).getLabel( ).getCaption( ).setValue( "Stock Chart" );//$NON-NLS-1$
TitleBlock tb = cwaStock.getTitle( );
tb.setBackground( GradientImpl.create( ColorDefinitionImpl.create( 0,
128,
0 ), ColorDefinitionImpl.create( 128, 0, 0 ), 0, false ) );
tb.getLabel( ).getCaption( ).setColor( ColorDefinitionImpl.WHITE( ) );
// Plot
cwaStock.getBlock( )
.setBackground( GradientImpl.create( ColorDefinitionImpl.create( 196,
196,
196 ),
ColorDefinitionImpl.WHITE( ),
90,
false ) );
cwaStock.getPlot( ).getClientArea( ).getInsets( ).set( 10, 10, 10, 10 );
// Legend
cwaStock.getLegend( ).setBackground( ColorDefinitionImpl.ORANGE( ) );
// X-Axis
Axis xAxisPrimary = ( (ChartWithAxesImpl) cwaStock ).getPrimaryBaseAxes( )[0];
xAxisPrimary.getTitle( ).getCaption( ).setValue( "X Axis" );//$NON-NLS-1$
xAxisPrimary.getTitle( )
.getCaption( )
.setColor( ColorDefinitionImpl.RED( ) );
xAxisPrimary.getTitle( ).getCaption( ).setValue( "Date" );//$NON-NLS-1$
xAxisPrimary.setTitlePosition( Position.ABOVE_LITERAL );
xAxisPrimary.getLabel( )
.getCaption( )
.setColor( ColorDefinitionImpl.RED( ) );
xAxisPrimary.getLabel( ).getCaption( ).getFont( ).setRotation( 65 );
xAxisPrimary.setLabelPosition( Position.ABOVE_LITERAL );
xAxisPrimary.setType( AxisType.DATE_TIME_LITERAL );
xAxisPrimary.getMajorGrid( ).setTickStyle( TickStyle.ABOVE_LITERAL );
xAxisPrimary.getMajorGrid( )
.getLineAttributes( )
.setColor( ColorDefinitionImpl.create( 255, 196, 196 ) );
xAxisPrimary.getMajorGrid( )
.getLineAttributes( )
.setStyle( LineStyle.DOTTED_LITERAL );
xAxisPrimary.getMajorGrid( ).getLineAttributes( ).setVisible( true );
xAxisPrimary.setCategoryAxis( true );
// Y-Axis (1)
Axis yAxisPrimary = ( (ChartWithAxesImpl) cwaStock ).getPrimaryOrthogonalAxis( xAxisPrimary );
yAxisPrimary.getLabel( ).getCaption( ).setValue( "Price Axis" );//$NON-NLS-1$
yAxisPrimary.getLabel( )
.getCaption( )
.setColor( ColorDefinitionImpl.BLUE( ) );
yAxisPrimary.setLabelPosition( Position.LEFT_LITERAL );
yAxisPrimary.getTitle( )
.getCaption( )
.setValue( "Microsoft ($ Stock Price)" );//$NON-NLS-1$
yAxisPrimary.getTitle( )
.getCaption( )
.setColor( ColorDefinitionImpl.BLUE( ) );
yAxisPrimary.setTitlePosition( Position.LEFT_LITERAL );
yAxisPrimary.getScale( ).setMin( NumberDataElementImpl.create( 24.5 ) );
yAxisPrimary.getScale( ).setMax( NumberDataElementImpl.create( 27.5 ) );
yAxisPrimary.getScale( ).setStep( 0.5 );
yAxisPrimary.getMajorGrid( )
.getLineAttributes( )
.setColor( ColorDefinitionImpl.create( 196, 196, 255 ) );
yAxisPrimary.getMajorGrid( )
.getLineAttributes( )
.setStyle( LineStyle.DOTTED_LITERAL );
yAxisPrimary.getMajorGrid( ).getLineAttributes( ).setVisible( true );
yAxisPrimary.getMajorGrid( ).setTickStyle( TickStyle.LEFT_LITERAL );
yAxisPrimary.setType( AxisType.LINEAR_LITERAL );
yAxisPrimary.getOrigin( ).setType( IntersectionType.MIN_LITERAL );
// Y-Axis (2)
Axis yAxisOverlay = AxisImpl.create( Axis.ORTHOGONAL );
yAxisOverlay.getLabel( )
.getCaption( )
.setColor( ColorDefinitionImpl.create( 0, 128, 0 ) );
yAxisOverlay.getLabel( ).getCaption( ).getFont( ).setRotation( -25 );
yAxisOverlay.setLabelPosition( Position.RIGHT_LITERAL );
yAxisOverlay.getTitle( ).getCaption( ).setValue( "Volume" );//$NON-NLS-1$
yAxisOverlay.getTitle( )
.getCaption( )
.setColor( ColorDefinitionImpl.GREEN( ).darker( ) );
yAxisOverlay.getTitle( ).getCaption( ).getFont( ).setRotation( 90 );
yAxisOverlay.getTitle( ).getCaption( ).getFont( ).setSize( 16 );
yAxisOverlay.getTitle( ).getCaption( ).getFont( ).setBold( true );
yAxisOverlay.getTitle( ).setVisible( true );
yAxisOverlay.setTitlePosition( Position.RIGHT_LITERAL );
yAxisOverlay.getLineAttributes( )
.setColor( ColorDefinitionImpl.create( 0, 128, 0 ) );
yAxisOverlay.setType( AxisType.LINEAR_LITERAL );
yAxisOverlay.setOrientation( Orientation.VERTICAL_LITERAL );
yAxisOverlay.getMajorGrid( )
.getLineAttributes( )
.setColor( ColorDefinitionImpl.create( 64, 196, 64 ) );
yAxisOverlay.getMajorGrid( )
.getLineAttributes( )
.setStyle( LineStyle.DOTTED_LITERAL );
yAxisOverlay.getMajorGrid( ).getLineAttributes( ).setVisible( true );
yAxisOverlay.getMajorGrid( ).setTickStyle( TickStyle.RIGHT_LITERAL );
yAxisOverlay.getOrigin( ).setType( IntersectionType.MAX_LITERAL );
yAxisOverlay.getScale( )
.setMax( NumberDataElementImpl.create( 180000000 ) );
yAxisOverlay.getScale( )
.setMin( NumberDataElementImpl.create( 20000000 ) );
xAxisPrimary.getAssociatedAxes( ).add( yAxisOverlay );
// Data Set
DateTimeDataSet dsDateValues = DateTimeDataSetImpl.create( new Calendar[]{
new CDateTime( 2004, 12, 27 ),
new CDateTime( 2004, 12, 23 ),
new CDateTime( 2004, 12, 22 ),
new CDateTime( 2004, 12, 21 ),
new CDateTime( 2004, 12, 20 ),
new CDateTime( 2004, 12, 17 ),
new CDateTime( 2004, 12, 16 ),
new CDateTime( 2004, 12, 15 )
} );
StockDataSet dsStockValues = StockDataSetImpl.create( new StockEntry[]{
new StockEntry( 27.01, 26.82, 27.10, 26.85 ),
new StockEntry( 26.87, 26.83, 27.15, 27.01 ),
new StockEntry( 26.84, 26.78, 27.15, 26.97 ),
new StockEntry( 27.00, 26.94, 27.17, 27.07 ),
new StockEntry( 27.01, 26.89, 27.15, 26.95 ),
new StockEntry( 27.00, 26.80, 27.32, 26.96 ),
new StockEntry( 27.15, 27.01, 27.28, 27.16 ),
new StockEntry( 27.22, 27.07, 27.40, 27.11 ),
} );
NumberDataSet dsStockVolume = NumberDataSetImpl.create( new double[]{
55958500,
65801900,
63651900,
94646096,
85552800,
126184400,
88997504,
106303904
} );
// X-Series
Series seBase = SeriesImpl.create( );
seBase.setDataSet( dsDateValues );
SeriesDefinition sdX = SeriesDefinitionImpl.create( );
sdX.getSeriesPalette( ).shift( -1 );
xAxisPrimary.getSeriesDefinitions( ).add( sdX );
sdX.getSeries( ).add( seBase );
// Y-Series
BarSeries bs = (BarSeries) BarSeriesImpl.create( );
bs.setRiserOutline( null );
bs.setDataSet( dsStockVolume );
StockSeries ss = (StockSeries) StockSeriesImpl.create( );
ss.setSeriesIdentifier( "Stock Price" );//$NON-NLS-1$
ss.getLineAttributes( ).setColor( ColorDefinitionImpl.BLUE( ) );
ss.setDataSet( dsStockValues );
SeriesDefinition sdY1 = SeriesDefinitionImpl.create( );
sdY1.getSeriesPalette( ).update( ColorDefinitionImpl.CYAN( ) );
yAxisPrimary.getSeriesDefinitions( ).add( sdY1 );
sdY1.getSeries( ).add( ss );
SeriesDefinition sdY2 = SeriesDefinitionImpl.create( );
sdY2.getSeriesPalette( ).update( ColorDefinitionImpl.GREEN( ) );
yAxisOverlay.getSeriesDefinitions( ).add( sdY2 );
sdY2.getSeries( ).add( bs );
return cwaStock;
} | final static Chart function( ) { ChartWithAxes cwaStock = ChartWithAxesImpl.create( ); cwaStock.getTitle( ).getLabel( ).getCaption( ).setValue( STR ); TitleBlock tb = cwaStock.getTitle( ); tb.setBackground( GradientImpl.create( ColorDefinitionImpl.create( 0, 128, 0 ), ColorDefinitionImpl.create( 128, 0, 0 ), 0, false ) ); tb.getLabel( ).getCaption( ).setColor( ColorDefinitionImpl.WHITE( ) ); cwaStock.getBlock( ) .setBackground( GradientImpl.create( ColorDefinitionImpl.create( 196, 196, 196 ), ColorDefinitionImpl.WHITE( ), 90, false ) ); cwaStock.getPlot( ).getClientArea( ).getInsets( ).set( 10, 10, 10, 10 ); cwaStock.getLegend( ).setBackground( ColorDefinitionImpl.ORANGE( ) ); Axis xAxisPrimary = ( (ChartWithAxesImpl) cwaStock ).getPrimaryBaseAxes( )[0]; xAxisPrimary.getTitle( ).getCaption( ).setValue( STR ); xAxisPrimary.getTitle( ) .getCaption( ) .setColor( ColorDefinitionImpl.RED( ) ); xAxisPrimary.getTitle( ).getCaption( ).setValue( "Date" ); xAxisPrimary.setTitlePosition( Position.ABOVE_LITERAL ); xAxisPrimary.getLabel( ) .getCaption( ) .setColor( ColorDefinitionImpl.RED( ) ); xAxisPrimary.getLabel( ).getCaption( ).getFont( ).setRotation( 65 ); xAxisPrimary.setLabelPosition( Position.ABOVE_LITERAL ); xAxisPrimary.setType( AxisType.DATE_TIME_LITERAL ); xAxisPrimary.getMajorGrid( ).setTickStyle( TickStyle.ABOVE_LITERAL ); xAxisPrimary.getMajorGrid( ) .getLineAttributes( ) .setColor( ColorDefinitionImpl.create( 255, 196, 196 ) ); xAxisPrimary.getMajorGrid( ) .getLineAttributes( ) .setStyle( LineStyle.DOTTED_LITERAL ); xAxisPrimary.getMajorGrid( ).getLineAttributes( ).setVisible( true ); xAxisPrimary.setCategoryAxis( true ); Axis yAxisPrimary = ( (ChartWithAxesImpl) cwaStock ).getPrimaryOrthogonalAxis( xAxisPrimary ); yAxisPrimary.getLabel( ).getCaption( ).setValue( STR ); yAxisPrimary.getLabel( ) .getCaption( ) .setColor( ColorDefinitionImpl.BLUE( ) ); yAxisPrimary.setLabelPosition( Position.LEFT_LITERAL ); yAxisPrimary.getTitle( ) .getCaption( ) .setValue( STR ); yAxisPrimary.getTitle( ) .getCaption( ) .setColor( ColorDefinitionImpl.BLUE( ) ); yAxisPrimary.setTitlePosition( Position.LEFT_LITERAL ); yAxisPrimary.getScale( ).setMin( NumberDataElementImpl.create( 24.5 ) ); yAxisPrimary.getScale( ).setMax( NumberDataElementImpl.create( 27.5 ) ); yAxisPrimary.getScale( ).setStep( 0.5 ); yAxisPrimary.getMajorGrid( ) .getLineAttributes( ) .setColor( ColorDefinitionImpl.create( 196, 196, 255 ) ); yAxisPrimary.getMajorGrid( ) .getLineAttributes( ) .setStyle( LineStyle.DOTTED_LITERAL ); yAxisPrimary.getMajorGrid( ).getLineAttributes( ).setVisible( true ); yAxisPrimary.getMajorGrid( ).setTickStyle( TickStyle.LEFT_LITERAL ); yAxisPrimary.setType( AxisType.LINEAR_LITERAL ); yAxisPrimary.getOrigin( ).setType( IntersectionType.MIN_LITERAL ); Axis yAxisOverlay = AxisImpl.create( Axis.ORTHOGONAL ); yAxisOverlay.getLabel( ) .getCaption( ) .setColor( ColorDefinitionImpl.create( 0, 128, 0 ) ); yAxisOverlay.getLabel( ).getCaption( ).getFont( ).setRotation( -25 ); yAxisOverlay.setLabelPosition( Position.RIGHT_LITERAL ); yAxisOverlay.getTitle( ).getCaption( ).setValue( STR ); yAxisOverlay.getTitle( ) .getCaption( ) .setColor( ColorDefinitionImpl.GREEN( ).darker( ) ); yAxisOverlay.getTitle( ).getCaption( ).getFont( ).setRotation( 90 ); yAxisOverlay.getTitle( ).getCaption( ).getFont( ).setSize( 16 ); yAxisOverlay.getTitle( ).getCaption( ).getFont( ).setBold( true ); yAxisOverlay.getTitle( ).setVisible( true ); yAxisOverlay.setTitlePosition( Position.RIGHT_LITERAL ); yAxisOverlay.getLineAttributes( ) .setColor( ColorDefinitionImpl.create( 0, 128, 0 ) ); yAxisOverlay.setType( AxisType.LINEAR_LITERAL ); yAxisOverlay.setOrientation( Orientation.VERTICAL_LITERAL ); yAxisOverlay.getMajorGrid( ) .getLineAttributes( ) .setColor( ColorDefinitionImpl.create( 64, 196, 64 ) ); yAxisOverlay.getMajorGrid( ) .getLineAttributes( ) .setStyle( LineStyle.DOTTED_LITERAL ); yAxisOverlay.getMajorGrid( ).getLineAttributes( ).setVisible( true ); yAxisOverlay.getMajorGrid( ).setTickStyle( TickStyle.RIGHT_LITERAL ); yAxisOverlay.getOrigin( ).setType( IntersectionType.MAX_LITERAL ); yAxisOverlay.getScale( ) .setMax( NumberDataElementImpl.create( 180000000 ) ); yAxisOverlay.getScale( ) .setMin( NumberDataElementImpl.create( 20000000 ) ); xAxisPrimary.getAssociatedAxes( ).add( yAxisOverlay ); DateTimeDataSet dsDateValues = DateTimeDataSetImpl.create( new Calendar[]{ new CDateTime( 2004, 12, 27 ), new CDateTime( 2004, 12, 23 ), new CDateTime( 2004, 12, 22 ), new CDateTime( 2004, 12, 21 ), new CDateTime( 2004, 12, 20 ), new CDateTime( 2004, 12, 17 ), new CDateTime( 2004, 12, 16 ), new CDateTime( 2004, 12, 15 ) } ); StockDataSet dsStockValues = StockDataSetImpl.create( new StockEntry[]{ new StockEntry( 27.01, 26.82, 27.10, 26.85 ), new StockEntry( 26.87, 26.83, 27.15, 27.01 ), new StockEntry( 26.84, 26.78, 27.15, 26.97 ), new StockEntry( 27.00, 26.94, 27.17, 27.07 ), new StockEntry( 27.01, 26.89, 27.15, 26.95 ), new StockEntry( 27.00, 26.80, 27.32, 26.96 ), new StockEntry( 27.15, 27.01, 27.28, 27.16 ), new StockEntry( 27.22, 27.07, 27.40, 27.11 ), } ); NumberDataSet dsStockVolume = NumberDataSetImpl.create( new double[]{ 55958500, 65801900, 63651900, 94646096, 85552800, 126184400, 88997504, 106303904 } ); Series seBase = SeriesImpl.create( ); seBase.setDataSet( dsDateValues ); SeriesDefinition sdX = SeriesDefinitionImpl.create( ); sdX.getSeriesPalette( ).shift( -1 ); xAxisPrimary.getSeriesDefinitions( ).add( sdX ); sdX.getSeries( ).add( seBase ); BarSeries bs = (BarSeries) BarSeriesImpl.create( ); bs.setRiserOutline( null ); bs.setDataSet( dsStockVolume ); StockSeries ss = (StockSeries) StockSeriesImpl.create( ); ss.setSeriesIdentifier( STR ); ss.getLineAttributes( ).setColor( ColorDefinitionImpl.BLUE( ) ); ss.setDataSet( dsStockValues ); SeriesDefinition sdY1 = SeriesDefinitionImpl.create( ); sdY1.getSeriesPalette( ).update( ColorDefinitionImpl.CYAN( ) ); yAxisPrimary.getSeriesDefinitions( ).add( sdY1 ); sdY1.getSeries( ).add( ss ); SeriesDefinition sdY2 = SeriesDefinitionImpl.create( ); sdY2.getSeriesPalette( ).update( ColorDefinitionImpl.GREEN( ) ); yAxisOverlay.getSeriesDefinitions( ).add( sdY2 ); sdY2.getSeries( ).add( bs ); return cwaStock; } | /**
* Creates a stock chart instance
*
* @return An instance of the simulated runtime chart model (containing
* filled datasets)
*/ | Creates a stock chart instance | createStockChart | {
"repo_name": "Charling-Huang/birt",
"path": "chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/api/viewer/PrimitiveCharts.java",
"license": "epl-1.0",
"size": 105013
} | [
"com.ibm.icu.util.Calendar",
"org.eclipse.birt.chart.extension.datafeed.StockEntry",
"org.eclipse.birt.chart.model.Chart",
"org.eclipse.birt.chart.model.ChartWithAxes",
"org.eclipse.birt.chart.model.attribute.AxisType",
"org.eclipse.birt.chart.model.attribute.IntersectionType",
"org.eclipse.birt.chart.model.attribute.LineStyle",
"org.eclipse.birt.chart.model.attribute.Orientation",
"org.eclipse.birt.chart.model.attribute.Position",
"org.eclipse.birt.chart.model.attribute.TickStyle",
"org.eclipse.birt.chart.model.attribute.impl.ColorDefinitionImpl",
"org.eclipse.birt.chart.model.attribute.impl.GradientImpl",
"org.eclipse.birt.chart.model.component.Axis",
"org.eclipse.birt.chart.model.component.Series",
"org.eclipse.birt.chart.model.component.impl.AxisImpl",
"org.eclipse.birt.chart.model.component.impl.SeriesImpl",
"org.eclipse.birt.chart.model.data.DateTimeDataSet",
"org.eclipse.birt.chart.model.data.NumberDataSet",
"org.eclipse.birt.chart.model.data.SeriesDefinition",
"org.eclipse.birt.chart.model.data.StockDataSet",
"org.eclipse.birt.chart.model.data.impl.DateTimeDataSetImpl",
"org.eclipse.birt.chart.model.data.impl.NumberDataElementImpl",
"org.eclipse.birt.chart.model.data.impl.NumberDataSetImpl",
"org.eclipse.birt.chart.model.data.impl.SeriesDefinitionImpl",
"org.eclipse.birt.chart.model.data.impl.StockDataSetImpl",
"org.eclipse.birt.chart.model.impl.ChartWithAxesImpl",
"org.eclipse.birt.chart.model.layout.TitleBlock",
"org.eclipse.birt.chart.model.type.BarSeries",
"org.eclipse.birt.chart.model.type.StockSeries",
"org.eclipse.birt.chart.model.type.impl.BarSeriesImpl",
"org.eclipse.birt.chart.model.type.impl.StockSeriesImpl",
"org.eclipse.birt.chart.util.CDateTime"
] | import com.ibm.icu.util.Calendar; import org.eclipse.birt.chart.extension.datafeed.StockEntry; import org.eclipse.birt.chart.model.Chart; import org.eclipse.birt.chart.model.ChartWithAxes; import org.eclipse.birt.chart.model.attribute.AxisType; import org.eclipse.birt.chart.model.attribute.IntersectionType; import org.eclipse.birt.chart.model.attribute.LineStyle; import org.eclipse.birt.chart.model.attribute.Orientation; import org.eclipse.birt.chart.model.attribute.Position; import org.eclipse.birt.chart.model.attribute.TickStyle; import org.eclipse.birt.chart.model.attribute.impl.ColorDefinitionImpl; import org.eclipse.birt.chart.model.attribute.impl.GradientImpl; import org.eclipse.birt.chart.model.component.Axis; import org.eclipse.birt.chart.model.component.Series; import org.eclipse.birt.chart.model.component.impl.AxisImpl; import org.eclipse.birt.chart.model.component.impl.SeriesImpl; import org.eclipse.birt.chart.model.data.DateTimeDataSet; import org.eclipse.birt.chart.model.data.NumberDataSet; import org.eclipse.birt.chart.model.data.SeriesDefinition; import org.eclipse.birt.chart.model.data.StockDataSet; import org.eclipse.birt.chart.model.data.impl.DateTimeDataSetImpl; import org.eclipse.birt.chart.model.data.impl.NumberDataElementImpl; import org.eclipse.birt.chart.model.data.impl.NumberDataSetImpl; import org.eclipse.birt.chart.model.data.impl.SeriesDefinitionImpl; import org.eclipse.birt.chart.model.data.impl.StockDataSetImpl; import org.eclipse.birt.chart.model.impl.ChartWithAxesImpl; import org.eclipse.birt.chart.model.layout.TitleBlock; import org.eclipse.birt.chart.model.type.BarSeries; import org.eclipse.birt.chart.model.type.StockSeries; import org.eclipse.birt.chart.model.type.impl.BarSeriesImpl; import org.eclipse.birt.chart.model.type.impl.StockSeriesImpl; import org.eclipse.birt.chart.util.CDateTime; | import com.ibm.icu.util.*; import org.eclipse.birt.chart.extension.datafeed.*; import org.eclipse.birt.chart.model.*; import org.eclipse.birt.chart.model.attribute.*; import org.eclipse.birt.chart.model.attribute.impl.*; import org.eclipse.birt.chart.model.component.*; import org.eclipse.birt.chart.model.component.impl.*; import org.eclipse.birt.chart.model.data.*; import org.eclipse.birt.chart.model.data.impl.*; import org.eclipse.birt.chart.model.impl.*; import org.eclipse.birt.chart.model.layout.*; import org.eclipse.birt.chart.model.type.*; import org.eclipse.birt.chart.model.type.impl.*; import org.eclipse.birt.chart.util.*; | [
"com.ibm.icu",
"org.eclipse.birt"
] | com.ibm.icu; org.eclipse.birt; | 745,951 |
private FileSpec getTempFileSpec() throws IOException {
return new FileSpec(FileLocalizer.getTemporaryPath(pigContext).toString(),
new FuncSpec(Utils.getTmpFileCompressorName(pigContext)));
} | FileSpec function() throws IOException { return new FileSpec(FileLocalizer.getTemporaryPath(pigContext).toString(), new FuncSpec(Utils.getTmpFileCompressorName(pigContext))); } | /**
* Returns a temporary DFS Path
* @return
* @throws IOException
*/ | Returns a temporary DFS Path | getTempFileSpec | {
"repo_name": "dongjiaqiang/pig",
"path": "src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MRCompiler.java",
"license": "apache-2.0",
"size": 123083
} | [
"java.io.IOException",
"org.apache.pig.FuncSpec",
"org.apache.pig.impl.io.FileLocalizer",
"org.apache.pig.impl.io.FileSpec",
"org.apache.pig.impl.util.Utils"
] | import java.io.IOException; import org.apache.pig.FuncSpec; import org.apache.pig.impl.io.FileLocalizer; import org.apache.pig.impl.io.FileSpec; import org.apache.pig.impl.util.Utils; | import java.io.*; import org.apache.pig.*; import org.apache.pig.impl.io.*; import org.apache.pig.impl.util.*; | [
"java.io",
"org.apache.pig"
] | java.io; org.apache.pig; | 45,734 |
private void openSocket() throws AccessorySensorException {
try {
// Open socket
mLocalServerSocket = new LocalServerSocket(mSocketName);
// Stop server listening thread if running
if (mServerThread != null) {
mServerThread.interrupt();
mServerThread = null;
} | void function() throws AccessorySensorException { try { mLocalServerSocket = new LocalServerSocket(mSocketName); if (mServerThread != null) { mServerThread.interrupt(); mServerThread = null; } | /**
* Create socket to be able to read sensor data
*/ | Create socket to be able to read sensor data | openSocket | {
"repo_name": "Ayrat-Salavatovich/Learn_Android_Programming",
"path": "Day 114/SmartWatchPlayer/src/com/sonyericsson/extras/liveware/extension/util/sensor/AccessorySensor.java",
"license": "unlicense",
"size": 11561
} | [
"android.net.LocalServerSocket"
] | import android.net.LocalServerSocket; | import android.net.*; | [
"android.net"
] | android.net; | 1,079,841 |
private void handleRegisterInstantiator(Message clientMessage, EventID eventId) {
String instantiatorClassName = null;
final boolean isDebugEnabled = logger.isDebugEnabled();
try {
int noOfParts = clientMessage.getNumberOfParts();
if (isDebugEnabled) {
logger.debug("{}: Received register instantiators message of parts {}", getName(),
noOfParts);
}
Assert.assertTrue((noOfParts - 1) % 3 == 0);
for (int i = 0; i < noOfParts - 1; i += 3) {
instantiatorClassName =
(String) CacheServerHelper.deserialize(clientMessage.getPart(i).getSerializedForm());
String instantiatedClassName = (String) CacheServerHelper
.deserialize(clientMessage.getPart(i + 1).getSerializedForm());
int id = clientMessage.getPart(i + 2).getInt();
InternalInstantiator.register(instantiatorClassName, instantiatedClassName, id, false,
eventId, null);
// distribute is false because we don't want to propagate this to servers recursively
}
// CALLBACK TESTING PURPOSE ONLY
if (PoolImpl.IS_INSTANTIATOR_CALLBACK) {
ClientServerObserver clientServerObserver = ClientServerObserverHolder.getInstance();
clientServerObserver.afterReceivingFromServer(eventId);
}
} catch (Exception e) {
if (isDebugEnabled) {
logger.debug("{}: Caught following exception while attempting to read Instantiator : {}",
this, instantiatorClassName, e);
}
}
} | void function(Message clientMessage, EventID eventId) { String instantiatorClassName = null; final boolean isDebugEnabled = logger.isDebugEnabled(); try { int noOfParts = clientMessage.getNumberOfParts(); if (isDebugEnabled) { logger.debug(STR, getName(), noOfParts); } Assert.assertTrue((noOfParts - 1) % 3 == 0); for (int i = 0; i < noOfParts - 1; i += 3) { instantiatorClassName = (String) CacheServerHelper.deserialize(clientMessage.getPart(i).getSerializedForm()); String instantiatedClassName = (String) CacheServerHelper .deserialize(clientMessage.getPart(i + 1).getSerializedForm()); int id = clientMessage.getPart(i + 2).getInt(); InternalInstantiator.register(instantiatorClassName, instantiatedClassName, id, false, eventId, null); } if (PoolImpl.IS_INSTANTIATOR_CALLBACK) { ClientServerObserver clientServerObserver = ClientServerObserverHolder.getInstance(); clientServerObserver.afterReceivingFromServer(eventId); } } catch (Exception e) { if (isDebugEnabled) { logger.debug(STR, this, instantiatorClassName, e); } } } | /**
* Register instantiators locally
*
* @param clientMessage message describing the new instantiators
* @param eventId eventId of the instantiators
*/ | Register instantiators locally | handleRegisterInstantiator | {
"repo_name": "smgoller/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java",
"license": "apache-2.0",
"size": 69756
} | [
"org.apache.geode.cache.client.internal.PoolImpl",
"org.apache.geode.internal.Assert",
"org.apache.geode.internal.InternalInstantiator",
"org.apache.geode.internal.cache.ClientServerObserver",
"org.apache.geode.internal.cache.ClientServerObserverHolder",
"org.apache.geode.internal.cache.EventID"
] | import org.apache.geode.cache.client.internal.PoolImpl; import org.apache.geode.internal.Assert; import org.apache.geode.internal.InternalInstantiator; import org.apache.geode.internal.cache.ClientServerObserver; import org.apache.geode.internal.cache.ClientServerObserverHolder; import org.apache.geode.internal.cache.EventID; | import org.apache.geode.cache.client.internal.*; import org.apache.geode.internal.*; import org.apache.geode.internal.cache.*; | [
"org.apache.geode"
] | org.apache.geode; | 759,809 |
@SuppressLint("NewApi")
public void start(@NonNull final OnStartListener listener) {
StartRecordTask task = new StartRecordTask();
mMediaRecorder = new MediaRecorder();
mMediaRecorder.setAudioEncodingBitRate(mMediaRecorderConfig.mAudioEncodingBitRate);
mMediaRecorder.setAudioChannels(mMediaRecorderConfig.mAudioChannels);
mMediaRecorder.setAudioSource(mMediaRecorderConfig.mAudioSource);
mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mMediaRecorder.setOutputFile(getTemporaryFileName());
mMediaRecorder.setAudioEncoder(mMediaRecorderConfig.mAudioEncoder);
task.execute(listener);
} | @SuppressLint(STR) void function(@NonNull final OnStartListener listener) { StartRecordTask task = new StartRecordTask(); mMediaRecorder = new MediaRecorder(); mMediaRecorder.setAudioEncodingBitRate(mMediaRecorderConfig.mAudioEncodingBitRate); mMediaRecorder.setAudioChannels(mMediaRecorderConfig.mAudioChannels); mMediaRecorder.setAudioSource(mMediaRecorderConfig.mAudioSource); mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); mMediaRecorder.setOutputFile(getTemporaryFileName()); mMediaRecorder.setAudioEncoder(mMediaRecorderConfig.mAudioEncoder); task.execute(listener); } | /**
* Continues an existing record or starts a new one.
*
* @param listener The listener instance.
*/ | Continues an existing record or starts a new one | start | {
"repo_name": "lassana/continuous-audiorecorder",
"path": "recorder/src/main/java/com/github/lassana/recorder/AudioRecorder.java",
"license": "bsd-2-clause",
"size": 10398
} | [
"android.annotation.SuppressLint",
"android.media.MediaRecorder",
"android.support.annotation.NonNull"
] | import android.annotation.SuppressLint; import android.media.MediaRecorder; import android.support.annotation.NonNull; | import android.annotation.*; import android.media.*; import android.support.annotation.*; | [
"android.annotation",
"android.media",
"android.support"
] | android.annotation; android.media; android.support; | 1,210,151 |
public void updateFilesAtCheckpointEnd(CheckpointStartCleanerState info)
throws DatabaseException {
fileSelector.updateFilesAtCheckpointEnd(info);
deleteSafeToDeleteFiles();
} | void function(CheckpointStartCleanerState info) throws DatabaseException { fileSelector.updateFilesAtCheckpointEnd(info); deleteSafeToDeleteFiles(); } | /**
* When a checkpoint is complete, update the files that were returned at
* the beginning of the checkpoint.
*/ | When a checkpoint is complete, update the files that were returned at the beginning of the checkpoint | updateFilesAtCheckpointEnd | {
"repo_name": "nologic/nabs",
"path": "client/trunk/shared/libraries/je-3.2.44/src/com/sleepycat/je/cleaner/Cleaner.java",
"license": "gpl-2.0",
"size": 54470
} | [
"com.sleepycat.je.DatabaseException",
"com.sleepycat.je.cleaner.FileSelector"
] | import com.sleepycat.je.DatabaseException; import com.sleepycat.je.cleaner.FileSelector; | import com.sleepycat.je.*; import com.sleepycat.je.cleaner.*; | [
"com.sleepycat.je"
] | com.sleepycat.je; | 2,696,710 |
@Test
public void testGetFailedDate() {
assertNull(statusReport.getFailedDate());
} | void function() { assertNull(statusReport.getFailedDate()); } | /**
* Test method for {@link org.apache.taverna.platform.report.StatusReport#getFailedDate()}.
*/ | Test method for <code>org.apache.taverna.platform.report.StatusReport#getFailedDate()</code> | testGetFailedDate | {
"repo_name": "apache/incubator-taverna-engine",
"path": "taverna-report-api/src/test/java/org/apache/taverna/platform/report/StatusReportTest.java",
"license": "apache-2.0",
"size": 7208
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,234,397 |
EList<PropertyType> getPropertyTypes(); | EList<PropertyType> getPropertyTypes(); | /**
* Returns the value of the '<em><b>Property Types</b></em>' containment reference list.
* The list contents are of type {@link com.odcgroup.page.metamodel.PropertyType}.
* It is bidirectional and its opposite is '{@link com.odcgroup.page.metamodel.PropertyType#getLibrary <em>Library</em>}'.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Property Types</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Property Types</em>' containment reference list.
* @see com.odcgroup.page.metamodel.MetaModelPackage#getWidgetLibrary_PropertyTypes()
* @see com.odcgroup.page.metamodel.PropertyType#getLibrary
* @model opposite="library" containment="true"
* @generated
*/ | Returns the value of the 'Property Types' containment reference list. The list contents are of type <code>com.odcgroup.page.metamodel.PropertyType</code>. It is bidirectional and its opposite is '<code>com.odcgroup.page.metamodel.PropertyType#getLibrary Library</code>'. If the meaning of the 'Property Types' containment reference list isn't clear, there really should be more of a description here... | getPropertyTypes | {
"repo_name": "debabratahazra/DS",
"path": "designstudio/components/page/core/com.odcgroup.page.metamodel/src/generated/java/com/odcgroup/page/metamodel/WidgetLibrary.java",
"license": "epl-1.0",
"size": 4664
} | [
"org.eclipse.emf.common.util.EList"
] | import org.eclipse.emf.common.util.EList; | import org.eclipse.emf.common.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,392,416 |
public Path getPackageDirectory() {
return packageDirectory;
} | Path function() { return packageDirectory; } | /**
* Returns the directory containing the package's BUILD file.
*/ | Returns the directory containing the package's BUILD file | getPackageDirectory | {
"repo_name": "perezd/bazel",
"path": "src/main/java/com/google/devtools/build/lib/packages/Package.java",
"license": "apache-2.0",
"size": 77406
} | [
"com.google.devtools.build.lib.vfs.Path"
] | import com.google.devtools.build.lib.vfs.Path; | import com.google.devtools.build.lib.vfs.*; | [
"com.google.devtools"
] | com.google.devtools; | 362,210 |
INodejsProcess execute(File baseDir, CompilerOptions options, List<String> filenames,
INodejsProcessListener listener) throws TypeScriptException;
| INodejsProcess execute(File baseDir, CompilerOptions options, List<String> filenames, INodejsProcessListener listener) throws TypeScriptException; | /**
* Execute 'tsc' command from the given directory.
*
* @param baseDir
* the directory where 'tsc' must be executed.
* @return
* @throws TypeScriptException
*/ | Execute 'tsc' command from the given directory | execute | {
"repo_name": "Springrbua/typescript.java",
"path": "core/ts.core/src/ts/cmd/tsc/ITypeScriptCompiler.java",
"license": "mit",
"size": 1183
} | [
"java.io.File",
"java.util.List"
] | import java.io.File; import java.util.List; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,051,425 |
public void backStep() {
currentStep--;
((CardLayout) getPnlSteps().getLayout()).previous(getPnlSteps());
disableButtons();
callBackListener();
} | void function() { currentStep--; ((CardLayout) getPnlSteps().getLayout()).previous(getPnlSteps()); disableButtons(); callBackListener(); } | /**
* Muestra el panel del paso anterior del asistente
*/ | Muestra el panel del paso anterior del asistente | backStep | {
"repo_name": "iCarto/siga",
"path": "libIverUtiles/src/com/iver/utiles/swing/wizard/Wizard.java",
"license": "gpl-3.0",
"size": 8797
} | [
"java.awt.CardLayout"
] | import java.awt.CardLayout; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,136,081 |
public void setConnection(Connection conn) {
m_con = conn;
} | void function(Connection conn) { m_con = conn; } | /**
* Sets a new internal connection to the database.<p>
*
* @param conn the connection to use
*/ | Sets a new internal connection to the database | setConnection | {
"repo_name": "ggiudetti/opencms-core",
"path": "src-setup/org/opencms/setup/CmsSetupDb.java",
"license": "lgpl-2.1",
"size": 27006
} | [
"java.sql.Connection"
] | import java.sql.Connection; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,908,569 |
@Override
public void setDigester(final Digester digester)
{
this.m__Digester = digester;
} | void function(final Digester digester) { this.m__Digester = digester; } | /**
* <p>Set the {@link org.apache.commons.digester.Digester} to allow the implementation to do logging,
* classloading based on the digester's classloader, etc.
*
* @param digester parent Digester object
*/ | Set the <code>org.apache.commons.digester.Digester</code> to allow the implementation to do logging, classloading based on the digester's classloader, etc | setDigester | {
"repo_name": "rydnr/queryj-rt",
"path": "queryj-templates-deprecated/src/test/java/cucumber/templates/xml/RefElementFactory.java",
"license": "gpl-2.0",
"size": 3151
} | [
"org.apache.commons.digester.Digester"
] | import org.apache.commons.digester.Digester; | import org.apache.commons.digester.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,467,079 |
EEnum getGapType(); | EEnum getGapType(); | /**
* Returns the meta object for enum '{@link guizmo.layout.GapType <em>Gap Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for enum '<em>Gap Type</em>'.
* @see guizmo.layout.GapType
* @generated
*/ | Returns the meta object for enum '<code>guizmo.layout.GapType Gap Type</code>'. | getGapType | {
"repo_name": "osanchezUM/guizmo",
"path": "src/guizmo/layout/LayoutPackage.java",
"license": "apache-2.0",
"size": 87190
} | [
"org.eclipse.emf.ecore.EEnum"
] | import org.eclipse.emf.ecore.EEnum; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 629,345 |
@Test
public void testParseCommandEmptyString() {
String[] result = PersoSim.parseCommand("");
assertEquals(result.length, 0);
}
| void function() { String[] result = PersoSim.parseCommand(""); assertEquals(result.length, 0); } | /**
* Positive test case: parse arguments from an empty String.
*/ | Positive test case: parse arguments from an empty String | testParseCommandEmptyString | {
"repo_name": "JulianKoch/de.persosim.simulator",
"path": "de.persosim.simulator.test/src/de/persosim/simulator/PersoSimTest.java",
"license": "gpl-3.0",
"size": 14022
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,353,159 |
private void addFooter(ScrollablePopupMenuItem footer) {
this.footer = footer;
this.footer.setEnabled(false);
add((Component)this.footer, BorderLayout.SOUTH);
} | void function(ScrollablePopupMenuItem footer) { this.footer = footer; this.footer.setEnabled(false); add((Component)this.footer, BorderLayout.SOUTH); } | /**
* Adds the footer item to this pop up menu.
*/ | Adds the footer item to this pop up menu | addFooter | {
"repo_name": "adufilie/flex-sdk",
"path": "modules/thirdparty/batik/sources/org/apache/flex/forks/batik/util/gui/DropDownComponent.java",
"license": "apache-2.0",
"size": 26275
} | [
"java.awt.BorderLayout",
"java.awt.Component"
] | import java.awt.BorderLayout; import java.awt.Component; | import java.awt.*; | [
"java.awt"
] | java.awt; | 589,330 |
public static Operator parse(Expression expression, MetaComplexEvent matchingMetaComplexEvent,
ExecutionPlanContext executionPlanContext,
List<VariableExpressionExecutor> variableExpressionExecutors,
Map<String, EventTable> eventTableMap,
int matchingStreamIndex, AbstractDefinition candidateDefinition, long withinTime,
String indexedAttribute, int indexedPosition) {
if (indexedAttribute == null) {
return HazelcastOperatorParser.parse(expression, matchingMetaComplexEvent, executionPlanContext,
variableExpressionExecutors, eventTableMap, matchingStreamIndex, candidateDefinition,
withinTime, indexedPosition);
}
if (expression instanceof Compare && ((Compare) expression).getOperator() == Compare.Operator.EQUAL) {
Compare compare = (Compare) expression;
if ((compare.getLeftExpression() instanceof Variable || compare.getLeftExpression() instanceof Constant) &&
(compare.getRightExpression() instanceof Variable ||
compare.getRightExpression() instanceof Constant)) {
boolean leftSideIndexed = false;
boolean rightSideIndexed = false;
if (isTableIndexVariable(matchingMetaComplexEvent, matchingStreamIndex, compare.getLeftExpression(),
candidateDefinition, indexedAttribute)) {
leftSideIndexed = true;
}
if (isTableIndexVariable(matchingMetaComplexEvent, matchingStreamIndex, compare.getRightExpression(),
candidateDefinition, indexedAttribute)) {
rightSideIndexed = true;
}
AbstractDefinition matchingStreamDefinition;
if (matchingMetaComplexEvent instanceof MetaStateEvent) {
matchingStreamDefinition = ((MetaStateEvent) matchingMetaComplexEvent)
.getMetaStreamEvent(matchingStreamIndex).getLastInputDefinition();
} else {
matchingStreamDefinition = ((MetaStreamEvent) matchingMetaComplexEvent).getLastInputDefinition();
}
if (leftSideIndexed && !rightSideIndexed) {
ExpressionExecutor expressionExecutor = ExpressionParser.parseExpression(compare.getRightExpression(),
matchingMetaComplexEvent, matchingStreamIndex, eventTableMap,
variableExpressionExecutors, executionPlanContext, false, 0);
return new HazelcastIndexedOperator(expressionExecutor, matchingStreamIndex, withinTime,
matchingStreamDefinition.getAttributeList().size(), indexedPosition);
} else if (!leftSideIndexed && rightSideIndexed) {
ExpressionExecutor expressionExecutor = ExpressionParser.parseExpression(compare.getLeftExpression(),
matchingMetaComplexEvent, matchingStreamIndex, eventTableMap,
variableExpressionExecutors, executionPlanContext, false, 0);
return new HazelcastIndexedOperator(expressionExecutor, matchingStreamIndex, withinTime,
matchingStreamDefinition.getAttributeList().size(), indexedPosition);
}
}
}
return HazelcastOperatorParser.parse(expression, matchingMetaComplexEvent, executionPlanContext,
variableExpressionExecutors, eventTableMap, matchingStreamIndex, candidateDefinition,
withinTime, indexedPosition);
} | static Operator function(Expression expression, MetaComplexEvent matchingMetaComplexEvent, ExecutionPlanContext executionPlanContext, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String, EventTable> eventTableMap, int matchingStreamIndex, AbstractDefinition candidateDefinition, long withinTime, String indexedAttribute, int indexedPosition) { if (indexedAttribute == null) { return HazelcastOperatorParser.parse(expression, matchingMetaComplexEvent, executionPlanContext, variableExpressionExecutors, eventTableMap, matchingStreamIndex, candidateDefinition, withinTime, indexedPosition); } if (expression instanceof Compare && ((Compare) expression).getOperator() == Compare.Operator.EQUAL) { Compare compare = (Compare) expression; if ((compare.getLeftExpression() instanceof Variable compare.getLeftExpression() instanceof Constant) && (compare.getRightExpression() instanceof Variable compare.getRightExpression() instanceof Constant)) { boolean leftSideIndexed = false; boolean rightSideIndexed = false; if (isTableIndexVariable(matchingMetaComplexEvent, matchingStreamIndex, compare.getLeftExpression(), candidateDefinition, indexedAttribute)) { leftSideIndexed = true; } if (isTableIndexVariable(matchingMetaComplexEvent, matchingStreamIndex, compare.getRightExpression(), candidateDefinition, indexedAttribute)) { rightSideIndexed = true; } AbstractDefinition matchingStreamDefinition; if (matchingMetaComplexEvent instanceof MetaStateEvent) { matchingStreamDefinition = ((MetaStateEvent) matchingMetaComplexEvent) .getMetaStreamEvent(matchingStreamIndex).getLastInputDefinition(); } else { matchingStreamDefinition = ((MetaStreamEvent) matchingMetaComplexEvent).getLastInputDefinition(); } if (leftSideIndexed && !rightSideIndexed) { ExpressionExecutor expressionExecutor = ExpressionParser.parseExpression(compare.getRightExpression(), matchingMetaComplexEvent, matchingStreamIndex, eventTableMap, variableExpressionExecutors, executionPlanContext, false, 0); return new HazelcastIndexedOperator(expressionExecutor, matchingStreamIndex, withinTime, matchingStreamDefinition.getAttributeList().size(), indexedPosition); } else if (!leftSideIndexed && rightSideIndexed) { ExpressionExecutor expressionExecutor = ExpressionParser.parseExpression(compare.getLeftExpression(), matchingMetaComplexEvent, matchingStreamIndex, eventTableMap, variableExpressionExecutors, executionPlanContext, false, 0); return new HazelcastIndexedOperator(expressionExecutor, matchingStreamIndex, withinTime, matchingStreamDefinition.getAttributeList().size(), indexedPosition); } } } return HazelcastOperatorParser.parse(expression, matchingMetaComplexEvent, executionPlanContext, variableExpressionExecutors, eventTableMap, matchingStreamIndex, candidateDefinition, withinTime, indexedPosition); } | /**
* Method that constructs the Operator for Indexed Hazelcast event table related operations.
*
* @param expression Expression.
* @param matchingMetaComplexEvent Meta information about ComplexEvent.
* @param executionPlanContext Execution plan context.
* @param variableExpressionExecutors Variable expression executors.
* @param eventTableMap Event table map.
* @param matchingStreamIndex Matching stream index.
* @param candidateDefinition candidate definition.
* @param withinTime Within time frame.
* @param indexedAttribute Indexed attribute.
* @param indexedPosition Indexed position.
* @return HazelcastIndexedOperator or a HazelcastOperator.
*/ | Method that constructs the Operator for Indexed Hazelcast event table related operations | parse | {
"repo_name": "rajeev3001/siddhi",
"path": "modules/siddhi-extensions/event-table/src/main/java/org/wso2/siddhi/extension/eventtable/hazelcast/HazelcastOperatorParser.java",
"license": "apache-2.0",
"size": 13500
} | [
"java.util.List",
"java.util.Map",
"org.wso2.siddhi.core.config.ExecutionPlanContext",
"org.wso2.siddhi.core.event.MetaComplexEvent",
"org.wso2.siddhi.core.event.state.MetaStateEvent",
"org.wso2.siddhi.core.event.stream.MetaStreamEvent",
"org.wso2.siddhi.core.executor.ExpressionExecutor",
"org.wso2.siddhi.core.executor.VariableExpressionExecutor",
"org.wso2.siddhi.core.table.EventTable",
"org.wso2.siddhi.core.util.collection.operator.Operator",
"org.wso2.siddhi.core.util.parser.ExpressionParser",
"org.wso2.siddhi.query.api.definition.AbstractDefinition",
"org.wso2.siddhi.query.api.expression.Expression",
"org.wso2.siddhi.query.api.expression.Variable",
"org.wso2.siddhi.query.api.expression.condition.Compare",
"org.wso2.siddhi.query.api.expression.constant.Constant"
] | import java.util.List; import java.util.Map; import org.wso2.siddhi.core.config.ExecutionPlanContext; import org.wso2.siddhi.core.event.MetaComplexEvent; import org.wso2.siddhi.core.event.state.MetaStateEvent; import org.wso2.siddhi.core.event.stream.MetaStreamEvent; import org.wso2.siddhi.core.executor.ExpressionExecutor; import org.wso2.siddhi.core.executor.VariableExpressionExecutor; import org.wso2.siddhi.core.table.EventTable; import org.wso2.siddhi.core.util.collection.operator.Operator; import org.wso2.siddhi.core.util.parser.ExpressionParser; import org.wso2.siddhi.query.api.definition.AbstractDefinition; import org.wso2.siddhi.query.api.expression.Expression; import org.wso2.siddhi.query.api.expression.Variable; import org.wso2.siddhi.query.api.expression.condition.Compare; import org.wso2.siddhi.query.api.expression.constant.Constant; | import java.util.*; import org.wso2.siddhi.core.config.*; import org.wso2.siddhi.core.event.*; import org.wso2.siddhi.core.event.state.*; import org.wso2.siddhi.core.event.stream.*; import org.wso2.siddhi.core.executor.*; import org.wso2.siddhi.core.table.*; import org.wso2.siddhi.core.util.collection.operator.*; import org.wso2.siddhi.core.util.parser.*; import org.wso2.siddhi.query.api.definition.*; import org.wso2.siddhi.query.api.expression.*; import org.wso2.siddhi.query.api.expression.condition.*; import org.wso2.siddhi.query.api.expression.constant.*; | [
"java.util",
"org.wso2.siddhi"
] | java.util; org.wso2.siddhi; | 2,739,233 |
private Connection openDbConnection() throws NamingException, SQLException
{
if (dataSource != null)
{
return dataSource.getConnection();
}
if (ctx == null)
{
ctx = new InitialContext();
}
dataSource = (DataSource) ctx.lookup(dataSourceName);
return dataSource.getConnection();
} | Connection function() throws NamingException, SQLException { if (dataSource != null) { return dataSource.getConnection(); } if (ctx == null) { ctx = new InitialContext(); } dataSource = (DataSource) ctx.lookup(dataSourceName); return dataSource.getConnection(); } | /**
* Gets connection to the datasource specified through the configuration
* parameters.
*
* @return connection
*/ | Gets connection to the datasource specified through the configuration parameters | openDbConnection | {
"repo_name": "zhiqinghuang/core",
"path": "src/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java",
"license": "gpl-3.0",
"size": 16352
} | [
"java.sql.Connection",
"java.sql.SQLException",
"javax.naming.InitialContext",
"javax.naming.NamingException",
"javax.sql.DataSource"
] | import java.sql.Connection; import java.sql.SQLException; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; | import java.sql.*; import javax.naming.*; import javax.sql.*; | [
"java.sql",
"javax.naming",
"javax.sql"
] | java.sql; javax.naming; javax.sql; | 448,443 |
public Column getLacpCurrentColumn() {
ColumnDescription columndesc = new ColumnDescription(
InterfaceColumn.LACPCURRENT
.columnName(),
"getLacpCurrentColumn",
VersionNum.VERSION330);
return (Column) super.getColumnHandler(columndesc);
}
| Column function() { ColumnDescription columndesc = new ColumnDescription( InterfaceColumn.LACPCURRENT .columnName(), STR, VersionNum.VERSION330); return (Column) super.getColumnHandler(columndesc); } | /**
* Get the Column entity which column name is "lacp_current" from the Row
* entity of attributes.
* @return the Column entity which column name is "lacp_current"
*/ | Get the Column entity which column name is "lacp_current" from the Row entity of attributes | getLacpCurrentColumn | {
"repo_name": "kuangrewawa/OnosFw",
"path": "ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/table/Interface.java",
"license": "apache-2.0",
"size": 51208
} | [
"org.onosproject.ovsdb.rfc.notation.Column",
"org.onosproject.ovsdb.rfc.tableservice.ColumnDescription"
] | import org.onosproject.ovsdb.rfc.notation.Column; import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription; | import org.onosproject.ovsdb.rfc.notation.*; import org.onosproject.ovsdb.rfc.tableservice.*; | [
"org.onosproject.ovsdb"
] | org.onosproject.ovsdb; | 820,601 |
public Value execute(Path path)
throws IOException {
ReadStream reader = path.openRead();
QuercusProgram program = QuercusParser.parse(_quercus, null, reader);
OutputStream os = _out;
WriteStream out;
if (os != null) {
OutputStreamStream s = new OutputStreamStream(os);
WriteStream ws = new WriteStream(s);
ws.setNewlineString("\n");
try {
ws.setEncoding("iso-8859-1");
} catch (Exception e) {
}
out = ws;
} else {
out = new WriteStream(StdoutStream.create());
}
QuercusPage page = new InterpretedPage(program);
Env env = new Env(_quercus, page, out, null, null);
Value value = NullValue.NULL;
try {
value = program.execute(env);
} catch (QuercusExitException e) {
}
out.flushBuffer();
out.free();
if (os != null) {
os.flush();
}
return value;
}
class OutputStreamStream extends StreamImpl {
OutputStream _out;
OutputStreamStream(OutputStream out) {
_out = out;
} | Value function(Path path) throws IOException { ReadStream reader = path.openRead(); QuercusProgram program = QuercusParser.parse(_quercus, null, reader); OutputStream os = _out; WriteStream out; if (os != null) { OutputStreamStream s = new OutputStreamStream(os); WriteStream ws = new WriteStream(s); ws.setNewlineString("\n"); try { ws.setEncoding(STR); } catch (Exception e) { } out = ws; } else { out = new WriteStream(StdoutStream.create()); } QuercusPage page = new InterpretedPage(program); Env env = new Env(_quercus, page, out, null, null); Value value = NullValue.NULL; try { value = program.execute(env); } catch (QuercusExitException e) { } out.flushBuffer(); out.free(); if (os != null) { os.flush(); } return value; } class OutputStreamStream extends StreamImpl { OutputStream _out; OutputStreamStream(OutputStream out) { _out = out; } | /**
* Executes the script.
*/ | Executes the script | execute | {
"repo_name": "CleverCloud/Quercus",
"path": "quercus/src/main/java/com/caucho/quercus/QuercusEngine.java",
"license": "gpl-2.0",
"size": 4352
} | [
"com.caucho.quercus.env.Env",
"com.caucho.quercus.env.NullValue",
"com.caucho.quercus.env.Value",
"com.caucho.quercus.page.InterpretedPage",
"com.caucho.quercus.page.QuercusPage",
"com.caucho.quercus.parser.QuercusParser",
"com.caucho.quercus.program.QuercusProgram",
"com.caucho.vfs.Path",
"com.caucho.vfs.ReadStream",
"com.caucho.vfs.StdoutStream",
"com.caucho.vfs.StreamImpl",
"com.caucho.vfs.WriteStream",
"java.io.IOException",
"java.io.OutputStream"
] | import com.caucho.quercus.env.Env; import com.caucho.quercus.env.NullValue; import com.caucho.quercus.env.Value; import com.caucho.quercus.page.InterpretedPage; import com.caucho.quercus.page.QuercusPage; import com.caucho.quercus.parser.QuercusParser; import com.caucho.quercus.program.QuercusProgram; import com.caucho.vfs.Path; import com.caucho.vfs.ReadStream; import com.caucho.vfs.StdoutStream; import com.caucho.vfs.StreamImpl; import com.caucho.vfs.WriteStream; import java.io.IOException; import java.io.OutputStream; | import com.caucho.quercus.env.*; import com.caucho.quercus.page.*; import com.caucho.quercus.parser.*; import com.caucho.quercus.program.*; import com.caucho.vfs.*; import java.io.*; | [
"com.caucho.quercus",
"com.caucho.vfs",
"java.io"
] | com.caucho.quercus; com.caucho.vfs; java.io; | 603,545 |
public static boolean isMatchingTail(final Path pathToSearch, String pathTail) {
return isMatchingTail(pathToSearch, new Path(pathTail));
} | static boolean function(final Path pathToSearch, String pathTail) { return isMatchingTail(pathToSearch, new Path(pathTail)); } | /**
* Compare path component of the Path URI; e.g. if hdfs://a/b/c and /a/b/c, it will compare the
* '/a/b/c' part. Does not consider schema; i.e. if schemas different but path or subpath matches,
* the two will equate.
* @param pathToSearch Path we will be trying to match.
* @param pathTail
* @return True if <code>pathTail</code> is tail on the path of <code>pathToSearch</code>
*/ | Compare path component of the Path URI; e.g. if hdfs://a/b/c and /a/b/c, it will compare the '/a/b/c' part. Does not consider schema; i.e. if schemas different but path or subpath matches, the two will equate | isMatchingTail | {
"repo_name": "mapr/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java",
"license": "apache-2.0",
"size": 70673
} | [
"org.apache.hadoop.fs.Path"
] | import org.apache.hadoop.fs.Path; | import org.apache.hadoop.fs.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 652,224 |
public static void SYSCS_EXPORT_TABLE(
String schemaName,
String tableName,
String fileName,
String columnDelimiter,
String characterDelimiter,
String codeset)
throws SQLException
{
//
// In case this routine is called directly by the application,
// authorization is performed by Export.exportTable().
//
Connection conn = getDefaultConn();
Export.exportTable(conn, schemaName , tableName , fileName ,
columnDelimiter , characterDelimiter, codeset);
//export finished successfully, issue a commit
conn.commit();
} | static void function( String schemaName, String tableName, String fileName, String columnDelimiter, String characterDelimiter, String codeset) throws SQLException { Connection conn = getDefaultConn(); Export.exportTable(conn, schemaName , tableName , fileName , columnDelimiter , characterDelimiter, codeset); conn.commit(); } | /**
* Export data from a table to given file.
* <p>
* Will be called by system procedure:
* SYSCS_EXPORT_TABLE(IN SCHEMANAME VARCHAR(128),
* IN TABLENAME VARCHAR(128), IN FILENAME VARCHAR(32672) ,
* IN COLUMNDELIMITER CHAR(1), IN CHARACTERDELIMITER CHAR(1) ,
* IN CODESET VARCHAR(128))
*
* @param schemaName Name of schema
* @param tableName Name of table
* @param fileName Where to dump the table contents
* @param columnDelimiter Column separator
* @param characterDelimiter Quote character
* @param codeset The encoding to use
*
* @exception SQLException if a database error occurs
**/ | Export data from a table to given file. Will be called by system procedure: SYSCS_EXPORT_TABLE(IN SCHEMANAME VARCHAR(128), IN TABLENAME VARCHAR(128), IN FILENAME VARCHAR(32672) , IN COLUMNDELIMITER CHAR(1), IN CHARACTERDELIMITER CHAR(1) , IN CODESET VARCHAR(128)) | SYSCS_EXPORT_TABLE | {
"repo_name": "apache/derby",
"path": "java/org.apache.derby.engine/org/apache/derby/catalog/SystemProcedures.java",
"license": "apache-2.0",
"size": 101496
} | [
"java.sql.Connection",
"java.sql.SQLException",
"org.apache.derby.impl.load.Export"
] | import java.sql.Connection; import java.sql.SQLException; import org.apache.derby.impl.load.Export; | import java.sql.*; import org.apache.derby.impl.load.*; | [
"java.sql",
"org.apache.derby"
] | java.sql; org.apache.derby; | 1,521,646 |
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
// Ensure that there's a camera activity to handle the intent
if (takePictureIntent.resolveActivity(activity.getPackageManager()) != null) {
// Create the File where the photo should go
File photoFile = null;
try {
photoFile = createImageFile();
} catch (IOException ex) {
Log.e(TAG, "IOException", ex);
}
// Continue only if the File was successfully created
if (photoFile != null) {
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT,
Uri.fromFile(photoFile));
activity.startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);
}
}
} | Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (takePictureIntent.resolveActivity(activity.getPackageManager()) != null) { File photoFile = null; try { photoFile = createImageFile(); } catch (IOException ex) { Log.e(TAG, STR, ex); } if (photoFile != null) { takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile)); activity.startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE); } } } | /**
* Starts a activity using the device's onboard camera app
*/ | Starts a activity using the device's onboard camera app | dispatchTakePictureIntent | {
"repo_name": "blumareks/2017devoxx",
"path": "SpeechToText/com/ibm/watson/developer_cloud/android/library/audio/CameraHelper.java",
"license": "gpl-3.0",
"size": 3588
} | [
"android.content.Intent",
"android.net.Uri",
"android.provider.MediaStore",
"android.util.Log",
"java.io.File",
"java.io.IOException"
] | import android.content.Intent; import android.net.Uri; import android.provider.MediaStore; import android.util.Log; import java.io.File; import java.io.IOException; | import android.content.*; import android.net.*; import android.provider.*; import android.util.*; import java.io.*; | [
"android.content",
"android.net",
"android.provider",
"android.util",
"java.io"
] | android.content; android.net; android.provider; android.util; java.io; | 1,445,069 |
@Test(groups = {"singleCluster"})
public void submitValidFeedPostGet() throws Exception {
ServiceResponse response = prism.getFeedHelper().submitEntity(feed);
AssertUtil.assertSucceeded(response);
response = prism.getFeedHelper().getEntityDefinition(feed);
AssertUtil.assertSucceeded(response);
response = prism.getFeedHelper().submitEntity(feed);
AssertUtil.assertSucceeded(response);
} | @Test(groups = {STR}) void function() throws Exception { ServiceResponse response = prism.getFeedHelper().submitEntity(feed); AssertUtil.assertSucceeded(response); response = prism.getFeedHelper().getEntityDefinition(feed); AssertUtil.assertSucceeded(response); response = prism.getFeedHelper().submitEntity(feed); AssertUtil.assertSucceeded(response); } | /**
* Submit feed. Get its definition. Try to submit it again. Should succeed.
*
* @throws Exception
*/ | Submit feed. Get its definition. Try to submit it again. Should succeed | submitValidFeedPostGet | {
"repo_name": "pisaychuk/falcon",
"path": "falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedSubmitTest.java",
"license": "apache-2.0",
"size": 5894
} | [
"org.apache.falcon.regression.core.response.ServiceResponse",
"org.apache.falcon.regression.core.util.AssertUtil",
"org.testng.annotations.Test"
] | import org.apache.falcon.regression.core.response.ServiceResponse; import org.apache.falcon.regression.core.util.AssertUtil; import org.testng.annotations.Test; | import org.apache.falcon.regression.core.response.*; import org.apache.falcon.regression.core.util.*; import org.testng.annotations.*; | [
"org.apache.falcon",
"org.testng.annotations"
] | org.apache.falcon; org.testng.annotations; | 2,406,159 |
void addMessage(TcpDiscoveryAbstractMessage msg) {
DebugLogger log = messageLogger(msg);
if ((msg instanceof TcpDiscoveryStatusCheckMessage ||
msg instanceof TcpDiscoveryJoinRequestMessage ||
msg instanceof TcpDiscoveryCustomEventMessage ||
msg instanceof TcpDiscoveryClientReconnectMessage) &&
queue.contains(msg)) {
if (log.isDebugEnabled())
log.debug("Ignoring duplicate message: " + msg);
return;
}
if (msg.highPriority())
queue.addFirst(msg);
else
queue.add(msg);
if (log.isDebugEnabled())
log.debug("Message has been added to queue: " + msg);
} | void addMessage(TcpDiscoveryAbstractMessage msg) { DebugLogger log = messageLogger(msg); if ((msg instanceof TcpDiscoveryStatusCheckMessage msg instanceof TcpDiscoveryJoinRequestMessage msg instanceof TcpDiscoveryCustomEventMessage msg instanceof TcpDiscoveryClientReconnectMessage) && queue.contains(msg)) { if (log.isDebugEnabled()) log.debug(STR + msg); return; } if (msg.highPriority()) queue.addFirst(msg); else queue.add(msg); if (log.isDebugEnabled()) log.debug(STR + msg); } | /**
* Adds message to queue.
*
* @param msg Message to add.
*/ | Adds message to queue | addMessage | {
"repo_name": "psadusumilli/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java",
"license": "apache-2.0",
"size": 268088
} | [
"org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryAbstractMessage",
"org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryClientReconnectMessage",
"org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryCustomEventMessage",
"org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryJoinRequestMessage",
"org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryStatusCheckMessage"
] | import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryAbstractMessage; import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryClientReconnectMessage; import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryCustomEventMessage; import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryJoinRequestMessage; import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryStatusCheckMessage; | import org.apache.ignite.spi.discovery.tcp.messages.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,595,914 |
private void establishRelationships() {
for (Object o : propertyMap.values()) {
DefaultGrailsDomainClassProperty currentProp = (DefaultGrailsDomainClassProperty) o;
if (!currentProp.isPersistent()) continue;
Class currentPropType = currentProp.getType();
// establish if the property is a one-to-many
// if it is a Set and there are relationships defined
// and it is defined as persistent
if (currentPropType != null) {
if (Collection.class.isAssignableFrom(currentPropType) || Map.class.isAssignableFrom(currentPropType)) {
establishRelationshipForCollection(currentProp);
}
// otherwise if the type is a domain class establish relationship
else if (DomainClassArtefactHandler.isDomainClass(currentPropType) &&
currentProp.isPersistent()) {
associations.add(currentProp);
establishDomainClassRelationship(currentProp);
}
else if (embedded.contains(currentProp.getName())) {
associations.add(currentProp);
establishDomainClassRelationship(currentProp);
}
}
}
} | void function() { for (Object o : propertyMap.values()) { DefaultGrailsDomainClassProperty currentProp = (DefaultGrailsDomainClassProperty) o; if (!currentProp.isPersistent()) continue; Class currentPropType = currentProp.getType(); if (currentPropType != null) { if (Collection.class.isAssignableFrom(currentPropType) Map.class.isAssignableFrom(currentPropType)) { establishRelationshipForCollection(currentProp); } else if (DomainClassArtefactHandler.isDomainClass(currentPropType) && currentProp.isPersistent()) { associations.add(currentProp); establishDomainClassRelationship(currentProp); } else if (embedded.contains(currentProp.getName())) { associations.add(currentProp); establishDomainClassRelationship(currentProp); } } } } | /**
* Calculates the relationship type based other types referenced
*/ | Calculates the relationship type based other types referenced | establishRelationships | {
"repo_name": "erdi/grails-core",
"path": "grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsDomainClass.java",
"license": "apache-2.0",
"size": 35419
} | [
"java.util.Collection",
"java.util.Map"
] | import java.util.Collection; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 599,435 |
final String query = "INSERT INTO testcasestepactioncontrolexecution(id, step, sequence, control, returncode, controltype, "
+ "controlproperty, controlvalue, fatal, start, END, startlong, endlong, returnmessage, test, testcase, screenshotfilename, pageSourceFilename)"
+ " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
Connection connection = this.databaseSpring.connect();
try {
PreparedStatement preStat = connection.prepareStatement(query);
try {
preStat.setLong(1, testCaseStepActionControlExecution.getId());
preStat.setInt(2, testCaseStepActionControlExecution.getStep());
preStat.setInt(3, testCaseStepActionControlExecution.getSequence());
preStat.setInt(4, testCaseStepActionControlExecution.getControl());
preStat.setString(5, ParameterParserUtil.parseStringParam(testCaseStepActionControlExecution.getReturnCode(), ""));
preStat.setString(6, StringUtil.getLeftString(testCaseStepActionControlExecution.getControlType(), 200));
preStat.setString(7, StringUtil.getLeftString(testCaseStepActionControlExecution.getControlProperty(), 2500));
preStat.setString(8, StringUtil.getLeftString(testCaseStepActionControlExecution.getControlValue(), 200));
preStat.setString(9, testCaseStepActionControlExecution.getFatal());
if (testCaseStepActionControlExecution.getStart() != 0) {
preStat.setTimestamp(10, new Timestamp(testCaseStepActionControlExecution.getStart()));
} else {
preStat.setString(10, "0000-00-00 00:00:00");
}
if (testCaseStepActionControlExecution.getEnd() != 0) {
preStat.setTimestamp(11, new Timestamp(testCaseStepActionControlExecution.getEnd()));
} else {
preStat.setString(11, "0000-00-00 00:00:00");
}
DateFormat df = new SimpleDateFormat(DateUtil.DATE_FORMAT_TIMESTAMP);
preStat.setString(12, df.format(testCaseStepActionControlExecution.getStart()));
preStat.setString(13, df.format(testCaseStepActionControlExecution.getEnd()));
preStat.setString(14, StringUtil.getLeftString(ParameterParserUtil.parseStringParam(testCaseStepActionControlExecution.getReturnMessage(), ""), 500));
preStat.setString(15, testCaseStepActionControlExecution.getTest());
preStat.setString(16, testCaseStepActionControlExecution.getTestCase());
preStat.setString(17, testCaseStepActionControlExecution.getScreenshotFilename());
preStat.setString(18, testCaseStepActionControlExecution.getPageSourceFilename());
preStat.executeUpdate();
} catch (SQLException exception) {
MyLogger.log(TestCaseStepActionControlExecutionDAO.class.getName(), Level.ERROR, "Unable to execute query : "+exception.toString());
} finally {
preStat.close();
}
} catch (SQLException exception) {
MyLogger.log(TestCaseStepActionControlExecutionDAO.class.getName(), Level.ERROR, "Unable to execute query : "+exception.toString());
} finally {
try {
if (connection != null) {
connection.close();
}
} catch (SQLException e) {
MyLogger.log(TestCaseStepActionControlDAO.class.getName(), Level.WARN, e.toString());
}
}
} | final String query = STR + STR + STR; Connection connection = this.databaseSpring.connect(); try { PreparedStatement preStat = connection.prepareStatement(query); try { preStat.setLong(1, testCaseStepActionControlExecution.getId()); preStat.setInt(2, testCaseStepActionControlExecution.getStep()); preStat.setInt(3, testCaseStepActionControlExecution.getSequence()); preStat.setInt(4, testCaseStepActionControlExecution.getControl()); preStat.setString(5, ParameterParserUtil.parseStringParam(testCaseStepActionControlExecution.getReturnCode(), STR0000-00-00 00:00:00STR0000-00-00 00:00:00STRSTRUnable to execute query : STRUnable to execute query : "+exception.toString()); } finally { try { if (connection != null) { connection.close(); } } catch (SQLException e) { MyLogger.log(TestCaseStepActionControlDAO.class.getName(), Level.WARN, e.toString()); } } } | /**
* Short one line description.
* <p/>
* Longer description. If there were any, it would be here. <p> And even
* more explanations to follow in consecutive paragraphs separated by HTML
* paragraph breaks.
*
* @param variable Description text text text.
*/ | Short one line description. Longer description. If there were any, it would be here. And even more explanations to follow in consecutive paragraphs separated by HTML paragraph breaks | insertTestCaseStepActionControlExecution | {
"repo_name": "afnogueira/Cerberus",
"path": "source/src/main/java/org/cerberus/dao/impl/TestCaseStepActionControlExecutionDAO.java",
"license": "gpl-3.0",
"size": 13837
} | [
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.SQLException",
"org.apache.log4j.Level",
"org.cerberus.log.MyLogger",
"org.cerberus.util.ParameterParserUtil"
] | import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import org.apache.log4j.Level; import org.cerberus.log.MyLogger; import org.cerberus.util.ParameterParserUtil; | import java.sql.*; import org.apache.log4j.*; import org.cerberus.log.*; import org.cerberus.util.*; | [
"java.sql",
"org.apache.log4j",
"org.cerberus.log",
"org.cerberus.util"
] | java.sql; org.apache.log4j; org.cerberus.log; org.cerberus.util; | 2,154,397 |
EReference getNameSpaceDefinition_NameSpace(); | EReference getNameSpaceDefinition_NameSpace(); | /**
* Returns the meta object for the containment reference '{@link org.xtext.example.delphi.astm.NameSpaceDefinition#getNameSpace <em>Name Space</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Name Space</em>'.
* @see org.xtext.example.delphi.astm.NameSpaceDefinition#getNameSpace()
* @see #getNameSpaceDefinition()
* @generated
*/ | Returns the meta object for the containment reference '<code>org.xtext.example.delphi.astm.NameSpaceDefinition#getNameSpace Name Space</code>'. | getNameSpaceDefinition_NameSpace | {
"repo_name": "adolfosbh/cs2as",
"path": "org.xtext.example.delphi/emf-gen/org/xtext/example/delphi/astm/AstmPackage.java",
"license": "epl-1.0",
"size": 670467
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,037,269 |
final Map<ExpectedLabels, Integer> map = new EnumMap<>(ExpectedLabels.class);
final List<ExpectedLabels> unusedLabels = new ArrayList<>(Arrays.asList(ExpectedLabels.values()));
for (int index = 0; index < labels.size(); index++) {
final String next = labels.get(index);
ExpectedLabels labelValue;
try {
labelValue = ExpectedLabels.valueOf(next);
unusedLabels.remove(labelValue);
if (map.containsKey(labelValue)) {
LOGGER.warn("Duplicate state label: {} ({})", next, labels);
}
map.put(labelValue, index);
} catch (final IllegalArgumentException e) {
LOGGER.warn("Unexpected state label: {}", next);
}
}
for (final ExpectedLabels label : unusedLabels) {
LOGGER.warn("Unused label: {}", label);
}
return map;
}
| final Map<ExpectedLabels, Integer> map = new EnumMap<>(ExpectedLabels.class); final List<ExpectedLabels> unusedLabels = new ArrayList<>(Arrays.asList(ExpectedLabels.values())); for (int index = 0; index < labels.size(); index++) { final String next = labels.get(index); ExpectedLabels labelValue; try { labelValue = ExpectedLabels.valueOf(next); unusedLabels.remove(labelValue); if (map.containsKey(labelValue)) { LOGGER.warn(STR, next, labels); } map.put(labelValue, index); } catch (final IllegalArgumentException e) { LOGGER.warn(STR, next); } } for (final ExpectedLabels label : unusedLabels) { LOGGER.warn(STR, label); } return map; } | /**
* Produces a mapping of label to index for use in parsing state values to the appropriate slot in the state object.
*/ | Produces a mapping of label to index for use in parsing state values to the appropriate slot in the state object | mapLabels | {
"repo_name": "smarcu/cubesensors-for-java",
"path": "src/main/java/com/w3asel/cubesensors/api/v1/json/StateParser.java",
"license": "mit",
"size": 3968
} | [
"java.util.ArrayList",
"java.util.Arrays",
"java.util.EnumMap",
"java.util.List",
"java.util.Map"
] | import java.util.ArrayList; import java.util.Arrays; import java.util.EnumMap; import java.util.List; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 510,180 |
public List<DocumentAttribute> resolveSearchableAttributeValues(Document document, WorkflowAttributes workflowAttributes) {
List<DocumentAttribute> valuesToIndex = new ArrayList<DocumentAttribute>();
if (workflowAttributes != null && workflowAttributes.getSearchingTypeDefinitions() != null) {
for (SearchingTypeDefinition definition : workflowAttributes.getSearchingTypeDefinitions()) {
valuesToIndex.addAll(aardvarkValuesForSearchingTypeDefinition(document, definition));
}
}
return valuesToIndex;
}
| List<DocumentAttribute> function(Document document, WorkflowAttributes workflowAttributes) { List<DocumentAttribute> valuesToIndex = new ArrayList<DocumentAttribute>(); if (workflowAttributes != null && workflowAttributes.getSearchingTypeDefinitions() != null) { for (SearchingTypeDefinition definition : workflowAttributes.getSearchingTypeDefinitions()) { valuesToIndex.addAll(aardvarkValuesForSearchingTypeDefinition(document, definition)); } } return valuesToIndex; } | /**
* Resolves all of the searching values to index for the given document, returning a list of SearchableAttributeValue implementations
*
*/ | Resolves all of the searching values to index for the given document, returning a list of SearchableAttributeValue implementations | resolveSearchableAttributeValues | {
"repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua",
"path": "rice-middleware/impl/src/main/java/org/kuali/rice/kns/workflow/service/impl/WorkflowAttributePropertyResolutionServiceImpl.java",
"license": "apache-2.0",
"size": 26456
} | [
"java.util.ArrayList",
"java.util.List",
"org.kuali.rice.kew.api.document.attribute.DocumentAttribute",
"org.kuali.rice.krad.datadictionary.SearchingTypeDefinition",
"org.kuali.rice.krad.datadictionary.WorkflowAttributes",
"org.kuali.rice.krad.document.Document"
] | import java.util.ArrayList; import java.util.List; import org.kuali.rice.kew.api.document.attribute.DocumentAttribute; import org.kuali.rice.krad.datadictionary.SearchingTypeDefinition; import org.kuali.rice.krad.datadictionary.WorkflowAttributes; import org.kuali.rice.krad.document.Document; | import java.util.*; import org.kuali.rice.kew.api.document.attribute.*; import org.kuali.rice.krad.datadictionary.*; import org.kuali.rice.krad.document.*; | [
"java.util",
"org.kuali.rice"
] | java.util; org.kuali.rice; | 1,892,982 |
public FeatureResultSet queryFeaturesForChunk(BoundingBox boundingBox,
String where, String orderBy, int limit, long offset) {
return queryFeaturesForChunk(false, boundingBox, where, orderBy, limit,
offset);
} | FeatureResultSet function(BoundingBox boundingBox, String where, String orderBy, int limit, long offset) { return queryFeaturesForChunk(false, boundingBox, where, orderBy, limit, offset); } | /**
* Query for features within the bounding box, starting at the offset and
* returning no more than the limit
*
* @param boundingBox
* bounding box
* @param where
* where clause
* @param orderBy
* order by
* @param limit
* chunk limit
* @param offset
* chunk query offset
* @return feature results
* @since 6.2.0
*/ | Query for features within the bounding box, starting at the offset and returning no more than the limit | queryFeaturesForChunk | {
"repo_name": "ngageoint/geopackage-java",
"path": "src/main/java/mil/nga/geopackage/extension/rtree/RTreeIndexTableDao.java",
"license": "mit",
"size": 349361
} | [
"mil.nga.geopackage.BoundingBox",
"mil.nga.geopackage.features.user.FeatureResultSet"
] | import mil.nga.geopackage.BoundingBox; import mil.nga.geopackage.features.user.FeatureResultSet; | import mil.nga.geopackage.*; import mil.nga.geopackage.features.user.*; | [
"mil.nga.geopackage"
] | mil.nga.geopackage; | 1,962,523 |
default Optional<Boolean> doesResetLocationService() {
return Optional.ofNullable(toSafeBoolean(getCapability(RESET_LOCATION_SERVICE_OPTION)));
} | default Optional<Boolean> doesResetLocationService() { return Optional.ofNullable(toSafeBoolean(getCapability(RESET_LOCATION_SERVICE_OPTION))); } | /**
* Get whether to reset the location service in the session deletion on real device.
*
* @return True or false.
*/ | Get whether to reset the location service in the session deletion on real device | doesResetLocationService | {
"repo_name": "appium/java-client",
"path": "src/main/java/io/appium/java_client/ios/options/general/SupportsResetLocationServiceOption.java",
"license": "apache-2.0",
"size": 2144
} | [
"java.util.Optional"
] | import java.util.Optional; | import java.util.*; | [
"java.util"
] | java.util; | 629,231 |
@JsonProperty("city")
public String getCity() {
return this.city;
} | @JsonProperty("city") String function() { return this.city; } | /**
* "city": "Saint-Denis"
*/ | "city": "Saint-Denis" | getCity | {
"repo_name": "dbadia/openhab",
"path": "bundles/binding/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/weather/GetStationsDataResponse.java",
"license": "epl-1.0",
"size": 23138
} | [
"org.codehaus.jackson.annotate.JsonProperty"
] | import org.codehaus.jackson.annotate.JsonProperty; | import org.codehaus.jackson.annotate.*; | [
"org.codehaus.jackson"
] | org.codehaus.jackson; | 2,237,666 |
public NamingException getException(); | NamingException function(); | /**
* Retrieves the exception as constructed using information
* sent by the server.
* @return A possibly null exception as constructed using information
* sent by the server. If null, a "success" status was indicated by
* the server.
*/ | Retrieves the exception as constructed using information sent by the server | getException | {
"repo_name": "andreagenso/java2scala",
"path": "test/J2s/java/openjdk-6-src-b27/jdk/src/share/classes/javax/naming/ldap/UnsolicitedNotification.java",
"license": "apache-2.0",
"size": 2471
} | [
"javax.naming.NamingException"
] | import javax.naming.NamingException; | import javax.naming.*; | [
"javax.naming"
] | javax.naming; | 2,484,376 |
public void setPastDue61_90 (BigDecimal PastDue61_90)
{
set_Value (COLUMNNAME_PastDue61_90, PastDue61_90);
} | void function (BigDecimal PastDue61_90) { set_Value (COLUMNNAME_PastDue61_90, PastDue61_90); } | /** Set Past Due 61-90.
@param PastDue61_90 Past Due 61-90 */ | Set Past Due 61-90 | setPastDue61_90 | {
"repo_name": "klst-com/metasfresh",
"path": "de.metas.adempiere.adempiere/base/src/main/java-gen/org/compiere/model/X_T_Aging.java",
"license": "gpl-2.0",
"size": 20737
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 1,560,233 |
public HRegionLocation relocateRegion(final byte [] tableName,
final byte [] row)
throws IOException; | HRegionLocation function(final byte [] tableName, final byte [] row) throws IOException; | /**
* Find the location of the region of <i>tableName</i> that <i>row</i>
* lives in, ignoring any value that might be in the cache.
* @param tableName name of the table <i>row</i> is in
* @param row row key you're trying to find the region of
* @return HRegionLocation that describes where to find the region in
* question
* @throws IOException if a remote or network exception occurs
*/ | Find the location of the region of tableName that row lives in, ignoring any value that might be in the cache | relocateRegion | {
"repo_name": "ddraj/hbase-trunk-mttr",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/client/HConnection.java",
"license": "apache-2.0",
"size": 15268
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.HRegionLocation"
] | import java.io.IOException; import org.apache.hadoop.hbase.HRegionLocation; | import java.io.*; import org.apache.hadoop.hbase.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 57,246 |
protected ImageDescriptor getImageDescriptor() {
if (getElement() == null) {
return null;
}
// IItemLabelProvider labelProvider = (IItemLabelProvider) myAdapterFactory.adapt(getElement(), IItemLabelProvider.class);
// if (labelProvider != null) {
// return ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(getElement()));
// }
return null;
} | ImageDescriptor function() { if (getElement() == null) { return null; } return null; } | /**
* Returns the image descriptor provided by the given adapter factory.
* Subclasses may override.
*/ | Returns the image descriptor provided by the given adapter factory. Subclasses may override | getImageDescriptor | {
"repo_name": "ghillairet/gmf-tooling-gwt-runtime",
"path": "org.eclipse.gmf.runtime.lite.gwt/src/org/eclipse/gmf/runtime/gwt/edit/parts/tree/BaseTreeEditPart.java",
"license": "epl-1.0",
"size": 10054
} | [
"org.eclipse.jface.resource.ImageDescriptor"
] | import org.eclipse.jface.resource.ImageDescriptor; | import org.eclipse.jface.resource.*; | [
"org.eclipse.jface"
] | org.eclipse.jface; | 835,611 |
public FilePath createTempDir(final String prefix, final String suffix) throws IOException, InterruptedException {
try {
String[] s;
if (StringUtils.isBlank(suffix)) {
s = new String[]{prefix, "tmp"}; // see File.createTempFile - tmp is used if suffix is null
} else {
s = new String[]{prefix, suffix};
}
String name = StringUtils.join(s, ".");
return new FilePath(this, act(new CreateTempDir(name)));
} catch (IOException e) {
throw new IOException("Failed to create a temp directory on "+remote,e);
}
}
private class CreateTempDir extends SecureFileCallable<String> {
private final String name;
CreateTempDir(String name) {
this.name = name;
} | FilePath function(final String prefix, final String suffix) throws IOException, InterruptedException { try { String[] s; if (StringUtils.isBlank(suffix)) { s = new String[]{prefix, "tmp"}; } else { s = new String[]{prefix, suffix}; } String name = StringUtils.join(s, "."); return new FilePath(this, act(new CreateTempDir(name))); } catch (IOException e) { throw new IOException(STR+remote,e); } } private class CreateTempDir extends SecureFileCallable<String> { private final String name; CreateTempDir(String name) { this.name = name; } | /**
* Creates a temporary directory inside the directory represented by 'this'
*
* @param prefix
* The prefix string to be used in generating the directory's name;
* must be at least three characters long
* @param suffix
* The suffix string to be used in generating the directory's name; may
* be null, in which case the suffix ".tmp" will be used
* @return
* The new FilePath pointing to the temporary directory
* @since 1.311
* @see Files#createTempDirectory(Path, String, FileAttribute[])
*/ | Creates a temporary directory inside the directory represented by 'this' | createTempDir | {
"repo_name": "batmat/jenkins",
"path": "core/src/main/java/hudson/FilePath.java",
"license": "mit",
"size": 132867
} | [
"java.io.IOException",
"org.apache.commons.lang.StringUtils"
] | import java.io.IOException; import org.apache.commons.lang.StringUtils; | import java.io.*; import org.apache.commons.lang.*; | [
"java.io",
"org.apache.commons"
] | java.io; org.apache.commons; | 558,599 |
public ForecastJobResponse forecastJob(ForecastJobRequest request, RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(request,
MLRequestConverters::forecastJob,
options,
ForecastJobResponse::fromXContent,
Collections.emptySet());
} | ForecastJobResponse function(ForecastJobRequest request, RequestOptions options) throws IOException { return restHighLevelClient.performRequestAndParseEntity(request, MLRequestConverters::forecastJob, options, ForecastJobResponse::fromXContent, Collections.emptySet()); } | /**
* Creates a forecast of an existing, opened Machine Learning Job
* This predicts the future behavior of a time series by using its historical behavior.
* <p>
* For additional info
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-forecast.html">Forecast ML Job Documentation</a>
*
* @param request ForecastJobRequest with forecasting options
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @return response containing forecast acknowledgement and new forecast's ID
* @throws IOException when there is a serialization issue sending the request or receiving the response
*/ | Creates a forecast of an existing, opened Machine Learning Job This predicts the future behavior of a time series by using its historical behavior. For additional info see Forecast ML Job Documentation | forecastJob | {
"repo_name": "uschindler/elasticsearch",
"path": "client/rest-high-level/src/main/java/org/elasticsearch/client/MachineLearningClient.java",
"license": "apache-2.0",
"size": 130429
} | [
"java.io.IOException",
"java.util.Collections",
"org.elasticsearch.client.ml.ForecastJobRequest",
"org.elasticsearch.client.ml.ForecastJobResponse"
] | import java.io.IOException; import java.util.Collections; import org.elasticsearch.client.ml.ForecastJobRequest; import org.elasticsearch.client.ml.ForecastJobResponse; | import java.io.*; import java.util.*; import org.elasticsearch.client.ml.*; | [
"java.io",
"java.util",
"org.elasticsearch.client"
] | java.io; java.util; org.elasticsearch.client; | 293,356 |
public Resource vm() {
return this.vm;
} | Resource function() { return this.vm; } | /**
* Get the vm property: Reference of the virtual machine resource.
*
* @return the vm value.
*/ | Get the vm property: Reference of the virtual machine resource | vm | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/BastionShareableLinkInner.java",
"license": "mit",
"size": 2901
} | [
"com.azure.core.management.Resource"
] | import com.azure.core.management.Resource; | import com.azure.core.management.*; | [
"com.azure.core"
] | com.azure.core; | 1,088,831 |
@Test
@UseDataProvider("streams")
public void testDecode(String normal, byte[] encoded) {
final byte[] decoded = new DeflateWrapper(encoded).decode();
final String result = new String(decoded, UTF_8);
assertEquals(normal, result);
} | @UseDataProvider(STR) void function(String normal, byte[] encoded) { final byte[] decoded = new DeflateWrapper(encoded).decode(); final String result = new String(decoded, UTF_8); assertEquals(normal, result); } | /**
* Decodes several streams and verify the results
*/ | Decodes several streams and verify the results | testDecode | {
"repo_name": "akapps/rest-toolkit",
"path": "src/test/java/org/akapps/rest/client/zip/DeflateWrapperTest.java",
"license": "mit",
"size": 3538
} | [
"com.tngtech.java.junit.dataprovider.UseDataProvider",
"org.junit.Assert"
] | import com.tngtech.java.junit.dataprovider.UseDataProvider; import org.junit.Assert; | import com.tngtech.java.junit.dataprovider.*; import org.junit.*; | [
"com.tngtech.java",
"org.junit"
] | com.tngtech.java; org.junit; | 2,640,108 |
public static Document getDocument(InputSource xml, InputStream xsd) throws Exception {
Document doc = null;
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
if (xsd != null) {
dbf.setNamespaceAware(true);
}
DocumentBuilder builder = dbf.newDocumentBuilder();
doc = builder.parse(xml);
if (xsd != null) {
validateXml(doc, xsd);
}
} catch (ParserConfigurationException e) {
throw e;
} catch (SAXException e) {
throw new Exception("XML_PARSE_ERROR", e);
} catch (IOException e) {
throw new Exception("XML_READ_ERROR", e);
} finally {
closeStream(xml.getByteStream());
}
return doc;
} | static Document function(InputSource xml, InputStream xsd) throws Exception { Document doc = null; try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); if (xsd != null) { dbf.setNamespaceAware(true); } DocumentBuilder builder = dbf.newDocumentBuilder(); doc = builder.parse(xml); if (xsd != null) { validateXml(doc, xsd); } } catch (ParserConfigurationException e) { throw e; } catch (SAXException e) { throw new Exception(STR, e); } catch (IOException e) { throw new Exception(STR, e); } finally { closeStream(xml.getByteStream()); } return doc; } | /**
* Parses the content of the given stream as an XML document.
*
* @param xml the XML file input stream
* @return the document instance representing the entire XML document
* @throws Exception problem parsing the XML input stream
*/ | Parses the content of the given stream as an XML document | getDocument | {
"repo_name": "13048694426/familiy-cook-menu",
"path": "src/com/example/familiycookmenu/utils/util/XmlUtils.java",
"license": "apache-2.0",
"size": 20616
} | [
"java.io.IOException",
"java.io.InputStream",
"javax.xml.parsers.DocumentBuilder",
"javax.xml.parsers.DocumentBuilderFactory",
"javax.xml.parsers.ParserConfigurationException",
"org.w3c.dom.Document",
"org.xml.sax.InputSource",
"org.xml.sax.SAXException"
] | import java.io.IOException; import java.io.InputStream; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.xml.sax.InputSource; import org.xml.sax.SAXException; | import java.io.*; import javax.xml.parsers.*; import org.w3c.dom.*; import org.xml.sax.*; | [
"java.io",
"javax.xml",
"org.w3c.dom",
"org.xml.sax"
] | java.io; javax.xml; org.w3c.dom; org.xml.sax; | 1,557,800 |
public Optional<HavingSegment> getHaving() {
return Optional.ofNullable(having);
} | Optional<HavingSegment> function() { return Optional.ofNullable(having); } | /**
* Get having segment.
*
* @return having segment
*/ | Get having segment | getHaving | {
"repo_name": "apache/incubator-shardingsphere",
"path": "shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/dml/SelectStatement.java",
"license": "apache-2.0",
"size": 3271
} | [
"java.util.Optional",
"org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.HavingSegment"
] | import java.util.Optional; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.HavingSegment; | import java.util.*; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.*; | [
"java.util",
"org.apache.shardingsphere"
] | java.util; org.apache.shardingsphere; | 2,044,218 |
public void Alterar(NoticiaEntity noticiaEntity){
this.entityManager.getTransaction().begin();
this.entityManager.merge(noticiaEntity);
this.entityManager.getTransaction().commit();
}
| void function(NoticiaEntity noticiaEntity){ this.entityManager.getTransaction().begin(); this.entityManager.merge(noticiaEntity); this.entityManager.getTransaction().commit(); } | /**
* ALTERA UM REGISTRO CADASTRADO
* */ | ALTERA UM REGISTRO CADASTRADO | Alterar | {
"repo_name": "robsonscooby/WebServiceRest",
"path": "src/main/java/br/com/celulasreligiosas/repository/NoticiaRepository.java",
"license": "apache-2.0",
"size": 1934
} | [
"br.com.celulasreligiosas.repository.entity.NoticiaEntity"
] | import br.com.celulasreligiosas.repository.entity.NoticiaEntity; | import br.com.celulasreligiosas.repository.entity.*; | [
"br.com.celulasreligiosas"
] | br.com.celulasreligiosas; | 1,490,720 |
String contactHashGenerator(KuorumUser user, String email); | String contactHashGenerator(KuorumUser user, String email); | /**
* Search for a contact and generate his hash
* @param user
* @param email
* @return
*/ | Search for a contact and generate his hash | contactHashGenerator | {
"repo_name": "Kuorum/kuorumServices",
"path": "serviceContact/src/main/java/org/kuorum/service/contact/ContactService.java",
"license": "gpl-3.0",
"size": 5589
} | [
"org.kuorum.provider.mongo.model.kuorumUser.KuorumUser"
] | import org.kuorum.provider.mongo.model.kuorumUser.KuorumUser; | import org.kuorum.provider.mongo.model.*; | [
"org.kuorum.provider"
] | org.kuorum.provider; | 1,479,279 |
public ims.core.vo.ActivitySchedVoCollection listActivitiesForType(ims.core.vo.lookups.ActivityType actType, CatsReferralRefVo catsReferral)
{
if(catsReferral == null)
return null;
DomainFactory factory = getDomainFactory();
List appointments = factory.find("select appts.id from CatsReferral as cats right join cats.appointments as appts where cats.id = :CatsReferralId", new String[] {"CatsReferralId"}, new Object[] {catsReferral.getID_CatsReferral()});
String query = null;
if(appointments == null || appointments.size() == 0)
{
query = "select act from Activity act where act.activityType = :actType and act.isActive = :isActive and (act.firstAppointment = 1 or act.diagnostic = 1) order by act.name asc";
}
else
{
query = "select act from Activity act where act.activityType = :actType and act.isActive = :isActive order by act.name asc";
}
if(query != null && query.length() > 0)
{
return ActivitySchedVoAssembler.createActivitySchedVoCollectionFromActivity(factory.find(query, new String[]{"actType", "isActive"}, new Object[]{getDomLookup(actType), Boolean.TRUE}));//WDEV-16073
}
return null;
} | ims.core.vo.ActivitySchedVoCollection function(ims.core.vo.lookups.ActivityType actType, CatsReferralRefVo catsReferral) { if(catsReferral == null) return null; DomainFactory factory = getDomainFactory(); List appointments = factory.find(STR, new String[] {STR}, new Object[] {catsReferral.getID_CatsReferral()}); String query = null; if(appointments == null appointments.size() == 0) { query = STR; } else { query = STR; } if(query != null && query.length() > 0) { return ActivitySchedVoAssembler.createActivitySchedVoCollectionFromActivity(factory.find(query, new String[]{STR, STR}, new Object[]{getDomLookup(actType), Boolean.TRUE})); } return null; } | /**
* list activities for ActivityType
*/ | list activities for ActivityType | listActivitiesForType | {
"repo_name": "open-health-hub/openMAXIMS",
"path": "openmaxims_workspace/RefMan/src/ims/RefMan/domain/impl/BookAppointmentImpl.java",
"license": "agpl-3.0",
"size": 82928
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,270,764 |
BinaryStarReactorBuilder buildBinaryStarReactor(); | BinaryStarReactorBuilder buildBinaryStarReactor(); | /**
* Create a new BinaryStarReactor, which will create one half of an HA-pair
* with event-driven polling of a client Socket.
*
* @return A builder for constructing a BinaryStarReactor
*/ | Create a new BinaryStarReactor, which will create one half of an HA-pair with event-driven polling of a client Socket | buildBinaryStarReactor | {
"repo_name": "zeromq/jzmq-api",
"path": "src/main/java/org/zeromq/api/Context.java",
"license": "lgpl-3.0",
"size": 6195
} | [
"org.zeromq.jzmq.bstar.BinaryStarReactorBuilder"
] | import org.zeromq.jzmq.bstar.BinaryStarReactorBuilder; | import org.zeromq.jzmq.bstar.*; | [
"org.zeromq.jzmq"
] | org.zeromq.jzmq; | 562,491 |
@Override
public synchronized CompletableFuture<Void> disconnect() {
CompletableFuture<Void> disconnectFuture = new CompletableFuture<>();
// block any further consumers on this subscription
IS_FENCED_UPDATER.set(this, TRUE);
(dispatcher != null ? dispatcher.close() : CompletableFuture.completedFuture(null))
.thenCompose(v -> close()).thenRun(() -> {
log.info("[{}][{}] Successfully disconnected and closed subscription", topicName, subName);
disconnectFuture.complete(null);
}).exceptionally(exception -> {
IS_FENCED_UPDATER.set(this, FALSE);
dispatcher.reset();
log.error("[{}][{}] Error disconnecting consumers from subscription", topicName, subName,
exception);
disconnectFuture.completeExceptionally(exception);
return null;
});
return disconnectFuture;
} | synchronized CompletableFuture<Void> function() { CompletableFuture<Void> disconnectFuture = new CompletableFuture<>(); IS_FENCED_UPDATER.set(this, TRUE); (dispatcher != null ? dispatcher.close() : CompletableFuture.completedFuture(null)) .thenCompose(v -> close()).thenRun(() -> { log.info(STR, topicName, subName); disconnectFuture.complete(null); }).exceptionally(exception -> { IS_FENCED_UPDATER.set(this, FALSE); dispatcher.reset(); log.error(STR, topicName, subName, exception); disconnectFuture.completeExceptionally(exception); return null; }); return disconnectFuture; } | /**
* Disconnect all consumers attached to the dispatcher and close this subscription
*
* @return CompletableFuture indicating the completion of disconnect operation
*/ | Disconnect all consumers attached to the dispatcher and close this subscription | disconnect | {
"repo_name": "saandrews/pulsar",
"path": "pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java",
"license": "apache-2.0",
"size": 29028
} | [
"java.util.concurrent.CompletableFuture"
] | import java.util.concurrent.CompletableFuture; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,185,448 |
@Override
public String generateReport(List<ReportEntity> reportEntities, String fileName) {
if(!CollectionUtils.isEmpty(reportEntities)) {
DataDumpSuccessReport dataDumpSuccessReport = new DataDumpSuccessReport();
List<DataDumpSuccessReport> dataDumpSuccessReportList = new ArrayList<>();
for (ReportEntity reportEntity : reportEntities) {
DataDumpSuccessReport dataDumpSuccessReport1 = new DataDumpSuccessReportGenerator().prepareDataDumpCSVSuccessRecord(reportEntity);
dataDumpSuccessReportList.add(dataDumpSuccessReport1);
}
ReportEntity reportEntity = reportEntities.get(0);
dataDumpSuccessReport.setReportType(reportEntity.getType());
dataDumpSuccessReport.setInstitutionName(reportEntity.getInstitutionName());
dataDumpSuccessReport.setFileName(fileName);
dataDumpSuccessReport.setDataDumpSuccessReportList(dataDumpSuccessReportList);
producerTemplate.sendBody(RecapConstants.DATADUMP_SUCCESS_REPORT_CSV_Q, dataDumpSuccessReport);
DateFormat df = new SimpleDateFormat(RecapConstants.DATE_FORMAT_FOR_FILE_NAME);
return FilenameUtils.removeExtension(dataDumpSuccessReport.getFileName()) + "-" + dataDumpSuccessReport.getReportType() + "-" + df.format(new Date()) + ".csv";
}
return null;
} | String function(List<ReportEntity> reportEntities, String fileName) { if(!CollectionUtils.isEmpty(reportEntities)) { DataDumpSuccessReport dataDumpSuccessReport = new DataDumpSuccessReport(); List<DataDumpSuccessReport> dataDumpSuccessReportList = new ArrayList<>(); for (ReportEntity reportEntity : reportEntities) { DataDumpSuccessReport dataDumpSuccessReport1 = new DataDumpSuccessReportGenerator().prepareDataDumpCSVSuccessRecord(reportEntity); dataDumpSuccessReportList.add(dataDumpSuccessReport1); } ReportEntity reportEntity = reportEntities.get(0); dataDumpSuccessReport.setReportType(reportEntity.getType()); dataDumpSuccessReport.setInstitutionName(reportEntity.getInstitutionName()); dataDumpSuccessReport.setFileName(fileName); dataDumpSuccessReport.setDataDumpSuccessReportList(dataDumpSuccessReportList); producerTemplate.sendBody(RecapConstants.DATADUMP_SUCCESS_REPORT_CSV_Q, dataDumpSuccessReport); DateFormat df = new SimpleDateFormat(RecapConstants.DATE_FORMAT_FOR_FILE_NAME); return FilenameUtils.removeExtension(dataDumpSuccessReport.getFileName()) + "-" + dataDumpSuccessReport.getReportType() + "-" + df.format(new Date()) + ".csv"; } return null; } | /**
* Generates CSV report with success records for data dump.
*
* @param reportEntities the report entities
* @param fileName the file name
* @return the file name
*/ | Generates CSV report with success records for data dump | generateReport | {
"repo_name": "premkumarbalu/scsb-etl",
"path": "src/main/java/org/recap/report/CSVDataDumpSuccessReportGenerator.java",
"license": "apache-2.0",
"size": 3363
} | [
"java.text.DateFormat",
"java.text.SimpleDateFormat",
"java.util.ArrayList",
"java.util.Date",
"java.util.List",
"org.apache.commons.io.FilenameUtils",
"org.recap.RecapConstants",
"org.recap.model.csv.DataDumpSuccessReport",
"org.recap.model.jpa.ReportEntity",
"org.recap.util.datadump.DataDumpSuccessReportGenerator",
"org.springframework.util.CollectionUtils"
] | import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.apache.commons.io.FilenameUtils; import org.recap.RecapConstants; import org.recap.model.csv.DataDumpSuccessReport; import org.recap.model.jpa.ReportEntity; import org.recap.util.datadump.DataDumpSuccessReportGenerator; import org.springframework.util.CollectionUtils; | import java.text.*; import java.util.*; import org.apache.commons.io.*; import org.recap.*; import org.recap.model.csv.*; import org.recap.model.jpa.*; import org.recap.util.datadump.*; import org.springframework.util.*; | [
"java.text",
"java.util",
"org.apache.commons",
"org.recap",
"org.recap.model",
"org.recap.util",
"org.springframework.util"
] | java.text; java.util; org.apache.commons; org.recap; org.recap.model; org.recap.util; org.springframework.util; | 191,611 |
private void generateEmptySwatches() {
if (mVibrantSwatch == null) {
// If we do not have a vibrant color...
if (mDarkVibrantSwatch != null) {
// ...but we do have a dark vibrant, generate the value by modifying the luma
final float[] newHsl = copyHslValues(mDarkVibrantSwatch);
newHsl[2] = TARGET_NORMAL_LUMA;
mVibrantSwatch = new Swatch(ColorUtils.HSLToColor(newHsl), 0);
}
}
if (mDarkVibrantSwatch == null) {
// If we do not have a dark vibrant color...
if (mVibrantSwatch != null) {
// ...but we do have a vibrant, generate the value by modifying the luma
final float[] newHsl = copyHslValues(mVibrantSwatch);
newHsl[2] = TARGET_DARK_LUMA;
mDarkVibrantSwatch = new Swatch(ColorUtils.HSLToColor(newHsl), 0);
}
}
} | void function() { if (mVibrantSwatch == null) { if (mDarkVibrantSwatch != null) { final float[] newHsl = copyHslValues(mDarkVibrantSwatch); newHsl[2] = TARGET_NORMAL_LUMA; mVibrantSwatch = new Swatch(ColorUtils.HSLToColor(newHsl), 0); } } if (mDarkVibrantSwatch == null) { if (mVibrantSwatch != null) { final float[] newHsl = copyHslValues(mVibrantSwatch); newHsl[2] = TARGET_DARK_LUMA; mDarkVibrantSwatch = new Swatch(ColorUtils.HSLToColor(newHsl), 0); } } } | /**
* Try and generate any missing swatches from the swatches we did find.
*/ | Try and generate any missing swatches from the swatches we did find | generateEmptySwatches | {
"repo_name": "billy1380/palette-gwt",
"path": "src/main/java/com/willshex/palette/shared/DefaultGenerator.java",
"license": "apache-2.0",
"size": 8392
} | [
"com.willshex.palette.shared.Palette"
] | import com.willshex.palette.shared.Palette; | import com.willshex.palette.shared.*; | [
"com.willshex.palette"
] | com.willshex.palette; | 2,108,833 |
public com.google.pubsub.v1.Topic updateTopic(com.google.pubsub.v1.UpdateTopicRequest request) {
return blockingUnaryCall(
getChannel(), getUpdateTopicMethodHelper(), getCallOptions(), request);
} | com.google.pubsub.v1.Topic function(com.google.pubsub.v1.UpdateTopicRequest request) { return blockingUnaryCall( getChannel(), getUpdateTopicMethodHelper(), getCallOptions(), request); } | /**
* <pre>
* Updates an existing topic. Note that certain properties of a topic are not
* modifiable. Options settings follow the style guide:
* NOTE: The style guide requires body: "topic" instead of body: "*".
* Keeping the latter for internal consistency in V1, however it should be
* corrected in V2. See
* https://cloud.google.com/apis/design/standard_methods#update for details.
* </pre>
*/ | <code> Updates an existing topic. Note that certain properties of a topic are not modifiable. Options settings follow the style guide: Keeping the latter for internal consistency in V1, however it should be corrected in V2. See HREF for details. </code> | updateTopic | {
"repo_name": "pongad/api-client-staging",
"path": "generated/java/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublisherGrpc.java",
"license": "bsd-3-clause",
"size": 40538
} | [
"io.grpc.stub.ClientCalls"
] | import io.grpc.stub.ClientCalls; | import io.grpc.stub.*; | [
"io.grpc.stub"
] | io.grpc.stub; | 2,767,595 |
public void setViewport(int x, int y, int width, int height) {
viewport = new Rectangle(x, y, width, height);
} | void function(int x, int y, int width, int height) { viewport = new Rectangle(x, y, width, height); } | /**
* Permite especificar el viewport de la camara.
*
* @param x
* Coordenada x del origen del viewport.
* @param y
* Coordenada y del origen del viewport.
* @param width
* Ancho del viewport.
* @param height
* Alto del viewport.
*/ | Permite especificar el viewport de la camara | setViewport | {
"repo_name": "unaguil/nu3a",
"path": "src/nu3a/camera/N3CameraData.java",
"license": "gpl-3.0",
"size": 10178
} | [
"java.awt.Rectangle"
] | import java.awt.Rectangle; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,101,178 |
private static String getJavadocComment( final String javaClassContent, final AbstractJavaEntity entity )
throws IOException
{
if ( entity.getComment() == null )
{
return "";
}
String originalJavadoc = extractOriginalJavadocContent( javaClassContent, entity );
StringBuilder sb = new StringBuilder();
BufferedReader lr = new BufferedReader( new StringReader( originalJavadoc ) );
String line;
while ( ( line = lr.readLine() ) != null )
{
String l = StringUtils.removeDuplicateWhitespace( line.trim() );
if ( l.startsWith( "* @" ) || l.startsWith( "*@" ) )
{
break;
}
sb.append( line ).append( EOL );
}
return trimRight( sb.toString() );
} | static String function( final String javaClassContent, final AbstractJavaEntity entity ) throws IOException { if ( entity.getComment() == null ) { return STR* @STR*@" ) ) { break; } sb.append( line ).append( EOL ); } return trimRight( sb.toString() ); } | /**
* Workaround for QDOX-146 about whitespace.
* Ideally we want to use <code>entity.getComment()</code>
* <br/>
* For instance, with the following snippet:
* <br/>
* <p/>
* <code>
* <font color="#808080">1</font> <font color="#ffffff"></font><br />
* <font color="#808080">2</font> <font color="#ffffff"> </font>
* <font color="#3f5fbf">/**</font><br />
* <font color="#808080">3</font> <font color="#ffffff"> </font>
* <font color="#3f5fbf">* Dummy Javadoc comment.</font><br />
* <font color="#808080">4</font> <font color="#ffffff"> </font>
* <font color="#3f5fbf">* </font><font color="#7f9fbf">@param </font>
* <font color="#3f5fbf">s a String</font><br />
* <font color="#808080">5</font> <font color="#ffffff"> </font>
* <font color="#3f5fbf">*/</font><br />
* <font color="#808080">6</font> <font color="#ffffff"> </font>
* <font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>void </b></font>
* <font color="#000000">dummyMethod</font><font color="#000000">( </font>
* <font color="#000000">String s </font><font color="#000000">){}</font><br />
* </code>
* <p/>
* <br/>
* The return will be:
* <br/>
* <p/>
* <code>
* <font color="#808080">1</font> <font color="#ffffff"> </font>
* <font color="#3f5fbf">* Dummy Javadoc comment.</font><br />
* </code>
*
* @param javaClassContent original class content not null
* @param entity not null
* @return the javadoc comment for the entity without any tags.
* @throws IOException if any
*/ | Workaround for QDOX-146 about whitespace. Ideally we want to use <code>entity.getComment()</code> For instance, with the following snippet: <code> 1 2 /** 3 * Dummy Javadoc comment. 4 * @param s a String 5 */ 6 public void dummyMethod( String s ){} </code> The return will be: <code> 1 * Dummy Javadoc comment. </code> | getJavadocComment | {
"repo_name": "lennartj/maven-plugins",
"path": "maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractFixJavadocMojo.java",
"license": "apache-2.0",
"size": 129817
} | [
"com.thoughtworks.qdox.model.AbstractJavaEntity",
"java.io.IOException"
] | import com.thoughtworks.qdox.model.AbstractJavaEntity; import java.io.IOException; | import com.thoughtworks.qdox.model.*; import java.io.*; | [
"com.thoughtworks.qdox",
"java.io"
] | com.thoughtworks.qdox; java.io; | 647,761 |
private void readConfiguration(String configFilename) {
File configFile = new File(CONFIG_DIR, configFilename);
ObjectMapper mapper = new ObjectMapper();
try {
log.info("Loading config: {}", configFile.getAbsolutePath());
VbngConfiguration config = mapper.readValue(configFile,
VbngConfiguration.class);
for (IpPrefix prefix : config.getLocalPublicIpPrefixes()) {
localPublicIpPrefixes.put(prefix, true);
}
nextHopIpAddress = config.getNextHopIpAddress();
macOfPublicIpAddresses = config.getPublicFacingMac();
xosIpAddress = config.getXosIpAddress();
xosRestPort = config.getXosRestPort();
nodeToPort = config.getHosts();
} catch (FileNotFoundException e) {
log.warn("Configuration file not found: {}", configFileName);
} catch (IOException e) {
log.error("Error loading configuration", e);
}
} | void function(String configFilename) { File configFile = new File(CONFIG_DIR, configFilename); ObjectMapper mapper = new ObjectMapper(); try { log.info(STR, configFile.getAbsolutePath()); VbngConfiguration config = mapper.readValue(configFile, VbngConfiguration.class); for (IpPrefix prefix : config.getLocalPublicIpPrefixes()) { localPublicIpPrefixes.put(prefix, true); } nextHopIpAddress = config.getNextHopIpAddress(); macOfPublicIpAddresses = config.getPublicFacingMac(); xosIpAddress = config.getXosIpAddress(); xosRestPort = config.getXosRestPort(); nodeToPort = config.getHosts(); } catch (FileNotFoundException e) { log.warn(STR, configFileName); } catch (IOException e) { log.error(STR, e); } } | /**
* Reads virtual BNG information contained in configuration file.
*
* @param configFilename the name of the configuration file for the virtual
* BNG application
*/ | Reads virtual BNG information contained in configuration file | readConfiguration | {
"repo_name": "sdnwiselab/onos",
"path": "apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngConfigurationManager.java",
"license": "apache-2.0",
"size": 11642
} | [
"com.fasterxml.jackson.databind.ObjectMapper",
"java.io.File",
"java.io.FileNotFoundException",
"java.io.IOException",
"org.onlab.packet.IpPrefix"
] | import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import org.onlab.packet.IpPrefix; | import com.fasterxml.jackson.databind.*; import java.io.*; import org.onlab.packet.*; | [
"com.fasterxml.jackson",
"java.io",
"org.onlab.packet"
] | com.fasterxml.jackson; java.io; org.onlab.packet; | 1,823,774 |
@Override
public Schema getSchema() {
return schema$;
} | Schema function() { return schema$; } | /**
* This method supports the Avro framework and is not intended to be called
* directly by the user.
*
* @return the schema object describing this class.
*
*/ | This method supports the Avro framework and is not intended to be called directly by the user | getSchema | {
"repo_name": "kineticadb/kinetica-api-java",
"path": "api/src/main/java/com/gpudb/protocol/AlterTableRequest.java",
"license": "mit",
"size": 111167
} | [
"org.apache.avro.Schema"
] | import org.apache.avro.Schema; | import org.apache.avro.*; | [
"org.apache.avro"
] | org.apache.avro; | 294,676 |
@Test
public void testCommandManagerLoadCommands() {
Set<String> packagesToScan = new HashSet<>();
packagesToScan.add(GfshCommand.class.getPackage().getName());
packagesToScan.add(VersionCommand.class.getPackage().getName());
ClasspathScanLoadHelper scanner = new ClasspathScanLoadHelper(packagesToScan);
ServiceLoader<CommandMarker> loader =
ServiceLoader.load(CommandMarker.class, ClassPathLoader.getLatest().asClassLoader());
loader.reload();
Iterator<CommandMarker> iterator = loader.iterator();
Set<Class<?>> foundClasses;
// geode's commands
foundClasses = scanner.scanPackagesForClassesImplementing(CommandMarker.class,
GfshCommand.class.getPackage().getName(),
VersionCommand.class.getPackage().getName());
while (iterator.hasNext()) {
foundClasses.add(iterator.next().getClass());
}
Set<Class<?>> expectedClasses = new HashSet<>();
for (CommandMarker commandMarker : commandManager.getCommandMarkers()) {
expectedClasses.add(commandMarker.getClass());
}
assertThat(expectedClasses).isEqualTo(foundClasses);
} | void function() { Set<String> packagesToScan = new HashSet<>(); packagesToScan.add(GfshCommand.class.getPackage().getName()); packagesToScan.add(VersionCommand.class.getPackage().getName()); ClasspathScanLoadHelper scanner = new ClasspathScanLoadHelper(packagesToScan); ServiceLoader<CommandMarker> loader = ServiceLoader.load(CommandMarker.class, ClassPathLoader.getLatest().asClassLoader()); loader.reload(); Iterator<CommandMarker> iterator = loader.iterator(); Set<Class<?>> foundClasses; foundClasses = scanner.scanPackagesForClassesImplementing(CommandMarker.class, GfshCommand.class.getPackage().getName(), VersionCommand.class.getPackage().getName()); while (iterator.hasNext()) { foundClasses.add(iterator.next().getClass()); } Set<Class<?>> expectedClasses = new HashSet<>(); for (CommandMarker commandMarker : commandManager.getCommandMarkers()) { expectedClasses.add(commandMarker.getClass()); } assertThat(expectedClasses).isEqualTo(foundClasses); } | /**
* tests loadCommands()
*/ | tests loadCommands() | testCommandManagerLoadCommands | {
"repo_name": "smgoller/geode",
"path": "geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/cli/ConnectionsCommandManagerTest.java",
"license": "apache-2.0",
"size": 2868
} | [
"java.util.HashSet",
"java.util.Iterator",
"java.util.ServiceLoader",
"java.util.Set",
"org.apache.geode.internal.classloader.ClassPathLoader",
"org.apache.geode.management.cli.GfshCommand",
"org.apache.geode.management.internal.cli.commands.VersionCommand",
"org.apache.geode.management.internal.util.ClasspathScanLoadHelper",
"org.assertj.core.api.Assertions",
"org.springframework.shell.core.CommandMarker"
] | import java.util.HashSet; import java.util.Iterator; import java.util.ServiceLoader; import java.util.Set; import org.apache.geode.internal.classloader.ClassPathLoader; import org.apache.geode.management.cli.GfshCommand; import org.apache.geode.management.internal.cli.commands.VersionCommand; import org.apache.geode.management.internal.util.ClasspathScanLoadHelper; import org.assertj.core.api.Assertions; import org.springframework.shell.core.CommandMarker; | import java.util.*; import org.apache.geode.internal.classloader.*; import org.apache.geode.management.cli.*; import org.apache.geode.management.internal.cli.commands.*; import org.apache.geode.management.internal.util.*; import org.assertj.core.api.*; import org.springframework.shell.core.*; | [
"java.util",
"org.apache.geode",
"org.assertj.core",
"org.springframework.shell"
] | java.util; org.apache.geode; org.assertj.core; org.springframework.shell; | 1,396,567 |
private void reloadButtons() {
final Context context = getContext();
final PackageManager pm = context.getPackageManager();
final ActivityManager am = (ActivityManager)
context.getSystemService(Context.ACTIVITY_SERVICE);
final List<ActivityManager.RecentTaskInfo> recentTasks =
am.getRecentTasks(MAX_RECENT_TASKS, ActivityManager.RECENT_IGNORE_UNAVAILABLE);
ActivityInfo homeInfo =
new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME)
.resolveActivityInfo(pm, 0);
IconUtilities iconUtilities = new IconUtilities(getContext());
// Performance note: Our android performance guide says to prefer Iterator when
// using a List class, but because we know that getRecentTasks() always returns
// an ArrayList<>, we'll use a simple index instead.
int index = 0;
int numTasks = recentTasks.size();
for (int i = 0; i < numTasks && (index < NUM_BUTTONS); ++i) {
final ActivityManager.RecentTaskInfo info = recentTasks.get(i);
// for debug purposes only, disallow first result to create empty lists
if (DBG_FORCE_EMPTY_LIST && (i == 0)) continue;
Intent intent = new Intent(info.baseIntent);
if (info.origActivity != null) {
intent.setComponent(info.origActivity);
}
// Skip the current home activity.
if (homeInfo != null) {
if (homeInfo.packageName.equals(
intent.getComponent().getPackageName())
&& homeInfo.name.equals(
intent.getComponent().getClassName())) {
continue;
}
}
intent.setFlags((intent.getFlags()&~Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED)
| Intent.FLAG_ACTIVITY_NEW_TASK);
final ResolveInfo resolveInfo = pm.resolveActivity(intent, 0);
if (resolveInfo != null) {
final ActivityInfo activityInfo = resolveInfo.activityInfo;
final String title = activityInfo.loadLabel(pm).toString();
Drawable icon = activityInfo.loadIcon(pm);
if (title != null && title.length() > 0 && icon != null) {
final TextView tv = mIcons[index];
tv.setText(title);
icon = iconUtilities.createIconDrawable(icon);
tv.setCompoundDrawables(null, icon, null, null);
RecentTag tag = new RecentTag();
tag.info = info;
tag.intent = intent;
tv.setTag(tag);
tv.setVisibility(View.VISIBLE);
tv.setPressed(false);
tv.clearFocus();
++index;
}
}
}
// handle the case of "no icons to show"
mNoAppsText.setVisibility((index == 0) ? View.VISIBLE : View.GONE);
// hide the rest
for (; index < NUM_BUTTONS; ++index) {
mIcons[index].setVisibility(View.GONE);
}
} | void function() { final Context context = getContext(); final PackageManager pm = context.getPackageManager(); final ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); final List<ActivityManager.RecentTaskInfo> recentTasks = am.getRecentTasks(MAX_RECENT_TASKS, ActivityManager.RECENT_IGNORE_UNAVAILABLE); ActivityInfo homeInfo = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME) .resolveActivityInfo(pm, 0); IconUtilities iconUtilities = new IconUtilities(getContext()); int index = 0; int numTasks = recentTasks.size(); for (int i = 0; i < numTasks && (index < NUM_BUTTONS); ++i) { final ActivityManager.RecentTaskInfo info = recentTasks.get(i); if (DBG_FORCE_EMPTY_LIST && (i == 0)) continue; Intent intent = new Intent(info.baseIntent); if (info.origActivity != null) { intent.setComponent(info.origActivity); } if (homeInfo != null) { if (homeInfo.packageName.equals( intent.getComponent().getPackageName()) && homeInfo.name.equals( intent.getComponent().getClassName())) { continue; } } intent.setFlags((intent.getFlags()&~Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) Intent.FLAG_ACTIVITY_NEW_TASK); final ResolveInfo resolveInfo = pm.resolveActivity(intent, 0); if (resolveInfo != null) { final ActivityInfo activityInfo = resolveInfo.activityInfo; final String title = activityInfo.loadLabel(pm).toString(); Drawable icon = activityInfo.loadIcon(pm); if (title != null && title.length() > 0 && icon != null) { final TextView tv = mIcons[index]; tv.setText(title); icon = iconUtilities.createIconDrawable(icon); tv.setCompoundDrawables(null, icon, null, null); RecentTag tag = new RecentTag(); tag.info = info; tag.intent = intent; tv.setTag(tag); tv.setVisibility(View.VISIBLE); tv.setPressed(false); tv.clearFocus(); ++index; } } } mNoAppsText.setVisibility((index == 0) ? View.VISIBLE : View.GONE); for (; index < NUM_BUTTONS; ++index) { mIcons[index].setVisibility(View.GONE); } } | /**
* Reload the 6 buttons with recent activities
*/ | Reload the 6 buttons with recent activities | reloadButtons | {
"repo_name": "haikuowuya/android_system_code",
"path": "src/com/android/internal/policy/impl/RecentApplicationsDialog.java",
"license": "apache-2.0",
"size": 13107
} | [
"android.app.ActivityManager",
"android.content.Context",
"android.content.Intent",
"android.content.pm.ActivityInfo",
"android.content.pm.PackageManager",
"android.content.pm.ResolveInfo",
"android.graphics.drawable.Drawable",
"android.view.View",
"android.widget.TextView",
"java.util.List"
] | import android.app.ActivityManager; import android.content.Context; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.graphics.drawable.Drawable; import android.view.View; import android.widget.TextView; import java.util.List; | import android.app.*; import android.content.*; import android.content.pm.*; import android.graphics.drawable.*; import android.view.*; import android.widget.*; import java.util.*; | [
"android.app",
"android.content",
"android.graphics",
"android.view",
"android.widget",
"java.util"
] | android.app; android.content; android.graphics; android.view; android.widget; java.util; | 688,710 |
public Image getImage(String imageFilePath) {
Image image = Activator.getDefault().getImageRegistry().get(Activator.PLUGIN_ID + ":" + imageFilePath);
if (image == null)
image = loadImage(Activator.PLUGIN_ID, imageFilePath);
return image;
} | Image function(String imageFilePath) { Image image = Activator.getDefault().getImageRegistry().get(Activator.PLUGIN_ID + ":" + imageFilePath); if (image == null) image = loadImage(Activator.PLUGIN_ID, imageFilePath); return image; } | /**
* Returns image in this plugin
*
* @param imageFilePath
* : image File Path in this plugin
* @return Image if exists
*/ | Returns image in this plugin | getImage | {
"repo_name": "awltech/eclipse-asciidoctools",
"path": "com.worldline.asciidoctools.editor/src/main/java/com/worldline/asciidoctools/editor/internal/Activator.java",
"license": "lgpl-2.1",
"size": 3823
} | [
"org.eclipse.swt.graphics.Image"
] | import org.eclipse.swt.graphics.Image; | import org.eclipse.swt.graphics.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 557,004 |
public interface PreprocessorCallback {
String onDataReady(String body, NRequestModel requestModel);
} | interface PreprocessorCallback { String function(String body, NRequestModel requestModel); } | /**
* Implement this instance for organizing custom logic
*
* @param body original body from raw file
* @return body after post processing
*/ | Implement this instance for organizing custom logic | onDataReady | {
"repo_name": "jaksab/EasyNetwork",
"path": "easynet/src/main/java/pro/oncreate/easynet/processing/TestTask.java",
"license": "mit",
"size": 3270
} | [
"pro.oncreate.easynet.models.NRequestModel"
] | import pro.oncreate.easynet.models.NRequestModel; | import pro.oncreate.easynet.models.*; | [
"pro.oncreate.easynet"
] | pro.oncreate.easynet; | 1,537,378 |
protected Location fixLocation(Location old, World world) {
Location fixed = old.clone();
fixed.setWorld(world);
return fixed;
} | Location function(Location old, World world) { Location fixed = old.clone(); fixed.setWorld(world); return fixed; } | /**
* Create a duplicate location with a set world.
* @param old
* @param world
* @return fixed
*/ | Create a duplicate location with a set world | fixLocation | {
"repo_name": "Kneesnap/Kineticraft",
"path": "src/net/kineticraft/lostcity/cutscenes/CutsceneAction.java",
"license": "gpl-3.0",
"size": 3631
} | [
"org.bukkit.Location",
"org.bukkit.World"
] | import org.bukkit.Location; import org.bukkit.World; | import org.bukkit.*; | [
"org.bukkit"
] | org.bukkit; | 2,655,552 |
public int quantityDroppedWithBonus(int fortune, Random random)
{
if (fortune > 0 && Item.getItemFromBlock(this) != this.getItemDropped((IBlockState)this.getBlockState().getValidStates().iterator().next(), random, fortune))
{
int var3 = random.nextInt(fortune + 2) - 1;
if (var3 < 0)
{
var3 = 0;
}
return this.quantityDropped(random) * (var3 + 1);
}
else
{
return this.quantityDropped(random);
}
} | int function(int fortune, Random random) { if (fortune > 0 && Item.getItemFromBlock(this) != this.getItemDropped((IBlockState)this.getBlockState().getValidStates().iterator().next(), random, fortune)) { int var3 = random.nextInt(fortune + 2) - 1; if (var3 < 0) { var3 = 0; } return this.quantityDropped(random) * (var3 + 1); } else { return this.quantityDropped(random); } } | /**
* Get the quantity dropped based on the given fortune level
*/ | Get the quantity dropped based on the given fortune level | quantityDroppedWithBonus | {
"repo_name": "Hexeption/Youtube-Hacked-Client-1.8",
"path": "minecraft/net/minecraft/block/BlockOre.java",
"license": "mit",
"size": 3737
} | [
"java.util.Random",
"net.minecraft.block.state.IBlockState",
"net.minecraft.item.Item"
] | import java.util.Random; import net.minecraft.block.state.IBlockState; import net.minecraft.item.Item; | import java.util.*; import net.minecraft.block.state.*; import net.minecraft.item.*; | [
"java.util",
"net.minecraft.block",
"net.minecraft.item"
] | java.util; net.minecraft.block; net.minecraft.item; | 1,408,978 |
private void handleWriteFuture( WriteFuture future, Entry entry, EventType event )
{
// Let the operation be executed.
// Note : we wait 10 seconds max
future.awaitUninterruptibly( 10000L );
if ( !future.isWritten() )
{
LOG.error( "Failed to write to the consumer {} during the event {} on entry {}", new Object[] {
consumerMsgLog.getId(), event, entry.getDn() } );
LOG.error( "", future.getException() );
// set realtime push to false, will be set back to true when the client
// comes back and sends another request this flag will be set to true
pushInRealTime = false;
}
else
{
try
{
// if successful update the last sent CSN
consumerMsgLog.setLastSentCsn( entry.get( SchemaConstants.ENTRY_CSN_AT ).getString() );
}
catch ( Exception e )
{
//should never happen
LOG.error( "No entry CSN attribute found", e );
}
}
}
| void function( WriteFuture future, Entry entry, EventType event ) { future.awaitUninterruptibly( 10000L ); if ( !future.isWritten() ) { LOG.error( STR, new Object[] { consumerMsgLog.getId(), event, entry.getDn() } ); LOG.error( STRNo entry CSN attribute found", e ); } } } | /**
* Process the writing of the replicated entry to the consumer
*/ | Process the writing of the replicated entry to the consumer | handleWriteFuture | {
"repo_name": "apache/directory-server",
"path": "protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplSearchListener.java",
"license": "apache-2.0",
"size": 22415
} | [
"org.apache.directory.api.ldap.model.entry.Entry",
"org.apache.directory.server.core.api.event.EventType",
"org.apache.mina.core.future.WriteFuture"
] | import org.apache.directory.api.ldap.model.entry.Entry; import org.apache.directory.server.core.api.event.EventType; import org.apache.mina.core.future.WriteFuture; | import org.apache.directory.api.ldap.model.entry.*; import org.apache.directory.server.core.api.event.*; import org.apache.mina.core.future.*; | [
"org.apache.directory",
"org.apache.mina"
] | org.apache.directory; org.apache.mina; | 1,062,057 |
public Element update(Element updateElement) {
updateGameObjects(updateElement.getChildNodes());
new RefreshCanvasSwingTask().invokeLater();
return null;
} | Element function(Element updateElement) { updateGameObjects(updateElement.getChildNodes()); new RefreshCanvasSwingTask().invokeLater(); return null; } | /**
* Handles an "update"-message.
*
* @param updateElement The element (root element in a DOM-parsed XML tree)
* that holds all the information.
* @return The reply.
*/ | Handles an "update"-message | update | {
"repo_name": "tectronics/reformationofeurope",
"path": "src/net/sf/freecol/client/control/InGameInputHandler.java",
"license": "gpl-2.0",
"size": 80987
} | [
"org.w3c.dom.Element"
] | import org.w3c.dom.Element; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 1,785,096 |
public void setEnableTable(String tableName) throws IOException {
setTableState(tableName, "ENABLED");
} | void function(String tableName) throws IOException { setTableState(tableName, STR); } | /**
* Forcefully sets the table state as ENABLED in ZK
* @param tablename
*/ | Forcefully sets the table state as ENABLED in ZK | setEnableTable | {
"repo_name": "gdweijin/hindex",
"path": "src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java",
"license": "apache-2.0",
"size": 93736
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 950,319 |
@Inject
public void setSystemStatus(SystemStatus systemStatus) {
this.systemStatus = systemStatus;
} | void function(SystemStatus systemStatus) { this.systemStatus = systemStatus; } | /**
* Allows {@link com.google.inject.Guice} to inject a SystemStatus object
*
* @param systemStatus the {@link SystemStatus} singleton used to meter this processor
*/ | Allows <code>com.google.inject.Guice</code> to inject a SystemStatus object | setSystemStatus | {
"repo_name": "salesforce/pyplyn",
"path": "plugin-api/src/main/java/com/salesforce/pyplyn/processor/AbstractMeteredLoadProcessor.java",
"license": "bsd-3-clause",
"size": 2172
} | [
"com.salesforce.pyplyn.status.SystemStatus"
] | import com.salesforce.pyplyn.status.SystemStatus; | import com.salesforce.pyplyn.status.*; | [
"com.salesforce.pyplyn"
] | com.salesforce.pyplyn; | 1,128,903 |
public static java.util.List extractLocSiteList(ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.LocSiteUpprNameVoCollection voCollection)
{
return extractLocSiteList(domainFactory, voCollection, null, new HashMap());
}
| static java.util.List function(ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.LocSiteUpprNameVoCollection voCollection) { return extractLocSiteList(domainFactory, voCollection, null, new HashMap()); } | /**
* Create the ims.core.resource.place.domain.objects.LocSite list from the value object collection.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param voCollection - the collection of value objects
*/ | Create the ims.core.resource.place.domain.objects.LocSite list from the value object collection | extractLocSiteList | {
"repo_name": "IMS-MAXIMS/openMAXIMS",
"path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/core/vo/domain/LocSiteUpprNameVoAssembler.java",
"license": "agpl-3.0",
"size": 20625
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 542,957 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.