method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public void setIdempotentRepository(IdempotentRepository<String> idempotentRepository) { this.idempotentRepository = idempotentRepository; }
void function(IdempotentRepository<String> idempotentRepository) { this.idempotentRepository = idempotentRepository; }
/** * A pluggable repository org.apache.camel.spi.IdempotentRepository which by default use MemoryMessageIdRepository * if none is specified and idempotent is true. */
A pluggable repository org.apache.camel.spi.IdempotentRepository which by default use MemoryMessageIdRepository if none is specified and idempotent is true
setIdempotentRepository
{ "repo_name": "jlpedrosa/camel", "path": "camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java", "license": "apache-2.0", "size": 58194 }
[ "org.apache.camel.spi.IdempotentRepository" ]
import org.apache.camel.spi.IdempotentRepository;
import org.apache.camel.spi.*;
[ "org.apache.camel" ]
org.apache.camel;
1,178,018
public static int createPreSplitLoadTestTable(Configuration conf, HTableDescriptor desc, HColumnDescriptor hcd, int numRegionsPerServer) throws IOException { if (!desc.hasFamily(hcd.getName())) { desc.addFamily(hcd); } int totalNumberOfRegions = 0; Connection unmanagedConnection = Connect...
static int function(Configuration conf, HTableDescriptor desc, HColumnDescriptor hcd, int numRegionsPerServer) throws IOException { if (!desc.hasFamily(hcd.getName())) { desc.addFamily(hcd); } int totalNumberOfRegions = 0; Connection unmanagedConnection = ConnectionFactory.createConnection(conf); Admin admin = unmanage...
/** * Creates a pre-split table for load testing. If the table already exists, * logs a warning and continues. * @return the number of regions the table was split into */
Creates a pre-split table for load testing. If the table already exists, logs a warning and continues
createPreSplitLoadTestTable
{ "repo_name": "toshimasa-nasu/hbase", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java", "license": "apache-2.0", "size": 134883 }
[ "java.io.IOException", "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.hbase.client.Admin", "org.apache.hadoop.hbase.client.Connection", "org.apache.hadoop.hbase.client.ConnectionFactory", "org.apache.hadoop.hbase.util.RegionSplitter" ]
import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.ConnectionFactory; import org.apache.hadoop.hbase.util.RegionSplitter;
import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.util.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,981,175
public Request indexTemplate(ComposableIndexTemplate template) { this.indexTemplate = template; return this; }
Request function(ComposableIndexTemplate template) { this.indexTemplate = template; return this; }
/** * The index template that will be inserted into the cluster state */
The index template that will be inserted into the cluster state
indexTemplate
{ "repo_name": "gingerwizard/elasticsearch", "path": "server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutComposableIndexTemplateAction.java", "license": "apache-2.0", "size": 7310 }
[ "org.elasticsearch.cluster.metadata.ComposableIndexTemplate" ]
import org.elasticsearch.cluster.metadata.ComposableIndexTemplate;
import org.elasticsearch.cluster.metadata.*;
[ "org.elasticsearch.cluster" ]
org.elasticsearch.cluster;
2,047,033
protected DataKeyMapper<T> createKeyMapper( ValueProvider<T, Object> identifierGetter) { return new KeyMapper<T>(identifierGetter); }
DataKeyMapper<T> function( ValueProvider<T, Object> identifierGetter) { return new KeyMapper<T>(identifierGetter); }
/** * Creates a {@link DataKeyMapper} to use with this DataCommunicator. * <p> * This method is called from the constructor. * * @param identifierGetter * has to return a unique key for every bean, and the returned * key has to follow general {@code hashCode()} a...
Creates a <code>DataKeyMapper</code> to use with this DataCommunicator. This method is called from the constructor
createKeyMapper
{ "repo_name": "mstahv/framework", "path": "server/src/main/java/com/vaadin/data/provider/DataCommunicator.java", "license": "apache-2.0", "size": 25380 }
[ "com.vaadin.data.ValueProvider", "com.vaadin.server.KeyMapper" ]
import com.vaadin.data.ValueProvider; import com.vaadin.server.KeyMapper;
import com.vaadin.data.*; import com.vaadin.server.*;
[ "com.vaadin.data", "com.vaadin.server" ]
com.vaadin.data; com.vaadin.server;
115,183
accepting = true; while(accepting && !closed) { echo("Closed: " + closed + " Accepting: " + accepting, LOG_PRI); try { echo("Listening for client connections", LOG_PRI); Connection cli = new Connection(this, server.accept(), clients.size()); echo(cli.getIP() + ":" + cli.getPort() + " has connected...
accepting = true; while(accepting && !closed) { echo(STR + closed + STR + accepting, LOG_PRI); try { echo(STR, LOG_PRI); Connection cli = new Connection(this, server.accept(), clients.size()); echo(cli.getIP() + ":" + cli.getPort() + STR + cli.getID() + ")" , LOG_PRI); Thread cthread = new Thread(cli); cthread.setName(...
/** * <b>Run</b><br> * Listens for and accepts client connections. <br> * Starts connection thread and indexes the connection in Client array */
Run Listens for and accepts client connections. Starts connection thread and indexes the connection in Client array
run
{ "repo_name": "shiro-nk/SwiftDrive", "path": "swiftdrive/src/sd/swiftserver/rk/net/Server.java", "license": "gpl-3.0", "size": 6500 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,710,426
protected void validateRequest(HttpRequestBuffer httpReq) throws HttpBufferException { if (!HttpConstants.Methods.GET.equals(httpReq.getMethod())) { throw new MethodNotAllowedException(httpReq.getMethod(), new String[] { HttpConstants.Methods.GET }); } // This is actually already validated by HttpMess...
void function(HttpRequestBuffer httpReq) throws HttpBufferException { if (!HttpConstants.Methods.GET.equals(httpReq.getMethod())) { throw new MethodNotAllowedException(httpReq.getMethod(), new String[] { HttpConstants.Methods.GET }); } String lenStr = httpReq.getHeaderValue(HttpConstants.Headers.CONTENT_LENGTH); if (le...
/** * Validate an XML-RPC HTTP request. * <p> * This implementation checks for the following * cases: * <ul> * <li>The HTTP method specified is <code>GET</code>.</li> * <li><code>Content-Length</code> is absent or set to zero.</li> * </ul> * @param httpReq * The complete HTTP message to v...
Validate an XML-RPC HTTP request. This implementation checks for the following cases: The HTTP method specified is <code>GET</code>. <code>Content-Length</code> is absent or set to zero.
validateRequest
{ "repo_name": "lukehutch/gribbit-rox", "path": "attic/src/com/flat502/rox/server/CgiRequestUnmarshaller.java", "license": "bsd-3-clause", "size": 2487 }
[ "com.flat502.rox.http.HttpBufferException", "com.flat502.rox.http.HttpConstants", "com.flat502.rox.http.HttpRequestBuffer", "com.flat502.rox.http.InvalidHeaderException", "com.flat502.rox.http.MethodNotAllowedException" ]
import com.flat502.rox.http.HttpBufferException; import com.flat502.rox.http.HttpConstants; import com.flat502.rox.http.HttpRequestBuffer; import com.flat502.rox.http.InvalidHeaderException; import com.flat502.rox.http.MethodNotAllowedException;
import com.flat502.rox.http.*;
[ "com.flat502.rox" ]
com.flat502.rox;
24,529
public static void evaluateCheckConstraints ( GeneratedMethod checkGM, Activation activation ) throws StandardException { if (checkGM != null) { // Evaluate the expression containing the check constraints. // This expression will throw an exception if there is a // violation, so there is no n...
static void function ( GeneratedMethod checkGM, Activation activation ) throws StandardException { if (checkGM != null) { checkGM.invoke(activation); } }
/** * Run check constraints against the current row. Raise an error if * a check constraint is violated. * * @param checkGM Generated code to run the check constraint. * @param activation Class in which checkGM lives. * * @exception StandardException thrown on error */
Run check constraints against the current row. Raise an error if a check constraint is violated
evaluateCheckConstraints
{ "repo_name": "SnappyDataInc/snappy-store", "path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/internal/impl/sql/execute/NoRowsResultSetImpl.java", "license": "apache-2.0", "size": 23363 }
[ "com.pivotal.gemfirexd.internal.iapi.error.StandardException", "com.pivotal.gemfirexd.internal.iapi.services.loader.GeneratedMethod", "com.pivotal.gemfirexd.internal.iapi.sql.Activation" ]
import com.pivotal.gemfirexd.internal.iapi.error.StandardException; import com.pivotal.gemfirexd.internal.iapi.services.loader.GeneratedMethod; import com.pivotal.gemfirexd.internal.iapi.sql.Activation;
import com.pivotal.gemfirexd.internal.iapi.error.*; import com.pivotal.gemfirexd.internal.iapi.services.loader.*; import com.pivotal.gemfirexd.internal.iapi.sql.*;
[ "com.pivotal.gemfirexd" ]
com.pivotal.gemfirexd;
1,064,490
DatabaseTable getDatabaseInformationPublishedComponentsTable() { return getDataBase().getTable(WalletPublisherMiddlewareDatabaseConstants.INFORMATION_PUBLISHED_COMPONENTS_TABLE_NAME); }
DatabaseTable getDatabaseInformationPublishedComponentsTable() { return getDataBase().getTable(WalletPublisherMiddlewareDatabaseConstants.INFORMATION_PUBLISHED_COMPONENTS_TABLE_NAME); }
/** * Return the DatabaseTable * * @return DatabaseTable */
Return the DatabaseTable
getDatabaseInformationPublishedComponentsTable
{ "repo_name": "fvasquezjatar/fermat-unused", "path": "WPD/plugin/middleware/fermat-wpd-plugin-middleware-wallet-publisher-bitdubai/src/main/java/com/bitdubai/fermat_wpd_plugin/layer/middleware/wallet_publisher/developer/bitdubai/version_1/database/InformationPublishedComponentDao.java", "license": "mit", "size...
[ "com.bitdubai.fermat_api.layer.osa_android.database_system.DatabaseTable" ]
import com.bitdubai.fermat_api.layer.osa_android.database_system.DatabaseTable;
import com.bitdubai.fermat_api.layer.osa_android.database_system.*;
[ "com.bitdubai.fermat_api" ]
com.bitdubai.fermat_api;
2,256,182
protected Object doExecute( final InteractionSpec spec, final Record inputRecord, final Record outputRecord, final RecordExtractor outputExtractor) throws DataAccessException {
Object function( final InteractionSpec spec, final Record inputRecord, final Record outputRecord, final RecordExtractor outputExtractor) throws DataAccessException {
/** * Execute the specified interaction on an EIS with CCI. * All other interaction execution methods go through this. * @param spec the CCI InteractionSpec instance that defines * the interaction (connector-specific) * @param inputRecord the input record * @param outputRecord output record (can be <code>nu...
Execute the specified interaction on an EIS with CCI. All other interaction execution methods go through this
doExecute
{ "repo_name": "cbeams-archive/spring-framework-2.5.x", "path": "src/org/springframework/jca/cci/core/CciTemplate.java", "license": "apache-2.0", "size": 15864 }
[ "javax.resource.cci.InteractionSpec", "javax.resource.cci.Record", "org.springframework.dao.DataAccessException" ]
import javax.resource.cci.InteractionSpec; import javax.resource.cci.Record; import org.springframework.dao.DataAccessException;
import javax.resource.cci.*; import org.springframework.dao.*;
[ "javax.resource", "org.springframework.dao" ]
javax.resource; org.springframework.dao;
426,590
public static BufferedImage toCompatibleImage(BufferedImage image) { if (image.getColorModel().equals(CONFIGURATION.getColorModel())) { return image; } BufferedImage compatibleImage = CONFIGURATION.createCompatibleImage( image.getWidth(), image.getHeight(), image...
static BufferedImage function(BufferedImage image) { if (image.getColorModel().equals(CONFIGURATION.getColorModel())) { return image; } BufferedImage compatibleImage = CONFIGURATION.createCompatibleImage( image.getWidth(), image.getHeight(), image.getTransparency()); Graphics g = compatibleImage.getGraphics(); g.drawIm...
/** * <p>Return a new compatible image that contains a copy of the specified * image. This method ensures an image is compatible with the hardware, * and therefore optimized for fast blitting operations.</p> * * @see #createCompatibleImage(java.awt.image.BufferedImage) * @see #createCompat...
Return a new compatible image that contains a copy of the specified image. This method ensures an image is compatible with the hardware, and therefore optimized for fast blitting operations
toCompatibleImage
{ "repo_name": "mmilosavljevic/horizon", "path": "filemanager/GraphicsUtilities.java", "license": "gpl-3.0", "size": 24943 }
[ "java.awt.Graphics", "java.awt.image.BufferedImage" ]
import java.awt.Graphics; import java.awt.image.BufferedImage;
import java.awt.*; import java.awt.image.*;
[ "java.awt" ]
java.awt;
1,744,011
@POST @Consumes(MediaType.APPLICATION_SPARQL_QUERY) Response post(Query query, @QueryParam(DEFAULT_GRAPH_URI) List<URI> defaultGraphUris, @QueryParam(NAMED_GRAPH_URI) List<URI> namedGraphUris);
@POST @Consumes(MediaType.APPLICATION_SPARQL_QUERY) Response post(Query query, @QueryParam(DEFAULT_GRAPH_URI) List<URI> defaultGraphUris, @QueryParam(NAMED_GRAPH_URI) List<URI> namedGraphUris);
/** * Handles direct POST query request and returns result as response * * @param query the submitted SPARQL query * @param defaultGraphUris default graph URI * @param namedGraphUris named graph URI * @return result response (in one of the representation variants) * @see <a href="htt...
Handles direct POST query request and returns result as response
post
{ "repo_name": "AtomGraph/Core", "path": "src/main/java/com/atomgraph/core/model/SPARQLEndpoint.java", "license": "apache-2.0", "size": 4852 }
[ "com.atomgraph.core.MediaType", "java.util.List", "javax.ws.rs.Consumes", "javax.ws.rs.QueryParam", "javax.ws.rs.core.Response", "org.apache.jena.query.Query" ]
import com.atomgraph.core.MediaType; import java.util.List; import javax.ws.rs.Consumes; import javax.ws.rs.QueryParam; import javax.ws.rs.core.Response; import org.apache.jena.query.Query;
import com.atomgraph.core.*; import java.util.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.apache.jena.query.*;
[ "com.atomgraph.core", "java.util", "javax.ws", "org.apache.jena" ]
com.atomgraph.core; java.util; javax.ws; org.apache.jena;
505,819
public boolean containsX509Data() { return containsElement(WSS4JConstants.SIG_NS, WSS4JConstants.X509_DATA_LN); }
boolean function() { return containsElement(WSS4JConstants.SIG_NS, WSS4JConstants.X509_DATA_LN); }
/** * Method containsX509Data * * @return true if the <code>SecurityTokenReference</code> contains * a <code>ds:X509Data</code> element */
Method containsX509Data
containsX509Data
{ "repo_name": "apache/wss4j", "path": "ws-security-common/src/main/java/org/apache/wss4j/common/token/SecurityTokenReference.java", "license": "apache-2.0", "size": 25394 }
[ "org.apache.wss4j.common.WSS4JConstants" ]
import org.apache.wss4j.common.WSS4JConstants;
import org.apache.wss4j.common.*;
[ "org.apache.wss4j" ]
org.apache.wss4j;
915,880
public int evaluate(OverworldStage stage);
int function(OverworldStage stage);
/** * Returns the client ID of the winner, * or -1 if there is no winner. * * @param stage the stage * @return the int */
Returns the client ID of the winner, or -1 if there is no winner
evaluate
{ "repo_name": "eliatlarge/FEMultiPlayer-V2", "path": "src/net/fe/overworldStage/objective/Objective.java", "license": "gpl-3.0", "size": 523 }
[ "net.fe.overworldStage.OverworldStage" ]
import net.fe.overworldStage.OverworldStage;
import net.fe.*;
[ "net.fe" ]
net.fe;
2,028,380
public List<Integer> getInNeighbors(int v) { List<Integer> inNeighbors = new ArrayList<Integer>(); for (int i = 0; i < getNumVertices(); i ++) { for (int j=0; j< adjMatrix[i][v]; j++) { inNeighbors.add(i); } } return inNeighbors; }
List<Integer> function(int v) { List<Integer> inNeighbors = new ArrayList<Integer>(); for (int i = 0; i < getNumVertices(); i ++) { for (int j=0; j< adjMatrix[i][v]; j++) { inNeighbors.add(i); } } return inNeighbors; }
/** * Implement the abstract method for finding all * in-neighbors of a vertex. * If there are multiple edges from another vertex * to this one, the neighbor * appears once in the list for each of these edges. * * @param v the index of vertex. * @return List<Integer> a list of indices of vert...
Implement the abstract method for finding all in-neighbors of a vertex. If there are multiple edges from another vertex to this one, the neighbor appears once in the list for each of these edges
getInNeighbors
{ "repo_name": "fierlion/Java-Graphs", "path": "src/basicgraph/GraphAdjMatrix.java", "license": "apache-2.0", "size": 4260 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
965,019
private String getParameter(Map<String, String> params, String key, String defaultValue) { String value = params.get(key); return (value != null) ? value : defaultValue; }
String function(Map<String, String> params, String key, String defaultValue) { String value = params.get(key); return (value != null) ? value : defaultValue; }
/** * Returns a parameter value from the module parameters, * or a given default value in case the parameter is not set.<p> * * @param params the parameter map to get a value from * @param key the parameter to return the value for * @param defaultValue the default value in case there...
Returns a parameter value from the module parameters, or a given default value in case the parameter is not set
getParameter
{ "repo_name": "alkacon/opencms-core", "path": "src-modules/org/opencms/workplace/tools/sites/CmsSitesWebserverDialog.java", "license": "lgpl-2.1", "size": 15883 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
691,627
public SamzaSqlExecutionContext getExecutionContext() { return executionContext; }
SamzaSqlExecutionContext function() { return executionContext; }
/** * Gets execution context. * * @return the execution context */
Gets execution context
getExecutionContext
{ "repo_name": "TiVo/samza", "path": "samza-sql/src/main/java/org/apache/samza/sql/translator/TranslatorContext.java", "license": "apache-2.0", "size": 4706 }
[ "org.apache.samza.sql.data.SamzaSqlExecutionContext" ]
import org.apache.samza.sql.data.SamzaSqlExecutionContext;
import org.apache.samza.sql.data.*;
[ "org.apache.samza" ]
org.apache.samza;
27,361
String str = "abcdefghigklmnopkrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ0123456789"; Random random = new Random(); int mLen = str.length(); StringBuffer sf = new StringBuffer(); for (int i = 0; i < length; i++) { int number = random.nextInt(mLen);// 0~61 sf.append(str.c...
String str = STR; Random random = new Random(); int mLen = str.length(); StringBuffer sf = new StringBuffer(); for (int i = 0; i < length; i++) { int number = random.nextInt(mLen); sf.append(str.charAt(number)); } return sf.toString(); }
/** * get random string with a-z,A-Z, 0-9 * * @param length * @return */
get random string with a-z,A-Z, 0-9
getRandomStr
{ "repo_name": "lisicnu/droidUtil", "path": "src/main/java/com/github/lisicnu/libDroid/util/StringUtils.java", "license": "apache-2.0", "size": 4547 }
[ "java.util.Random" ]
import java.util.Random;
import java.util.*;
[ "java.util" ]
java.util;
2,573,185
public CompletableFuture<RemoteLogServer> showConfigRemoteLogServer(String switchAddress) { GrpcSession sender = new GrpcSession(mapper, switchAddress); return sender.login(name, password) .thenCompose(e -> sender.showConfigRemoteLogServer()) .thenApply(optional -> op...
CompletableFuture<RemoteLogServer> function(String switchAddress) { GrpcSession sender = new GrpcSession(mapper, switchAddress); return sender.login(name, password) .thenCompose(e -> sender.showConfigRemoteLogServer()) .thenApply(optional -> optional .map(mapper::map) .orElseThrow(() -> new GrpcException(format(STR, sw...
/** * Gets a config of a remote log server. * * @param switchAddress a switch address. * @return {@link CompletableFuture} with the execution result. */
Gets a config of a remote log server
showConfigRemoteLogServer
{ "repo_name": "jonvestal/open-kilda", "path": "src-java/grpc-speaker/grpc-service/src/main/java/org/openkilda/grpc/speaker/service/GrpcSenderService.java", "license": "apache-2.0", "size": 13699 }
[ "java.util.concurrent.CompletableFuture", "org.openkilda.grpc.speaker.client.GrpcSession", "org.openkilda.grpc.speaker.exception.GrpcException", "org.openkilda.messaging.model.grpc.RemoteLogServer" ]
import java.util.concurrent.CompletableFuture; import org.openkilda.grpc.speaker.client.GrpcSession; import org.openkilda.grpc.speaker.exception.GrpcException; import org.openkilda.messaging.model.grpc.RemoteLogServer;
import java.util.concurrent.*; import org.openkilda.grpc.speaker.client.*; import org.openkilda.grpc.speaker.exception.*; import org.openkilda.messaging.model.grpc.*;
[ "java.util", "org.openkilda.grpc", "org.openkilda.messaging" ]
java.util; org.openkilda.grpc; org.openkilda.messaging;
431,148
public static final Document parse(String xmlString) throws SAXException, IOException, ParserConfigurationException { if (xmlString != null) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); DocumentBuilder builder = factory.newDocumentBuilder(); ...
static final Document function(String xmlString) throws SAXException, IOException, ParserConfigurationException { if (xmlString != null) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); DocumentBuilder builder = factory.newDocumentBuilder(); InputSource is = new ...
/** * Parses the xmlString and returns a Document * * @param xmlString the xml string * @return the document * @throws SAXException the sAX exception * @throws IOException Signals that an I/O exception has occurred. * @throws ParserConfigurationException the parser configuration exception */
Parses the xmlString and returns a Document
parse
{ "repo_name": "Inhealthcare/open-inhealthcare", "path": "open-itk-base/src/main/java/uk/co/inhealthcare/open/itk/util/xml/DomUtils.java", "license": "apache-2.0", "size": 4234 }
[ "java.io.IOException", "java.io.StringReader", "javax.xml.parsers.DocumentBuilder", "javax.xml.parsers.DocumentBuilderFactory", "javax.xml.parsers.ParserConfigurationException", "org.w3c.dom.Document", "org.xml.sax.InputSource", "org.xml.sax.SAXException" ]
import java.io.IOException; import java.io.StringReader; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.xml.sax.InputSource; import org.xml.sax.SAXException;
import java.io.*; import javax.xml.parsers.*; import org.w3c.dom.*; import org.xml.sax.*;
[ "java.io", "javax.xml", "org.w3c.dom", "org.xml.sax" ]
java.io; javax.xml; org.w3c.dom; org.xml.sax;
2,338,462
public void setExtends(final Reference extendsRef) throws BuildException { if (isReference()) { throw tooManyAttributes(); } this.extendsRef = extendsRef; }
void function(final Reference extendsRef) throws BuildException { if (isReference()) { throw tooManyAttributes(); } this.extendsRef = extendsRef; }
/** * Specifies that this element extends the element with id attribute with a * matching value. The configuration will be constructed from the settings * of this element, element referenced by extends, and the containing cc * element. * * @param extendsRef * Reference to the extended pro...
Specifies that this element extends the element with id attribute with a matching value. The configuration will be constructed from the settings of this element, element referenced by extends, and the containing cc element
setExtends
{ "repo_name": "Zetten/nar-maven-plugin", "path": "src/main/java/com/github/maven_nar/cpptasks/ProcessorDef.java", "license": "apache-2.0", "size": 21482 }
[ "org.apache.tools.ant.BuildException", "org.apache.tools.ant.types.Reference" ]
import org.apache.tools.ant.BuildException; import org.apache.tools.ant.types.Reference;
import org.apache.tools.ant.*; import org.apache.tools.ant.types.*;
[ "org.apache.tools" ]
org.apache.tools;
1,283,514
void setResName(ResName resName);
void setResName(ResName resName);
/** * Sets the <code>ResName</code> attribute. * * @param resName * The <code>ResName</code> attribute. May be <code>null</code>. */
Sets the <code>ResName</code> attribute
setResName
{ "repo_name": "SAP/xliff-1-2", "path": "com.sap.mlt.xliff12.api/src/main/java/com/sap/mlt/xliff12/api/element/structural/BinUnit.java", "license": "apache-2.0", "size": 9132 }
[ "com.sap.mlt.xliff12.api.attribute.ResName" ]
import com.sap.mlt.xliff12.api.attribute.ResName;
import com.sap.mlt.xliff12.api.attribute.*;
[ "com.sap.mlt" ]
com.sap.mlt;
1,906,829
private void filterSpuriousVertices(final List<Segment> loop) { for (int i = 0; i < loop.size(); ++i) { final Segment previous = loop.get(i); int j = (i + 1) % loop.size(); final Segment next = loop.get(j); if (next != null && Precision.equals(...
void function(final List<Segment> loop) { for (int i = 0; i < loop.size(); ++i) { final Segment previous = loop.get(i); int j = (i + 1) % loop.size(); final Segment next = loop.get(j); if (next != null && Precision.equals(previous.getLine().getAngle(), next.getLine().getAngle(), Precision.EPSILON)) { loop.set(j, new Se...
/** Filter out spurious vertices on straight lines (at machine precision). * @param loop segments loop to filter (will be modified in-place) */
Filter out spurious vertices on straight lines (at machine precision)
filterSpuriousVertices
{ "repo_name": "najibghadri/NeuralNetworkSimulator", "path": "src/org/apache/commons/math3/geometry/euclidean/twod/PolygonsSet.java", "license": "mit", "size": 48264 }
[ "java.util.List", "org.apache.commons.math3.geometry.partitioning.BSPTree", "org.apache.commons.math3.util.Precision" ]
import java.util.List; import org.apache.commons.math3.geometry.partitioning.BSPTree; import org.apache.commons.math3.util.Precision;
import java.util.*; import org.apache.commons.math3.geometry.partitioning.*; import org.apache.commons.math3.util.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
1,709,706
public void printTo(Body b, PrintWriter out) { if (Main.VALIDATE) { b.validate(); } boolean isPrecise = !useAbbreviations(); String decl = b.getMethod().getDeclaration(); out.println(" " + decl); if (addJimpleLn()) { setJimpleLnNum(addJ...
void function(Body b, PrintWriter out) { if (Main.VALIDATE) { b.validate(); } boolean isPrecise = !useAbbreviations(); String decl = b.getMethod().getDeclaration(); out.println(" " + decl); if (addJimpleLn()) { setJimpleLnNum(addJimpleLnTags(getJimpleLnNum(), b.getMethod())); } out.println(STR); incJimpleLnNum(); UnitG...
/** * Prints out the method corresponding to b Body, (declaration and body), * in the textual format corresponding to the IR used to encode b body. * * @param out a PrintWriter instance to print to. */
Prints out the method corresponding to b Body, (declaration and body), in the textual format corresponding to the IR used to encode b body
printTo
{ "repo_name": "JulianSchuette/ConDroid", "path": "src/main/java/acteve/instrumentor/Printer.java", "license": "bsd-3-clause", "size": 15754 }
[ "java.io.PrintWriter" ]
import java.io.PrintWriter;
import java.io.*;
[ "java.io" ]
java.io;
1,118,214
public static synchronized void init() throws IOException, MarshalException, ValidationException { if (isInitialized()) { // init already called return; to reload, reload() will need to be called return; } OpennmsServerConfigFactory.init(); File cfgFile = Co...
static synchronized void function() throws IOException, MarshalException, ValidationException { if (isInitialized()) { return; } OpennmsServerConfigFactory.init(); File cfgFile = ConfigFileConstants.getFile(ConfigFileConstants.COLLECTD_CONFIG_FILE_NAME); log().debug(STR + cfgFile.getPath()); setInstance(new CollectdCon...
/** * Load the config from the default config file and create the singleton * instance of this factory. * * @exception java.io.IOException * Thrown if the specified config file cannot be read * @exception org.exolab.castor.xml.MarshalException * Thrown if...
Load the config from the default config file and create the singleton instance of this factory
init
{ "repo_name": "dzonekl/oss2nms", "path": "plugins/com.netxforge.oss2.config/src/com/netxforge/oss2/config/CollectdConfigFactory.java", "license": "gpl-3.0", "size": 10661 }
[ "java.io.File", "java.io.IOException", "org.exolab.castor.xml.MarshalException", "org.exolab.castor.xml.ValidationException", "org.opennms.core.utils.ConfigFileConstants" ]
import java.io.File; import java.io.IOException; import org.exolab.castor.xml.MarshalException; import org.exolab.castor.xml.ValidationException; import org.opennms.core.utils.ConfigFileConstants;
import java.io.*; import org.exolab.castor.xml.*; import org.opennms.core.utils.*;
[ "java.io", "org.exolab.castor", "org.opennms.core" ]
java.io; org.exolab.castor; org.opennms.core;
157,192
public void close() { if (this.reader != null) { try { this.reader.close(); this.reader = null; } catch (IOException e) { Log.warn("Failure while closing EventReader."); } } }
void function() { if (this.reader != null) { try { this.reader.close(); this.reader = null; } catch (IOException e) { Log.warn(STR); } } }
/** * Closes this {@link EventReader}. * <p> * You do not need to call this method if you read all lines of the file, * because {@link EventReader#readNext()} closes the reader if there are no * more lines to read. * </p> */
Closes this <code>EventReader</code>. You do not need to call this method if you read all lines of the file, because <code>EventReader#readNext()</code> closes the reader if there are no more lines to read.
close
{ "repo_name": "marcel-stud/DNA", "path": "src/dna/graph/generators/zalando/EventReader.java", "license": "gpl-3.0", "size": 3141 }
[ "dna.util.Log", "java.io.IOException" ]
import dna.util.Log; import java.io.IOException;
import dna.util.*; import java.io.*;
[ "dna.util", "java.io" ]
dna.util; java.io;
2,474,177
@Test @SmallTest public void testRecordCountHistogram() { String histogram = "HelloWorld.CountMetric"; HistogramDelta zeroCount = new HistogramDelta(histogram, 0); HistogramDelta oneCount = new HistogramDelta(histogram, 1); HistogramDelta twoCount = new HistogramDelta(histogr...
void function() { String histogram = STR; HistogramDelta zeroCount = new HistogramDelta(histogram, 0); HistogramDelta oneCount = new HistogramDelta(histogram, 1); HistogramDelta twoCount = new HistogramDelta(histogram, 2); HistogramDelta eightThousandCount = new HistogramDelta(histogram, 8000); Assert.assertEquals(0, z...
/** * Tests recording of count histograms. */
Tests recording of count histograms
testRecordCountHistogram
{ "repo_name": "endlessm/chromium-browser", "path": "base/android/javatests/src/org/chromium/base/metrics/RecordHistogramTest.java", "license": "bsd-3-clause", "size": 7832 }
[ "org.chromium.base.test.util.MetricsUtils", "org.junit.Assert" ]
import org.chromium.base.test.util.MetricsUtils; import org.junit.Assert;
import org.chromium.base.test.util.*; import org.junit.*;
[ "org.chromium.base", "org.junit" ]
org.chromium.base; org.junit;
2,236,690
public static final SourceModel.Expr ChainOfSeqs(SourceModel.Expr seqs, SourceModel.Expr expression) { return SourceModel.Expr.Application.make( new SourceModel.Expr[] {SourceModel.Expr.DataCons.make(DataConstructors.ChainOfSeqs), seqs, expression}); } public static final QualifiedName C...
static final SourceModel.Expr function(SourceModel.Expr seqs, SourceModel.Expr expression) { return SourceModel.Expr.Application.make( new SourceModel.Expr[] {SourceModel.Expr.DataCons.make(DataConstructors.ChainOfSeqs), seqs, expression}); } static final QualifiedName function = QualifiedName.make( CAL_Optimizer_Expre...
/** * Binding for DataConstructor: Cal.Internal.Optimizer_Expression.ChainOfSeqs. * @param seqs * @param expression * @return the SourceModule.Expr representing an application of Cal.Internal.Optimizer_Expression.ChainOfSeqs */
Binding for DataConstructor: Cal.Internal.Optimizer_Expression.ChainOfSeqs
ChainOfSeqs
{ "repo_name": "levans/Open-Quark", "path": "src/CAL_Platform/src/org/openquark/cal/internal/module/Cal/Internal/CAL_Optimizer_Expression_internal.java", "license": "bsd-3-clause", "size": 265925 }
[ "org.openquark.cal.compiler.QualifiedName", "org.openquark.cal.compiler.SourceModel" ]
import org.openquark.cal.compiler.QualifiedName; import org.openquark.cal.compiler.SourceModel;
import org.openquark.cal.compiler.*;
[ "org.openquark.cal" ]
org.openquark.cal;
1,092,203
private void update (JSONArray updates) { for (int i = 0; i < updates.length(); i++) { JSONObject update = updates.optJSONObject(i); int id = update.optInt("id", 0); Notification notification = getNotificationMgr().update(id, update, TriggerRece...
void function (JSONArray updates) { for (int i = 0; i < updates.length(); i++) { JSONObject update = updates.optJSONObject(i); int id = update.optInt("id", 0); Notification notification = getNotificationMgr().update(id, update, TriggerReceiver.class); if (notification == null) continue; fireEvent(STR, notification); } ...
/** * Update multiple local notifications. * * @param updates * Notification properties including their IDs */
Update multiple local notifications
update
{ "repo_name": "nozelrosario/Dcare", "path": "plugins/de.appplant.cordova.plugin.local-notification/src/android/LocalNotification.java", "license": "apache-2.0", "size": 19462 }
[ "de.appplant.cordova.plugin.notification.Notification", "org.json.JSONArray", "org.json.JSONObject" ]
import de.appplant.cordova.plugin.notification.Notification; import org.json.JSONArray; import org.json.JSONObject;
import de.appplant.cordova.plugin.notification.*; import org.json.*;
[ "de.appplant.cordova", "org.json" ]
de.appplant.cordova; org.json;
1,678,139
protected boolean canAnimateType(int type) { return type == SVGTypes.TYPE_TRANSFORM_LIST; }
boolean function(int type) { return type == SVGTypes.TYPE_TRANSFORM_LIST; }
/** * Returns whether the animation element being handled by this bridge can * animate attributes of the specified type. * @param type one of the TYPE_ constants defined in {@link SVGTypes}. */
Returns whether the animation element being handled by this bridge can animate attributes of the specified type
canAnimateType
{ "repo_name": "apache/batik", "path": "batik-bridge/src/main/java/org/apache/batik/bridge/SVGAnimateTransformElementBridge.java", "license": "apache-2.0", "size": 9705 }
[ "org.apache.batik.util.SVGTypes" ]
import org.apache.batik.util.SVGTypes;
import org.apache.batik.util.*;
[ "org.apache.batik" ]
org.apache.batik;
2,281,276
public final GroupData getGroupData() { return groupData; } public GroupInfo(AggregatorFactory aggregatorFactory, GraphSeriesSelector seriesSelector, GraphValueSelector valueSelector, boolean enableOverallSeries, boolean enableAggregatedKeysSeries) { ...
final GroupData function() { return groupData; } public GroupInfo(AggregatorFactory aggregatorFactory, GraphSeriesSelector seriesSelector, GraphValueSelector valueSelector, boolean enableOverallSeries, boolean enableAggregatedKeysSeries) { this.enableOverallSeries = enableOverallSeries; this.seriesSelector = seriesSele...
/** * Gets the group data. * * @return the group data */
Gets the group data
getGroupData
{ "repo_name": "ufctester/apache-jmeter", "path": "src/core/org/apache/jmeter/report/processor/graph/GroupInfo.java", "license": "apache-2.0", "size": 3557 }
[ "org.apache.jmeter.report.processor.AggregatorFactory" ]
import org.apache.jmeter.report.processor.AggregatorFactory;
import org.apache.jmeter.report.processor.*;
[ "org.apache.jmeter" ]
org.apache.jmeter;
2,288,706
protected void readyGoThenKill(Class<?> clazz, Bundle bundle) { Intent intent = new Intent(this, clazz); if (null != bundle) { intent.putExtras(bundle); } startActivity(intent); finish(); }
void function(Class<?> clazz, Bundle bundle) { Intent intent = new Intent(this, clazz); if (null != bundle) { intent.putExtras(bundle); } startActivity(intent); finish(); }
/** * startActivity with bundle then finish * * @param clazz * @param bundle */
startActivity with bundle then finish
readyGoThenKill
{ "repo_name": "duwenjun199081/qihaosou", "path": "app/src/main/java/com/qihaosou/ui/activity/BaseAppCompatActivity.java", "license": "apache-2.0", "size": 4729 }
[ "android.content.Intent", "android.os.Bundle" ]
import android.content.Intent; import android.os.Bundle;
import android.content.*; import android.os.*;
[ "android.content", "android.os" ]
android.content; android.os;
1,673,572
@Override public void onStopRefresh() { Log.d(SHACExtensionService.LOG_TAG, "stopRefesh"); // Cancel pending clock updates cancelScheduledRefresh(SHACExtensionService.EXTENSION_KEY); }
void function() { Log.d(SHACExtensionService.LOG_TAG, STR); cancelScheduledRefresh(SHACExtensionService.EXTENSION_KEY); }
/** * Stop refreshing the widget. The widget is no longer visible. */
Stop refreshing the widget. The widget is no longer visible
onStopRefresh
{ "repo_name": "house4hack/openSHAC", "path": "SmartWatch/SmartWatch SHAC/src/com/sonyericsson/extras/liveware/extension/shac/SHACWidget.java", "license": "mit", "size": 7585 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
932,026
@Transactional(readOnly = true) public TagDTO findOne(Long id) { log.debug("Request to get Tag : {}", id); Tag tag = tagRepository.findOne(id); TagDTO tagDTO = tagMapper.tagToTagDTO(tag); return tagDTO; }
@Transactional(readOnly = true) TagDTO function(Long id) { log.debug(STR, id); Tag tag = tagRepository.findOne(id); TagDTO tagDTO = tagMapper.tagToTagDTO(tag); return tagDTO; }
/** * Get one tag by id. * * @param id the id of the entity * @return the entity */
Get one tag by id
findOne
{ "repo_name": "mbocek/mymoney", "path": "account-service/src/main/java/org/mymoney/accountservice/service/impl/TagServiceImpl.java", "license": "apache-2.0", "size": 2300 }
[ "org.mymoney.accountservice.domain.Tag", "org.mymoney.accountservice.service.dto.TagDTO", "org.springframework.transaction.annotation.Transactional" ]
import org.mymoney.accountservice.domain.Tag; import org.mymoney.accountservice.service.dto.TagDTO; import org.springframework.transaction.annotation.Transactional;
import org.mymoney.accountservice.domain.*; import org.mymoney.accountservice.service.dto.*; import org.springframework.transaction.annotation.*;
[ "org.mymoney.accountservice", "org.springframework.transaction" ]
org.mymoney.accountservice; org.springframework.transaction;
1,368,210
public void readFromProperties(String prefix, Properties props) { for (Map.Entry<Object, Object> e : props.entrySet()) { String name = (String) e.getKey(); String value = (String) e.getValue(); if (name.startsWith(prefix)) { if (name.equalsIgnoreCase(prefi...
void function(String prefix, Properties props) { for (Map.Entry<Object, Object> e : props.entrySet()) { String name = (String) e.getKey(); String value = (String) e.getValue(); if (name.startsWith(prefix)) { if (name.equalsIgnoreCase(prefix + PROP_ALLOW_ZERO_HOP)) { if (!_isExploratory) _allowZeroHop = getBoolean(value...
/** * Defaults in props are NOT honored. * In-JVM client side must promote defaults to the primary map. * * @param prefix non-null */
Defaults in props are NOT honored. In-JVM client side must promote defaults to the primary map
readFromProperties
{ "repo_name": "NoYouShutup/CryptMeme", "path": "CryptMeme/router/java/src/net/i2p/router/TunnelPoolSettings.java", "license": "mit", "size": 15185 }
[ "java.util.Map", "java.util.Properties", "net.i2p.data.Base64", "net.i2p.data.Hash" ]
import java.util.Map; import java.util.Properties; import net.i2p.data.Base64; import net.i2p.data.Hash;
import java.util.*; import net.i2p.data.*;
[ "java.util", "net.i2p.data" ]
java.util; net.i2p.data;
2,098,702
@Override public Properties loadConfiguration() throws EzConfigurationLoaderException { EzProperties ezProperties = new EzProperties(); for(URL resourceToLoad : classpathResourceUrls) { logger.info("Attempting to load properties from: {}", resourceToLoad); Properties load...
Properties function() throws EzConfigurationLoaderException { EzProperties ezProperties = new EzProperties(); for(URL resourceToLoad : classpathResourceUrls) { logger.info(STR, resourceToLoad); Properties loaded = new Properties(); try { loaded.load(resourceToLoad.openStream()); ezProperties.mergeProperties(loaded, tru...
/** * This method actually loads the properties object. * * @return a properties object (Implementors should return a blank properties object if no properties are loaded) * @throws ezbake.configuration.EzConfigurationLoaderException if there is a problem trying to load properties */
This method actually loads the properties object
loadConfiguration
{ "repo_name": "crawlik/ezbake-common-java", "path": "configuration/src/main/java/ezbake/configuration/ClasspathConfigurationLoader.java", "license": "apache-2.0", "size": 5121 }
[ "java.io.IOException", "java.util.Properties" ]
import java.io.IOException; import java.util.Properties;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,244,266
private void ensureNotClosed() throws SQLException { if (closed) throw new SQLException("Connection is closed.", SqlStateCode.CONNECTION_CLOSED); }
void function() throws SQLException { if (closed) throw new SQLException(STR, SqlStateCode.CONNECTION_CLOSED); }
/** * Ensures that connection is not closed. * * @throws SQLException If connection is closed. */
Ensures that connection is not closed
ensureNotClosed
{ "repo_name": "WilliamDo/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcConnection.java", "license": "apache-2.0", "size": 32486 }
[ "java.sql.SQLException", "org.apache.ignite.internal.processors.odbc.SqlStateCode" ]
import java.sql.SQLException; import org.apache.ignite.internal.processors.odbc.SqlStateCode;
import java.sql.*; import org.apache.ignite.internal.processors.odbc.*;
[ "java.sql", "org.apache.ignite" ]
java.sql; org.apache.ignite;
980,124
public static View getView() { ViewLifecycle active = getActiveLifecycle(); if (active.view == null) { throw new IllegalStateException("Context view is not available"); } return active.view; }
static View function() { ViewLifecycle active = getActiveLifecycle(); if (active.view == null) { throw new IllegalStateException(STR); } return active.view; }
/** * Gets the view active within a lifecycle on the current thread. * * @return view active on the current thread */
Gets the view active within a lifecycle on the current thread
getView
{ "repo_name": "mztaylor/rice-git", "path": "rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/uif/lifecycle/ViewLifecycle.java", "license": "apache-2.0", "size": 31655 }
[ "org.kuali.rice.krad.uif.view.View" ]
import org.kuali.rice.krad.uif.view.View;
import org.kuali.rice.krad.uif.view.*;
[ "org.kuali.rice" ]
org.kuali.rice;
2,307,531
static void tearDownShiro() { try { SecurityManager securityManager = SecurityUtils.getSecurityManager(); LifecycleUtils.destroy(securityManager); } catch (UnavailableSecurityManagerException e) { // we don't care about this when cleaning up the test environment // (for...
static void tearDownShiro() { try { SecurityManager securityManager = SecurityUtils.getSecurityManager(); LifecycleUtils.destroy(securityManager); } catch (UnavailableSecurityManagerException e) { } ThreadContext.unbindSecurityManager(); ThreadContext.unbindSubject(); ThreadContext.remove(); SecurityUtils.setSecurityMa...
/** * Method description * */
Method description
tearDownShiro
{ "repo_name": "sdorra/shiro-unit", "path": "src/main/java/com/github/sdorra/shiro/ShiroRule.java", "license": "mit", "size": 4858 }
[ "org.apache.shiro.SecurityUtils", "org.apache.shiro.UnavailableSecurityManagerException", "org.apache.shiro.mgt.SecurityManager", "org.apache.shiro.util.LifecycleUtils", "org.apache.shiro.util.ThreadContext" ]
import org.apache.shiro.SecurityUtils; import org.apache.shiro.UnavailableSecurityManagerException; import org.apache.shiro.mgt.SecurityManager; import org.apache.shiro.util.LifecycleUtils; import org.apache.shiro.util.ThreadContext;
import org.apache.shiro.*; import org.apache.shiro.mgt.*; import org.apache.shiro.util.*;
[ "org.apache.shiro" ]
org.apache.shiro;
1,429,370
@GET("collection/{id}") Observable<NounCollection> getCollection(@Path("id") int id);
@GET(STR) Observable<NounCollection> getCollection(@Path("id") int id);
/** * Collection * Request http://api.thenounproject.com/collection/4 * @param id – collection id * @return Returns a single collection */
Collection Request HREF
getCollection
{ "repo_name": "graviton57/TheNounProject", "path": "app/src/main/java/com/havrylyuk/thenounproject/data/remote/ApiInterface.java", "license": "apache-2.0", "size": 6486 }
[ "com.havrylyuk.thenounproject.data.remote.model.NounCollection", "io.reactivex.Observable" ]
import com.havrylyuk.thenounproject.data.remote.model.NounCollection; import io.reactivex.Observable;
import com.havrylyuk.thenounproject.data.remote.model.*; import io.reactivex.*;
[ "com.havrylyuk.thenounproject", "io.reactivex" ]
com.havrylyuk.thenounproject; io.reactivex;
384,364
public XYSeries[] calc() throws ArithmeticException { //LOG.fine("calculating..."); double inertia = data.getInertia(); double n; //uebersetzungsverhaeltnis rolle zu motor boolean schleppEnable = data.isSchleppEnable(); double tempFactor = (1013 / data.getPressure()) * Math.sqrt((273 + data.g...
XYSeries[] function() throws ArithmeticException { double inertia = data.getInertia(); double n; boolean schleppEnable = data.isSchleppEnable(); double tempFactor = (1013 / data.getPressure()) * Math.sqrt((273 + data.getTemperature()) / 293); int removeCount = 0; ArrayList<Datapoint> tempList = data.getMeasureList(); f...
/** * calculates Power and Torque and updates the Chart * * @return */
calculates Power and Torque and updates the Chart
calc
{ "repo_name": "PMTDyno/Zweiradpruefstand", "path": "Zweiradpruefstand/src/measure/Calculate.java", "license": "gpl-3.0", "size": 9279 }
[ "java.util.ArrayList", "org.jfree.data.xy.XYSeries" ]
import java.util.ArrayList; import org.jfree.data.xy.XYSeries;
import java.util.*; import org.jfree.data.xy.*;
[ "java.util", "org.jfree.data" ]
java.util; org.jfree.data;
1,229,770
PendingIntent getAuthentificationNotificationContentIntent(Context context, DownloadRequest request);
PendingIntent getAuthentificationNotificationContentIntent(Context context, DownloadRequest request);
/** * Returns a PendingIntent for a notification that tells the user to enter a username * or a password for a requested download. * <p/> * The PendingIntent takes users to an Activity that lets the user enter their username * and password to retry the download. * * @return A non-null...
Returns a PendingIntent for a notification that tells the user to enter a username or a password for a requested download. The PendingIntent takes users to an Activity that lets the user enter their username and password to retry the download
getAuthentificationNotificationContentIntent
{ "repo_name": "johnjohndoe/AntennaPod", "path": "core/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java", "license": "mit", "size": 2002 }
[ "android.app.PendingIntent", "android.content.Context", "de.danoeh.antennapod.core.service.download.DownloadRequest" ]
import android.app.PendingIntent; import android.content.Context; import de.danoeh.antennapod.core.service.download.DownloadRequest;
import android.app.*; import android.content.*; import de.danoeh.antennapod.core.service.download.*;
[ "android.app", "android.content", "de.danoeh.antennapod" ]
android.app; android.content; de.danoeh.antennapod;
2,606,243
Authentication login(Authentication authentication) throws AuthenticationException, Exception;
Authentication login(Authentication authentication) throws AuthenticationException, Exception;
/** * Tries to login using the specified authentication object. If authentication succeeds, this method * will return without exceptions. * <p/> * Remember Me authentication is ignored * * @param authentication the authentication object to authenticate, must not be {@code null}. * @re...
Tries to login using the specified authentication object. If authentication succeeds, this method will return without exceptions. Remember Me authentication is ignored
login
{ "repo_name": "GJRTimmer/vaadin4spring", "path": "extensions/security/src/main/java/org/vaadin/spring/security/VaadinSecurity.java", "license": "apache-2.0", "size": 8211 }
[ "org.springframework.security.core.Authentication", "org.springframework.security.core.AuthenticationException" ]
import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.*;
[ "org.springframework.security" ]
org.springframework.security;
2,486,279
public boolean getBooleanProperty(String name, boolean defaultValue) { Bundle bundle = this.getIntent().getExtras(); if (bundle == null) { return defaultValue; } name = name.toLowerCase(Locale.getDefault()); Boolean p; try { p = (Boolean) bun...
boolean function(String name, boolean defaultValue) { Bundle bundle = this.getIntent().getExtras(); if (bundle == null) { return defaultValue; } name = name.toLowerCase(Locale.getDefault()); Boolean p; try { p = (Boolean) bundle.get(name); } catch (ClassCastException e) { String s = bundle.get(name).toString(); if ("tr...
/** * Get boolean property for activity. * * @param name * @param defaultValue * @return the boolean value of the named property */
Get boolean property for activity
getBooleanProperty
{ "repo_name": "ROGUE-JCTD/Arbiter-Android", "path": "Arbiter-Android/src/com/lmn/Arbiter_Android/Activities/MapActivity.java", "license": "mit", "size": 21477 }
[ "android.os.Bundle", "java.util.Locale" ]
import android.os.Bundle; import java.util.Locale;
import android.os.*; import java.util.*;
[ "android.os", "java.util" ]
android.os; java.util;
2,305,968
public static void Processing(String ID) { init(); try { Class.forName(driver).newInstance(); Connection conn = DriverManager.getConnection(url+dbName,userName,password); String insertQuery = "UPDATE video SET Status = ? WHERE ID = ?"; PreparedStatement pstmt = null; ...
static void function(String ID) { init(); try { Class.forName(driver).newInstance(); Connection conn = DriverManager.getConnection(url+dbName,userName,password); String insertQuery = STR; PreparedStatement pstmt = null; pstmt = conn.prepareStatement(insertQuery); pstmt.setString(1, STR); pstmt.setString(2, ID); pstmt.e...
/** * Sets the status of the video to 'Processing' * @param ID Video ID */
Sets the status of the video to 'Processing'
Processing
{ "repo_name": "learning-layers/Cloud-Video-Transcoder", "path": "ClViTra_2.0/src/main/java/de/dbis/db/Java2MySql.java", "license": "apache-2.0", "size": 13383 }
[ "java.sql.Connection", "java.sql.DriverManager", "java.sql.PreparedStatement" ]
import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,241,273
if (value == null) { return null; } if (value instanceof BytesRef) { return ((BytesRef) value).utf8ToString(); } return value.toString(); }
if (value == null) { return null; } if (value instanceof BytesRef) { return ((BytesRef) value).utf8ToString(); } return value.toString(); }
/** * Converts a value to a string, taking special care if its a {@link BytesRef} to call * {@link org.apache.lucene.util.BytesRef#utf8ToString()}. */
Converts a value to a string, taking special care if its a <code>BytesRef</code> to call <code>org.apache.lucene.util.BytesRef#utf8ToString()</code>
toString
{ "repo_name": "dongaihua/highlight-elasticsearch", "path": "src/main/java/org/elasticsearch/common/lucene/BytesRefs.java", "license": "apache-2.0", "size": 1969 }
[ "org.apache.lucene.util.BytesRef" ]
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.*;
[ "org.apache.lucene" ]
org.apache.lucene;
2,319,952
public void setClasspathRef(final Reference ref) { createClasspath().setRefid(ref); }
void function(final Reference ref) { createClasspath().setRefid(ref); }
/** * Set the classpath for loading * using the classpath reference. * * @param ref the refid to use */
Set the classpath for loading using the classpath reference
setClasspathRef
{ "repo_name": "russel/incubator-groovy", "path": "subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovy.java", "license": "apache-2.0", "size": 23530 }
[ "org.apache.tools.ant.types.Reference" ]
import org.apache.tools.ant.types.Reference;
import org.apache.tools.ant.types.*;
[ "org.apache.tools" ]
org.apache.tools;
2,500,854
public void setReplicationRole(ReplicationRole role) { List<InvocationAcceptancePolicy> policies = m_policies.get(null); if (policies != null) { for (InvocationAcceptancePolicy policy : policies) { if (policy instanceof ReplicaInvocationAcceptancePolicy) { ...
void function(ReplicationRole role) { List<InvocationAcceptancePolicy> policies = m_policies.get(null); if (policies != null) { for (InvocationAcceptancePolicy policy : policies) { if (policy instanceof ReplicaInvocationAcceptancePolicy) { policy.setMode(role == ReplicationRole.REPLICA); } } } }
/** * Called when the replication role of the cluster changes. * @param role */
Called when the replication role of the cluster changes
setReplicationRole
{ "repo_name": "eoneil1942/voltdb-4.7fix", "path": "src/frontend/org/voltdb/ClientInterface.java", "license": "agpl-3.0", "size": 126465 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
281,889
ExecPreparedStatement getPreparedStatement();
ExecPreparedStatement getPreparedStatement();
/** * Get the prepared statement that this activation is for. * * @return the prepared statement this activation is for. * */
Get the prepared statement that this activation is for
getPreparedStatement
{ "repo_name": "splicemachine/spliceengine", "path": "db-engine/src/main/java/com/splicemachine/db/iapi/sql/Activation.java", "license": "agpl-3.0", "size": 23428 }
[ "com.splicemachine.db.iapi.sql.execute.ExecPreparedStatement" ]
import com.splicemachine.db.iapi.sql.execute.ExecPreparedStatement;
import com.splicemachine.db.iapi.sql.execute.*;
[ "com.splicemachine.db" ]
com.splicemachine.db;
2,175,961
private void addOpt(char opt, String optType) { // ensure this is a new, not a redundant, option. Iterator it = options.iterator(); while (it.hasNext()) { Opt o = (Opt) it.next(); if (o.opt == opt) { o.multi = true; return; // already known } } if (opt != '?') options.add(new Opt(opt,...
void function(char opt, String optType) { Iterator it = options.iterator(); while (it.hasNext()) { Opt o = (Opt) it.next(); if (o.opt == opt) { o.multi = true; return; } } if (opt != '?') options.add(new Opt(opt, optType)); }
/** * Add the given option of the given type to the list of known options. * '?' is handled separately in <code>getOperands</code>. * * @see #getOperands * @see #usage */
Add the given option of the given type to the list of known options. '?' is handled separately in <code>getOperands</code>
addOpt
{ "repo_name": "pfirmstone/JGDMS", "path": "JGDMS/jgdms-lib/src/main/java/org/apache/river/system/POSIXCommandLine.java", "license": "apache-2.0", "size": 20679 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
479,389
public putMultiple_args setTable(byte[] table) { setTable(table == null ? (ByteBuffer)null : ByteBuffer.wrap(table)); return this; }
putMultiple_args function(byte[] table) { setTable(table == null ? (ByteBuffer)null : ByteBuffer.wrap(table)); return this; }
/** * the table to put data in */
the table to put data in
setTable
{ "repo_name": "Guavus/hbase", "path": "hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/THBaseService.java", "license": "apache-2.0", "size": 597913 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
2,801,952
@Override public Uri insert(Uri uri, ContentValues initialValues) { if (database == null || !database.isOpen()) database = databaseHelper.getWritableDatabase(); ContentValues values = (initialValues != null) ? new ContentValues( initialValues) : new ContentValues(); switch (sUriMatcher.match(uri)) { ...
Uri function(Uri uri, ContentValues initialValues) { if (database == null !database.isOpen()) database = databaseHelper.getWritableDatabase(); ContentValues values = (initialValues != null) ? new ContentValues( initialValues) : new ContentValues(); switch (sUriMatcher.match(uri)) { case SENSOR_DEV: long accel_id = data...
/** * Insert entry to the database */
Insert entry to the database
insert
{ "repo_name": "EEXCESS/android-app", "path": "Frameworks/aware_framework_v2/src/com/aware/providers/Gravity_Provider.java", "license": "mit", "size": 11695 }
[ "android.content.ContentUris", "android.content.ContentValues", "android.database.SQLException", "android.net.Uri" ]
import android.content.ContentUris; import android.content.ContentValues; import android.database.SQLException; import android.net.Uri;
import android.content.*; import android.database.*; import android.net.*;
[ "android.content", "android.database", "android.net" ]
android.content; android.database; android.net;
1,129,771
private void filterResults() { checkLimits(); final MemoryPeakResults newResults = new MemoryPeakResults(); newResults.copySettings(results); newResults.setName(results.getName() + " Filtered"); // Initialise the mask CoordFilter maskFilter; final ImagePlus maskImp = WindowManager.getIma...
void function() { checkLimits(); final MemoryPeakResults newResults = new MemoryPeakResults(); newResults.copySettings(results); newResults.setName(results.getName() + STR); CoordFilter maskFilter; final ImagePlus maskImp = WindowManager.getImage(filterSettings.getMaskTitle()); if (maskImp != null) { final int maxx = m...
/** * Apply the filters to the data. */
Apply the filters to the data
filterResults
{ "repo_name": "aherbert/GDSC-SMLM", "path": "src/main/java/uk/ac/sussex/gdsc/smlm/ij/plugins/FilterResults.java", "license": "gpl-3.0", "size": 13795 }
[ "java.awt.Rectangle", "uk.ac.sussex.gdsc.core.ij.ImageJUtils", "uk.ac.sussex.gdsc.core.logging.Ticker", "uk.ac.sussex.gdsc.core.utils.TextUtils", "uk.ac.sussex.gdsc.smlm.results.MemoryPeakResults", "uk.ac.sussex.gdsc.smlm.results.PeakResult" ]
import java.awt.Rectangle; import uk.ac.sussex.gdsc.core.ij.ImageJUtils; import uk.ac.sussex.gdsc.core.logging.Ticker; import uk.ac.sussex.gdsc.core.utils.TextUtils; import uk.ac.sussex.gdsc.smlm.results.MemoryPeakResults; import uk.ac.sussex.gdsc.smlm.results.PeakResult;
import java.awt.*; import uk.ac.sussex.gdsc.core.ij.*; import uk.ac.sussex.gdsc.core.logging.*; import uk.ac.sussex.gdsc.core.utils.*; import uk.ac.sussex.gdsc.smlm.results.*;
[ "java.awt", "uk.ac.sussex" ]
java.awt; uk.ac.sussex;
1,273,650
// Test with no parameters assertEquals(new JsStatement().$(null, "#aComponent").chain( new EffectTest()).render().toString(), "$('#aComponent').anEffect();"); // Test with a parameter assertEquals(new JsStatement().$(null, "#aComponent").chain( new EffectTest("'aaa'")).render().toString(), "$(...
assertEquals(new JsStatement().$(null, STR).chain( new EffectTest()).render().toString(), STR); assertEquals(new JsStatement().$(null, STR).chain( new EffectTest("'aaa'")).render().toString(), STR); assertEquals(new JsStatement().$(null, STR).chain( new EffectTest(EffectSpeed.SLOW, "'aaa'")).render().toString(), STR); ...
/** * Test method for * {@link org.odlabs.wiquery.core.effects.Effect#statementArgs()}. */
Test method for <code>org.odlabs.wiquery.core.effects.Effect#statementArgs()</code>
testStatementArgs
{ "repo_name": "openengsb-attic/forks-org.odlabs.wiquery", "path": "src/test/java/org/odlabs/wiquery/core/effects/EffectTestCase.java", "license": "mit", "size": 3234 }
[ "org.junit.Assert", "org.odlabs.wiquery.core.javascript.JsScope", "org.odlabs.wiquery.core.javascript.JsStatement" ]
import org.junit.Assert; import org.odlabs.wiquery.core.javascript.JsScope; import org.odlabs.wiquery.core.javascript.JsStatement;
import org.junit.*; import org.odlabs.wiquery.core.javascript.*;
[ "org.junit", "org.odlabs.wiquery" ]
org.junit; org.odlabs.wiquery;
2,713,820
public void fatal(Object message, Throwable t) { differentiatedLog(FATAL_MARKER, CATEGORY_FQCN, LocationAwareLogger.ERROR_INT, message, t); }
void function(Object message, Throwable t) { differentiatedLog(FATAL_MARKER, CATEGORY_FQCN, LocationAwareLogger.ERROR_INT, message, t); }
/** * Delegates to {@link org.slf4j.Logger#error(String,Throwable)} method in * SLF4J. In addition, the call is marked with a marker named "FATAL". */
Delegates to <code>org.slf4j.Logger#error(String,Throwable)</code> method in SLF4J. In addition, the call is marked with a marker named "FATAL"
fatal
{ "repo_name": "PRECISE/ROSLab", "path": "lib/slf4j-1.7.10/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java", "license": "apache-2.0", "size": 10156 }
[ "org.slf4j.spi.LocationAwareLogger" ]
import org.slf4j.spi.LocationAwareLogger;
import org.slf4j.spi.*;
[ "org.slf4j.spi" ]
org.slf4j.spi;
2,033,992
@Override public AppleBitcodeMode getBitcodeMode() { return getAppleBitcodeMode(applePlatformType, appleCpus, platformBitcodeModes); }
AppleBitcodeMode function() { return getAppleBitcodeMode(applePlatformType, appleCpus, platformBitcodeModes); }
/** * Returns the bitcode mode to use for compilation steps. This should only be invoked in * single-architecture contexts. * * <p>Users can control bitcode mode using the {@code apple_bitcode} build flag, but bitcode * will be disabled for all simulator architectures regardless of this flag. * * @...
Returns the bitcode mode to use for compilation steps. This should only be invoked in single-architecture contexts. Users can control bitcode mode using the apple_bitcode build flag, but bitcode will be disabled for all simulator architectures regardless of this flag
getBitcodeMode
{ "repo_name": "twitter-forks/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/apple/AppleConfiguration.java", "license": "apache-2.0", "size": 22106 }
[ "com.google.devtools.build.lib.rules.apple.AppleCommandLineOptions" ]
import com.google.devtools.build.lib.rules.apple.AppleCommandLineOptions;
import com.google.devtools.build.lib.rules.apple.*;
[ "com.google.devtools" ]
com.google.devtools;
2,839,554
void doWith(Method method) throws IllegalArgumentException, IllegalAccessException; }
void doWith(Method method) throws IllegalArgumentException, IllegalAccessException; }
/** * Perform an operation using the given method. * * @param method the method to operate on */
Perform an operation using the given method
doWith
{ "repo_name": "shuliangtao/apache-camel-2.13.0-src", "path": "camel-core/src/main/java/org/apache/camel/util/ReflectionHelper.java", "license": "apache-2.0", "size": 4554 }
[ "java.lang.reflect.Method" ]
import java.lang.reflect.Method;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
404,528
@Method(selector = "unblockBuddy:byUser:completionBlock:") public native void unblockBuddy(String buddyName, String userName, @Block App42ResponseBlock completionBlock);
@Method(selector = STR) native void function(String buddyName, String userName, @Block App42ResponseBlock completionBlock);
/** * Unblock User * * @param userName * : name of user who is unblocking the specific buddy * @param buddyName * : name of user to be unblocked * @return Buddy object * @throws App42Exception */
Unblock User
unblockBuddy
{ "repo_name": "mariamKh/robovm-ios-bindings", "path": "app42/src/org/robovm/bindings/app42/BuddyService.java", "license": "apache-2.0", "size": 11029 }
[ "org.robovm.objc.annotation.Block", "org.robovm.objc.annotation.Method" ]
import org.robovm.objc.annotation.Block; import org.robovm.objc.annotation.Method;
import org.robovm.objc.annotation.*;
[ "org.robovm.objc" ]
org.robovm.objc;
2,882,433
@Test public void testValidateCampaignIds() { try { for(String emptyValue : ParameterSets.getEmptyValues()) { Assert.assertNull(CampaignValidators.validateCampaignIds(emptyValue)); } try { CampaignValidators.validateCampaignIds("Invalid value."); fail("The campaign ID list was invalid.");...
void function() { try { for(String emptyValue : ParameterSets.getEmptyValues()) { Assert.assertNull(CampaignValidators.validateCampaignIds(emptyValue)); } try { CampaignValidators.validateCampaignIds(STR); fail(STR); } catch(ValidationException e) { } for(String validUrnList : ParameterSets.getValidUrnLists()) { try { ...
/** * Test the campaign ID list validator. */
Test the campaign ID list validator
testValidateCampaignIds
{ "repo_name": "HaiJiaoXinHeng/server-1", "path": "test/org/ohmage/validator/CampaignValidatorsTest.java", "license": "apache-2.0", "size": 10535 }
[ "org.junit.Assert", "org.ohmage.exception.ValidationException", "org.ohmage.test.ParameterSets" ]
import org.junit.Assert; import org.ohmage.exception.ValidationException; import org.ohmage.test.ParameterSets;
import org.junit.*; import org.ohmage.exception.*; import org.ohmage.test.*;
[ "org.junit", "org.ohmage.exception", "org.ohmage.test" ]
org.junit; org.ohmage.exception; org.ohmage.test;
292,263
@Override protected String getContextName() { return ContextHelpIDs.WIZARD_DATASET_NAME; }
String function() { return ContextHelpIDs.WIZARD_DATASET_NAME; }
/** * Return the context name for the help of this page */
Return the context name for the help of this page
getContextName
{ "repo_name": "OpenSoftwareSolutions/PDFReporter-Studio", "path": "com.jaspersoft.studio/src/com/jaspersoft/studio/property/dataset/wizard/WizardDatasetNewPage.java", "license": "lgpl-3.0", "size": 7521 }
[ "com.jaspersoft.studio.wizards.ContextHelpIDs" ]
import com.jaspersoft.studio.wizards.ContextHelpIDs;
import com.jaspersoft.studio.wizards.*;
[ "com.jaspersoft.studio" ]
com.jaspersoft.studio;
1,857,793
public static AzureADToken getTokenFromMsi(final String authEndpoint, final String tenantGuid, final String clientId, String authority, boolean bypassCache) throws IOException { QueryParams qp = new QueryParams(); qp.add("api-version", "2018-02-01"); qp.add("resource", RESOURCE_NAME); if ...
static AzureADToken function(final String authEndpoint, final String tenantGuid, final String clientId, String authority, boolean bypassCache) throws IOException { QueryParams qp = new QueryParams(); qp.add(STR, STR); qp.add(STR, RESOURCE_NAME); if (tenantGuid != null && tenantGuid.length() > 0) { authority = authority...
/** * Gets AAD token from the local virtual machine's VM extension. This only works on * an Azure VM with MSI extension * enabled. * * @param authEndpoint the OAuth 2.0 token endpoint associated * with the user's directory (obtain from * Active Directory conf...
Gets AAD token from the local virtual machine's VM extension. This only works on an Azure VM with MSI extension enabled
getTokenFromMsi
{ "repo_name": "steveloughran/hadoop", "path": "hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/AzureADAuthenticator.java", "license": "apache-2.0", "size": 18912 }
[ "java.io.IOException", "java.util.Hashtable" ]
import java.io.IOException; import java.util.Hashtable;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
273,829
private void notifyUser() { // Start building our notification NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(mContext) .setAutoCancel(true) .setContentTitle(getTitle()); // If intent is specifi...
void function() { NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(mContext) .setAutoCancel(true) .setContentTitle(getTitle()); final Intent intent = getIntent(); if (intent != null) { PendingIntent viewPendingIntent = PendingIntent.getActivity(mContext, 0, intent, 0); notificationBuilder...
/** * Shows the card as notification if settings allow it */
Shows the card as notification if settings allow it
notifyUser
{ "repo_name": "brdvlps/TumCampusApp", "path": "app/src/main/java/de/tum/in/tumcampusapp/cards/Card.java", "license": "gpl-2.0", "size": 12492 }
[ "android.app.Notification", "android.app.PendingIntent", "android.content.Intent", "android.support.v4.app.NotificationCompat", "android.support.v4.app.NotificationManagerCompat" ]
import android.app.Notification; import android.app.PendingIntent; import android.content.Intent; import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationManagerCompat;
import android.app.*; import android.content.*; import android.support.v4.app.*;
[ "android.app", "android.content", "android.support" ]
android.app; android.content; android.support;
2,085,893
Set<String> getPropertyNames();
Set<String> getPropertyNames();
/** * Get all the property names with values applied to this measurement. */
Get all the property names with values applied to this measurement
getPropertyNames
{ "repo_name": "powsybl/powsybl-core", "path": "iidm/iidm-extensions/src/main/java/com/powsybl/iidm/network/extensions/DiscreteMeasurement.java", "license": "mpl-2.0", "size": 4412 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,860,753
public static MozuClient<com.mozu.api.contracts.productadmin.search.SynonymDefinitionPagedCollection> getSynonymDefinitionsClient() throws Exception { return getSynonymDefinitionsClient( null, null, null, null, null); }
static MozuClient<com.mozu.api.contracts.productadmin.search.SynonymDefinitionPagedCollection> function() throws Exception { return getSynonymDefinitionsClient( null, null, null, null, null); }
/** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productadmin.search.SynonymDefinitionPagedCollection> mozuClient=GetSynonymDefinitionsClient(); * client.setBaseAddress(url); * client.executeRequest(); * SynonymDefinitionPagedCollection synonymDefinitionPagedCollection = client.Result(); ...
<code><code> MozuClient mozuClient=GetSynonymDefinitionsClient(); client.setBaseAddress(url); client.executeRequest(); SynonymDefinitionPagedCollection synonymDefinitionPagedCollection = client.Result(); </code></code>
getSynonymDefinitionsClient
{ "repo_name": "Mozu/mozu-java", "path": "mozu-javaasync-core/src/main/java/com/mozu/api/clients/commerce/catalog/admin/SearchClient.java", "license": "mit", "size": 40771 }
[ "com.mozu.api.MozuClient" ]
import com.mozu.api.MozuClient;
import com.mozu.api.*;
[ "com.mozu.api" ]
com.mozu.api;
443,319
public static void main(String[] args) { System.out.println("Changing the Graphics State with save and restore"); // step 1: creation of a document-object Document document = new Document(); try { // step 2: // we create a writer that listens to the document // and directs a PDF-stream to a file ...
static void function(String[] args) { System.out.println(STR); Document document = new Document(); try { PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(STR)); document.open(); PdfContentByte cb = writer.getDirectContent(); cb.circle(260.0f, 500.0f, 250.0f); cb.fill(); cb.saveState(); cb.setColo...
/** * Changing the Graphics State with saveState() and restoreState(). * * @param args * no arguments needed */
Changing the Graphics State with saveState() and restoreState()
main
{ "repo_name": "yogthos/itext", "path": "www/examples/com/lowagie/examples/directcontent/graphics/State.java", "license": "lgpl-3.0", "size": 2207 }
[ "com.lowagie.text.Document", "com.lowagie.text.DocumentException", "com.lowagie.text.pdf.PdfContentByte", "com.lowagie.text.pdf.PdfWriter", "java.awt.Color", "java.io.FileOutputStream", "java.io.IOException" ]
import com.lowagie.text.Document; import com.lowagie.text.DocumentException; import com.lowagie.text.pdf.PdfContentByte; import com.lowagie.text.pdf.PdfWriter; import java.awt.Color; import java.io.FileOutputStream; import java.io.IOException;
import com.lowagie.text.*; import com.lowagie.text.pdf.*; import java.awt.*; import java.io.*;
[ "com.lowagie.text", "java.awt", "java.io" ]
com.lowagie.text; java.awt; java.io;
869,273
public static DDRRecord createDDRForTTS(String remoteAddress, Session session, TTSInfo ttsInfo, String message) { if (session != null) { try { return createDDRForTTS(message, session, true, ttsInfo.getProvider()); } catch (Exception e) { e...
static DDRRecord function(String remoteAddress, Session session, TTSInfo ttsInfo, String message) { if (session != null) { try { return createDDRForTTS(message, session, true, ttsInfo.getProvider()); } catch (Exception e) { e.printStackTrace(); log.severe(String.format(STR, session.getKey(), session.getAccountId(), mes...
/** * Create a ddr for a TTS being processed being created and charge a monthly * fee for example * * @param adapterConfig * @return * @throws Exception */
Create a ddr for a TTS being processed being created and charge a monthly fee for example
createDDRForTTS
{ "repo_name": "almende/dialog", "path": "dialoghandler/src/main/java/com/almende/dialog/util/DDRUtils.java", "license": "apache-2.0", "size": 57427 }
[ "com.almende.dialog.model.Session", "com.almende.dialog.model.ddr.DDRRecord", "com.askfast.commons.entity.TTSInfo" ]
import com.almende.dialog.model.Session; import com.almende.dialog.model.ddr.DDRRecord; import com.askfast.commons.entity.TTSInfo;
import com.almende.dialog.model.*; import com.almende.dialog.model.ddr.*; import com.askfast.commons.entity.*;
[ "com.almende.dialog", "com.askfast.commons" ]
com.almende.dialog; com.askfast.commons;
1,379,261
public boolean hasSubPermission(String subPermission){ String rank = this.getRank(); if(rank != null){ @SuppressWarnings("unchecked") ArrayList<String> list = (ArrayList<String>) this.instance.getVillagePermissionData(this.getVillage()).get("Rank." + rank); if(list.contains(subPermission)){ return t...
boolean function(String subPermission){ String rank = this.getRank(); if(rank != null){ @SuppressWarnings(STR) ArrayList<String> list = (ArrayList<String>) this.instance.getVillagePermissionData(this.getVillage()).get("Rank." + rank); if(list.contains(subPermission)){ return true; } else { return false; } } else { retu...
/** * Checks if the player has a sub permission defined by the plugin. * * @param subPermission The specified sub permission you want to check. * @return A boolean of of weather or not the player has that sub permission. */
Checks if the player has a sub permission defined by the plugin
hasSubPermission
{ "repo_name": "weeryan17/Villages", "path": "Villages/src/com/weeryan17/vgs/util/PlayerUtil.java", "license": "mit", "size": 4357 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,416,654
public byte getByte(int columnIndex) { checkValidColumn(columnIndex); checkNull(columnIndex); checkType(columnIndex, Type.INT8); return Bytes.getByte(this.rowData.getRawArray(), this.rowData.getRawOffset() + getCurrentRowDataOffsetForColumn(columnIndex)); }
byte function(int columnIndex) { checkValidColumn(columnIndex); checkNull(columnIndex); checkType(columnIndex, Type.INT8); return Bytes.getByte(this.rowData.getRawArray(), this.rowData.getRawOffset() + getCurrentRowDataOffsetForColumn(columnIndex)); }
/** * Get the specified column's byte * @param columnIndex Column index in the schema * @return a byte * @throws IllegalArgumentException if the column is null * or if the type doesn't match the column's type * @throws IndexOutOfBoundsException if the column doesn't exist */
Get the specified column's byte
getByte
{ "repo_name": "InspurUSA/kudu", "path": "java/kudu-client/src/main/java/org/apache/kudu/client/RowResult.java", "license": "apache-2.0", "size": 26394 }
[ "org.apache.kudu.Type" ]
import org.apache.kudu.Type;
import org.apache.kudu.*;
[ "org.apache.kudu" ]
org.apache.kudu;
1,025,747
protected void test(List<SourceFile> js, List<SourceFile> expected) { test(srcs(js), expected(expected)); }
void function(List<SourceFile> js, List<SourceFile> expected) { test(srcs(js), expected(expected)); }
/** * Verifies that the compiler pass's JS output matches the expected output. * * @param js Inputs * @param expected Expected JS output */
Verifies that the compiler pass's JS output matches the expected output
test
{ "repo_name": "vobruba-martin/closure-compiler", "path": "test/com/google/javascript/jscomp/CompilerTestCase.java", "license": "apache-2.0", "size": 86059 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
375,254
public static Path findCurrent(int callDepth) { final AtomicReference<Class<?>[]> classContextRef = new AtomicReference<>(); new SecurityManager() { { classContextRef.set(getClassContext()); } }; // Skip the first two classes which are: ...
static Path function(int callDepth) { final AtomicReference<Class<?>[]> classContextRef = new AtomicReference<>(); new SecurityManager() { { classContextRef.set(getClassContext()); } }; final Class<?>[] classes = classContextRef.get(); final int toSkip = 2; if (callDepth < 0 callDepth + toSkip >= classes.length) { thro...
/** * Returns the {@link Path} to the JAR, WAR or directory where the caller class of this method is located * at. * * @param callDepth how many calls were made between the caller class and this {@link #findCurrent(int)}. */
Returns the <code>Path</code> to the JAR, WAR or directory where the caller class of this method is located at
findCurrent
{ "repo_name": "line/armeria", "path": "core/src/main/java/com/linecorp/armeria/common/util/AppRootFinder.java", "license": "apache-2.0", "size": 4253 }
[ "java.nio.file.Path", "java.util.concurrent.atomic.AtomicReference" ]
import java.nio.file.Path; import java.util.concurrent.atomic.AtomicReference;
import java.nio.file.*; import java.util.concurrent.atomic.*;
[ "java.nio", "java.util" ]
java.nio; java.util;
2,583,752
public Collection<Object> getSelection() { Iterator<Object> i = selectedItems.iterator(); List<Object> results = new ArrayList<Object>(); Object object; while (i.hasNext()) { object = i.next(); if (isAddedNode(object)) results.add(object); else { //was there but is immutable if (object...
Collection<Object> function() { Iterator<Object> i = selectedItems.iterator(); List<Object> results = new ArrayList<Object>(); Object object; while (i.hasNext()) { object = i.next(); if (isAddedNode(object)) results.add(object); else { if (object instanceof DataObject) { if (!isImmutable((DataObject) object)) results.a...
/** * Returns the selected items, excluding the immutable node. * * @return See above. */
Returns the selected items, excluding the immutable node
getSelection
{ "repo_name": "jballanc/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/util/SelectionWizardUI.java", "license": "gpl-2.0", "size": 18915 }
[ "java.util.ArrayList", "java.util.Collection", "java.util.Iterator", "java.util.List" ]
import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,272,259
public static void validateIndexName(String index, ClusterState state) { validateIndexOrAliasName(index, InvalidIndexNameException::new); if (!index.toLowerCase(Locale.ROOT).equals(index)) { throw new InvalidIndexNameException(index, "must be lowercase"); } if (state.rout...
static void function(String index, ClusterState state) { validateIndexOrAliasName(index, InvalidIndexNameException::new); if (!index.toLowerCase(Locale.ROOT).equals(index)) { throw new InvalidIndexNameException(index, STR); } if (state.routingTable().hasIndex(index)) { throw new ResourceAlreadyExistsException(state.rou...
/** * Validate the name for an index against some static rules and a cluster state. */
Validate the name for an index against some static rules and a cluster state
validateIndexName
{ "repo_name": "nazarewk/elasticsearch", "path": "core/src/main/java/org/elasticsearch/cluster/metadata/MetaDataCreateIndexService.java", "license": "apache-2.0", "size": 36225 }
[ "java.util.Locale", "org.elasticsearch.ResourceAlreadyExistsException", "org.elasticsearch.cluster.ClusterState", "org.elasticsearch.indices.InvalidIndexNameException" ]
import java.util.Locale; import org.elasticsearch.ResourceAlreadyExistsException; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.indices.InvalidIndexNameException;
import java.util.*; import org.elasticsearch.*; import org.elasticsearch.cluster.*; import org.elasticsearch.indices.*;
[ "java.util", "org.elasticsearch", "org.elasticsearch.cluster", "org.elasticsearch.indices" ]
java.util; org.elasticsearch; org.elasticsearch.cluster; org.elasticsearch.indices;
2,724,764
public Point2D mapSourcePoint(Point2D sourcePt) { if (sourcePt == null) { throw new IllegalArgumentException(JaiI18N.getString("Generic0")); } return null; }
Point2D function(Point2D sourcePt) { if (sourcePt == null) { throw new IllegalArgumentException(JaiI18N.getString(STR)); } return null; }
/** * Computes the destination point corresponding to the supplied point. * * @return <code>null</code>. * * @throws IllegalArgumentException if <code>sourcePt</code> is * <code>null</code>. * * @since JAI 1.1.2 */
Computes the destination point corresponding to the supplied point
mapSourcePoint
{ "repo_name": "MarinnaCole/LightZone", "path": "lightcrafts/extsrc/com/lightcrafts/media/jai/opimage/DCTOpImage.java", "license": "bsd-3-clause", "size": 11699 }
[ "java.awt.geom.Point2D" ]
import java.awt.geom.Point2D;
import java.awt.geom.*;
[ "java.awt" ]
java.awt;
1,253,643
private static void refreshLayout(ThemeFragment themeFragment, SharedPreferences prefs, Context context, Activity activity, Map<String, String[]> substratumPackages...
static void function(ThemeFragment themeFragment, SharedPreferences prefs, Context context, Activity activity, Map<String, String[]> substratumPackages, ArrayList<ThemeItem> themeItems) { TextView cardViewText = themeFragment.cardView.findViewById(R.id.no_themes_description); ImageView cardViewImage = themeFragment.car...
/** * Deeply refresh the themes * * @param themeFragment Theme Fragment * @param context Self explanatory, bud * @param prefs Shared Preferences instance * @param activity Activity of calling function * @param substratumPackages List of collected...
Deeply refresh the themes
refreshLayout
{ "repo_name": "iskandar1023/substratum", "path": "app/src/main/java/projekt/substratum/fragments/ThemeFragment.java", "license": "gpl-3.0", "size": 16364 }
[ "android.app.Activity", "android.content.Context", "android.content.SharedPreferences", "android.view.View", "android.widget.ImageView", "android.widget.TextView", "java.util.ArrayList", "java.util.Map" ]
import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import java.util.ArrayList; import java.util.Map;
import android.app.*; import android.content.*; import android.view.*; import android.widget.*; import java.util.*;
[ "android.app", "android.content", "android.view", "android.widget", "java.util" ]
android.app; android.content; android.view; android.widget; java.util;
234,313
public void refresh() { if (!this.canRefresh()) { throw new IllegalStateException("The BoxAPIConnection cannot be refreshed because it doesn't have a " + "refresh token."); } URL url = null; try { url = new URL(TOKEN_URL_STRING); } cat...
void function() { if (!this.canRefresh()) { throw new IllegalStateException(STR + STR); } URL url = null; try { url = new URL(TOKEN_URL_STRING); } catch (MalformedURLException e) { assert false : STR; throw new RuntimeException(STR, e); } String urlParameters = String.format(STR, this.refreshToken, this.clientID, this....
/** * Refresh's this connection's access token using its refresh token. * @throws IllegalStateException if this connection's access token cannot be refreshed. */
Refresh's this connection's access token using its refresh token
refresh
{ "repo_name": "sarattall/box-java-sdk", "path": "src/main/java/com/box/sdk/BoxAPIConnection.java", "license": "apache-2.0", "size": 10593 }
[ "com.eclipsesource.json.JsonObject", "java.net.MalformedURLException" ]
import com.eclipsesource.json.JsonObject; import java.net.MalformedURLException;
import com.eclipsesource.json.*; import java.net.*;
[ "com.eclipsesource.json", "java.net" ]
com.eclipsesource.json; java.net;
288,946
public Date getValidUntil() { return validUntil; }
Date function() { return validUntil; }
/** * Get the ValidUntil * * @return Date */
Get the ValidUntil
getValidUntil
{ "repo_name": "trackplus/Genji", "path": "src/main/java/com/aurel/track/persist/BaseTPerson.java", "license": "gpl-3.0", "size": 1013508 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
1,206,721
@Nullable public Boolean getBoolean(@Nonnull final String key) { return (Boolean) this.values.get(key); }
Boolean function(@Nonnull final String key) { return (Boolean) this.values.get(key); }
/** * Get a boolean value from the values or null. * * @param key the look up key of the value */
Get a boolean value from the values or null
getBoolean
{ "repo_name": "jesseeichar/mapfish-print", "path": "core/src/main/java/org/mapfish/print/output/Values.java", "license": "gpl-3.0", "size": 14141 }
[ "javax.annotation.Nonnull" ]
import javax.annotation.Nonnull;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
660,111
public UserRequestPostProcessor rolePrefix(String rolePrefix) { this.rolePrefix = rolePrefix; return this; } /** * Specify the roles of the user to authenticate as. This method is similar to * {@link #authorities(GrantedAuthority...)}, but just not as f...
UserRequestPostProcessor function(String rolePrefix) { this.rolePrefix = rolePrefix; return this; } /** * Specify the roles of the user to authenticate as. This method is similar to * {@link #authorities(GrantedAuthority...)}, but just not as flexible. * * @param roles The roles to populate. Note that if the role does ...
/** * Sets the prefix to append to each role if the role does not already start with * the prefix. If no prefix is desired, an empty String or null can be used. */
Sets the prefix to append to each role if the role does not already start with the prefix. If no prefix is desired, an empty String or null can be used
rolePrefix
{ "repo_name": "martinlippert/sagan", "path": "sagan-site/src/it/java/sagan/support/SecurityRequestPostProcessors.java", "license": "bsd-3-clause", "size": 10641 }
[ "org.springframework.security.core.GrantedAuthority" ]
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.*;
[ "org.springframework.security" ]
org.springframework.security;
2,319,618
public void fetch(String outputName, FloatBuffer dst) { getTensor(outputName).writeTo(dst); }
void function(String outputName, FloatBuffer dst) { getTensor(outputName).writeTo(dst); }
/** * Read from a Tensor named {@link outputName} and copy the contents into the <b>direct</b> and * <b>native ordered</b> java.nio buffer {@link dst}. {@link dst} must have capacity greater than * or equal to that of the source Tensor. This operation will not affect dst's content past the * source Tensor's...
Read from a Tensor named <code>outputName</code> and copy the contents into the direct and native ordered java.nio buffer <code>dst</code>. <code>dst</code> must have capacity greater than or equal to that of the source Tensor. This operation will not affect dst's content past the source Tensor's size
fetch
{ "repo_name": "chemelnucfin/tensorflow", "path": "tensorflow/tools/android/inference_interface/java/org/tensorflow/contrib/android/TensorFlowInferenceInterface.java", "license": "apache-2.0", "size": 23882 }
[ "java.nio.FloatBuffer" ]
import java.nio.FloatBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
1,551,138
public static void createOrUpdate(AlarmReminder reminder, Context context) { reminder.mNeedsSync = Tag.FLAG_READED; if (!AlarmReminder.isSaved(reminder)) { reminder.save(); reminder.setAlarm(context); } else { AlarmReminder oldReminder = getSingleRemi...
static void function(AlarmReminder reminder, Context context) { reminder.mNeedsSync = Tag.FLAG_READED; if (!AlarmReminder.isSaved(reminder)) { reminder.save(); reminder.setAlarm(context); } else { AlarmReminder oldReminder = getSingleReminder(reminder.mAlarmReminderId); oldReminder.cancelAlarm(context); oldReminder.upd...
/** * Crea o actualiza un alarma que fue creada en el servidor. * * @param reminder * @param context */
Crea o actualiza un alarma que fue creada en el servidor
createOrUpdate
{ "repo_name": "celeiva815/Android-Code-Example", "path": "models/AlarmReminder.java", "license": "gpl-2.0", "size": 23713 }
[ "android.content.Context", "social.laika.app.utils.Tag" ]
import android.content.Context; import social.laika.app.utils.Tag;
import android.content.*; import social.laika.app.utils.*;
[ "android.content", "social.laika.app" ]
android.content; social.laika.app;
923,514
public static boolean coordinateIsValid( String coordinate ) { if ( coordinate == null || coordinate.trim().isEmpty() ) { return false; } Matcher matcher = POINT_PATTERN.matcher( coordinate ); if ( !matcher.find() ) { return fa...
static boolean function( String coordinate ) { if ( coordinate == null coordinate.trim().isEmpty() ) { return false; } Matcher matcher = POINT_PATTERN.matcher( coordinate ); if ( !matcher.find() ) { return false; } double longitude = 0.0; double latitude = 0.0; try { longitude = Double.parseDouble( matcher.group( 1 ) )...
/** * Validates whether a coordinate is valid. * * @return true if the coordinate is valid, false otherwise. */
Validates whether a coordinate is valid
coordinateIsValid
{ "repo_name": "minagri-rwanda/DHIS2-Agriculture", "path": "dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ValidationUtils.java", "license": "bsd-3-clause", "size": 18194 }
[ "java.util.regex.Matcher" ]
import java.util.regex.Matcher;
import java.util.regex.*;
[ "java.util" ]
java.util;
350,531
public Path mouse2cellPathRel( int x, int y ){ Dimension sz = getSize(); double scale = getScale( sz ); //poincare projection coordinates double dx = (x - sz.width/2) / scale; double dy = -(y - sz.height/2) / scale; //System.out.println("Dx="+dx+" Dy="+dy); //restore hyperbolic coordinates // x ...
Path function( int x, int y ){ Dimension sz = getSize(); double scale = getScale( sz ); double dx = (x - sz.width/2) / scale; double dy = -(y - sz.height/2) / scale; double d2 = len2( dx, dy ); if ( d2 >= 1 ) return null; double s = 2/(1-d2); double [] point = new double[]{ dx*s, dy*s, 0.5*(d2+1)*s }; return PathNaviga...
/**Given the point in th view coordinates, return path to the cell, containing it * Path is relative to the view center*/
Given the point in th view coordinates, return path to the cell, containing it
mouse2cellPathRel
{ "repo_name": "dmishin/Pentagrid", "path": "src/org/ratson/pentagrid/gui/FarPoincarePanel.java", "license": "mit", "size": 9689 }
[ "java.awt.Dimension", "org.ratson.pentagrid.Path", "org.ratson.pentagrid.PathNavigation" ]
import java.awt.Dimension; import org.ratson.pentagrid.Path; import org.ratson.pentagrid.PathNavigation;
import java.awt.*; import org.ratson.pentagrid.*;
[ "java.awt", "org.ratson.pentagrid" ]
java.awt; org.ratson.pentagrid;
2,692,009
for (UIComponent child : component.getChildren()) { if (child instanceof UIParameter) { UIParameter param = (UIParameter) child; if (paramName.equals(param.getName())) { return param.getValue(); } } } return null; }
for (UIComponent child : component.getChildren()) { if (child instanceof UIParameter) { UIParameter param = (UIParameter) child; if (paramName.equals(param.getName())) { return param.getValue(); } } } return null; }
/** * Finds the first <code>UIParameter</code> child of the given UIComponent which has a parameter name <i>paramName</i>. * Returns the value of this child. * * @param component * UIComponent to search for UIParameter children. * @param paramName * Name of parameter to search for. ...
Finds the first <code>UIParameter</code> child of the given UIComponent which has a parameter name paramName. Returns the value of this child
getParamValue
{ "repo_name": "AludraTest/cloud-manager-api", "path": "src/main/java/org/aludratest/cloud/util/JSFUtil.java", "license": "apache-2.0", "size": 5616 }
[ "javax.faces.component.UIComponent", "javax.faces.component.UIParameter" ]
import javax.faces.component.UIComponent; import javax.faces.component.UIParameter;
import javax.faces.component.*;
[ "javax.faces" ]
javax.faces;
2,753,279
public void addCloseHandler(ClickHandler handler) { //this.decPanel.close.setVisible(true); this.decPanel.addCloseHandler(handler); }
void function(ClickHandler handler) { this.decPanel.addCloseHandler(handler); }
/** * clickHandler for close button.Also sets close button visible. * * @param handler * click handler for close button. */
clickHandler for close button.Also sets close button visible
addCloseHandler
{ "repo_name": "Agnie-Software/3a", "path": "code/common/src/main/java/com/agnie/gwt/common/client/widget/DialogBox.java", "license": "gpl-2.0", "size": 2283 }
[ "com.google.gwt.event.dom.client.ClickHandler" ]
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.*;
[ "com.google.gwt" ]
com.google.gwt;
1,571,232
public void testViewFetchOffset() throws SQLException { setAutoCommit(false); Statement s = createStatement(); ResultSet rs; s.executeUpdate( "create view v1 as select i from t order by j desc " + " offset 2 rows fetch first 1 row only"); ...
void function() throws SQLException { setAutoCommit(false); Statement s = createStatement(); ResultSet rs; s.executeUpdate( STR + STR); s.executeUpdate( STR + STR); s.executeUpdate( STR + STR); rs = s.executeQuery( STR); JDBC.assertFullResultSet(rs, new String[][]{{"3"}}); rs = s.executeQuery( STR); JDBC.assertFullResu...
/** * Test {@code ORDER BY} + {@code FETCH/OFFSET} in a view definition * <p/> * This test is a variant made my modifying {@code testView} with suitable * {@code OFFSET/FETCH FIRST} clauses. */
Test ORDER BY + FETCH/OFFSET in a view definition This test is a variant made my modifying testView with suitable OFFSET/FETCH FIRST clauses
testViewFetchOffset
{ "repo_name": "splicemachine/spliceengine", "path": "db-testing/src/test/java/com/splicemachine/dbTesting/functionTests/tests/lang/OrderByAndOffsetFetchInSubqueries.java", "license": "agpl-3.0", "size": 38597 }
[ "com.splicemachine.dbTesting.junit.JDBC", "java.sql.ResultSet", "java.sql.SQLException", "java.sql.Statement" ]
import com.splicemachine.dbTesting.junit.JDBC; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement;
import com.splicemachine.*; import java.sql.*;
[ "com.splicemachine", "java.sql" ]
com.splicemachine; java.sql;
1,379,076
public static String encodeColor( Color color ) { String s= namedColors.get(color); if ( s!=null ) { return s; } else { if ( color.getAlpha()<255 ) { return "#" + Integer.toHexString(color.getRGB()); } else { return "#" + In...
static String function( Color color ) { String s= namedColors.get(color); if ( s!=null ) { return s; } else { if ( color.getAlpha()<255 ) { return "#" + Integer.toHexString(color.getRGB()); } else { return "#" + Integer.toHexString(color.getRGB() & 0xFFFFFF); } } }
/** * return either a named color or * "#" + Integer.toHexString( color.getRGB() &amp; 0xFFFFFF) * @param color * @return named color or hex string like "#FF0000" for Red. */
return either a named color or "#" + Integer.toHexString( color.getRGB() &amp; 0xFFFFFF)
encodeColor
{ "repo_name": "autoplot/app", "path": "dasCoreUtil/src/org/das2/util/ColorUtil.java", "license": "gpl-2.0", "size": 24030 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
168,133
@Test() public void testNormalizeValid() throws Exception { assertEquals(LDAPDN.normalize("dc = ExAmPlE , DC = COM"), "dc=example,dc=com"); }
@Test() void function() throws Exception { assertEquals(LDAPDN.normalize(STR), STR); }
/** * Tests the normalize method with a valid DN string. * * @throws Exception If an unexpected problem occurs. */
Tests the normalize method with a valid DN string
testNormalizeValid
{ "repo_name": "UnboundID/ldapsdk", "path": "tests/unit/src/com/unboundid/ldap/sdk/migrate/ldapjdk/LDAPDNTestCase.java", "license": "gpl-2.0", "size": 9791 }
[ "org.testng.annotations.Test" ]
import org.testng.annotations.Test;
import org.testng.annotations.*;
[ "org.testng.annotations" ]
org.testng.annotations;
206,301
public void addKeyName(String keynameString) { this.add(new KeyName(this.doc, keynameString)); }
void function(String keynameString) { this.add(new KeyName(this.doc, keynameString)); }
/** * Method addKeyName * * @param keynameString */
Method addKeyName
addKeyName
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/openjdk2/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java", "license": "mit", "size": 40787 }
[ "com.sun.org.apache.xml.internal.security.keys.content.KeyName" ]
import com.sun.org.apache.xml.internal.security.keys.content.KeyName;
import com.sun.org.apache.xml.internal.security.keys.content.*;
[ "com.sun.org" ]
com.sun.org;
1,392,083
public static void registerActionHandler(final ViewPart part, final IAction action){ String commandId = action.getActionDefinitionId(); if (!StringTool.isNothing(commandId)) { IHandlerService handlerService = part.getSite().getService(IHandlerService.class); IHandler handler = new ActionHandler(action); ...
static void function(final ViewPart part, final IAction action){ String commandId = action.getActionDefinitionId(); if (!StringTool.isNothing(commandId)) { IHandlerService handlerService = part.getSite().getService(IHandlerService.class); IHandler handler = new ActionHandler(action); handlerService.activateHandler(comm...
/** * Creates an ActionHandler for the given IAction and registers it to the Site's HandlerService, * i. e. binds the action to the command so that key bindings get activated. You need to set the * action's actionDefinitionId to the command id. * * @param action * the action to activate. The act...
Creates an ActionHandler for the given IAction and registers it to the Site's HandlerService, i. e. binds the action to the command so that key bindings get activated. You need to set the action's actionDefinitionId to the command id
registerActionHandler
{ "repo_name": "sazgin/elexis-3-core", "path": "ch.elexis.core.ui/src/ch/elexis/core/ui/actions/GlobalActions.java", "license": "epl-1.0", "size": 35968 }
[ "ch.elexis.data.Mandant", "ch.rgw.tools.StringTool", "java.util.List", "org.eclipse.core.commands.IHandler", "org.eclipse.jface.action.IAction", "org.eclipse.jface.commands.ActionHandler", "org.eclipse.jface.dialogs.TitleAreaDialog", "org.eclipse.ui.handlers.IHandlerService", "org.eclipse.ui.part.Vi...
import ch.elexis.data.Mandant; import ch.rgw.tools.StringTool; import java.util.List; import org.eclipse.core.commands.IHandler; import org.eclipse.jface.action.IAction; import org.eclipse.jface.commands.ActionHandler; import org.eclipse.jface.dialogs.TitleAreaDialog; import org.eclipse.ui.handlers.IHandlerService; imp...
import ch.elexis.data.*; import ch.rgw.tools.*; import java.util.*; import org.eclipse.core.commands.*; import org.eclipse.jface.action.*; import org.eclipse.jface.commands.*; import org.eclipse.jface.dialogs.*; import org.eclipse.ui.handlers.*; import org.eclipse.ui.part.*;
[ "ch.elexis.data", "ch.rgw.tools", "java.util", "org.eclipse.core", "org.eclipse.jface", "org.eclipse.ui" ]
ch.elexis.data; ch.rgw.tools; java.util; org.eclipse.core; org.eclipse.jface; org.eclipse.ui;
1,155,262
protected void executeTarget(String targetName) { PrintStream sysOut = System.out; PrintStream sysErr = System.err; try { sysOut.flush(); sysErr.flush(); outBuffer = new StringBuffer(); PrintStream out = new PrintStream(new AntOutputStre...
void function(String targetName) { PrintStream sysOut = System.out; PrintStream sysErr = System.err; try { sysOut.flush(); sysErr.flush(); outBuffer = new StringBuffer(); PrintStream out = new PrintStream(new AntOutputStream(outBuffer)); System.setOut(out); errBuffer = new StringBuffer(); PrintStream err = new PrintStr...
/** * execute a target we have set up * @pre configureProject has been called * @param targetName target to run */
execute a target we have set up
executeTarget
{ "repo_name": "cniweb/ant-contrib", "path": "ant-contrib/test/src/org/apache/tools/ant/BuildFileTest.java", "license": "apache-2.0", "size": 15026 }
[ "java.io.PrintStream" ]
import java.io.PrintStream;
import java.io.*;
[ "java.io" ]
java.io;
2,074,371
public static boolean canReadLabels(Context c) { boolean supported = false; try { final PackageInfo info = c.getPackageManager().getPackageInfo(PACKAGE, PackageManager.GET_PROVIDERS | PackageManager.GET_PERMISSIONS); boolean allowRead = false; ...
static boolean function(Context c) { boolean supported = false; try { final PackageInfo info = c.getPackageManager().getPackageInfo(PACKAGE, PackageManager.GET_PROVIDERS PackageManager.GET_PERMISSIONS); boolean allowRead = false; if (info.permissions != null) { for (int i = 0, len = info.permissions.length; i < len; i+...
/** * Check if the installed Gmail app supports querying for label information. * * @param c an application Context * @return true if it's safe to make label API queries */
Check if the installed Gmail app supports querying for label information
canReadLabels
{ "repo_name": "jbremnant/project_ledi", "path": "sw/LEDIManager/src/com/google/android/gm/contentprovider/GmailContract.java", "license": "bsd-3-clause", "size": 8887 }
[ "android.content.Context", "android.content.pm.PackageInfo", "android.content.pm.PackageManager", "android.content.pm.PermissionInfo", "android.content.pm.ProviderInfo", "android.text.TextUtils" ]
import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.PermissionInfo; import android.content.pm.ProviderInfo; import android.text.TextUtils;
import android.content.*; import android.content.pm.*; import android.text.*;
[ "android.content", "android.text" ]
android.content; android.text;
2,075,219
@ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux<PolicyTrackedResourceInner> listQueryResultsForResourceAsync(String resourceId) { final Integer top = null; final String filter = null; return new PagedFlux<>( () -> listQueryResultsForResourceSinglePageAsync(r...
@ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux<PolicyTrackedResourceInner> function(String resourceId) { final Integer top = null; final String filter = null; return new PagedFlux<>( () -> listQueryResultsForResourceSinglePageAsync(resourceId, top, filter), nextLink -> listQueryResultsForResourceNextSinglePa...
/** * Queries policy tracked resources under the resource. * * @param resourceId Resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped...
Queries policy tracked resources under the resource
listQueryResultsForResourceAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyTrackedResourcesClientImpl.java", "license": "mit", "size": 59223 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedFlux", "com.azure.resourcemanager.policyinsights.fluent.models.PolicyTrackedResourceInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedFlux; import com.azure.resourcemanager.policyinsights.fluent.models.PolicyTrackedResourceInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.policyinsights.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,107,652
private static void decodeToFile( String dataToDecode, String filename ) throws java.io.IOException { Base64.OutputStream bos = null; try{ bos = new Base64.OutputStream( new java.io.FileOutputStream( filename ), Base64.DECODE ); bos.write( dat...
static void function( String dataToDecode, String filename ) throws java.io.IOException { Base64.OutputStream bos = null; try{ bos = new Base64.OutputStream( new java.io.FileOutputStream( filename ), Base64.DECODE ); bos.write( dataToDecode.getBytes( PREFERRED_ENCODING ) ); } catch( java.io.IOException e ) { throw e; }...
/** * Convenience method for decoding data to a file. * * <p>As of v 2.3, if there is a error, * the method will throw an java.io.IOException. <b>This is new to v2.3!</b> * In earlier versions, it just returned false, but * in retrospect that's a pretty poor way to handle it.</p> * ...
Convenience method for decoding data to a file. As of v 2.3, if there is a error, the method will throw an java.io.IOException. This is new to v2.3! In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it
decodeToFile
{ "repo_name": "ryanlfoster/httpsig-java", "path": "api/src/main/java/net/adamcin/httpsig/api/Base64.java", "license": "unlicense", "size": 88397 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,332,202
private void writeRVVRecord(OplogFile olf, boolean writeGCRVV) throws IOException { writeRVVRecord(olf, getParent().getAllDiskRegions(), writeGCRVV); }
void function(OplogFile olf, boolean writeGCRVV) throws IOException { writeRVVRecord(olf, getParent().getAllDiskRegions(), writeGCRVV); }
/** * Write an RVV record containing all of the live disk regions. */
Write an RVV record containing all of the live disk regions
writeRVVRecord
{ "repo_name": "sshcherbakov/incubator-geode", "path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/Oplog.java", "license": "apache-2.0", "size": 294400 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,505,506
if (number == -1) { return "Internal Error"; } try { return BMErrorStrings.ERROR_STRINGS[number]; } catch (ArrayIndexOutOfBoundsException aibe) { Toolkit.getDefaultToolkit().beep(); return BMErrorStrings.ERROR_STRINGS[0]; } } private BMErrorStrings() {}
if (number == -1) { return STR; } try { return BMErrorStrings.ERROR_STRINGS[number]; } catch (ArrayIndexOutOfBoundsException aibe) { Toolkit.getDefaultToolkit().beep(); return BMErrorStrings.ERROR_STRINGS[0]; } } private BMErrorStrings() {}
/** * Note: number -1 is used for "Internal Error". */
Note: number -1 is used for "Internal Error"
getErrorString
{ "repo_name": "dougmencken/bytecodemaker", "path": "source/bm/storage/constants/BMErrorStrings.java", "license": "gpl-3.0", "size": 1878 }
[ "java.awt.Toolkit" ]
import java.awt.Toolkit;
import java.awt.*;
[ "java.awt" ]
java.awt;
771,094
public void setUserPersistence(UserPersistence userPersistence) { this.userPersistence = userPersistence; }
void function(UserPersistence userPersistence) { this.userPersistence = userPersistence; }
/** * Sets the user persistence. * * @param userPersistence the user persistence */
Sets the user persistence
setUserPersistence
{ "repo_name": "p-gebhard/QuickAnswer", "path": "docroot/WEB-INF/src/it/gebhard/qa/service/base/NotificationLocalServiceBaseImpl.java", "license": "gpl-3.0", "size": 24421 }
[ "com.liferay.portal.service.persistence.UserPersistence" ]
import com.liferay.portal.service.persistence.UserPersistence;
import com.liferay.portal.service.persistence.*;
[ "com.liferay.portal" ]
com.liferay.portal;
1,711,040
public static StudentAttributes getStudent(String courseId, String studentEmail) { Map<String, String> params = createParamMap(BackDoorOperation.OPERATION_GET_STUDENT_AS_JSON); params.put(BackDoorOperation.PARAMETER_COURSE_ID, courseId); params.put(BackDoorOperation.PARAMETER_STUDENT_EMAIL, ...
static StudentAttributes function(String courseId, String studentEmail) { Map<String, String> params = createParamMap(BackDoorOperation.OPERATION_GET_STUDENT_AS_JSON); params.put(BackDoorOperation.PARAMETER_COURSE_ID, courseId); params.put(BackDoorOperation.PARAMETER_STUDENT_EMAIL, studentEmail); String studentJson = m...
/** * Gets a student data from the datastore. */
Gets a student data from the datastore
getStudent
{ "repo_name": "VamsiSangam/teammates", "path": "src/test/java/teammates/test/driver/BackDoor.java", "license": "gpl-2.0", "size": 22650 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,424,846
public void setNavigationCoordinator(HistoryNavigationCoordinator navigationHandler) { mNavigationCoordinator = navigationHandler; }
void function(HistoryNavigationCoordinator navigationHandler) { mNavigationCoordinator = navigationHandler; }
/** * Sets {@link HistoryNavigationCoordinator} object. * @param layout {@link HistoryNavigationCoordinator} object. */
Sets <code>HistoryNavigationCoordinator</code> object
setNavigationCoordinator
{ "repo_name": "scheib/chromium", "path": "chrome/android/java/src/org/chromium/chrome/browser/SwipeRefreshHandler.java", "license": "bsd-3-clause", "size": 11200 }
[ "org.chromium.chrome.browser.gesturenav.HistoryNavigationCoordinator" ]
import org.chromium.chrome.browser.gesturenav.HistoryNavigationCoordinator;
import org.chromium.chrome.browser.gesturenav.*;
[ "org.chromium.chrome" ]
org.chromium.chrome;
472,559
public List getLocalBucketsListTestOnly() { List localBucketList = null; if (this.dataStore != null) { localBucketList = this.dataStore.getLocalBucketsListTestOnly(); } return localBucketList; }
List function() { List localBucketList = null; if (this.dataStore != null) { localBucketList = this.dataStore.getLocalBucketsListTestOnly(); } return localBucketList; }
/** * A test method to get the list of all the bucket ids for the partitioned region in the data * Store. */
A test method to get the list of all the bucket ids for the partitioned region in the data Store
getLocalBucketsListTestOnly
{ "repo_name": "davinash/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java", "license": "apache-2.0", "size": 383155 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,354,538
public NotificationSchemaDto getNotificationSchema(String notificationSchemaId) throws KaaAdminServiceException { checkAuthority(KaaAuthorityDto.TENANT_DEVELOPER, KaaAuthorityDto.TENANT_USER); try { NotificationSchemaDto notificationSchema = controlService.getNotificationSchema( notifica...
NotificationSchemaDto function(String notificationSchemaId) throws KaaAdminServiceException { checkAuthority(KaaAuthorityDto.TENANT_DEVELOPER, KaaAuthorityDto.TENANT_USER); try { NotificationSchemaDto notificationSchema = controlService.getNotificationSchema( notificationSchemaId); Utils.checkNotNull(notificationSchema...
/** * Get notification schema. * * @param notificationSchemaId the id of notification schema * @return notification schema */
Get notification schema
getNotificationSchema
{ "repo_name": "vtkhir/kaa", "path": "server/node/src/main/java/org/kaaproject/kaa/server/admin/services/NotificationServiceImpl.java", "license": "apache-2.0", "size": 18596 }
[ "org.kaaproject.kaa.common.dto.KaaAuthorityDto", "org.kaaproject.kaa.common.dto.NotificationSchemaDto", "org.kaaproject.kaa.server.admin.services.util.Utils", "org.kaaproject.kaa.server.admin.shared.services.KaaAdminServiceException" ]
import org.kaaproject.kaa.common.dto.KaaAuthorityDto; import org.kaaproject.kaa.common.dto.NotificationSchemaDto; import org.kaaproject.kaa.server.admin.services.util.Utils; import org.kaaproject.kaa.server.admin.shared.services.KaaAdminServiceException;
import org.kaaproject.kaa.common.dto.*; import org.kaaproject.kaa.server.admin.services.util.*; import org.kaaproject.kaa.server.admin.shared.services.*;
[ "org.kaaproject.kaa" ]
org.kaaproject.kaa;
1,989,109
public String getAssessmentId() { return Validator.check(assessmentId, "0"); }
String function() { return Validator.check(assessmentId, "0"); }
/** * get assessment id * * @return the assessment id */
get assessment id
getAssessmentId
{ "repo_name": "eemirtekin/Sakai-10.6-TR", "path": "samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/evaluation/ExportResponsesBean.java", "license": "apache-2.0", "size": 17696 }
[ "org.sakaiproject.tool.assessment.ui.bean.util.Validator" ]
import org.sakaiproject.tool.assessment.ui.bean.util.Validator;
import org.sakaiproject.tool.assessment.ui.bean.util.*;
[ "org.sakaiproject.tool" ]
org.sakaiproject.tool;
2,004,454