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<ByteBuffer>>> mono = exportDataWithResponseAsync(resourceGroupName, name, parameters, context); return this .client .<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); }
@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(resourceGroupName, name, parameters, context); return this .client .<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); }
/** * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running 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", "java.nio.ByteBuffer" ]
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.ExportRdbParameters; import java.nio.ByteBuffer;
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 itself. * * @param type the typecode of the data structure, stored in the byte * array. * * @return the {@link Any}, containing the decoded structure. The * structure can be extracted from the Any with the appropriate helper. * * @throws FormatMismatch on the invalid structure of the byte array. * @throws TypeMismatch if discovered that the the byte array defines a * different structure. * * @see #encode_value(Any) */
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_CENTRAL_DIR_OFFSET_FIELD_OFFSET, offset); }
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<GrantedAuthority> roles = getGroupMembershipRoles(userDn, username); Set<GrantedAuthority> extraRoles = getAdditionalRoles(user, username); if (extraRoles != null) { roles.addAll(extraRoles); } if (defaultRole != null) { roles.add(defaultRole); } List<GrantedAuthority> result = new ArrayList<GrantedAuthority>(roles.size()); result.addAll(roles); return result; }
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 = getAdditionalRoles(user, username); if (extraRoles != null) { roles.addAll(extraRoles); } if (defaultRole != null) { roles.add(defaultRole); } List<GrantedAuthority> result = new ArrayList<GrantedAuthority>(roles.size()); result.addAll(roles); return result; }
/** * 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 unique globally. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, * protocol, content caching and delivery behavior. */
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) { throw new IllegalArgumentException("charset may not be null or empty"); } try { return new String(data, offset, length, charset); } catch (UnsupportedEncodingException e) { if (LOG.isWarnEnabled()) { LOG.warn("Unsupported encoding: " + charset + ". System encoding used"); } return new String(data, offset, length); } }
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 (UnsupportedEncodingException e) { if (LOG.isWarnEnabled()) { LOG.warn(STR + charset + STR); } return new String(data, offset, length); } }
/** * 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 to encode * @param charset the desired character encoding * @return The result of the conversion. * * @since 3.0 */
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. HiveMetaStoreClient client = context.getMetaStoreClient(userWithoutAccess.toUpperCase()); try { client.getDatabase(dbName1); fail("NoSuchObjectException should have been thrown"); } catch (NoSuchObjectException noe) { // ignore, just make sure the authorization is failed. } }
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 " + telegram.message + " not handled"); } } else { // Dispatch the telegram to all the registered receivers int handledCount = 0; Array<Telegraph> listeners = msgListeners.get(telegram.message); if (listeners != null) { for (int i = 0; i < listeners.size; i++) { if (listeners.get(i).handleMessage(telegram)) { handledCount++; } } } // Telegram could not be handled if (debugEnabled && handledCount == 0) GdxAI.getLogger().info(LOG_TAG, "Message " + telegram.message + " not handled"); } if (telegram.returnReceiptStatus == Telegram.RETURN_RECEIPT_NEEDED) { // Use this telegram to send the return receipt telegram.receiver = telegram.sender; telegram.sender = this; telegram.returnReceiptStatus = Telegram.RETURN_RECEIPT_SENT; discharge(telegram); } else { // Release the telegram to the pool pool.free(telegram); } }
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) { for (int i = 0; i < listeners.size; i++) { if (listeners.get(i).handleMessage(telegram)) { handledCount++; } } } if (debugEnabled && handledCount == 0) GdxAI.getLogger().info(LOG_TAG, STR + telegram.message + STR); } if (telegram.returnReceiptStatus == Telegram.RETURN_RECEIPT_NEEDED) { telegram.receiver = telegram.sender; telegram.sender = this; telegram.returnReceiptStatus = Telegram.RETURN_RECEIPT_SENT; discharge(telegram); } else { pool.free(telegram); } }
/** 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 to the pool. * @param telegram the telegram to discharge */
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 the pool
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("any/type"); put.setEntity(putReq); HttpResponse resp = httpClient.execute(put); assertEquals(204, resp.getStatusLine().getStatusCode()); HttpGet get = new HttpGet(isTestUri); get.addHeader("Accept", "mytype/subtype"); resp = httpClient.execute(get); assertEquals(200, resp.getStatusLine().getStatusCode()); InputStream is = resp.getEntity().getContent(); byte[] receivedBArr = new byte[barr.length]; DataInputStream dis = new DataInputStream(is); dis.readFully(receivedBArr); int checkEOF = dis.read(); assertEquals(-1, checkEOF); for (int c = 0; c < barr.length; ++c) { assertEquals(barr[c], receivedBArr[c]); } assertEquals("mytype/subtype", resp.getFirstHeader("Content-Type").getValue()); // Original test expects Content-Length header to be null, too assertNull(resp.getFirstHeader("Content-Length")); }
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.getStatusLine().getStatusCode()); HttpGet get = new HttpGet(isTestUri); get.addHeader(STR, STR); resp = httpClient.execute(get); assertEquals(200, resp.getStatusLine().getStatusCode()); InputStream is = resp.getEntity().getContent(); byte[] receivedBArr = new byte[barr.length]; DataInputStream dis = new DataInputStream(is); dis.readFully(receivedBArr); int checkEOF = dis.read(); assertEquals(-1, checkEOF); for (int c = 0; c < barr.length; ++c) { assertEquals(barr[c], receivedBArr[c]); } assertEquals(STR, resp.getFirstHeader(STR).getValue()); assertNull(resp.getFirstHeader(STR)); }
/** * 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 subclass wishes to exclude a particular control in its contents from * getting the specified background color, it may instead override * {@link #getBackgroundColorExclusions()}
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 control in its contents from * getting the specified background color, it may instead override * {@link #getBackgroundColorExclusions()}
/** * 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 #getForegroundColorExclusions()}. * * @param color * the color to use as the foreground color * @param control * the control whose color is to be changed * @see PopupDialog#getForegroundColorExclusions() */
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()</code>
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.getPropertiesManager().getDeployPropertyValue("jboss.server.port"));
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(); Value oValue = otherValue.getNestedValue(slotName); if (!ignoreUndefinedInObject || (ignoreUndefinedInObject && null != oValue)) { Value myValue = getNestedValue(slotName); if (null == myValue) { equals = (null == oValue); } else { equals = myValue.equals(oValue); } } } return equals; }
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 (!ignoreUndefinedInObject (ignoreUndefinedInObject && null != oValue)) { Value myValue = getNestedValue(slotName); if (null == myValue) { equals = (null == oValue); } else { equals = myValue.equals(oValue); } } } return equals; }
/** * 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</code> if <code>other</code> is considered equal to <b>container</b>, <code>false</code> else */
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 = (ProteinDetailList) MARSHALLER.getProteinDetailList(queryURL + "?show=" + PAGE_SIZE + "&page=" + page); if (subList.getList().isEmpty()) { moreResults = false; } else { proteins.getList().addAll(subList.getList()); } page++; } return proteins; }
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 (subList.getList().isEmpty()) { moreResults = false; } else { proteins.getList().addAll(subList.getList()); } page++; } return proteins; }
/** * 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 ) { StandardWritable std = (StandardWritable)obj; TypeName type_name = std.getTypeName(); if ( !ObjectParseTree.isTypeRegistered(type_name) ) { System.err.println(String.format("WARNING! An object, %s, with type name %s is being written, but it is not registered with ObjectReader (meaning you will not be able to read/clone it)", obj.getClass().getSimpleName(), type_name.getSimpleName())); System.err.println("Register the class by calling ObjectReader.registerType"); } writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(type_name.getSimpleName()); std.write(new ObjectWriter(this)); } else if ( obj instanceof Boolean ) { Boolean value = (Boolean)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_BOOLEAN.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeBoolean(value.booleanValue()); } else if ( obj instanceof Character ) { Character value = (Character)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_CHAR.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeString(value.toString()); } else if ( obj instanceof Byte ) { Byte value = (Byte)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_BYTE.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeByte(value.byteValue()); } else if ( obj instanceof Short ) { Short value = (Short)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_SHORT.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeInt(value.shortValue()); } else if ( obj instanceof Integer ) { Integer value = (Integer)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_INT.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeInt(value.intValue()); } else if ( obj instanceof Long ) { Long value = (Long)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_LONG.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeLong(value.longValue()); } else if ( obj instanceof Float ) { Float value = (Float)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_FLOAT.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeFloat(value.floatValue()); } else if ( obj instanceof Double ) { Double value = (Double)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_DOUBLE.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeDouble(value.doubleValue()); } else { throw new SerializeException(String.format("Attempt to serialize unknown type %s",obj.getClass())); } gen.writeEndObject(); } } catch(SerializeException e ) { throw e; } catch(Exception e) { throw new SerializeException("Low level write serialization error", e); } }
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.getTypeName(); if ( !ObjectParseTree.isTypeRegistered(type_name) ) { System.err.println(String.format(STR, obj.getClass().getSimpleName(), type_name.getSimpleName())); System.err.println(STR); } writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(type_name.getSimpleName()); std.write(new ObjectWriter(this)); } else if ( obj instanceof Boolean ) { Boolean value = (Boolean)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_BOOLEAN.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeBoolean(value.booleanValue()); } else if ( obj instanceof Character ) { Character value = (Character)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_CHAR.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeString(value.toString()); } else if ( obj instanceof Byte ) { Byte value = (Byte)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_BYTE.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeByte(value.byteValue()); } else if ( obj instanceof Short ) { Short value = (Short)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_SHORT.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeInt(value.shortValue()); } else if ( obj instanceof Integer ) { Integer value = (Integer)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_INT.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeInt(value.intValue()); } else if ( obj instanceof Long ) { Long value = (Long)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_LONG.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeLong(value.longValue()); } else if ( obj instanceof Float ) { Float value = (Float)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_FLOAT.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeFloat(value.floatValue()); } else if ( obj instanceof Double ) { Double value = (Double)obj; writeFieldName(FieldName.FIELD_NAME_TYPE_HINT); writeString(TypeName.TYPE_NAME_DOUBLE.getSimpleName()); writeFieldName(FieldName.FIELD_NAME_PRIMITIVE_VALUE); writeDouble(value.doubleValue()); } else { throw new SerializeException(String.format(STR,obj.getClass())); } gen.writeEndObject(); } } catch(SerializeException e ) { throw e; } catch(Exception e) { throw new SerializeException(STR, e); } }
/** * 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 = isDefaulter; return isValid; }
@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) == '#') { return getNodeByFragment(uri.substring(1), ref); } ParsedURL purl = new ParsedURL(baseURI, uri); // System.err.println("PURL: " + purl); if (documentURI == null) documentURI = document.getURL(); String frag = purl.getRef(); if ((frag != null) && (documentURI != null)) { ParsedURL pDocURL = new ParsedURL(documentURI); // System.out.println("doc: " + pDocURL); // System.out.println("Purl: " + purl); if (pDocURL.sameFile(purl)) { // System.out.println("match"); return document.getElementById(frag); } } // uri is not a reference into this document, so load the // document it does reference after doing a security // check with the UserAgent ParsedURL pDocURL = null; if (documentURI != null) { pDocURL = new ParsedURL(documentURI); } UserAgent userAgent = documentLoader.getUserAgent(); userAgent.checkLoadExternalResource(purl, pDocURL); String purlStr = purl.toString(); if (frag != null) { purlStr = purlStr.substring(0, purlStr.length()-(frag.length()+1)); } Document doc = documentLoader.loadDocument(purlStr); if (frag != null) return doc.getElementById(frag); return doc; }
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) documentURI = document.getURL(); String frag = purl.getRef(); if ((frag != null) && (documentURI != null)) { ParsedURL pDocURL = new ParsedURL(documentURI); if (pDocURL.sameFile(purl)) { return document.getElementById(frag); } } ParsedURL pDocURL = null; if (documentURI != null) { pDocURL = new ParsedURL(documentURI); } UserAgent userAgent = documentLoader.getUserAgent(); userAgent.checkLoadExternalResource(purl, pDocURL); String purlStr = purl.toString(); if (frag != null) { purlStr = purlStr.substring(0, purlStr.length()-(frag.length()+1)); } Document doc = documentLoader.loadDocument(purlStr); if (frag != null) return doc.getElementById(frag); return doc; }
/** * 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 = null;
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) { throw new NegativeArraySizeException("array size must be positive but was: " + arraySize); } // lets do a sanity check that if we are reading an array size that is bigger that the remaining bytes we can safely // throw an exception instead of allocating the array based on the size. A simple corrutpted byte can make a node go OOM // if the size is large and for perf reasons we allocate arrays ahead of time ensureCanReadBytes(arraySize); return arraySize; }
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 arraySize; }
/** * 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 pop up if the znode under which we're trying to // create the lock is already deleted by another region server, meaning // that the transfer already occurred. // NoNode => transfer is done and znodes are already deleted // NodeExists => lock znode already created by another RS if (e instanceof KeeperException.NoNodeException || e instanceof KeeperException.NodeExistsException) { LOG.info("Won't transfer the queue," + " another RS took care of it because of: " + e.getMessage()); } else { LOG.info("Failed lock other rs", e); } return false; } return true; }
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 KeeperException.NodeExistsException) { LOG.info(STR + STR + e.getMessage()); } else { LOG.info(STR, e); } return false; } return true; }
/** * 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.asUnsignedByteArray(new BigInteger("171278725565216523967285789236956265265265235675811949404040041670216363")); SecureRandom k = new FixedSecureRandom(kData); BigInteger n = new BigInteger("220855883097298041197912187592864814557886993776713230936715041207411783"); BigInteger h = BigInteger.valueOf(4); ECCurve.F2m curve = new ECCurve.F2m( 239, // m 36, //k new BigInteger("32010857077C5431123A46B808906756F543423E8D27877578125778AC76", 16), // a new BigInteger("790408F2EEDAF392B012EDEFB3392F30F4327C0CA3F31FC383C422AA8C16", 16), // b n, h); ECDomainParameters params = new ECDomainParameters( curve, curve.decodePoint(Hex.decode("0457927098FA932E7C0A96D3FD5B706EF7E5F5C156E16B7E7C86038552E91D61D8EE5077C33FECF6F1A16B268DE469C3C7744EA9A971649FC7A9616305")), // G n, h); ECPrivateKeyParameters priKey = new ECPrivateKeyParameters( new BigInteger("145642755521911534651321230007534120304391871461646461466464667494947990"), // d params); ECDSASigner ecdsa = new ECDSASigner(); ParametersWithRandom param = new ParametersWithRandom(priKey, k); ecdsa.init(true, param); byte[] message = new BigInteger("968236873715988614170569073515315707566766479517").toByteArray(); BigInteger[] sig = ecdsa.generateSignature(message); if (!r.equals(sig[0])) { fail("r component wrong." + System.getProperty("line.separator") + " expecting: " + r + System.getProperty("line.separator") + " got : " + sig[0]); } if (!s.equals(sig[1])) { fail("s component wrong." + System.getProperty("line.separator") + " expecting: " + s + System.getProperty("line.separator") + " got : " + sig[1]); } // Verify the signature ECPublicKeyParameters pubKey = new ECPublicKeyParameters( curve.decodePoint(Hex.decode("045894609CCECF9A92533F630DE713A958E96C97CCB8F5ABB5A688A238DEED6DC2D9D0C94EBFB7D526BA6A61764175B99CB6011E2047F9F067293F57F5")), // Q params); ecdsa.init(false, pubKey); if (!ecdsa.verifySignature(message, sig[0], sig[1])) { fail("signature fails"); } }
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, 36, new BigInteger(STR, 16), new BigInteger(STR, 16), n, h); ECDomainParameters params = new ECDomainParameters( curve, curve.decodePoint(Hex.decode(STR)), n, h); ECPrivateKeyParameters priKey = new ECPrivateKeyParameters( new BigInteger(STR), params); ECDSASigner ecdsa = new ECDSASigner(); ParametersWithRandom param = new ParametersWithRandom(priKey, k); ecdsa.init(true, param); byte[] message = new BigInteger(STR).toByteArray(); BigInteger[] sig = ecdsa.generateSignature(message); if (!r.equals(sig[0])) { fail(STR + System.getProperty(STR) + STR + r + System.getProperty(STR) + STR + sig[0]); } if (!s.equals(sig[1])) { fail(STR + System.getProperty(STR) + STR + s + System.getProperty(STR) + STR + sig[1]); } ECPublicKeyParameters pubKey = new ECPublicKeyParameters( curve.decodePoint(Hex.decode(STR)), params); ecdsa.init(false, pubKey); if (!ecdsa.verifySignature(message, sig[0], sig[1])) { fail(STR); } }
/** * 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.signers.ECDSASigner", "org.bouncycastle.math.ec.ECCurve", "org.bouncycastle.util.BigIntegers", "org.bouncycastle.util.encoders.Hex", "org.bouncycastle.util.test.FixedSecureRandom" ]
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.bouncycastle.crypto.signers.ECDSASigner; import org.bouncycastle.math.ec.ECCurve; import org.bouncycastle.util.BigIntegers; import org.bouncycastle.util.encoders.Hex; import org.bouncycastle.util.test.FixedSecureRandom;
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(person, ContentModel.PROP_EMAIL)); String firstName = ObjectUtils.getDisplayString(nodeService.getProperty(person, ContentModel.PROP_FIRSTNAME)); String lastName = ObjectUtils.getDisplayString(nodeService.getProperty(person, ContentModel.PROP_LASTNAME)); boolean isSiteAdmin = (loginName.equals("admin") ? true : false); return new UserBean(person.toString(), firstName + " " + lastName, loginName, email, false, isSiteAdmin); }
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 = ObjectUtils.getDisplayString(nodeService.getProperty(person, ContentModel.PROP_FIRSTNAME)); String lastName = ObjectUtils.getDisplayString(nodeService.getProperty(person, ContentModel.PROP_LASTNAME)); boolean isSiteAdmin = (loginName.equals("admin") ? true : false); return new UserBean(person.toString(), firstName + " " + lastName, loginName, email, false, isSiteAdmin); }
/** * 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 Arrays.asList(schemaArray); }
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) { // This is a normal exception, as this will occur when Server#stopServer() is called. logger.log(Level.INFO, "Socket exception on port {0}: {1}. This is normal when the server is stopped.", new Object[]{this.options.getProxyPort(), e}); } catch (SQLException e) { logger.log(Level.SEVERE, "Something went wrong in establishing a Spanner connection: {0}", e.getMessage() ); } finally { this.status = ServerStatus.STOPPED; logger.log(Level.INFO, "Socket on port {0} stopped", this.options.getProxyPort()); } }
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[]{this.options.getProxyPort(), e}); } catch (SQLException e) { logger.log(Level.SEVERE, STR, e.getMessage() ); } finally { this.status = ServerStatus.STOPPED; logger.log(Level.INFO, STR, this.options.getProxyPort()); } }
/** * 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(); calendar.set(2025, Calendar.DECEMBER, 10, 0, 0, 0); testClock.setCurrentTime(calendar.getTime()); // deploy the process repositoryService.createDeployment().addClasspathResource("org/flowable/engine/test/bpmn/event/timer/StartTimerEventRepeatWithoutEndDateTest.testCycleDateStartTimerEvent.bpmn20.xml").deploy(); assertEquals(1, repositoryService.createProcessDefinitionQuery().count()); // AFTER DEPLOYMENT // when the process is deployed there will be created a timerStartEvent job which will wait to be executed. List<Job> jobs = managementService.createTimerJobQuery().list(); assertEquals(1, jobs.size()); // dueDate should be after 24 hours from the process deployment Calendar dueDateCalendar = Calendar.getInstance(); dueDateCalendar.set(2025, Calendar.DECEMBER, 11, 0, 0, 0); // check the due date is inside the 2 seconds range assertTrue(Math.abs(dueDateCalendar.getTime().getTime() - jobs.get(0).getDuedate().getTime()) < 2000); // No process instances List<ProcessInstance> processInstances = runtimeService.createProcessInstanceQuery().list(); assertEquals(0, processInstances.size()); // No tasks List<org.flowable.task.api.Task> tasks = taskService.createTaskQuery().list(); assertEquals(0, tasks.size()); // ADVANCE THE CLOCK // advance the clock after 9 days from starting the process -> // the system will execute the pending job and will create a new one (day by day) moveByMinutes(9 * 60 * 24); executeJobExecutorForTime(10000, 200); // there must be a pending job because the endDate is not reached yet jobs = managementService.createTimerJobQuery().list(); assertEquals(1, jobs.size()); // After time advanced 9 days there should be 9 process instance started processInstances = runtimeService.createProcessInstanceQuery().list(); assertEquals(9, processInstances.size()); // 9 task to be executed (the userTask "Task A") tasks = taskService.createTaskQuery().list(); assertEquals(9, tasks.size()); // one new job will be created (and the old one will be deleted after execution) jobs = managementService.createTimerJobQuery().list(); assertEquals(1, jobs.size()); // check if the last job to be executed has the dueDate set correctly // (10'th repeat after 10 dec. => dueDate must have DueDate = 20 dec.) dueDateCalendar = Calendar.getInstance(); dueDateCalendar.set(2025, Calendar.DECEMBER, 20, 0, 0, 0); assertTrue(Math.abs(dueDateCalendar.getTime().getTime() - jobs.get(0).getDuedate().getTime()) < 2000); // ADVANCE THE CLOCK SO that all 10 repeats to be executed (last execution) moveByMinutes(60 * 24); try { waitForJobExecutorToProcessAllJobsAndExecutableTimerJobs(2000, 200); } catch (Exception e) { fail("Because the maximum number of repeats is reached it will not be executed other jobs"); } // After the 10nth startEvent Execution should have 10 process instances started // (since the first one was not completed) processInstances = runtimeService.createProcessInstanceQuery().list(); assertEquals(10, processInstances.size()); // the current job will be deleted after execution and a new one will // not be created. (all 10 has already executed) jobs = managementService.createJobQuery().list(); assertEquals(0, jobs.size()); // 10 tasks to be executed (the userTask "Task A") // one task for each process instance tasks = taskService.createTaskQuery().list(); assertEquals(10, tasks.size()); // FINAL CHECK // count "timer fired" events int timerFiredCount = 0; List<FlowableEvent> eventsReceived = listener.getEventsReceived(); for (FlowableEvent eventReceived : eventsReceived) { if (FlowableEngineEventType.TIMER_FIRED == eventReceived.getType()) { timerFiredCount++; } } // count "entity created" events int eventCreatedCount = 0; for (FlowableEvent eventReceived : eventsReceived) { if (FlowableEngineEventType.ENTITY_CREATED == eventReceived.getType()) { eventCreatedCount++; } } // count "entity deleted" events int eventDeletedCount = 0; for (FlowableEvent eventReceived : eventsReceived) { if (FlowableEngineEventType.ENTITY_DELETED == eventReceived.getType()) { eventDeletedCount++; } } assertEquals(10, timerFiredCount); // 10 timers fired assertEquals(20, eventCreatedCount); // 20 job entities created, 2 per job (timer and executable job) assertEquals(20, eventDeletedCount); // 20 jobs entities deleted, 2 per job (timer and executable job) // for each processInstance // let's complete the userTasks where the process is hanging in order to complete the processes. for (ProcessInstance processInstance : processInstances) { tasks = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).list(); org.flowable.task.api.Task task = tasks.get(0); assertEquals("Task A", task.getName()); assertEquals(1, tasks.size()); taskService.complete(task.getId()); } // now All the process instances should be completed processInstances = runtimeService.createProcessInstanceQuery().list(); assertEquals(0, processInstances.size()); // no jobs jobs = managementService.createJobQuery().list(); assertEquals(0, jobs.size()); jobs = managementService.createTimerJobQuery().list(); assertEquals(0, jobs.size()); // no tasks tasks = taskService.createTaskQuery().list(); assertEquals(0, tasks.size()); listener.clearEventsReceived(); processEngineConfiguration.setClock(previousClock); repositoryService.deleteDeployment(repositoryService.createDeploymentQuery().singleResult().getId(), true); }
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.getTime()); repositoryService.createDeployment().addClasspathResource(STR).deploy(); assertEquals(1, repositoryService.createProcessDefinitionQuery().count()); List<Job> jobs = managementService.createTimerJobQuery().list(); assertEquals(1, jobs.size()); Calendar dueDateCalendar = Calendar.getInstance(); dueDateCalendar.set(2025, Calendar.DECEMBER, 11, 0, 0, 0); assertTrue(Math.abs(dueDateCalendar.getTime().getTime() - jobs.get(0).getDuedate().getTime()) < 2000); List<ProcessInstance> processInstances = runtimeService.createProcessInstanceQuery().list(); assertEquals(0, processInstances.size()); List<org.flowable.task.api.Task> tasks = taskService.createTaskQuery().list(); assertEquals(0, tasks.size()); moveByMinutes(9 * 60 * 24); executeJobExecutorForTime(10000, 200); jobs = managementService.createTimerJobQuery().list(); assertEquals(1, jobs.size()); processInstances = runtimeService.createProcessInstanceQuery().list(); assertEquals(9, processInstances.size()); tasks = taskService.createTaskQuery().list(); assertEquals(9, tasks.size()); jobs = managementService.createTimerJobQuery().list(); assertEquals(1, jobs.size()); dueDateCalendar = Calendar.getInstance(); dueDateCalendar.set(2025, Calendar.DECEMBER, 20, 0, 0, 0); assertTrue(Math.abs(dueDateCalendar.getTime().getTime() - jobs.get(0).getDuedate().getTime()) < 2000); moveByMinutes(60 * 24); try { waitForJobExecutorToProcessAllJobsAndExecutableTimerJobs(2000, 200); } catch (Exception e) { fail(STR); } processInstances = runtimeService.createProcessInstanceQuery().list(); assertEquals(10, processInstances.size()); jobs = managementService.createJobQuery().list(); assertEquals(0, jobs.size()); tasks = taskService.createTaskQuery().list(); assertEquals(10, tasks.size()); int timerFiredCount = 0; List<FlowableEvent> eventsReceived = listener.getEventsReceived(); for (FlowableEvent eventReceived : eventsReceived) { if (FlowableEngineEventType.TIMER_FIRED == eventReceived.getType()) { timerFiredCount++; } } int eventCreatedCount = 0; for (FlowableEvent eventReceived : eventsReceived) { if (FlowableEngineEventType.ENTITY_CREATED == eventReceived.getType()) { eventCreatedCount++; } } int eventDeletedCount = 0; for (FlowableEvent eventReceived : eventsReceived) { if (FlowableEngineEventType.ENTITY_DELETED == eventReceived.getType()) { eventDeletedCount++; } } assertEquals(10, timerFiredCount); assertEquals(20, eventCreatedCount); assertEquals(20, eventDeletedCount); for (ProcessInstance processInstance : processInstances) { tasks = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).list(); org.flowable.task.api.Task task = tasks.get(0); assertEquals(STR, task.getName()); assertEquals(1, tasks.size()); taskService.complete(task.getId()); } processInstances = runtimeService.createProcessInstanceQuery().list(); assertEquals(0, processInstances.size()); jobs = managementService.createJobQuery().list(); assertEquals(0, jobs.size()); jobs = managementService.createTimerJobQuery().list(); assertEquals(0, jobs.size()); tasks = taskService.createTaskQuery().list(); assertEquals(0, tasks.size()); listener.clearEventsReceived(); processEngineConfiguration.setClock(previousClock); repositoryService.deleteDeployment(repositoryService.createDeploymentQuery().singleResult().getId(), true); }
/** * 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.runtime.ProcessInstance", "org.flowable.job.api.Job" ]
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 org.flowable.engine.runtime.ProcessInstance; import org.flowable.job.api.Job;
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().getSequenceNumber()); seq++; } Assert.assertEquals(endSN, seq); } }
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.assertEquals(endSN, seq); } }
/** * 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 null."); } if (routeTableName == null) { throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); final String apiVersion = "2019-11-01"; Observable<Response<ResponseBody>> observable = service.createOrUpdate(resourceGroupName, routeTableName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<RouteTableInner>() { }.getType()); }
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() == null) { throw new IllegalArgumentException(STR); } if (parameters == null) { throw new IllegalArgumentException(STR); } Validator.validate(parameters); final String apiVersion = STR; Observable<Response<ResponseBody>> observable = service.createOrUpdate(resourceGroupName, routeTableName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<RouteTableInner>() { }.getType()); }
/** * 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 IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
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 = new FormAttachment(controlBox, -6); fd_headingBox.left = new FormAttachment(0); fd_headingBox.right = new FormAttachment(100); fd_headingBox.top = new FormAttachment(0); headingBox.setLayoutData(fd_headingBox); // top controlBox.setLayout(new FormLayout()); final FormData fd_controlBox = new FormData(-1, -1); fd_controlBox.top = new FormAttachment(0, 79); fd_controlBox.bottom = new FormAttachment(helpBox, -6); fd_controlBox.right = new FormAttachment(centerbox, -6); fd_controlBox.left = new FormAttachment(0); controlBox.setLayoutData(fd_controlBox); // optionbox GridLayout gl_optionbox = new GridLayout(); gl_optionbox.marginWidth = 10; gl_optionbox.marginHeight = 10; gl_optionbox.makeColumnsEqualWidth = true; optionbox.setLayout(gl_optionbox); final FormData fdOb = new FormData(-1, -1); fdOb.left = new FormAttachment(0, 10); fdOb.top = new FormAttachment(0); optionbox.setLayoutData(fdOb); btnSave = new Button(controlBox, SWT.NONE); FormData fd_btnSave = new FormData(); fd_btnSave.top = new FormAttachment(optionbox, 6); fd_btnSave.right = new FormAttachment(optionbox, 0, SWT.RIGHT); fd_btnSave.left = new FormAttachment(optionbox, 0, SWT.LEFT); fd_btnSave.height = 30; fd_btnSave.width = 80; btnSave.setLayoutData(fd_btnSave); btnSave.setText(Messages.AndroidUnlockPattern_ButtonSaveText); btnSave.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND)); // btnCheck = new Button(bottombox, SWT.None); btnCancel = new Button(controlBox, SWT.NONE); btnCancel.setEnabled(false); btnCancel.setToolTipText(Messages.AndroidUnlockPattern_btnCancel_toolTipText); FormData fd_btnCancel = new FormData(); fd_btnCancel.top = new FormAttachment(btnSave, 6); fd_btnCancel.right = new FormAttachment(optionbox, 0, SWT.RIGHT); fd_btnCancel.left = new FormAttachment(optionbox, 0, SWT.LEFT); fd_btnCancel.width = 80; fd_btnCancel.height = 30; btnCancel.setLayoutData(fd_btnCancel); btnCancel.setText(Messages.AndroidUnlockPattern_ButtonCancelText); // center final GridLayout clayout = new GridLayout(3, false); clayout.marginLeft = 10; clayout.marginRight = 10; clayout.marginTop = 10; clayout.horizontalSpacing = 15; clayout.verticalSpacing = 15; centerbox.setLayout(clayout); final FormData fdCb = new FormData(0, -1); fdCb.top = new FormAttachment(headingBox, 6); fdCb.bottom = new FormAttachment(helpBox, -6); fdCb.left = new FormAttachment(0, 156); fdCb.right = new FormAttachment(100, -10); centerbox.setLayoutData(fdCb); Label heading = new Label(headingBox, SWT.NONE); heading.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); heading.setFont(FontService.getHeaderFont()); FormData fd_heading = new FormData(); fd_heading.top = new FormAttachment(0, 10); fd_heading.left = new FormAttachment(0, 10); heading.setLayoutData(fd_heading); heading.setText(Messages.AndroidUnlockPattern_Heading); Text lblHeaderInfoText = new Text(headingBox, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY); lblHeaderInfoText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); FormData fd_lblHeaderInfoText = new FormData(); fd_lblHeaderInfoText.right = new FormAttachment(heading, 120, SWT.RIGHT); fd_lblHeaderInfoText.bottom = new FormAttachment(100, -16); fd_lblHeaderInfoText.top = new FormAttachment(heading, 5); fd_lblHeaderInfoText.left = new FormAttachment(heading, 0, SWT.LEFT); lblHeaderInfoText.setLayoutData(fd_lblHeaderInfoText); lblHeaderInfoText.setText(Messages.AndroidUnlockPattern_HeadingInfoText); GridLayout gl_helpBox = new GridLayout(2, true); gl_helpBox.horizontalSpacing = 25; helpBox.setLayout(gl_helpBox); final FormData fd_helpBox = new FormData(180, -1); fd_helpBox.top = new FormAttachment(100, -164); fd_helpBox.bottom = new FormAttachment(100, -10); fd_helpBox.left = new FormAttachment(0, 10); fd_helpBox.right = new FormAttachment(100, -10); helpBox.setLayoutData(fd_helpBox); instrTextHeading = new Label(helpBox, SWT.READ_ONLY | SWT.WRAP); instrTextHeading.setText(Messages.AndroidUnlockPattern_helpBox_instrText_Heading); descTextHeading = new Label(helpBox, SWT.READ_ONLY | SWT.WRAP); descTextHeading.setText(Messages.AndroidUnlockPattern_helpBox_descText_Heading); instrText1 = new StyledText(helpBox, SWT.READ_ONLY | SWT.WRAP); instrText1.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); instrText1.setDoubleClickEnabled(false); instrText1.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false, 1, 1)); instrText1.setAlignment(SWT.LEFT); instrText1.setText(Messages.Mode_Set_1); descTextScroller = new ScrolledComposite(helpBox, SWT.V_SCROLL); descTextScroller.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true, 1, 3)); descTextScroller.setExpandHorizontal(true); descTextScroller.setExpandVertical(true); descText = new StyledText(descTextScroller, SWT.READ_ONLY | SWT.WRAP); descText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); descText.setDoubleClickEnabled(false); descText.setText(Messages.AndroidUnlockPattern_helpBox_descText); descTextScroller.setContent(descText); instrText2 = new StyledText(helpBox, SWT.READ_ONLY | SWT.WRAP); instrText2.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); instrText2.setDoubleClickEnabled(false); instrText2.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false, 1, 1)); instrText2.setAlignment(SWT.LEFT); instrText2.setText(Messages.Mode_Set_1); instrText3 = new StyledText(helpBox, SWT.READ_ONLY | SWT.WRAP); instrText3.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); instrText3.setDoubleClickEnabled(false); instrText3.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false, 1, 1)); instrText3.setAlignment(SWT.LEFT); instrText3.setText(Messages.Mode_Set_1); }
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(controlBox, -6); fd_headingBox.left = new FormAttachment(0); fd_headingBox.right = new FormAttachment(100); fd_headingBox.top = new FormAttachment(0); headingBox.setLayoutData(fd_headingBox); controlBox.setLayout(new FormLayout()); final FormData fd_controlBox = new FormData(-1, -1); fd_controlBox.top = new FormAttachment(0, 79); fd_controlBox.bottom = new FormAttachment(helpBox, -6); fd_controlBox.right = new FormAttachment(centerbox, -6); fd_controlBox.left = new FormAttachment(0); controlBox.setLayoutData(fd_controlBox); GridLayout gl_optionbox = new GridLayout(); gl_optionbox.marginWidth = 10; gl_optionbox.marginHeight = 10; gl_optionbox.makeColumnsEqualWidth = true; optionbox.setLayout(gl_optionbox); final FormData fdOb = new FormData(-1, -1); fdOb.left = new FormAttachment(0, 10); fdOb.top = new FormAttachment(0); optionbox.setLayoutData(fdOb); btnSave = new Button(controlBox, SWT.NONE); FormData fd_btnSave = new FormData(); fd_btnSave.top = new FormAttachment(optionbox, 6); fd_btnSave.right = new FormAttachment(optionbox, 0, SWT.RIGHT); fd_btnSave.left = new FormAttachment(optionbox, 0, SWT.LEFT); fd_btnSave.height = 30; fd_btnSave.width = 80; btnSave.setLayoutData(fd_btnSave); btnSave.setText(Messages.AndroidUnlockPattern_ButtonSaveText); btnSave.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND)); btnCancel = new Button(controlBox, SWT.NONE); btnCancel.setEnabled(false); btnCancel.setToolTipText(Messages.AndroidUnlockPattern_btnCancel_toolTipText); FormData fd_btnCancel = new FormData(); fd_btnCancel.top = new FormAttachment(btnSave, 6); fd_btnCancel.right = new FormAttachment(optionbox, 0, SWT.RIGHT); fd_btnCancel.left = new FormAttachment(optionbox, 0, SWT.LEFT); fd_btnCancel.width = 80; fd_btnCancel.height = 30; btnCancel.setLayoutData(fd_btnCancel); btnCancel.setText(Messages.AndroidUnlockPattern_ButtonCancelText); final GridLayout clayout = new GridLayout(3, false); clayout.marginLeft = 10; clayout.marginRight = 10; clayout.marginTop = 10; clayout.horizontalSpacing = 15; clayout.verticalSpacing = 15; centerbox.setLayout(clayout); final FormData fdCb = new FormData(0, -1); fdCb.top = new FormAttachment(headingBox, 6); fdCb.bottom = new FormAttachment(helpBox, -6); fdCb.left = new FormAttachment(0, 156); fdCb.right = new FormAttachment(100, -10); centerbox.setLayoutData(fdCb); Label heading = new Label(headingBox, SWT.NONE); heading.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); heading.setFont(FontService.getHeaderFont()); FormData fd_heading = new FormData(); fd_heading.top = new FormAttachment(0, 10); fd_heading.left = new FormAttachment(0, 10); heading.setLayoutData(fd_heading); heading.setText(Messages.AndroidUnlockPattern_Heading); Text lblHeaderInfoText = new Text(headingBox, SWT.MULTI SWT.WRAP SWT.READ_ONLY); lblHeaderInfoText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); FormData fd_lblHeaderInfoText = new FormData(); fd_lblHeaderInfoText.right = new FormAttachment(heading, 120, SWT.RIGHT); fd_lblHeaderInfoText.bottom = new FormAttachment(100, -16); fd_lblHeaderInfoText.top = new FormAttachment(heading, 5); fd_lblHeaderInfoText.left = new FormAttachment(heading, 0, SWT.LEFT); lblHeaderInfoText.setLayoutData(fd_lblHeaderInfoText); lblHeaderInfoText.setText(Messages.AndroidUnlockPattern_HeadingInfoText); GridLayout gl_helpBox = new GridLayout(2, true); gl_helpBox.horizontalSpacing = 25; helpBox.setLayout(gl_helpBox); final FormData fd_helpBox = new FormData(180, -1); fd_helpBox.top = new FormAttachment(100, -164); fd_helpBox.bottom = new FormAttachment(100, -10); fd_helpBox.left = new FormAttachment(0, 10); fd_helpBox.right = new FormAttachment(100, -10); helpBox.setLayoutData(fd_helpBox); instrTextHeading = new Label(helpBox, SWT.READ_ONLY SWT.WRAP); instrTextHeading.setText(Messages.AndroidUnlockPattern_helpBox_instrText_Heading); descTextHeading = new Label(helpBox, SWT.READ_ONLY SWT.WRAP); descTextHeading.setText(Messages.AndroidUnlockPattern_helpBox_descText_Heading); instrText1 = new StyledText(helpBox, SWT.READ_ONLY SWT.WRAP); instrText1.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); instrText1.setDoubleClickEnabled(false); instrText1.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false, 1, 1)); instrText1.setAlignment(SWT.LEFT); instrText1.setText(Messages.Mode_Set_1); descTextScroller = new ScrolledComposite(helpBox, SWT.V_SCROLL); descTextScroller.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true, 1, 3)); descTextScroller.setExpandHorizontal(true); descTextScroller.setExpandVertical(true); descText = new StyledText(descTextScroller, SWT.READ_ONLY SWT.WRAP); descText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); descText.setDoubleClickEnabled(false); descText.setText(Messages.AndroidUnlockPattern_helpBox_descText); descTextScroller.setContent(descText); instrText2 = new StyledText(helpBox, SWT.READ_ONLY SWT.WRAP); instrText2.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); instrText2.setDoubleClickEnabled(false); instrText2.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false, 1, 1)); instrText2.setAlignment(SWT.LEFT); instrText2.setText(Messages.Mode_Set_1); instrText3 = new StyledText(helpBox, SWT.READ_ONLY SWT.WRAP); instrText3.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); instrText3.setDoubleClickEnabled(false); instrText3.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false, 1, 1)); instrText3.setAlignment(SWT.LEFT); instrText3.setText(Messages.Mode_Set_1); }
/** * 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", "org.eclipse.swt.widgets.Display", "org.eclipse.swt.widgets.Label", "org.eclipse.swt.widgets.Text", "org.eclipse.wb.swt.SWTResourceManager", "org.jcryptool.core.util.fonts.FontService" ]
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.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; import org.eclipse.wb.swt.SWTResourceManager; import org.jcryptool.core.util.fonts.FontService;
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 (root.getNodeType() != Node.ELEMENT_NODE || !root.getLocalName().equals("Condition")) { throw new ParsingException("Can't create a Condition from a" + root.getLocalName() + " element" + (src != null ? src.getLocationMsgForError() : "")); } if (metaData.getXACMLVersion() < Constants.XACML_VERSION_2_0) { Apply apply = Apply.getConditionInstance(root, metaData.getXPathIdentifier(), manager); Condition cond = new Condition(apply.getFunction(), apply.getChildren(), src); if ( src != null ) { src.setXACMLObject(cond); } return cond; } Expression xpr = null; NodeList nodes = root.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { if (nodes.item(i).getNodeType() == Node.ELEMENT_NODE) { xpr = ExpressionHandler. parseExpression(nodes.item(i), metaData, manager); break; } } Condition cond = new Condition(xpr); if ( src != null ) { cond.src = src; src.setXACMLObject(cond); } return cond; }
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() + STR + (src != null ? src.getLocationMsgForError() : "")); } if (metaData.getXACMLVersion() < Constants.XACML_VERSION_2_0) { Apply apply = Apply.getConditionInstance(root, metaData.getXPathIdentifier(), manager); Condition cond = new Condition(apply.getFunction(), apply.getChildren(), src); if ( src != null ) { src.setXACMLObject(cond); } return cond; } Expression xpr = null; NodeList nodes = root.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { if (nodes.item(i).getNodeType() == Node.ELEMENT_NODE) { xpr = ExpressionHandler. parseExpression(nodes.item(i), metaData, manager); break; } } Condition cond = new Condition(xpr); if ( src != null ) { cond.src = src; src.setXACMLObject(cond); } return cond; }
/** * 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 * and definitions while parsing * * @return The instance of the condition. * * @throws ParsingException if this is not a valid ConditionType */
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 FilePosition(line, index); } }
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.forEachElement((r, c) -> { final int index = r * columns + c; result.elements[index] = operation.apply(elements[index], other.elements[index]); }); return result; }
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 * columns + c; result.elements[index] = operation.apply(elements[index], other.elements[index]); }); return result; }
/** * 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 amount of rows of the argument * @return A new matrix - The result */
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) { objects = (Collection<Object>) object; }
@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 BufferedWriter(new FileWriter(file))); for (int i = 0; i < lines.size(); i++) { out.println(lines.get(i)); } } catch (IOException e) { throw new FileOperationException(ERROR_CODE_FILENOTREAD, e); } finally { if (out != null) { out.flush(); out.close(); } } }
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 < lines.size(); i++) { out.println(lines.get(i)); } } catch (IOException e) { throw new FileOperationException(ERROR_CODE_FILENOTREAD, e); } finally { if (out != null) { out.flush(); out.close(); } } }
/** * 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.getOctets()); } catch (ClassCastException e) { throw new IllegalArgumentException(octs.elementAt(i).getClass().getName() + " found in input should only contain DEROctetString"); } catch (IOException e) { throw new IllegalArgumentException("exception converting octets " + e.toString()); } } return bOut.toByteArray(); } private Vector octs; public BERConstructedOctetString( byte[] string) { super(string); } public BERConstructedOctetString( Vector octs) { super(toBytes(octs)); this.octs = octs; } public BERConstructedOctetString( DERObject obj) { super(obj); } public BERConstructedOctetString( DEREncodable obj) { super(obj.getDERObject()); }
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().getName() + STR); } catch (IOException e) { throw new IllegalArgumentException(STR + e.toString()); } } return bOut.toByteArray(); } private Vector octs; public BERConstructedOctetString( byte[] string) { super(string); } public BERConstructedOctetString( Vector octs) { super(toBytes(octs)); this.octs = octs; } public BERConstructedOctetString( DERObject obj) { super(obj); } public BERConstructedOctetString( DEREncodable obj) { super(obj.getDERObject()); }
/** * 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.getLayoutParameters()).append("\n"); res.append(pair("display_edge_labels", gd.displayEdgeLabels(), 1)); res.append(pair("late_edge_labels", gd.lateEdgeLabels(), 1)); res.append(pair("portsharing", gd.portSharing(), 1)); res.append(pair("node.width", gd.defaultNodeWidth(), 1)); res.append(pair("node.color", gd.defaultNodeColor(), 1)); res.append(pair("node.borderwidth", gd.defaultBorderWidth(), 1)); res.append(pair("edge.linestyle", gd.defaultEdgeStyle(), 1)); String[] eClasses = gd.getEdgeClasses(); if (eClasses != null) { for (int i = 0; i < eClasses.length; i++) { res.append(pair("classname " + i, quote(eClasses[i]), 1)); } res.append("\n"); } String[] eColors = gd.getEdgeColors(); Hashtable<OPT_VisNode, String> nodeNames = new Hashtable<OPT_VisNode, String>(); int nodenum = 0; for (Enumeration<OPT_VCGNode> nodes = g.nodes(); nodes.hasMoreElements();) { OPT_VCGNode node = nodes.nextElement(); OPT_VCGNode.NodeDesc nd = node.getVCGDescriptor(); res.append(indent("node: {", 1)); String name = nodeNames.get(node); if (name == null) { name = "Node " + (nodenum++); nodeNames.put(node, name); } res.append(pair("title", quote(name), 1)); String label = nd.getLabel(); if (label != null) res.append(pair("label", quote(label), 2)); String info1 = nd.getInfo1(); if (info1 != null) res.append(pair("info1", quote(info1), 2)); String info2 = nd.getInfo2(); if (info2 != null) res.append(pair("info2", quote(info2), 2)); String info3 = nd.getInfo3(); if (info3 != null) res.append(pair("info3", quote(info3), 2)); String shape = nd.getShape(); if (shape != null) res.append(pair("shape", shape, 2)); String color = nd.getColor(); if (color != null) res.append(pair("color", color, 2)); int bwidth = nd.getBorderWidth(); if (bwidth != 1) res.append(pair("borderwidth", bwidth, 2)); res.append(indent("}", 1)); res.append("\n"); for (Enumeration<OPT_VisEdge> edges = node.edges(); edges.hasMoreElements();) { OPT_VCGEdge edge = (OPT_VCGEdge) edges.nextElement(); OPT_VCGEdge.EdgeDesc ed = edge.getVCGDescriptor(); String eName = edge.backEdge() ? "backedge" : "edge"; res.append(indent(eName + ": {", 1)); OPT_VisNode fromNode = edge.sourceNode(); String fromName = nodeNames.get(fromNode); if (fromName == null) { fromName = "Node " + (nodenum++); nodeNames.put(fromNode, fromName); } res.append(pair("sourcename", quote(fromName), 2)); OPT_VisNode toNode = edge.targetNode(); String toName = nodeNames.get(toNode); if (toName == null) { toName = "Node " + (nodenum++); nodeNames.put(toNode, toName); } res.append(pair("targetname", quote(toName), 2)); String eLabel = ed.getLabel(); if (eLabel != null) res.append(pair("label", quote(eLabel), 2)); int type = ed.getType(); String eColor = ed.getColor(); if (type != NONE) { res.append(pair("class", type, 2)); if (eColor == null && eColors != null) eColor = eColors[type]; } if (eColor != null) res.append(pair("color", eColor, 2)); int thickness = ed.getThickness(); if (thickness != 1) res.append(pair("thickness", thickness, 2)); String linestyle = ed.getStyle(); if (linestyle != null) res.append(pair("linestyle", linestyle, 2)); res.append(indent("}", 1)); res.append("\n"); } } res.append("}\n"); return res.toString(); }
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.displayEdgeLabels(), 1)); res.append(pair(STR, gd.lateEdgeLabels(), 1)); res.append(pair(STR, gd.portSharing(), 1)); res.append(pair(STR, gd.defaultNodeWidth(), 1)); res.append(pair(STR, gd.defaultNodeColor(), 1)); res.append(pair(STR, gd.defaultBorderWidth(), 1)); res.append(pair(STR, gd.defaultEdgeStyle(), 1)); String[] eClasses = gd.getEdgeClasses(); if (eClasses != null) { for (int i = 0; i < eClasses.length; i++) { res.append(pair(STR + i, quote(eClasses[i]), 1)); } res.append("\n"); } String[] eColors = gd.getEdgeColors(); Hashtable<OPT_VisNode, String> nodeNames = new Hashtable<OPT_VisNode, String>(); int nodenum = 0; for (Enumeration<OPT_VCGNode> nodes = g.nodes(); nodes.hasMoreElements();) { OPT_VCGNode node = nodes.nextElement(); OPT_VCGNode.NodeDesc nd = node.getVCGDescriptor(); res.append(indent(STR, 1)); String name = nodeNames.get(node); if (name == null) { name = STR + (nodenum++); nodeNames.put(node, name); } res.append(pair("title", quote(name), 1)); String label = nd.getLabel(); if (label != null) res.append(pair("label", quote(label), 2)); String info1 = nd.getInfo1(); if (info1 != null) res.append(pair("info1", quote(info1), 2)); String info2 = nd.getInfo2(); if (info2 != null) res.append(pair("info2", quote(info2), 2)); String info3 = nd.getInfo3(); if (info3 != null) res.append(pair("info3", quote(info3), 2)); String shape = nd.getShape(); if (shape != null) res.append(pair("shape", shape, 2)); String color = nd.getColor(); if (color != null) res.append(pair("color", color, 2)); int bwidth = nd.getBorderWidth(); if (bwidth != 1) res.append(pair(STR, bwidth, 2)); res.append(indent("}", 1)); res.append("\n"); for (Enumeration<OPT_VisEdge> edges = node.edges(); edges.hasMoreElements();) { OPT_VCGEdge edge = (OPT_VCGEdge) edges.nextElement(); OPT_VCGEdge.EdgeDesc ed = edge.getVCGDescriptor(); String eName = edge.backEdge() ? STR : "edge"; res.append(indent(eName + STR, 1)); OPT_VisNode fromNode = edge.sourceNode(); String fromName = nodeNames.get(fromNode); if (fromName == null) { fromName = STR + (nodenum++); nodeNames.put(fromNode, fromName); } res.append(pair(STR, quote(fromName), 2)); OPT_VisNode toNode = edge.targetNode(); String toName = nodeNames.get(toNode); if (toName == null) { toName = STR + (nodenum++); nodeNames.put(toNode, toName); } res.append(pair(STR, quote(toName), 2)); String eLabel = ed.getLabel(); if (eLabel != null) res.append(pair("label", quote(eLabel), 2)); int type = ed.getType(); String eColor = ed.getColor(); if (type != NONE) { res.append(pair("class", type, 2)); if (eColor == null && eColors != null) eColor = eColors[type]; } if (eColor != null) res.append(pair("color", eColor, 2)); int thickness = ed.getThickness(); if (thickness != 1) res.append(pair(STR, thickness, 2)); String linestyle = ed.getStyle(); if (linestyle != null) res.append(pair(STR, linestyle, 2)); res.append(indent("}", 1)); res.append("\n"); } } res.append("}\n"); return res.toString(); }
/** * 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 operations. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an action group resource. */
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 (regEx == null) { assert false; throw new NotAvailableException("Regular expression is null!"); } List<Method> methods = new ArrayList<>(); Pattern pattern = (patternFlag == 0) ? Pattern.compile(regEx) : Pattern.compile(regEx, patternFlag); for (Method method : inputClass.getMethods()) { Matcher matcher = pattern.matcher(method.getName()); if (matcher.find()) { methods.add(method); } } if (methods.size() == 1) { return methods.get(0); } else if (methods.size() >= 2) { String exceptionInfo = "There are more than one matching methods, which contains the regular expression: " + regEx + ". Method names are: "; for (Method method : methods) { exceptionInfo += method.getName() + ", "; } throw new NoSuchMethodException(exceptionInfo); } else { throw new NoSuchMethodException("There is no matching method with regular expression: " + regEx); } } catch (NoSuchMethodException | NotAvailableException ex) { throw new CouldNotPerformException("Could not get method!", ex); } }
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 ArrayList<>(); Pattern pattern = (patternFlag == 0) ? Pattern.compile(regEx) : Pattern.compile(regEx, patternFlag); for (Method method : inputClass.getMethods()) { Matcher matcher = pattern.matcher(method.getName()); if (matcher.find()) { methods.add(method); } } if (methods.size() == 1) { return methods.get(0); } else if (methods.size() >= 2) { String exceptionInfo = STR + regEx + STR; for (Method method : methods) { exceptionInfo += method.getName() + STR; } throw new NoSuchMethodException(exceptionInfo); } else { throw new NoSuchMethodException(STR + regEx); } } catch (NoSuchMethodException NotAvailableException ex) { throw new CouldNotPerformException(STR, ex); } }
/** * 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 matching radius (e.g. Pattern.CASE_INSENSITIVE). Set to 0 if not necessary. * @return the matched method object. * @throws CouldNotPerformException is thrown in case the input is null or the method could not explicit detected, because of no matching method or more * than one matching methods. */
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 #sendMessage(PrivateMessage) */
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(); // KeepAliveManager should stop using the scheduler after onTransportTermination gets called. scheduler = SharedResourceHolder.release(TIMER_SERVICE, scheduler); } if (ping != null) { ping.failed(getPingFailure()); ping = null; } if (!goAwaySent) { // Send GOAWAY with lastGoodStreamId of 0, since we don't expect any server-initiated // streams. The GOAWAY is part of graceful shutdown. goAwaySent = true; frameWriter.goAway(0, ErrorCode.NO_ERROR, new byte[0]); } // We will close the underlying socket in the writing thread to break out the reader // thread, which will close the frameReader and notify the listener. frameWriter.close(); }
@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 (ping != null) { ping.failed(getPingFailure()); ping = null; } if (!goAwaySent) { goAwaySent = true; frameWriter.goAway(0, ErrorCode.NO_ERROR, new byte[0]); } frameWriter.close(); }
/** * 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 index = hash & (table.length() - 1); ReferenceEntry<K, V> first = table.get(index); // Look for an existing entry. for (e = first; e != null; e = e.getNext()) { K entryKey = e.getKey(); if (e.getHash() == hash && entryKey != null && map.keyEquivalence.equivalent(key, entryKey)) { // We found an existing entry. ValueReference<K, V> valueReference = e.getValueReference(); if (valueReference.isLoading()) { // refresh is a no-op if loading is pending return null; } // continue returning old value while loading ++modCount; LoadingValueReference<K, V> loadingValueReference = new LoadingValueReference<K, V>(valueReference); e.setValueReference(loadingValueReference); return loadingValueReference; } } ++modCount; LoadingValueReference<K, V> loadingValueReference = new LoadingValueReference<K, V>(); e = newEntry(key, hash, first); e.setValueReference(loadingValueReference); table.set(index, e); return loadingValueReference; } finally { unlock(); postWriteCleanup(); } } // reference queues, for garbage collection cleanup
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 = table.get(index); for (e = first; e != null; e = e.getNext()) { K entryKey = e.getKey(); if (e.getHash() == hash && entryKey != null && map.keyEquivalence.equivalent(key, entryKey)) { ValueReference<K, V> valueReference = e.getValueReference(); if (valueReference.isLoading()) { return null; } ++modCount; LoadingValueReference<K, V> loadingValueReference = new LoadingValueReference<K, V>(valueReference); e.setValueReference(loadingValueReference); return loadingValueReference; } } ++modCount; LoadingValueReference<K, V> loadingValueReference = new LoadingValueReference<K, V>(); e = newEntry(key, hash, first); e.setValueReference(loadingValueReference); table.set(index, e); return loadingValueReference; } finally { unlock(); postWriteCleanup(); } }
/** * 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(input, _className); } catch (IOException e) { _parser.reportError(Constants.FATAL, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e)); return false; } }
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(); rateMessage("like",msg_id); Toast.makeText( this, "Ç øÞöïò óáò áðïèçêåýôçêå!", Toast.LENGTH_SHORT).show(); }
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, Toast.LENGTH_SHORT).show(); }
/** * 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 = m_previewFactoryRegistration.get(provider).getPreview(m_handler.m_galleryDialog); m_currentPreview.openPreview(resourcePath); m_handler.hideShowPreviewButton(false); } else { CmsDebugLog.getInstance().printLine( "Preview provider \"" + provider + "\" has not been registered properly."); } }
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_galleryDialog); m_currentPreview.openPreview(resourcePath); m_handler.hideShowPreviewButton(false); } else { CmsDebugLog.getInstance().printLine( STRSTR\STR); } }
/** * 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(); } return principal.toString(); }
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(JMXConnector.CREDENTIALS, creds); } env.put("com.sun.jndi.rmi.factory.socket", getRMIClientSocketFactory()); jmxc = JMXConnectorFactory.connect(jmxUrl, env); mbeanServerConn = jmxc.getMBeanServerConnection(); try { ObjectName name = new ObjectName(ssObjName); ssProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageServiceMBean.class); name = new ObjectName(MessagingService.MBEAN_NAME); msProxy = JMX.newMBeanProxy(mbeanServerConn, name, MessagingServiceMBean.class); name = new ObjectName(StreamManagerMBean.OBJECT_NAME); streamProxy = JMX.newMBeanProxy(mbeanServerConn, name, StreamManagerMBean.class); name = new ObjectName(CompactionManager.MBEAN_OBJECT_NAME); compactionProxy = JMX.newMBeanProxy(mbeanServerConn, name, CompactionManagerMBean.class); name = new ObjectName(FailureDetector.MBEAN_NAME); fdProxy = JMX.newMBeanProxy(mbeanServerConn, name, FailureDetectorMBean.class); name = new ObjectName(CacheService.MBEAN_NAME); cacheService = JMX.newMBeanProxy(mbeanServerConn, name, CacheServiceMBean.class); name = new ObjectName(StorageProxy.MBEAN_NAME); spProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageProxyMBean.class); name = new ObjectName(HintedHandOffManager.MBEAN_NAME); hhProxy = JMX.newMBeanProxy(mbeanServerConn, name, HintedHandOffManagerMBean.class); name = new ObjectName(GCInspector.MBEAN_NAME); gcProxy = JMX.newMBeanProxy(mbeanServerConn, name, GCInspectorMXBean.class); name = new ObjectName(Gossiper.MBEAN_NAME); gossProxy = JMX.newMBeanProxy(mbeanServerConn, name, GossiperMBean.class); name = new ObjectName(BatchlogManager.MBEAN_NAME); bmProxy = JMX.newMBeanProxy(mbeanServerConn, name, BatchlogManagerMBean.class); name = new ObjectName(ActiveRepairServiceMBean.MBEAN_NAME); arsProxy = JMX.newMBeanProxy(mbeanServerConn, name, ActiveRepairServiceMBean.class); } catch (MalformedObjectNameException e) { throw new RuntimeException( "Invalid ObjectName? Please report this as a bug.", e); } memProxy = ManagementFactory.newPlatformMXBeanProxy(mbeanServerConn, ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class); runtimeProxy = ManagementFactory.newPlatformMXBeanProxy( mbeanServerConn, ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class); }
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()); jmxc = JMXConnectorFactory.connect(jmxUrl, env); mbeanServerConn = jmxc.getMBeanServerConnection(); try { ObjectName name = new ObjectName(ssObjName); ssProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageServiceMBean.class); name = new ObjectName(MessagingService.MBEAN_NAME); msProxy = JMX.newMBeanProxy(mbeanServerConn, name, MessagingServiceMBean.class); name = new ObjectName(StreamManagerMBean.OBJECT_NAME); streamProxy = JMX.newMBeanProxy(mbeanServerConn, name, StreamManagerMBean.class); name = new ObjectName(CompactionManager.MBEAN_OBJECT_NAME); compactionProxy = JMX.newMBeanProxy(mbeanServerConn, name, CompactionManagerMBean.class); name = new ObjectName(FailureDetector.MBEAN_NAME); fdProxy = JMX.newMBeanProxy(mbeanServerConn, name, FailureDetectorMBean.class); name = new ObjectName(CacheService.MBEAN_NAME); cacheService = JMX.newMBeanProxy(mbeanServerConn, name, CacheServiceMBean.class); name = new ObjectName(StorageProxy.MBEAN_NAME); spProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageProxyMBean.class); name = new ObjectName(HintedHandOffManager.MBEAN_NAME); hhProxy = JMX.newMBeanProxy(mbeanServerConn, name, HintedHandOffManagerMBean.class); name = new ObjectName(GCInspector.MBEAN_NAME); gcProxy = JMX.newMBeanProxy(mbeanServerConn, name, GCInspectorMXBean.class); name = new ObjectName(Gossiper.MBEAN_NAME); gossProxy = JMX.newMBeanProxy(mbeanServerConn, name, GossiperMBean.class); name = new ObjectName(BatchlogManager.MBEAN_NAME); bmProxy = JMX.newMBeanProxy(mbeanServerConn, name, BatchlogManagerMBean.class); name = new ObjectName(ActiveRepairServiceMBean.MBEAN_NAME); arsProxy = JMX.newMBeanProxy(mbeanServerConn, name, ActiveRepairServiceMBean.class); } catch (MalformedObjectNameException e) { throw new RuntimeException( STR, e); } memProxy = ManagementFactory.newPlatformMXBeanProxy(mbeanServerConn, ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class); runtimeProxy = ManagementFactory.newPlatformMXBeanProxy( mbeanServerConn, ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class); }
/** * 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.management.remote.JMXConnector", "javax.management.remote.JMXConnectorFactory", "javax.management.remote.JMXServiceURL", "org.apache.cassandra.batchlog.BatchlogManager", "org.apache.cassandra.batchlog.BatchlogManagerMBean", "org.apache.cassandra.db.HintedHandOffManager", "org.apache.cassandra.db.HintedHandOffManagerMBean", "org.apache.cassandra.db.compaction.CompactionManager", "org.apache.cassandra.db.compaction.CompactionManagerMBean", "org.apache.cassandra.gms.FailureDetector", "org.apache.cassandra.gms.FailureDetectorMBean", "org.apache.cassandra.gms.Gossiper", "org.apache.cassandra.gms.GossiperMBean", "org.apache.cassandra.net.MessagingService", "org.apache.cassandra.net.MessagingServiceMBean", "org.apache.cassandra.service.ActiveRepairServiceMBean", "org.apache.cassandra.service.CacheService", "org.apache.cassandra.service.CacheServiceMBean", "org.apache.cassandra.service.GCInspector", "org.apache.cassandra.service.GCInspectorMXBean", "org.apache.cassandra.service.StorageProxy", "org.apache.cassandra.service.StorageProxyMBean", "org.apache.cassandra.service.StorageServiceMBean", "org.apache.cassandra.streaming.StreamManagerMBean" ]
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.ObjectName; import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXServiceURL; import org.apache.cassandra.batchlog.BatchlogManager; import org.apache.cassandra.batchlog.BatchlogManagerMBean; import org.apache.cassandra.db.HintedHandOffManager; import org.apache.cassandra.db.HintedHandOffManagerMBean; import org.apache.cassandra.db.compaction.CompactionManager; import org.apache.cassandra.db.compaction.CompactionManagerMBean; import org.apache.cassandra.gms.FailureDetector; import org.apache.cassandra.gms.FailureDetectorMBean; import org.apache.cassandra.gms.Gossiper; import org.apache.cassandra.gms.GossiperMBean; import org.apache.cassandra.net.MessagingService; import org.apache.cassandra.net.MessagingServiceMBean; import org.apache.cassandra.service.ActiveRepairServiceMBean; import org.apache.cassandra.service.CacheService; import org.apache.cassandra.service.CacheServiceMBean; import org.apache.cassandra.service.GCInspector; import org.apache.cassandra.service.GCInspectorMXBean; import org.apache.cassandra.service.StorageProxy; import org.apache.cassandra.service.StorageProxyMBean; import org.apache.cassandra.service.StorageServiceMBean; import org.apache.cassandra.streaming.StreamManagerMBean;
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.*; import org.apache.cassandra.service.*; import org.apache.cassandra.streaming.*;
[ "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</code> if valid or <code>null</code> if invalid. */
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()); } return strings; }
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> fieldsList = typeToFields.get(type); if (fieldsList == null) { fieldsList = Lists.newArrayList(); typeToFields.put(type, fieldsList); } fieldsList.add(field); } //ensure consistent ordering of fields for (Map.Entry<Type, List<String>> entry : typeToFields.entrySet()) { Type type = entry.getKey(); List<String> tempFields = entry.getValue(); Collections.sort(tempFields); Object2IntLinkedOpenHashMap<String> fieldToIndex = new Object2IntLinkedOpenHashMap<String>(); for (int index = 0; index < tempFields.size(); index++) { String field = tempFields.get(index); if (compressedTypes.contains(type)) { fieldToIndex.put(field, 0); } else { fieldToIndex.put(field, index); } } typeToFieldToIndex.put(type, fieldToIndex); } //Types if (!typeToFields.isEmpty()) { types = EnumSet.copyOf(typeToFields.keySet()); } else { types = Sets.newHashSet(); } //Types list typesList = Lists.newArrayList(); typesList.addAll(types); //Field List fieldList = Lists.newArrayList(); fieldList.addAll(fieldToType.keySet()); ((ArrayList<String>)fieldList).trimToSize(); Collections.sort(fieldList); //Array Sizes typeToSize = new Object2IntLinkedOpenHashMap<Type>(); for (Map.Entry<Type, List<String>> entry : typeToFields.entrySet()) { Type type = entry.getKey(); if (compressedTypes.contains(type)) { getTypeToSize().put(type, 1); } else { getTypeToSize().put(type, entry.getValue().size()); } } }
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.newArrayList(); typeToFields.put(type, fieldsList); } fieldsList.add(field); } for (Map.Entry<Type, List<String>> entry : typeToFields.entrySet()) { Type type = entry.getKey(); List<String> tempFields = entry.getValue(); Collections.sort(tempFields); Object2IntLinkedOpenHashMap<String> fieldToIndex = new Object2IntLinkedOpenHashMap<String>(); for (int index = 0; index < tempFields.size(); index++) { String field = tempFields.get(index); if (compressedTypes.contains(type)) { fieldToIndex.put(field, 0); } else { fieldToIndex.put(field, index); } } typeToFieldToIndex.put(type, fieldToIndex); } if (!typeToFields.isEmpty()) { types = EnumSet.copyOf(typeToFields.keySet()); } else { types = Sets.newHashSet(); } typesList = Lists.newArrayList(); typesList.addAll(types); fieldList = Lists.newArrayList(); fieldList.addAll(fieldToType.keySet()); ((ArrayList<String>)fieldList).trimToSize(); Collections.sort(fieldList); typeToSize = new Object2IntLinkedOpenHashMap<Type>(); for (Map.Entry<Type, List<String>> entry : typeToFields.entrySet()) { Type type = entry.getKey(); if (compressedTypes.contains(type)) { getTypeToSize().put(type, 1); } else { getTypeToSize().put(type, entry.getValue().size()); } } }
/** * 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 = null; }
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 grant membership (e.g. "user@host.org"). * @throws XMPPException if an error occurs granting membership to a user. */
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 cross platform look and feel", e); } }
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 IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (registryNameCheckRequest == null) { return Mono .error( new IllegalArgumentException("Parameter registryNameCheckRequest is required and cannot be null.")); } else { registryNameCheckRequest.validate(); } final String apiVersion = "2021-09-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service .checkNameAvailability( this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), registryNameCheckRequest, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); }
@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 IllegalArgumentException( STR)); } if (registryNameCheckRequest == null) { return Mono .error( new IllegalArgumentException(STR)); } else { registryNameCheckRequest.validate(); } final String apiVersion = STR; final String accept = STR; return FluxUtil .withContext( context -> service .checkNameAvailability( this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), registryNameCheckRequest, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); }
/** * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to check the availability of a container registry name. */
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.RegistryNameCheckRequest" ]
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.RegistryNameCheckRequest;
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. * * @return Trades object representing all OrdersMatched trades recieved. * @throws ExchangeException if watchOrders method has not been called. */
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; private boolean isProgressDisplayed = false; Task(String componentTag, String taskTag, Handler handler, TaskRunnable taskRunnable, Callback callback) { this.componentTag = componentTag; this.taskTag = taskTag; this.handler = handler; this.taskRunnable = taskRunnable; this.callback = callback; } /** * Execute task * * @param executor executor for task * @param request Request from {@link ContextTaskExecutor#executeTask(String, String, Object, TaskRunnable)}
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; Task(String componentTag, String taskTag, Handler handler, TaskRunnable taskRunnable, Callback callback) { this.componentTag = componentTag; this.taskTag = taskTag; this.handler = handler; this.taskRunnable = taskRunnable; this.callback = callback; } /** * Execute task * * @param executor executor for task * @param request Request from {@link ContextTaskExecutor#executeTask(String, String, Object, TaskRunnable)}
/** * 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(administrativeUnitId, body, context).block(); }
@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 parameters fail the validation. * @throws OdataErrorMainException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return scopedRoleMembership. */
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