method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public static Uri buildSessionsUri(String blockId) { return CONTENT_URI.buildUpon().appendPath(blockId).appendPath(PATH_SESSIONS).build(); }
static Uri function(String blockId) { return CONTENT_URI.buildUpon().appendPath(blockId).appendPath(PATH_SESSIONS).build(); }
/** * Build {@link Uri} that references any {@link Sessions} associated * with the requested {@link #BLOCK_ID}. */
Build <code>Uri</code> that references any <code>Sessions</code> associated with the requested <code>#BLOCK_ID</code>
buildSessionsUri
{ "repo_name": "underhilllabs/iosched", "path": "src/com/google/android/apps/iosched/provider/ScheduleContract.java", "license": "apache-2.0", "size": 21916 }
[ "android.net.Uri" ]
import android.net.Uri;
import android.net.*;
[ "android.net" ]
android.net;
1,678,881
@ZapApiIgnore public List<DomainMatcher> getPermittedAddressesEnabled() { return permittedAddressesEnabled; }
List<DomainMatcher> function() { return permittedAddressesEnabled; }
/** * Returns the enabled client addresses that are allowed to access the API. * * @return the enabled client addresses that are allowed to access the API. * @since 2.6.0 */
Returns the enabled client addresses that are allowed to access the API
getPermittedAddressesEnabled
{ "repo_name": "psiinon/zaproxy", "path": "zap/src/main/java/org/zaproxy/zap/extension/api/OptionsParamApi.java", "license": "apache-2.0", "size": 13074 }
[ "java.util.List", "org.zaproxy.zap.network.DomainMatcher" ]
import java.util.List; import org.zaproxy.zap.network.DomainMatcher;
import java.util.*; import org.zaproxy.zap.network.*;
[ "java.util", "org.zaproxy.zap" ]
java.util; org.zaproxy.zap;
777,842
@Test(expectedExceptions = IllegalStateException.class) public void testNoSecuritySource() { try (ToolContext toolContext = new ToolContext()) { VALIDATOR.validate(GROUP, toolContext); } catch (final Exception e) { throw e; } }
@Test(expectedExceptions = IllegalStateException.class) void function() { try (ToolContext toolContext = new ToolContext()) { VALIDATOR.validate(GROUP, toolContext); } catch (final Exception e) { throw e; } }
/** * Tests the behaviour when the tool context does not have a security source set. */
Tests the behaviour when the tool context does not have a security source set
testNoSecuritySource
{ "repo_name": "McLeodMoores/starling", "path": "projects/validation/src/test/java/com/mcleodmoores/security/ToolContextSecurityValidatorTest.java", "license": "apache-2.0", "size": 3844 }
[ "com.opengamma.financial.tool.ToolContext", "org.testng.annotations.Test" ]
import com.opengamma.financial.tool.ToolContext; import org.testng.annotations.Test;
import com.opengamma.financial.tool.*; import org.testng.annotations.*;
[ "com.opengamma.financial", "org.testng.annotations" ]
com.opengamma.financial; org.testng.annotations;
2,330,491
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux<PollResult<Void>, Void> beginExportDataAsync( String resourceGroupName, String name, ExportRdbParameters parameters, Context context) { context = this.client.mergeContext(context); Mono<Response<Flux<ByteBuffe...
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux<PollResult<Void>, Void> function( String resourceGroupName, String name, ExportRdbParameters parameters, Context context) { context = this.client.mergeContext(context); Mono<Response<Flux<ByteBuffer>>> mono = exportDataWithResponseAsync(resourceGrou...
/** * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. * @param name The name of the Redis cache. * @param parameters Parameters for Redis export operation. * @param context The context to associate with this operation. ...
Export data from the redis cache to blobs in a container
beginExportDataAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisClientImpl.java", "license": "mit", "size": 145842 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.management.polling.PollResult", "com.azure.core.util.Context", "com.azure.core.util.polling.PollerFlux", "com.azure.resourcemanager.redis.models.ExportRdbParameters", ...
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.PollerFlux; import com.azure.resourcemanager.redis.models.Exp...
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.redis.models.*; import java.nio.*;
[ "com.azure.core", "com.azure.resourcemanager", "java.nio" ]
com.azure.core; com.azure.resourcemanager; java.nio;
2,445,611
Any decode_value(byte[] them, TypeCode type) throws FormatMismatch, TypeMismatch;
Any decode_value(byte[] them, TypeCode type) throws FormatMismatch, TypeMismatch;
/** * Decode the given array of bytes, supposing that they contain the * given data structure, and return the decoded value. * * @param them the array of bytes to decode. Should contain the data type, * matching the structure, defined in the <code>type</code> parameter. * Does not contain the typecode...
Decode the given array of bytes, supposing that they contain the given data structure, and return the decoded value
decode_value
{ "repo_name": "SanDisk-Open-Source/SSD_Dashboard", "path": "uefi/gcc/gcc-4.6.3/libjava/classpath/org/omg/IOP/CodecOperations.java", "license": "gpl-2.0", "size": 4714 }
[ "org.omg.CORBA", "org.omg.IOP" ]
import org.omg.CORBA; import org.omg.IOP;
import org.omg.*;
[ "org.omg" ]
org.omg;
1,227,754
public static void setZipEocdCentralDirectoryOffset( ByteBuffer zipEndOfCentralDirectory, long offset) { assertByteOrderLittleEndian(zipEndOfCentralDirectory); setUnsignedInt32( zipEndOfCentralDirectory, zipEndOfCentralDirectory.position() + ZIP_EOCD_CENTR...
static void function( ByteBuffer zipEndOfCentralDirectory, long offset) { assertByteOrderLittleEndian(zipEndOfCentralDirectory); setUnsignedInt32( zipEndOfCentralDirectory, zipEndOfCentralDirectory.position() + ZIP_EOCD_CENTRAL_DIR_OFFSET_FIELD_OFFSET, offset); }
/** * Sets the offset of the start of the ZIP Central Directory in the archive. * * <p>NOTE: Byte order of {@code zipEndOfCentralDirectory} must be little-endian. */
Sets the offset of the start of the ZIP Central Directory in the archive
setZipEocdCentralDirectoryOffset
{ "repo_name": "wang-qian/ChannelPackage", "path": "src/com/leon/channel/common/verify/ZipUtils.java", "license": "apache-2.0", "size": 12203 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
1,490,563
@Override public DynaClass getDynaClass() { return dynaClass; }
DynaClass function() { return dynaClass; }
/** * {@inheritDoc} This implementation returns an instance of {@code MultiWrapDynaClass}. */
This implementation returns an instance of MultiWrapDynaClass
getDynaClass
{ "repo_name": "apache/commons-configuration", "path": "src/main/java/org/apache/commons/configuration2/builder/combined/MultiWrapDynaBean.java", "license": "apache-2.0", "size": 5530 }
[ "org.apache.commons.beanutils.DynaClass" ]
import org.apache.commons.beanutils.DynaClass;
import org.apache.commons.beanutils.*;
[ "org.apache.commons" ]
org.apache.commons;
2,357,780
@JsProperty(name = "geometryInstances") public native GeometryInstance[] geometryInstances();
@JsProperty(name = STR) native GeometryInstance[] function();
/** * The geometry instances rendered with this primitive. This may be undefined if * options.releaseGeometryInstances is true when the primitive is constructed. * Changing this property after the primitive is rendered has no effect. * <p> * Default: undefined */
The geometry instances rendered with this primitive. This may be undefined if options.releaseGeometryInstances is true when the primitive is constructed. Changing this property after the primitive is rendered has no effect. Default: undefined
geometryInstances
{ "repo_name": "iSergio/gwt-cs", "path": "cesiumjs4gwt-main/src/main/java/org/cesiumjs/cs/scene/ClassificationPrimitive.java", "license": "apache-2.0", "size": 7391 }
[ "org.cesiumjs.cs.core.geometry.GeometryInstance" ]
import org.cesiumjs.cs.core.geometry.GeometryInstance;
import org.cesiumjs.cs.core.geometry.*;
[ "org.cesiumjs.cs" ]
org.cesiumjs.cs;
1,255,141
ResultSet executeQuery(PreparedStatement statement) throws SQLException;
ResultSet executeQuery(PreparedStatement statement) throws SQLException;
/** * Execute query * * @param statement prepared statement * @return the result set * @throws SQLException when SQL execution gives an error */
Execute query
executeQuery
{ "repo_name": "jprante/elasticsearch-jdbc", "path": "src/main/java/org/xbib/elasticsearch/jdbc/strategy/JDBCSource.java", "license": "apache-2.0", "size": 13485 }
[ "java.sql.PreparedStatement", "java.sql.ResultSet", "java.sql.SQLException" ]
import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,137,523
public final Collection<GrantedAuthority> getGrantedAuthorities( DirContextOperations user, String username) { String userDn = user.getNameInNamespace(); if (logger.isDebugEnabled()) { logger.debug("Getting authorities for user " + userDn); } Set<GrantedAuth...
final Collection<GrantedAuthority> function( DirContextOperations user, String username) { String userDn = user.getNameInNamespace(); if (logger.isDebugEnabled()) { logger.debug(STR + userDn); } Set<GrantedAuthority> roles = getGroupMembershipRoles(userDn, username); Set<GrantedAuthority> extraRoles = getAdditionalRole...
/** * Obtains the authorities for the user who's directory entry is represented by the * supplied LdapUserDetails object. * * @param user the user who's authorities are required * @return the set of roles granted to the user. */
Obtains the authorities for the user who's directory entry is represented by the supplied LdapUserDetails object
getGrantedAuthorities
{ "repo_name": "Booksonic-Server/madsonic-main", "path": "src/main/java/org/madsonic/ldap/MadsonicLdapAuthoritiesPopulator.java", "license": "gpl-3.0", "size": 11450 }
[ "java.util.ArrayList", "java.util.Collection", "java.util.List", "java.util.Set", "org.springframework.ldap.core.DirContextOperations", "org.springframework.security.core.GrantedAuthority" ]
import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Set; import org.springframework.ldap.core.DirContextOperations; import org.springframework.security.core.GrantedAuthority;
import java.util.*; import org.springframework.ldap.core.*; import org.springframework.security.core.*;
[ "java.util", "org.springframework.ldap", "org.springframework.security" ]
java.util; org.springframework.ldap; org.springframework.security;
964,709
//----------------------------------------------------------------------- public Period toPeriod() { return new Period(this); }
Period function() { return new Period(this); }
/** * Get this period as an immutable <code>Period</code> object. * * @return a Period using the same field set and values */
Get this period as an immutable <code>Period</code> object
toPeriod
{ "repo_name": "HossainKhademian/JodaTime", "path": "src/main/java/org/joda/time/base/AbstractPeriod.java", "license": "apache-2.0", "size": 8147 }
[ "org.joda.time.Period" ]
import org.joda.time.Period;
import org.joda.time.*;
[ "org.joda.time" ]
org.joda.time;
1,921,649
static AttributeConverterProvider defaultProvider() { return ConverterProviderResolver.defaultConverterProvider(); }
static AttributeConverterProvider defaultProvider() { return ConverterProviderResolver.defaultConverterProvider(); }
/** * Returns a default implementation of AttributeConverterProvider with all * standard Java type converters included. */
Returns a default implementation of AttributeConverterProvider with all standard Java type converters included
defaultProvider
{ "repo_name": "aws/aws-sdk-java-v2", "path": "services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/AttributeConverterProvider.java", "license": "apache-2.0", "size": 1706 }
[ "software.amazon.awssdk.enhanced.dynamodb.internal.converter.ConverterProviderResolver" ]
import software.amazon.awssdk.enhanced.dynamodb.internal.converter.ConverterProviderResolver;
import software.amazon.awssdk.enhanced.dynamodb.internal.converter.*;
[ "software.amazon.awssdk" ]
software.amazon.awssdk;
2,746,730
@ServiceMethod(returns = ReturnType.SINGLE) public SyncPoller<PollResult<EndpointInner>, EndpointInner> beginStop( String resourceGroupName, String profileName, String endpointName, Context context) { return beginStopAsync(resourceGroupName, profileName, endpointName, context).getSyncPoller(); ...
@ServiceMethod(returns = ReturnType.SINGLE) SyncPoller<PollResult<EndpointInner>, EndpointInner> function( String resourceGroupName, String profileName, String endpointName, Context context) { return beginStopAsync(resourceGroupName, profileName, endpointName, context).getSyncPoller(); }
/** * Stops an existing running CDN endpoint. * * @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 endpointName Name of the endpoint under the profile which is uniq...
Stops an existing running CDN endpoint
beginStop
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/implementation/EndpointsClientImpl.java", "license": "mit", "size": 169310 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.management.polling.PollResult", "com.azure.core.util.Context", "com.azure.core.util.polling.SyncPoller", "com.azure.resourcemanager.cdn.fluent.models.EndpointInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cdn.fluent.models.EndpointInner;
import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.cdn.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,602,200
private void printUsage() { HelpFormatter formatter = new HelpFormatter(); // Option names are long so increasing the width is helpful formatter.setWidth(100); formatter.printHelp("Client", opts); }
void function() { HelpFormatter formatter = new HelpFormatter(); formatter.setWidth(100); formatter.printHelp(STR, opts); }
/** * Helper function to print out usage. */
Helper function to print out usage
printUsage
{ "repo_name": "steveloughran/hadoop", "path": "hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/src/main/java/org/apache/hadoop/tools/dynamometer/Client.java", "license": "apache-2.0", "size": 48758 }
[ "org.apache.commons.cli.HelpFormatter" ]
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.*;
[ "org.apache.commons" ]
org.apache.commons;
2,505,308
public static String getString( final byte[] data, int offset, int length, String charset ) { if (data == null) { throw new IllegalArgumentException("Parameter may not be null"); } if (charset == null || charset.length() == 0) { ...
static String function( final byte[] data, int offset, int length, String charset ) { if (data == null) { throw new IllegalArgumentException(STR); } if (charset == null charset.length() == 0) { throw new IllegalArgumentException(STR); } try { return new String(data, offset, length, charset); } catch (UnsupportedEncodin...
/** * Converts the byte array of HTTP content characters to a string. If * the specified charset is not supported, default system encoding * is used. * * @param data the byte array to be encoded * @param offset the index of the first byte to encode * @param length the number of bytes ...
Converts the byte array of HTTP content characters to a string. If the specified charset is not supported, default system encoding is used
getString
{ "repo_name": "magneticmoon/httpclient3-ntml", "path": "src/java/org/apache/commons/httpclient/util/EncodingUtil.java", "license": "apache-2.0", "size": 9945 }
[ "java.io.UnsupportedEncodingException" ]
import java.io.UnsupportedEncodingException;
import java.io.*;
[ "java.io" ]
java.io;
2,227,371
Single<byte[]> dump();
Single<byte[]> dump();
/** * Returns dump of object * * @return dump */
Returns dump of object
dump
{ "repo_name": "redisson/redisson", "path": "redisson/src/main/java/org/redisson/api/RObjectRx.java", "license": "apache-2.0", "size": 5431 }
[ "io.reactivex.rxjava3.core.Single" ]
import io.reactivex.rxjava3.core.Single;
import io.reactivex.rxjava3.core.*;
[ "io.reactivex.rxjava3" ]
io.reactivex.rxjava3;
779,543
@Test public void testPrivilegesForUserNameCaseSensitive() throws Exception { // The value of "sentry.metastore.service.users" is "accessAllMetaUser", and // the value is case-sensitive. // The input name is "ACCESSALLMEATAUSER", and the client should has no // access to metadata. HiveMetaStoreC...
void function() throws Exception { HiveMetaStoreClient client = context.getMetaStoreClient(userWithoutAccess.toUpperCase()); try { client.getDatabase(dbName1); fail(STR); } catch (NoSuchObjectException noe) { } }
/** * The configuration "sentry.metastore.service.users" is for user who has all * access to metadata, and the value should be case-sensitive. * * @throws Exception */
The configuration "sentry.metastore.service.users" is for user who has all access to metadata, and the value should be case-sensitive
testPrivilegesForUserNameCaseSensitive
{ "repo_name": "joshuayao/incubator-sentry", "path": "sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/TestAuthorizingObjectStore.java", "license": "apache-2.0", "size": 48207 }
[ "org.apache.hadoop.hive.metastore.HiveMetaStoreClient", "org.apache.hadoop.hive.metastore.api.NoSuchObjectException", "org.junit.Assert" ]
import org.apache.hadoop.hive.metastore.HiveMetaStoreClient; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.junit.Assert;
import org.apache.hadoop.hive.metastore.*; import org.apache.hadoop.hive.metastore.api.*; import org.junit.*;
[ "org.apache.hadoop", "org.junit" ]
org.apache.hadoop; org.junit;
2,365,731
public List<Scenario> getDerivedScenarios() { return derivedScenarios; }
List<Scenario> function() { return derivedScenarios; }
/** * Returns all the {@link Scenario} that has a parent. */
Returns all the <code>Scenario</code> that has a parent
getDerivedScenarios
{ "repo_name": "bolobr/IEBT-Libreplan", "path": "libreplan-webapp/src/main/java/org/libreplan/web/scenarios/ScenarioTreeRoot.java", "license": "agpl-3.0", "size": 2199 }
[ "java.util.List", "org.libreplan.business.scenarios.entities.Scenario" ]
import java.util.List; import org.libreplan.business.scenarios.entities.Scenario;
import java.util.*; import org.libreplan.business.scenarios.entities.*;
[ "java.util", "org.libreplan.business" ]
java.util; org.libreplan.business;
468,246
PacketService packetService();
PacketService packetService();
/** * Returns the shared packet service reference. * * @return packet service */
Returns the shared packet service reference
packetService
{ "repo_name": "kuujo/onos", "path": "providers/lldpcommon/src/main/java/org/onosproject/provider/lldpcommon/LinkDiscoveryContext.java", "license": "apache-2.0", "size": 2699 }
[ "org.onosproject.net.packet.PacketService" ]
import org.onosproject.net.packet.PacketService;
import org.onosproject.net.packet.*;
[ "org.onosproject.net" ]
org.onosproject.net;
1,916,560
private void discharge (Telegram telegram) { if (telegram.receiver != null) { // Dispatch the telegram to the receiver specified by the telegram itself if (!telegram.receiver.handleMessage(telegram)) { // Telegram could not be handled if (debugEnabled) GdxAI.getLogger().info(LOG_TAG, "Message " + tel...
void function (Telegram telegram) { if (telegram.receiver != null) { if (!telegram.receiver.handleMessage(telegram)) { if (debugEnabled) GdxAI.getLogger().info(LOG_TAG, STR + telegram.message + STR); } } else { int handledCount = 0; Array<Telegraph> listeners = msgListeners.get(telegram.message); if (listeners != null)...
/** This method is used by {@link #dispatchMessage(float, Telegraph, Telegraph, int, Object) dispatchMessage} for immediate * telegrams and {@link #update(float) update} for delayed telegrams. It first calls the message handling method of the * receiving agents with the specified telegram then returns the telegram ...
This method is used by <code>#dispatchMessage(float, Telegraph, Telegraph, int, Object) dispatchMessage</code> for immediate telegrams and <code>#update(float) update</code> for delayed telegrams. It first calls the message handling method of the receiving agents with the specified telegram then returns the telegram to...
discharge
{ "repo_name": "domokato/gdx-ai", "path": "gdx-ai/src/com/badlogic/gdx/ai/msg/MessageDispatcher.java", "license": "apache-2.0", "size": 27005 }
[ "com.badlogic.gdx.ai.GdxAI", "com.badlogic.gdx.utils.Array" ]
import com.badlogic.gdx.ai.GdxAI; import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.ai.*; import com.badlogic.gdx.utils.*;
[ "com.badlogic.gdx" ]
com.badlogic.gdx;
1,999,654
static boolean isIndexFile(File file) { return isFile(file, "index"); }
static boolean isIndexFile(File file) { return isFile(file, "index"); }
/** * Returns a boolean value indicating whether the given file appears to be a parsable index file. */
Returns a boolean value indicating whether the given file appears to be a parsable index file
isIndexFile
{ "repo_name": "arnonmoscona/copycat", "path": "storage/src/main/java/net/kuujo/copycat/io/storage/SegmentFile.java", "license": "apache-2.0", "size": 3008 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
913,323
@Test public void testISAcceptMatchesReturnContentType() throws Exception { HttpPut put = new HttpPut(isTestUri); byte[] barr = new byte[80000]; Random r = new Random(); r.nextBytes(barr); ByteArrayEntity putReq = new ByteArrayEntity(barr); putReq.setContentType(...
void function() throws Exception { HttpPut put = new HttpPut(isTestUri); byte[] barr = new byte[80000]; Random r = new Random(); r.nextBytes(barr); ByteArrayEntity putReq = new ByteArrayEntity(barr); putReq.setContentType(STR); put.setEntity(putReq); HttpResponse resp = httpClient.execute(put); assertEquals(204, resp.g...
/** * Tests receiving an empty byte array. * */
Tests receiving an empty byte array
testISAcceptMatchesReturnContentType
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.jaxrs.2.0_fat/fat/src/com/ibm/ws/jaxrs20/fat/StandardProvidersTest.java", "license": "epl-1.0", "size": 45950 }
[ "java.io.DataInputStream", "java.io.InputStream", "java.util.Random", "org.apache.http.HttpResponse", "org.apache.http.client.methods.HttpGet", "org.apache.http.client.methods.HttpPut", "org.apache.http.entity.ByteArrayEntity", "org.junit.Assert" ]
import java.io.DataInputStream; import java.io.InputStream; import java.util.Random; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPut; import org.apache.http.entity.ByteArrayEntity; import org.junit.Assert;
import java.io.*; import java.util.*; import org.apache.http.*; import org.apache.http.client.methods.*; import org.apache.http.entity.*; import org.junit.*;
[ "java.io", "java.util", "org.apache.http", "org.junit" ]
java.io; java.util; org.apache.http; org.junit;
430,319
protected void applyForegroundColor(Color color, Control control) { applyForegroundColor(color, control, getForegroundColorExclusions()); } /** * Set the specified background color for the specified control and all of * its children. Subclasses may override this method, but typically do not. * If a subcla...
void function(Color color, Control control) { applyForegroundColor(color, control, getForegroundColorExclusions()); } /** * Set the specified background color for the specified control and all of * its children. Subclasses may override this method, but typically do not. * If a subclass wishes to exclude a particular co...
/** * Set the specified foreground color for the specified control and all of * its children. Subclasses may override this method, but typically do not. * If a subclass wishes to exclude a particular control in its contents from * getting the specified foreground color, it may instead override * {@link #getFo...
Set the specified foreground color for the specified control and all of its children. Subclasses may override this method, but typically do not. If a subclass wishes to exclude a particular control in its contents from getting the specified foreground color, it may instead override <code>#getForegroundColorExclusions()...
applyForegroundColor
{ "repo_name": "ControlSystemStudio/org.csstudio.iter", "path": "plugins/org.eclipse.jface/src/org/eclipse/jface/dialogs/PopupDialog.java", "license": "epl-1.0", "size": 54110 }
[ "org.eclipse.swt.graphics.Color", "org.eclipse.swt.widgets.Control" ]
import org.eclipse.swt.graphics.Color; import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
2,530,416
private JTextField getJbossServerPortField() { if (jbossServerPortField == null) { jbossServerPortField = new JTextField(); jbossServerPortField.setToolTipText("Enter the port number JBoss will listen to for HTTP requests"); jbossServerPortField.setText(parentContainer.getPropertiesMana...
JTextField function() { if (jbossServerPortField == null) { jbossServerPortField = new JTextField(); jbossServerPortField.setToolTipText(STR); jbossServerPortField.setText(parentContainer.getPropertiesManager().getDeployPropertyValue(STR));
/** * This method initializes the Jboss Server Port Field * * @return javax.swing.JTextField */
This method initializes the Jboss Server Port Field
getJbossServerPortField
{ "repo_name": "NCIP/cacore-sdk", "path": "sdk-workbench/workbench-project/software/modules/workbench/src/gov/nih/nci/cacore/workbench/portal/panel/AppServerSettingsPanel.java", "license": "bsd-3-clause", "size": 73991 }
[ "javax.swing.JTextField" ]
import javax.swing.JTextField;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
1,377,703
private Slot getUnassignedSlot(String queueName) { Slot slotToBeAssigned = null; TreeSet<Slot> unAssignedSlotSet = unAssignedSlotMap.get(queueName); if (null != unAssignedSlotSet) { slotToBeAssigned = unAssignedSlotSet.pollFirst(); } return slotToBeAssigned; }
Slot function(String queueName) { Slot slotToBeAssigned = null; TreeSet<Slot> unAssignedSlotSet = unAssignedSlotMap.get(queueName); if (null != unAssignedSlotSet) { slotToBeAssigned = unAssignedSlotSet.pollFirst(); } return slotToBeAssigned; }
/** * Get an unassigned slot (slots dropped by sudden subscription closes) * * @param queueName name of the queue slot is required * @return slot or null if cannot find */
Get an unassigned slot (slots dropped by sudden subscription closes)
getUnassignedSlot
{ "repo_name": "prabathariyaratna/andes", "path": "modules/andes-core/broker/src/main/java/org/wso2/andes/kernel/slot/SlotManagerStandalone.java", "license": "apache-2.0", "size": 11691 }
[ "java.util.TreeSet" ]
import java.util.TreeSet;
import java.util.*;
[ "java.util" ]
java.util;
2,161,233
public final void startConsoleLogging() { stopLogging(); this.logConsole = true; setLogLevel(EncogLogging.LEVEL_DEBUG); }
final void function() { stopLogging(); this.logConsole = true; setLogLevel(EncogLogging.LEVEL_DEBUG); }
/** * Start logging to the console. */
Start logging to the console
startConsoleLogging
{ "repo_name": "larhoy/SentimentProjectV2", "path": "SentimentAnalysisV2/encog-core-3.1.0/src/main/java/org/encog/plugin/system/SystemLoggingPlugin.java", "license": "mit", "size": 4308 }
[ "org.encog.util.logging.EncogLogging" ]
import org.encog.util.logging.EncogLogging;
import org.encog.util.logging.*;
[ "org.encog.util" ]
org.encog.util;
2,817,377
@Test public void testDemoLoadsProperly() throws Exception { WebDriverWait wait = new WebDriverWait(driver, 20); wait.pollingEvery(500, TimeUnit.MILLISECONDS); driver.get("http://localhost:9080/");
void function() throws Exception { WebDriverWait wait = new WebDriverWait(driver, 20); wait.pollingEvery(500, TimeUnit.MILLISECONDS); driver.get("http:
/** * Simple test which verifies that the demo starts. * * @throws Exception oops */
Simple test which verifies that the demo starts
testDemoLoadsProperly
{ "repo_name": "olivermay/geomajas", "path": "project/geomajas-project-sld-editor/expert-gwt-example/src/test/java/org/geomajas/sld/editor/expert/example/LoadsProperlyTestInt.java", "license": "agpl-3.0", "size": 1582 }
[ "java.util.concurrent.TimeUnit", "org.openqa.selenium.support.ui.WebDriverWait" ]
import java.util.concurrent.TimeUnit; import org.openqa.selenium.support.ui.WebDriverWait;
import java.util.concurrent.*; import org.openqa.selenium.support.ui.*;
[ "java.util", "org.openqa.selenium" ]
java.util; org.openqa.selenium;
2,848,599
private boolean checkElements(IDecisionVariableContainer container, CompoundValue otherValue, boolean ignoreUndefinedInObject) { boolean equals = true; for (int s = 0; equals && s < container.getElementCount(); s++) { String slotName = container.getElement(s).getName(); ...
boolean function(IDecisionVariableContainer container, CompoundValue otherValue, boolean ignoreUndefinedInObject) { boolean equals = true; for (int s = 0; equals && s < container.getElementCount(); s++) { String slotName = container.getElement(s).getName(); Value oValue = otherValue.getNestedValue(slotName); if (!ignor...
/** * Checks the elements for equality. * * @param container the container to check * @param otherValue the other value to compare against * @param ignoreUndefinedInObject whether undefined values in <code>object</code> shall be ignored * (partial equality) * @return <code>true</c...
Checks the elements for equality
checkElements
{ "repo_name": "SSEHUB/EASyProducer", "path": "Plugins/VarModel/Model/src/net/ssehub/easy/varModel/model/values/CompoundValue.java", "license": "apache-2.0", "size": 21554 }
[ "net.ssehub.easy.varModel.model.IDecisionVariableContainer" ]
import net.ssehub.easy.varModel.model.IDecisionVariableContainer;
import net.ssehub.easy.*;
[ "net.ssehub.easy" ]
net.ssehub.easy;
979,470
private static ProteinDetailList bufferProteinIdentifications(String queryURL) throws IOException { ProteinDetailList proteins = new ProteinDetailList(); //buffer the results boolean moreResults = true; int page = 0; while (moreResults) { ProteinDetailList subList...
static ProteinDetailList function(String queryURL) throws IOException { ProteinDetailList proteins = new ProteinDetailList(); boolean moreResults = true; int page = 0; while (moreResults) { ProteinDetailList subList = (ProteinDetailList) MARSHALLER.getProteinDetailList(queryURL + STR + PAGE_SIZE + STR + page); if (subL...
/** * Returns a list of proteins, gotten from the paged query. * * @param queryURL the root query url * @return a list of proteins, gotten from the paged query * @throws IOException thrown if the webservice is down or the json response * was invalid */
Returns a list of proteins, gotten from the paged query
bufferProteinIdentifications
{ "repo_name": "compomics/compomics-utilities", "path": "src/main/java/com/compomics/util/pride/PrideWebService.java", "license": "apache-2.0", "size": 20970 }
[ "java.io.IOException", "uk.ac.ebi.pride.archive.web.service.model.protein.ProteinDetailList" ]
import java.io.IOException; import uk.ac.ebi.pride.archive.web.service.model.protein.ProteinDetailList;
import java.io.*; import uk.ac.ebi.pride.archive.web.service.model.protein.*;
[ "java.io", "uk.ac.ebi" ]
java.io; uk.ac.ebi;
2,015,704
public InetAddress getAddress() { return address; }
InetAddress function() { return address; }
/** * get this nodes address * * @return address as InetAddress */
get this nodes address
getAddress
{ "repo_name": "theoweiss/openhab2", "path": "bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/IpNode.java", "license": "epl-1.0", "size": 4512 }
[ "java.net.InetAddress" ]
import java.net.InetAddress;
import java.net.*;
[ "java.net" ]
java.net;
553,333
List<Recipe> findByDiseaseId(Integer diseaseId);
List<Recipe> findByDiseaseId(Integer diseaseId);
/** * Finds recipes for a disease. * @param diseaseId id of a disease * @return a list of recipes */
Finds recipes for a disease
findByDiseaseId
{ "repo_name": "solairerove/padlaboris", "path": "src/main/java/com/instinctools/padlaboris/domain/service/RecipeService.java", "license": "mit", "size": 1142 }
[ "com.instinctools.padlaboris.domain.model.Recipe", "java.util.List" ]
import com.instinctools.padlaboris.domain.model.Recipe; import java.util.List;
import com.instinctools.padlaboris.domain.model.*; import java.util.*;
[ "com.instinctools.padlaboris", "java.util" ]
com.instinctools.padlaboris; java.util;
2,817,455
public void setArguments(final Class<?>... arguments) { this.arguments = null; if (!CheckUtil.isNull(arguments)) { this.arguments = arguments.clone(); } }
void function(final Class<?>... arguments) { this.arguments = null; if (!CheckUtil.isNull(arguments)) { this.arguments = arguments.clone(); } }
/** * Sets a new value for the arguments field. * * @param arguments * The new value for the arguments field. */
Sets a new value for the arguments field
setArguments
{ "repo_name": "lunarray-org/model-descriptor", "path": "src/main/java/org/lunarray/model/descriptor/serialization/ConstructorInfo.java", "license": "lgpl-3.0", "size": 3380 }
[ "org.lunarray.common.check.CheckUtil" ]
import org.lunarray.common.check.CheckUtil;
import org.lunarray.common.check.*;
[ "org.lunarray.common" ]
org.lunarray.common;
1,143,568
public void writeObject(Object obj) { try { if ( obj == null ) { writeNull(); return; } if ( obj instanceof String ) { String value = (String)obj; writeStringObject(value); return; } gen.writeStartObject(); { if ( obj instanceof StandardWritable ) { ...
void function(Object obj) { try { if ( obj == null ) { writeNull(); return; } if ( obj instanceof String ) { String value = (String)obj; writeStringObject(value); return; } gen.writeStartObject(); { if ( obj instanceof StandardWritable ) { StandardWritable std = (StandardWritable)obj; TypeName type_name = std.getTypeNa...
/** * Write an object. * * Primitives (Strings, Integer, Double, etc.) will be written in complete * object encoding (i.e. not as a JavaScript Primitive, but as a full * object, with type_hint, etc.) * * @param obj The object to write. Can be null. */
Write an object. Primitives (Strings, Integer, Double, etc.) will be written in complete object encoding (i.e. not as a JavaScript Primitive, but as a full object, with type_hint, etc.)
writeObject
{ "repo_name": "jimmutable/core", "path": "core/src/main/java/org/jimmutable/core/serialization/writer/LowLevelWriter.java", "license": "bsd-3-clause", "size": 14432 }
[ "org.jimmutable.core.exceptions.SerializeException", "org.jimmutable.core.serialization.FieldName", "org.jimmutable.core.serialization.TypeName", "org.jimmutable.core.serialization.reader.ObjectParseTree" ]
import org.jimmutable.core.exceptions.SerializeException; import org.jimmutable.core.serialization.FieldName; import org.jimmutable.core.serialization.TypeName; import org.jimmutable.core.serialization.reader.ObjectParseTree;
import org.jimmutable.core.exceptions.*; import org.jimmutable.core.serialization.*; import org.jimmutable.core.serialization.reader.*;
[ "org.jimmutable.core" ]
org.jimmutable.core;
967,999
@SuppressWarnings("rawtypes") @Override public boolean isPatternValid( WritableComparable value ) { boolean isValid = false; BooleanWritable booleanWritable=(BooleanWritable) value; boolean isDefaulter = booleanWritable.get(); // if is defaulter is true then only valid input isValid = isDefau...
@SuppressWarnings(STR) boolean function( WritableComparable value ) { boolean isValid = false; BooleanWritable booleanWritable=(BooleanWritable) value; boolean isDefaulter = booleanWritable.get(); isValid = isDefaulter; return isValid; }
/*** * validates whether the given input value is valid * @return boolean isValid */
validates whether the given input value is valid
isPatternValid
{ "repo_name": "impetus-opensource/jumbune", "path": "examples/src/main/resources/source/defaulterdebugging/src/main/java/org/debugging/defaulter/validation/ListDefaulterMapValueValidator.java", "license": "lgpl-3.0", "size": 825 }
[ "org.apache.hadoop.io.BooleanWritable", "org.apache.hadoop.io.WritableComparable" ]
import org.apache.hadoop.io.BooleanWritable; import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,048,229
public void setLocalSubscription(AndesSubscription localSubscription) { this.localSubscription = localSubscription; }
void function(AndesSubscription localSubscription) { this.localSubscription = localSubscription; }
/** * Set AMQP local subscription for current event * * @param localSubscription * Local subscription */
Set AMQP local subscription for current event
setLocalSubscription
{ "repo_name": "indikasampath2000/andes", "path": "modules/andes-core/broker/src/main/java/org/wso2/andes/kernel/disruptor/delivery/DeliveryEventData.java", "license": "apache-2.0", "size": 5104 }
[ "org.wso2.andes.kernel.subscription.AndesSubscription" ]
import org.wso2.andes.kernel.subscription.AndesSubscription;
import org.wso2.andes.kernel.subscription.*;
[ "org.wso2.andes" ]
org.wso2.andes;
2,892,633
public Node getNode(String uri, Element ref) throws MalformedURLException, IOException, SecurityException { String baseURI = getRefererBaseURI(ref); // System.err.println("baseURI: " + baseURI); // System.err.println("URI: " + uri); if (baseURI == null && uri.charAt(0) == '#...
Node function(String uri, Element ref) throws MalformedURLException, IOException, SecurityException { String baseURI = getRefererBaseURI(ref); if (baseURI == null && uri.charAt(0) == '#') { return getNodeByFragment(uri.substring(1), ref); } ParsedURL purl = new ParsedURL(baseURI, uri); if (documentURI == null) document...
/** * Imports the Node referenced by the given URI on Element * <tt>ref</tt>. * @param uri The element URI. * @param ref The Element in the DOM tree to evaluate <tt>uri</tt> * from. * @return The referenced Node/Document or null if element can't be found. */
Imports the Node referenced by the given URI on Element ref
getNode
{ "repo_name": "Uni-Sol/batik", "path": "sources/org/apache/batik/bridge/URIResolver.java", "license": "apache-2.0", "size": 5070 }
[ "java.io.IOException", "java.net.MalformedURLException", "org.apache.batik.util.ParsedURL", "org.w3c.dom.Document", "org.w3c.dom.Element", "org.w3c.dom.Node" ]
import java.io.IOException; import java.net.MalformedURLException; import org.apache.batik.util.ParsedURL; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node;
import java.io.*; import java.net.*; import org.apache.batik.util.*; import org.w3c.dom.*;
[ "java.io", "java.net", "org.apache.batik", "org.w3c.dom" ]
java.io; java.net; org.apache.batik; org.w3c.dom;
678,555
// COMPLETED (2) Within onCreateLoader, return a new AsyncTaskLoader that looks a lot like the existing FetchWeatherTask. @Override public Loader<String[]> onCreateLoader(int id, final Bundle loaderArgs) { return new AsyncTaskLoader<String[]>(this) { String[] mWeatherData...
Loader<String[]> function(int id, final Bundle loaderArgs) { return new AsyncTaskLoader<String[]>(this) { String[] mWeatherData = null;
/** * Instantiate and return a new Loader for the given ID. * * @param id The ID whose loader is to be created. * @param loaderArgs Any arguments supplied by the caller. * * @return Return a new Loader instance that is ready to start loading. */
Instantiate and return a new Loader for the given ID
onCreateLoader
{ "repo_name": "leonnnwu/ud851-Sunshine", "path": "S05.01-Solution-AsyncTaskLoader/app/src/main/java/com/example/android/sunshine/MainActivity.java", "license": "apache-2.0", "size": 13506 }
[ "android.os.Bundle", "android.support.v4.content.AsyncTaskLoader", "android.support.v4.content.Loader" ]
import android.os.Bundle; import android.support.v4.content.AsyncTaskLoader; import android.support.v4.content.Loader;
import android.os.*; import android.support.v4.content.*;
[ "android.os", "android.support" ]
android.os; android.support;
1,725,974
private int readArraySize() throws IOException { final int arraySize = readVInt(); if (arraySize > ArrayUtil.MAX_ARRAY_LENGTH) { throw new IllegalStateException("array length must be <= to " + ArrayUtil.MAX_ARRAY_LENGTH + " but was: " + arraySize); } if (arraySize < 0) {...
int function() throws IOException { final int arraySize = readVInt(); if (arraySize > ArrayUtil.MAX_ARRAY_LENGTH) { throw new IllegalStateException(STR + ArrayUtil.MAX_ARRAY_LENGTH + STR + arraySize); } if (arraySize < 0) { throw new NegativeArraySizeException(STR + arraySize); } ensureCanReadBytes(arraySize); return a...
/** * Reads a vint via {@link #readVInt()} and applies basic checks to ensure the read array size is sane. * This method uses {@link #ensureCanReadBytes(int)} to ensure this stream has enough bytes to read for the read array size. */
Reads a vint via <code>#readVInt()</code> and applies basic checks to ensure the read array size is sane. This method uses <code>#ensureCanReadBytes(int)</code> to ensure this stream has enough bytes to read for the read array size
readArraySize
{ "repo_name": "coding0011/elasticsearch", "path": "server/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java", "license": "apache-2.0", "size": 47459 }
[ "java.io.IOException", "org.apache.lucene.util.ArrayUtil" ]
import java.io.IOException; import org.apache.lucene.util.ArrayUtil;
import java.io.*; import org.apache.lucene.util.*;
[ "java.io", "org.apache.lucene" ]
java.io; org.apache.lucene;
2,667,322
public boolean lockOtherRS(String znode) { try { String parent = ZKUtil.joinZNode(this.rsZNode, znode); String p = ZKUtil.joinZNode(parent, RS_LOCK_ZNODE); ZKUtil.createAndWatch(this.zookeeper, p, Bytes.toBytes(rsServerNameZnode)); } catch (KeeperException e) { // This exception will p...
boolean function(String znode) { try { String parent = ZKUtil.joinZNode(this.rsZNode, znode); String p = ZKUtil.joinZNode(parent, RS_LOCK_ZNODE); ZKUtil.createAndWatch(this.zookeeper, p, Bytes.toBytes(rsServerNameZnode)); } catch (KeeperException e) { if (e instanceof KeeperException.NoNodeException e instanceof Keeper...
/** * Try to set a lock in another server's znode. * @param znode the server names of the other server * @return true if the lock was acquired, false in every other cases */
Try to set a lock in another server's znode
lockOtherRS
{ "repo_name": "JichengSong/hbase", "path": "src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java", "license": "apache-2.0", "size": 34562 }
[ "org.apache.hadoop.hbase.util.Bytes", "org.apache.hadoop.hbase.zookeeper.ZKUtil", "org.apache.zookeeper.KeeperException" ]
import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.zookeeper.ZKUtil; import org.apache.zookeeper.KeeperException;
import org.apache.hadoop.hbase.util.*; import org.apache.hadoop.hbase.zookeeper.*; import org.apache.zookeeper.*;
[ "org.apache.hadoop", "org.apache.zookeeper" ]
org.apache.hadoop; org.apache.zookeeper;
1,835,849
public ExampleLabelObject withEntityLabels(List<EntityLabelObject> entityLabels) { this.entityLabels = entityLabels; return this; }
ExampleLabelObject function(List<EntityLabelObject> entityLabels) { this.entityLabels = entityLabels; return this; }
/** * Set the entityLabels value. * * @param entityLabels the entityLabels value to set * @return the ExampleLabelObject object itself. */
Set the entityLabels value
withEntityLabels
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ExampleLabelObject.java", "license": "mit", "size": 2231 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,337,766
private void testECDSA239bitBinary() { BigInteger r = new BigInteger("21596333210419611985018340039034612628818151486841789642455876922391552"); BigInteger s = new BigInteger("197030374000731686738334997654997227052849804072198819102649413465737174"); byte[] kData = BigIntegers.asUn...
void function() { BigInteger r = new BigInteger(STR); BigInteger s = new BigInteger(STR); byte[] kData = BigIntegers.asUnsignedByteArray(new BigInteger(STR)); SecureRandom k = new FixedSecureRandom(kData); BigInteger n = new BigInteger(STR); BigInteger h = BigInteger.valueOf(4); ECCurve.F2m curve = new ECCurve.F2m( 239...
/** * X9.62 - 1998,<br> * J.2.1, Page 100, ECDSA over the field F2m<br> * an example with 191 bit binary field */
X9.62 - 1998, J.2.1, Page 100, ECDSA over the field F2m an example with 191 bit binary field
testECDSA239bitBinary
{ "repo_name": "partheinstein/bc-java", "path": "core/src/test/java/org/bouncycastle/crypto/test/ECTest.java", "license": "mit", "size": 37965 }
[ "java.math.BigInteger", "java.security.SecureRandom", "org.bouncycastle.crypto.params.ECDomainParameters", "org.bouncycastle.crypto.params.ECPrivateKeyParameters", "org.bouncycastle.crypto.params.ECPublicKeyParameters", "org.bouncycastle.crypto.params.ParametersWithRandom", "org.bouncycastle.crypto.sign...
import java.math.BigInteger; import java.security.SecureRandom; import org.bouncycastle.crypto.params.ECDomainParameters; import org.bouncycastle.crypto.params.ECPrivateKeyParameters; import org.bouncycastle.crypto.params.ECPublicKeyParameters; import org.bouncycastle.crypto.params.ParametersWithRandom; import org.boun...
import java.math.*; import java.security.*; import org.bouncycastle.crypto.params.*; import org.bouncycastle.crypto.signers.*; import org.bouncycastle.math.ec.*; import org.bouncycastle.util.*; import org.bouncycastle.util.encoders.*; import org.bouncycastle.util.test.*;
[ "java.math", "java.security", "org.bouncycastle.crypto", "org.bouncycastle.math", "org.bouncycastle.util" ]
java.math; java.security; org.bouncycastle.crypto; org.bouncycastle.math; org.bouncycastle.util;
2,839,240
protected UserBean getCurrentUser() { NodeRef person = personService.getPerson(authenticationService.getCurrentUserName()); String loginName = (String) nodeService.getProperty(person, ContentModel.PROP_USERNAME); String email = ObjectUtils.getDisplayString(nodeService.getProperty(p...
UserBean function() { NodeRef person = personService.getPerson(authenticationService.getCurrentUserName()); String loginName = (String) nodeService.getProperty(person, ContentModel.PROP_USERNAME); String email = ObjectUtils.getDisplayString(nodeService.getProperty(person, ContentModel.PROP_EMAIL)); String firstName = O...
/** * Get current user * * @return UserBean represent current user */
Get current user
getCurrentUser
{ "repo_name": "Alfresco/community-edition", "path": "modules/sharepoint/amp/source/java/org/alfresco/module/vti/handler/alfresco/AbstractAlfrescoDwsServiceHandler.java", "license": "lgpl-3.0", "size": 35388 }
[ "org.alfresco.model.ContentModel", "org.alfresco.module.vti.metadata.model.UserBean", "org.alfresco.service.cmr.repository.NodeRef", "org.springframework.util.ObjectUtils" ]
import org.alfresco.model.ContentModel; import org.alfresco.module.vti.metadata.model.UserBean; import org.alfresco.service.cmr.repository.NodeRef; import org.springframework.util.ObjectUtils;
import org.alfresco.model.*; import org.alfresco.module.vti.metadata.model.*; import org.alfresco.service.cmr.repository.*; import org.springframework.util.*;
[ "org.alfresco.model", "org.alfresco.module", "org.alfresco.service", "org.springframework.util" ]
org.alfresco.model; org.alfresco.module; org.alfresco.service; org.springframework.util;
643,775
@FIXVersion(introduced="4.2") @TagNumRef(tagNum=TagNum.ComplianceID) public void setComplianceID(String complianceID) { this.complianceID = complianceID; }
@FIXVersion(introduced="4.2") @TagNumRef(tagNum=TagNum.ComplianceID) void function(String complianceID) { this.complianceID = complianceID; }
/** * Message field setter. * @param complianceID field value */
Message field setter
setComplianceID
{ "repo_name": "marvisan/HadesFIX", "path": "Model/src/main/java/net/hades/fix/message/OrderModificationRequestMsg.java", "license": "gpl-3.0", "size": 149491 }
[ "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,390,243
public void delete(Context context, String url, AsyncHttpResponseHandler responseHandler) { final HttpDelete delete = new HttpDelete(url); sendRequest(httpClient, httpContext, delete, null, responseHandler, context); }
void function(Context context, String url, AsyncHttpResponseHandler responseHandler) { final HttpDelete delete = new HttpDelete(url); sendRequest(httpClient, httpContext, delete, null, responseHandler, context); }
/** * Perform a HTTP DELETE request. * @param context the Android Context which initiated the request. * @param url the URL to send the request to. * @param responseHandler the response handler instance that should handle the response. */
Perform a HTTP DELETE request
delete
{ "repo_name": "zoozooll/MyExercise", "path": "meep/MeepOTA/src/com/loopj/android/http/AsyncHttpClient.java", "license": "apache-2.0", "size": 27035 }
[ "android.content.Context", "org.apache.http.client.methods.HttpDelete" ]
import android.content.Context; import org.apache.http.client.methods.HttpDelete;
import android.content.*; import org.apache.http.client.methods.*;
[ "android.content", "org.apache.http" ]
android.content; org.apache.http;
1,177,243
public static List<ValueType> getSchemaType(Object schemaObject) { JSONArray schemaJsonArr = (JSONArray)schemaObject; ValueType[] schemaArray = new ValueType[schemaJsonArr.size()]; for(int i=0; i < schemaJsonArr.length(); i++) schemaArray[i] = ValueType.valueOf((String)schemaJsonArr.get(0)); return A...
static List<ValueType> function(Object schemaObject) { JSONArray schemaJsonArr = (JSONArray)schemaObject; ValueType[] schemaArray = new ValueType[schemaJsonArr.size()]; for(int i=0; i < schemaJsonArr.length(); i++) schemaArray[i] = ValueType.valueOf((String)schemaJsonArr.get(0)); return Arrays.asList(schemaArray); }
/** * Returns the schema based on Json object * * @param schemaObject * @return */
Returns the schema based on Json object
getSchemaType
{ "repo_name": "Wenpei/incubator-systemml", "path": "src/main/java/org/apache/sysml/runtime/util/UtilFunctions.java", "license": "apache-2.0", "size": 16676 }
[ "java.util.Arrays", "java.util.List", "org.apache.sysml.parser.Expression", "org.apache.wink.json4j.JSONArray" ]
import java.util.Arrays; import java.util.List; import org.apache.sysml.parser.Expression; import org.apache.wink.json4j.JSONArray;
import java.util.*; import org.apache.sysml.parser.*; import org.apache.wink.json4j.*;
[ "java.util", "org.apache.sysml", "org.apache.wink" ]
java.util; org.apache.sysml; org.apache.wink;
639,268
void runServer() throws IOException { this.serverSocket = new ServerSocket(this.options.getProxyPort()); this.status = ServerStatus.STARTED; try { while (this.status == ServerStatus.STARTED) { createConnectionHandler(this.serverSocket.accept()); } } catch (SocketException e) { ...
void runServer() throws IOException { this.serverSocket = new ServerSocket(this.options.getProxyPort()); this.status = ServerStatus.STARTED; try { while (this.status == ServerStatus.STARTED) { createConnectionHandler(this.serverSocket.accept()); } } catch (SocketException e) { logger.log(Level.INFO, STR, new Object[]{t...
/** * Thread logic: opens the listening socket and instantiates the connection handler. * * @throws IOException if ServerSocket cannot start. */
Thread logic: opens the listening socket and instantiates the connection handler
runServer
{ "repo_name": "cloudspannerecosystem/pgadapter", "path": "src/main/java/com/google/cloud/spanner/pgadapter/ProxyServer.java", "license": "apache-2.0", "size": 9018 }
[ "java.io.IOException", "java.net.ServerSocket", "java.net.SocketException", "java.sql.SQLException", "java.util.logging.Level" ]
import java.io.IOException; import java.net.ServerSocket; import java.net.SocketException; import java.sql.SQLException; import java.util.logging.Level;
import java.io.*; import java.net.*; import java.sql.*; import java.util.logging.*;
[ "java.io", "java.net", "java.sql", "java.util" ]
java.io; java.net; java.sql; java.util;
2,497,524
public void setAbstract1(ClobDomain value) { setAttributeInternal(ABSTRACT1, value); }
void function(ClobDomain value) { setAttributeInternal(ABSTRACT1, value); }
/** * Sets <code>value</code> as attribute value for ABSTRACT using the alias name Abstract1. * @param value value to set the ABSTRACT */
Sets <code>value</code> as attribute value for ABSTRACT using the alias name Abstract1
setAbstract1
{ "repo_name": "lucasjellema/beyond-the-horizon-conference-app", "path": "JCS-ADF/BeyondTheHorizon-BackOffice/Model/src/nl/amis/bth/model/BthSessionViewRowImpl.java", "license": "apache-2.0", "size": 13180 }
[ "oracle.jbo.domain.ClobDomain" ]
import oracle.jbo.domain.ClobDomain;
import oracle.jbo.domain.*;
[ "oracle.jbo.domain" ]
oracle.jbo.domain;
900,658
@Test public void testCycleDateStartTimerEvent() throws Exception { Clock previousClock = processEngineConfiguration.getClock(); Clock testClock = new DefaultClockImpl(); processEngineConfiguration.setClock(testClock); Calendar calendar = Calendar.getInstance(); calend...
void function() throws Exception { Clock previousClock = processEngineConfiguration.getClock(); Clock testClock = new DefaultClockImpl(); processEngineConfiguration.setClock(testClock); Calendar calendar = Calendar.getInstance(); calendar.set(2025, Calendar.DECEMBER, 10, 0, 0, 0); testClock.setCurrentTime(calendar.getT...
/** * Timer repetition */
Timer repetition
testCycleDateStartTimerEvent
{ "repo_name": "lsmall/flowable-engine", "path": "modules/flowable-engine/src/test/java/org/flowable/engine/test/bpmn/event/timer/compatibility/StartTimerEventRepeatCompatibilityTest.java", "license": "apache-2.0", "size": 8487 }
[ "java.util.Calendar", "java.util.List", "org.flowable.common.engine.api.delegate.event.FlowableEngineEventType", "org.flowable.common.engine.api.delegate.event.FlowableEvent", "org.flowable.common.engine.impl.runtime.Clock", "org.flowable.common.engine.impl.util.DefaultClockImpl", "org.flowable.engine.r...
import java.util.Calendar; import java.util.List; import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType; import org.flowable.common.engine.api.delegate.event.FlowableEvent; import org.flowable.common.engine.impl.runtime.Clock; import org.flowable.common.engine.impl.util.DefaultClockImpl; import o...
import java.util.*; import org.flowable.common.engine.api.delegate.event.*; import org.flowable.common.engine.impl.runtime.*; import org.flowable.common.engine.impl.util.*; import org.flowable.engine.runtime.*; import org.flowable.job.api.*;
[ "java.util", "org.flowable.common", "org.flowable.engine", "org.flowable.job" ]
java.util; org.flowable.common; org.flowable.engine; org.flowable.job;
765,098
private void checkJournalEntries(long startSN, long endSN) throws IOException, InvalidJournalEntryException { try (JournalReader reader = new UfsJournalReader(mJournal, startSN, true)) { long seq = startSN; while (reader.advance() == State.LOG) { Assert.assertEquals(seq, reader.getEntry(...
void function(long startSN, long endSN) throws IOException, InvalidJournalEntryException { try (JournalReader reader = new UfsJournalReader(mJournal, startSN, true)) { long seq = startSN; while (reader.advance() == State.LOG) { Assert.assertEquals(seq, reader.getEntry().getSequenceNumber()); seq++; } Assert.assertEqual...
/** * Checks that journal entries with sequence number between startSN (inclusive) and endSN * (exclusive) exist in the current journal files. * * @param startSN start sequence number (inclusive) * @param endSN end sequence number (exclusive) */
Checks that journal entries with sequence number between startSN (inclusive) and endSN (exclusive) exist in the current journal files
checkJournalEntries
{ "repo_name": "bf8086/alluxio", "path": "core/server/master/src/test/java/alluxio/master/journal/ufs/UfsJournalLogWriterTest.java", "license": "apache-2.0", "size": 20091 }
[ "java.io.IOException", "org.junit.Assert" ]
import java.io.IOException; import org.junit.Assert;
import java.io.*; import org.junit.*;
[ "java.io", "org.junit" ]
java.io; org.junit;
1,721,194
public Observable<ServiceResponse<RouteTableInner>> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be nul...
Observable<ServiceResponse<RouteTableInner>> function(String resourceGroupName, String routeTableName, RouteTableInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (routeTableName == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == nu...
/** * Create or updates a route table in a specified resource group. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param parameters Parameters supplied to the create or update route table operation. * @throws IllegalArg...
Create or updates a route table in a specified resource group
createOrUpdateWithServiceResponseAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2019_11_01/src/main/java/com/microsoft/azure/management/network/v2019_11_01/implementation/RouteTablesInner.java", "license": "mit", "size": 67373 }
[ "com.google.common.reflect.TypeToken", "com.microsoft.rest.ServiceResponse", "com.microsoft.rest.Validator" ]
import com.google.common.reflect.TypeToken; import com.microsoft.rest.ServiceResponse; import com.microsoft.rest.Validator;
import com.google.common.reflect.*; import com.microsoft.rest.*;
[ "com.google.common", "com.microsoft.rest" ]
com.google.common; com.microsoft.rest;
2,777,898
private void initLayout() { headingBox.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1)); headingBox.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); headingBox.setLayout(new FormLayout()); final FormData fd_headingBox = new FormData(-1, -1); fd_headingBox.bottom...
void function() { headingBox.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1)); headingBox.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); headingBox.setLayout(new FormLayout()); final FormData fd_headingBox = new FormData(-1, -1); fd_headingBox.bottom = new FormAttachment(controlB...
/** * sets the initial Layout */
sets the initial Layout
initLayout
{ "repo_name": "kevinott/crypto", "path": "org.jcryptool.visual.aup/src/org/jcryptool/visual/aup/views/AupView.java", "license": "epl-1.0", "size": 29766 }
[ "org.eclipse.swt.custom.ScrolledComposite", "org.eclipse.swt.custom.StyledText", "org.eclipse.swt.layout.FormAttachment", "org.eclipse.swt.layout.FormData", "org.eclipse.swt.layout.FormLayout", "org.eclipse.swt.layout.GridData", "org.eclipse.swt.layout.GridLayout", "org.eclipse.swt.widgets.Button", ...
import org.eclipse.swt.custom.ScrolledComposite; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse....
import org.eclipse.swt.custom.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; import org.eclipse.wb.swt.*; import org.jcryptool.core.util.fonts.*;
[ "org.eclipse.swt", "org.eclipse.wb", "org.jcryptool.core" ]
org.eclipse.swt; org.eclipse.wb; org.jcryptool.core;
1,793,125
public void testToIpAddrString() throws UnknownHostException { String addr = "192.168.1.1"; assertEquals(addr, InetAddressUtils.toIpAddrString(InetAddressUtils.addr(addr).getAddress())); }
void function() throws UnknownHostException { String addr = STR; assertEquals(addr, InetAddressUtils.toIpAddrString(InetAddressUtils.addr(addr).getAddress())); }
/** * Tests creating a string representation of an IP address that is converted to an InetAddress and then * a long and back to an IP address. * * @throws UnknownHostException */
Tests creating a string representation of an IP address that is converted to an InetAddress and then a long and back to an IP address
testToIpAddrString
{ "repo_name": "jeffgdotorg/opennms", "path": "opennms-config/src/test/java/org/opennms/netmgt/config/ConfigureSnmpTest.java", "license": "gpl-2.0", "size": 10467 }
[ "java.net.UnknownHostException", "org.opennms.core.utils.InetAddressUtils" ]
import java.net.UnknownHostException; import org.opennms.core.utils.InetAddressUtils;
import java.net.*; import org.opennms.core.utils.*;
[ "java.net", "org.opennms.core" ]
java.net; org.opennms.core;
978,644
public static Condition getInstance(Node root, PolicyMetaData metaData, VariableManager manager) throws ParsingException { RuntimeInfo src = RuntimeInfo.getRuntimeInfo(root, ELEMENT_TYPE.CONDITION); // check if this really is a Condition if (r...
static Condition function(Node root, PolicyMetaData metaData, VariableManager manager) throws ParsingException { RuntimeInfo src = RuntimeInfo.getRuntimeInfo(root, ELEMENT_TYPE.CONDITION); if (root.getNodeType() != Node.ELEMENT_NODE !root.getLocalName().equals(STR)) { throw new ParsingException(STR + root.getLocalName(...
/** * Returns an instance of <code>Condition</code> based on the given * DOM root. * * @param root the DOM root of a ConditionType XML type * @param metaData the meta-data associated with the containing policy * @param manager <code>VariableManager</code> used to connect references *...
Returns an instance of <code>Condition</code> based on the given DOM root
getInstance
{ "repo_name": "GenericBreakGlass/GenericBreakGlass-XACML", "path": "src/com.sun.xacml/src/main/java/com/sun/xacml/cond/Condition.java", "license": "apache-2.0", "size": 14666 }
[ "com.sun.xacml.Constants", "com.sun.xacml.ParsingException", "com.sun.xacml.PolicyMetaData", "com.sun.xacml.debug.RuntimeInfo", "org.w3c.dom.Node", "org.w3c.dom.NodeList" ]
import com.sun.xacml.Constants; import com.sun.xacml.ParsingException; import com.sun.xacml.PolicyMetaData; import com.sun.xacml.debug.RuntimeInfo; import org.w3c.dom.Node; import org.w3c.dom.NodeList;
import com.sun.xacml.*; import com.sun.xacml.debug.*; import org.w3c.dom.*;
[ "com.sun.xacml", "org.w3c.dom" ]
com.sun.xacml; org.w3c.dom;
990,619
@Override void endSourceMapping(Node node) { if (createSrcMap && !mappings.isEmpty() && mappings.peek().node == node) { Mapping mapping = mappings.pop(); int line = getCurrentLineIndex(); int index = getCurrentCharIndex(); checkState(line >= 0); mapping.end = new Fi...
void endSourceMapping(Node node) { if (createSrcMap && !mappings.isEmpty() && mappings.peek().node == node) { Mapping mapping = mappings.pop(); int line = getCurrentLineIndex(); int index = getCurrentCharIndex(); checkState(line >= 0); mapping.end = new FilePosition(line, index); } }
/** * Finishes the source mapping for the given * node at the current position. */
Finishes the source mapping for the given node at the current position
endSourceMapping
{ "repo_name": "GerHobbelt/closure-compiler", "path": "src/com/google/javascript/jscomp/CodePrinter.java", "license": "apache-2.0", "size": 27636 }
[ "com.google.common.base.Preconditions", "com.google.debugging.sourcemap.FilePosition", "com.google.javascript.rhino.Node" ]
import com.google.common.base.Preconditions; import com.google.debugging.sourcemap.FilePosition; import com.google.javascript.rhino.Node;
import com.google.common.base.*; import com.google.debugging.sourcemap.*; import com.google.javascript.rhino.*;
[ "com.google.common", "com.google.debugging", "com.google.javascript" ]
com.google.common; com.google.debugging; com.google.javascript;
2,767,508
protected final Matrix performOperation(final Matrix other, final BiFunction<Double, Double, Double> operation) { if (rows != other.rows || columns != other.columns) { throw new IllegalArgumentException(MESSAGE_ROW_COLUMN_COUNT); } final Matrix result = new Matrix(rows, columns); result.forEa...
final Matrix function(final Matrix other, final BiFunction<Double, Double, Double> operation) { if (rows != other.rows columns != other.columns) { throw new IllegalArgumentException(MESSAGE_ROW_COLUMN_COUNT); } final Matrix result = new Matrix(rows, columns); result.forEachElement((r, c) -> { final int index = r * colu...
/** * Performs the specified operation with another matrix. * Does not modify the operands. * The BiFunction parameters are the current matrix values. * @param other The second operand * @param operation The operation * @throws IllegalArgumentException If the amount of columns is not equal to the amou...
Performs the specified operation with another matrix. Does not modify the operands. The BiFunction parameters are the current matrix values
performOperation
{ "repo_name": "Sogomn/spjgl", "path": "src/de/sogomn/spjgl/math/Matrix.java", "license": "apache-2.0", "size": 8672 }
[ "java.util.function.BiFunction" ]
import java.util.function.BiFunction;
import java.util.function.*;
[ "java.util" ]
java.util;
2,517,635
public String getAbstract() { try { return Val.chkStr((String) newXPath.evaluate("Abstract", ndLayer, XPathConstants.STRING)); } catch (XPathExpressionException ex) { return ""; } }
String function() { try { return Val.chkStr((String) newXPath.evaluate(STR, ndLayer, XPathConstants.STRING)); } catch (XPathExpressionException ex) { return ""; } }
/** * Gets layer abstract. * @return layer abstract */
Gets layer abstract
getAbstract
{ "repo_name": "GeoinformationSystems/geoportal-server", "path": "geoportal/src/com/esri/gpt/catalog/publication/WMSProcessor.java", "license": "apache-2.0", "size": 14122 }
[ "com.esri.gpt.framework.util.Val", "javax.xml.xpath.XPathConstants", "javax.xml.xpath.XPathExpressionException" ]
import com.esri.gpt.framework.util.Val; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException;
import com.esri.gpt.framework.util.*; import javax.xml.xpath.*;
[ "com.esri.gpt", "javax.xml" ]
com.esri.gpt; javax.xml;
228,878
Optional<Person> getPersonByMailAddress(String mailAddress); /** * finds all {@link Person}s in the database that have the given {@link Role}. * * @param role {@link Role} * @return {@link List} of {@link Person}
Optional<Person> getPersonByMailAddress(String mailAddress); /** * finds all {@link Person}s in the database that have the given {@link Role}. * * @param role {@link Role} * @return {@link List} of {@link Person}
/** * finds a {@link Person} in the database by mail address. * @param mailAddress of the person * @return optional {@link Person} for the given mail address */
finds a <code>Person</code> in the database by mail address
getPersonByMailAddress
{ "repo_name": "synyx/urlaubsverwaltung", "path": "src/main/java/org/synyx/urlaubsverwaltung/person/PersonService.java", "license": "apache-2.0", "size": 4414 }
[ "java.util.List", "java.util.Optional" ]
import java.util.List; import java.util.Optional;
import java.util.*;
[ "java.util" ]
java.util;
2,908,180
public void save(File file, T instance) throws IOException { writeJsonAsBytes(instance, new FileOutputStream(file)); }
void function(File file, T instance) throws IOException { writeJsonAsBytes(instance, new FileOutputStream(file)); }
/** * Save to a local file. Any existing file is overwritten unless * the OS blocks that. * @param file file * @param path path * @throws IOException IO exception */
Save to a local file. Any existing file is overwritten unless the OS blocks that
save
{ "repo_name": "ChetnaChaudhari/hadoop", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/JsonSerialization.java", "license": "apache-2.0", "size": 10067 }
[ "java.io.File", "java.io.FileOutputStream", "java.io.IOException" ]
import java.io.File; import java.io.FileOutputStream; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
676,875
@SuppressWarnings("unchecked") public static List<String> createList(Object object) { List<String> result = null; if (object != null) { Collection<Object> objects = null; if (object.getClass().isArray()) { objects = Arrays.asList((Object[]) object); } else if (object instanceof Collection)...
@SuppressWarnings(STR) static List<String> function(Object object) { List<String> result = null; if (object != null) { Collection<Object> objects = null; if (object.getClass().isArray()) { objects = Arrays.asList((Object[]) object); } else if (object instanceof Collection) { objects = (Collection<Object>) object; }
/** * This method tries to cast the specified object to an array. If that is successful, then a new list will be * generated by calling toString on each array element as it is added to the resulting list * * @param object * @param list * @return */
This method tries to cast the specified object to an array. If that is successful, then a new list will be generated by calling toString on each array element as it is added to the resulting list
createList
{ "repo_name": "HossainKhademian/Studio3", "path": "plugins/com.aptana.index.core/src/com/aptana/index/core/IndexUtil.java", "license": "gpl-3.0", "size": 5358 }
[ "java.util.Arrays", "java.util.Collection", "java.util.List" ]
import java.util.Arrays; import java.util.Collection; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
741,519
public WaveId getWaveId() { return data.getWaveId(); }
WaveId function() { return data.getWaveId(); }
/** * Get the unique identifier of the wave in view. * * @return the unique identifier of the wave. */
Get the unique identifier of the wave in view
getWaveId
{ "repo_name": "jkatzer/jkatzer-wave", "path": "src/org/waveprotocol/wave/examples/client/webclient/waveclient/common/WebClientWaveView.java", "license": "apache-2.0", "size": 4141 }
[ "org.waveprotocol.wave.model.id.WaveId" ]
import org.waveprotocol.wave.model.id.WaveId;
import org.waveprotocol.wave.model.id.*;
[ "org.waveprotocol.wave" ]
org.waveprotocol.wave;
1,304,323
public void initializeGameType(GameType type) { if (this.gameType == GameType.NOT_SET) { this.gameType = type; } this.setGameType(this.gameType); }
void function(GameType type) { if (this.gameType == GameType.NOT_SET) { this.gameType = type; } this.setGameType(this.gameType); }
/** * if the gameType is currently NOT_SET then change it to par1 */
if the gameType is currently NOT_SET then change it to par1
initializeGameType
{ "repo_name": "TheGreatAndPowerfulWeegee/wipunknown", "path": "build/tmp/recompileMc/sources/net/minecraft/server/management/PlayerInteractionManager.java", "license": "gpl-3.0", "size": 20609 }
[ "net.minecraft.world.GameType" ]
import net.minecraft.world.GameType;
import net.minecraft.world.*;
[ "net.minecraft.world" ]
net.minecraft.world;
1,252,315
public void addLinesToFile(List<String> lines, File file) throws FileOperationException { if (file.exists()) { file.delete(); } if (!file.getParentFile().exists()) { file.getParentFile().mkdirs(); } PrintWriter out = null; try { file.createNewFile(); out = new PrintWriter(new BufferedWrite...
void function(List<String> lines, File file) throws FileOperationException { if (file.exists()) { file.delete(); } if (!file.getParentFile().exists()) { file.getParentFile().mkdirs(); } PrintWriter out = null; try { file.createNewFile(); out = new PrintWriter(new BufferedWriter(new FileWriter(file))); for (int i = 0; i...
/** * Creates file with specific content. * * @param lines * lines to add * @param file * target file * @throws IOException * file could not be created */
Creates file with specific content
addLinesToFile
{ "repo_name": "1Tristan/VariantSync", "path": "src/de/ovgu/variantsync/persistencelayer/FileOperations.java", "license": "lgpl-3.0", "size": 4361 }
[ "de.ovgu.variantsync.applicationlayer.datamodel.exception.FileOperationException", "java.io.BufferedWriter", "java.io.File", "java.io.FileWriter", "java.io.IOException", "java.io.PrintWriter", "java.util.List" ]
import de.ovgu.variantsync.applicationlayer.datamodel.exception.FileOperationException; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.List;
import de.ovgu.variantsync.applicationlayer.datamodel.exception.*; import java.io.*; import java.util.*;
[ "de.ovgu.variantsync", "java.io", "java.util" ]
de.ovgu.variantsync; java.io; java.util;
1,143,549
//----------------------------------------------------------------------- public Map<ExternalIdBundle, LocalDateDoubleTimeSeries> getResultMap() { return _resultMap; }
Map<ExternalIdBundle, LocalDateDoubleTimeSeries> function() { return _resultMap; }
/** * Gets the time-series that were obtained. * @return the value of the property, not null */
Gets the time-series that were obtained
getResultMap
{ "repo_name": "McLeodMoores/starling", "path": "projects/provider/src/main/java/com/opengamma/provider/historicaltimeseries/HistoricalTimeSeriesProviderGetResult.java", "license": "apache-2.0", "size": 10297 }
[ "com.opengamma.id.ExternalIdBundle", "com.opengamma.timeseries.date.localdate.LocalDateDoubleTimeSeries", "java.util.Map" ]
import com.opengamma.id.ExternalIdBundle; import com.opengamma.timeseries.date.localdate.LocalDateDoubleTimeSeries; import java.util.Map;
import com.opengamma.id.*; import com.opengamma.timeseries.date.localdate.*; import java.util.*;
[ "com.opengamma.id", "com.opengamma.timeseries", "java.util" ]
com.opengamma.id; com.opengamma.timeseries; java.util;
762,358
static private byte[] toBytes( Vector octs) { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); for (int i = 0; i != octs.size(); i++) { try { DEROctetString o = (DEROctetString)octs.elementAt(i); bOut.write(o....
static byte[] function( Vector octs) { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); for (int i = 0; i != octs.size(); i++) { try { DEROctetString o = (DEROctetString)octs.elementAt(i); bOut.write(o.getOctets()); } catch (ClassCastException e) { throw new IllegalArgumentException(octs.elementAt(i).getClass(...
/** * convert a vector of octet strings into a single byte string */
convert a vector of octet strings into a single byte string
toBytes
{ "repo_name": "meetdestiny/geronimo-trader", "path": "modules/util/src/java/org/apache/geronimo/util/asn1/BERConstructedOctetString.java", "license": "apache-2.0", "size": 4754 }
[ "java.io.ByteArrayOutputStream", "java.io.IOException", "java.util.Vector" ]
import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Vector;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
699,383
public CompositeAggregationBuilder aggregateAfter(Map<String, Object> afterKey) { this.after = afterKey; return this; }
CompositeAggregationBuilder function(Map<String, Object> afterKey) { this.after = afterKey; return this; }
/** * Sets the values that indicates which composite bucket this request should "aggregate after". * Defaults to {@code null}. */
Sets the values that indicates which composite bucket this request should "aggregate after". Defaults to null
aggregateAfter
{ "repo_name": "uschindler/elasticsearch", "path": "server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregationBuilder.java", "license": "apache-2.0", "size": 11112 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,772,858
public List<ProjectInnovationRegion> findAll();
List<ProjectInnovationRegion> function();
/** * This method gets a list of projectInnovationRegion that are active * * @return a list from ProjectInnovationRegion null if no exist records */
This method gets a list of projectInnovationRegion that are active
findAll
{ "repo_name": "CCAFS/MARLO", "path": "marlo-data/src/main/java/org/cgiar/ccafs/marlo/data/manager/ProjectInnovationRegionManager.java", "license": "gpl-3.0", "size": 3838 }
[ "java.util.List", "org.cgiar.ccafs.marlo.data.model.ProjectInnovationRegion" ]
import java.util.List; import org.cgiar.ccafs.marlo.data.model.ProjectInnovationRegion;
import java.util.*; import org.cgiar.ccafs.marlo.data.model.*;
[ "java.util", "org.cgiar.ccafs" ]
java.util; org.cgiar.ccafs;
1,301,834
public final class OPT_VCG implements OPT_VCGConstants { public static String toVCG(OPT_VCGGraph g) { OPT_VCGGraph.GraphDesc gd = g.getVCGDescriptor(); StringBuilder res = new StringBuilder("graph: {\n"); res.append(pair("title", quote(gd.getTitle()), 1)); // Options res.append(gd.getLayo...
final class OPT_VCG implements OPT_VCGConstants { public static String function(OPT_VCGGraph g) { OPT_VCGGraph.GraphDesc gd = g.getVCGDescriptor(); StringBuilder res = new StringBuilder(STR); res.append(pair("title", quote(gd.getTitle()), 1)); res.append(gd.getLayoutParameters()).append("\n"); res.append(pair(STR, gd.d...
/** * Returns a VCG representation for a given graph. * @param g the graph in question. */
Returns a VCG representation for a given graph
toVCG
{ "repo_name": "rmcilroy/HeraJVM", "path": "rvm/src/org/jikesrvm/compilers/opt/OPT_VCG.java", "license": "epl-1.0", "size": 8800 }
[ "java.util.Enumeration", "java.util.Hashtable" ]
import java.util.Enumeration; import java.util.Hashtable;
import java.util.*;
[ "java.util" ]
java.util;
1,327,769
@ServiceMethod(returns = ReturnType.SINGLE) public ActionGroupResourceInner update( String resourceGroupName, String actionGroupName, ActionGroupPatchBody actionGroupPatch) { return updateAsync(resourceGroupName, actionGroupName, actionGroupPatch).block(); }
@ServiceMethod(returns = ReturnType.SINGLE) ActionGroupResourceInner function( String resourceGroupName, String actionGroupName, ActionGroupPatchBody actionGroupPatch) { return updateAsync(resourceGroupName, actionGroupName, actionGroupPatch).block(); }
/** * Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. * @param actionGroupPatch An action group object for the body of patch operati...
Updates an existing action group's tags. To update other fields use the CreateOrUpdate method
update
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsClientImpl.java", "license": "mit", "size": 58951 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.monitor.fluent.models.ActionGroupResourceInner", "com.azure.resourcemanager.monitor.models.ActionGroupPatchBody" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.monitor.fluent.models.ActionGroupResourceInner; import com.azure.resourcemanager.monitor.models.ActionGroupPatchBody;
import com.azure.core.annotation.*; import com.azure.resourcemanager.monitor.fluent.models.*; import com.azure.resourcemanager.monitor.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
791,101
static Method detectMethod(final Class<?> inputClass, final String regEx, final int patternFlag) throws CouldNotPerformException { try { if (inputClass == null) { assert false; throw new NotAvailableException("Object class is null!"); } if...
static Method detectMethod(final Class<?> inputClass, final String regEx, final int patternFlag) throws CouldNotPerformException { try { if (inputClass == null) { assert false; throw new NotAvailableException(STR); } if (regEx == null) { assert false; throw new NotAvailableException(STR); } List<Method> methods = new A...
/** * Method detects the method of an object class by the input regular expression. * * @param inputClass is the class object, which contains the method. * @param regEx is the regular expression, which should be matched with the method name. * @param patternFlag is the flag to configure the mat...
Method detects the method of an object class by the input regular expression
detectMethod
{ "repo_name": "openbase/bco.ontology", "path": "lib/src/main/java/org/openbase/bco/ontology/lib/utility/ReflectionUtility.java", "license": "lgpl-3.0", "size": 7767 }
[ "java.lang.reflect.Method", "java.util.ArrayList", "java.util.List", "java.util.regex.Matcher", "java.util.regex.Pattern", "org.openbase.jul.exception.CouldNotPerformException", "org.openbase.jul.exception.NotAvailableException" ]
import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.openbase.jul.exception.CouldNotPerformException; import org.openbase.jul.exception.NotAvailableException;
import java.lang.reflect.*; import java.util.*; import java.util.regex.*; import org.openbase.jul.exception.*;
[ "java.lang", "java.util", "org.openbase.jul" ]
java.lang; java.util; org.openbase.jul;
1,654,421
void processMessage(@NotNull PrivateMessage message);
void processMessage(@NotNull PrivateMessage message);
/** * Sends the given message through the message pipeline, registers the last sender, then sends the message to the * sender and recipient. * * @param message Message to process * @see #sendMessageToPipeline(PrivateMessage) * @see #registerLastSender(Player, Player) * @see #sendMessa...
Sends the given message through the message pipeline, registers the last sender, then sends the message to the sender and recipient
processMessage
{ "repo_name": "turt2live/Chatterbox", "path": "modules/Chatterbox/src/main/java/works/chatterbox/chatterbox/api/MessagingAPI.java", "license": "mpl-2.0", "size": 2720 }
[ "org.jetbrains.annotations.NotNull", "works.chatterbox.chatterbox.api.impl.messaging.PrivateMessage" ]
import org.jetbrains.annotations.NotNull; import works.chatterbox.chatterbox.api.impl.messaging.PrivateMessage;
import org.jetbrains.annotations.*; import works.chatterbox.chatterbox.api.impl.messaging.*;
[ "org.jetbrains.annotations", "works.chatterbox.chatterbox" ]
org.jetbrains.annotations; works.chatterbox.chatterbox;
1,954,963
@GuardedBy("lock") private void stopIfNecessary() { if (!(goAwayStatus != null && streams.isEmpty() && pendingStreams.isEmpty())) { return; } if (stopped) { return; } stopped = true; if (keepAliveManager != null) { keepAliveManager.onTransportTermination(); // KeepAl...
@GuardedBy("lock") void function() { if (!(goAwayStatus != null && streams.isEmpty() && pendingStreams.isEmpty())) { return; } if (stopped) { return; } stopped = true; if (keepAliveManager != null) { keepAliveManager.onTransportTermination(); scheduler = SharedResourceHolder.release(TIMER_SERVICE, scheduler); } if (pin...
/** * When the transport is in goAway state, we should stop it once all active streams finish. */
When the transport is in goAway state, we should stop it once all active streams finish
stopIfNecessary
{ "repo_name": "gxwangdi/practice", "path": "grpc-java/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java", "license": "gpl-2.0", "size": 39183 }
[ "io.grpc.internal.SharedResourceHolder", "io.grpc.okhttp.internal.framed.ErrorCode", "javax.annotation.concurrent.GuardedBy" ]
import io.grpc.internal.SharedResourceHolder; import io.grpc.okhttp.internal.framed.ErrorCode; import javax.annotation.concurrent.GuardedBy;
import io.grpc.internal.*; import io.grpc.okhttp.internal.framed.*; import javax.annotation.concurrent.*;
[ "io.grpc.internal", "io.grpc.okhttp", "javax.annotation" ]
io.grpc.internal; io.grpc.okhttp; javax.annotation;
987,898
@Nullable LoadingValueReference<K, V> insertLoadingValueReference(final K key, final int hash) { ReferenceEntry<K, V> e = null; lock(); try { long now = map.ticker.read(); preWriteCleanup(now); AtomicReferenceArray<ReferenceEntry<K, V>> table = this.table; int ...
LoadingValueReference<K, V> insertLoadingValueReference(final K key, final int hash) { ReferenceEntry<K, V> e = null; lock(); try { long now = map.ticker.read(); preWriteCleanup(now); AtomicReferenceArray<ReferenceEntry<K, V>> table = this.table; int index = hash & (table.length() - 1); ReferenceEntry<K, V> first = tab...
/** * Returns a newly inserted {@code LoadingValueReference}, or null if the live value reference * is already loading. */
Returns a newly inserted LoadingValueReference, or null if the live value reference is already loading
insertLoadingValueReference
{ "repo_name": "hceylan/guava", "path": "guava/src/com/google/common/cache/LocalCache.java", "license": "apache-2.0", "size": 144823 }
[ "java.util.concurrent.atomic.AtomicReferenceArray" ]
import java.util.concurrent.atomic.AtomicReferenceArray;
import java.util.concurrent.atomic.*;
[ "java.util" ]
java.util;
1,583,665
@Nonnull public java.util.concurrent.CompletableFuture<MuteParticipantOperation> putAsync(@Nonnull final MuteParticipantOperation newMuteParticipantOperation) { return sendAsync(HttpMethod.PUT, newMuteParticipantOperation); }
java.util.concurrent.CompletableFuture<MuteParticipantOperation> function(@Nonnull final MuteParticipantOperation newMuteParticipantOperation) { return sendAsync(HttpMethod.PUT, newMuteParticipantOperation); }
/** * Creates a MuteParticipantOperation with a new object * * @param newMuteParticipantOperation the object to create/update * @return a future with the result */
Creates a MuteParticipantOperation with a new object
putAsync
{ "repo_name": "microsoftgraph/msgraph-sdk-java", "path": "src/main/java/com/microsoft/graph/requests/MuteParticipantOperationRequest.java", "license": "mit", "size": 6433 }
[ "com.microsoft.graph.http.HttpMethod", "com.microsoft.graph.models.MuteParticipantOperation", "javax.annotation.Nonnull" ]
import com.microsoft.graph.http.HttpMethod; import com.microsoft.graph.models.MuteParticipantOperation; import javax.annotation.Nonnull;
import com.microsoft.graph.http.*; import com.microsoft.graph.models.*; import javax.annotation.*;
[ "com.microsoft.graph", "javax.annotation" ]
com.microsoft.graph; javax.annotation;
2,227,915
public void markTimestampFor(final String action, final String userValue) { markTimestampFor(new Date(), action, userValue); }
void function(final String action, final String userValue) { markTimestampFor(new Date(), action, userValue); }
/** * Create a LifeCycleEntry * * @return The created LifeCycleEntry */
Create a LifeCycleEntry
markTimestampFor
{ "repo_name": "RLDevOps/Demo", "path": "src/main/java/org/olat/commons/lifecycle/LifeCycleManager.java", "license": "apache-2.0", "size": 5713 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
686,211
@Generated @Selector("selectedIndex") @NUInt public native long selectedIndex();
@Selector(STR) native long function();
/** * Designate an instance in the pointsOfInterest array to highlight. Use NSNotFound to indicate no selection. */
Designate an instance in the pointsOfInterest array to highlight. Use NSNotFound to indicate no selection
selectedIndex
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/carplay/CPPointOfInterestTemplate.java", "license": "apache-2.0", "size": 8374 }
[ "org.moe.natj.objc.ann.Selector" ]
import org.moe.natj.objc.ann.Selector;
import org.moe.natj.objc.ann.*;
[ "org.moe.natj" ]
org.moe.natj;
2,004,064
public Path getCompilerclasspath() { return compilerClasspath; }
Path function() { return compilerClasspath; }
/** * get the classpath used to find the compiler adapter * @return the compiler classpath. */
get the classpath used to find the compiler adapter
getCompilerclasspath
{ "repo_name": "BIORIMP/biorimp", "path": "BIO-RIMP/test_data/code/antapache/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java", "license": "gpl-2.0", "size": 20543 }
[ "org.apache.tools.ant.types.Path" ]
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.*;
[ "org.apache.tools" ]
org.apache.tools;
2,342,252
private DefaultTableCellRenderer createPasswordCellRenderer() { return new DefaultTableCellRenderer() { private static final long serialVersionUID = 1L;
DefaultTableCellRenderer function() { return new DefaultTableCellRenderer() { private static final long serialVersionUID = 1L;
/** * Creates the renderer for the password cells in the table. * * @return the password cell renderer */
Creates the renderer for the password cells in the table
createPasswordCellRenderer
{ "repo_name": "aerhard/dbTagger", "path": "src/main/java/com/aerhard/oxygen/plugin/dbtagger/config/ConfigTable.java", "license": "apache-2.0", "size": 5322 }
[ "javax.swing.table.DefaultTableCellRenderer" ]
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.*;
[ "javax.swing" ]
javax.swing;
2,867,662
public boolean compile(URL url) { try { // Open input stream from URL and wrap inside InputSource final InputStream stream = url.openStream(); final InputSource input = new InputSource(stream); input.setSystemId(url.toString()); return compile(inpu...
boolean function(URL url) { try { final InputStream stream = url.openStream(); final InputSource input = new InputSource(stream); input.setSystemId(url.toString()); return compile(input, _className); } catch (IOException e) { _parser.reportError(Constants.FATAL, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e)); return false...
/** * Compiles an XSL stylesheet pointed to by a URL * @param url An URL containing the input XSL stylesheet */
Compiles an XSL stylesheet pointed to by a URL
compile
{ "repo_name": "FauxFaux/jdk9-jaxp", "path": "src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java", "license": "gpl-2.0", "size": 35830 }
[ "com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg", "java.io.IOException", "java.io.InputStream", "org.xml.sax.InputSource" ]
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; import java.io.IOException; import java.io.InputStream; import org.xml.sax.InputSource;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.*; import java.io.*; import org.xml.sax.*;
[ "com.sun.org", "java.io", "org.xml.sax" ]
com.sun.org; java.io; org.xml.sax;
1,960,414
public void likeMessage(View view) { ListView listview1 = (ListView) view.getParent().getParent().getParent(); final int position = listview1.getPositionForView((View) view.getParent()); Message msg = (Message) listview1.getItemAtPosition(position); int msg_id = msg.getId();...
void function(View view) { ListView listview1 = (ListView) view.getParent().getParent().getParent(); final int position = listview1.getPositionForView((View) view.getParent()); Message msg = (Message) listview1.getItemAtPosition(position); int msg_id = msg.getId(); rateMessage("like",msg_id); Toast.makeText( this, STR,...
/** * BUTTON LISTENERS */
BUTTON LISTENERS
likeMessage
{ "repo_name": "GRboss/vithess", "path": "ViThess_Android/src/com/vithess/ListMessages.java", "license": "gpl-3.0", "size": 25971 }
[ "android.view.View", "android.widget.ListView", "android.widget.Toast" ]
import android.view.View; import android.widget.ListView; import android.widget.Toast;
import android.view.*; import android.widget.*;
[ "android.view", "android.widget" ]
android.view; android.widget;
2,845,021
public void openPreview(String resourcePath, String resourceType) { if (m_currentPreview != null) { m_currentPreview.removePreview(); } String provider = getProviderName(resourceType); if (m_previewFactoryRegistration.containsKey(provider)) { m_currentPreview...
void function(String resourcePath, String resourceType) { if (m_currentPreview != null) { m_currentPreview.removePreview(); } String provider = getProviderName(resourceType); if (m_previewFactoryRegistration.containsKey(provider)) { m_currentPreview = m_previewFactoryRegistration.get(provider).getPreview(m_handler.m_ga...
/** * Opens the preview for the given resource by the given resource type.<p> * * @param resourcePath the resource path * @param resourceType the resource type name */
Opens the preview for the given resource by the given resource type
openPreview
{ "repo_name": "PatidarWeb/opencms-core", "path": "src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java", "license": "lgpl-2.1", "size": 59819 }
[ "org.opencms.gwt.client.util.CmsDebugLog" ]
import org.opencms.gwt.client.util.CmsDebugLog;
import org.opencms.gwt.client.util.*;
[ "org.opencms.gwt" ]
org.opencms.gwt;
2,150,674
public MulticastConfig setMulticastGroup(String multicastGroup) { this.multicastGroup = checkHasText(multicastGroup, "multicastGroup must contain text"); return this; }
MulticastConfig function(String multicastGroup) { this.multicastGroup = checkHasText(multicastGroup, STR); return this; }
/** * Sets the multicast group. * * @param multicastGroup the multicastGroup to set * @return the updated MulticastConfig * @throws IllegalArgumentException if multicastGroup is null or empty. * @see #getMulticastGroup() * @see #setMulticastPort(int) */
Sets the multicast group
setMulticastGroup
{ "repo_name": "lmjacksoniii/hazelcast", "path": "hazelcast/src/main/java/com/hazelcast/config/MulticastConfig.java", "license": "apache-2.0", "size": 9552 }
[ "com.hazelcast.util.Preconditions" ]
import com.hazelcast.util.Preconditions;
import com.hazelcast.util.*;
[ "com.hazelcast.util" ]
com.hazelcast.util;
2,738,767
private String extractUsername(Object principal) { // if principal is spring security user, cast it and get username // else it is javax.security principal with toString() that return username if (principal instanceof UserDetails) { return ((UserDetails) principal).getUsername();...
String function(Object principal) { if (principal instanceof UserDetails) { return ((UserDetails) principal).getUsername(); } return principal.toString(); }
/** * Get username from principal. * * @param principal principal * @return username */
Get username from principal
extractUsername
{ "repo_name": "jtalks-org/jtalks-common", "path": "jtalks-common-service/src/main/java/org/jtalks/common/service/nontransactional/SecurityServiceImpl.java", "license": "lgpl-2.1", "size": 5364 }
[ "org.springframework.security.core.userdetails.UserDetails" ]
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.*;
[ "org.springframework.security" ]
org.springframework.security;
2,206,478
public void addNode(GraphNode node) { this.mGraphImplementor.addNode(node); // increment associated workflow metrics this.mDAGInfo.getWorkflowMetrics().increment((Job) node.getContent()); }
void function(GraphNode node) { this.mGraphImplementor.addNode(node); this.mDAGInfo.getWorkflowMetrics().increment((Job) node.getContent()); }
/** * Adds a node to the Graph. It overwrites an already existing node with the same ID. * * @param node the node to be added to the Graph. */
Adds a node to the Graph. It overwrites an already existing node with the same ID
addNode
{ "repo_name": "pegasus-isi/pegasus", "path": "src/edu/isi/pegasus/planner/classes/ADag.java", "license": "apache-2.0", "size": 34906 }
[ "edu.isi.pegasus.planner.partitioner.graph.GraphNode" ]
import edu.isi.pegasus.planner.partitioner.graph.GraphNode;
import edu.isi.pegasus.planner.partitioner.graph.*;
[ "edu.isi.pegasus" ]
edu.isi.pegasus;
1,042,788
private void connect() throws IOException { JMXServiceURL jmxUrl = new JMXServiceURL(String.format(fmtUrl, host, port)); Map<String,Object> env = new HashMap<String,Object>(); if (username != null) { String[] creds = { username, password }; env.put(JMXConn...
void function() throws IOException { JMXServiceURL jmxUrl = new JMXServiceURL(String.format(fmtUrl, host, port)); Map<String,Object> env = new HashMap<String,Object>(); if (username != null) { String[] creds = { username, password }; env.put(JMXConnector.CREDENTIALS, creds); } env.put(STR, getRMIClientSocketFactory());...
/** * Create a connection to the JMX agent and setup the M[X]Bean proxies. * * @throws IOException on connection failures */
Create a connection to the JMX agent and setup the M[X]Bean proxies
connect
{ "repo_name": "exoscale/cassandra", "path": "src/java/org/apache/cassandra/tools/NodeProbe.java", "license": "apache-2.0", "size": 55385 }
[ "java.io.IOException", "java.lang.management.ManagementFactory", "java.lang.management.MemoryMXBean", "java.lang.management.RuntimeMXBean", "java.util.HashMap", "java.util.Map", "javax.management.JMX", "javax.management.MalformedObjectNameException", "javax.management.ObjectName", "javax.managemen...
import java.io.IOException; import java.lang.management.ManagementFactory; import java.lang.management.MemoryMXBean; import java.lang.management.RuntimeMXBean; import java.util.HashMap; import java.util.Map; import javax.management.JMX; import javax.management.MalformedObjectNameException; import javax.management.Objec...
import java.io.*; import java.lang.management.*; import java.util.*; import javax.management.*; import javax.management.remote.*; import org.apache.cassandra.batchlog.*; import org.apache.cassandra.db.*; import org.apache.cassandra.db.compaction.*; import org.apache.cassandra.gms.*; import org.apache.cassandra.net.*; i...
[ "java.io", "java.lang", "java.util", "javax.management", "org.apache.cassandra" ]
java.io; java.lang; java.util; javax.management; org.apache.cassandra;
2,488,344
protected String getResourcePath(HttpServletRequest request) { return "static/" + StringUtils.substringAfter(getPluginKeyAndResourcePath(request), "/"); }
String function(HttpServletRequest request) { return STR + StringUtils.substringAfter(getPluginKeyAndResourcePath(request), "/"); }
/** * Note that returned value should not have a leading "/" - see {@link Class#resolveName(String)}. */
Note that returned value should not have a leading "/" - see <code>Class#resolveName(String)</code>
getResourcePath
{ "repo_name": "abbeyj/sonarqube", "path": "server/sonar-server/src/main/java/org/sonar/server/plugins/StaticResourcesServlet.java", "license": "lgpl-3.0", "size": 3817 }
[ "javax.servlet.http.HttpServletRequest", "org.apache.commons.lang.StringUtils" ]
import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang.StringUtils;
import javax.servlet.http.*; import org.apache.commons.lang.*;
[ "javax.servlet", "org.apache.commons" ]
javax.servlet; org.apache.commons;
1,357,535
public Calendar validate(String value, TimeZone timeZone) { return (Calendar)parse(value, (String)null, (Locale)null, timeZone); }
Calendar function(String value, TimeZone timeZone) { return (Calendar)parse(value, (String)null, (Locale)null, timeZone); }
/** * <p>Validate/convert a time using the specified <code>TimeZone</code> * and default <code>Locale</code>. * * @param value The value validation is being performed on. * @param timeZone The Time Zone used to parse the time, system default if null. * @return The parsed <code>Calendar<...
Validate/convert a time using the specified <code>TimeZone</code> and default <code>Locale</code>
validate
{ "repo_name": "apache/commons-validator", "path": "src/main/java/org/apache/commons/validator/routines/TimeValidator.java", "license": "apache-2.0", "size": 12246 }
[ "java.util.Calendar", "java.util.Locale", "java.util.TimeZone" ]
import java.util.Calendar; import java.util.Locale; import java.util.TimeZone;
import java.util.*;
[ "java.util" ]
java.util;
460,023
public List<String> findStrings(String expr) throws XPathExpressionException { List<String> strings = new ArrayList<String>(); NodeList nodes = findNodes(expr); for(int i=0; i<nodes.getLength(); i++) { strings.add(nodes.item(i).getNodeValue()); ...
List<String> function(String expr) throws XPathExpressionException { List<String> strings = new ArrayList<String>(); NodeList nodes = findNodes(expr); for(int i=0; i<nodes.getLength(); i++) { strings.add(nodes.item(i).getNodeValue()); } return strings; }
/** * Evaluates the given xpath expression and returns the result as a * List of Strings. If there are no matches, return the empty list. */
Evaluates the given xpath expression and returns the result as a List of Strings. If there are no matches, return the empty list
findStrings
{ "repo_name": "55minutes/fiftyfive-util", "path": "src/main/java/fiftyfive/util/XPathHelper.java", "license": "apache-2.0", "size": 6236 }
[ "java.util.ArrayList", "java.util.List", "javax.xml.xpath.XPathExpressionException", "org.w3c.dom.NodeList" ]
import java.util.ArrayList; import java.util.List; import javax.xml.xpath.XPathExpressionException; import org.w3c.dom.NodeList;
import java.util.*; import javax.xml.xpath.*; import org.w3c.dom.*;
[ "java.util", "javax.xml", "org.w3c.dom" ]
java.util; javax.xml; org.w3c.dom;
2,271,481
public Term getTerm() { return term; }
Term function() { return term; }
/** * Get the term. * @return the term */
Get the term
getTerm
{ "repo_name": "ZhangXFeng/hadoop", "path": "src/hadoop-mapreduce1-project/src/contrib/index/src/java/org/apache/hadoop/contrib/index/mapred/DocumentAndOp.java", "license": "apache-2.0", "size": 5161 }
[ "org.apache.lucene.index.Term" ]
import org.apache.lucene.index.Term;
import org.apache.lucene.index.*;
[ "org.apache.lucene" ]
org.apache.lucene;
2,077,854
private void setList(List<Dish> dishes) { mDishes = checkNotNull(dishes); }
void function(List<Dish> dishes) { mDishes = checkNotNull(dishes); }
/** * Sets the list of dishes. * * @param dishes the list of dishes. */
Sets the list of dishes
setList
{ "repo_name": "luizgmassa/arquiteturaafe2017", "path": "ArquiteturaAfe2017/app/src/main/java/org/motorola/eldorado/arquiteturaafe2017/view/DishesActivity.java", "license": "gpl-3.0", "size": 9952 }
[ "com.google.common.base.Preconditions", "java.util.List", "org.motorola.eldorado.arquiteturaafe2017.model.Dish" ]
import com.google.common.base.Preconditions; import java.util.List; import org.motorola.eldorado.arquiteturaafe2017.model.Dish;
import com.google.common.base.*; import java.util.*; import org.motorola.eldorado.arquiteturaafe2017.model.*;
[ "com.google.common", "java.util", "org.motorola.eldorado" ]
com.google.common; java.util; org.motorola.eldorado;
761,672
private void initialize() { //TODO make this maps immutable typeToFieldToIndex = Maps.newHashMap(); typeToFields = Maps.newHashMap(); for (Map.Entry<String, Type> entry : fieldToType.entrySet()) { String field = entry.getKey(); Type type = entry.getValue(); List<String> fieldsLis...
void function() { typeToFieldToIndex = Maps.newHashMap(); typeToFields = Maps.newHashMap(); for (Map.Entry<String, Type> entry : fieldToType.entrySet()) { String field = entry.getKey(); Type type = entry.getValue(); List<String> fieldsList = typeToFields.get(type); if (fieldsList == null) { fieldsList = Lists.newArrayL...
/** * This is a helper method, which initializes all the data structures for a * {@link FieldsDescriptor} object. */
This is a helper method, which initializes all the data structures for a <code>FieldsDescriptor</code> object
initialize
{ "repo_name": "PramodSSImmaneni/apex-malhar", "path": "library/src/main/java/com/datatorrent/lib/appdata/schemas/FieldsDescriptor.java", "license": "apache-2.0", "size": 13679 }
[ "com.google.common.collect.Lists", "com.google.common.collect.Maps", "com.google.common.collect.Sets", "it.unimi.dsi.fastutil.objects.Object2IntLinkedOpenHashMap", "java.util.ArrayList", "java.util.Collections", "java.util.EnumSet", "java.util.List", "java.util.Map" ]
import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import it.unimi.dsi.fastutil.objects.Object2IntLinkedOpenHashMap; import java.util.ArrayList; import java.util.Collections; import java.util.EnumSet; import java.util.List; import java.util.Map;
import com.google.common.collect.*; import it.unimi.dsi.fastutil.objects.*; import java.util.*;
[ "com.google.common", "it.unimi.dsi", "java.util" ]
com.google.common; it.unimi.dsi; java.util;
1,635,323
ListIterator<Socket> itr = sockets.listIterator(); while (itr.hasNext()) { destroySocket(itr.next()); } sockets.clear(); // Only terminate context if we are on the main thread if (isMain() && context != null) context.term(); context = nul...
ListIterator<Socket> itr = sockets.listIterator(); while (itr.hasNext()) { destroySocket(itr.next()); } sockets.clear(); if (isMain() && context != null) context.term(); context = null; }
/** * Destructor. Call this to gracefully terminate context and close any managed 0MQ sockets */
Destructor. Call this to gracefully terminate context and close any managed 0MQ sockets
destroy
{ "repo_name": "zeromq/jeromq3-x", "path": "src/main/java/org/zeromq/ZContext.java", "license": "gpl-3.0", "size": 5804 }
[ "java.util.ListIterator", "org.zeromq.ZMQ" ]
import java.util.ListIterator; import org.zeromq.ZMQ;
import java.util.*; import org.zeromq.*;
[ "java.util", "org.zeromq" ]
java.util; org.zeromq;
1,673,970
public void grantMembership(String jid) throws XMPPException { changeAffiliationByAdmin(jid, "member", null); }
void function(String jid) throws XMPPException { changeAffiliationByAdmin(jid, STR, null); }
/** * Grants membership to a user. Only administrators are able to grant membership. A user * that becomes a room member will be able to enter a room of type Members-Only (i.e. a room * that a user cannot enter without being on the member list). * * @param jid the XMPP user ID of the user to gr...
Grants membership to a user. Only administrators are able to grant membership. A user that becomes a room member will be able to enter a room of type Members-Only (i.e. a room that a user cannot enter without being on the member list)
grantMembership
{ "repo_name": "luchuangbin/test1", "path": "src/org/jivesoftware/smackx/muc/MultiUserChat.java", "license": "apache-2.0", "size": 122001 }
[ "org.jivesoftware.smack.XMPPException" ]
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.*;
[ "org.jivesoftware.smack" ]
org.jivesoftware.smack;
1,366,611
public static void setCrossPlatformLookAndFeels() { try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { logger.error("failed to set the default...
static void function() { try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch (ClassNotFoundException InstantiationException IllegalAccessException UnsupportedLookAndFeelException e) { logger.error(STR, e); } }
/** * Loads the default cross platform {@link LookAndFeel}. */
Loads the default cross platform <code>LookAndFeel</code>
setCrossPlatformLookAndFeels
{ "repo_name": "cristian-sulea/jatoo-ui", "path": "src/main/java/jatoo/ui/UIUtils.java", "license": "apache-2.0", "size": 24799 }
[ "javax.swing.UIManager", "javax.swing.UnsupportedLookAndFeelException" ]
import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
1,668,849
public void addIfCanExecute(Command command) { if (command.canExecute()) { add(command); } }
void function(Command command) { if (command.canExecute()) { add(command); } }
/** * Before adding a command, the canExecute() method is called. * * @param command A command to execute */
Before adding a command, the canExecute() method is called
addIfCanExecute
{ "repo_name": "pgaufillet/topcased-req", "path": "plugins/org.topcased.requirement.common/src/org/topcased/requirement/common/commands/CompoundCommand.java", "license": "epl-1.0", "size": 3980 }
[ "org.eclipse.gef.commands.Command" ]
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.*;
[ "org.eclipse.gef" ]
org.eclipse.gef;
1,528,814
@ServiceMethod(returns = ReturnType.SINGLE) public Mono<Response<RegistryNameStatusInner>> checkNameAvailabilityWithResponseAsync( RegistryNameCheckRequest registryNameCheckRequest) { if (this.client.getEndpoint() == null) { return Mono .error( new...
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<RegistryNameStatusInner>> function( RegistryNameCheckRequest registryNameCheckRequest) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new Il...
/** * Checks whether the container registry name is available for use. The name must contain only alphanumeric * characters, be globally unique, and between 5 and 50 characters in length. * * @param registryNameCheckRequest The object containing information for the availability request. * @thro...
Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length
checkNameAvailabilityWithResponseAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesClientImpl.java", "license": "mit", "size": 175049 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.FluxUtil", "com.azure.resourcemanager.containerregistry.fluent.models.RegistryNameStatusInner", "com.azure.resourcemanager.containerregistry.models.RegistryNameCheck...
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.containerregistry.fluent.models.RegistryNameStatusInner; import com.azure.resourcemanager.containerregistry.models....
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.containerregistry.fluent.models.*; import com.azure.resourcemanager.containerregistry.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,624,448
void updateService(PerunSession perunSession, Service service);
void updateService(PerunSession perunSession, Service service);
/** Updates the service. * * @param perunSession * @param service */
Updates the service
updateService
{ "repo_name": "balcirakpeter/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/implApi/ServicesManagerImplApi.java", "license": "bsd-2-clause", "size": 19989 }
[ "cz.metacentrum.perun.core.api.PerunSession", "cz.metacentrum.perun.core.api.Service" ]
import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.Service;
import cz.metacentrum.perun.core.api.*;
[ "cz.metacentrum.perun" ]
cz.metacentrum.perun;
1,835,427
public OrderBook getCachedOrderBook() { synchronized (cachedDataSynchronizationObject) { if (cachedOrderBook == null) { throw new ExchangeException("watchOrders method has not been called yet!"); } return cachedOrderBook; } }
OrderBook function() { synchronized (cachedDataSynchronizationObject) { if (cachedOrderBook == null) { throw new ExchangeException(STR); } return cachedOrderBook; } }
/** * Experimental: USE WITH CAUTION. * Adapters take every "OrderOpened," "OrdersMatched," or "OrderClosed" event, update local Orderbook object. * This method will return that cached Orderbook object. * Notes: Will not survive program restarts, instantiated upon class instantiation with NO WALLETS. * ...
Experimental: USE WITH CAUTION. Adapters take every "OrderOpened," "OrdersMatched," or "OrderClosed" event, update local Orderbook object. This method will return that cached Orderbook object. Notes: Will not survive program restarts, instantiated upon class instantiation with NO WALLETS
getCachedOrderBook
{ "repo_name": "habibmasuro/XChange", "path": "xchange-coinfloor/src/main/java/com/xeiam/xchange/coinfloor/CoinfloorAdapters.java", "license": "mit", "size": 20709 }
[ "com.xeiam.xchange.ExchangeException", "com.xeiam.xchange.dto.marketdata.OrderBook" ]
import com.xeiam.xchange.ExchangeException; import com.xeiam.xchange.dto.marketdata.OrderBook;
import com.xeiam.xchange.*; import com.xeiam.xchange.dto.marketdata.*;
[ "com.xeiam.xchange" ]
com.xeiam.xchange;
2,284,474
public void add(String lexeme, String partOfSpeech) { HashSet<String> posSet = lexicon.get(lexeme); if (posSet == null) { posSet = new HashSet<String>(); } posSet.add(partOfSpeech); lexicon.put(lexeme, posSet); }
void function(String lexeme, String partOfSpeech) { HashSet<String> posSet = lexicon.get(lexeme); if (posSet == null) { posSet = new HashSet<String>(); } posSet.add(partOfSpeech); lexicon.put(lexeme, posSet); }
/** * This method ... * * @param lexeme ... * @param partOfSpeech ... */
This method ..
add
{ "repo_name": "rikarudo/LemPORT", "path": "src/lexicon/Lexicon.java", "license": "lgpl-3.0", "size": 5374 }
[ "java.util.HashSet" ]
import java.util.HashSet;
import java.util.*;
[ "java.util" ]
java.util;
1,266,879
void onFinish(Task task); } private final String componentTag; private final String taskTag; private final Handler handler; private final TaskRunnable taskRunnable; private final Callback callback; private volatile TaskResult taskResult; private TaskListener taskListener; ...
void onFinish(Task task); } private final String componentTag; private final String taskTag; private final Handler handler; private final TaskRunnable taskRunnable; private final Callback callback; private volatile TaskResult taskResult; private TaskListener taskListener; private boolean isProgressDisplayed = false; Ta...
/** * Called when task finished execution and delivered result * * @param task finished task */
Called when task finished execution and delivered result
onFinish
{ "repo_name": "amakdev/taskhelper", "path": "library/src/main/java/com/amakdev/android/taskhelper/Task.java", "license": "apache-2.0", "size": 4122 }
[ "android.os.Handler" ]
import android.os.Handler;
import android.os.*;
[ "android.os" ]
android.os;
2,896,164
@ServiceMethod(returns = ReturnType.SINGLE) public Response<MicrosoftGraphScopedRoleMembershipInner> createScopedRoleMembersWithResponse( String administrativeUnitId, MicrosoftGraphScopedRoleMembershipInner body, Context context) { return createScopedRoleMembersWithResponseAsync(administrativeUn...
@ServiceMethod(returns = ReturnType.SINGLE) Response<MicrosoftGraphScopedRoleMembershipInner> function( String administrativeUnitId, MicrosoftGraphScopedRoleMembershipInner body, Context context) { return createScopedRoleMembersWithResponseAsync(administrativeUnitId, body, context).block(); }
/** * Create new navigation property to scopedRoleMembers for directory. * * @param administrativeUnitId key: id of administrativeUnit. * @param body New navigation property. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if paramet...
Create new navigation property to scopedRoleMembers for directory
createScopedRoleMembersWithResponse
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/DirectoryAdministrativeUnitsClientImpl.java", "license": "mit", "size": 146570 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context", "com.azure.resourcemanager.authorization.fluent.models.MicrosoftGraphScopedRoleMembershipInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.authorization.fluent.models.MicrosoftGraphScopedRoleMembershipInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.authorization.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
371,923