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 CompressDirectoryWithStubZipImpl andUnicodeExtraFieldPolicy(UnicodeExtraFieldPolicy unicodeExtraFieldPolicy) { this.unicodeExtraFieldPolicy = unicodeExtraFieldPolicy; return this; }
CompressDirectoryWithStubZipImpl function(UnicodeExtraFieldPolicy unicodeExtraFieldPolicy) { this.unicodeExtraFieldPolicy = unicodeExtraFieldPolicy; return this; }
/** * Sets the policy for creating unicode extra fields. By default, it is set to * {@link UnicodeExtraFieldPolicy#NEVER}. See * {@link ZipArchiveOutputStream#setCreateUnicodeExtraFields(UnicodeExtraFieldPolicy)}. */
Sets the policy for creating unicode extra fields. By default, it is set to <code>UnicodeExtraFieldPolicy#NEVER</code>. See <code>ZipArchiveOutputStream#setCreateUnicodeExtraFields(UnicodeExtraFieldPolicy)</code>
andUnicodeExtraFieldPolicy
{ "repo_name": "alanbuttars/commons-java", "path": "commons-compress/src/main/java/com/alanbuttars/commons/compress/stub/compress/CompressDirectoryWithStubZipImpl.java", "license": "apache-2.0", "size": 7126 }
[ "org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream" ]
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.commons.compress.archivers.zip.*;
[ "org.apache.commons" ]
org.apache.commons;
16,635
@Override public void defineItem() { BodyDef bdef = new BodyDef(); bdef.position.set(getX(), getY()); bdef.type = BodyDef.BodyType.DynamicBody; body = world.createBody(bdef); FixtureDef fdef = new FixtureDef(); CircleShape shape = new CircleShape(); shape.setRadius(7/ Seeker.PPM); fdef.filter.categoryBits = Seeker.ITEM_BIT; fdef.filter.maskBits = Seeker.JAAP_BIT | Seeker.OBJECT_BIT | Seeker.GROUND_BIT | Seeker.COIN_BIT | Seeker.BRICK_BIT; fdef.shape = shape; body.createFixture(fdef).setUserData(this); setBounds(getX(), getY(), 24 / Seeker.PPM, 24 / Seeker.PPM); }
void function() { BodyDef bdef = new BodyDef(); bdef.position.set(getX(), getY()); bdef.type = BodyDef.BodyType.DynamicBody; body = world.createBody(bdef); FixtureDef fdef = new FixtureDef(); CircleShape shape = new CircleShape(); shape.setRadius(7/ Seeker.PPM); fdef.filter.categoryBits = Seeker.ITEM_BIT; fdef.filter.maskBits = Seeker.JAAP_BIT Seeker.OBJECT_BIT Seeker.GROUND_BIT Seeker.COIN_BIT Seeker.BRICK_BIT; fdef.shape = shape; body.createFixture(fdef).setUserData(this); setBounds(getX(), getY(), 24 / Seeker.PPM, 24 / Seeker.PPM); }
/** * Defines the hulkifier, giving it a body and attaching a fixture, setting a bit and telling it what it can collide with. */
Defines the hulkifier, giving it a body and attaching a fixture, setting a bit and telling it what it can collide with
defineItem
{ "repo_name": "fjodor-rs/Project", "path": "core/src/nl/mprog/com/seeker/game/sprites/items/Hulkifier.java", "license": "mit", "size": 2191 }
[ "com.badlogic.gdx.physics.box2d.BodyDef", "com.badlogic.gdx.physics.box2d.CircleShape", "com.badlogic.gdx.physics.box2d.FixtureDef", "nl.mprog.com.seeker.game.Seeker" ]
import com.badlogic.gdx.physics.box2d.BodyDef; import com.badlogic.gdx.physics.box2d.CircleShape; import com.badlogic.gdx.physics.box2d.FixtureDef; import nl.mprog.com.seeker.game.Seeker;
import com.badlogic.gdx.physics.box2d.*; import nl.mprog.com.seeker.game.*;
[ "com.badlogic.gdx", "nl.mprog.com" ]
com.badlogic.gdx; nl.mprog.com;
867,917
public void closeIfNotShared(Object rcpt) throws IgniteCheckedException { assert isDone(); synchronized (recipients) { if (recipients.isEmpty()) return; recipients.remove(rcpt); if (recipients.isEmpty()) get().close(); } }
void function(Object rcpt) throws IgniteCheckedException { assert isDone(); synchronized (recipients) { if (recipients.isEmpty()) return; recipients.remove(rcpt); if (recipients.isEmpty()) get().close(); } }
/** * Close if this result does not have any other recipients. * * @param rcpt ID of the recipient. * @throws IgniteCheckedException If failed. */
Close if this result does not have any other recipients
closeIfNotShared
{ "repo_name": "dlnufox/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java", "license": "apache-2.0", "size": 100876 }
[ "org.apache.ignite.IgniteCheckedException" ]
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,452,210
PagedIterable<SharedAccessAuthorizationRuleResource> listAuthorizationRules( String resourceGroupName, String namespaceName);
PagedIterable<SharedAccessAuthorizationRuleResource> listAuthorizationRules( String resourceGroupName, String namespaceName);
/** * Gets the authorization rules for a namespace. * * @param resourceGroupName The name of the resource group. * @param namespaceName The namespace name. * @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 authorization rules for a namespace. */
Gets the authorization rules for a namespace
listAuthorizationRules
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Namespaces.java", "license": "mit", "size": 20638 }
[ "com.azure.core.http.rest.PagedIterable" ]
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.*;
[ "com.azure.core" ]
com.azure.core;
2,533,513
public void writeRatingTable(String dest) { try { PrintWriter out = new PrintWriter(dest); out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<html><body>\n\n"); out.write("\n\n\n<!-- light -->\n\n"); out.write(buildSingleRatingTable(TankType.LightTank, FieldDef.rating)); out.write("\n\n\n<!-- medium -->\n\n"); out.write(buildSingleRatingTable(TankType.MediumTank, FieldDef.rating)); out.write("\n\n\n<!-- heavy -->\n\n"); out.write(buildSingleRatingTable(TankType.HeavyTank, FieldDef.rating)); out.write("\n\n\n<!-- td -->\n\n"); out.write(buildSingleRatingTable(TankType.TankDestroyer, FieldDef.rating)); out.write("\n\n\n<!-- spg -->\n\n"); out.write(buildSingleRatingTable(TankType.SelfPropelledGun, FieldDef.rating)); out.write("\n\n\n</body></html>"); out.flush(); out.close(); } catch (FileNotFoundException ex) { log.error("Could not write to local file: Not found!", ex); } } // -------------------- tables only --------------------
void function(String dest) { try { PrintWriter out = new PrintWriter(dest); out.write(STR1.0\STRUTF-8\STR); out.write(STR); out.write(buildSingleRatingTable(TankType.LightTank, FieldDef.rating)); out.write(STR); out.write(buildSingleRatingTable(TankType.MediumTank, FieldDef.rating)); out.write(STR); out.write(buildSingleRatingTable(TankType.HeavyTank, FieldDef.rating)); out.write(STR); out.write(buildSingleRatingTable(TankType.TankDestroyer, FieldDef.rating)); out.write(STR); out.write(buildSingleRatingTable(TankType.SelfPropelledGun, FieldDef.rating)); out.write(STR); out.flush(); out.close(); } catch (FileNotFoundException ex) { log.error(STR, ex); } }
/** * Writes a table for each tank type, containing the ratings for each tank, * as defined by the TankRating class. * @param dest the file where the tables shall be stored in */
Writes a table for each tank type, containing the ratings for each tank, as defined by the TankRating class
writeRatingTable
{ "repo_name": "Klamann/WotCrawler", "path": "src/main/java/de/nx42/wotcrawler/xml/Transformer.java", "license": "gpl-3.0", "size": 14097 }
[ "de.nx42.wotcrawler.db.tank.Tank", "de.nx42.wotcrawler.ext.FieldDef", "java.io.FileNotFoundException", "java.io.PrintWriter" ]
import de.nx42.wotcrawler.db.tank.Tank; import de.nx42.wotcrawler.ext.FieldDef; import java.io.FileNotFoundException; import java.io.PrintWriter;
import de.nx42.wotcrawler.db.tank.*; import de.nx42.wotcrawler.ext.*; import java.io.*;
[ "de.nx42.wotcrawler", "java.io" ]
de.nx42.wotcrawler; java.io;
1,661,297
public FacesConfigFactoryType<WebFacesConfigDescriptor> getOrCreateFactory() { List<Node> nodeList = model.get("factory"); if (nodeList != null && nodeList.size() > 0) { return new FacesConfigFactoryTypeImpl<WebFacesConfigDescriptor>(this, "factory", model, nodeList.get(0)); } return createFactory(); }
FacesConfigFactoryType<WebFacesConfigDescriptor> function() { List<Node> nodeList = model.get(STR); if (nodeList != null && nodeList.size() > 0) { return new FacesConfigFactoryTypeImpl<WebFacesConfigDescriptor>(this, STR, model, nodeList.get(0)); } return createFactory(); }
/** * If not already created, a new <code>factory</code> element will be created and returned. * Otherwise, the first existing <code>factory</code> element will be returned. * @return the instance defined for the element <code>factory</code> */
If not already created, a new <code>factory</code> element will be created and returned. Otherwise, the first existing <code>factory</code> element will be returned
getOrCreateFactory
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesconfig20/WebFacesConfigDescriptorImpl.java", "license": "epl-1.0", "size": 44350 }
[ "java.util.List", "org.jboss.shrinkwrap.descriptor.api.facesconfig20.FacesConfigFactoryType", "org.jboss.shrinkwrap.descriptor.api.facesconfig20.WebFacesConfigDescriptor", "org.jboss.shrinkwrap.descriptor.spi.node.Node" ]
import java.util.List; import org.jboss.shrinkwrap.descriptor.api.facesconfig20.FacesConfigFactoryType; import org.jboss.shrinkwrap.descriptor.api.facesconfig20.WebFacesConfigDescriptor; import org.jboss.shrinkwrap.descriptor.spi.node.Node;
import java.util.*; import org.jboss.shrinkwrap.descriptor.api.facesconfig20.*; import org.jboss.shrinkwrap.descriptor.spi.node.*;
[ "java.util", "org.jboss.shrinkwrap" ]
java.util; org.jboss.shrinkwrap;
1,225,452
@FIXVersion(introduced="5.0SP1") @TagNumRef(tagNum=TagNum.UnderlyingLegOptAttribute) public void setUnderlyingLegOptAttribute(Character underlyingLegOptAttribute) { this.underlyingLegOptAttribute = underlyingLegOptAttribute; }
@FIXVersion(introduced=STR) @TagNumRef(tagNum=TagNum.UnderlyingLegOptAttribute) void function(Character underlyingLegOptAttribute) { this.underlyingLegOptAttribute = underlyingLegOptAttribute; }
/** * Message field setter. * @param underlyingLegOptAttribute field value */
Message field setter
setUnderlyingLegOptAttribute
{ "repo_name": "marvisan/HadesFIX", "path": "Model/src/main/java/net/hades/fix/message/comp/UnderlyingLegInstrument.java", "license": "gpl-3.0", "size": 27982 }
[ "net.hades.fix.message.anno.FIXVersion", "net.hades.fix.message.anno.TagNumRef", "net.hades.fix.message.type.TagNum" ]
import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum;
import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*;
[ "net.hades.fix" ]
net.hades.fix;
1,046,797
public void write(NetInterfaceConfig<? extends NetInterfaceAddressConfig> netConfig) throws KuraException;
void function(NetInterfaceConfig<? extends NetInterfaceAddressConfig> netConfig) throws KuraException;
/** * Persists the network configuration received as argument. Throws a {@link KuraException} if the persist operation * fails. * * @param netConfig * @throws KuraException */
Persists the network configuration received as argument. Throws a <code>KuraException</code> if the persist operation fails
write
{ "repo_name": "darionct/kura", "path": "kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/internal/linux/net/NetInterfaceConfigSerializationService.java", "license": "epl-1.0", "size": 1457 }
[ "org.eclipse.kura.KuraException", "org.eclipse.kura.net.NetInterfaceAddressConfig", "org.eclipse.kura.net.NetInterfaceConfig" ]
import org.eclipse.kura.KuraException; import org.eclipse.kura.net.NetInterfaceAddressConfig; import org.eclipse.kura.net.NetInterfaceConfig;
import org.eclipse.kura.*; import org.eclipse.kura.net.*;
[ "org.eclipse.kura" ]
org.eclipse.kura;
834,728
private Object readResolve() { wakeUpQueue = new ArrayBlockingQueue<SerialMessage>(MAX_BUFFFER_SIZE, true); timer = new Timer(); return this; } /** * {@inheritDoc}
Object function() { wakeUpQueue = new ArrayBlockingQueue<SerialMessage>(MAX_BUFFFER_SIZE, true); timer = new Timer(); return this; } /** * {@inheritDoc}
/** * Resolves uninitialized fields after XML Deserialization. * * @return The current {@link ZWaveWakeUpCommandClass} instance. */
Resolves uninitialized fields after XML Deserialization
readResolve
{ "repo_name": "Greblys/openhab", "path": "bundles/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/protocol/commandclass/ZWaveWakeUpCommandClass.java", "license": "epl-1.0", "size": 20107 }
[ "java.util.Timer", "java.util.concurrent.ArrayBlockingQueue", "org.openhab.binding.zwave.internal.protocol.SerialMessage" ]
import java.util.Timer; import java.util.concurrent.ArrayBlockingQueue; import org.openhab.binding.zwave.internal.protocol.SerialMessage;
import java.util.*; import java.util.concurrent.*; import org.openhab.binding.zwave.internal.protocol.*;
[ "java.util", "org.openhab.binding" ]
java.util; org.openhab.binding;
1,635,370
private void createLabel(final Composite parent, final String text) { Label label = new Label(parent, SWT.WRAP); label.setText(text); label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1)); }
void function(final Composite parent, final String text) { Label label = new Label(parent, SWT.WRAP); label.setText(text); label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1)); }
/** * Creates a label with the given text. * * @param parent * The parent for the label * @param text * The text for the label */
Creates a label with the given text
createLabel
{ "repo_name": "fqqb/yamcs-studio", "path": "bundles/org.csstudio.opibuilder/src/org/csstudio/opibuilder/visualparts/OPIColorDialog.java", "license": "epl-1.0", "size": 13030 }
[ "org.eclipse.swt.layout.GridData", "org.eclipse.swt.widgets.Composite", "org.eclipse.swt.widgets.Label" ]
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
1,190,943
private void renewClaimedTasks() { try { List<ClaimedTask> claimedTasks = ImmutableList.copyOf(_claimedTasks.values()); List<ScanRangeTask> tasks = Lists.newArrayList(); for (ClaimedTask claimedTask : claimedTasks) { if (claimedTask.isComplete()) { // Task is likely being removed in another thread. However, go ahead and remove it now // to allow other tasks to start sooner. _log.info("Complete claimed task found during renew: id={}", claimedTask.getTaskId()); _claimedTasks.remove(claimedTask.getTaskId()); } else if (claimedTask.isStarted()) { // Task has started and is not complete. Renew it. tasks.add(claimedTask.getTask()); } } if (!tasks.isEmpty()) { _scanWorkflow.renewScanRangeTasks(tasks, QUEUE_RENEW_TTL); for (ScanRangeTask task : tasks) { _log.info("Renewed scan range task: {}", task); } } } catch (Exception e) { _log.error("Failed to renew scan ranges", e); } }
void function() { try { List<ClaimedTask> claimedTasks = ImmutableList.copyOf(_claimedTasks.values()); List<ScanRangeTask> tasks = Lists.newArrayList(); for (ClaimedTask claimedTask : claimedTasks) { if (claimedTask.isComplete()) { _log.info(STR, claimedTask.getTaskId()); _claimedTasks.remove(claimedTask.getTaskId()); } else if (claimedTask.isStarted()) { tasks.add(claimedTask.getTask()); } } if (!tasks.isEmpty()) { _scanWorkflow.renewScanRangeTasks(tasks, QUEUE_RENEW_TTL); for (ScanRangeTask task : tasks) { _log.info(STR, task); } } } catch (Exception e) { _log.error(STR, e); } }
/** * Renews all claimed scan range tasks that have not been released. Unless this is called periodically the * scan workflow will make this task available to be claimed again. */
Renews all claimed scan range tasks that have not been released. Unless this is called periodically the scan workflow will make this task available to be claimed again
renewClaimedTasks
{ "repo_name": "bazaarvoice/emodb", "path": "web/src/main/java/com/bazaarvoice/emodb/web/scanner/control/DistributedScanRangeMonitor.java", "license": "apache-2.0", "size": 17252 }
[ "com.google.common.collect.ImmutableList", "com.google.common.collect.Lists", "java.util.List" ]
import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.util.List;
import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
1,463,759
Version getVersion();
Version getVersion();
/** * Return the version for this extension. * @return */
Return the version for this extension
getVersion
{ "repo_name": "Techcable/CommandHelper", "path": "src/main/java/com/laytonsmith/core/extensions/Extension.java", "license": "mit", "size": 1845 }
[ "com.laytonsmith.PureUtilities" ]
import com.laytonsmith.PureUtilities;
import com.laytonsmith.*;
[ "com.laytonsmith" ]
com.laytonsmith;
1,083,253
public int executeUpdate(String sql, Object... params) throws SQLException { return executeUpdate(new Query(sql, params)); }
int function(String sql, Object... params) throws SQLException { return executeUpdate(new Query(sql, params)); }
/** * Executes the update query given by a Jorm SQL statement and applicable parameters. * * @param sql * the Jorm SQL statement. * @param params * the applicable parameters. * @return the number of updated rows in the database. * @throws SQLException * if a database access error occurs or the generated SQL * statement does not return a result set. */
Executes the update query given by a Jorm SQL statement and applicable parameters
executeUpdate
{ "repo_name": "jajja/jorm", "path": "src/main/java/com/jajja/jorm/Transaction.java", "license": "mit", "size": 84462 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,420,947
public ApiContractInner withSubscriptionKeyParameterNames(SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames) { this.subscriptionKeyParameterNames = subscriptionKeyParameterNames; return this; }
ApiContractInner function(SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames) { this.subscriptionKeyParameterNames = subscriptionKeyParameterNames; return this; }
/** * Set protocols over which API is made available. * * @param subscriptionKeyParameterNames the subscriptionKeyParameterNames value to set * @return the ApiContractInner object itself. */
Set protocols over which API is made available
withSubscriptionKeyParameterNames
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/apimanagement/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/apimanagement/v2019_12_01/implementation/ApiContractInner.java", "license": "mit", "size": 14657 }
[ "com.microsoft.azure.management.apimanagement.v2019_12_01.SubscriptionKeyParameterNamesContract" ]
import com.microsoft.azure.management.apimanagement.v2019_12_01.SubscriptionKeyParameterNamesContract;
import com.microsoft.azure.management.apimanagement.v2019_12_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
53,007
@Nonnull public EdgeMappingInfo findTheEdge(PortMappingInfo port) { for (Entry<Uuid, EdgeMappingInfo> entry : this.edgeStore.entrySet()) { EdgeMappingInfo edge = entry.getValue(); if (edge.getEdge().getUuid().equals(port.getPort().getEdgeId())) { return edge; } } return null; }
EdgeMappingInfo function(PortMappingInfo port) { for (Entry<Uuid, EdgeMappingInfo> entry : this.edgeStore.entrySet()) { EdgeMappingInfo edge = entry.getValue(); if (edge.getEdge().getUuid().equals(port.getPort().getEdgeId())) { return edge; } } return null; }
/** * Find the edge connects the given port. * @param port - the target port. * @return the Endge connects the given port. */
Find the edge connects the given port
findTheEdge
{ "repo_name": "opendaylight/faas", "path": "fabric-mgr/uln-cache/src/main/java/org/opendaylight/faas/uln/cache/UserLogicalNetworkCache.java", "license": "epl-1.0", "size": 54820 }
[ "java.util.Map", "org.opendaylight.yang.gen.v1.urn.opendaylight.faas.logical.faas.common.rev151013.Uuid" ]
import java.util.Map; import org.opendaylight.yang.gen.v1.urn.opendaylight.faas.logical.faas.common.rev151013.Uuid;
import java.util.*; import org.opendaylight.yang.gen.v1.urn.opendaylight.faas.logical.faas.common.rev151013.*;
[ "java.util", "org.opendaylight.yang" ]
java.util; org.opendaylight.yang;
826,808
ServiceCall<DataLakeAnalyticsAccount> updateAsync(String resourceGroupName, String accountName, DataLakeAnalyticsAccountUpdateParameters parameters, final ServiceCallback<DataLakeAnalyticsAccount> serviceCallback);
ServiceCall<DataLakeAnalyticsAccount> updateAsync(String resourceGroupName, String accountName, DataLakeAnalyticsAccountUpdateParameters parameters, final ServiceCallback<DataLakeAnalyticsAccount> serviceCallback);
/** * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. * * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. * @param accountName The name of the Data Lake Analytics account to update. * @param parameters Parameters supplied to the update Data Lake Analytics account operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */
Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object
updateAsync
{ "repo_name": "pomortaz/azure-sdk-for-java", "path": "azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/Accounts.java", "license": "mit", "size": 41301 }
[ "com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsAccount", "com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsAccountUpdateParameters", "com.microsoft.rest.ServiceCall", "com.microsoft.rest.ServiceCallback" ]
import com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsAccount; import com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsAccountUpdateParameters; import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback;
import com.microsoft.azure.management.datalake.analytics.models.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
1,691,013
public static final void performance(String tag, String method, long time) { if (Cons.SHOW_LOGS) { Log.i("Performance:" + tag, method + ": " + String.valueOf(time) + " ms"); } }
static final void function(String tag, String method, long time) { if (Cons.SHOW_LOGS) { Log.i(STR + tag, method + STR + String.valueOf(time) + STR); } }
/** * Send a INFO log message for performance notice. * * @param tag * Used to identify the source of a log message. It usually * identifies the class or activity where the log call occurs. * @param method * Used to identify the method of a log performance message. * @param time * The performance time in milliseconds you would like logged. */
Send a INFO log message for performance notice
performance
{ "repo_name": "r2bapps/TaskManager", "path": "TaskManagerLib/src/r2b/apps/utils/Logger.java", "license": "mit", "size": 3251 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
2,034,665
ProductResult getSinglePages() throws ServiceException;
ProductResult getSinglePages() throws ServiceException;
/** * A paging operation that finishes on the first call without a nextlink * * @return the ProductResult object if successful. * @throws ServiceException the exception wrapped in ServiceException if failed. */
A paging operation that finishes on the first call without a nextlink
getSinglePages
{ "repo_name": "BretJohnson/autorest", "path": "AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/Paging.java", "license": "mit", "size": 14369 }
[ "com.microsoft.rest.ServiceException" ]
import com.microsoft.rest.ServiceException;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
1,157,131
protected boolean canPrintStackTrace() { return mostRecentElement != null && mostRecentElement.getCause() != null; } protected static final class StackTraceElement { private final String label; private final Location location; private final StackTraceElement cause; private final boolean canPrint; StackTraceElement(String label, Location location, StackTraceElement cause, boolean canPrint) { this.label = label; this.location = location; this.cause = cause; this.canPrint = canPrint; }
boolean function() { return mostRecentElement != null && mostRecentElement.getCause() != null; } protected static final class StackTraceElement { private final String label; private final Location location; private final StackTraceElement cause; private final boolean canPrint; StackTraceElement(String label, Location location, StackTraceElement cause, boolean canPrint) { this.label = label; this.location = location; this.cause = cause; this.canPrint = canPrint; }
/** * Returns true when there is at least one non-built-in element. */
Returns true when there is at least one non-built-in element
canPrintStackTrace
{ "repo_name": "Digas29/bazel", "path": "src/main/java/com/google/devtools/build/lib/syntax/EvalExceptionWithStackTrace.java", "license": "apache-2.0", "size": 11527 }
[ "com.google.devtools.build.lib.events.Location" ]
import com.google.devtools.build.lib.events.Location;
import com.google.devtools.build.lib.events.*;
[ "com.google.devtools" ]
com.google.devtools;
1,093,009
//------------------------------------------------------------------------- @Test public void testWithScheme() { final ObjectId test = ObjectId.of("id1", "value1"); assertEquals(ObjectId.of("newScheme", "value1"), test.withScheme("newScheme")); assertNotSame(test, test.withValue("value1")); }
void function() { final ObjectId test = ObjectId.of("id1", STR); assertEquals(ObjectId.of(STR, STR), test.withScheme(STR)); assertNotSame(test, test.withValue(STR)); }
/** * Tests the scheme replacement. */
Tests the scheme replacement
testWithScheme
{ "repo_name": "McLeodMoores/starling", "path": "projects/util/src/test/java/com/opengamma/id/ObjectIdTest.java", "license": "apache-2.0", "size": 8234 }
[ "org.testng.Assert", "org.testng.AssertJUnit" ]
import org.testng.Assert; import org.testng.AssertJUnit;
import org.testng.*;
[ "org.testng" ]
org.testng;
2,776,444
public KeySelector<IN, ?> getStateKeySelector() { return stateKeySelector; }
KeySelector<IN, ?> function() { return stateKeySelector; }
/** * Returns the {@code KeySelector} that must be used for partitioning keyed state in this * Operation. * * @see #setStateKeySelector */
Returns the KeySelector that must be used for partitioning keyed state in this Operation
getStateKeySelector
{ "repo_name": "greghogan/flink", "path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/transformations/OneInputTransformation.java", "license": "apache-2.0", "size": 4946 }
[ "org.apache.flink.api.java.functions.KeySelector" ]
import org.apache.flink.api.java.functions.KeySelector;
import org.apache.flink.api.java.functions.*;
[ "org.apache.flink" ]
org.apache.flink;
1,014,173
private static List<BundleInfo> mergeOSGiLibWithExistingBundlesInfo(List<BundleInfo> newBundlesInfo, Map<BundleLocation, List<BundleInfo>> existingBundleInfo) { List<BundleInfo> effectiveBundlesInfo = existingBundleInfo.get(BundleLocation.NON_OSGI_LIB_BUNDLE); if (effectiveBundlesInfo != null) { effectiveBundlesInfo.addAll(newBundlesInfo); } else { effectiveBundlesInfo = newBundlesInfo; } return effectiveBundlesInfo .stream() .distinct() .collect(Collectors.toList()); }
static List<BundleInfo> function(List<BundleInfo> newBundlesInfo, Map<BundleLocation, List<BundleInfo>> existingBundleInfo) { List<BundleInfo> effectiveBundlesInfo = existingBundleInfo.get(BundleLocation.NON_OSGI_LIB_BUNDLE); if (effectiveBundlesInfo != null) { effectiveBundlesInfo.addAll(newBundlesInfo); } else { effectiveBundlesInfo = newBundlesInfo; } return effectiveBundlesInfo .stream() .distinct() .collect(Collectors.toList()); }
/** * Merges the existing OSGi bundle information with the newly retrieved OSGi bundle information. * * @param newBundlesInfo the new OSGi bundle information to be added * @param existingBundleInfo the existing OSGi bundle information * @return merged result of the existing OSGi bundle information with the newly retrieved OSGi bundle information */
Merges the existing OSGi bundle information with the newly retrieved OSGi bundle information
mergeOSGiLibWithExistingBundlesInfo
{ "repo_name": "nilminiwso2/carbon-kernel-1", "path": "launcher/src/main/java/org/wso2/carbon/launcher/extensions/OSGiLibBundleDeployerUtils.java", "license": "apache-2.0", "size": 17237 }
[ "java.util.List", "java.util.Map", "java.util.stream.Collectors", "org.wso2.carbon.launcher.extensions.model.BundleInfo", "org.wso2.carbon.launcher.extensions.model.BundleLocation" ]
import java.util.List; import java.util.Map; import java.util.stream.Collectors; import org.wso2.carbon.launcher.extensions.model.BundleInfo; import org.wso2.carbon.launcher.extensions.model.BundleLocation;
import java.util.*; import java.util.stream.*; import org.wso2.carbon.launcher.extensions.model.*;
[ "java.util", "org.wso2.carbon" ]
java.util; org.wso2.carbon;
1,935,275
private final void add(ArrayList<GalleryImage> images, int imageId, int nameId, int searchTermId) { images.add(new GalleryImage(imageId, getString(nameId), getString(searchTermId))); }
final void function(ArrayList<GalleryImage> images, int imageId, int nameId, int searchTermId) { images.add(new GalleryImage(imageId, getString(nameId), getString(searchTermId))); }
/** * Adds an image to the gallery, but using an internationalized search term. * Note, that for this to work the internationalized name _must_ be in the * search index. */
Adds an image to the gallery, but using an internationalized search term. Note, that for this to work the internationalized name _must_ be in the search index
add
{ "repo_name": "jaydeetay/stardroid", "path": "app/src/main/java/com/google/android/stardroid/gallery/HardcodedGallery.java", "license": "apache-2.0", "size": 4036 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,580,307
public static Implementation getPlugin() { return plugin; } public static class Implementation extends EclipseUIPlugin { public Implementation() { super(); // Remember the static instance. // plugin = this; } }
static Implementation function() { return plugin; } public static class Implementation extends EclipseUIPlugin { public Implementation() { super(); plugin = this; } }
/** * Returns the singleton instance of the Eclipse plugin. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the singleton instance. * @generated */
Returns the singleton instance of the Eclipse plugin.
getPlugin
{ "repo_name": "FTSRG/mondo-collab-framework", "path": "archive/workspaceTracker/VA/ikerlanEMF.editor/src/eu/mondo/collaboration/operationtracemodel/example/WTSpec/presentation/WTSpec2EditorPlugin.java", "license": "epl-1.0", "size": 1973 }
[ "org.eclipse.emf.common.ui.EclipseUIPlugin" ]
import org.eclipse.emf.common.ui.EclipseUIPlugin;
import org.eclipse.emf.common.ui.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,921,872
public long getEventTime(long suggestedTime) { long result = suggestedTime; if (this.versionTag != null && getRegion().getConcurrencyChecksEnabled()) { if (suggestedTime != 0) { this.versionTag.setVersionTimeStamp(suggestedTime); } else { result = this.versionTag.getVersionTimeStamp(); } } if (result <= 0) { InternalRegion region = this.getRegion(); if (region != null) { result = region.cacheTimeMillis(); } else { result = System.currentTimeMillis(); } } return result; } public static class SerializedCacheValueImpl implements SerializedCacheValue, CachedDeserializable, Sendable { private final EntryEventImpl event; @Unretained private final CachedDeserializable cd; private final Region r; private final RegionEntry re; private final byte[] serializedValue; SerializedCacheValueImpl(EntryEventImpl event, Region r, RegionEntry re, @Unretained CachedDeserializable cd, byte[] serializedBytes) { if (event.isOffHeapReference(cd)) { this.event = event; } else { this.event = null; } this.r = r; this.re = re; this.cd = cd; this.serializedValue = serializedBytes; }
long function(long suggestedTime) { long result = suggestedTime; if (this.versionTag != null && getRegion().getConcurrencyChecksEnabled()) { if (suggestedTime != 0) { this.versionTag.setVersionTimeStamp(suggestedTime); } else { result = this.versionTag.getVersionTimeStamp(); } } if (result <= 0) { InternalRegion region = this.getRegion(); if (region != null) { result = region.cacheTimeMillis(); } else { result = System.currentTimeMillis(); } } return result; } public static class SerializedCacheValueImpl implements SerializedCacheValue, CachedDeserializable, Sendable { private final EntryEventImpl event; private final CachedDeserializable cd; private final Region r; private final RegionEntry re; private final byte[] serializedValue; SerializedCacheValueImpl(EntryEventImpl event, Region r, RegionEntry re, @Unretained CachedDeserializable cd, byte[] serializedBytes) { if (event.isOffHeapReference(cd)) { this.event = event; } else { this.event = null; } this.r = r; this.re = re; this.cd = cd; this.serializedValue = serializedBytes; }
/** * this method joins together version tag timestamps and the "lastModified" timestamps generated * and stored in entries. If a change does not already carry a lastModified timestamp * * @return the timestamp to store in the entry */
this method joins together version tag timestamps and the "lastModified" timestamps generated and stored in entries. If a change does not already carry a lastModified timestamp
getEventTime
{ "repo_name": "davebarnes97/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java", "license": "apache-2.0", "size": 99239 }
[ "org.apache.geode.cache.Region", "org.apache.geode.cache.SerializedCacheValue", "org.apache.geode.internal.Sendable", "org.apache.geode.internal.offheap.annotations.Unretained" ]
import org.apache.geode.cache.Region; import org.apache.geode.cache.SerializedCacheValue; import org.apache.geode.internal.Sendable; import org.apache.geode.internal.offheap.annotations.Unretained;
import org.apache.geode.cache.*; import org.apache.geode.internal.*; import org.apache.geode.internal.offheap.annotations.*;
[ "org.apache.geode" ]
org.apache.geode;
67,312
private int update(Connection conn, boolean closeConn, String sql, Object... params) throws SQLException { if (conn == null) { throw new SQLException("Null connection"); } if (sql == null) { if (closeConn) { close(conn); } throw new SQLException("Null SQL statement"); } PreparedStatement stmt = null; int rows = 0; try { stmt = this.prepareStatement(conn, sql); this.fillStatement(stmt, params); rows = stmt.executeUpdate(); } catch (SQLException e) { this.rethrow(e, sql, params); } finally { close(stmt); if (closeConn) { close(conn); } } return rows; }
int function(Connection conn, boolean closeConn, String sql, Object... params) throws SQLException { if (conn == null) { throw new SQLException(STR); } if (sql == null) { if (closeConn) { close(conn); } throw new SQLException(STR); } PreparedStatement stmt = null; int rows = 0; try { stmt = this.prepareStatement(conn, sql); this.fillStatement(stmt, params); rows = stmt.executeUpdate(); } catch (SQLException e) { this.rethrow(e, sql, params); } finally { close(stmt); if (closeConn) { close(conn); } } return rows; }
/** * Calls update after checking the parameters to ensure nothing is null. * @param conn The connection to use for the update call. * @param closeConn True if the connection should be closed, false otherwise. * @param sql The SQL statement to execute. * @param params An array of update replacement parameters. Each row in * this array is one set of update replacement values. * @return The number of rows updated. * @throws SQLException If there are database or parameter errors. */
Calls update after checking the parameters to ensure nothing is null
update
{ "repo_name": "drinkjava2/jSQLBox", "path": "core/src/main/java/org/apache/commons/dbutils/QueryRunner.java", "license": "apache-2.0", "size": 39281 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.SQLException" ]
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
33,692
public static void removeCreator(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) { Base.remove(model, instanceResource, CREATOR, value); }
static void function(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) { Base.remove(model, instanceResource, CREATOR, value); }
/** * Removes a value of property Creator as an RDF2Go node * * @param model * an RDF2Go model * @param resource * an RDF2Go resource * @param value * the value to be removed * * [Generated from RDFReactor template rule #remove1static] */
Removes a value of property Creator as an RDF2Go node
removeCreator
{ "repo_name": "m0ep/master-thesis", "path": "source/apis/rdf2go/rdf2go-sioc/src/main/java/org/rdfs/sioc/Thing.java", "license": "mit", "size": 317844 }
[ "org.ontoware.rdf2go.model.Model", "org.ontoware.rdfreactor.runtime.Base" ]
import org.ontoware.rdf2go.model.Model; import org.ontoware.rdfreactor.runtime.Base;
import org.ontoware.rdf2go.model.*; import org.ontoware.rdfreactor.runtime.*;
[ "org.ontoware.rdf2go", "org.ontoware.rdfreactor" ]
org.ontoware.rdf2go; org.ontoware.rdfreactor;
1,083,638
public Object validatedDestroy(Object key, EntryEventImpl event) throws TimeoutException, EntryNotFoundException, CacheWriterException { try { if (event.getEventId() == null && generateEventID()) { event.setNewEventId(cache.getDistributedSystem()); } basicDestroy(event, true, // cacheWrite null); // expectedOldValue if (event.isOldValueOffHeap()) { return null; } else { return handleNotAvailable(event.getOldValue()); } } finally { event.release(); } }
Object function(Object key, EntryEventImpl event) throws TimeoutException, EntryNotFoundException, CacheWriterException { try { if (event.getEventId() == null && generateEventID()) { event.setNewEventId(cache.getDistributedSystem()); } basicDestroy(event, true, null); if (event.isOldValueOffHeap()) { return null; } else { return handleNotAvailable(event.getOldValue()); } } finally { event.release(); } }
/** * Destroys entry without performing validations. Call this after validating * key, callback arg, and runtime state. */
Destroys entry without performing validations. Call this after validating key, callback arg, and runtime state
validatedDestroy
{ "repo_name": "papicella/snappy-store", "path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java", "license": "apache-2.0", "size": 506961 }
[ "com.gemstone.gemfire.cache.CacheWriterException", "com.gemstone.gemfire.cache.EntryNotFoundException", "com.gemstone.gemfire.cache.TimeoutException" ]
import com.gemstone.gemfire.cache.CacheWriterException; import com.gemstone.gemfire.cache.EntryNotFoundException; import com.gemstone.gemfire.cache.TimeoutException;
import com.gemstone.gemfire.cache.*;
[ "com.gemstone.gemfire" ]
com.gemstone.gemfire;
2,825,383
public int fetchNextBatch( @SuppressWarnings("unused") @JavaType(internalName = "Ljava/lang/StackStreamFactory;") StaticObject stackStream, long mode, long anchor, int batchSize, int startIndex, @JavaType(Object[].class) StaticObject frames, Meta meta) { assert synchronizedConstants(meta); FrameWalker fw = getAnchored(anchor); if (fw == null) { throw meta.throwExceptionWithMessage(meta.java_lang_InternalError, "doStackWalk: corrupted buffers"); } if (batchSize <= 0) { return startIndex; } fw.next(batchSize, startIndex); fw.mode(mode); Integer decodedOrNull = fw.doStackWalk(frames); int decoded = decodedOrNull == null ? fw.decoded() : decodedOrNull; return startIndex + decoded; }
int function( @SuppressWarnings(STR) @JavaType(internalName = STR) StaticObject stackStream, long mode, long anchor, int batchSize, int startIndex, @JavaType(Object[].class) StaticObject frames, Meta meta) { assert synchronizedConstants(meta); FrameWalker fw = getAnchored(anchor); if (fw == null) { throw meta.throwExceptionWithMessage(meta.java_lang_InternalError, STR); } if (batchSize <= 0) { return startIndex; } fw.next(batchSize, startIndex); fw.mode(mode); Integer decodedOrNull = fw.doStackWalk(frames); int decoded = decodedOrNull == null ? fw.decoded() : decodedOrNull; return startIndex + decoded; }
/** * After {@link #fetchFirstBatch(StaticObject, long, int, int, int, StaticObject, Meta)}, this * method allows to continue frame walking, starting from where the previous calls left off. * * @return The position in the buffer at the end of fetching. */
After <code>#fetchFirstBatch(StaticObject, long, int, int, int, StaticObject, Meta)</code>, this method allows to continue frame walking, starting from where the previous calls left off
fetchNextBatch
{ "repo_name": "smarr/Truffle", "path": "espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/vm/StackWalk.java", "license": "gpl-2.0", "size": 15606 }
[ "com.oracle.truffle.espresso.meta.Meta", "com.oracle.truffle.espresso.runtime.StaticObject", "com.oracle.truffle.espresso.substitutions.JavaType" ]
import com.oracle.truffle.espresso.meta.Meta; import com.oracle.truffle.espresso.runtime.StaticObject; import com.oracle.truffle.espresso.substitutions.JavaType;
import com.oracle.truffle.espresso.meta.*; import com.oracle.truffle.espresso.runtime.*; import com.oracle.truffle.espresso.substitutions.*;
[ "com.oracle.truffle" ]
com.oracle.truffle;
2,668,195
public void removeToolBarComponent(Component component) { validateComponentNonNull(component); getToolbar().remove(component); getToolbar().validate(); getToolbar().repaint(); }
void function(Component component) { validateComponentNonNull(component); getToolbar().remove(component); getToolbar().validate(); getToolbar().repaint(); }
/** * Removes the given component to the tool bar. * * @param component the component to remove. * @throws IllegalArgumentException if the component is {@code null}. * @since 2.6.0 */
Removes the given component to the tool bar
removeToolBarComponent
{ "repo_name": "zaproxy/zaproxy", "path": "zap/src/main/java/org/zaproxy/zap/view/MainToolbarPanel.java", "license": "apache-2.0", "size": 18946 }
[ "java.awt.Component" ]
import java.awt.Component;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,072,110
@Test(expected=TimeoutException.class) public void testWriteChangesErrorTimeout() throws XBeeException, IOException { // Throw a timeout exception when trying to set the WR parameter. Mockito.doThrow(new TimeoutException()).when(xbeeDevice).executeParameter(PARAMETER_WR); // Write changes in the device. xbeeDevice.writeChanges(); }
@Test(expected=TimeoutException.class) void function() throws XBeeException, IOException { Mockito.doThrow(new TimeoutException()).when(xbeeDevice).executeParameter(PARAMETER_WR); xbeeDevice.writeChanges(); }
/** * Test method for {@link com.digi.xbee.api.XBeeDevice#writeChanges()}. * * <p>Verify that changes on an XBee device cannot be written if there is a timeout writing * those changes.</p> * * @throws XBeeException * @throws IOException */
Test method for <code>com.digi.xbee.api.XBeeDevice#writeChanges()</code>. Verify that changes on an XBee device cannot be written if there is a timeout writing those changes
testWriteChangesErrorTimeout
{ "repo_name": "digidotcom/XBeeJavaLibrary", "path": "library/src/test/java/com/digi/xbee/api/WriteChangesTest.java", "license": "mpl-2.0", "size": 4713 }
[ "com.digi.xbee.api.exceptions.TimeoutException", "com.digi.xbee.api.exceptions.XBeeException", "java.io.IOException", "org.junit.Test", "org.mockito.Mockito" ]
import com.digi.xbee.api.exceptions.TimeoutException; import com.digi.xbee.api.exceptions.XBeeException; import java.io.IOException; import org.junit.Test; import org.mockito.Mockito;
import com.digi.xbee.api.exceptions.*; import java.io.*; import org.junit.*; import org.mockito.*;
[ "com.digi.xbee", "java.io", "org.junit", "org.mockito" ]
com.digi.xbee; java.io; org.junit; org.mockito;
2,064,081
void deleteBlobsByPrefix(String prefix) throws IOException { doPrivileged(() -> { deleteBlobs(listBlobsByPath(bucket, prefix, null).keySet()); return null; }); }
void deleteBlobsByPrefix(String prefix) throws IOException { doPrivileged(() -> { deleteBlobs(listBlobsByPath(bucket, prefix, null).keySet()); return null; }); }
/** * Deletes multiple blobs in the bucket that have a given prefix * * @param prefix prefix of the buckets to delete */
Deletes multiple blobs in the bucket that have a given prefix
deleteBlobsByPrefix
{ "repo_name": "danielmitterdorfer/elasticsearch", "path": "plugins/repository-gcs/src/main/java/org/elasticsearch/common/blobstore/gcs/GoogleCloudStorageBlobStore.java", "license": "apache-2.0", "size": 15637 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
869,885
public static IoFuture<SslConnection> performUpgrade(final XnioWorker worker, XnioSsl ssl, InetSocketAddress bindAddress, URI uri, final Map<String, String> headers, ChannelListener<? super SslConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap, HandshakeChecker handshakeChecker) { return new HttpUpgradeState<SslConnection>(worker, ssl, bindAddress, uri, headers, openListener, bindListener, optionMap, handshakeChecker).doUpgrade(); }
static IoFuture<SslConnection> function(final XnioWorker worker, XnioSsl ssl, InetSocketAddress bindAddress, URI uri, final Map<String, String> headers, ChannelListener<? super SslConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap, HandshakeChecker handshakeChecker) { return new HttpUpgradeState<SslConnection>(worker, ssl, bindAddress, uri, headers, openListener, bindListener, optionMap, handshakeChecker).doUpgrade(); }
/** * Perform a HTTP upgrade that results in a SSL secured connection. This method should be used if the target endpoint is using https * * @param worker The worker * @param ssl The XnioSsl instance * @param bindAddress The bind address * @param uri The URI to connect to * @param headers Any additional headers to include in the upgrade request. This must include an <code>Upgrade</code> header that specifies the type of upgrade being performed * @param openListener The open listener that is invoked once the HTTP upgrade is done * @param bindListener The bind listener that is invoked when the socket is bound * @param optionMap The option map for the connection * @param handshakeChecker A handshake checker that can be supplied to verify that the server returned a valid response to the upgrade request * @return An IoFuture of the connection */
Perform a HTTP upgrade that results in a SSL secured connection. This method should be used if the target endpoint is using https
performUpgrade
{ "repo_name": "xnio/xnio", "path": "api/src/main/java/org/xnio/http/HttpUpgrade.java", "license": "apache-2.0", "size": 25849 }
[ "java.net.InetSocketAddress", "java.util.Map", "org.xnio.ChannelListener", "org.xnio.IoFuture", "org.xnio.OptionMap", "org.xnio.XnioWorker", "org.xnio.channels.BoundChannel", "org.xnio.ssl.SslConnection", "org.xnio.ssl.XnioSsl" ]
import java.net.InetSocketAddress; import java.util.Map; import org.xnio.ChannelListener; import org.xnio.IoFuture; import org.xnio.OptionMap; import org.xnio.XnioWorker; import org.xnio.channels.BoundChannel; import org.xnio.ssl.SslConnection; import org.xnio.ssl.XnioSsl;
import java.net.*; import java.util.*; import org.xnio.*; import org.xnio.channels.*; import org.xnio.ssl.*;
[ "java.net", "java.util", "org.xnio", "org.xnio.channels", "org.xnio.ssl" ]
java.net; java.util; org.xnio; org.xnio.channels; org.xnio.ssl;
1,346,956
public CursorAdapter getSuggestionsAdapter() { return mSuggestionsAdapter; }
CursorAdapter function() { return mSuggestionsAdapter; }
/** * Returns the adapter used for suggestions, if any. * @return the suggestions adapter */
Returns the adapter used for suggestions, if any
getSuggestionsAdapter
{ "repo_name": "treasure-lau/CSipSimple", "path": "actionbarsherlock-library/src/main/java/com/actionbarsherlock/widget/SearchView.java", "license": "gpl-3.0", "size": 71183 }
[ "android.support.v4.widget.CursorAdapter" ]
import android.support.v4.widget.CursorAdapter;
import android.support.v4.widget.*;
[ "android.support" ]
android.support;
538,094
@NonNull public @EntityType String getEntity(int index) { return mEntityConfidence.getEntities().get(index); }
@EntityType String function(int index) { return mEntityConfidence.getEntities().get(index); }
/** * Returns the entity at the specified index. Entities are ordered from high confidence * to low confidence. * * @throws IndexOutOfBoundsException if the specified index is out of range. * @see #getEntityCount() for the number of entities available. */
Returns the entity at the specified index. Entities are ordered from high confidence to low confidence
getEntity
{ "repo_name": "aosp-mirror/platform_frameworks_support", "path": "textclassifier/src/main/java/androidx/textclassifier/TextSelection.java", "license": "apache-2.0", "size": 9395 }
[ "androidx.textclassifier.TextClassifier" ]
import androidx.textclassifier.TextClassifier;
import androidx.textclassifier.*;
[ "androidx.textclassifier" ]
androidx.textclassifier;
2,720,671
final boolean isAnnotatedAsSingleton() { return (type != null && type.getAnnotation(Singleton.class) != null); } /** * {@inheritDoc}
final boolean isAnnotatedAsSingleton() { return (type != null && type.getAnnotation(Singleton.class) != null); } /** * {@inheritDoc}
/** * Returns information whatever the bound type is annotated by {@link Singleton} annotation - this * type is always singleton. * * @return <code>true</code> if bound type is annotated by {@link Singleton} annotation; * <code>false</code> otherwise. */
Returns information whatever the bound type is annotated by <code>Singleton</code> annotation - this type is always singleton
isAnnotatedAsSingleton
{ "repo_name": "mrfranta/jop", "path": "jop-impl/src/main/java/cz/zcu/kiv/jop/factory/binding/BindingImpl.java", "license": "apache-2.0", "size": 10747 }
[ "javax.inject.Singleton" ]
import javax.inject.Singleton;
import javax.inject.*;
[ "javax.inject" ]
javax.inject;
390,983
protected WFSCountResponse getWfsFeatureCount(HttpRequestBase method) throws PortalServiceException { try (InputStream responseStream = httpServiceCaller.getMethodResponseAsStream(method)) { Document responseDoc = DOMUtil.buildDomFromStream(responseStream); OWSExceptionParser.checkForExceptionResponse(responseDoc); XPathExpression xPath = DOMUtil.compileXPathExpr("wfs:FeatureCollection/@numberOfFeatures", new WFSNamespaceContext()); Node numNode = (Node) xPath.evaluate(responseDoc, XPathConstants.NODE); int numNodeValue = Integer.parseInt(numNode.getTextContent()); return new WFSCountResponse(numNodeValue); } catch (Exception ex) { throw new PortalServiceException(method, ex); } finally { if (method != null) { method.releaseConnection(); } } }
WFSCountResponse function(HttpRequestBase method) throws PortalServiceException { try (InputStream responseStream = httpServiceCaller.getMethodResponseAsStream(method)) { Document responseDoc = DOMUtil.buildDomFromStream(responseStream); OWSExceptionParser.checkForExceptionResponse(responseDoc); XPathExpression xPath = DOMUtil.compileXPathExpr(STR, new WFSNamespaceContext()); Node numNode = (Node) xPath.evaluate(responseDoc, XPathConstants.NODE); int numNodeValue = Integer.parseInt(numNode.getTextContent()); return new WFSCountResponse(numNodeValue); } catch (Exception ex) { throw new PortalServiceException(method, ex); } finally { if (method != null) { method.releaseConnection(); } } }
/** * Makes a WFS GetFeature request represented by method, only the count of features will be returned * * @param method * @return * @throws PortalServiceException */
Makes a WFS GetFeature request represented by method, only the count of features will be returned
getWfsFeatureCount
{ "repo_name": "joshvote/portal-core", "path": "src/main/java/org/auscope/portal/core/services/BaseWFSService.java", "license": "gpl-3.0", "size": 12763 }
[ "java.io.InputStream", "javax.xml.xpath.XPathConstants", "javax.xml.xpath.XPathExpression", "org.apache.http.client.methods.HttpRequestBase", "org.auscope.portal.core.services.namespaces.WFSNamespaceContext", "org.auscope.portal.core.services.responses.ows.OWSExceptionParser", "org.auscope.portal.core.services.responses.wfs.WFSCountResponse", "org.auscope.portal.core.util.DOMUtil", "org.w3c.dom.Document", "org.w3c.dom.Node" ]
import java.io.InputStream; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpression; import org.apache.http.client.methods.HttpRequestBase; import org.auscope.portal.core.services.namespaces.WFSNamespaceContext; import org.auscope.portal.core.services.responses.ows.OWSExceptionParser; import org.auscope.portal.core.services.responses.wfs.WFSCountResponse; import org.auscope.portal.core.util.DOMUtil; import org.w3c.dom.Document; import org.w3c.dom.Node;
import java.io.*; import javax.xml.xpath.*; import org.apache.http.client.methods.*; import org.auscope.portal.core.services.namespaces.*; import org.auscope.portal.core.services.responses.ows.*; import org.auscope.portal.core.services.responses.wfs.*; import org.auscope.portal.core.util.*; import org.w3c.dom.*;
[ "java.io", "javax.xml", "org.apache.http", "org.auscope.portal", "org.w3c.dom" ]
java.io; javax.xml; org.apache.http; org.auscope.portal; org.w3c.dom;
194,516
protected static OutputValueRenderer getOutputValueRenderer(Class type, RendererMetaOptions options) { if (type.isArray()) { type = type.getComponentType(); } if (type == String.class || type == Character.class || type == char.class || type.isEnum() || (!JavaClassHelper.isNumeric(type) && JavaClassHelper.getBoxedType(type) != Boolean.class)) { if (options.isXmlOutput()) { return xmlStringOutput; } else { return jsonStringOutput; } } else { return baseOutput; } }
static OutputValueRenderer function(Class type, RendererMetaOptions options) { if (type.isArray()) { type = type.getComponentType(); } if (type == String.class type == Character.class type == char.class type.isEnum() (!JavaClassHelper.isNumeric(type) && JavaClassHelper.getBoxedType(type) != Boolean.class)) { if (options.isXmlOutput()) { return xmlStringOutput; } else { return jsonStringOutput; } } else { return baseOutput; } }
/** * Returns a renderer for an output value. * @param type to render * @param options options * @return renderer */
Returns a renderer for an output value
getOutputValueRenderer
{ "repo_name": "b-cuts/esper", "path": "esper/src/main/java/com/espertech/esper/event/util/OutputValueRendererFactory.java", "license": "gpl-2.0", "size": 2065 }
[ "com.espertech.esper.util.JavaClassHelper" ]
import com.espertech.esper.util.JavaClassHelper;
import com.espertech.esper.util.*;
[ "com.espertech.esper" ]
com.espertech.esper;
2,410,682
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<Void>, Void> beginRevert( String resourceGroupName, String accountName, String poolName, String volumeName, VolumeRevert body);
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<Void>, Void> beginRevert( String resourceGroupName, String accountName, String poolName, String volumeName, VolumeRevert body);
/** * Revert a volume to the snapshot specified in the body. * * @param resourceGroupName The name of the resource group. * @param accountName The name of the NetApp account. * @param poolName The name of the capacity pool. * @param volumeName The name of the volume. * @param body Object for snapshot to revert supplied in the body of the operation. * @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 SyncPoller} for polling of long-running operation. */
Revert a volume to the snapshot specified in the body
beginRevert
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/VolumesClient.java", "license": "mit", "size": 47258 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.management.polling.PollResult", "com.azure.core.util.polling.SyncPoller", "com.azure.resourcemanager.netapp.models.VolumeRevert" ]
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.SyncPoller; import com.azure.resourcemanager.netapp.models.VolumeRevert;
import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.netapp.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,544,444
public FeDb getDb(String dbName, Privilege privilege) throws AnalysisException { return getDb(dbName, privilege, true); }
FeDb function(String dbName, Privilege privilege) throws AnalysisException { return getDb(dbName, privilege, true); }
/** * If the database does not exist in the catalog an AnalysisError is thrown. * This method does not require the grant option permission. */
If the database does not exist in the catalog an AnalysisError is thrown. This method does not require the grant option permission
getDb
{ "repo_name": "cloudera/Impala", "path": "fe/src/main/java/org/apache/impala/analysis/Analyzer.java", "license": "apache-2.0", "size": 116695 }
[ "org.apache.impala.authorization.Privilege", "org.apache.impala.catalog.FeDb", "org.apache.impala.common.AnalysisException" ]
import org.apache.impala.authorization.Privilege; import org.apache.impala.catalog.FeDb; import org.apache.impala.common.AnalysisException;
import org.apache.impala.authorization.*; import org.apache.impala.catalog.*; import org.apache.impala.common.*;
[ "org.apache.impala" ]
org.apache.impala;
1,280,552
@ServiceMethod(returns = ReturnType.SINGLE) public ProfileInner create(String resourceGroupName, String profileName, ProfileInner profile) { return createAsync(resourceGroupName, profileName, profile).block(); }
@ServiceMethod(returns = ReturnType.SINGLE) ProfileInner function(String resourceGroupName, String profileName, ProfileInner profile) { return createAsync(resourceGroupName, profileName, profile).block(); }
/** * Creates a new CDN profile with a profile name under the specified subscription and resource group. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param profile CDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider * and pricing tier. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and * pricing tier. */
Creates a new CDN profile with a profile name under the specified subscription and resource group
create
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/implementation/ProfilesClientImpl.java", "license": "mit", "size": 111257 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.cdn.fluent.models.ProfileInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.cdn.fluent.models.ProfileInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.cdn.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
809,363
@SimpleFunction(description="Set the time to be shown in the Time Picker popup. Current time is shown by default.") public void SetTimeToDisplay(int hour, int minute) { if ((hour < 0) || (hour > 23)) { form.dispatchErrorOccurredEvent(this, "SetTimeToDisplay", ErrorMessages.ERROR_ILLEGAL_HOUR); } else if ((minute < 0) || (minute > 59)) { form.dispatchErrorOccurredEvent(this, "SetTimeToDisplay", ErrorMessages.ERROR_ILLEGAL_MINUTE); } else { time.updateTime(hour, minute); instant = Dates.TimeInstant(hour, minute); customTime = true; } } /** * Allows the instant to set the hour and minute to be displayed when the `TimePicker` opens. * Instants are used in [`Clock`](sensors.html#Clock), {@link DatePicker}, and {@link TimePicker}
@SimpleFunction(description=STR) void function(int hour, int minute) { if ((hour < 0) (hour > 23)) { form.dispatchErrorOccurredEvent(this, STR, ErrorMessages.ERROR_ILLEGAL_HOUR); } else if ((minute < 0) (minute > 59)) { form.dispatchErrorOccurredEvent(this, STR, ErrorMessages.ERROR_ILLEGAL_MINUTE); } else { time.updateTime(hour, minute); instant = Dates.TimeInstant(hour, minute); customTime = true; } } /** * Allows the instant to set the hour and minute to be displayed when the `TimePicker` opens. * Instants are used in [`Clock`](sensors.html#Clock), {@link DatePicker}, and {@link TimePicker}
/** * Allows the user to set the time to be displayed when the `TimePicker` opens. Valid values for * the hour field are 0-23 and 0-59 for the second field. * @param hour * @param minute */
Allows the user to set the time to be displayed when the `TimePicker` opens. Valid values for the hour field are 0-23 and 0-59 for the second field
SetTimeToDisplay
{ "repo_name": "kkashi01/appinventor-sources", "path": "appinventor/components/src/com/google/appinventor/components/runtime/TimePicker.java", "license": "apache-2.0", "size": 7010 }
[ "com.google.appinventor.components.annotations.SimpleFunction", "com.google.appinventor.components.runtime.util.Dates", "com.google.appinventor.components.runtime.util.ErrorMessages" ]
import com.google.appinventor.components.annotations.SimpleFunction; import com.google.appinventor.components.runtime.util.Dates; import com.google.appinventor.components.runtime.util.ErrorMessages;
import com.google.appinventor.components.annotations.*; import com.google.appinventor.components.runtime.util.*;
[ "com.google.appinventor" ]
com.google.appinventor;
851,280
public String getText(Object object) { String label = ((MdfAssociation)object).getName(); return label == null || label.length() == 0 ? getString("_UI_MdfAssociation_type") : label; }
String function(Object object) { String label = ((MdfAssociation)object).getName(); return label == null label.length() == 0 ? getString(STR) : label; }
/** * This returns the label text for the adapted class. */
This returns the label text for the adapted class
getText
{ "repo_name": "debabratahazra/DS", "path": "designstudio/components/domain/ui/com.odcgroup.mdf.editor/source/com/odcgroup/mdf/editor/ui/editors/providers/MdfAssociationItemProvider.java", "license": "epl-1.0", "size": 9178 }
[ "com.odcgroup.mdf.metamodel.MdfAssociation" ]
import com.odcgroup.mdf.metamodel.MdfAssociation;
import com.odcgroup.mdf.metamodel.*;
[ "com.odcgroup.mdf" ]
com.odcgroup.mdf;
2,824,211
public void fireEvent(String elementRef,final String type, final Map<String, Object> data,final Map<String, Object> domChanges){ fireEvent(elementRef, type, data, domChanges, null); }
void function(String elementRef,final String type, final Map<String, Object> data,final Map<String, Object> domChanges){ fireEvent(elementRef, type, data, domChanges, null); }
/** * Fire event callback on a element. * @param elementRef * @param type * @param data * @param domChanges */
Fire event callback on a element
fireEvent
{ "repo_name": "xiayun200825/weex", "path": "android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java", "license": "apache-2.0", "size": 55202 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
803,741
private UserTransaction getUserTransaction() { if (!cacheUserTransaction) { if (log.isDebugEnabled()) { log.debug("Acquiring a new UserTransaction for event adaptor : " + eventAdaptorName); } try { context = getInitialContext(); return JMSUtils.lookup(context, UserTransaction.class, getUserTransactionJNDIName()); } catch (NamingException e) { handleException("Error looking up UserTransaction : " + getUserTransactionJNDIName() + " using JNDI properties : " + jmsProperties, e); } } if (sharedUserTransaction == null) { try { context = getInitialContext(); sharedUserTransaction = JMSUtils.lookup(context, UserTransaction.class, getUserTransactionJNDIName()); if (log.isDebugEnabled()) { log.debug("Acquired shared UserTransaction for event adator : " + eventAdaptorName); } } catch (NamingException e) { handleException("Error looking up UserTransaction : " + getUserTransactionJNDIName() + " using JNDI properties : " + jmsProperties, e); } } return sharedUserTransaction; }
UserTransaction function() { if (!cacheUserTransaction) { if (log.isDebugEnabled()) { log.debug(STR + eventAdaptorName); } try { context = getInitialContext(); return JMSUtils.lookup(context, UserTransaction.class, getUserTransactionJNDIName()); } catch (NamingException e) { handleException(STR + getUserTransactionJNDIName() + STR + jmsProperties, e); } } if (sharedUserTransaction == null) { try { context = getInitialContext(); sharedUserTransaction = JMSUtils.lookup(context, UserTransaction.class, getUserTransactionJNDIName()); if (log.isDebugEnabled()) { log.debug(STR + eventAdaptorName); } } catch (NamingException e) { handleException(STR + getUserTransactionJNDIName() + STR + jmsProperties, e); } } return sharedUserTransaction; }
/** * The UserTransaction to be used, looked up from the JNDI * * @return The UserTransaction to be used, looked up from the JNDI */
The UserTransaction to be used, looked up from the JNDI
getUserTransaction
{ "repo_name": "lankavitharana/carbon-event-processing", "path": "components/adaptors/event-input-adaptor/org.wso2.carbon.event.input.adaptor.jms/src/main/java/org/wso2/carbon/event/input/adaptor/jms/internal/util/JMSTaskManager.java", "license": "apache-2.0", "size": 49739 }
[ "javax.naming.NamingException", "javax.transaction.UserTransaction" ]
import javax.naming.NamingException; import javax.transaction.UserTransaction;
import javax.naming.*; import javax.transaction.*;
[ "javax.naming", "javax.transaction" ]
javax.naming; javax.transaction;
1,858,923
public static final Function<String,BigInteger> toBigInteger(final DecimalPoint decimalPoint) { return new ToBigInteger(decimalPoint); }
static final Function<String,BigInteger> function(final DecimalPoint decimalPoint) { return new ToBigInteger(decimalPoint); }
/** * <p> * Converts a String into a BigInteger, using the specified decimal point * configuration ({@link DecimalPoint}). The target String should contain no * thousand separators. * Any fractional part of the input String will be removed. * </p> * * @param decimalPoint the decimal point being used by the String * @return the resulting BigInteger object */
Converts a String into a BigInteger, using the specified decimal point configuration (<code>DecimalPoint</code>). The target String should contain no thousand separators. Any fractional part of the input String will be removed.
toBigInteger
{ "repo_name": "op4j/op4j", "path": "src/main/java/org/op4j/functions/FnString.java", "license": "apache-2.0", "size": 242735 }
[ "java.math.BigInteger", "org.op4j.functions.FnStringAuxNumberConverters" ]
import java.math.BigInteger; import org.op4j.functions.FnStringAuxNumberConverters;
import java.math.*; import org.op4j.functions.*;
[ "java.math", "org.op4j.functions" ]
java.math; org.op4j.functions;
2,233,713
@Test @Ignore public void testJoinAndAddToEnsemble() throws Exception { System.err.println(CommandSupport.executeCommand("fabric:create --force --clean -n")); //System.out.println(executeCommand("shell:info")); //System.out.println(executeCommand("fabric:info")); //System.out.println(executeCommand("fabric:profile-list")); BundleContext moduleContext = ServiceLocator.getSystemContext(); ServiceProxy<FabricService> fabricProxy = ServiceProxy.createServiceProxy(moduleContext, FabricService.class); try { FabricService fabricService = fabricProxy.getService(); AdminService adminService = ServiceLocator.awaitService(AdminService.class); String version = System.getProperty("fabric.version"); System.out.println(CommandSupport.executeCommand("admin:create --featureURL mvn:io.fabric8/fabric8-karaf/" + version + "/xml/features --feature fabric-git --feature fabric-agent --feature fabric-boot-commands basic_cnt_f")); System.out.println(CommandSupport.executeCommand("admin:create --featureURL mvn:io.fabric8/fabric8-karaf/" + version + "/xml/features --feature fabric-git --feature fabric-agent --feature fabric-boot-commands basic_cnt_g")); try { System.out.println(CommandSupport.executeCommand("admin:start basic_cnt_f")); System.out.println(CommandSupport.executeCommand("admin:start basic_cnt_g")); ProvisionSupport.instanceStarted(Arrays.asList("basic_cnt_f", "basic_cnt_g"), ProvisionSupport.PROVISION_TIMEOUT); System.out.println(CommandSupport.executeCommand("admin:list")); String joinCommand = "fabric:join -f --zookeeper-password "+ fabricService.getZookeeperPassword() +" " + fabricService.getZookeeperUrl(); String response = ""; for (int i = 0; i < 10 && !response.contains("true"); i++) { response = CommandSupport.executeCommand("ssh:ssh -l karaf -P karaf -p " + adminService.getInstance("basic_cnt_f").getSshPort() + " localhost " + WAIT_FOR_JOIN_SERVICE); Thread.sleep(1000); } response = ""; for (int i = 0; i < 10 && !response.contains("true"); i++) { response = CommandSupport.executeCommand("ssh:ssh -l karaf -P karaf -p " + adminService.getInstance("basic_cnt_g").getSshPort() + " localhost " + WAIT_FOR_JOIN_SERVICE); Thread.sleep(1000); } System.err.println(CommandSupport.executeCommand("ssh:ssh -l karaf -P karaf -p " + adminService.getInstance("basic_cnt_f").getSshPort() + " localhost " + joinCommand)); System.err.println(CommandSupport.executeCommand("ssh:ssh -l karaf -P karaf -p " + adminService.getInstance("basic_cnt_g").getSshPort() + " localhost " + joinCommand)); ProvisionSupport.containersExist(Arrays.asList("basic_cnt_f", "basic_cnt_g"), ProvisionSupport.PROVISION_TIMEOUT); Container cntF = fabricService.getContainer("basic_cnt_f"); Container cntG = fabricService.getContainer("basic_cnt_g"); ProvisionSupport.containerStatus(Arrays.asList(cntF, cntG), "success", ProvisionSupport.PROVISION_TIMEOUT); EnsembleSupport.addToEnsemble(fabricService, cntF, cntG); System.out.println(CommandSupport.executeCommand("fabric:container-list")); EnsembleSupport.removeFromEnsemble(fabricService, cntF, cntG); System.out.println(CommandSupport.executeCommand("fabric:container-list")); } finally { System.out.println(CommandSupport.executeCommand("admin:stop basic_cnt_f")); System.out.println(CommandSupport.executeCommand("admin:stop basic_cnt_g")); } } finally { fabricProxy.close(); } }
void function() throws Exception { System.err.println(CommandSupport.executeCommand(STR)); BundleContext moduleContext = ServiceLocator.getSystemContext(); ServiceProxy<FabricService> fabricProxy = ServiceProxy.createServiceProxy(moduleContext, FabricService.class); try { FabricService fabricService = fabricProxy.getService(); AdminService adminService = ServiceLocator.awaitService(AdminService.class); String version = System.getProperty(STR); System.out.println(CommandSupport.executeCommand(STR + version + STR)); System.out.println(CommandSupport.executeCommand(STR + version + STR)); try { System.out.println(CommandSupport.executeCommand(STR)); System.out.println(CommandSupport.executeCommand(STR)); ProvisionSupport.instanceStarted(Arrays.asList(STR, STR), ProvisionSupport.PROVISION_TIMEOUT); System.out.println(CommandSupport.executeCommand(STR)); String joinCommand = STR+ fabricService.getZookeeperPassword() +" " + fabricService.getZookeeperUrl(); String response = STRtrueSTRssh:ssh -l karaf -P karaf -p " + adminService.getInstance(STR).getSshPort() + " localhost " + WAIT_FOR_JOIN_SERVICE); Thread.sleep(1000); } response = STRtrueSTRssh:ssh -l karaf -P karaf -p " + adminService.getInstance(STR).getSshPort() + " localhost STRssh:ssh -l karaf -P karaf -p " + adminService.getInstance(STR).getSshPort() + " localhost STRssh:ssh -l karaf -P karaf -p " + adminService.getInstance(STR).getSshPort() + " localhost " + joinCommand)); ProvisionSupport.containersExist(Arrays.asList(STR, STR), ProvisionSupport.PROVISION_TIMEOUT); Container cntF = fabricService.getContainer(STR); Container cntG = fabricService.getContainer(STR); ProvisionSupport.containerStatus(Arrays.asList(cntF, cntG), "successSTRfabric:container-listSTRfabric:container-listSTRadmin:stop basic_cnt_fSTRadmin:stop basic_cnt_g")); } } finally { fabricProxy.close(); } }
/** * This is a test for FABRIC-353. */
This is a test for FABRIC-353
testJoinAndAddToEnsemble
{ "repo_name": "jonathanchristison/fabric8", "path": "itests/basic/karaf/src/test/java/io/fabric8/itests/basic/karaf/ExtendedJoinTest.java", "license": "apache-2.0", "size": 7130 }
[ "io.fabric8.api.Container", "io.fabric8.api.FabricService", "io.fabric8.api.gravia.ServiceLocator", "io.fabric8.itests.support.CommandSupport", "io.fabric8.itests.support.ProvisionSupport", "io.fabric8.itests.support.ServiceProxy", "java.util.Arrays", "org.apache.karaf.admin.AdminService", "org.osgi.framework.BundleContext" ]
import io.fabric8.api.Container; import io.fabric8.api.FabricService; import io.fabric8.api.gravia.ServiceLocator; import io.fabric8.itests.support.CommandSupport; import io.fabric8.itests.support.ProvisionSupport; import io.fabric8.itests.support.ServiceProxy; import java.util.Arrays; import org.apache.karaf.admin.AdminService; import org.osgi.framework.BundleContext;
import io.fabric8.api.*; import io.fabric8.api.gravia.*; import io.fabric8.itests.support.*; import java.util.*; import org.apache.karaf.admin.*; import org.osgi.framework.*;
[ "io.fabric8.api", "io.fabric8.itests", "java.util", "org.apache.karaf", "org.osgi.framework" ]
io.fabric8.api; io.fabric8.itests; java.util; org.apache.karaf; org.osgi.framework;
294,286
@Test public void testGetScope_1() throws Exception { ScriptFilterAction fixture = new ScriptFilterAction(); fixture.setKey(""); fixture.setValue(""); fixture.setAction(ScriptFilterActionType.add); fixture.setScope(""); String result = fixture.getScope(); assertEquals("", result); }
void function() throws Exception { ScriptFilterAction fixture = new ScriptFilterAction(); fixture.setKey(STRSTRSTR", result); }
/** * Run the String getScope() method test. * * @throws Exception * * @generatedBy CodePro at 12/15/14 1:34 PM */
Run the String getScope() method test
testGetScope_1
{ "repo_name": "kevinmcgoldrick/Tank", "path": "data_model/src/test/java/com/intuit/tank/project/ScriptFilterActionTest.java", "license": "epl-1.0", "size": 9432 }
[ "com.intuit.tank.project.ScriptFilterAction" ]
import com.intuit.tank.project.ScriptFilterAction;
import com.intuit.tank.project.*;
[ "com.intuit.tank" ]
com.intuit.tank;
332,737
private ECPublicKey createPublicEncryptionKey (BigInteger x, BigInteger y) { try { java.security.spec.ECPoint w = new java.security.spec.ECPoint(x, y); ECNamedCurveParameterSpec params = ECNamedCurveTable.getParameterSpec(CURVE); KeyFactory fact = KeyFactory.getInstance(ALGORITHM_ECDSA, PROVIDER); ECCurve curve = params.getCurve(); java.security.spec.EllipticCurve ellipticCurve = EC5Util.convertCurve(curve, params.getSeed()); java.security.spec.ECParameterSpec params2 = EC5Util.convertSpec(ellipticCurve, params); java.security.spec.ECPublicKeySpec keySpec = new java.security.spec.ECPublicKeySpec(w, params2); return (ECPublicKey) fact.generatePublic(keySpec); } catch (InvalidKeySpecException e) { throw new RuntimeException("InvalidKeySpecException occurred in CryptProcessor.createPublicEncryptionKey()", e); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("NoSuchAlgorithmException occurred in CryptProcessor.createPublicEncryptionKey()", e); } catch (NoSuchProviderException e) { throw new RuntimeException("NoSuchProviderException occurred in CryptProcessor.createPublicEncryptionKey()", e); } }
ECPublicKey function (BigInteger x, BigInteger y) { try { java.security.spec.ECPoint w = new java.security.spec.ECPoint(x, y); ECNamedCurveParameterSpec params = ECNamedCurveTable.getParameterSpec(CURVE); KeyFactory fact = KeyFactory.getInstance(ALGORITHM_ECDSA, PROVIDER); ECCurve curve = params.getCurve(); java.security.spec.EllipticCurve ellipticCurve = EC5Util.convertCurve(curve, params.getSeed()); java.security.spec.ECParameterSpec params2 = EC5Util.convertSpec(ellipticCurve, params); java.security.spec.ECPublicKeySpec keySpec = new java.security.spec.ECPublicKeySpec(w, params2); return (ECPublicKey) fact.generatePublic(keySpec); } catch (InvalidKeySpecException e) { throw new RuntimeException(STR, e); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(STR, e); } catch (NoSuchProviderException e) { throw new RuntimeException(STR, e); } }
/** * Creates an ECPublicKey with the given coordinates. The key will have valid parameters. * * @param x - A BigInteger object denoting the x coordinate on the curve. * @param y -A BigInteger object denoting the y coordinate on the curve. * * @return An ECPublicKey object with the given coordinates. */
Creates an ECPublicKey with the given coordinates. The key will have valid parameters
createPublicEncryptionKey
{ "repo_name": "loki-sama/bitseal", "path": "src/org/bitseal/crypt/CryptProcessor.java", "license": "gpl-3.0", "size": 12430 }
[ "java.math.BigInteger", "java.security.KeyFactory", "java.security.NoSuchAlgorithmException", "java.security.NoSuchProviderException", "java.security.spec.InvalidKeySpecException", "org.spongycastle.jce.ECNamedCurveTable", "org.spongycastle.jce.interfaces.ECPublicKey", "org.spongycastle.jce.provider.asymmetric.ec.EC5Util", "org.spongycastle.jce.spec.ECNamedCurveParameterSpec", "org.spongycastle.math.ec.ECCurve", "org.spongycastle.math.ec.ECPoint" ]
import java.math.BigInteger; import java.security.KeyFactory; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.spec.InvalidKeySpecException; import org.spongycastle.jce.ECNamedCurveTable; import org.spongycastle.jce.interfaces.ECPublicKey; import org.spongycastle.jce.provider.asymmetric.ec.EC5Util; import org.spongycastle.jce.spec.ECNamedCurveParameterSpec; import org.spongycastle.math.ec.ECCurve; import org.spongycastle.math.ec.ECPoint;
import java.math.*; import java.security.*; import java.security.spec.*; import org.spongycastle.jce.*; import org.spongycastle.jce.interfaces.*; import org.spongycastle.jce.provider.asymmetric.ec.*; import org.spongycastle.jce.spec.*; import org.spongycastle.math.ec.*;
[ "java.math", "java.security", "org.spongycastle.jce", "org.spongycastle.math" ]
java.math; java.security; org.spongycastle.jce; org.spongycastle.math;
2,505,206
public void draw(Color color) { if (curve == null) return; // peppysliders if (Options.getSkin().getSliderStyle() == Skin.STYLE_PEPPYSLIDER || !mmsliderSupported) { Image hitCircle = GameImage.HITCIRCLE.getImage(); Image hitCircleOverlay = GameImage.HITCIRCLE_OVERLAY.getImage(); for (int i = 0; i < curve.length; i++) hitCircleOverlay.drawCentered(curve[i].x, curve[i].y, Colors.WHITE_FADE); for (int i = 0; i < curve.length; i++) hitCircle.drawCentered(curve[i].x, curve[i].y, color); } // mmsliders else { if (renderState == null) renderState = new CurveRenderState(hitObject); renderState.draw(color, borderColor, curve); } }
void function(Color color) { if (curve == null) return; if (Options.getSkin().getSliderStyle() == Skin.STYLE_PEPPYSLIDER !mmsliderSupported) { Image hitCircle = GameImage.HITCIRCLE.getImage(); Image hitCircleOverlay = GameImage.HITCIRCLE_OVERLAY.getImage(); for (int i = 0; i < curve.length; i++) hitCircleOverlay.drawCentered(curve[i].x, curve[i].y, Colors.WHITE_FADE); for (int i = 0; i < curve.length; i++) hitCircle.drawCentered(curve[i].x, curve[i].y, color); } else { if (renderState == null) renderState = new CurveRenderState(hitObject); renderState.draw(color, borderColor, curve); } }
/** * Draws the full curve to the graphics context. * @param color the color filter */
Draws the full curve to the graphics context
draw
{ "repo_name": "Lucki/opsu", "path": "src/itdelatrisu/opsu/objects/curves/Curve.java", "license": "gpl-3.0", "size": 4823 }
[ "org.newdawn.slick.Color", "org.newdawn.slick.Image" ]
import org.newdawn.slick.Color; import org.newdawn.slick.Image;
import org.newdawn.slick.*;
[ "org.newdawn.slick" ]
org.newdawn.slick;
488,687
if (!registered) { registered = true; TypeRegistry.DEFAULT.register(ModelSerializer.class); TypeRegistry.DEFAULT.register(ModelDeserializer.class); } }
if (!registered) { registered = true; TypeRegistry.DEFAULT.register(ModelSerializer.class); TypeRegistry.DEFAULT.register(ModelDeserializer.class); } }
/** * Registers the model serialization and instantiators. */
Registers the model serialization and instantiators
register
{ "repo_name": "SSEHUB/EASyProducer", "path": "Plugins/Instantiation/Model.persistency/src/net/ssehub/easy/instantiation/serializer/xml/Registration.java", "license": "apache-2.0", "size": 2648 }
[ "net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry" ]
import net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry;
import net.ssehub.easy.instantiation.core.model.*;
[ "net.ssehub.easy" ]
net.ssehub.easy;
875,079
public Builder loadFromPath(Path path) throws IOException { // NOTE: loadFromStream will close the input stream return loadFromStream(path.getFileName().toString(), Files.newInputStream(path)); }
Builder function(Path path) throws IOException { return loadFromStream(path.getFileName().toString(), Files.newInputStream(path)); }
/** * Loads settings from a url that represents them using the * {@link SettingsLoaderFactory#loaderFromResource(String)}. */
Loads settings from a url that represents them using the <code>SettingsLoaderFactory#loaderFromResource(String)</code>
loadFromPath
{ "repo_name": "fuchao01/elasticsearch", "path": "core/src/main/java/org/elasticsearch/common/settings/Settings.java", "license": "apache-2.0", "size": 52409 }
[ "java.io.IOException", "java.nio.file.Files", "java.nio.file.Path" ]
import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path;
import java.io.*; import java.nio.file.*;
[ "java.io", "java.nio" ]
java.io; java.nio;
1,345,495
@Override public boolean equals(Object o) { boolean result; if (this == o) { result = true; } else if (o == null || getClass() != o.getClass()) { result = false; } else { Car car = (Car) o; result = id == car.id && Objects.equals(name, car.name); } return result; }
boolean function(Object o) { boolean result; if (this == o) { result = true; } else if (o == null getClass() != o.getClass()) { result = false; } else { Car car = (Car) o; result = id == car.id && Objects.equals(name, car.name); } return result; }
/** * Checks equality by id and name. * @param o - object to compare. * @return - result. */
Checks equality by id and name
equals
{ "repo_name": "wamdue/agorbunov", "path": "chapter_010/src/main/java/ru/job4j/mapping/carshop/entity/Car.java", "license": "apache-2.0", "size": 5970 }
[ "java.util.Objects" ]
import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
1,511,866
static private boolean verifyDisjunctGlobalAndStack(LogManager pLogger, CLangSMG pSmg) { ArrayDeque<CLangStackFrame> stack_frames = pSmg.getStackFrames(); Set<SMGObject> stack = new HashSet<>(); for (CLangStackFrame frame: stack_frames) { stack.addAll(frame.getAllObjects()); } Map<String, SMGRegion> globals = pSmg.getGlobalObjects(); boolean toReturn = Collections.disjoint(stack, globals.values()); if (! toReturn) { pLogger.log(Level.SEVERE, "CLangSMG inconsistent, global and stack objects are not disjoint"); } return toReturn; }
static boolean function(LogManager pLogger, CLangSMG pSmg) { ArrayDeque<CLangStackFrame> stack_frames = pSmg.getStackFrames(); Set<SMGObject> stack = new HashSet<>(); for (CLangStackFrame frame: stack_frames) { stack.addAll(frame.getAllObjects()); } Map<String, SMGRegion> globals = pSmg.getGlobalObjects(); boolean toReturn = Collections.disjoint(stack, globals.values()); if (! toReturn) { pLogger.log(Level.SEVERE, STR); } return toReturn; }
/** * Verifies that global and stack object sets are disjunct * * @param pLogger Logger to log the message * @param pSmg SMG to check * @return True if {@link pSmg} is consistent w.r.t. this criteria. False otherwise. */
Verifies that global and stack object sets are disjunct
verifyDisjunctGlobalAndStack
{ "repo_name": "nishanttotla/predator", "path": "cpachecker/src/org/sosy_lab/cpachecker/cpa/smg/CLangSMG.java", "license": "gpl-3.0", "size": 23467 }
[ "java.util.ArrayDeque", "java.util.Collections", "java.util.HashSet", "java.util.Map", "java.util.Set", "java.util.logging.Level", "org.sosy_lab.common.log.LogManager", "org.sosy_lab.cpachecker.cpa.smg.objects.SMGObject", "org.sosy_lab.cpachecker.cpa.smg.objects.SMGRegion" ]
import java.util.ArrayDeque; import java.util.Collections; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.logging.Level; import org.sosy_lab.common.log.LogManager; import org.sosy_lab.cpachecker.cpa.smg.objects.SMGObject; import org.sosy_lab.cpachecker.cpa.smg.objects.SMGRegion;
import java.util.*; import java.util.logging.*; import org.sosy_lab.common.log.*; import org.sosy_lab.cpachecker.cpa.smg.objects.*;
[ "java.util", "org.sosy_lab.common", "org.sosy_lab.cpachecker" ]
java.util; org.sosy_lab.common; org.sosy_lab.cpachecker;
1,718,544
@ApiModelProperty(value = "The retailerId") public String getRetailerId() { return retailerId; }
@ApiModelProperty(value = STR) String function() { return retailerId; }
/** * The retailerId * @return retailerId **/
The retailerId
getRetailerId
{ "repo_name": "iterate-ch/cyberduck", "path": "storegate/src/main/java/ch/cyberduck/core/storegate/io/swagger/client/model/RegistrationInformationSubuser.java", "license": "gpl-3.0", "size": 8309 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
2,612,498
private void logRequest(HttpServletRequest req, Session session) { StringBuilder buf = new StringBuilder(); buf.append(getRealClientIpAddr(req)).append(" "); if (session != null && session.getUser() != null) { buf.append(session.getUser().getUserId()).append(" "); } else { buf.append(" - ").append(" "); } buf.append("\""); buf.append(req.getMethod()).append(" "); buf.append(req.getRequestURI()).append(" "); if (req.getQueryString() != null) { buf.append(req.getQueryString()).append(" "); } else { buf.append("-").append(" "); } buf.append(req.getProtocol()).append("\" "); String userAgent = req.getHeader("User-Agent"); if (shouldLogRawUserAgent) { buf.append(userAgent); } else { // simply log a short string to indicate browser or not if (StringUtils.isFromBrowser(userAgent)) { buf.append("browser"); } else { buf.append("not-browser"); } } logger.info(buf.toString()); }
void function(HttpServletRequest req, Session session) { StringBuilder buf = new StringBuilder(); buf.append(getRealClientIpAddr(req)).append(" "); if (session != null && session.getUser() != null) { buf.append(session.getUser().getUserId()).append(" "); } else { buf.append(STR).append(" "); } buf.append("\"STR STR STR STR-STR STR\" "); String userAgent = req.getHeader(STR); if (shouldLogRawUserAgent) { buf.append(userAgent); } else { if (StringUtils.isFromBrowser(userAgent)) { buf.append("browserSTRnot-browser"); } } logger.info(buf.toString()); }
/** * Log out request - the format should be close to Apache access log format * * @param req * @param session */
Log out request - the format should be close to Apache access log format
logRequest
{ "repo_name": "mariacioffi/azkaban", "path": "azkaban-web-server/src/main/java/azkaban/webapp/servlet/LoginAbstractAzkabanServlet.java", "license": "apache-2.0", "size": 14577 }
[ "javax.servlet.http.HttpServletRequest" ]
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
2,691,291
@Nonnull default Promise<Void> run(@Nonnull Runnable runnable) { Objects.requireNonNull(runnable, "runnable"); return Promise.supplying(getContext(), Delegates.runnableToSupplier(runnable)); }
default Promise<Void> run(@Nonnull Runnable runnable) { Objects.requireNonNull(runnable, STR); return Promise.supplying(getContext(), Delegates.runnableToSupplier(runnable)); }
/** * Execute the passed runnable * * @param runnable the runnable * @return a Promise which will return when the runnable is complete */
Execute the passed runnable
run
{ "repo_name": "lucko/helper", "path": "helper/src/main/java/me/lucko/helper/scheduler/Scheduler.java", "license": "mit", "size": 7378 }
[ "java.util.Objects", "javax.annotation.Nonnull", "me.lucko.helper.promise.Promise", "me.lucko.helper.utils.Delegates" ]
import java.util.Objects; import javax.annotation.Nonnull; import me.lucko.helper.promise.Promise; import me.lucko.helper.utils.Delegates;
import java.util.*; import javax.annotation.*; import me.lucko.helper.promise.*; import me.lucko.helper.utils.*;
[ "java.util", "javax.annotation", "me.lucko.helper" ]
java.util; javax.annotation; me.lucko.helper;
2,054,384
public List<Map.Entry<InterfaceDoc, Set<MethodDoc>>> getInheritedMethods() { final List<Map.Entry<InterfaceDoc, Set<MethodDoc>>> result = new ArrayList<Map.Entry<InterfaceDoc, Set<MethodDoc>>>(); // Initialize the list of already seen methods final Set<String> seenMethods = new HashSet<String>(); for (final MethodDoc method : this.getMethods()) seenMethods.add(method.getName()); for (final InterfaceDoc superInterface : getAllSuperInterfaces()) { final Set<MethodDoc> methods = new TreeSet<MethodDoc>(); for (final MethodDoc method : superInterface.getMethods()) { if (seenMethods.contains(method.getName())) continue; methods.add(method); seenMethods.add(method.getName()); } if (methods.isEmpty()) continue; result.add( new AbstractMap.SimpleEntry<InterfaceDoc, Set<MethodDoc>>( superInterface, methods)); } return result; }
List<Map.Entry<InterfaceDoc, Set<MethodDoc>>> function() { final List<Map.Entry<InterfaceDoc, Set<MethodDoc>>> result = new ArrayList<Map.Entry<InterfaceDoc, Set<MethodDoc>>>(); final Set<String> seenMethods = new HashSet<String>(); for (final MethodDoc method : this.getMethods()) seenMethods.add(method.getName()); for (final InterfaceDoc superInterface : getAllSuperInterfaces()) { final Set<MethodDoc> methods = new TreeSet<MethodDoc>(); for (final MethodDoc method : superInterface.getMethods()) { if (seenMethods.contains(method.getName())) continue; methods.add(method); seenMethods.add(method.getName()); } if (methods.isEmpty()) continue; result.add( new AbstractMap.SimpleEntry<InterfaceDoc, Set<MethodDoc>>( superInterface, methods)); } return result; }
/** * Return a list of super classes with additional methods they provide. * * @return The list of super classes and the additional methods they * provide. */
Return a list of super classes with additional methods they provide
getInheritedMethods
{ "repo_name": "kayahr/jasdoc", "path": "src/main/java/de/ailis/jasdoc/doc/InterfaceDoc.java", "license": "gpl-3.0", "size": 5819 }
[ "java.util.AbstractMap", "java.util.ArrayList", "java.util.HashSet", "java.util.List", "java.util.Map", "java.util.Set", "java.util.TreeSet" ]
import java.util.AbstractMap; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet;
import java.util.*;
[ "java.util" ]
java.util;
1,451,715
boolean isRsParityFile(Path p) { String pathStr = p.toUri().getPath(); return isRsParityFile(pathStr); }
boolean isRsParityFile(Path p) { String pathStr = p.toUri().getPath(); return isRsParityFile(pathStr); }
/** * checks whether file is rs parity file */
checks whether file is rs parity file
isRsParityFile
{ "repo_name": "jchen123/hadoop-20-warehouse-fix", "path": "src/contrib/raid/src/java/org/apache/hadoop/raid/BlockFixer.java", "license": "apache-2.0", "size": 36163 }
[ "org.apache.hadoop.fs.Path" ]
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,281,242
zClans plugin = zClans.getInstance(); ClanPlayer cpn = plugin.getClanManager().getCreateClanPlayer(player.getUniqueId()); if (cpn != null && cpn.isBanned()) { ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("banned")); return; } if (plugin.getPermissionsManager().has(player, "zclans.leader.create")) { if (arg.length >= 2) { String tag = arg[0]; String cleanTag = Helper.cleanTag(arg[0]); String name = Helper.toMessage(Helper.removeFirst(arg)); boolean bypass = plugin.getPermissionsManager().has(player, "zclans.mod.bypass"); if (bypass || cleanTag.length() <= plugin.getSettingsManager().getTagMaxLength()) { if (bypass || cleanTag.length() > plugin.getSettingsManager().getTagMinLength()) { if (bypass || !plugin.getSettingsManager().hasDisallowedColor(tag)) { if (bypass || Helper.stripColors(name).length() <= plugin.getSettingsManager().getClanMaxLength()) { if (bypass || Helper.stripColors(name).length() > plugin.getSettingsManager().getClanMinLength()) { if (cleanTag.matches("[0-9a-zA-Z]*")) { if (!name.contains("&")) { if (bypass || !plugin.getSettingsManager().isDisallowedWord(cleanTag.toLowerCase())) { ClanPlayer cp = plugin.getClanManager().getClanPlayer(player); if (cp == null) { if (!plugin.getClanManager().isClan(cleanTag)) { if (plugin.getClanManager().purchaseCreation(player)) { plugin.getClanManager().createClan(player, tag, name); Clan clan = plugin.getClanManager().getClan(tag); clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("clan.created"), name)); plugin.getStorageManager().updateClan(clan); if (plugin.getSettingsManager().isRequireVerification()) { boolean verified = !plugin.getSettingsManager().isRequireVerification() || plugin.getPermissionsManager().has(player, "zclans.mod.verify"); if (!verified) { ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("get.your.clan.verified.to.access.advanced.features")); } } } } else { ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.with.this.tag.already.exists")); } } else { ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("you.must.first.resign"), cp.getClan().getName())); } } else { ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("that.tag.name.is.disallowed")); } } else { ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("your.clan.name.cannot.contain.color.codes")); } } else { ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("your.clan.tag.can.only.contain.letters.numbers.and.color.codes")); } } else { ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("your.clan.name.must.be.longer.than.characters"), plugin.getSettingsManager().getClanMinLength())); } } else { ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("your.clan.name.cannot.be.longer.than.characters"), plugin.getSettingsManager().getClanMaxLength())); } } else { ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("your.tag.cannot.contain.the.following.colors"), plugin.getSettingsManager().getDisallowedColorString())); } } else { ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("your.clan.tag.must.be.longer.than.characters"), plugin.getSettingsManager().getTagMinLength())); } } else { ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("your.clan.tag.cannot.be.longer.than.characters"), plugin.getSettingsManager().getTagMaxLength())); } } else { ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.create.tag"), plugin.getSettingsManager().getCommandClan())); ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("example.clan.create")); } } else { ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions")); } }
zClans plugin = zClans.getInstance(); ClanPlayer cpn = plugin.getClanManager().getCreateClanPlayer(player.getUniqueId()); if (cpn != null && cpn.isBanned()) { ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang(STR)); return; } if (plugin.getPermissionsManager().has(player, STR)) { if (arg.length >= 2) { String tag = arg[0]; String cleanTag = Helper.cleanTag(arg[0]); String name = Helper.toMessage(Helper.removeFirst(arg)); boolean bypass = plugin.getPermissionsManager().has(player, STR); if (bypass cleanTag.length() <= plugin.getSettingsManager().getTagMaxLength()) { if (bypass cleanTag.length() > plugin.getSettingsManager().getTagMinLength()) { if (bypass !plugin.getSettingsManager().hasDisallowedColor(tag)) { if (bypass Helper.stripColors(name).length() <= plugin.getSettingsManager().getClanMaxLength()) { if (bypass Helper.stripColors(name).length() > plugin.getSettingsManager().getClanMinLength()) { if (cleanTag.matches(STR)) { if (!name.contains("&")) { if (bypass !plugin.getSettingsManager().isDisallowedWord(cleanTag.toLowerCase())) { ClanPlayer cp = plugin.getClanManager().getClanPlayer(player); if (cp == null) { if (!plugin.getClanManager().isClan(cleanTag)) { if (plugin.getClanManager().purchaseCreation(player)) { plugin.getClanManager().createClan(player, tag, name); Clan clan = plugin.getClanManager().getClan(tag); clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang(STR), name)); plugin.getStorageManager().updateClan(clan); if (plugin.getSettingsManager().isRequireVerification()) { boolean verified = !plugin.getSettingsManager().isRequireVerification() plugin.getPermissionsManager().has(player, STR); if (!verified) { ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang(STR)); } } } } else { ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang(STR)); } } else { ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang(STR), cp.getClan().getName())); } } else { ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang(STR)); } } else { ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang(STR)); } } else { ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang(STR)); } } else { ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang(STR), plugin.getSettingsManager().getClanMinLength())); } } else { ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang(STR), plugin.getSettingsManager().getClanMaxLength())); } } else { ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang(STR), plugin.getSettingsManager().getDisallowedColorString())); } } else { ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang(STR), plugin.getSettingsManager().getTagMinLength())); } } else { ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang(STR), plugin.getSettingsManager().getTagMaxLength())); } } else { ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang(STR), plugin.getSettingsManager().getCommandClan())); ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang(STR)); } } else { ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang(STR)); } }
/** * Execute the command * @param player player executing command * @param arg command arguments */
Execute the command
execute
{ "repo_name": "zenith4183/SimpleClans", "path": "src/main/java/org/bitbucket/zenith4183/zclans/commands/CreateCommand.java", "license": "gpl-3.0", "size": 8375 }
[ "java.text.MessageFormat", "org.bitbucket.zenith4183.zclans.ChatBlock", "org.bitbucket.zenith4183.zclans.Clan", "org.bitbucket.zenith4183.zclans.ClanPlayer", "org.bitbucket.zenith4183.zclans.Helper", "org.bukkit.ChatColor" ]
import java.text.MessageFormat; import org.bitbucket.zenith4183.zclans.ChatBlock; import org.bitbucket.zenith4183.zclans.Clan; import org.bitbucket.zenith4183.zclans.ClanPlayer; import org.bitbucket.zenith4183.zclans.Helper; import org.bukkit.ChatColor;
import java.text.*; import org.bitbucket.zenith4183.zclans.*; import org.bukkit.*;
[ "java.text", "org.bitbucket.zenith4183", "org.bukkit" ]
java.text; org.bitbucket.zenith4183; org.bukkit;
493,987
@Test public void testSnapshotsOnErasureCodingDirAfterECPolicyChanges() throws Exception { final Path ecDir = new Path("/ecdir"); fs.mkdirs(ecDir); fs.allowSnapshot(ecDir); final Path snap1 = fs.createSnapshot(ecDir, "snap1"); assertNull("Expected null erasure coding policy", fs.getErasureCodingPolicy(snap1)); // Set erasure coding policy final ErasureCodingPolicy ec63Policy = SystemErasureCodingPolicies .getByID(SystemErasureCodingPolicies.RS_6_3_POLICY_ID); fs.setErasureCodingPolicy(ecDir, ec63Policy.getName()); final Path snap2 = fs.createSnapshot(ecDir, "snap2"); assertEquals("Got unexpected erasure coding policy", ec63Policy, fs.getErasureCodingPolicy(snap2)); // Verify the EC policy correctness after the unset operation fs.unsetErasureCodingPolicy(ecDir); final Path snap3 = fs.createSnapshot(ecDir, "snap3"); assertNull("Expected null erasure coding policy", fs.getErasureCodingPolicy(snap3)); // Change the erasure coding policy and take another snapshot final ErasureCodingPolicy ec32Policy = SystemErasureCodingPolicies .getByID(SystemErasureCodingPolicies.RS_3_2_POLICY_ID); fs.enableErasureCodingPolicy(ec32Policy.getName()); fs.setErasureCodingPolicy(ecDir, ec32Policy.getName()); final Path snap4 = fs.createSnapshot(ecDir, "snap4"); assertEquals("Got unexpected erasure coding policy", ec32Policy, fs.getErasureCodingPolicy(snap4)); // Check that older snapshot still have the old ECPolicy settings assertNull("Expected null erasure coding policy", fs.getErasureCodingPolicy(snap1)); assertEquals("Got unexpected erasure coding policy", ec63Policy, fs.getErasureCodingPolicy(snap2)); assertNull("Expected null erasure coding policy", fs.getErasureCodingPolicy(snap3)); }
void function() throws Exception { final Path ecDir = new Path(STR); fs.mkdirs(ecDir); fs.allowSnapshot(ecDir); final Path snap1 = fs.createSnapshot(ecDir, "snap1"); assertNull(STR, fs.getErasureCodingPolicy(snap1)); final ErasureCodingPolicy ec63Policy = SystemErasureCodingPolicies .getByID(SystemErasureCodingPolicies.RS_6_3_POLICY_ID); fs.setErasureCodingPolicy(ecDir, ec63Policy.getName()); final Path snap2 = fs.createSnapshot(ecDir, "snap2"); assertEquals(STR, ec63Policy, fs.getErasureCodingPolicy(snap2)); fs.unsetErasureCodingPolicy(ecDir); final Path snap3 = fs.createSnapshot(ecDir, "snap3"); assertNull(STR, fs.getErasureCodingPolicy(snap3)); final ErasureCodingPolicy ec32Policy = SystemErasureCodingPolicies .getByID(SystemErasureCodingPolicies.RS_3_2_POLICY_ID); fs.enableErasureCodingPolicy(ec32Policy.getName()); fs.setErasureCodingPolicy(ecDir, ec32Policy.getName()); final Path snap4 = fs.createSnapshot(ecDir, "snap4"); assertEquals(STR, ec32Policy, fs.getErasureCodingPolicy(snap4)); assertNull(STR, fs.getErasureCodingPolicy(snap1)); assertEquals(STR, ec63Policy, fs.getErasureCodingPolicy(snap2)); assertNull(STR, fs.getErasureCodingPolicy(snap3)); }
/** * Test creation of snapshot on directory which changes its * erasure coding policy. */
Test creation of snapshot on directory which changes its erasure coding policy
testSnapshotsOnErasureCodingDirAfterECPolicyChanges
{ "repo_name": "dennishuo/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestErasureCodingPolicyWithSnapshot.java", "license": "apache-2.0", "size": 11888 }
[ "org.apache.hadoop.fs.Path", "org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy", "org.apache.hadoop.hdfs.protocol.SystemErasureCodingPolicies", "org.junit.Assert" ]
import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy; import org.apache.hadoop.hdfs.protocol.SystemErasureCodingPolicies; import org.junit.Assert;
import org.apache.hadoop.fs.*; import org.apache.hadoop.hdfs.protocol.*; import org.junit.*;
[ "org.apache.hadoop", "org.junit" ]
org.apache.hadoop; org.junit;
64,310
@Override protected void setUpdateStatisticsParameters(FileInfo file) throws SQLException { this.stUpdateFileStatistics.setInt(1, file.getRating()); this.stUpdateFileStatistics.setFloat(2, file.getBPM()); this.stUpdateFileStatistics.setString(3, file.getFormattedAddedDate()); this.stUpdateFileStatistics.setInt(4, file.getPlayCounter()); this.stUpdateFileStatistics.setString(5, this.getRootPath()+getPath(file.getRelativeFullPath())); this.stUpdateFileStatistics.addBatch(); }
void function(FileInfo file) throws SQLException { this.stUpdateFileStatistics.setInt(1, file.getRating()); this.stUpdateFileStatistics.setFloat(2, file.getBPM()); this.stUpdateFileStatistics.setString(3, file.getFormattedAddedDate()); this.stUpdateFileStatistics.setInt(4, file.getPlayCounter()); this.stUpdateFileStatistics.setString(5, this.getRootPath()+getPath(file.getRelativeFullPath())); this.stUpdateFileStatistics.addBatch(); }
/** * Set update statistics parameters * @param file * @throws SQLException */
Set update statistics parameters
setUpdateStatisticsParameters
{ "repo_name": "phramusca/JaMuz", "path": "src/jamuz/process/merge/StatSourceMixxx.java", "license": "gpl-3.0", "size": 12250 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,895,724
public static int min(int... array) { checkArgument(array.length > 0); int min = array[0]; for (int i = 1; i < array.length; i++) { if (array[i] < min) { min = array[i]; } } return min; }
static int function(int... array) { checkArgument(array.length > 0); int min = array[0]; for (int i = 1; i < array.length; i++) { if (array[i] < min) { min = array[i]; } } return min; }
/** * Returns the least value present in {@code array}. * * @param array a <i>nonempty</i> array of {@code int} values * @return the value present in {@code array} that is less than or equal to every other value in * the array * @throws IllegalArgumentException if {@code array} is empty */
Returns the least value present in array
min
{ "repo_name": "tli2/guava", "path": "guava/src/com/google/common/primitives/Ints.java", "license": "apache-2.0", "size": 22882 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
467,090
public static String getClassPath() { refreshClassPath(); StringBuffer classPath = new StringBuffer(originalClassPath); classPath.append(File.pathSeparatorChar); String libDirs = JSystemProperties.getInstance().getPreference(FrameworkOptions.LIB_DIRS); if (libDirs != null) { StringTokenizer st = new StringTokenizer(libDirs, ";"); while (st.hasMoreElements()) { classPath.append(findJars(st.nextToken())); } } // append tests project jars File testProjectLibFile = new File(JSystemProperties.getCurrentTestsPath() + "/../lib"); if (testProjectLibFile.exists()) { classPath.append(findJars(FileUtils.getCannonicalPath(testProjectLibFile))); } // ITAI: If our project is in Maven structure then we need to travel up // another folder File mavenTestProjectLibFile = new File(JSystemProperties.getCurrentTestsPath() + "/../../lib"); if (mavenTestProjectLibFile.exists()) { classPath.append(findJars(FileUtils.getCannonicalPath(mavenTestProjectLibFile))); } classPath.append(JSystemProperties.getCurrentTestsPath()); System.setProperty("java.class.path", classPath.toString()); return classPath.toString(); }
static String function() { refreshClassPath(); StringBuffer classPath = new StringBuffer(originalClassPath); classPath.append(File.pathSeparatorChar); String libDirs = JSystemProperties.getInstance().getPreference(FrameworkOptions.LIB_DIRS); if (libDirs != null) { StringTokenizer st = new StringTokenizer(libDirs, ";"); while (st.hasMoreElements()) { classPath.append(findJars(st.nextToken())); } } File testProjectLibFile = new File(JSystemProperties.getCurrentTestsPath() + STR); if (testProjectLibFile.exists()) { classPath.append(findJars(FileUtils.getCannonicalPath(testProjectLibFile))); } File mavenTestProjectLibFile = new File(JSystemProperties.getCurrentTestsPath() + STR); if (mavenTestProjectLibFile.exists()) { classPath.append(findJars(FileUtils.getCannonicalPath(mavenTestProjectLibFile))); } classPath.append(JSystemProperties.getCurrentTestsPath()); System.setProperty(STR, classPath.toString()); return classPath.toString(); }
/** * Order of classes in the classpath: * * 1. Thirdparty ant/lib 2. Thirdparty commonLib 3. Thirdparty lib 4. * Thirdparty/selenium 5. runner/customer_lib 6. runner/so_lib 7. runner/lib * 8. user additional libs 9. automation project lib file 10. automation * project tests */
Order of classes in the classpath: 1. Thirdparty ant/lib 2. Thirdparty commonLib 3. Thirdparty lib 4. Thirdparty/selenium 5. runner/customer_lib 6. runner/so_lib 7. runner/lib 8. user additional libs 9. automation project lib file 10. automation project tests
getClassPath
{ "repo_name": "Top-Q/jsystem", "path": "jsystem-core-projects/jsystemCore/src/main/java/jsystem/runner/loader/ClassPathBuilder.java", "license": "apache-2.0", "size": 2734 }
[ "java.io.File", "java.util.StringTokenizer" ]
import java.io.File; import java.util.StringTokenizer;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,529,833
@Override public final void setLabel(String labelResource) { this.mLabel.setText(JMeterUtils.getResString(labelResource)); }
final void function(String labelResource) { this.mLabel.setText(JMeterUtils.getResString(labelResource)); }
/** * Set the group label from the resource name. * * @param labelResource The text to be looked up and set */
Set the group label from the resource name
setLabel
{ "repo_name": "apache/jmeter", "path": "src/core/src/main/java/org/apache/jmeter/gui/util/JLabeledRadioI18N.java", "license": "apache-2.0", "size": 7674 }
[ "org.apache.jmeter.util.JMeterUtils" ]
import org.apache.jmeter.util.JMeterUtils;
import org.apache.jmeter.util.*;
[ "org.apache.jmeter" ]
org.apache.jmeter;
2,621,819
public static MetricResult fromMap(Map<String,?> values) { return new MapMetricResult(values); }
static MetricResult function(Map<String,?> values) { return new MapMetricResult(values); }
/** * Create an empty metric result. * @return An empty metric result. */
Create an empty metric result
fromMap
{ "repo_name": "amaliujia/lenskit", "path": "lenskit-eval/src/main/java/org/lenskit/eval/traintest/metrics/MetricResult.java", "license": "lgpl-2.1", "size": 2593 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
153,745
public static String serializeToString(Node node, String encoding) throws IOException { TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = null; try { transformer = tFactory.newTransformer(); } catch (TransformerConfigurationException e) { throw new IOException("Unable to serialize XML document"); } transformer.setOutputProperty(OutputKeys.INDENT, "no"); transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); transformer.setOutputProperty(OutputKeys.ENCODING, encoding); DOMSource source = new DOMSource(node); StringWriter writer = new StringWriter(); Result result = new StreamResult(writer); try { transformer.transform(source, result); } catch (TransformerException e) { throw new IOException("Unable to serialize XML document"); } writer.flush(); return writer.toString(); }
static String function(Node node, String encoding) throws IOException { TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = null; try { transformer = tFactory.newTransformer(); } catch (TransformerConfigurationException e) { throw new IOException(STR); } transformer.setOutputProperty(OutputKeys.INDENT, "no"); transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); transformer.setOutputProperty(OutputKeys.ENCODING, encoding); DOMSource source = new DOMSource(node); StringWriter writer = new StringWriter(); Result result = new StreamResult(writer); try { transformer.transform(source, result); } catch (TransformerException e) { throw new IOException(STR); } writer.flush(); return writer.toString(); }
/** * Serialize XML Document to string using Transformer * * @param node the XML node (and the subtree rooted at this node) to be serialized * @param encoding encoding for the XML document * @return String representation of the Document * @throws IOException */
Serialize XML Document to string using Transformer
serializeToString
{ "repo_name": "k3b/pixymeta-android", "path": "pixymeta-lib/src/main/java/pixy/string/XMLUtils.java", "license": "epl-1.0", "size": 13804 }
[ "java.io.IOException", "java.io.StringWriter", "javax.xml.transform.OutputKeys", "javax.xml.transform.Result", "javax.xml.transform.Transformer", "javax.xml.transform.TransformerConfigurationException", "javax.xml.transform.TransformerException", "javax.xml.transform.TransformerFactory", "javax.xml.transform.dom.DOMSource", "javax.xml.transform.stream.StreamResult", "org.w3c.dom.Node" ]
import java.io.IOException; import java.io.StringWriter; import javax.xml.transform.OutputKeys; import javax.xml.transform.Result; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.w3c.dom.Node;
import java.io.*; import javax.xml.transform.*; import javax.xml.transform.dom.*; import javax.xml.transform.stream.*; import org.w3c.dom.*;
[ "java.io", "javax.xml", "org.w3c.dom" ]
java.io; javax.xml; org.w3c.dom;
1,566,751
public Locator getDocumentLocator() { return this.locator; }
Locator function() { return this.locator; }
/** * Retrieves the Locator. <p> * @return the Locator */
Retrieves the Locator.
getDocumentLocator
{ "repo_name": "RabadanLab/Pegasus", "path": "resources/hsqldb-2.2.7/hsqldb/src/org/hsqldb/jdbc/JDBCSQLXML.java", "license": "mit", "size": 120115 }
[ "org.xml.sax.Locator" ]
import org.xml.sax.Locator;
import org.xml.sax.*;
[ "org.xml.sax" ]
org.xml.sax;
2,379,476
private void grade_submission_option(RunData data, String gradeOption) { SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid()); boolean withGrade = state.getAttribute(WITH_GRADES) != null ? ((Boolean) state.getAttribute(WITH_GRADES)).booleanValue(): false; String sId = (String) state.getAttribute(GRADE_SUBMISSION_SUBMISSION_ID); String assignmentId = (String) state.getAttribute(GRADE_SUBMISSION_ASSIGNMENT_ID); // for points grading, one have to enter number as the points String grade = (String) state.getAttribute(GRADE_SUBMISSION_GRADE); AssignmentSubmissionEdit sEdit = editSubmission(sId, "grade_submission_option", state); if (sEdit != null) { //This logic could be done in one line, but would be harder to read, so break it out to make it easier to follow boolean gradeChanged = false; if((sEdit.getGrade() == null || "".equals(sEdit.getGrade().trim())) && (grade == null || "".equals(grade.trim()))){ //both are null, keep grade changed = false }else if((sEdit.getGrade() == null || "".equals(sEdit.getGrade().trim()) || (grade == null || "".equals(grade.trim())))){ //one is null the other isn't gradeChanged = true; }else if(!grade.trim().equals(sEdit.getGrade().trim())){ gradeChanged = true; } Assignment a = sEdit.getAssignment(); int typeOfGrade = a.getContent().getTypeOfGrade(); if (!withGrade) { // no grade input needed for the without-grade version of assignment tool sEdit.setGraded(true); if(gradeChanged){ sEdit.setGradedBy(UserDirectoryService.getCurrentUser() == null ? null : UserDirectoryService.getCurrentUser().getId()); } if ("return".equals(gradeOption) || "release".equals(gradeOption)) { sEdit.setGradeReleased(true); } } else if (grade == null) { sEdit.setGrade(""); sEdit.setGraded(false); if(gradeChanged){ sEdit.setGradedBy(null); } sEdit.setGradeReleased(false); } else { sEdit.setGrade(grade); if (grade.length() != 0) { sEdit.setGraded(true); if(gradeChanged){ sEdit.setGradedBy(UserDirectoryService.getCurrentUser() == null ? null : UserDirectoryService.getCurrentUser().getId()); } } else { sEdit.setGraded(false); if(gradeChanged){ sEdit.setGradedBy(null); } } } // iterate through submitters and look for grade overrides... if (withGrade && a.isGroup()) { User[] _users = sEdit.getSubmitters(); for (int i=0; _users != null && i < _users.length; i++) { String _gr = (String)state.getAttribute(GRADE_SUBMISSION_GRADE + "_" + _users[i].getId()); sEdit.addGradeForUser(_users[i].getId(), _gr); } } if ("release".equals(gradeOption)) { sEdit.setGradeReleased(true); sEdit.setGraded(true); if(gradeChanged){ sEdit.setGradedBy(UserDirectoryService.getCurrentUser() == null ? null : UserDirectoryService.getCurrentUser().getId()); } // clear the returned flag sEdit.setReturned(false); sEdit.setTimeReturned(null); } else if ("return".equals(gradeOption)) { sEdit.setGradeReleased(true); sEdit.setGraded(true); if(gradeChanged){ sEdit.setGradedBy(UserDirectoryService.getCurrentUser() == null ? null : UserDirectoryService.getCurrentUser().getId()); } sEdit.setReturned(true); sEdit.setTimeReturned(TimeService.newTime()); sEdit.setHonorPledgeFlag(Boolean.FALSE.booleanValue()); } else if ("save".equals(gradeOption)) { sEdit.setGradeReleased(false); sEdit.setReturned(false); sEdit.setTimeReturned(null); } ResourcePropertiesEdit pEdit = sEdit.getPropertiesEdit(); if (state.getAttribute(AssignmentSubmission.ALLOW_RESUBMIT_NUMBER) != null) { // get resubmit number pEdit.addProperty(AssignmentSubmission.ALLOW_RESUBMIT_NUMBER, (String) state.getAttribute(AssignmentSubmission.ALLOW_RESUBMIT_NUMBER)); if (state.getAttribute(ALLOW_RESUBMIT_CLOSEYEAR) != null) { // get resubmit time Time closeTime = getTimeFromState(state, ALLOW_RESUBMIT_CLOSEMONTH, ALLOW_RESUBMIT_CLOSEDAY, ALLOW_RESUBMIT_CLOSEYEAR, ALLOW_RESUBMIT_CLOSEHOUR, ALLOW_RESUBMIT_CLOSEMIN); pEdit.addProperty(AssignmentSubmission.ALLOW_RESUBMIT_CLOSETIME, String.valueOf(closeTime.getTime())); } else { pEdit.removeProperty(AssignmentSubmission.ALLOW_RESUBMIT_CLOSETIME); } } else { // clean resubmission property pEdit.removeProperty(AssignmentSubmission.ALLOW_RESUBMIT_CLOSETIME); pEdit.removeProperty(AssignmentSubmission.ALLOW_RESUBMIT_NUMBER); } // the instructor comment String feedbackCommentString = StringUtils .trimToNull((String) state.getAttribute(GRADE_SUBMISSION_FEEDBACK_COMMENT)); if (feedbackCommentString != null) { sEdit.setFeedbackComment(feedbackCommentString); } else { sEdit.setFeedbackComment(""); } // the instructor inline feedback String feedbackTextString = (String) state.getAttribute(GRADE_SUBMISSION_FEEDBACK_TEXT); if (feedbackTextString != null) { sEdit.setFeedbackText(feedbackTextString); } List v = (List) state.getAttribute(GRADE_SUBMISSION_FEEDBACK_ATTACHMENT); if (v != null) { // clear the old attachments first sEdit.clearFeedbackAttachments(); for (int i = 0; i < v.size(); i++) { sEdit.addFeedbackAttachment((Reference) v.get(i)); } } String sReference = sEdit.getReference(); // save a timestamp for this grading process sEdit.getPropertiesEdit().addProperty(AssignmentConstants.PROP_LAST_GRADED_DATE, TimeService.newTime().toStringLocalFull()); AssignmentService.commitEdit(sEdit); // update grades in gradebook String aReference = a.getReference(); String associateGradebookAssignment = StringUtils.trimToNull(a.getProperties().getProperty(AssignmentService.PROP_ASSIGNMENT_ASSOCIATE_GRADEBOOK_ASSIGNMENT)); if (!"remove".equals(gradeOption)) { // update grade in gradebook integrateGradebook(state, aReference, associateGradebookAssignment, null, null, null, -1, null, sReference, "update", -1); } else { //remove grade from gradebook integrateGradebook(state, aReference, associateGradebookAssignment, null, null, null, -1, null, sReference, "remove", -1); } } if (state.getAttribute(STATE_MESSAGE) == null) { // SAK-29314 - put submission information into state boolean viewSubsOnlySelected = stringToBool((String)data.getParameters().getString(PARAMS_VIEW_SUBS_ONLY_CHECKBOX)); putSubmissionInfoIntoState(state, assignmentId, sId, viewSubsOnlySelected); state.setAttribute(STATE_MODE, MODE_INSTRUCTOR_GRADE_SUBMISSION); state.setAttribute(GRADE_SUBMISSION_DONE, Boolean.TRUE); } else { state.removeAttribute(GRADE_SUBMISSION_DONE); } // SAK-29314 - update the list being iterated over sizeResources(state); } // grade_submission_option
void function(RunData data, String gradeOption) { SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid()); boolean withGrade = state.getAttribute(WITH_GRADES) != null ? ((Boolean) state.getAttribute(WITH_GRADES)).booleanValue(): false; String sId = (String) state.getAttribute(GRADE_SUBMISSION_SUBMISSION_ID); String assignmentId = (String) state.getAttribute(GRADE_SUBMISSION_ASSIGNMENT_ID); String grade = (String) state.getAttribute(GRADE_SUBMISSION_GRADE); AssignmentSubmissionEdit sEdit = editSubmission(sId, STR, state); if (sEdit != null) { boolean gradeChanged = false; if((sEdit.getGrade() == null STRSTRSTRSTRreturnSTRreleaseSTRSTR_STRreleaseSTRreturnSTRsaveSTRSTRremoveSTRupdateSTRremove", -1); } } if (state.getAttribute(STATE_MESSAGE) == null) { boolean viewSubsOnlySelected = stringToBool((String)data.getParameters().getString(PARAMS_VIEW_SUBS_ONLY_CHECKBOX)); putSubmissionInfoIntoState(state, assignmentId, sId, viewSubsOnlySelected); state.setAttribute(STATE_MODE, MODE_INSTRUCTOR_GRADE_SUBMISSION); state.setAttribute(GRADE_SUBMISSION_DONE, Boolean.TRUE); } else { state.removeAttribute(GRADE_SUBMISSION_DONE); } sizeResources(state); }
/** * Common grading routine plus specific operation to differenciate cases when saving, releasing or returning grade. */
Common grading routine plus specific operation to differenciate cases when saving, releasing or returning grade
grade_submission_option
{ "repo_name": "tl-its-umich-edu/sakai", "path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java", "license": "apache-2.0", "size": 671846 }
[ "org.sakaiproject.assignment.api.AssignmentSubmissionEdit", "org.sakaiproject.cheftool.JetspeedRunData", "org.sakaiproject.cheftool.RunData", "org.sakaiproject.event.api.SessionState" ]
import org.sakaiproject.assignment.api.AssignmentSubmissionEdit; import org.sakaiproject.cheftool.JetspeedRunData; import org.sakaiproject.cheftool.RunData; import org.sakaiproject.event.api.SessionState;
import org.sakaiproject.assignment.api.*; import org.sakaiproject.cheftool.*; import org.sakaiproject.event.api.*;
[ "org.sakaiproject.assignment", "org.sakaiproject.cheftool", "org.sakaiproject.event" ]
org.sakaiproject.assignment; org.sakaiproject.cheftool; org.sakaiproject.event;
909,021
public void addComplex() { //add constants to Symbol Table symTab.addConstant("i", new Complex(0, 1)); funTab.put("re", new Real()); funTab.put("im", new Imaginary()); funTab.put("arg", new Arg()); funTab.put("cmod", new Abs()); funTab.put("complex", new ComplexPFMC()); funTab.put("polar", new Polar()); funTab.put("conj", new Conjugate()); }
void function() { symTab.addConstant("i", new Complex(0, 1)); funTab.put("re", new Real()); funTab.put("im", new Imaginary()); funTab.put("arg", new Arg()); funTab.put("cmod", new Abs()); funTab.put(STR, new ComplexPFMC()); funTab.put("polar", new Polar()); funTab.put("conj", new Conjugate()); }
/** * Call this function if you want to parse expressions which involve * complex numbers. This method specifies "i" as the imaginary unit * (0,1). Two functions re() and im() are also added for extracting the * real or imaginary components of a complex number respectively. *<p> * @since 2.3.0 alpha The functions cmod and arg are added to get the modulus and argument. * @since 2.3.0 beta 1 The functions complex and polar to convert x,y and r,theta to Complex. * @since Feb 05 added complex conjugate conj. */
Call this function if you want to parse expressions which involve complex numbers. This method specifies "i" as the imaginary unit (0,1). Two functions re() and im() are also added for extracting the real or imaginary components of a complex number respectively.
addComplex
{ "repo_name": "dbunibas/spicy", "path": "jep-2.4.1/src/org/nfunk/jep/JEP.java", "license": "gpl-3.0", "size": 28068 }
[ "org.nfunk.jep.function.Abs", "org.nfunk.jep.function.Arg", "org.nfunk.jep.function.ComplexPFMC", "org.nfunk.jep.function.Conjugate", "org.nfunk.jep.function.Imaginary", "org.nfunk.jep.function.Polar", "org.nfunk.jep.function.Real", "org.nfunk.jep.type.Complex" ]
import org.nfunk.jep.function.Abs; import org.nfunk.jep.function.Arg; import org.nfunk.jep.function.ComplexPFMC; import org.nfunk.jep.function.Conjugate; import org.nfunk.jep.function.Imaginary; import org.nfunk.jep.function.Polar; import org.nfunk.jep.function.Real; import org.nfunk.jep.type.Complex;
import org.nfunk.jep.function.*; import org.nfunk.jep.type.*;
[ "org.nfunk.jep" ]
org.nfunk.jep;
1,414,342
public static Mixin mixin(Class<?>[] ics, Class<?>[] dcs) { return mixin(ics, dcs, ClassHelper.getCallerClassLoader(Mixin.class)); }
static Mixin function(Class<?>[] ics, Class<?>[] dcs) { return mixin(ics, dcs, ClassHelper.getCallerClassLoader(Mixin.class)); }
/** * mixin interface and delegates. * all class must be public. * * @param ics interface class array. * @param dcs delegate class array. * @return Mixin instance. */
mixin interface and delegates. all class must be public
mixin
{ "repo_name": "JasonHZXie/dubbo", "path": "dubbo-common/src/main/java/org/apache/dubbo/common/bytecode/Mixin.java", "license": "apache-2.0", "size": 7907 }
[ "org.apache.dubbo.common.utils.ClassHelper" ]
import org.apache.dubbo.common.utils.ClassHelper;
import org.apache.dubbo.common.utils.*;
[ "org.apache.dubbo" ]
org.apache.dubbo;
1,650,352
public void setBuilderCustomizers( Collection<? extends UndertowBuilderCustomizer> customizers) { Assert.notNull(customizers, "Customizers must not be null"); this.builderCustomizers = new ArrayList<>(customizers); }
void function( Collection<? extends UndertowBuilderCustomizer> customizers) { Assert.notNull(customizers, STR); this.builderCustomizers = new ArrayList<>(customizers); }
/** * Set {@link UndertowBuilderCustomizer}s that should be applied to the Undertow * {@link io.undertow.Undertow.Builder Builder}. Calling this method will replace any * existing customizers. * @param customizers the customizers to set */
Set <code>UndertowBuilderCustomizer</code>s that should be applied to the Undertow <code>io.undertow.Undertow.Builder Builder</code>. Calling this method will replace any existing customizers
setBuilderCustomizers
{ "repo_name": "hello2009chen/spring-boot", "path": "spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowReactiveWebServerFactory.java", "license": "apache-2.0", "size": 10085 }
[ "java.util.ArrayList", "java.util.Collection", "org.springframework.util.Assert" ]
import java.util.ArrayList; import java.util.Collection; import org.springframework.util.Assert;
import java.util.*; import org.springframework.util.*;
[ "java.util", "org.springframework.util" ]
java.util; org.springframework.util;
997,532
public static OGCWebServiceException create( Document doc ) { Element root = doc.getDocumentElement(); return create( root ); }
static OGCWebServiceException function( Document doc ) { Element root = doc.getDocumentElement(); return create( root ); }
/** * creates an OGCWebServiceException from a DOM object as defined in the OGC common * implementation specification * * @param doc * @return an {@link OGCWebServiceException} with the message, code and locator set to the xml * inside the document. */
creates an OGCWebServiceException from a DOM object as defined in the OGC common implementation specification
create
{ "repo_name": "lat-lon/deegree2-base", "path": "deegree2-core/src/main/java/org/deegree/ogcwebservices/OGCWebServiceException.java", "license": "lgpl-2.1", "size": 4343 }
[ "org.w3c.dom.Document", "org.w3c.dom.Element" ]
import org.w3c.dom.Document; import org.w3c.dom.Element;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,200,079
private void checkDatabaseBooted(Database database, String operation, String dbname) throws SQLException { if (database == null) { // Do not clear the TransactionResource context. It will // be restored as part of the finally clause of the constructor. this.setInactive(); throw newSQLException(SQLState.REPLICATION_DB_NOT_BOOTED, operation, dbname); } } /** Examine the attributes set provided for illegal boot combinations and determine if this is a create boot. @return true iff the attribute <em>create=true</em> is provided. This means create a standard database. In other cases, returns false. @param p the attribute set. @exception SQLException Throw if more than one of <em>create</em>, <em>createFrom</em>, <em>restoreFrom</em> and <em>rollForwardRecoveryFrom</em> is used simultaneously. <br> Also, throw if (re)encryption is attempted with one of <em>createFrom</em>, <em>restoreFrom</em> and <em>rollForwardRecoveryFrom</em>.
void function(Database database, String operation, String dbname) throws SQLException { if (database == null) { this.setInactive(); throw newSQLException(SQLState.REPLICATION_DB_NOT_BOOTED, operation, dbname); } } /** Examine the attributes set provided for illegal boot combinations and determine if this is a create boot. @return true iff the attribute <em>create=true</em> is provided. This means create a standard database. In other cases, returns false. @param p the attribute set. @exception SQLException Throw if more than one of <em>create</em>, <em>createFrom</em>, <em>restoreFrom</em> and <em>rollForwardRecoveryFrom</em> is used simultaneously. <br> Also, throw if (re)encryption is attempted with one of <em>createFrom</em>, <em>restoreFrom</em> and <em>rollForwardRecoveryFrom</em>.
/** * Check that a database has already been booted. Throws an exception * otherwise * * @param database The database that should have been booted * @param operation The operation that requires that the database has * already been booted, used in the exception message if not booted * @param dbname The name of the database that should have been booted, * used in the exception message if not booted * @throws java.sql.SQLException thrown if database is not booted */
Check that a database has already been booted. Throws an exception otherwise
checkDatabaseBooted
{ "repo_name": "viaper/DBPlus", "path": "DerbyHodgepodge/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java", "license": "apache-2.0", "size": 128383 }
[ "java.sql.SQLException", "org.apache.derby.iapi.db.Database", "org.apache.derby.iapi.reference.SQLState" ]
import java.sql.SQLException; import org.apache.derby.iapi.db.Database; import org.apache.derby.iapi.reference.SQLState;
import java.sql.*; import org.apache.derby.iapi.db.*; import org.apache.derby.iapi.reference.*;
[ "java.sql", "org.apache.derby" ]
java.sql; org.apache.derby;
711,639
EAttribute getArrayTypeSpecifier_Size();
EAttribute getArrayTypeSpecifier_Size();
/** * Returns the meta object for the attribute '{@link org.yakindu.base.types.ArrayTypeSpecifier#getSize <em>Size</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Size</em>'. * @see org.yakindu.base.types.ArrayTypeSpecifier#getSize() * @see #getArrayTypeSpecifier() * @generated */
Returns the meta object for the attribute '<code>org.yakindu.base.types.ArrayTypeSpecifier#getSize Size</code>'.
getArrayTypeSpecifier_Size
{ "repo_name": "Yakindu/statecharts", "path": "plugins/org.yakindu.base.types/src-gen/org/yakindu/base/types/TypesPackage.java", "license": "epl-1.0", "size": 91972 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
722,116
private void validateRoleURIs(final Role[] userRoles) { final List<String> invalidRoles = new ArrayList<>(); for(Role role: userRoles) { if(role.getUri() == null) { invalidRoles.add(role.getIdentifier()); } } if (!invalidRoles.isEmpty()) { throw new IllegalArgumentException("Roles with URI not specified found: " + invalidRoles); } }
void function(final Role[] userRoles) { final List<String> invalidRoles = new ArrayList<>(); for(Role role: userRoles) { if(role.getUri() == null) { invalidRoles.add(role.getIdentifier()); } } if (!invalidRoles.isEmpty()) { throw new IllegalArgumentException(STR + invalidRoles); } }
/** * Checks whether all the roles have URI specified. */
Checks whether all the roles have URI specified
validateRoleURIs
{ "repo_name": "martiner/gooddata-java", "path": "gooddata-java/src/main/java/com/gooddata/sdk/service/project/ProjectService.java", "license": "bsd-3-clause", "size": 25129 }
[ "com.gooddata.sdk.model.project.Role", "java.util.ArrayList", "java.util.List" ]
import com.gooddata.sdk.model.project.Role; import java.util.ArrayList; import java.util.List;
import com.gooddata.sdk.model.project.*; import java.util.*;
[ "com.gooddata.sdk", "java.util" ]
com.gooddata.sdk; java.util;
1,190,102
private static Locale getWindowsLocale(int lcid) { switch (lcid) { case 0x0407: return Locale.GERMAN; case 0x0408: return new Locale("el", "GR"); case 0x0409: return Locale.ENGLISH; case 0x040b: return new Locale("fi"); case 0x040c: return Locale.FRENCH; case 0x0416: return new Locale("pt"); case 0x0807: return new Locale("de", "CH"); case 0x0809: return new Locale("en", "UK"); case 0x080c: return new Locale("fr", "BE"); case 0x0816: return new Locale("pt", "BR"); case 0x0c07: return new Locale("de", "AT"); case 0x0c09: return new Locale("en", "AU"); case 0x0c0c: return new Locale("fr", "CA"); case 0x1007: return new Locale("de", "LU"); case 0x1009: return new Locale("en", "CA"); case 0x100c: return new Locale("fr", "CH"); case 0x1407: return new Locale("de", "LI"); case 0x1409: return new Locale("en", "NZ"); case 0x140c: return new Locale("fr", "LU"); case 0x1809: return new Locale("en", "IE"); default: return null; } }
static Locale function(int lcid) { switch (lcid) { case 0x0407: return Locale.GERMAN; case 0x0408: return new Locale("el", "GR"); case 0x0409: return Locale.ENGLISH; case 0x040b: return new Locale("fi"); case 0x040c: return Locale.FRENCH; case 0x0416: return new Locale("pt"); case 0x0807: return new Locale("de", "CH"); case 0x0809: return new Locale("en", "UK"); case 0x080c: return new Locale("fr", "BE"); case 0x0816: return new Locale("pt", "BR"); case 0x0c07: return new Locale("de", "AT"); case 0x0c09: return new Locale("en", "AU"); case 0x0c0c: return new Locale("fr", "CA"); case 0x1007: return new Locale("de", "LU"); case 0x1009: return new Locale("en", "CA"); case 0x100c: return new Locale("fr", "CH"); case 0x1407: return new Locale("de", "LI"); case 0x1409: return new Locale("en", "NZ"); case 0x140c: return new Locale("fr", "LU"); case 0x1809: return new Locale("en", "IE"); default: return null; } }
/** * Maps a Windows LCID into a Java Locale. * * @param lcid the Windows language ID whose Java locale * is to be retrieved. * * @return an suitable Locale, or <code>null</code> if * the mapping cannot be performed. */
Maps a Windows LCID into a Java Locale
getWindowsLocale
{ "repo_name": "SanDisk-Open-Source/SSD_Dashboard", "path": "uefi/gcc/gcc-4.6.3/libjava/classpath/gnu/java/awt/font/opentype/NameDecoder.java", "license": "gpl-2.0", "size": 21736 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
1,522,292
protected static InputStream getResponseStream(HttpWebRequest request) throws EWSHttpException, IOException { String contentEncoding = ""; if (null != request.getContentEncoding()) { contentEncoding = request.getContentEncoding().toLowerCase(); } InputStream responseStream; if (contentEncoding.contains("gzip")) { responseStream = new GZIPInputStream(request.getInputStream()); } else if (contentEncoding.contains("deflate")) { responseStream = new InflaterInputStream(request.getInputStream()); } else { responseStream = request.getInputStream(); } return responseStream; }
static InputStream function(HttpWebRequest request) throws EWSHttpException, IOException { String contentEncoding = STRgzipSTRdeflate")) { responseStream = new InflaterInputStream(request.getInputStream()); } else { responseStream = request.getInputStream(); } return responseStream; }
/** * Gets the response stream (may be wrapped with GZip/Deflate stream to * decompress content). * * @param request * the request * @return ResponseStream * @throws microsoft.exchange.webservices.data.EWSHttpException * the eWS http exception * @throws java.io.IOException * Signals that an I/O exception has occurred. */
Gets the response stream (may be wrapped with GZip/Deflate stream to decompress content)
getResponseStream
{ "repo_name": "kaaaaang/ews-java-api", "path": "src/main/java/microsoft/exchange/webservices/data/AutodiscoverRequest.java", "license": "mit", "size": 23379 }
[ "java.io.IOException", "java.io.InputStream", "java.util.zip.InflaterInputStream" ]
import java.io.IOException; import java.io.InputStream; import java.util.zip.InflaterInputStream;
import java.io.*; import java.util.zip.*;
[ "java.io", "java.util" ]
java.io; java.util;
573,719
public void testValueWhenNameBlank() throws Exception { ValueSerialization ser = createMock(ValueSerialization.class); replay(ser); writer.writeValue(ser, null, "John Doé", ctx); verify(ser); assertEquals("John Do&#233;", os.toString()); assertEquals(StringUtils.EMPTY, ctx.getPath()); }
void function() throws Exception { ValueSerialization ser = createMock(ValueSerialization.class); replay(ser); writer.writeValue(ser, null, STR, ctx); verify(ser); assertEquals(STR, os.toString()); assertEquals(StringUtils.EMPTY, ctx.getPath()); }
/** * Tests serializing a non-null or empty value but with an empty name */
Tests serializing a non-null or empty value but with an empty name
testValueWhenNameBlank
{ "repo_name": "localmatters/object-serializer", "path": "src/test/java/org/localmatters/serializer/writer/XMLWriterTest.java", "license": "apache-2.0", "size": 25219 }
[ "org.apache.commons.lang.StringUtils", "org.easymock.classextension.EasyMock", "org.localmatters.serializer.serialization.ValueSerialization" ]
import org.apache.commons.lang.StringUtils; import org.easymock.classextension.EasyMock; import org.localmatters.serializer.serialization.ValueSerialization;
import org.apache.commons.lang.*; import org.easymock.classextension.*; import org.localmatters.serializer.serialization.*;
[ "org.apache.commons", "org.easymock.classextension", "org.localmatters.serializer" ]
org.apache.commons; org.easymock.classextension; org.localmatters.serializer;
1,236,801
// TODO: Customize helper method public void sendtoUI(int code, String res) { if(null != intent2) { Intent result = new Intent(); result.putExtra("error", res); try { intent2.send(this, code, result); } catch (PendingIntent.CanceledException e) { e.printStackTrace(); } } }
void function(int code, String res) { if(null != intent2) { Intent result = new Intent(); result.putExtra("error", res); try { intent2.send(this, code, result); } catch (PendingIntent.CanceledException e) { e.printStackTrace(); } } }
/** * Starts this service to perform action Foo with the given parameters. If * the service is already performing a task this action will be queued. * * @see IntentService */
Starts this service to perform action Foo with the given parameters. If the service is already performing a task this action will be queued
sendtoUI
{ "repo_name": "inv2004/cycle-computer", "path": "app/src/main/java/com/example/unknoqn/cc/CCDataServiceAsync_disabled.java", "license": "apache-2.0", "size": 5414 }
[ "android.app.PendingIntent", "android.content.Intent" ]
import android.app.PendingIntent; import android.content.Intent;
import android.app.*; import android.content.*;
[ "android.app", "android.content" ]
android.app; android.content;
1,000,892
public void showShareFile(OCFile file){ Intent intent = new Intent(mFileActivity, ShareActivity.class); intent.putExtra(mFileActivity.EXTRA_FILE, file); intent.putExtra(mFileActivity.EXTRA_ACCOUNT, mFileActivity.getAccount()); mFileActivity.startActivity(intent); }
void function(OCFile file){ Intent intent = new Intent(mFileActivity, ShareActivity.class); intent.putExtra(mFileActivity.EXTRA_FILE, file); intent.putExtra(mFileActivity.EXTRA_ACCOUNT, mFileActivity.getAccount()); mFileActivity.startActivity(intent); }
/** * Show an instance of {@link ShareType} for sharing or unsharing the {@OCFile} received as parameter. * * @param file File to share or unshare. */
Show an instance of <code>ShareType</code> for sharing or unsharing the received as parameter
showShareFile
{ "repo_name": "rishabh7m/android-1", "path": "src/com/owncloud/android/files/FileOperationsHelper.java", "license": "gpl-2.0", "size": 20946 }
[ "android.content.Intent", "com.owncloud.android.datamodel.OCFile", "com.owncloud.android.ui.activity.ShareActivity" ]
import android.content.Intent; import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.ui.activity.ShareActivity;
import android.content.*; import com.owncloud.android.datamodel.*; import com.owncloud.android.ui.activity.*;
[ "android.content", "com.owncloud.android" ]
android.content; com.owncloud.android;
2,517,376
private void setUpExtrinsics() { // Get device to imu matrix. TangoPoseData device2IMUPose = new TangoPoseData(); TangoCoordinateFramePair framePair = new TangoCoordinateFramePair(); framePair.baseFrame = TangoPoseData.COORDINATE_FRAME_IMU; framePair.targetFrame = TangoPoseData.COORDINATE_FRAME_DEVICE; device2IMUPose = mTango.getPoseAtTime(0.0, framePair); mRenderer.getModelMatCalculator().SetDevice2IMUMatrix( device2IMUPose.getTranslationAsFloats(), device2IMUPose.getRotationAsFloats()); // Get color camera to imu matrix. TangoPoseData color2IMUPose = new TangoPoseData(); framePair.baseFrame = TangoPoseData.COORDINATE_FRAME_IMU; framePair.targetFrame = TangoPoseData.COORDINATE_FRAME_CAMERA_COLOR; color2IMUPose = mTango.getPoseAtTime(0.0, framePair); mRenderer.getModelMatCalculator().SetColorCamera2IMUMatrix( color2IMUPose.getTranslationAsFloats(), color2IMUPose.getRotationAsFloats()); }
void function() { TangoPoseData device2IMUPose = new TangoPoseData(); TangoCoordinateFramePair framePair = new TangoCoordinateFramePair(); framePair.baseFrame = TangoPoseData.COORDINATE_FRAME_IMU; framePair.targetFrame = TangoPoseData.COORDINATE_FRAME_DEVICE; device2IMUPose = mTango.getPoseAtTime(0.0, framePair); mRenderer.getModelMatCalculator().SetDevice2IMUMatrix( device2IMUPose.getTranslationAsFloats(), device2IMUPose.getRotationAsFloats()); TangoPoseData color2IMUPose = new TangoPoseData(); framePair.baseFrame = TangoPoseData.COORDINATE_FRAME_IMU; framePair.targetFrame = TangoPoseData.COORDINATE_FRAME_CAMERA_COLOR; color2IMUPose = mTango.getPoseAtTime(0.0, framePair); mRenderer.getModelMatCalculator().SetColorCamera2IMUMatrix( color2IMUPose.getTranslationAsFloats(), color2IMUPose.getRotationAsFloats()); }
/** * Setup the extrinsics of the device. */
Setup the extrinsics of the device
setUpExtrinsics
{ "repo_name": "UNH-Android-Development-Lab/tango-examples-java", "path": "MotionTrackingJava/app/src/main/java/com/projecttango/experiments/javamotiontracking/MotionTrackingActivity.java", "license": "apache-2.0", "size": 20320 }
[ "com.google.atap.tangoservice.TangoCoordinateFramePair", "com.google.atap.tangoservice.TangoPoseData" ]
import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoPoseData;
import com.google.atap.tangoservice.*;
[ "com.google.atap" ]
com.google.atap;
859,649
@Test public void testGetPolyfillsSourceCustomServiceConfigQueryUseDefault() { Query query = new Query.Builder().build(); String actual = service.getPolyfillsSource("chrome/30", query); String expected = "(function(undefined) {c.minb.mind.mina.min}).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});"; assertEquals(expected, actual); }
void function() { Query query = new Query.Builder().build(); String actual = service.getPolyfillsSource(STR, query); String expected = STR; assertEquals(expected, actual); }
/** * Polyfill service should fill the empty query object with default values * So this should behave the same as if query is not supplied at all */
Polyfill service should fill the empty query object with default values So this should behave the same as if query is not supplied at all
testGetPolyfillsSourceCustomServiceConfigQueryUseDefault
{ "repo_name": "reiniergs/polyfill-service", "path": "polyfill-service-api/src/test/java/org/polyfillservice/api/services/PreSortPolyfillServiceCustomServiceConfig.java", "license": "mit", "size": 3320 }
[ "junit.framework.TestCase", "org.polyfillservice.api.components.Query" ]
import junit.framework.TestCase; import org.polyfillservice.api.components.Query;
import junit.framework.*; import org.polyfillservice.api.components.*;
[ "junit.framework", "org.polyfillservice.api" ]
junit.framework; org.polyfillservice.api;
1,674,555
public SiteLink getSiteLink() { return siteLink; }
SiteLink function() { return siteLink; }
/** * Gets the sitelink. */
Gets the sitelink
getSiteLink
{ "repo_name": "JeffRisberg/BING01", "path": "src/main/java/com/microsoft/bingads/v10/bulk/entities/BulkSiteLink.java", "license": "mit", "size": 14302 }
[ "com.microsoft.bingads.v10.campaignmanagement.SiteLink" ]
import com.microsoft.bingads.v10.campaignmanagement.SiteLink;
import com.microsoft.bingads.v10.campaignmanagement.*;
[ "com.microsoft.bingads" ]
com.microsoft.bingads;
1,432,599
public ConnectPoint controlPlaneConnectPoint() { return connectPoint; }
ConnectPoint function() { return connectPoint; }
/** * Returns the routing control plane connect point. * * @return control plane connect point */
Returns the routing control plane connect point
controlPlaneConnectPoint
{ "repo_name": "kuujo/onos", "path": "apps/routing-api/src/main/java/org/onosproject/routing/config/RoutersConfig.java", "license": "apache-2.0", "size": 4434 }
[ "org.onosproject.net.ConnectPoint" ]
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.*;
[ "org.onosproject.net" ]
org.onosproject.net;
381,064
public void rangeExpressionEvaluatorMapBased() { // The algorithm : // Get all the nodes of the Expression Tree and fill it into a MAP. // The Map structure will be currentNode, ColumnName, LessThanOrGreaterThan, Value, ParentNode // Group the rows in MAP according to the columns and then evaluate if it can be transformed // into a RANGE or not. // // AND AND // | | // / \ / \ // / \ / \ // Less Greater => TRUE Range // / \ / \ / \ // / \ / \ / \ // a 10 a 5 Less greater // /\ /\ // / \ / \ // a 10 a 5 // Map<String, List<FilterModificationNode>> filterExpressionMap; filterExpressionMap = convertFilterTreeToMap(); replaceWithRangeExpression(filterExpressionMap); filterExpressionMap.clear(); }
void function() { Map<String, List<FilterModificationNode>> filterExpressionMap; filterExpressionMap = convertFilterTreeToMap(); replaceWithRangeExpression(filterExpressionMap); filterExpressionMap.clear(); }
/** * This method evaluates is any greater than or less than expression can be transformed * into a single RANGE filter. */
This method evaluates is any greater than or less than expression can be transformed into a single RANGE filter
rangeExpressionEvaluatorMapBased
{ "repo_name": "zzcclp/carbondata", "path": "core/src/main/java/org/apache/carbondata/core/scan/expression/RangeExpressionEvaluator.java", "license": "apache-2.0", "size": 18482 }
[ "java.util.List", "java.util.Map" ]
import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,693,439
public default List<GrammarRule> subrules() { return children(); }
default List<GrammarRule> function() { return children(); }
/** * Gets the subrules of this grammar rule. Alias for * {@link GrammarRule#children()}. * * @return the subrules of this grammar rule. */
Gets the subrules of this grammar rule. Alias for <code>GrammarRule#children()</code>
subrules
{ "repo_name": "NoodleOfDeath/PastaParser", "path": "runtime/java/src/com/noodleofdeath/grammarkit/model/grammar/rule/GrammarRule.java", "license": "mit", "size": 8079 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
912,360
@Nullable public Uri getTokenEndpoint() { return get(TOKEN_ENDPOINT); }
Uri function() { return get(TOKEN_ENDPOINT); }
/** * The OAuth 2 token endpoint URI. Not specified if only the implicit flow is used. * * @see <a href="http://openid.net/specs/openid-connect-core-1_0.html#TokenEndpoint"> * "OpenID Connect Dynamic Client Registration 1.0"</a> */
The OAuth 2 token endpoint URI. Not specified if only the implicit flow is used
getTokenEndpoint
{ "repo_name": "StudienprojektUniTrier/Client", "path": "library/java/net/openid/appauth/AuthorizationServiceDiscovery.java", "license": "apache-2.0", "size": 21556 }
[ "android.net.Uri" ]
import android.net.Uri;
import android.net.*;
[ "android.net" ]
android.net;
1,091,576
public ActionInstance deleteActionInstance(String actionInstanceId) throws ActionInstanceNotFoundException { checkInitialized(); return actionOperationsDelegate.delete(actionInstanceId); }
ActionInstance function(String actionInstanceId) throws ActionInstanceNotFoundException { checkInitialized(); return actionOperationsDelegate.delete(actionInstanceId); }
/** * Deletes/Removes the {@code ActionInstance} associated with this actionInstanceId. * If it has a {@code CronTrigger} then it is also un-scheduled from scheduler * @throws ActionInstanceNotFoundException * @throws com.netflix.scheduledactions.exceptions.ActionOperationException */
Deletes/Removes the ActionInstance associated with this actionInstanceId. If it has a CronTrigger then it is also un-scheduled from scheduler
deleteActionInstance
{ "repo_name": "spinnaker/scheduled-actions", "path": "scheduled-actions-core/src/main/java/com/netflix/scheduledactions/ActionsOperator.java", "license": "apache-2.0", "size": 11259 }
[ "com.netflix.scheduledactions.exceptions.ActionInstanceNotFoundException" ]
import com.netflix.scheduledactions.exceptions.ActionInstanceNotFoundException;
import com.netflix.scheduledactions.exceptions.*;
[ "com.netflix.scheduledactions" ]
com.netflix.scheduledactions;
435,758
@ServiceMethod(returns = ReturnType.SINGLE) PolicyDefinitionInner get(String policyDefinitionName);
@ServiceMethod(returns = ReturnType.SINGLE) PolicyDefinitionInner get(String policyDefinitionName);
/** * Gets the policy definition. * * @param policyDefinitionName The name of the policy definition to get. * @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 policy definition. */
Gets the policy definition
get
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyDefinitionsClient.java", "license": "mit", "size": 26040 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.resources.fluent.models.PolicyDefinitionInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.resources.fluent.models.PolicyDefinitionInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.resources.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,510,727
public void identifyNode(int nodeId) throws SerialInterfaceException { SerialMessage newMessage = new SerialMessage(nodeId, SerialMessageClass.IdentifyNode, SerialMessageType.Request, SerialMessageClass.IdentifyNode, SerialMessagePriority.High); byte[] newPayload = { (byte) nodeId }; newMessage.setMessagePayload(newPayload); this.enqueue(newMessage); }
void function(int nodeId) throws SerialInterfaceException { SerialMessage newMessage = new SerialMessage(nodeId, SerialMessageClass.IdentifyNode, SerialMessageType.Request, SerialMessageClass.IdentifyNode, SerialMessagePriority.High); byte[] newPayload = { (byte) nodeId }; newMessage.setMessagePayload(newPayload); this.enqueue(newMessage); }
/** * Send Identify Node message to the controller. * @param nodeId the nodeId of the node to identify * @throws SerialInterfaceException when timing out or getting an invalid response. */
Send Identify Node message to the controller
identifyNode
{ "repo_name": "dereulenspiegel/openhab", "path": "bundles/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/protocol/ZWaveController.java", "license": "epl-1.0", "size": 53059 }
[ "org.openhab.binding.zwave.internal.protocol.SerialMessage" ]
import org.openhab.binding.zwave.internal.protocol.SerialMessage;
import org.openhab.binding.zwave.internal.protocol.*;
[ "org.openhab.binding" ]
org.openhab.binding;
2,880,949
void register(Object object, Set<TypeInfo> services);
void register(Object object, Set<TypeInfo> services);
/** * Register an object as providing a set of services * * @param object object providing services * @param services services provided by object */
Register an object as providing a set of services
register
{ "repo_name": "mjameson-se/foundation", "path": "org.f8n.inject/src/org/f8n/inject/ServiceRegistry.java", "license": "unlicense", "size": 695 }
[ "java.util.Set", "org.f8n.reflect.TypeInfo" ]
import java.util.Set; import org.f8n.reflect.TypeInfo;
import java.util.*; import org.f8n.reflect.*;
[ "java.util", "org.f8n.reflect" ]
java.util; org.f8n.reflect;
1,257,167
public static ScalarFunction createUnsafe(Method method) { CallImplementor implementor = createImplementor(method); return new ScalarFunctionImpl(method, implementor); }
static ScalarFunction function(Method method) { CallImplementor implementor = createImplementor(method); return new ScalarFunctionImpl(method, implementor); }
/** * Creates unsafe version of {@link ScalarFunction} from any method. The method * does not need to be static or belong to a class with default constructor. It is * the responsibility of the underlying engine to initialize the UDF object that * contain the method. * * @param method method that is used to implement the function */
Creates unsafe version of <code>ScalarFunction</code> from any method. The method does not need to be static or belong to a class with default constructor. It is the responsibility of the underlying engine to initialize the UDF object that contain the method
createUnsafe
{ "repo_name": "vlsi/calcite", "path": "core/src/main/java/org/apache/calcite/schema/impl/ScalarFunctionImpl.java", "license": "apache-2.0", "size": 7472 }
[ "java.lang.reflect.Method", "org.apache.calcite.adapter.enumerable.CallImplementor", "org.apache.calcite.schema.ScalarFunction" ]
import java.lang.reflect.Method; import org.apache.calcite.adapter.enumerable.CallImplementor; import org.apache.calcite.schema.ScalarFunction;
import java.lang.reflect.*; import org.apache.calcite.adapter.enumerable.*; import org.apache.calcite.schema.*;
[ "java.lang", "org.apache.calcite" ]
java.lang; org.apache.calcite;
2,685,165
public void setRectangle(Rectangle rectangle) { this.rectangle.set(rectangle); }
void function(Rectangle rectangle) { this.rectangle.set(rectangle); }
/** * Set menu rectangle * * @param rectangle to set */
Set menu rectangle
setRectangle
{ "repo_name": "IonAgorria/Ouroboros", "path": "src/com/agorria/ouroboros/ui/panel/Panel.java", "license": "gpl-3.0", "size": 7026 }
[ "com.agorria.ouroboros.core.Rectangle" ]
import com.agorria.ouroboros.core.Rectangle;
import com.agorria.ouroboros.core.*;
[ "com.agorria.ouroboros" ]
com.agorria.ouroboros;
252,680
public E nextElement() { if (element == null) { throw new NoSuchElementException(Messages.getString("security.17")); //$NON-NLS-1$ } E last = element; element = null; return last; } }
E function() { if (element == null) { throw new NoSuchElementException(Messages.getString(STR)); } E last = element; element = null; return last; } }
/** * Returns the element and clears internal reference to it. */
Returns the element and clears internal reference to it
nextElement
{ "repo_name": "freeVM/freeVM", "path": "enhanced/archive/classlib/java6/modules/security/src/main/java/common/java/security/AllPermissionCollection.java", "license": "apache-2.0", "size": 4478 }
[ "java.util.NoSuchElementException", "org.apache.harmony.security.internal.nls.Messages" ]
import java.util.NoSuchElementException; import org.apache.harmony.security.internal.nls.Messages;
import java.util.*; import org.apache.harmony.security.internal.nls.*;
[ "java.util", "org.apache.harmony" ]
java.util; org.apache.harmony;
2,367,025
@Test public void codecSimpleFlowTest() throws IOException { FlowRule rule = getRule("simple-flow.json"); checkCommonData(rule); assertThat(rule.selector().criteria().size(), is(1)); Criterion criterion1 = rule.selector().criteria().iterator().next(); assertThat(criterion1.type(), is(Criterion.Type.ETH_TYPE)); assertThat(((EthTypeCriterion) criterion1).ethType(), is(2054)); assertThat(rule.treatment().allInstructions().size(), is(1)); Instruction instruction1 = rule.treatment().allInstructions().get(0); assertThat(instruction1.type(), is(Instruction.Type.OUTPUT)); assertThat(((Instructions.OutputInstruction) instruction1).port(), is(PortNumber.CONTROLLER)); } SortedMap<String, Instruction> instructions = new TreeMap<>();
void function() throws IOException { FlowRule rule = getRule(STR); checkCommonData(rule); assertThat(rule.selector().criteria().size(), is(1)); Criterion criterion1 = rule.selector().criteria().iterator().next(); assertThat(criterion1.type(), is(Criterion.Type.ETH_TYPE)); assertThat(((EthTypeCriterion) criterion1).ethType(), is(2054)); assertThat(rule.treatment().allInstructions().size(), is(1)); Instruction instruction1 = rule.treatment().allInstructions().get(0); assertThat(instruction1.type(), is(Instruction.Type.OUTPUT)); assertThat(((Instructions.OutputInstruction) instruction1).port(), is(PortNumber.CONTROLLER)); } SortedMap<String, Instruction> instructions = new TreeMap<>();
/** * Checks that a simple rule decodes properly. * * @throws IOException if the resource cannot be processed */
Checks that a simple rule decodes properly
codecSimpleFlowTest
{ "repo_name": "maxkondr/onos-porta", "path": "core/common/src/test/java/org/onosproject/codec/impl/FlowRuleCodecTest.java", "license": "apache-2.0", "size": 22038 }
[ "java.io.IOException", "java.util.SortedMap", "java.util.TreeMap", "org.hamcrest.MatcherAssert", "org.hamcrest.Matchers", "org.onosproject.net.PortNumber", "org.onosproject.net.flow.FlowRule", "org.onosproject.net.flow.criteria.Criterion", "org.onosproject.net.flow.criteria.EthTypeCriterion", "org.onosproject.net.flow.instructions.Instruction", "org.onosproject.net.flow.instructions.Instructions" ]
import java.io.IOException; import java.util.SortedMap; import java.util.TreeMap; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.onosproject.net.PortNumber; import org.onosproject.net.flow.FlowRule; import org.onosproject.net.flow.criteria.Criterion; import org.onosproject.net.flow.criteria.EthTypeCriterion; import org.onosproject.net.flow.instructions.Instruction; import org.onosproject.net.flow.instructions.Instructions;
import java.io.*; import java.util.*; import org.hamcrest.*; import org.onosproject.net.*; import org.onosproject.net.flow.*; import org.onosproject.net.flow.criteria.*; import org.onosproject.net.flow.instructions.*;
[ "java.io", "java.util", "org.hamcrest", "org.onosproject.net" ]
java.io; java.util; org.hamcrest; org.onosproject.net;
2,157,177
default AdvancedNitriteEndpointConsumerBuilder exchangePattern( ExchangePattern exchangePattern) { doSetProperty("exchangePattern", exchangePattern); return this; }
default AdvancedNitriteEndpointConsumerBuilder exchangePattern( ExchangePattern exchangePattern) { doSetProperty(STR, exchangePattern); return this; }
/** * Sets the exchange pattern when the consumer creates an exchange. * * The option is a: <code>org.apache.camel.ExchangePattern</code> type. * * Group: consumer (advanced) */
Sets the exchange pattern when the consumer creates an exchange. The option is a: <code>org.apache.camel.ExchangePattern</code> type. Group: consumer (advanced)
exchangePattern
{ "repo_name": "CodeSmell/camel", "path": "core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/NitriteEndpointBuilderFactory.java", "license": "apache-2.0", "size": 25276 }
[ "org.apache.camel.ExchangePattern" ]
import org.apache.camel.ExchangePattern;
import org.apache.camel.*;
[ "org.apache.camel" ]
org.apache.camel;
2,544,151
public List<Birthday> getBirthdays() { return birthdays; }
List<Birthday> function() { return birthdays; }
/** * Will need https://www.googleapis.com/auth/user.birthday.read scope * @return list of birthdays */
Will need HREF scope
getBirthdays
{ "repo_name": "spring-social/spring-social-google", "path": "src/main/java/org/springframework/social/google/api/people/PeoplePerson.java", "license": "apache-2.0", "size": 3025 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
767,424
public DataNode setTypeScalar(String type);
DataNode function(String type);
/** * Type of the disk-chopper: only one from the enumerated list (match text exactly) * <p> * <p><b>Enumeration:</b><ul> * <li><b>Chopper type single</b> </li> * <li><b>contra_rotating_pair</b> </li> * <li><b>synchro_pair</b> </li></ul></p> * </p> * * @param type the type */
Type of the disk-chopper: only one from the enumerated list (match text exactly) Enumeration: Chopper type single contra_rotating_pair synchro_pair
setTypeScalar
{ "repo_name": "colinpalmer/dawnsci", "path": "org.eclipse.dawnsci.nexus/autogen/org/eclipse/dawnsci/nexus/NXdisk_chopper.java", "license": "epl-1.0", "size": 11747 }
[ "org.eclipse.dawnsci.analysis.api.tree.DataNode" ]
import org.eclipse.dawnsci.analysis.api.tree.DataNode;
import org.eclipse.dawnsci.analysis.api.tree.*;
[ "org.eclipse.dawnsci" ]
org.eclipse.dawnsci;
2,880,889
EReference getOclFeature_Definition();
EReference getOclFeature_Definition();
/** * Returns the meta object for the container reference '{@link anatlyzer.atlext.OCL.OclFeature#getDefinition <em>Definition</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the container reference '<em>Definition</em>'. * @see anatlyzer.atlext.OCL.OclFeature#getDefinition() * @see #getOclFeature() * @generated */
Returns the meta object for the container reference '<code>anatlyzer.atlext.OCL.OclFeature#getDefinition Definition</code>'.
getOclFeature_Definition
{ "repo_name": "jesusc/anatlyzer", "path": "plugins/anatlyzer.atl.typing/src-gen/anatlyzer/atlext/OCL/OCLPackage.java", "license": "epl-1.0", "size": 484377 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,621,653