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 list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public APIResponse httpPost(File file) throws RESTException {
HttpResponse response = null;
try {
HttpClient httpClient = createClient();
HttpPost httpPost = new HttpPost(url);
addInternalHeaders(httpPost);
String contentType = this.getMIMEType(file)... | APIResponse function(File file) throws RESTException { HttpResponse response = null; try { HttpClient httpClient = createClient(); HttpPost httpPost = new HttpPost(url); addInternalHeaders(httpPost); String contentType = this.getMIMEType(file); httpPost.setEntity(new FileEntity(file, contentType)); return buildResponse... | /**
* Sends an http POST request with the POST body set to the file.
*
* <p>
* <strong>NOTE</strong>: Any parameters set using
* <code>addParameter()</code> or <code>setParameter()</code> will be
* ignored.
* </p>
*
* @param file file to use as POST body
* @return api r... | Sends an http POST request with the POST body set to the file. NOTE: Any parameters set using <code>addParameter()</code> or <code>setParameter()</code> will be ignored. | httpPost | {
"repo_name": "attdevsupport/codekit-java",
"path": "codekit/src/main/java/com/att/api/rest/RESTClient.java",
"license": "apache-2.0",
"size": 30320
} | [
"java.io.File",
"org.apache.http.HttpResponse",
"org.apache.http.client.HttpClient",
"org.apache.http.client.methods.HttpPost",
"org.apache.http.entity.FileEntity"
] | import java.io.File; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.FileEntity; | import java.io.*; import org.apache.http.*; import org.apache.http.client.*; import org.apache.http.client.methods.*; import org.apache.http.entity.*; | [
"java.io",
"org.apache.http"
] | java.io; org.apache.http; | 724,933 |
public Q not(Iterable<T> iterable) {
return not(new IterableContainsPredicate<T>(iterable, provider));
} | Q function(Iterable<T> iterable) { return not(new IterableContainsPredicate<T>(iterable, provider)); } | /**
* Remove elements from the collection.
*
* @param iterable Selector used to remove Resources
* @return new SlingQuery object transformed by this operation
*/ | Remove elements from the collection | not | {
"repo_name": "headwirecom/sling",
"path": "contrib/extensions/sling-query/src/main/java/org/apache/sling/query/AbstractQuery.java",
"license": "apache-2.0",
"size": 26338
} | [
"org.apache.sling.query.predicate.IterableContainsPredicate"
] | import org.apache.sling.query.predicate.IterableContainsPredicate; | import org.apache.sling.query.predicate.*; | [
"org.apache.sling"
] | org.apache.sling; | 699,955 |
private static String getHumanReadableCount(long rows) {
int unit = 1000;
if (rows < unit) {
return String.valueOf(rows);
} else {
int exp = (int) (Math.log(rows) / Math.log(unit));
char pre = "kMGTPE".charAt(exp - 1); //$NON-NLS-1$
... | static String function(long rows) { int unit = 1000; if (rows < unit) { return String.valueOf(rows); } else { int exp = (int) (Math.log(rows) / Math.log(unit)); char pre = STR.charAt(exp - 1); return String.format(STR, rows / Math.pow(unit, exp), pre); } } private ImportWizard wizardImport; private Table table; private... | /**
* Returns a human readable string representation of <code>rows</code>
*
* This converts rows into a human readable string, e.g. 1000000 gets
* converted to 1M.
*
* The code is based upon <a href="http://bit.ly/1m4UetX">this</a> snippet.
*
* @param rows The number of r... | Returns a human readable string representation of <code>rows</code> This converts rows into a human readable string, e.g. 1000000 gets converted to 1M. The code is based upon this snippet | getHumanReadableCount | {
"repo_name": "arx-deidentifier/arx",
"path": "src/gui/org/deidentifier/arx/gui/view/impl/wizard/ImportWizardPageTable.java",
"license": "apache-2.0",
"size": 18077
} | [
"org.deidentifier.arx.gui.resources.Resources",
"org.eclipse.jface.viewers.TableViewer",
"org.eclipse.swt.widgets.Table"
] | import org.deidentifier.arx.gui.resources.Resources; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.swt.widgets.Table; | import org.deidentifier.arx.gui.resources.*; import org.eclipse.jface.viewers.*; import org.eclipse.swt.widgets.*; | [
"org.deidentifier.arx",
"org.eclipse.jface",
"org.eclipse.swt"
] | org.deidentifier.arx; org.eclipse.jface; org.eclipse.swt; | 2,029,254 |
public static GeometryArray createGA(GeometryData terrainData, int texCoordCount, int vertexAttrCount, int[] vertexAttrSizes)
{
int basicFormat = GeometryArray.COORDINATES | GeometryArray.NORMALS | GeometryArray.COLOR_4 //
| GeometryArray.TEXTURE_COORDINATE_2 //
| GeometryArray.USE_COORD_INDEX_ONLY //
... | static GeometryArray function(GeometryData terrainData, int texCoordCount, int vertexAttrCount, int[] vertexAttrSizes) { int basicFormat = GeometryArray.COORDINATES GeometryArray.NORMALS GeometryArray.COLOR_4 GeometryArray.USE_COORD_INDEX_ONLY (BUFFERS ? GeometryArray.USE_NIO_BUFFER : 0) texCoordCount = 1; int[] texMap... | /**
* texCoordCount is overrriden to 1
* @param terrainData
* @param texCoordCount
* @param vertexAttrCount
* @param vertexAttrSizes
* @return
*/ | texCoordCount is overrriden to 1 | createGA | {
"repo_name": "philjord/esmj3d",
"path": "esmj3d/src/esmj3d/j3d/j3drecords/inst/J3dLAND.java",
"license": "lgpl-3.0",
"size": 36522
} | [
"org.jogamp.java3d.GeometryArray",
"org.jogamp.java3d.IndexedGeometryArray",
"org.jogamp.java3d.IndexedTriangleArray",
"org.jogamp.java3d.IndexedTriangleStripArray",
"org.jogamp.java3d.J3DBuffer",
"org.jogamp.java3d.geom.GeometryData"
] | import org.jogamp.java3d.GeometryArray; import org.jogamp.java3d.IndexedGeometryArray; import org.jogamp.java3d.IndexedTriangleArray; import org.jogamp.java3d.IndexedTriangleStripArray; import org.jogamp.java3d.J3DBuffer; import org.jogamp.java3d.geom.GeometryData; | import org.jogamp.java3d.*; import org.jogamp.java3d.geom.*; | [
"org.jogamp.java3d"
] | org.jogamp.java3d; | 749,062 |
private boolean deleteFile(Request req, Response res) {
FileInfo file = fileCollection.findPermittedByRequestParamId(req, res);
fileStorage.delete(file.getKey());
return fileCollection.delete(file).wasAcknowledged();
} | boolean function(Request req, Response res) { FileInfo file = fileCollection.findPermittedByRequestParamId(req, res); fileStorage.delete(file.getKey()); return fileCollection.delete(file).wasAcknowledged(); } | /**
* Remove the FileInfo record from the database and the file from the FileStorage.
*/ | Remove the FileInfo record from the database and the file from the FileStorage | deleteFile | {
"repo_name": "conveyal/analysis-backend",
"path": "src/main/java/com/conveyal/analysis/controllers/FileStorageController.java",
"license": "mit",
"size": 4921
} | [
"com.conveyal.analysis.models.FileInfo"
] | import com.conveyal.analysis.models.FileInfo; | import com.conveyal.analysis.models.*; | [
"com.conveyal.analysis"
] | com.conveyal.analysis; | 959,699 |
public boolean isSystemConfigurationComplete() {
boolean adminEmailSet = false;
boolean adminNameSet = false;
boolean smtpServerSet = false;
final List props = getSystemProperties();
for (final Iterator iter = props.iterator(); iter.hasNext(); ) {
final SystemProperty prop = (SystemProperty)... | boolean function() { boolean adminEmailSet = false; boolean adminNameSet = false; boolean smtpServerSet = false; final List props = getSystemProperties(); for (final Iterator iter = props.iterator(); iter.hasNext(); ) { final SystemProperty prop = (SystemProperty) iter.next(); if (isSystemPropertySet(prop, SystemProper... | /**
* Returns true if system configuration complete.
*/ | Returns true if system configuration complete | isSystemConfigurationComplete | {
"repo_name": "simeshev/parabuild-ci",
"path": "src/org/parabuild/ci/configuration/SystemConfigurationManagerImpl.java",
"license": "lgpl-3.0",
"size": 32865
} | [
"java.util.Iterator",
"java.util.List",
"org.parabuild.ci.object.SystemProperty"
] | import java.util.Iterator; import java.util.List; import org.parabuild.ci.object.SystemProperty; | import java.util.*; import org.parabuild.ci.object.*; | [
"java.util",
"org.parabuild.ci"
] | java.util; org.parabuild.ci; | 1,781,882 |
public String[] getAttrNames() {
Set<String> attrNameSet = attrs.keySet();
return attrNameSet.toArray(new String[attrNameSet.size()]);
} | String[] function() { Set<String> attrNameSet = attrs.keySet(); return attrNameSet.toArray(new String[attrNameSet.size()]); } | /**
* Return attr name of this record.
*/ | Return attr name of this record | getAttrNames | {
"repo_name": "solmix/wmix",
"path": "rest/src/main/java/org/solmix/rest/route/entity/Entity.java",
"license": "lgpl-2.1",
"size": 10459
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,187,662 |
public Country getCountryV6(String ipAddress) {
InetAddress addr;
try {
addr = Inet6Address.getByName(ipAddress);
}
catch (UnknownHostException e) {
return UNKNOWN_COUNTRY;
}
return getCountryV6(addr);
} | Country function(String ipAddress) { InetAddress addr; try { addr = Inet6Address.getByName(ipAddress); } catch (UnknownHostException e) { return UNKNOWN_COUNTRY; } return getCountryV6(addr); } | /**
* Returns the country the IP address is in.
*
* @param ipAddress String version of an IPv6 address, i.e. "::127.0.0.1"
* @return the country the IP address is from.
*/ | Returns the country the IP address is in | getCountryV6 | {
"repo_name": "ArcasCZ/GeoIPTools-Sponge",
"path": "src/main/java/com/maxmind/geoip/LookupService.java",
"license": "lgpl-3.0",
"size": 39857
} | [
"java.net.Inet6Address",
"java.net.InetAddress",
"java.net.UnknownHostException"
] | import java.net.Inet6Address; import java.net.InetAddress; import java.net.UnknownHostException; | import java.net.*; | [
"java.net"
] | java.net; | 2,315,947 |
@Test
public void testSetStartingOffset() {
SystemStreamPartition ssp = new SystemStreamPartition("mySystem", "myStream", new Partition(0));
taskContext.setStartingOffset(ssp, "123");
verify(offsetManager).setStartingOffset(TASK_NAME, ssp, "123");
} | void function() { SystemStreamPartition ssp = new SystemStreamPartition(STR, STR, new Partition(0)); taskContext.setStartingOffset(ssp, "123"); verify(offsetManager).setStartingOffset(TASK_NAME, ssp, "123"); } | /**
* Given an SSP and offset, setStartingOffset should delegate to the offset manager.
*/ | Given an SSP and offset, setStartingOffset should delegate to the offset manager | testSetStartingOffset | {
"repo_name": "lhaiesp/samza",
"path": "samza-core/src/test/java/org/apache/samza/context/TestTaskContextImpl.java",
"license": "apache-2.0",
"size": 3456
} | [
"org.apache.samza.Partition",
"org.apache.samza.system.SystemStreamPartition",
"org.mockito.Mockito"
] | import org.apache.samza.Partition; import org.apache.samza.system.SystemStreamPartition; import org.mockito.Mockito; | import org.apache.samza.*; import org.apache.samza.system.*; import org.mockito.*; | [
"org.apache.samza",
"org.mockito"
] | org.apache.samza; org.mockito; | 189,695 |
@Override
public void responseReceived(String response) {
if (StringUtils.isEmpty(response)) {
return;
}
Matcher m = RSP_BANKNOTIFICATION.matcher(response);
if (m.matches()) {
handleBankNotification(m, response);
return;
}
m =... | void function(String response) { if (StringUtils.isEmpty(response)) { return; } Matcher m = RSP_BANKNOTIFICATION.matcher(response); if (m.matches()) { handleBankNotification(m, response); return; } m = RSP_PRESETNOTIFICATION.matcher(response); if (m.matches()) { return; } m = RSP_SRCNOTIFICATION.matcher(response); if (... | /**
* Implements {@link SocketSessionListener#responseReceived(String)} to try to process the response from the
* russound system. This response may be for other protocol handler - so ignore if we don't recognize the response.
*
* @param a possibly null, possibly empty response
*/ | Implements <code>SocketSessionListener#responseReceived(String)</code> to try to process the response from the russound system. This response may be for other protocol handler - so ignore if we don't recognize the response | responseReceived | {
"repo_name": "openhab/openhab2",
"path": "bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/source/RioSourceProtocol.java",
"license": "epl-1.0",
"size": 26401
} | [
"java.util.regex.Matcher",
"org.apache.commons.lang.StringUtils",
"org.openhab.binding.russound.internal.rio.RioConstants"
] | import java.util.regex.Matcher; import org.apache.commons.lang.StringUtils; import org.openhab.binding.russound.internal.rio.RioConstants; | import java.util.regex.*; import org.apache.commons.lang.*; import org.openhab.binding.russound.internal.rio.*; | [
"java.util",
"org.apache.commons",
"org.openhab.binding"
] | java.util; org.apache.commons; org.openhab.binding; | 2,597,423 |
EClass getRule(); | EClass getRule(); | /**
* Returns the meta object for class '{@link tudor.lu.modeling.transformation.tauHCI.Rule <em>Rule</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Rule</em>'.
* @see tudor.lu.modeling.transformation.tauHCI.Rule
* @generated
*/ | Returns the meta object for class '<code>tudor.lu.modeling.transformation.tauHCI.Rule Rule</code>'. | getRule | {
"repo_name": "jssottet/Tau4HCI",
"path": "tudor.lu.modeling.transformation.tauHCI/src-gen/tudor/lu/modeling/transformation/tauHCI/TauHCIPackage.java",
"license": "epl-1.0",
"size": 40427
} | [
"org.eclipse.emf.ecore.EClass"
] | import org.eclipse.emf.ecore.EClass; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,710,812 |
public void dispose()
{
if (fileSystemCopyTaskItemProvider != null)
{
fileSystemCopyTaskItemProvider.dispose();
}
}
public static class BaseChildCreationExtender implements IChildCreationExtender
{
protected static class CreationSwitch extends BaseSwitch<Object>
{
... | void function() { if (fileSystemCopyTaskItemProvider != null) { fileSystemCopyTaskItemProvider.dispose(); } } public static class BaseChildCreationExtender implements IChildCreationExtender { protected static class CreationSwitch extends BaseSwitch<Object> { protected List<Object> newChildDescriptors; protected Editing... | /**
* This disposes all of the item providers created by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This disposes all of the item providers created by this factory. | dispose | {
"repo_name": "maybeec/oomph-task-fscopy",
"path": "task-fscopy.edit/src/com/github/maybeec/oomph/task/fscopy/provider/FSCopyItemProviderAdapterFactory.java",
"license": "epl-1.0",
"size": 12939
} | [
"java.util.List",
"org.eclipse.emf.edit.domain.EditingDomain",
"org.eclipse.emf.edit.provider.IChildCreationExtender",
"org.eclipse.oomph.base.util.BaseSwitch"
] | import java.util.List; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.edit.provider.IChildCreationExtender; import org.eclipse.oomph.base.util.BaseSwitch; | import java.util.*; import org.eclipse.emf.edit.domain.*; import org.eclipse.emf.edit.provider.*; import org.eclipse.oomph.base.util.*; | [
"java.util",
"org.eclipse.emf",
"org.eclipse.oomph"
] | java.util; org.eclipse.emf; org.eclipse.oomph; | 1,951,775 |
private byte[] createArrayBytes(TrustedByteArrayOutputStream byteStream, DataOutputStream oStream,
PhoenixArray array, int noOfElements, PDataType baseType, SortOrder sortOrder, boolean rowKeyOrderOptimizable) {
try {
if (!baseType.isFixedWidth()) {
int[] offsetPos = ... | byte[] function(TrustedByteArrayOutputStream byteStream, DataOutputStream oStream, PhoenixArray array, int noOfElements, PDataType baseType, SortOrder sortOrder, boolean rowKeyOrderOptimizable) { try { if (!baseType.isFixedWidth()) { int[] offsetPos = new int[noOfElements]; int nulls = 0; for (int i = 0; i < noOfElemen... | /**
* creates array bytes
* @param rowKeyOrderOptimizable TODO
*/ | creates array bytes | createArrayBytes | {
"repo_name": "nickman/phoenix",
"path": "phoenix-core/src/main/java/org/apache/phoenix/schema/types/PArrayDataType.java",
"license": "apache-2.0",
"size": 66195
} | [
"java.io.DataOutputStream",
"java.io.IOException",
"org.apache.hadoop.hbase.io.ImmutableBytesWritable",
"org.apache.phoenix.schema.SortOrder",
"org.apache.phoenix.util.ByteUtil",
"org.apache.phoenix.util.TrustedByteArrayOutputStream"
] | import java.io.DataOutputStream; import java.io.IOException; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.phoenix.schema.SortOrder; import org.apache.phoenix.util.ByteUtil; import org.apache.phoenix.util.TrustedByteArrayOutputStream; | import java.io.*; import org.apache.hadoop.hbase.io.*; import org.apache.phoenix.schema.*; import org.apache.phoenix.util.*; | [
"java.io",
"org.apache.hadoop",
"org.apache.phoenix"
] | java.io; org.apache.hadoop; org.apache.phoenix; | 2,332,345 |
void onProgressFinished(Bundle data); | void onProgressFinished(Bundle data); | /**
* Called when operation has ended, is not called if error (exception) has occurred.
*
* @param data data bundle that needs to be passed to handler
*/ | Called when operation has ended, is not called if error (exception) has occurred | onProgressFinished | {
"repo_name": "andreynovikov/maptrek",
"path": "app/src/main/java/mobi/maptrek/util/ProgressListener.java",
"license": "gpl-3.0",
"size": 1701
} | [
"android.os.Bundle"
] | import android.os.Bundle; | import android.os.*; | [
"android.os"
] | android.os; | 1,427,420 |
public static com.iucn.whp.dbservice.model.prot_mgmt_overall findByPrimaryKey(
long pmo_id)
throws com.iucn.whp.dbservice.NoSuchprot_mgmt_overallException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByPrimaryKey(pmo_id);
} | static com.iucn.whp.dbservice.model.prot_mgmt_overall function( long pmo_id) throws com.iucn.whp.dbservice.NoSuchprot_mgmt_overallException, com.liferay.portal.kernel.exception.SystemException { return getPersistence().findByPrimaryKey(pmo_id); } | /**
* Returns the prot_mgmt_overall with the primary key or throws a {@link com.iucn.whp.dbservice.NoSuchprot_mgmt_overallException} if it could not be found.
*
* @param pmo_id the primary key of the prot_mgmt_overall
* @return the prot_mgmt_overall
* @throws com.iucn.whp.dbservice.NoSuchprot_mgmt_overallException... | Returns the prot_mgmt_overall with the primary key or throws a <code>com.iucn.whp.dbservice.NoSuchprot_mgmt_overallException</code> if it could not be found | findByPrimaryKey | {
"repo_name": "iucn-whp/world-heritage-outlook",
"path": "portlets/iucn-dbservice-portlet/docroot/WEB-INF/service/com/iucn/whp/dbservice/service/persistence/prot_mgmt_overallUtil.java",
"license": "gpl-2.0",
"size": 27783
} | [
"com.liferay.portal.kernel.exception.SystemException"
] | import com.liferay.portal.kernel.exception.SystemException; | import com.liferay.portal.kernel.exception.*; | [
"com.liferay.portal"
] | com.liferay.portal; | 2,536,086 |
public List<TriggerFiredResult> triggersFired(List<OperableTrigger> firedTriggers) {
synchronized (lock) {
List<TriggerFiredResult> results = new ArrayList<TriggerFiredResult>();
for (OperableTrigger trigger : firedTriggers) {
TriggerWrapper tw = triggersByKey.get(t... | List<TriggerFiredResult> function(List<OperableTrigger> firedTriggers) { synchronized (lock) { List<TriggerFiredResult> results = new ArrayList<TriggerFiredResult>(); for (OperableTrigger trigger : firedTriggers) { TriggerWrapper tw = triggersByKey.get(trigger.getKey()); if (tw == null tw.trigger == null) { continue; }... | /**
* <p>
* Inform the <code>JobStore</code> that the scheduler is now firing the
* given <code>Trigger</code> (executing its associated <code>Job</code>),
* that it had previously acquired (reserved).
* </p>
*/ | Inform the <code>JobStore</code> that the scheduler is now firing the given <code>Trigger</code> (executing its associated <code>Job</code>), that it had previously acquired (reserved). | triggersFired | {
"repo_name": "suthat/signal",
"path": "vendor/quartz-2.2.0/src/org/quartz/simpl/RAMJobStore.java",
"license": "apache-2.0",
"size": 60289
} | [
"java.util.ArrayList",
"java.util.Date",
"java.util.List",
"org.quartz.Calendar",
"org.quartz.JobDetail",
"org.quartz.spi.OperableTrigger",
"org.quartz.spi.TriggerFiredBundle",
"org.quartz.spi.TriggerFiredResult"
] | import java.util.ArrayList; import java.util.Date; import java.util.List; import org.quartz.Calendar; import org.quartz.JobDetail; import org.quartz.spi.OperableTrigger; import org.quartz.spi.TriggerFiredBundle; import org.quartz.spi.TriggerFiredResult; | import java.util.*; import org.quartz.*; import org.quartz.spi.*; | [
"java.util",
"org.quartz",
"org.quartz.spi"
] | java.util; org.quartz; org.quartz.spi; | 1,300,897 |
public StormTopology createTopology() {
TopologyBuilder builder = new TopologyBuilder();
PersistenceManager persistenceManager =
PersistenceProvider.getInstance().getPersistenceManager(configurationProvider);
createSpout(builder);
createPacketBolt(builder, persisten... | StormTopology function() { TopologyBuilder builder = new TopologyBuilder(); PersistenceManager persistenceManager = PersistenceProvider.getInstance().getPersistenceManager(configurationProvider); createSpout(builder); createPacketBolt(builder, persistenceManager); return builder.createTopology(); } | /**
* Creating topology.
*/ | Creating topology | createTopology | {
"repo_name": "jonvestal/open-kilda",
"path": "src-java/connecteddevices-topology/connecteddevices-storm-topology/src/main/java/org/openkilda/wfm/topology/connecteddevices/ConnectedDevicesTopology.java",
"license": "apache-2.0",
"size": 2736
} | [
"org.apache.storm.generated.StormTopology",
"org.apache.storm.topology.TopologyBuilder",
"org.openkilda.persistence.PersistenceManager",
"org.openkilda.persistence.spi.PersistenceProvider"
] | import org.apache.storm.generated.StormTopology; import org.apache.storm.topology.TopologyBuilder; import org.openkilda.persistence.PersistenceManager; import org.openkilda.persistence.spi.PersistenceProvider; | import org.apache.storm.generated.*; import org.apache.storm.topology.*; import org.openkilda.persistence.*; import org.openkilda.persistence.spi.*; | [
"org.apache.storm",
"org.openkilda.persistence"
] | org.apache.storm; org.openkilda.persistence; | 685,203 |
@Override
public String toString(final Locale locale) {
return value;
} | String function(final Locale locale) { return value; } | /**
* Returns the text as a string, or {@code null} if none.
*
* @param locale Ignored in current implementation.
* @return The anchor text, or {@code null} if none.
*/ | Returns the text as a string, or null if none | toString | {
"repo_name": "desruisseaux/sis",
"path": "core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmx/Anchor.java",
"license": "apache-2.0",
"size": 5861
} | [
"java.util.Locale"
] | import java.util.Locale; | import java.util.*; | [
"java.util"
] | java.util; | 2,562,348 |
@Deprecated
public void setCertificate(SslCertificate certificate) {
checkThread();
if (DebugFlags.TRACE_API) Log.d(LOGTAG, "setCertificate=" + certificate);
mProvider.setCertificate(certificate);
}
//-------------------------------------------------------------------------
... | void function(SslCertificate certificate) { checkThread(); if (DebugFlags.TRACE_API) Log.d(LOGTAG, STR + certificate); mProvider.setCertificate(certificate); } | /**
* Sets the SSL certificate for the main top-level page.
*
* @deprecated Calling this function has no useful effect, and will be
* ignored in future releases.
*/ | Sets the SSL certificate for the main top-level page | setCertificate | {
"repo_name": "JuudeDemos/android-sdk-20",
"path": "src/android/webkit/WebView.java",
"license": "apache-2.0",
"size": 90292
} | [
"android.net.http.SslCertificate",
"android.util.Log"
] | import android.net.http.SslCertificate; import android.util.Log; | import android.net.http.*; import android.util.*; | [
"android.net",
"android.util"
] | android.net; android.util; | 767,675 |
public void setUrlPatterns(Collection<String> urlPatterns) {
Assert.notNull(urlPatterns, "UrlPatterns must not be null");
this.urlPatterns = new LinkedHashSet<>(urlPatterns);
} | void function(Collection<String> urlPatterns) { Assert.notNull(urlPatterns, STR); this.urlPatterns = new LinkedHashSet<>(urlPatterns); } | /**
* Set the URL patterns that the filter will be registered against. This will replace
* any previously specified URL patterns.
* @param urlPatterns the URL patterns
* @see #setServletRegistrationBeans
* @see #setServletNames
*/ | Set the URL patterns that the filter will be registered against. This will replace any previously specified URL patterns | setUrlPatterns | {
"repo_name": "michael-simons/spring-boot",
"path": "spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java",
"license": "apache-2.0",
"size": 9121
} | [
"java.util.Collection",
"java.util.LinkedHashSet",
"org.springframework.util.Assert"
] | import java.util.Collection; import java.util.LinkedHashSet; import org.springframework.util.Assert; | import java.util.*; import org.springframework.util.*; | [
"java.util",
"org.springframework.util"
] | java.util; org.springframework.util; | 2,693,962 |
public void writeSpawnData(ByteBuf buffer); | void function(ByteBuf buffer); | /**
* Called by the server when constructing the spawn packet.
* Data should be added to the provided stream.
*
* @param buffer The packet data stream
*/ | Called by the server when constructing the spawn packet. Data should be added to the provided stream | writeSpawnData | {
"repo_name": "tomtomtom09/CampCraft",
"path": "build/tmp/recompileMc/sources/net/minecraftforge/fml/common/registry/IEntityAdditionalSpawnData.java",
"license": "gpl-3.0",
"size": 1137
} | [
"io.netty.buffer.ByteBuf"
] | import io.netty.buffer.ByteBuf; | import io.netty.buffer.*; | [
"io.netty.buffer"
] | io.netty.buffer; | 1,775,719 |
public PrivateKey getPrivateKey() {
return privateKey;
} | PrivateKey function() { return privateKey; } | /**
* Get the configured private key for use with Raw Public Key.
*/ | Get the configured private key for use with Raw Public Key | getPrivateKey | {
"repo_name": "pax95/camel",
"path": "components/camel-coap/src/main/java/org/apache/camel/coap/CoAPEndpoint.java",
"license": "apache-2.0",
"size": 16550
} | [
"java.security.PrivateKey"
] | import java.security.PrivateKey; | import java.security.*; | [
"java.security"
] | java.security; | 1,391,785 |
public StepInterface getRunThread( int i ) {
if ( steps == null ) {
return null;
}
return steps.get( i ).step;
} | StepInterface function( int i ) { if ( steps == null ) { return null; } return steps.get( i ).step; } | /**
* Gets the run thread for the step at the specified index.
*
* @param i the index of the desired step
* @return a StepInterface object corresponding to the run thread for the specified step
*/ | Gets the run thread for the step at the specified index | getRunThread | {
"repo_name": "bmorrise/pentaho-kettle",
"path": "engine/src/main/java/org/pentaho/di/trans/Trans.java",
"license": "apache-2.0",
"size": 199512
} | [
"org.pentaho.di.trans.step.StepInterface"
] | import org.pentaho.di.trans.step.StepInterface; | import org.pentaho.di.trans.step.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 667,160 |
public static ims.emergency.configuration.domain.objects.AmbulanceArrivalsConfig extractAmbulanceArrivalsConfig(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.AmbulanceArrivalsConfigVo valueObject)
{
return extractAmbulanceArrivalsConfig(domainFactory, valueObject, new HashMap());
}
| static ims.emergency.configuration.domain.objects.AmbulanceArrivalsConfig function(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.AmbulanceArrivalsConfigVo valueObject) { return extractAmbulanceArrivalsConfig(domainFactory, valueObject, new HashMap()); } | /**
* Create the domain object from the value object.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param valueObject - extract the domain object fields from this.
*/ | Create the domain object from the value object | extractAmbulanceArrivalsConfig | {
"repo_name": "FreudianNM/openMAXIMS",
"path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/emergency/vo/domain/AmbulanceArrivalsConfigVoAssembler.java",
"license": "agpl-3.0",
"size": 20534
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 1,637,272 |
public static CharSequence parseTime(Context context,
int hour,
int minute) {
Locale locale =
context.getResources().getConfiguration().getLocales().get(0);
String parse;
if (android.text.forma... | static CharSequence function(Context context, int hour, int minute) { Locale locale = context.getResources().getConfiguration().getLocales().get(0); String parse; if (android.text.format.DateFormat.is24HourFormat(context)) { parse = String.format(locale, STR, hour, minute); } else { String AM_PM = (hour <= 12) ? "AM" :... | /**
* Convert a time from computer-readable to human-readable
*
* @param context Context
* @param hour Hour
* @param minute Minute
* @return Returns the proper time
*/ | Convert a time from computer-readable to human-readable | parseTime | {
"repo_name": "MSF-Jarvis/substratum",
"path": "app/src/main/java/projekt/substratum/common/References.java",
"license": "gpl-3.0",
"size": 42602
} | [
"android.content.Context",
"java.util.Locale"
] | import android.content.Context; import java.util.Locale; | import android.content.*; import java.util.*; | [
"android.content",
"java.util"
] | android.content; java.util; | 1,860,010 |
public float getHeight() {
if ( height == null ) {
height = (SFFloat)getField( "height" );
}
return( height.getValue( ) );
} | float function() { if ( height == null ) { height = (SFFloat)getField( STR ); } return( height.getValue( ) ); } | /** Return the height float value.
* @return The height float value. */ | Return the height float value | getHeight | {
"repo_name": "Norkart/NK-VirtualGlobe",
"path": "Xj3D/src/java/org/xj3d/sai/external/node/geometry3d/SAICylinder.java",
"license": "gpl-2.0",
"size": 4295
} | [
"org.web3d.x3d.sai.SFFloat"
] | import org.web3d.x3d.sai.SFFloat; | import org.web3d.x3d.sai.*; | [
"org.web3d.x3d"
] | org.web3d.x3d; | 1,944,518 |
@Test
public void testCreateExpression() {
DefaultFunctionFactory functionFactory = new DefaultFunctionFactory();
List<FunctionName> functionNameList = functionFactory.getFunctionNames();
FunctionName functionName = null;
Expression expression = FunctionManager.getInstance().crea... | void function() { DefaultFunctionFactory functionFactory = new DefaultFunctionFactory(); List<FunctionName> functionNameList = functionFactory.getFunctionNames(); FunctionName functionName = null; Expression expression = FunctionManager.getInstance().createExpression(functionName); assertNull(expression); boolean fail ... | /**
* Test method for {@link
* com.sldeditor.filter.v2.function.FunctionManager#createExpression(org.opengis.filter.capability.FunctionName)}.
*/ | Test method for <code>com.sldeditor.filter.v2.function.FunctionManager#createExpression(org.opengis.filter.capability.FunctionName)</code> | testCreateExpression | {
"repo_name": "robward-scisys/sldeditor",
"path": "modules/application/src/test/java/com/sldeditor/test/unit/filter/v2/function/FunctionManagerTest.java",
"license": "gpl-3.0",
"size": 9339
} | [
"com.sldeditor.filter.v2.function.FunctionManager",
"java.util.List",
"org.geotools.filter.function.DefaultFunctionFactory",
"org.junit.jupiter.api.Assertions",
"org.opengis.filter.capability.FunctionName",
"org.opengis.filter.expression.Expression"
] | import com.sldeditor.filter.v2.function.FunctionManager; import java.util.List; import org.geotools.filter.function.DefaultFunctionFactory; import org.junit.jupiter.api.Assertions; import org.opengis.filter.capability.FunctionName; import org.opengis.filter.expression.Expression; | import com.sldeditor.filter.v2.function.*; import java.util.*; import org.geotools.filter.function.*; import org.junit.jupiter.api.*; import org.opengis.filter.capability.*; import org.opengis.filter.expression.*; | [
"com.sldeditor.filter",
"java.util",
"org.geotools.filter",
"org.junit.jupiter",
"org.opengis.filter"
] | com.sldeditor.filter; java.util; org.geotools.filter; org.junit.jupiter; org.opengis.filter; | 2,472,907 |
@Test
public void debugFormattedStringWithSingleInt() {
logger.debugf("Hello %d!", 42);
if (debugEnabled) {
verify(provider).log(eq(2), isNull(), eq(Level.DEBUG), same(null), any(PrintfStyleFormatter.class), eq("Hello %d!"), eq(42));
} else {
verify(provider, never()).log(anyInt(), anyString(), any(), ... | void function() { logger.debugf(STR, 42); if (debugEnabled) { verify(provider).log(eq(2), isNull(), eq(Level.DEBUG), same(null), any(PrintfStyleFormatter.class), eq(STR), eq(42)); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any()); } } /** * Verifies that a formatted string... | /**
* Verifies that a formatted string with a single integer argument will be logged correctly at {@link Level#DEBUG
* DEBUG} level.
*/ | Verifies that a formatted string with a single integer argument will be logged correctly at <code>Level#DEBUG DEBUG</code> level | debugFormattedStringWithSingleInt | {
"repo_name": "pmwmedia/tinylog",
"path": "jboss-tinylog/src/test/java/org/tinylog/jboss/TinylogLoggerTest.java",
"license": "apache-2.0",
"size": 189291
} | [
"org.mockito.ArgumentMatchers",
"org.mockito.Mockito",
"org.tinylog.Level",
"org.tinylog.format.PrintfStyleFormatter"
] | import org.mockito.ArgumentMatchers; import org.mockito.Mockito; import org.tinylog.Level; import org.tinylog.format.PrintfStyleFormatter; | import org.mockito.*; import org.tinylog.*; import org.tinylog.format.*; | [
"org.mockito",
"org.tinylog",
"org.tinylog.format"
] | org.mockito; org.tinylog; org.tinylog.format; | 1,061,126 |
public static Artifact getLinkedArtifact(RuleContext ruleContext, LinkTargetType linkType) {
PathFragment name = new PathFragment(ruleContext.getLabel().getName());
if (linkType != LinkTargetType.EXECUTABLE) {
name = name.replaceName("lib" + name.getBaseName() + linkType.getExtension());
}
retu... | static Artifact function(RuleContext ruleContext, LinkTargetType linkType) { PathFragment name = new PathFragment(ruleContext.getLabel().getName()); if (linkType != LinkTargetType.EXECUTABLE) { name = name.replaceName("lib" + name.getBaseName() + linkType.getExtension()); } return ruleContext.getPackageRelativeArtifact... | /**
* Returns the linked artifact.
*/ | Returns the linked artifact | getLinkedArtifact | {
"repo_name": "whuwxl/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java",
"license": "apache-2.0",
"size": 25003
} | [
"com.google.devtools.build.lib.actions.Artifact",
"com.google.devtools.build.lib.analysis.RuleContext",
"com.google.devtools.build.lib.rules.cpp.Link",
"com.google.devtools.build.lib.vfs.PathFragment"
] | import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.rules.cpp.Link; import com.google.devtools.build.lib.vfs.PathFragment; | import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.rules.cpp.*; import com.google.devtools.build.lib.vfs.*; | [
"com.google.devtools"
] | com.google.devtools; | 2,050,626 |
Set<Class<?>> getInterfaces(); | Set<Class<?>> getInterfaces(); | /**
* Returns an immutable set of all the listener interfaces the underlying listener implements.
*
* @return an immutable set of all the listener interfaces the underlying listener implements
*/ | Returns an immutable set of all the listener interfaces the underlying listener implements | getInterfaces | {
"repo_name": "cakeframework/cake-container",
"path": "modules/org.cakeframework.base/src/main/java/org/cakeframework/listener/Listener.java",
"license": "apache-2.0",
"size": 8158
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,753,242 |
public void writeAnimatedGIF(BufferedImage[] images, int[] delays, OutputStream os) throws Exception {
// Header first
writeHeader(os, true);
Dimension logicalScreenSize = getLogicalScreenSize(images);
logicalScreenWidth = logicalScreenSize.width;
logicalScreenHeight = logicalScreenSize.height;
// We a... | void function(BufferedImage[] images, int[] delays, OutputStream os) throws Exception { writeHeader(os, true); Dimension logicalScreenSize = getLogicalScreenSize(images); logicalScreenWidth = logicalScreenSize.width; logicalScreenHeight = logicalScreenSize.height; animated = true; for (int i = 0; i < images.length; i++... | /**
* Writes an array of BufferedImage as an animated GIF
*
* @param images
* an array of BufferedImage
* @param delays
* delays in millisecond for each frame
* @param os
* OutputStream for the animated GIF
* @throws Exception
*/ | Writes an array of BufferedImage as an animated GIF | writeAnimatedGIF | {
"repo_name": "vjay82/Distributed-Classroom",
"path": "src/de/volkerGronau/distributedClassroom/AnimatedGIFWriter.java",
"license": "gpl-3.0",
"size": 56979
} | [
"java.awt.Dimension",
"java.awt.image.BufferedImage",
"java.io.OutputStream"
] | import java.awt.Dimension; import java.awt.image.BufferedImage; import java.io.OutputStream; | import java.awt.*; import java.awt.image.*; import java.io.*; | [
"java.awt",
"java.io"
] | java.awt; java.io; | 1,385,870 |
private void updateSession( final LockInfo lockInfo, boolean remove ) {
final HttpSession session = RpcContext.getHttpSession();
@SuppressWarnings("unchecked")
Set<LockInfo> locks = (Set<LockInfo>) session.getAttribute( LOCK_SESSION_ATTRIBUTE_NAME );
if ( remove ) {
... | void function( final LockInfo lockInfo, boolean remove ) { final HttpSession session = RpcContext.getHttpSession(); @SuppressWarnings(STR) Set<LockInfo> locks = (Set<LockInfo>) session.getAttribute( LOCK_SESSION_ATTRIBUTE_NAME ); if ( remove ) { if (locks != null) { locks.remove( lockInfo ); } } else { if ( locks == nu... | /**
* Updates the user's session to track all currently held locks so we can
* release locks on session expiry.
*
* @param lockInfo
* the lock to update
* @param remove
* true to remove the lock, false to add it
*/ | Updates the user's session to track all currently held locks so we can release locks on session expiry | updateSession | {
"repo_name": "psiroky/uberfire",
"path": "uberfire-backend/uberfire-backend-server/src/main/java/org/uberfire/backend/server/VFSLockServiceImpl.java",
"license": "apache-2.0",
"size": 10120
} | [
"java.util.HashSet",
"java.util.Set",
"javax.servlet.http.HttpSession",
"org.jboss.errai.bus.server.api.RpcContext",
"org.uberfire.backend.vfs.impl.LockInfo"
] | import java.util.HashSet; import java.util.Set; import javax.servlet.http.HttpSession; import org.jboss.errai.bus.server.api.RpcContext; import org.uberfire.backend.vfs.impl.LockInfo; | import java.util.*; import javax.servlet.http.*; import org.jboss.errai.bus.server.api.*; import org.uberfire.backend.vfs.impl.*; | [
"java.util",
"javax.servlet",
"org.jboss.errai",
"org.uberfire.backend"
] | java.util; javax.servlet; org.jboss.errai; org.uberfire.backend; | 1,555,897 |
public void saveClaim(Claim claim) {
if (DataManager.isNetworkAvailable()){
new SaveASyncTask().execute(claim.getclaimID());
}
local.saveClaims(ClaimListSingleton.getClaimList().getClaimArrayList(), DataManager.getCurrentContext());
} | void function(Claim claim) { if (DataManager.isNetworkAvailable()){ new SaveASyncTask().execute(claim.getclaimID()); } local.saveClaims(ClaimListSingleton.getClaimList().getClaimArrayList(), DataManager.getCurrentContext()); } | /**
* This saves a claim. If a local save is required... All claims are saved
* @param claim
*/ | This saves a claim. If a local save is required... All claims are saved | saveClaim | {
"repo_name": "CMPUT301W15T13/TravelPlanner",
"path": "TravelPlanner/src/persistanceController/DataManager.java",
"license": "apache-2.0",
"size": 7564
} | [
"ca.ualberta.cmput301w15t13.Controllers",
"ca.ualberta.cmput301w15t13.Models"
] | import ca.ualberta.cmput301w15t13.Controllers; import ca.ualberta.cmput301w15t13.Models; | import ca.ualberta.cmput301w15t13.*; | [
"ca.ualberta.cmput301w15t13"
] | ca.ualberta.cmput301w15t13; | 682,770 |
public static DragSource getDefaultDragSource() {
if (GraphicsEnvironment.isHeadless()) {
throw new HeadlessException();
} else {
return dflt;
}
} | static DragSource function() { if (GraphicsEnvironment.isHeadless()) { throw new HeadlessException(); } else { return dflt; } } | /**
* Gets the {@code DragSource} object associated with
* the underlying platform.
*
* @return the platform DragSource
* @exception HeadlessException if GraphicsEnvironment.isHeadless()
* returns true
* @see java.awt.GraphicsEnvironment#isHeadless
*/ | Gets the DragSource object associated with the underlying platform | getDefaultDragSource | {
"repo_name": "FauxFaux/jdk9-jdk",
"path": "src/java.desktop/share/classes/java/awt/dnd/DragSource.java",
"license": "gpl-2.0",
"size": 36280
} | [
"java.awt.GraphicsEnvironment",
"java.awt.HeadlessException"
] | import java.awt.GraphicsEnvironment; import java.awt.HeadlessException; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,053,121 |
Object loadChannelAcquisitionData(SecurityContext ctx, long channelID)
throws DSOutOfServiceException, DSAccessException
{
try {
IMetadataPrx service = gw.getMetadataService(ctx);
IQueryPrx query = gw.getQueryService(ctx);
List<Long> ids = new ArrayList<Long>(1);
ids.add(channelID);
... | Object loadChannelAcquisitionData(SecurityContext ctx, long channelID) throws DSOutOfServiceException, DSAccessException { try { IMetadataPrx service = gw.getMetadataService(ctx); IQueryPrx query = gw.getQueryService(ctx); List<Long> ids = new ArrayList<Long>(1); ids.add(channelID); List l = service.loadChannelAcquisit... | /**
* Loads the acquisition metadata related to the specified channel.
*
* @param ctx The security context.
* @param channelID The id of the channel.
* @return See above.
* @throws DSOutOfServiceException If the connection is broken, or logged
* in.
* @throws DSAccessEx... | Loads the acquisition metadata related to the specified channel | loadChannelAcquisitionData | {
"repo_name": "dominikl/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/env/data/OMEROGateway.java",
"license": "gpl-2.0",
"size": 262766
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 165,096 |
public static String addCSRFToken(String url)
{
Session session = SessionManager.getCurrentSession();
Object csrfToken = session.getAttribute(UsageSessionService.SAKAI_CSRF_SESSION_ATTRIBUTE);
if ( url.indexOf("?") < 0 ) {
url = url + "?";
} else {
url = url + "&";
}
ur... | static String function(String url) { Session session = SessionManager.getCurrentSession(); Object csrfToken = session.getAttribute(UsageSessionService.SAKAI_CSRF_SESSION_ATTRIBUTE); if ( url.indexOf("?") < 0 ) { url = url + "?"; } else { url = url + "&"; } url = url + STR + URLEncoder.encode(csrfToken.toString()); retu... | /**
* Build a URL, Adding Sakai's CSRF token
*/ | Build a URL, Adding Sakai's CSRF token | addCSRFToken | {
"repo_name": "puramshetty/sakai",
"path": "basiclti/basiclti-common/src/java/org/sakaiproject/basiclti/util/SakaiBLTIUtil.java",
"license": "apache-2.0",
"size": 76087
} | [
"java.net.URLEncoder",
"org.sakaiproject.event.cover.UsageSessionService",
"org.sakaiproject.tool.api.Session",
"org.sakaiproject.tool.cover.SessionManager"
] | import java.net.URLEncoder; import org.sakaiproject.event.cover.UsageSessionService; import org.sakaiproject.tool.api.Session; import org.sakaiproject.tool.cover.SessionManager; | import java.net.*; import org.sakaiproject.event.cover.*; import org.sakaiproject.tool.api.*; import org.sakaiproject.tool.cover.*; | [
"java.net",
"org.sakaiproject.event",
"org.sakaiproject.tool"
] | java.net; org.sakaiproject.event; org.sakaiproject.tool; | 1,552,631 |
private void sendHandshakeSetConfig() {
// Ensure we receive the full packet via PacketIn
// FIXME: We don't set the reassembly flags.
OFSetConfig configSet = factory.buildSetConfig()
.setXid(handshakeTransactionIds--)
.setMissSendLen(0xffff)
.build();
// Barrier
OFBarrierRequest barrier = fac... | void function() { OFSetConfig configSet = factory.buildSetConfig() .setXid(handshakeTransactionIds--) .setMissSendLen(0xffff) .build(); OFBarrierRequest barrier = factory.buildBarrierRequest() .setXid(handshakeTransactionIds--) .build(); OFGetConfigRequest configReq = factory.buildGetConfigRequest() .setXid(handshakeTr... | /**
* Send the configuration requests to tell the switch we want full
* packets
* @throws IOException
*/ | Send the configuration requests to tell the switch we want full packets | sendHandshakeSetConfig | {
"repo_name": "rizard/fast-failover-demo",
"path": "src/main/java/net/floodlightcontroller/core/internal/OFSwitchHandshakeHandler.java",
"license": "apache-2.0",
"size": 62049
} | [
"com.google.common.collect.ImmutableList",
"java.util.List",
"org.projectfloodlight.openflow.protocol.OFBarrierRequest",
"org.projectfloodlight.openflow.protocol.OFGetConfigRequest",
"org.projectfloodlight.openflow.protocol.OFMessage",
"org.projectfloodlight.openflow.protocol.OFSetConfig"
] | import com.google.common.collect.ImmutableList; import java.util.List; import org.projectfloodlight.openflow.protocol.OFBarrierRequest; import org.projectfloodlight.openflow.protocol.OFGetConfigRequest; import org.projectfloodlight.openflow.protocol.OFMessage; import org.projectfloodlight.openflow.protocol.OFSetConfig; | import com.google.common.collect.*; import java.util.*; import org.projectfloodlight.openflow.protocol.*; | [
"com.google.common",
"java.util",
"org.projectfloodlight.openflow"
] | com.google.common; java.util; org.projectfloodlight.openflow; | 1,402,766 |
return ShardingDataSourceFactory.createDataSource(dataSourceMap, new ShardingRuleConfigurationYamlSwapper().swap(shardingRule), props.getProps());
} | return ShardingDataSourceFactory.createDataSource(dataSourceMap, new ShardingRuleConfigurationYamlSwapper().swap(shardingRule), props.getProps()); } | /**
* Get sharding data source bean.
*
* @return data source bean
* @throws SQLException SQL exception
*/ | Get sharding data source bean | shardingDataSource | {
"repo_name": "shardingjdbc/sharding-jdbc",
"path": "sharding-spring/sharding-jdbc-spring/sharding-jdbc-spring-boot-starter/src/main/java/org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.java",
"license": "apache-2.0",
"size": 9721
} | [
"org.apache.shardingsphere.core.yaml.swapper.ShardingRuleConfigurationYamlSwapper",
"org.apache.shardingsphere.shardingjdbc.api.ShardingDataSourceFactory"
] | import org.apache.shardingsphere.core.yaml.swapper.ShardingRuleConfigurationYamlSwapper; import org.apache.shardingsphere.shardingjdbc.api.ShardingDataSourceFactory; | import org.apache.shardingsphere.core.yaml.swapper.*; import org.apache.shardingsphere.shardingjdbc.api.*; | [
"org.apache.shardingsphere"
] | org.apache.shardingsphere; | 2,078,637 |
public static <V,E> Graph<V,E> generateMixedRandomGraph(
Factory<Graph<V,E>> graphFactory,
Factory<V> vertexFactory,
Factory<E> edgeFactory,
Map<E,Number> edge_weights,
int num_vertices, boolean parallel, Set<V> seedVertices)
{
int seed = (int)(Math.random() * 10000)... | static <V,E> Graph<V,E> function( Factory<Graph<V,E>> graphFactory, Factory<V> vertexFactory, Factory<E> edgeFactory, Map<E,Number> edge_weights, int num_vertices, boolean parallel, Set<V> seedVertices) { int seed = (int)(Math.random() * 10000); BarabasiAlbertGenerator<V,E> bag = new BarabasiAlbertGenerator<V,E>(graphF... | /**
* Returns a random mixed-mode graph. Starts with a randomly generated
* Barabasi-Albert (preferential attachment) generator
* (4 initial vertices, 3 edges added at each step, and num_vertices - 4 evolution steps).
* Then takes the resultant graph, replaces random undirected edges with directe... | Returns a random mixed-mode graph. Starts with a randomly generated Barabasi-Albert (preferential attachment) generator (4 initial vertices, 3 edges added at each step, and num_vertices - 4 evolution steps). Then takes the resultant graph, replaces random undirected edges with directed edges, and assigns random weights... | generateMixedRandomGraph | {
"repo_name": "aryantaheri/controller",
"path": "third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/MixedRandomGraphGenerator.java",
"license": "epl-1.0",
"size": 2988
} | [
"edu.uci.ics.jung.graph.Graph",
"edu.uci.ics.jung.graph.util.EdgeType",
"java.util.Map",
"java.util.Set",
"org.apache.commons.collections15.Factory"
] | import edu.uci.ics.jung.graph.Graph; import edu.uci.ics.jung.graph.util.EdgeType; import java.util.Map; import java.util.Set; import org.apache.commons.collections15.Factory; | import edu.uci.ics.jung.graph.*; import edu.uci.ics.jung.graph.util.*; import java.util.*; import org.apache.commons.collections15.*; | [
"edu.uci.ics",
"java.util",
"org.apache.commons"
] | edu.uci.ics; java.util; org.apache.commons; | 1,780,160 |
public NestedSet<Artifact> getArchiveSourceMappingFiles() {
return archiveSourceMappingFiles;
}
public static final class Builder {
private final NestedSetBuilder<Artifact> headerMappingFiles = NestedSetBuilder.stableOrder();
private final NestedSetBuilder<Artifact> classMappingFiles = NestedSetBu... | NestedSet<Artifact> function() { return archiveSourceMappingFiles; } public static final class Builder { private final NestedSetBuilder<Artifact> headerMappingFiles = NestedSetBuilder.stableOrder(); private final NestedSetBuilder<Artifact> classMappingFiles = NestedSetBuilder.stableOrder(); private final NestedSetBuild... | /**
* Returns the files containing mappings between J2ObjC static library archives and their
* associated J2ObjC-translated source files. When flag --j2objc_dead_code_removal is specified,
* they are used to strip unused object files inside J2ObjC static libraries before the linking
* action at binary level... | Returns the files containing mappings between J2ObjC static library archives and their associated J2ObjC-translated source files. When flag --j2objc_dead_code_removal is specified, they are used to strip unused object files inside J2ObjC static libraries before the linking action at binary level | getArchiveSourceMappingFiles | {
"repo_name": "davidzchen/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcMappingFileProvider.java",
"license": "apache-2.0",
"size": 6164
} | [
"com.google.devtools.build.lib.actions.Artifact",
"com.google.devtools.build.lib.collect.nestedset.NestedSet",
"com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder"
] | import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; | import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.collect.nestedset.*; | [
"com.google.devtools"
] | com.google.devtools; | 64,279 |
public void addProjectAsMember(Project project) {
if (this.projectsAsMember == null) {
this.projectsAsMember = new HashSet<Project>();
}
if (!this.projectsAsMember.contains(project)) {
this.projectsAsMember.add(project);
}
} | void function(Project project) { if (this.projectsAsMember == null) { this.projectsAsMember = new HashSet<Project>(); } if (!this.projectsAsMember.contains(project)) { this.projectsAsMember.add(project); } } | /**
* Adds a project as member to the projects set
*
* @param project
*/ | Adds a project as member to the projects set | addProjectAsMember | {
"repo_name": "bernfried/SimplePRP",
"path": "SimplePRP/src/main/java/de/webertise/simpleprp/model/User.java",
"license": "gpl-2.0",
"size": 18738
} | [
"java.util.HashSet"
] | import java.util.HashSet; | import java.util.*; | [
"java.util"
] | java.util; | 2,655,463 |
boolean fixFile(Path srcPath, Progressable progress) throws IOException {
if (RaidNode.isParityHarPartFile(srcPath)) {
return processCorruptParityHarPartFile(srcPath, progress);
}
// The corrupted file is a XOR parity file
if (isXorParityFile(srcPath)) {
return processCorru... | boolean fixFile(Path srcPath, Progressable progress) throws IOException { if (RaidNode.isParityHarPartFile(srcPath)) { return processCorruptParityHarPartFile(srcPath, progress); } if (isXorParityFile(srcPath)) { return processCorruptParityFile(srcPath, xorEncoder, progress); } if (isRsParityFile(srcPath)) { return proc... | /**
* Fix a file, report progess.
*
* @return true if file has been fixed, false if no fixing
* was necessary or possible.
*/ | Fix a file, report progess | fixFile | {
"repo_name": "jchen123/hadoop-20-warehouse-fix",
"path": "src/contrib/raid/src/java/org/apache/hadoop/raid/BlockFixer.java",
"license": "apache-2.0",
"size": 36163
} | [
"java.io.IOException",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.util.Progressable"
] | import java.io.IOException; import org.apache.hadoop.fs.Path; import org.apache.hadoop.util.Progressable; | import java.io.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.util.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,281,243 |
@InterfaceAudience.Private
@InterfaceStability.Unstable
public void setResourceValue(int index, long value)
throws ResourceNotFoundException {
try {
resources[index].setValue(value);
} catch (ArrayIndexOutOfBoundsException e) {
throwExceptionWhenArrayOutOfBound(index);
}
} | @InterfaceAudience.Private @InterfaceStability.Unstable void function(int index, long value) throws ResourceNotFoundException { try { resources[index].setValue(value); } catch (ArrayIndexOutOfBoundsException e) { throwExceptionWhenArrayOutOfBound(index); } } | /**
* Set the value of a resource in the ResourceInformation object. The unit of
* the value is assumed to be the one in the ResourceInformation object.
*
* @param index
* the resource index for which the value is provided.
* @param value
* the value to set
* @throws ResourceNo... | Set the value of a resource in the ResourceInformation object. The unit of the value is assumed to be the one in the ResourceInformation object | setResourceValue | {
"repo_name": "szegedim/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Resource.java",
"license": "apache-2.0",
"size": 17970
} | [
"org.apache.hadoop.classification.InterfaceAudience",
"org.apache.hadoop.classification.InterfaceStability",
"org.apache.hadoop.yarn.exceptions.ResourceNotFoundException"
] | import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.yarn.exceptions.ResourceNotFoundException; | import org.apache.hadoop.classification.*; import org.apache.hadoop.yarn.exceptions.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,691,953 |
public Scan addColumn(byte [] family, byte [] qualifier) {
NavigableSet<byte []> set = familyMap.get(family);
if(set == null) {
set = new TreeSet<byte []>(Bytes.BYTES_COMPARATOR);
}
if (qualifier != null) {
set.add(qualifier);
}
familyMap.put(family, set);
return this;
} | Scan function(byte [] family, byte [] qualifier) { NavigableSet<byte []> set = familyMap.get(family); if(set == null) { set = new TreeSet<byte []>(Bytes.BYTES_COMPARATOR); } if (qualifier != null) { set.add(qualifier); } familyMap.put(family, set); return this; } | /**
* Get the column from the specified family with the specified qualifier.
* <p>
* Overrides previous calls to addFamily for this family.
* @param family family name
* @param qualifier column qualifier
* @return this
*/ | Get the column from the specified family with the specified qualifier. Overrides previous calls to addFamily for this family | addColumn | {
"repo_name": "matteobertozzi/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/client/Scan.java",
"license": "apache-2.0",
"size": 20737
} | [
"java.util.NavigableSet",
"java.util.TreeSet",
"org.apache.hadoop.hbase.util.Bytes"
] | import java.util.NavigableSet; import java.util.TreeSet; import org.apache.hadoop.hbase.util.Bytes; | import java.util.*; import org.apache.hadoop.hbase.util.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 2,682,390 |
@Override
protected void processNormalInputFile(final File inputFile) {
boolean abortDueToUnknownRecordType = false;
BufferedReader in = null;
try {
InputStream fileInputStream = new FileInputStream(inputFile);
if (this.shouldDecompress) {
@SuppressWarnings("resource")
final ZipInputStream zipIn... | void function(final File inputFile) { boolean abortDueToUnknownRecordType = false; BufferedReader in = null; try { InputStream fileInputStream = new FileInputStream(inputFile); if (this.shouldDecompress) { @SuppressWarnings(STR) final ZipInputStream zipInputStream = new ZipInputStream(fileInputStream); zipInputStream.g... | /**
* Reads the records contained in the given normal file and passes them to the registered {@link #recordReceiver}.
*
* @param inputFile
* The input file which should be processed.
*/ | Reads the records contained in the given normal file and passes them to the registered <code>#recordReceiver</code> | processNormalInputFile | {
"repo_name": "HaStr/kieker",
"path": "kieker-analysis/src/kieker/analysis/plugin/reader/filesystem/AsciiLogReaderThread.java",
"license": "apache-2.0",
"size": 10387
} | [
"java.io.BufferedReader",
"java.io.File",
"java.io.FileInputStream",
"java.io.IOException",
"java.io.InputStream",
"java.io.InputStreamReader",
"java.util.Arrays",
"java.util.zip.ZipInputStream"
] | import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Arrays; import java.util.zip.ZipInputStream; | import java.io.*; import java.util.*; import java.util.zip.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,688,440 |
String factory = super.getFactoryClassName();
if (factory != null) {
return factory;
} else {
factory = System.getProperty(Context.OBJECT_FACTORIES);
if (factory != null) {
return null;
} else {
return DEFAULT_FACTORY;
... | String factory = super.getFactoryClassName(); if (factory != null) { return factory; } else { factory = System.getProperty(Context.OBJECT_FACTORIES); if (factory != null) { return null; } else { return DEFAULT_FACTORY; } } } | /**
* Retrieves the class name of the factory of the object to which this
* reference refers.
*/ | Retrieves the class name of the factory of the object to which this reference refers | getFactoryClassName | {
"repo_name": "WhiteBearSolutions/WBSAirback",
"path": "packages/wbsairback-tomcat/wbsairback-tomcat-7.0.22/java/org/apache/naming/ResourceRef.java",
"license": "apache-2.0",
"size": 5092
} | [
"javax.naming.Context"
] | import javax.naming.Context; | import javax.naming.*; | [
"javax.naming"
] | javax.naming; | 1,246,244 |
public String getRelativeSupportFormatted(int databaseSize) {
// calculate the support
double support = ((double)getAbsoluteSupport()) / ((double) databaseSize);
// Format to appear with two decimals
DecimalFormat format = new DecimalFormat();
format.setMinimumFractionDigits(0);
format.setMaximumF... | String function(int databaseSize) { double support = ((double)getAbsoluteSupport()) / ((double) databaseSize); DecimalFormat format = new DecimalFormat(); format.setMinimumFractionDigits(0); format.setMaximumFractionDigits(5); return format.format(support); } | /**
* Get the relative support of this pattern as a percentage with
* two decimals (string)
* @param databaseSize the database size
* @return the relative support as a string
*/ | Get the relative support of this pattern as a percentage with two decimals (string) | getRelativeSupportFormatted | {
"repo_name": "pommedeterresautee/spmf",
"path": "ca/pfv/spmf/algorithms/sequentialpatterns/fournier2008_seqdim/multidimensionalpatterns/MDPattern.java",
"license": "gpl-3.0",
"size": 7823
} | [
"java.text.DecimalFormat"
] | import java.text.DecimalFormat; | import java.text.*; | [
"java.text"
] | java.text; | 576,237 |
public BlobKey put(final byte[] value, final int offset, final int len) throws IOException {
return putBuffer(null, null, value, offset, len);
} | BlobKey function(final byte[] value, final int offset, final int len) throws IOException { return putBuffer(null, null, value, offset, len); } | /**
* Uploads data from the given byte array to the BLOB server in a content-addressable manner.
*
* @param value
* the buffer to upload data from
* @param offset
* the read offset within the buffer
* @param len
* the number of bytes to upload from the buffer
* @return the comput... | Uploads data from the given byte array to the BLOB server in a content-addressable manner | put | {
"repo_name": "citlab/vs.msc.ws14",
"path": "flink-0-7-custom/flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobClient.java",
"license": "apache-2.0",
"size": 16748
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,942,865 |
public List<ObjectMapper> getNestedMappers() {
List<ObjectMapper> childMappers = new ArrayList<>();
for (ObjectMapper mapper : objectMappers().values()) {
if (mapper.nested().isNested() == false) {
continue;
}
childMappers.add(mapper);
}
... | List<ObjectMapper> function() { List<ObjectMapper> childMappers = new ArrayList<>(); for (ObjectMapper mapper : objectMappers().values()) { if (mapper.nested().isNested() == false) { continue; } childMappers.add(mapper); } return childMappers; } | /**
* Returns all nested object mappers
*/ | Returns all nested object mappers | getNestedMappers | {
"repo_name": "nknize/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/index/mapper/MappingLookup.java",
"license": "apache-2.0",
"size": 15277
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,418,116 |
User confirm(String code); | User confirm(String code); | /**
* Try to confirm the the user.
*
* @param code The confirmation code of the {@link User}.
*
* @return If the user could be confirmed.
*/ | Try to confirm the the user | confirm | {
"repo_name": "autermann/enviroCar-server",
"path": "core/src/main/java/org/envirocar/server/core/dao/UserDao.java",
"license": "agpl-3.0",
"size": 2263
} | [
"org.envirocar.server.core.entities.User"
] | import org.envirocar.server.core.entities.User; | import org.envirocar.server.core.entities.*; | [
"org.envirocar.server"
] | org.envirocar.server; | 2,252,137 |
public ResponseAPDU sendIncrease() throws CardServiceException {
return null; // TODO
} | ResponseAPDU function() throws CardServiceException { return null; } | /**
* Described in 9.2.8 of ETSI TS 100 977.
*
* @throws CardServiceException
* if something goes wrong.
*/ | Described in 9.2.8 of ETSI TS 100 977 | sendIncrease | {
"repo_name": "credentials/smartcardjs",
"path": "ext/scuba/simservice/src/net/sourceforge/scuba/simservice/SIMAPDUService.java",
"license": "gpl-3.0",
"size": 8819
} | [
"javax.smartcardio.ResponseAPDU",
"net.sourceforge.scuba.smartcards.CardServiceException"
] | import javax.smartcardio.ResponseAPDU; import net.sourceforge.scuba.smartcards.CardServiceException; | import javax.smartcardio.*; import net.sourceforge.scuba.smartcards.*; | [
"javax.smartcardio",
"net.sourceforge.scuba"
] | javax.smartcardio; net.sourceforge.scuba; | 39,656 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<DatastoreInner>> listNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.... | @ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<DatastoreInner>> function(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException(STR)); } if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String accept = STR; retur... | /**
* Get the next page of items.
*
* @param nextLink The nextLink parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked excepti... | Get the next page of items | listNextSinglePageAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java",
"license": "mit",
"size": 60129
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedResponse",
"com.azure.core.http.rest.PagedResponseBase",
"com.azure.core.util.FluxUtil",
"com.azure.resourcemanager.avs.fluent.models.DatastoreInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.avs.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,633,092 |
public Abraham fetchCanonical(int hash, int snarfID, int index) {
throw new SubclassResponsibilityException();
} | Abraham function(int hash, int snarfID, int index) { throw new SubclassResponsibilityException(); } | /**
* If something is already imaged at that location, then return it. If there is already
* an existing stub with the same hash at a different location, follow them both till we
* know that they are actually different objects.
*/ | If something is already imaged at that location, then return it. If there is already an existing stub with the same hash at a different location, follow them both till we know that they are actually different objects | fetchCanonical | {
"repo_name": "jonesd/udanax-gold2java",
"path": "abora-gold/src/generated-sources/translator/info/dgjones/abora/gold/snarf/DiskManager.java",
"license": "mit",
"size": 23713
} | [
"info.dgjones.abora.gold.java.exception.SubclassResponsibilityException",
"info.dgjones.abora.gold.snarf.Abraham"
] | import info.dgjones.abora.gold.java.exception.SubclassResponsibilityException; import info.dgjones.abora.gold.snarf.Abraham; | import info.dgjones.abora.gold.java.exception.*; import info.dgjones.abora.gold.snarf.*; | [
"info.dgjones.abora"
] | info.dgjones.abora; | 2,766,369 |
private void jumpTo(final DMTFile aDirectory) {
mStepsBack = 0;
browseTo(aDirectory);
} | void function(final DMTFile aDirectory) { mStepsBack = 0; browseTo(aDirectory); } | /**
* Jump to some location by clicking on a directory button.
*
* This resets the counter for "back" actions.
*
* @param aDirectory
*/ | Jump to some location by clicking on a directory button. This resets the counter for "back" actions | jumpTo | {
"repo_name": "vikingbrain/droidedmediatank",
"path": "app/src/main/java/com/vikingbrain/dmt/oi/filemanager/FileManagerActivity_OLD.java",
"license": "apache-2.0",
"size": 58684
} | [
"com.vikingbrain.dmt.pojo.DMTFile"
] | import com.vikingbrain.dmt.pojo.DMTFile; | import com.vikingbrain.dmt.pojo.*; | [
"com.vikingbrain.dmt"
] | com.vikingbrain.dmt; | 372,936 |
private User getActiveUser() throws IOException {
User user = RpcServer.getRequestUser();
if (user == null) {
// for non-rpc handling, fallback to system user
user = userProvider.getCurrent();
}
return user;
} | User function() throws IOException { User user = RpcServer.getRequestUser(); if (user == null) { user = userProvider.getCurrent(); } return user; } | /**
* Returns the active user to which authorization checks should be applied.
* If we are in the context of an RPC call, the remote user is used,
* otherwise the currently logged in user is used.
*/ | Returns the active user to which authorization checks should be applied. If we are in the context of an RPC call, the remote user is used, otherwise the currently logged in user is used | getActiveUser | {
"repo_name": "andrewmains12/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java",
"license": "apache-2.0",
"size": 106295
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.ipc.RpcServer",
"org.apache.hadoop.hbase.security.User"
] | import java.io.IOException; import org.apache.hadoop.hbase.ipc.RpcServer; import org.apache.hadoop.hbase.security.User; | import java.io.*; import org.apache.hadoop.hbase.ipc.*; import org.apache.hadoop.hbase.security.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 2,468,567 |
GLGraph g1;
g1 = GLFactory.path(4);
g1.show();
if(GLAlgorithm.isRegular(g1))
System.out.println(g1.getName() + " is regular.");
else System.out.println(g1.getName() + " is not regular.");
GLGraph g2 = new GLGraph("Circuit 4");
g2.addV... | GLGraph g1; g1 = GLFactory.path(4); g1.show(); if(GLAlgorithm.isRegular(g1)) System.out.println(g1.getName() + STR); else System.out.println(g1.getName() + STR); GLGraph g2 = new GLGraph(STR); g2.addVertex("a"); g2.addVertex("b"); g2.addVertex("c"); g2.addVertex("d"); g2.addEdge("a", "b"); g2.addEdge("b", "c"); g2.addE... | /**
* It contains two minimal examples to use the library.
*
* @author Esdras Lins Bispo Jr.
*/ | It contains two minimal examples to use the library | main | {
"repo_name": "FreeUFG/GraphLib",
"path": "src/mainpackage/Controller.java",
"license": "gpl-3.0",
"size": 1809
} | [
"br.ufg.caj.graphlib.GLAlgorithm",
"br.ufg.caj.graphlib.GLFactory",
"br.ufg.caj.graphlib.GLGraph"
] | import br.ufg.caj.graphlib.GLAlgorithm; import br.ufg.caj.graphlib.GLFactory; import br.ufg.caj.graphlib.GLGraph; | import br.ufg.caj.graphlib.*; | [
"br.ufg.caj"
] | br.ufg.caj; | 359,797 |
private String getPropertyValue(String key, String input) {
// the key may be a function, so lets check this first
if (propertiesComponent != null) {
for (PropertiesFunction function : propertiesComponent.getFunctions().values()) {
String token = func... | String function(String key, String input) { if (propertiesComponent != null) { for (PropertiesFunction function : propertiesComponent.getFunctions().values()) { String token = function.getName() + ":"; if (key.startsWith(token)) { String remainder = key.substring(token.length()); log.debug(STR, key, function.getName())... | /**
* Gets the value of the property with given key
*
* @param key Key of the property
* @param input Input string (used for exception message if value not found)
* @return Value of the property with the given key
*/ | Gets the value of the property with given key | getPropertyValue | {
"repo_name": "jamesnetherton/camel",
"path": "camel-core/src/main/java/org/apache/camel/component/properties/DefaultPropertiesParser.java",
"license": "apache-2.0",
"size": 15711
} | [
"org.apache.camel.util.StringHelper"
] | import org.apache.camel.util.StringHelper; | import org.apache.camel.util.*; | [
"org.apache.camel"
] | org.apache.camel; | 2,543,730 |
ManifestLoader loader = new ManifestLoader();
List<Manifest> manifests = loader.getManifests();
assertNotNull(manifests);
assertTrue(manifests.size() > 0);
Manifest slf4jApiManifest = null;
for (Manifest manifest : manifests) {
String implementationTitle = ManifestLoader.getValue(m... | ManifestLoader loader = new ManifestLoader(); List<Manifest> manifests = loader.getManifests(); assertNotNull(manifests); assertTrue(manifests.size() > 0); Manifest slf4jApiManifest = null; for (Manifest manifest : manifests) { String implementationTitle = ManifestLoader.getValue(manifest, Attributes.Name.IMPLEMENTATIO... | /**
* Tests the content of the manifest from the servlet-api that is added as test-dependency especially for
* this test.
*
* @throws IOException on error.
*/ | Tests the content of the manifest from the servlet-api that is added as test-dependency especially for this test | testLoader | {
"repo_name": "m-m-m/util",
"path": "reflect/src/test/java/net/sf/mmm/util/reflect/base/ManifestLoaderTest.java",
"license": "apache-2.0",
"size": 1885
} | [
"java.util.List",
"java.util.jar.Attributes",
"java.util.jar.Manifest",
"org.junit.Assert"
] | import java.util.List; import java.util.jar.Attributes; import java.util.jar.Manifest; import org.junit.Assert; | import java.util.*; import java.util.jar.*; import org.junit.*; | [
"java.util",
"org.junit"
] | java.util; org.junit; | 2,722,475 |
public void reportRemovedFunction(Node functionNode, Node declaringBlock) {
// Depends when we were notified, functionNode.getParent might or might
// not be null. We are going to force the user to tell us the parent
// instead.
if (removedFunctions.add(functionNode)) {
hasChanged = ... | void function(Node functionNode, Node declaringBlock) { if (removedFunctions.add(functionNode)) { hasChanged = true; removedFunctionToBlock.put(functionNode, declaringBlock); } } /** * Returns true if the function can be fixed up (that is, if it can be * safely removed or specialized). * * <p>In order to be safely fixe... | /**
* Reports that a function has been removed.
*
* @param functionNode A removed AST node with type Token.FUNCTION
* @param declaringBlock If the function declaration puts a variable in the
* scope, we need to have a VAR statement in the scope where the
* function is declared. Null ... | Reports that a function has been removed | reportRemovedFunction | {
"repo_name": "arcadoss/js-invulnerable",
"path": "src/com/google/javascript/jscomp/SpecializeModule.java",
"license": "apache-2.0",
"size": 25253
} | [
"com.google.javascript.rhino.Node"
] | import com.google.javascript.rhino.Node; | import com.google.javascript.rhino.*; | [
"com.google.javascript"
] | com.google.javascript; | 2,433,874 |
@Override
protected Timeseries processData(Timeseries data) {
Timeseries result;
List<TimeseriesPoint> list;
long timestamp;
long last;
long step;
List<TimeseriesPoint> closest;
double value;
result = data.getHeader();
list = data.toList();
step = Ma... | Timeseries function(Timeseries data) { Timeseries result; List<TimeseriesPoint> list; long timestamp; long last; long step; List<TimeseriesPoint> closest; double value; result = data.getHeader(); list = data.toList(); step = Math.round(m_Interval * 1000); timestamp = list.get(0).getTimestamp().getTime(); last = list.ge... | /**
* Performs the actual filtering.
*
* @param data the data to filter
* @return the filtered data
*/ | Performs the actual filtering | processData | {
"repo_name": "waikato-datamining/adams-base",
"path": "adams-timeseries/src/main/java/adams/data/filter/TimeseriesChangeResolution.java",
"license": "gpl-3.0",
"size": 7697
} | [
"java.util.Date",
"java.util.List"
] | import java.util.Date; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,445,079 |
public byte[] execute(PageSource source,Resource classFile) throws BytecodeException {
Resource p = classFile.getParentResource().getRealResource(classFile.getName()+".txt");
List<LitString> keys=new ArrayList<LitString>();
ClassWriter cw = ASMUtil.getClassWriter();
... | byte[] function(PageSource source,Resource classFile) throws BytecodeException { Resource p = classFile.getParentResource().getRealResource(classFile.getName()+".txt"); List<LitString> keys=new ArrayList<LitString>(); ClassWriter cw = ASMUtil.getClassWriter(); ArrayList<String> imports = new ArrayList<String>(); getImp... | /**
* result byte code as binary array
* @param classFile
* @return byte code
* @throws IOException
* @throws TemplateException
*/ | result byte code as binary array | execute | {
"repo_name": "jzuijlek/Lucee4",
"path": "lucee-java/lucee-core/src/lucee/transformer/bytecode/Page.java",
"license": "lgpl-2.1",
"size": 50636
} | [
"java.util.ArrayList",
"java.util.Iterator",
"java.util.List",
"org.objectweb.asm.ClassWriter",
"org.objectweb.asm.FieldVisitor",
"org.objectweb.asm.Opcodes",
"org.objectweb.asm.Type",
"org.objectweb.asm.commons.GeneratorAdapter",
"org.objectweb.asm.commons.Method"
] | import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.FieldVisitor; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; import org.objectweb.asm.commons.GeneratorAdapter; import org.objectweb.asm.commons.Method; | import java.util.*; import org.objectweb.asm.*; import org.objectweb.asm.commons.*; | [
"java.util",
"org.objectweb.asm"
] | java.util; org.objectweb.asm; | 2,390,625 |
private boolean mkdirs0(@Nullable File dir) {
if (dir == null)
return true; // Nothing to create.
if (dir.exists())
// Already exists, so no-op.
return dir.isDirectory();
else {
File parentDir = dir.getParentFile();
if (!mkdirs0(p... | boolean function(@Nullable File dir) { if (dir == null) return true; if (dir.exists()) return dir.isDirectory(); else { File parentDir = dir.getParentFile(); if (!mkdirs0(parentDir)) return false; boolean res = dir.mkdir(); if (!res) res = dir.exists(); return res; } } | /**
* Create directories.
*
* @param dir Directory.
* @return Result.
*/ | Create directories | mkdirs0 | {
"repo_name": "SomeFire/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/igfs/secondary/local/LocalIgfsSecondaryFileSystem.java",
"license": "apache-2.0",
"size": 19436
} | [
"java.io.File",
"org.jetbrains.annotations.Nullable"
] | import java.io.File; import org.jetbrains.annotations.Nullable; | import java.io.*; import org.jetbrains.annotations.*; | [
"java.io",
"org.jetbrains.annotations"
] | java.io; org.jetbrains.annotations; | 1,101,793 |
@TargetApi(Build.VERSION_CODES.KITKAT)
private void dimStatusBar(boolean dim) {
if (dim || mIsLocked)
mActionBar.hide();
else
mActionBar.show();
if (!AndroidUtil.isHoneycombOrLater() || mIsNavMenu)
return;
int visibility = 0;
int navbar... | @TargetApi(Build.VERSION_CODES.KITKAT) void function(boolean dim) { if (dim mIsLocked) mActionBar.hide(); else mActionBar.show(); if (!AndroidUtil.isHoneycombOrLater() mIsNavMenu) return; int visibility = 0; int navbar = 0; if (AndroidUtil.isJellyBeanOrLater()) { visibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE View.SYST... | /**
* Dim the status bar and/or navigation icons when needed on Android 3.x.
* Hide it on Android 4.0 and later
*/ | Dim the status bar and/or navigation icons when needed on Android 3.x. Hide it on Android 4.0 and later | dimStatusBar | {
"repo_name": "Apolunor/vlc-android-sdk",
"path": "vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java",
"license": "gpl-2.0",
"size": 131939
} | [
"android.annotation.TargetApi",
"android.os.Build",
"android.view.View",
"android.view.ViewGroup",
"android.view.WindowManager",
"org.videolan.libvlc.util.AndroidUtil",
"org.videolan.vlc.util.AndroidDevices"
] | import android.annotation.TargetApi; import android.os.Build; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import org.videolan.libvlc.util.AndroidUtil; import org.videolan.vlc.util.AndroidDevices; | import android.annotation.*; import android.os.*; import android.view.*; import org.videolan.libvlc.util.*; import org.videolan.vlc.util.*; | [
"android.annotation",
"android.os",
"android.view",
"org.videolan.libvlc",
"org.videolan.vlc"
] | android.annotation; android.os; android.view; org.videolan.libvlc; org.videolan.vlc; | 789,333 |
public static <T> T[] reverseEach(T[] self, @ClosureParams(FirstParam.Component.class) Closure closure) {
each(new ReverseListIterator<>(Arrays.asList(self)), closure);
return self;
}
/**
* Used to determine if the given predicate closure is valid (i.e. returns
* <code>true</code>... | static <T> T[] function(T[] self, @ClosureParams(FirstParam.Component.class) Closure closure) { each(new ReverseListIterator<>(Arrays.asList(self)), closure); return self; } /** * Used to determine if the given predicate closure is valid (i.e. returns * <code>true</code> for all items in this data structure). * A simpl... | /**
* Iterate over each element of the array in the reverse order.
*
* @param self an array
* @param closure a closure to which each item is passed
* @return the original array
* @since 1.5.2
*/ | Iterate over each element of the array in the reverse order | reverseEach | {
"repo_name": "apache/incubator-groovy",
"path": "src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java",
"license": "apache-2.0",
"size": 703151
} | [
"groovy.lang.Closure",
"groovy.transform.stc.ClosureParams",
"groovy.transform.stc.FirstParam",
"java.util.Arrays"
] | import groovy.lang.Closure; import groovy.transform.stc.ClosureParams; import groovy.transform.stc.FirstParam; import java.util.Arrays; | import groovy.lang.*; import groovy.transform.stc.*; import java.util.*; | [
"groovy.lang",
"groovy.transform.stc",
"java.util"
] | groovy.lang; groovy.transform.stc; java.util; | 2,620,488 |
public CrpProgramOutcome getCrpProgramOutcome(String composedId, Phase phase);
| CrpProgramOutcome function(String composedId, Phase phase); | /**
* This method finds a CrpProgramOutcome by composeId and phase
*
* @param composedId
* @param phase
* @return a CrpProgramOutcome object.
*/ | This method finds a CrpProgramOutcome by composeId and phase | getCrpProgramOutcome | {
"repo_name": "CCAFS/MARLO",
"path": "marlo-data/src/main/java/org/cgiar/ccafs/marlo/data/manager/CrpProgramOutcomeManager.java",
"license": "gpl-3.0",
"size": 4122
} | [
"org.cgiar.ccafs.marlo.data.model.CrpProgramOutcome",
"org.cgiar.ccafs.marlo.data.model.Phase"
] | import org.cgiar.ccafs.marlo.data.model.CrpProgramOutcome; import org.cgiar.ccafs.marlo.data.model.Phase; | import org.cgiar.ccafs.marlo.data.model.*; | [
"org.cgiar.ccafs"
] | org.cgiar.ccafs; | 197,343 |
public static String encodeCompoundKeyValues(
Object[] keyValues,
Object[] keyExchanges
)
{
// normal overhead is 1, but add 2 for encoding growth
int keyValueSize = getKeyValueArraySize(keyValues, 3);
// normal overhead is 1, but add for encoding growth
int keyExchangesSize = getKeyVa... | static String function( Object[] keyValues, Object[] keyExchanges ) { int keyValueSize = getKeyValueArraySize(keyValues, 3); int keyExchangesSize = getKeyValueArraySize(keyExchanges, 3); if (keyValueSize > 0 keyExchangesSize > 0) { if (keyValues==null) { keyValues = new Object[0]; } if (keyExchanges==null) { keyExchang... | /**
* Encodes an array of key value pairs as a single value appended to
* the baseName, if any;
*/ | Encodes an array of key value pairs as a single value appended to the baseName, if any | encodeCompoundKeyValues | {
"repo_name": "adamrduffy/trinidad-1.0.x",
"path": "trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/BaseLafUtils.java",
"license": "apache-2.0",
"size": 32751
} | [
"java.util.Arrays",
"org.apache.myfaces.trinidadinternal.share.data.ServletRequestParameters"
] | import java.util.Arrays; import org.apache.myfaces.trinidadinternal.share.data.ServletRequestParameters; | import java.util.*; import org.apache.myfaces.trinidadinternal.share.data.*; | [
"java.util",
"org.apache.myfaces"
] | java.util; org.apache.myfaces; | 1,634,300 |
public void updateBounds(Dimension min)
{
//first round - compute the viewport size
maxx = min.width;
maxy = min.height;
absolutePositionsChildren();
//update the size
if (width < maxx) width = maxx;
if (height < maxy) height = maxy;
loadSizes();
loadBackgroundFromContents(); //the background... | void function(Dimension min) { maxx = min.width; maxy = min.height; absolutePositionsChildren(); if (width < maxx) width = maxx; if (height < maxy) height = maxy; loadSizes(); loadBackgroundFromContents(); } | /**
* Calculates the absolute positions and updates the viewport size
* in order to enclose all the boxes.
* @param min the minimal viewport dimensions
*/ | Calculates the absolute positions and updates the viewport size in order to enclose all the boxes | updateBounds | {
"repo_name": "dbmalkovsky/CSSBox",
"path": "src/main/java/org/fit/cssbox/layout/Viewport.java",
"license": "lgpl-3.0",
"size": 16118
} | [
"java.awt.Dimension"
] | import java.awt.Dimension; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,659,354 |
List<DataValue> getDataValues( DataElement dataElement );
| List<DataValue> getDataValues( DataElement dataElement ); | /**
* Returns all DataValues for a given collection of DataElements.
*
* @param dataElement the DataElements of the DataValue.
* @return a collection of all DataValues which mach the given collection of DataElements.
*/ | Returns all DataValues for a given collection of DataElements | getDataValues | {
"repo_name": "minagri-rwanda/DHIS2-Agriculture",
"path": "dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueService.java",
"license": "bsd-3-clause",
"size": 14501
} | [
"java.util.List",
"org.hisp.dhis.dataelement.DataElement"
] | import java.util.List; import org.hisp.dhis.dataelement.DataElement; | import java.util.*; import org.hisp.dhis.dataelement.*; | [
"java.util",
"org.hisp.dhis"
] | java.util; org.hisp.dhis; | 2,866,151 |
public static URI stripSingleURIQueryAndFragment(final URI inUri) throws StorageException {
if (inUri == null) {
return null;
}
try {
return new URI(inUri.getScheme(), inUri.getAuthority(), inUri.getPath(), null, null);
}
catch (final URISyntaxExceptio... | static URI function(final URI inUri) throws StorageException { if (inUri == null) { return null; } try { return new URI(inUri.getScheme(), inUri.getAuthority(), inUri.getPath(), null, null); } catch (final URISyntaxException e) { throw Utility.generateNewUnexpectedStorageException(e); } } | /**
* Strips the Query and Fragment from the uri.
*
* @param inUri
* the uri to alter
* @return the stripped uri.
* @throws StorageException
*/ | Strips the Query and Fragment from the uri | stripSingleURIQueryAndFragment | {
"repo_name": "iterate-ch/azure-storage-java",
"path": "microsoft-azure-storage/src/com/microsoft/azure/storage/core/PathUtility.java",
"license": "apache-2.0",
"size": 21484
} | [
"com.microsoft.azure.storage.StorageException",
"java.net.URISyntaxException"
] | import com.microsoft.azure.storage.StorageException; import java.net.URISyntaxException; | import com.microsoft.azure.storage.*; import java.net.*; | [
"com.microsoft.azure",
"java.net"
] | com.microsoft.azure; java.net; | 65,957 |
if (node != null) {
PsiElement checker = node.getPsi();
checker = checker.getPrevSibling(); // step from the source node
while (checker != null) {
ASTNode ch_node = checker.getNode();
if (ch_node == null) return false;
else {
if (ch_node.getElementType() == eltType) {... | if (node != null) { PsiElement checker = node.getPsi(); checker = checker.getPrevSibling(); while (checker != null) { ASTNode ch_node = checker.getNode(); if (ch_node == null) return false; else { if (ch_node.getElementType() == eltType) { return true; } else if (!(checker instanceof PsiWhiteSpace)) { return false; } }... | /**
* Checks that given node actually follows a node of given type, skipping whitespace.
* @param node node to check.
* @param eltType type of a node that must precede the node we're checking.
* @return true if node is really a next sibling to a node of eltType type.
*/ | Checks that given node actually follows a node of given type, skipping whitespace | followsNodeOfType | {
"repo_name": "goodwinnk/intellij-community",
"path": "python/src/com/jetbrains/python/psi/impl/PyForPartImpl.java",
"license": "apache-2.0",
"size": 2385
} | [
"com.intellij.lang.ASTNode",
"com.intellij.psi.PsiElement",
"com.intellij.psi.PsiWhiteSpace"
] | import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiWhiteSpace; | import com.intellij.lang.*; import com.intellij.psi.*; | [
"com.intellij.lang",
"com.intellij.psi"
] | com.intellij.lang; com.intellij.psi; | 455,678 |
@Override
public Date getData_izmenenija() {
return _spisoklotov.getData_izmenenija();
} | Date function() { return _spisoklotov.getData_izmenenija(); } | /**
* Returns the data_izmenenija of this spisoklotov.
*
* @return the data_izmenenija of this spisoklotov
*/ | Returns the data_izmenenija of this spisoklotov | getData_izmenenija | {
"repo_name": "falko0000/moduleEProc",
"path": "Spisoklotov/Spisoklotov-api/src/main/java/tj/spisok/lotov/model/SpisoklotovWrapper.java",
"license": "lgpl-2.1",
"size": 24008
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 1,308,899 |
protected void encodeFields(mxCodec enc, Object obj, Node node)
{
// LATER: Use PropertyDescriptors in Introspector.getBeanInfo(clazz)
// see http://forum.jgraph.com/questions/1424
Class<?> type = obj.getClass();
while (type != null)
{
Field[] fields = type.getDeclaredFields();
for (int i = 0; i <... | void function(mxCodec enc, Object obj, Node node) { Class<?> type = obj.getClass(); while (type != null) { Field[] fields = type.getDeclaredFields(); for (int i = 0; i < fields.length; i++) { Field f = fields[i]; if ((f.getModifiers() & Modifier.TRANSIENT) != Modifier.TRANSIENT) { String fieldname = f.getName(); Object... | /**
* Encodes the declared fields of the given object into the given node.
*
* @param enc Codec that controls the encoding process.
* @param obj Object whose fields should be encoded.
* @param node XML node that contains the encoded object.
*/ | Encodes the declared fields of the given object into the given node | encodeFields | {
"repo_name": "JanaWengenroth/GKA1",
"path": "libraries/jgraphx/src/com/mxgraph/io/mxObjectCodec.java",
"license": "gpl-2.0",
"size": 32261
} | [
"java.lang.reflect.Field",
"java.lang.reflect.Modifier",
"org.w3c.dom.Node"
] | import java.lang.reflect.Field; import java.lang.reflect.Modifier; import org.w3c.dom.Node; | import java.lang.reflect.*; import org.w3c.dom.*; | [
"java.lang",
"org.w3c.dom"
] | java.lang; org.w3c.dom; | 1,930,112 |
public static InputStream getSnappyInputStream( InputStream in ) throws Exception {
return getSnappyInputStream( HadoopSnappyCompressionProvider.IO_COMPRESSION_CODEC_SNAPPY_DEFAULT_BUFFERSIZE, in );
} | static InputStream function( InputStream in ) throws Exception { return getSnappyInputStream( HadoopSnappyCompressionProvider.IO_COMPRESSION_CODEC_SNAPPY_DEFAULT_BUFFERSIZE, in ); } | /**
* Gets a CompressionInputStream that uses the snappy codec and wraps the supplied base input stream.
*
* @param in
* the base input stream to wrap around
* @return an InputStream that uses the Snappy codec
*
* @throws Exception
* if snappy is not available or an error occu... | Gets a CompressionInputStream that uses the snappy codec and wraps the supplied base input stream | getSnappyInputStream | {
"repo_name": "tkafalas/pentaho-kettle",
"path": "engine/src/main/java/org/pentaho/di/core/compress/hadoopsnappy/HadoopSnappyCompressionInputStream.java",
"license": "apache-2.0",
"size": 3236
} | [
"java.io.InputStream"
] | import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,459,875 |
void maybeNotifyForChunkCreation(PutChunk chunk) {
if (chunk.chunkIndex == 0) {
firstChunkIdAndProperties = new Pair<>(chunk.chunkBlobId, chunk.chunkBlobProperties);
} else {
notificationSystem.onBlobCreated(chunk.chunkBlobId.getID(), chunk.chunkBlobProperties, userMetadata,
... | void maybeNotifyForChunkCreation(PutChunk chunk) { if (chunk.chunkIndex == 0) { firstChunkIdAndProperties = new Pair<>(chunk.chunkBlobId, chunk.chunkBlobProperties); } else { notificationSystem.onBlobCreated(chunk.chunkBlobId.getID(), chunk.chunkBlobProperties, userMetadata, NotificationBlobType.DataChunk); } } | /**
* Call {@link NotificationSystem#onBlobCreated(String, BlobProperties, byte[], NotificationBlobType)} for this
* chunk, unless it is the first chunk, in which case it might be an entire simple blob. In that case, save
* the {@link BlobProperties} from the first chunk.
* @param chunk the {@link P... | Call <code>NotificationSystem#onBlobCreated(String, BlobProperties, byte[], NotificationBlobType)</code> for this chunk, unless it is the first chunk, in which case it might be an entire simple blob. In that case, save the <code>BlobProperties</code> from the first chunk | maybeNotifyForChunkCreation | {
"repo_name": "daniellitoc/ambry-Research",
"path": "ambry-router/src/main/java/com.github.ambry.router/PutOperation.java",
"license": "apache-2.0",
"size": 53866
} | [
"com.github.ambry.notification.NotificationBlobType",
"com.github.ambry.utils.Pair"
] | import com.github.ambry.notification.NotificationBlobType; import com.github.ambry.utils.Pair; | import com.github.ambry.notification.*; import com.github.ambry.utils.*; | [
"com.github.ambry"
] | com.github.ambry; | 1,500,567 |
public void setParameter(IRequestCycle cycle)
{
if (shouldSetPropertyValue(cycle))
{
double scalar = getBinding().getDouble();
setPropertyValue(new Double(scalar));
}
} | void function(IRequestCycle cycle) { if (shouldSetPropertyValue(cycle)) { double scalar = getBinding().getDouble(); setPropertyValue(new Double(scalar)); } } | /**
* Invokes {@link IBinding#getDouble()} to obtain the value
* to assign to the property.
*
**/ | Invokes <code>IBinding#getDouble()</code> to obtain the value to assign to the property | setParameter | {
"repo_name": "apache/tapestry3",
"path": "tapestry-framework/src/org/apache/tapestry/param/DoubleParameterConnector.java",
"license": "apache-2.0",
"size": 1502
} | [
"org.apache.tapestry.IRequestCycle"
] | import org.apache.tapestry.IRequestCycle; | import org.apache.tapestry.*; | [
"org.apache.tapestry"
] | org.apache.tapestry; | 1,049,701 |
@SuppressWarnings("UnusedReturnValue")
public InventoryItemEntity addStackedInventoryItem(InventoryEntity inventoryEntity, String productId,
int quantity, boolean ignoreLimits) {
ProductEntity productEntity = productDAO.findByProductId(productId);
... | @SuppressWarnings(STR) InventoryItemEntity function(InventoryEntity inventoryEntity, String productId, int quantity, boolean ignoreLimits) { ProductEntity productEntity = productDAO.findByProductId(productId); if (productEntity == null) throw new EngineException(STR + productId + STR, EngineExceptionCode.NoSuchEntitlem... | /**
* Adds a new item to the given {@link InventoryEntity} instance, contributing to a stack if necessary.
* Does not persist the inventory to the database!
*
* @param inventoryEntity The {@link InventoryEntity} instance to manipulate.
* @param productId The ID of the product that should ... | Adds a new item to the given <code>InventoryEntity</code> instance, contributing to a stack if necessary. Does not persist the inventory to the database | addStackedInventoryItem | {
"repo_name": "SoapboxRaceWorld/soapbox-race-core",
"path": "src/main/java/com/soapboxrace/core/bo/InventoryBO.java",
"license": "gpl-3.0",
"size": 25919
} | [
"com.soapboxrace.core.engine.EngineException",
"com.soapboxrace.core.engine.EngineExceptionCode",
"com.soapboxrace.core.jpa.InventoryEntity",
"com.soapboxrace.core.jpa.InventoryItemEntity",
"com.soapboxrace.core.jpa.ProductEntity"
] | import com.soapboxrace.core.engine.EngineException; import com.soapboxrace.core.engine.EngineExceptionCode; import com.soapboxrace.core.jpa.InventoryEntity; import com.soapboxrace.core.jpa.InventoryItemEntity; import com.soapboxrace.core.jpa.ProductEntity; | import com.soapboxrace.core.engine.*; import com.soapboxrace.core.jpa.*; | [
"com.soapboxrace.core"
] | com.soapboxrace.core; | 46,388 |
// ============================================================================
// Table Locking Helpers
// ============================================================================
private void logLockedResource(LockedResourceType resourceType, String resourceName) {
if (!LOG.isDebugEnabled()) {
... | void function(LockedResourceType resourceType, String resourceName) { if (!LOG.isDebugEnabled()) { return; } LockedResource lockedResource = getLockResource(resourceType, resourceName); if (lockedResource != null) { String msg = resourceType.toString() + STR + resourceName + STR + lockedResource.getSharedLockCount(); P... | /**
* Get lock info for a resource of specified type and name and log details
*/ | Get lock info for a resource of specified type and name and log details | logLockedResource | {
"repo_name": "mahak/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureScheduler.java",
"license": "apache-2.0",
"size": 39100
} | [
"org.apache.hadoop.hbase.procedure2.LockedResource",
"org.apache.hadoop.hbase.procedure2.LockedResourceType",
"org.apache.hadoop.hbase.procedure2.Procedure"
] | import org.apache.hadoop.hbase.procedure2.LockedResource; import org.apache.hadoop.hbase.procedure2.LockedResourceType; import org.apache.hadoop.hbase.procedure2.Procedure; | import org.apache.hadoop.hbase.procedure2.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,105,279 |
public int getParentTreeNextKey()
{
return this.getCOSObject().getInt(COSName.PARENT_TREE_NEXT_KEY);
} | int function() { return this.getCOSObject().getInt(COSName.PARENT_TREE_NEXT_KEY); } | /**
* Returns the next key in the parent tree.
*
* @return the next key in the parent tree
*/ | Returns the next key in the parent tree | getParentTreeNextKey | {
"repo_name": "kalaspuffar/pdfbox",
"path": "pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDStructureTreeRoot.java",
"license": "apache-2.0",
"size": 4952
} | [
"org.apache.pdfbox.cos.COSName"
] | import org.apache.pdfbox.cos.COSName; | import org.apache.pdfbox.cos.*; | [
"org.apache.pdfbox"
] | org.apache.pdfbox; | 2,281,598 |
public RedwoodConfiguration clear(){
this.tasks = new LinkedList<>();
this.tasks.add(() -> {
Redwood.clearHandlers();
Redwood.restoreSystemStreams();
});
this.outputHandler = Redwood.ConsoleHandler.out();
return this;
} | RedwoodConfiguration function(){ this.tasks = new LinkedList<>(); this.tasks.add(() -> { Redwood.clearHandlers(); Redwood.restoreSystemStreams(); }); this.outputHandler = Redwood.ConsoleHandler.out(); return this; } | /**
* Clear any custom configurations to Redwood
* @return this
*/ | Clear any custom configurations to Redwood | clear | {
"repo_name": "hbbpb/stanford-corenlp-gv",
"path": "src/edu/stanford/nlp/util/logging/RedwoodConfiguration.java",
"license": "gpl-2.0",
"size": 20326
} | [
"java.util.LinkedList"
] | import java.util.LinkedList; | import java.util.*; | [
"java.util"
] | java.util; | 853,786 |
private boolean constructorHasMatchingParams(TypeLiteral<?> type,
Constructor<?> constructor, List<Key<?>> paramList, Errors errors)
throws ErrorsException {
List<TypeLiteral<?>> params = type.getParameterTypes(constructor);
Annotation[][] paramAnnotations = constructor.getParameterAnnotations();
... | boolean function(TypeLiteral<?> type, Constructor<?> constructor, List<Key<?>> paramList, Errors errors) throws ErrorsException { List<TypeLiteral<?>> params = type.getParameterTypes(constructor); Annotation[][] paramAnnotations = constructor.getParameterAnnotations(); int p = 0; List<Key<?>> constructorKeys = Lists.ne... | /**
* Matching logic for constructors annotated with AssistedInject.
* This returns true if and only if all @Assisted parameters in the
* constructor exactly match (in any order) all @Assisted parameters
* the method's parameter.
*/ | Matching logic for constructors annotated with AssistedInject. This returns true if and only if all @Assisted parameters in the constructor exactly match (in any order) all @Assisted parameters the method's parameter | constructorHasMatchingParams | {
"repo_name": "fizzy33/guice3",
"path": "extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider2.java",
"license": "apache-2.0",
"size": 27073
} | [
"com.google.inject.Key",
"com.google.inject.TypeLiteral",
"com.google.inject.internal.Annotations",
"com.google.inject.internal.Errors",
"com.google.inject.internal.ErrorsException",
"com.google.inject.internal.util.Lists",
"java.lang.annotation.Annotation",
"java.lang.reflect.Constructor",
"java.ut... | import com.google.inject.Key; import com.google.inject.TypeLiteral; import com.google.inject.internal.Annotations; import com.google.inject.internal.Errors; import com.google.inject.internal.ErrorsException; import com.google.inject.internal.util.Lists; import java.lang.annotation.Annotation; import java.lang.reflect.C... | import com.google.inject.*; import com.google.inject.internal.*; import com.google.inject.internal.util.*; import java.lang.annotation.*; import java.lang.reflect.*; import java.util.*; | [
"com.google.inject",
"java.lang",
"java.util"
] | com.google.inject; java.lang; java.util; | 906,162 |
public String stripIllegal(String str) {
Matcher m = fIllegalCharReg.matcher(str);
return m.replaceAll("");
} | String function(String str) { Matcher m = fIllegalCharReg.matcher(str); return m.replaceAll(""); } | /**
* Illegal characters
* ***********************************************************
*/ | Illegal characters | stripIllegal | {
"repo_name": "federvieh/Anki-Android",
"path": "AnkiDroid/src/main/java/com/ichi2/libanki/Media.java",
"license": "gpl-3.0",
"size": 36231
} | [
"java.util.regex.Matcher"
] | import java.util.regex.Matcher; | import java.util.regex.*; | [
"java.util"
] | java.util; | 2,265,119 |
Set<LibraryVersionResource> resolve(Set<LibraryVersionResource> libraries) throws StoreException; | Set<LibraryVersionResource> resolve(Set<LibraryVersionResource> libraries) throws StoreException; | /**
* Resolves the set of libraries (essentially looking to see if they are in the index)
*
* @return the set of the libraries that we know
* @throws StoreException if there is a problem
*/ | Resolves the set of libraries (essentially looking to see if they are in the index) | resolve | {
"repo_name": "pongasoft/kiwidoc",
"path": "kiwidoc/com.pongasoft.kiwidoc.builder/src/main/java/com/pongasoft/kiwidoc/builder/KiwidocLibraryStore.java",
"license": "apache-2.0",
"size": 5071
} | [
"com.pongasoft.kiwidoc.model.resource.LibraryVersionResource",
"java.util.Set"
] | import com.pongasoft.kiwidoc.model.resource.LibraryVersionResource; import java.util.Set; | import com.pongasoft.kiwidoc.model.resource.*; import java.util.*; | [
"com.pongasoft.kiwidoc",
"java.util"
] | com.pongasoft.kiwidoc; java.util; | 1,872,056 |
@Messages({"# {0} - hash set name", "HashDbManager.noDbPath.message=Couldn't get valid hash set path for: {0}",
"HashDbManager.centralRepoLoadError.message=Error loading central repository hash sets"})
private void configureSettings(HashLookupSettings settings) {
allDatabasesLoadedCorrectly ... | @Messages({STR, STR, STR}) void function(HashLookupSettings settings) { allDatabasesLoadedCorrectly = true; List<HashDbInfo> hashDbInfoList = settings.getHashDbInfo(); for (HashDbInfo hashDbInfo : hashDbInfoList) { try { if(hashDbInfo.isFileDatabaseType()){ String dbPath = this.getValidFilePath(hashDbInfo.getHashSetNam... | /**
* Configures the given settings object by adding all contained hash db to
* the system.
*
* @param settings The settings to configure.
*/ | Configures the given settings object by adding all contained hash db to the system | configureSettings | {
"repo_name": "esaunders/autopsy",
"path": "Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbManager.java",
"license": "apache-2.0",
"size": 60611
} | [
"java.util.List",
"java.util.logging.Level",
"javax.swing.JOptionPane",
"org.openide.util.NbBundle",
"org.openide.windows.WindowManager",
"org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository",
"org.sleuthkit.autopsy.core.RuntimeProperties",
"org.sleuthkit.autopsy.coreutils.Logger",
"... | import java.util.List; import java.util.logging.Level; import javax.swing.JOptionPane; import org.openide.util.NbBundle; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; import org.sleuthkit.autopsy.core.RuntimeProperties; import org.sleuthkit.autopsy... | import java.util.*; import java.util.logging.*; import javax.swing.*; import org.openide.util.*; import org.openide.windows.*; import org.sleuthkit.autopsy.centralrepository.datamodel.*; import org.sleuthkit.autopsy.core.*; import org.sleuthkit.autopsy.coreutils.*; import org.sleuthkit.autopsy.modules.hashdatabase.*; i... | [
"java.util",
"javax.swing",
"org.openide.util",
"org.openide.windows",
"org.sleuthkit.autopsy",
"org.sleuthkit.datamodel"
] | java.util; javax.swing; org.openide.util; org.openide.windows; org.sleuthkit.autopsy; org.sleuthkit.datamodel; | 2,647,012 |
private boolean startCacheStatListener() {
final GemFireStatSampler sampler = this.cache.getDistributedSystem().getStatSampler();
if (sampler == null) {
return false;
}
try {
sampler.waitForInitialization();
String tenuredPoolName = getTenuredMemoryPoolMXBean().getName();
... | boolean function() { final GemFireStatSampler sampler = this.cache.getDistributedSystem().getStatSampler(); if (sampler == null) { return false; } try { sampler.waitForInitialization(); String tenuredPoolName = getTenuredMemoryPoolMXBean().getName(); String edenPoolName = getEdenMemoryPoolMXBean() != null ? getEdenMemo... | /**
* Start a listener on the cache stats to monitor memory usage.
*
* @return True of the listener was correctly started, false otherwise.
*/ | Start a listener on the cache stats to monitor memory usage | startCacheStatListener | {
"repo_name": "SnappyDataInc/snappy-store",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java",
"license": "apache-2.0",
"size": 51314
} | [
"com.gemstone.gemfire.internal.GemFireStatSampler",
"com.gemstone.gemfire.internal.StatisticsImpl",
"java.util.List"
] | import com.gemstone.gemfire.internal.GemFireStatSampler; import com.gemstone.gemfire.internal.StatisticsImpl; import java.util.List; | import com.gemstone.gemfire.internal.*; import java.util.*; | [
"com.gemstone.gemfire",
"java.util"
] | com.gemstone.gemfire; java.util; | 173,465 |
CompletableFuture<Acknowledge> abortCheckpoint(
ExecutionAttemptID executionAttemptID, long checkpointId, long checkpointTimestamp); | CompletableFuture<Acknowledge> abortCheckpoint( ExecutionAttemptID executionAttemptID, long checkpointId, long checkpointTimestamp); | /**
* Abort a checkpoint for the given task. The checkpoint is identified by the checkpoint ID and
* the checkpoint timestamp.
*
* @param executionAttemptID identifying the task
* @param checkpointId unique id for the checkpoint
* @param checkpointTimestamp is the timestamp when the checkp... | Abort a checkpoint for the given task. The checkpoint is identified by the checkpoint ID and the checkpoint timestamp | abortCheckpoint | {
"repo_name": "kl0u/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskExecutorGateway.java",
"license": "apache-2.0",
"size": 11452
} | [
"java.util.concurrent.CompletableFuture",
"org.apache.flink.runtime.executiongraph.ExecutionAttemptID",
"org.apache.flink.runtime.messages.Acknowledge"
] | import java.util.concurrent.CompletableFuture; import org.apache.flink.runtime.executiongraph.ExecutionAttemptID; import org.apache.flink.runtime.messages.Acknowledge; | import java.util.concurrent.*; import org.apache.flink.runtime.executiongraph.*; import org.apache.flink.runtime.messages.*; | [
"java.util",
"org.apache.flink"
] | java.util; org.apache.flink; | 2,893,651 |
private RetryAction getFailAction(List<RetryAction> actions) {
RetryAction fAction = null;
for (RetryAction action : actions) {
if (action.action == RetryAction.RetryDecision.FAIL) {
fAction = action;
} else {
// Atleast 1 RETRY
return null;
}
}
return fAction... | RetryAction function(List<RetryAction> actions) { RetryAction fAction = null; for (RetryAction action : actions) { if (action.action == RetryAction.RetryDecision.FAIL) { fAction = action; } else { return null; } } return fAction; } | /**
* Return the last FAIL action.. only if there are no RETRY actions.
*/ | Return the last FAIL action.. only if there are no RETRY actions | getFailAction | {
"repo_name": "aliyun-beta/aliyun-oss-hadoop-fs",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java",
"license": "apache-2.0",
"size": 10365
} | [
"java.util.List",
"org.apache.hadoop.io.retry.RetryPolicy"
] | import java.util.List; import org.apache.hadoop.io.retry.RetryPolicy; | import java.util.*; import org.apache.hadoop.io.retry.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 1,372,904 |
private Se3_F64 computeRightToLeft() {
// location of points in the world coordinate system
List<Point2D_F64> points2D = calibLeft.getTarget().points;
List<Point3D_F64> points3D = new ArrayList<Point3D_F64>();
for( Point2D_F64 p : points2D ) {
points3D.add( new Point3D_F64(p.x,p.y,0));
}
// create p... | Se3_F64 function() { List<Point2D_F64> points2D = calibLeft.getTarget().points; List<Point3D_F64> points3D = new ArrayList<Point3D_F64>(); for( Point2D_F64 p : points2D ) { points3D.add( new Point3D_F64(p.x,p.y,0)); } List<Point3D_F64> left = new ArrayList<Point3D_F64>(); List<Point3D_F64> right = new ArrayList<Point3D... | /**
* Creates two 3D point clouds for the left and right camera using the known calibration points and camera
* calibration. Then find the optimal rigid body transform going from the right to left views.
*
* @return Transform from right to left view.
*/ | Creates two 3D point clouds for the left and right camera using the known calibration points and camera calibration. Then find the optimal rigid body transform going from the right to left views | computeRightToLeft | {
"repo_name": "intrack/BoofCV-master",
"path": "main/calibration/src/boofcv/abst/calib/CalibrateStereoPlanar.java",
"license": "apache-2.0",
"size": 6607
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 474,228 |
public CountDownLatch getOrderAttributesAsync(String orderId, AsyncCallback<List<com.mozu.api.contracts.commerceruntime.orders.OrderAttribute>> callback) throws Exception
{
MozuClient<List<com.mozu.api.contracts.commerceruntime.orders.OrderAttribute>> client = com.mozu.api.clients.commerce.orders.OrderAttributeCl... | CountDownLatch function(String orderId, AsyncCallback<List<com.mozu.api.contracts.commerceruntime.orders.OrderAttribute>> callback) throws Exception { MozuClient<List<com.mozu.api.contracts.commerceruntime.orders.OrderAttribute>> client = com.mozu.api.clients.commerce.orders.OrderAttributeClient.getOrderAttributesClien... | /**
* Retrieves a list of the attributes defined for the order specified in the request.
* <p><pre><code>
* OrderAttribute orderattribute = new OrderAttribute();
* CountDownLatch latch = orderattribute.getOrderAttributes( orderId, callback );
* latch.await() * </code></pre></p>
* @param orderId Unique iden... | Retrieves a list of the attributes defined for the order specified in the request. <code><code> OrderAttribute orderattribute = new OrderAttribute(); CountDownLatch latch = orderattribute.getOrderAttributes( orderId, callback ); latch.await() * </code></code> | getOrderAttributesAsync | {
"repo_name": "lakshmi-nair/mozu-java",
"path": "mozu-javaasync-core/src/main/java/com/mozu/api/resources/commerce/orders/OrderAttributeResource.java",
"license": "mit",
"size": 10317
} | [
"com.mozu.api.AsyncCallback",
"com.mozu.api.MozuClient",
"java.util.List",
"java.util.concurrent.CountDownLatch"
] | import com.mozu.api.AsyncCallback; import com.mozu.api.MozuClient; import java.util.List; import java.util.concurrent.CountDownLatch; | import com.mozu.api.*; import java.util.*; import java.util.concurrent.*; | [
"com.mozu.api",
"java.util"
] | com.mozu.api; java.util; | 2,677,160 |
Map<Class<? extends IObject>, Map<String, IObjectContainer>>
getAuthoritativeContainerCache(); | Map<Class<? extends IObject>, Map<String, IObjectContainer>> getAuthoritativeContainerCache(); | /**
* Returns the current authoritative LSID container cache. This container
* cache records the explicitly set LSID to container references.
* @return See above.
*/ | Returns the current authoritative LSID container cache. This container cache records the explicitly set LSID to container references | getAuthoritativeContainerCache | {
"repo_name": "jballanc/openmicroscopy",
"path": "components/blitz/src/ome/formats/model/IObjectContainerStore.java",
"license": "gpl-2.0",
"size": 8498
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,901,990 |
public ListenableFuture<T> firstValue() {
return firstValue;
} | ListenableFuture<T> function() { return firstValue; } | /**
* Returns a {@link ListenableFuture} for the first value received from the stream. Useful
* for testing unary call patterns.
*/ | Returns a <code>ListenableFuture</code> for the first value received from the stream. Useful for testing unary call patterns | firstValue | {
"repo_name": "pieterjanpintens/grpc-java",
"path": "testing/src/main/java/io/grpc/testing/StreamRecorder.java",
"license": "apache-2.0",
"size": 3064
} | [
"com.google.common.util.concurrent.ListenableFuture"
] | import com.google.common.util.concurrent.ListenableFuture; | import com.google.common.util.concurrent.*; | [
"com.google.common"
] | com.google.common; | 1,125,077 |
@Test
public void testGetCopy()
{
UUID uuid = UUID.randomUUID();
UUID uuid2 = accessor.getCopy(uuid);
Assert.assertEquals(uuid, uuid2);
} | void function() { UUID uuid = UUID.randomUUID(); UUID uuid2 = accessor.getCopy(uuid); Assert.assertEquals(uuid, uuid2); } | /**
* Test method for {@link com.impetus.kundera.property.accessor.UUIDAccessor#getCopy(java.lang.Object)}.
*/ | Test method for <code>com.impetus.kundera.property.accessor.UUIDAccessor#getCopy(java.lang.Object)</code> | testGetCopy | {
"repo_name": "impetus-opensource/Kundera",
"path": "src/jpa-engine/core/src/test/java/com/impetus/kundera/property/accessor/UUIDAccessorTest.java",
"license": "apache-2.0",
"size": 3787
} | [
"java.util.UUID",
"junit.framework.Assert"
] | import java.util.UUID; import junit.framework.Assert; | import java.util.*; import junit.framework.*; | [
"java.util",
"junit.framework"
] | java.util; junit.framework; | 2,756,039 |
public KualiDecimal getCrmTotalTaxAmount() {
return crmTotalTaxAmount;
} | KualiDecimal function() { return crmTotalTaxAmount; } | /**
* Gets the crmTotalTaxAmount attribute.
*
* @return Returns the crmTotalTaxAmount.
*/ | Gets the crmTotalTaxAmount attribute | getCrmTotalTaxAmount | {
"repo_name": "quikkian-ua-devops/will-financials",
"path": "kfs-ar/src/main/java/org/kuali/kfs/module/ar/document/CustomerCreditMemoDocument.java",
"license": "agpl-3.0",
"size": 33333
} | [
"org.kuali.rice.core.api.util.type.KualiDecimal"
] | import org.kuali.rice.core.api.util.type.KualiDecimal; | import org.kuali.rice.core.api.util.type.*; | [
"org.kuali.rice"
] | org.kuali.rice; | 2,829,280 |
byte [] cachedName = serializedFieldNames.get(fieldName);
if (null != cachedName) {
// Cache hit. We're done.
return cachedName;
}
// Do the serialization and memoize the result.
byte [] nameBytes = Bytes.toBytes(fieldName);
serializedFieldNames.put(fieldName, nameBytes);
return nam... | byte [] cachedName = serializedFieldNames.get(fieldName); if (null != cachedName) { return cachedName; } byte [] nameBytes = Bytes.toBytes(fieldName); serializedFieldNames.put(fieldName, nameBytes); return nameBytes; } | /**
* Return the serialized bytes for a field name, using
* the cache if it's already in there.
*/ | Return the serialized bytes for a field name, using the cache if it's already in there | getFieldNameBytes | {
"repo_name": "beni55/sqoop",
"path": "src/java/com/cloudera/sqoop/hbase/ToStringPutTransformer.java",
"license": "apache-2.0",
"size": 3216
} | [
"org.apache.hadoop.hbase.util.Bytes"
] | import org.apache.hadoop.hbase.util.Bytes; | import org.apache.hadoop.hbase.util.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,457,544 |
private static void ex1D_float() {
log("Testing 1D float tree");
log("=====================");
//double-float requires 64 bit
CritBit1D<String> cb = CritBit.create1D(64);
long[] key = new long[]{BitTools.toSortableLong(12.34)};
cb.put(key, "hello float");
log("contains() --> " + cb.contains(key));
lo... | static void function() { log(STR); log(STR); CritBit1D<String> cb = CritBit.create1D(64); long[] key = new long[]{BitTools.toSortableLong(12.34)}; cb.put(key, STR); log(STR + cb.contains(key)); log(STR+ cb.get(key)); long[] min = new long[]{BitTools.toSortableLong(1.0)}; long[] max = new long[]{BitTools.toSortableLong(... | /**
* Example of a 1D crit-bit tree with 64 bit float keys.
*/ | Example of a 1D crit-bit tree with 64 bit float keys | ex1D_float | {
"repo_name": "tzaeschke/phtree",
"path": "src/main/java/org/zoodb/index/critbit/Examples.java",
"license": "apache-2.0",
"size": 4138
} | [
"org.zoodb.index.critbit.CritBit"
] | import org.zoodb.index.critbit.CritBit; | import org.zoodb.index.critbit.*; | [
"org.zoodb.index"
] | org.zoodb.index; | 1,684,520 |
public static @Nonnull String makeAbsolute(@Nonnull String link, @Nonnull String pageUrl) {
try {
if(!hasSchema(link)) {
URL baseUrl = new URL(pageUrl);
URL url = new URL(baseUrl, link);
return url.toString();
}
return link;
} catch(MalformedURLException e) {
throw new IllegalArgumentExce... | static @Nonnull String function(@Nonnull String link, @Nonnull String pageUrl) { try { if(!hasSchema(link)) { URL baseUrl = new URL(pageUrl); URL url = new URL(baseUrl, link); return url.toString(); } return link; } catch(MalformedURLException e) { throw new IllegalArgumentException(String.format(STR, link, pageUrl), e... | /**
* Converts the given link to an absolut link if it is not already absolute.
*
* @param link The link which is to be converted into an absolut link.
* @param pageUrl The page url which is the base to turn a relative to an absolute link.
* @return The absolute link.
* @throws IllegalArgumentException if ... | Converts the given link to an absolut link if it is not already absolute | makeAbsolute | {
"repo_name": "meerkatzenwildschein/FeedExpander",
"path": "src/main/java/org/rr/expander/feed/HtmlUtils.java",
"license": "gpl-2.0",
"size": 1387
} | [
"java.net.MalformedURLException",
"javax.annotation.Nonnull"
] | import java.net.MalformedURLException; import javax.annotation.Nonnull; | import java.net.*; import javax.annotation.*; | [
"java.net",
"javax.annotation"
] | java.net; javax.annotation; | 220,441 |
@Test
public void testToString() {
assertEquals("0x0", flowId1.toString());
assertEquals("0xabcdef", flowId5.toString());
} | void function() { assertEquals("0x0", flowId1.toString()); assertEquals(STR, flowId5.toString()); } | /**
* Tests {@link FlowId#toString()} method.
*/ | Tests <code>FlowId#toString()</code> method | testToString | {
"repo_name": "opennetworkinglab/spring-open",
"path": "src/test/java/net/onrc/onos/api/flowmanager/FlowIdTest.java",
"license": "apache-2.0",
"size": 1687
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 403,745 |
//System.out.println("A new predicate is added to this state: " + this.tag);
//System.out.println(pDescription);
// a predicate should be composed of 3 parts: left operator right
StringTokenizer st = new StringTokenizer(pDescription);
int size = st.countTokens();
String left = st.nextToken();
in... | StringTokenizer st = new StringTokenizer(pDescription); int size = st.countTokens(); String left = st.nextToken(); int edgeNumber = this.parseEdgeNumber(left); String right = null; while(st.hasMoreTokens()){ right = st.nextToken();} String newLeft = this.replaceLeftStateNumber(left); String newRight = this.replaceRight... | /**
* Adds a predicate to this state based on the given description.
* @param pDescription
*/ | Adds a predicate to this state based on the given description | addPredicate | {
"repo_name": "jonyt/sase",
"path": "src/main/java/edu/umass/cs/sase/query/State.java",
"license": "mit",
"size": 12325
} | [
"java.util.StringTokenizer"
] | import java.util.StringTokenizer; | import java.util.*; | [
"java.util"
] | java.util; | 140,279 |
public List<ReportLineItem> getReportData(Criterion filter, ReportFieldEnum reportField,
List<GroupByField> groupByFields) {
return reportDao.getReportData(filter, reportField, groupByFields);
}
| List<ReportLineItem> function(Criterion filter, ReportFieldEnum reportField, List<GroupByField> groupByFields) { return reportDao.getReportData(filter, reportField, groupByFields); } | /**
* Gets reports data for a profile.
*
* @param filter
* Filter to be applied to the report data.
* @param reportField
* reported field.
* @param groupByFields
* A list of fields to group by, with associated grouping functions.
* ... | Gets reports data for a profile | getReportData | {
"repo_name": "ksclarke/droid",
"path": "droid-results/src/main/java/uk/gov/nationalarchives/droid/profile/ProfileInstanceManagerImpl.java",
"license": "bsd-3-clause",
"size": 19011
} | [
"java.util.List",
"uk.gov.nationalarchives.droid.core.interfaces.filter.expressions.Criterion",
"uk.gov.nationalarchives.droid.report.dao.GroupByField",
"uk.gov.nationalarchives.droid.report.dao.ReportFieldEnum",
"uk.gov.nationalarchives.droid.report.dao.ReportLineItem"
] | import java.util.List; import uk.gov.nationalarchives.droid.core.interfaces.filter.expressions.Criterion; import uk.gov.nationalarchives.droid.report.dao.GroupByField; import uk.gov.nationalarchives.droid.report.dao.ReportFieldEnum; import uk.gov.nationalarchives.droid.report.dao.ReportLineItem; | import java.util.*; import uk.gov.nationalarchives.droid.core.interfaces.filter.expressions.*; import uk.gov.nationalarchives.droid.report.dao.*; | [
"java.util",
"uk.gov.nationalarchives"
] | java.util; uk.gov.nationalarchives; | 2,095,781 |
public FacesConfigType<T> metadataComplete(Boolean metadataComplete)
{
childNode.attribute("metadata-complete", metadataComplete);
return this;
} | FacesConfigType<T> function(Boolean metadataComplete) { childNode.attribute(STR, metadataComplete); return this; } | /**
* Sets the <code>metadata-complete</code> attribute
* @param metadataComplete the value for the attribute <code>metadata-complete</code>
* @return the current instance of <code>FacesConfigType<T></code>
*/ | Sets the <code>metadata-complete</code> attribute | metadataComplete | {
"repo_name": "forge/javaee-descriptors",
"path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesconfig21/FacesConfigTypeImpl.java",
"license": "epl-1.0",
"size": 40579
} | [
"org.jboss.shrinkwrap.descriptor.api.facesconfig21.FacesConfigType"
] | import org.jboss.shrinkwrap.descriptor.api.facesconfig21.FacesConfigType; | import org.jboss.shrinkwrap.descriptor.api.facesconfig21.*; | [
"org.jboss.shrinkwrap"
] | org.jboss.shrinkwrap; | 266,047 |
protected void setDocumentContent( IDocument document,
InputStream contentStream ) throws CoreException
{
setDocumentContent( document, contentStream, null );
} | void function( IDocument document, InputStream contentStream ) throws CoreException { setDocumentContent( document, contentStream, null ); } | /**
* Initializes the given document with the given stream.
*
* @param document
* the document to be initialized
* @param contentStream
* the stream which delivers the document content
* @throws CoreException
* if the given stream can not be read
*
*/ | Initializes the given document with the given stream | setDocumentContent | {
"repo_name": "sguan-actuate/birt",
"path": "UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/editors/DocumentProvider.java",
"license": "epl-1.0",
"size": 8552
} | [
"java.io.InputStream",
"org.eclipse.core.runtime.CoreException",
"org.eclipse.jface.text.IDocument"
] | import java.io.InputStream; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.text.IDocument; | import java.io.*; import org.eclipse.core.runtime.*; import org.eclipse.jface.text.*; | [
"java.io",
"org.eclipse.core",
"org.eclipse.jface"
] | java.io; org.eclipse.core; org.eclipse.jface; | 1,662,334 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.