method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public void activate(BundleContext bundleContext)
{
// init the logger
this.logger = new LogHelper(bundleContext);
// store the context
this.context = bundleContext;
// fill the device categories
this.properFillDeviceCategories(this.driverInstanceClass);
} | void function(BundleContext bundleContext) { this.logger = new LogHelper(bundleContext); this.context = bundleContext; this.properFillDeviceCategories(this.driverInstanceClass); } | /**
* Handle the bundle activation
*/ | Handle the bundle activation | activate | {
"repo_name": "dog-gateway/hue-drivers",
"path": "it.polito.elite.dog.drivers.hue.gateway/src/it/polito/elite/dog/drivers/hue/device/HueDeviceDriver.java",
"license": "apache-2.0",
"size": 9615
} | [
"it.polito.elite.dog.core.library.util.LogHelper",
"org.osgi.framework.BundleContext"
] | import it.polito.elite.dog.core.library.util.LogHelper; import org.osgi.framework.BundleContext; | import it.polito.elite.dog.core.library.util.*; import org.osgi.framework.*; | [
"it.polito.elite",
"org.osgi.framework"
] | it.polito.elite; org.osgi.framework; | 2,776,677 |
public int[] getCodebook() {
return Arrays.copyOf(codebook, codebook.length);
} | int[] function() { return Arrays.copyOf(codebook, codebook.length); } | /**
* Returns a copy of the codebook.
*
* @return
*/ | Returns a copy of the codebook | getCodebook | {
"repo_name": "inter6/jHears",
"path": "jhears-core/src/main/java/org/jhears/seq/IntQuantizer.java",
"license": "agpl-3.0",
"size": 8075
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 141,016 |
public Iterable<Edge> getEdgesOfClass(final String iClassName) {
makeActive();
return getEdgesOfClass(iClassName, true);
} | Iterable<Edge> function(final String iClassName) { makeActive(); return getEdgesOfClass(iClassName, true); } | /**
* Get all the Edges in Graph of a specific edge class and all sub-classes.
*
* @param iClassName Edge class name to filter
* @return Edges as Iterable
*/ | Get all the Edges in Graph of a specific edge class and all sub-classes | getEdgesOfClass | {
"repo_name": "orientechnologies/orientdb",
"path": "graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientBaseGraph.java",
"license": "apache-2.0",
"size": 78130
} | [
"com.tinkerpop.blueprints.Edge"
] | import com.tinkerpop.blueprints.Edge; | import com.tinkerpop.blueprints.*; | [
"com.tinkerpop.blueprints"
] | com.tinkerpop.blueprints; | 86,221 |
CompletableFuture<Object> asyncRequestBody(Endpoint endpoint, Object body); | CompletableFuture<Object> asyncRequestBody(Endpoint endpoint, Object body); | /**
* Sends an asynchronous body to the given endpoint.
* Uses an {@link ExchangePattern#InOut} message exchange pattern.
*
* @param endpoint the endpoint to send the exchange to
* @param body the body to send
* @return a handle to be used to get the response in the future
*... | Sends an asynchronous body to the given endpoint. Uses an <code>ExchangePattern#InOut</code> message exchange pattern | asyncRequestBody | {
"repo_name": "punkhorn/camel-upstream",
"path": "core/camel-api/src/main/java/org/apache/camel/ProducerTemplate.java",
"license": "apache-2.0",
"size": 56673
} | [
"java.util.concurrent.CompletableFuture"
] | import java.util.concurrent.CompletableFuture; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,846,637 |
private void saveAPIStatus(Registry registry, String artifactId, String apiStatus) throws APIManagementException {
try {
Resource resource = registry.get(artifactId);
if (resource != null) {
String propValue = resource.getProperty(APIConstants.API_STATUS);
... | void function(Registry registry, String artifactId, String apiStatus) throws APIManagementException { try { Resource resource = registry.get(artifactId); if (resource != null) { String propValue = resource.getProperty(APIConstants.API_STATUS); if (propValue == null) { resource.addProperty(APIConstants.API_STATUS, apiSt... | /**
* Persist API Status into a property of API Registry resource
*
* @param artifactId API artifact ID
* @param apiStatus Current status of the API
* @throws APIManagementException on error
*/ | Persist API Status into a property of API Registry resource | saveAPIStatus | {
"repo_name": "praminda/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/RegistryPersistenceImpl.java",
"license": "apache-2.0",
"size": 210089
} | [
"org.wso2.carbon.apimgt.api.APIManagementException",
"org.wso2.carbon.apimgt.persistence.utils.PersistenceUtil",
"org.wso2.carbon.registry.core.Registry",
"org.wso2.carbon.registry.core.Resource",
"org.wso2.carbon.registry.core.exceptions.RegistryException"
] | import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.persistence.utils.PersistenceUtil; import org.wso2.carbon.registry.core.Registry; import org.wso2.carbon.registry.core.Resource; import org.wso2.carbon.registry.core.exceptions.RegistryException; | import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.persistence.utils.*; import org.wso2.carbon.registry.core.*; import org.wso2.carbon.registry.core.exceptions.*; | [
"org.wso2.carbon"
] | org.wso2.carbon; | 517,459 |
@Override
public Session createSession(String sessionId) {
if ((maxActiveSessions >= 0) &&
(getActiveSessions() >= maxActiveSessions)) {
rejectedSessions++;
throw new TooManyActiveSessionsException(
sm.getString("managerBase.createSessi... | Session function(String sessionId) { if ((maxActiveSessions >= 0) && (getActiveSessions() >= maxActiveSessions)) { rejectedSessions++; throw new TooManyActiveSessionsException( sm.getString(STR), maxActiveSessions); } Session session = createEmptySession(); session.setNew(true); session.setValid(true); session.setCreat... | /**
* Construct and return a new session object, based on the default
* settings specified by this Manager's properties. The session
* id specified will be used as the session id.
* If a new session cannot be created for any reason, return
* <code>null</code>.
*
* @param sessi... | Construct and return a new session object, based on the default settings specified by this Manager's properties. The session id specified will be used as the session id. If a new session cannot be created for any reason, return <code>null</code> | createSession | {
"repo_name": "wenzhucjy/tomcat_source",
"path": "tomcat-8.0.9-sourcecode/java/org/apache/catalina/session/ManagerBase.java",
"license": "apache-2.0",
"size": 40186
} | [
"org.apache.catalina.Session"
] | import org.apache.catalina.Session; | import org.apache.catalina.*; | [
"org.apache.catalina"
] | org.apache.catalina; | 1,643,185 |
void loadFromDB(long id, @NonNull SQLiteDatabase db) throws NoSuchRowException; | void loadFromDB(long id, @NonNull SQLiteDatabase db) throws NoSuchRowException; | /**
* Sets values of model based on a row in the DB
* @param id The id of the row to load
* @param db The database to load from
* @throws NoSuchRowException When the specified row does not exist
*/ | Sets values of model based on a row in the DB | loadFromDB | {
"repo_name": "Noah-Huppert/Counter",
"path": "app/src/main/java/com/noahhuppert/counter/models/sqlite/DBModel.java",
"license": "mit",
"size": 1580
} | [
"android.database.sqlite.SQLiteDatabase",
"android.support.annotation.NonNull",
"com.noahhuppert.counter.models.sqlite.exceptions.NoSuchRowException"
] | import android.database.sqlite.SQLiteDatabase; import android.support.annotation.NonNull; import com.noahhuppert.counter.models.sqlite.exceptions.NoSuchRowException; | import android.database.sqlite.*; import android.support.annotation.*; import com.noahhuppert.counter.models.sqlite.exceptions.*; | [
"android.database",
"android.support",
"com.noahhuppert.counter"
] | android.database; android.support; com.noahhuppert.counter; | 2,240,166 |
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
{
if (state.getValue(VARIANT) == BlockDirt.DirtType.PODZOL)
{
Block block = worldIn.getBlockState(pos.up()).getBlock();
state = state.withProperty(SNOWY, Boolean.valueOf(block == Bloc... | IBlockState function(IBlockState state, IBlockAccess worldIn, BlockPos pos) { if (state.getValue(VARIANT) == BlockDirt.DirtType.PODZOL) { Block block = worldIn.getBlockState(pos.up()).getBlock(); state = state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow block == Blocks.snow_layer)); } return state; } | /**
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
* metadata, such as fence connections.
*/ | Get the actual Block state of this Block at the given position. This applies properties not visible in the metadata, such as fence connections | getActualState | {
"repo_name": "SkidJava/BaseClient",
"path": "new_1.8.8/net/minecraft/block/BlockDirt.java",
"license": "gpl-2.0",
"size": 5830
} | [
"net.minecraft.block.state.IBlockState",
"net.minecraft.init.Blocks",
"net.minecraft.util.BlockPos",
"net.minecraft.world.IBlockAccess"
] | import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.world.IBlockAccess; | import net.minecraft.block.state.*; import net.minecraft.init.*; import net.minecraft.util.*; import net.minecraft.world.*; | [
"net.minecraft.block",
"net.minecraft.init",
"net.minecraft.util",
"net.minecraft.world"
] | net.minecraft.block; net.minecraft.init; net.minecraft.util; net.minecraft.world; | 2,837,180 |
public void init() throws TeolennException {
if (this.field == null)
throw new InvalidParameterException("The field value is unknown for "
+ MEASUREMENT_FILTER_NAME + " filter.");
}
//
// Constructor
//
public BooleanFilter() {
}
public BooleanFilter(final String field, fin... | void function() throws TeolennException { if (this.field == null) throw new InvalidParameterException(STR + MEASUREMENT_FILTER_NAME + STR); } public BooleanFilter() { } public BooleanFilter(final String field, final boolean acceptValue) { if (field == null) throw new NullPointerException(STR); this.field = field; this.... | /**
* Run the initialization phase of the parameter.
* @throws TeolennException if an error occurs while the initialization phase
*/ | Run the initialization phase of the parameter | init | {
"repo_name": "GenomicParisCentre/teolenn",
"path": "src/main/java/fr/ens/transcriptome/teolenn/measurement/filter/BooleanFilter.java",
"license": "gpl-2.0",
"size": 3301
} | [
"fr.ens.transcriptome.teolenn.TeolennException",
"java.security.InvalidParameterException"
] | import fr.ens.transcriptome.teolenn.TeolennException; import java.security.InvalidParameterException; | import fr.ens.transcriptome.teolenn.*; import java.security.*; | [
"fr.ens.transcriptome",
"java.security"
] | fr.ens.transcriptome; java.security; | 309,064 |
public void setStemH( float stemH )
{
dic.setFloat( COSName.STEM_H, stemH );
}
| void function( float stemH ) { dic.setFloat( COSName.STEM_H, stemH ); } | /**
* This will set the stem H for the font.
*
* @param stemH The new stem h for the font.
*/ | This will set the stem H for the font | setStemH | {
"repo_name": "mdamt/PdfBox-Android",
"path": "library/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontDescriptor.java",
"license": "apache-2.0",
"size": 19677
} | [
"org.apache.pdfbox.cos.COSName"
] | import org.apache.pdfbox.cos.COSName; | import org.apache.pdfbox.cos.*; | [
"org.apache.pdfbox"
] | org.apache.pdfbox; | 528,880 |
void postCall(HttpRequest request, HttpResponseStatus status, HandlerInfo handlerInfo); | void postCall(HttpRequest request, HttpResponseStatus status, HandlerInfo handlerInfo); | /**
* postCall is run after a handler method call is made. If any of the postCalls throw and exception then the
* remaining postCalls will still be called. If the handler method was not called then postCall hooks will not be
* called.
*
* @param request HttpRequest being processed.
* @... | postCall is run after a handler method call is made. If any of the postCalls throw and exception then the remaining postCalls will still be called. If the handler method was not called then postCall hooks will not be called | postCall | {
"repo_name": "chanakaudaya/netty-http",
"path": "src/main/java/co/cask/http/HandlerHook.java",
"license": "apache-2.0",
"size": 2137
} | [
"co.cask.http.HandlerInfo",
"io.netty.handler.codec.http.HttpRequest",
"io.netty.handler.codec.http.HttpResponseStatus"
] | import co.cask.http.HandlerInfo; import io.netty.handler.codec.http.HttpRequest; import io.netty.handler.codec.http.HttpResponseStatus; | import co.cask.http.*; import io.netty.handler.codec.http.*; | [
"co.cask.http",
"io.netty.handler"
] | co.cask.http; io.netty.handler; | 2,586,855 |
@Override
public Response isScopeExists(String name) {
boolean isScopeExists = false;
try {
isScopeExists = ScopeUtils.getOAuth2ScopeService().isScopeExists(name);
} catch (IdentityOAuth2ScopeClientException e) {
if (LOG.isDebugEnabled()) {
LOG.d... | Response function(String name) { boolean isScopeExists = false; try { isScopeExists = ScopeUtils.getOAuth2ScopeService().isScopeExists(name); } catch (IdentityOAuth2ScopeClientException e) { if (LOG.isDebugEnabled()) { LOG.debug(STR + name, e); } ScopeUtils.handleErrorResponse(Response.Status.BAD_REQUEST, Response.Stat... | /**
* Check the existence of a scope
*
* @param name Name of the scope
* @return Response with the indication whether the scope exists or not
*/ | Check the existence of a scope | isScopeExists | {
"repo_name": "chirankavinda123/identity-inbound-auth-oauth",
"path": "components/org.wso2.carbon.identity.oauth.scope.endpoint/src/main/java/org/wso2/carbon/identity/oauth/scope/endpoint/impl/ScopesApiServiceImpl.java",
"license": "apache-2.0",
"size": 10569
} | [
"javax.ws.rs.core.Response",
"org.wso2.carbon.identity.oauth.scope.endpoint.util.ScopeUtils",
"org.wso2.carbon.identity.oauth2.IdentityOAuth2ScopeClientException",
"org.wso2.carbon.identity.oauth2.IdentityOAuth2ScopeException"
] | import javax.ws.rs.core.Response; import org.wso2.carbon.identity.oauth.scope.endpoint.util.ScopeUtils; import org.wso2.carbon.identity.oauth2.IdentityOAuth2ScopeClientException; import org.wso2.carbon.identity.oauth2.IdentityOAuth2ScopeException; | import javax.ws.rs.core.*; import org.wso2.carbon.identity.oauth.scope.endpoint.util.*; import org.wso2.carbon.identity.oauth2.*; | [
"javax.ws",
"org.wso2.carbon"
] | javax.ws; org.wso2.carbon; | 2,473,753 |
@Override
protected synchronized void changeIntention(CtrlIntention intention, Object... args)
{
final Object localArg0 = args.length > 0 ? args[0] : null;
final Object localArg1 = args.length > 1 ? args[1] : null;
final Object globalArg0 = (_intentionArgs != null) && (_intentionArgs.length > 0) ? _intent... | synchronized void function(CtrlIntention intention, Object... args) { final Object localArg0 = args.length > 0 ? args[0] : null; final Object localArg1 = args.length > 1 ? args[1] : null; final Object globalArg0 = (_intentionArgs != null) && (_intentionArgs.length > 0) ? _intentionArgs[0] : null; final Object globalArg... | /**
* Saves the current Intention for this L2PlayerAI if necessary and calls changeIntention in AbstractAI.
* @param intention The new Intention to set to the AI
* @param args The first parameter of the Intention
*/ | Saves the current Intention for this L2PlayerAI if necessary and calls changeIntention in AbstractAI | changeIntention | {
"repo_name": "rubenswagner/L2J-Global",
"path": "java/com/l2jglobal/gameserver/ai/L2PlayerAI.java",
"license": "gpl-3.0",
"size": 10336
} | [
"com.l2jglobal.gameserver.model.skills.Skill"
] | import com.l2jglobal.gameserver.model.skills.Skill; | import com.l2jglobal.gameserver.model.skills.*; | [
"com.l2jglobal.gameserver"
] | com.l2jglobal.gameserver; | 1,442,855 |
private void changeSystemListener(int idx, @Nullable GridMessageListener lsnr) {
assert Thread.holdsLock(sysLsnrsMux);
GridMessageListener[] res = new GridMessageListener[sysLsnrs.length];
System.arraycopy(sysLsnrs, 0, res, 0, sysLsnrs.length);
res[idx] = lsnr;
sysLsnrs =... | void function(int idx, @Nullable GridMessageListener lsnr) { assert Thread.holdsLock(sysLsnrsMux); GridMessageListener[] res = new GridMessageListener[sysLsnrs.length]; System.arraycopy(sysLsnrs, 0, res, 0, sysLsnrs.length); res[idx] = lsnr; sysLsnrs = res; } | /**
* Change systme listener at the given index.
*
* @param idx Index.
* @param lsnr Listener.
*/ | Change systme listener at the given index | changeSystemListener | {
"repo_name": "pperalta/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java",
"license": "apache-2.0",
"size": 84542
} | [
"org.jetbrains.annotations.Nullable"
] | import org.jetbrains.annotations.Nullable; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 333,022 |
public static Builder open (File _file) throws FileNotFoundException
{
return new Builder(_file);
}
| static Builder function (File _file) throws FileNotFoundException { return new Builder(_file); } | /**
* Open a {@link File} and create a {@link RecordStream} from it.
* @return a builder object, on which configuration settings can be chained.
*/ | Open a <code>File</code> and create a <code>RecordStream</code> from it | open | {
"repo_name": "christopher-johnson/cyto-rdf",
"path": "helixsoft-commons/nl.helixsoft.util/src/nl/helixsoft/recordstream/TabularIO.java",
"license": "gpl-2.0",
"size": 1894
} | [
"java.io.File",
"java.io.FileNotFoundException",
"nl.helixsoft.recordstream.TsvRecordStream"
] | import java.io.File; import java.io.FileNotFoundException; import nl.helixsoft.recordstream.TsvRecordStream; | import java.io.*; import nl.helixsoft.recordstream.*; | [
"java.io",
"nl.helixsoft.recordstream"
] | java.io; nl.helixsoft.recordstream; | 1,077,018 |
public static void scanSNS(AwsStats stats, AwsAccount account, Regions region) {
LOG.debug("Scan for SNS in region " + region.getName() + " in account " + account.getAccountId());
try {
AmazonSNS sns = new AmazonSNSClient(account.getCredentials());
sns.setRegion(Region.getRegion(region));
int totalApp... | static void function(AwsStats stats, AwsAccount account, Regions region) { LOG.debug(STR + region.getName() + STR + account.getAccountId()); try { AmazonSNS sns = new AmazonSNSClient(account.getCredentials()); sns.setRegion(Region.getRegion(region)); int totalApps = 0; for (PlatformApplication app : sns.listPlatformApp... | /**
* Collect data for SNS.
*
* @param stats
* current statistics object.
* @param account
* currently used credentials object.
* @param region
* currently used aws region.
*/ | Collect data for SNS | scanSNS | {
"repo_name": "zalando/aws-utilization-monitor",
"path": "src/main/java/de/zalando/platform/awsutilizationmonitor/collector/AwsScan.java",
"license": "apache-2.0",
"size": 31719
} | [
"com.amazonaws.AmazonServiceException",
"com.amazonaws.regions.Region",
"com.amazonaws.regions.Regions",
"com.amazonaws.services.sns.AmazonSNS",
"com.amazonaws.services.sns.AmazonSNSClient",
"com.amazonaws.services.sns.model.PlatformApplication",
"com.amazonaws.services.sns.model.Subscription",
"de.za... | import com.amazonaws.AmazonServiceException; import com.amazonaws.regions.Region; import com.amazonaws.regions.Regions; import com.amazonaws.services.sns.AmazonSNS; import com.amazonaws.services.sns.AmazonSNSClient; import com.amazonaws.services.sns.model.PlatformApplication; import com.amazonaws.services.sns.model.Sub... | import com.amazonaws.*; import com.amazonaws.regions.*; import com.amazonaws.services.sns.*; import com.amazonaws.services.sns.model.*; import de.zalando.platform.awsutilizationmonitor.api.*; import de.zalando.platform.awsutilizationmonitor.stats.*; | [
"com.amazonaws",
"com.amazonaws.regions",
"com.amazonaws.services",
"de.zalando.platform"
] | com.amazonaws; com.amazonaws.regions; com.amazonaws.services; de.zalando.platform; | 2,157,493 |
private void writeComponents(Response response, String encoding)
{
componentsFrozen = true;
// process component markup
for (Map.Entry<String, Component> stringComponentEntry : markupIdToComponent.entrySet())
{
final Component component = stringComponentEntry.getValue();
if (!containsAncestorFor(com... | void function(Response response, String encoding) { componentsFrozen = true; for (Map.Entry<String, Component> stringComponentEntry : markupIdToComponent.entrySet()) { final Component component = stringComponentEntry.getValue(); if (!containsAncestorFor(component)) { writeComponent(response, component.getAjaxRegionMark... | /**
* Processes components added to the target. This involves attaching components, rendering
* markup into a client side xml envelope, and detaching them
*
* @param response
* the response to write to
* @param encoding
* the encoding for the response
*/ | Processes components added to the target. This involves attaching components, rendering markup into a client side xml envelope, and detaching them | writeComponents | {
"repo_name": "astrapi69/wicket",
"path": "wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxResponse.java",
"license": "apache-2.0",
"size": 22124
} | [
"java.util.Map",
"org.apache.wicket.Component",
"org.apache.wicket.request.Response",
"org.apache.wicket.request.cycle.RequestCycle"
] | import java.util.Map; import org.apache.wicket.Component; import org.apache.wicket.request.Response; import org.apache.wicket.request.cycle.RequestCycle; | import java.util.*; import org.apache.wicket.*; import org.apache.wicket.request.*; import org.apache.wicket.request.cycle.*; | [
"java.util",
"org.apache.wicket"
] | java.util; org.apache.wicket; | 461,788 |
public List<AclChangeSet> getAclChangeSets(Long minAclChangeSetId, Long fromCommitTime, Long maxAclChangeSetId, Long toCommitTime, int maxResults);
| List<AclChangeSet> function(Long minAclChangeSetId, Long fromCommitTime, Long maxAclChangeSetId, Long toCommitTime, int maxResults); | /**
* Get the ACL changesets for given range parameters
*
* @param minAclChangeSetId minimum ACL changeset ID - (inclusive and optional)
* @param fromCommitTime minimum ACL commit time - (inclusive and optional)
* @param maxAclChangeSetId max ACL changeset ID - ... | Get the ACL changesets for given range parameters | getAclChangeSets | {
"repo_name": "nguyentienlong/community-edition",
"path": "projects/repository/source/java/org/alfresco/repo/solr/SOLRTrackingComponent.java",
"license": "lgpl-3.0",
"size": 6199
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,589,150 |
public LifecycleListener[] findLifecycleListeners() {
return new LifecycleListener[0];
}
| LifecycleListener[] function() { return new LifecycleListener[0]; } | /**
* Get the lifecycle listeners associated with this lifecycle. If this
* Lifecycle has no listeners registered, a zero-length array is returned.
*/ | Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners registered, a zero-length array is returned | findLifecycleListeners | {
"repo_name": "yuyupapa/OpenSource",
"path": "apache-tomcat-6.0.48/java/org/apache/catalina/loader/WebappClassLoader.java",
"license": "apache-2.0",
"size": 126194
} | [
"org.apache.catalina.LifecycleListener"
] | import org.apache.catalina.LifecycleListener; | import org.apache.catalina.*; | [
"org.apache.catalina"
] | org.apache.catalina; | 2,523,726 |
@Test
public void testRequestCache3() {
TestCircuitBreaker circuitBreaker = new TestCircuitBreaker();
SuccessfulCacheableCommand<String> command1 = new SuccessfulCacheableCommand<String>(circuitBreaker, true, "A");
SuccessfulCacheableCommand<String> command2 = new SuccessfulCacheableComm... | void function() { TestCircuitBreaker circuitBreaker = new TestCircuitBreaker(); SuccessfulCacheableCommand<String> command1 = new SuccessfulCacheableCommand<String>(circuitBreaker, true, "A"); SuccessfulCacheableCommand<String> command2 = new SuccessfulCacheableCommand<String>(circuitBreaker, true, "B"); SuccessfulCach... | /**
* Test Request scoped caching with a mixture of commands
*/ | Test Request scoped caching with a mixture of commands | testRequestCache3 | {
"repo_name": "davidkarlsen/Hystrix",
"path": "hystrix-core/src/test/java/com/netflix/hystrix/HystrixCommandTest.java",
"license": "apache-2.0",
"size": 282697
} | [
"com.netflix.hystrix.HystrixCircuitBreakerTest",
"com.netflix.hystrix.util.HystrixRollingNumberEvent",
"java.util.concurrent.Future",
"org.junit.Assert"
] | import com.netflix.hystrix.HystrixCircuitBreakerTest; import com.netflix.hystrix.util.HystrixRollingNumberEvent; import java.util.concurrent.Future; import org.junit.Assert; | import com.netflix.hystrix.*; import com.netflix.hystrix.util.*; import java.util.concurrent.*; import org.junit.*; | [
"com.netflix.hystrix",
"java.util",
"org.junit"
] | com.netflix.hystrix; java.util; org.junit; | 2,046,056 |
public static String decodeString(String source) throws URISyntaxException {
if (source == null) {
return source;
}
int i;
// most strings not encoded, so prevent extra objects and work.
if ((i = source.indexOf(QUOTE_MARKER)) == -1) {
return source;
}
ByteArrayOutputStream decoded = new ByteArray... | static String function(String source) throws URISyntaxException { if (source == null) { return source; } int i; if ((i = source.indexOf(QUOTE_MARKER)) == -1) { return source; } ByteArrayOutputStream decoded = new ByteArrayOutputStream(); try { decoded.write(toBytes(source.substring(0, i))); int len = source.length(); f... | /**
* A utility method to decode a string.
*
* @param source an encoded string
* @return a decoded string.
* @throws URISyntaxException
*/ | A utility method to decode a string | decodeString | {
"repo_name": "JrmyDev/CodenameOne",
"path": "Ports/retro/JavaCompatibility/src/net/sourceforge/retroweaver/harmony/runtime/java/net/URIHelper.java",
"license": "gpl-2.0",
"size": 20695
} | [
"java.io.ByteArrayOutputStream",
"java.io.IOException"
] | import java.io.ByteArrayOutputStream; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 964,122 |
public void dismissLoadingDialog(){
Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG);
if (frag != null) {
LoadingDialog loading = (LoadingDialog) frag;
loading.dismiss();
}
} | void function(){ Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG); if (frag != null) { LoadingDialog loading = (LoadingDialog) frag; loading.dismiss(); } } | /**
* Dismiss loading dialog
*/ | Dismiss loading dialog | dismissLoadingDialog | {
"repo_name": "saoussenBA/android",
"path": "src/com/owncloud/android/ui/activity/FileActivity.java",
"license": "gpl-2.0",
"size": 35032
} | [
"android.support.v4.app.Fragment",
"com.owncloud.android.ui.dialog.LoadingDialog"
] | import android.support.v4.app.Fragment; import com.owncloud.android.ui.dialog.LoadingDialog; | import android.support.v4.app.*; import com.owncloud.android.ui.dialog.*; | [
"android.support",
"com.owncloud.android"
] | android.support; com.owncloud.android; | 546,238 |
public void syncStart(int id)
throws CameraInUseException,
StorageUnavailableException,
ConfNotSupportedException,
InvalidSurfaceException,
UnknownHostException,
IOException {
Stream stream = id==0 ? mAudioStream : mVideoStream;
if (stream!=null && !stream.isStreaming()) {
try {
... | void function(int id) throws CameraInUseException, StorageUnavailableException, ConfNotSupportedException, InvalidSurfaceException, UnknownHostException, IOException { Stream stream = id==0 ? mAudioStream : mVideoStream; if (stream!=null && !stream.isStreaming()) { try { InetAddress destination = InetAddress.getByName(... | /**
* Starts a stream in a syncronous manner.
* Throws exceptions in addition to calling a callback.
* @param id The id of the stream to start
**/ | Starts a stream in a syncronous manner. Throws exceptions in addition to calling a callback | syncStart | {
"repo_name": "HiRaygo/spydroid",
"path": "src/com/raygo/streaming/Session.java",
"license": "gpl-3.0",
"size": 20984
} | [
"com.raygo.streaming.exceptions.CameraInUseException",
"com.raygo.streaming.exceptions.ConfNotSupportedException",
"com.raygo.streaming.exceptions.InvalidSurfaceException",
"com.raygo.streaming.exceptions.StorageUnavailableException",
"java.io.IOException",
"java.net.InetAddress",
"java.net.UnknownHostE... | import com.raygo.streaming.exceptions.CameraInUseException; import com.raygo.streaming.exceptions.ConfNotSupportedException; import com.raygo.streaming.exceptions.InvalidSurfaceException; import com.raygo.streaming.exceptions.StorageUnavailableException; import java.io.IOException; import java.net.InetAddress; import j... | import com.raygo.streaming.exceptions.*; import java.io.*; import java.net.*; | [
"com.raygo.streaming",
"java.io",
"java.net"
] | com.raygo.streaming; java.io; java.net; | 2,604,710 |
public void commitUTStab(final String type, final WXErrorCode errorCode) {
if (errorCode == WXErrorCode.WX_SUCCESS) {
return;
}
runOnUiThread(new Runnable() { | void function(final String type, final WXErrorCode errorCode) { if (errorCode == WXErrorCode.WX_SUCCESS) { return; } runOnUiThread(new Runnable() { | /**
* UserTrack Log
*/ | UserTrack Log | commitUTStab | {
"repo_name": "sospartan/weex",
"path": "android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java",
"license": "apache-2.0",
"size": 32809
} | [
"com.taobao.weex.common.WXErrorCode"
] | import com.taobao.weex.common.WXErrorCode; | import com.taobao.weex.common.*; | [
"com.taobao.weex"
] | com.taobao.weex; | 98,392 |
public MorphoFeatureSpecification morphFeatureSpec() {
return null;
}
| MorphoFeatureSpecification function() { return null; } | /**
* Returns a morphological feature specification for words in this language.
*/ | Returns a morphological feature specification for words in this language | morphFeatureSpec | {
"repo_name": "PeterisP/LVTagger",
"path": "src/main/java/edu/stanford/nlp/trees/AbstractTreebankLanguagePack.java",
"license": "gpl-2.0",
"size": 18437
} | [
"edu.stanford.nlp.international.morph.MorphoFeatureSpecification"
] | import edu.stanford.nlp.international.morph.MorphoFeatureSpecification; | import edu.stanford.nlp.international.morph.*; | [
"edu.stanford.nlp"
] | edu.stanford.nlp; | 1,575,646 |
public static FederationPolicyManager instantiatePolicyManager(String newType)
throws FederationPolicyInitializationException {
FederationPolicyManager federationPolicyManager = null;
try {
// create policy instance and set queue
Class<?> c = Class.forName(newType);
federationPolicyMan... | static FederationPolicyManager function(String newType) throws FederationPolicyInitializationException { FederationPolicyManager federationPolicyManager = null; try { Class<?> c = Class.forName(newType); federationPolicyManager = (FederationPolicyManager) c.newInstance(); } catch (ClassNotFoundException e) { throw new ... | /**
* A utilize method to instantiate a policy manager class given the type
* (class name) from {@link SubClusterPolicyConfiguration}.
*
* @param newType class name of the policy manager to create
* @return Policy manager
* @throws FederationPolicyInitializationException if fails
*/ | A utilize method to instantiate a policy manager class given the type (class name) from <code>SubClusterPolicyConfiguration</code> | instantiatePolicyManager | {
"repo_name": "JingchengDu/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/policies/FederationPolicyUtils.java",
"license": "apache-2.0",
"size": 9770
} | [
"org.apache.hadoop.yarn.server.federation.policies.exceptions.FederationPolicyInitializationException",
"org.apache.hadoop.yarn.server.federation.policies.manager.FederationPolicyManager"
] | import org.apache.hadoop.yarn.server.federation.policies.exceptions.FederationPolicyInitializationException; import org.apache.hadoop.yarn.server.federation.policies.manager.FederationPolicyManager; | import org.apache.hadoop.yarn.server.federation.policies.exceptions.*; import org.apache.hadoop.yarn.server.federation.policies.manager.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 269,789 |
DatasetDescriptor getDescriptor();
/**
* Get a partition for a {@link PartitionKey}, optionally creating the
* partition if it doesn't already exist. You can obtain the
* {@link PartitionKey} using
* {@link PartitionStrategy#partitionKey(Object...)} or
* {@link PartitionStrategy#partitionKeyForEntit... | DatasetDescriptor getDescriptor(); /** * Get a partition for a {@link PartitionKey}, optionally creating the * partition if it doesn't already exist. You can obtain the * {@link PartitionKey} using * {@link PartitionStrategy#partitionKey(Object...)} or * {@link PartitionStrategy#partitionKeyForEntity(Object)}. * * @par... | /**
* Get the {@link DatasetDescriptor} associated with this dataset.
*/ | Get the <code>DatasetDescriptor</code> associated with this dataset | getDescriptor | {
"repo_name": "whoschek/kite",
"path": "kite-data/kite-data-core/src/main/java/org/kitesdk/data/Dataset.java",
"license": "apache-2.0",
"size": 3767
} | [
"org.kitesdk.data.spi.PartitionKey"
] | import org.kitesdk.data.spi.PartitionKey; | import org.kitesdk.data.spi.*; | [
"org.kitesdk.data"
] | org.kitesdk.data; | 248,589 |
public EvaluationContext getEvaluationContext() {
if (this.evaluationContext == null) {
this.evaluationContext = new StandardEvaluationContext();
}
return this.evaluationContext;
}
// implementing Expression | EvaluationContext function() { if (this.evaluationContext == null) { this.evaluationContext = new StandardEvaluationContext(); } return this.evaluationContext; } | /**
* Return the default evaluation context that will be used if none is supplied on an evaluation call.
* @return the default evaluation context
*/ | Return the default evaluation context that will be used if none is supplied on an evaluation call | getEvaluationContext | {
"repo_name": "qobel/esoguproject",
"path": "spring-framework/spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelExpression.java",
"license": "apache-2.0",
"size": 19279
} | [
"org.springframework.expression.EvaluationContext",
"org.springframework.expression.spel.support.StandardEvaluationContext"
] | import org.springframework.expression.EvaluationContext; import org.springframework.expression.spel.support.StandardEvaluationContext; | import org.springframework.expression.*; import org.springframework.expression.spel.support.*; | [
"org.springframework.expression"
] | org.springframework.expression; | 1,054,937 |
public Intent[] getIntents() {
Intent[] intents = new Intent[mIntents.size()];
if (intents.length == 0) return intents;
intents[0] = new Intent(mIntents.get(0)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
IntentCompat.FLAG_ACTIVITY_CLEAR_TASK |
IntentCompat.FLAG... | Intent[] function() { Intent[] intents = new Intent[mIntents.size()]; if (intents.length == 0) return intents; intents[0] = new Intent(mIntents.get(0)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK IntentCompat.FLAG_ACTIVITY_CLEAR_TASK IntentCompat.FLAG_ACTIVITY_TASK_ON_HOME); for (int i = 1; i < intents.length; i++) { intent... | /**
* Return an array containing the intents added to this builder. The intent at the
* root of the task stack will appear as the first item in the array and the
* intent at the top of the stack will appear as the last item.
*
* @return An array containing the intents added to this builder.
... | Return an array containing the intents added to this builder. The intent at the root of the task stack will appear as the first item in the array and the intent at the top of the stack will appear as the last item | getIntents | {
"repo_name": "masconsult/android-recipes-app",
"path": "vendors/android-support-v7-appcompat/libs-src/android-support-v4/android/support/v4/app/TaskStackBuilder.java",
"license": "apache-2.0",
"size": 16623
} | [
"android.content.Intent",
"android.support.v4.content.IntentCompat"
] | import android.content.Intent; import android.support.v4.content.IntentCompat; | import android.content.*; import android.support.v4.content.*; | [
"android.content",
"android.support"
] | android.content; android.support; | 2,855,989 |
public EventSubscriptionEntity createSubscriptionForExecution(ExecutionEntity execution) {
EventSubscriptionEntity eventSubscriptionEntity = new EventSubscriptionEntity(execution, eventType);
String eventName = resolveExpressionOfEventName(execution);
eventSubscriptionEntity.setEventName(eventName);
... | EventSubscriptionEntity function(ExecutionEntity execution) { EventSubscriptionEntity eventSubscriptionEntity = new EventSubscriptionEntity(execution, eventType); String eventName = resolveExpressionOfEventName(execution); eventSubscriptionEntity.setEventName(eventName); if (activityId != null) { ActivityImpl activity ... | /**
* Creates and inserts a subscription entity depending on the message type of this declaration.
*/ | Creates and inserts a subscription entity depending on the message type of this declaration | createSubscriptionForExecution | {
"repo_name": "xasx/camunda-bpm-platform",
"path": "engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/EventSubscriptionDeclaration.java",
"license": "apache-2.0",
"size": 6220
} | [
"org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity",
"org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity",
"org.camunda.bpm.engine.impl.pvm.process.ActivityImpl",
"org.camunda.bpm.engine.impl.pvm.runtime.LegacyBehavior"
] | import org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity; import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; import org.camunda.bpm.engine.impl.pvm.process.ActivityImpl; import org.camunda.bpm.engine.impl.pvm.runtime.LegacyBehavior; | import org.camunda.bpm.engine.impl.persistence.entity.*; import org.camunda.bpm.engine.impl.pvm.process.*; import org.camunda.bpm.engine.impl.pvm.runtime.*; | [
"org.camunda.bpm"
] | org.camunda.bpm; | 97,231 |
public SearchRequestBuilder setScroll(TimeValue keepAlive) {
request.scroll(keepAlive);
return this;
} | SearchRequestBuilder function(TimeValue keepAlive) { request.scroll(keepAlive); return this; } | /**
* If set, will enable scrolling of the search request for the specified timeout.
*/ | If set, will enable scrolling of the search request for the specified timeout | setScroll | {
"repo_name": "18098924759/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/action/search/SearchRequestBuilder.java",
"license": "apache-2.0",
"size": 30936
} | [
"org.elasticsearch.common.unit.TimeValue"
] | import org.elasticsearch.common.unit.TimeValue; | import org.elasticsearch.common.unit.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 894,847 |
TaskDefinitionResource create(String name, String definition, String description); | TaskDefinitionResource create(String name, String definition, String description); | /**
* Create a new task definition
*
* @param name the name of the task
* @param definition the task definition DSL
* @param description the description of the task definition
* @return the task definition
*/ | Create a new task definition | create | {
"repo_name": "spring-cloud/spring-cloud-dataflow",
"path": "spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/TaskOperations.java",
"license": "apache-2.0",
"size": 6272
} | [
"org.springframework.cloud.dataflow.rest.resource.TaskDefinitionResource"
] | import org.springframework.cloud.dataflow.rest.resource.TaskDefinitionResource; | import org.springframework.cloud.dataflow.rest.resource.*; | [
"org.springframework.cloud"
] | org.springframework.cloud; | 1,120,640 |
void variableUse() throws CompilerException;
| void variableUse() throws CompilerException; | /**
* This method implements the BNF grammar rule for the variable-use annotation.
* @throws CompilerException
*/ | This method implements the BNF grammar rule for the variable-use annotation | variableUse | {
"repo_name": "cosc455fall2015/mycompiler",
"path": "src/edu/towson/cis/cosc455/jdehlinger/project1/interfaces/SyntaxAnalyzer.java",
"license": "apache-2.0",
"size": 3144
} | [
"edu.towson.cis.cosc455.jdehlinger.project1.implementation.CompilerException"
] | import edu.towson.cis.cosc455.jdehlinger.project1.implementation.CompilerException; | import edu.towson.cis.cosc455.jdehlinger.project1.implementation.*; | [
"edu.towson.cis"
] | edu.towson.cis; | 1,689,723 |
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
PollerFlux<PollResult<DeploymentValidateResultInner>, DeploymentValidateResultInner> beginValidateAtScopeAsync(
String scope, String deploymentName, DeploymentInner parameters); | @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux<PollResult<DeploymentValidateResultInner>, DeploymentValidateResultInner> beginValidateAtScopeAsync( String scope, String deploymentName, DeploymentInner parameters); | /**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @throws IllegalArgumentExce... | Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager. | beginValidateAtScopeAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentsClient.java",
"license": "mit",
"size": 218889
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.polling.PollerFlux",
"com.azure.resourcemanager.resources.fluent.models.DeploymentInner",
"com.azure.resourcemanager.resources.fluent.models.DeploymentVal... | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.PollerFlux; import com.azure.resourcemanager.resources.fluent.models.DeploymentInner; import com.azure.resourcemanager.resources.fluent.mod... | import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.resources.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 217,419 |
public void setOwner(Path p, String username, String groupname
) throws IOException {
} | void function(Path p, String username, String groupname ) throws IOException { } | /**
* Set owner of a path (i.e. a file or a directory).
* The parameters username and groupname cannot both be null.
* @param p The path
* @param username If it is null, the original username remains unchanged.
* @param groupname If it is null, the original groupname remains unchanged.
*/ | Set owner of a path (i.e. a file or a directory). The parameters username and groupname cannot both be null | setOwner | {
"repo_name": "joyghosh/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java",
"license": "gpl-3.0",
"size": 116427
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,307,810 |
public void addDhtVersion(IgniteTxKey key, @Nullable GridCacheVersion dhtVer) {
if (dhtVers == null)
dhtVers = new HashMap<>();
dhtVers.put(key, dhtVer);
} | void function(IgniteTxKey key, @Nullable GridCacheVersion dhtVer) { if (dhtVers == null) dhtVers = new HashMap<>(); dhtVers.put(key, dhtVer); } | /**
* Adds version to be verified on remote node.
*
* @param key Key for which version is verified.
* @param dhtVer DHT version to check.
*/ | Adds version to be verified on remote node | addDhtVersion | {
"repo_name": "amirakhmedov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java",
"license": "apache-2.0",
"size": 21180
} | [
"java.util.HashMap",
"org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey",
"org.apache.ignite.internal.processors.cache.version.GridCacheVersion",
"org.jetbrains.annotations.Nullable"
] | import java.util.HashMap; import org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey; import org.apache.ignite.internal.processors.cache.version.GridCacheVersion; import org.jetbrains.annotations.Nullable; | import java.util.*; import org.apache.ignite.internal.processors.cache.transactions.*; import org.apache.ignite.internal.processors.cache.version.*; import org.jetbrains.annotations.*; | [
"java.util",
"org.apache.ignite",
"org.jetbrains.annotations"
] | java.util; org.apache.ignite; org.jetbrains.annotations; | 435,439 |
public Observable<ServiceResponse<Page<NetworkSecurityGroupInner>>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
} | Observable<ServiceResponse<Page<NetworkSecurityGroupInner>>> function(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException(STR); } | /**
* Gets all network security groups in a resource group.
*
ServiceResponse<PageImpl<NetworkSecurityGroupInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the Pag... | Gets all network security groups in a resource group | listByResourceGroupNextSinglePageAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/NetworkSecurityGroupsInner.java",
"license": "mit",
"size": 81333
} | [
"com.microsoft.azure.Page",
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse; | import com.microsoft.azure.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 399,717 |
List<PrivateEndpointConnection> value(); | List<PrivateEndpointConnection> value(); | /**
* Gets the value property: Array of private endpoint connections.
*
* @return the value value.
*/ | Gets the value property: Array of private endpoint connections | value | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/videoanalyzer/azure-resourcemanager-videoanalyzer/src/main/java/com/azure/resourcemanager/videoanalyzer/models/PrivateEndpointConnectionListResult.java",
"license": "mit",
"size": 904
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 691,081 |
@Override
public TestEnvironment createTestEnvironment(TestParameters Param,
PrintWriter log)
throws Exception {
XInterface oObj = null;
XWindowPeer the_win = null;
XWindow win = null;
//I... | TestEnvironment function(TestParameters Param, PrintWriter log) throws Exception { XInterface oObj = null; XWindowPeer the_win = null; XWindow win = null; XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000, 10000, STR); WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model ... | /**
* Creating a TestEnvironment for the interfaces to be tested.
* Creates <code>com.sun.star.awt.Toolkit</code> service.
*/ | Creating a TestEnvironment for the interfaces to be tested. Creates <code>com.sun.star.awt.Toolkit</code> service | createTestEnvironment | {
"repo_name": "sbbic/core",
"path": "qadevOOo/tests/java/mod/_toolkit/Toolkit.java",
"license": "gpl-3.0",
"size": 4214
} | [
"com.sun.star.awt.XControlModel",
"com.sun.star.awt.XWindow",
"com.sun.star.awt.XWindowPeer",
"com.sun.star.drawing.XControlShape",
"com.sun.star.frame.XController",
"com.sun.star.frame.XModel",
"com.sun.star.uno.UnoRuntime",
"com.sun.star.uno.XInterface",
"com.sun.star.view.XControlAccess",
"java... | import com.sun.star.awt.XControlModel; import com.sun.star.awt.XWindow; import com.sun.star.awt.XWindowPeer; import com.sun.star.drawing.XControlShape; import com.sun.star.frame.XController; import com.sun.star.frame.XModel; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; import com.sun.star.vie... | import com.sun.star.awt.*; import com.sun.star.drawing.*; import com.sun.star.frame.*; import com.sun.star.uno.*; import com.sun.star.view.*; import java.io.*; | [
"com.sun.star",
"java.io"
] | com.sun.star; java.io; | 472,941 |
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
CharSequence item = ((TextView) view).getText();
String name = item.toString();
Cave3DSurvey survey = mParser.getSurvey( name );
if ( survey != null ) {
( new DialogSurvey( mApp, survey ) ).show();
... | void function(AdapterView<?> parent, View view, int position, long id) { CharSequence item = ((TextView) view).getText(); String name = item.toString(); Cave3DSurvey survey = mParser.getSurvey( name ); if ( survey != null ) { ( new DialogSurvey( mApp, survey ) ).show(); } else { } } | /** respond to taps on item views
* @param parent view parent container
* @param view clicked item view
* @param position position of the item in the container
* @param id item id (?)
*/ | respond to taps on item views | onItemClick | {
"repo_name": "marcocorvi/topodroid",
"path": "src/com/topodroid/DistoX/DialogInfo.java",
"license": "gpl-3.0",
"size": 4993
} | [
"android.view.View",
"android.widget.AdapterView",
"android.widget.TextView"
] | import android.view.View; import android.widget.AdapterView; import android.widget.TextView; | import android.view.*; import android.widget.*; | [
"android.view",
"android.widget"
] | android.view; android.widget; | 740,453 |
private void validateUpdateAllowed(Attribute attr) {
String attrIdentifier = attr.getIdentifier();
Attribute systemAttr = systemEntityTypeRegistry.getSystemAttribute(attrIdentifier);
if (systemAttr != null && !EntityUtils.equals(attr, systemAttr)) {
throw new SystemMetadataModificationException();
... | void function(Attribute attr) { String attrIdentifier = attr.getIdentifier(); Attribute systemAttr = systemEntityTypeRegistry.getSystemAttribute(attrIdentifier); if (systemAttr != null && !EntityUtils.equals(attr, systemAttr)) { throw new SystemMetadataModificationException(); } } | /**
* Updating attribute meta data is allowed for non-system attributes. For system attributes
* updating attribute meta data is only allowed if the meta data defined in Java differs from the
* meta data stored in the database (in other words the Java code was updated).
*
* @param attr attribute
*/ | Updating attribute meta data is allowed for non-system attributes. For system attributes updating attribute meta data is only allowed if the meta data defined in Java differs from the meta data stored in the database (in other words the Java code was updated) | validateUpdateAllowed | {
"repo_name": "dennishendriksen/molgenis",
"path": "molgenis-data-security/src/main/java/org/molgenis/data/security/meta/AttributeRepositorySecurityDecorator.java",
"license": "lgpl-3.0",
"size": 8978
} | [
"org.molgenis.data.meta.model.Attribute",
"org.molgenis.data.security.exception.SystemMetadataModificationException",
"org.molgenis.data.util.EntityUtils"
] | import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.security.exception.SystemMetadataModificationException; import org.molgenis.data.util.EntityUtils; | import org.molgenis.data.meta.model.*; import org.molgenis.data.security.exception.*; import org.molgenis.data.util.*; | [
"org.molgenis.data"
] | org.molgenis.data; | 2,068,150 |
public static boolean getWaitForDependencies(Dictionary headers) {
String value = getDirectiveValue(headers, DIRECTIVE_WAIT_FOR_DEPS);
return (value != null ? Boolean.valueOf(value) : DIRECTIVE_WAIT_FOR_DEPS_DEFAULT);
}
| static boolean function(Dictionary headers) { String value = getDirectiveValue(headers, DIRECTIVE_WAIT_FOR_DEPS); return (value != null ? Boolean.valueOf(value) : DIRECTIVE_WAIT_FOR_DEPS_DEFAULT); } | /**
* Shortcut for finding the boolean value for
* {@link #DIRECTIVE_WAIT_FOR_DEPS} directive using the given headers.
* Assumes the headers belong to a Spring powered bundle.
*
* @param headers
* @return
*/ | Shortcut for finding the boolean value for <code>#DIRECTIVE_WAIT_FOR_DEPS</code> directive using the given headers. Assumes the headers belong to a Spring powered bundle | getWaitForDependencies | {
"repo_name": "rritoch/gemini.blueprint",
"path": "extender/src/main/java/org/eclipse/gemini/blueprint/extender/support/internal/ConfigUtils.java",
"license": "apache-2.0",
"size": 11428
} | [
"java.util.Dictionary"
] | import java.util.Dictionary; | import java.util.*; | [
"java.util"
] | java.util; | 2,449,710 |
double yaw = entity.rotationYaw;
while (yaw < 0)
yaw += 360;
yaw = yaw % 360;
if (includeUpAndDown) {
if (entity.rotationPitch > 45)
return ForgeDirection.DOWN;
else if (entity.rotationPitch < -45)
return ForgeDirection.... | double yaw = entity.rotationYaw; while (yaw < 0) yaw += 360; yaw = yaw % 360; if (includeUpAndDown) { if (entity.rotationPitch > 45) return ForgeDirection.DOWN; else if (entity.rotationPitch < -45) return ForgeDirection.UP; } if (yaw < 45) return ForgeDirection.SOUTH; else if (yaw < 135) return ForgeDirection.WEST; els... | /**
* Returns the ForgeDirection of the facing of the entity given.
*
* @param entity
* @param includeUpAndDown
* false when UP/DOWN should not be included.
* @return
*/ | Returns the ForgeDirection of the facing of the entity given | getDirectionFacing | {
"repo_name": "Qmunity/QmunityLib",
"path": "src/main/java/uk/co/qmunity/lib/misc/ForgeDirectionUtils.java",
"license": "mit",
"size": 3648
} | [
"net.minecraftforge.common.util.ForgeDirection"
] | import net.minecraftforge.common.util.ForgeDirection; | import net.minecraftforge.common.util.*; | [
"net.minecraftforge.common"
] | net.minecraftforge.common; | 2,747,657 |
public void evalUnset(Env env)
{
env.error(L.l("{0}::${1}: Cannot unset static variables.",
env.getCallingClass().getName(), _varName), getLocation());
} | void function(Env env) { env.error(L.l(STR, env.getCallingClass().getName(), _varName), getLocation()); } | /**
* Evaluates the expression.
*
* @param env the calling environment.
*
* @return the expression value.
*/ | Evaluates the expression | evalUnset | {
"repo_name": "smba/oak",
"path": "quercus/src/main/java/com/caucho/quercus/expr/ClassVirtualFieldExpr.java",
"license": "lgpl-3.0",
"size": 3352
} | [
"com.caucho.quercus.env.Env"
] | import com.caucho.quercus.env.Env; | import com.caucho.quercus.env.*; | [
"com.caucho.quercus"
] | com.caucho.quercus; | 2,581,724 |
@Test
public void whenTryToGetBeanFromAnnotationsThenNotNull() {
Model model = this.context.getBean(Model.class);
assertNotNull(model);
} | void function() { Model model = this.context.getBean(Model.class); assertNotNull(model); } | /**
* Trying to define variable via annotations.
* Expecting: not null.
*/ | Trying to define variable via annotations. Expecting: not null | whenTryToGetBeanFromAnnotationsThenNotNull | {
"repo_name": "wamdue/agorbunov",
"path": "chapter_011/src/test/java/ru/job4j/ioc/UserTest.java",
"license": "apache-2.0",
"size": 1230
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,801,528 |
@SuppressWarnings("unchecked")
public List getResult() {
List result = null;
if (this.saxHandler != null) {
// Retrieve result from SAX content handler.
result = this.saxHandler.getResult();
// Detach the (non-reusable) SAXHandler instance.
this.saxHandler = null;
... | @SuppressWarnings(STR) List function() { List result = null; if (this.saxHandler != null) { result = this.saxHandler.getResult(); this.saxHandler = null; this.startDocumentReceived = false; } return result; } | /**
* Returns the result of an XSL Transformation.
*
* @return the transformation result as a (possibly empty) list of
* JDOM nodes (Elements, Texts, Comments, PIs...) or
* <code>null</code> if no new transformation occurred
* since the result of the previous one wa... | Returns the result of an XSL Transformation | getResult | {
"repo_name": "roboidstudio/embedded",
"path": "org.jdom/src/org/jdom/transform/JDOMResult.java",
"license": "lgpl-2.1",
"size": 23398
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,354,244 |
public static ServiceDispatcher getInstance(Delegator delegator) {
ServiceDispatcher sd;
String dispatcherKey = delegator != null ? delegator.getDelegatorName() : "null";
sd = dispatchers.get(dispatcherKey);
if (sd == null) {
if (Debug.verboseOn()) Debug.logVerbose("[Serv... | static ServiceDispatcher function(Delegator delegator) { ServiceDispatcher sd; String dispatcherKey = delegator != null ? delegator.getDelegatorName() : "null"; sd = dispatchers.get(dispatcherKey); if (sd == null) { if (Debug.verboseOn()) Debug.logVerbose(STR + dispatcherKey + ").", module); sd = new ServiceDispatcher(... | /**
* Returns an instance of the ServiceDispatcher associated with this delegator.
* @param delegator the local delegator
* @return A reference to this global ServiceDispatcher
*/ | Returns an instance of the ServiceDispatcher associated with this delegator | getInstance | {
"repo_name": "yuri0x7c1/ofbiz-explorer",
"path": "src/test/resources/apache-ofbiz-17.12.04/framework/service/src/main/java/org/apache/ofbiz/service/ServiceDispatcher.java",
"license": "apache-2.0",
"size": 52685
} | [
"org.apache.ofbiz.base.util.Debug",
"org.apache.ofbiz.entity.Delegator"
] | import org.apache.ofbiz.base.util.Debug; import org.apache.ofbiz.entity.Delegator; | import org.apache.ofbiz.base.util.*; import org.apache.ofbiz.entity.*; | [
"org.apache.ofbiz"
] | org.apache.ofbiz; | 1,961,045 |
public void observeDrop(SimulatorDrop pDrop) {
// Determine what to do with the drop based on the drop type
if (pDrop instanceof CritterStateDrop) {
parseStateDrop((CritterStateDrop)pDrop);
}
else if (pDrop instanceof CritterRewardDrop) {
// @todo Most likely ... | void function(SimulatorDrop pDrop) { if (pDrop instanceof CritterStateDrop) { parseStateDrop((CritterStateDrop)pDrop); } else if (pDrop instanceof CritterRewardDrop) { } else if (pDrop instanceof CritterControlDrop) { } } | /** Receive a drop from the server.
*
* @param pDrop The received drop.
*/ | Receive a drop from the server | observeDrop | {
"repo_name": "jmodayil/rlai-critterbot",
"path": "javadrops/src/org/rlcommunity/critterbot/javadrops/clients/DiscoRewardGenerator.java",
"license": "apache-2.0",
"size": 5011
} | [
"org.rlcommunity.critterbot.javadrops.drops.CritterControlDrop",
"org.rlcommunity.critterbot.javadrops.drops.CritterRewardDrop",
"org.rlcommunity.critterbot.javadrops.drops.CritterStateDrop",
"org.rlcommunity.critterbot.javadrops.drops.SimulatorDrop"
] | import org.rlcommunity.critterbot.javadrops.drops.CritterControlDrop; import org.rlcommunity.critterbot.javadrops.drops.CritterRewardDrop; import org.rlcommunity.critterbot.javadrops.drops.CritterStateDrop; import org.rlcommunity.critterbot.javadrops.drops.SimulatorDrop; | import org.rlcommunity.critterbot.javadrops.drops.*; | [
"org.rlcommunity.critterbot"
] | org.rlcommunity.critterbot; | 483,158 |
public CmsLink getLink(CmsObject cms) {
Element linkElement = m_element.element(CmsXmlPage.NODE_LINK);
if (linkElement == null) {
String uri = m_element.getText();
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(uri)) {
setStringValue(cms, uri);
}
... | CmsLink function(CmsObject cms) { Element linkElement = m_element.element(CmsXmlPage.NODE_LINK); if (linkElement == null) { String uri = m_element.getText(); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(uri)) { setStringValue(cms, uri); } linkElement = m_element.element(CmsXmlPage.NODE_LINK); if (linkElement == null) {... | /**
* Returns the link object represented by this XML content value.<p>
*
* @param cms the cms context, can be <code>null</code> but in this case no link check is performed
*
* @return the link object represented by this XML content value
*/ | Returns the link object represented by this XML content value | getLink | {
"repo_name": "serrapos/opencms-core",
"path": "src/org/opencms/xml/types/CmsXmlVfsFileValue.java",
"license": "lgpl-2.1",
"size": 12144
} | [
"org.dom4j.Element",
"org.opencms.file.CmsObject",
"org.opencms.relations.CmsLink",
"org.opencms.relations.CmsLinkUpdateUtil",
"org.opencms.util.CmsStringUtil",
"org.opencms.xml.page.CmsXmlPage"
] | import org.dom4j.Element; import org.opencms.file.CmsObject; import org.opencms.relations.CmsLink; import org.opencms.relations.CmsLinkUpdateUtil; import org.opencms.util.CmsStringUtil; import org.opencms.xml.page.CmsXmlPage; | import org.dom4j.*; import org.opencms.file.*; import org.opencms.relations.*; import org.opencms.util.*; import org.opencms.xml.page.*; | [
"org.dom4j",
"org.opencms.file",
"org.opencms.relations",
"org.opencms.util",
"org.opencms.xml"
] | org.dom4j; org.opencms.file; org.opencms.relations; org.opencms.util; org.opencms.xml; | 2,329,988 |
public static CipherTextIvMac encrypt(String plaintext, SecretKeys secretKeys)
throws UnsupportedEncodingException, GeneralSecurityException {
return encrypt(plaintext, secretKeys, "UTF-8");
} | static CipherTextIvMac function(String plaintext, SecretKeys secretKeys) throws UnsupportedEncodingException, GeneralSecurityException { return encrypt(plaintext, secretKeys, "UTF-8"); } | /**
* Generates a random IV and encrypts this plain text with the given key. Then attaches
* a hashed MAC, which is contained in the CipherTextIvMac class.
*
* @param plaintext The text that will be encrypted, which
* will be serialized with UTF-8
* @param secretKeys The A... | Generates a random IV and encrypts this plain text with the given key. Then attaches a hashed MAC, which is contained in the CipherTextIvMac class | encrypt | {
"repo_name": "1ipf1ip/steganocrypt",
"path": "src/com/tozny/crypto/AesCbcWithIntegrity.java",
"license": "mit",
"size": 38513
} | [
"java.io.UnsupportedEncodingException",
"java.security.GeneralSecurityException"
] | import java.io.UnsupportedEncodingException; import java.security.GeneralSecurityException; | import java.io.*; import java.security.*; | [
"java.io",
"java.security"
] | java.io; java.security; | 755,058 |
void beforeRows(ResultSet results, KeyValueStreamListener listener) throws SQLException, IOException; | void beforeRows(ResultSet results, KeyValueStreamListener listener) throws SQLException, IOException; | /**
* Executed before rows are fetched from result set
*
* @param results the result set
* @param listener a result set listener or null
* @throws SQLException when result set fails
* @throws IOException when method fails
*/ | Executed before rows are fetched from result set | beforeRows | {
"repo_name": "abo/elasticsearch-jdbc",
"path": "src/main/java/org/xbib/elasticsearch/jdbc/strategy/JDBCSource.java",
"license": "apache-2.0",
"size": 13072
} | [
"java.io.IOException",
"java.sql.ResultSet",
"java.sql.SQLException",
"org.xbib.elasticsearch.common.keyvalue.KeyValueStreamListener"
] | import java.io.IOException; import java.sql.ResultSet; import java.sql.SQLException; import org.xbib.elasticsearch.common.keyvalue.KeyValueStreamListener; | import java.io.*; import java.sql.*; import org.xbib.elasticsearch.common.keyvalue.*; | [
"java.io",
"java.sql",
"org.xbib.elasticsearch"
] | java.io; java.sql; org.xbib.elasticsearch; | 2,820,314 |
@Test
public void testMissingFirstResultParameter() {
int maxResults = 10;
given().queryParam("maxResults", maxResults)
.then().expect().statusCode(Status.OK.getStatusCode())
.when().get(PROCESS_DEFINITION_QUERY_URL);
verify(mockedQuery).listPage(0, maxResults);
} | void function() { int maxResults = 10; given().queryParam(STR, maxResults) .then().expect().statusCode(Status.OK.getStatusCode()) .when().get(PROCESS_DEFINITION_QUERY_URL); verify(mockedQuery).listPage(0, maxResults); } | /**
* If parameter "firstResult" is missing, we expect 0 as default.
*/ | If parameter "firstResult" is missing, we expect 0 as default | testMissingFirstResultParameter | {
"repo_name": "falko/camunda-bpm-platform",
"path": "engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/ProcessDefinitionRestServiceQueryTest.java",
"license": "apache-2.0",
"size": 26287
} | [
"io.restassured.RestAssured",
"javax.ws.rs.core.Response",
"org.mockito.Mockito"
] | import io.restassured.RestAssured; import javax.ws.rs.core.Response; import org.mockito.Mockito; | import io.restassured.*; import javax.ws.rs.core.*; import org.mockito.*; | [
"io.restassured",
"javax.ws",
"org.mockito"
] | io.restassured; javax.ws; org.mockito; | 922,115 |
T dynamic(DateIntervalType intervalSize, boolean emptyAllowed); | T dynamic(DateIntervalType intervalSize, boolean emptyAllowed); | /**
* Same as "dynamic(int maxIntervals, DateIntervalType intervalSize)" but taking
* "maxIntervals=15" as default.
*/ | Same as "dynamic(int maxIntervals, DateIntervalType intervalSize)" but taking "maxIntervals=15" as default | dynamic | {
"repo_name": "porcelli-forks/dashbuilder",
"path": "dashbuilder-shared/dashbuilder-dataset-api/src/main/java/org/dashbuilder/dataset/DataSetLookupBuilder.java",
"license": "apache-2.0",
"size": 16871
} | [
"org.dashbuilder.dataset.group.DateIntervalType"
] | import org.dashbuilder.dataset.group.DateIntervalType; | import org.dashbuilder.dataset.group.*; | [
"org.dashbuilder.dataset"
] | org.dashbuilder.dataset; | 2,070,737 |
public static EnumSet<NtfsFileAttributes> toAttributes(String ntfsAttributes) {
if (ntfsAttributes == null) {
return null;
}
EnumSet<NtfsFileAttributes> attributes = EnumSet.noneOf(NtfsFileAttributes.class);
String[] splitAttributes = ntfsAttributes.split("\\|");
... | static EnumSet<NtfsFileAttributes> function(String ntfsAttributes) { if (ntfsAttributes == null) { return null; } EnumSet<NtfsFileAttributes> attributes = EnumSet.noneOf(NtfsFileAttributes.class); String[] splitAttributes = ntfsAttributes.split(STR); for (String sa : splitAttributes) { sa = sa.trim(); if (sa.equals(STR... | /**
* Creates an enum set of {@code NtfsFileAttributes} from a valid String .
*
* @param ntfsAttributes A <code>String</code> that represents the ntfs attributes. The string must contain one or
* more of the following values delimited by a |. Note they are case sensitive.
* <ul>
* <li><cod... | Creates an enum set of NtfsFileAttributes from a valid String | toAttributes | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/NtfsFileAttributes.java",
"license": "mit",
"size": 6179
} | [
"java.util.EnumSet"
] | import java.util.EnumSet; | import java.util.*; | [
"java.util"
] | java.util; | 758,562 |
@Test(expected = NullPointerException.class)
public void testPreconditionsNullError()
{
new Either<String, String>(Optional.<String>absent(), null);
} | @Test(expected = NullPointerException.class) void function() { new Either<String, String>(Optional.<String>absent(), null); } | /**
* Tests that the expected non-null precondition check works.
*/ | Tests that the expected non-null precondition check works | testPreconditionsNullError | {
"repo_name": "gkopff/crowd-control",
"path": "src/test/java/com/fatboyindustrial/crowdcontrol/EitherTest.java",
"license": "mit",
"size": 3432
} | [
"com.google.common.base.Optional",
"org.junit.Test"
] | import com.google.common.base.Optional; import org.junit.Test; | import com.google.common.base.*; import org.junit.*; | [
"com.google.common",
"org.junit"
] | com.google.common; org.junit; | 1,140,893 |
public TransformationCatalog getHandleToTransformationCatalog() {
return (TransformationCatalog) get(PegasusBag.TRANSFORMATION_CATALOG);
} | TransformationCatalog function() { return (TransformationCatalog) get(PegasusBag.TRANSFORMATION_CATALOG); } | /**
* A convenience method to get the handle to the transformation catalog.
*
* @return the handle to transformation catalog
*/ | A convenience method to get the handle to the transformation catalog | getHandleToTransformationCatalog | {
"repo_name": "pegasus-isi/pegasus",
"path": "src/edu/isi/pegasus/planner/classes/PegasusBag.java",
"license": "apache-2.0",
"size": 17081
} | [
"edu.isi.pegasus.planner.catalog.TransformationCatalog"
] | import edu.isi.pegasus.planner.catalog.TransformationCatalog; | import edu.isi.pegasus.planner.catalog.*; | [
"edu.isi.pegasus"
] | edu.isi.pegasus; | 2,617,740 |
public void adjustSetsWithChosenReplica(
final Map<String, List<DatanodeStorageInfo>> rackMap,
final List<DatanodeStorageInfo> moreThanOne,
final List<DatanodeStorageInfo> exactlyOne,
final DatanodeStorageInfo cur) {
final String rack = getRack(cur.getDatanodeDescriptor());
final ... | void function( final Map<String, List<DatanodeStorageInfo>> rackMap, final List<DatanodeStorageInfo> moreThanOne, final List<DatanodeStorageInfo> exactlyOne, final DatanodeStorageInfo cur) { final String rack = getRack(cur.getDatanodeDescriptor()); final List<DatanodeStorageInfo> storages = rackMap.get(rack); storages.... | /**
* Adjust rackmap, moreThanOne, and exactlyOne after removing replica on cur.
*
* @param rackMap a map from rack to replica
* @param moreThanOne The List of replica nodes on rack which has more than
* one replica
* @param exactlyOne The List of replica nodes on rack with only one replica
... | Adjust rackmap, moreThanOne, and exactlyOne after removing replica on cur | adjustSetsWithChosenReplica | {
"repo_name": "NJUJYB/disYarn",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicy.java",
"license": "apache-2.0",
"size": 9581
} | [
"java.util.List",
"java.util.Map"
] | import java.util.List; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,128,757 |
public GSSCredential getDelegateGSSCredUsingS4U2self(String userPrincipalName,
String targetServiceSpn,
Oid gssNameType,
int gssCredUsage,
... | GSSCredential function(String userPrincipalName, String targetServiceSpn, Oid gssNameType, int gssCredUsage, String delegateServiceSpn, Subject delegateServiceSubject) throws GSSException; | /**
* The delegate service gets the client delegate GSSCredential behalf of the client using for self (S4U2self)
*
* @param userPrincipalName - UserPrincipalName of the user for which the SPNEGO token will be generated.
* @param targetServiceSpn - The target ServicePrincipalName of system for which... | The delegate service gets the client delegate GSSCredential behalf of the client using for self (S4U2self) | getDelegateGSSCredUsingS4U2self | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.security.token.s4u2/src/com/ibm/ws/security/s4u2proxy/KerberosExtService.java",
"license": "epl-1.0",
"size": 3903
} | [
"javax.security.auth.Subject",
"org.ietf.jgss.GSSCredential",
"org.ietf.jgss.GSSException",
"org.ietf.jgss.Oid"
] | import javax.security.auth.Subject; import org.ietf.jgss.GSSCredential; import org.ietf.jgss.GSSException; import org.ietf.jgss.Oid; | import javax.security.auth.*; import org.ietf.jgss.*; | [
"javax.security",
"org.ietf.jgss"
] | javax.security; org.ietf.jgss; | 1,466,379 |
protected void onSearchResponse(final SearchResponse searchResponse, final OnSearchResultListener onSearchResultListener) {
List<SearchResult> searchResults = searchResponse.searchCategories.roomEvents.results;
List<MessageRow> messageRows = new ArrayList<>(searchResults.size());
for (Searc... | void function(final SearchResponse searchResponse, final OnSearchResultListener onSearchResultListener) { List<SearchResult> searchResults = searchResponse.searchCategories.roomEvents.results; List<MessageRow> messageRows = new ArrayList<>(searchResults.size()); for (SearchResult searchResult : searchResults) { RoomSta... | /**
* Manage the search response.
*
* @param searchResponse the search response
* @param onSearchResultListener the search result listener
*/ | Manage the search response | onSearchResponse | {
"repo_name": "matrix-org/matrix-android-sdk",
"path": "matrix-sdk/src/main/java/org/matrix/androidsdk/fragments/MatrixMessageListFragment.java",
"license": "apache-2.0",
"size": 91833
} | [
"com.google.gson.JsonObject",
"java.util.ArrayList",
"java.util.Collections",
"java.util.List",
"org.matrix.androidsdk.adapters.MessageRow",
"org.matrix.androidsdk.core.Log",
"org.matrix.androidsdk.data.Room",
"org.matrix.androidsdk.data.RoomState",
"org.matrix.androidsdk.rest.model.search.SearchRes... | import com.google.gson.JsonObject; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.matrix.androidsdk.adapters.MessageRow; import org.matrix.androidsdk.core.Log; import org.matrix.androidsdk.data.Room; import org.matrix.androidsdk.data.RoomState; import org.matrix.androidsdk.r... | import com.google.gson.*; import java.util.*; import org.matrix.androidsdk.adapters.*; import org.matrix.androidsdk.core.*; import org.matrix.androidsdk.data.*; import org.matrix.androidsdk.rest.model.search.*; | [
"com.google.gson",
"java.util",
"org.matrix.androidsdk"
] | com.google.gson; java.util; org.matrix.androidsdk; | 1,205,072 |
@NotNull Navigatable getNavigatable(); | @NotNull Navigatable getNavigatable(); | /**
* This method is called once before the actual navigation.
* In other words it is safe to unstub PSI in the implementation of this method.
* <p/>
* This method is called only if {@link #isValid()} returns {@code true}.<br/>
* This method is called in read action.
*
* @return navigatable instanc... | This method is called once before the actual navigation. In other words it is safe to unstub PSI in the implementation of this method. This method is called only if <code>#isValid()</code> returns true. This method is called in read action | getNavigatable | {
"repo_name": "siosio/intellij-community",
"path": "platform/core-api/src/com/intellij/navigation/NavigationTarget.java",
"license": "apache-2.0",
"size": 1598
} | [
"com.intellij.pom.Navigatable",
"org.jetbrains.annotations.NotNull"
] | import com.intellij.pom.Navigatable; import org.jetbrains.annotations.NotNull; | import com.intellij.pom.*; import org.jetbrains.annotations.*; | [
"com.intellij.pom",
"org.jetbrains.annotations"
] | com.intellij.pom; org.jetbrains.annotations; | 2,853,657 |
public ResultOfMovingFromDelayToWaitingQueue moveFromInToOutQueueAndReturnQueueDelay(
long fromByNdoeId, long toByNodeId, GraphType graphType) {
GraphTypeFromToNodeKey key = createGraphTypeFromToNodeKey(graphType, fromByNdoeId,
toByNodeId);
InnerQueueAndItems innerQueue... | ResultOfMovingFromDelayToWaitingQueue function( long fromByNdoeId, long toByNodeId, GraphType graphType) { GraphTypeFromToNodeKey key = createGraphTypeFromToNodeKey(graphType, fromByNdoeId, toByNodeId); InnerQueueAndItems innerQueueAndItems = createInnerQueueAndItems(key); DelayingSegment queueItems = innerQueueAndItem... | /**
* Moves {@code DelayActor} between in and out queues
*
* @param fromByNdoeId
* @param toByNodeId
* @param graphType
* @return
*/ | Moves DelayActor between in and out queues | moveFromInToOutQueueAndReturnQueueDelay | {
"repo_name": "agents4its/agentpolis",
"path": "src/main/java/cz/agents/agentpolis/simmodel/environment/model/delaymodel/impl/DelayModelStorage.java",
"license": "gpl-3.0",
"size": 9105
} | [
"cz.agents.agentpolis.simmodel.environment.model.citymodel.transportnetwork.GraphType",
"cz.agents.agentpolis.simmodel.environment.model.delaymodel.DelayingSegment",
"cz.agents.agentpolis.simmodel.environment.model.delaymodel.dto.ResultOfMovingFromDelayToWaitingQueue"
] | import cz.agents.agentpolis.simmodel.environment.model.citymodel.transportnetwork.GraphType; import cz.agents.agentpolis.simmodel.environment.model.delaymodel.DelayingSegment; import cz.agents.agentpolis.simmodel.environment.model.delaymodel.dto.ResultOfMovingFromDelayToWaitingQueue; | import cz.agents.agentpolis.simmodel.environment.model.citymodel.transportnetwork.*; import cz.agents.agentpolis.simmodel.environment.model.delaymodel.*; import cz.agents.agentpolis.simmodel.environment.model.delaymodel.dto.*; | [
"cz.agents.agentpolis"
] | cz.agents.agentpolis; | 133,179 |
public List<RemoteXBeeDevice> discoverDevices(List<String> ids) throws XBeeException {
if (ids == null)
throw new NullPointerException("List of device identifiers cannot be null.");
if (ids.size() == 0)
throw new IllegalArgumentException("List of device identifiers cannot be empty.");
logger.debug("{}... | List<RemoteXBeeDevice> function(List<String> ids) throws XBeeException { if (ids == null) throw new NullPointerException(STR); if (ids.size() == 0) throw new IllegalArgumentException(STR); logger.debug(STR, localDevice.toString(), ids.toString()); return nodeDiscovery.discoverDevices(ids); } | /**
* Discovers and reports all remote XBee devices that match the supplied
* identifiers.
*
* <p>This method blocks until the configured timeout expires. To configure
* the discovery timeout, use the method {@link #setDiscoveryTimeout(long)}.
* </p>
*
* <p>To configure the discovery options, use th... | Discovers and reports all remote XBee devices that match the supplied identifiers. This method blocks until the configured timeout expires. To configure the discovery timeout, use the method <code>#setDiscoveryTimeout(long)</code>. To configure the discovery options, use the <code>#setDiscoveryOptions(Set)</code> metho... | discoverDevices | {
"repo_name": "amertahir/QuadTRON",
"path": "GroundControlStation/src/com/digi/xbee/api/XBeeNetwork.java",
"license": "gpl-2.0",
"size": 27360
} | [
"com.digi.xbee.api.exceptions.XBeeException",
"java.util.List"
] | import com.digi.xbee.api.exceptions.XBeeException; import java.util.List; | import com.digi.xbee.api.exceptions.*; import java.util.*; | [
"com.digi.xbee",
"java.util"
] | com.digi.xbee; java.util; | 461,079 |
public void mousePressed(MouseEvent e)
{
if (SwingUtilities.isRightMouseButton(e))
{
JTree slctTree=(JTree)e.getSource();
//MappingBaseTree slctTree=(MappingBaseTree)e.getSource();
TreePath slctedPath=slctTree.getSelectionPath();
if (slctedPath==null)
return;
... | void function(MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) { JTree slctTree=(JTree)e.getSource(); TreePath slctedPath=slctTree.getSelectionPath(); if (slctedPath==null) return; DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) slctedPath.getLastPathComponent(); Container parentC = e.getComponent()... | /**
* Invoked when the mouse has been clicked on a component.
*/ | Invoked when the mouse has been clicked on a component | mousePressed | {
"repo_name": "NCIP/cacore-sdk",
"path": "RestGen/src/gov/nih/nci/restgen/ui/tree/TreeMouseAdapter.java",
"license": "bsd-3-clause",
"size": 2931
} | [
"gov.nih.nci.restgen.ui.mapping.MappingMainPanel",
"java.awt.Container",
"java.awt.event.MouseEvent",
"javax.swing.JPopupMenu",
"javax.swing.JTree",
"javax.swing.SwingUtilities",
"javax.swing.tree.DefaultMutableTreeNode",
"javax.swing.tree.TreePath"
] | import gov.nih.nci.restgen.ui.mapping.MappingMainPanel; import java.awt.Container; import java.awt.event.MouseEvent; import javax.swing.JPopupMenu; import javax.swing.JTree; import javax.swing.SwingUtilities; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreePath; | import gov.nih.nci.restgen.ui.mapping.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.tree.*; | [
"gov.nih.nci",
"java.awt",
"javax.swing"
] | gov.nih.nci; java.awt; javax.swing; | 2,444,637 |
@Override
protected void onNewIntent(Intent intent) {
if (intent.getData() != null) {
addTab(false);
navigateToUrl(intent.getDataString());
}
setIntent(intent);
super.onNewIntent(intent);
} | void function(Intent intent) { if (intent.getData() != null) { addTab(false); navigateToUrl(intent.getDataString()); } setIntent(intent); super.onNewIntent(intent); } | /**
* Handle a url request from external apps.
*/ | Handle a url request from external apps | onNewIntent | {
"repo_name": "sunnyfarmer/SFBrowser",
"path": "src/sf/browser/ui/activities/MainActivity.java",
"license": "mit",
"size": 60894
} | [
"android.content.Intent"
] | import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 524,673 |
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public void sink(FlowProcess<JobConf> flowProcess, SinkCall<Object[], OutputCollector> sinkCall)
throws IOException {
sinkCall.getOutput().collect(
null,
writer()
.writeValueAsString(
... | @SuppressWarnings({ STR, STR }) void function(FlowProcess<JobConf> flowProcess, SinkCall<Object[], OutputCollector> sinkCall) throws IOException { sinkCall.getOutput().collect( null, writer() .writeValueAsString( getFirstObject(sinkCall.getOutgoingEntry()))); } | /**
* It's ok to use NULL here so the collector does not write anything
*/ | It's ok to use NULL here so the collector does not write anything | sink | {
"repo_name": "icgc-dcc/dcc-common",
"path": "dcc-common-cascading/src/main/java/org/icgc/dcc/common/cascading/taps/DistributedSchemes.java",
"license": "gpl-3.0",
"size": 5338
} | [
"java.io.IOException",
"org.apache.hadoop.mapred.JobConf",
"org.apache.hadoop.mapred.OutputCollector",
"org.icgc.dcc.common.cascading.TupleEntries"
] | import java.io.IOException; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.OutputCollector; import org.icgc.dcc.common.cascading.TupleEntries; | import java.io.*; import org.apache.hadoop.mapred.*; import org.icgc.dcc.common.cascading.*; | [
"java.io",
"org.apache.hadoop",
"org.icgc.dcc"
] | java.io; org.apache.hadoop; org.icgc.dcc; | 96,846 |
public void testStaticMetadataIsRestoredOnRestart() throws Exception {
clientMode = false;
startGrids(2);
Ignite ignite0 = grid(0);
ignite0.active(true);
IgniteCache<Object, Object> cache0 = ignite0.cache(CACHE_NAME);
cache0.put(0, new TestValue1(0));
cac... | void function() throws Exception { clientMode = false; startGrids(2); Ignite ignite0 = grid(0); ignite0.active(true); IgniteCache<Object, Object> cache0 = ignite0.cache(CACHE_NAME); cache0.put(0, new TestValue1(0)); cache0.put(1, new TestValue2("value")); stopAllGrids(); startGrids(2); ignite0 = grid(0); ignite0.active... | /**
* Test verifies that binary metadata from regular java classes is saved and restored correctly
* on cluster restart.
*/ | Test verifies that binary metadata from regular java classes is saved and restored correctly on cluster restart | testStaticMetadataIsRestoredOnRestart | {
"repo_name": "WilliamDo/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataOnClusterRestartTest.java",
"license": "apache-2.0",
"size": 14551
} | [
"org.apache.ignite.Ignite",
"org.apache.ignite.IgniteCache"
] | import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; | import org.apache.ignite.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,936,696 |
private Map<String, TField> computeFieldNameMap(Class<?> clazz) {
final Map<String, TField> map = new HashMap<>();
if (isTBase(clazz)) {
// Get the metaDataMap for this Thrift class
@SuppressWarnings("unchecked")
final Map<? extends TFieldIdEnum, FieldMetaData> m... | Map<String, TField> function(Class<?> clazz) { final Map<String, TField> map = new HashMap<>(); if (isTBase(clazz)) { @SuppressWarnings(STR) final Map<? extends TFieldIdEnum, FieldMetaData> metaDataMap = FieldMetaData.getStructMetaDataMap((Class<? extends TBase<?, ?>>) clazz); for (Entry<? extends TFieldIdEnum, FieldMe... | /**
* Compute a new field name map for the current thrift message
* we are parsing.
*/ | Compute a new field name map for the current thrift message we are parsing | computeFieldNameMap | {
"repo_name": "minwoox/armeria",
"path": "thrift0.13/src/main/java/com/linecorp/armeria/common/thrift/text/StructContext.java",
"license": "apache-2.0",
"size": 10912
} | [
"java.util.HashMap",
"java.util.Map",
"org.apache.thrift.TBase",
"org.apache.thrift.TFieldIdEnum",
"org.apache.thrift.meta_data.EnumMetaData",
"org.apache.thrift.meta_data.FieldMetaData",
"org.apache.thrift.meta_data.FieldValueMetaData",
"org.apache.thrift.meta_data.ListMetaData",
"org.apache.thrift... | import java.util.HashMap; import java.util.Map; import org.apache.thrift.TBase; import org.apache.thrift.TFieldIdEnum; import org.apache.thrift.meta_data.EnumMetaData; import org.apache.thrift.meta_data.FieldMetaData; import org.apache.thrift.meta_data.FieldValueMetaData; import org.apache.thrift.meta_data.ListMetaData... | import java.util.*; import org.apache.thrift.*; import org.apache.thrift.meta_data.*; import org.apache.thrift.protocol.*; | [
"java.util",
"org.apache.thrift"
] | java.util; org.apache.thrift; | 1,391,384 |
public String addScheduledOnceJob(Date date, IScheduledJob job) {
ISchedulingService service = (ISchedulingService) ScopeUtils.getScopeService(scope, ISchedulingService.class, QuartzSchedulingService.class, false);
return service.addScheduledOnceJob(date, job);
} | String function(Date date, IScheduledJob job) { ISchedulingService service = (ISchedulingService) ScopeUtils.getScopeService(scope, ISchedulingService.class, QuartzSchedulingService.class, false); return service.addScheduledOnceJob(date, job); } | /**
* Adds a scheduled job that's gonna be executed once on given date. Please
* note that the jobs are not saved if Red5 is restarted in the meantime.
*
* @param date
* When to run scheduled job
* @param job
* Scheduled job object
*
* @return Name of the scheduled job
*/ | Adds a scheduled job that's gonna be executed once on given date. Please note that the jobs are not saved if Red5 is restarted in the meantime | addScheduledOnceJob | {
"repo_name": "cwpenhale/red5-mobileconsole",
"path": "red5_server/src/main/java/org/red5/server/adapter/MultiThreadedApplicationAdapter.java",
"license": "apache-2.0",
"size": 45074
} | [
"java.util.Date",
"org.red5.server.api.scheduling.IScheduledJob",
"org.red5.server.api.scheduling.ISchedulingService",
"org.red5.server.scheduling.QuartzSchedulingService",
"org.red5.server.util.ScopeUtils"
] | import java.util.Date; import org.red5.server.api.scheduling.IScheduledJob; import org.red5.server.api.scheduling.ISchedulingService; import org.red5.server.scheduling.QuartzSchedulingService; import org.red5.server.util.ScopeUtils; | import java.util.*; import org.red5.server.api.scheduling.*; import org.red5.server.scheduling.*; import org.red5.server.util.*; | [
"java.util",
"org.red5.server"
] | java.util; org.red5.server; | 2,304,710 |
@Test
public void testConnectPassword01() throws Exception {
TestUtil.initDriver(); // Set up log levels, etc.
// Create temporary .pgpass file
Path tempDirWithPrefix = Files.createTempDirectory("junit");
Path tempPgPassFile = Files.createTempFile(tempDirWithPrefix, "pgpass", "conf");
try {
... | void function() throws Exception { TestUtil.initDriver(); Path tempDirWithPrefix = Files.createTempDirectory("junit"); Path tempPgPassFile = Files.createTempFile(tempDirWithPrefix, STR, "conf"); try { try (PrintStream psPass = new PrintStream(Files.newOutputStream(tempPgPassFile))) { psPass.printf(STR, TestUtil.getServ... | /**
* Tests the password by connecting to the test database.
* password from .pgpass (correct)
*/ | Tests the password by connecting to the test database. password from .pgpass (correct) | testConnectPassword01 | {
"repo_name": "marschall/pgjdbc",
"path": "pgjdbc/src/test/java/org/postgresql/test/jdbc2/DriverTest.java",
"license": "bsd-2-clause",
"size": 26556
} | [
"java.io.PrintStream",
"java.nio.file.Files",
"java.nio.file.Path",
"org.junit.Assert",
"org.postgresql.PGEnvironment",
"org.postgresql.test.TestUtil",
"uk.org.webcompere.systemstubs.environment.EnvironmentVariables",
"uk.org.webcompere.systemstubs.resource.Resources"
] | import java.io.PrintStream; import java.nio.file.Files; import java.nio.file.Path; import org.junit.Assert; import org.postgresql.PGEnvironment; import org.postgresql.test.TestUtil; import uk.org.webcompere.systemstubs.environment.EnvironmentVariables; import uk.org.webcompere.systemstubs.resource.Resources; | import java.io.*; import java.nio.file.*; import org.junit.*; import org.postgresql.*; import org.postgresql.test.*; import uk.org.webcompere.systemstubs.environment.*; import uk.org.webcompere.systemstubs.resource.*; | [
"java.io",
"java.nio",
"org.junit",
"org.postgresql",
"org.postgresql.test",
"uk.org.webcompere"
] | java.io; java.nio; org.junit; org.postgresql; org.postgresql.test; uk.org.webcompere; | 2,798,879 |
private boolean needNeutralConquer(final TypeOfUnit item, final Sector thisSector) {
if ((item instanceof Spy)
|| (item instanceof Commander)
|| (item instanceof BaggageTrain)) {
return false;
}
// Retrieve current owner of sector
final Na... | boolean function(final TypeOfUnit item, final Sector thisSector) { if ((item instanceof Spy) (item instanceof Commander) (item instanceof BaggageTrain)) { return false; } final Nation sectorOwner = getSectorOwner(thisSector); return ((sectorOwner.getId() == NATION_NEUTRAL) && (thisSector.getTerrain().getId() != TERRAIN... | /**
* Check if the item is conquering this neutral sector.
*
* @param item the subject of the movement order.
* @param thisSector the sector to check.
* @return true if the item is conquering neutral sector.
*/ | Check if the item is conquering this neutral sector | needNeutralConquer | {
"repo_name": "EaW1805/engine",
"path": "src/main/java/com/eaw1805/orders/movement/AbstractMovement.java",
"license": "mit",
"size": 87879
} | [
"com.eaw1805.data.model.Nation",
"com.eaw1805.data.model.army.Commander",
"com.eaw1805.data.model.army.Spy",
"com.eaw1805.data.model.economy.BaggageTrain",
"com.eaw1805.data.model.map.Sector"
] | import com.eaw1805.data.model.Nation; import com.eaw1805.data.model.army.Commander; import com.eaw1805.data.model.army.Spy; import com.eaw1805.data.model.economy.BaggageTrain; import com.eaw1805.data.model.map.Sector; | import com.eaw1805.data.model.*; import com.eaw1805.data.model.army.*; import com.eaw1805.data.model.economy.*; import com.eaw1805.data.model.map.*; | [
"com.eaw1805.data"
] | com.eaw1805.data; | 2,217,333 |
public static SecuredReifiedStatement getInstance(
final SecuredModel securedModel, final ReifiedStatement stmt) {
if (securedModel == null) {
throw new IllegalArgumentException(
"Secured securedModel may not be null");
}
if (stmt == null) {
throw new IllegalArgumentException("Statement may not b... | static SecuredReifiedStatement function( final SecuredModel securedModel, final ReifiedStatement stmt) { if (securedModel == null) { throw new IllegalArgumentException( STR); } if (stmt == null) { throw new IllegalArgumentException(STR); } final ItemHolder<ReifiedStatement, SecuredReifiedStatement> holder = new ItemHol... | /**
* Get an instance of SecuredReifiedStatement
*
* @param securedModel
* the Secured Model to use.
* @param stmt
* The ReifiedStatement to secure.
* @return SecuredReifiedStatement
*/ | Get an instance of SecuredReifiedStatement | getInstance | {
"repo_name": "samaitra/jena",
"path": "jena-permissions/src/main/java/org/apache/jena/permissions/model/impl/SecuredReifiedStatementImpl.java",
"license": "apache-2.0",
"size": 3456
} | [
"org.apache.jena.permissions.impl.ItemHolder",
"org.apache.jena.permissions.impl.SecuredItemInvoker",
"org.apache.jena.permissions.model.SecuredModel",
"org.apache.jena.permissions.model.SecuredReifiedStatement",
"org.apache.jena.rdf.model.ReifiedStatement"
] | import org.apache.jena.permissions.impl.ItemHolder; import org.apache.jena.permissions.impl.SecuredItemInvoker; import org.apache.jena.permissions.model.SecuredModel; import org.apache.jena.permissions.model.SecuredReifiedStatement; import org.apache.jena.rdf.model.ReifiedStatement; | import org.apache.jena.permissions.impl.*; import org.apache.jena.permissions.model.*; import org.apache.jena.rdf.model.*; | [
"org.apache.jena"
] | org.apache.jena; | 134,884 |
public ArrayList<Long> genCards(java.util.Collection<Long> nids, @NonNull Model model) {
return genCards(Utils.collection2Array(nids), model);
} | ArrayList<Long> function(java.util.Collection<Long> nids, @NonNull Model model) { return genCards(Utils.collection2Array(nids), model); } | /**
* Generate cards for non-empty templates, return ids to remove.
*/ | Generate cards for non-empty templates, return ids to remove | genCards | {
"repo_name": "ankidroid/Anki-Android",
"path": "AnkiDroid/src/main/java/com/ichi2/libanki/Collection.java",
"license": "gpl-3.0",
"size": 89141
} | [
"androidx.annotation.NonNull",
"java.util.ArrayList"
] | import androidx.annotation.NonNull; import java.util.ArrayList; | import androidx.annotation.*; import java.util.*; | [
"androidx.annotation",
"java.util"
] | androidx.annotation; java.util; | 2,159,001 |
@Test
public void optionalObjectTableArgTest1() {
Invocation invocation = new Invocation("OptionalArgTest4");
Operation op = xrService.getOperation(invocation.getName());
Object result = op.invoke(xrService, invocation);
assertNotNull("result is null", result);
Document d... | void function() { Invocation invocation = new Invocation(STR); Operation op = xrService.getOperation(invocation.getName()); Object result = op.invoke(xrService, invocation); assertNotNull(STR, result); Document doc = xmlPlatform.createDocument(); XMLMarshaller marshaller = xrService.getXMLContext().createMarshaller(); ... | /**
* Tests ObjectTable default.
* Expects 'null'.
*/ | Tests ObjectTable default. Expects 'null' | optionalObjectTableArgTest1 | {
"repo_name": "RallySoftware/eclipselink.runtime",
"path": "utils/eclipselink.dbws.builder.test.oracle/src/dbws/testing/optionalarguments/OptionalArgumentTestSuite.java",
"license": "epl-1.0",
"size": 20512
} | [
"java.io.StringReader",
"org.eclipse.persistence.internal.xr.Invocation",
"org.eclipse.persistence.internal.xr.Operation",
"org.eclipse.persistence.oxm.XMLMarshaller",
"org.junit.Assert",
"org.w3c.dom.Document"
] | import java.io.StringReader; import org.eclipse.persistence.internal.xr.Invocation; import org.eclipse.persistence.internal.xr.Operation; import org.eclipse.persistence.oxm.XMLMarshaller; import org.junit.Assert; import org.w3c.dom.Document; | import java.io.*; import org.eclipse.persistence.internal.xr.*; import org.eclipse.persistence.oxm.*; import org.junit.*; import org.w3c.dom.*; | [
"java.io",
"org.eclipse.persistence",
"org.junit",
"org.w3c.dom"
] | java.io; org.eclipse.persistence; org.junit; org.w3c.dom; | 1,092,918 |
List<? extends Element> fullTextSearch(FullTextElementQuery params); | List<? extends Element> fullTextSearch(FullTextElementQuery params); | /**
* Search elements using a full-text query.
*/ | Search elements using a full-text query | fullTextSearch | {
"repo_name": "mateli/OpenCyclos",
"path": "src/main/java/nl/strohalm/cyclos/dao/members/ElementDAO.java",
"license": "gpl-2.0",
"size": 7308
} | [
"java.util.List",
"nl.strohalm.cyclos.entities.members.Element",
"nl.strohalm.cyclos.entities.members.FullTextElementQuery"
] | import java.util.List; import nl.strohalm.cyclos.entities.members.Element; import nl.strohalm.cyclos.entities.members.FullTextElementQuery; | import java.util.*; import nl.strohalm.cyclos.entities.members.*; | [
"java.util",
"nl.strohalm.cyclos"
] | java.util; nl.strohalm.cyclos; | 2,731,384 |
public static BaseArtifactType toBaseArtifact(WorkflowQueryBean workflowQuery) {
ExtendedArtifactType toSave = new ExtendedArtifactType();
toSave.setArtifactType(BaseArtifactEnum.EXTENDED_ARTIFACT_TYPE);
toSave.setExtendedType(DtgovModel.WorkflowQueryType);
toSave.setName(workflowQue... | static BaseArtifactType function(WorkflowQueryBean workflowQuery) { ExtendedArtifactType toSave = new ExtendedArtifactType(); toSave.setArtifactType(BaseArtifactEnum.EXTENDED_ARTIFACT_TYPE); toSave.setExtendedType(DtgovModel.WorkflowQueryType); toSave.setName(workflowQuery.getName()); toSave.setDescription(workflowQuer... | /**
* To base artifact.
*
* @param workflowQuery
* the workflow query
* @return the base artifact type
*/ | To base artifact | toBaseArtifact | {
"repo_name": "Governance/dtgov",
"path": "dtgov-ui-war/src/main/java/org/overlord/dtgov/ui/server/services/workflows/WorkflowQueryFactory.java",
"license": "apache-2.0",
"size": 5277
} | [
"java.util.Date",
"java.util.GregorianCalendar",
"javax.xml.datatype.DatatypeConfigurationException",
"javax.xml.datatype.DatatypeFactory",
"javax.xml.datatype.XMLGregorianCalendar",
"org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactEnum",
"org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType",
... | import java.util.Date; import java.util.GregorianCalendar; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactEnum; import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.... | import java.util.*; import javax.xml.datatype.*; import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.*; import org.overlord.dtgov.common.model.*; import org.overlord.dtgov.ui.client.shared.beans.*; import org.overlord.sramp.common.*; | [
"java.util",
"javax.xml",
"org.oasis_open.docs",
"org.overlord.dtgov",
"org.overlord.sramp"
] | java.util; javax.xml; org.oasis_open.docs; org.overlord.dtgov; org.overlord.sramp; | 3,895 |
@Override
public int storeNewLocal(final Type type) {
Object t;
switch (type.getSort()) {
case Type.BOOLEAN:
case Type.CHAR:
case Type.BYTE:
case Type.SHORT:
case Type.INT:
t = Opcodes.INTEGER;
break;
case Type.FLOAT:
... | int function(final Type type) { Object t; switch (type.getSort()) { case Type.BOOLEAN: case Type.CHAR: case Type.BYTE: case Type.SHORT: case Type.INT: t = Opcodes.INTEGER; break; case Type.FLOAT: t = Opcodes.FLOAT; break; case Type.LONG: t = Opcodes.LONG; break; case Type.DOUBLE: t = Opcodes.DOUBLE; break; case Type.AR... | /**
* Creates a new local variable of the given type and
* stores the top stack value there
*
* @param type
* the type of the local variable to be created.
* @return the identifier of the newly created local variable.
* it is a negative number -> Math.abs(ident) = t... | Creates a new local variable of the given type and stores the top stack value there | storeNewLocal | {
"repo_name": "xiangyong/btrace",
"path": "src/share/classes/com/sun/btrace/util/LocalVariableHelperImpl.java",
"license": "gpl-2.0",
"size": 11777
} | [
"com.sun.btrace.org.objectweb.asm.Opcodes",
"com.sun.btrace.org.objectweb.asm.Type"
] | import com.sun.btrace.org.objectweb.asm.Opcodes; import com.sun.btrace.org.objectweb.asm.Type; | import com.sun.btrace.org.objectweb.asm.*; | [
"com.sun.btrace"
] | com.sun.btrace; | 2,663,221 |
public KeyphraseSoundModel getKeyphraseSoundModel(int keyphraseId, int userHandle,
String bcp47Locale) {
// Sanitize the locale to guard against SQL injection.
bcp47Locale = Locale.forLanguageTag(bcp47Locale).toLanguageTag();
synchronized(this) {
// Find the correspon... | KeyphraseSoundModel function(int keyphraseId, int userHandle, String bcp47Locale) { bcp47Locale = Locale.forLanguageTag(bcp47Locale).toLanguageTag(); synchronized(this) { String selectQuery = STR + SoundModelContract.TABLE + STR + SoundModelContract.KEY_KEYPHRASE_ID + STR + keyphraseId + STR + SoundModelContract.KEY_LO... | /**
* Returns a matching {@link KeyphraseSoundModel} for the keyphrase ID.
* Returns null if a match isn't found.
*
* TODO: We only support one keyphrase currently.
*/ | Returns a matching <code>KeyphraseSoundModel</code> for the keyphrase ID. Returns null if a match isn't found | getKeyphraseSoundModel | {
"repo_name": "Ant-Droid/android_frameworks_base_OLD",
"path": "services/voiceinteraction/java/com/android/server/voiceinteraction/DatabaseHelper.java",
"license": "apache-2.0",
"size": 11135
} | [
"android.database.Cursor",
"android.database.sqlite.SQLiteDatabase",
"android.hardware.soundtrigger.SoundTrigger",
"android.util.Slog",
"java.util.Locale",
"java.util.UUID"
] | import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.hardware.soundtrigger.SoundTrigger; import android.util.Slog; import java.util.Locale; import java.util.UUID; | import android.database.*; import android.database.sqlite.*; import android.hardware.soundtrigger.*; import android.util.*; import java.util.*; | [
"android.database",
"android.hardware",
"android.util",
"java.util"
] | android.database; android.hardware; android.util; java.util; | 237,991 |
@Override
public void setLEDState(int led, LEDState state) {
if (led != 0) {
throw new RuntimeException(led + " is not valid LED number; only 1 LED");
}
// log.info("setting LED="+led+" to state="+state);
short cmd = 0;
switch (state) {
case OFF:
... | void function(int led, LEDState state) { if (led != 0) { throw new RuntimeException(led + STR); } short cmd = 0; switch (state) { case OFF: cmd = 0; break; case ON: cmd = 1; break; case FLASHING: cmd = 2; break; } try { this.sendVendorRequest(this.VENDOR_REQUEST_LED, cmd, (byte) 0); ledState = state; } catch (HardwareI... | /** Sets the LED state. Throws no exception, just prints warning on hardware exceptions.
*
* @param led only 0 in this case
* @param state the new state
*/ | Sets the LED state. Throws no exception, just prints warning on hardware exceptions | setLEDState | {
"repo_name": "viktorbahr/jaer",
"path": "src/net/sf/jaer/hardwareinterface/usb/cypressfx2/CypressFX2DVS128HardwareInterface.java",
"license": "lgpl-2.1",
"size": 16041
} | [
"net.sf.jaer.hardwareinterface.HardwareInterfaceException"
] | import net.sf.jaer.hardwareinterface.HardwareInterfaceException; | import net.sf.jaer.hardwareinterface.*; | [
"net.sf.jaer"
] | net.sf.jaer; | 2,907,606 |
public static MozuClient<com.mozu.api.contracts.commerceruntime.returns.ReturnCollection> performReturnActionsClient(com.mozu.api.contracts.commerceruntime.returns.ReturnAction action, AuthTicket authTicket) throws Exception
{
MozuUrl url = com.mozu.api.urls.commerce.ReturnUrl.performReturnActionsUrl();
String ... | static MozuClient<com.mozu.api.contracts.commerceruntime.returns.ReturnCollection> function(com.mozu.api.contracts.commerceruntime.returns.ReturnAction action, AuthTicket authTicket) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.ReturnUrl.performReturnActionsUrl(); String verb = "POST"; Class<?> clz = com... | /**
* Updates the return by performing the specified action.
* <p><pre><code>
* MozuClient<com.mozu.api.contracts.commerceruntime.returns.ReturnCollection> mozuClient=PerformReturnActionsClient( action, authTicket);
* client.setBaseAddress(url);
* client.executeRequest();
* ReturnCollection returnCollection... | Updates the return by performing the specified action. <code><code> MozuClient mozuClient=PerformReturnActionsClient( action, authTicket); client.setBaseAddress(url); client.executeRequest(); ReturnCollection returnCollection = client.Result(); </code></code> | performReturnActionsClient | {
"repo_name": "carsonreinke/mozu-java-sdk",
"path": "src/main/java/com/mozu/api/clients/commerce/ReturnClient.java",
"license": "mit",
"size": 18485
} | [
"com.mozu.api.MozuClient",
"com.mozu.api.MozuUrl",
"com.mozu.api.security.AuthTicket"
] | import com.mozu.api.MozuClient; import com.mozu.api.MozuUrl; import com.mozu.api.security.AuthTicket; | import com.mozu.api.*; import com.mozu.api.security.*; | [
"com.mozu.api"
] | com.mozu.api; | 1,862,019 |
public boolean matches(Lesson another) {
if(equals(another)) {
List<SchoolClass> anotherSchoolClasses = another.getSchoolClasses();
List<SchoolTeacher> anotherSchoolTeachers = another.getSchoolTeachers();
List<SchoolRoom> anotherSchoolRooms = another.getSchoolRooms();
List<SchoolSubject> anotherSchoolS... | boolean function(Lesson another) { if(equals(another)) { List<SchoolClass> anotherSchoolClasses = another.getSchoolClasses(); List<SchoolTeacher> anotherSchoolTeachers = another.getSchoolTeachers(); List<SchoolRoom> anotherSchoolRooms = another.getSchoolRooms(); List<SchoolSubject> anotherSchoolSubjects = another.getSc... | /**
* Ueberprueft, ob Datum, Anfangs- und Endzeit, Klassen-, Lehrer-, Raum- und Fachliste uebereinstimmen.
* @param another Stunde, mit der diese vergleichen werden soll
* @return 'true', wenn Stunde uebereinstimmt (siehe Methodenbeschreibung)
*/ | Ueberprueft, ob Datum, Anfangs- und Endzeit, Klassen-, Lehrer-, Raum- und Fachliste uebereinstimmen | matches | {
"repo_name": "makubi/SchoolPlanner4Untis",
"path": "app/src/main/java/edu/htl3r/schoolplanner/backend/schoolObjects/lesson/Lesson.java",
"license": "gpl-3.0",
"size": 10700
} | [
"edu.htl3r.schoolplanner.backend.schoolObjects.viewtypes.SchoolClass",
"edu.htl3r.schoolplanner.backend.schoolObjects.viewtypes.SchoolRoom",
"edu.htl3r.schoolplanner.backend.schoolObjects.viewtypes.SchoolSubject",
"edu.htl3r.schoolplanner.backend.schoolObjects.viewtypes.SchoolTeacher",
"java.util.List"
] | import edu.htl3r.schoolplanner.backend.schoolObjects.viewtypes.SchoolClass; import edu.htl3r.schoolplanner.backend.schoolObjects.viewtypes.SchoolRoom; import edu.htl3r.schoolplanner.backend.schoolObjects.viewtypes.SchoolSubject; import edu.htl3r.schoolplanner.backend.schoolObjects.viewtypes.SchoolTeacher; import java.u... | import edu.htl3r.schoolplanner.backend.*; import java.util.*; | [
"edu.htl3r.schoolplanner",
"java.util"
] | edu.htl3r.schoolplanner; java.util; | 2,256,532 |
public SpringApplicationBuilder properties(Properties defaultProperties) {
return properties(getMapFromProperties(defaultProperties));
} | SpringApplicationBuilder function(Properties defaultProperties) { return properties(getMapFromProperties(defaultProperties)); } | /**
* Default properties for the environment in the form {@code key=value} or
* {@code key:value}.
* @param defaultProperties the properties to set.
* @return the current builder
*/ | Default properties for the environment in the form key=value or key:value | properties | {
"repo_name": "wwadge/spring-boot",
"path": "spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java",
"license": "apache-2.0",
"size": 16679
} | [
"java.util.Properties"
] | import java.util.Properties; | import java.util.*; | [
"java.util"
] | java.util; | 2,617,317 |
public Annotation getParse() {
if (Predicate_Type.featOkTst && ((Predicate_Type)jcasType).casFeat_parse == null)
jcasType.jcas.throwFeatMissing("parse", "org.oaqa.dso.model.Predicate");
return (Annotation)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Predicate_Type)jcasType).cas... | Annotation function() { if (Predicate_Type.featOkTst && ((Predicate_Type)jcasType).casFeat_parse == null) jcasType.jcas.throwFeatMissing("parse", STR); return (Annotation)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Predicate_Type)jcasType).casFeatCode_parse)));} | /** getter for parse - gets A parse for which this predicate was a head (if any)
* @generated */ | getter for parse - gets A parse for which this predicate was a head (if any) | getParse | {
"repo_name": "brmson/helloqa",
"path": "src/main/java/org/oaqa/dso/model/Predicate.java",
"license": "apache-2.0",
"size": 15724
} | [
"org.apache.uima.jcas.tcas.Annotation"
] | import org.apache.uima.jcas.tcas.Annotation; | import org.apache.uima.jcas.tcas.*; | [
"org.apache.uima"
] | org.apache.uima; | 2,106,467 |
boolean containsFile( File file ) {
final String path = file.getAbsolutePath();
synchronized ( m_filesByPath ) {
return m_filesByPath.containsKey( path );
}
} | boolean containsFile( File file ) { final String path = file.getAbsolutePath(); synchronized ( m_filesByPath ) { return m_filesByPath.containsKey( path ); } } | /**
* Checks whether the given file is being monitored.
*
* @param file The {@link File} to check.
* @return Returns <code>true</code> only if the file is being monitored.
*/ | Checks whether the given file is being monitored | containsFile | {
"repo_name": "MarinnaCole/LightZone",
"path": "lightcrafts/src/com/lightcrafts/utils/filecache/FileCacheMonitor.java",
"license": "bsd-3-clause",
"size": 9905
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 907,259 |
public static void doWithFields(Class<?> clazz, FieldCallback fc, FieldFilter ff)
throws IllegalArgumentException {
// Keep backing up the inheritance hierarchy.
Class<?> targetClass = clazz;
do {
Field[] fields = targetClass.getDeclaredFields();
for (Field field : fields) {
// Skip static and fi... | static void function(Class<?> clazz, FieldCallback fc, FieldFilter ff) throws IllegalArgumentException { Class<?> targetClass = clazz; do { Field[] fields = targetClass.getDeclaredFields(); for (Field field : fields) { if (ff != null && !ff.matches(field)) { continue; } try { fc.doWith(field); } catch (IllegalAccessExc... | /**
* Invoke the given callback on all fields in the target class, going up the
* class hierarchy to get all declared fields.
* @param clazz the target class to analyze
* @param fc the callback to invoke for each field
* @param ff the filter that determines the fields to apply the callback to
*/ | Invoke the given callback on all fields in the target class, going up the class hierarchy to get all declared fields | doWithFields | {
"repo_name": "TinyGroup/tiny",
"path": "framework/org.tinygroup.commons/src/main/java/org/tinygroup/commons/tools/ReflectionUtils.java",
"license": "gpl-3.0",
"size": 25137
} | [
"java.lang.reflect.Field"
] | import java.lang.reflect.Field; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 1,376,766 |
protected WorldDistance perpendicularDistanceBetween(final WorldLocation lineStart, final WorldLocation lineEnd)
{
final Point2D pStart = new Point2D.Double(lineStart.getLong(), lineStart.getLat());
final Point2D pEnd = new Point2D.Double(lineEnd.getLong(), lineEnd.getLat());
final Point2D tgt = new Poi... | WorldDistance function(final WorldLocation lineStart, final WorldLocation lineEnd) { final Point2D pStart = new Point2D.Double(lineStart.getLong(), lineStart.getLat()); final Point2D pEnd = new Point2D.Double(lineEnd.getLong(), lineEnd.getLat()); final Point2D tgt = new Point2D.Double(this.getLong(), this.getLat()); fi... | /**
* work out the perpendicular distance between me and the supplied line
* segment
*
* @param lineStart
* start point of the line
* @param lineEnd
* end point of the line
* @return perpendicular distance off track.
*/ | work out the perpendicular distance between me and the supplied line segment | perpendicularDistanceBetween | {
"repo_name": "alastrina123/debrief",
"path": "org.mwc.cmap.legacy/src/MWC/GenericData/WorldLocation.java",
"license": "epl-1.0",
"size": 23391
} | [
"java.awt.geom.Point2D"
] | import java.awt.geom.Point2D; | import java.awt.geom.*; | [
"java.awt"
] | java.awt; | 1,961,723 |
public IntValue getDistinctNeighborCount() {
return distinctNeighborCount;
} | IntValue function() { return distinctNeighborCount; } | /**
* Get the distinct neighbor count.
*
* @return distinct neighbor count
*/ | Get the distinct neighbor count | getDistinctNeighborCount | {
"repo_name": "mtunique/flink",
"path": "flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/library/similarity/JaccardIndex.java",
"license": "apache-2.0",
"size": 17861
} | [
"org.apache.flink.types.IntValue"
] | import org.apache.flink.types.IntValue; | import org.apache.flink.types.*; | [
"org.apache.flink"
] | org.apache.flink; | 67,244 |
public final <T extends KeySpec> T getKeySpec(Key key,
Class<T> keySpec)
throws InvalidKeySpecException {
return spiImpl.engineGetKeySpec(key, keySpec);
}
| final <T extends KeySpec> T function(Key key, Class<T> keySpec) throws InvalidKeySpecException { return spiImpl.engineGetKeySpec(key, keySpec); } | /**
* Returns the key specification for the specified key.
*
* @param <T>
* The key type
*
* @param key
* the key from which the specification is requested.
* @param keySpec
* the type of the requested {@code KeySpec}.
* @ret... | Returns the key specification for the specified key | getKeySpec | {
"repo_name": "skyHALud/codenameone",
"path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/security/src/main/java/common/java/security/KeyFactory.java",
"license": "gpl-2.0",
"size": 8641
} | [
"java.security.spec.InvalidKeySpecException",
"java.security.spec.KeySpec"
] | import java.security.spec.InvalidKeySpecException; import java.security.spec.KeySpec; | import java.security.spec.*; | [
"java.security"
] | java.security; | 622,649 |
public static JSONObject getObject(JSONObject json, String... path) throws JSONException {
json = walk(json, path);
return json.getJSONObject(path[path.length - 1]);
} | static JSONObject function(JSONObject json, String... path) throws JSONException { json = walk(json, path); return json.getJSONObject(path[path.length - 1]); } | /**
* Returns a JSONObject member value from the JSON sub-object addressed by the path
*
* @param json The object
* @param path list of string object member selectors
* @return the int addressed by the path, assuming such a thing exists
* @throws JSONException if any step in the path doesn... | Returns a JSONObject member value from the JSON sub-object addressed by the path | getObject | {
"repo_name": "open-keychain/KeybaseLib",
"path": "Lib/src/main/java/com/textuality/keybase/lib/JWalk.java",
"license": "apache-2.0",
"size": 5216
} | [
"org.json.JSONException",
"org.json.JSONObject"
] | import org.json.JSONException; import org.json.JSONObject; | import org.json.*; | [
"org.json"
] | org.json; | 2,478,492 |
public InheritanceModel inheritDoc()
{
if(isRoot())
return this;
Collection<InheritanceModel> interfaces = null;
if(_interfaces != null)
{
if(_interfaces.size() != 0)
{
boolean changed = false;
interfaces = new ArrayList<InheritanceModel>(_interfaces.size());
... | InheritanceModel function() { if(isRoot()) return this; Collection<InheritanceModel> interfaces = null; if(_interfaces != null) { if(_interfaces.size() != 0) { boolean changed = false; interfaces = new ArrayList<InheritanceModel>(_interfaces.size()); for(InheritanceModel model : _interfaces) { InheritanceModel newModel... | /**
* This method returns a new model where the inheriting of javadoc has been processed.
* @see <a href="http://java.sun.com/javase/6/docs/technotes/tools/solaris/javadoc.html">javadoc - The Java API Documentation Generator</a>
*/ | This method returns a new model where the inheriting of javadoc has been processed | inheritDoc | {
"repo_name": "pongasoft/kiwidoc",
"path": "kiwidoc/com.pongasoft.kiwidoc.model/src/main/java/com/pongasoft/kiwidoc/model/InheritanceModel.java",
"license": "apache-2.0",
"size": 14082
} | [
"java.util.ArrayList",
"java.util.Collection"
] | import java.util.ArrayList; import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 271,158 |
public static Set<DeployedCard> sameCapture(Field field,
DeployedCard toPlay, DeployedCardComparator cardComparator)
{
Set<DeployedCard> result = CardPlayFunction.basicCapture(field, toPlay,
cardComparator);
Set<DeployedCard> sameCards = CardPlayFunction.basicCapture(field,
toPlay, DeployedCard... | static Set<DeployedCard> function(Field field, DeployedCard toPlay, DeployedCardComparator cardComparator) { Set<DeployedCard> result = CardPlayFunction.basicCapture(field, toPlay, cardComparator); Set<DeployedCard> sameCards = CardPlayFunction.basicCapture(field, toPlay, DeployedCardComparator::equalCompare); if (same... | /**
* This method takes in a field, a card to play, and card comparator and
* uses them to determine which cards to capture, returning those as a set.
* This function assumes the Same rule but not the Combo or Plus rule.
*
* @param field
* The current state of the game.
* @param toPlay
... | This method takes in a field, a card to play, and card comparator and uses them to determine which cards to capture, returning those as a set. This function assumes the Same rule but not the Combo or Plus rule | sameCapture | {
"repo_name": "slaymaker1907/triple-triad-ai",
"path": "TRIPLE_TRIAD_ENGINE/src/com/dyllongagnier/triad/core/functions/CardPlayFunction.java",
"license": "gpl-2.0",
"size": 13137
} | [
"com.dyllongagnier.triad.card.DeployedCard",
"com.dyllongagnier.triad.core.Field",
"java.util.Set"
] | import com.dyllongagnier.triad.card.DeployedCard; import com.dyllongagnier.triad.core.Field; import java.util.Set; | import com.dyllongagnier.triad.card.*; import com.dyllongagnier.triad.core.*; import java.util.*; | [
"com.dyllongagnier.triad",
"java.util"
] | com.dyllongagnier.triad; java.util; | 413,854 |
@Override
public void actionPerformed(ActionEvent e) {
jFileChooser1.showSaveDialog(frame);
//FileDialog chooser = new FileDialog(StdDraw.frame, "Use a .png or .jpg extension", FileDialog.SAVE);
//chooser.setVisible(true);
//String fi... | void function(ActionEvent e) { jFileChooser1.showSaveDialog(frame); } | /**
* This method cannot be called directly.
* @param e save event
*/ | This method cannot be called directly | actionPerformed | {
"repo_name": "hmueller80/VCF.Filter",
"path": "VCFFilter/src/at/ac/oeaw/cemm/bsf/vcffilter/vcftoimage/StdDraw.java",
"license": "gpl-3.0",
"size": 77382
} | [
"java.awt.event.ActionEvent"
] | import java.awt.event.ActionEvent; | import java.awt.event.*; | [
"java.awt"
] | java.awt; | 51,232 |
public String displayError(String pathPrefix) {
if (pathPrefix == null) {
pathPrefix = "";
}
StringBuffer html = new StringBuffer(512);
html.append("<table border='0' cellpadding='5' cellspacing='0' style='width: 100%; height: 100%;'>");
html.append("\t<tr>");
... | String function(String pathPrefix) { if (pathPrefix == null) { pathPrefix = STR<table border='0' cellpadding='5' cellspacing='0' style='width: 100%; height: 100%;'>STR\t<tr>STR\t\t<td style='vertical-align: middle; height: 100%;'>STRC_BLOCK_STARTSTRErrorSTR\t\t\t<table border='0' cellpadding='0' cellspacing='0' style='... | /**
* Returns html code to display an error.<p>
*
* @param pathPrefix to adjust the path
*
* @return html code
*/ | Returns html code to display an error | displayError | {
"repo_name": "mediaworx/opencms-core",
"path": "src-setup/org/opencms/setup/CmsSetupBean.java",
"license": "lgpl-2.1",
"size": 115587
} | [
"org.opencms.main.OpenCms"
] | import org.opencms.main.OpenCms; | import org.opencms.main.*; | [
"org.opencms.main"
] | org.opencms.main; | 1,027,396 |
private Animation outToRightAnimation() {
Animation outToRight = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, 0.0f,
Animation.RELATIVE_TO_PARENT, 1.0f,
Animation.RELATIVE_TO_PARENT, 0.0f,
Animation.RELATIVE_TO_PARENT, 0.0f);
return setProperties(outToRight);
} | Animation function() { Animation outToRight = new TranslateAnimation( Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 1.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f); return setProperties(outToRight); } | /**
* Custom animation that animates out to the right
*
* @return Animation the Animation object
*/ | Custom animation that animates out to the right | outToRightAnimation | {
"repo_name": "bernagg/arcowabungaproject",
"path": "ARcowabungaproject/src/org/escoladeltreball/arcowabungaproject/activities/MenuActivity.java",
"license": "gpl-3.0",
"size": 15686
} | [
"android.view.animation.Animation",
"android.view.animation.TranslateAnimation"
] | import android.view.animation.Animation; import android.view.animation.TranslateAnimation; | import android.view.animation.*; | [
"android.view"
] | android.view; | 1,296,215 |
double[][] spectrogramData = spectrogram.getNormalizedSpectrogramData();
int width = spectrogramData.length;
int height = spectrogramData[0].length;
BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
for (int i = 0; i < width; i++) {
for (int... | double[][] spectrogramData = spectrogram.getNormalizedSpectrogramData(); int width = spectrogramData.length; int height = spectrogramData[0].length; BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { int value;... | /**
* Render a spectrogram of a wave file
*
* @param spectrogram spectrogram object
*/ | Render a spectrogram of a wave file | renderSpectrogram | {
"repo_name": "timmolter/Datasets",
"path": "datasets-hja-birdsong/src/main/java/com/musicg/wave/SpectrogramRender.java",
"license": "mit",
"size": 2241
} | [
"java.awt.image.BufferedImage"
] | import java.awt.image.BufferedImage; | import java.awt.image.*; | [
"java.awt"
] | java.awt; | 1,108,217 |
public void setTabLabelMargins(int margin) {
tabInsets = (Insets) tabInsets.clone();
tabInsets.left = margin;
tabInsets.right = margin;
}
| void function(int margin) { tabInsets = (Insets) tabInsets.clone(); tabInsets.left = margin; tabInsets.right = margin; } | /**
* Set the empty space at the sides of the tab label.
*
* @param margin margin width in pixels
*/ | Set the empty space at the sides of the tab label | setTabLabelMargins | {
"repo_name": "sourceress-project/archestica",
"path": "src/games/stendhal/client/gui/styled/StyledTabbedPaneUI.java",
"license": "gpl-2.0",
"size": 4841
} | [
"java.awt.Insets"
] | import java.awt.Insets; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,570,199 |
@RequestMapping(value = "/{eventId}/resources/{id}", method = RequestMethod.DELETE)
public ResponseEntity<String> deleteResource(@PathVariable Long eventId, @PathVariable Long id) {
LOGGER.debug("[{}] Delete resource {} for event {}", getUserConnected(), id, eventId);
eventService.deleteResource... | @RequestMapping(value = STR, method = RequestMethod.DELETE) ResponseEntity<String> function(@PathVariable Long eventId, @PathVariable Long id) { LOGGER.debug(STR, getUserConnected(), id, eventId); eventService.deleteResource(id, eventId, getUserConnectedId()); return ResponseEntity.ok().body(StringUtils.EMPTY); } | /**
* Update resource.
*/ | Update resource | deleteResource | {
"repo_name": "aguillem/festival-manager",
"path": "festival-manager-core/src/main/java/com/aguillem/festival/manager/core/rest/controller/EventController.java",
"license": "gpl-3.0",
"size": 23803
} | [
"org.apache.commons.lang3.StringUtils",
"org.springframework.http.ResponseEntity",
"org.springframework.web.bind.annotation.PathVariable",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestMethod"
] | import org.apache.commons.lang3.StringUtils; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; | import org.apache.commons.lang3.*; import org.springframework.http.*; import org.springframework.web.bind.annotation.*; | [
"org.apache.commons",
"org.springframework.http",
"org.springframework.web"
] | org.apache.commons; org.springframework.http; org.springframework.web; | 2,523,359 |
public And<S> containsSequence(List<T> sequence) {
if (sequence.isEmpty()) {
return nextChain();
}
List<T> list = getSubject();
while (true) {
int first = list.indexOf(sequence.get(0));
if (first < 0) {
break; // Not found
}
int last = first + sequence.size();
... | And<S> function(List<T> sequence) { if (sequence.isEmpty()) { return nextChain(); } List<T> list = getSubject(); while (true) { int first = list.indexOf(sequence.get(0)); if (first < 0) { break; } int last = first + sequence.size(); if (last > list.size()) { break; } if (sequence.equals(list.subList(first, last))) { re... | /**
* Attests that a List contains the specified sequence.
*/ | Attests that a List contains the specified sequence | containsSequence | {
"repo_name": "dsaff/truth-old",
"path": "src/main/java/org/junit/contrib/truth/subjects/ListSubject.java",
"license": "apache-2.0",
"size": 4687
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 23,958 |
public List<FeatureDataRow> getRows(); | List<FeatureDataRow> function(); | /**
* Gets all the rows in the dataset as a list
*
* @return a list of all the rows in the dataset
*/ | Gets all the rows in the dataset as a list | getRows | {
"repo_name": "unoinformatics/informatics-common",
"path": "informatics-data/informatics-data-api/src/main/java/uno/informatics/data/dataset/FeatureData.java",
"license": "apache-2.0",
"size": 3666
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 908,669 |
public void setBackgroundColor(int colorRes) {
if (getBackground() instanceof ShapeDrawable) {
final Resources res = getResources();
((ShapeDrawable) getBackground()).getPaint().setColor(CompatibilityUtils.getColor(res, colorRes));
}
}
private class OvalShadow extend... | void function(int colorRes) { if (getBackground() instanceof ShapeDrawable) { final Resources res = getResources(); ((ShapeDrawable) getBackground()).getPaint().setColor(CompatibilityUtils.getColor(res, colorRes)); } } private class OvalShadow extends OvalShape { private RadialGradient mRadialGradient; private int mSha... | /**
* Update the background color of the circle image view.
*/ | Update the background color of the circle image view | setBackgroundColor | {
"repo_name": "miku-nyan/Overchan-Android",
"path": "src/nya/miku/wishmaster/lib/pullable_layout/CircleImageView.java",
"license": "gpl-3.0",
"size": 5084
} | [
"android.content.res.Resources",
"android.graphics.Color",
"android.graphics.Paint",
"android.graphics.RadialGradient",
"android.graphics.Shader",
"android.graphics.drawable.ShapeDrawable",
"android.graphics.drawable.shapes.OvalShape"
] | import android.content.res.Resources; import android.graphics.Color; import android.graphics.Paint; import android.graphics.RadialGradient; import android.graphics.Shader; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.OvalShape; | import android.content.res.*; import android.graphics.*; import android.graphics.drawable.*; import android.graphics.drawable.shapes.*; | [
"android.content",
"android.graphics"
] | android.content; android.graphics; | 2,769,057 |
EAttribute getElementPosition__Width_1(); | EAttribute getElementPosition__Width_1(); | /**
* Returns the meta object for the attribute '{@link cruise.umple.umple.ElementPosition_#getWidth_1 <em>Width 1</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Width 1</em>'.
* @see cruise.umple.umple.ElementPosition_#getWidth_1()
* @see #g... | Returns the meta object for the attribute '<code>cruise.umple.umple.ElementPosition_#getWidth_1 Width 1</code>'. | getElementPosition__Width_1 | {
"repo_name": "ahmedvc/umple",
"path": "cruise.umple.xtext/src-gen/cruise/umple/umple/UmplePackage.java",
"license": "mit",
"size": 485842
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 392,553 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.