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 Set<SubscribedAPI> getSubscribedAPIs(Subscriber subscriber, String applicationName, String groupingId) throws APIManagementException { Set<SubscribedAPI> subscribedAPIs = new LinkedHashSet<SubscribedAPI>(); Connection connection = null; PreparedStatement ps = null; ...
Set<SubscribedAPI> function(Subscriber subscriber, String applicationName, String groupingId) throws APIManagementException { Set<SubscribedAPI> subscribedAPIs = new LinkedHashSet<SubscribedAPI>(); Connection connection = null; PreparedStatement ps = null; ResultSet result = null; String sqlQuery = STR + STR + STR + ST...
/** * This method returns the set of APIs for given subscriber, subscribed under the specified application. * * @param subscriber subscriber * @param applicationName Application Name * @return Set<API> * @throws org.wso2.carbon.apimgt.api.APIManagementException * if failed to...
This method returns the set of APIs for given subscriber, subscribed under the specified application
getSubscribedAPIs
{ "repo_name": "rnavagamuwa/custom-carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java", "license": "apache-2.0", "size": 404796 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.ResultSet", "java.sql.SQLException", "java.util.LinkedHashSet", "java.util.Set", "org.wso2.carbon.apimgt.api.APIManagementException", "org.wso2.carbon.apimgt.api.model.APIIdentifier", "org.wso2.carbon.apimgt.api.model.Application", "or...
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.LinkedHashSet; import java.util.Set; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.model.APIIdentifier; import org.wso2.carbon.apimgt.api...
import java.sql.*; import java.util.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.impl.*; import org.wso2.carbon.apimgt.impl.utils.*;
[ "java.sql", "java.util", "org.wso2.carbon" ]
java.sql; java.util; org.wso2.carbon;
1,704,962
public T delayAlpha(@FloatRange(from = 0.0, to = 1.0) float end) { getDelayedProcessor().addProcess(ALPHA, end); return self(); }
T function(@FloatRange(from = 0.0, to = 1.0) float end) { getDelayedProcessor().addProcess(ALPHA, end); return self(); }
/** * Similar to alpha(float), but wait until the transition is about to start to perform the evaluation. * * @param end * @return self */
Similar to alpha(float), but wait until the transition is about to start to perform the evaluation
delayAlpha
{ "repo_name": "kaichunlin/android-transition", "path": "core/src/main/java/com/kaichunlin/transition/AbstractTransitionBuilder.java", "license": "apache-2.0", "size": 33240 }
[ "android.support.annotation.FloatRange" ]
import android.support.annotation.FloatRange;
import android.support.annotation.*;
[ "android.support" ]
android.support;
2,369,220
protected String sha1( File file ) { try { if (contentBasedSha1()) { byte[] hash = SecureHash.getHash(SecureHash.Algorithm.SHA_1, file); return StringUtil.getHexString(hash); } return SecureHash.sha1(createUrlForFile(file).toString()); ...
String function( File file ) { try { if (contentBasedSha1()) { byte[] hash = SecureHash.getHash(SecureHash.Algorithm.SHA_1, file); return StringUtil.getHexString(hash); } return SecureHash.sha1(createUrlForFile(file).toString()); } catch (Exception e) { throw new ConnectorException(e); } }
/** * Computes the SHA1 for the given file. By default, this method will look at the * {@link FileSystemConnector#contentBasedSha1()} flag and either take the URL of the file (using @see * java.util.File#toURI().toURL() and return the SHA1 of the URL string or return the SHA1 of the entire file content. ...
Computes the SHA1 for the given file. By default, this method will look at the <code>FileSystemConnector#contentBasedSha1()</code> flag and either take the URL of the file (using @see java.util.File#toURI().toURL() and return the SHA1 of the URL string or return the SHA1 of the entire file content
sha1
{ "repo_name": "flownclouds/modeshape", "path": "modeshape-jcr/src/main/java/org/modeshape/connector/filesystem/FileSystemConnector.java", "license": "apache-2.0", "size": 53636 }
[ "java.io.File", "org.modeshape.common.util.SecureHash", "org.modeshape.common.util.StringUtil", "org.modeshape.jcr.spi.federation.ConnectorException" ]
import java.io.File; import org.modeshape.common.util.SecureHash; import org.modeshape.common.util.StringUtil; import org.modeshape.jcr.spi.federation.ConnectorException;
import java.io.*; import org.modeshape.common.util.*; import org.modeshape.jcr.spi.federation.*;
[ "java.io", "org.modeshape.common", "org.modeshape.jcr" ]
java.io; org.modeshape.common; org.modeshape.jcr;
2,908,591
@Override @XmlElement(name = "MD_DatatypeCode") public CodeListUID getElement() { return identifier; }
@XmlElement(name = STR) CodeListUID function() { return identifier; }
/** * Invoked by JAXB on marshalling. * * @return the value to be marshalled. */
Invoked by JAXB on marshalling
getElement
{ "repo_name": "Geomatys/sis", "path": "core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/MD_DatatypeCode.java", "license": "apache-2.0", "size": 2531 }
[ "javax.xml.bind.annotation.XmlElement", "org.apache.sis.internal.jaxb.gmd.CodeListUID" ]
import javax.xml.bind.annotation.XmlElement; import org.apache.sis.internal.jaxb.gmd.CodeListUID;
import javax.xml.bind.annotation.*; import org.apache.sis.internal.jaxb.gmd.*;
[ "javax.xml", "org.apache.sis" ]
javax.xml; org.apache.sis;
2,634,151
public static void log(final Object caller, final Level arg0, final String arg1, final Object arg2) { Logger.resolveLogger(caller).log(arg0, arg1, arg2); }
static void function(final Object caller, final Level arg0, final String arg1, final Object arg2) { Logger.resolveLogger(caller).log(arg0, arg1, arg2); }
/** * Logs a message, with associated parameter * * @param caller the object calling the logger * @param arg0 the log level * @param arg1 the message * @param arg2 the parameter */
Logs a message, with associated parameter
log
{ "repo_name": "krevelen/coala", "path": "coala-adapters/coala-dsol2-adapter/src/main/java/nl/tudelft/simulation/logger/Logger.java", "license": "apache-2.0", "size": 19181 }
[ "java.util.logging.Level" ]
import java.util.logging.Level;
import java.util.logging.*;
[ "java.util" ]
java.util;
647,533
public void send(List<SimpleNameValuePair> requestParams, File file) throws UnknownHostException, ConnectException, RemoteException, IOException;
void function(List<SimpleNameValuePair> requestParams, File file) throws UnknownHostException, ConnectException, RemoteException, IOException;
/** * Send a String to the HTTP server and upload a file * * @param requestParams * the request parameters list with (parameter, value) * @param file * the file to upload * * @throws UnknownHostException * Host url (http://www.acm...
Send a String to the HTTP server and upload a file
send
{ "repo_name": "ndepomereu/awake-file", "path": "src-main/org/kawanfw/commons/client/http/HttpTransfer.java", "license": "lgpl-2.1", "size": 9421 }
[ "java.io.File", "java.io.IOException", "java.net.ConnectException", "java.net.UnknownHostException", "java.util.List", "org.kawanfw.commons.api.client.RemoteException" ]
import java.io.File; import java.io.IOException; import java.net.ConnectException; import java.net.UnknownHostException; import java.util.List; import org.kawanfw.commons.api.client.RemoteException;
import java.io.*; import java.net.*; import java.util.*; import org.kawanfw.commons.api.client.*;
[ "java.io", "java.net", "java.util", "org.kawanfw.commons" ]
java.io; java.net; java.util; org.kawanfw.commons;
1,857,741
public boolean accept(File file) { if (file == null) { return false; } boolean scan = false; for (FileTypeAnalyzer a : this.fileTypeAnalyzers) { scan |= a.accept(file); } return scan; }
boolean function(File file) { if (file == null) { return false; } boolean scan = false; for (FileTypeAnalyzer a : this.fileTypeAnalyzers) { scan = a.accept(file); } return scan; }
/** * Checks all analyzers to see if an extension is supported. * * @param file a file extension * @return true or false depending on whether or not the file extension is supported */
Checks all analyzers to see if an extension is supported
accept
{ "repo_name": "wmaintw/DependencyCheck", "path": "dependency-check-core/src/main/java/org/owasp/dependencycheck/Engine.java", "license": "apache-2.0", "size": 18726 }
[ "java.io.File", "org.owasp.dependencycheck.analyzer.FileTypeAnalyzer" ]
import java.io.File; import org.owasp.dependencycheck.analyzer.FileTypeAnalyzer;
import java.io.*; import org.owasp.dependencycheck.analyzer.*;
[ "java.io", "org.owasp.dependencycheck" ]
java.io; org.owasp.dependencycheck;
2,560,846
@Test public void test1() { List<Travel> travels = new ArrayList<>(); Travel journey = new Travel( ZonedDateTime.parse("2017-06-16T10:55+00:00").withZoneSameLocal(ZoneId.of("Europe/Amsterdam")), ZonedDateTime.parse("2017-06-16T19:55+00:00").withZoneSameLocal(ZoneId.of("America/Los_Angeles")) ); trav...
void function() { List<Travel> travels = new ArrayList<>(); Travel journey = new Travel( ZonedDateTime.parse(STR).withZoneSameLocal(ZoneId.of(STR)), ZonedDateTime.parse(STR).withZoneSameLocal(ZoneId.of(STR)) ); travels.add(journey); Travel returnTrip = new Travel( ZonedDateTime.parse(STR).withZoneSameLocal(ZoneId.of(ST...
/** * Test attributes: * Journey: * From: Europe/Amsterdam * To: America/Los_Angeles * Date category: summer time * Departure time: morning * Arrival time: morning * Return trip: * From: America/Los_Angeles * To: Europe/Amsterdam * Date category: summer time * Departure time: a...
Test attributes: Journey: From: Europe/Amsterdam To: America/Los_Angeles Date category: summer time Departure time: morning Arrival time: morning Return trip: From: America/Los_Angeles To: Europe/Amsterdam Date category: summer time Departure time: afternoon Arrival time: morning Source: HREF
test1
{ "repo_name": "aversio/HappiApp", "path": "src/org/todss/client/test/JUnitTesting.java", "license": "apache-2.0", "size": 13625 }
[ "java.time.ZoneId", "java.time.ZonedDateTime", "java.util.ArrayList", "java.util.List", "org.todss.algorithm.model.Intake", "org.todss.algorithm.model.Travel" ]
import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.List; import org.todss.algorithm.model.Intake; import org.todss.algorithm.model.Travel;
import java.time.*; import java.util.*; import org.todss.algorithm.model.*;
[ "java.time", "java.util", "org.todss.algorithm" ]
java.time; java.util; org.todss.algorithm;
2,015,263
@Nullable Message<?> receive() throws MessagingException;
Message<?> receive() throws MessagingException;
/** * Receive a message from a default destination. * @return the received message, possibly {@code null} if the message could not * be received, for example due to a timeout */
Receive a message from a default destination
receive
{ "repo_name": "spring-projects/spring-framework", "path": "spring-messaging/src/main/java/org/springframework/messaging/core/MessageReceivingOperations.java", "license": "apache-2.0", "size": 2525 }
[ "org.springframework.messaging.Message", "org.springframework.messaging.MessagingException" ]
import org.springframework.messaging.Message; import org.springframework.messaging.MessagingException;
import org.springframework.messaging.*;
[ "org.springframework.messaging" ]
org.springframework.messaging;
1,664,007
@Override public void activate() { log.trace("Activating binding"); startRefreshScheduler(); log.trace("Registering modules"); for (NikobusModule module : getBindingProvider().getAllModules()) { register(module); } }
void function() { log.trace(STR); startRefreshScheduler(); log.trace(STR); for (NikobusModule module : getBindingProvider().getAllModules()) { register(module); } }
/** * Activate the binding provider. After initial connection; */
Activate the binding provider. After initial connection
activate
{ "repo_name": "paolodenti/openhab", "path": "bundles/binding/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/NikobusBinding.java", "license": "epl-1.0", "size": 12709 }
[ "org.openhab.binding.nikobus.internal.core.NikobusModule" ]
import org.openhab.binding.nikobus.internal.core.NikobusModule;
import org.openhab.binding.nikobus.internal.core.*;
[ "org.openhab.binding" ]
org.openhab.binding;
2,583,819
@Override public void info(String TAG, String message) { if(verbosity == Verbosity.INFO) { Log.i(TAG, message); } }
void function(String TAG, String message) { if(verbosity == Verbosity.INFO) { Log.i(TAG, message); } }
/** * Log information messages * @param TAG The Tag to log with * @param message The message to log */
Log information messages
info
{ "repo_name": "Microsoft/Telemetry-Client-for-Android", "path": "AndroidCll/src/main/java/com/microsoft/cll/android/AndroidLogger.java", "license": "mit", "size": 1938 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
876,251
private void uploadFileExtMismatchSettings(File remoteFolder) throws SharedConfigurationException { publishTask("Uploading File Extension Mismatch module configuration"); copyToRemoteFolder(FILE_EXT_MISMATCH_SETTINGS, moduleDirPath, remoteFolder, true); copyToRemoteFolder(FILE_EXT_MISMATCH_S...
void function(File remoteFolder) throws SharedConfigurationException { publishTask(STR); copyToRemoteFolder(FILE_EXT_MISMATCH_SETTINGS, moduleDirPath, remoteFolder, true); copyToRemoteFolder(FILE_EXT_MISMATCH_SETTINGS_LEGACY, moduleDirPath, remoteFolder, false); }
/** * Upload settings for the file extension mismatch module. * * @param remoteFolder Shared settings folder * * @throws SharedConfigurationException */
Upload settings for the file extension mismatch module
uploadFileExtMismatchSettings
{ "repo_name": "esaunders/autopsy", "path": "Experimental/src/org/sleuthkit/autopsy/experimental/configuration/SharedConfiguration.java", "license": "apache-2.0", "size": 65973 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
267,283
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace(); int i = 1; if (stackTraceElements.length>1) { i++; if (stackTraceElements.length>2 && stackTraceElements[i].getClassName().equals("org.voyanttools.trombone.tool.utils.AbstractTool") && stackTraceElements[i].getMethodName().equa...
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace(); int i = 1; if (stackTraceElements.length>1) { i++; if (stackTraceElements.length>2 && stackTraceElements[i].getClassName().equals(STR) && stackTraceElements[i].getMethodName().equals(STR)) { i++; } } if (messages==null) { messages = new Ar...
/** * Create a message intended for the client (which may or may not appear to the user). * @param message the message * @param type the {@link Message.Type} */
Create a message intended for the client (which may or may not appear to the user)
message
{ "repo_name": "sgsinclair/trombone", "path": "src/main/java/org/voyanttools/trombone/tool/util/AbstractTool.java", "license": "gpl-3.0", "size": 7116 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,547,923
public com.mozu.api.contracts.appdev.FileMetadata changePackageFileNameOrPath(com.mozu.api.contracts.appdev.RenameInfo renameInfo, Integer applicationVersionId, Integer packageId, AuthTicket authTicket) throws Exception { MozuClient<com.mozu.api.contracts.appdev.FileMetadata> client = com.mozu.api.clients.platfor...
com.mozu.api.contracts.appdev.FileMetadata function(com.mozu.api.contracts.appdev.RenameInfo renameInfo, Integer applicationVersionId, Integer packageId, AuthTicket authTicket) throws Exception { MozuClient<com.mozu.api.contracts.appdev.FileMetadata> client = com.mozu.api.clients.platform.developer.ApplicationVersionCl...
/** * * <p><pre><code> * ApplicationVersion applicationversion = new ApplicationVersion(); * FileMetadata fileMetadata = applicationversion.ChangePackageFileNameOrPath( renameInfo, applicationVersionId, packageId, authTicket); * </code></pre></p> * @param applicationVersionId * @param packageId * @...
<code><code> ApplicationVersion applicationversion = new ApplicationVersion(); FileMetadata fileMetadata = applicationversion.ChangePackageFileNameOrPath( renameInfo, applicationVersionId, packageId, authTicket); </code></code>
changePackageFileNameOrPath
{ "repo_name": "carsonreinke/mozu-java-sdk", "path": "src/main/java/com/mozu/api/resources/platform/developer/ApplicationVersionResource.java", "license": "mit", "size": 16398 }
[ "com.mozu.api.MozuClient", "com.mozu.api.security.AuthTicket" ]
import com.mozu.api.MozuClient; import com.mozu.api.security.AuthTicket;
import com.mozu.api.*; import com.mozu.api.security.*;
[ "com.mozu.api" ]
com.mozu.api;
2,358,462
public ArrayList<Player> getPlayers();
ArrayList<Player> function();
/** * Get the players * * @return The players list */
Get the players
getPlayers
{ "repo_name": "PymZoR/LO02-Menhir", "path": "src/core/Playable.java", "license": "mit", "size": 2261 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,835,783
public synchronized int getMessageCount() throws MessagingException { statDir(curdir); statDir(newdir); return curdir.messages.length + newdir.messages.length; }
synchronized int function() throws MessagingException { statDir(curdir); statDir(newdir); return curdir.messages.length + newdir.messages.length; }
/** * Returns the number of messages in this folder. * @exception MessagingException if a messaging error occurred */
Returns the number of messages in this folder
getMessageCount
{ "repo_name": "imoseyon/leanKernel-d2usc-deprecated", "path": "vendor/samsung/common/packages/apps/Email/lib_Src/mail-1.1.2/source/gnu/mail/providers/maildir/MaildirFolder.java", "license": "gpl-2.0", "size": 21707 }
[ "javax.mail.MessagingException" ]
import javax.mail.MessagingException;
import javax.mail.*;
[ "javax.mail" ]
javax.mail;
1,049,991
public Map<String, Object> getJsonPathExpressions() { return jsonPathExpressions; }
Map<String, Object> function() { return jsonPathExpressions; }
/** * Gets the JSONPath expressions. * @return */
Gets the JSONPath expressions
getJsonPathExpressions
{ "repo_name": "christophd/citrus", "path": "validation/citrus-validation-json/src/main/java/com/consol/citrus/validation/json/JsonPathVariableExtractor.java", "license": "apache-2.0", "size": 4998 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,863,352
protected boolean acceptWord(DependencyTreeNode focusNode, String contextHeader, Wordsi wordsi) { return pseudoWordMap.containsKey(focusNode.word()) && focusNode.word().equals(contextHeader); }
boolean function(DependencyTreeNode focusNode, String contextHeader, Wordsi wordsi) { return pseudoWordMap.containsKey(focusNode.word()) && focusNode.word().equals(contextHeader); }
/** * Returns true if {@code focusWord} is a known pseudo word. */
Returns true if focusWord is a known pseudo word
acceptWord
{ "repo_name": "fozziethebeat/S-Space", "path": "src/main/java/edu/ucla/sspace/wordsi/psd/PseudoWordDependencyContextExtractor.java", "license": "gpl-2.0", "size": 5053 }
[ "edu.ucla.sspace.dependency.DependencyTreeNode", "edu.ucla.sspace.wordsi.Wordsi" ]
import edu.ucla.sspace.dependency.DependencyTreeNode; import edu.ucla.sspace.wordsi.Wordsi;
import edu.ucla.sspace.dependency.*; import edu.ucla.sspace.wordsi.*;
[ "edu.ucla.sspace" ]
edu.ucla.sspace;
2,773,494
return new FormLoginHandlerImpl(authProvider, DEFAULT_USERNAME_PARAM, DEFAULT_PASSWORD_PARAM, DEFAULT_RETURN_URL_PARAM, null); }
return new FormLoginHandlerImpl(authProvider, DEFAULT_USERNAME_PARAM, DEFAULT_PASSWORD_PARAM, DEFAULT_RETURN_URL_PARAM, null); }
/** * Create a handler * * @param authProvider the auth service to use * @return the handler */
Create a handler
create
{ "repo_name": "eformat/vertx-web", "path": "vertx-web/src/main/java/io/vertx/ext/web/handler/FormLoginHandler.java", "license": "apache-2.0", "size": 3734 }
[ "io.vertx.ext.web.handler.impl.FormLoginHandlerImpl" ]
import io.vertx.ext.web.handler.impl.FormLoginHandlerImpl;
import io.vertx.ext.web.handler.impl.*;
[ "io.vertx.ext" ]
io.vertx.ext;
2,460,983
private void printParams(Node n, String pageParam, boolean literal) throws JasperException { class ParamVisitor extends Node.Visitor { private String separator; ParamVisitor(String separator) { this.separator = separator; ...
void function(Node n, String pageParam, boolean literal) throws JasperException { class ParamVisitor extends Node.Visitor { private String separator; ParamVisitor(String separator) { this.separator = separator; }
/** * Prints the attribute value specified in the param action, in the form * of name=value string. * * @param n * the parent node for the param action nodes. */
Prints the attribute value specified in the param action, in the form of name=value string
printParams
{ "repo_name": "plumer/codana", "path": "tomcat_files/8.0.22/Generator.java", "license": "mit", "size": 173069 }
[ "org.apache.jasper.JasperException" ]
import org.apache.jasper.JasperException;
import org.apache.jasper.*;
[ "org.apache.jasper" ]
org.apache.jasper;
600,417
@Override public boolean accept(File f) { if (f.isDirectory()) { return true; } // PREFIX MODE if (this.prefix_mode) { String name = f.getName(); for (String prefix : this.matches) { if (name.startsWith(prefix)) { ...
boolean function(File f) { if (f.isDirectory()) { return true; } if (this.prefix_mode) { String name = f.getName(); for (String prefix : this.matches) { if (name.startsWith(prefix)) { return (true); } } } else { String extension = IOFileFilter.getExtension(f); if (extension != null) { return (this.matches.contains(exte...
/** * We only want to except files that match * * @param f * - the file to check for its extension * @return true if the file is acceptable */
We only want to except files that match
accept
{ "repo_name": "malin1993ml/h-store", "path": "src/frontend/edu/brown/utils/IOFileFilter.java", "license": "gpl-3.0", "size": 6566 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
242,781
@Override @DoesServiceRequest public void write(final byte[] data, final int offset, final int length) throws IOException { if (offset < 0 || length < 0 || length > data.length - offset) { throw new IndexOutOfBoundsException(); } this.writeInternal(data, offset, length);...
void function(final byte[] data, final int offset, final int length) throws IOException { if (offset < 0 length < 0 length > data.length - offset) { throw new IndexOutOfBoundsException(); } this.writeInternal(data, offset, length); }
/** * Writes length bytes from the specified byte array starting at offset to this output stream. * * @param data * A <code>byte</code> array which represents the data to write. * @param offset * An <code>int</code> which represents the start offset in the data. ...
Writes length bytes from the specified byte array starting at offset to this output stream
write
{ "repo_name": "manikandan-palaniappan/azure-storage-java", "path": "microsoft-azure-storage/src/com/microsoft/azure/storage/blob/BlobOutputStream.java", "license": "apache-2.0", "size": 22723 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,649,348
public @Nonnull IntegerSpace getVids() { return _vids; }
@Nonnull IntegerSpace function() { return _vids; }
/** * Returns trunk (tagged) VLAN IDs if interface is in trunk mode, or else an empty {@link * IntegerSpace}. If {@link #getAccess} is {@code null}, {@link #getVids} is empty, and interface * is in {@link Bridge#getPorts}, then value from {@link Bridge#getVids()} should be used. */
Returns trunk (tagged) VLAN IDs if interface is in trunk mode, or else an empty <code>IntegerSpace</code>. If <code>#getAccess</code> is null, <code>#getVids</code> is empty, and interface is in <code>Bridge#getPorts</code>, then value from <code>Bridge#getVids()</code> should be used
getVids
{ "repo_name": "intentionet/batfish", "path": "projects/batfish/src/main/java/org/batfish/representation/cumulus_concatenated/InterfaceBridgeSettings.java", "license": "apache-2.0", "size": 2344 }
[ "javax.annotation.Nonnull", "org.batfish.datamodel.IntegerSpace" ]
import javax.annotation.Nonnull; import org.batfish.datamodel.IntegerSpace;
import javax.annotation.*; import org.batfish.datamodel.*;
[ "javax.annotation", "org.batfish.datamodel" ]
javax.annotation; org.batfish.datamodel;
2,094,144
public String unify(String statement) { JSONArray table = this.getData(); if (table != null && table.length() > 0) { JSONObject row = table.getJSONObject(0); for (String key: row.keySet()) { int i = statement.indexOf("$" + key + "$"); if (i >= ...
String function(String statement) { JSONArray table = this.getData(); if (table != null && table.length() > 0) { JSONObject row = table.getJSONObject(0); for (String key: row.keySet()) { int i = statement.indexOf("$" + key + "$"); if (i >= 0) { statement = statement.substring(0, i) + row.get(key).toString() + statement...
/** * Unification applies a piece of memory within the current argument to a statement * which creates an instantiated statement * @param statement * @return the instantiated statement with elements of the argument applied as much as possible */
Unification applies a piece of memory within the current argument to a statement which creates an instantiated statement
unify
{ "repo_name": "singhpratyush/loklak_server", "path": "src/org/loklak/susi/SusiThought.java", "license": "lgpl-2.1", "size": 9842 }
[ "org.json.JSONArray", "org.json.JSONObject" ]
import org.json.JSONArray; import org.json.JSONObject;
import org.json.*;
[ "org.json" ]
org.json;
689,450
public void keyUp(int keyCode) { switch (keyCode) { case KeyEvent.KEYCODE_ALT_LEFT: case KeyEvent.KEYCODE_ALT_RIGHT: mAltKey.onRelease(); break; case KeyEvent.KEYCODE_SHIFT_LEFT: case KeyEvent.KEYCODE_SHIFT_RIGHT: mCapKey.onRelease(); ...
void function(int keyCode) { switch (keyCode) { case KeyEvent.KEYCODE_ALT_LEFT: case KeyEvent.KEYCODE_ALT_RIGHT: mAltKey.onRelease(); break; case KeyEvent.KEYCODE_SHIFT_LEFT: case KeyEvent.KEYCODE_SHIFT_RIGHT: mCapKey.onRelease(); break; default: break; } }
/** * Handle a keyUp event. * * @param keyCode the keyCode of the keyUp event */
Handle a keyUp event
keyUp
{ "repo_name": "nickiaconis/brickster", "path": "android/src/com/codefox421/brickster/BricksTer.java", "license": "mit", "size": 118234 }
[ "android.view.KeyEvent" ]
import android.view.KeyEvent;
import android.view.*;
[ "android.view" ]
android.view;
641,656
protected boolean addValueBootstrap(NodeState state, double value[], int result) { double newBuffer[] = adjustValueBuffer(state, value, true); int newResultBuffer[] = AbstractClassifierSlidingWindowManagingNode.adjustResultBuffer(state, result, true); boolean newBootstrap = true; if...
boolean function(NodeState state, double value[], int result) { double newBuffer[] = adjustValueBuffer(state, value, true); int newResultBuffer[] = AbstractClassifierSlidingWindowManagingNode.adjustResultBuffer(state, result, true); boolean newBootstrap = true; if (newResultBuffer.length >= getMaxBufferLength()) { doub...
/** * Adds new value to the buffer. Gaussian model is regenerated. Assuming that we are in bootstrap mode. * * @param state Node state to get/set properties * @param value New value to add; {@code null} disallowed * @param result Proper class label * @return new bootstrap mode value *...
Adds new value to the buffer. Gaussian model is regenerated. Assuming that we are in bootstrap mode
addValueBootstrap
{ "repo_name": "electricalwind/greycat", "path": "plugins/incub/mlx/src/main/java/org/mwg/mlx/algorithm/AbstractClassifierSlidingWindowManagingNode.java", "license": "apache-2.0", "size": 11224 }
[ "org.mwg.plugin.NodeState" ]
import org.mwg.plugin.NodeState;
import org.mwg.plugin.*;
[ "org.mwg.plugin" ]
org.mwg.plugin;
2,312,517
private static Map<String, String> flatten(Properties p) { return p.stringPropertyNames() .stream() .collect(ImmutableMap.toImmutableMap(name -> name, name -> p.getProperty(name))); }
static Map<String, String> function(Properties p) { return p.stringPropertyNames() .stream() .collect(ImmutableMap.toImmutableMap(name -> name, name -> p.getProperty(name))); }
/** * Properties objects can have an enclosed default Properties, but Properties doesn't * override equals() to take that into account. * * @param p a Properties object * @return a map with the properties, including any defaults not overridden */
Properties objects can have an enclosed default Properties, but Properties doesn't override equals() to take that into account
flatten
{ "repo_name": "google-cloudsearch/connector-sdk", "path": "sdk/src/main/java/com/google/enterprise/cloudsearch/sdk/config/Configuration.java", "license": "apache-2.0", "size": 21952 }
[ "com.google.common.collect.ImmutableMap", "java.util.Map", "java.util.Properties" ]
import com.google.common.collect.ImmutableMap; import java.util.Map; import java.util.Properties;
import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
2,644,302
public void setMedia(Media media) throws SdpException { if (media == null) throw new SdpException("The media is null"); if (media instanceof MediaField) { mediaField = (MediaField) media; } else throw new SdpException("A mediaField parameter is required"); }
void function(Media media) throws SdpException { if (media == null) throw new SdpException(STR); if (media instanceof MediaField) { mediaField = (MediaField) media; } else throw new SdpException(STR); }
/** * Set the Media field of the description. * * @param media to set * @throws SdpException if the media field is null */
Set the Media field of the description
setMedia
{ "repo_name": "darkmi/rtspproxy", "path": "src/main/java/gov/nist/javax/sdp/MediaDescriptionImpl.java", "license": "gpl-2.0", "size": 18115 }
[ "gov.nist.javax.sdp.fields.MediaField", "javax.sdp.Media", "javax.sdp.SdpException" ]
import gov.nist.javax.sdp.fields.MediaField; import javax.sdp.Media; import javax.sdp.SdpException;
import gov.nist.javax.sdp.fields.*; import javax.sdp.*;
[ "gov.nist.javax", "javax.sdp" ]
gov.nist.javax; javax.sdp;
319,515
public void setIngressPolicingRate(Set<Long> ingressPolicingRate) { ColumnDescription columndesc = new ColumnDescription( InterfaceColumn.INGRESSPOLICINGRATE .columnName(), ...
void function(Set<Long> ingressPolicingRate) { ColumnDescription columndesc = new ColumnDescription( InterfaceColumn.INGRESSPOLICINGRATE .columnName(), STR, VersionNum.VERSION100); super.setDataHandler(columndesc, ingressPolicingRate); }
/** * Add a Column entity which column name is "ingress_policing_rate" to the * Row entity of attributes. * @param ingressPolicingRate the column data which column name is * "ingress_policing_rate" */
Add a Column entity which column name is "ingress_policing_rate" to the Row entity of attributes
setIngressPolicingRate
{ "repo_name": "kuangrewawa/OnosFw", "path": "ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/table/Interface.java", "license": "apache-2.0", "size": 51208 }
[ "java.util.Set", "org.onosproject.ovsdb.rfc.tableservice.ColumnDescription" ]
import java.util.Set; import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription;
import java.util.*; import org.onosproject.ovsdb.rfc.tableservice.*;
[ "java.util", "org.onosproject.ovsdb" ]
java.util; org.onosproject.ovsdb;
820,564
public String evaluateActionCondition(final String actionId, final User user, final HttpServletRequest request, final HttpServletResponse response) throws DotDataException, DotSecurityException{ if (!UtilMethods.isSet(actionId)) { final String exceptionMessage = getFormattedMessage(user.getLoca...
String function(final String actionId, final User user, final HttpServletRequest request, final HttpServletResponse response) throws DotDataException, DotSecurityException{ if (!UtilMethods.isSet(actionId)) { final String exceptionMessage = getFormattedMessage(user.getLocale(),STR,actionId); throw new IllegalArgumentEx...
/** * Evaluates the action condition using the Velocity Template Engine * @param actionId * @param user * @return * @throws DotDataException * @throws DotSecurityException */
Evaluates the action condition using the Velocity Template Engine
evaluateActionCondition
{ "repo_name": "dotCMS/core", "path": "dotCMS/src/main/java/com/dotcms/workflow/helper/WorkflowHelper.java", "license": "gpl-3.0", "size": 83329 }
[ "com.dotcms.rest.api.v1.authentication.ResponseUtil", "com.dotmarketing.exception.DoesNotExistException", "com.dotmarketing.exception.DotDataException", "com.dotmarketing.exception.DotSecurityException", "com.dotmarketing.portlets.workflows.model.WorkflowAction", "com.dotmarketing.util.UtilMethods", "co...
import com.dotcms.rest.api.v1.authentication.ResponseUtil; import com.dotmarketing.exception.DoesNotExistException; import com.dotmarketing.exception.DotDataException; import com.dotmarketing.exception.DotSecurityException; import com.dotmarketing.portlets.workflows.model.WorkflowAction; import com.dotmarketing.util.Ut...
import com.dotcms.rest.api.v1.authentication.*; import com.dotmarketing.exception.*; import com.dotmarketing.portlets.workflows.model.*; import com.dotmarketing.util.*; import com.dotmarketing.util.web.*; import com.liferay.portal.model.*; import java.io.*; import javax.servlet.http.*; import org.apache.velocity.contex...
[ "com.dotcms.rest", "com.dotmarketing.exception", "com.dotmarketing.portlets", "com.dotmarketing.util", "com.liferay.portal", "java.io", "javax.servlet", "org.apache.velocity" ]
com.dotcms.rest; com.dotmarketing.exception; com.dotmarketing.portlets; com.dotmarketing.util; com.liferay.portal; java.io; javax.servlet; org.apache.velocity;
668,346
public int initializeTensorFlow( AssetManager assetManager, String modelFilename, String labelFilename, int numClasses, int inputSize, int imageMean, float imageStd, String inputName, String outputName) throws IOException { this.inputName = inputName; this...
int function( AssetManager assetManager, String modelFilename, String labelFilename, int numClasses, int inputSize, int imageMean, float imageStd, String inputName, String outputName) throws IOException { this.inputName = inputName; this.outputName = outputName; String actualFilename = labelFilename.split(STRReading la...
/** * Initializes a native TensorFlow session for classifying images. * * @param assetManager The asset manager to be used to load assets. * @param modelFilename The filepath of the model GraphDef protocol buffer. * @param labelFilename The filepath of label file for classes. * @param numClasses The n...
Initializes a native TensorFlow session for classifying images
initializeTensorFlow
{ "repo_name": "tongwang01/tensorflow", "path": "tensorflow/examples/android/src/org/tensorflow/demo/TensorFlowImageClassifier.java", "license": "apache-2.0", "size": 6338 }
[ "android.content.res.AssetManager", "java.io.IOException", "org.tensorflow.contrib.android.TensorFlowInferenceInterface" ]
import android.content.res.AssetManager; import java.io.IOException; import org.tensorflow.contrib.android.TensorFlowInferenceInterface;
import android.content.res.*; import java.io.*; import org.tensorflow.contrib.android.*;
[ "android.content", "java.io", "org.tensorflow.contrib" ]
android.content; java.io; org.tensorflow.contrib;
226,265
public void queryPST(int lower, int upper, int prio, int pos, IntArrayList dataKey, IntArrayList dataPrio, IntArrayList dataInf) { // starting at subtree rooted at pos, returns everything between lower and upper with priority >=prio // result comes as vector of individual data items if (pos...
void function(int lower, int upper, int prio, int pos, IntArrayList dataKey, IntArrayList dataPrio, IntArrayList dataInf) { if (pos > treeKey.length - 1) { return; } if (heapPrio[pos] < prio) { return; } if ( heapKey[pos] >= lower && heapKey[pos] <= upper) { dataKey.add(heapKey[pos]); dataPrio.add(heapPrio[pos]); dataI...
/** * Query the subtree rooted at pos for all data with keys between lower and upper and priority >= prio */
Query the subtree rooted at pos for all data with keys between lower and upper and priority >= prio
queryPST
{ "repo_name": "ToureNPlaner/tourenplaner-server", "path": "src/main/java/de/tourenplaner/graphrep/PrioSearchTree.java", "license": "apache-2.0", "size": 10016 }
[ "com.carrotsearch.hppc.IntArrayList" ]
import com.carrotsearch.hppc.IntArrayList;
import com.carrotsearch.hppc.*;
[ "com.carrotsearch.hppc" ]
com.carrotsearch.hppc;
2,583,166
public static long getOpenFileHandlesLimit() { if (OperatingSystem.isWindows()) { // getMaxFileDescriptorCount method is not available on Windows return -1L; } Class<?> sunBeanClass; try { sunBeanClass = Class.forName("com.sun.management.UnixOperatingSystemMXBean"); } catch (ClassNotFoundException ...
static long function() { if (OperatingSystem.isWindows()) { return -1L; } Class<?> sunBeanClass; try { sunBeanClass = Class.forName(STR); } catch (ClassNotFoundException e) { return -1L; } try { Method fhLimitMethod = sunBeanClass.getMethod(STR); Object result = fhLimitMethod.invoke(ManagementFactory.getOperatingSystem...
/** * Tries to retrieve the maximum number of open file handles. This method will only work on * UNIX-based operating systems with Sun/Oracle Java versions. * * <p>If the number of max open file handles cannot be determined, this method returns {@code -1}.</p> * * @return The limit of open file handles, o...
Tries to retrieve the maximum number of open file handles. This method will only work on UNIX-based operating systems with Sun/Oracle Java versions. If the number of max open file handles cannot be determined, this method returns -1
getOpenFileHandlesLimit
{ "repo_name": "greghogan/flink", "path": "flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java", "license": "apache-2.0", "size": 16365 }
[ "java.lang.management.ManagementFactory", "java.lang.reflect.Method", "org.apache.flink.util.OperatingSystem" ]
import java.lang.management.ManagementFactory; import java.lang.reflect.Method; import org.apache.flink.util.OperatingSystem;
import java.lang.management.*; import java.lang.reflect.*; import org.apache.flink.util.*;
[ "java.lang", "org.apache.flink" ]
java.lang; org.apache.flink;
864,534
@Override public void debug(final Marker marker, final String message, final Object... params) { if (isEnabled(Level.DEBUG, marker, message, params)) { final Message msg = messageFactory.newMessage(message, params); log(marker, FQCN, Level.DEBUG, msg, msg.getThrowable()); ...
void function(final Marker marker, final String message, final Object... params) { if (isEnabled(Level.DEBUG, marker, message, params)) { final Message msg = messageFactory.newMessage(message, params); log(marker, FQCN, Level.DEBUG, msg, msg.getThrowable()); } }
/** * Logs a message with parameters at the {@link Level#DEBUG DEBUG} level. * * @param marker the marker data specific to this log statement. * @param message the message to log. * @param params parameters to the message. */
Logs a message with parameters at the <code>Level#DEBUG DEBUG</code> level
debug
{ "repo_name": "OuZhencong/log4j2", "path": "log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java", "license": "apache-2.0", "size": 66623 }
[ "org.apache.logging.log4j.Level", "org.apache.logging.log4j.Marker", "org.apache.logging.log4j.message.Message" ]
import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Marker; import org.apache.logging.log4j.message.Message;
import org.apache.logging.log4j.*; import org.apache.logging.log4j.message.*;
[ "org.apache.logging" ]
org.apache.logging;
2,038,951
public static Identifier getIdentifier(final IdentifiedObject object, final Citation authority) { if (object != null) { final Iterator<? extends Identifier> it = iterator(object.getIdentifiers()); if (it != null) while (it.hasNext()) { final Identifier identifier = it...
static Identifier function(final IdentifiedObject object, final Citation authority) { if (object != null) { final Iterator<? extends Identifier> it = iterator(object.getIdentifiers()); if (it != null) while (it.hasNext()) { final Identifier identifier = it.next(); if (identifier != null) { if (authority == null identif...
/** * Returns an identifier for the given object according the given authority. * This method checks all {@linkplain AbstractIdentifiedObject#getIdentifiers() identifiers} in their iteration * order and returns the first identifier with an {@linkplain NamedIdentifier#getAuthority() authority} citation ...
Returns an identifier for the given object according the given authority. This method checks all AbstractIdentifiedObject#getIdentifiers() identifiers in their iteration order and returns the first identifier with an NamedIdentifier#getAuthority() authority citation Citations#identifierMatches(Citation, Citation) match...
getIdentifier
{ "repo_name": "desruisseaux/sis", "path": "core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java", "license": "apache-2.0", "size": 38429 }
[ "java.util.Iterator", "org.apache.sis.internal.util.Citations", "org.opengis.metadata.Identifier", "org.opengis.metadata.citation.Citation", "org.opengis.referencing.IdentifiedObject" ]
import java.util.Iterator; import org.apache.sis.internal.util.Citations; import org.opengis.metadata.Identifier; import org.opengis.metadata.citation.Citation; import org.opengis.referencing.IdentifiedObject;
import java.util.*; import org.apache.sis.internal.util.*; import org.opengis.metadata.*; import org.opengis.metadata.citation.*; import org.opengis.referencing.*;
[ "java.util", "org.apache.sis", "org.opengis.metadata", "org.opengis.referencing" ]
java.util; org.apache.sis; org.opengis.metadata; org.opengis.referencing;
2,589,264
public static void shuffle(final int[] array) { shuffle(array, new Random()); }
static void function(final int[] array) { shuffle(array, new Random()); }
/** * Randomly permutes the elements of the specified array using the Fisher-Yates algorithm. * * @param array the array to shuffle * @see <a href="https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates shuffle algorithm</a> * @since 3.6 */
Randomly permutes the elements of the specified array using the Fisher-Yates algorithm
shuffle
{ "repo_name": "ManfredTremmel/gwt-commons-lang3", "path": "src/main/java/org/apache/commons/lang3/ArrayUtils.java", "license": "apache-2.0", "size": 350834 }
[ "java.util.Random" ]
import java.util.Random;
import java.util.*;
[ "java.util" ]
java.util;
433,161
private static String makeHttpRequest(URL url) throws IOException { String response = null; HttpURLConnection urlConnection = null; try { urlConnection = (HttpURLConnection) url.openConnection(); urlConnection.setReadTimeout(WebRequestContract.READ_TIMEOUT); ...
static String function(URL url) throws IOException { String response = null; HttpURLConnection urlConnection = null; try { urlConnection = (HttpURLConnection) url.openConnection(); urlConnection.setReadTimeout(WebRequestContract.READ_TIMEOUT); urlConnection.setConnectTimeout(WebRequestContract.CONNECT_TIMEOUT); urlConn...
/** * Make the web request. * @param url The url with the request. * @return The response of the request. * @throws IOException */
Make the web request
makeHttpRequest
{ "repo_name": "ironbit-android/popular-movies", "path": "app/src/main/java/pe/ironbit/android/popularmovies/request/base/WebRequestHelper.java", "license": "agpl-3.0", "size": 4268 }
[ "java.io.IOException", "java.net.HttpURLConnection" ]
import java.io.IOException; import java.net.HttpURLConnection;
import java.io.*; import java.net.*;
[ "java.io", "java.net" ]
java.io; java.net;
293,145
public Msg makeStandardMessage(byte flags, byte cmd1, byte cmd2, int group) throws FieldException, IOException { Msg m = Msg.s_makeMessage("SendStandardMessage"); InsteonAddress addr = null; if (group != -1) { flags |= 0xc0; // mark message as group message // and stash the group number into the addre...
Msg function(byte flags, byte cmd1, byte cmd2, int group) throws FieldException, IOException { Msg m = Msg.s_makeMessage(STR); InsteonAddress addr = null; if (group != -1) { flags = 0xc0; addr = new InsteonAddress((byte) 0, (byte) 0, (byte) (group & 0xff)); } else { addr = getAddress(); } m.setAddress(STR, addr); m.set...
/** * Helper method to make standard message, possibly with group * @param flags * @param cmd1 * @param cmd2 * @param group (-1 if not a group message) * @return standard message * @throws FieldException * @throws IOException */
Helper method to make standard message, possibly with group
makeStandardMessage
{ "repo_name": "magcode/openhab", "path": "bundles/binding/org.openhab.binding.insteonplm/src/main/java/org/openhab/binding/insteonplm/internal/device/InsteonDevice.java", "license": "epl-1.0", "size": 16840 }
[ "java.io.IOException", "org.openhab.binding.insteonplm.internal.message.FieldException", "org.openhab.binding.insteonplm.internal.message.Msg" ]
import java.io.IOException; import org.openhab.binding.insteonplm.internal.message.FieldException; import org.openhab.binding.insteonplm.internal.message.Msg;
import java.io.*; import org.openhab.binding.insteonplm.internal.message.*;
[ "java.io", "org.openhab.binding" ]
java.io; org.openhab.binding;
1,575,390
@Test public void testPushdownOnOffset() throws Exception { final String predicate1 = "kafkaMsgOffset > 4"; final String predicate2 = "kafkaMsgOffset < 6"; final int expectedRowCount = 5; //1 * NUM_PARTITIONS final String queryString = String.format(TestQueryConstants.QUERY_TEMPLATE_AND, Te...
void function() throws Exception { final String predicate1 = STR; final String predicate2 = STR; final int expectedRowCount = 5; final String queryString = String.format(TestQueryConstants.QUERY_TEMPLATE_AND, TestQueryConstants.JSON_PUSHDOWN_TOPIC, predicate1, predicate2); runKafkaSQLVerifyCount(queryString, expectedRo...
/** * Test filter pushdown with condition on kafkaMsgOffset. * @throws Exception */
Test filter pushdown with condition on kafkaMsgOffset
testPushdownOnOffset
{ "repo_name": "kkhatua/drill", "path": "contrib/storage-kafka/src/test/java/org/apache/drill/exec/store/kafka/KafkaFilterPushdownTest.java", "license": "apache-2.0", "size": 16178 }
[ "org.apache.drill.PlanTestBase" ]
import org.apache.drill.PlanTestBase;
import org.apache.drill.*;
[ "org.apache.drill" ]
org.apache.drill;
2,636,547
public JSOG next() { if (modCount != expectedModCount) { throw new ConcurrentModificationException(); } return wrap(it.next()); }
JSOG function() { if (modCount != expectedModCount) { throw new ConcurrentModificationException(); } return wrap(it.next()); }
/** * Wraps the value from the backing iterator. * @return the wrapped value of the iterator's next method. */
Wraps the value from the backing iterator
next
{ "repo_name": "JeffreyRodriguez/JSOG", "path": "src/main/java/net/sf/jsog/JSOG.java", "license": "unlicense", "size": 56094 }
[ "java.util.ConcurrentModificationException" ]
import java.util.ConcurrentModificationException;
import java.util.*;
[ "java.util" ]
java.util;
2,874,372
void createQueue(AMQQueue queue, FieldTable arguments) throws AMQStoreException;
void createQueue(AMQQueue queue, FieldTable arguments) throws AMQStoreException;
/** * Makes the specified queue persistent. * * @param queue The queue to store. * @param arguments The additional arguments to the binding * * @throws AMQStoreException If the operation fails for any reason. */
Makes the specified queue persistent
createQueue
{ "repo_name": "ChamNDeSilva/andes", "path": "modules/andes-core/broker/src/main/java/org/wso2/andes/server/store/DurableConfigurationStore.java", "license": "apache-2.0", "size": 4715 }
[ "org.wso2.andes.AMQStoreException", "org.wso2.andes.framing.FieldTable", "org.wso2.andes.server.queue.AMQQueue" ]
import org.wso2.andes.AMQStoreException; import org.wso2.andes.framing.FieldTable; import org.wso2.andes.server.queue.AMQQueue;
import org.wso2.andes.*; import org.wso2.andes.framing.*; import org.wso2.andes.server.queue.*;
[ "org.wso2.andes" ]
org.wso2.andes;
1,164,327
@Override() public java.lang.Class getJavaClass( ) { return org.chocolate_milk.model.WorkersCompCodeAddRs.class; }
@Override() java.lang.Class function( ) { return org.chocolate_milk.model.WorkersCompCodeAddRs.class; }
/** * Method getJavaClass. * * @return the Java class represented by this descriptor. */
Method getJavaClass
getJavaClass
{ "repo_name": "galleon1/chocolate-milk", "path": "src/org/chocolate_milk/model/descriptors/WorkersCompCodeAddRsDescriptor.java", "license": "lgpl-3.0", "size": 3655 }
[ "org.chocolate_milk.model.WorkersCompCodeAddRs" ]
import org.chocolate_milk.model.WorkersCompCodeAddRs;
import org.chocolate_milk.model.*;
[ "org.chocolate_milk.model" ]
org.chocolate_milk.model;
1,887,844
private void transformToLowerBiDiagonal() { final int m = householderVectors.length; final int n = householderVectors[0].length; for (int k = 0; k < m; k++) { //zero-out a row final double[] hK = householderVectors[k]; double xNormSqr = 0; fo...
void function() { final int m = householderVectors.length; final int n = householderVectors[0].length; for (int k = 0; k < m; k++) { final double[] hK = householderVectors[k]; double xNormSqr = 0; for (int j = k; j < n; ++j) { final double c = hK[j]; xNormSqr += c * c; } final double a = (hK[k] > 0) ? -FastMath.sqrt(xN...
/** * Transform original matrix to lower bi-diagonal form. * <p>Transformation is done using alternate Householder transforms * on rows and columns.</p> */
Transform original matrix to lower bi-diagonal form. Transformation is done using alternate Householder transforms on rows and columns
transformToLowerBiDiagonal
{ "repo_name": "Yndal/ArduPilot-SensorPlatform", "path": "Tower_with_3drservices/dependencyLibs/EllipsoidFit/EllipsoidFit/src/org/apache/commons/math3/linear/BiDiagonalTransformer.java", "license": "mit", "size": 13442 }
[ "org.apache.commons.math3.util.FastMath" ]
import org.apache.commons.math3.util.FastMath;
import org.apache.commons.math3.util.*;
[ "org.apache.commons" ]
org.apache.commons;
684,374
public static <T> T readValueOfChildByKey(AndesConfiguration configurationProperty, String key) { String constructedKey = configurationProperty.get().getKeyInFile().replace("{key}", key); // The cast to T is unavoidable. Even though the function returns the same data type, ...
static <T> T function(AndesConfiguration configurationProperty, String key) { String constructedKey = configurationProperty.get().getKeyInFile().replace("{key}", key); try { return (T) deriveValidConfigurationValue(constructedKey, configurationProperty.get().getDataType(), configurationProperty.get().getDefaultValue())...
/** * Using this method, you can access a singular property of a child. * <p/> * example, * <p/> * <users> * <user userName="testuser1">password1</user> * <user userName="testuser2">password2</user> * </users> scenario. * * @param configurationProperty relevant enum val...
Using this method, you can access a singular property of a child. example, password1 password2 scenario
readValueOfChildByKey
{ "repo_name": "a5anka/andes", "path": "modules/andes-core/broker/src/main/java/org/wso2/andes/configuration/AndesConfigurationManager.java", "license": "apache-2.0", "size": 25013 }
[ "java.text.MessageFormat", "org.apache.commons.configuration.ConfigurationException", "org.wso2.andes.configuration.enums.AndesConfiguration" ]
import java.text.MessageFormat; import org.apache.commons.configuration.ConfigurationException; import org.wso2.andes.configuration.enums.AndesConfiguration;
import java.text.*; import org.apache.commons.configuration.*; import org.wso2.andes.configuration.enums.*;
[ "java.text", "org.apache.commons", "org.wso2.andes" ]
java.text; org.apache.commons; org.wso2.andes;
2,328,944
private AlertDialog buildLoadPresetDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(this); //Get a cursor with the list of EQ presets. final Cursor cursor = mApp.getDBAccessHelper().getAllEQPresets(); //Set the dialog title. builder.setTitle(R.string.load_pr...
AlertDialog function() { AlertDialog.Builder builder = new AlertDialog.Builder(this); final Cursor cursor = mApp.getDBAccessHelper().getAllEQPresets(); builder.setTitle(R.string.load_preset); builder.setCursor(cursor, new DialogInterface.OnClickListener() {
/** * Builds the "Load Preset" dialog. Does not call the show() method, so this * should be done manually after calling this method. * * @return A fully built AlertDialog reference. */
Builds the "Load Preset" dialog. Does not call the show() method, so this should be done manually after calling this method
buildLoadPresetDialog
{ "repo_name": "reyanshmishra/Rey-MusicPlayer", "path": "app/src/main/java/com/reyansh/audio/audioplayer/free/Equalizer/EqualizerActivity.java", "license": "apache-2.0", "size": 42291 }
[ "android.app.AlertDialog", "android.content.DialogInterface", "android.database.Cursor" ]
import android.app.AlertDialog; import android.content.DialogInterface; import android.database.Cursor;
import android.app.*; import android.content.*; import android.database.*;
[ "android.app", "android.content", "android.database" ]
android.app; android.content; android.database;
2,524,120
public AccessUriInner grantAccess(String resourceGroupName, String diskName, GrantAccessData grantAccessData) { return grantAccessWithServiceResponseAsync(resourceGroupName, diskName, grantAccessData).toBlocking().last().body(); }
AccessUriInner function(String resourceGroupName, String diskName, GrantAccessData grantAccessData) { return grantAccessWithServiceResponseAsync(resourceGroupName, diskName, grantAccessData).toBlocking().last().body(); }
/** * Grants access to a disk. * * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is...
Grants access to a disk
grantAccess
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/compute/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/compute/v2019_03_01/implementation/DisksInner.java", "license": "mit", "size": 88874 }
[ "com.microsoft.azure.management.compute.v2019_03_01.GrantAccessData" ]
import com.microsoft.azure.management.compute.v2019_03_01.GrantAccessData;
import com.microsoft.azure.management.compute.v2019_03_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
2,102,128
public List<CmsProject> getAllAccessibleProjects( CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean includeSubOus) throws CmsException { Set<CmsProject> projects = new HashSet<CmsProject>(); // get the ous where the user has the project manager role List<...
List<CmsProject> function( CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean includeSubOus) throws CmsException { Set<CmsProject> projects = new HashSet<CmsProject>(); List<CmsOrganizationalUnit> ous = getOrgUnitsForRole( dbc, CmsRole.PROJECT_MANAGER.forOrgUnit(orgUnit.getName()), includeSubOus); Set<CmsUUID> us...
/** * Returns all projects which are owned by the current user or which are * accessible by the current user.<p> * * @param dbc the current database context * @param orgUnit the organizational unit to search project in * @param includeSubOus if to include sub organizational units * ...
Returns all projects which are owned by the current user or which are accessible by the current user
getAllAccessibleProjects
{ "repo_name": "ggiudetti/opencms-core", "path": "src/org/opencms/db/CmsDriverManager.java", "license": "lgpl-2.1", "size": 494693 }
[ "java.util.ArrayList", "java.util.Collections", "java.util.HashSet", "java.util.Iterator", "java.util.List", "java.util.Set", "org.opencms.file.CmsGroup", "org.opencms.file.CmsProject", "org.opencms.main.CmsException", "org.opencms.security.CmsOrganizationalUnit", "org.opencms.security.CmsRole",...
import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import org.opencms.file.CmsGroup; import org.opencms.file.CmsProject; import org.opencms.main.CmsException; import org.opencms.security.CmsOrganizationalUnit; impor...
import java.util.*; import org.opencms.file.*; import org.opencms.main.*; import org.opencms.security.*; import org.opencms.util.*;
[ "java.util", "org.opencms.file", "org.opencms.main", "org.opencms.security", "org.opencms.util" ]
java.util; org.opencms.file; org.opencms.main; org.opencms.security; org.opencms.util;
2,877,360
checkParameters(); resetFileLists(); // scan source directories and dest directory to build up // compile lists String[] list = getSrcdir().list(); for (int i = 0; i < list.length; i++) { File srcDir = getProject().resolveFile(list[i]); if (!srcDir.exists...
checkParameters(); resetFileLists(); String[] list = getSrcdir().list(); for (int i = 0; i < list.length; i++) { File srcDir = getProject().resolveFile(list[i]); if (!srcDir.exists()) { throw new BuildException(STRSTR\STR, getLocation()); } DirectoryScanner ds = this.getDirectoryScanner(srcDir); String[] files = ds.get...
/** * the input files will be in the (protected) filed compileList */
the input files will be in the (protected) filed compileList
getInputFiles
{ "repo_name": "paraita/programming", "path": "programming-build-utils/src/main/java/ant/AptForceCompileTask.java", "license": "agpl-3.0", "size": 2682 }
[ "java.io.File", "org.apache.tools.ant.BuildException", "org.apache.tools.ant.DirectoryScanner" ]
import java.io.File; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DirectoryScanner;
import java.io.*; import org.apache.tools.ant.*;
[ "java.io", "org.apache.tools" ]
java.io; org.apache.tools;
2,319,648
final BrowserContentProviderRegistry converterRegistry = BrowserContentProviderRegistry.getInstance(); if (converterRegistry != null) { converterRegistry.register(new BrowserPlugin()); } }
final BrowserContentProviderRegistry converterRegistry = BrowserContentProviderRegistry.getInstance(); if (converterRegistry != null) { converterRegistry.register(new BrowserPlugin()); } }
/** * Entry point for application * * @param args * Command line args (not used) */
Entry point for application
libMain
{ "repo_name": "blackberry/JDE-Samples", "path": "com/rim/samples/device/browser/browserplugin/LoaderApp.java", "license": "apache-2.0", "size": 1862 }
[ "net.rim.device.api.browser.plugin.BrowserContentProviderRegistry" ]
import net.rim.device.api.browser.plugin.BrowserContentProviderRegistry;
import net.rim.device.api.browser.plugin.*;
[ "net.rim.device" ]
net.rim.device;
1,629,474
public String buildResponseStr(CloseableHttpResponse response) { StringBuilder sb = new StringBuilder(); HeaderIterator hi = response.headerIterator(); while (hi.hasNext()) { Header header = hi.nextHeader(); sb.append(header.getName()).append(": ").append(he...
String function(CloseableHttpResponse response) { StringBuilder sb = new StringBuilder(); HeaderIterator hi = response.headerIterator(); while (hi.hasNext()) { Header header = hi.nextHeader(); sb.append(header.getName()).append(STR).append(header.getValue()).append("\r\n"); } sb.append("\r\n"); try { sb.append(EntityUt...
/** * Render the headers and the response content as a string. * This could include more things such as the status code. * * @param response * @return A string consisting of the HTTP Response headers nicely formatted. */
Render the headers and the response content as a string. This could include more things such as the status code
buildResponseStr
{ "repo_name": "anl-cyberscience/java-taxii", "path": "src/main/java/org/mitre/taxii/client/HttpResponseErrorHandler.java", "license": "bsd-3-clause", "size": 4402 }
[ "java.io.IOException", "org.apache.http.Header", "org.apache.http.HeaderIterator", "org.apache.http.client.methods.CloseableHttpResponse", "org.apache.http.util.EntityUtils" ]
import java.io.IOException; import org.apache.http.Header; import org.apache.http.HeaderIterator; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.util.EntityUtils;
import java.io.*; import org.apache.http.*; import org.apache.http.client.methods.*; import org.apache.http.util.*;
[ "java.io", "org.apache.http" ]
java.io; org.apache.http;
2,716,378
private void setResultIteratorException(IOException ioex) { synchronized (this.iteratorLock) { if (this.iteratorException == null) { this.iteratorException = ioex; this.iteratorLock.notifyAll(); } } } private static final class Ci...
void function(IOException ioex) { synchronized (this.iteratorLock) { if (this.iteratorException == null) { this.iteratorException = ioex; this.iteratorLock.notifyAll(); } } } private static final class CircularElement { final int id; final BinaryInMemorySortBuffer buffer; private CircularElement() { this.id = -1; this....
/** * Reports an exception to all threads that are waiting for the result iterator. * * @param ioex The exception to be reported to the threads that wait for the result iterator. */
Reports an exception to all threads that are waiting for the result iterator
setResultIteratorException
{ "repo_name": "aljoscha/flink", "path": "flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/operators/sort/BinaryExternalSorter.java", "license": "apache-2.0", "size": 46999 }
[ "java.io.IOException", "java.util.concurrent.BlockingQueue", "java.util.concurrent.LinkedBlockingQueue", "org.apache.flink.runtime.operators.sort.ExceptionHandler", "org.apache.flink.table.runtime.io.ChannelWithMeta" ]
import java.io.IOException; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import org.apache.flink.runtime.operators.sort.ExceptionHandler; import org.apache.flink.table.runtime.io.ChannelWithMeta;
import java.io.*; import java.util.concurrent.*; import org.apache.flink.runtime.operators.sort.*; import org.apache.flink.table.runtime.io.*;
[ "java.io", "java.util", "org.apache.flink" ]
java.io; java.util; org.apache.flink;
498,964
public static final String getBriefHelp( ToggleToolbarLargeIconsAction action) { if (!commandBriefHelpInitialized && action != null) { try { commandBriefHelp = ResourceUtils.getMessage(COMMAND_BRIEF_HELP_KEY); } catch (MissingResourceException e) { LOGGER.log(Level.SEVERE, ...
static final String function( ToggleToolbarLargeIconsAction action) { if (!commandBriefHelpInitialized && action != null) { try { commandBriefHelp = ResourceUtils.getMessage(COMMAND_BRIEF_HELP_KEY); } catch (MissingResourceException e) { LOGGER.log(Level.SEVERE, STRSTR\"", e); commandBriefHelp = COMMAND_BRIEF_HELP; } c...
/** * Construct the static command brief help. * * @param action the action reference * * @return the static command brief help. */
Construct the static command brief help
getBriefHelp
{ "repo_name": "madmath03/MidiPlayer", "path": "src/main/java/midiplayer/console/action/ToggleToolbarLargeIconsAction.java", "license": "mit", "size": 8473 }
[ "java.util.MissingResourceException", "java.util.logging.Level" ]
import java.util.MissingResourceException; import java.util.logging.Level;
import java.util.*; import java.util.logging.*;
[ "java.util" ]
java.util;
285,921
Entry[] snapshots = new Entry[5]; SimpleEntry[] sampleEntries = new SimpleEntry[5]; SimpleEntry[] origEntries = new SimpleEntry[5]; SimpleEntry sampleEntry1 = new SimpleEntry("TestEntry #1", 1); SimpleEntry sampleEntry2 = new SimpleEntry("TestEntry #2", 2); SimpleEntry sampleEntr...
Entry[] snapshots = new Entry[5]; SimpleEntry[] sampleEntries = new SimpleEntry[5]; SimpleEntry[] origEntries = new SimpleEntry[5]; SimpleEntry sampleEntry1 = new SimpleEntry(STR, 1); SimpleEntry sampleEntry2 = new SimpleEntry(STR, 2); SimpleEntry sampleEntry3 = new SimpleEntry(STR, 2); SimpleEntry result; int i; sampl...
/** * This method asserts, that: * 1) Modifications to the original entry will not affect the snapshot. * 2) You can snapshot a null template. * * <P>Notes:<BR>For more information see the JavaSpaces specification * section 2.6.</P> */
This method asserts, that: 1) Modifications to the original entry will not affect the snapshot. 2) You can snapshot a null template. Notes:For more information see the JavaSpaces specification section 2.6
run
{ "repo_name": "cdegroot/river", "path": "qa/src/com/sun/jini/test/spec/javaspace/conformance/snapshot/SnapshotModifyEntryTest.java", "license": "apache-2.0", "size": 3985 }
[ "com.sun.jini.qa.harness.TestException", "com.sun.jini.test.spec.javaspace.conformance.SimpleEntry", "net.jini.core.entry.Entry" ]
import com.sun.jini.qa.harness.TestException; import com.sun.jini.test.spec.javaspace.conformance.SimpleEntry; import net.jini.core.entry.Entry;
import com.sun.jini.qa.harness.*; import com.sun.jini.test.spec.javaspace.conformance.*; import net.jini.core.entry.*;
[ "com.sun.jini", "net.jini.core" ]
com.sun.jini; net.jini.core;
1,767,452
public Pager<Diff> getDiff(Object projectIdOrPath, String sha, int itemsPerPage) throws GitLabApiException { if (projectIdOrPath == null) { throw new RuntimeException("projectIdOrPath cannot be null"); } if (sha == null || sha.trim().isEmpty()) { throw new RuntimeEx...
Pager<Diff> function(Object projectIdOrPath, String sha, int itemsPerPage) throws GitLabApiException { if (projectIdOrPath == null) { throw new RuntimeException(STR); } if (sha == null sha.trim().isEmpty()) { throw new RuntimeException(STR); } return (new Pager<Diff>(this, Diff.class, itemsPerPage, null, STR, getProjec...
/** * Get the Pager of diffs of a commit in a project. * * <pre><code>GitLab Endpoint: GET /projects/:id/repository/commits/:sha/diff</code></pre> * * @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance * @param sha a commit hash or name of ...
Get the Pager of diffs of a commit in a project. <code><code>GitLab Endpoint: GET /projects/:id/repository/commits/:sha/diff</code></code>
getDiff
{ "repo_name": "gmessner/gitlab4j-api", "path": "src/main/java/org/gitlab4j/api/CommitsApi.java", "license": "mit", "size": 49798 }
[ "org.gitlab4j.api.models.Diff" ]
import org.gitlab4j.api.models.Diff;
import org.gitlab4j.api.models.*;
[ "org.gitlab4j.api" ]
org.gitlab4j.api;
2,849,113
List<PublicationRecord> getPublicationRecords();
List<PublicationRecord> getPublicationRecords();
/** * Returns the list of the publications records in publications file. If the publications file doesn't contain * publications records then the empty list will be returned. */
Returns the list of the publications records in publications file. If the publications file doesn't contain publications records then the empty list will be returned
getPublicationRecords
{ "repo_name": "GuardTime/ksi-java-sdk", "path": "ksi-api/src/main/java/com/guardtime/ksi/publication/PublicationsFile.java", "license": "apache-2.0", "size": 2889 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,157,837
protected void addTphostPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_DestinationData_tphost_feature"), getString("_UI_PropertyDescriptor_...
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), RfcPackage.Literals.DESTINATION_DATA__TPHOST, true, false, false, ItemPropertyDescriptor.GENERIC_...
/** * This adds a property descriptor for the Tphost feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a property descriptor for the Tphost feature.
addTphostPropertyDescriptor
{ "repo_name": "janstey/fuse-1", "path": "components/camel-sap/org.fusesource.camel.component.sap.model.edit/src/org/fusesource/camel/component/sap/model/rfc/provider/DestinationDataItemProvider.java", "license": "apache-2.0", "size": 44078 }
[ "org.eclipse.emf.edit.provider.ComposeableAdapterFactory", "org.eclipse.emf.edit.provider.ItemPropertyDescriptor", "org.fusesource.camel.component.sap.model.rfc.RfcPackage" ]
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.fusesource.camel.component.sap.model.rfc.RfcPackage;
import org.eclipse.emf.edit.provider.*; import org.fusesource.camel.component.sap.model.rfc.*;
[ "org.eclipse.emf", "org.fusesource.camel" ]
org.eclipse.emf; org.fusesource.camel;
2,764,065
public RestDefinition to(String uri) { // add to last verb if (getVerbs().isEmpty()) { throw new IllegalArgumentException("Must add verb first, such as get/post/delete"); } ToDefinition to = new ToDefinition(uri); VerbDefinition verb = getVerbs().get(getVerbs()....
RestDefinition function(String uri) { if (getVerbs().isEmpty()) { throw new IllegalArgumentException(STR); } ToDefinition to = new ToDefinition(uri); VerbDefinition verb = getVerbs().get(getVerbs().size() - 1); verb.setTo(to); return this; }
/** * Routes directly to the given static endpoint. * <p/> * If you need additional routing capabilities, then use {@link #route()} instead. * * @param uri the uri of the endpoint * @return this builder */
Routes directly to the given static endpoint. If you need additional routing capabilities, then use <code>#route()</code> instead
to
{ "repo_name": "tadayosi/camel", "path": "core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestDefinition.java", "license": "apache-2.0", "size": 35125 }
[ "org.apache.camel.model.ToDefinition" ]
import org.apache.camel.model.ToDefinition;
import org.apache.camel.model.*;
[ "org.apache.camel" ]
org.apache.camel;
459,564
protected final Number getNumberMethodArg(List args, int argIdx) throws TemplateModelException { TemplateModel arg = (TemplateModel) args.get(argIdx); if (!(arg instanceof TemplateNumberModel)) { throw MessageUtil.newMethodArgMustBeNumberException("?" + key, argIdx, arg); ...
final Number function(List args, int argIdx) throws TemplateModelException { TemplateModel arg = (TemplateModel) args.get(argIdx); if (!(arg instanceof TemplateNumberModel)) { throw MessageUtil.newMethodArgMustBeNumberException("?" + key, argIdx, arg); } else { return EvalUtil.modelToNumber((TemplateNumberModel) arg, n...
/** * Gets a method argument and checks if it's a number; it does NOT check if {@code args} is big enough. */
Gets a method argument and checks if it's a number; it does NOT check if args is big enough
getNumberMethodArg
{ "repo_name": "ekollof/DarkUniverse", "path": "lib/Freemarker/source/src/main/java/freemarker/core/BuiltIn.java", "license": "bsd-2-clause", "size": 21778 }
[ "freemarker.template.TemplateModel", "freemarker.template.TemplateModelException", "freemarker.template.TemplateNumberModel", "java.util.List" ]
import freemarker.template.TemplateModel; import freemarker.template.TemplateModelException; import freemarker.template.TemplateNumberModel; import java.util.List;
import freemarker.template.*; import java.util.*;
[ "freemarker.template", "java.util" ]
freemarker.template; java.util;
177,784
public static String createToken(User userDetails) { long expires = System.currentTimeMillis() + 1000L * 60 * 60 * 120; StringBuilder tokenBuilder = new StringBuilder(); tokenBuilder.append(userDetails.getUsername()); tokenBuilder.append(":"); tokenBuilder.append(ex...
static String function(User userDetails) { long expires = System.currentTimeMillis() + 1000L * 60 * 60 * 120; StringBuilder tokenBuilder = new StringBuilder(); tokenBuilder.append(userDetails.getUsername()); tokenBuilder.append(":"); tokenBuilder.append(expires); tokenBuilder.append(":"); tokenBuilder.append(TokenUtils...
/** * Cria o token de acesso * * @param userDetails * @return */
Cria o token de acesso
createToken
{ "repo_name": "julianoezequiel/simple-serve", "path": "ex/src/main/java/com/topdata/toppontoweb/rest/autenticacao/TokenUtils.java", "license": "gpl-3.0", "size": 5593 }
[ "com.topdata.toppontoweb.entity.autenticacao.User" ]
import com.topdata.toppontoweb.entity.autenticacao.User;
import com.topdata.toppontoweb.entity.autenticacao.*;
[ "com.topdata.toppontoweb" ]
com.topdata.toppontoweb;
230,121
private void showEntryFromBookmarks() { // if no data available, leave method if (data.getCount(Daten.ZKNCOUNT) < 1) { return; } // get the entry number from selected bookmark int nr = ZettelkastenViewUtil.retrieveSelectedEntryFromTable(data, jTableBookmarks, 0); ...
void function() { if (data.getCount(Daten.ZKNCOUNT) < 1) { return; } int nr = ZettelkastenViewUtil.retrieveSelectedEntryFromTable(data, jTableBookmarks, 0); if (-1 == nr) { jEditorPaneBookmarkComment.setText(STR"; jEditorPaneBookmarkComment.setText(comment); updateDisplayParts(nr); } }
/** * This methods displays the entry which is selected in the bookmarks-table * (jTableBookmarks). This method is especially called from the * mouse-clicked and key-released events from the jTableBookmarks. */
This methods displays the entry which is selected in the bookmarks-table (jTableBookmarks). This method is especially called from the mouse-clicked and key-released events from the jTableBookmarks
showEntryFromBookmarks
{ "repo_name": "RalfBarkow/Zettelkasten", "path": "src/main/java/de/danielluedecke/zettelkasten/ZettelkastenView.java", "license": "gpl-3.0", "size": 749454 }
[ "de.danielluedecke.zettelkasten.database.Daten", "de.danielluedecke.zettelkasten.util.ZettelkastenViewUtil" ]
import de.danielluedecke.zettelkasten.database.Daten; import de.danielluedecke.zettelkasten.util.ZettelkastenViewUtil;
import de.danielluedecke.zettelkasten.database.*; import de.danielluedecke.zettelkasten.util.*;
[ "de.danielluedecke.zettelkasten" ]
de.danielluedecke.zettelkasten;
2,572,704
private void assertReadVarint(byte[] data, long value) throws Exception { for (InputType inputType : InputType.values()) { // Try different block sizes. for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { CodedInputStream input = inputType.newDecoder(data, blockSize); assertEqua...
void function(byte[] data, long value) throws Exception { for (InputType inputType : InputType.values()) { for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { CodedInputStream input = inputType.newDecoder(data, blockSize); assertEquals(inputType.name(), (int) value, input.readRawVarint32()); assertDataConsumed(i...
/** * Parses the given bytes using readRawVarint32() and readRawVarint64() and checks that the result * matches the given value. */
Parses the given bytes using readRawVarint32() and readRawVarint64() and checks that the result matches the given value
assertReadVarint
{ "repo_name": "scheib/chromium", "path": "third_party/protobuf/java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java", "license": "bsd-3-clause", "size": 47985 }
[ "java.io.ByteArrayInputStream", "java.io.InputStream" ]
import java.io.ByteArrayInputStream; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
821,476
public void restoreDataFromReplications(int nodeId, int parallelTransfers, int zoneId) { ExecutorService executors = Executors.newFixedThreadPool(parallelTransfers, new ThreadFactory() {
void function(int nodeId, int parallelTransfers, int zoneId) { ExecutorService executors = Executors.newFixedThreadPool(parallelTransfers, new ThreadFactory() {
/** * RestoreData from copies on other machines for the given nodeId * <p> * Recovery mechanism to recover and restore data actively from * replicated copies in the cluster.<br> * * @param nodeId Id of the node to restoreData * @param parallelTransfers num...
RestoreData from copies on other machines for the given nodeId Recovery mechanism to recover and restore data actively from replicated copies in the cluster
restoreDataFromReplications
{ "repo_name": "cshaxu/voldemort", "path": "src/java/voldemort/client/protocol/admin/AdminClient.java", "license": "apache-2.0", "size": 234723 }
[ "java.util.concurrent.ExecutorService", "java.util.concurrent.Executors", "java.util.concurrent.ThreadFactory" ]
import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,860,372
public Paint getBackgroundPaint() { return this.backgroundPaint; }
Paint function() { return this.backgroundPaint; }
/** * Returns the background paint. * * @return The background paint (possibly <code>null</code>). */
Returns the background paint
getBackgroundPaint
{ "repo_name": "fluidware/Eastwood-Charts", "path": "source/org/jfree/chart/title/LegendTitle.java", "license": "lgpl-2.1", "size": 22438 }
[ "java.awt.Paint" ]
import java.awt.Paint;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,859,174
public void sendConsultants(final ObjectOutputStream out) { AddConsultantCommand command = null; // Send new consultants command = new AddConsultantCommand(new Consultant( new PersonalName("Jones", "FooBar", "Q."))); sendCommand(out, command); command = ne...
void function(final ObjectOutputStream out) { AddConsultantCommand command = null; command = new AddConsultantCommand(new Consultant( new PersonalName("Jones", STR, "Q."))); sendCommand(out, command); command = new AddConsultantCommand(new Consultant( new PersonalName("Bug", "Don", "D."))); sendCommand(out, command); }
/** * Send some new consultants to the server. * * @param out the output stream connecting this client to the server. */
Send some new consultants to the server
sendConsultants
{ "repo_name": "bkstamm67/java", "path": "old/session2/assignment9/net/client/InvoiceClient.java", "license": "mit", "size": 7476 }
[ "com.scg.domain.Consultant", "com.scg.net.cmd.AddConsultantCommand", "com.scg.util.PersonalName", "java.io.ObjectOutputStream" ]
import com.scg.domain.Consultant; import com.scg.net.cmd.AddConsultantCommand; import com.scg.util.PersonalName; import java.io.ObjectOutputStream;
import com.scg.domain.*; import com.scg.net.cmd.*; import com.scg.util.*; import java.io.*;
[ "com.scg.domain", "com.scg.net", "com.scg.util", "java.io" ]
com.scg.domain; com.scg.net; com.scg.util; java.io;
1,195,449
@Override public void incrementCounter(String counter) { PulseData pulseData; if (fxThread == null || Thread.currentThread() == fxThread) { if (fxData == null) { fxData = allocate(INTER_PULSE_DATA); } pulseData = fxData; } else ...
void function(String counter) { PulseData pulseData; if (fxThread == null Thread.currentThread() == fxThread) { if (fxData == null) { fxData = allocate(INTER_PULSE_DATA); } pulseData = fxData; } else { pulseData = renderData; } if (pulseData == null) { return; } Map<String,Counter> counters = pulseData.counters; Counte...
/** * Increments the given named per-pulse counter. * @param counter The name for the counter. */
Increments the given named per-pulse counter
incrementCounter
{ "repo_name": "lostdj/Jaklin-OpenJFX", "path": "modules/base/src/main/java/com/sun/javafx/logging/PrintLogger.java", "license": "gpl-2.0", "size": 14535 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
493,831
Date getTimeInterval();
Date getTimeInterval();
/** * If specified, defines that "count" breaches in this time interval are * needed to raise a violation. */
If specified, defines that "count" breaches in this time interval are needed to raise a violation
getTimeInterval
{ "repo_name": "modaclouds/modaclouds-sla-core", "path": "sla-repository/src/main/java/eu/atos/sla/datamodel/IPolicy.java", "license": "apache-2.0", "size": 1300 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
642,602
public static java.util.List extractSpecimenWorkListItemList(ims.domain.ILightweightDomainFactory domainFactory, ims.ocrr.vo.SpecimenWorkListItemVoCollection voCollection) { return extractSpecimenWorkListItemList(domainFactory, voCollection, null, new HashMap()); }
static java.util.List function(ims.domain.ILightweightDomainFactory domainFactory, ims.ocrr.vo.SpecimenWorkListItemVoCollection voCollection) { return extractSpecimenWorkListItemList(domainFactory, voCollection, null, new HashMap()); }
/** * Create the ims.ocrr.orderingresults.domain.objects.SpecimenWorkListItem list from the value object collection. * @param domainFactory - used to create existing (persistent) domain objects. * @param voCollection - the collection of value objects */
Create the ims.ocrr.orderingresults.domain.objects.SpecimenWorkListItem list from the value object collection
extractSpecimenWorkListItemList
{ "repo_name": "open-health-hub/openmaxims-linux", "path": "openmaxims_workspace/ValueObjects/src/ims/ocrr/vo/domain/SpecimenWorkListItemVoAssembler.java", "license": "agpl-3.0", "size": 26231 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,601,489
@SuppressWarnings("unchecked") private <T> T executeRequest(OpenWebIfConfig config, String url, Class<T> clazz) throws IOException { HttpURLConnection con = null; try { logger.trace("Request [{}]: {}", config.getName(), url); con = (HttpURLConnection) new URL(url).openConnection(); con.setConnectTimeo...
@SuppressWarnings(STR) <T> T function(OpenWebIfConfig config, String url, Class<T> clazz) throws IOException { HttpURLConnection con = null; try { logger.trace(STR, config.getName(), url); con = (HttpURLConnection) new URL(url).openConnection(); con.setConnectTimeout(CONNECTION_TIMEOUT); con.setReadTimeout(10000); if (...
/** * Executes the http request and parses the returned stream. */
Executes the http request and parses the returned stream
executeRequest
{ "repo_name": "Greblys/openhab", "path": "bundles/action/org.openhab.action.openwebif/src/main/java/org/openhab/action/openwebif/internal/impl/OpenWebIfCommunicator.java", "license": "epl-1.0", "size": 4728 }
[ "java.io.IOException", "java.io.StringReader", "java.io.StringWriter", "java.net.HttpURLConnection", "java.security.GeneralSecurityException", "java.security.SecureRandom", "javax.net.ssl.HttpsURLConnection", "javax.net.ssl.KeyManager", "javax.net.ssl.SSLContext", "javax.net.ssl.TrustManager", "...
import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import java.net.HttpURLConnection; import java.security.GeneralSecurityException; import java.security.SecureRandom; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.KeyManager; import javax.net.ssl.SSLContext; import jav...
import java.io.*; import java.net.*; import java.security.*; import javax.net.ssl.*; import javax.xml.bind.*; import org.apache.commons.io.*; import org.openhab.action.openwebif.internal.impl.config.*; import org.openhab.action.openwebif.internal.impl.ssl.*;
[ "java.io", "java.net", "java.security", "javax.net", "javax.xml", "org.apache.commons", "org.openhab.action" ]
java.io; java.net; java.security; javax.net; javax.xml; org.apache.commons; org.openhab.action;
882,937
public List<SsaInsn> getUseListForRegister(int reg) { if (unmodifiableUseList == null) { buildUseList(); } return unmodifiableUseList[reg]; }
List<SsaInsn> function(int reg) { if (unmodifiableUseList == null) { buildUseList(); } return unmodifiableUseList[reg]; }
/** * Returns the list of all source uses (not results) for a register. * * @param reg register in question * @return unmodifiable instruction list */
Returns the list of all source uses (not results) for a register
getUseListForRegister
{ "repo_name": "alibaba/atlas", "path": "atlas-gradle-plugin/dexpatch/src/main/java/com/taobao/android/dx/ssa/SsaMethod.java", "license": "apache-2.0", "size": 27034 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
155,771
default void open( SerializationSchema.InitializationContext context, KafkaSinkContext sinkContext) throws Exception {} /** * Serializes given element and returns it as a {@link ProducerRecord}. * * @param element element to be serialized * @param context context to ...
default void open( SerializationSchema.InitializationContext context, KafkaSinkContext sinkContext) throws Exception {} /** * Serializes given element and returns it as a {@link ProducerRecord}. * * @param element element to be serialized * @param context context to possibly determine target partition * @param timestam...
/** * Initialization method for the schema. It is called before the actual working methods {@link * #serialize(Object, KafkaSinkContext, Long)} and thus suitable for one time setup work. * * <p>The provided {@link SerializationSchema.InitializationContext} can be used to access * additional fea...
Initialization method for the schema. It is called before the actual working methods <code>#serialize(Object, KafkaSinkContext, Long)</code> and thus suitable for one time setup work. The provided <code>SerializationSchema.InitializationContext</code> can be used to access additional features such as e.g. registering u...
open
{ "repo_name": "apache/flink", "path": "flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/sink/KafkaRecordSerializationSchema.java", "license": "apache-2.0", "size": 3869 }
[ "org.apache.flink.api.common.serialization.SerializationSchema", "org.apache.kafka.clients.producer.ProducerRecord" ]
import org.apache.flink.api.common.serialization.SerializationSchema; import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.flink.api.common.serialization.*; import org.apache.kafka.clients.producer.*;
[ "org.apache.flink", "org.apache.kafka" ]
org.apache.flink; org.apache.kafka;
703,382
private File getExistingFile() { File file = getFile(); if (file != null && !file.exists()) { file = null; } return file; }
File function() { File file = getFile(); if (file != null && !file.exists()) { file = null; } return file; }
/** * Returns the monitored {@code File} or <b>null</b> if it does not exist. * * @return the monitored {@code File} or <b>null</b> */
Returns the monitored File or null if it does not exist
getExistingFile
{ "repo_name": "mohanaraosv/commons-configuration", "path": "src/main/java/org/apache/commons/configuration2/reloading/FileHandlerReloadingDetector.java", "license": "apache-2.0", "size": 9231 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
221,393
public static Optional<ReservedList> get(String listName) { return getFromCache(listName, cache); }
static Optional<ReservedList> function(String listName) { return getFromCache(listName, cache); }
/** * Gets a ReservedList by name using the caching layer. * * @return An Optional&lt;ReservedList&gt; that has a value if a reserved list exists by the given * name, or absent if not. * @throws UncheckedExecutionException if some other error occurs while trying to load the * ReservedList from...
Gets a ReservedList by name using the caching layer
get
{ "repo_name": "google/nomulus", "path": "core/src/main/java/google/registry/model/tld/label/ReservedList.java", "license": "apache-2.0", "size": 13520 }
[ "java.util.Optional" ]
import java.util.Optional;
import java.util.*;
[ "java.util" ]
java.util;
2,891,698
// Sanity check - should have >1 parser if event is fired. int parserCount = getParserCount(); if (parserCount==0) { return; } RSyntaxDocument doc = (RSyntaxDocument)textArea.getDocument(); String style = textArea.getSyntaxEditingStyle(); doc.readLock(); try { for (int i=0; i<parser...
int parserCount = getParserCount(); if (parserCount==0) { return; } RSyntaxDocument doc = (RSyntaxDocument)textArea.getDocument(); String style = textArea.getSyntaxEditingStyle(); doc.readLock(); try { for (int i=0; i<parserCount; i++) { Parser parser = getParser(i); if (parser.isEnabled()) { parser.parse(doc, style); ...
/** * Called when the timer fires (e.g. it's time to parse the document). * * @param e The event. */
Called when the timer fires (e.g. it's time to parse the document)
actionPerformed
{ "repo_name": "freddy-realirm/BPMNEditor-For-Protege-Essential", "path": "src/org/fife/ui/rsyntaxtextarea/ParserManager.java", "license": "gpl-3.0", "size": 6412 }
[ "org.fife.ui.rsyntaxtextarea.parser.Parser" ]
import org.fife.ui.rsyntaxtextarea.parser.Parser;
import org.fife.ui.rsyntaxtextarea.parser.*;
[ "org.fife.ui" ]
org.fife.ui;
168,201
@Override public void exitEveryRule(ParserRuleContext ctx) { }
@Override public void exitEveryRule(ParserRuleContext ctx) { }
/** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */
The default implementation does nothing
enterEveryRule
{ "repo_name": "rebeca-lang/org.rebecalang.compiler", "path": "src/main/java/org/rebecalang/compiler/modelcompiler/hybridrebeca/compiler/HybridRebecaCompleteBaseListener.java", "license": "gpl-2.0", "size": 22052 }
[ "org.antlr.v4.runtime.ParserRuleContext" ]
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.*;
[ "org.antlr.v4" ]
org.antlr.v4;
1,228,234
public final void endElement() throws IOException { if (stack.empty()) { throw new IOException("Called closeTag() too many times"); } String name = stack.pop(); if (open) { w.append('/'); w.append('>'); open = false; ...
final void function() throws IOException { if (stack.empty()) { throw new IOException(STR); } String name = stack.pop(); if (open) { w.append('/'); w.append('>'); open = false; } else { w.append('<'); w.append('/'); w.append(name); w.append('>'); } }
/** * Renders a close tag: " tag/&gt;" * * @param tagName * @throws IOException */
Renders a close tag: " tag/&gt;"
endElement
{ "repo_name": "am0e/commons", "path": "src/main/java/com/github/am0e/utils/XmlWriter.java", "license": "apache-2.0", "size": 9349 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
516,717
public Color getColor() { return mGraphics.getColor(); }
Color function() { return mGraphics.getColor(); }
/** * Gets this graphics context's current color. * @return this graphics context's current color. * @see java.awt.Color * @see java.awt.Graphics#setColor * @since 1.0 */
Gets this graphics context's current color
getColor
{ "repo_name": "md-5/jdk10", "path": "src/java.desktop/share/classes/sun/print/PeekGraphics.java", "license": "gpl-2.0", "size": 71432 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
823,484
private ASTPrimaryExpression findNonVariableStmt(String variableName, ASTPrimaryExpression apeLeft, ASTPrimaryExpression apeRight) { if (matchName(apeLeft, variableName) ) { return apeRight; } else if (matchName(apeRight, variableName) ) { return apeLeft; } return null; }
ASTPrimaryExpression function(String variableName, ASTPrimaryExpression apeLeft, ASTPrimaryExpression apeRight) { if (matchName(apeLeft, variableName) ) { return apeRight; } else if (matchName(apeRight, variableName) ) { return apeLeft; } return null; }
/** * <p>Sort out if apeLeft or apeRight are variable with the provided 'variableName'.</p> * * @param variableName * @param apeLeft * @param apeRight * @return reference from either apeLeft or apeRight, if one of them match, or 'null', if none match. */
Sort out if apeLeft or apeRight are variable with the provided 'variableName'
findNonVariableStmt
{ "repo_name": "StephaneMangin/V-V-TP3", "path": "src/main/java/net/sourceforge/pmd/lang/java/rule/basic/DoubleCheckedLockingRule.java", "license": "bsd-3-clause", "size": 8186 }
[ "net.sourceforge.pmd.lang.java.ast.ASTPrimaryExpression" ]
import net.sourceforge.pmd.lang.java.ast.ASTPrimaryExpression;
import net.sourceforge.pmd.lang.java.ast.*;
[ "net.sourceforge.pmd" ]
net.sourceforge.pmd;
2,393,693
@Override protected MapTuple joinAggregated(final Object key, final List matches, final String keyName, final String matchingValuesName) { if (matches.isEmpty()) { MapTuple<String> allMatchingValues = new MapTuple<>(); allMatchingValues.put(keyName, key); allMatchingV...
MapTuple function(final Object key, final List matches, final String keyName, final String matchingValuesName) { if (matches.isEmpty()) { MapTuple<String> allMatchingValues = new MapTuple<>(); allMatchingValues.put(keyName, key); allMatchingValues.put(matchingValuesName, matches); return allMatchingValues; } else { ret...
/** * Returns a {@code MapTuple} if the key has no matches. If it does, null is returned. * @param key The key * @param matches a list containing the matches * @param keyName the name of the keyed side (LEFT or RIGHT) * @param matchingValuesName the corresponding value side (LEFT or RIGHT) ...
Returns a MapTuple if the key has no matches. If it does, null is returned
joinAggregated
{ "repo_name": "gchq/Gaffer", "path": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/impl/join/methods/OuterJoin.java", "license": "apache-2.0", "size": 2717 }
[ "java.util.List", "uk.gov.gchq.koryphe.tuple.MapTuple" ]
import java.util.List; import uk.gov.gchq.koryphe.tuple.MapTuple;
import java.util.*; import uk.gov.gchq.koryphe.tuple.*;
[ "java.util", "uk.gov.gchq" ]
java.util; uk.gov.gchq;
1,603,030
public ClassLoader extractViewArchive(ViewEntity view, File viewArchive, File archiveDir, List<File> viewsAdditionalClasspath) throws ExtractionException { String archivePath = archiveDir.getAbsolutePath(); try { // Remove directory if jar was updated since last extracting if (archiveDir.e...
ClassLoader function(ViewEntity view, File viewArchive, File archiveDir, List<File> viewsAdditionalClasspath) throws ExtractionException { String archivePath = archiveDir.getAbsolutePath(); try { if (archiveDir.exists() && viewArchive != null && viewArchive.lastModified() > archiveDir.lastModified()) { FileUtils.delete...
/** * Extract the given view archive to the given archive directory. * * @param view the view entity * @param viewArchive the view archive file * @param archiveDir the view archive directory * * @param viewsAdditionalClasspath: list of additional paths to be added to every view's classpa...
Extract the given view archive to the given archive directory
extractViewArchive
{ "repo_name": "sekikn/ambari", "path": "ambari-server/src/main/java/org/apache/ambari/server/view/ViewExtractor.java", "license": "apache-2.0", "size": 9711 }
[ "java.io.File", "java.io.FileOutputStream", "java.util.List", "java.util.jar.JarEntry", "java.util.jar.JarInputStream", "org.apache.ambari.server.orm.entities.ViewEntity", "org.apache.ambari.server.view.configuration.ViewConfig", "org.apache.commons.io.FileUtils" ]
import java.io.File; import java.io.FileOutputStream; import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarInputStream; import org.apache.ambari.server.orm.entities.ViewEntity; import org.apache.ambari.server.view.configuration.ViewConfig; import org.apache.commons.io.FileUtils;
import java.io.*; import java.util.*; import java.util.jar.*; import org.apache.ambari.server.orm.entities.*; import org.apache.ambari.server.view.configuration.*; import org.apache.commons.io.*;
[ "java.io", "java.util", "org.apache.ambari", "org.apache.commons" ]
java.io; java.util; org.apache.ambari; org.apache.commons;
1,773,145
public ByteBuffer encode() { ByteBuffer buf = ByteBuffer.allocate(SIZE); if (id > 0xFFFF) { buf.putInt(id); } else { buf.putShort((short) id); } buf.putShort((short) chunk); ByteBufferUtils.putMedium(buf, nextSector); buf.put((byte) type); buf.put(data); return (ByteBuffer) buf.flip(); }
ByteBuffer function() { ByteBuffer buf = ByteBuffer.allocate(SIZE); if (id > 0xFFFF) { buf.putInt(id); } else { buf.putShort((short) id); } buf.putShort((short) chunk); ByteBufferUtils.putMedium(buf, nextSector); buf.put((byte) type); buf.put(data); return (ByteBuffer) buf.flip(); }
/** * Encodes this sector into a {@link ByteBuffer}. * * @return The encoded buffer. */
Encodes this sector into a <code>ByteBuffer</code>
encode
{ "repo_name": "im-frizzy/OpenRS", "path": "source/net/openrs/cache/Sector.java", "license": "gpl-3.0", "size": 4940 }
[ "java.nio.ByteBuffer", "net.openrs.util.ByteBufferUtils" ]
import java.nio.ByteBuffer; import net.openrs.util.ByteBufferUtils;
import java.nio.*; import net.openrs.util.*;
[ "java.nio", "net.openrs.util" ]
java.nio; net.openrs.util;
1,438,554
public boolean loggedIn() { String userAccount = PreferenceUtils.getString(this, PreferenceUtils.KEY_USER_ACCOUNT); String userId = PreferenceUtils.getString(this, PreferenceUtils.KEY_USER_ID); String authorizationToken = PreferenceUtils.getString(this, PreferenceUtils.KEY_AUTH_TOKEN); ...
boolean function() { String userAccount = PreferenceUtils.getString(this, PreferenceUtils.KEY_USER_ACCOUNT); String userId = PreferenceUtils.getString(this, PreferenceUtils.KEY_USER_ID); String authorizationToken = PreferenceUtils.getString(this, PreferenceUtils.KEY_AUTH_TOKEN); Log.i(TAG, STR + userAccount); Log.i(TAG...
/** * Is the user currently logged in? * NOTE: this doesn't guarantee that all user information has already been fetched from the server, * but it guarantees that the information can be safely fetched. * @return true, if the user has signed in */
Is the user currently logged in? but it guarantees that the information can be safely fetched
loggedIn
{ "repo_name": "Kapoor-uh/lokki-android", "path": "App/src/main/java/cc/softwarefactory/lokki/android/activities/MainActivity.java", "license": "apache-2.0", "size": 25410 }
[ "android.util.Log", "cc.softwarefactory.lokki.android.utilities.PreferenceUtils" ]
import android.util.Log; import cc.softwarefactory.lokki.android.utilities.PreferenceUtils;
import android.util.*; import cc.softwarefactory.lokki.android.utilities.*;
[ "android.util", "cc.softwarefactory.lokki" ]
android.util; cc.softwarefactory.lokki;
960,353
public static DocumentBuilder builder() { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); // ----------------------------------------------------------------- // [#136] FIX START: Prevent OWASP attack vectors try { ...
static DocumentBuilder function() { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { factory.setFeature(STRhttp: } catch (ParserConfigurationException ignore) {} try { factory.setFeature(STR1STRySTRyesSTRtrueSTRonSTRenabledSTR0STRnSTRnoSTRfalseSTRoffSTRdisabled"); }
/** * Get a namespace-aware document builder */
Get a namespace-aware document builder
builder
{ "repo_name": "jOOQ/jOOX", "path": "jOOX/src/main/java/org/joox/JOOX.java", "license": "apache-2.0", "size": 39238 }
[ "javax.xml.parsers.DocumentBuilder", "javax.xml.parsers.DocumentBuilderFactory", "javax.xml.parsers.ParserConfigurationException" ]
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.*;
[ "javax.xml" ]
javax.xml;
1,593,324
@Test public void warnObjectMessage() { logger.warn(42); if (warnEnabled) { verify(provider).log(2, null, Level.WARN, null, null, 42, (Object[]) null); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any()); } }
void function() { logger.warn(42); if (warnEnabled) { verify(provider).log(2, null, Level.WARN, null, null, 42, (Object[]) null); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any()); } }
/** * Verifies that an object as message will be logged correctly at {@link Level#WARN WARN} level. */
Verifies that an object as message will be logged correctly at <code>Level#WARN WARN</code> level
warnObjectMessage
{ "repo_name": "pmwmedia/tinylog", "path": "jboss-tinylog/src/test/java/org/tinylog/jboss/TinylogLoggerTest.java", "license": "apache-2.0", "size": 189291 }
[ "org.mockito.ArgumentMatchers", "org.mockito.Mockito", "org.tinylog.Level" ]
import org.mockito.ArgumentMatchers; import org.mockito.Mockito; import org.tinylog.Level;
import org.mockito.*; import org.tinylog.*;
[ "org.mockito", "org.tinylog" ]
org.mockito; org.tinylog;
1,061,183
public Property<String[]> tags() { return metaBean().tags().createProperty(this); }
Property<String[]> function() { return metaBean().tags().createProperty(this); }
/** * Gets the the {@code tags} property. * @return the property, not null */
Gets the the tags property
tags
{ "repo_name": "BIORIMP/biorimp", "path": "BIO-RIMP/test_data/code/joda/src/test/java/org/joda/beans/gen/SimplePersonWithBuilderFinal.java", "license": "gpl-2.0", "size": 32338 }
[ "org.joda.beans.Property" ]
import org.joda.beans.Property;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
902,883
@Override protected Object initializeSymbol(String name, String value) { Double result; try { result = new Double(value); } catch (Exception e) { result = null; getLogger().log(Level.SEVERE, "Failed to parse the value of symbol '" + name + "': " + value, e); } return resu...
Object function(String name, String value) { Double result; try { result = new Double(value); } catch (Exception e) { result = null; getLogger().log(Level.SEVERE, STR + name + STR + value, e); } return result; }
/** * Initializes the symbol. * * @param name the name of the symbol * @param value the string representation of the symbol * @return the object representation of the symbol */
Initializes the symbol
initializeSymbol
{ "repo_name": "waikato-datamining/adams-base", "path": "adams-core/src/main/java/adams/parser/SpreadSheetFormula.java", "license": "gpl-3.0", "size": 20540 }
[ "java.util.logging.Level" ]
import java.util.logging.Level;
import java.util.logging.*;
[ "java.util" ]
java.util;
1,306,227
Map<String, String> getUserRolesForGroup(String id);
Map<String, String> getUserRolesForGroup(String id);
/** * Access the user id - role name map for all users in the external group. * * @param id The external group id. This will need to be unpacked if the provider supports packing. * This may be <code>null</code> if the context doesn't have a provider ID set.. * @return the user id - role name map for all use...
Access the user id - role name map for all users in the external group
getUserRolesForGroup
{ "repo_name": "bzhouduke123/sakai", "path": "kernel/api/src/main/java/org/sakaiproject/authz/api/GroupProvider.java", "license": "apache-2.0", "size": 3540 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,949,114
public void enterCommon_value_expression(SQLParser.Common_value_expressionContext ctx) { }
public void enterCommon_value_expression(SQLParser.Common_value_expressionContext ctx) { }
/** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */
The default implementation does nothing
exitValue_expression
{ "repo_name": "HEIG-GAPS/slasher", "path": "slasher.corrector/src/main/java/ch/gaps/slasher/corrector/SQLParserBaseListener.java", "license": "mit", "size": 73849 }
[ "ch.gaps.slasher.corrector.SQLParser" ]
import ch.gaps.slasher.corrector.SQLParser;
import ch.gaps.slasher.corrector.*;
[ "ch.gaps.slasher" ]
ch.gaps.slasher;
761,154
@Override public String getServerIP(final int type, final String name) throws RemoteException { if (LOG.isDebugEnabled()) { LOG.debug("getServerIp called :: servertype = " + type + " :: servername = " + name); // NOI18N } try { return sm.getServerIP(type, name); ...
String function(final int type, final String name) throws RemoteException { if (LOG.isDebugEnabled()) { LOG.debug(STR + type + STR + name); } try { return sm.getServerIP(type, name); } catch (final Exception e) { final String message = STR + type + STR + name; LOG.error(message, e); throw new RemoteException(message, e...
/** * DOCUMENT ME! * * @param type DOCUMENT ME! * @param name DOCUMENT ME! * * @return DOCUMENT ME! * * @throws RemoteException DOCUMENT ME! */
DOCUMENT ME
getServerIP
{ "repo_name": "cismet/cids-server", "path": "src/main/java/Sirius/server/registry/Registry.java", "license": "lgpl-3.0", "size": 39621 }
[ "java.rmi.RemoteException" ]
import java.rmi.RemoteException;
import java.rmi.*;
[ "java.rmi" ]
java.rmi;
2,356,820
DownloadServiceDelegate getServiceDelegate(ContentId id) { if (LegacyHelpers.isLegacyOfflinePage(id)) { return OfflinePageDownloadBridge.getDownloadServiceDelegate(); } if (LegacyHelpers.isLegacyDownload(id)) { return DownloadManagerService.getDownloadManagerService()...
DownloadServiceDelegate getServiceDelegate(ContentId id) { if (LegacyHelpers.isLegacyOfflinePage(id)) { return OfflinePageDownloadBridge.getDownloadServiceDelegate(); } if (LegacyHelpers.isLegacyDownload(id)) { return DownloadManagerService.getDownloadManagerService(); } return OfflineContentAggregatorNotificationBridg...
/** * Gets appropriate download delegate that can handle interactions with download item referred * to by the entry. * @param id The {@link ContentId} to grab the delegate for. * @return delegate for interactions with the entry */
Gets appropriate download delegate that can handle interactions with download item referred to by the entry
getServiceDelegate
{ "repo_name": "mogoweb/365browser", "path": "app/src/main/java/org/chromium/chrome/browser/download/DownloadNotificationService.java", "license": "apache-2.0", "size": 71741 }
[ "org.chromium.chrome.browser.download.items.OfflineContentAggregatorNotificationBridgeUiFactory", "org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadBridge", "org.chromium.components.offline_items_collection.ContentId", "org.chromium.components.offline_items_collection.LegacyHelpers" ]
import org.chromium.chrome.browser.download.items.OfflineContentAggregatorNotificationBridgeUiFactory; import org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadBridge; import org.chromium.components.offline_items_collection.ContentId; import org.chromium.components.offline_items_collection.LegacyHel...
import org.chromium.chrome.browser.download.items.*; import org.chromium.chrome.browser.offlinepages.downloads.*; import org.chromium.components.offline_items_collection.*;
[ "org.chromium.chrome", "org.chromium.components" ]
org.chromium.chrome; org.chromium.components;
1,094,250
@SuppressWarnings("unused") final void handleQueryParameters(ByteBuffer buffer, ParseState state, HttpServerExchange exchange) { StringBuilder stringBuilder = state.stringBuilder; int queryParamPos = state.pos; int mapCount = state.mapCount; boolean urlDecodeRequired = state.urlD...
@SuppressWarnings(STR) final void handleQueryParameters(ByteBuffer buffer, ParseState state, HttpServerExchange exchange) { StringBuilder stringBuilder = state.stringBuilder; int queryParamPos = state.pos; int mapCount = state.mapCount; boolean urlDecodeRequired = state.urlDecodeRequired; String nextQueryParam = state....
/** * Parses a path value * * @param buffer The buffer * @param state The current state * @param exchange The exchange builder * @return The number of bytes remaining */
Parses a path value
handleQueryParameters
{ "repo_name": "jasonchaffee/undertow", "path": "core/src/main/java/io/undertow/server/protocol/http/HttpRequestParser.java", "license": "apache-2.0", "size": 36886 }
[ "io.undertow.UndertowMessages", "io.undertow.server.HttpServerExchange", "java.nio.ByteBuffer" ]
import io.undertow.UndertowMessages; import io.undertow.server.HttpServerExchange; import java.nio.ByteBuffer;
import io.undertow.*; import io.undertow.server.*; import java.nio.*;
[ "io.undertow", "io.undertow.server", "java.nio" ]
io.undertow; io.undertow.server; java.nio;
2,816,062
public Map toMap() { Map map = new HashMap(); map.put("storageUnit",StringUtils.toString(storageUnit, eiMetadata.getMeta("storageUnit").getFieldLength(), eiMetadata.getMeta("storageUnit").getScaleLength())); map.put("productId",StringUtils.toString(productId, eiMetadata.getMeta("productId").getFieldL...
Map function() { Map map = new HashMap(); map.put(STR,StringUtils.toString(storageUnit, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(productId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,Stri...
/** * set the value to Map */
set the value to Map
toMap
{ "repo_name": "stserp/erp1", "path": "source/src/com/baosight/sts/st/wl/domain/STWL1801.java", "license": "apache-2.0", "size": 55865 }
[ "com.baosight.iplat4j.util.StringUtils", "java.util.HashMap", "java.util.Map" ]
import com.baosight.iplat4j.util.StringUtils; import java.util.HashMap; import java.util.Map;
import com.baosight.iplat4j.util.*; import java.util.*;
[ "com.baosight.iplat4j", "java.util" ]
com.baosight.iplat4j; java.util;
276,243
javax.xml.namespace.QName getServiceName();
javax.xml.namespace.QName getServiceName();
/** * Returns the service name of this endpoint. * * @return the qualified service name. */
Returns the service name of this endpoint
getServiceName
{ "repo_name": "apache/servicemix4-specs", "path": "jbi-api-1.0/src/main/java/javax/jbi/servicedesc/ServiceEndpoint.java", "license": "apache-2.0", "size": 2318 }
[ "javax.xml.namespace.QName" ]
import javax.xml.namespace.QName;
import javax.xml.namespace.*;
[ "javax.xml" ]
javax.xml;
1,375,973
@Test public void testClearAndSize() { assertEquals("Check size 1", 3, set.size()); set.clear(); assertEquals("Check size 2", 0, set.size()); }
void function() { assertEquals(STR, 3, set.size()); set.clear(); assertEquals(STR, 0, set.size()); }
/** * Test the clear() and size() methods. */
Test the clear() and size() methods
testClearAndSize
{ "repo_name": "tzaeschke/zoodb", "path": "tst/org/zoodb/test/util/PrimLongSetTest.java", "license": "gpl-3.0", "size": 5274 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
596,678
private String getMessageTypeSelector(String messageType, String messageVersion) { // TYPE = 'TYPE_VALUE' AND VERSION = 'VERSION_VALUE' return TransferMessage.HEADER_MESSAGE_TYPE + " = " + "'" + messageType + "' AND " + TransferMessage.HEADER_MESSAGE_VERSION + " = '" ...
String function(String messageType, String messageVersion) { return TransferMessage.HEADER_MESSAGE_TYPE + STR + "'" + messageType + STR + TransferMessage.HEADER_MESSAGE_VERSION + STR + messageVersion + "'"; }
/** * creates message selector. It is used by the JMS message consumer, to receive only relevant * messages * * @param messageType * type of the message * @param messageVersion * version of the message * @return selector expression */
creates message selector. It is used by the JMS message consumer, to receive only relevant messages
getMessageTypeSelector
{ "repo_name": "Communote/communote-server", "path": "communote/plugins/communote-message-queue/communote-plugins-mq-adapter-jms/src/main/java/com/communote/plugins/mq/provider/jms/ConsumerFactory.java", "license": "apache-2.0", "size": 6502 }
[ "com.communote.plugins.mq.service.provider.TransferMessage" ]
import com.communote.plugins.mq.service.provider.TransferMessage;
import com.communote.plugins.mq.service.provider.*;
[ "com.communote.plugins" ]
com.communote.plugins;
188,994
@Deprecated public DTMAxisIterator cloneIterator() { KeyIndex other = new KeyIndex(0); other._index = _index; other._rootToIndexMap = _rootToIndexMap; other._nodes = _nodes; other._position = _position; return (DTMAxisIterator) other; }
DTMAxisIterator function() { KeyIndex other = new KeyIndex(0); other._index = _index; other._rootToIndexMap = _rootToIndexMap; other._nodes = _nodes; other._position = _position; return (DTMAxisIterator) other; }
/** * <p>Returns a deep copy of this iterator.</p> * <p><em>Use of an instance of this class as a {@link DTMAxisIterator} is * <b>deprecated.</b></em></p> * @deprecated */
Returns a deep copy of this iterator. Use of an instance of this class as a <code>DTMAxisIterator</code> is deprecated
cloneIterator
{ "repo_name": "md-5/jdk10", "path": "src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java", "license": "gpl-2.0", "size": 32219 }
[ "com.sun.org.apache.xml.internal.dtm.DTMAxisIterator" ]
import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
import com.sun.org.apache.xml.internal.dtm.*;
[ "com.sun.org" ]
com.sun.org;
222,509
public Set<String> getMandatoryAnyofs() { return this.mandatoryAnyofs; }
Set<String> function() { return this.mandatoryAnyofs; }
/** * Returns the set of mandatoryAnyofs. * @return returns the set of mandatoryAnyofs. */
Returns the set of mandatoryAnyofs
getMandatoryAnyofs
{ "repo_name": "tlong2/amphtml", "path": "validator/java/src/main/java/dev/amp/validator/ParsedTagSpec.java", "license": "apache-2.0", "size": 15488 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
677,141
public void processingInstruction(String target, String data) throws SAXException { if (extractLevel == 0) { super.processingInstruction(target,data); } else { this.currentBuilder.processingInstruction(target,data); } }
void function(String target, String data) throws SAXException { if (extractLevel == 0) { super.processingInstruction(target,data); } else { this.currentBuilder.processingInstruction(target,data); } }
/** * Receive notification of a processing instruction. * * @param target The processing instruction target. * @param data The processing instruction data, or null if none was * supplied. */
Receive notification of a processing instruction
processingInstruction
{ "repo_name": "apache/cocoon", "path": "core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/transformation/AbstractExtractionTransformer.java", "license": "apache-2.0", "size": 15696 }
[ "org.xml.sax.SAXException" ]
import org.xml.sax.SAXException;
import org.xml.sax.*;
[ "org.xml.sax" ]
org.xml.sax;
52,360
return new Date(); }
return new Date(); }
/** * As an instant job, return 'now' to tell manager start right now. */
As an instant job, return 'now' to tell manager start right now
getStartTime
{ "repo_name": "liyang-bsy/LYLab", "path": "src/main/java/net/vicp/lylab/utils/timer/InitializeJob.java", "license": "lgpl-3.0", "size": 644 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,736,080
private static Map<Integer, Integer> getAllReachablesOf(Element busStop) { Map<Integer, Integer> reachables = new HashMap<>(); NodeList connections = busStop.getElementsByTagName("connection"); // iterate through the list and fill the map for (int i = 0; i < connections.getLength();...
static Map<Integer, Integer> function(Element busStop) { Map<Integer, Integer> reachables = new HashMap<>(); NodeList connections = busStop.getElementsByTagName(STR); for (int i = 0; i < connections.getLength(); i++) { Element connection = (Element)connections.item(i); int refId = getNumericContentOfTag(connection, "re...
/** * Collects and returns all the reachable-data from the given bus stop element. * @param busStop the bus stop element whose reachable-data shell be read and returned * @return an (id - travel time) structured {@link Map} containing the id -s of the reachable stops * from the given stop along with...
Collects and returns all the reachable-data from the given bus stop element
getAllReachablesOf
{ "repo_name": "joey11111000111/EasyPlan", "path": "src/main/java/com/github/joey11111000111/EasyPlan/dao/CityReader.java", "license": "gpl-3.0", "size": 5324 }
[ "java.util.HashMap", "java.util.Map", "org.w3c.dom.Element", "org.w3c.dom.NodeList" ]
import java.util.HashMap; import java.util.Map; import org.w3c.dom.Element; import org.w3c.dom.NodeList;
import java.util.*; import org.w3c.dom.*;
[ "java.util", "org.w3c.dom" ]
java.util; org.w3c.dom;
527,692
public void testVerifyShardBeforeIndexClosingIsNoOp() throws IOException { IOUtils.close(engine, store); final AtomicLong globalCheckpoint = new AtomicLong(SequenceNumbers.NO_OPS_PERFORMED); try (Store store = createStore()) { EngineConfig config = config(defaultSettings, store, ...
void function() throws IOException { IOUtils.close(engine, store); final AtomicLong globalCheckpoint = new AtomicLong(SequenceNumbers.NO_OPS_PERFORMED); try (Store store = createStore()) { EngineConfig config = config(defaultSettings, store, createTempDir(), newMergePolicy(), null, null, globalCheckpoint::get); store.c...
/** * Test that {@link ReadOnlyEngine#verifyEngineBeforeIndexClosing()} never fails * whatever the value of the global checkpoint to check is. */
Test that <code>ReadOnlyEngine#verifyEngineBeforeIndexClosing()</code> never fails whatever the value of the global checkpoint to check is
testVerifyShardBeforeIndexClosingIsNoOp
{ "repo_name": "gingerwizard/elasticsearch", "path": "server/src/test/java/org/elasticsearch/index/engine/ReadOnlyEngineTests.java", "license": "apache-2.0", "size": 15249 }
[ "java.io.IOException", "java.util.concurrent.atomic.AtomicLong", "java.util.function.Function", "org.elasticsearch.Version", "org.elasticsearch.core.internal.io.IOUtils", "org.elasticsearch.index.seqno.SequenceNumbers", "org.elasticsearch.index.store.Store", "org.elasticsearch.index.translog.TranslogS...
import java.io.IOException; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Function; import org.elasticsearch.Version; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.index.store.Store; import org.elasticsearch.i...
import java.io.*; import java.util.concurrent.atomic.*; import java.util.function.*; import org.elasticsearch.*; import org.elasticsearch.core.internal.io.*; import org.elasticsearch.index.seqno.*; import org.elasticsearch.index.store.*; import org.elasticsearch.index.translog.*;
[ "java.io", "java.util", "org.elasticsearch", "org.elasticsearch.core", "org.elasticsearch.index" ]
java.io; java.util; org.elasticsearch; org.elasticsearch.core; org.elasticsearch.index;
203,213