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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
protected void setChecked(TableItem item, int col, boolean value) {
boolean prevChecked = checkedIndicator(col).equals(item.getText(col));
item.setText(col, value ? checkedIndicator(col) : UNCHECKED);
if (value && !prevChecked)
numberChecked++;
else if (!value && prevChecked)
numberChecked... | void function(TableItem item, int col, boolean value) { boolean prevChecked = checkedIndicator(col).equals(item.getText(col)); item.setText(col, value ? checkedIndicator(col) : UNCHECKED); if (value && !prevChecked) numberChecked++; else if (!value && prevChecked) numberChecked--; } | /**
* Sets the checked.
*
* @param item
* the item
* @param col
* the col
* @param value
* the value
*/ | Sets the checked | setChecked | {
"repo_name": "apache/uima-uimaj",
"path": "uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialogMultiColTable.java",
"license": "apache-2.0",
"size": 5845
} | [
"org.eclipse.swt.widgets.TableItem"
] | import org.eclipse.swt.widgets.TableItem; | import org.eclipse.swt.widgets.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 1,452,869 |
@Override
public TechGalleryUser updateUser(final TechGalleryUser user) throws BadRequestException {
if (!userDataIsValid(user) && user.getId() != null) {
throw new BadRequestException(i18n.t("User's email cannot be blank."));
} else {
userDao.update(user);
return user;
}
} | TechGalleryUser function(final TechGalleryUser user) throws BadRequestException { if (!userDataIsValid(user) && user.getId() != null) { throw new BadRequestException(i18n.t(STR)); } else { userDao.update(user); return user; } } | /**
* Updates a user, with validation.
*
* @throws BadRequestException
* in case of a missing parameter
* @return the updated user
*/ | Updates a user, with validation | updateUser | {
"repo_name": "sidharta/sales-gallery",
"path": "src/main/java/com/ciandt/techgallery/service/impl/UserServiceTGImpl.java",
"license": "apache-2.0",
"size": 18779
} | [
"com.ciandt.techgallery.persistence.model.TechGalleryUser",
"com.google.api.server.spi.response.BadRequestException"
] | import com.ciandt.techgallery.persistence.model.TechGalleryUser; import com.google.api.server.spi.response.BadRequestException; | import com.ciandt.techgallery.persistence.model.*; import com.google.api.server.spi.response.*; | [
"com.ciandt.techgallery",
"com.google.api"
] | com.ciandt.techgallery; com.google.api; | 98,083 |
public final void bind(final String name, final Object obj)
throws NamingException {
map.put(name, obj);
} | final void function(final String name, final Object obj) throws NamingException { map.put(name, obj); } | /**
* Binds an Object into the Context by name.
* @param name the key to look the Object up by.
* @param obj the Object to bind into the Context.
* @exception NamingException if there is a problem with binding.
*/ | Binds an Object into the Context by name | bind | {
"repo_name": "ecalo/SQLUnit-5.0-Fork",
"path": "test/java/mock/MockInitialContext.java",
"license": "gpl-3.0",
"size": 2480
} | [
"javax.naming.NamingException"
] | import javax.naming.NamingException; | import javax.naming.*; | [
"javax.naming"
] | javax.naming; | 1,726,705 |
public void clear() {
GuiUtils.stopTableEditing(table);
tableModel.clearData();
}
| void function() { GuiUtils.stopTableEditing(table); tableModel.clearData(); } | /**
* Clear all rows from the table.
*/ | Clear all rows from the table | clear | {
"repo_name": "yuyupapa/OpenSource",
"path": "apache-jmeter-3.0/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java",
"license": "apache-2.0",
"size": 14775
} | [
"org.apache.jorphan.gui.GuiUtils"
] | import org.apache.jorphan.gui.GuiUtils; | import org.apache.jorphan.gui.*; | [
"org.apache.jorphan"
] | org.apache.jorphan; | 471,831 |
public final Cursor getDescriptionOfItem(final FeedItem item) {
final String query = "SELECT " + KEY_DESCRIPTION
+ " FROM " + TABLE_NAME_FEED_ITEMS
+ " WHERE " + KEY_ID + "=" + item.getId();
return db.rawQuery(query, null);
} | final Cursor function(final FeedItem item) { final String query = STR + KEY_DESCRIPTION + STR + TABLE_NAME_FEED_ITEMS + STR + KEY_ID + "=" + item.getId(); return db.rawQuery(query, null); } | /**
* Return the description and content_encoded of item
*/ | Return the description and content_encoded of item | getDescriptionOfItem | {
"repo_name": "johnjohndoe/AntennaPod",
"path": "core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java",
"license": "mit",
"size": 61471
} | [
"android.database.Cursor",
"de.danoeh.antennapod.model.feed.FeedItem"
] | import android.database.Cursor; import de.danoeh.antennapod.model.feed.FeedItem; | import android.database.*; import de.danoeh.antennapod.model.feed.*; | [
"android.database",
"de.danoeh.antennapod"
] | android.database; de.danoeh.antennapod; | 2,049,850 |
public void setInput(BufferedReader input) {
this.input = input;
} | void function(BufferedReader input) { this.input = input; } | /**
* Sets the TCP input stream.
*
* @param input TCP input stream.
*/ | Sets the TCP input stream | setInput | {
"repo_name": "oxyzero/volt",
"path": "src/main/java/com/github/oxyzero/volt/Connection.java",
"license": "mit",
"size": 2812
} | [
"java.io.BufferedReader"
] | import java.io.BufferedReader; | import java.io.*; | [
"java.io"
] | java.io; | 2,051,977 |
public final void init(byte[] params, String format) throws IOException {
if (initialized) {
throw new IOException("Parameter has already been initialized");
}
spiImpl.engineInit(params, format);
initialized = true;
} | final void function(byte[] params, String format) throws IOException { if (initialized) { throw new IOException(STR); } spiImpl.engineInit(params, format); initialized = true; } | /**
* Initializes this {@code AlgorithmParameters} with the specified {@code
* byte[]} using the specified decoding format.
*
* @param params
* the encoded parameters.
* @param format
* the name of the decoding format.
* @throws IOException
* ... | Initializes this AlgorithmParameters with the specified byte[] using the specified decoding format | init | {
"repo_name": "openweave/openweave-core",
"path": "third_party/android/platform-libcore/android-platform-libcore/luni/src/main/java/java/security/AlgorithmParameters.java",
"license": "apache-2.0",
"size": 10924
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,011,744 |
@Override
public CompletableFuture<Void> closeAsync() {
close.complete(null);
return close;
}
/**
* {@inheritDoc} | CompletableFuture<Void> function() { close.complete(null); return close; } /** * {@inheritDoc} | /**
* Prevents messages from being sent from this {@code Client}. Note that calling this method does not call
* close on the {@code Client} that created it.
*/ | Prevents messages from being sent from this Client. Note that calling this method does not call close on the Client that created it | closeAsync | {
"repo_name": "dalaro/incubator-tinkerpop",
"path": "gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java",
"license": "apache-2.0",
"size": 23065
} | [
"java.util.concurrent.CompletableFuture"
] | import java.util.concurrent.CompletableFuture; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 1,171,432 |
public static boolean useMockInstance(final Configuration conf) {
return new AccumuloRdfConfiguration(conf).useMockInstance();
} | static boolean function(final Configuration conf) { return new AccumuloRdfConfiguration(conf).useMockInstance(); } | /**
* Indicates that a Mock instance of Accumulo is being used to back the Rya instance.
*
* @param conf - The configuration object that will be interrogated. (not null)
* @return {@code true} if the Rya instance is backed by a mock Accumulo; otherwise {@code false}.
*/ | Indicates that a Mock instance of Accumulo is being used to back the Rya instance | useMockInstance | {
"repo_name": "apache/incubator-rya",
"path": "extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/ConfigUtils.java",
"license": "apache-2.0",
"size": 21985
} | [
"org.apache.hadoop.conf.Configuration",
"org.apache.rya.accumulo.AccumuloRdfConfiguration"
] | import org.apache.hadoop.conf.Configuration; import org.apache.rya.accumulo.AccumuloRdfConfiguration; | import org.apache.hadoop.conf.*; import org.apache.rya.accumulo.*; | [
"org.apache.hadoop",
"org.apache.rya"
] | org.apache.hadoop; org.apache.rya; | 2,564,940 |
public Filter duplicate( Filter filter ){
DuplicatingFilterVisitor xerox = new DuplicatingFilterVisitor( ff );
Filter copy = (Filter) filter.accept( xerox, ff );
return copy;
} | Filter function( Filter filter ){ DuplicatingFilterVisitor xerox = new DuplicatingFilterVisitor( ff ); Filter copy = (Filter) filter.accept( xerox, ff ); return copy; } | /**
* Deep copy the filter.
* <p>
* Filter objects are mutable, when copying a rich
* data structure (like SLD) you will need to duplicate
* the Filters referenced therein.
* </p>
*/ | Deep copy the filter. Filter objects are mutable, when copying a rich data structure (like SLD) you will need to duplicate the Filters referenced therein. | duplicate | {
"repo_name": "FUNCATE/TerraMobile",
"path": "sldparser/src/main/geotools/filter/Filters.java",
"license": "apache-2.0",
"size": 42738
} | [
"org.geotools.filter.visitor.DuplicatingFilterVisitor",
"org.opengis.filter.Filter"
] | import org.geotools.filter.visitor.DuplicatingFilterVisitor; import org.opengis.filter.Filter; | import org.geotools.filter.visitor.*; import org.opengis.filter.*; | [
"org.geotools.filter",
"org.opengis.filter"
] | org.geotools.filter; org.opengis.filter; | 529,083 |
public boolean updatePostTitle(long postId, final String title) throws SQLException {
Connection conn = null;
PreparedStatement stmt = null;
Timer.Context ctx = metrics.updatePostTimer.time();
try {
conn = connectionSupplier.getConnection();
stmt = conn.prepareStatement(upda... | boolean function(long postId, final String title) throws SQLException { Connection conn = null; PreparedStatement stmt = null; Timer.Context ctx = metrics.updatePostTimer.time(); try { conn = connectionSupplier.getConnection(); stmt = conn.prepareStatement(updatePostTitleSQL); stmt.setString(1, title); stmt.setLong(2, ... | /**
* Updates the title for a post.
* @param postId The post to update.
* @param title The new title.
* @return Was the post modified?
* @throws SQLException on database error or missing post id.
*/ | Updates the title for a post | updatePostTitle | {
"repo_name": "attribyte/wpdb",
"path": "src/main/java/org/attribyte/wp/db/DB.java",
"license": "apache-2.0",
"size": 100265
} | [
"com.codahale.metrics.Timer",
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.SQLException",
"org.attribyte.util.SQLUtil"
] | import com.codahale.metrics.Timer; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import org.attribyte.util.SQLUtil; | import com.codahale.metrics.*; import java.sql.*; import org.attribyte.util.*; | [
"com.codahale.metrics",
"java.sql",
"org.attribyte.util"
] | com.codahale.metrics; java.sql; org.attribyte.util; | 1,187,394 |
public long longValue(boolean exact) {
switch (typeName) {
case DECIMAL:
case DOUBLE:
BigDecimal bd = (BigDecimal) value;
if (exact) {
try {
return bd.longValueExact();
} catch (ArithmeticException e) {
throw SqlUtil.newContextException(getParserPosition(),
... | long function(boolean exact) { switch (typeName) { case DECIMAL: case DOUBLE: BigDecimal bd = (BigDecimal) value; if (exact) { try { return bd.longValueExact(); } catch (ArithmeticException e) { throw SqlUtil.newContextException(getParserPosition(), RESOURCE.numberLiteralOutOfRange(bd.toString())); } } else { return bd... | /**
* Returns the long value of this literal.
*
* @param exact Whether the value has to be exact. If true, and the literal
* is a fraction (e.g. 3.14), throws. If false, discards the
* fractional part of the value.
* @return Long value of this literal
*/ | Returns the long value of this literal | longValue | {
"repo_name": "julianhyde/calcite",
"path": "core/src/main/java/org/apache/calcite/sql/SqlLiteral.java",
"license": "apache-2.0",
"size": 33739
} | [
"java.math.BigDecimal",
"org.apache.calcite.util.Static",
"org.apache.calcite.util.Util"
] | import java.math.BigDecimal; import org.apache.calcite.util.Static; import org.apache.calcite.util.Util; | import java.math.*; import org.apache.calcite.util.*; | [
"java.math",
"org.apache.calcite"
] | java.math; org.apache.calcite; | 1,715,598 |
@Nonnull QueryInstructionsBuilder instructions(); | @Nonnull QueryInstructionsBuilder instructions(); | /**
* Create query instructions.
* @return A new query instruction builder.
*/ | Create query instructions | instructions | {
"repo_name": "SylvesterAbreu/sling",
"path": "bundles/api/src/main/java/org/apache/sling/api/resource/query/QueryManager.java",
"license": "apache-2.0",
"size": 3137
} | [
"javax.annotation.Nonnull"
] | import javax.annotation.Nonnull; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 1,403,544 |
private void getTimeSeriesStats(Range<Integer> range, double[] data, OnlineNormalStatistics inDs,
OnlineNormalStatistics outDs) {
// TODO should be able to leverage sliding windows to do this more efficiently
for (int i = 0; i < data.length; i++) {
if (range.contains(i)) {
inDs.addValue(data[i... | void function(Range<Integer> range, double[] data, OnlineNormalStatistics inDs, OnlineNormalStatistics outDs) { for (int i = 0; i < data.length; i++) { if (range.contains(i)) { inDs.addValue(data[i]); } else { outDs.addValue(data[i]); } } } | /**
* This function generates necessary statistics for a given period of a time series.
*
* @param range
* The interval considered as 'in'
* @param inDs
* The descriptive statistics to register 'in' values to
* @param outDs
* The descriptive statistics to register 'out' values to
*/ | This function generates necessary statistics for a given period of a time series | getTimeSeriesStats | {
"repo_name": "izzizz/pinot",
"path": "thirdeye/thirdeye-detector/src/main/java/com/linkedin/thirdeye/lib/scanstatistics/ScanStatistics.java",
"license": "apache-2.0",
"size": 10550
} | [
"com.google.common.collect.Range"
] | import com.google.common.collect.Range; | import com.google.common.collect.*; | [
"com.google.common"
] | com.google.common; | 2,685,377 |
private void purgeFileIndex() {
Iterator<String> fileIter = fileIndex.keySet().iterator();
long now = System.currentTimeMillis();
while(fileIter.hasNext()) {
String file = fileIter.next();
if (fileIndex.get(file).isTooOld(now)) {
fileIter.remove();
}
}
... | void function() { Iterator<String> fileIter = fileIndex.keySet().iterator(); long now = System.currentTimeMillis(); while(fileIter.hasNext()) { String file = fileIter.next(); if (fileIndex.get(file).isTooOld(now)) { fileIter.remove(); } } Iterator<TrackingUrlInfo> tuiIter = this.idToTrakcingUrlMap.values().iterator(); ... | /**
* purge expired jobs from the file index
*/ | purge expired jobs from the file index | purgeFileIndex | {
"repo_name": "shakamunyi/hadoop-20",
"path": "src/contrib/raid/src/java/org/apache/hadoop/raid/DistBlockIntegrityMonitor.java",
"license": "apache-2.0",
"size": 82474
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 1,635,166 |
public final void setObjectType_MxObjectMember_PrimaryKey(IContext context, mxmodelreflection.proxies.MxObjectMember objecttype_mxobjectmember_primarykey)
{
if (objecttype_mxobjectmember_primarykey == null)
getMendixObject().setValue(context, MemberNames.ObjectType_MxObjectMember_PrimaryKey.toString(), null);
... | final void function(IContext context, mxmodelreflection.proxies.MxObjectMember objecttype_mxobjectmember_primarykey) { if (objecttype_mxobjectmember_primarykey == null) getMendixObject().setValue(context, MemberNames.ObjectType_MxObjectMember_PrimaryKey.toString(), null); else getMendixObject().setValue(context, Member... | /**
* Set value of ObjectType_MxObjectMember_PrimaryKey
* @param context
* @param objecttype_mxobjectmember_primarykey
*/ | Set value of ObjectType_MxObjectMember_PrimaryKey | setObjectType_MxObjectMember_PrimaryKey | {
"repo_name": "synobsys/mendix-ObjectBackupRestore",
"path": "src/project/javasource/objectbackuprestore/proxies/ObjectType.java",
"license": "apache-2.0",
"size": 9219
} | [
"com.mendix.systemwideinterfaces.core.IContext"
] | import com.mendix.systemwideinterfaces.core.IContext; | import com.mendix.systemwideinterfaces.core.*; | [
"com.mendix.systemwideinterfaces"
] | com.mendix.systemwideinterfaces; | 690,044 |
public static void replaceIdsByAnnotation(final BioAssay bioAssay,
final Translator annotation, final String annotationField,
final String unknowId) {
if (bioAssay == null || annotation == null || annotationField == null)
return;
String[] ids = bioAssay.getIds();
if (ids == null)
... | static void function(final BioAssay bioAssay, final Translator annotation, final String annotationField, final String unknowId) { if (bioAssay == null annotation == null annotationField == null) return; String[] ids = bioAssay.getIds(); if (ids == null) return; String[] newIds = annotation.translateField(ids, annotatio... | /**
* Replace Ids of a BioAssay by the id from an feature annoatation
* @param bioAssay Bioassay to modify
* @param annotation Feature annotation to use
* @param annotationField field of the annotation to use
* @param unknowId Value for empty annotations.
*/ | Replace Ids of a BioAssay by the id from an feature annoatation | replaceIdsByAnnotation | {
"repo_name": "GenomicParisCentre/nividic",
"path": "src/main/java/fr/ens/transcriptome/nividic/om/BioAssayUtils.java",
"license": "lgpl-2.1",
"size": 25723
} | [
"fr.ens.transcriptome.nividic.om.translators.Translator"
] | import fr.ens.transcriptome.nividic.om.translators.Translator; | import fr.ens.transcriptome.nividic.om.translators.*; | [
"fr.ens.transcriptome"
] | fr.ens.transcriptome; | 1,983,403 |
public void setBlockBag(BlockBag blockBag) {
blockBagExtent.setBlockBag(blockBag);
} | void function(BlockBag blockBag) { blockBagExtent.setBlockBag(blockBag); } | /**
* Set a {@link BlockBag} to use.
*
* @param blockBag the block bag to set, or null to use none
*/ | Set a <code>BlockBag</code> to use | setBlockBag | {
"repo_name": "HolodeckOne-Minecraft/WorldEdit",
"path": "worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java",
"license": "gpl-3.0",
"size": 107454
} | [
"com.sk89q.worldedit.extent.inventory.BlockBag"
] | import com.sk89q.worldedit.extent.inventory.BlockBag; | import com.sk89q.worldedit.extent.inventory.*; | [
"com.sk89q.worldedit"
] | com.sk89q.worldedit; | 1,306,264 |
public TrackGroup getTrackGroup() {
return trackGroup;
} | TrackGroup function() { return trackGroup; } | /**
* Returns the track group exposed by the source.
*/ | Returns the track group exposed by the source | getTrackGroup | {
"repo_name": "Ood-Tsen/ExoPlayer",
"path": "library/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java",
"license": "apache-2.0",
"size": 24782
} | [
"com.google.android.exoplayer2.source.TrackGroup"
] | import com.google.android.exoplayer2.source.TrackGroup; | import com.google.android.exoplayer2.source.*; | [
"com.google.android"
] | com.google.android; | 324,999 |
public static void main(String[] args) {
try {
//=============================================================
// Authenticate
final AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
final TokenCredential credential = new DefaultAzureCredentia... | static void function(String[] args) { try { final AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); final TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); AzureResourceManager azureResourceManager = AzureResou... | /**
* Main entry point.
* @param args the parameters
*/ | Main entry point | main | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppSqlConnection.java",
"license": "mit",
"size": 6760
} | [
"com.azure.core.credential.TokenCredential",
"com.azure.core.http.policy.HttpLogDetailLevel",
"com.azure.core.management.AzureEnvironment",
"com.azure.core.management.profile.AzureProfile",
"com.azure.identity.DefaultAzureCredentialBuilder",
"com.azure.resourcemanager.AzureResourceManager"
] | import com.azure.core.credential.TokenCredential; import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.resourcemanager.AzureResourceManager... | import com.azure.core.credential.*; import com.azure.core.http.policy.*; import com.azure.core.management.*; import com.azure.core.management.profile.*; import com.azure.identity.*; import com.azure.resourcemanager.*; | [
"com.azure.core",
"com.azure.identity",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.identity; com.azure.resourcemanager; | 1,338,620 |
public PageIterator<Gist> pageStarredGists(final int size) {
return pageStarredGists(PAGE_FIRST, size);
} | PageIterator<Gist> function(final int size) { return pageStarredGists(PAGE_FIRST, size); } | /**
* Create page iterator for the current user's starred gists
*
* @param size
* size of page
* @return gist page iterator
*/ | Create page iterator for the current user's starred gists | pageStarredGists | {
"repo_name": "edyesed/gh4a",
"path": "github-api/src/main/java/org/eclipse/egit/github/core/service/GistService.java",
"license": "apache-2.0",
"size": 11831
} | [
"org.eclipse.egit.github.core.Gist",
"org.eclipse.egit.github.core.client.PageIterator"
] | import org.eclipse.egit.github.core.Gist; import org.eclipse.egit.github.core.client.PageIterator; | import org.eclipse.egit.github.core.*; import org.eclipse.egit.github.core.client.*; | [
"org.eclipse.egit"
] | org.eclipse.egit; | 569,641 |
public Timestamp getLastContact ()
{
return (Timestamp)get_Value(COLUMNNAME_LastContact);
} | Timestamp function () { return (Timestamp)get_Value(COLUMNNAME_LastContact); } | /** Get Last Contact.
@return Date this individual was last contacted
*/ | Get Last Contact | getLastContact | {
"repo_name": "geneos/adempiere",
"path": "base/src/org/compiere/model/X_RV_BPartner.java",
"license": "gpl-2.0",
"size": 51998
} | [
"java.sql.Timestamp"
] | import java.sql.Timestamp; | import java.sql.*; | [
"java.sql"
] | java.sql; | 901,845 |
public static Pipeline createNewIPRangePipeline () {
IPCondition ipCondition = new IPCondition(PolicyConstants.IP_RANGE_TYPE);
ipCondition.setStartingIP("10.100.0.105");
ipCondition.setEndingIP("10.100.0.115");
Pipeline pipeline = new Pipeline();
RequestCountLimit requestCou... | static Pipeline function () { IPCondition ipCondition = new IPCondition(PolicyConstants.IP_RANGE_TYPE); ipCondition.setStartingIP(STR); ipCondition.setEndingIP(STR); Pipeline pipeline = new Pipeline(); RequestCountLimit requestCountLimit = new RequestCountLimit(TIME_UNIT_SECONDS, 1, 1000); QuotaPolicy quotaPolicy = new... | /**
* Creates a new {@link Pipeline} instance
*
* @return created Pipeline instance
*/ | Creates a new <code>Pipeline</code> instance | createNewIPRangePipeline | {
"repo_name": "lalaji/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.core/src/test/java/org/wso2/carbon/apimgt/core/SampleTestObjectCreator.java",
"license": "apache-2.0",
"size": 42035
} | [
"java.util.Arrays",
"org.wso2.carbon.apimgt.core.models.policy.IPCondition",
"org.wso2.carbon.apimgt.core.models.policy.Pipeline",
"org.wso2.carbon.apimgt.core.models.policy.PolicyConstants",
"org.wso2.carbon.apimgt.core.models.policy.QuotaPolicy",
"org.wso2.carbon.apimgt.core.models.policy.RequestCountLi... | import java.util.Arrays; import org.wso2.carbon.apimgt.core.models.policy.IPCondition; import org.wso2.carbon.apimgt.core.models.policy.Pipeline; import org.wso2.carbon.apimgt.core.models.policy.PolicyConstants; import org.wso2.carbon.apimgt.core.models.policy.QuotaPolicy; import org.wso2.carbon.apimgt.core.models.poli... | import java.util.*; import org.wso2.carbon.apimgt.core.models.policy.*; | [
"java.util",
"org.wso2.carbon"
] | java.util; org.wso2.carbon; | 2,210,551 |
public Adapter createChangeableAdapter() {
return null;
} | Adapter function() { return null; } | /**
* Creates a new adapter for an object of class '{@link org.openhealthtools.mdht.cts2.core.Changeable <em>Changeable</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway... | Creates a new adapter for an object of class '<code>org.openhealthtools.mdht.cts2.core.Changeable Changeable</code>'. This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway. | createChangeableAdapter | {
"repo_name": "drbgfc/mdht",
"path": "cts2/plugins/org.openhealthtools.mdht.cts2.core/src/org/openhealthtools/mdht/cts2/valuesetdefinition/util/ValueSetDefinitionAdapterFactory.java",
"license": "epl-1.0",
"size": 27532
} | [
"org.eclipse.emf.common.notify.Adapter"
] | import org.eclipse.emf.common.notify.Adapter; | import org.eclipse.emf.common.notify.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,728,564 |
@ApiModelProperty(required = true, value = "attackers array")
public List<KillmailAttacker> getAttackers() {
return attackers;
} | @ApiModelProperty(required = true, value = STR) List<KillmailAttacker> function() { return attackers; } | /**
* attackers array
*
* @return attackers
**/ | attackers array | getAttackers | {
"repo_name": "burberius/eve-esi",
"path": "src/main/java/net/troja/eve/esi/model/KillmailResponse.java",
"license": "apache-2.0",
"size": 7774
} | [
"io.swagger.annotations.ApiModelProperty",
"java.util.List",
"net.troja.eve.esi.model.KillmailAttacker"
] | import io.swagger.annotations.ApiModelProperty; import java.util.List; import net.troja.eve.esi.model.KillmailAttacker; | import io.swagger.annotations.*; import java.util.*; import net.troja.eve.esi.model.*; | [
"io.swagger.annotations",
"java.util",
"net.troja.eve"
] | io.swagger.annotations; java.util; net.troja.eve; | 431,284 |
@Override
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
if (childrenFeatures == null) {
super.getChildrenFeatures(object);
childrenFeatures.add(CodeSystemPackage.Literals.CODE_SYSTEM_CATALOG_ENTRY__CODE_SYSTEM_CATEGORY);
childrenFeatures.add(CodeSystemPackage.Litera... | Collection<? extends EStructuralFeature> function(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); childrenFeatures.add(CodeSystemPackage.Literals.CODE_SYSTEM_CATALOG_ENTRY__CODE_SYSTEM_CATEGORY); childrenFeatures.add(CodeSystemPackage.Literals.CODE_SYSTEM_CATALOG_ENTRY__ONTOLOGY_DOMA... | /**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
* <!-- begin-user-... | This specifies how to implement <code>#getChildren</code> and is used to deduce an appropriate feature for an <code>org.eclipse.emf.edit.command.AddCommand</code>, <code>org.eclipse.emf.edit.command.RemoveCommand</code> or <code>org.eclipse.emf.edit.command.MoveCommand</code> in <code>#createCommand</code>. | getChildrenFeatures | {
"repo_name": "drbgfc/mdht",
"path": "cts2/plugins/org.openhealthtools.mdht.cts2.core.edit/src/org/openhealthtools/mdht/cts2/codesystem/provider/CodeSystemCatalogEntryItemProvider.java",
"license": "epl-1.0",
"size": 10751
} | [
"java.util.Collection",
"org.eclipse.emf.ecore.EStructuralFeature",
"org.openhealthtools.mdht.cts2.codesystem.CodeSystemPackage"
] | import java.util.Collection; import org.eclipse.emf.ecore.EStructuralFeature; import org.openhealthtools.mdht.cts2.codesystem.CodeSystemPackage; | import java.util.*; import org.eclipse.emf.ecore.*; import org.openhealthtools.mdht.cts2.codesystem.*; | [
"java.util",
"org.eclipse.emf",
"org.openhealthtools.mdht"
] | java.util; org.eclipse.emf; org.openhealthtools.mdht; | 1,761,491 |
Object infoValue = null;
ProcessInfo info = (ProcessInfo)getInfo(aKey);
if (info!=null && info.isReady()) {
infoValue = info.getValue();
}
return infoValue;
} | Object infoValue = null; ProcessInfo info = (ProcessInfo)getInfo(aKey); if (info!=null && info.isReady()) { infoValue = info.getValue(); } return infoValue; } | /**
* Retriev an object from the InfoTable from the parameter aKey.
*/ | Retriev an object from the InfoTable from the parameter aKey | getInfoObject | {
"repo_name": "CBIIT/cadsr-util",
"path": "cadsrutil/src/java/gov/nih/nci/ncicb/cadsr/common/base/process/BaseGenericProcess.java",
"license": "bsd-3-clause",
"size": 2649
} | [
"oracle.cle.process.ProcessInfo"
] | import oracle.cle.process.ProcessInfo; | import oracle.cle.process.*; | [
"oracle.cle.process"
] | oracle.cle.process; | 1,391,507 |
public Set<String> getPatientDIDs(ISPYclinicalDataQueryDTO cDTO) {
Set<TimepointType> timepoints = cDTO.getTimepointValues();
Set<String> patientDIDs = null;
Set<String> queryResult = null;
Set<String> restrainingSamples = cDTO.getRestrainingSamples();
//Get IDs for Clinical Stage
if ((cDTO.g... | Set<String> function(ISPYclinicalDataQueryDTO cDTO) { Set<TimepointType> timepoints = cDTO.getTimepointValues(); Set<String> patientDIDs = null; Set<String> queryResult = null; Set<String> restrainingSamples = cDTO.getRestrainingSamples(); if ((cDTO.getClinicalStageValues() != null)&&(!cDTO.getClinicalStageValues().isE... | /**
* This method gets the patient DIDs corresponding to the constraints in the
* clinical data query dto . Note in the future may want to add capability to
* and and or constraints. Currently the the constraints are OR ed.
*/ | This method gets the patient DIDs corresponding to the constraints in the clinical data query dto . Note in the future may want to add capability to and and or constraints. Currently the the constraints are OR ed | getPatientDIDs | {
"repo_name": "NCIP/i-spy",
"path": "src/gov/nih/nci/ispy/service/clinical/ClinicalFileBasedQueryService.java",
"license": "bsd-3-clause",
"size": 29267
} | [
"gov.nih.nci.caintegrator.enumeration.Operator",
"gov.nih.nci.ispy.dto.query.ISPYclinicalDataQueryDTO",
"gov.nih.nci.ispy.service.common.TimepointType",
"java.util.Collections",
"java.util.Set"
] | import gov.nih.nci.caintegrator.enumeration.Operator; import gov.nih.nci.ispy.dto.query.ISPYclinicalDataQueryDTO; import gov.nih.nci.ispy.service.common.TimepointType; import java.util.Collections; import java.util.Set; | import gov.nih.nci.caintegrator.enumeration.*; import gov.nih.nci.ispy.dto.query.*; import gov.nih.nci.ispy.service.common.*; import java.util.*; | [
"gov.nih.nci",
"java.util"
] | gov.nih.nci; java.util; | 741,098 |
public static @NonNull int[] appendInt(@Nullable int[] cur, int val) {
if (cur == null) {
return new int[] { val };
}
final int N = cur.length;
for (int i = 0; i < N; i++) {
if (cur[i] == val) {
return cur;
}
}
int[]... | static @NonNull int[] function(@Nullable int[] cur, int val) { if (cur == null) { return new int[] { val }; } final int N = cur.length; for (int i = 0; i < N; i++) { if (cur[i] == val) { return cur; } } int[] ret = new int[N + 1]; System.arraycopy(cur, 0, ret, 0, N); ret[N] = val; return ret; } | /**
* Adds value to given array if not already present, providing set-like
* behavior.
*/ | Adds value to given array if not already present, providing set-like behavior | appendInt | {
"repo_name": "syslover33/ctank",
"path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/com/android/internal/util/ArrayUtils.java",
"license": "gpl-3.0",
"size": 12386
} | [
"android.annotation.NonNull",
"android.annotation.Nullable"
] | import android.annotation.NonNull; import android.annotation.Nullable; | import android.annotation.*; | [
"android.annotation"
] | android.annotation; | 729,287 |
private JsonWriter close(JsonScope empty, JsonScope nonempty,
String closeBracket) throws IOException {
JsonScope context = peek();
if (context != nonempty && context != empty) {
throw new IllegalStateException("Nesting problem: " + stack);
}
stack.remove(sta... | JsonWriter function(JsonScope empty, JsonScope nonempty, String closeBracket) throws IOException { JsonScope context = peek(); if (context != nonempty && context != empty) { throw new IllegalStateException(STR + stack); } stack.remove(stack.size() - 1); if (context == nonempty) { newline(); } out.write(closeBracket); r... | /**
* Closes the current scope by appending any necessary whitespace and the
* given bracket.
*/ | Closes the current scope by appending any necessary whitespace and the given bracket | close | {
"repo_name": "jonasoreland/runnerup",
"path": "app/src/main/org/runnerup/util/JsonWriter.java",
"license": "gpl-3.0",
"size": 17565
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,276,483 |
protected void setText(int row, int col, String text) {
CharFormatter.formatString(fieldBuffers[row][col], 0, text, -1);
} | void function(int row, int col, String text) { CharFormatter.formatString(fieldBuffers[row][col], 0, text, -1); } | /**
* Display a text value in this view.
*
* @param row Row of the field to change.
* @param col Column of the field to change.
* @param text The new text field value.
*/ | Display a text value in this view | setText | {
"repo_name": "jmwhite999/_android_utilpad",
"path": "UtilPad/src/org/hermit/utilpad/HeaderBarElement.java",
"license": "gpl-2.0",
"size": 8727
} | [
"org.hermit.utils.CharFormatter"
] | import org.hermit.utils.CharFormatter; | import org.hermit.utils.*; | [
"org.hermit.utils"
] | org.hermit.utils; | 1,145,561 |
public String getVersionString() {
return version == 0 ? tr("UNKNOWN") : Integer.toString(version);
} | String function() { return version == 0 ? tr(STR) : Integer.toString(version); } | /**
* Replies the version string. Either the SVN revision "1234" (as string) or the
* the I18n equivalent of "UNKNOWN".
*
* @return the JOSM version
*/ | Replies the version string. Either the SVN revision "1234" (as string) or the the I18n equivalent of "UNKNOWN" | getVersionString | {
"repo_name": "jonathanrcarter/divv-amsterdam-parkingapi",
"path": "src-josm/org/openstreetmap/josm/data/Version.java",
"license": "gpl-2.0",
"size": 7545
} | [
"org.openstreetmap.josm.tools.I18n"
] | import org.openstreetmap.josm.tools.I18n; | import org.openstreetmap.josm.tools.*; | [
"org.openstreetmap.josm"
] | org.openstreetmap.josm; | 2,756,877 |
public ServiceResponse<PageImpl<Product>> getSinglePagesFailureNext(String nextPageLink) throws CloudException, IOException, IllegalArgumentException {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
}
Call... | ServiceResponse<PageImpl<Product>> function(String nextPageLink) throws CloudException, IOException, IllegalArgumentException { if (nextPageLink == null) { throw new IllegalArgumentException(STR); } Call<ResponseBody> call = service.getSinglePagesFailureNext(nextPageLink, this.client.getAcceptLanguage()); return getSin... | /**
* A paging operation that receives a 400 on the first call.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws CloudException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @th... | A paging operation that receives a 400 on the first call | getSinglePagesFailureNext | {
"repo_name": "matt-gibbs/AutoRest",
"path": "AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/PagingOperationsImpl.java",
"license": "mit",
"size": 36572
} | [
"com.microsoft.rest.CloudException",
"com.microsoft.rest.ServiceResponse",
"com.squareup.okhttp.ResponseBody",
"java.io.IOException"
] | import com.microsoft.rest.CloudException; import com.microsoft.rest.ServiceResponse; import com.squareup.okhttp.ResponseBody; import java.io.IOException; | import com.microsoft.rest.*; import com.squareup.okhttp.*; import java.io.*; | [
"com.microsoft.rest",
"com.squareup.okhttp",
"java.io"
] | com.microsoft.rest; com.squareup.okhttp; java.io; | 299,316 |
public static void writeVarInt(ByteBuf buf, int value) {
byte part;
while (true) {
part = (byte) (value & 0x7F);
value >>>= 7;
if (value != 0) {
part |= 0x80;
}
buf.writeByte(part);
if (value == 0) {
... | static void function(ByteBuf buf, int value) { byte part; while (true) { part = (byte) (value & 0x7F); value >>>= 7; if (value != 0) { part = 0x80; } buf.writeByte(part); if (value == 0) { break; } } } | /**
* Writes an integer into the byte buffer using the least possible amount of bits.
*
* @param buf The byte buffer to write too
* @param value The integer value to write
*/ | Writes an integer into the byte buffer using the least possible amount of bits | writeVarInt | {
"repo_name": "flow/network",
"path": "src/main/java/com/flowpowered/network/util/ByteBufUtils.java",
"license": "mit",
"size": 5205
} | [
"io.netty.buffer.ByteBuf"
] | import io.netty.buffer.ByteBuf; | import io.netty.buffer.*; | [
"io.netty.buffer"
] | io.netty.buffer; | 2,626,922 |
IntStream mapToInt(DoubleToIntFunction mapper); | IntStream mapToInt(DoubleToIntFunction mapper); | /**
* Returns an {@code IntStream} consisting of the results of applying the
* given function to the elements of this stream.
*
* <p>This is an <a href="package-summary.html#StreamOps">intermediate
* operation</a>.
*
* @param mapper a <a href="package-summary.html#NonInterference">non... | Returns an IntStream consisting of the results of applying the given function to the elements of this stream. This is an intermediate operation | mapToInt | {
"repo_name": "evanman/Java-Source",
"path": "util/stream/DoubleStream.java",
"license": "lgpl-2.1",
"size": 36818
} | [
"java.util.function.DoubleToIntFunction"
] | import java.util.function.DoubleToIntFunction; | import java.util.function.*; | [
"java.util"
] | java.util; | 1,413,817 |
@CliCommand(value = "fact list partitions",
help = "get all partitions associated with fact <fact_name>, storage <storage_name> filtered by <partition-filter>")
public String getAllPartitionsOfFact(
@CliOption(key = {"", "fact_name"}, mandatory = true, help = "<fact_name>") String tableName,
@CliOption(... | @CliCommand(value = STR, help = STR) String function( @CliOption(key = {STRfact_nameSTR<fact_name>") String tableName, @CliOption(key = {STRstorage_nameSTR<storage_name>") String storageName, @CliOption(key = {STRfilterSTR<partition-filter>") String filter) { return getAllPartitions(tableName, storageName, filter); } | /**
* Gets the all partitions of fact.
*
* @param tableName fact name
* @param storageName storage name
* @param filter partition filter
* @return the all partitions of fact
*/ | Gets the all partitions of fact | getAllPartitionsOfFact | {
"repo_name": "adeelmahmood/lens",
"path": "lens-cli/src/main/java/org/apache/lens/cli/commands/LensFactCommands.java",
"license": "apache-2.0",
"size": 14328
} | [
"org.springframework.shell.core.annotation.CliCommand",
"org.springframework.shell.core.annotation.CliOption"
] | import org.springframework.shell.core.annotation.CliCommand; import org.springframework.shell.core.annotation.CliOption; | import org.springframework.shell.core.annotation.*; | [
"org.springframework.shell"
] | org.springframework.shell; | 2,789,207 |
public static int i(String msg) {
return println(Log.INFO, null, msg, null);
} | static functionnt i(String msg) { return println(Log.INFO, null, msg, null); } | /**
* Send an INFO log message.
*
* @param msg The message you would like logged.
*/ | Send an INFO log message | i | {
"repo_name": "qiniu/android-sdk",
"path": "library/src/main/java/com/qiniu/android/utils/LogUtil.java",
"license": "mit",
"size": 9592
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 2,856,240 |
void init(Component c) {
try {
createRoutingTableCache();
} catch (CacheExistException e) {
throw new IllegalStateException("could not construct routing table cache");
} catch (CacheConfigException e) {
throw new IllegalStateException("could not construct... | void init(Component c) { try { createRoutingTableCache(); } catch (CacheExistException e) { throw new IllegalStateException(STR); } catch (CacheConfigException e) { throw new IllegalStateException(STR); } catch (CacheListenerAddException e) { throw new IllegalStateException(STR); } } | /**
* Function called by the dependency manager when all the required
* dependencies are satisfied
*
*/ | Function called by the dependency manager when all the required dependencies are satisfied | init | {
"repo_name": "xiaohanz/softcontroller",
"path": "opendaylight/md-sal/zeromq-routingtable/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/impl/RoutingTableImpl.java",
"license": "epl-1.0",
"size": 12868
} | [
"org.apache.felix.dm.Component",
"org.opendaylight.controller.clustering.services.CacheConfigException",
"org.opendaylight.controller.clustering.services.CacheExistException",
"org.opendaylight.controller.clustering.services.CacheListenerAddException"
] | import org.apache.felix.dm.Component; import org.opendaylight.controller.clustering.services.CacheConfigException; import org.opendaylight.controller.clustering.services.CacheExistException; import org.opendaylight.controller.clustering.services.CacheListenerAddException; | import org.apache.felix.dm.*; import org.opendaylight.controller.clustering.services.*; | [
"org.apache.felix",
"org.opendaylight.controller"
] | org.apache.felix; org.opendaylight.controller; | 2,759,491 |
public void showMap() {
Sector comparisonSector;
Sector clientSector = client.getCurrentSector();
GameMap gameMap = client.getGameMap();
int horizontalMapLength = gameMap.getHorizontalLength();
int verticalMapLength = gameMap.getVerticalLength();
int startingHorizontalCoord = gameMap.getStartingHorizonta... | void function() { Sector comparisonSector; Sector clientSector = client.getCurrentSector(); GameMap gameMap = client.getGameMap(); int horizontalMapLength = gameMap.getHorizontalLength(); int verticalMapLength = gameMap.getVerticalLength(); int startingHorizontalCoord = gameMap.getStartingHorizontalCoord(); int startin... | /**
* Shows to the client the game's map
*
*/ | Shows to the client the game's map | showMap | {
"repo_name": "DeadManPoe/AFOSpaceProject",
"path": "src/main/java/client/CliInteractionManager.java",
"license": "apache-2.0",
"size": 26126
} | [
"it.polimi.ingsw.cg_19.GameMap"
] | import it.polimi.ingsw.cg_19.GameMap; | import it.polimi.ingsw.cg_19.*; | [
"it.polimi.ingsw"
] | it.polimi.ingsw; | 1,089,472 |
public List<AbstractGoods> getSortedPotential(UnitType unitType, Player owner) {
List<AbstractGoods> goodsTypeList = new ArrayList<AbstractGoods>();
if (getType() != null) {
// It is necessary to consider all farmed goods, since the
// tile might have a resource that produce... | List<AbstractGoods> function(UnitType unitType, Player owner) { List<AbstractGoods> goodsTypeList = new ArrayList<AbstractGoods>(); if (getType() != null) { for (GoodsType goodsType : Reformation.getSpecification().getFarmedGoodsTypeList()) { int potential = potential(goodsType, unitType); if (potential > 0) { goodsTyp... | /**
* Sorts GoodsTypes according to potential based on TileType,
* TileItemContainer if any.
*
* @param unitType the <code>UnitType</code> to work on this Tile
* @param owner the <code>Player</code> owning the unit
*
* @return The sorted GoodsTypes.
*/ | Sorts GoodsTypes according to potential based on TileType, TileItemContainer if any | getSortedPotential | {
"repo_name": "tectronics/reformationofeurope",
"path": "src/net/sf/freecol/common/model/Tile.java",
"license": "gpl-2.0",
"size": 60810
} | [
"java.util.ArrayList",
"java.util.List",
"net.sf.freecol.Reformation"
] | import java.util.ArrayList; import java.util.List; import net.sf.freecol.Reformation; | import java.util.*; import net.sf.freecol.*; | [
"java.util",
"net.sf.freecol"
] | java.util; net.sf.freecol; | 750,712 |
List<ExtensionRepoGroup> getGroups(String bucketName) throws IOException, NiFiRegistryException; | List<ExtensionRepoGroup> getGroups(String bucketName) throws IOException, NiFiRegistryException; | /**
* Gets the extension repo groups in the specified bucket.
*
* @param bucketName the bucket name
* @return the list of groups
*
* @throws IOException if an I/O error occurs
* @throws NiFiRegistryException if an non I/O error occurs
*/ | Gets the extension repo groups in the specified bucket | getGroups | {
"repo_name": "MikeThomsen/nifi",
"path": "nifi-registry/nifi-registry-core/nifi-registry-client/src/main/java/org/apache/nifi/registry/client/ExtensionRepoClient.java",
"license": "apache-2.0",
"size": 8487
} | [
"java.io.IOException",
"java.util.List",
"org.apache.nifi.registry.extension.repo.ExtensionRepoGroup"
] | import java.io.IOException; import java.util.List; import org.apache.nifi.registry.extension.repo.ExtensionRepoGroup; | import java.io.*; import java.util.*; import org.apache.nifi.registry.extension.repo.*; | [
"java.io",
"java.util",
"org.apache.nifi"
] | java.io; java.util; org.apache.nifi; | 995,372 |
public boolean run(Method _m, int _data) throws MethodException, BadArgumentException, IOException {
if (_m.getType() != VariableType.SET) {
throw new MethodException();
}
byte[] data = _m.encodeData(_data);
byte[] toDevice = new byte[data.length + 3];
byte[] fro... | boolean function(Method _m, int _data) throws MethodException, BadArgumentException, IOException { if (_m.getType() != VariableType.SET) { throw new MethodException(); } byte[] data = _m.encodeData(_data); byte[] toDevice = new byte[data.length + 3]; byte[] fromDevice = new byte[2]; toDevice[0] = MessageHeader.SET; toD... | /**
* Runs a SET method on this peripheral
*
* @param _m the method to be run
* @param _data the data to be set
* @return the returned value of the associated handler
* @throws MethodException if the provided method has not the good type
* @throws IOException in case something goes wr... | Runs a SET method on this peripheral | run | {
"repo_name": "cambierr/SmartBricksMaster",
"path": "src/main/java/org/smartbricks/peripherals/Peripheral.java",
"license": "mit",
"size": 14102
} | [
"java.io.IOException",
"org.smartbricks.core.Log",
"org.smartbricks.exceptions.BadArgumentException",
"org.smartbricks.exceptions.MethodException",
"org.smartbricks.i2c.Bus",
"org.smartbricks.i2c.Client",
"org.smartbricks.i2c.MessageHeader"
] | import java.io.IOException; import org.smartbricks.core.Log; import org.smartbricks.exceptions.BadArgumentException; import org.smartbricks.exceptions.MethodException; import org.smartbricks.i2c.Bus; import org.smartbricks.i2c.Client; import org.smartbricks.i2c.MessageHeader; | import java.io.*; import org.smartbricks.core.*; import org.smartbricks.exceptions.*; import org.smartbricks.i2c.*; | [
"java.io",
"org.smartbricks.core",
"org.smartbricks.exceptions",
"org.smartbricks.i2c"
] | java.io; org.smartbricks.core; org.smartbricks.exceptions; org.smartbricks.i2c; | 1,789,622 |
@Test
public void testDeleteUploadedMultipleSetsDeleteOneSet()
throws Exception
{
List<String> srcPaths = new ArrayList<String>();
String uniquePath = UUID.randomUUID().toString();
String file1 = UUID.randomUUID().toString() + ".dv";
String file2 = file1 + ".dv.log";
String[] sr... | void function() throws Exception { List<String> srcPaths = new ArrayList<String>(); String uniquePath = UUID.randomUUID().toString(); String file1 = UUID.randomUUID().toString() + ".dv"; String file2 = file1 + STR; String[] src = {uniquePath, file1}; srcPaths.add(buildPath(src)); src[1] = file2; srcPaths.add(buildPath(... | /**
* Test that
* @throws Exception Thrown if an error occurred.
*/ | Test that | testDeleteUploadedMultipleSetsDeleteOneSet | {
"repo_name": "hflynn/openmicroscopy",
"path": "components/tools/OmeroJava/test/integration/ManagedRepositoryTest.java",
"license": "gpl-2.0",
"size": 15477
} | [
"java.util.ArrayList",
"java.util.List",
"java.util.UUID"
] | import java.util.ArrayList; import java.util.List; import java.util.UUID; | import java.util.*; | [
"java.util"
] | java.util; | 923,583 |
@Test
public void testBothOpportunisticContainersOverLimitUponOOM()
throws Exception {
ConcurrentHashMap<ContainerId, Container> containers =
new ConcurrentHashMap<>();
Container c1 = createContainer(1, false, 1L, true);
containers.put(c1.getContainerId(), c1);
Container c2 = createCon... | void function() throws Exception { ConcurrentHashMap<ContainerId, Container> containers = new ConcurrentHashMap<>(); Container c1 = createContainer(1, false, 1L, true); containers.put(c1.getContainerId(), c1); Container c2 = createContainer(2, false, 2L, true); containers.put(c2.getContainerId(), c2); ContainerExecutor... | /**
* We have two running opportunistic containers, both of which are out of
* limit. We should kill the later one.
*/ | We have two running opportunistic containers, both of which are out of limit. We should kill the later one | testBothOpportunisticContainersOverLimitUponOOM | {
"repo_name": "steveloughran/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/TestDefaultOOMHandler.java",
"license": "apache-2.0",
"size": 54408
} | [
"java.util.concurrent.ConcurrentHashMap",
"org.apache.hadoop.yarn.api.records.ContainerId",
"org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor",
"org.apache.hadoop.yarn.server.nodemanager.Context",
"org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container",
"org.mockito.Moc... | import java.util.concurrent.ConcurrentHashMap; import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor; import org.apache.hadoop.yarn.server.nodemanager.Context; import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container; impor... | import java.util.concurrent.*; import org.apache.hadoop.yarn.api.records.*; import org.apache.hadoop.yarn.server.nodemanager.*; import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.*; import org.mockito.*; | [
"java.util",
"org.apache.hadoop",
"org.mockito"
] | java.util; org.apache.hadoop; org.mockito; | 2,214,393 |
@Test
public void testGetProjectIdChildWithNoParent() throws Exception{
Node child = setUpChildWithNoParent();
assertThrows(NotFoundException.class, ()->{
// Before the fix, this call call would hang with 100% CPU.
nodeDao.getProjectId(child.getId());
});
}
| void function() throws Exception{ Node child = setUpChildWithNoParent(); assertThrows(NotFoundException.class, ()->{ nodeDao.getProjectId(child.getId()); }); } | /**
* Test for PLFM-4369.
* A timeout for this test means the function entered
* into an infinite loop and should be killed.
*
* @throws Exception
*/ | Test for PLFM-4369. A timeout for this test means the function entered into an infinite loop and should be killed | testGetProjectIdChildWithNoParent | {
"repo_name": "xschildw/Synapse-Repository-Services",
"path": "lib/jdomodels/src/test/java/org/sagebionetworks/repo/model/dbo/dao/NodeDAOImplTest.java",
"license": "apache-2.0",
"size": 166702
} | [
"org.junit.jupiter.api.Assertions",
"org.sagebionetworks.repo.model.Node",
"org.sagebionetworks.repo.web.NotFoundException"
] | import org.junit.jupiter.api.Assertions; import org.sagebionetworks.repo.model.Node; import org.sagebionetworks.repo.web.NotFoundException; | import org.junit.jupiter.api.*; import org.sagebionetworks.repo.model.*; import org.sagebionetworks.repo.web.*; | [
"org.junit.jupiter",
"org.sagebionetworks.repo"
] | org.junit.jupiter; org.sagebionetworks.repo; | 1,927,253 |
public List<IProtocol.Feature> getFeatures() {
return features;
}
| List<IProtocol.Feature> function() { return features; } | /**
* Returns an array of features
* @return
*/ | Returns an array of features | getFeatures | {
"repo_name": "eggied97/qwirkle",
"path": "qwirkle/src/nl/utwente/ewi/qwirkle/server/connect/ClientHandler.java",
"license": "gpl-2.0",
"size": 4957
} | [
"java.util.List",
"nl.utwente.ewi.qwirkle.protocol.IProtocol"
] | import java.util.List; import nl.utwente.ewi.qwirkle.protocol.IProtocol; | import java.util.*; import nl.utwente.ewi.qwirkle.protocol.*; | [
"java.util",
"nl.utwente.ewi"
] | java.util; nl.utwente.ewi; | 1,093,447 |
private int getModuleCount(Map<String, String> properties) {
return (properties.containsKey(INSTANCE_COUNT_PROPERTY_KEY)) ?
Integer.valueOf(properties.get(INSTANCE_COUNT_PROPERTY_KEY)) : 1;
} | int function(Map<String, String> properties) { return (properties.containsKey(INSTANCE_COUNT_PROPERTY_KEY)) ? Integer.valueOf(properties.get(INSTANCE_COUNT_PROPERTY_KEY)) : 1; } | /**
* Return the module count indicated in the provided properties.
*
* @param properties properties for the module for which to determine the count
* @return module count indicated in the provided properties;
* if the properties do not contain a count a value of {@code 1} is returned
*/ | Return the module count indicated in the provided properties | getModuleCount | {
"repo_name": "pperalta/spring-cloud-dataflow",
"path": "spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/controller/StreamDeploymentController.java",
"license": "apache-2.0",
"size": 16537
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,890,616 |
public List<TargetClassifier> getClassifiers() {
return _classifiers;
} | List<TargetClassifier> function() { return _classifiers; } | /**
* Gets the classifiers.
*
* @return the classifiers
*/ | Gets the classifiers | getClassifiers | {
"repo_name": "Governance/dtgov",
"path": "dtgov-ui-war/src/main/java/org/overlord/dtgov/ui/client/local/pages/targets/ClassifiersTable.java",
"license": "apache-2.0",
"size": 5163
} | [
"java.util.List",
"org.overlord.dtgov.ui.client.shared.beans.TargetClassifier"
] | import java.util.List; import org.overlord.dtgov.ui.client.shared.beans.TargetClassifier; | import java.util.*; import org.overlord.dtgov.ui.client.shared.beans.*; | [
"java.util",
"org.overlord.dtgov"
] | java.util; org.overlord.dtgov; | 911,044 |
public static OptionsParser newOptionsParser(
Iterable<? extends Class<? extends OptionsBase>> optionsClasses) {
return new OptionsParser(
getOptionsData(ImmutableList.<Class<? extends OptionsBase>>copyOf(optionsClasses)));
}
private final OptionsParserImpl impl;
private final List<String> re... | static OptionsParser function( Iterable<? extends Class<? extends OptionsBase>> optionsClasses) { return new OptionsParser( getOptionsData(ImmutableList.<Class<? extends OptionsBase>>copyOf(optionsClasses))); } private final OptionsParserImpl impl; private final List<String> residue = new ArrayList<String>(); private b... | /**
* Create a new {@link OptionsParser}.
*/ | Create a new <code>OptionsParser</code> | newOptionsParser | {
"repo_name": "anupcshan/bazel",
"path": "src/main/java/com/google/devtools/common/options/OptionsParser.java",
"license": "apache-2.0",
"size": 21059
} | [
"com.google.common.collect.ImmutableList",
"java.util.ArrayList",
"java.util.Collection",
"java.util.List"
] | import com.google.common.collect.ImmutableList; import java.util.ArrayList; import java.util.Collection; import java.util.List; | import com.google.common.collect.*; import java.util.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 732,536 |
public void setGPOS(GlyphPositioningTable gpos) {
if ((this.gpos == null) || (gpos == null)) {
this.gpos = gpos;
} else {
throw new IllegalStateException("font already associated with GPOS table");
}
} | void function(GlyphPositioningTable gpos) { if ((this.gpos == null) (gpos == null)) { this.gpos = gpos; } else { throw new IllegalStateException(STR); } } | /**
* Establishes the glyph positioning table.
* @param gpos the glyph positioning table to be used by this font
*/ | Establishes the glyph positioning table | setGPOS | {
"repo_name": "chunlinyao/fop",
"path": "fop-core/src/main/java/org/apache/fop/fonts/MultiByteFont.java",
"license": "apache-2.0",
"size": 28852
} | [
"org.apache.fop.complexscripts.fonts.GlyphPositioningTable"
] | import org.apache.fop.complexscripts.fonts.GlyphPositioningTable; | import org.apache.fop.complexscripts.fonts.*; | [
"org.apache.fop"
] | org.apache.fop; | 1,774,840 |
public static InputStream getPackageResourceAsStream(Package ppackage, String name) {
return getPackageResourceAsStream(ppackage, name, getDefaultClassLoader(), null);
} | static InputStream function(Package ppackage, String name) { return getPackageResourceAsStream(ppackage, name, getDefaultClassLoader(), null); } | /**
* This method is similar to {@link #getResourceAsStream(String)} except that it looks for a resource with a given
* name in a specific package.
*
* @param ppackage package serving as a base folder for the resource to retrieve
* @param name name of the resource in the package. This is a file... | This method is similar to <code>#getResourceAsStream(String)</code> except that it looks for a resource with a given name in a specific package | getPackageResourceAsStream | {
"repo_name": "trol73/mucommander",
"path": "src/main/com/mucommander/commons/file/util/ResourceLoader.java",
"license": "gpl-3.0",
"size": 25237
} | [
"java.io.InputStream"
] | import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 361,981 |
public Properties transformProperties(Properties props) throws SQLException {
String host = getHost();
String port = getPort();
if (!port.equals("3306")) {
host = host + ":" + port;
}
props.put(NonRegisteringDriver.HOST_PROPERTY_KEY, host);
props.put(NonRe... | Properties function(Properties props) throws SQLException { String host = getHost(); String port = getPort(); if (!port.equals("3306")) { host = host + ":" + port; } props.put(NonRegisteringDriver.HOST_PROPERTY_KEY, host); props.put(NonRegisteringDriver.PORT_PROPERTY_KEY, port); return props; } | /**
* replaces the host and port and parameters with values for the MBean
*/ | replaces the host and port and parameters with values for the MBean | transformProperties | {
"repo_name": "wrmsr/mysql-connector-mxj-gpl",
"path": "src/com/mysql/management/jmx/ConnectorMXJPropertiesTransform.java",
"license": "gpl-2.0",
"size": 5528
} | [
"com.mysql.jdbc.NonRegisteringDriver",
"java.sql.SQLException",
"java.util.Properties"
] | import com.mysql.jdbc.NonRegisteringDriver; import java.sql.SQLException; import java.util.Properties; | import com.mysql.jdbc.*; import java.sql.*; import java.util.*; | [
"com.mysql.jdbc",
"java.sql",
"java.util"
] | com.mysql.jdbc; java.sql; java.util; | 669,489 |
public Date getEndTime() {
return endTime;
} | Date function() { return endTime; } | /**
* Gets the end time.
*
* @return the end time
*/ | Gets the end time | getEndTime | {
"repo_name": "ahmedlawi92/pnc",
"path": "model/src/main/java/org/jboss/pnc/model/BuildRecord.java",
"license": "apache-2.0",
"size": 17044
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 1,049,439 |
public Map<String, byte[]> getXAttrs(Path path, List<String> names)
throws IOException {
throw new UnsupportedOperationException(getClass().getSimpleName()
+ " doesn't support getXAttrs");
} | Map<String, byte[]> function(Path path, List<String> names) throws IOException { throw new UnsupportedOperationException(getClass().getSimpleName() + STR); } | /**
* Get all of the xattrs for a file or directory.
* Only those xattrs for which the logged-in user has permissions to view
* are returned.
* <p>
* Refer to the HDFS extended attributes user documentation for details.
*
* @param path Path to get extended attributes
* @param names XAttr names.
... | Get all of the xattrs for a file or directory. Only those xattrs for which the logged-in user has permissions to view are returned. Refer to the HDFS extended attributes user documentation for details | getXAttrs | {
"repo_name": "plusplusjiajia/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java",
"license": "apache-2.0",
"size": 50364
} | [
"java.io.IOException",
"java.util.List",
"java.util.Map"
] | import java.io.IOException; import java.util.List; import java.util.Map; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,720,998 |
public static Audio getAudio(String format, InputStream in) throws IOException {
init();
if (format.equals(AIF)) {
return SoundStore.get().getAIF(in);
}
if (format.equals(WAV)) {
return SoundStore.get().getWAV(in);
}
if (format.equals(OGG)) {
return SoundStore.get().getOgg(in);
}
throw... | static Audio function(String format, InputStream in) throws IOException { init(); if (format.equals(AIF)) { return SoundStore.get().getAIF(in); } if (format.equals(WAV)) { return SoundStore.get().getWAV(in); } if (format.equals(OGG)) { return SoundStore.get().getOgg(in); } throw new IOException(STR+format); } | /**
* Get audio data in a playable state by loading the complete audio into
* memory.
*
* @param format The format of the audio to be loaded (something like "XM" or "OGG")
* @param in The input stream from which to load the audio data
* @return An object representing the audio data
* @throws IOExceptio... | Get audio data in a playable state by loading the complete audio into memory | getAudio | {
"repo_name": "copyliu/Spoutcraft_CJKPatch",
"path": "src/minecraft/org/newdawn/slick/openal/AudioLoader.java",
"license": "lgpl-3.0",
"size": 2586
} | [
"java.io.IOException",
"java.io.InputStream"
] | import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 151,982 |
public void renderSelectionLink(AnchorTag.State state, TreeElement elem)
{
ArrayList al = _lists[TreeHtmlAttributeInfo.HTML_LOCATION_SELECTION_LINK];
assert(al != null);
if (al.size() == 0)
return;
int cnt = al.size();
for (int i = 0; i < cnt; i++) {
... | void function(AnchorTag.State state, TreeElement elem) { ArrayList al = _lists[TreeHtmlAttributeInfo.HTML_LOCATION_SELECTION_LINK]; assert(al != null); if (al.size() == 0) return; int cnt = al.size(); for (int i = 0; i < cnt; i++) { TreeHtmlAttributeInfo attr = (TreeHtmlAttributeInfo) al.get(i); state.registerAttribute... | /**
* This method will render the values assocated with the selection link.
* @param state
* @param elem
*/ | This method will render the values assocated with the selection link | renderSelectionLink | {
"repo_name": "moparisthebest/beehive",
"path": "beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/AttributeRenderer.java",
"license": "apache-2.0",
"size": 13071
} | [
"java.util.ArrayList",
"org.apache.beehive.netui.tags.rendering.AbstractHtmlState",
"org.apache.beehive.netui.tags.rendering.AnchorTag"
] | import java.util.ArrayList; import org.apache.beehive.netui.tags.rendering.AbstractHtmlState; import org.apache.beehive.netui.tags.rendering.AnchorTag; | import java.util.*; import org.apache.beehive.netui.tags.rendering.*; | [
"java.util",
"org.apache.beehive"
] | java.util; org.apache.beehive; | 1,545,634 |
ServerTransport serverTransport(ServiceMethodRegistry methodRegistry); | ServerTransport serverTransport(ServiceMethodRegistry methodRegistry); | /**
* Provider for {@link ServerTransport}.
*
* @param methodRegistry methodRegistry
* @return {@code ServerTransport} instance
*/ | Provider for <code>ServerTransport</code> | serverTransport | {
"repo_name": "servicefabric/servicefabric",
"path": "services-api/src/main/java/io/scalecube/services/transport/api/ServiceTransport.java",
"license": "apache-2.0",
"size": 762
} | [
"io.scalecube.services.methods.ServiceMethodRegistry"
] | import io.scalecube.services.methods.ServiceMethodRegistry; | import io.scalecube.services.methods.*; | [
"io.scalecube.services"
] | io.scalecube.services; | 2,795,792 |
public boolean isTestTarget() {
return TargetUtils.isTestRule(getTarget());
} | boolean function() { return TargetUtils.isTestRule(getTarget()); } | /**
* Returns true if the target for this context is a test target.
*/ | Returns true if the target for this context is a test target | isTestTarget | {
"repo_name": "damienmg/bazel",
"path": "src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java",
"license": "apache-2.0",
"size": 78605
} | [
"com.google.devtools.build.lib.packages.TargetUtils"
] | import com.google.devtools.build.lib.packages.TargetUtils; | import com.google.devtools.build.lib.packages.*; | [
"com.google.devtools"
] | com.google.devtools; | 542,085 |
public Attributes getAttributes(Name name)
throws NamingException {
CacheEntry entry = cacheLookup(name.toString());
if (entry != null) {
if (!entry.exists) {
throw notFoundException;
}
return entry.attributes;
}
Attributes ... | Attributes function(Name name) throws NamingException { CacheEntry entry = cacheLookup(name.toString()); if (entry != null) { if (!entry.exists) { throw notFoundException; } return entry.attributes; } Attributes attributes = dirContext.getAttributes(parseName(name)); if (!(attributes instanceof ResourceAttributes)) { a... | /**
* Retrieves all of the attributes associated with a named object.
*
* @return the set of attributes associated with name.
* Returns an empty attribute set if name has no attributes; never null.
* @param name the name of the object from which to retrieve attributes
* @exception Namin... | Retrieves all of the attributes associated with a named object | getAttributes | {
"repo_name": "johnaoahra80/JBOSSWEB_7_5_0_FINAL",
"path": "src/main/java/org/apache/naming/resources/ProxyDirContext.java",
"license": "apache-2.0",
"size": 69508
} | [
"javax.naming.Name",
"javax.naming.NamingException",
"javax.naming.directory.Attributes"
] | import javax.naming.Name; import javax.naming.NamingException; import javax.naming.directory.Attributes; | import javax.naming.*; import javax.naming.directory.*; | [
"javax.naming"
] | javax.naming; | 961,416 |
void generateCase(int key, Label end); | void generateCase(int key, Label end); | /**
* Generates the code for a switch case.
*
* @param key the switch case key.
* @param end a label that corresponds to the end of the switch statement.
*/ | Generates the code for a switch case | generateCase | {
"repo_name": "avaje-metric/avaje-metric-agent",
"path": "src/main/java/io/avaje/metrics/agent/asm/commons/TableSwitchGenerator.java",
"license": "apache-2.0",
"size": 2212
} | [
"io.avaje.metrics.agent.asm.Label"
] | import io.avaje.metrics.agent.asm.Label; | import io.avaje.metrics.agent.asm.*; | [
"io.avaje.metrics"
] | io.avaje.metrics; | 191,084 |
public void addDataLink(Port sourcePort, Port destinationPort,
String workflowId) throws SQLException {
String sql = "INSERT INTO Datalink (workflowId, sourceProcessorName, "
+ " sourcePortName, destinationProcessorName, destinationPortName,"
+ " sourcePortId, destinationPortId) "
+ "VALUES(?,?,?,?,... | void function(Port sourcePort, Port destinationPort, String workflowId) throws SQLException { String sql = STR + STR + STR + STR; try (Connection connection = getConnection(); PreparedStatement ps = connection.prepareStatement(sql)) { ps.setString(1, workflowId); ps.setString(2, sourcePort.getProcessorName()); ps.setSt... | /**
* inserts one row into the ARC DB table
*
* @param sourcePort
* @param destinationPort
* @param workflowId
*/ | inserts one row into the ARC DB table | addDataLink | {
"repo_name": "apache/incubator-taverna-engine",
"path": "taverna-provenanceconnector/src/main/java/org/apache/taverna/provenance/lineageservice/ProvenanceWriter.java",
"license": "apache-2.0",
"size": 23252
} | [
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.SQLException",
"org.apache.taverna.provenance.lineageservice.utils.Port"
] | import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import org.apache.taverna.provenance.lineageservice.utils.Port; | import java.sql.*; import org.apache.taverna.provenance.lineageservice.utils.*; | [
"java.sql",
"org.apache.taverna"
] | java.sql; org.apache.taverna; | 2,016,113 |
INDArray dimensions(); | INDArray dimensions(); | /**
* This method returns dimensions for this op
* @return
*/ | This method returns dimensions for this op | dimensions | {
"repo_name": "deeplearning4j/deeplearning4j",
"path": "nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/ReduceOp.java",
"license": "apache-2.0",
"size": 2925
} | [
"org.nd4j.linalg.api.ndarray.INDArray"
] | import org.nd4j.linalg.api.ndarray.INDArray; | import org.nd4j.linalg.api.ndarray.*; | [
"org.nd4j.linalg"
] | org.nd4j.linalg; | 2,270,929 |
private void sendPlayerCommand(String type, String playerName, String value) {
PlayerCommandData playerCommand = new PlayerCommandData(type, playerName, value);
JsonElement serializedCommand = gson.toJsonTree(playerCommand);
logger.debug("Command: {}", serializedCommand);
bridgeHandl... | void function(String type, String playerName, String value) { PlayerCommandData playerCommand = new PlayerCommandData(type, playerName, value); JsonElement serializedCommand = gson.toJsonTree(playerCommand); logger.debug(STR, serializedCommand); bridgeHandler.sendMessage(new OHMessage(OHMessage.MESSAGE_TYPE_PLAYER_COMM... | /**
* Send a player command to server.
*
* @param type the type of command to send
* @param playerName the name of the player to target
* @param value the related to command
*/ | Send a player command to server | sendPlayerCommand | {
"repo_name": "dominicdesu/openhab2-addons",
"path": "addons/binding/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/handler/MinecraftPlayerHandler.java",
"license": "epl-1.0",
"size": 8109
} | [
"com.google.gson.JsonElement",
"org.openhab.binding.minecraft.message.OHMessage",
"org.openhab.binding.minecraft.message.data.commands.PlayerCommandData"
] | import com.google.gson.JsonElement; import org.openhab.binding.minecraft.message.OHMessage; import org.openhab.binding.minecraft.message.data.commands.PlayerCommandData; | import com.google.gson.*; import org.openhab.binding.minecraft.message.*; import org.openhab.binding.minecraft.message.data.commands.*; | [
"com.google.gson",
"org.openhab.binding"
] | com.google.gson; org.openhab.binding; | 265,659 |
public Builder setTargetLiveOffsetIncrementOnRebufferMs(
long targetLiveOffsetIncrementOnRebufferMs) {
Assertions.checkArgument(targetLiveOffsetIncrementOnRebufferMs >= 0);
this.targetLiveOffsetIncrementOnRebufferUs =
Util.msToUs(targetLiveOffsetIncrementOnRebufferMs);
return thi... | Builder function( long targetLiveOffsetIncrementOnRebufferMs) { Assertions.checkArgument(targetLiveOffsetIncrementOnRebufferMs >= 0); this.targetLiveOffsetIncrementOnRebufferUs = Util.msToUs(targetLiveOffsetIncrementOnRebufferMs); return this; } | /**
* Sets the increment applied to the target live offset each time the player is rebuffering, in
* milliseconds.
*
* @param targetLiveOffsetIncrementOnRebufferMs The increment applied to the target live offset
* when the player is rebuffering, in milliseconds
* @return This builder, ... | Sets the increment applied to the target live offset each time the player is rebuffering, in milliseconds | setTargetLiveOffsetIncrementOnRebufferMs | {
"repo_name": "google/ExoPlayer",
"path": "library/core/src/main/java/com/google/android/exoplayer2/DefaultLivePlaybackSpeedControl.java",
"license": "apache-2.0",
"size": 19668
} | [
"com.google.android.exoplayer2.util.Assertions",
"com.google.android.exoplayer2.util.Util"
] | import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.Util; | import com.google.android.exoplayer2.util.*; | [
"com.google.android"
] | com.google.android; | 777,106 |
FileNameAnalyzer instance = new FileNameAnalyzer();
String expResult = "File Name Analyzer";
String result = instance.getName();
assertEquals(expResult, result);
} | FileNameAnalyzer instance = new FileNameAnalyzer(); String expResult = STR; String result = instance.getName(); assertEquals(expResult, result); } | /**
* Test of getName method, of class FileNameAnalyzer.
*/ | Test of getName method, of class FileNameAnalyzer | testGetName | {
"repo_name": "simon-eastwood/DependencyCheckCM",
"path": "dependency-check-core/src/test/java/org/owasp/dependencycheck/analyzer/FileNameAnalyzerTest.java",
"license": "apache-2.0",
"size": 3075
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,207,587 |
public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos)
{
if (state.getValue(PART) == BlockBed.EnumPartType.FOOT)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityBed)
{
... | MapColor function(IBlockState state, IBlockAccess worldIn, BlockPos pos) { if (state.getValue(PART) == BlockBed.EnumPartType.FOOT) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityBed) { EnumDyeColor enumdyecolor = ((TileEntityBed)tileentity).getColor(); return MapColor.getBlock... | /**
* Get the MapColor for this Block and the given BlockState
*/ | Get the MapColor for this Block and the given BlockState | getMapColor | {
"repo_name": "InverMN/MinecraftForgeReference",
"path": "MinecraftBlocks/BlockBed.java",
"license": "unlicense",
"size": 17653
} | [
"net.minecraft.block.material.MapColor",
"net.minecraft.block.state.IBlockState",
"net.minecraft.item.EnumDyeColor",
"net.minecraft.tileentity.TileEntity",
"net.minecraft.tileentity.TileEntityBed",
"net.minecraft.util.math.BlockPos",
"net.minecraft.world.IBlockAccess"
] | import net.minecraft.block.material.MapColor; import net.minecraft.block.state.IBlockState; import net.minecraft.item.EnumDyeColor; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityBed; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; | import net.minecraft.block.material.*; import net.minecraft.block.state.*; import net.minecraft.item.*; import net.minecraft.tileentity.*; import net.minecraft.util.math.*; import net.minecraft.world.*; | [
"net.minecraft.block",
"net.minecraft.item",
"net.minecraft.tileentity",
"net.minecraft.util",
"net.minecraft.world"
] | net.minecraft.block; net.minecraft.item; net.minecraft.tileentity; net.minecraft.util; net.minecraft.world; | 104,970 |
@ApiModelProperty(required = true, value = "journal_ref_id integer")
public Long getJournalRefId() {
return journalRefId;
} | @ApiModelProperty(required = true, value = STR) Long function() { return journalRefId; } | /**
* journal_ref_id integer
*
* @return journalRefId
**/ | journal_ref_id integer | getJournalRefId | {
"repo_name": "burberius/eve-esi",
"path": "src/main/java/net/troja/eve/esi/model/CharacterWalletTransactionsResponse.java",
"license": "apache-2.0",
"size": 9830
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 2,122,905 |
public void save() throws IOException {
FileChooser.SimpleFileFilter filter = FileChooser.SimpleFileFilter.getWritableImageFIlter();
JFileChooser chooser = FileChooser.getInstance();
chooser.setFileFilter(filter);
chooser.setAcceptAllFileFilterUsed(false);
chooser.setSelected... | void function() throws IOException { FileChooser.SimpleFileFilter filter = FileChooser.SimpleFileFilter.getWritableImageFIlter(); JFileChooser chooser = FileChooser.getInstance(); chooser.setFileFilter(filter); chooser.setAcceptAllFileFilterUsed(false); chooser.setSelectedFiles(new File[0]); int returnVal = chooser.sho... | /**
* Shows a file chooser and exports the plot to the selected image file.
* @throws IOException if an error occurs during writing.
*/ | Shows a file chooser and exports the plot to the selected image file | save | {
"repo_name": "arehart13/smile",
"path": "plot/src/main/java/smile/plot/PlotCanvas.java",
"license": "apache-2.0",
"size": 72105
} | [
"java.io.File",
"java.io.IOException",
"javax.swing.JFileChooser"
] | import java.io.File; import java.io.IOException; import javax.swing.JFileChooser; | import java.io.*; import javax.swing.*; | [
"java.io",
"javax.swing"
] | java.io; javax.swing; | 2,208,510 |
@SuppressWarnings({ "unchecked", "rawtypes" })
public static Object convert(final Object iValue, final Class<?> iTargetClass) {
if (iValue == null)
return null;
if (iValue.getClass().equals(iTargetClass))
// SAME TYPE: DON'T CONVERT IT
return iValue;
if (iTargetClass.isAssignableFrom(iValu... | @SuppressWarnings({ STR, STR }) static Object function(final Object iValue, final Class<?> iTargetClass) { if (iValue == null) return null; if (iValue.getClass().equals(iTargetClass)) return iValue; if (iTargetClass.isAssignableFrom(iValue.getClass())) return iValue; try { if (byte[].class.isAssignableFrom(iTargetClass... | /**
* Convert types between numbers based on the iTargetClass parameter.
*
* @param iValue
* Value to convert
* @param iTargetClass
* Expected class
* @return The converted value or the original if no conversion was applied
*/ | Convert types between numbers based on the iTargetClass parameter | convert | {
"repo_name": "fedgehog/Orient",
"path": "core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OType.java",
"license": "apache-2.0",
"size": 13639
} | [
"com.orientechnologies.common.log.OLogManager",
"com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal",
"com.orientechnologies.orient.core.serialization.serializer.OStringSerializerHelper",
"java.text.ParseException",
"java.util.Collection",
"java.util.Date",
"java.util.HashSet",
"java.util... | import com.orientechnologies.common.log.OLogManager; import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal; import com.orientechnologies.orient.core.serialization.serializer.OStringSerializerHelper; import java.text.ParseException; import java.util.Collection; import java.util.Date; import java.util.Ha... | import com.orientechnologies.common.log.*; import com.orientechnologies.orient.core.db.*; import com.orientechnologies.orient.core.serialization.serializer.*; import java.text.*; import java.util.*; | [
"com.orientechnologies.common",
"com.orientechnologies.orient",
"java.text",
"java.util"
] | com.orientechnologies.common; com.orientechnologies.orient; java.text; java.util; | 360,184 |
@Override
public Set<String> getFieldTypes() {
return null;
}
| Set<String> function() { return null; } | /**
* This attribute is used with Dashboard tabs;
*/ | This attribute is used with Dashboard tabs | getFieldTypes | {
"repo_name": "trackplus/Genji",
"path": "src/main/java/com/aurel/track/beans/TScreenTabBean.java",
"license": "gpl-3.0",
"size": 5112
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,332,391 |
if (SwingUtilities.isEventDispatchThread()) {
r.run();
} else {
SwingUtilities.invokeLater(r);
}
} | if (SwingUtilities.isEventDispatchThread()) { r.run(); } else { SwingUtilities.invokeLater(r); } } | /**
* Invoke now or later, depending if we are in the EDT
* @param r the runnable to invoke
*/ | Invoke now or later, depending if we are in the EDT | invokeInEDT | {
"repo_name": "leolewis/openvisualtraceroute",
"path": "org.leo.traceroute/src/org/leo/traceroute/ui/util/SwingUtilities4.java",
"license": "lgpl-3.0",
"size": 2523
} | [
"javax.swing.SwingUtilities"
] | import javax.swing.SwingUtilities; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 2,771,320 |
public CertificateDetails intermediate() {
return this.innerProperties() == null ? null : this.innerProperties().intermediate();
} | CertificateDetails function() { return this.innerProperties() == null ? null : this.innerProperties().intermediate(); } | /**
* Get the intermediate property: Intermediate certificate.
*
* @return the intermediate value.
*/ | Get the intermediate property: Intermediate certificate | intermediate | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateOrderInner.java",
"license": "mit",
"size": 12735
} | [
"com.azure.resourcemanager.appservice.models.CertificateDetails"
] | import com.azure.resourcemanager.appservice.models.CertificateDetails; | import com.azure.resourcemanager.appservice.models.*; | [
"com.azure.resourcemanager"
] | com.azure.resourcemanager; | 2,344,684 |
public boolean isInterface()
{
lazyLoad();
return Modifier.isInterface(_accessFlags);
} | boolean function() { lazyLoad(); return Modifier.isInterface(_accessFlags); } | /**
* Returns true for an interface.
*/ | Returns true for an interface | isInterface | {
"repo_name": "CleverCloud/Quercus",
"path": "resin/src/main/java/com/caucho/bytecode/JavaClass.java",
"license": "gpl-2.0",
"size": 16398
} | [
"java.lang.reflect.Modifier"
] | import java.lang.reflect.Modifier; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 755,294 |
String getMediaTypeName(SearchResult.MediaType mediaType); | String getMediaTypeName(SearchResult.MediaType mediaType); | /**
* Returns the localized name of a media type
*
* @param mediaType the MediaType
* @return the translated string
*/ | Returns the localized name of a media type | getMediaTypeName | {
"repo_name": "geomcmaster/opacclient",
"path": "opacclient/libopac/src/main/java/de/geeksfactory/opacclient/i18n/StringProvider.java",
"license": "mit",
"size": 5117
} | [
"de.geeksfactory.opacclient.objects.SearchResult"
] | import de.geeksfactory.opacclient.objects.SearchResult; | import de.geeksfactory.opacclient.objects.*; | [
"de.geeksfactory.opacclient"
] | de.geeksfactory.opacclient; | 2,178,800 |
EClass getAny(); | EClass getAny(); | /**
* Returns the meta object for class '{@link org_sl_planet_bgfSimplified.Any <em>Any</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Any</em>'.
* @see org_sl_planet_bgfSimplified.Any
* @generated
*/ | Returns the meta object for class '<code>org_sl_planet_bgfSimplified.Any Any</code>'. | getAny | {
"repo_name": "patrickneubauer/XMLIntellEdit",
"path": "xmlintelledit/xmltext/src/main/java/org_sl_planet_bgfSimplified/Org_sl_planet_bgfSimplifiedPackage.java",
"license": "mit",
"size": 58776
} | [
"org.eclipse.emf.ecore.EClass"
] | import org.eclipse.emf.ecore.EClass; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 912,407 |
public int combine(MDDManager m, MDDVariable var, int mdd) ; | int function(MDDManager m, MDDVariable var, int mdd) ; | /**
* Quantifies over the variable var
* @param m
* @param var
* @param mdd
* @return the new MDD where the variable var was quantified out.
*/ | Quantifies over the variable var | combine | {
"repo_name": "biobioinfo/project",
"path": "GINsim/src/main/java/org/colomoto/logicalmodel/tools/pushcount/MDDQuantifier.java",
"license": "gpl-2.0",
"size": 880
} | [
"org.colomoto.mddlib.MDDManager",
"org.colomoto.mddlib.MDDVariable"
] | import org.colomoto.mddlib.MDDManager; import org.colomoto.mddlib.MDDVariable; | import org.colomoto.mddlib.*; | [
"org.colomoto.mddlib"
] | org.colomoto.mddlib; | 1,722,051 |
public void deleteGeneratedFiles() {
synchronized(generatedFiles) {
Enumeration enumeration = generatedFiles.elements();
while (enumeration.hasMoreElements()) {
File file = (File) enumeration.nextElement();
file.delete();
}
gene... | void function() { synchronized(generatedFiles) { Enumeration enumeration = generatedFiles.elements(); while (enumeration.hasMoreElements()) { File file = (File) enumeration.nextElement(); file.delete(); } generatedFiles.removeAllElements(); } } | /**
* Delete all the generated source files made during the execution
* of this environment (those that have been registered with the
* "addGeneratedFile" method).
*/ | Delete all the generated source files made during the execution of this environment (those that have been registered with the "addGeneratedFile" method) | deleteGeneratedFiles | {
"repo_name": "TheTypoMaster/Scaper",
"path": "openjdk/jdk/src/share/classes/sun/rmi/rmic/BatchEnvironment.java",
"license": "gpl-2.0",
"size": 16470
} | [
"java.io.File",
"java.util.Enumeration"
] | import java.io.File; import java.util.Enumeration; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 374,733 |
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) {
if (action.equals("getConnectionInfo")) {
this.connectionCallbackContext = callbackContext;
NetworkInfo info = sockMan.getActiveNetworkInfo();
String connectionType = this.getTypeOfNe... | boolean function(String action, JSONArray args, CallbackContext callbackContext) { if (action.equals(STR)) { this.connectionCallbackContext = callbackContext; NetworkInfo info = sockMan.getActiveNetworkInfo(); String connectionType = this.getTypeOfNetworkFallbackToTypeNoneIfNotConnected(info); PluginResult pluginResult... | /**
* Executes the request and returns PluginResult.
*
* @param action The action to execute.
* @param args JSONArry of arguments for the plugin.
* @param callbackContext The callback id used when calling back into JavaScript.
* @return True if th... | Executes the request and returns PluginResult | execute | {
"repo_name": "apache/cordova-plugin-network-information",
"path": "src/android/NetworkManager.java",
"license": "apache-2.0",
"size": 11549
} | [
"android.net.NetworkInfo",
"org.apache.cordova.CallbackContext",
"org.apache.cordova.PluginResult",
"org.json.JSONArray"
] | import android.net.NetworkInfo; import org.apache.cordova.CallbackContext; import org.apache.cordova.PluginResult; import org.json.JSONArray; | import android.net.*; import org.apache.cordova.*; import org.json.*; | [
"android.net",
"org.apache.cordova",
"org.json"
] | android.net; org.apache.cordova; org.json; | 2,488,356 |
public static Optional<Entity> randomEntity(final EntityContainer container) {
return randomEntity0(container.streamEntities(), container.getEntityCount());
} | static Optional<Entity> function(final EntityContainer container) { return randomEntity0(container.streamEntities(), container.getEntityCount()); } | /**
* Gets a random entity from the container (if there is one).
*
* @param container
* Source container.
* @return Random entity (if found).
*/ | Gets a random entity from the container (if there is one) | randomEntity | {
"repo_name": "Ellzord/JALSE",
"path": "src/main/java/jalse/entities/Entities.java",
"license": "apache-2.0",
"size": 18542
} | [
"java.util.Optional"
] | import java.util.Optional; | import java.util.*; | [
"java.util"
] | java.util; | 1,555,309 |
public static String readBufferedReader(BufferedReader reader){
String content = "";
try{
String line = null;
do{
line = reader.readLine();
if(line != null)
content += line;
}while(line != null);
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
return content;
}... | static String function(BufferedReader reader){ String content = ""; try{ String line = null; do{ line = reader.readLine(); if(line != null) content += line; }while(line != null); reader.close(); } catch (IOException e) { e.printStackTrace(); } return content; } | /**
* Read buffered reader
* @param reader The buffered reader reader to read
* @return String corresponding to the stream
*/ | Read buffered reader | readBufferedReader | {
"repo_name": "alexgus/SmartHome-Server",
"path": "src/main/java/fr/utbm/to52/smarthome/util/BasicIO.java",
"license": "mit",
"size": 2448
} | [
"java.io.BufferedReader",
"java.io.IOException"
] | import java.io.BufferedReader; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,642,415 |
public void removeListener(L listener) {
Validate.notNull(listener, "Listener object cannot be null.");
listeners.remove(listener);
} | void function(L listener) { Validate.notNull(listener, STR); listeners.remove(listener); } | /**
* Unregisters an event listener.
*
* @param listener the event listener (may not be <code>null</code>).
*
* @throws NullPointerException if <code>listener</code> is
* <code>null</code>.
*/ | Unregisters an event listener | removeListener | {
"repo_name": "dpisarewski/gka_wise12",
"path": "src/org/apache/commons/lang3/event/EventListenerSupport.java",
"license": "lgpl-2.1",
"size": 11834
} | [
"org.apache.commons.lang3.Validate"
] | import org.apache.commons.lang3.Validate; | import org.apache.commons.lang3.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,424,147 |
public void replaceRetainedCycle(final UniqueId resourceId) {
if (_retainedResourceId != null) {
getManager().decrementCycleReferenceCount(_retainedResourceId);
_retainedResourceId = null;
}
if (resourceId != null) {
getManager().incrementCycleReferenceCount(resourceId);
_retainedR... | void function(final UniqueId resourceId) { if (_retainedResourceId != null) { getManager().decrementCycleReferenceCount(_retainedResourceId); _retainedResourceId = null; } if (resourceId != null) { getManager().incrementCycleReferenceCount(resourceId); _retainedResourceId = resourceId; } } | /**
* Replaces any existing retained resource with a new resource.
*
* @param resourceId the unique identifier of the new resource to retain, or null if there is nothing new to retain
*/ | Replaces any existing retained resource with a new resource | replaceRetainedCycle | {
"repo_name": "McLeodMoores/starling",
"path": "projects/engine/src/main/java/com/opengamma/engine/resource/EngineResourceRetainer.java",
"license": "apache-2.0",
"size": 1188
} | [
"com.opengamma.id.UniqueId"
] | import com.opengamma.id.UniqueId; | import com.opengamma.id.*; | [
"com.opengamma.id"
] | com.opengamma.id; | 537,578 |
protected boolean needToCast(SqlValidatorScope scope, SqlNode node, RelDataType toType) {
RelDataType fromType = validator.deriveType(scope, node);
// This depends on the fact that type validate happens before coercion.
// We do not have inferred type for some node, i.e. LOCALTIME.
if (fromType == nul... | boolean function(SqlValidatorScope scope, SqlNode node, RelDataType toType) { RelDataType fromType = validator.deriveType(scope, node); if (fromType == null) { return false; } if (fromType instanceof RelDataTypeFactoryImpl.JavaType && toType.getSqlTypeName() == fromType.getSqlTypeName()) { return false; } if (toType.ge... | /** Decide if a SqlNode should be casted to target type, derived class
* can override this strategy. */ | Decide if a SqlNode should be casted to target type, derived class | needToCast | {
"repo_name": "julianhyde/calcite",
"path": "core/src/main/java/org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.java",
"license": "apache-2.0",
"size": 26900
} | [
"org.apache.calcite.rel.type.RelDataType",
"org.apache.calcite.rel.type.RelDataTypeFactoryImpl",
"org.apache.calcite.sql.SqlNode",
"org.apache.calcite.sql.type.SqlTypeName",
"org.apache.calcite.sql.type.SqlTypeUtil",
"org.apache.calcite.sql.validate.SqlValidatorScope"
] | import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.rel.type.RelDataTypeFactoryImpl; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.type.SqlTypeName; import org.apache.calcite.sql.type.SqlTypeUtil; import org.apache.calcite.sql.validate.SqlValidatorScope; | import org.apache.calcite.rel.type.*; import org.apache.calcite.sql.*; import org.apache.calcite.sql.type.*; import org.apache.calcite.sql.validate.*; | [
"org.apache.calcite"
] | org.apache.calcite; | 1,741,481 |
public void setMatch(XPath v)
{
m_matchPattern = v;
}
| void function(XPath v) { m_matchPattern = v; } | /**
* Set the "match" attribute.
* The match attribute is a Pattern; an xsl:key element gives
* information about the keys of any node that matches the
* pattern specified in the match attribute.
* @see <a href="http://www.w3.org/TR/xslt#patterns">patterns in XSLT Specification</a>
*
* @para... | Set the "match" attribute. The match attribute is a Pattern; an xsl:key element gives information about the keys of any node that matches the pattern specified in the match attribute | setMatch | {
"repo_name": "srnsw/xena",
"path": "xena/ext/src/xalan-j_2_7_1/src/org/apache/xalan/templates/KeyDeclaration.java",
"license": "gpl-3.0",
"size": 5706
} | [
"org.apache.xpath.XPath"
] | import org.apache.xpath.XPath; | import org.apache.xpath.*; | [
"org.apache.xpath"
] | org.apache.xpath; | 465,011 |
public void setSourceMask(Mask sourceMask) {
checkNotNull(sourceMask);
this.sourceMask = sourceMask;
} | void function(Mask sourceMask) { checkNotNull(sourceMask); this.sourceMask = sourceMask; } | /**
* Set a mask that gets applied to the source extent.
*
* @param sourceMask a source mask
* @see #getSourceMask()
*/ | Set a mask that gets applied to the source extent | setSourceMask | {
"repo_name": "HolodeckOne-Minecraft/WorldEdit",
"path": "worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java",
"license": "gpl-3.0",
"size": 11958
} | [
"com.google.common.base.Preconditions",
"com.sk89q.worldedit.function.mask.Mask"
] | import com.google.common.base.Preconditions; import com.sk89q.worldedit.function.mask.Mask; | import com.google.common.base.*; import com.sk89q.worldedit.function.mask.*; | [
"com.google.common",
"com.sk89q.worldedit"
] | com.google.common; com.sk89q.worldedit; | 2,116,476 |
public void setViewPager(ViewPager viewPager)
{
tabStrip.removeAllViews();
this.viewPager = viewPager;
if (viewPager != null && viewPager.getAdapter() != null)
{
viewPager.setOnPageChangeListener(new InternalViewPagerListener());
populateTabStrip();
}
} | void function(ViewPager viewPager) { tabStrip.removeAllViews(); this.viewPager = viewPager; if (viewPager != null && viewPager.getAdapter() != null) { viewPager.setOnPageChangeListener(new InternalViewPagerListener()); populateTabStrip(); } } | /**
* Sets the associated view pager. Note that the assumption here is that the pager content
* (number of tabs and tab titles) does not change after this call has been made.
*/ | Sets the associated view pager. Note that the assumption here is that the pager content (number of tabs and tab titles) does not change after this call has been made | setViewPager | {
"repo_name": "libit/lr_dialer",
"path": "app/src/main/java/com/ogaclejapan/smarttablayout/SmartTabLayout.java",
"license": "gpl-3.0",
"size": 20506
} | [
"android.support.v4.view.ViewPager"
] | import android.support.v4.view.ViewPager; | import android.support.v4.view.*; | [
"android.support"
] | android.support; | 2,406,837 |
public static java.util.List extractReportBoList(ims.domain.ILightweightDomainFactory domainFactory, ims.admin.vo.ReportVoCollection voCollection)
{
return extractReportBoList(domainFactory, voCollection, null, new HashMap());
}
| static java.util.List function(ims.domain.ILightweightDomainFactory domainFactory, ims.admin.vo.ReportVoCollection voCollection) { return extractReportBoList(domainFactory, voCollection, null, new HashMap()); } | /**
* Create the ims.core.admin.domain.objects.ReportBo list from the value object collection.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param voCollection - the collection of value objects
*/ | Create the ims.core.admin.domain.objects.ReportBo list from the value object collection | extractReportBoList | {
"repo_name": "open-health-hub/openMAXIMS",
"path": "openmaxims_workspace/ValueObjects/src/ims/admin/vo/domain/ReportVoAssembler.java",
"license": "agpl-3.0",
"size": 17340
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 363,614 |
private class ReferenceQueueMonitor<T> extends ReferenceQueue<T>
implements Runnable {
@Override
public void run() {
for (;;) try {
Reference<? extends T> ref = super.remove();
if (ref != null) ref.clear();
} catch (Interru... | class ReferenceQueueMonitor<T> extends ReferenceQueue<T> implements Runnable { public void function() { for (;;) try { Reference<? extends T> ref = super.remove(); if (ref != null) ref.clear(); } catch (InterruptedException e) { System.out.println(e+STR);} } } | /** Uses the parent's remove method which is blocking until a cleared
* reference is added to the queue.
* Calls the overwritten clear method of the associated reference which
* will remove the key from the cache.
* {@inheritDoc} */ | Uses the parent's remove method which is blocking until a cleared reference is added to the queue. Calls the overwritten clear method of the associated reference which will remove the key from the cache | run | {
"repo_name": "beanshell/beanshell",
"path": "src/main/java/bsh/util/ReferenceCache.java",
"license": "apache-2.0",
"size": 13285
} | [
"java.lang.ref.Reference",
"java.lang.ref.ReferenceQueue"
] | import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; | import java.lang.ref.*; | [
"java.lang"
] | java.lang; | 2,907,991 |
public void setSecurityOptions(Map<String, Object> securityOptions) {
this.securityOptions = securityOptions;
} | void function(Map<String, Object> securityOptions) { this.securityOptions = securityOptions; } | /**
* To configure NettyHttpSecurityConfiguration using key/value pairs from the map
*/ | To configure NettyHttpSecurityConfiguration using key/value pairs from the map | setSecurityOptions | {
"repo_name": "punkhorn/camel-upstream",
"path": "components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpEndpoint.java",
"license": "apache-2.0",
"size": 10630
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,111,072 |
public void restoreResource(CmsRequestContext context, CmsResource resource, int version)
throws CmsException, CmsSecurityException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
checkOfflineProject(dbc);
checkPermissions(dbc, resource, CmsPermissio... | void function(CmsRequestContext context, CmsResource resource, int version) throws CmsException, CmsSecurityException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { checkOfflineProject(dbc); checkPermissions(dbc, resource, CmsPermissionSet.ACCESS_WRITE, true, CmsResourceFilter.ALL); m_driverManage... | /**
* Restores a resource in the current project with the given version from the historical archive.<p>
*
* @param context the current request context
* @param resource the resource to restore from the archive
* @param version the version number to restore
*
* @throws CmsException if ... | Restores a resource in the current project with the given version from the historical archive | restoreResource | {
"repo_name": "sbonoc/opencms-core",
"path": "src/org/opencms/db/CmsSecurityManager.java",
"license": "lgpl-2.1",
"size": 287876
} | [
"org.opencms.file.CmsRequestContext",
"org.opencms.file.CmsResource",
"org.opencms.file.CmsResourceFilter",
"org.opencms.main.CmsException",
"org.opencms.security.CmsPermissionSet",
"org.opencms.security.CmsSecurityException"
] | import org.opencms.file.CmsRequestContext; import org.opencms.file.CmsResource; import org.opencms.file.CmsResourceFilter; import org.opencms.main.CmsException; import org.opencms.security.CmsPermissionSet; import org.opencms.security.CmsSecurityException; | import org.opencms.file.*; import org.opencms.main.*; import org.opencms.security.*; | [
"org.opencms.file",
"org.opencms.main",
"org.opencms.security"
] | org.opencms.file; org.opencms.main; org.opencms.security; | 2,580,155 |
private long getDurationValue() throws ImplementationException {
if (spec.getBoundarySpec() != null) {
ECTime duration = spec.getBoundarySpec().getDuration();
if (duration != null) {
if (duration.getUnit().compareToIgnoreCase(ECTimeUnit.MS) == 0) {
return duration.getValue();
} else {
throw... | long function() throws ImplementationException { if (spec.getBoundarySpec() != null) { ECTime duration = spec.getBoundarySpec().getDuration(); if (duration != null) { if (duration.getUnit().compareToIgnoreCase(ECTimeUnit.MS) == 0) { return duration.getValue(); } else { throw new ImplementationException( STR); } } } ret... | /**
* This method returns the duration value extracted from the event cycle
* specification.
* @return duration value in milliseconds
* @throws ImplementationException if an implementation exception occurs
*/ | This method returns the duration value extracted from the event cycle specification | getDurationValue | {
"repo_name": "Auto-ID-Lab-Japan/fosstrak-fc",
"path": "fc-server/src/main/java/org/fosstrak/ale/server/impl/EventCycleImpl.java",
"license": "lgpl-2.1",
"size": 20930
} | [
"org.fosstrak.ale.exception.ImplementationException",
"org.fosstrak.ale.util.ECTimeUnit",
"org.fosstrak.ale.xsd.ale.epcglobal.ECTime"
] | import org.fosstrak.ale.exception.ImplementationException; import org.fosstrak.ale.util.ECTimeUnit; import org.fosstrak.ale.xsd.ale.epcglobal.ECTime; | import org.fosstrak.ale.exception.*; import org.fosstrak.ale.util.*; import org.fosstrak.ale.xsd.ale.epcglobal.*; | [
"org.fosstrak.ale"
] | org.fosstrak.ale; | 1,918,638 |
public List<BoardPosition> getPushingPositions(int row, int col)
{
List<BoardPosition> positions = new ArrayList<>();
// UP and DOWN
if(row > 0 && row < rows-1) {
BoardPosition down = new BoardPosition(row+1,col);
BoardPosition up = new BoardPosition(row-1,col);
if(!isBlockingNode... | List<BoardPosition> function(int row, int col) { List<BoardPosition> positions = new ArrayList<>(); if(row > 0 && row < rows-1) { BoardPosition down = new BoardPosition(row+1,col); BoardPosition up = new BoardPosition(row-1,col); if(!isBlockingNode(down) && !isBlockingNode(up)) { positions.add(up); positions.add(down);... | /***
* Returns neighbour positions which can be used to push this (assumed) block.
* @param row
* @param col
* @return
*/ | Returns neighbour positions which can be used to push this (assumed) block | getPushingPositions | {
"repo_name": "figgefred/ai13-sokoban",
"path": "src/sokoban/Tethik/IDA/BoardState.java",
"license": "mit",
"size": 17491
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 126,018 |
private float computeArea(Rect2D rect0, Rect2D rect1)
{
// Compute minimum and maximum x coords to get containing width
final float minX = Math.min(rect0.getX(), rect1.getX());
final float maxX = Math.max(rect0.getX() + rect0.getWidth(), rect1.getX() + rect1.getWidth());
// Comp... | float function(Rect2D rect0, Rect2D rect1) { final float minX = Math.min(rect0.getX(), rect1.getX()); final float maxX = Math.max(rect0.getX() + rect0.getWidth(), rect1.getX() + rect1.getWidth()); final float minY = Math.min(rect0.getY(), rect1.getY()); final float maxY = Math.max(rect0.getY() + rect0.getHeight(), rect... | /**
* <p>Computes the area of a rectangle containing two given {@link Rect2D}s used as the rectangle's corners.</p>
*
* @param rect0 one Rect2D.
* @param rect1 other Rect2D.
* @return area.
*/ | Computes the area of a rectangle containing two given <code>Rect2D</code>s used as the rectangle's corners | computeArea | {
"repo_name": "joltix/Cinnamon",
"path": "com/cinnamon/object/BoundingTree.java",
"license": "mit",
"size": 20383
} | [
"com.cinnamon.utils.Rect2D"
] | import com.cinnamon.utils.Rect2D; | import com.cinnamon.utils.*; | [
"com.cinnamon.utils"
] | com.cinnamon.utils; | 1,880,172 |
private StatusGenerator extractStatusGenerator(final Method method) {
final GenerateStatus generateStatusAnnotation;
if (method.isAnnotationPresent(GenerateStatus.class)) {
generateStatusAnnotation = method.getAnnotation(GenerateStatus.class);
} else {
generateStatusA... | StatusGenerator function(final Method method) { final GenerateStatus generateStatusAnnotation; if (method.isAnnotationPresent(GenerateStatus.class)) { generateStatusAnnotation = method.getAnnotation(GenerateStatus.class); } else { generateStatusAnnotation = method.getDeclaringClass().getAnnotation(GenerateStatus.class)... | /**
* Extracts and instantiates the status generator that is responsible for
* the given method.
*
* @param method
* The method to extract the status generator instance from.
* @return The created status generator.
*/ | Extracts and instantiates the status generator that is responsible for the given method | extractStatusGenerator | {
"repo_name": "lcmanager/gdb",
"path": "gdb-web-control/src/main/java/org/lcmanager/gdb/web/control/status/StatusAspect.java",
"license": "apache-2.0",
"size": 5338
} | [
"java.lang.reflect.Method",
"org.lcmanager.gdb.base.ApplicationContextUtil",
"org.springframework.beans.factory.config.AutowireCapableBeanFactory"
] | import java.lang.reflect.Method; import org.lcmanager.gdb.base.ApplicationContextUtil; import org.springframework.beans.factory.config.AutowireCapableBeanFactory; | import java.lang.reflect.*; import org.lcmanager.gdb.base.*; import org.springframework.beans.factory.config.*; | [
"java.lang",
"org.lcmanager.gdb",
"org.springframework.beans"
] | java.lang; org.lcmanager.gdb; org.springframework.beans; | 322,556 |
private Method getBestMatchingMethod(
Map<Class<? extends Throwable>, Method> resolverMethods, Exception thrownException) {
if (resolverMethods.isEmpty()) {
return null;
}
Class<? extends Throwable> closestMatch =
ExceptionDepthComparator.findClosestMatch(resolverMethods.keySet(), thrownException);
... | Method function( Map<Class<? extends Throwable>, Method> resolverMethods, Exception thrownException) { if (resolverMethods.isEmpty()) { return null; } Class<? extends Throwable> closestMatch = ExceptionDepthComparator.findClosestMatch(resolverMethods.keySet(), thrownException); Method method = resolverMethods.get(close... | /**
* Uses the {@link DepthComparator} to find the best matching method
* @return the best matching method or {@code null}.
*/ | Uses the <code>DepthComparator</code> to find the best matching method | getBestMatchingMethod | {
"repo_name": "kingtang/spring-learn",
"path": "spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver.java",
"license": "gpl-3.0",
"size": 17869
} | [
"java.lang.reflect.Method",
"java.util.Map",
"org.springframework.core.ExceptionDepthComparator"
] | import java.lang.reflect.Method; import java.util.Map; import org.springframework.core.ExceptionDepthComparator; | import java.lang.reflect.*; import java.util.*; import org.springframework.core.*; | [
"java.lang",
"java.util",
"org.springframework.core"
] | java.lang; java.util; org.springframework.core; | 1,742,493 |
int insertSelective(Milestone record); | int insertSelective(Milestone record); | /**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table m_prj_milestone
*
* @mbggenerated Thu Jul 16 10:50:12 ICT 2015
*/ | This method was generated by MyBatis Generator. This method corresponds to the database table m_prj_milestone | insertSelective | {
"repo_name": "uniteddiversity/mycollab",
"path": "mycollab-services/src/main/java/com/esofthead/mycollab/module/project/dao/MilestoneMapper.java",
"license": "agpl-3.0",
"size": 5589
} | [
"com.esofthead.mycollab.module.project.domain.Milestone"
] | import com.esofthead.mycollab.module.project.domain.Milestone; | import com.esofthead.mycollab.module.project.domain.*; | [
"com.esofthead.mycollab"
] | com.esofthead.mycollab; | 35,292 |
public void setInformationDate(final LocalDateTime informationDate) {
this.informationDate = informationDate;
} | void function(final LocalDateTime informationDate) { this.informationDate = informationDate; } | /**
* Set the value related to the column: informationDate.
* @param informationDate the informationDate value you wish to set
*/ | Set the value related to the column: informationDate | setInformationDate | {
"repo_name": "servinglynk/hmis-lynk-open-source",
"path": "hmis-model-v2016/src/main/java/com/servinglynk/hmis/warehouse/model/v2016/Employment.java",
"license": "mpl-2.0",
"size": 13316
} | [
"java.time.LocalDateTime"
] | import java.time.LocalDateTime; | import java.time.*; | [
"java.time"
] | java.time; | 99,196 |
public static Bitmap decodeSampledBitmapFromAsset(AssetManager am, String path, int reqWidth, int reqHeight) throws IOException
{
Log.i(TAG, "decodeSampledBitmapFromAsset-->in");
// First decode with inJustDecodeBounds=true to check dimensions
final BitmapFactory.Options options = new Bitma... | static Bitmap function(AssetManager am, String path, int reqWidth, int reqHeight) throws IOException { Log.i(TAG, STR); final BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; InputStream is = am.open(path); BitmapFactory.decodeStream(is, null, options); is.close(); options... | /**
* Decode and sample down a bitmap from a file to the requested width and
* height.
*
* @param filename
* The full path of the file to decode
* @param reqWidth
* The requested width of the resulting bitmap
* @param reqHeight
* The request... | Decode and sample down a bitmap from a file to the requested width and height | decodeSampledBitmapFromAsset | {
"repo_name": "ROKOLabs/ROKO.Stickers.Android-Demo-APP",
"path": "RokoStickersDemo/app/src/main/java/com/rokolabs/app/common/image/ImageResizer.java",
"license": "apache-2.0",
"size": 11622
} | [
"android.content.res.AssetManager",
"android.graphics.Bitmap",
"android.graphics.BitmapFactory",
"android.util.Log",
"java.io.IOException",
"java.io.InputStream"
] | import android.content.res.AssetManager; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.util.Log; import java.io.IOException; import java.io.InputStream; | import android.content.res.*; import android.graphics.*; import android.util.*; import java.io.*; | [
"android.content",
"android.graphics",
"android.util",
"java.io"
] | android.content; android.graphics; android.util; java.io; | 2,605,136 |
@Override
public void assigned(Assignment<Request, Enrollment> assignment, Enrollment value) {
StudentSectioningModelContext cx = ((StudentSectioningModel)getModel()).getContext(assignment);
for (Conflict c: allConflicts(assignment, value)) {
iTotalNrConflicts += ... | void function(Assignment<Request, Enrollment> assignment, Enrollment value) { StudentSectioningModelContext cx = ((StudentSectioningModel)getModel()).getContext(assignment); for (Conflict c: allConflicts(assignment, value)) { iTotalNrConflicts += c.getShare(); cx.add(assignment, c); } if (sDebug) { sLog.debug("A:" + va... | /**
* Called when a value is assigned to a variable. Internal number of
* time overlapping conflicts is updated, see
* {@link TimeOverlapsCounter#getTotalNrConflicts(Assignment)}.
*/ | Called when a value is assigned to a variable. Internal number of time overlapping conflicts is updated, see <code>TimeOverlapsCounter#getTotalNrConflicts(Assignment)</code> | assigned | {
"repo_name": "UniTime/cpsolver",
"path": "src/org/cpsolver/studentsct/extension/TimeOverlapsCounter.java",
"license": "lgpl-3.0",
"size": 30907
} | [
"org.cpsolver.ifs.assignment.Assignment",
"org.cpsolver.studentsct.StudentSectioningModel",
"org.cpsolver.studentsct.model.Enrollment",
"org.cpsolver.studentsct.model.Request"
] | import org.cpsolver.ifs.assignment.Assignment; import org.cpsolver.studentsct.StudentSectioningModel; import org.cpsolver.studentsct.model.Enrollment; import org.cpsolver.studentsct.model.Request; | import org.cpsolver.ifs.assignment.*; import org.cpsolver.studentsct.*; import org.cpsolver.studentsct.model.*; | [
"org.cpsolver.ifs",
"org.cpsolver.studentsct"
] | org.cpsolver.ifs; org.cpsolver.studentsct; | 2,523,565 |
public String generateCreateTableSQL(AmberPersistenceUnit manager)
{
return null;
} | String function(AmberPersistenceUnit manager) { return null; } | /**
* Generates the where clause.
*/ | Generates the where clause | generateCreateTableSQL | {
"repo_name": "dlitz/resin",
"path": "modules/resin/src/com/caucho/amber/field/SubId.java",
"license": "gpl-2.0",
"size": 7074
} | [
"com.caucho.amber.manager.AmberPersistenceUnit"
] | import com.caucho.amber.manager.AmberPersistenceUnit; | import com.caucho.amber.manager.*; | [
"com.caucho.amber"
] | com.caucho.amber; | 475,850 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.