method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
public void 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);
if (propValue == null) {
resource.addProperty(APIConstants.API_STATUS, apiStatus);
} else {
resource.setProperty(APIConstants.API_STATUS, apiStatus);
}
registry.put(artifactId, resource);
}
} catch (RegistryException e) {
handleException("Error while adding API", e);
}
} | 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, apiStatus); } else { resource.setProperty(APIConstants.API_STATUS, apiStatus); } registry.put(artifactId, resource); } } catch (RegistryException e) { handleException(STR, e); } } | /**
* 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.createSession.ise"),
maxActiveSessions);
}
// Recycle or create a Session instance
Session session = createEmptySession();
// Initialize the properties of the new session and return it
session.setNew(true);
session.setValid(true);
session.setCreationTime(System.currentTimeMillis());
session.setMaxInactiveInterval(this.maxInactiveInterval);
String id = sessionId;
if (id == null) {
id = generateSessionId();
}
session.setId(id);
sessionCounter++;
SessionTiming timing = new SessionTiming(session.getCreationTime(), 0);
synchronized (sessionCreationTiming) {
sessionCreationTiming.add(timing);
sessionCreationTiming.poll();
}
return (session);
}
| 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.setCreationTime(System.currentTimeMillis()); session.setMaxInactiveInterval(this.maxInactiveInterval); String id = sessionId; if (id == null) { id = generateSessionId(); } session.setId(id); sessionCounter++; SessionTiming timing = new SessionTiming(session.getCreationTime(), 0); synchronized (sessionCreationTiming) { sessionCreationTiming.add(timing); sessionCreationTiming.poll(); } return (session); } | /**
* 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 sessionId The session id which should be used to create the
* new session; if <code>null</code>, a new session id will be
* generated
* @exception IllegalStateException if a new session cannot be
* instantiated for any reason
*/ | 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 == Blocks.snow || block == Blocks.snow_layer));
}
return state;
} | 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, final boolean acceptValue) {
if (field == null)
throw new NullPointerException("field value is null");
this.field = field;
this.acceptValue = acceptValue;
} | 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.acceptValue = acceptValue; } | /**
* 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.
* @param status Http status returned to the client.
* @param handlerInfo Info on handler method that was called.
*/ | 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.debug("Client Error while getting scope existence of scope name " + name, e);
}
ScopeUtils.handleErrorResponse(Response.Status.BAD_REQUEST,
Response.Status.BAD_REQUEST.getReasonPhrase(), e, false, LOG);
} catch (IdentityOAuth2ScopeException e) {
ScopeUtils.handleErrorResponse(Response.Status.INTERNAL_SERVER_ERROR,
Response.Status.INTERNAL_SERVER_ERROR.getReasonPhrase(), e, true, LOG);
} catch (Throwable throwable) {
ScopeUtils.handleErrorResponse(Response.Status.INTERNAL_SERVER_ERROR,
Response.Status.INTERNAL_SERVER_ERROR.getReasonPhrase(), throwable, true, LOG);
}
if (isScopeExists) {
return Response.status(Response.Status.OK).build();
}
return Response.status(Response.Status.NOT_FOUND).build();
} | 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.Status.BAD_REQUEST.getReasonPhrase(), e, false, LOG); } catch (IdentityOAuth2ScopeException e) { ScopeUtils.handleErrorResponse(Response.Status.INTERNAL_SERVER_ERROR, Response.Status.INTERNAL_SERVER_ERROR.getReasonPhrase(), e, true, LOG); } catch (Throwable throwable) { ScopeUtils.handleErrorResponse(Response.Status.INTERNAL_SERVER_ERROR, Response.Status.INTERNAL_SERVER_ERROR.getReasonPhrase(), throwable, true, LOG); } if (isScopeExists) { return Response.status(Response.Status.OK).build(); } return Response.status(Response.Status.NOT_FOUND).build(); } | /**
* 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) ? _intentionArgs[0] : null;
final Object globalArg1 = (_intentionArgs != null) && (_intentionArgs.length > 1) ? _intentionArgs[1] : null;
// do nothing unless CAST intention
// however, forget interrupted actions when starting to use an offensive skill
if ((intention != AI_INTENTION_CAST) || ((Skill) args[0]).isBad())
{
_nextIntention = null;
super.changeIntention(intention, args);
return;
}
// do nothing if next intention is same as current one.
if ((intention == _intention) && (globalArg0 == localArg0) && (globalArg1 == localArg1))
{
super.changeIntention(intention, args);
return;
}
// save current intention so it can be used after cast
saveNextIntention(_intention, globalArg0, globalArg1);
super.changeIntention(intention, args);
}
| 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 globalArg1 = (_intentionArgs != null) && (_intentionArgs.length > 1) ? _intentionArgs[1] : null; if ((intention != AI_INTENTION_CAST) ((Skill) args[0]).isBad()) { _nextIntention = null; super.changeIntention(intention, args); return; } if ((intention == _intention) && (globalArg0 == localArg0) && (globalArg1 == localArg1)) { super.changeIntention(intention, args); return; } saveNextIntention(_intention, globalArg0, globalArg1); super.changeIntention(intention, args); } | /**
* 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 = res;
} | 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 totalApps = 0;
for (PlatformApplication app : sns.listPlatformApplications().getPlatformApplications()) {
AwsResource res = new AwsResource(app.getPlatformApplicationArn(), account.getAccountId(), AwsResourceType.SNS, region);
stats.add(res);
totalApps++;
}
LOG.info(totalApps + " SNS applications in region " + region.getName() + " in account " + account.getAccountId());
int totalSubscriptions = 0;
for (Subscription subscription : sns.listSubscriptions().getSubscriptions()) {
AwsResource res = new AwsResource(subscription.getSubscriptionArn(), account.getAccountId(), AwsResourceType.SNS, region);
res.addInfo(AwsTag.Owner, subscription.getOwner());
res.addInfo("Endpoint", subscription.getEndpoint());
res.addInfo("TopicArn", subscription.getTopicArn());
stats.add(res);
totalSubscriptions++;
}
LOG.info(totalSubscriptions + " SNS subscriptions in region " + region.getName() + " in account " + account.getAccountId());
} catch (AmazonServiceException ase) {
LOG.error("Exception of SNS: " + ase.getMessage());
} catch (Exception ex) {
LOG.error("Exception of SNS: " + ex.getMessage());
}
} | 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.listPlatformApplications().getPlatformApplications()) { AwsResource res = new AwsResource(app.getPlatformApplicationArn(), account.getAccountId(), AwsResourceType.SNS, region); stats.add(res); totalApps++; } LOG.info(totalApps + STR + region.getName() + STR + account.getAccountId()); int totalSubscriptions = 0; for (Subscription subscription : sns.listSubscriptions().getSubscriptions()) { AwsResource res = new AwsResource(subscription.getSubscriptionArn(), account.getAccountId(), AwsResourceType.SNS, region); res.addInfo(AwsTag.Owner, subscription.getOwner()); res.addInfo(STR, subscription.getEndpoint()); res.addInfo(STR, subscription.getTopicArn()); stats.add(res); totalSubscriptions++; } LOG.info(totalSubscriptions + STR + region.getName() + STR + account.getAccountId()); } catch (AmazonServiceException ase) { LOG.error(STR + ase.getMessage()); } catch (Exception ex) { LOG.error(STR + ex.getMessage()); } } | /**
* 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.zalando.platform.awsutilizationmonitor.api.AwsAccount",
"de.zalando.platform.awsutilizationmonitor.stats.AwsResource",
"de.zalando.platform.awsutilizationmonitor.stats.AwsResourceType",
"de.zalando.platform.awsutilizationmonitor.stats.AwsStats",
"de.zalando.platform.awsutilizationmonitor.stats.AwsTag"
] | 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.Subscription; import de.zalando.platform.awsutilizationmonitor.api.AwsAccount; import de.zalando.platform.awsutilizationmonitor.stats.AwsResource; import de.zalando.platform.awsutilizationmonitor.stats.AwsResourceType; import de.zalando.platform.awsutilizationmonitor.stats.AwsStats; import de.zalando.platform.awsutilizationmonitor.stats.AwsTag; | 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(component))
{
writeComponent(response, component.getAjaxRegionMarkupId(), component, encoding);
}
}
if (header != null)
{
// some header responses buffer all calls to render*** until close is called.
// when they are closed, they do something (i.e. aggregate all JS resource urls to a
// single url), and then "flush" (by writing to the real response) before closing.
// to support this, we need to allow header contributions to be written in the close
// tag, which we do here:
headerRendering = true;
// save old response, set new
Response oldResponse = RequestCycle.get().setResponse(encodingHeaderResponse);
encodingHeaderResponse.reset();
// now, close the response (which may render things)
header.getHeaderResponse().close();
// revert to old response
RequestCycle.get().setResponse(oldResponse);
// write the XML tags and we're done
writeHeaderContribution(response);
headerRendering = false;
}
} | 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.getAjaxRegionMarkupId(), component, encoding); } } if (header != null) { headerRendering = true; Response oldResponse = RequestCycle.get().setResponse(encodingHeaderResponse); encodingHeaderResponse.reset(); header.getHeaderResponse().close(); RequestCycle.get().setResponse(oldResponse); writeHeaderContribution(response); headerRendering = false; } } | /**
* 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 - (exclusive and optional)
* @param toCommitTime max ACL commit time - (exclusive and optional)
* @param maxResults limit the results. 0 or Integer.MAX_VALUE does not limit the results
* @return list of ACL changesets
*/ | 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 SuccessfulCacheableCommand<String>(circuitBreaker, true, "B");
SuccessfulCacheableCommand<String> command3 = new SuccessfulCacheableCommand<String>(circuitBreaker, true, "A");
assertTrue(command1.isCommandRunningInThread());
Future<String> f1 = command1.queue();
Future<String> f2 = command2.queue();
Future<String> f3 = command3.queue();
try {
assertEquals("A", f1.get());
assertEquals("B", f2.get());
assertEquals("A", f3.get());
} catch (Exception e) {
throw new RuntimeException(e);
}
assertTrue(command1.executed);
// both should execute as they are different
assertTrue(command2.executed);
// but the 3rd should come from cache
assertFalse(command3.executed);
// the execution log for command1 should show a SUCCESS
assertEquals(1, command1.getExecutionEvents().size());
assertTrue(command1.getExecutionEvents().contains(HystrixEventType.SUCCESS));
// the execution log for command2 should show a SUCCESS
assertEquals(1, command2.getExecutionEvents().size());
assertTrue(command2.getExecutionEvents().contains(HystrixEventType.SUCCESS));
// the execution log for command3 should show it came from cache
assertEquals(2, command3.getExecutionEvents().size()); // it will include the SUCCESS + RESPONSE_FROM_CACHE
assertTrue(command3.getExecutionEvents().contains(HystrixEventType.RESPONSE_FROM_CACHE));
assertTrue(command3.getExecutionTimeInMilliseconds() == -1);
assertTrue(command3.isResponseFromCache());
assertEquals(2, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.SUCCESS));
assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.EXCEPTION_THROWN));
assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.FAILURE));
assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.BAD_REQUEST));
assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.FALLBACK_REJECTION));
assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.FALLBACK_FAILURE));
assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.FALLBACK_SUCCESS));
assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.FALLBACK_MISSING));
assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.SEMAPHORE_REJECTED));
assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.SHORT_CIRCUITED));
assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.THREAD_POOL_REJECTED));
assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.TIMEOUT));
assertEquals(1, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.RESPONSE_FROM_CACHE));
assertEquals(0, circuitBreaker.metrics.getHealthCounts().getErrorPercentage());
assertEquals(0, circuitBreaker.metrics.getCurrentConcurrentExecutionCount());
assertSaneHystrixRequestLog(3);
} | void function() { TestCircuitBreaker circuitBreaker = new TestCircuitBreaker(); SuccessfulCacheableCommand<String> command1 = new SuccessfulCacheableCommand<String>(circuitBreaker, true, "A"); SuccessfulCacheableCommand<String> command2 = new SuccessfulCacheableCommand<String>(circuitBreaker, true, "B"); SuccessfulCacheableCommand<String> command3 = new SuccessfulCacheableCommand<String>(circuitBreaker, true, "A"); assertTrue(command1.isCommandRunningInThread()); Future<String> f1 = command1.queue(); Future<String> f2 = command2.queue(); Future<String> f3 = command3.queue(); try { assertEquals("A", f1.get()); assertEquals("B", f2.get()); assertEquals("A", f3.get()); } catch (Exception e) { throw new RuntimeException(e); } assertTrue(command1.executed); assertTrue(command2.executed); assertFalse(command3.executed); assertEquals(1, command1.getExecutionEvents().size()); assertTrue(command1.getExecutionEvents().contains(HystrixEventType.SUCCESS)); assertEquals(1, command2.getExecutionEvents().size()); assertTrue(command2.getExecutionEvents().contains(HystrixEventType.SUCCESS)); assertEquals(2, command3.getExecutionEvents().size()); assertTrue(command3.getExecutionEvents().contains(HystrixEventType.RESPONSE_FROM_CACHE)); assertTrue(command3.getExecutionTimeInMilliseconds() == -1); assertTrue(command3.isResponseFromCache()); assertEquals(2, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.SUCCESS)); assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.EXCEPTION_THROWN)); assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.FAILURE)); assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.BAD_REQUEST)); assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.FALLBACK_REJECTION)); assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.FALLBACK_FAILURE)); assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.FALLBACK_SUCCESS)); assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.FALLBACK_MISSING)); assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.SEMAPHORE_REJECTED)); assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.SHORT_CIRCUITED)); assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.THREAD_POOL_REJECTED)); assertEquals(0, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.TIMEOUT)); assertEquals(1, circuitBreaker.metrics.getRollingCount(HystrixRollingNumberEvent.RESPONSE_FROM_CACHE)); assertEquals(0, circuitBreaker.metrics.getHealthCounts().getErrorPercentage()); assertEquals(0, circuitBreaker.metrics.getCurrentConcurrentExecutionCount()); assertSaneHystrixRequestLog(3); } | /**
* 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 ByteArrayOutputStream();
try {
decoded.write(toBytes(source.substring(0, i)));
int len = source.length();
for (; i < len; i++) {
char ch = source.charAt(i);
if (ch == QUOTE_MARKER) {
if ((i + 2) >= len) {
ch = ENCODING_ERROR_MARKER;
} else {
try {
ch = (char) Integer.parseInt(source.substring(i + 1, i + 3), 16);
} catch (NumberFormatException nfe) {
// ch = ENCODING_ERROR_MARKER;
throw new URISyntaxException(source, "Invalid escape value");
}
decoded.write(ch);
}
i += 2;
} else {
decoded.write(ch);
}
}
return new String(decoded.toByteArray(), "UTF8");
} catch (IOException e) {
// should never get here.
e.printStackTrace();
return null;
}
} | 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(); for (; i < len; i++) { char ch = source.charAt(i); if (ch == QUOTE_MARKER) { if ((i + 2) >= len) { ch = ENCODING_ERROR_MARKER; } else { try { ch = (char) Integer.parseInt(source.substring(i + 1, i + 3), 16); } catch (NumberFormatException nfe) { throw new URISyntaxException(source, STR); } decoded.write(ch); } i += 2; } else { decoded.write(ch); } } return new String(decoded.toByteArray(), "UTF8"); } catch (IOException e) { e.printStackTrace(); return null; } } | /**
* 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 {
InetAddress destination = InetAddress.getByName(mDestination);
stream.setTimeToLive(mTimeToLive);
stream.setDestinationAddress(destination);
stream.start();
if (getTrack(1-id) == null || getTrack(1-id).isStreaming()) {
postSessionStarted();
}
if (getTrack(1-id) == null || !getTrack(1-id).isStreaming()) {
sHandler.post(mUpdateBitrate);
}
} catch (UnknownHostException e) {
postError(ERROR_UNKNOWN_HOST, id, e);
throw e;
} catch (CameraInUseException e) {
postError(ERROR_CAMERA_ALREADY_IN_USE , id, e);
throw e;
} catch (StorageUnavailableException e) {
postError(ERROR_STORAGE_NOT_READY , id, e);
throw e;
} catch (ConfNotSupportedException e) {
postError(ERROR_CONFIGURATION_NOT_SUPPORTED , id, e);
throw e;
} catch (InvalidSurfaceException e) {
postError(ERROR_INVALID_SURFACE , id, e);
throw e;
} catch (IOException e) {
postError(ERROR_OTHER, id, e);
throw e;
} catch (RuntimeException e) {
postError(ERROR_OTHER, id, e);
throw e;
}
}
} | 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(mDestination); stream.setTimeToLive(mTimeToLive); stream.setDestinationAddress(destination); stream.start(); if (getTrack(1-id) == null getTrack(1-id).isStreaming()) { postSessionStarted(); } if (getTrack(1-id) == null !getTrack(1-id).isStreaming()) { sHandler.post(mUpdateBitrate); } } catch (UnknownHostException e) { postError(ERROR_UNKNOWN_HOST, id, e); throw e; } catch (CameraInUseException e) { postError(ERROR_CAMERA_ALREADY_IN_USE , id, e); throw e; } catch (StorageUnavailableException e) { postError(ERROR_STORAGE_NOT_READY , id, e); throw e; } catch (ConfNotSupportedException e) { postError(ERROR_CONFIGURATION_NOT_SUPPORTED , id, e); throw e; } catch (InvalidSurfaceException e) { postError(ERROR_INVALID_SURFACE , id, e); throw e; } catch (IOException e) { postError(ERROR_OTHER, id, e); throw e; } catch (RuntimeException e) { postError(ERROR_OTHER, id, e); throw e; } } } | /**
* 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.UnknownHostException"
] | 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 java.net.UnknownHostException; | 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);
federationPolicyManager = (FederationPolicyManager) c.newInstance();
} catch (ClassNotFoundException e) {
throw new FederationPolicyInitializationException(e);
} catch (InstantiationException e) {
throw new FederationPolicyInitializationException(e);
} catch (IllegalAccessException e) {
throw new FederationPolicyInitializationException(e);
}
return federationPolicyManager;
} | 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 FederationPolicyInitializationException(e); } catch (InstantiationException e) { throw new FederationPolicyInitializationException(e); } catch (IllegalAccessException e) { throw new FederationPolicyInitializationException(e); } return federationPolicyManager; } | /**
* 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#partitionKeyForEntity(Object)}.
*
* @param key The key used to look up the partition.
* @param autoCreate If true, automatically creates the partition if it
* doesn't exist.
* @throws DatasetException
* @deprecated will be removed in 0.16.0; use {@link org.kitesdk.data.RefinableView} | 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)}. * * @param key The key used to look up the partition. * @param autoCreate If true, automatically creates the partition if it * doesn't exist. * @throws DatasetException * @deprecated will be removed in 0.16.0; use {@link org.kitesdk.data.RefinableView} | /**
* 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_ACTIVITY_TASK_ON_HOME);
for (int i = 1; i < intents.length; i++) {
intents[i] = new Intent(mIntents.get(i));
}
return intents;
} | 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++) { intents[i] = new Intent(mIntents.get(i)); } return intents; } | /**
* 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);
if (activityId != null) {
ActivityImpl activity = execution.getProcessDefinition().findActivity(activityId);
eventSubscriptionEntity.setActivity(activity);
}
eventSubscriptionEntity.insert();
LegacyBehavior.removeLegacySubscriptionOnParent(execution, eventSubscriptionEntity);
return eventSubscriptionEntity;
} | EventSubscriptionEntity function(ExecutionEntity execution) { EventSubscriptionEntity eventSubscriptionEntity = new EventSubscriptionEntity(execution, eventType); String eventName = resolveExpressionOfEventName(execution); eventSubscriptionEntity.setEventName(eventName); if (activityId != null) { ActivityImpl activity = execution.getProcessDefinition().findActivity(activityId); eventSubscriptionEntity.setActivity(activity); } eventSubscriptionEntity.insert(); LegacyBehavior.removeLegacySubscriptionOnParent(execution, eventSubscriptionEntity); return eventSubscriptionEntity; } | /**
* 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 IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of information from validate template deployment response.
*/ | 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.DeploymentValidateResultInner"
] | 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.models.DeploymentValidateResultInner; | 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 PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful.
*/ | 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;
//Insert a ControlShape and get the ControlModel
XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
4500, 15000, 10000,
"CommandButton");
WriterTools.getDrawPage(xTextDoc).add(aShape);
XControlModel the_Model = aShape.getControl();
//Try to query XControlAccess
XControlAccess the_access = UnoRuntime.queryInterface(
XControlAccess.class,
xTextDoc.getCurrentController());
XController cntrlr = UnoRuntime.queryInterface(
XController.class,
xTextDoc.getCurrentController());
//now get the toolkit
win = cntrlr.getFrame().getContainerWindow();
the_win = the_access.getControl(the_Model).getPeer();
oObj = (XInterface) Param.getMSF().createInstance(
"com.sun.star.awt.Toolkit");
XModel xModel = UnoRuntime.queryInterface(XModel.class, xTextDoc);
log.println(" creating a new environment for toolkit object");
TestEnvironment tEnv = new TestEnvironment(oObj);
log.println("Implementation Name: " + utils.getImplName(oObj));
tEnv.addObjRelation("WINPEER", the_win);
tEnv.addObjRelation("XModel", xModel);
// adding relation for XDataTransferProviderAccess
tEnv.addObjRelation("XDataTransferProviderAccess.XWindow", win);
return tEnv;
} // finish method getTestEnvironment | 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 = aShape.getControl(); XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); XController cntrlr = UnoRuntime.queryInterface( XController.class, xTextDoc.getCurrentController()); win = cntrlr.getFrame().getContainerWindow(); the_win = the_access.getControl(the_Model).getPeer(); oObj = (XInterface) Param.getMSF().createInstance( STR); XModel xModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); log.println(STR); TestEnvironment tEnv = new TestEnvironment(oObj); log.println(STR + utils.getImplName(oObj)); tEnv.addObjRelation(STR, the_win); tEnv.addObjRelation(STR, xModel); tEnv.addObjRelation(STR, win); return tEnv; } | /**
* 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.io.PrintWriter"
] | 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.view.XControlAccess; import java.io.PrintWriter; | 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();
} else {
// TODO Toast.makeText( );
}
} | 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.UP;
}
if (yaw < 45)
return ForgeDirection.SOUTH;
else if (yaw < 135)
return ForgeDirection.WEST;
else if (yaw < 225)
return ForgeDirection.NORTH;
else if (yaw < 315)
return ForgeDirection.EAST;
else
return ForgeDirection.SOUTH;
} | 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; else if (yaw < 225) return ForgeDirection.NORTH; else if (yaw < 315) return ForgeDirection.EAST; else return ForgeDirection.SOUTH; } | /**
* 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;
// And get ready for the next transformation.
this.startDocumentReceived = false;
}
return result;
} | @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 was returned.
*/ | 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("[ServiceDispatcher.getInstance] : No instance found (" + dispatcherKey + ").", module);
sd = new ServiceDispatcher(delegator);
ServiceDispatcher cachedDispatcher = dispatchers.putIfAbsent(dispatcherKey, sd);
if (cachedDispatcher == null) {
// if the cachedDispatcher is null, then it means that
// the new dispatcher created by this thread was successfully added to the cache
// only in this case, the thread runs runStartupServices
sd.runStartupServices();
cachedDispatcher = sd;
}
sd = cachedDispatcher;
}
return sd;
} | 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(delegator); ServiceDispatcher cachedDispatcher = dispatchers.putIfAbsent(dispatcherKey, sd); if (cachedDispatcher == null) { sd.runStartupServices(); cachedDispatcher = sd; } sd = cachedDispatcher; } return sd; } | /**
* 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 this is our own reward drop
}
else if (pDrop instanceof CritterControlDrop) {
// This could be use to add motor costs to the reward function
}
} | 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);
}
linkElement = m_element.element(CmsXmlPage.NODE_LINK);
if (linkElement == null) {
return null;
}
}
CmsLinkUpdateUtil.updateType(linkElement, getContentDefinition().getContentHandler().getRelationType(getPath()));
CmsLink link = new CmsLink(linkElement);
link.checkConsistency(cms);
if (CmsStringUtil.isEmptyOrWhitespaceOnly(link.getTarget())) {
return null;
}
return link;
} | 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) { return null; } } CmsLinkUpdateUtil.updateType(linkElement, getContentDefinition().getContentHandler().getRelationType(getPath())); CmsLink link = new CmsLink(linkElement); link.checkConsistency(cms); if (CmsStringUtil.isEmptyOrWhitespaceOnly(link.getTarget())) { return null; } return link; } | /**
* 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 AES & HMAC keys with which to encrypt
* @return a tuple of the IV, ciphertext, mac
* @throws GeneralSecurityException if AES is not implemented on this system
* @throws UnsupportedEncodingException if UTF-8 is not supported in this system
*/ | 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("\\|");
for (String sa : splitAttributes) {
sa = sa.trim();
if (sa.equals("ReadOnly")) {
attributes.add(NtfsFileAttributes.READ_ONLY);
} else if (sa.equals("Hidden")) {
attributes.add(NtfsFileAttributes.HIDDEN);
} else if (sa.equals("System")) {
attributes.add(NtfsFileAttributes.SYSTEM);
} else if (sa.equals("None")) {
attributes.add(NtfsFileAttributes.NORMAL);
} else if (sa.equals("Directory")) {
attributes.add(NtfsFileAttributes.DIRECTORY);
} else if (sa.equals("Archive")) {
attributes.add(NtfsFileAttributes.ARCHIVE);
} else if (sa.equals("Temporary")) {
attributes.add(NtfsFileAttributes.TEMPORARY);
} else if (sa.equals("Offline")) {
attributes.add(NtfsFileAttributes.OFFLINE);
} else if (sa.equals("NotContentIndexed")) {
attributes.add(NtfsFileAttributes.NOT_CONTENT_INDEXED);
} else if (sa.equals("NoScrubData")) {
attributes.add(NtfsFileAttributes.NO_SCRUB_DATA);
} else {
throw new IllegalArgumentException("FileAttribute '" + sa + "' not recognized.");
}
}
return attributes;
} | 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)) { attributes.add(NtfsFileAttributes.READ_ONLY); } else if (sa.equals(STR)) { attributes.add(NtfsFileAttributes.HIDDEN); } else if (sa.equals(STR)) { attributes.add(NtfsFileAttributes.SYSTEM); } else if (sa.equals("None")) { attributes.add(NtfsFileAttributes.NORMAL); } else if (sa.equals(STR)) { attributes.add(NtfsFileAttributes.DIRECTORY); } else if (sa.equals(STR)) { attributes.add(NtfsFileAttributes.ARCHIVE); } else if (sa.equals(STR)) { attributes.add(NtfsFileAttributes.TEMPORARY); } else if (sa.equals(STR)) { attributes.add(NtfsFileAttributes.OFFLINE); } else if (sa.equals(STR)) { attributes.add(NtfsFileAttributes.NOT_CONTENT_INDEXED); } else if (sa.equals(STR)) { attributes.add(NtfsFileAttributes.NO_SCRUB_DATA); } else { throw new IllegalArgumentException(STR + sa + STR); } } return attributes; } | /**
* 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><code>ReadOnly</code></li>
* <li><code>Hidden</code></li>
* <li><code>System</code></li>
* <li><code>None</code></li>
* <li><code>Directory</code></li>
* <li><code>Archive</code></li>
* <li><code>Temporary</code></li>
* <li><code>Offline</code></li>
* <li><code>NotContentIndexed</code></li>
* <li><code>NoScrubData</code></li>
* </ul>
* @return A set of {@link NtfsFileAttributes} that were contained in the passed string.
* @throws IllegalArgumentException If {@code ntfsAttributes} contains an attribute that is unknown.
*/ | 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 List<DatanodeStorageInfo> storages = rackMap.get(rack);
storages.remove(cur);
if (storages.isEmpty()) {
rackMap.remove(rack);
}
if (moreThanOne.remove(cur)) {
if (storages.size() == 1) {
final DatanodeStorageInfo remaining = storages.get(0);
moreThanOne.remove(remaining);
exactlyOne.add(remaining);
}
} else {
exactlyOne.remove(cur);
}
} | 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.remove(cur); if (storages.isEmpty()) { rackMap.remove(rack); } if (moreThanOne.remove(cur)) { if (storages.size() == 1) { final DatanodeStorageInfo remaining = storages.get(0); moreThanOne.remove(remaining); exactlyOne.add(remaining); } } else { exactlyOne.remove(cur); } } | /**
* 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
* @param cur current replica to remove
*/ | 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,
String delegateServiceSpn,
Subject delegateServiceSubject) throws GSSException; | 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 SPNEGO token will be targeted.
* @param gssNameType - GSSName type.
* @param gssCredUsage - GSSCredential usage.
* @param delegateServiceSpn - Delegate service principal name of the delegate service.
* @param delegateServiceSubject - Delegate service subject that have the delegate SPN Kerberos ticket granting ticket (TGT).
* @throws GSSException - thrown when SPNEGO token generation fails, when delegateServiceSpnSubject is null, when the delegateServiceSpnSubject
* does not contain the delegate service SPN TGT, when upn or targetServiceSpn are invalid.
*/ | 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 (SearchResult searchResult : searchResults) {
RoomState roomState = null;
if (null != mRoom) {
roomState = mRoom.getState();
}
if (null == roomState) {
Room room = mSession.getDataHandler().getStore().getRoom(searchResult.result.roomId);
if (null != room) {
roomState = room.getState();
}
}
boolean isValidMessage = false;
if ((null != searchResult.result) && (null != searchResult.result.getContent())) {
JsonObject object = searchResult.result.getContentAsJsonObject();
if (null != object) {
isValidMessage = (0 != object.entrySet().size());
}
}
if (isValidMessage) {
messageRows.add(new MessageRow(searchResult.result, roomState));
}
}
Collections.reverse(messageRows);
mAdapter.clear();
mAdapter.addAll(messageRows);
mNextBatch = searchResponse.searchCategories.roomEvents.nextBatch;
if (null != onSearchResultListener) {
try {
onSearchResultListener.onSearchSucceed(messageRows.size());
} catch (Exception e) {
Log.e(LOG_TAG, "onSearchResponse failed with " + e.getMessage(), e);
}
}
} | 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) { RoomState roomState = null; if (null != mRoom) { roomState = mRoom.getState(); } if (null == roomState) { Room room = mSession.getDataHandler().getStore().getRoom(searchResult.result.roomId); if (null != room) { roomState = room.getState(); } } boolean isValidMessage = false; if ((null != searchResult.result) && (null != searchResult.result.getContent())) { JsonObject object = searchResult.result.getContentAsJsonObject(); if (null != object) { isValidMessage = (0 != object.entrySet().size()); } } if (isValidMessage) { messageRows.add(new MessageRow(searchResult.result, roomState)); } } Collections.reverse(messageRows); mAdapter.clear(); mAdapter.addAll(messageRows); mNextBatch = searchResponse.searchCategories.roomEvents.nextBatch; if (null != onSearchResultListener) { try { onSearchResultListener.onSearchSucceed(messageRows.size()); } catch (Exception e) { Log.e(LOG_TAG, STR + e.getMessage(), e); } } } | /**
* 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.SearchResponse",
"org.matrix.androidsdk.rest.model.search.SearchResult"
] | 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.rest.model.search.SearchResponse; import org.matrix.androidsdk.rest.model.search.SearchResult; | 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 instance to use when this target is selected
*/ | 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 innerQueueAndItems = createInnerQueueAndItems(key);
DelayingSegment queueItems = innerQueueAndItems.queueItems;
if (queueItems.isDelayQueueEmpty()) {
return new ResultOfMovingFromDelayToWaitingQueue(false);
}
long queueDelay = queueItems.moveFromDealyQueueIntoWaitingQueueAndReturnDelayTime();
setDatatToInnerQueueToQueue(key, queueItems, innerQueueAndItems.innerQueues);
return new ResultOfMovingFromDelayToWaitingQueue(true, queueDelay);
} | ResultOfMovingFromDelayToWaitingQueue function( long fromByNdoeId, long toByNodeId, GraphType graphType) { GraphTypeFromToNodeKey key = createGraphTypeFromToNodeKey(graphType, fromByNdoeId, toByNodeId); InnerQueueAndItems innerQueueAndItems = createInnerQueueAndItems(key); DelayingSegment queueItems = innerQueueAndItems.queueItems; if (queueItems.isDelayQueueEmpty()) { return new ResultOfMovingFromDelayToWaitingQueue(false); } long queueDelay = queueItems.moveFromDealyQueueIntoWaitingQueueAndReturnDelayTime(); setDatatToInnerQueueToQueue(key, queueItems, innerQueueAndItems.innerQueues); return new ResultOfMovingFromDelayToWaitingQueue(true, queueDelay); } | /**
* 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("{}Discovering all '{}' devices.", localDevice.toString(), ids.toString());
return nodeDiscovery.discoverDevices(ids);
}
| 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 the
* {@link #setDiscoveryOptions(Set)} method.</p>
*
* @param ids List which contains the identifiers of the devices to be
* discovered.
*
* @return A list of the discovered remote XBee devices with the given
* identifiers.
*
* @throws IllegalArgumentException if {@code ids.size() == 0}.
* @throws InterfaceNotOpenException if the device is not open.
* @throws NullPointerException if {@code ids == null}.
* @throws XBeeException if there is an error discovering the devices.
*
* @see #discoverDevice(String)
* @see RemoteXBeeDevice
*/ | 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> method | 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;
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) slctedPath.getLastPathComponent();
Container parentC = e.getComponent().getParent();
while ( !(parentC instanceof MappingMainPanel))
{
parentC=parentC.getParent();
}
// Create PopupMenu for the Cell
if((!treeNode.isRoot()&& treeNode.getChildCount()>0)||(treeNode.isRoot()&& !(treeNode.getLeafCount()>4)))
{
JPopupMenu menu = createTreePopupMenu(treeNode, slctTree, (MappingMainPanel)parentC);
menu.show(e.getComponent(), e.getX(), e.getY());
}
}
}
| 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().getParent(); while ( !(parentC instanceof MappingMainPanel)) { parentC=parentC.getParent(); } if((!treeNode.isRoot()&& treeNode.getChildCount()>0) (treeNode.isRoot()&& !(treeNode.getLeafCount()>4))) { JPopupMenu menu = createTreePopupMenu(treeNode, slctTree, (MappingMainPanel)parentC); menu.show(e.getComponent(), e.getX(), e.getY()); } } } | /**
* 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(
getFirstObject(sinkCall.getOutgoingEntry())));
} | @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));
cache0.put(1, new TestValue2("value"));
stopAllGrids();
startGrids(2);
ignite0 = grid(0);
ignite0.active(true);
examineStaticMetadata(2);
startGrid(2);
startGrid(3);
awaitPartitionMapExchange();
examineStaticMetadata(4);
} | 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(true); examineStaticMetadata(2); startGrid(2); startGrid(3); awaitPartitionMapExchange(); examineStaticMetadata(4); } | /**
* 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> metaDataMap =
FieldMetaData.getStructMetaDataMap((Class<? extends TBase<?, ?>>) clazz);
for (Entry<? extends TFieldIdEnum, FieldMetaData> e : metaDataMap.entrySet()) {
final String fieldName = e.getKey().getFieldName();
final FieldMetaData metaData = e.getValue();
final FieldValueMetaData elementMetaData;
if (metaData.valueMetaData.isContainer()) {
if (metaData.valueMetaData instanceof SetMetaData) {
elementMetaData = ((SetMetaData) metaData.valueMetaData).elemMetaData;
} else if (metaData.valueMetaData instanceof ListMetaData) {
elementMetaData = ((ListMetaData) metaData.valueMetaData).elemMetaData;
} else if (metaData.valueMetaData instanceof MapMetaData) {
elementMetaData = ((MapMetaData) metaData.valueMetaData).valueMetaData;
} else {
// Unrecognized container type, but let's still continue processing without
// special enum support.
elementMetaData = metaData.valueMetaData;
}
} else {
elementMetaData = metaData.valueMetaData;
}
if (elementMetaData instanceof EnumMetaData) {
classMap.put(fieldName, ((EnumMetaData) elementMetaData).enumClass);
} else if (elementMetaData instanceof StructMetaData) {
classMap.put(fieldName, ((StructMetaData) elementMetaData).structClass);
} else {
// Workaround a bug where the generated 'FieldMetaData' does not provide
// a fully qualified class name.
final String typedefName = elementMetaData.getTypedefName();
if (typedefName != null) {
final String fqcn = clazz.getPackage().getName() + '.' + typedefName;
Class<?> fieldClass = fieldMetaDataClassCache.get(fqcn);
if (fieldClass == null) {
fieldClass = fieldMetaDataClassCache.computeIfAbsent(fqcn, key -> {
try {
return Class.forName(key);
} catch (ClassNotFoundException ignored) {
return StructContext.class;
}
});
}
if (fieldClass != StructContext.class) {
classMap.put(fieldName, fieldClass);
}
}
}
// Workaround a bug in the generated thrift message read()
// method by mapping the ENUM type to the INT32 type
// The thrift generated parsing code requires that, when expecting
// a value of enum, we actually parse a value of type int32. The
// generated read() method then looks up the enum value in a map.
final byte type = TType.ENUM == metaData.valueMetaData.type ? TType.I32
: metaData.valueMetaData.type;
map.put(fieldName,
new TField(fieldName,
type,
e.getKey().getThriftFieldId()));
}
} else { // TApplicationException
map.put("message", new TField("message", (byte)11, (short)1));
map.put("type", new TField("type", (byte)8, (short)2));
}
return map;
} | 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, FieldMetaData> e : metaDataMap.entrySet()) { final String fieldName = e.getKey().getFieldName(); final FieldMetaData metaData = e.getValue(); final FieldValueMetaData elementMetaData; if (metaData.valueMetaData.isContainer()) { if (metaData.valueMetaData instanceof SetMetaData) { elementMetaData = ((SetMetaData) metaData.valueMetaData).elemMetaData; } else if (metaData.valueMetaData instanceof ListMetaData) { elementMetaData = ((ListMetaData) metaData.valueMetaData).elemMetaData; } else if (metaData.valueMetaData instanceof MapMetaData) { elementMetaData = ((MapMetaData) metaData.valueMetaData).valueMetaData; } else { elementMetaData = metaData.valueMetaData; } } else { elementMetaData = metaData.valueMetaData; } if (elementMetaData instanceof EnumMetaData) { classMap.put(fieldName, ((EnumMetaData) elementMetaData).enumClass); } else if (elementMetaData instanceof StructMetaData) { classMap.put(fieldName, ((StructMetaData) elementMetaData).structClass); } else { final String typedefName = elementMetaData.getTypedefName(); if (typedefName != null) { final String fqcn = clazz.getPackage().getName() + '.' + typedefName; Class<?> fieldClass = fieldMetaDataClassCache.get(fqcn); if (fieldClass == null) { fieldClass = fieldMetaDataClassCache.computeIfAbsent(fqcn, key -> { try { return Class.forName(key); } catch (ClassNotFoundException ignored) { return StructContext.class; } }); } if (fieldClass != StructContext.class) { classMap.put(fieldName, fieldClass); } } } final byte type = TType.ENUM == metaData.valueMetaData.type ? TType.I32 : metaData.valueMetaData.type; map.put(fieldName, new TField(fieldName, type, e.getKey().getThriftFieldId())); } } else { map.put(STR, new TField(STR, (byte)11, (short)1)); map.put("type", new TField("type", (byte)8, (short)2)); } return map; } | /**
* 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.meta_data.MapMetaData",
"org.apache.thrift.meta_data.SetMetaData",
"org.apache.thrift.meta_data.StructMetaData",
"org.apache.thrift.protocol.TField",
"org.apache.thrift.protocol.TType"
] | 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 org.apache.thrift.meta_data.MapMetaData; import org.apache.thrift.meta_data.SetMetaData; import org.apache.thrift.meta_data.StructMetaData; import org.apache.thrift.protocol.TField; import org.apache.thrift.protocol.TType; | 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 {
try (PrintStream psPass = new PrintStream(Files.newOutputStream(tempPgPassFile))) {
psPass.printf("%s:%s:%s:%s:%s%n", TestUtil.getServer(), TestUtil.getPort(), TestUtil.getDatabase(), TestUtil.getUser(), TestUtil.getPassword());
}
// ignore pg_service.conf, use .pgpass
Resources.with(
new EnvironmentVariables(PGEnvironment.PGSERVICEFILE.getName(), "", PGEnvironment.PGSYSCONFDIR.getName(), ""),
new SystemProperties(PGEnvironment.ORG_POSTGRESQL_PGSERVICEFILE.getName(), "", "user.home", "/tmp/dir-non-existent",
PGEnvironment.ORG_POSTGRESQL_PGPASSFILE.getName(), tempPgPassFile.toString())
).execute(() -> {
// password from .pgpass (correct)
Connection con = DriverManager.getConnection(String.format("jdbc:postgresql://%s:%s/%s?user=%s", TestUtil.getServer(), TestUtil.getPort(), TestUtil.getDatabase(), TestUtil.getUser()));
assertNotNull(con);
con.close();
});
} finally {
// cleanup
Files.delete(tempPgPassFile);
Files.delete(tempDirWithPrefix);
}
} | 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.getServer(), TestUtil.getPort(), TestUtil.getDatabase(), TestUtil.getUser(), TestUtil.getPassword()); } Resources.with( new EnvironmentVariables(PGEnvironment.PGSERVICEFILE.getName(), STRSTRSTRuser.homeSTR/tmp/dir-non-existentSTRjdbc:postgresql: assertNotNull(con); con.close(); }); } finally { Files.delete(tempPgPassFile); Files.delete(tempDirWithPrefix); } } | /**
* 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 Nation sectorOwner = getSectorOwner(thisSector);
// check if this is the owner of the sector.
return ((sectorOwner.getId() == NATION_NEUTRAL) && (thisSector.getTerrain().getId() != TERRAIN_O));
} | 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_O)); } | /**
* 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 be null");
}
final ItemHolder<ReifiedStatement, SecuredReifiedStatement> holder = new ItemHolder<ReifiedStatement, SecuredReifiedStatement>(
stmt);
final SecuredReifiedStatementImpl checker = new SecuredReifiedStatementImpl(
securedModel, holder);
// if we are going to create a duplicate proxy, just return this
// one.
if (stmt instanceof SecuredReifiedStatement) {
if (checker.isEquivalent((SecuredReifiedStatement) stmt)) {
return (SecuredReifiedStatement) stmt;
}
}
return holder.setSecuredItem(new SecuredItemInvoker(stmt.getClass(),
checker));
}
// the item holder that contains this SecuredResource
private final ItemHolder<? extends ReifiedStatement, ? extends SecuredReifiedStatement> holder;
protected SecuredReifiedStatementImpl(
final SecuredModel securedModel,
final ItemHolder<? extends ReifiedStatement, ? extends SecuredReifiedStatement> holder) {
super(securedModel, holder);
this.holder = holder;
} | 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 ItemHolder<ReifiedStatement, SecuredReifiedStatement>( stmt); final SecuredReifiedStatementImpl checker = new SecuredReifiedStatementImpl( securedModel, holder); if (stmt instanceof SecuredReifiedStatement) { if (checker.isEquivalent((SecuredReifiedStatement) stmt)) { return (SecuredReifiedStatement) stmt; } } return holder.setSecuredItem(new SecuredItemInvoker(stmt.getClass(), checker)); } private final ItemHolder<? extends ReifiedStatement, ? extends SecuredReifiedStatement> holder; protected SecuredReifiedStatementImpl( final SecuredModel securedModel, final ItemHolder<? extends ReifiedStatement, ? extends SecuredReifiedStatement> holder) { super(securedModel, holder); this.holder = holder; } | /**
* 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 doc = xmlPlatform.createDocument();
XMLMarshaller marshaller = xrService.getXMLContext().createMarshaller();
marshaller.marshal(result, doc);
Document controlDoc = xmlParser.parse(new StringReader(NULL_RESULT_XML));
assertTrue("Expected:\n" + documentToString(controlDoc) + "\nActual:\n" + documentToString(doc), comparer.isNodeEqual(controlDoc, doc));
} | 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(); marshaller.marshal(result, doc); Document controlDoc = xmlParser.parse(new StringReader(NULL_RESULT_XML)); assertTrue(STR + documentToString(controlDoc) + STR + documentToString(doc), comparer.isNodeEqual(controlDoc, doc)); } | /**
* 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(workflowQuery.getName());
toSave.setDescription(workflowQuery.getDescription());
SrampModelUtils.setCustomProperty(toSave, DtgovModel.CUSTOM_PROPERTY_QUERY, workflowQuery.getQuery());
SrampModelUtils.setCustomProperty(toSave, DtgovModel.CUSTOM_PROPERTY_WORKFLOW, workflowQuery.getWorkflow());
GregorianCalendar gcal = new GregorianCalendar();
gcal.setTime(new Date());
try {
XMLGregorianCalendar xmlCal = DatatypeFactory.newInstance().newXMLGregorianCalendar(gcal);
toSave.setCreatedTimestamp(xmlCal);
} catch (DatatypeConfigurationException ee) {
throw new RuntimeException(ee);
}
for (WorkflowQueryProperty property : workflowQuery.getProperties()) {
SrampModelUtils.setCustomProperty(toSave, "prop." + property.getKey(), property.getValue()); //$NON-NLS-1$
}
return toSave;
} | 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(workflowQuery.getDescription()); SrampModelUtils.setCustomProperty(toSave, DtgovModel.CUSTOM_PROPERTY_QUERY, workflowQuery.getQuery()); SrampModelUtils.setCustomProperty(toSave, DtgovModel.CUSTOM_PROPERTY_WORKFLOW, workflowQuery.getWorkflow()); GregorianCalendar gcal = new GregorianCalendar(); gcal.setTime(new Date()); try { XMLGregorianCalendar xmlCal = DatatypeFactory.newInstance().newXMLGregorianCalendar(gcal); toSave.setCreatedTimestamp(xmlCal); } catch (DatatypeConfigurationException ee) { throw new RuntimeException(ee); } for (WorkflowQueryProperty property : workflowQuery.getProperties()) { SrampModelUtils.setCustomProperty(toSave, "prop." + property.getKey(), property.getValue()); } return toSave; } | /**
* 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",
"org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ExtendedArtifactType",
"org.overlord.dtgov.common.model.DtgovModel",
"org.overlord.dtgov.ui.client.shared.beans.WorkflowQueryBean",
"org.overlord.dtgov.ui.client.shared.beans.WorkflowQueryProperty",
"org.overlord.sramp.common.SrampModelUtils"
] | 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.BaseArtifactType; import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ExtendedArtifactType; import org.overlord.dtgov.common.model.DtgovModel; import org.overlord.dtgov.ui.client.shared.beans.WorkflowQueryBean; import org.overlord.dtgov.ui.client.shared.beans.WorkflowQueryProperty; import org.overlord.sramp.common.SrampModelUtils; | 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:
t = Opcodes.FLOAT;
break;
case Type.LONG:
t = Opcodes.LONG;
break;
case Type.DOUBLE:
t = Opcodes.DOUBLE;
break;
case Type.ARRAY:
t = type.getDescriptor();
break;
// case Type.OBJECT:
default:
t = type.getInternalName();
break;
}
int local = newLocalMapping(type);
setFrameLocal(local, t);
changed = true;
local = -local;
visitVarInsn(type.getOpcode(Opcodes.ISTORE), local);
return local;
} | 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.ARRAY: t = type.getDescriptor(); break; default: t = type.getInternalName(); break; } int local = newLocalMapping(type); setFrameLocal(local, t); changed = true; local = -local; visitVarInsn(type.getOpcode(Opcodes.ISTORE), local); return local; } | /**
* 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) = the real var index
*/ | 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 corresponding sound model ID for the keyphrase.
String selectQuery = "SELECT * FROM " + SoundModelContract.TABLE
+ " WHERE " + SoundModelContract.KEY_KEYPHRASE_ID + "= '" + keyphraseId
+ "' AND " + SoundModelContract.KEY_LOCALE + "='" + bcp47Locale + "'";
SQLiteDatabase db = getReadableDatabase();
Cursor c = db.rawQuery(selectQuery, null);
try {
if (c.moveToFirst()) {
do {
int type = c.getInt(c.getColumnIndex(SoundModelContract.KEY_TYPE));
if (type != SoundTrigger.SoundModel.TYPE_KEYPHRASE) {
if (DBG) {
Slog.w(TAG, "Ignoring SoundModel since it's type is incorrect");
}
continue;
}
String modelUuid = c.getString(
c.getColumnIndex(SoundModelContract.KEY_MODEL_UUID));
if (modelUuid == null) {
Slog.w(TAG, "Ignoring SoundModel since it doesn't specify an ID");
continue;
}
byte[] data = c.getBlob(c.getColumnIndex(SoundModelContract.KEY_DATA));
int recognitionModes = c.getInt(
c.getColumnIndex(SoundModelContract.KEY_RECOGNITION_MODES));
int[] users = getArrayForCommaSeparatedString(
c.getString(c.getColumnIndex(SoundModelContract.KEY_USERS)));
String modelLocale = c.getString(
c.getColumnIndex(SoundModelContract.KEY_LOCALE));
String text = c.getString(
c.getColumnIndex(SoundModelContract.KEY_HINT_TEXT));
// Only add keyphrases meant for the current user.
if (users == null) {
// No users present in the keyphrase.
Slog.w(TAG, "Ignoring SoundModel since it doesn't specify users");
continue;
}
boolean isAvailableForCurrentUser = false;
for (int user : users) {
if (userHandle == user) {
isAvailableForCurrentUser = true;
break;
}
}
if (!isAvailableForCurrentUser) {
if (DBG) {
Slog.w(TAG, "Ignoring SoundModel since user handles don't match");
}
continue;
} else {
if (DBG) Slog.d(TAG, "Found a SoundModel for user: " + userHandle);
}
Keyphrase[] keyphrases = new Keyphrase[1];
keyphrases[0] = new Keyphrase(
keyphraseId, recognitionModes, modelLocale, text, users);
KeyphraseSoundModel model = new KeyphraseSoundModel(
UUID.fromString(modelUuid),
null , data, keyphrases);
if (DBG) {
Slog.d(TAG, "Found SoundModel for the given keyphrase/locale/user: "
+ model);
}
return model;
} while (c.moveToNext());
}
Slog.w(TAG, "No SoundModel available for the given keyphrase");
} finally {
c.close();
db.close();
}
return null;
}
} | 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_LOCALE + "='" + bcp47Locale + "'"; SQLiteDatabase db = getReadableDatabase(); Cursor c = db.rawQuery(selectQuery, null); try { if (c.moveToFirst()) { do { int type = c.getInt(c.getColumnIndex(SoundModelContract.KEY_TYPE)); if (type != SoundTrigger.SoundModel.TYPE_KEYPHRASE) { if (DBG) { Slog.w(TAG, STR); } continue; } String modelUuid = c.getString( c.getColumnIndex(SoundModelContract.KEY_MODEL_UUID)); if (modelUuid == null) { Slog.w(TAG, STR); continue; } byte[] data = c.getBlob(c.getColumnIndex(SoundModelContract.KEY_DATA)); int recognitionModes = c.getInt( c.getColumnIndex(SoundModelContract.KEY_RECOGNITION_MODES)); int[] users = getArrayForCommaSeparatedString( c.getString(c.getColumnIndex(SoundModelContract.KEY_USERS))); String modelLocale = c.getString( c.getColumnIndex(SoundModelContract.KEY_LOCALE)); String text = c.getString( c.getColumnIndex(SoundModelContract.KEY_HINT_TEXT)); if (users == null) { Slog.w(TAG, STR); continue; } boolean isAvailableForCurrentUser = false; for (int user : users) { if (userHandle == user) { isAvailableForCurrentUser = true; break; } } if (!isAvailableForCurrentUser) { if (DBG) { Slog.w(TAG, STR); } continue; } else { if (DBG) Slog.d(TAG, STR + userHandle); } Keyphrase[] keyphrases = new Keyphrase[1]; keyphrases[0] = new Keyphrase( keyphraseId, recognitionModes, modelLocale, text, users); KeyphraseSoundModel model = new KeyphraseSoundModel( UUID.fromString(modelUuid), null , data, keyphrases); if (DBG) { Slog.d(TAG, STR + model); } return model; } while (c.moveToNext()); } Slog.w(TAG, STR); } finally { c.close(); db.close(); } return null; } } | /**
* 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:
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 (HardwareInterfaceException e) {
log.warning(e.toString()+": LED control request ignored. Probably your DVS128 firmware version is too old; LED control was added at revision 12. See \\devices\\firmware\\CypressFX2\\firmware_FX2LP_DVS128\\CHANGELOG.txt");
}
} | 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 (HardwareInterfaceException e) { log.warning(e.toString()+STR); } } | /** 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 verb = "POST";
Class<?> clz = com.mozu.api.contracts.commerceruntime.returns.ReturnCollection.class;
MozuClient<com.mozu.api.contracts.commerceruntime.returns.ReturnCollection> mozuClient = new MozuClient(clz);
mozuClient.setVerb(verb);
mozuClient.setResourceUrl(url);
mozuClient.setBody(action);
if (authTicket != null)
mozuClient.setUserAuth(authTicket);
return mozuClient;
} | 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.mozu.api.contracts.commerceruntime.returns.ReturnCollection.class; MozuClient<com.mozu.api.contracts.commerceruntime.returns.ReturnCollection> mozuClient = new MozuClient(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.setBody(action); if (authTicket != null) mozuClient.setUserAuth(authTicket); return mozuClient; } | /**
* 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 = client.Result();
* </code></pre></p>
* @param authTicket User Auth Ticket
* @param action The name of the return action to perform, such as "Refund" or "Replace".
* @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.returns.ReturnCollection>
* @see com.mozu.api.contracts.commerceruntime.returns.ReturnCollection
* @see com.mozu.api.contracts.commerceruntime.returns.ReturnAction
*/ | 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> anotherSchoolSubjects = another.getSchoolSubjects();
return schoolClasses.size() == anotherSchoolClasses.size() && schoolClasses.containsAll(anotherSchoolClasses) && schoolTeachers.size() == anotherSchoolTeachers.size() && schoolTeachers.containsAll(anotherSchoolTeachers) && schoolRooms.size() == anotherSchoolRooms.size() && schoolRooms.containsAll(anotherSchoolRooms) && schoolSubjects.size() == anotherSchoolSubjects.size() && schoolSubjects.containsAll(anotherSchoolSubjects);
}
return false;
}
| 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.getSchoolSubjects(); return schoolClasses.size() == anotherSchoolClasses.size() && schoolClasses.containsAll(anotherSchoolClasses) && schoolTeachers.size() == anotherSchoolTeachers.size() && schoolTeachers.containsAll(anotherSchoolTeachers) && schoolRooms.size() == anotherSchoolRooms.size() && schoolRooms.containsAll(anotherSchoolRooms) && schoolSubjects.size() == anotherSchoolSubjects.size() && schoolSubjects.containsAll(anotherSchoolSubjects); } return false; } | /**
* 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.util.List; | 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).casFeatCode_parse)));} | 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 final fields.
if (ff != null && !ff.matches(field)) {
continue;
}
try {
fc.doWith(field);
}
catch (IllegalAccessException ex) {
throw new IllegalStateException(
"Shouldn't be illegal to access field '" + field.getName() + "': " + ex);
}
}
targetClass = targetClass.getSuperclass();
}
while (targetClass != null && targetClass != Object.class);
} | 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 (IllegalAccessException ex) { throw new IllegalStateException( STR + field.getName() + STR + ex); } } targetClass = targetClass.getSuperclass(); } while (targetClass != null && targetClass != Object.class); } | /**
* 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 Point2D.Double(this.getLong(), this.getLat());
final double res = distanceToSegment(pStart, pEnd, tgt);
final WorldDistance distance = new WorldDistance(res, WorldDistance.DEGS);
// Note: we were using an algorithm to calculate the dist to a point on a
// continuous line, not
// a line segment. The above code class the correct algorithm.
// // sort out known angles
// double thetaOne = lineEnd.bearingFrom(lineStart);
// double thetaTwo = Math.PI - lineStart.bearingFrom(this);
// double thetaThree = thetaOne + thetaTwo;
//
// // and the single known distance
// double rangeToP1 = lineStart.rangeFrom(this);
//
// // now do our trig.
// double sinThetaThree = Math.abs(Math.sin(thetaThree));
// WorldDistance distance = new WorldDistance(rangeToP1 * sinThetaThree,
// WorldDistance.DEGS);
// sorted.
return distance;
}
| 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()); final double res = distanceToSegment(pStart, pEnd, tgt); final WorldDistance distance = new WorldDistance(res, WorldDistance.DEGS); return distance; } | /**
* 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}.
* @return the key specification for the specified key.
* @throws InvalidKeySpecException
* if the key can not be processed, or the requested requested
* {@code KeySpec} is inappropriate for the given key.
*/ | 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't work
*/ | 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());
for(InheritanceModel model : _interfaces)
{
InheritanceModel newModel = model.inheritDoc();
changed |= newModel != model;
interfaces.add(newModel);
}
if(!changed)
interfaces = _interfaces;
}
else
{
interfaces = _interfaces;
}
}
InheritanceModel superClass = _superClass;
if(superClass != null)
superClass = superClass.inheritDoc();
Entry entry = _entry;
if(entry != null)
{
InheritanceModel inheritanceModel = this;
if(superClass != _superClass || interfaces != _interfaces)
{
inheritanceModel = new InheritanceModel(_entry, superClass, interfaces);
}
entry = inheritDoc(entry, inheritanceModel);
}
if(entry != _entry || superClass != _superClass || interfaces != _interfaces)
return new InheritanceModel(entry, superClass, interfaces);
else
return this;
} | 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 = model.inheritDoc(); changed = newModel != model; interfaces.add(newModel); } if(!changed) interfaces = _interfaces; } else { interfaces = _interfaces; } } InheritanceModel superClass = _superClass; if(superClass != null) superClass = superClass.inheritDoc(); Entry entry = _entry; if(entry != null) { InheritanceModel inheritanceModel = this; if(superClass != _superClass interfaces != _interfaces) { inheritanceModel = new InheritanceModel(_entry, superClass, interfaces); } entry = inheritDoc(entry, inheritanceModel); } if(entry != _entry superClass != _superClass interfaces != _interfaces) return new InheritanceModel(entry, superClass, interfaces); else return this; } | /**
* 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, DeployedCardComparator::equalCompare);
if (sameCards.size() >= 2)
result.addAll(sameCards);
return result;
}
| 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 (sameCards.size() >= 2) result.addAll(sameCards); return result; } | /**
* 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
* The card just played (but not yet added to the state of the
* game).
* @param cardComparator
* The comparator to use for comparing card values.
* @return The captured cards.
*/ | 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 filename = chooser.getFile();
//if (filename != null) {
// StdDraw.save(chooser.getDirectory() + File.separator + chooser.getFile());
//}
}
| 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>");
html.append("\t\t<td style='vertical-align: middle; height: 100%;'>");
html.append(getHtmlPart("C_BLOCK_START", "Error"));
html.append("\t\t\t<table border='0' cellpadding='0' cellspacing='0' style='width: 100%;'>");
html.append("\t\t\t\t<tr>");
html.append("\t\t\t\t\t<td><img src='").append(pathPrefix).append("resources/error.png' border='0'></td>");
html.append("\t\t\t\t\t<td> </td>");
html.append("\t\t\t\t\t<td style='width: 100%;'>");
html.append("\t\t\t\t\t\tThe Alkacon OpenCms setup wizard has not been started correctly!<br>");
html.append("\t\t\t\t\t\tPlease click <a href='").append(pathPrefix);
html.append("index.jsp'>here</a> to restart the wizard.");
html.append("\t\t\t\t\t</td>");
html.append("\t\t\t\t</tr>");
html.append("\t\t\t</table>");
html.append(getHtmlPart("C_BLOCK_END"));
html.append("\t\t</td>");
html.append("\t</tr>");
html.append("</table>");
return html.toString();
} | 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='width: 100%;'>STR\t\t\t\t<tr>STR\t\t\t\t\t<td><img src='STRresources/error.png' border='0'></td>STR\t\t\t\t\t<td> </td>STR\t\t\t\t\t<td style='width: 100%;'>STR\t\t\t\t\t\tThe Alkacon OpenCms setup wizard has not been started correctly!<br>STR\t\t\t\t\t\tPlease click <a href='STRindex.jsp'>here</a> to restart the wizard.STR\t\t\t\t\t</td>STR\t\t\t\t</tr>STR\t\t\t</table>STRC_BLOCK_ENDSTR\t\t</td>STR\t</tr>STR</table>"); return html.toString(); } | /**
* 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 j = 0; j < height; j++) {
int value;
value = (int) (spectrogramData[i][j] * 255);
bufferedImage.setRGB(i, j, value << 16 | value << 8 | value);
}
}
return bufferedImage;
}
| 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; value = (int) (spectrogramData[i][j] * 255); bufferedImage.setRGB(i, j, value << 16 value << 8 value); } } return bufferedImage; } | /**
* 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(id, eventId, getUserConnectedId());
// return empty to have a valid json return
return ResponseEntity.ok().body(StringUtils.EMPTY);
} | @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();
if (last > list.size()) {
break; // Not enough room left
}
if (sequence.equals(list.subList(first, last))) {
return nextChain();
}
list = list.subList(first + 1, list.size());
}
fail("contains sequence", sequence);
return nextChain();
} | 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))) { return nextChain(); } list = list.subList(first + 1, list.size()); } fail(STR, sequence); return nextChain(); } | /**
* 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 extends OvalShape {
private RadialGradient mRadialGradient;
private int mShadowRadius;
private Paint mShadowPaint;
private int mCircleDiameter;
public OvalShadow(int shadowRadius, int circleDiameter) {
super();
mShadowPaint = new Paint();
mShadowRadius = shadowRadius;
mCircleDiameter = circleDiameter;
mRadialGradient = new RadialGradient(mCircleDiameter / 2, mCircleDiameter / 2,
mShadowRadius, new int[] {
FILL_SHADOW_COLOR, Color.TRANSPARENT
}, null, Shader.TileMode.CLAMP);
mShadowPaint.setShader(mRadialGradient);
} | 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 mShadowRadius; private Paint mShadowPaint; private int mCircleDiameter; public OvalShadow(int shadowRadius, int circleDiameter) { super(); mShadowPaint = new Paint(); mShadowRadius = shadowRadius; mCircleDiameter = circleDiameter; mRadialGradient = new RadialGradient(mCircleDiameter / 2, mCircleDiameter / 2, mShadowRadius, new int[] { FILL_SHADOW_COLOR, Color.TRANSPARENT }, null, Shader.TileMode.CLAMP); mShadowPaint.setShader(mRadialGradient); } | /**
* 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 #getElementPosition_()
* @generated
*/ | 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.