method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
private void compileOffsets(InputStream in) { BufferedReader reader = null; try{ reader = new BufferedReader(new InputStreamReader(in)); ArrayList<Integer> lines = new ArrayList<Integer>(); lines.add(new Integer(0)); ArrayList<String> byteLines = new ArrayList<String>(); byteLines.add(null); int offset = 0; String line = null; while((line = reader.readLine()) != null){ offset += line.length(); lines.add(new Integer(offset)); if (line.length() != line.getBytes().length){ byteLines.add(line); }else{ byteLines.add(null); } } offsets = (Integer[])lines.toArray(new Integer[lines.size()]); multiByteLines = (String[])byteLines.toArray(new String[byteLines.size()]); }catch(Exception e){ throw new RuntimeException(e); }finally{ IOUtils.closeQuietly(reader); } }
void function(InputStream in) { BufferedReader reader = null; try{ reader = new BufferedReader(new InputStreamReader(in)); ArrayList<Integer> lines = new ArrayList<Integer>(); lines.add(new Integer(0)); ArrayList<String> byteLines = new ArrayList<String>(); byteLines.add(null); int offset = 0; String line = null; while((line = reader.readLine()) != null){ offset += line.length(); lines.add(new Integer(offset)); if (line.length() != line.getBytes().length){ byteLines.add(line); }else{ byteLines.add(null); } } offsets = (Integer[])lines.toArray(new Integer[lines.size()]); multiByteLines = (String[])byteLines.toArray(new String[byteLines.size()]); }catch(Exception e){ throw new RuntimeException(e); }finally{ IOUtils.closeQuietly(reader); } }
/** * Reads the supplied input stream and compiles a list of offsets. * * @param in The InputStream to compile a list of offsets for. */
Reads the supplied input stream and compiles a list of offsets
compileOffsets
{ "repo_name": "euclio/eclim", "path": "org.eclim/java/org/eclim/util/file/FileOffsets.java", "license": "gpl-3.0", "size": 4994 }
[ "java.io.InputStream", "java.io.InputStreamReader", "java.util.ArrayList", "org.eclim.util.IOUtils" ]
import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import org.eclim.util.IOUtils;
import java.io.*; import java.util.*; import org.eclim.util.*;
[ "java.io", "java.util", "org.eclim.util" ]
java.io; java.util; org.eclim.util;
2,163,770
@ServiceMethod(returns = ReturnType.SINGLE) public SensitivityLabelInner get( String resourceGroupName, String managedInstanceName, String databaseName, String schemaName, String tableName, String columnName, SensitivityLabelSource sensitivityLabelSource) { return getAsync( resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource) .block(); }
@ServiceMethod(returns = ReturnType.SINGLE) SensitivityLabelInner function( String resourceGroupName, String managedInstanceName, String databaseName, String schemaName, String tableName, String columnName, SensitivityLabelSource sensitivityLabelSource) { return getAsync( resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource) .block(); }
/** * Gets the sensitivity label of a given column. * * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value * from the Azure Resource Manager API or the portal. * @param managedInstanceName The name of the managed instance. * @param databaseName The name of the database. * @param schemaName The name of the schema. * @param tableName The name of the table. * @param columnName The name of the column. * @param sensitivityLabelSource The source of the sensitivity label. * @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 sensitivity label of a given column. */
Gets the sensitivity label of a given column
get
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/implementation/ManagedDatabaseSensitivityLabelsClientImpl.java", "license": "mit", "size": 102432 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.sql.fluent.models.SensitivityLabelInner", "com.azure.resourcemanager.sql.models.SensitivityLabelSource" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.sql.fluent.models.SensitivityLabelInner; import com.azure.resourcemanager.sql.models.SensitivityLabelSource;
import com.azure.core.annotation.*; import com.azure.resourcemanager.sql.fluent.models.*; import com.azure.resourcemanager.sql.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,508,068
public void run() { try { switch ( message.getType() ) { case Message.QUERY_REQUEST : QueryRequest queryRequest = ( QueryRequest )message; processQueryRequest( queryRequest ); break; case Message.EXECUTE_QUERY_REQUEST : ExecuteQueryRequest executeQueryRequest = ( ExecuteQueryRequest )message; processExecuteQueryRequest( executeQueryRequest ); break; case Message.NEXT_VALUES_REQUEST : NextValuesRequest nextValuesRequest = ( NextValuesRequest )message; processNextValuesRequest( nextValuesRequest ); break; case Message.CLOSE_REQUEST : CloseRequest closeRequest = ( CloseRequest )message; processCloseRequest( closeRequest ); break; default: throw new UDPDriverServerException( "Message is not conformed." ); } } catch( Exception e ) { logger.logException( GDBMessages.NETDRIVER_SERVER_INTERRUPTED_ERROR, "RunnableWorker Interrupted End." , e ); } }
void function() { try { switch ( message.getType() ) { case Message.QUERY_REQUEST : QueryRequest queryRequest = ( QueryRequest )message; processQueryRequest( queryRequest ); break; case Message.EXECUTE_QUERY_REQUEST : ExecuteQueryRequest executeQueryRequest = ( ExecuteQueryRequest )message; processExecuteQueryRequest( executeQueryRequest ); break; case Message.NEXT_VALUES_REQUEST : NextValuesRequest nextValuesRequest = ( NextValuesRequest )message; processNextValuesRequest( nextValuesRequest ); break; case Message.CLOSE_REQUEST : CloseRequest closeRequest = ( CloseRequest )message; processCloseRequest( closeRequest ); break; default: throw new UDPDriverServerException( STR ); } } catch( Exception e ) { logger.logException( GDBMessages.NETDRIVER_SERVER_INTERRUPTED_ERROR, STR , e ); } }
/** * Process the message. */
Process the message
run
{ "repo_name": "gaiandb/gaiandb", "path": "java/Prototype/UDPDriver/com/ibm/gaiandb/udpdriver/server/RunnableWorker.java", "license": "epl-1.0", "size": 16730 }
[ "com.ibm.gaiandb.diags.GDBMessages", "com.ibm.gaiandb.udpdriver.common.protocol.CloseRequest", "com.ibm.gaiandb.udpdriver.common.protocol.ExecuteQueryRequest", "com.ibm.gaiandb.udpdriver.common.protocol.Message", "com.ibm.gaiandb.udpdriver.common.protocol.NextValuesRequest", "com.ibm.gaiandb.udpdriver.common.protocol.QueryRequest" ]
import com.ibm.gaiandb.diags.GDBMessages; import com.ibm.gaiandb.udpdriver.common.protocol.CloseRequest; import com.ibm.gaiandb.udpdriver.common.protocol.ExecuteQueryRequest; import com.ibm.gaiandb.udpdriver.common.protocol.Message; import com.ibm.gaiandb.udpdriver.common.protocol.NextValuesRequest; import com.ibm.gaiandb.udpdriver.common.protocol.QueryRequest;
import com.ibm.gaiandb.diags.*; import com.ibm.gaiandb.udpdriver.common.protocol.*;
[ "com.ibm.gaiandb" ]
com.ibm.gaiandb;
1,951,789
Map<String, Object> getDatabaseValues(E entityInstance);
Map<String, Object> getDatabaseValues(E entityInstance);
/** * Get the database values from a given entity instance. * * @param entityInstance - The entity instance * @return - The database values. The key is the column name and the value is the database value. */
Get the database values from a given entity instance
getDatabaseValues
{ "repo_name": "molcikas/photon", "path": "photon-core/src/main/java/com/github/molcikas/photon/blueprints/entity/CompoundEntityFieldValueMapping.java", "license": "mit", "size": 1170 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
312,943
// TODO: Deprecate public static <T> Document loadDoc(Class<T> clazz, String xmlPath, String xsdPath) { Document ret = loadDoc(clazz, xmlPath); if (!XMLUtil.xmlIsValid(ret, clazz, xsdPath)) { Logger.getLogger(clazz.getName()).log(Level.WARNING, "Error loading XML file: could not validate against [{0}], results may not be accurate", xsdPath); //NON-NLS } return ret; }
static <T> Document function(Class<T> clazz, String xmlPath, String xsdPath) { Document ret = loadDoc(clazz, xmlPath); if (!XMLUtil.xmlIsValid(ret, clazz, xsdPath)) { Logger.getLogger(clazz.getName()).log(Level.WARNING, STR, xsdPath); } return ret; }
/** * Loads XML files from disk * * @param clazz the class this method is invoked from * @param xmlPath the full path to the file to load * @param xsdPath the full path to the file to validate against */
Loads XML files from disk
loadDoc
{ "repo_name": "dgrove727/autopsy", "path": "Core/src/org/sleuthkit/autopsy/coreutils/XMLUtil.java", "license": "apache-2.0", "size": 13126 }
[ "java.util.logging.Level", "org.w3c.dom.Document" ]
import java.util.logging.Level; import org.w3c.dom.Document;
import java.util.logging.*; import org.w3c.dom.*;
[ "java.util", "org.w3c.dom" ]
java.util; org.w3c.dom;
623,257
protected AuthenticatedURL.Token readAuthToken() { AuthenticatedURL.Token authToken = null; if (AUTH_TOKEN_CACHE_FILE.exists()) { try { BufferedReader reader = new BufferedReader(new FileReader(AUTH_TOKEN_CACHE_FILE)); String line = reader.readLine(); reader.close(); if (line != null) { authToken = new AuthenticatedURL.Token(line); } } catch (IOException ex) { //NOP } } return authToken; }
AuthenticatedURL.Token function() { AuthenticatedURL.Token authToken = null; if (AUTH_TOKEN_CACHE_FILE.exists()) { try { BufferedReader reader = new BufferedReader(new FileReader(AUTH_TOKEN_CACHE_FILE)); String line = reader.readLine(); reader.close(); if (line != null) { authToken = new AuthenticatedURL.Token(line); } } catch (IOException ex) { } } return authToken; }
/** * Read a authentication token cached in the user home directory. * <p/> * * @return the authentication token cached in the user home directory, NULL if none. */
Read a authentication token cached in the user home directory.
readAuthToken
{ "repo_name": "terrancesnyder/oozie-hadoop2", "path": "client/src/main/java/org/apache/oozie/client/AuthOozieClient.java", "license": "apache-2.0", "size": 11812 }
[ "java.io.BufferedReader", "java.io.FileReader", "java.io.IOException", "org.apache.hadoop.security.authentication.client.AuthenticatedURL" ]
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import org.apache.hadoop.security.authentication.client.AuthenticatedURL;
import java.io.*; import org.apache.hadoop.security.authentication.client.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
426,379
public static FileSystem login(final FileSystem fs, final Configuration conf, final UserGroupInformation ugi) throws IOException, InterruptedException { if (fs != null) { fs.close(); } return DFSTestUtil.getFileSystemAs(ugi, conf); }
static FileSystem function(final FileSystem fs, final Configuration conf, final UserGroupInformation ugi) throws IOException, InterruptedException { if (fs != null) { fs.close(); } return DFSTestUtil.getFileSystemAs(ugi, conf); }
/** * Close current file system and create a new instance as given * {@link UserGroupInformation}. */
Close current file system and create a new instance as given <code>UserGroupInformation</code>
login
{ "repo_name": "ronny-macmaster/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java", "license": "apache-2.0", "size": 85590 }
[ "java.io.IOException", "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.fs.FileSystem", "org.apache.hadoop.security.UserGroupInformation" ]
import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.security.UserGroupInformation;
import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.security.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
45,353
void enterArrayAccess_lfno_primary(@NotNull Java8Parser.ArrayAccess_lfno_primaryContext ctx); void exitArrayAccess_lfno_primary(@NotNull Java8Parser.ArrayAccess_lfno_primaryContext ctx);
void enterArrayAccess_lfno_primary(@NotNull Java8Parser.ArrayAccess_lfno_primaryContext ctx); void exitArrayAccess_lfno_primary(@NotNull Java8Parser.ArrayAccess_lfno_primaryContext ctx);
/** * Exit a parse tree produced by {@link Java8Parser#arrayAccess_lfno_primary}. * @param ctx the parse tree */
Exit a parse tree produced by <code>Java8Parser#arrayAccess_lfno_primary</code>
exitArrayAccess_lfno_primary
{ "repo_name": "IsThisThePayneResidence/intellidots", "path": "src/main/java/ua/edu/hneu/ast/parsers/Java8Listener.java", "license": "gpl-3.0", "size": 95845 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
608,426
public boolean resetImplicitPrototype( JSType type, ObjectType newImplicitProto) { if (type instanceof PrototypeObjectType) { PrototypeObjectType poType = (PrototypeObjectType) type; poType.clearCachedValues(); poType.setImplicitPrototype(newImplicitProto); return true; } return false; } /** * Creates a constructor function type. * @param name the function's name or {@code null} to indicate that the * function is anonymous. * @param source the node defining this function. Its type * ({@link Node#getType()}) must be {@link Token#FUNCTION}. * @param parameters the function's parameters or {@code null}
boolean function( JSType type, ObjectType newImplicitProto) { if (type instanceof PrototypeObjectType) { PrototypeObjectType poType = (PrototypeObjectType) type; poType.clearCachedValues(); poType.setImplicitPrototype(newImplicitProto); return true; } return false; } /** * Creates a constructor function type. * @param name the function's name or {@code null} to indicate that the * function is anonymous. * @param source the node defining this function. Its type * ({@link Node#getType()}) must be {@link Token#FUNCTION}. * @param parameters the function's parameters or {@code null}
/** * Set the implicit prototype if it's possible to do so. * @return True if we were able to set the implicit prototype successfully, * false if it was not possible to do so for some reason. There are * a few different reasons why this could fail: for example, numbers * can't be implicit prototypes, and we don't want to change the implicit * prototype if other classes have already subclassed this one. */
Set the implicit prototype if it's possible to do so
resetImplicitPrototype
{ "repo_name": "selkhateeb/closure-compiler", "path": "src/com/google/javascript/rhino/jstype/JSTypeRegistry.java", "license": "apache-2.0", "size": 66720 }
[ "com.google.javascript.rhino.Node", "com.google.javascript.rhino.Token" ]
import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
1,185,631
protected final void appendGeneratedAnnotation(JvmAnnotationTarget target, GenerationContext context) { appendGeneratedAnnotation(target, context, null); }
final void function(JvmAnnotationTarget target, GenerationContext context) { appendGeneratedAnnotation(target, context, null); }
/** Add the @Generated annotation to the given target. * The annotation will not have any generated SARL code associated to it. * * @param target - the target of the annotation. * @param context the generation context. */
Add the @Generated annotation to the given target. The annotation will not have any generated SARL code associated to it
appendGeneratedAnnotation
{ "repo_name": "gallandarakhneorg/sarl", "path": "eclipse-sarl/plugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java", "license": "apache-2.0", "size": 113698 }
[ "org.eclipse.xtext.common.types.JvmAnnotationTarget" ]
import org.eclipse.xtext.common.types.JvmAnnotationTarget;
import org.eclipse.xtext.common.types.*;
[ "org.eclipse.xtext" ]
org.eclipse.xtext;
969,946
public AmqpMessage receive(long timeout, TimeUnit unit) throws Exception { checkClosed(); return prefetch.poll(timeout, unit); }
AmqpMessage function(long timeout, TimeUnit unit) throws Exception { checkClosed(); return prefetch.poll(timeout, unit); }
/** * Attempts to receive a message sent to this receiver, waiting for the given * timeout value before giving up and returning null. * * @param timeout * the time to wait for a new message to arrive. * @param unit * the unit of time that the timeout value represents. * * @return a newly received message or null if the time to wait period expires. * * @throws Exception if an error occurs during the receive attempt. */
Attempts to receive a message sent to this receiver, waiting for the given timeout value before giving up and returning null
receive
{ "repo_name": "chirino/activemq", "path": "activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpReceiver.java", "license": "apache-2.0", "size": 37258 }
[ "java.util.concurrent.TimeUnit" ]
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
461,758
public Set<Tier> getTiers(String tenantDomain) throws APIManagementException { Set<Tier> tiers = new TreeSet<Tier>(new TierNameComparator()); Map<String, Tier> tierMap; if (!APIUtil.isAdvanceThrottlingEnabled()) { startTenantFlow(tenantDomain); int requestedTenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); if (requestedTenantId == MultitenantConstants.SUPER_TENANT_ID || requestedTenantId == MultitenantConstants.INVALID_TENANT_ID) { tierMap = APIUtil.getTiers(); } else { tierMap = APIUtil.getTiers(requestedTenantId); } tiers.addAll(tierMap.values()); endTenantFlow(); } else { tierMap = APIUtil.getTiersFromPolicies(PolicyConstants.POLICY_LEVEL_SUB, tenantId); tiers.addAll(tierMap.values()); } return tiers; }
Set<Tier> function(String tenantDomain) throws APIManagementException { Set<Tier> tiers = new TreeSet<Tier>(new TierNameComparator()); Map<String, Tier> tierMap; if (!APIUtil.isAdvanceThrottlingEnabled()) { startTenantFlow(tenantDomain); int requestedTenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); if (requestedTenantId == MultitenantConstants.SUPER_TENANT_ID requestedTenantId == MultitenantConstants.INVALID_TENANT_ID) { tierMap = APIUtil.getTiers(); } else { tierMap = APIUtil.getTiers(requestedTenantId); } tiers.addAll(tierMap.values()); endTenantFlow(); } else { tierMap = APIUtil.getTiersFromPolicies(PolicyConstants.POLICY_LEVEL_SUB, tenantId); tiers.addAll(tierMap.values()); } return tiers; }
/** * Returns a list of pre-defined # {@link org.wso2.carbon.apimgt.api.model.Tier} in the system. * * @return Set<Tier> */
Returns a list of pre-defined # <code>org.wso2.carbon.apimgt.api.model.Tier</code> in the system
getTiers
{ "repo_name": "pubudu538/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/AbstractAPIManager.java", "license": "apache-2.0", "size": 165292 }
[ "java.util.Map", "java.util.Set", "java.util.TreeSet", "org.wso2.carbon.apimgt.api.APIManagementException", "org.wso2.carbon.apimgt.api.model.Tier", "org.wso2.carbon.apimgt.api.model.policy.PolicyConstants", "org.wso2.carbon.apimgt.impl.utils.APIUtil", "org.wso2.carbon.apimgt.impl.utils.TierNameComparator", "org.wso2.carbon.context.PrivilegedCarbonContext", "org.wso2.carbon.utils.multitenancy.MultitenantConstants" ]
import java.util.Map; import java.util.Set; import java.util.TreeSet; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.model.Tier; import org.wso2.carbon.apimgt.api.model.policy.PolicyConstants; import org.wso2.carbon.apimgt.impl.utils.APIUtil; import org.wso2.carbon.apimgt.impl.utils.TierNameComparator; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
import java.util.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.api.model.policy.*; import org.wso2.carbon.apimgt.impl.utils.*; import org.wso2.carbon.context.*; import org.wso2.carbon.utils.multitenancy.*;
[ "java.util", "org.wso2.carbon" ]
java.util; org.wso2.carbon;
223,683
@SuppressWarnings({ "unchecked", "rawtypes" }) public void addCacheListener(CacheListener listener) { if (this.region != null) { this.region.getAttributesMutator().addCacheListener(listener); } }
@SuppressWarnings({ STR, STR }) void function(CacheListener listener) { if (this.region != null) { this.region.getAttributesMutator().addCacheListener(listener); } }
/** * Add a <code>CacheListener</code> to the queue. This method is NOT * THREAD-SAFE. * * @param listener * the <code>CacheListener</code> to add */
Add a <code>CacheListener</code> to the queue. This method is NOT THREAD-SAFE
addCacheListener
{ "repo_name": "papicella/snappy-store", "path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/internal/engine/ddl/GfxdDDLRegionQueue.java", "license": "apache-2.0", "size": 34837 }
[ "com.gemstone.gemfire.cache.CacheListener" ]
import com.gemstone.gemfire.cache.CacheListener;
import com.gemstone.gemfire.cache.*;
[ "com.gemstone.gemfire" ]
com.gemstone.gemfire;
2,229,636
public RequestOutputStream write(final String value) throws IOException { final ByteBuffer bytes = encoder.encode(CharBuffer.wrap(value)); super.write(bytes.array(), 0, bytes.limit()); return this; } }
RequestOutputStream function(final String value) throws IOException { final ByteBuffer bytes = encoder.encode(CharBuffer.wrap(value)); super.write(bytes.array(), 0, bytes.limit()); return this; } }
/** * Write string to stream * * @param value * @return this stream * @throws IOException */
Write string to stream
write
{ "repo_name": "h42i/Hasi-App", "path": "app/src/main/java/org/hasi/apps/hasi/HttpRequest.java", "license": "gpl-3.0", "size": 101719 }
[ "java.io.IOException", "java.nio.ByteBuffer", "java.nio.CharBuffer" ]
import java.io.IOException; import java.nio.ByteBuffer; import java.nio.CharBuffer;
import java.io.*; import java.nio.*;
[ "java.io", "java.nio" ]
java.io; java.nio;
2,513,950
public boolean canSupport(Properties startParams) { String modeParam = startParams.getProperty(MasterFactory.REPLICATION_MODE); // currently only one attribute: asynchronous replication mode if (modeParam != null && modeParam.equals(MasterFactory.ASYNCHRONOUS_MODE)) { return true; } else { return false; } }
boolean function(Properties startParams) { String modeParam = startParams.getProperty(MasterFactory.REPLICATION_MODE); if (modeParam != null && modeParam.equals(MasterFactory.ASYNCHRONOUS_MODE)) { return true; } else { return false; } }
/** * Used by Monitor.bootServiceModule to check if this class is * usable for replication. To be usable, we require that * asynchronous replication is specified in startParams by * checking that a property with key * MasterFactory.REPLICATION_MODE has the value * MasterFactory.ASYNCHRONOUS_MODE. * @param startParams The properties used to boot replication * @return true if asynchronous replication is requested, meaning * that this MasterController is a suitable implementation for the * MasterFactory service. False otherwise * @see ModuleSupportable#canSupport */
Used by Monitor.bootServiceModule to check if this class is usable for replication. To be usable, we require that asynchronous replication is specified in startParams by checking that a property with key MasterFactory.REPLICATION_MODE has the value MasterFactory.ASYNCHRONOUS_MODE
canSupport
{ "repo_name": "kavin256/Derby", "path": "java/engine/org/apache/derby/impl/store/replication/master/MasterController.java", "license": "apache-2.0", "size": 25319 }
[ "java.util.Properties", "org.apache.derby.iapi.store.replication.master.MasterFactory" ]
import java.util.Properties; import org.apache.derby.iapi.store.replication.master.MasterFactory;
import java.util.*; import org.apache.derby.iapi.store.replication.master.*;
[ "java.util", "org.apache.derby" ]
java.util; org.apache.derby;
2,834,973
Map<String, DataFormatDefinition> getDataFormats(); /** * Resolve a data format given its name * * @param name the data format name or a reference to it in the {@link Registry}
Map<String, DataFormatDefinition> getDataFormats(); /** * Resolve a data format given its name * * @param name the data format name or a reference to it in the {@link Registry}
/** * Gets the data formats that can be referenced in the routes. * * @return the data formats available */
Gets the data formats that can be referenced in the routes
getDataFormats
{ "repo_name": "jonmcewen/camel", "path": "camel-core/src/main/java/org/apache/camel/CamelContext.java", "license": "apache-2.0", "size": 79068 }
[ "java.util.Map", "org.apache.camel.model.DataFormatDefinition", "org.apache.camel.spi.Registry" ]
import java.util.Map; import org.apache.camel.model.DataFormatDefinition; import org.apache.camel.spi.Registry;
import java.util.*; import org.apache.camel.model.*; import org.apache.camel.spi.*;
[ "java.util", "org.apache.camel" ]
java.util; org.apache.camel;
1,031,354
if (StringUtils.isNotEmpty(source)) { if (LOG.isDebugEnabled()) { LOG.debug("Convert into a cron slot [" + source + "]"); } String[] values = source.split(":"); Assert.isTrue(values.length == 4, "Cron slot value must be of the format <name>:<workflowId>:<transition>:<cron>, value [" + source + "]"); return new CronSlot(values[0], values[1], values[2], values[3]); } return null; }
if (StringUtils.isNotEmpty(source)) { if (LOG.isDebugEnabled()) { LOG.debug(STR + source + "]"); } String[] values = source.split(":"); Assert.isTrue(values.length == 4, STR + source + "]"); return new CronSlot(values[0], values[1], values[2], values[3]); } return null; }
/** * Convert String into CronSlot, barfs if String split on ':' does not result in * at least two tokens. * * @param source String. * @return WorkflowTransitionWrapper. */
Convert String into CronSlot, barfs if String split on ':' does not result in at least two tokens
convert
{ "repo_name": "cucina/opencucina", "path": "engine/src/main/java/org/cucina/engine/converter/CronSlotConverter.java", "license": "apache-2.0", "size": 1264 }
[ "org.apache.commons.lang3.StringUtils", "org.cucina.engine.schedule.CronSlot", "org.springframework.util.Assert" ]
import org.apache.commons.lang3.StringUtils; import org.cucina.engine.schedule.CronSlot; import org.springframework.util.Assert;
import org.apache.commons.lang3.*; import org.cucina.engine.schedule.*; import org.springframework.util.*;
[ "org.apache.commons", "org.cucina.engine", "org.springframework.util" ]
org.apache.commons; org.cucina.engine; org.springframework.util;
915,669
private static SQLQuery setResultSetMetaData(IResultSetMetaData md, String sqlQueryText ) throws OdaException { SQLQuery query=null; ResultSetColumns columns = DesignSessionUtil.toResultSetColumnsDesign( md ); if ( columns != null ) { query=new SQLQuery(); ResultSetDefinition resultSetDefn = DesignFactory.eINSTANCE.createResultSetDefinition( ); resultSetDefn.setResultSetColumns( columns ); int count=resultSetDefn.getResultSetColumns().getResultColumnDefinitions().size(); query.setSqlQueryString(sqlQueryText); for (int i = 0; i < count; i++) { int columntype=-1; String columname=""; try { ResultSetMetaData dataset=(ResultSetMetaData)md; columname=dataset.getColumnName(i+1); columntype=dataset.getColumnType(i+1); } catch (Exception e) { return null; } query.setFields(columname, columntype); } } return query; }
static SQLQuery function(IResultSetMetaData md, String sqlQueryText ) throws OdaException { SQLQuery query=null; ResultSetColumns columns = DesignSessionUtil.toResultSetColumnsDesign( md ); if ( columns != null ) { query=new SQLQuery(); ResultSetDefinition resultSetDefn = DesignFactory.eINSTANCE.createResultSetDefinition( ); resultSetDefn.setResultSetColumns( columns ); int count=resultSetDefn.getResultSetColumns().getResultColumnDefinitions().size(); query.setSqlQueryString(sqlQueryText); for (int i = 0; i < count; i++) { int columntype=-1; String columname=""; try { ResultSetMetaData dataset=(ResultSetMetaData)md; columname=dataset.getColumnName(i+1); columntype=dataset.getColumnType(i+1); } catch (Exception e) { return null; } query.setFields(columname, columntype); } } return query; }
/** * Set the resultset metadata in dataset design * * @param dataSetDesign * @param md * @throws OdaException */
Set the resultset metadata in dataset design
setResultSetMetaData
{ "repo_name": "BIRT-eXperts/IBM-Maximo-BIRT-Code-Generator", "path": "src/com/mmkarton/mx7/reportgenerator/sqledit/SQLUtility.java", "license": "epl-1.0", "size": 7663 }
[ "com.mmkarton.mx7.reportgenerator.engine.SQLQuery", "com.mmkarton.mx7.reportgenerator.jdbc.ResultSetMetaData", "org.eclipse.datatools.connectivity.oda.IResultSetMetaData", "org.eclipse.datatools.connectivity.oda.OdaException", "org.eclipse.datatools.connectivity.oda.design.DesignFactory", "org.eclipse.datatools.connectivity.oda.design.ResultSetColumns", "org.eclipse.datatools.connectivity.oda.design.ResultSetDefinition", "org.eclipse.datatools.connectivity.oda.design.ui.designsession.DesignSessionUtil" ]
import com.mmkarton.mx7.reportgenerator.engine.SQLQuery; import com.mmkarton.mx7.reportgenerator.jdbc.ResultSetMetaData; import org.eclipse.datatools.connectivity.oda.IResultSetMetaData; import org.eclipse.datatools.connectivity.oda.OdaException; import org.eclipse.datatools.connectivity.oda.design.DesignFactory; import org.eclipse.datatools.connectivity.oda.design.ResultSetColumns; import org.eclipse.datatools.connectivity.oda.design.ResultSetDefinition; import org.eclipse.datatools.connectivity.oda.design.ui.designsession.DesignSessionUtil;
import com.mmkarton.mx7.reportgenerator.engine.*; import com.mmkarton.mx7.reportgenerator.jdbc.*; import org.eclipse.datatools.connectivity.oda.*; import org.eclipse.datatools.connectivity.oda.design.*; import org.eclipse.datatools.connectivity.oda.design.ui.designsession.*;
[ "com.mmkarton.mx7", "org.eclipse.datatools" ]
com.mmkarton.mx7; org.eclipse.datatools;
1,284,197
public GroupsGetInvitesQueryWithExtended getInvitesExtended(UserActor actor) { return new GroupsGetInvitesQueryWithExtended(getClient(), actor); }
GroupsGetInvitesQueryWithExtended function(UserActor actor) { return new GroupsGetInvitesQueryWithExtended(getClient(), actor); }
/** * Returns a list of invitations to join communities and events. */
Returns a list of invitations to join communities and events
getInvitesExtended
{ "repo_name": "kokorin/vk-java-sdk", "path": "sdk/src/main/java/com/vk/api/sdk/actions/Groups.java", "license": "mit", "size": 16597 }
[ "com.vk.api.sdk.client.actors.UserActor", "com.vk.api.sdk.queries.groups.GroupsGetInvitesQueryWithExtended" ]
import com.vk.api.sdk.client.actors.UserActor; import com.vk.api.sdk.queries.groups.GroupsGetInvitesQueryWithExtended;
import com.vk.api.sdk.client.actors.*; import com.vk.api.sdk.queries.groups.*;
[ "com.vk.api" ]
com.vk.api;
2,510,689
public void setFilter(final IFilter filter) { // Backup current caches list if it isn't backed up yet if (originalList == null) { originalList = new ArrayList<>(list); } // If there is already a filter in place, this is a request to change or clear the filter, so we have to // replace the original cache list if (currentFilter != null) { list.clear(); list.addAll(originalList); } // Do the filtering or clear it if (filter != null) { filter.filter(list); } currentFilter = filter; notifyDataSetChanged(); }
void function(final IFilter filter) { if (originalList == null) { originalList = new ArrayList<>(list); } if (currentFilter != null) { list.clear(); list.addAll(originalList); } if (filter != null) { filter.filter(list); } currentFilter = filter; notifyDataSetChanged(); }
/** * Called after a user action on the filter menu. */
Called after a user action on the filter menu
setFilter
{ "repo_name": "S-Bartfast/cgeo", "path": "main/src/cgeo/geocaching/ui/CacheListAdapter.java", "license": "apache-2.0", "size": 26985 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,398,799
protected void moveElements(int steps) { if (steps == 0) { return; } // We need to make each TimeView reflect a value that is -steps units // from its current value. As an optimization, we will see if this // value is already present in another child (by looking to see if there // is a child at an index -steps offset from the target child's index). // Since this method is most often called with steps equal to 1 or -1, // this is a valuable optimization. However, when doing this we need to // make sure that we don't overwrite the value of the other child before // we copy the value out. So, when steps is negative, we will be pulling // values from children with larger indexes and we want to iterate forwards. // When steps is positive, we will be pulling values from children with // smaller indexes, and we want to iterate backwards. int start; int end; int incr; if (steps < 0) { start = 0; end = getChildCount(); incr = 1; } else { start = getChildCount() - 1; end = -1; incr = -1; } for (int i = start; i != end; i += incr) { TimeView tv = (TimeView)getChildAt(i); int index = i - steps; if (index >= 0 && index < getChildCount()) { tv.setVals((TimeView)getChildAt(index)); } else { tv.setVals(mLabeler.add(tv.getEndTime(), -steps)); } if (minTime != -1 && tv.getEndTime() < minTime) { if (!tv.isOutOfBounds()) tv.setOutOfBounds(true); } else if (maxTime != -1 && tv.getStartTime() > maxTime) { if (!tv.isOutOfBounds()) tv.setOutOfBounds(true); } else if (tv.isOutOfBounds()) { tv.setOutOfBounds(false); } } }
void function(int steps) { if (steps == 0) { return; } int start; int end; int incr; if (steps < 0) { start = 0; end = getChildCount(); incr = 1; } else { start = getChildCount() - 1; end = -1; incr = -1; } for (int i = start; i != end; i += incr) { TimeView tv = (TimeView)getChildAt(i); int index = i - steps; if (index >= 0 && index < getChildCount()) { tv.setVals((TimeView)getChildAt(index)); } else { tv.setVals(mLabeler.add(tv.getEndTime(), -steps)); } if (minTime != -1 && tv.getEndTime() < minTime) { if (!tv.isOutOfBounds()) tv.setOutOfBounds(true); } else if (maxTime != -1 && tv.getStartTime() > maxTime) { if (!tv.isOutOfBounds()) tv.setOutOfBounds(true); } else if (tv.isOutOfBounds()) { tv.setOutOfBounds(false); } } }
/** * when the scrolling procedure causes "steps" elements to fall out of the visible layout, * all TimeTextViews swap their contents so that it appears that there happens an endless * scrolling with a very limited amount of views * * @param steps */
when the scrolling procedure causes "steps" elements to fall out of the visible layout, all TimeTextViews swap their contents so that it appears that there happens an endless scrolling with a very limited amount of views
moveElements
{ "repo_name": "syrel/hut.by-Organizer", "path": "app/OrganizerHut/app/src/main/java/by/hut/flat/calendar/dialog/date/ScrollLayout.java", "license": "mit", "size": 20701 }
[ "by.hut.flat.calendar.widget.datetime.timeview.TimeView" ]
import by.hut.flat.calendar.widget.datetime.timeview.TimeView;
import by.hut.flat.calendar.widget.datetime.timeview.*;
[ "by.hut.flat" ]
by.hut.flat;
78,432
private void waitForClusterStateUpdatesToFinish() throws Exception { assertBusy(() -> { try { Response response = adminClient().performRequest(new Request("GET", "/_cluster/pending_tasks")); List<?> tasks = (List<?>) entityAsMap(response).get("tasks"); if (false == tasks.isEmpty()) { StringBuilder message = new StringBuilder("there are still running tasks:"); for (Object task: tasks) { message.append('\n').append(task.toString()); } fail(message.toString()); } } catch (IOException e) { fail("cannot get cluster's pending tasks: " + e.getMessage()); } }, 30, TimeUnit.SECONDS); }
void function() throws Exception { assertBusy(() -> { try { Response response = adminClient().performRequest(new Request("GET", STR)); List<?> tasks = (List<?>) entityAsMap(response).get("tasks"); if (false == tasks.isEmpty()) { StringBuilder message = new StringBuilder(STR); for (Object task: tasks) { message.append('\n').append(task.toString()); } fail(message.toString()); } } catch (IOException e) { fail(STR + e.getMessage()); } }, 30, TimeUnit.SECONDS); }
/** * Waits for the cluster state updates to have been processed, so that no cluster * state updates are still in-progress when the next test starts. */
Waits for the cluster state updates to have been processed, so that no cluster state updates are still in-progress when the next test starts
waitForClusterStateUpdatesToFinish
{ "repo_name": "uschindler/elasticsearch", "path": "test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java", "license": "apache-2.0", "size": 65113 }
[ "java.io.IOException", "java.util.List", "java.util.concurrent.TimeUnit", "org.elasticsearch.client.Request", "org.elasticsearch.client.Response" ]
import java.io.IOException; import java.util.List; import java.util.concurrent.TimeUnit; import org.elasticsearch.client.Request; import org.elasticsearch.client.Response;
import java.io.*; import java.util.*; import java.util.concurrent.*; import org.elasticsearch.client.*;
[ "java.io", "java.util", "org.elasticsearch.client" ]
java.io; java.util; org.elasticsearch.client;
1,445,549
public static int getTrueIfd(int tag) { return tag >>> 16; } public static interface Orientation { public static final short TOP_LEFT = 1; public static final short TOP_RIGHT = 2; public static final short BOTTOM_LEFT = 3; public static final short BOTTOM_RIGHT = 4; public static final short LEFT_TOP = 5; public static final short RIGHT_TOP = 6; public static final short LEFT_BOTTOM = 7; public static final short RIGHT_BOTTOM = 8; } public static interface YCbCrPositioning { public static final short CENTERED = 1; public static final short CO_SITED = 2; } public static interface Compression { public static final short UNCOMPRESSION = 1; public static final short JPEG = 6; } public static interface ResolutionUnit { public static final short INCHES = 2; public static final short CENTIMETERS = 3; } public static interface PhotometricInterpretation { public static final short RGB = 2; public static final short YCBCR = 6; } public static interface PlanarConfiguration { public static final short CHUNKY = 1; public static final short PLANAR = 2; } public static interface ExposureProgram { public static final short NOT_DEFINED = 0; public static final short MANUAL = 1; public static final short NORMAL_PROGRAM = 2; public static final short APERTURE_PRIORITY = 3; public static final short SHUTTER_PRIORITY = 4; public static final short CREATIVE_PROGRAM = 5; public static final short ACTION_PROGRAM = 6; public static final short PROTRAIT_MODE = 7; public static final short LANDSCAPE_MODE = 8; } public static interface MeteringMode { public static final short UNKNOWN = 0; public static final short AVERAGE = 1; public static final short CENTER_WEIGHTED_AVERAGE = 2; public static final short SPOT = 3; public static final short MULTISPOT = 4; public static final short PATTERN = 5; public static final short PARTAIL = 6; public static final short OTHER = 255; } public static interface Flash { // LSB public static final short DID_NOT_FIRED = 0; public static final short FIRED = 1; // 1st~2nd bits public static final short RETURN_NO_STROBE_RETURN_DETECTION_FUNCTION = 0 << 1; public static final short RETURN_STROBE_RETURN_LIGHT_NOT_DETECTED = 2 << 1; public static final short RETURN_STROBE_RETURN_LIGHT_DETECTED = 3 << 1; // 3rd~4th bits public static final short MODE_UNKNOWN = 0 << 3; public static final short MODE_COMPULSORY_FLASH_FIRING = 1 << 3; public static final short MODE_COMPULSORY_FLASH_SUPPRESSION = 2 << 3; public static final short MODE_AUTO_MODE = 3 << 3; // 5th bit public static final short FUNCTION_PRESENT = 0 << 5; public static final short FUNCTION_NO_FUNCTION = 1 << 5; // 6th bit public static final short RED_EYE_REDUCTION_NO_OR_UNKNOWN = 0 << 6; public static final short RED_EYE_REDUCTION_SUPPORT = 1 << 6; } public static interface ColorSpace { public static final short SRGB = 1; public static final short UNCALIBRATED = (short) 0xFFFF; } public static interface ExposureMode { public static final short AUTO_EXPOSURE = 0; public static final short MANUAL_EXPOSURE = 1; public static final short AUTO_BRACKET = 2; } public static interface WhiteBalance { public static final short AUTO = 0; public static final short MANUAL = 1; } public static interface SceneCapture { public static final short STANDARD = 0; public static final short LANDSCAPE = 1; public static final short PROTRAIT = 2; public static final short NIGHT_SCENE = 3; } public static interface ComponentsConfiguration { public static final short NOT_EXIST = 0; public static final short Y = 1; public static final short CB = 2; public static final short CR = 3; public static final short R = 4; public static final short G = 5; public static final short B = 6; } public static interface LightSource { public static final short UNKNOWN = 0; public static final short DAYLIGHT = 1; public static final short FLUORESCENT = 2; public static final short TUNGSTEN = 3; public static final short FLASH = 4; public static final short FINE_WEATHER = 9; public static final short CLOUDY_WEATHER = 10; public static final short SHADE = 11; public static final short DAYLIGHT_FLUORESCENT = 12; public static final short DAY_WHITE_FLUORESCENT = 13; public static final short COOL_WHITE_FLUORESCENT = 14; public static final short WHITE_FLUORESCENT = 15; public static final short STANDARD_LIGHT_A = 17; public static final short STANDARD_LIGHT_B = 18; public static final short STANDARD_LIGHT_C = 19; public static final short D55 = 20; public static final short D65 = 21; public static final short D75 = 22; public static final short D50 = 23; public static final short ISO_STUDIO_TUNGSTEN = 24; public static final short OTHER = 255; } public static interface SensingMethod { public static final short NOT_DEFINED = 1; public static final short ONE_CHIP_COLOR = 2; public static final short TWO_CHIP_COLOR = 3; public static final short THREE_CHIP_COLOR = 4; public static final short COLOR_SEQUENTIAL_AREA = 5; public static final short TRILINEAR = 7; public static final short COLOR_SEQUENTIAL_LINEAR = 8; } public static interface FileSource { public static final short DSC = 3; } public static interface SceneType { public static final short DIRECT_PHOTOGRAPHED = 1; } public static interface GainControl { public static final short NONE = 0; public static final short LOW_UP = 1; public static final short HIGH_UP = 2; public static final short LOW_DOWN = 3; public static final short HIGH_DOWN = 4; } public static interface Contrast { public static final short NORMAL = 0; public static final short SOFT = 1; public static final short HARD = 2; } public static interface Saturation { public static final short NORMAL = 0; public static final short LOW = 1; public static final short HIGH = 2; } public static interface Sharpness { public static final short NORMAL = 0; public static final short SOFT = 1; public static final short HARD = 2; } public static interface SubjectDistance { public static final short UNKNOWN = 0; public static final short MACRO = 1; public static final short CLOSE_VIEW = 2; public static final short DISTANT_VIEW = 3; } public static interface GpsLatitudeRef { public static final String NORTH = "N"; public static final String SOUTH = "S"; } public static interface GpsLongitudeRef { public static final String EAST = "E"; public static final String WEST = "W"; } public static interface GpsAltitudeRef { public static final short SEA_LEVEL = 0; public static final short SEA_LEVEL_NEGATIVE = 1; } public static interface GpsStatus { public static final String IN_PROGRESS = "A"; public static final String INTEROPERABILITY = "V"; } public static interface GpsMeasureMode { public static final String MODE_2_DIMENSIONAL = "2"; public static final String MODE_3_DIMENSIONAL = "3"; } public static interface GpsSpeedRef { public static final String KILOMETERS = "K"; public static final String MILES = "M"; public static final String KNOTS = "N"; } public static interface GpsTrackRef { public static final String TRUE_DIRECTION = "T"; public static final String MAGNETIC_DIRECTION = "M"; } public static interface GpsDifferential { public static final short WITHOUT_DIFFERENTIAL_CORRECTION = 0; public static final short DIFFERENTIAL_CORRECTION_APPLIED = 1; } private static final String NULL_ARGUMENT_STRING = "Argument is null"; private ExifData mData = new ExifData(DEFAULT_BYTE_ORDER); public static final ByteOrder DEFAULT_BYTE_ORDER = ByteOrder.BIG_ENDIAN; public ExifInterface() { mGPSDateStampFormat.setTimeZone(TimeZone.getTimeZone("UTC")); }
static int function(int tag) { return tag >>> 16; } public static interface Orientation { public static final short TOP_LEFT = 1; public static final short TOP_RIGHT = 2; public static final short BOTTOM_LEFT = 3; public static final short BOTTOM_RIGHT = 4; public static final short LEFT_TOP = 5; public static final short RIGHT_TOP = 6; public static final short LEFT_BOTTOM = 7; public static final short RIGHT_BOTTOM = 8; } public static interface YCbCrPositioning { public static final short CENTERED = 1; public static final short CO_SITED = 2; } public static interface Compression { public static final short UNCOMPRESSION = 1; public static final short JPEG = 6; } public static interface ResolutionUnit { public static final short INCHES = 2; public static final short CENTIMETERS = 3; } public static interface PhotometricInterpretation { public static final short RGB = 2; public static final short YCBCR = 6; } public static interface PlanarConfiguration { public static final short CHUNKY = 1; public static final short PLANAR = 2; } public static interface ExposureProgram { public static final short NOT_DEFINED = 0; public static final short MANUAL = 1; public static final short NORMAL_PROGRAM = 2; public static final short APERTURE_PRIORITY = 3; public static final short SHUTTER_PRIORITY = 4; public static final short CREATIVE_PROGRAM = 5; public static final short ACTION_PROGRAM = 6; public static final short PROTRAIT_MODE = 7; public static final short LANDSCAPE_MODE = 8; } public static interface MeteringMode { public static final short UNKNOWN = 0; public static final short AVERAGE = 1; public static final short CENTER_WEIGHTED_AVERAGE = 2; public static final short SPOT = 3; public static final short MULTISPOT = 4; public static final short PATTERN = 5; public static final short PARTAIL = 6; public static final short OTHER = 255; } public static interface Flash { public static final short DID_NOT_FIRED = 0; public static final short FIRED = 1; public static final short RETURN_NO_STROBE_RETURN_DETECTION_FUNCTION = 0 << 1; public static final short RETURN_STROBE_RETURN_LIGHT_NOT_DETECTED = 2 << 1; public static final short RETURN_STROBE_RETURN_LIGHT_DETECTED = 3 << 1; public static final short MODE_UNKNOWN = 0 << 3; public static final short MODE_COMPULSORY_FLASH_FIRING = 1 << 3; public static final short MODE_COMPULSORY_FLASH_SUPPRESSION = 2 << 3; public static final short MODE_AUTO_MODE = 3 << 3; public static final short FUNCTION_PRESENT = 0 << 5; public static final short FUNCTION_NO_FUNCTION = 1 << 5; public static final short RED_EYE_REDUCTION_NO_OR_UNKNOWN = 0 << 6; public static final short RED_EYE_REDUCTION_SUPPORT = 1 << 6; } public static interface ColorSpace { public static final short SRGB = 1; public static final short UNCALIBRATED = (short) 0xFFFF; } public static interface ExposureMode { public static final short AUTO_EXPOSURE = 0; public static final short MANUAL_EXPOSURE = 1; public static final short AUTO_BRACKET = 2; } public static interface WhiteBalance { public static final short AUTO = 0; public static final short MANUAL = 1; } public static interface SceneCapture { public static final short STANDARD = 0; public static final short LANDSCAPE = 1; public static final short PROTRAIT = 2; public static final short NIGHT_SCENE = 3; } public static interface ComponentsConfiguration { public static final short NOT_EXIST = 0; public static final short Y = 1; public static final short CB = 2; public static final short CR = 3; public static final short R = 4; public static final short G = 5; public static final short B = 6; } public static interface LightSource { public static final short UNKNOWN = 0; public static final short DAYLIGHT = 1; public static final short FLUORESCENT = 2; public static final short TUNGSTEN = 3; public static final short FLASH = 4; public static final short FINE_WEATHER = 9; public static final short CLOUDY_WEATHER = 10; public static final short SHADE = 11; public static final short DAYLIGHT_FLUORESCENT = 12; public static final short DAY_WHITE_FLUORESCENT = 13; public static final short COOL_WHITE_FLUORESCENT = 14; public static final short WHITE_FLUORESCENT = 15; public static final short STANDARD_LIGHT_A = 17; public static final short STANDARD_LIGHT_B = 18; public static final short STANDARD_LIGHT_C = 19; public static final short D55 = 20; public static final short D65 = 21; public static final short D75 = 22; public static final short D50 = 23; public static final short ISO_STUDIO_TUNGSTEN = 24; public static final short OTHER = 255; } public static interface SensingMethod { public static final short NOT_DEFINED = 1; public static final short ONE_CHIP_COLOR = 2; public static final short TWO_CHIP_COLOR = 3; public static final short THREE_CHIP_COLOR = 4; public static final short COLOR_SEQUENTIAL_AREA = 5; public static final short TRILINEAR = 7; public static final short COLOR_SEQUENTIAL_LINEAR = 8; } public static interface FileSource { public static final short DSC = 3; } public static interface SceneType { public static final short DIRECT_PHOTOGRAPHED = 1; } public static interface GainControl { public static final short NONE = 0; public static final short LOW_UP = 1; public static final short HIGH_UP = 2; public static final short LOW_DOWN = 3; public static final short HIGH_DOWN = 4; } public static interface Contrast { public static final short NORMAL = 0; public static final short SOFT = 1; public static final short HARD = 2; } public static interface Saturation { public static final short NORMAL = 0; public static final short LOW = 1; public static final short HIGH = 2; } public static interface Sharpness { public static final short NORMAL = 0; public static final short SOFT = 1; public static final short HARD = 2; } public static interface SubjectDistance { public static final short UNKNOWN = 0; public static final short MACRO = 1; public static final short CLOSE_VIEW = 2; public static final short DISTANT_VIEW = 3; } public static interface GpsLatitudeRef { public static final String NORTH = "N"; public static final String SOUTH = "S"; } public static interface GpsLongitudeRef { public static final String EAST = "E"; public static final String WEST = "W"; } public static interface GpsAltitudeRef { public static final short SEA_LEVEL = 0; public static final short SEA_LEVEL_NEGATIVE = 1; } public static interface GpsStatus { public static final String IN_PROGRESS = "A"; public static final String INTEROPERABILITY = "V"; } public static interface GpsMeasureMode { public static final String MODE_2_DIMENSIONAL = "2"; public static final String MODE_3_DIMENSIONAL = "3"; } public static interface GpsSpeedRef { public static final String KILOMETERS = "K"; public static final String MILES = "M"; public static final String KNOTS = "N"; } public static interface GpsTrackRef { public static final String TRUE_DIRECTION = "T"; public static final String MAGNETIC_DIRECTION = "M"; } public static interface GpsDifferential { public static final short WITHOUT_DIFFERENTIAL_CORRECTION = 0; public static final short DIFFERENTIAL_CORRECTION_APPLIED = 1; } private static final String NULL_ARGUMENT_STRING = STR; private ExifData mData = new ExifData(DEFAULT_BYTE_ORDER); public static final ByteOrder DEFAULT_BYTE_ORDER = ByteOrder.BIG_ENDIAN; public ExifInterface() { mGPSDateStampFormat.setTimeZone(TimeZone.getTimeZone("UTC")); }
/** * Returns the default IFD for a tag constant. */
Returns the default IFD for a tag constant
getTrueIfd
{ "repo_name": "bmaupin/android-sms-plus", "path": "src/com/android/mms/exif/ExifInterface.java", "license": "apache-2.0", "size": 92509 }
[ "java.nio.ByteOrder", "java.util.TimeZone" ]
import java.nio.ByteOrder; import java.util.TimeZone;
import java.nio.*; import java.util.*;
[ "java.nio", "java.util" ]
java.nio; java.util;
905,012
public List<List<GraphPath<StateVertex, Eventable>>> getAllPossiblePaths(StateVertex index) { final List<List<GraphPath<StateVertex, Eventable>>> results = new ArrayList<List<GraphPath<StateVertex, Eventable>>>(); final KShortestPaths<StateVertex, Eventable> kPaths = new KShortestPaths<StateVertex, Eventable>(this.sfg, index, Integer.MAX_VALUE); for (StateVertex state : getDeepStates(index)) { try { List<GraphPath<StateVertex, Eventable>> paths = kPaths.getPaths(state); results.add(paths); } catch (Exception e) { // TODO Stefan; which Exception is catched here???Can this be removed? LOGGER.error("Error with " + state.toString(), e); } } return results; }
List<List<GraphPath<StateVertex, Eventable>>> function(StateVertex index) { final List<List<GraphPath<StateVertex, Eventable>>> results = new ArrayList<List<GraphPath<StateVertex, Eventable>>>(); final KShortestPaths<StateVertex, Eventable> kPaths = new KShortestPaths<StateVertex, Eventable>(this.sfg, index, Integer.MAX_VALUE); for (StateVertex state : getDeepStates(index)) { try { List<GraphPath<StateVertex, Eventable>> paths = kPaths.getPaths(state); results.add(paths); } catch (Exception e) { LOGGER.error(STR + state.toString(), e); } } return results; }
/** * This method returns all possible paths from the index state using the Kshortest paths. * * @param index * the initial state. * @return a list of GraphPath lists. */
This method returns all possible paths from the index state using the Kshortest paths
getAllPossiblePaths
{ "repo_name": "texasinstrument/temporaryjaxrepodiana", "path": "core/src/main/java/com/crawljax/core/state/StateFlowGraph.java", "license": "apache-2.0", "size": 12370 }
[ "java.util.ArrayList", "java.util.List", "org.jgrapht.GraphPath", "org.jgrapht.alg.KShortestPaths" ]
import java.util.ArrayList; import java.util.List; import org.jgrapht.GraphPath; import org.jgrapht.alg.KShortestPaths;
import java.util.*; import org.jgrapht.*; import org.jgrapht.alg.*;
[ "java.util", "org.jgrapht", "org.jgrapht.alg" ]
java.util; org.jgrapht; org.jgrapht.alg;
539,698
public Map<PlateBigInteger, List<BigDecimal>> platesAggregated(PlateBigInteger[] array, MathContext mc) { Preconditions.checkNotNull(array, "The plate array cannot be null."); Map<PlateBigInteger, List<BigDecimal>> results = new TreeMap<PlateBigInteger, List<BigDecimal>>(); for(PlateBigInteger plate : array) { List<BigDecimal> aggregated = new ArrayList<BigDecimal>(); PlateBigInteger clone = new PlateBigInteger(plate); for (WellBigInteger well : plate) { aggregated.addAll(well.toBigDecimal()); } results.put(clone, calculate(aggregated, mc)); } return results; }
Map<PlateBigInteger, List<BigDecimal>> function(PlateBigInteger[] array, MathContext mc) { Preconditions.checkNotNull(array, STR); Map<PlateBigInteger, List<BigDecimal>> results = new TreeMap<PlateBigInteger, List<BigDecimal>>(); for(PlateBigInteger plate : array) { List<BigDecimal> aggregated = new ArrayList<BigDecimal>(); PlateBigInteger clone = new PlateBigInteger(plate); for (WellBigInteger well : plate) { aggregated.addAll(well.toBigDecimal()); } results.put(clone, calculate(aggregated, mc)); } return results; }
/** * Returns the aggregated statistic for each plate. * @param PlateBigInteger[] array of plates * @param MathContext the math context * @return map of plates and aggregated result */
Returns the aggregated statistic for each plate
platesAggregated
{ "repo_name": "jessemull/MicroFlex", "path": "src/main/java/com/github/jessemull/microflex/bigintegerflex/stat/DescriptiveStatisticListBigIntegerContext.java", "license": "apache-2.0", "size": 24705 }
[ "com.github.jessemull.microflex.bigintegerflex.plate.PlateBigInteger", "com.github.jessemull.microflex.bigintegerflex.plate.WellBigInteger", "com.google.common.base.Preconditions", "java.math.BigDecimal", "java.math.MathContext", "java.util.ArrayList", "java.util.List", "java.util.Map", "java.util.TreeMap" ]
import com.github.jessemull.microflex.bigintegerflex.plate.PlateBigInteger; import com.github.jessemull.microflex.bigintegerflex.plate.WellBigInteger; import com.google.common.base.Preconditions; import java.math.BigDecimal; import java.math.MathContext; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.TreeMap;
import com.github.jessemull.microflex.bigintegerflex.plate.*; import com.google.common.base.*; import java.math.*; import java.util.*;
[ "com.github.jessemull", "com.google.common", "java.math", "java.util" ]
com.github.jessemull; com.google.common; java.math; java.util;
2,539,353
public void setExpires(String expires) { this.expires = expires; } public CallStatsAuthenticator(final int appId, final String appSecret, final String bridgeId, final CallStatsHttp2Client httpClient, CallStatsInitListener listener) { this.listener = listener; this.appId = appId; this.bridgeId = bridgeId; this.httpClient = httpClient; gson = new GsonBuilder().registerTypeAdapter(AuthenticateErrorAction.class, new AuthenticateErrorActionDeserializer()).create(); } public CallStatsAuthenticator(final int appId, ICallStatsTokenGenerator tokenGenerator, final String bridgeId, final CallStatsHttp2Client httpClient, CallStatsInitListener listener) { this.tokenGenerator = tokenGenerator; this.listener = listener; this.appId = appId; this.bridgeId = bridgeId; this.httpClient = httpClient; gson = new GsonBuilder().registerTypeAdapter(AuthenticateErrorAction.class, new AuthenticateErrorActionDeserializer()).create(); }
void function(String expires) { this.expires = expires; } public CallStatsAuthenticator(final int appId, final String appSecret, final String bridgeId, final CallStatsHttp2Client httpClient, CallStatsInitListener listener) { this.listener = listener; this.appId = appId; this.bridgeId = bridgeId; this.httpClient = httpClient; gson = new GsonBuilder().registerTypeAdapter(AuthenticateErrorAction.class, new AuthenticateErrorActionDeserializer()).create(); } public CallStatsAuthenticator(final int appId, ICallStatsTokenGenerator tokenGenerator, final String bridgeId, final CallStatsHttp2Client httpClient, CallStatsInitListener listener) { this.tokenGenerator = tokenGenerator; this.listener = listener; this.appId = appId; this.bridgeId = bridgeId; this.httpClient = httpClient; gson = new GsonBuilder().registerTypeAdapter(AuthenticateErrorAction.class, new AuthenticateErrorActionDeserializer()).create(); }
/** * Sets the expires. * * @param expires the new expires */
Sets the expires
setExpires
{ "repo_name": "callstats-io/callstats.java", "path": "callstats-java-sdk/src/main/java/io/callstats/sdk/internal/CallStatsAuthenticator.java", "license": "mit", "size": 8648 }
[ "com.google.gson.GsonBuilder", "io.callstats.sdk.ICallStatsTokenGenerator", "io.callstats.sdk.httpclient.CallStatsHttp2Client", "io.callstats.sdk.listeners.CallStatsInitListener", "io.callstats.sdk.messages.AuthenticateErrorAction", "io.callstats.sdk.messages.AuthenticateErrorActionDeserializer" ]
import com.google.gson.GsonBuilder; import io.callstats.sdk.ICallStatsTokenGenerator; import io.callstats.sdk.httpclient.CallStatsHttp2Client; import io.callstats.sdk.listeners.CallStatsInitListener; import io.callstats.sdk.messages.AuthenticateErrorAction; import io.callstats.sdk.messages.AuthenticateErrorActionDeserializer;
import com.google.gson.*; import io.callstats.sdk.*; import io.callstats.sdk.httpclient.*; import io.callstats.sdk.listeners.*; import io.callstats.sdk.messages.*;
[ "com.google.gson", "io.callstats.sdk" ]
com.google.gson; io.callstats.sdk;
691,075
when(sourceStorage.getParameters()).thenReturn(parameters); when(dataObject.getSource()).thenReturn(sourceStorage); when(view.getProjectRelativePath()).thenReturn(""); presenter.setUpdateDelegate(updateDelegate); presenter.init(dataObject); }
when(sourceStorage.getParameters()).thenReturn(parameters); when(dataObject.getSource()).thenReturn(sourceStorage); when(view.getProjectRelativePath()).thenReturn(""); presenter.setUpdateDelegate(updateDelegate); presenter.init(dataObject); }
/** * Setup the tests. * * @throws Exception if anything goes wrong */
Setup the tests
setUp
{ "repo_name": "kaloyan-raev/che", "path": "plugins/plugin-svn/che-plugin-svn-ext-ide/src/test/java/org/eclipse/che/plugin/svn/ide/importer/SubversionProjectImporterPresenterTest.java", "license": "epl-1.0", "size": 7037 }
[ "org.mockito.Mockito" ]
import org.mockito.Mockito;
import org.mockito.*;
[ "org.mockito" ]
org.mockito;
977,819
super.onCreate(savedInstanceState); if(getArguments() != null) { isPopular = getArguments().getBoolean(KeyUtil.arg_popular); externalLinks = getArguments().getParcelableArrayList(KeyUtil.arg_list_model); if(externalLinks != null) targetLink = EpisodeUtil.INSTANCE.episodeSupport(externalLinks); } mColumnSize = R.integer.single_list_x1; }
super.onCreate(savedInstanceState); if(getArguments() != null) { isPopular = getArguments().getBoolean(KeyUtil.arg_popular); externalLinks = getArguments().getParcelableArrayList(KeyUtil.arg_list_model); if(externalLinks != null) targetLink = EpisodeUtil.INSTANCE.episodeSupport(externalLinks); } mColumnSize = R.integer.single_list_x1; }
/** * Override and set presenter, mColumnSize, and fetch argument/s */
Override and set presenter, mColumnSize, and fetch argument/s
onCreate
{ "repo_name": "wax911/AniTrendApp", "path": "app/src/main/java/com/mxt/anitrend/base/custom/fragment/FragmentChannelBase.java", "license": "lgpl-3.0", "size": 15235 }
[ "com.mxt.anitrend.util.KeyUtil", "com.mxt.anitrend.util.collection.EpisodeUtil" ]
import com.mxt.anitrend.util.KeyUtil; import com.mxt.anitrend.util.collection.EpisodeUtil;
import com.mxt.anitrend.util.*; import com.mxt.anitrend.util.collection.*;
[ "com.mxt.anitrend" ]
com.mxt.anitrend;
2,226,297
@Nonnull public Iterable<String> getAggregatedPrivilegeNames(@Nonnull String... privilegeNames) { if (privilegeNames.length == 0) { return Collections.emptySet(); } else if (privilegeNames.length == 1) { String privName = privilegeNames[0]; if (NON_AGGREGATE_PRIVILEGES.contains(privName)) { return ImmutableSet.of(privName); } else if (aggregation.containsKey(privName)) { return aggregation.get(privName); } else { return extractAggregatedPrivileges(Collections.singleton(privName)); } } else { Set<String> pNames = ImmutableSet.copyOf(privilegeNames); if (NON_AGGREGATE_PRIVILEGES.containsAll(pNames)) { return pNames; } else { return extractAggregatedPrivileges(pNames); } } }
Iterable<String> function(@Nonnull String... privilegeNames) { if (privilegeNames.length == 0) { return Collections.emptySet(); } else if (privilegeNames.length == 1) { String privName = privilegeNames[0]; if (NON_AGGREGATE_PRIVILEGES.contains(privName)) { return ImmutableSet.of(privName); } else if (aggregation.containsKey(privName)) { return aggregation.get(privName); } else { return extractAggregatedPrivileges(Collections.singleton(privName)); } } else { Set<String> pNames = ImmutableSet.copyOf(privilegeNames); if (NON_AGGREGATE_PRIVILEGES.containsAll(pNames)) { return pNames; } else { return extractAggregatedPrivileges(pNames); } } }
/** * Return the names of the non-aggregate privileges corresponding to the * specified {@code privilegeNames}. * * @param privilegeNames The privilege names to be converted. * @return The names of the non-aggregate privileges that correspond to the * given {@code privilegeNames}. */
Return the names of the non-aggregate privileges corresponding to the specified privilegeNames
getAggregatedPrivilegeNames
{ "repo_name": "afilimonov/jackrabbit-oak", "path": "oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/privilege/PrivilegeBitsProvider.java", "license": "apache-2.0", "size": 10614 }
[ "com.google.common.collect.ImmutableSet", "java.util.Collections", "java.util.Set", "javax.annotation.Nonnull" ]
import com.google.common.collect.ImmutableSet; import java.util.Collections; import java.util.Set; import javax.annotation.Nonnull;
import com.google.common.collect.*; import java.util.*; import javax.annotation.*;
[ "com.google.common", "java.util", "javax.annotation" ]
com.google.common; java.util; javax.annotation;
191,483
@Override public boolean transactAgreedDeal(ItemParserResult res, final EventRaiser npc, final Player player) { int amount = res.getAmount(); String productName = res.getChosenItemName(); if (getMaximalAmount(productName, player) < amount) { // The player tried to cheat us by placing the resource // onto the ground after saying "yes" npc.say("Hey! I'm over here! You'd better not be trying to trick me..."); return false; } else { for (final Map.Entry<String, Integer> entry : getRequiredResourcesPerProduct(productName).entrySet()) { final int amountToDrop = amount * entry.getValue(); player.drop(entry.getKey(), amountToDrop); } final long timeNow = new Date().getTime(); player.setQuest(questSlot, amount + ";" + productName + ";" + timeNow); npc.say("OK, I will " + getProductionActivity() + " " + Grammar.quantityplnoun(amount, productName, "a") + " for you, but that will take some time. Please come back in " + getApproximateRemainingTime(player) + "."); return true; } }
boolean function(ItemParserResult res, final EventRaiser npc, final Player player) { int amount = res.getAmount(); String productName = res.getChosenItemName(); if (getMaximalAmount(productName, player) < amount) { npc.say(STR); return false; } else { for (final Map.Entry<String, Integer> entry : getRequiredResourcesPerProduct(productName).entrySet()) { final int amountToDrop = amount * entry.getValue(); player.drop(entry.getKey(), amountToDrop); } final long timeNow = new Date().getTime(); player.setQuest(questSlot, amount + ";" + productName + ";" + timeNow); npc.say(STR + getProductionActivity() + " " + Grammar.quantityplnoun(amount, productName, "a") + STR + getApproximateRemainingTime(player) + "."); return true; } }
/** * At the time the order is made, * tries to take all the resources required to produce the agreed amount of * the chosen product from the player. If this is possible, initiates an order. * * @param npc * the involved NPC * @param player * the involved player */
At the time the order is made, tries to take all the resources required to produce the agreed amount of the chosen product from the player. If this is possible, initiates an order
transactAgreedDeal
{ "repo_name": "sourceress-project/archestica", "path": "src/games/stendhal/server/entity/npc/behaviour/impl/MultiProducerBehaviour.java", "license": "gpl-2.0", "size": 17423 }
[ "games.stendhal.common.grammar.Grammar", "games.stendhal.common.grammar.ItemParserResult", "games.stendhal.server.entity.npc.EventRaiser", "games.stendhal.server.entity.player.Player", "java.util.Date", "java.util.Map" ]
import games.stendhal.common.grammar.Grammar; import games.stendhal.common.grammar.ItemParserResult; import games.stendhal.server.entity.npc.EventRaiser; import games.stendhal.server.entity.player.Player; import java.util.Date; import java.util.Map;
import games.stendhal.common.grammar.*; import games.stendhal.server.entity.npc.*; import games.stendhal.server.entity.player.*; import java.util.*;
[ "games.stendhal.common", "games.stendhal.server", "java.util" ]
games.stendhal.common; games.stendhal.server; java.util;
697,982
public void setToLimit(int iAreaDesc) // Set this field to the largest or smallest value { // By default compare as ASCII strings Double tempdouble = MIN; // Lowest value if (iAreaDesc == DBConstants.END_SELECT_KEY) tempdouble = MAX; this.doSetData(tempdouble, DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE); }
void function(int iAreaDesc) { Double tempdouble = MIN; if (iAreaDesc == DBConstants.END_SELECT_KEY) tempdouble = MAX; this.doSetData(tempdouble, DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE); }
/** * Set this field to the maximum or minimum value. * @param iAreaDesc END_SELECT_KEY means set to largest value, others mean smallest. */
Set this field to the maximum or minimum value
setToLimit
{ "repo_name": "jbundle/jbundle", "path": "base/base/src/main/java/org/jbundle/base/field/DoubleField.java", "license": "gpl-3.0", "size": 11202 }
[ "org.jbundle.base.model.DBConstants" ]
import org.jbundle.base.model.DBConstants;
import org.jbundle.base.model.*;
[ "org.jbundle.base" ]
org.jbundle.base;
2,425,629
public boolean deleteParent(Inode parent) { if (this instanceof Category || parent instanceof Category) { throw new DotRuntimeException( "Usage of this method directly is forbidden please go through the APIs directly"); } Tree tree = TreeFactory.getTree(parent, this); if (!InodeUtils.isSet(tree.getParent()) || !InodeUtils.isSet(tree.getChild())) { return false; } TreeFactory.deleteTree(tree); return true; }
boolean function(Inode parent) { if (this instanceof Category parent instanceof Category) { throw new DotRuntimeException( STR); } Tree tree = TreeFactory.getTree(parent, this); if (!InodeUtils.isSet(tree.getParent()) !InodeUtils.isSet(tree.getChild())) { return false; } TreeFactory.deleteTree(tree); return true; }
/** * Remove the ASSOCIATION between a parent and the inode * * @param parent * parent to be dissociated * @deprecated Association between inodes should be called through their * respective API, calling the API ensures the consistency of * the relationship and caches * @return */
Remove the ASSOCIATION between a parent and the inode
deleteParent
{ "repo_name": "dotCMS/core", "path": "dotCMS/src/main/java/com/dotmarketing/beans/Inode.java", "license": "gpl-3.0", "size": 17304 }
[ "com.dotmarketing.exception.DotRuntimeException", "com.dotmarketing.factories.TreeFactory", "com.dotmarketing.portlets.categories.model.Category", "com.dotmarketing.util.InodeUtils" ]
import com.dotmarketing.exception.DotRuntimeException; import com.dotmarketing.factories.TreeFactory; import com.dotmarketing.portlets.categories.model.Category; import com.dotmarketing.util.InodeUtils;
import com.dotmarketing.exception.*; import com.dotmarketing.factories.*; import com.dotmarketing.portlets.categories.model.*; import com.dotmarketing.util.*;
[ "com.dotmarketing.exception", "com.dotmarketing.factories", "com.dotmarketing.portlets", "com.dotmarketing.util" ]
com.dotmarketing.exception; com.dotmarketing.factories; com.dotmarketing.portlets; com.dotmarketing.util;
1,412,160
@Override public boolean removeFromWorld() { removeNPC("Susi"); final StendhalRPZone zone = SingletonRepository.getRPWorld().getZone("int_ados_ross_house"); new LittleGirlNPC().createGirlNPC(zone); return true; }
boolean function() { removeNPC("Susi"); final StendhalRPZone zone = SingletonRepository.getRPWorld().getZone(STR); new LittleGirlNPC().createGirlNPC(zone); return true; }
/** * removes Susi from the Mine Town and places her back into her home in Ados. * * @return <code>true</code>, if the content was removed, <code>false</code> otherwise */
removes Susi from the Mine Town and places her back into her home in Ados
removeFromWorld
{ "repo_name": "sourceress-project/archestica", "path": "src/games/stendhal/server/maps/quests/revivalweeks/FoundGirl.java", "license": "gpl-2.0", "size": 10401 }
[ "games.stendhal.server.core.engine.SingletonRepository", "games.stendhal.server.core.engine.StendhalRPZone", "games.stendhal.server.maps.ados.rosshouse.LittleGirlNPC" ]
import games.stendhal.server.core.engine.SingletonRepository; import games.stendhal.server.core.engine.StendhalRPZone; import games.stendhal.server.maps.ados.rosshouse.LittleGirlNPC;
import games.stendhal.server.core.engine.*; import games.stendhal.server.maps.ados.rosshouse.*;
[ "games.stendhal.server" ]
games.stendhal.server;
1,013,577
Single<ContentItem> getContentItem(int id);
Single<ContentItem> getContentItem(int id);
/** * Retrieves the content item with the given id from DB or server. */
Retrieves the content item with the given id from DB or server
getContentItem
{ "repo_name": "Frank1234/FireBaseTest", "path": "app/src/main/java/com/ironflowers/firebasetest/data/repo/ContentRepository.java", "license": "mit", "size": 572 }
[ "com.ironflowers.firebasetest.data.model.ContentItem", "io.reactivex.Single" ]
import com.ironflowers.firebasetest.data.model.ContentItem; import io.reactivex.Single;
import com.ironflowers.firebasetest.data.model.*; import io.reactivex.*;
[ "com.ironflowers.firebasetest", "io.reactivex" ]
com.ironflowers.firebasetest; io.reactivex;
742,072
private Message pollForMessage(){ ReceiveMessageRequest request = new ReceiveMessageRequest(); request.setMaxNumberOfMessages(1); request.setQueueUrl(this.messageQueueUrl); request.setVisibilityTimeout(this.messageVisibilityTimeoutSec); request.setWaitTimeSeconds(0); // Poll for one message. ReceiveMessageResult results = this.amazonSQSClient .receiveMessage(request); if (results != null) { List<Message> messages = results.getMessages(); if (messages != null && !messages.isEmpty()) { if (messages.size() != 1) { throw new IllegalStateException( "Expected only one message but received: " + messages.size()); } final Message message = messages.get(0); if (message == null) { throw new IllegalStateException( "Message list contains a null message"); } return message; } } // no message for you return null; }
Message function(){ ReceiveMessageRequest request = new ReceiveMessageRequest(); request.setMaxNumberOfMessages(1); request.setQueueUrl(this.messageQueueUrl); request.setVisibilityTimeout(this.messageVisibilityTimeoutSec); request.setWaitTimeSeconds(0); ReceiveMessageResult results = this.amazonSQSClient .receiveMessage(request); if (results != null) { List<Message> messages = results.getMessages(); if (messages != null && !messages.isEmpty()) { if (messages.size() != 1) { throw new IllegalStateException( STR + messages.size()); } final Message message = messages.get(0); if (message == null) { throw new IllegalStateException( STR); } return message; } } return null; }
/** * Poll for a single message. * @return */
Poll for a single message
pollForMessage
{ "repo_name": "kimyen/worker-utilities", "path": "src/main/java/org/sagebionetworks/workers/util/aws/message/PollingMessageReceiverImpl.java", "license": "mit", "size": 8184 }
[ "com.amazonaws.services.sqs.model.Message", "com.amazonaws.services.sqs.model.ReceiveMessageRequest", "com.amazonaws.services.sqs.model.ReceiveMessageResult", "java.util.List" ]
import com.amazonaws.services.sqs.model.Message; import com.amazonaws.services.sqs.model.ReceiveMessageRequest; import com.amazonaws.services.sqs.model.ReceiveMessageResult; import java.util.List;
import com.amazonaws.services.sqs.model.*; import java.util.*;
[ "com.amazonaws.services", "java.util" ]
com.amazonaws.services; java.util;
2,692,067
public List<EventMain> getListEventMain() { return listEventMain; }
List<EventMain> function() { return listEventMain; }
/** * Gets the list event main. * * @return the list event main */
Gets the list event main
getListEventMain
{ "repo_name": "uaijug/chronos", "path": "src/main/java/br/com/uaijug/chronos/event/controller/EventTrackController.java", "license": "gpl-3.0", "size": 5328 }
[ "br.com.uaijug.chronos.event.model.EventMain", "java.util.List" ]
import br.com.uaijug.chronos.event.model.EventMain; import java.util.List;
import br.com.uaijug.chronos.event.model.*; import java.util.*;
[ "br.com.uaijug", "java.util" ]
br.com.uaijug; java.util;
2,438,965
public static boolean isZip(String fName) { if (Strings.isNullOrEmpty(fName)) { return false; } return fName.endsWith(ZIP_SUFFIX); // Technically a file named `.zip` would be fine }
static boolean function(String fName) { if (Strings.isNullOrEmpty(fName)) { return false; } return fName.endsWith(ZIP_SUFFIX); }
/** * Checks to see if fName is a valid name for a "*.zip" file * * @param fName The name of the file in question * * @return True if fName is properly named for a .zip file, false otherwise */
Checks to see if fName is a valid name for a "*.zip" file
isZip
{ "repo_name": "praveev/druid", "path": "java-util/src/main/java/io/druid/java/util/common/CompressionUtils.java", "license": "apache-2.0", "size": 16791 }
[ "com.google.common.base.Strings" ]
import com.google.common.base.Strings;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
2,500,639
public static void main(final String[] args) { if (args.length != 2) { System.out.println("Usage: ant -DstreamSize=<stream size> " + "-DnumberOfStreams=<number of streams>"); System.exit(-1); } final int sizeTimeseries = Integer.parseInt(args[0]); final int numTimeseries = Integer.parseInt(args[1]); double[][] data = randomData(numTimeseries, sizeTimeseries); DecimalFormat timeFormat = new DecimalFormat("#0.00000"); double startTime = System.nanoTime(); final double[] correlationsDfe = correlateDfe(data, numTimeseries, sizeTimeseries); double estimatedTime = (System.nanoTime() - startTime) / NUM_OF_NANO_SECONDS; System.out.println("DFE correlation total time:\t\t" + timeFormat.format(estimatedTime) + "s"); startTime = System.nanoTime(); final double[] correlationsCpu = correlateCpu(data, numTimeseries, sizeTimeseries); estimatedTime = (System.nanoTime() - startTime) / NUM_OF_NANO_SECONDS; System.out.println("CPU correlation total time:\t\t" + timeFormat.format(estimatedTime) + "s"); check(correlationsDfe, correlationsCpu, numTimeseries, sizeTimeseries); }
static void function(final String[] args) { if (args.length != 2) { System.out.println(STR + STR); System.exit(-1); } final int sizeTimeseries = Integer.parseInt(args[0]); final int numTimeseries = Integer.parseInt(args[1]); double[][] data = randomData(numTimeseries, sizeTimeseries); DecimalFormat timeFormat = new DecimalFormat(STR); double startTime = System.nanoTime(); final double[] correlationsDfe = correlateDfe(data, numTimeseries, sizeTimeseries); double estimatedTime = (System.nanoTime() - startTime) / NUM_OF_NANO_SECONDS; System.out.println(STR + timeFormat.format(estimatedTime) + "s"); startTime = System.nanoTime(); final double[] correlationsCpu = correlateCpu(data, numTimeseries, sizeTimeseries); estimatedTime = (System.nanoTime() - startTime) / NUM_OF_NANO_SECONDS; System.out.println(STR + timeFormat.format(estimatedTime) + "s"); check(correlationsDfe, correlationsCpu, numTimeseries, sizeTimeseries); }
/** * Calculates correlationsDfe and correlationsCpu and * checks if they return the same value. * * @param args Command line arguments */
Calculates correlationsDfe and correlationsCpu and checks if they return the same value
main
{ "repo_name": "maxeler/maxskins", "path": "examples/Correlation/client/java/AdvancedStatic/CorrelationClient.java", "license": "bsd-2-clause", "size": 26410 }
[ "java.text.DecimalFormat" ]
import java.text.DecimalFormat;
import java.text.*;
[ "java.text" ]
java.text;
1,435,035
protected static boolean handleValidateDataSetColumn( ResultSetColumnHandle insertObj, EditPart target ) { if ( handleValidateDataSetColumnDropContainer( target ) && DNDUtil.handleValidateTargetCanContainType( target.getModel( ), ReportDesignConstants.DATA_ITEM ) ) { // Validates target is report root if ( target.getModel( ) instanceof ModuleHandle || isMasterPageHeaderOrFooter( target.getModel( ) ) ) { return true; } // Validates target's dataset is null or the same with the inserted DesignElementHandle handle = (DesignElementHandle) target.getParent( ) .getModel( ); if ( handle instanceof TableHandle && target.getModel( ) instanceof CellHandle && ( (TableHandle) handle ).isSummaryTable( ) ) { TableHandle tableHandle = (TableHandle) handle; CellHandle cellHandle = (CellHandle) target.getModel( ); if ( DesignChoiceConstants.ANALYSIS_TYPE_DIMENSION.equals( UIUtil.getColumnAnalysis( insertObj ) ) ) { // SlotHandle slotHandle = tableHandle.getGroups( ); // for ( Object o : slotHandle.getContents( ) ) // { // GroupHandle group = (GroupHandle) o; // if ( group.getName( ).equals( insertObj.getColumnName( ) // ) ) // return false; // } if ( cellHandle.getContent( ).getCount( ) == 0 ) { return true; } return !hasGroup( tableHandle, insertObj.getColumnName( ) ); } else if ( DesignChoiceConstants.ANALYSIS_TYPE_ATTRIBUTE.equals( UIUtil.getColumnAnalysis( insertObj ) ) ) { String str = UIUtil.getAnalysisColumn( insertObj ); DataSetHandle dataset = getDataSet( insertObj ); String type = ""; if ( str != null ) { List<ColumnHintHandle> columnHints = DataUtil.getColumnHints( dataset ); for( ColumnHintHandle columnHint : columnHints ) { if ( str.equals( columnHint.getColumnName( ) ) || str.equals( columnHint.getAlias( ) ) ) { type = columnHint.getAnalysis( ); break; } } if ( DesignChoiceConstants.ANALYSIS_TYPE_DIMENSION.equals( type ) ) { GroupHandle findGroup = null; SlotHandle slotHandle = tableHandle.getGroups( ); for ( Object o : slotHandle.getContents( ) ) { GroupHandle group = (GroupHandle) o; if ( group.getName( ).equals( str ) ) { findGroup = group; } } if ( findGroup == null ) { // DesignElementHandle container = // cellHandle.getContainer( ).getContainer( ); // if (container instanceof TableHandle) // { // return true; // } // if (container instanceof GroupHandle && // str.equals( ((GroupHandle)container).getName( // ))) // { // return true; // } // return false; return true; } else { if ( cellHandle.getContainer( ).getContainer( ) == findGroup ) { return true; } else { return false; } } } else if ( type != null && !type.equals( "" ) ) //$NON-NLS-1$ { SlotHandle slotHandle = cellHandle.getContainer( ) .getContainerSlotHandle( ); if ( slotHandle.equals( tableHandle.getHeader( ) ) || slotHandle.equals( tableHandle.getFooter( ) ) ) { return true; } else { return false; } } } else { SlotHandle slotHandle = cellHandle.getContainer( ) .getContainerSlotHandle( ); if ( slotHandle == tableHandle.getHeader( ) || slotHandle == tableHandle.getFooter( ) ) { return true; } return false; } } } if ( handle instanceof ReportItemHandle ) { ReportItemHandle bindingHolder = DEUtil.getListingContainer( handle ); DataSetHandle itsDataSet = ( (ReportItemHandle) handle ).getDataSet( ); DataSetHandle dataSet = null; ReportItemHandle bindingRoot = DEUtil.getBindingRoot( handle ); if ( bindingRoot != null ) { dataSet = bindingRoot.getDataSet( ); } if ( itsDataSet == null && ( bindingHolder == null || !bindingHolder.getColumnBindings( ) .iterator( ) .hasNext( ) ) || getDataSet( insertObj ).equals( dataSet ) ) { return true; } else { if ( ExtendedDataModelUIAdapterHelper.isBoundToExtendedData( bindingRoot ) ) { return getAdapter( ) != null && getAdapter( ).getBoundExtendedData( bindingRoot ) .equals( getAdapter( ).resolveExtendedData( getDataSet( insertObj ) ) ); } } } } return false; }
static boolean function( ResultSetColumnHandle insertObj, EditPart target ) { if ( handleValidateDataSetColumnDropContainer( target ) && DNDUtil.handleValidateTargetCanContainType( target.getModel( ), ReportDesignConstants.DATA_ITEM ) ) { if ( target.getModel( ) instanceof ModuleHandle isMasterPageHeaderOrFooter( target.getModel( ) ) ) { return true; } DesignElementHandle handle = (DesignElementHandle) target.getParent( ) .getModel( ); if ( handle instanceof TableHandle && target.getModel( ) instanceof CellHandle && ( (TableHandle) handle ).isSummaryTable( ) ) { TableHandle tableHandle = (TableHandle) handle; CellHandle cellHandle = (CellHandle) target.getModel( ); if ( DesignChoiceConstants.ANALYSIS_TYPE_DIMENSION.equals( UIUtil.getColumnAnalysis( insertObj ) ) ) { if ( cellHandle.getContent( ).getCount( ) == 0 ) { return true; } return !hasGroup( tableHandle, insertObj.getColumnName( ) ); } else if ( DesignChoiceConstants.ANALYSIS_TYPE_ATTRIBUTE.equals( UIUtil.getColumnAnalysis( insertObj ) ) ) { String str = UIUtil.getAnalysisColumn( insertObj ); DataSetHandle dataset = getDataSet( insertObj ); String type = STR" ) ) { SlotHandle slotHandle = cellHandle.getContainer( ) .getContainerSlotHandle( ); if ( slotHandle.equals( tableHandle.getHeader( ) ) slotHandle.equals( tableHandle.getFooter( ) ) ) { return true; } else { return false; } } } else { SlotHandle slotHandle = cellHandle.getContainer( ) .getContainerSlotHandle( ); if ( slotHandle == tableHandle.getHeader( ) slotHandle == tableHandle.getFooter( ) ) { return true; } return false; } } } if ( handle instanceof ReportItemHandle ) { ReportItemHandle bindingHolder = DEUtil.getListingContainer( handle ); DataSetHandle itsDataSet = ( (ReportItemHandle) handle ).getDataSet( ); DataSetHandle dataSet = null; ReportItemHandle bindingRoot = DEUtil.getBindingRoot( handle ); if ( bindingRoot != null ) { dataSet = bindingRoot.getDataSet( ); } if ( itsDataSet == null && ( bindingHolder == null !bindingHolder.getColumnBindings( ) .iterator( ) .hasNext( ) ) getDataSet( insertObj ).equals( dataSet ) ) { return true; } else { if ( ExtendedDataModelUIAdapterHelper.isBoundToExtendedData( bindingRoot ) ) { return getAdapter( ) != null && getAdapter( ).getBoundExtendedData( bindingRoot ) .equals( getAdapter( ).resolveExtendedData( getDataSet( insertObj ) ) ); } } } } return false; }
/** * Validates drop target from data set column in data view. * * @return validate result */
Validates drop target from data set column in data view
handleValidateDataSetColumn
{ "repo_name": "sguan-actuate/birt", "path": "UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dnd/InsertInLayoutUtil.java", "license": "epl-1.0", "size": 77257 }
[ "org.eclipse.birt.report.designer.internal.ui.extension.ExtendedDataModelUIAdapterHelper", "org.eclipse.birt.report.designer.internal.ui.util.UIUtil", "org.eclipse.birt.report.designer.util.DEUtil", "org.eclipse.birt.report.designer.util.DNDUtil", "org.eclipse.birt.report.model.api.CellHandle", "org.eclipse.birt.report.model.api.DataSetHandle", "org.eclipse.birt.report.model.api.DesignElementHandle", "org.eclipse.birt.report.model.api.ModuleHandle", "org.eclipse.birt.report.model.api.ReportItemHandle", "org.eclipse.birt.report.model.api.ResultSetColumnHandle", "org.eclipse.birt.report.model.api.SlotHandle", "org.eclipse.birt.report.model.api.TableHandle", "org.eclipse.birt.report.model.api.elements.DesignChoiceConstants", "org.eclipse.birt.report.model.api.elements.ReportDesignConstants", "org.eclipse.gef.EditPart" ]
import org.eclipse.birt.report.designer.internal.ui.extension.ExtendedDataModelUIAdapterHelper; import org.eclipse.birt.report.designer.internal.ui.util.UIUtil; import org.eclipse.birt.report.designer.util.DEUtil; import org.eclipse.birt.report.designer.util.DNDUtil; import org.eclipse.birt.report.model.api.CellHandle; import org.eclipse.birt.report.model.api.DataSetHandle; import org.eclipse.birt.report.model.api.DesignElementHandle; import org.eclipse.birt.report.model.api.ModuleHandle; import org.eclipse.birt.report.model.api.ReportItemHandle; import org.eclipse.birt.report.model.api.ResultSetColumnHandle; import org.eclipse.birt.report.model.api.SlotHandle; import org.eclipse.birt.report.model.api.TableHandle; import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants; import org.eclipse.birt.report.model.api.elements.ReportDesignConstants; import org.eclipse.gef.EditPart;
import org.eclipse.birt.report.designer.internal.ui.extension.*; import org.eclipse.birt.report.designer.internal.ui.util.*; import org.eclipse.birt.report.designer.util.*; import org.eclipse.birt.report.model.api.*; import org.eclipse.birt.report.model.api.elements.*; import org.eclipse.gef.*;
[ "org.eclipse.birt", "org.eclipse.gef" ]
org.eclipse.birt; org.eclipse.gef;
1,008,037
public static class ComposeCombineFnBuilder { public <DataT, InputT, OutputT> ComposedCombineFn<DataT> with( SimpleFunction<DataT, InputT> extractInputFn, CombineFn<InputT, ?, OutputT> combineFn, TupleTag<OutputT> outputTag) { return new ComposedCombineFn<DataT>() .with(extractInputFn, combineFn, outputTag); }
static class ComposeCombineFnBuilder { public <DataT, InputT, OutputT> ComposedCombineFn<DataT> function( SimpleFunction<DataT, InputT> extractInputFn, CombineFn<InputT, ?, OutputT> combineFn, TupleTag<OutputT> outputTag) { return new ComposedCombineFn<DataT>() .with(extractInputFn, combineFn, outputTag); }
/** * Returns a {@link ComposedCombineFn} that can take additional * {@link GlobalCombineFn GlobalCombineFns} and apply them as a single combine function. * * <p>The {@link ComposedCombineFn} extracts inputs from {@code DataT} with * the {@code extractInputFn} and combines them with the {@code combineFn}, * and then it outputs each combined value with a {@link TupleTag} to a * {@link CoCombineResult}. */
Returns a <code>ComposedCombineFn</code> that can take additional <code>GlobalCombineFn GlobalCombineFns</code> and apply them as a single combine function. The <code>ComposedCombineFn</code> extracts inputs from DataT with the extractInputFn and combines them with the combineFn, and then it outputs each combined value with a <code>TupleTag</code> to a <code>CoCombineResult</code>
with
{ "repo_name": "sammcveety/DataflowJavaSDK", "path": "sdk/src/main/java/com/google/cloud/dataflow/sdk/transforms/CombineFns.java", "license": "apache-2.0", "size": 45404 }
[ "com.google.cloud.dataflow.sdk.transforms.Combine", "com.google.cloud.dataflow.sdk.values.TupleTag" ]
import com.google.cloud.dataflow.sdk.transforms.Combine; import com.google.cloud.dataflow.sdk.values.TupleTag;
import com.google.cloud.dataflow.sdk.transforms.*; import com.google.cloud.dataflow.sdk.values.*;
[ "com.google.cloud" ]
com.google.cloud;
1,302,576
public void setInBody(String inBody) { // validate property name ObjectHelper.notNull(inBody, "inBody"); if (!FacebookPropertiesHelper.getValidEndpointProperties().contains(inBody)) { throw new IllegalArgumentException("Unknown property " + inBody); } this.inBody = inBody; }
void function(String inBody) { ObjectHelper.notNull(inBody, STR); if (!FacebookPropertiesHelper.getValidEndpointProperties().contains(inBody)) { throw new IllegalArgumentException(STR + inBody); } this.inBody = inBody; }
/** * Sets the name of a parameter to be passed in the exchange In Body */
Sets the name of a parameter to be passed in the exchange In Body
setInBody
{ "repo_name": "CandleCandle/camel", "path": "components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java", "license": "apache-2.0", "size": 8375 }
[ "org.apache.camel.component.facebook.data.FacebookPropertiesHelper", "org.apache.camel.util.ObjectHelper" ]
import org.apache.camel.component.facebook.data.FacebookPropertiesHelper; import org.apache.camel.util.ObjectHelper;
import org.apache.camel.component.facebook.data.*; import org.apache.camel.util.*;
[ "org.apache.camel" ]
org.apache.camel;
210,331
public PDFPaint getPaint(PDFObject patternObj, float[] components, Map resources) throws IOException { PDFPaint basePaint = null; if (getBase() != null) { basePaint = getBase().getPaint(components); } PDFPattern pattern = (PDFPattern) patternObj.getCache(); if (pattern == null) { pattern = PDFPattern.getPattern(patternObj, resources); patternObj.setCache(pattern); } return pattern.getPaint(basePaint); }
PDFPaint function(PDFObject patternObj, float[] components, Map resources) throws IOException { PDFPaint basePaint = null; if (getBase() != null) { basePaint = getBase().getPaint(components); } PDFPattern pattern = (PDFPattern) patternObj.getCache(); if (pattern == null) { pattern = PDFPattern.getPattern(patternObj, resources); patternObj.setCache(pattern); } return pattern.getPaint(basePaint); }
/** * Get the paint representing a pattern, optionally with the given * base paint. * * @param patternObj the pattern to render * @param components the components of the base paint */
Get the paint representing a pattern, optionally with the given base paint
getPaint
{ "repo_name": "HarmonyEnterpriseSolutions/harmony-platform", "path": "java/src/com/sun/pdfview/colorspace/PatternSpace.java", "license": "gpl-2.0", "size": 3345 }
[ "com.sun.pdfview.PDFObject", "com.sun.pdfview.PDFPaint", "com.sun.pdfview.pattern.PDFPattern", "java.io.IOException", "java.util.Map" ]
import com.sun.pdfview.PDFObject; import com.sun.pdfview.PDFPaint; import com.sun.pdfview.pattern.PDFPattern; import java.io.IOException; import java.util.Map;
import com.sun.pdfview.*; import com.sun.pdfview.pattern.*; import java.io.*; import java.util.*;
[ "com.sun.pdfview", "java.io", "java.util" ]
com.sun.pdfview; java.io; java.util;
1,185,210
@Override public void sawOpcode(int seen) { switch (state) { case SAW_NOTHING: if (OpcodeUtils.isALoad(seen)) { register1_1 = RegisterUtils.getALoadReg(this, seen); state = State.SAW_LOAD1_1; } break; case SAW_LOAD1_1: if (OpcodeUtils.isALoad(seen)) { register1_2 = RegisterUtils.getALoadReg(this, seen); } if (register1_2 > -1) { state = State.SAW_LOAD1_2; } else { state = State.SAW_NOTHING; } break; case SAW_LOAD1_2: if (seen == INVOKEVIRTUAL) { String cls = getDottedClassConstantOperand(); if (dateClasses.contains(cls)) { String methodName = getNameConstantOperand(); if ("equals".equals(methodName) || "after".equals(methodName) || "before".equals(methodName)) { state = State.SAW_CMP1; } } } if (state != State.SAW_CMP1) { state = State.SAW_NOTHING; } break; case SAW_CMP1: if (seen == IFNE) { state = State.SAW_IFNE; } else { state = State.SAW_NOTHING; } break; case SAW_IFNE: if (OpcodeUtils.isALoad(seen)) { register2_1 = RegisterUtils.getALoadReg(this, seen); } if (register2_1 > -1) { state = State.SAW_LOAD2_1; } else { state = State.SAW_NOTHING; } break; case SAW_LOAD2_1: if (OpcodeUtils.isALoad(seen)) { register2_2 = RegisterUtils.getALoadReg(this, seen); } if ((register2_2 > -1) && (((register1_1 == register2_1) && (register1_2 == register2_2)) || ((register1_1 == register2_2) && (register1_2 == register2_1)))) { state = State.SAW_LOAD2_2; } else { state = State.SAW_NOTHING; } break; case SAW_LOAD2_2: if (seen == INVOKEVIRTUAL) { String cls = getDottedClassConstantOperand(); if (dateClasses.contains(cls)) { String methodName = getNameConstantOperand(); if ("equals".equals(methodName) || "after".equals(methodName) || "before".equals(methodName)) { state = State.SAW_CMP2; } } } if (state != State.SAW_CMP2) { state = State.SAW_NOTHING; } break; case SAW_CMP2: if (seen == IFEQ) { bugReporter.reportBug(new BugInstance("DDC_DOUBLE_DATE_COMPARISON", NORMAL_PRIORITY).addClassAndMethod(this).addSourceLine(this)); } state = State.SAW_NOTHING; break; default: break; } }
void function(int seen) { switch (state) { case SAW_NOTHING: if (OpcodeUtils.isALoad(seen)) { register1_1 = RegisterUtils.getALoadReg(this, seen); state = State.SAW_LOAD1_1; } break; case SAW_LOAD1_1: if (OpcodeUtils.isALoad(seen)) { register1_2 = RegisterUtils.getALoadReg(this, seen); } if (register1_2 > -1) { state = State.SAW_LOAD1_2; } else { state = State.SAW_NOTHING; } break; case SAW_LOAD1_2: if (seen == INVOKEVIRTUAL) { String cls = getDottedClassConstantOperand(); if (dateClasses.contains(cls)) { String methodName = getNameConstantOperand(); if (STR.equals(methodName) "after".equals(methodName) STR.equals(methodName)) { state = State.SAW_CMP1; } } } if (state != State.SAW_CMP1) { state = State.SAW_NOTHING; } break; case SAW_CMP1: if (seen == IFNE) { state = State.SAW_IFNE; } else { state = State.SAW_NOTHING; } break; case SAW_IFNE: if (OpcodeUtils.isALoad(seen)) { register2_1 = RegisterUtils.getALoadReg(this, seen); } if (register2_1 > -1) { state = State.SAW_LOAD2_1; } else { state = State.SAW_NOTHING; } break; case SAW_LOAD2_1: if (OpcodeUtils.isALoad(seen)) { register2_2 = RegisterUtils.getALoadReg(this, seen); } if ((register2_2 > -1) && (((register1_1 == register2_1) && (register1_2 == register2_2)) ((register1_1 == register2_2) && (register1_2 == register2_1)))) { state = State.SAW_LOAD2_2; } else { state = State.SAW_NOTHING; } break; case SAW_LOAD2_2: if (seen == INVOKEVIRTUAL) { String cls = getDottedClassConstantOperand(); if (dateClasses.contains(cls)) { String methodName = getNameConstantOperand(); if (STR.equals(methodName) "after".equals(methodName) STR.equals(methodName)) { state = State.SAW_CMP2; } } } if (state != State.SAW_CMP2) { state = State.SAW_NOTHING; } break; case SAW_CMP2: if (seen == IFEQ) { bugReporter.reportBug(new BugInstance(STR, NORMAL_PRIORITY).addClassAndMethod(this).addSourceLine(this)); } state = State.SAW_NOTHING; break; default: break; } }
/** * overrides the visitor to look for double date compares using the same registers * * @param seen * the current opcode parsed. */
overrides the visitor to look for double date compares using the same registers
sawOpcode
{ "repo_name": "crow-misia/fb-contrib", "path": "src/com/mebigfatguy/fbcontrib/detect/DateComparison.java", "license": "lgpl-2.1", "size": 6222 }
[ "com.mebigfatguy.fbcontrib.utils.OpcodeUtils", "com.mebigfatguy.fbcontrib.utils.RegisterUtils", "edu.umd.cs.findbugs.BugInstance" ]
import com.mebigfatguy.fbcontrib.utils.OpcodeUtils; import com.mebigfatguy.fbcontrib.utils.RegisterUtils; import edu.umd.cs.findbugs.BugInstance;
import com.mebigfatguy.fbcontrib.utils.*; import edu.umd.cs.findbugs.*;
[ "com.mebigfatguy.fbcontrib", "edu.umd.cs" ]
com.mebigfatguy.fbcontrib; edu.umd.cs;
2,806,556
public static String dumpAsString( DEREncodable obj) { return _dumpAsString("", obj.getDERObject()); }
static String function( DEREncodable obj) { return _dumpAsString("", obj.getDERObject()); }
/** * dump out a DER object as a formatted string * * @param obj the DERObject to be dumped out. */
dump out a DER object as a formatted string
dumpAsString
{ "repo_name": "apache/geronimo", "path": "framework/modules/geronimo-crypto/src/main/java/org/apache/geronimo/crypto/asn1/util/DERDump.java", "license": "apache-2.0", "size": 1546 }
[ "org.apache.geronimo.crypto.asn1.DEREncodable" ]
import org.apache.geronimo.crypto.asn1.DEREncodable;
import org.apache.geronimo.crypto.asn1.*;
[ "org.apache.geronimo" ]
org.apache.geronimo;
2,605,962
@Override public boolean outputsUnicode() { return true; } protected MarcPermissiveStreamReader curReader = null; // protected ErrorHandler errorList = null; public AnselToUnicode() { ct = loadGeneratedTable(false); } public AnselToUnicode(final boolean loadMultibyte) { ct = loadGeneratedTable(loadMultibyte); } public AnselToUnicode(final MarcPermissiveStreamReader curReader) { ct = loadGeneratedTable(false); this.curReader = curReader; }
boolean function() { return true; } protected MarcPermissiveStreamReader curReader = null; public AnselToUnicode() { ct = loadGeneratedTable(false); } public AnselToUnicode(final boolean loadMultibyte) { ct = loadGeneratedTable(loadMultibyte); } public AnselToUnicode(final MarcPermissiveStreamReader curReader) { ct = loadGeneratedTable(false); this.curReader = curReader; }
/** * Should return true if the CharConverter outputs Unicode encoded characters * * @return boolean whether the CharConverter returns Unicode encoded characters */
Should return true if the CharConverter outputs Unicode encoded characters
outputsUnicode
{ "repo_name": "Dyrcona/marc4j", "path": "src/org/marc4j/converter/impl/AnselToUnicode.java", "license": "lgpl-2.1", "size": 38936 }
[ "org.marc4j.MarcPermissiveStreamReader" ]
import org.marc4j.MarcPermissiveStreamReader;
import org.marc4j.*;
[ "org.marc4j" ]
org.marc4j;
2,827,059
public Map<String, String> getAttributes() { return attributes; }
Map<String, String> function() { return attributes; }
/** * Returns a map of all attributes associated with this user. Each entry * key is the attribute identifier, while each value is the attribute * value itself. * * @return * The attribute map for this user. */
Returns a map of all attributes associated with this user. Each entry key is the attribute identifier, while each value is the attribute value itself
getAttributes
{ "repo_name": "lato333/guacamole-client", "path": "guacamole/src/main/java/org/apache/guacamole/rest/user/APIUser.java", "license": "apache-2.0", "size": 3414 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,479,149
@Test public void testDegenerateRegions() throws Exception { FullyQualifiedTableName table = FullyQualifiedTableName.valueOf("tableDegenerateRegions"); try { setupTable(table); assertNoErrors(doFsck(conf,false)); assertEquals(ROWKEYS.length, countRows()); // Now let's mess it up, by adding a region with a duplicate startkey HRegionInfo hriDupe = createRegion(conf, tbl.getTableDescriptor(), Bytes.toBytes("B"), Bytes.toBytes("B")); TEST_UTIL.getHBaseCluster().getMaster().assignRegion(hriDupe); TEST_UTIL.getHBaseCluster().getMaster().getAssignmentManager() .waitForAssignment(hriDupe); ServerName server = regionStates.getRegionServerOfRegion(hriDupe); TEST_UTIL.assertRegionOnServer(hriDupe, server, REGION_ONLINE_TIMEOUT); HBaseFsck hbck = doFsck(conf,false); assertErrors(hbck, new ERROR_CODE[] { ERROR_CODE.DEGENERATE_REGION, ERROR_CODE.DUPE_STARTKEYS, ERROR_CODE.DUPE_STARTKEYS}); assertEquals(2, hbck.getOverlapGroups(table).size()); assertEquals(ROWKEYS.length, countRows()); // fix the degenerate region. doFsck(conf,true); // check that the degenerate region is gone and no data loss HBaseFsck hbck2 = doFsck(conf,false); assertNoErrors(hbck2); assertEquals(0, hbck2.getOverlapGroups(table).size()); assertEquals(ROWKEYS.length, countRows()); } finally { deleteTable(table); } }
void function() throws Exception { FullyQualifiedTableName table = FullyQualifiedTableName.valueOf(STR); try { setupTable(table); assertNoErrors(doFsck(conf,false)); assertEquals(ROWKEYS.length, countRows()); HRegionInfo hriDupe = createRegion(conf, tbl.getTableDescriptor(), Bytes.toBytes("B"), Bytes.toBytes("B")); TEST_UTIL.getHBaseCluster().getMaster().assignRegion(hriDupe); TEST_UTIL.getHBaseCluster().getMaster().getAssignmentManager() .waitForAssignment(hriDupe); ServerName server = regionStates.getRegionServerOfRegion(hriDupe); TEST_UTIL.assertRegionOnServer(hriDupe, server, REGION_ONLINE_TIMEOUT); HBaseFsck hbck = doFsck(conf,false); assertErrors(hbck, new ERROR_CODE[] { ERROR_CODE.DEGENERATE_REGION, ERROR_CODE.DUPE_STARTKEYS, ERROR_CODE.DUPE_STARTKEYS}); assertEquals(2, hbck.getOverlapGroups(table).size()); assertEquals(ROWKEYS.length, countRows()); doFsck(conf,true); HBaseFsck hbck2 = doFsck(conf,false); assertNoErrors(hbck2); assertEquals(0, hbck2.getOverlapGroups(table).size()); assertEquals(ROWKEYS.length, countRows()); } finally { deleteTable(table); } }
/** * This creates and fixes a bad table with regions that has startkey == endkey */
This creates and fixes a bad table with regions that has startkey == endkey
testDegenerateRegions
{ "repo_name": "francisliu/hbase_namespace", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java", "license": "apache-2.0", "size": 76656 }
[ "org.apache.hadoop.hbase.FullyQualifiedTableName", "org.apache.hadoop.hbase.HRegionInfo", "org.apache.hadoop.hbase.ServerName", "org.apache.hadoop.hbase.util.hbck.HbckTestingUtil", "org.junit.Assert" ]
import org.apache.hadoop.hbase.FullyQualifiedTableName; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.util.hbck.HbckTestingUtil; import org.junit.Assert;
import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.util.hbck.*; import org.junit.*;
[ "org.apache.hadoop", "org.junit" ]
org.apache.hadoop; org.junit;
1,945,388
public List<EffectiveNetworkSecurityRule> effectiveSecurityRules() { return this.effectiveSecurityRules; }
List<EffectiveNetworkSecurityRule> function() { return this.effectiveSecurityRules; }
/** * Get collection of effective security rules. * * @return the effectiveSecurityRules value */
Get collection of effective security rules
effectiveSecurityRules
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/network/v2019_07_01/SecurityRuleAssociations.java", "license": "mit", "size": 3986 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
965,605
void setAuthenticationManager(@NotNull AuthenticationManager authenticationManager);
void setAuthenticationManager(@NotNull AuthenticationManager authenticationManager);
/** * Sets authentication manager. * * @param authenticationManager the authentication manager */
Sets authentication manager
setAuthenticationManager
{ "repo_name": "joansmith/cas", "path": "cas-server-core-api-authentication/src/main/java/org/jasig/cas/authentication/AuthenticationTransactionManager.java", "license": "apache-2.0", "size": 1398 }
[ "javax.validation.constraints.NotNull" ]
import javax.validation.constraints.NotNull;
import javax.validation.constraints.*;
[ "javax.validation" ]
javax.validation;
517,349
public static Document readFile(File file) { try { return new SAXBuilder().build(file); } catch (Exception e) { e.printStackTrace(); return null; } }
static Document function(File file) { try { return new SAXBuilder().build(file); } catch (Exception e) { e.printStackTrace(); return null; } }
/** * Get XML Document thanks to its filename * * @param the XML file * @return the XML Document */
Get XML Document thanks to its filename
readFile
{ "repo_name": "moliva/proactive", "path": "src/Extensions/org/objectweb/proactive/extensions/timitspmd/util/XMLHelper.java", "license": "agpl-3.0", "size": 11882 }
[ "java.io.File", "org.jdom.Document", "org.jdom.input.SAXBuilder" ]
import java.io.File; import org.jdom.Document; import org.jdom.input.SAXBuilder;
import java.io.*; import org.jdom.*; import org.jdom.input.*;
[ "java.io", "org.jdom", "org.jdom.input" ]
java.io; org.jdom; org.jdom.input;
5,046
public boolean hasSupportingIndex(SecondaryIndexManager indexManager);
boolean function(SecondaryIndexManager indexManager);
/** * Check if the restriction is on indexed columns. * * @param indexManager the index manager * @return <code>true</code> if the restriction is on indexed columns, <code>false</code> */
Check if the restriction is on indexed columns
hasSupportingIndex
{ "repo_name": "fengshao0907/cassandra-1", "path": "src/java/org/apache/cassandra/cql3/restrictions/Restriction.java", "license": "apache-2.0", "size": 5322 }
[ "org.apache.cassandra.index.SecondaryIndexManager" ]
import org.apache.cassandra.index.SecondaryIndexManager;
import org.apache.cassandra.index.*;
[ "org.apache.cassandra" ]
org.apache.cassandra;
2,770,618
public void fillIDValues() { for (X_I_Workflow importWorkflow : getRecords(false, false)) { int AD_Org_ID = getID(MOrg.Table_Name, "Value = ?", new Object[] { importWorkflow.getOrgValue() }); if (AD_Org_ID > 0) importWorkflow.setAD_Org_ID(AD_Org_ID); int S_Resource_ID = getID(MResource.Table_Name, "Value=?", new Object[] { importWorkflow.getResourceValue() }); if (S_Resource_ID > 0) importWorkflow.setS_Resource_ID(S_Resource_ID); String errorMsg = ""; if (MWorkflow.WORKFLOWTYPE_Manufacturing.equals(importWorkflow .getWorkflowType())) { if (importWorkflow.getS_Resource_ID() <= 0) { errorMsg += "@S_Resource_ID@ @NotFound@, "; } } if (importWorkflow.getDocumentNo() == null) errorMsg += "@DocumentNo@ @NotFound@, "; if (importWorkflow.getName() == null) errorMsg += "@Name@ @NotFound@, "; if (importWorkflow.getAccessLevel() == null) errorMsg += "@AccessLevel@ @NotFound@, "; if (importWorkflow.getAuthor() == null) errorMsg += "@Author@ @NotFound@, "; if (importWorkflow.getAuthor() == null) errorMsg += "@Author@ @NotFound@, "; if (importWorkflow.getEntityType() == null) errorMsg += "@EntityType@ @NotFound@, "; if (importWorkflow.getPublishStatus() == null) errorMsg += "@PublishStatus@ @NotFound@, "; if (importWorkflow.getValue() == null) errorMsg += "@Value@ @NotFound@, "; if (importWorkflow.getVersion() <= 0) errorMsg += "@Version@ @NotFound@, "; if (importWorkflow.getWorkflowType() == null) errorMsg += "@WorkflowType@ @NotFound@, "; if (importWorkflow.getDurationUnit() == null) errorMsg += "@DurationUnit@ @NotFound@, "; if (errorMsg != null && errorMsg.length() > 0) { importWorkflow.setI_ErrorMsg(Msg.parseTranslation(getCtx(), errorMsg)); } importWorkflow.saveEx(); } }
void function() { for (X_I_Workflow importWorkflow : getRecords(false, false)) { int AD_Org_ID = getID(MOrg.Table_Name, STR, new Object[] { importWorkflow.getOrgValue() }); if (AD_Org_ID > 0) importWorkflow.setAD_Org_ID(AD_Org_ID); int S_Resource_ID = getID(MResource.Table_Name, STR, new Object[] { importWorkflow.getResourceValue() }); if (S_Resource_ID > 0) importWorkflow.setS_Resource_ID(S_Resource_ID); String errorMsg = STR@S_Resource_ID@ @NotFound@, STR@DocumentNo@ @NotFound@, STR@Name@ @NotFound@, STR@AccessLevel@ @NotFound@, STR@Author@ @NotFound@, STR@Author@ @NotFound@, STR@EntityType@ @NotFound@, STR@PublishStatus@ @NotFound@, STR@Value@ @NotFound@, STR@Version@ @NotFound@, STR@WorkflowType@ @NotFound@, STR@DurationUnit@ @NotFound@, "; if (errorMsg != null && errorMsg.length() > 0) { importWorkflow.setI_ErrorMsg(Msg.parseTranslation(getCtx(), errorMsg)); } importWorkflow.saveEx(); } }
/** * fill IDs values based on Search Key */
fill IDs values based on Search Key
fillIDValues
{ "repo_name": "pplatek/adempiere", "path": "org.eevolution.manufacturing/src/main/java/base/org/eevolution/process/ImportWorkflow.java", "license": "gpl-2.0", "size": 12863 }
[ "org.compiere.model.MOrg", "org.compiere.model.MResource", "org.compiere.util.Msg" ]
import org.compiere.model.MOrg; import org.compiere.model.MResource; import org.compiere.util.Msg;
import org.compiere.model.*; import org.compiere.util.*;
[ "org.compiere.model", "org.compiere.util" ]
org.compiere.model; org.compiere.util;
1,329,553
List<SourceDocument> getAllDocuments();
List<SourceDocument> getAllDocuments();
/** * Method obtains all source documents in form of list. * * @return list of all source documents, empty list if there are none yet. */
Method obtains all source documents in form of list
getAllDocuments
{ "repo_name": "michal-ruzicka/MathMLCanEval", "path": "mathmlcaneval-backend/src/main/java/cz/muni/fi/mir/db/dao/SourceDocumentDAO.java", "license": "apache-2.0", "size": 1083 }
[ "cz.muni.fi.mir.db.domain.SourceDocument", "java.util.List" ]
import cz.muni.fi.mir.db.domain.SourceDocument; import java.util.List;
import cz.muni.fi.mir.db.domain.*; import java.util.*;
[ "cz.muni.fi", "java.util" ]
cz.muni.fi; java.util;
168,727
@Nonnull ItemStack remove(); } interface StrategySupplier{ @CapabilityInject(StrategySupplier.class) Capability<StrategySupplier> CAPABILITY = null;
ItemStack remove(); } interface StrategySupplier{ @CapabilityInject(StrategySupplier.class) Capability<StrategySupplier> CAPABILITY = null;
/** * Remove strategy. * * @return * @since 1.0 */
Remove strategy
remove
{ "repo_name": "CrafterKina/Pipes", "path": "src/api/java/jp/crafterkina/pipes/api/pipe/IStrategy.java", "license": "mpl-2.0", "size": 3312 }
[ "net.minecraft.item.ItemStack", "net.minecraftforge.common.capabilities.Capability", "net.minecraftforge.common.capabilities.CapabilityInject" ]
import net.minecraft.item.ItemStack; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityInject;
import net.minecraft.item.*; import net.minecraftforge.common.capabilities.*;
[ "net.minecraft.item", "net.minecraftforge.common" ]
net.minecraft.item; net.minecraftforge.common;
1,656,749
public void saveFileData(File file, File destination, java.io.File newDataFile) throws IOException { String fileName = file.getFileName(); // This was added for http://jira.dotmarketing.net/browse/DOTCMS-5390 // but this breaks the original intent of the // method. See the doc for the method above. Caused // http://jira.dotmarketing.net/browse/DOTCMS-5539 so commented out. // if(newDataFile ==null || newDataFile.length() ==0){ // throw new // DotStateException("Null or 0 lenght java.io.file passed in for file:" // + file.getInode()); // } String assetsPath = APILocator.getFileAPI().getRealAssetsRootPath(); new java.io.File(assetsPath).mkdir(); // creates the new file as // inode{1}/inode{2}/inode.file_extension java.io.File workingFile = getAssetIOFile(file); // http://jira.dotmarketing.net/browse/DOTCMS-1873 // To clear velocity cache DotResourceCache vc = CacheLocator.getVeloctyResourceCache(); vc.remove(ResourceManager.RESOURCE_TEMPLATE + workingFile.getPath()); // If a new version was created, we move the current data to the new // version if (destination != null && InodeUtils.isSet(destination.getInode())) { java.io.File newVersionFile = getAssetIOFile(destination); // FileUtil.copyFile(workingFile, newVersionFile); FileUtils.copyFile(workingFile, newVersionFile); // FileInputStream is = new FileInputStream(workingFile); // FileChannel channelFrom = is.getChannel(); // java.io.File newVersionFile = getAssetIOFile(destination); // FileChannel channelTo = new // FileOutputStream(newVersionFile).getChannel(); // channelFrom.transferTo(0, channelFrom.size(), channelTo); // channelTo.force(false); // channelTo.close(); // channelFrom.close(); } if (newDataFile != null) { // Saving the new working data FileUtils.copyFile(newDataFile, workingFile); file.setSize((int) newDataFile.length()); // checks if it's an image if (UtilMethods.isImage(fileName)) { InputStream in = null; try { // gets image height in = new BufferedInputStream(new FileInputStream(workingFile)); byte[] imageData = new byte[in.available()]; in.read(imageData); Image image = Toolkit.getDefaultToolkit().createImage(imageData); MediaTracker mediaTracker = new MediaTracker(new Container()); mediaTracker.addImage(image, 0); mediaTracker.waitForID(0); int imageWidth = image.getWidth(null); int imageHeight = image.getHeight(null); in.close(); in = null; // gets image width file.setHeight(imageHeight); file.setWidth(imageWidth); } catch (Exception e) { Logger.error(FileFactory.class, "Unable to read image " + workingFile + " : " + e.getMessage()); throw new IOException(e); } finally { if (in != null) { try { in.close(); } catch (Exception e) { Logger.error(FileFactory.class, "Unable to close image " + e.getMessage()); } } } } // Wiping out the thumbnails and resized versions // http://jira.dotmarketing.net/browse/DOTCMS-5911 String inode = file.getInode(); if (UtilMethods.isSet(inode)) { String realAssetPath = APILocator.getFileAPI().getRealAssetPath(); java.io.File tumbnailDir = new java.io.File(realAssetPath + java.io.File.separator + "dotGenerated" + java.io.File.separator + inode.charAt(0) + java.io.File.separator + inode.charAt(1)); if (tumbnailDir != null) { java.io.File[] files = tumbnailDir.listFiles(); if (files != null) { for (java.io.File iofile : files) { try { if (iofile.getName().startsWith("dotGenerated_")) { iofile.delete(); } } catch (SecurityException e) { Logger.error(FileFactory.class, "EditFileAction._saveWorkingFileData(): " + iofile.getName() + " cannot be erased. Please check the file permissions."); } catch (Exception e) { Logger.error(FileFactory.class, "EditFileAction._saveWorkingFileData(): " + e.getMessage()); } } } } } } }
void function(File file, File destination, java.io.File newDataFile) throws IOException { String fileName = file.getFileName(); String assetsPath = APILocator.getFileAPI().getRealAssetsRootPath(); new java.io.File(assetsPath).mkdir(); java.io.File workingFile = getAssetIOFile(file); DotResourceCache vc = CacheLocator.getVeloctyResourceCache(); vc.remove(ResourceManager.RESOURCE_TEMPLATE + workingFile.getPath()); if (destination != null && InodeUtils.isSet(destination.getInode())) { java.io.File newVersionFile = getAssetIOFile(destination); FileUtils.copyFile(workingFile, newVersionFile); } if (newDataFile != null) { FileUtils.copyFile(newDataFile, workingFile); file.setSize((int) newDataFile.length()); if (UtilMethods.isImage(fileName)) { InputStream in = null; try { in = new BufferedInputStream(new FileInputStream(workingFile)); byte[] imageData = new byte[in.available()]; in.read(imageData); Image image = Toolkit.getDefaultToolkit().createImage(imageData); MediaTracker mediaTracker = new MediaTracker(new Container()); mediaTracker.addImage(image, 0); mediaTracker.waitForID(0); int imageWidth = image.getWidth(null); int imageHeight = image.getHeight(null); in.close(); in = null; file.setHeight(imageHeight); file.setWidth(imageWidth); } catch (Exception e) { Logger.error(FileFactory.class, STR + workingFile + STR + e.getMessage()); throw new IOException(e); } finally { if (in != null) { try { in.close(); } catch (Exception e) { Logger.error(FileFactory.class, STR + e.getMessage()); } } } } String inode = file.getInode(); if (UtilMethods.isSet(inode)) { String realAssetPath = APILocator.getFileAPI().getRealAssetPath(); java.io.File tumbnailDir = new java.io.File(realAssetPath + java.io.File.separator + STR + java.io.File.separator + inode.charAt(0) + java.io.File.separator + inode.charAt(1)); if (tumbnailDir != null) { java.io.File[] files = tumbnailDir.listFiles(); if (files != null) { for (java.io.File iofile : files) { try { if (iofile.getName().startsWith(STR)) { iofile.delete(); } } catch (SecurityException e) { Logger.error(FileFactory.class, STR + iofile.getName() + STR); } catch (Exception e) { Logger.error(FileFactory.class, STR + e.getMessage()); } } } } } } }
/** * This method will copy the file data from file to version if version is * not null and version inode > 0 and will replace current file data if * newData passed is not null * * @param file * @param version * @param newData * @throws IOException * @throws Exception */
This method will copy the file data from file to version if version is not null and version inode > 0 and will replace current file data if newData passed is not null
saveFileData
{ "repo_name": "ggonzales/ksl", "path": "src/com/dotmarketing/portlets/files/business/FileFactoryImpl.java", "license": "gpl-3.0", "size": 33922 }
[ "com.dotmarketing.business.APILocator", "com.dotmarketing.business.CacheLocator", "com.dotmarketing.portlets.files.model.File", "com.dotmarketing.util.InodeUtils", "com.dotmarketing.util.Logger", "com.dotmarketing.util.UtilMethods", "com.dotmarketing.velocity.DotResourceCache", "java.awt.Container", "java.awt.Image", "java.awt.MediaTracker", "java.awt.Toolkit", "java.io.BufferedInputStream", "java.io.FileInputStream", "java.io.IOException", "java.io.InputStream", "org.apache.commons.io.FileUtils", "org.apache.velocity.runtime.resource.ResourceManager" ]
import com.dotmarketing.business.APILocator; import com.dotmarketing.business.CacheLocator; import com.dotmarketing.portlets.files.model.File; import com.dotmarketing.util.InodeUtils; import com.dotmarketing.util.Logger; import com.dotmarketing.util.UtilMethods; import com.dotmarketing.velocity.DotResourceCache; import java.awt.Container; import java.awt.Image; import java.awt.MediaTracker; import java.awt.Toolkit; import java.io.BufferedInputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import org.apache.commons.io.FileUtils; import org.apache.velocity.runtime.resource.ResourceManager;
import com.dotmarketing.business.*; import com.dotmarketing.portlets.files.model.*; import com.dotmarketing.util.*; import com.dotmarketing.velocity.*; import java.awt.*; import java.io.*; import org.apache.commons.io.*; import org.apache.velocity.runtime.resource.*;
[ "com.dotmarketing.business", "com.dotmarketing.portlets", "com.dotmarketing.util", "com.dotmarketing.velocity", "java.awt", "java.io", "org.apache.commons", "org.apache.velocity" ]
com.dotmarketing.business; com.dotmarketing.portlets; com.dotmarketing.util; com.dotmarketing.velocity; java.awt; java.io; org.apache.commons; org.apache.velocity;
2,663,008
public Hyphenation hyphenationFromAttibutes(Element elm) { if (notEmptyAttribute(elm, "hyphenation-lang") && notEmptyAttribute(elm, "hyphenation-country")) { String country = elm.getAttribute("hyphenation-lang"); String lang = elm.getAttribute("hyphenation-country"); return new Hyphenation(country, lang); } else return null; } public static class Hyphenation { private String country; private String lang; public Hyphenation(String country, String lang) { super(); this.country = country; this.lang = lang; }
Hyphenation function(Element elm) { if (notEmptyAttribute(elm, STR) && notEmptyAttribute(elm, STR)) { String country = elm.getAttribute(STR); String lang = elm.getAttribute(STR); return new Hyphenation(country, lang); } else return null; } public static class Hyphenation { private String country; private String lang; public Hyphenation(String country, String lang) { super(); this.country = country; this.lang = lang; }
/** * Construct Hyphenation object from given element * @param elm XML element * @return Hyphenation object * @see Hyphenation */
Construct Hyphenation object from given element
hyphenationFromAttibutes
{ "repo_name": "moravianlibrary/kramerius", "path": "common/src/main/java/cz/incad/kramerius/pdf/commands/AbstractITextCommand.java", "license": "gpl-3.0", "size": 3119 }
[ "org.w3c.dom.Element" ]
import org.w3c.dom.Element;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,102,916
public boolean handleComponentClick(ITextComponent component) { ClickEvent clickevent = component.getStyle().getClickEvent(); if (clickevent == null) { return false; } else if (clickevent.getAction() == ClickEvent.Action.CHANGE_PAGE) { String s = clickevent.getValue(); try { int i = Integer.parseInt(s) - 1; if (i >= 0 && i < this.bookTotalPages && i != this.currPage) { this.currPage = i; this.updateButtons(); return true; } } catch (Throwable var5) { ; } return false; } else { boolean flag = super.handleComponentClick(component); if (flag && clickevent.getAction() == ClickEvent.Action.RUN_COMMAND) { this.mc.displayGuiScreen((GuiScreen)null); } return flag; } }
boolean function(ITextComponent component) { ClickEvent clickevent = component.getStyle().getClickEvent(); if (clickevent == null) { return false; } else if (clickevent.getAction() == ClickEvent.Action.CHANGE_PAGE) { String s = clickevent.getValue(); try { int i = Integer.parseInt(s) - 1; if (i >= 0 && i < this.bookTotalPages && i != this.currPage) { this.currPage = i; this.updateButtons(); return true; } } catch (Throwable var5) { ; } return false; } else { boolean flag = super.handleComponentClick(component); if (flag && clickevent.getAction() == ClickEvent.Action.RUN_COMMAND) { this.mc.displayGuiScreen((GuiScreen)null); } return flag; } }
/** * Executes the click event specified by the given chat component */
Executes the click event specified by the given chat component
handleComponentClick
{ "repo_name": "TheGreatAndPowerfulWeegee/wipunknown", "path": "build/tmp/recompileMc/sources/net/minecraft/client/gui/GuiScreenBook.java", "license": "gpl-3.0", "size": 22174 }
[ "net.minecraft.util.text.ITextComponent", "net.minecraft.util.text.event.ClickEvent" ]
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.event.ClickEvent;
import net.minecraft.util.text.*; import net.minecraft.util.text.event.*;
[ "net.minecraft.util" ]
net.minecraft.util;
1,046,826
EDataType getEventTypeObject();
EDataType getEventTypeObject();
/** * Returns the meta object for data type '{@link org.camunda.bpm.modeler.runtime.engine.model.EventType <em>Event Type Object</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for data type '<em>Event Type Object</em>'. * @see org.camunda.bpm.modeler.runtime.engine.model.EventType * @model instanceClass="org.camunda.bpm.modeler.runtime.engine.model.EventType" * extendedMetaData="name='event_._1_._type:Object' baseType='event_._1_._type'" * @generated */
Returns the meta object for data type '<code>org.camunda.bpm.modeler.runtime.engine.model.EventType Event Type Object</code>'.
getEventTypeObject
{ "repo_name": "camunda/camunda-eclipse-plugin", "path": "org.camunda.bpm.modeler/src/org/camunda/bpm/modeler/runtime/engine/model/ModelPackage.java", "license": "epl-1.0", "size": 231785 }
[ "org.eclipse.emf.ecore.EDataType" ]
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
171,569
public static void main(String args[]) throws Exception { McastService service = new McastService(); java.util.Properties p = new java.util.Properties(); p.setProperty("mcastPort","5555"); p.setProperty("mcastAddress","224.10.10.10"); p.setProperty("mcastClusterDomain","catalina"); p.setProperty("bindAddress","localhost"); p.setProperty("memberDropTime","3000"); p.setProperty("mcastFrequency","500"); p.setProperty("tcpListenPort","4000"); p.setProperty("tcpListenHost","127.0.0.1"); p.setProperty("tcpSecurePort","4100"); p.setProperty("udpListenPort","4200"); service.setProperties(p); service.start(); Thread.sleep(60*1000*60); }
static void function(String args[]) throws Exception { McastService service = new McastService(); java.util.Properties p = new java.util.Properties(); p.setProperty(STR,"5555"); p.setProperty(STR,STR); p.setProperty(STR,STR); p.setProperty(STR,STR); p.setProperty(STR,"3000"); p.setProperty(STR,"500"); p.setProperty(STR,"4000"); p.setProperty(STR,STR); p.setProperty(STR,"4100"); p.setProperty(STR,"4200"); service.setProperties(p); service.start(); Thread.sleep(60*1000*60); }
/** * Simple test program * @param args Command-line arguments * @throws Exception If an error occurs */
Simple test program
main
{ "repo_name": "plumer/codana", "path": "tomcat_files/8.0.22/McastService.java", "license": "mit", "size": 19736 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
894,570
//------------------------- AUTOGENERATED START ------------------------- ///CLOVER:OFF public static InterpolatedDoublesCurve.Meta meta() { return InterpolatedDoublesCurve.Meta.INSTANCE; } static { JodaBeanUtils.registerMetaBean(InterpolatedDoublesCurve.Meta.INSTANCE); }
static InterpolatedDoublesCurve.Meta function() { return InterpolatedDoublesCurve.Meta.INSTANCE; } static { JodaBeanUtils.registerMetaBean(InterpolatedDoublesCurve.Meta.INSTANCE); }
/** * The meta-bean for {@code InterpolatedDoublesCurve}. * @return the meta-bean, not null */
The meta-bean for InterpolatedDoublesCurve
meta
{ "repo_name": "jeorme/OG-Platform", "path": "projects/OG-Analytics/src/main/java/com/opengamma/analytics/math/curve/InterpolatedDoublesCurve.java", "license": "apache-2.0", "size": 31352 }
[ "org.joda.beans.JodaBeanUtils" ]
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
1,345,912
public void unsetHarmonyHubGateway(HarmonyHubGateway harmonyHubGateway) { this.harmonyHubGateway = null; }
void function(HarmonyHubGateway harmonyHubGateway) { this.harmonyHubGateway = null; }
/** * un-wire our gateway from the IO package * * @param harmonyHubGateway */
un-wire our gateway from the IO package
unsetHarmonyHubGateway
{ "repo_name": "computergeek1507/openhab", "path": "bundles/binding/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/HarmonyHubBinding.java", "license": "epl-1.0", "size": 9554 }
[ "org.openhab.io.harmonyhub.HarmonyHubGateway" ]
import org.openhab.io.harmonyhub.HarmonyHubGateway;
import org.openhab.io.harmonyhub.*;
[ "org.openhab.io" ]
org.openhab.io;
2,377,713
public Builder setDirectories(Path installBase, Path outputBase, Path workspace) { this.directories = new BlazeDirectories(installBase, outputBase, workspace); return this; }
Builder function(Path installBase, Path outputBase, Path workspace) { this.directories = new BlazeDirectories(installBase, outputBase, workspace); return this; }
/** * Creates and sets a new {@link BlazeDirectories} instance with the given * parameters. */
Creates and sets a new <code>BlazeDirectories</code> instance with the given parameters
setDirectories
{ "repo_name": "charlieaustin/bazel", "path": "src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java", "license": "apache-2.0", "size": 69352 }
[ "com.google.devtools.build.lib.analysis.BlazeDirectories", "com.google.devtools.build.lib.vfs.Path" ]
import com.google.devtools.build.lib.analysis.BlazeDirectories; import com.google.devtools.build.lib.vfs.Path;
import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.vfs.*;
[ "com.google.devtools" ]
com.google.devtools;
2,160,791
public OperatorGraph build() { return new OperatorGraph(operators.values()); }
OperatorGraph function() { return new OperatorGraph(operators.values()); }
/** * Builds {@link OperatorGraph}. * @return the built graph */
Builds <code>OperatorGraph</code>
build
{ "repo_name": "asakusafw/asakusafw-compiler", "path": "compiler-project/tester/src/main/java/com/asakusafw/lang/compiler/tester/util/OperatorGraphBuilder.java", "license": "apache-2.0", "size": 11097 }
[ "com.asakusafw.lang.compiler.model.graph.OperatorGraph" ]
import com.asakusafw.lang.compiler.model.graph.OperatorGraph;
import com.asakusafw.lang.compiler.model.graph.*;
[ "com.asakusafw.lang" ]
com.asakusafw.lang;
2,194,733
public void startRecovery() { if ((state == DEGRADING) || (state == BEING_TREATED)) { // If no recovery period, then it's done. duration = getIllness().getRecoveryPeriod(); // Randomized the duration and varied it according to the complaint type if (type == ComplaintType.COLD || type == ComplaintType.FEVER) duration = duration + duration * RandomUtil.getRandomDouble(.5) - duration * RandomUtil.getRandomDouble(.5); else if (type == ComplaintType.HEARTBURN || type == ComplaintType.HIGH_FATIGUE_COLLAPSE || type == ComplaintType.PANIC_ATTACK || type == ComplaintType.DEPRESSION) duration = duration + duration * RandomUtil.getRandomDouble(.4) - duration * RandomUtil.getRandomDouble(.4); else if (type == ComplaintType.FLU) duration = duration + duration * RandomUtil.getRandomDouble(.3) - duration * RandomUtil.getRandomDouble(.3); else if (type == ComplaintType.STARVATION) duration = duration * (1 + RandomUtil.getRandomDouble(.1) - RandomUtil.getRandomDouble(.1)); else if (type == ComplaintType.DEHYDRATION) duration = duration * (1 + RandomUtil.getRandomDouble(.1) - RandomUtil.getRandomDouble(.1)); else duration = duration * (1 + RandomUtil.getRandomDouble(.1) - RandomUtil.getRandomDouble(.1)); // TODO: what to do with environmentally induced complaints ? do they need to be treated ? timePassed = 0D; if (duration > 0D) { setState(RECOVERING); if ((usedAid != null)) { if (usedAid.getProblemsBeingTreated().contains(this)) { usedAid.stopTreatment(this); } usedAid = null; } // Check if recovery requires bed rest. requiresBedRest = getIllness().requiresBedRestRecovery(); // if (requiresBedRest) // sufferer.getTaskSchedule().setShiftType(ShiftType.OFF); // Create medical event for recovering. MedicalEvent recoveringEvent = new MedicalEvent(sufferer, this, EventType.MEDICAL_RECOVERY); eventManager.registerNewEvent(recoveringEvent); } else { setCured(); // sufferer.getTaskSchedule().allocateAWorkShift(); } } }
void function() { if ((state == DEGRADING) (state == BEING_TREATED)) { duration = getIllness().getRecoveryPeriod(); if (type == ComplaintType.COLD type == ComplaintType.FEVER) duration = duration + duration * RandomUtil.getRandomDouble(.5) - duration * RandomUtil.getRandomDouble(.5); else if (type == ComplaintType.HEARTBURN type == ComplaintType.HIGH_FATIGUE_COLLAPSE type == ComplaintType.PANIC_ATTACK type == ComplaintType.DEPRESSION) duration = duration + duration * RandomUtil.getRandomDouble(.4) - duration * RandomUtil.getRandomDouble(.4); else if (type == ComplaintType.FLU) duration = duration + duration * RandomUtil.getRandomDouble(.3) - duration * RandomUtil.getRandomDouble(.3); else if (type == ComplaintType.STARVATION) duration = duration * (1 + RandomUtil.getRandomDouble(.1) - RandomUtil.getRandomDouble(.1)); else if (type == ComplaintType.DEHYDRATION) duration = duration * (1 + RandomUtil.getRandomDouble(.1) - RandomUtil.getRandomDouble(.1)); else duration = duration * (1 + RandomUtil.getRandomDouble(.1) - RandomUtil.getRandomDouble(.1)); timePassed = 0D; if (duration > 0D) { setState(RECOVERING); if ((usedAid != null)) { if (usedAid.getProblemsBeingTreated().contains(this)) { usedAid.stopTreatment(this); } usedAid = null; } requiresBedRest = getIllness().requiresBedRestRecovery(); MedicalEvent recoveringEvent = new MedicalEvent(sufferer, this, EventType.MEDICAL_RECOVERY); eventManager.registerNewEvent(recoveringEvent); } else { setCured(); } } }
/** * This is now moving to a recovery state. */
This is now moving to a recovery state
startRecovery
{ "repo_name": "mars-sim/mars-sim", "path": "mars-sim-core/src/main/java/org/mars_sim/msp/core/person/health/HealthProblem.java", "license": "gpl-3.0", "size": 13184 }
[ "org.mars_sim.msp.core.person.EventType", "org.mars_sim.msp.core.tool.RandomUtil" ]
import org.mars_sim.msp.core.person.EventType; import org.mars_sim.msp.core.tool.RandomUtil;
import org.mars_sim.msp.core.person.*; import org.mars_sim.msp.core.tool.*;
[ "org.mars_sim.msp" ]
org.mars_sim.msp;
1,020,688
IModel process(ImmutableMap<String, String> customData);
IModel process(ImmutableMap<String, String> customData);
/** * Allows the model to process custom data from the variant definition * @return a new model, with data applied */
Allows the model to process custom data from the variant definition
process
{ "repo_name": "luacs1998/MinecraftForge", "path": "src/main/java/net/minecraftforge/client/model/IModelCustomData.java", "license": "lgpl-2.1", "size": 341 }
[ "com.google.common.collect.ImmutableMap" ]
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.*;
[ "com.google.common" ]
com.google.common;
445,572
private Result pdecimalNumeral(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case '0': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; continue; } default: } } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } default: } } // Done. yyError = yyError.select("decimal numeral expected", yyStart); return yyError; } // =========================================================================
Result function(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case '0': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; continue; } default: } } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } default: } } yyError = yyError.select(STR, yyStart); return yyError; }
/** * Parse nonterminal * org.netbeans.modules.scala.core.rats.Character.decimalNumeral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */
Parse nonterminal org.netbeans.modules.scala.core.rats.Character.decimalNumeral
pdecimalNumeral
{ "repo_name": "vnkmr7620/kojo", "path": "ScalaEditorLite/src/org/netbeans/modules/scala/core/rats/LexerScala.java", "license": "gpl-3.0", "size": 391546 }
[ "java.io.IOException", "xtc.parser.ParseError", "xtc.parser.Result", "xtc.parser.SemanticValue" ]
import java.io.IOException; import xtc.parser.ParseError; import xtc.parser.Result; import xtc.parser.SemanticValue;
import java.io.*; import xtc.parser.*;
[ "java.io", "xtc.parser" ]
java.io; xtc.parser;
1,635,080
public Sup removeChild(Node child){ children.remove(child); return this; }
Sup function(Node child){ children.remove(child); return this; }
/** * Removes the child node * @param child node to be removed * @return the node */
Removes the child node
removeChild
{ "repo_name": "abdulmudabir/Gagawa", "path": "src/com/hp/gagawa/java/elements/Sup.java", "license": "mit", "size": 4530 }
[ "com.hp.gagawa.java.Node" ]
import com.hp.gagawa.java.Node;
import com.hp.gagawa.java.*;
[ "com.hp.gagawa" ]
com.hp.gagawa;
1,058,074
@Override public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception { final String baseDir = getResourceTestDirectory(); return manager.resolveFile("zip:res:" + baseDir + "/test.zip"); }
FileObject function(final FileSystemManager manager) throws Exception { final String baseDir = getResourceTestDirectory(); return manager.resolveFile(STR + baseDir + STR); }
/** * Returns the base folder for tests. */
Returns the base folder for tests
getBaseTestFolder
{ "repo_name": "apache/commons-vfs", "path": "commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/res/Vfs444TestCase.java", "license": "apache-2.0", "size": 4591 }
[ "org.apache.commons.vfs2.FileObject", "org.apache.commons.vfs2.FileSystemManager", "org.apache.commons.vfs2.VfsTestUtils" ]
import org.apache.commons.vfs2.FileObject; import org.apache.commons.vfs2.FileSystemManager; import org.apache.commons.vfs2.VfsTestUtils;
import org.apache.commons.vfs2.*;
[ "org.apache.commons" ]
org.apache.commons;
2,060,035
public static StarColumnPredicate or( RolapStar.Column column, List<StarColumnPredicate> list) { return new ListColumnPredicate(column, list); }
static StarColumnPredicate function( RolapStar.Column column, List<StarColumnPredicate> list) { return new ListColumnPredicate(column, list); }
/** * Returns predicate which is the OR of a list of predicates. * * @param column Column being constrained * @param list List of predicates * @return Predicate which is an OR of the list of predicates */
Returns predicate which is the OR of a list of predicates
or
{ "repo_name": "Twixer/mondrian-3.1.5", "path": "src/main/mondrian/rolap/agg/AbstractColumnPredicate.java", "license": "epl-1.0", "size": 7099 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,540,245
public void addEquality(Aliasing v_1, Aliasing v_2) { if( frozen ) throw new IllegalStateException("Cannot change frozen object. Get a mutable copy to do this."); if( knownPredicates.containsKey(v_1) ) { this.addIdenticalPredicate(v_1, v_2); } else if( knownPredicates.containsKey(v_2) ) { this.addIdenticalPredicate(v_2, v_1); } if( knownImplications.containsKey(v_1) ) { this.addIdenticalImplication(v_1, v_2); } else if( knownImplications.containsKey(v_2) ) { this.addIdenticalImplication(v_2, v_1); } }
void function(Aliasing v_1, Aliasing v_2) { if( frozen ) throw new IllegalStateException(STR); if( knownPredicates.containsKey(v_1) ) { this.addIdenticalPredicate(v_1, v_2); } else if( knownPredicates.containsKey(v_2) ) { this.addIdenticalPredicate(v_2, v_1); } if( knownImplications.containsKey(v_1) ) { this.addIdenticalImplication(v_1, v_2); } else if( knownImplications.containsKey(v_2) ) { this.addIdenticalImplication(v_2, v_1); } }
/** * Record the fact that the two variables given are equal. * @param v_1 * @param v_2 */
Record the fact that the two variables given are equal
addEquality
{ "repo_name": "plaidgroup/plural", "path": "Plural/src/edu/cmu/cs/plural/concrete/DynamicStateLogic.java", "license": "gpl-2.0", "size": 26879 }
[ "edu.cmu.cs.crystal.analysis.alias.Aliasing" ]
import edu.cmu.cs.crystal.analysis.alias.Aliasing;
import edu.cmu.cs.crystal.analysis.alias.*;
[ "edu.cmu.cs" ]
edu.cmu.cs;
1,968,202
@ServiceMethod(returns = ReturnType.SINGLE) Response<ForwardingRuleInner> updateWithResponse( String resourceGroupName, String dnsForwardingRulesetName, String forwardingRuleName, ForwardingRulePatch parameters, String ifMatch, Context context);
@ServiceMethod(returns = ReturnType.SINGLE) Response<ForwardingRuleInner> updateWithResponse( String resourceGroupName, String dnsForwardingRulesetName, String forwardingRuleName, ForwardingRulePatch parameters, String ifMatch, Context context);
/** * Updates a forwarding rule in a DNS forwarding ruleset. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dnsForwardingRulesetName The name of the DNS forwarding ruleset. * @param forwardingRuleName The name of the forwarding rule. * @param parameters Parameters supplied to the Update operation. * @param ifMatch ETag of the resource. Omit this value to always overwrite the current resource. Specify the * last-seen ETag value to prevent accidentally overwriting any concurrent changes. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a forwarding rule within a DNS forwarding ruleset along with {@link Response}. */
Updates a forwarding rule in a DNS forwarding ruleset
updateWithResponse
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/dnsresolver/azure-resourcemanager-dnsresolver/src/main/java/com/azure/resourcemanager/dnsresolver/fluent/ForwardingRulesClient.java", "license": "mit", "size": 11640 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context", "com.azure.resourcemanager.dnsresolver.fluent.models.ForwardingRuleInner", "com.azure.resourcemanager.dnsresolver.models.ForwardingRulePatch" ]
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.dnsresolver.fluent.models.ForwardingRuleInner; import com.azure.resourcemanager.dnsresolver.models.ForwardingRulePatch;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.dnsresolver.fluent.models.*; import com.azure.resourcemanager.dnsresolver.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
672,742
public boolean allQuantity(List<? extends IStoreItem> selection) { // are they all temporal? boolean allValid = true; for (int i = 0; i < selection.size(); i++) { IStoreItem thisI = selection.get(i); if (thisI instanceof ICollection) { ICollection thisC = (ICollection) thisI; if (!thisC.isQuantity()) { // oops, no allValid = false; break; } } else { allValid = false; break; } } return allValid; }
boolean function(List<? extends IStoreItem> selection) { boolean allValid = true; for (int i = 0; i < selection.size(); i++) { IStoreItem thisI = selection.get(i); if (thisI instanceof ICollection) { ICollection thisC = (ICollection) thisI; if (!thisC.isQuantity()) { allValid = false; break; } } else { allValid = false; break; } } return allValid; }
/** * check if the series are all quantity datasets * * @param selection * @return true/false */
check if the series are all quantity datasets
allQuantity
{ "repo_name": "pecko/limpet", "path": "info.limpet/src/info/limpet/data/operations/CollectionComplianceTests.java", "license": "epl-1.0", "size": 29577 }
[ "info.limpet.ICollection", "info.limpet.IStoreItem", "java.util.List" ]
import info.limpet.ICollection; import info.limpet.IStoreItem; import java.util.List;
import info.limpet.*; import java.util.*;
[ "info.limpet", "java.util" ]
info.limpet; java.util;
2,887,091
public ServiceReference getServiceReference() { return autoConfigure.getServiceReference(); }
ServiceReference function() { return autoConfigure.getServiceReference(); }
/** * Answer the service reference of the configured service * * @return the service reference of the configured service */
Answer the service reference of the configured service
getServiceReference
{ "repo_name": "ChiralBehaviors/vishnu", "path": "vishnu/src/main/java/com/chiralBehaviors/autoconfigure/AutoConfigureService.java", "license": "apache-2.0", "size": 5253 }
[ "com.hellblazer.slp.ServiceReference" ]
import com.hellblazer.slp.ServiceReference;
import com.hellblazer.slp.*;
[ "com.hellblazer.slp" ]
com.hellblazer.slp;
594,882
protected Object resolveSpringBean(FacesContext facesContext, String name) { BeanFactory bf = getBeanFactory(facesContext); if (bf.containsBean(name)) { if (logger.isTraceEnabled()) { logger.trace("Successfully resolved variable '" + name + "' in Spring BeanFactory"); } return bf.getBean(name); } else { return null; } }
Object function(FacesContext facesContext, String name) { BeanFactory bf = getBeanFactory(facesContext); if (bf.containsBean(name)) { if (logger.isTraceEnabled()) { logger.trace(STR + name + STR); } return bf.getBean(name); } else { return null; } }
/** * Resolve the attribute as a Spring bean in the ApplicationContext. */
Resolve the attribute as a Spring bean in the ApplicationContext
resolveSpringBean
{ "repo_name": "GIP-RECIA/esco-grouper-ui", "path": "ext/bundles/org.springframework.web/src/main/java/org/springframework/web/jsf/DelegatingVariableResolver.java", "license": "apache-2.0", "size": 6893 }
[ "javax.faces.context.FacesContext", "org.springframework.beans.factory.BeanFactory" ]
import javax.faces.context.FacesContext; import org.springframework.beans.factory.BeanFactory;
import javax.faces.context.*; import org.springframework.beans.factory.*;
[ "javax.faces", "org.springframework.beans" ]
javax.faces; org.springframework.beans;
654,632
protected Section getSection(Composite parent) { return toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR | ExpandableComposite.FOCUS_TITLE); }
Section function(Composite parent) { return toolkit.createSection(parent, ExpandableComposite.TWISTIE ExpandableComposite.EXPANDED ExpandableComposite.TITLE_BAR ExpandableComposite.FOCUS_TITLE); }
/** * Creates a section in the given composite. */
Creates a section in the given composite
getSection
{ "repo_name": "zhangzhx/aws-toolkit-eclipse", "path": "bundles/com.amazonaws.eclipse.elasticbeanstalk/src/com/amazonaws/eclipse/elasticbeanstalk/server/ui/configEditor/EnvironmentConfigEditorSection.java", "license": "apache-2.0", "size": 17434 }
[ "org.eclipse.swt.widgets.Composite", "org.eclipse.ui.forms.widgets.ExpandableComposite", "org.eclipse.ui.forms.widgets.Section" ]
import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.forms.widgets.ExpandableComposite; import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.swt.widgets.*; import org.eclipse.ui.forms.widgets.*;
[ "org.eclipse.swt", "org.eclipse.ui" ]
org.eclipse.swt; org.eclipse.ui;
2,583,482
public PersistenceUnitRefType<T> description(String ... values) { if (values != null) { for(String name: values) { childNode.createChild("description").text(name); } } return this; }
PersistenceUnitRefType<T> function(String ... values) { if (values != null) { for(String name: values) { childNode.createChild(STR).text(name); } } return this; }
/** * Creates for all String objects representing <code>description</code> elements, * a new <code>description</code> element * @param values list of <code>description</code> objects * @return the current instance of <code>PersistenceUnitRefType<T></code> */
Creates for all String objects representing <code>description</code> elements, a new <code>description</code> element
description
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/javaee7/PersistenceUnitRefTypeImpl.java", "license": "epl-1.0", "size": 11000 }
[ "org.jboss.shrinkwrap.descriptor.api.javaee7.PersistenceUnitRefType" ]
import org.jboss.shrinkwrap.descriptor.api.javaee7.PersistenceUnitRefType;
import org.jboss.shrinkwrap.descriptor.api.javaee7.*;
[ "org.jboss.shrinkwrap" ]
org.jboss.shrinkwrap;
2,272,869
public void attemptToUpdateTableProgress(String tableId, String resetToken, String progressMessage, Long currentProgress, Long totalProgress) throws ConflictingUpdateException, NotFoundException;
void function(String tableId, String resetToken, String progressMessage, Long currentProgress, Long totalProgress) throws ConflictingUpdateException, NotFoundException;
/** * Attempt to update the progress of a table. Will fail if the passed * rest-token does not match the current reset-token indicating the table * change while it was being processed. * * @param tableId * @param resetToken * @param progressMessage * @param currentProgress * @param totalProgress * @throws ConflictingUpdateException * Thrown when the passed restToken does not match the current * resetToken. This indicates that the table was updated before * processing finished. * @throws NotFoundException */
Attempt to update the progress of a table. Will fail if the passed rest-token does not match the current reset-token indicating the table change while it was being processed
attemptToUpdateTableProgress
{ "repo_name": "hhu94/Synapse-Repository-Services", "path": "services/repository-managers/src/main/java/org/sagebionetworks/repo/manager/table/TableManagerSupport.java", "license": "apache-2.0", "size": 13042 }
[ "org.sagebionetworks.repo.model.ConflictingUpdateException", "org.sagebionetworks.repo.web.NotFoundException" ]
import org.sagebionetworks.repo.model.ConflictingUpdateException; import org.sagebionetworks.repo.web.NotFoundException;
import org.sagebionetworks.repo.model.*; import org.sagebionetworks.repo.web.*;
[ "org.sagebionetworks.repo" ]
org.sagebionetworks.repo;
1,673,550
@WebMethod @WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306") @RequestWrapper(localName = "createCustomFieldOption", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306", className = "com.google.api.ads.dfp.jaxws.v201306.CustomFieldServiceInterfacecreateCustomFieldOption") @ResponseWrapper(localName = "createCustomFieldOptionResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306", className = "com.google.api.ads.dfp.jaxws.v201306.CustomFieldServiceInterfacecreateCustomFieldOptionResponse") public CustomFieldOption createCustomFieldOption( @WebParam(name = "customFieldOption", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306") CustomFieldOption customFieldOption) throws ApiException_Exception ;
@WebResult(name = "rval", targetNamespace = STRcreateCustomFieldOptionSTRhttps: @ResponseWrapper(localName = "createCustomFieldOptionResponseSTRhttps: CustomFieldOption function( @WebParam(name = "customFieldOptionSTRhttps: CustomFieldOption customFieldOption) throws ApiException_Exception ;
/** * * Creates a new {@link CustomFieldOption}. * * The following fields are required: * <ul> * <li>{@link CustomFieldOption#displayName}</li> * <li>{@link CustomFieldOption#customFieldId}</li> * </ul> * * @param customFieldOption the custom field to create * @return the custom field option with its ID filled in * * * @param customFieldOption * @return * returns com.google.api.ads.dfp.jaxws.v201306.CustomFieldOption * @throws ApiException_Exception */
Creates a new <code>CustomFieldOption</code>. The following fields are required: <code>CustomFieldOption#displayName</code> <code>CustomFieldOption#customFieldId</code>
createCustomFieldOption
{ "repo_name": "nafae/developer", "path": "modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201306/CustomFieldServiceInterface.java", "license": "apache-2.0", "size": 18450 }
[ "javax.jws.WebParam", "javax.jws.WebResult", "javax.xml.ws.ResponseWrapper" ]
import javax.jws.WebParam; import javax.jws.WebResult; import javax.xml.ws.ResponseWrapper;
import javax.jws.*; import javax.xml.ws.*;
[ "javax.jws", "javax.xml" ]
javax.jws; javax.xml;
945,360
@Override public int hashCode() { return ~Objects.hashCode(name); }
int function() { return ~Objects.hashCode(name); }
/** * Returns a hash code value for this object. */
Returns a hash code value for this object
hashCode
{ "repo_name": "apache/sis", "path": "core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameToIdentifier.java", "license": "apache-2.0", "size": 12872 }
[ "java.util.Objects" ]
import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
2,044,121
User getUserByUserExtSource(PerunSession perunSession, UserExtSource userExtSource) throws UserNotExistsException, UserExtSourceNotExistsException, PrivilegeException;
User getUserByUserExtSource(PerunSession perunSession, UserExtSource userExtSource) throws UserNotExistsException, UserExtSourceNotExistsException, PrivilegeException;
/** * Returns user by his login in external source and external source. * * @param perunSession * @param userExtSource * @return selected user or throws UserNotExistsException in case the user doesn't exists * @throws InternalErrorException * @throws UserNotExistsException * @throws UserExtSourceNotExistsException * @throws PrivilegeException */
Returns user by his login in external source and external source
getUserByUserExtSource
{ "repo_name": "balcirakpeter/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/api/UsersManager.java", "license": "bsd-2-clause", "size": 50685 }
[ "cz.metacentrum.perun.core.api.exceptions.PrivilegeException", "cz.metacentrum.perun.core.api.exceptions.UserExtSourceNotExistsException", "cz.metacentrum.perun.core.api.exceptions.UserNotExistsException" ]
import cz.metacentrum.perun.core.api.exceptions.PrivilegeException; import cz.metacentrum.perun.core.api.exceptions.UserExtSourceNotExistsException; import cz.metacentrum.perun.core.api.exceptions.UserNotExistsException;
import cz.metacentrum.perun.core.api.exceptions.*;
[ "cz.metacentrum.perun" ]
cz.metacentrum.perun;
257,826
public int getRunLimit(Set<? extends Attribute> attributes);
int function(Set<? extends Attribute> attributes);
/** * Returns the index of the first character following the run * with respect to the given {@code attributes} containing the current character. */
Returns the index of the first character following the run with respect to the given attributes containing the current character
getRunLimit
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/openjdk/jdk/src/share/classes/java/text/AttributedCharacterIterator.java", "license": "mit", "size": 9462 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,705,548
void setOnPageChangeListener(ViewPager.OnPageChangeListener listener);
void setOnPageChangeListener(ViewPager.OnPageChangeListener listener);
/** * Set a page change listener which will receive forwarded events. * * @param listener */
Set a page change listener which will receive forwarded events
setOnPageChangeListener
{ "repo_name": "pzhangleo/android-base", "path": "base/src/main/java/com/zhp/base/ui/widget/PagerIndicator/PageIndicator.java", "license": "lgpl-3.0", "size": 1846 }
[ "android.support.v4.view.ViewPager" ]
import android.support.v4.view.ViewPager;
import android.support.v4.view.*;
[ "android.support" ]
android.support;
2,543,515
public NXmirror createNXmirror() { return new NXmirrorImpl(this); }
NXmirror function() { return new NXmirrorImpl(this); }
/** * Create a new NXmirror. */
Create a new NXmirror
createNXmirror
{ "repo_name": "colinpalmer/dawnsci", "path": "org.eclipse.dawnsci.nexus/autogen/org/eclipse/dawnsci/nexus/NexusNodeFactory.java", "license": "epl-1.0", "size": 25082 }
[ "org.eclipse.dawnsci.nexus.impl.NXmirrorImpl" ]
import org.eclipse.dawnsci.nexus.impl.NXmirrorImpl;
import org.eclipse.dawnsci.nexus.impl.*;
[ "org.eclipse.dawnsci" ]
org.eclipse.dawnsci;
306,326
GlobalFactory getGlobalFactory(); interface Literals { EClass CHANNEL_PRIORITY = eINSTANCE.getChannelPriority(); EReference CHANNEL_PRIORITY__ITEM = eINSTANCE.getChannelPriority_Item(); EClass CHANNEL_PRIORITY_ITEM = eINSTANCE.getChannelPriorityItem(); EClass CHANNEL_LIST = eINSTANCE.getChannelList(); EReference CHANNEL_LIST__CHANNEL_EXPRESSION = eINSTANCE.getChannelList_ChannelExpression(); EClass DEFAULT_CHANNEL_PRIORITY = eINSTANCE.getDefaultChannelPriority(); }
GlobalFactory getGlobalFactory(); interface Literals { EClass CHANNEL_PRIORITY = eINSTANCE.getChannelPriority(); EReference CHANNEL_PRIORITY__ITEM = eINSTANCE.getChannelPriority_Item(); EClass CHANNEL_PRIORITY_ITEM = eINSTANCE.getChannelPriorityItem(); EClass CHANNEL_LIST = eINSTANCE.getChannelList(); EReference CHANNEL_LIST__CHANNEL_EXPRESSION = eINSTANCE.getChannelList_ChannelExpression(); EClass DEFAULT_CHANNEL_PRIORITY = eINSTANCE.getDefaultChannelPriority(); }
/** * Returns the factory that creates the instances of the model. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the factory that creates the instances of the model. * @generated */
Returns the factory that creates the instances of the model.
getGlobalFactory
{ "repo_name": "uppaal-emf/uppaal", "path": "metamodel/org.muml.uppaal/src/org/muml/uppaal/declarations/global/GlobalPackage.java", "license": "epl-1.0", "size": 10433 }
[ "org.eclipse.emf.ecore.EClass", "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
397,889
public boolean matches(String test, List<Pattern> includes, List<Pattern> excludes) { boolean green = false; boolean red = false; for (Pattern include : includes) { if (include.matcher(test).matches()) { green = true; break; } else { red = true; } } boolean matches = green || !red; if (matches) { green = false; red = false; for (Pattern exclude : excludes) { if (!exclude.matcher(test).matches()) { green = true; break; } else { red = true; } } matches = green || !red; } return matches; } /** * {@inheritDoc}
boolean function(String test, List<Pattern> includes, List<Pattern> excludes) { boolean green = false; boolean red = false; for (Pattern include : includes) { if (include.matcher(test).matches()) { green = true; break; } else { red = true; } } boolean matches = green !red; if (matches) { green = false; red = false; for (Pattern exclude : excludes) { if (!exclude.matcher(test).matches()) { green = true; break; } else { red = true; } } matches = green !red; } return matches; } /** * {@inheritDoc}
/** * Check if the property name matches specified condition. * @param test test * @param includes includes * @param excludes excludes * @return true if it matches */
Check if the property name matches specified condition
matches
{ "repo_name": "tadayosi/switchyard", "path": "components/common/common/src/main/java/org/switchyard/component/common/composer/BaseRegexContextMapper.java", "license": "apache-2.0", "size": 6477 }
[ "java.util.List", "java.util.regex.Pattern" ]
import java.util.List; import java.util.regex.Pattern;
import java.util.*; import java.util.regex.*;
[ "java.util" ]
java.util;
1,146,924
private int getConfigurationIntOrDefaultValue(String configKey, int defaultValue) { int returnValue = defaultValue; try { ApplicationInfo ai = context.getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA); Bundle aBundle = ai.metaData; returnValue = aBundle.getInt(configKey); // Check if available if (returnValue == 0) { returnValue = defaultValue; } } catch (Exception e) { // Ignore and reset to default returnValue = defaultValue; } return returnValue; }
int function(String configKey, int defaultValue) { int returnValue = defaultValue; try { ApplicationInfo ai = context.getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA); Bundle aBundle = ai.metaData; returnValue = aBundle.getInt(configKey); if (returnValue == 0) { returnValue = defaultValue; } } catch (Exception e) { returnValue = defaultValue; } return returnValue; }
/** * Util method to get a configured int value from the application bundle information defined by the * given key. In case the entry doesn't exist or anyhting goes wrong, the defaultValue is returned. * * @param configKey * @param defaultValue * @return */
Util method to get a configured int value from the application bundle information defined by the given key. In case the entry doesn't exist or anyhting goes wrong, the defaultValue is returned
getConfigurationIntOrDefaultValue
{ "repo_name": "friederikewild/DroidAppRater", "path": "lib/src/de/devmob/android/apprater/AppRater.java", "license": "apache-2.0", "size": 14987 }
[ "android.content.pm.ApplicationInfo", "android.content.pm.PackageManager", "android.os.Bundle" ]
import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.os.Bundle;
import android.content.pm.*; import android.os.*;
[ "android.content", "android.os" ]
android.content; android.os;
131,535
@SuppressWarnings("unchecked") public void removeContainer(NodeId nodeId, ContainerId containerId, Set<String> allocationTags) { // Do nothing for empty allocation tags. if (allocationTags == null || allocationTags.isEmpty()) { return; } ApplicationId applicationId = containerId.getApplicationAttemptId().getApplicationId(); removeTags(nodeId, applicationId, allocationTags); if (LOG.isDebugEnabled()) { LOG.debug("Removed container=" + containerId + " with tags=[" + StringUtils.join(allocationTags, ",") + "]"); } }
@SuppressWarnings(STR) void function(NodeId nodeId, ContainerId containerId, Set<String> allocationTags) { if (allocationTags == null allocationTags.isEmpty()) { return; } ApplicationId applicationId = containerId.getApplicationAttemptId().getApplicationId(); removeTags(nodeId, applicationId, allocationTags); if (LOG.isDebugEnabled()) { LOG.debug(STR + containerId + STR + StringUtils.join(allocationTags, ",") + "]"); } }
/** * Notify container removed. * * @param nodeId nodeId * @param containerId containerId. * @param allocationTags allocation tags for given container */
Notify container removed
removeContainer
{ "repo_name": "szegedim/hadoop", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/constraint/AllocationTagsManager.java", "license": "apache-2.0", "size": 23724 }
[ "java.util.Set", "org.apache.commons.lang3.StringUtils", "org.apache.hadoop.yarn.api.records.ApplicationId", "org.apache.hadoop.yarn.api.records.ContainerId", "org.apache.hadoop.yarn.api.records.NodeId" ]
import java.util.Set; import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.api.records.NodeId;
import java.util.*; import org.apache.commons.lang3.*; import org.apache.hadoop.yarn.api.records.*;
[ "java.util", "org.apache.commons", "org.apache.hadoop" ]
java.util; org.apache.commons; org.apache.hadoop;
2,560,118
public int compare( Principal o1, Principal o2 ) { Collator collator = Collator.getInstance(); return collator.compare( o1.getName(), o2.getName() ); }
int function( Principal o1, Principal o2 ) { Collator collator = Collator.getInstance(); return collator.compare( o1.getName(), o2.getName() ); }
/** * Compares two Principal objects. * @param o1 the first Principal * @param o2 the second Principal * @return the result of the comparison * @see java.util.Comparator#compare(Object, Object) */
Compares two Principal objects
compare
{ "repo_name": "tateshitah/jspwiki", "path": "jspwiki-war/src/main/java/org/apache/wiki/auth/PrincipalComparator.java", "license": "apache-2.0", "size": 1663 }
[ "java.security.Principal", "java.text.Collator" ]
import java.security.Principal; import java.text.Collator;
import java.security.*; import java.text.*;
[ "java.security", "java.text" ]
java.security; java.text;
958,871
public TopicTypesClient getTopicTypes() { return this.topicTypes; } EventGridManagementClientImpl( HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; this.apiVersion = "2021-12-01"; this.domains = new DomainsClientImpl(this); this.domainTopics = new DomainTopicsClientImpl(this); this.eventSubscriptions = new EventSubscriptionsClientImpl(this); this.systemTopicEventSubscriptions = new SystemTopicEventSubscriptionsClientImpl(this); this.operations = new OperationsClientImpl(this); this.topics = new TopicsClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); this.systemTopics = new SystemTopicsClientImpl(this); this.extensionTopics = new ExtensionTopicsClientImpl(this); this.topicTypes = new TopicTypesClientImpl(this); }
TopicTypesClient function() { return this.topicTypes; } EventGridManagementClientImpl( HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; this.apiVersion = STR; this.domains = new DomainsClientImpl(this); this.domainTopics = new DomainTopicsClientImpl(this); this.eventSubscriptions = new EventSubscriptionsClientImpl(this); this.systemTopicEventSubscriptions = new SystemTopicEventSubscriptionsClientImpl(this); this.operations = new OperationsClientImpl(this); this.topics = new TopicsClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); this.systemTopics = new SystemTopicsClientImpl(this); this.extensionTopics = new ExtensionTopicsClientImpl(this); this.topicTypes = new TopicTypesClientImpl(this); }
/** * Gets the TopicTypesClient object to access its operations. * * @return the TopicTypesClient object. */
Gets the TopicTypesClient object to access its operations
getTopicTypes
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventGridManagementClientImpl.java", "license": "mit", "size": 15768 }
[ "com.azure.core.http.HttpPipeline", "com.azure.core.management.AzureEnvironment", "com.azure.core.util.serializer.SerializerAdapter", "com.azure.resourcemanager.eventgrid.fluent.TopicTypesClient", "java.time.Duration" ]
import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.resourcemanager.eventgrid.fluent.TopicTypesClient; import java.time.Duration;
import com.azure.core.http.*; import com.azure.core.management.*; import com.azure.core.util.serializer.*; import com.azure.resourcemanager.eventgrid.fluent.*; import java.time.*;
[ "com.azure.core", "com.azure.resourcemanager", "java.time" ]
com.azure.core; com.azure.resourcemanager; java.time;
2,254,002
public static UpdateExecution create(UpdateRequest updateRequest, Dataset dataset, Context context) { return make(updateRequest, dataset, null, context); } /** * Create an UpdateExecution appropriate to the datasetGraph, or null if no * available factory to make an UpdateExecution * * @param updateRequest * @param datasetGraph * @param context (null means use merge of global and graph store context)) * @return UpdateExec * @deprecated Use {@code UpdateExec.dataset(datasetGraph)... build()}
static UpdateExecution function(UpdateRequest updateRequest, Dataset dataset, Context context) { return make(updateRequest, dataset, null, context); } /** * Create an UpdateExecution appropriate to the datasetGraph, or null if no * available factory to make an UpdateExecution * * @param updateRequest * @param datasetGraph * @param context (null means use merge of global and graph store context)) * @return UpdateExec * @deprecated Use {@code UpdateExec.dataset(datasetGraph)... build()}
/** * Create an UpdateExecution appropriate to the datasetGraph, or null if no * available factory to make an UpdateExecution * * @param updateRequest * @param dataset * @param context (null means use merge of global and graph store context)) * @return UpdateExecution */
Create an UpdateExecution appropriate to the datasetGraph, or null if no available factory to make an UpdateExecution
create
{ "repo_name": "apache/jena", "path": "jena-arq/src/main/java/org/apache/jena/update/UpdateExecutionFactory.java", "license": "apache-2.0", "size": 21646 }
[ "org.apache.jena.query.Dataset", "org.apache.jena.sparql.exec.UpdateExec" ]
import org.apache.jena.query.Dataset; import org.apache.jena.sparql.exec.UpdateExec;
import org.apache.jena.query.*; import org.apache.jena.sparql.exec.*;
[ "org.apache.jena" ]
org.apache.jena;
1,405,431
@Override public void missionUpdate(MissionEvent event) { MissionEventType eventType = event.getType(); if (eventType == MissionEventType.DESIGNATION_EVENT || eventType == MissionEventType.PHASE_EVENT || eventType == MissionEventType.PHASE_DESCRIPTION_EVENT) { int index = missions.indexOf(event.getSource()); if ((index > -1) && (index < missions.size())) { SwingUtilities.invokeLater(new MissionListUpdater(MissionListUpdater.CHANGE, this, index)); } } }
void function(MissionEvent event) { MissionEventType eventType = event.getType(); if (eventType == MissionEventType.DESIGNATION_EVENT eventType == MissionEventType.PHASE_EVENT eventType == MissionEventType.PHASE_DESCRIPTION_EVENT) { int index = missions.indexOf(event.getSource()); if ((index > -1) && (index < missions.size())) { SwingUtilities.invokeLater(new MissionListUpdater(MissionListUpdater.CHANGE, this, index)); } } }
/** * Catch mission update event. * * @param event the mission event. */
Catch mission update event
missionUpdate
{ "repo_name": "mars-sim/mars-sim", "path": "mars-sim-ui/src/main/java/org/mars_sim/msp/ui/swing/tool/mission/MissionListModel.java", "license": "gpl-3.0", "size": 5740 }
[ "javax.swing.SwingUtilities", "org.mars_sim.msp.core.person.ai.mission.MissionEvent", "org.mars_sim.msp.core.person.ai.mission.MissionEventType" ]
import javax.swing.SwingUtilities; import org.mars_sim.msp.core.person.ai.mission.MissionEvent; import org.mars_sim.msp.core.person.ai.mission.MissionEventType;
import javax.swing.*; import org.mars_sim.msp.core.person.ai.mission.*;
[ "javax.swing", "org.mars_sim.msp" ]
javax.swing; org.mars_sim.msp;
2,218,719
public java.sql.DatabaseMetaData getMetaData() throws SQLException { return getMetaData(true, true); }
java.sql.DatabaseMetaData function() throws SQLException { return getMetaData(true, true); }
/** * A connection's database is able to provide information describing its * tables, its supported SQL grammar, its stored procedures, the * capabilities of this connection, etc. This information is made available * through a DatabaseMetaData object. * * @return a DatabaseMetaData object for this connection * @exception SQLException * if a database access error occurs */
A connection's database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, etc. This information is made available through a DatabaseMetaData object
getMetaData
{ "repo_name": "mwaylabs/mysql-connector-j", "path": "src/com/mysql/jdbc/ConnectionImpl.java", "license": "gpl-2.0", "size": 217278 }
[ "java.sql.DatabaseMetaData", "java.sql.SQLException" ]
import java.sql.DatabaseMetaData; import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,833,584
public void run() { while (ready) { try { buf.clear(); SocketAddress client = channel.receive(buf); buf.flip(); int totalRead = 0; int totalWrite = 0; int count = buf.getInt(); totalRead += buf.position(); buf.clear(); for (int i = 1; i <= count; i++) { channel.receive(buf); totalRead += buf.position(); buf.clear(); } buf.putInt(totalRead); int intSize = buf.position(); totalWrite += intSize; buf.flip(); channel.send(buf, client); buf.clear(); totalWrite += intSize; buf.putInt(totalWrite); buf.flip(); channel.send(buf, client); channel.close(); ready = false; } catch (SocketTimeoutException e) { ready = false; } catch (IOException e) { System.err.println("error while accepting connection"); e.printStackTrace(); } } } }
void function() { while (ready) { try { buf.clear(); SocketAddress client = channel.receive(buf); buf.flip(); int totalRead = 0; int totalWrite = 0; int count = buf.getInt(); totalRead += buf.position(); buf.clear(); for (int i = 1; i <= count; i++) { channel.receive(buf); totalRead += buf.position(); buf.clear(); } buf.putInt(totalRead); int intSize = buf.position(); totalWrite += intSize; buf.flip(); channel.send(buf, client); buf.clear(); totalWrite += intSize; buf.putInt(totalWrite); buf.flip(); channel.send(buf, client); channel.close(); ready = false; } catch (SocketTimeoutException e) { ready = false; } catch (IOException e) { System.err.println(STR); e.printStackTrace(); } } } }
/** * Executes the thread, i.e. waits for incoming connections. We assume * that an appropriate SO timeout is set so that this thread my stop * after certain seconds of no new connection (for graceful end of test * program). */
Executes the thread, i.e. waits for incoming connections. We assume that an appropriate SO timeout is set so that this thread my stop after certain seconds of no new connection (for graceful end of test program)
run
{ "repo_name": "SSEHUB/spassMeter", "path": "Instrumentation.ex/src/test/UDPIoChannelTest.java", "license": "apache-2.0", "size": 6314 }
[ "java.io.IOException", "java.net.SocketAddress", "java.net.SocketTimeoutException" ]
import java.io.IOException; import java.net.SocketAddress; import java.net.SocketTimeoutException;
import java.io.*; import java.net.*;
[ "java.io", "java.net" ]
java.io; java.net;
1,443,587
public byte getDataStructureType() { return ConsumerId.DATA_STRUCTURE_TYPE; }
byte function() { return ConsumerId.DATA_STRUCTURE_TYPE; }
/** * Return the type of Data Structure we marshal * * @return short representation of the type data structure */
Return the type of Data Structure we marshal
getDataStructureType
{ "repo_name": "Mark-Booth/daq-eclipse", "path": "uk.ac.diamond.org.apache.activemq/org/apache/activemq/openwire/v3/ConsumerIdMarshaller.java", "license": "epl-1.0", "size": 4841 }
[ "org.apache.activemq.command.ConsumerId" ]
import org.apache.activemq.command.ConsumerId;
import org.apache.activemq.command.*;
[ "org.apache.activemq" ]
org.apache.activemq;
1,258,434
List<String> getResidue();
List<String> getResidue();
/** * Returns an immutable copy of the residue, that is, the arguments that * have not been parsed. */
Returns an immutable copy of the residue, that is, the arguments that have not been parsed
getResidue
{ "repo_name": "kamalmarhubi/bazel", "path": "src/main/java/com/google/devtools/common/options/OptionsProvider.java", "license": "apache-2.0", "size": 2564 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,255,359
public HttpRoute determineRoute(HttpHost target, HttpRequest request, HttpContext context) throws HttpException;
HttpRoute function(HttpHost target, HttpRequest request, HttpContext context) throws HttpException;
/** * Determines the route for a request. * * @param target the target host for the request. * Implementations may accept <code>null</code> * if they can still determine a route, for example * to a default target or by inspecting the request. * @param request the request to execute * @param context the context to use for the subsequent execution. * Implementations may accept <code>null</code>. * * @return the route that the request should take * * @throws HttpException in case of a problem */
Determines the route for a request
determineRoute
{ "repo_name": "vuzzan/openclinic", "path": "src/org/apache/http/conn/routing/HttpRoutePlanner.java", "license": "apache-2.0", "size": 2708 }
[ "org.apache.http.HttpException", "org.apache.http.HttpHost", "org.apache.http.HttpRequest", "org.apache.http.protocol.HttpContext" ]
import org.apache.http.HttpException; import org.apache.http.HttpHost; import org.apache.http.HttpRequest; import org.apache.http.protocol.HttpContext;
import org.apache.http.*; import org.apache.http.protocol.*;
[ "org.apache.http" ]
org.apache.http;
920,096
protected void initBeanWrapper(BeanWrapper bw) { bw.setConversionService(getConversionService()); registerCustomEditors(bw); }
void function(BeanWrapper bw) { bw.setConversionService(getConversionService()); registerCustomEditors(bw); }
/** * Initialize the given BeanWrapper with the custom editors registered * with this factory. To be called for BeanWrappers that will create * and populate bean instances. * <p>The default implementation delegates to {@link #registerCustomEditors}. * Can be overridden in subclasses. * @param bw the BeanWrapper to initialize */
Initialize the given BeanWrapper with the custom editors registered with this factory. To be called for BeanWrappers that will create and populate bean instances. The default implementation delegates to <code>#registerCustomEditors</code>. Can be overridden in subclasses
initBeanWrapper
{ "repo_name": "lamsfoundation/lams", "path": "3rdParty_sources/spring/org/springframework/beans/factory/support/AbstractBeanFactory.java", "license": "gpl-2.0", "size": 67974 }
[ "org.springframework.beans.BeanWrapper" ]
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.*;
[ "org.springframework.beans" ]
org.springframework.beans;
738,166
@Generated @Selector("setLearningRate:") public native void setLearningRate(float value);
@Selector(STR) native void function(float value);
/** * [@property] learningRate * <p> * The learning rate. This property is 'readwrite' so that callers can implement a 'decay' during training */
[@property] learningRate The learning rate. This property is 'readwrite' so that callers can implement a 'decay' during training
setLearningRate
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/mlcompute/MLCOptimizer.java", "license": "apache-2.0", "size": 7388 }
[ "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;
1,233,572
@Message(id = 87, value = "Host-Controller is already shutdown.") IllegalStateException hostAlreadyShutdown(); // // @Message(id = 88, value = "No server-group called: %s") // OperationFailedException noServerGroupCalled(String groupName); // // @Message(id = 89, value = "No socket-binding-group called: %s") // OperationFailedException noSocketBindingGroupCalled(String groupName);
@Message(id = 87, value = STR) IllegalStateException hostAlreadyShutdown();
/** * Creates an exception indication that the host controller was already shutdown. * @return an {@link Exception} for the error */
Creates an exception indication that the host controller was already shutdown
hostAlreadyShutdown
{ "repo_name": "aloubyansky/wildfly-core", "path": "host-controller/src/main/java/org/jboss/as/host/controller/logging/HostControllerLogger.java", "license": "lgpl-2.1", "size": 65292 }
[ "org.jboss.logging.annotations.Message" ]
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.*;
[ "org.jboss.logging" ]
org.jboss.logging;
1,456,682
protected void addHasDuplicatesPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_DuplicationObject_hasDuplicates_feature"), getString("_UI_PropertyDescriptor_description", "_UI_DuplicationObject_hasDuplicates_feature", "_UI_DuplicationObject_type"), RelationsPackage.Literals.DUPLICATION_OBJECT__HAS_DUPLICATES, true, false, true, null, null, null)); }
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), RelationsPackage.Literals.DUPLICATION_OBJECT__HAS_DUPLICATES, true, false, true, null, null, null)); }
/** * This adds a property descriptor for the Has Duplicates feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a property descriptor for the Has Duplicates feature.
addHasDuplicatesPropertyDescriptor
{ "repo_name": "KAMP-Research/KAMP", "path": "bundles/Toometa/toometa.requirements.edit/src/requirements/provider/RequirementItemProvider.java", "license": "apache-2.0", "size": 23285 }
[ "org.eclipse.emf.edit.provider.ComposeableAdapterFactory" ]
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,269,914