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
|
|---|---|---|---|---|---|---|---|---|---|---|---|
private static Mediation addApiSpecificMediationPolicyFromFile(String localName, String content, String fileName,
String type, APIProvider apiProvider, String apiId, String organization) throws APIManagementException {
if (APIConstants.MEDIATION_SEQUENCE_ELEM.equals(localName)) {
Mediation mediationPolicy = new Mediation();
mediationPolicy.setConfig(content);
mediationPolicy.setName(fileName);
mediationPolicy.setType(type);
// Adding API specific mediation policy
return apiProvider.addApiSpecificMediationPolicy(apiId, mediationPolicy, organization);
} else {
throw new APIManagementException("Sequence is malformed");
}
}
|
static Mediation function(String localName, String content, String fileName, String type, APIProvider apiProvider, String apiId, String organization) throws APIManagementException { if (APIConstants.MEDIATION_SEQUENCE_ELEM.equals(localName)) { Mediation mediationPolicy = new Mediation(); mediationPolicy.setConfig(content); mediationPolicy.setName(fileName); mediationPolicy.setType(type); return apiProvider.addApiSpecificMediationPolicy(apiId, mediationPolicy, organization); } else { throw new APIManagementException(STR); } }
|
/**
* Add API specific mediation sequences from file content.
*
* @param localName Local name of the mediation policy to be added
* @param content File content of the mediation policy to be added
* @param fileName File name of the mediation policy to be added
* @param type Type (in/out/fault) of the mediation policy to be added
* @param apiProvider API Provider
* @param apiId API ID of the mediation policy
* @param organization Organization of the API
* @return
* @throws APIManagementException If the sequence is malformed.
*/
|
Add API specific mediation sequences from file content
|
addApiSpecificMediationPolicyFromFile
|
{
"repo_name": "chamilaadhi/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/PublisherCommonUtils.java",
"license": "apache-2.0",
"size": 98550
}
|
[
"org.wso2.carbon.apimgt.api.APIManagementException",
"org.wso2.carbon.apimgt.api.APIProvider",
"org.wso2.carbon.apimgt.api.model.Mediation",
"org.wso2.carbon.apimgt.impl.APIConstants"
] |
import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.APIProvider; import org.wso2.carbon.apimgt.api.model.Mediation; import org.wso2.carbon.apimgt.impl.APIConstants;
|
import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.impl.*;
|
[
"org.wso2.carbon"
] |
org.wso2.carbon;
| 1,870,706
|
@Override
public synchronized String toString() {
StringBuilder sb = new StringBuilder();
sb.append(watch2Paths.size()).append(" connections watching ")
.append(watchTable.size()).append(" paths\n");
int total = 0;
for (HashSet<String> paths : watch2Paths.values()) {
total += paths.size();
}
sb.append("Total watches:").append(total);
return sb.toString();
}
|
synchronized String function() { StringBuilder sb = new StringBuilder(); sb.append(watch2Paths.size()).append(STR) .append(watchTable.size()).append(STR); int total = 0; for (HashSet<String> paths : watch2Paths.values()) { total += paths.size(); } sb.append(STR).append(total); return sb.toString(); }
|
/**
* Brief description of this object.
*/
|
Brief description of this object
|
toString
|
{
"repo_name": "sdw2330976/zookeeper-3.3.4-source",
"path": "zookeeper-release-3.4.3/src/java/main/org/apache/zookeeper/server/WatchManager.java",
"license": "apache-2.0",
"size": 6914
}
|
[
"java.util.HashSet"
] |
import java.util.HashSet;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 202,631
|
boolean canAttack(QueenBlackDragon npc, Player victim);
|
boolean canAttack(QueenBlackDragon npc, Player victim);
|
/**
* Checks if the QBD can use this attack.
* @param npc The QBD.
* @param victim The player.
* @return {@code True} if so.
*/
|
Checks if the QBD can use this attack
|
canAttack
|
{
"repo_name": "calvinlotsberg/OurScape",
"path": "src/com/rs/game/npc/qbd/QueenAttack.java",
"license": "apache-2.0",
"size": 552
}
|
[
"com.rs.game.player.Player"
] |
import com.rs.game.player.Player;
|
import com.rs.game.player.*;
|
[
"com.rs.game"
] |
com.rs.game;
| 452,989
|
EReference getPVPH_VHzSt();
|
EReference getPVPH_VHzSt();
|
/**
* Returns the meta object for the reference '{@link gluemodel.substationStandard.LNNodes.LNGroupP.PVPH#getVHzSt <em>VHz St</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>VHz St</em>'.
* @see gluemodel.substationStandard.LNNodes.LNGroupP.PVPH#getVHzSt()
* @see #getPVPH()
* @generated
*/
|
Returns the meta object for the reference '<code>gluemodel.substationStandard.LNNodes.LNGroupP.PVPH#getVHzSt VHz St</code>'.
|
getPVPH_VHzSt
|
{
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/eMoflon/rgse.ttc17.metamodels.src/src/gluemodel/substationStandard/LNNodes/LNGroupP/LNGroupPPackage.java",
"license": "mit",
"size": 291175
}
|
[
"org.eclipse.emf.ecore.EReference"
] |
import org.eclipse.emf.ecore.EReference;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 555,239
|
protected CmsPublishManager getPublishManager() {
return m_publishManager;
}
|
CmsPublishManager function() { return m_publishManager; }
|
/**
* Returns the publish manager instance.<p>
*
* @return the publish manager instance
*/
|
Returns the publish manager instance
|
getPublishManager
|
{
"repo_name": "mediaworx/opencms-core",
"path": "src/org/opencms/main/OpenCmsCore.java",
"license": "lgpl-2.1",
"size": 110979
}
|
[
"org.opencms.publish.CmsPublishManager"
] |
import org.opencms.publish.CmsPublishManager;
|
import org.opencms.publish.*;
|
[
"org.opencms.publish"
] |
org.opencms.publish;
| 1,460,624
|
public Observable<ServiceResponse<Page<OperationInner>>> listSinglePageAsync() {
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
|
Observable<ServiceResponse<Page<OperationInner>>> function() { if (this.client.apiVersion() == null) { throw new IllegalArgumentException(STR); }
|
/**
* Lists all of the available Microsoft.Resources REST API operations.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful.
*/
|
Lists all of the available Microsoft.Resources REST API operations
|
listSinglePageAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resources/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/resources/v2020_06_01/implementation/OperationsInner.java",
"license": "mit",
"size": 13993
}
|
[
"com.microsoft.azure.Page",
"com.microsoft.rest.ServiceResponse"
] |
import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse;
|
import com.microsoft.azure.*; import com.microsoft.rest.*;
|
[
"com.microsoft.azure",
"com.microsoft.rest"
] |
com.microsoft.azure; com.microsoft.rest;
| 2,436,535
|
private static Properties getORBPropertiesFile () {
return (Properties) AccessController.doPrivileged(new GetORBPropertiesFileAction());
}
}
class GetORBPropertiesFileAction implements PrivilegedAction {
private boolean debug = false ;
public GetORBPropertiesFileAction () {
}
|
static Properties function () { return (Properties) AccessController.doPrivileged(new GetORBPropertiesFileAction()); } } class GetORBPropertiesFileAction implements PrivilegedAction { private boolean debug = false ; public GetORBPropertiesFileAction () { }
|
/**
* Load the orb.properties file.
*/
|
Load the orb.properties file
|
getORBPropertiesFile
|
{
"repo_name": "rokn/Count_Words_2015",
"path": "testing/openjdk2/corba/src/share/classes/javax/rmi/PortableRemoteObject.java",
"license": "mit",
"size": 10408
}
|
[
"java.security.AccessController",
"java.security.PrivilegedAction",
"java.util.Properties"
] |
import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Properties;
|
import java.security.*; import java.util.*;
|
[
"java.security",
"java.util"
] |
java.security; java.util;
| 1,891,593
|
public void setCredentials(String tenant, String username, String userpassword) {
Credentials credentials = new Credentials(tenant, username, userpassword);
restClient.setCredentials(credentials);
}
|
void function(String tenant, String username, String userpassword) { Credentials credentials = new Credentials(tenant, username, userpassword); restClient.setCredentials(credentials); }
|
/**
* Set credentials such as tenant, username, password for use with a Doradus application.
* @param tenant tenant name
* @param username user name use when accessing applications within the specified tenant.
* @param userpassword user password
*/
|
Set credentials such as tenant, username, password for use with a Doradus application
|
setCredentials
|
{
"repo_name": "dell-oss/Doradus",
"path": "doradus-client/src/main/java/com/dell/doradus/dory/DoradusClient.java",
"license": "apache-2.0",
"size": 9470
}
|
[
"com.dell.doradus.client.Credentials"
] |
import com.dell.doradus.client.Credentials;
|
import com.dell.doradus.client.*;
|
[
"com.dell.doradus"
] |
com.dell.doradus;
| 232,871
|
public ArrayList<String> getScanPath() {
return scanPath;
}
|
ArrayList<String> function() { return scanPath; }
|
/**
* Returns the files and/or directory[s] to scan.
*/
|
Returns the files and/or directory[s] to scan
|
getScanPath
|
{
"repo_name": "pombredanne/dependency-check-plugin",
"path": "src/main/java/org/jenkinsci/plugins/DependencyCheck/Options.java",
"license": "apache-2.0",
"size": 26505
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 373,715
|
@Override
public Value evalAssignRef(Env env, Value value)
{
// php/03mk
Value array = _expr.evalArray(env);
return array.put(_index.eval(env), value);
}
|
Value function(Env env, Value value) { Value array = _expr.evalArray(env); return array.put(_index.eval(env), value); }
|
/**
* Evaluates the expression.
*
* @param env the calling environment.
*
* @return the expression value.
*/
|
Evaluates the expression
|
evalAssignRef
|
{
"repo_name": "dwango/quercus",
"path": "src/main/java/com/caucho/quercus/expr/ArrayGetExpr.java",
"license": "gpl-2.0",
"size": 5251
}
|
[
"com.caucho.quercus.env.Env",
"com.caucho.quercus.env.Value"
] |
import com.caucho.quercus.env.Env; import com.caucho.quercus.env.Value;
|
import com.caucho.quercus.env.*;
|
[
"com.caucho.quercus"
] |
com.caucho.quercus;
| 2,594,769
|
void commandSent(GcodeCommand command);
|
void commandSent(GcodeCommand command);
|
/**
* A command has successfully been sent to the controller.
*/
|
A command has successfully been sent to the controller
|
commandSent
|
{
"repo_name": "winder/Universal-G-Code-Sender",
"path": "ugs-core/src/com/willwinder/universalgcodesender/listeners/ControllerListener.java",
"license": "gpl-3.0",
"size": 2167
}
|
[
"com.willwinder.universalgcodesender.types.GcodeCommand"
] |
import com.willwinder.universalgcodesender.types.GcodeCommand;
|
import com.willwinder.universalgcodesender.types.*;
|
[
"com.willwinder.universalgcodesender"
] |
com.willwinder.universalgcodesender;
| 1,184,106
|
public Xml xml_parser_create(Env env,
@Optional("'UTF-8'") String outputEncoding)
{
if (outputEncoding == null)
outputEncoding = "UTF-8";
return new Xml(env, outputEncoding, null);
}
|
Xml function(Env env, @Optional(STR) String outputEncoding) { if (outputEncoding == null) outputEncoding = "UTF-8"; return new Xml(env, outputEncoding, null); }
|
/**
* returns a new Xml Parser
*/
|
returns a new Xml Parser
|
xml_parser_create
|
{
"repo_name": "dlitz/resin",
"path": "modules/quercus/src/com/caucho/quercus/lib/xml/XmlModule.java",
"license": "gpl-2.0",
"size": 14235
}
|
[
"com.caucho.quercus.annotation.Optional",
"com.caucho.quercus.env.Env"
] |
import com.caucho.quercus.annotation.Optional; import com.caucho.quercus.env.Env;
|
import com.caucho.quercus.annotation.*; import com.caucho.quercus.env.*;
|
[
"com.caucho.quercus"
] |
com.caucho.quercus;
| 950,884
|
public ECheck retrieve(String eCheckId) throws BaseException {
logger.debug("Enter ECheckService::retrieve");
if (StringUtils.isBlank(eCheckId)) {
logger.error("IllegalArgumentException {}", eCheckId);
throw new IllegalArgumentException("eCheckId cannot be empty or null");
}
// prepare API url
String apiUrl = requestContext.getBaseUrl() + "echecks/{id}".replaceAll("\\{format\\}", "json")
.replaceAll("\\{" + "id" + "\\}", eCheckId.toString());
logger.info("apiUrl - " + apiUrl);
// assign TypeReference for deserialization
TypeReference<ECheck> typeReference = new TypeReference<ECheck>() {
};
// prepare service request
Request request = new Request.RequestBuilder(MethodType.GET, apiUrl).typeReference(typeReference)
.context(requestContext).build();
// make API call
Response response = sendRequest(request);
// retrieve response
ECheck eCheckResponse = (ECheck) response.getResponseObject();
// set additional attributes
prepareResponse(request, response, eCheckResponse);
return eCheckResponse;
}
|
ECheck function(String eCheckId) throws BaseException { logger.debug(STR); if (StringUtils.isBlank(eCheckId)) { logger.error(STR, eCheckId); throw new IllegalArgumentException(STR); } String apiUrl = requestContext.getBaseUrl() + STR.replaceAll(STR, "json") .replaceAll("\\{" + "id" + "\\}", eCheckId.toString()); logger.info(STR + apiUrl); TypeReference<ECheck> typeReference = new TypeReference<ECheck>() { }; Request request = new Request.RequestBuilder(MethodType.GET, apiUrl).typeReference(typeReference) .context(requestContext).build(); Response response = sendRequest(request); ECheck eCheckResponse = (ECheck) response.getResponseObject(); prepareResponse(request, response, eCheckResponse); return eCheckResponse; }
|
/**
* Method to retrieve ECheck
*
* @param eCheckId
* @return
* @throws BaseException
*/
|
Method to retrieve ECheck
|
retrieve
|
{
"repo_name": "intuit/QuickBooks-V3-Java-SDK",
"path": "payments-api/src/main/java/com/intuit/payment/services/ECheckService.java",
"license": "apache-2.0",
"size": 6727
}
|
[
"com.fasterxml.jackson.core.type.TypeReference",
"com.intuit.payment.data.ECheck",
"com.intuit.payment.exception.BaseException",
"com.intuit.payment.http.MethodType",
"com.intuit.payment.http.Request",
"com.intuit.payment.http.Response",
"org.apache.commons.lang.StringUtils"
] |
import com.fasterxml.jackson.core.type.TypeReference; import com.intuit.payment.data.ECheck; import com.intuit.payment.exception.BaseException; import com.intuit.payment.http.MethodType; import com.intuit.payment.http.Request; import com.intuit.payment.http.Response; import org.apache.commons.lang.StringUtils;
|
import com.fasterxml.jackson.core.type.*; import com.intuit.payment.data.*; import com.intuit.payment.exception.*; import com.intuit.payment.http.*; import org.apache.commons.lang.*;
|
[
"com.fasterxml.jackson",
"com.intuit.payment",
"org.apache.commons"
] |
com.fasterxml.jackson; com.intuit.payment; org.apache.commons;
| 787,050
|
private void validateCredentials() throws InvalidCredentialsException {
ConnectionCredentials creds = connection.getCredentials();
if (creds == null || (creds.getIdentity() == null || creds.getCredential() == null || creds.getApiKey() == null)) {
throw new InvalidCredentialsException("Connection credentials require a username, password and API key.");
}
}
|
void function() throws InvalidCredentialsException { ConnectionCredentials creds = connection.getCredentials(); if (creds == null (creds.getIdentity() == null creds.getCredential() == null creds.getApiKey() == null)) { throw new InvalidCredentialsException(STR); } }
|
/**
* Pingdom requires both username/password and an API key.
*
* @throws InvalidCredentialsException
*/
|
Pingdom requires both username/password and an API key
|
validateCredentials
|
{
"repo_name": "StreamReduce/streamreduce-core",
"path": "core/src/main/java/com/streamreduce/util/PingdomClient.java",
"license": "apache-2.0",
"size": 5568
}
|
[
"com.streamreduce.core.model.ConnectionCredentials",
"com.streamreduce.core.service.exception.InvalidCredentialsException"
] |
import com.streamreduce.core.model.ConnectionCredentials; import com.streamreduce.core.service.exception.InvalidCredentialsException;
|
import com.streamreduce.core.model.*; import com.streamreduce.core.service.exception.*;
|
[
"com.streamreduce.core"
] |
com.streamreduce.core;
| 1,990,203
|
public void testLowerEntry() {
TreeMap map = map5();
Map.Entry e1 = map.lowerEntry(three);
assertEquals(two, e1.getKey());
Map.Entry e2 = map.lowerEntry(six);
assertEquals(five, e2.getKey());
Map.Entry e3 = map.lowerEntry(one);
assertNull(e3);
Map.Entry e4 = map.lowerEntry(zero);
assertNull(e4);
}
|
void function() { TreeMap map = map5(); Map.Entry e1 = map.lowerEntry(three); assertEquals(two, e1.getKey()); Map.Entry e2 = map.lowerEntry(six); assertEquals(five, e2.getKey()); Map.Entry e3 = map.lowerEntry(one); assertNull(e3); Map.Entry e4 = map.lowerEntry(zero); assertNull(e4); }
|
/**
* lowerEntry returns preceding entry.
*/
|
lowerEntry returns preceding entry
|
testLowerEntry
|
{
"repo_name": "FauxFaux/jdk9-jdk",
"path": "test/java/util/concurrent/tck/TreeMapTest.java",
"license": "gpl-2.0",
"size": 34187
}
|
[
"java.util.Map",
"java.util.TreeMap"
] |
import java.util.Map; import java.util.TreeMap;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,592,603
|
public Creator getCreatorExtension( final int index )
{
return (Creator) m_creatorExtensions.get( index );
}
|
Creator function( final int index ) { return (Creator) m_creatorExtensions.get( index ); }
|
/**
* Obtain the particular creator extension at the given index
*
* @param index an <code>int</code> index value
* @return a <code>Creator</code> instance
*/
|
Obtain the particular creator extension at the given index
|
getCreatorExtension
|
{
"repo_name": "eva-xuyen/migration",
"path": "fortress/container-impl/src/java/org/apache/avalon/fortress/util/LifecycleExtensionManager.java",
"license": "apache-2.0",
"size": 17449
}
|
[
"org.apache.avalon.lifecycle.Creator"
] |
import org.apache.avalon.lifecycle.Creator;
|
import org.apache.avalon.lifecycle.*;
|
[
"org.apache.avalon"
] |
org.apache.avalon;
| 1,203,671
|
protected final void write(byte[] b, int length) throws IOException {
write(b, 0, length);
}
|
final void function(byte[] b, int length) throws IOException { write(b, 0, length); }
|
/**
* Write an array of bytes to the buffered stream.
*
* @param b the array of bytes.
* @param length the length of bytes.
*/
|
Write an array of bytes to the buffered stream
|
write
|
{
"repo_name": "aadamowski/fi.java.net",
"path": "code/fastinfoset/src/main/java/com/sun/xml/fastinfoset/Encoder.java",
"license": "apache-2.0",
"size": 103614
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,869,726
|
final XLValue xlValue = PROCESSOR.invoke("JConstruct", XLString.of("java.lang.String"));
assertTrue(xlValue instanceof XLObject);
final Object object = HEAP.getObject(((XLObject) xlValue).getHandle());
assertTrue(object instanceof String);
final String string = (String) object;
assertTrue(string.isEmpty());
}
|
final XLValue xlValue = PROCESSOR.invoke(STR, XLString.of(STR)); assertTrue(xlValue instanceof XLObject); final Object object = HEAP.getObject(((XLObject) xlValue).getHandle()); assertTrue(object instanceof String); final String string = (String) object; assertTrue(string.isEmpty()); }
|
/**
* Tests construction of a String using new String().
*/
|
Tests construction of a String using new String()
|
testJConstruct
|
{
"repo_name": "McLeodMoores/xl4j",
"path": "xll-java/src/test/java/com/mcleodmoores/xl4j/v1/javacode/StringConstructionTest.java",
"license": "gpl-3.0",
"size": 1540
}
|
[
"com.mcleodmoores.xl4j.v1.api.values.XLObject",
"com.mcleodmoores.xl4j.v1.api.values.XLString",
"com.mcleodmoores.xl4j.v1.api.values.XLValue",
"org.testng.Assert"
] |
import com.mcleodmoores.xl4j.v1.api.values.XLObject; import com.mcleodmoores.xl4j.v1.api.values.XLString; import com.mcleodmoores.xl4j.v1.api.values.XLValue; import org.testng.Assert;
|
import com.mcleodmoores.xl4j.v1.api.values.*; import org.testng.*;
|
[
"com.mcleodmoores.xl4j",
"org.testng"
] |
com.mcleodmoores.xl4j; org.testng;
| 2,803,400
|
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
fasthb = MediaPlayer.create(this, R.raw.fast_hb);
slowhb = MediaPlayer.create(this, R.raw.slow_hb);
hb = MediaPlayer.create(this, R.raw.hb);
Timer mTimer = new Timer();
mTimer.scheduleAtFixedRate(mTimerTask, 1000, 1000);
setContentView(R.layout.common_ui);
cardboardView = (CardboardView) findViewById(R.id.cardboard_view);
cardboardView.setRestoreGLStateEnabled(false);
cardboardView.setRenderer(this);
setCardboardView(cardboardView);
trackedSSIDs = new ArrayList<String>();
untrackedSSIDs = new ArrayList<String>();
// headTracker = (HeadTracker) getSystemService(Context.);
// headTracker.setNeckModelEnabled(true);
// headTracker.setGyroBiasEstimationEnabled(true);
// headTracker.startTracking();
modelCube = new float[16];
camera = new float[16];
view = new float[16];
modelViewProjection = new float[16];
modelView = new float[16];
modelFloor = new float[16];
headView = new float[16];
vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
overlayView = (CardboardOverlayView) findViewById(R.id.overlay);
overlayView.show3DToast("Welcome To our app. \nMore Red means more Wi-Fi");
overlayViewTop = (CardboardOverlayViewTop) findViewById(R.id.overlayTop);
// overlayViewTop.show3DToast();
}
|
void function(Bundle savedInstanceState) { super.onCreate(savedInstanceState); wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); fasthb = MediaPlayer.create(this, R.raw.fast_hb); slowhb = MediaPlayer.create(this, R.raw.slow_hb); hb = MediaPlayer.create(this, R.raw.hb); Timer mTimer = new Timer(); mTimer.scheduleAtFixedRate(mTimerTask, 1000, 1000); setContentView(R.layout.common_ui); cardboardView = (CardboardView) findViewById(R.id.cardboard_view); cardboardView.setRestoreGLStateEnabled(false); cardboardView.setRenderer(this); setCardboardView(cardboardView); trackedSSIDs = new ArrayList<String>(); untrackedSSIDs = new ArrayList<String>(); modelCube = new float[16]; camera = new float[16]; view = new float[16]; modelViewProjection = new float[16]; modelView = new float[16]; modelFloor = new float[16]; headView = new float[16]; vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); overlayView = (CardboardOverlayView) findViewById(R.id.overlay); overlayView.show3DToast(STR); overlayViewTop = (CardboardOverlayViewTop) findViewById(R.id.overlayTop); }
|
/**
* Sets the view to our CardboardView and initializes the transformation matrices we will use
* to render our scene.
*/
|
Sets the view to our CardboardView and initializes the transformation matrices we will use to render our scene
|
onCreate
|
{
"repo_name": "madtreat/wi-find",
"path": "CardboardSample/src/main/java/com/google/vrtoolkit/cardboard/samples/treasurehunt/MainActivity.java",
"license": "apache-2.0",
"size": 29146
}
|
[
"android.content.Context",
"android.media.MediaPlayer",
"android.net.wifi.WifiManager",
"android.os.Bundle",
"android.os.Vibrator",
"com.google.vrtoolkit.cardboard.CardboardView",
"java.util.ArrayList",
"java.util.Timer"
] |
import android.content.Context; import android.media.MediaPlayer; import android.net.wifi.WifiManager; import android.os.Bundle; import android.os.Vibrator; import com.google.vrtoolkit.cardboard.CardboardView; import java.util.ArrayList; import java.util.Timer;
|
import android.content.*; import android.media.*; import android.net.wifi.*; import android.os.*; import com.google.vrtoolkit.cardboard.*; import java.util.*;
|
[
"android.content",
"android.media",
"android.net",
"android.os",
"com.google.vrtoolkit",
"java.util"
] |
android.content; android.media; android.net; android.os; com.google.vrtoolkit; java.util;
| 2,543,817
|
private int hash(List<StackWalker.StackFrame> stack) {
int hash = 0;
for (StackWalker.StackFrame frame : stack) {
hash = (31 * hash) + Objects.hash(frame.getDeclaringClass(),
frame.getMethodName(),
frame.getByteCodeIndex());
}
return hash;
}
// system-wide IllegalAccessLogger
private static volatile IllegalAccessLogger logger;
|
int function(List<StackWalker.StackFrame> stack) { int hash = 0; for (StackWalker.StackFrame frame : stack) { hash = (31 * hash) + Objects.hash(frame.getDeclaringClass(), frame.getMethodName(), frame.getByteCodeIndex()); } return hash; } private static volatile IllegalAccessLogger logger;
|
/**
* Computes a hash code for the give stack frames. The hash code is based
* on the class, method name, and BCI.
*/
|
Computes a hash code for the give stack frames. The hash code is based on the class, method name, and BCI
|
hash
|
{
"repo_name": "dmlloyd/openjdk-modules",
"path": "jdk/src/java.base/share/classes/jdk/internal/module/IllegalAccessLogger.java",
"license": "gpl-2.0",
"size": 12532
}
|
[
"java.util.List",
"java.util.Objects"
] |
import java.util.List; import java.util.Objects;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,351,477
|
ps.setParameters(shellParams.getPropertyFormatter().format(pc));
String scriptText;
try {
scriptText = IOUtils.toString(reader, MAX_LENGTH);
} catch (IOException e) {
throw new ShellProviderException("Failed reading a script file", e);
}
scriptText = ps.substitute(scriptText);
try {
shellCommandRunner.exec(scriptText);
} catch (IOException e) {
throw new ShellProviderException("Failed executing a script", e);
}
try {
shellCommandRunner.waitForAndCheckExceptions();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ShellProviderException("Interrupted while waiting for the script to finish", e);
} catch (ExecutionException e) {
throw new ShellProviderException(e.getMessage(), e);
}
counter.statements++;
}
|
ps.setParameters(shellParams.getPropertyFormatter().format(pc)); String scriptText; try { scriptText = IOUtils.toString(reader, MAX_LENGTH); } catch (IOException e) { throw new ShellProviderException(STR, e); } scriptText = ps.substitute(scriptText); try { shellCommandRunner.exec(scriptText); } catch (IOException e) { throw new ShellProviderException(STR, e); } try { shellCommandRunner.waitForAndCheckExceptions(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new ShellProviderException(STR, e); } catch (ExecutionException e) { throw new ShellProviderException(e.getMessage(), e); } counter.statements++; }
|
/**
* Parses a script from read, expands properties and produces the output.
*
* @param reader script content.
* @param pc parameters for substitution.
* @param counter statements counter.
*/
|
Parses a script from read, expands properties and produces the output
|
execute
|
{
"repo_name": "scriptella/scriptella-etl",
"path": "drivers/src/java/scriptella/driver/shell/ShellScriptExecutor.java",
"license": "apache-2.0",
"size": 3564
}
|
[
"java.io.IOException",
"java.util.concurrent.ExecutionException"
] |
import java.io.IOException; import java.util.concurrent.ExecutionException;
|
import java.io.*; import java.util.concurrent.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 1,885,984
|
public static void setWfcMode(Context context, int wfcMode) {
if (DBG) log("setWfcMode - setting=" + wfcMode);
android.provider.Settings.Global.putInt(context.getContentResolver(),
android.provider.Settings.Global.WFC_IMS_MODE, wfcMode);
setWfcModeInternal(context, wfcMode);
}
|
static void function(Context context, int wfcMode) { if (DBG) log(STR + wfcMode); android.provider.Settings.Global.putInt(context.getContentResolver(), android.provider.Settings.Global.WFC_IMS_MODE, wfcMode); setWfcModeInternal(context, wfcMode); }
|
/**
* Returns the user configuration of WFC modem setting
*/
|
Returns the user configuration of WFC modem setting
|
setWfcMode
|
{
"repo_name": "syslover33/ctank",
"path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/com/android/ims/ImsManager.java",
"license": "gpl-3.0",
"size": 41066
}
|
[
"android.content.Context",
"android.provider.Settings"
] |
import android.content.Context; import android.provider.Settings;
|
import android.content.*; import android.provider.*;
|
[
"android.content",
"android.provider"
] |
android.content; android.provider;
| 1,148,086
|
private void handleUserGroupSwitched(UserGroupSwitched evt)
{
if (evt == null) return;
Environment env = (Environment) registry.lookup(LookupNames.ENV);
if (!env.isServerAvailable()) return;
DataBrowserFactory.onGroupSwitched(evt.isSuccessful());
}
|
void function(UserGroupSwitched evt) { if (evt == null) return; Environment env = (Environment) registry.lookup(LookupNames.ENV); if (!env.isServerAvailable()) return; DataBrowserFactory.onGroupSwitched(evt.isSuccessful()); }
|
/**
* Handles the {@link UserGroupSwitched} event.
*
* @param evt The event to handle.
*/
|
Handles the <code>UserGroupSwitched</code> event
|
handleUserGroupSwitched
|
{
"repo_name": "rleigh-dundee/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/DataBrowserAgent.java",
"license": "gpl-2.0",
"size": 10671
}
|
[
"org.openmicroscopy.shoola.agents.dataBrowser.view.DataBrowserFactory",
"org.openmicroscopy.shoola.env.Environment",
"org.openmicroscopy.shoola.env.LookupNames",
"org.openmicroscopy.shoola.env.data.events.UserGroupSwitched"
] |
import org.openmicroscopy.shoola.agents.dataBrowser.view.DataBrowserFactory; import org.openmicroscopy.shoola.env.Environment; import org.openmicroscopy.shoola.env.LookupNames; import org.openmicroscopy.shoola.env.data.events.UserGroupSwitched;
|
import org.openmicroscopy.shoola.agents.*; import org.openmicroscopy.shoola.env.*; import org.openmicroscopy.shoola.env.data.events.*;
|
[
"org.openmicroscopy.shoola"
] |
org.openmicroscopy.shoola;
| 1,641,579
|
@Test(expectedExceptions = IllegalArgumentException.class)
public void testUriSearchResolveNullBaseUri2() {
uriSearchResolve(null, EIDS, IDENTIFIER_VALIDITY_DATE, DATA_FIELD, RESOLUTION_KEY, START, INCLUDE_START, END, INCLUDE_END, MAX_POINTS);
}
|
@Test(expectedExceptions = IllegalArgumentException.class) void function() { uriSearchResolve(null, EIDS, IDENTIFIER_VALIDITY_DATE, DATA_FIELD, RESOLUTION_KEY, START, INCLUDE_START, END, INCLUDE_END, MAX_POINTS); }
|
/**
* Tests that the base URI cannot be null.
*/
|
Tests that the base URI cannot be null
|
testUriSearchResolveNullBaseUri2
|
{
"repo_name": "McLeodMoores/starling",
"path": "projects/core-rest-client/src/test/java/com/opengamma/core/historicaltimeseries/impl/DataHistoricalTimeSeriesSourceUrisTest.java",
"license": "apache-2.0",
"size": 23342
}
|
[
"com.opengamma.core.historicaltimeseries.impl.DataHistoricalTimeSeriesSourceUris",
"org.testng.annotations.Test"
] |
import com.opengamma.core.historicaltimeseries.impl.DataHistoricalTimeSeriesSourceUris; import org.testng.annotations.Test;
|
import com.opengamma.core.historicaltimeseries.impl.*; import org.testng.annotations.*;
|
[
"com.opengamma.core",
"org.testng.annotations"
] |
com.opengamma.core; org.testng.annotations;
| 2,313,686
|
public SimpleFragmentIntent<F> putExtra(String name, short[] value) {
if (extras == null) {
extras = new Bundle();
}
extras.putShortArray(name, value);
return this;
}
|
SimpleFragmentIntent<F> function(String name, short[] value) { if (extras == null) { extras = new Bundle(); } extras.putShortArray(name, value); return this; }
|
/**
* Add extended data to the intent.
*
* @param name The name of the extra data, with package prefix.
* @param value The short array data value.
* @return Returns the same SimpleFragmentIntent<F> object, for chaining multiple calls into a
* single statement.
* @see #putExtras
* @see #removeExtra
* @see #getShortArrayExtra(String)
*/
|
Add extended data to the intent
|
putExtra
|
{
"repo_name": "evant/simplefragment",
"path": "simplefragment/src/main/java/me/tatarka/simplefragment/SimpleFragmentIntent.java",
"license": "apache-2.0",
"size": 36200
}
|
[
"android.os.Bundle"
] |
import android.os.Bundle;
|
import android.os.*;
|
[
"android.os"
] |
android.os;
| 2,357,484
|
public void map(Object key, Text value, Context context)
throws IOException, InterruptedException {
StringTokenizer itr = new StringTokenizer(value.toString());
while (itr.hasMoreTokens()) {
String string = itr.nextToken();
this.wordLen.set(string.length());
// the square of an integer is an integer...
this.wordLenSq.set((long) Math.pow(string.length(), 2.0));
context.write(LENGTH, this.wordLen);
context.write(SQUARE, this.wordLenSq);
context.write(COUNT, ONE);
}
}
}
public static class WordStandardDeviationReducer extends
Reducer<Text, LongWritable, Text, LongWritable> {
private LongWritable val = new LongWritable();
|
void function(Object key, Text value, Context context) throws IOException, InterruptedException { StringTokenizer itr = new StringTokenizer(value.toString()); while (itr.hasMoreTokens()) { String string = itr.nextToken(); this.wordLen.set(string.length()); this.wordLenSq.set((long) Math.pow(string.length(), 2.0)); context.write(LENGTH, this.wordLen); context.write(SQUARE, this.wordLenSq); context.write(COUNT, ONE); } } } public static class WordStandardDeviationReducer extends Reducer<Text, LongWritable, Text, LongWritable> { private LongWritable val = new LongWritable();
|
/**
* Emits 3 key-value pairs for counting the word, its length, and the
* squares of its length. Outputs are (Text, LongWritable).
*
* @param value
* This will be a line of text coming in from our input file.
*/
|
Emits 3 key-value pairs for counting the word, its length, and the squares of its length. Outputs are (Text, LongWritable)
|
map
|
{
"repo_name": "cnfire/hadoop",
"path": "hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/WordStandardDeviation.java",
"license": "apache-2.0",
"size": 7224
}
|
[
"java.io.IOException",
"java.util.StringTokenizer",
"org.apache.hadoop.io.LongWritable",
"org.apache.hadoop.io.Text",
"org.apache.hadoop.mapreduce.Reducer"
] |
import java.io.IOException; import java.util.StringTokenizer; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Reducer;
|
import java.io.*; import java.util.*; import org.apache.hadoop.io.*; import org.apache.hadoop.mapreduce.*;
|
[
"java.io",
"java.util",
"org.apache.hadoop"
] |
java.io; java.util; org.apache.hadoop;
| 2,665,899
|
public Logger getLogger() {
return reportLogger;
}
|
Logger function() { return reportLogger; }
|
/**
* Returns the underlying logger for report service interactions.
*/
|
Returns the underlying logger for report service interactions
|
getLogger
|
{
"repo_name": "gawkermedia/googleads-java-lib",
"path": "modules/ads_lib/src/main/java/com/google/api/ads/adwords/lib/utils/logging/ReportServiceLogger.java",
"license": "apache-2.0",
"size": 5202
}
|
[
"org.slf4j.Logger"
] |
import org.slf4j.Logger;
|
import org.slf4j.*;
|
[
"org.slf4j"
] |
org.slf4j;
| 2,275,746
|
public Set<String> getAreas(String configName, String envType, String envContext);
|
Set<String> function(String configName, String envType, String envContext);
|
/**
* Access the defined areas for a given configuration.
* @param configName the configuration name, not null.
* @param envContext the environment context, not null.
* @return the areas defined (only returning the areas that contain properties).
* @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded
*/
|
Access the defined areas for a given configuration
|
getAreas
|
{
"repo_name": "java-config/tamaya-export",
"path": "modules/managed/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java",
"license": "apache-2.0",
"size": 7783
}
|
[
"java.util.Set"
] |
import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,862,960
|
final boolean diskLookup(long fp) throws IOException {
if (this.index == null) {
return false;
}
// Increment disk lookup counter
this.diskLookupCnt.increment();
// search in index for position to seek to
// do interpolated binary search
final int indexLength = this.index.length;
int loPage = 0, hiPage = indexLength - 1;
long loVal = this.index[loPage];
long hiVal = this.index[hiPage];
// Test boundary cases (if not inside interval)
if (fp < loVal || fp > hiVal) {
return false;
}
if (fp == hiVal) {// why not check loVal? memLookup would have found it already!
return true;
}
final double dfp = (double) fp;
// a) find disk page that would potentially contain the fp. this.index contains
// the first fp of each disk page
while (loPage < hiPage - 1) {
final double dhi = (double) hiPage;
final double dlo = (double) loPage;
final double dhiVal = (double) hiVal;
final double dloVal = (double) loVal;
int midPage = (loPage + 1)
+ (int) ((dhi - dlo - 1.0) * (dfp - dloVal) / (dhiVal - dloVal));
if (midPage == hiPage)
midPage--; // Needed due to limited precision of doubles
Assert.check(loPage < midPage && midPage < hiPage,
EC.SYSTEM_INDEX_ERROR);
final long v = this.index[midPage];
if (fp < v) {
hiPage = midPage;
hiVal = v;
} else if (fp > v) {
loPage = midPage;
loVal = v;
} else {
// given fp happens to be in index file
return true;
}
}
return diskLookupBinarySearch(fp, indexLength, loPage, hiPage, loVal, hiVal, dfp);
}
|
final boolean diskLookup(long fp) throws IOException { if (this.index == null) { return false; } this.diskLookupCnt.increment(); final int indexLength = this.index.length; int loPage = 0, hiPage = indexLength - 1; long loVal = this.index[loPage]; long hiVal = this.index[hiPage]; if (fp < loVal fp > hiVal) { return false; } if (fp == hiVal) { return true; } final double dfp = (double) fp; while (loPage < hiPage - 1) { final double dhi = (double) hiPage; final double dlo = (double) loPage; final double dhiVal = (double) hiVal; final double dloVal = (double) loVal; int midPage = (loPage + 1) + (int) ((dhi - dlo - 1.0) * (dfp - dloVal) / (dhiVal - dloVal)); if (midPage == hiPage) midPage--; Assert.check(loPage < midPage && midPage < hiPage, EC.SYSTEM_INDEX_ERROR); final long v = this.index[midPage]; if (fp < v) { hiPage = midPage; hiVal = v; } else if (fp > v) { loPage = midPage; loVal = v; } else { return true; } } return diskLookupBinarySearch(fp, indexLength, loPage, hiPage, loVal, hiVal, dfp); }
|
/**
* Look on disk for the fingerprint "fp". This method requires that
* "this.rwLock" has been acquired for reading by the caller.
* @param fp The fingerprint to lookup on disk
* @return true iff fp is on disk
*/
|
Look on disk for the fingerprint "fp". This method requires that "this.rwLock" has been acquired for reading by the caller
|
diskLookup
|
{
"repo_name": "tlaplus/tlaplus",
"path": "tlatools/org.lamport.tlatools/src/tlc2/tool/fp/DiskFPSet.java",
"license": "mit",
"size": 35370
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 583,931
|
public void deleteStaticExportPublishedResource(
CmsRequestContext context,
String resourceName,
int linkType,
String linkParameter) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
m_driverManager.deleteStaticExportPublishedResource(dbc, resourceName, linkType, linkParameter);
} catch (Exception e) {
dbc.report(
null,
Messages.get().container(Messages.ERR_DELETE_STATEXP_PUBLISHES_RESOURCE_1, resourceName),
e);
} finally {
dbc.clear();
}
}
|
void function( CmsRequestContext context, String resourceName, int linkType, String linkParameter) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { m_driverManager.deleteStaticExportPublishedResource(dbc, resourceName, linkType, linkParameter); } catch (Exception e) { dbc.report( null, Messages.get().container(Messages.ERR_DELETE_STATEXP_PUBLISHES_RESOURCE_1, resourceName), e); } finally { dbc.clear(); } }
|
/**
* Deletes an entry in the published resource table.<p>
*
* @param context the current request context
* @param resourceName The name of the resource to be deleted in the static export
* @param linkType the type of resource deleted (0= non-parameter, 1=parameter)
* @param linkParameter the parameters of the resource
*
* @throws CmsException if something goes wrong
*/
|
Deletes an entry in the published resource table
|
deleteStaticExportPublishedResource
|
{
"repo_name": "comundus/opencms-comundus",
"path": "src/main/java/org/opencms/db/CmsSecurityManager.java",
"license": "lgpl-2.1",
"size": 242914
}
|
[
"org.opencms.file.CmsRequestContext",
"org.opencms.main.CmsException"
] |
import org.opencms.file.CmsRequestContext; import org.opencms.main.CmsException;
|
import org.opencms.file.*; import org.opencms.main.*;
|
[
"org.opencms.file",
"org.opencms.main"
] |
org.opencms.file; org.opencms.main;
| 1,940,033
|
@NonNull
private static List<File> getBackupDirectories() {
File[] directories = {};
File directory = getDirectory();
if (nonNull(directory)) {
directories = directory.listFiles(file -> file.isDirectory() &&
file.getName().matches(WorkerApplication.STORAGE_BACKUP_DIRECTORY_PATTERN));
}
return new ArrayList<>(Arrays.asList(directories));
}
|
static List<File> function() { File[] directories = {}; File directory = getDirectory(); if (nonNull(directory)) { directories = directory.listFiles(file -> file.isDirectory() && file.getName().matches(WorkerApplication.STORAGE_BACKUP_DIRECTORY_PATTERN)); } return new ArrayList<>(Arrays.asList(directories)); }
|
/**
* Get a list of backup directories from the application directory on the external storage.
*
* @return List of backup directories within the application directory.
*/
|
Get a list of backup directories from the application directory on the external storage
|
getBackupDirectories
|
{
"repo_name": "raatiniemi/worker",
"path": "app/src/main/java/me/raatiniemi/worker/data/util/ExternalStorage.java",
"license": "gpl-2.0",
"size": 5422
}
|
[
"java.io.File",
"java.util.ArrayList",
"java.util.Arrays",
"java.util.List",
"me.raatiniemi.worker.WorkerApplication"
] |
import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import me.raatiniemi.worker.WorkerApplication;
|
import java.io.*; import java.util.*; import me.raatiniemi.worker.*;
|
[
"java.io",
"java.util",
"me.raatiniemi.worker"
] |
java.io; java.util; me.raatiniemi.worker;
| 1,551,559
|
UserConfiguration config = new UserConfiguration();
path = config.getCacheFilePath();
}
|
UserConfiguration config = new UserConfiguration(); path = config.getCacheFilePath(); }
|
/** make sure all paths are initialized correctly
*
*/
|
make sure all paths are initialized correctly
|
checkPath
|
{
"repo_name": "sbliven/biojava",
"path": "biojava3-structure/src/main/java/org/biojava/bio/structure/io/mmcif/AllChemCompProvider.java",
"license": "lgpl-2.1",
"size": 5039
}
|
[
"org.biojava.bio.structure.align.util.UserConfiguration"
] |
import org.biojava.bio.structure.align.util.UserConfiguration;
|
import org.biojava.bio.structure.align.util.*;
|
[
"org.biojava.bio"
] |
org.biojava.bio;
| 1,744,111
|
public static Path createAppConfig(Path configurations, Path connectors) throws IOException {
Path configFile = Files.createTempFile("test-config", ".json");
AppConfig.Global global = ImmutableAppConfig.Global.builder()
.configurationsPath(configurations.toAbsolutePath().toString())
.connectorsPath(connectors.toAbsolutePath().toString())
.runOnce(true)
.updateConfigurationIntervalMillis(100000L)
.build();
AppConfig config = ImmutableAppConfig.builder().global(global).build();
mapper.writeValue(configFile.toFile(), config);
return configFile;
}
|
static Path function(Path configurations, Path connectors) throws IOException { Path configFile = Files.createTempFile(STR, ".json"); AppConfig.Global global = ImmutableAppConfig.Global.builder() .configurationsPath(configurations.toAbsolutePath().toString()) .connectorsPath(connectors.toAbsolutePath().toString()) .runOnce(true) .updateConfigurationIntervalMillis(100000L) .build(); AppConfig config = ImmutableAppConfig.builder().global(global).build(); mapper.writeValue(configFile.toFile(), config); return configFile; }
|
/**
* Creates a simple {@link AppConfig} object
*/
|
Creates a simple <code>AppConfig</code> object
|
createAppConfig
|
{
"repo_name": "salesforce/pyplyn",
"path": "duct/src/test/java/com/salesforce/pyplyn/duct/app/DuctMainTest.java",
"license": "bsd-3-clause",
"size": 2761
}
|
[
"com.salesforce.pyplyn.duct.appconfig.AppConfig",
"com.salesforce.pyplyn.duct.appconfig.ImmutableAppConfig",
"java.io.IOException",
"java.nio.file.Files",
"java.nio.file.Path"
] |
import com.salesforce.pyplyn.duct.appconfig.AppConfig; import com.salesforce.pyplyn.duct.appconfig.ImmutableAppConfig; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path;
|
import com.salesforce.pyplyn.duct.appconfig.*; import java.io.*; import java.nio.file.*;
|
[
"com.salesforce.pyplyn",
"java.io",
"java.nio"
] |
com.salesforce.pyplyn; java.io; java.nio;
| 216,437
|
@Override
public void config(final String message, final Throwable throwable) {
logWrapper.logIfEnabled(loggerName, Level.INFO, null, message, throwable);
}
|
void function(final String message, final Throwable throwable) { logWrapper.logIfEnabled(loggerName, Level.INFO, null, message, throwable); }
|
/**
* Logs a message at the {@code Level.INFO} level including the stack trace of the
* {@link Throwable} {@code t} passed as parameter.
*
* @param message the message to log.
* @param throwable the exception to log, including its stack trace.
*/
|
Logs a message at the Level.INFO level including the stack trace of the <code>Throwable</code> t passed as parameter
|
config
|
{
"repo_name": "PurelyApplied/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/logging/log4j/LogWriterLogger.java",
"license": "apache-2.0",
"size": 56907
}
|
[
"org.apache.logging.log4j.Level"
] |
import org.apache.logging.log4j.Level;
|
import org.apache.logging.log4j.*;
|
[
"org.apache.logging"
] |
org.apache.logging;
| 2,215,534
|
public Filter createFilter(FilterConfig filterConfig) {
LOGGER.entering(SecurityRealm.class.getName(), "createFilter");
Binding binding = new Binding();
SecurityComponents sc = getSecurityComponents();
binding.setVariable("securityComponents", sc);
binding.setVariable("securityRealm",this);
BeanBuilder builder = new BeanBuilder();
builder.parse(filterConfig.getServletContext().getResourceAsStream("/WEB-INF/security/SecurityFilters.groovy"),binding);
WebApplicationContext context = builder.createApplicationContext();
return (Filter) context.getBean("filter");
}
public static final SecurityRealm NO_AUTHENTICATION = new None();
|
Filter function(FilterConfig filterConfig) { LOGGER.entering(SecurityRealm.class.getName(), STR); Binding binding = new Binding(); SecurityComponents sc = getSecurityComponents(); binding.setVariable(STR, sc); binding.setVariable(STR,this); BeanBuilder builder = new BeanBuilder(); builder.parse(filterConfig.getServletContext().getResourceAsStream(STR),binding); WebApplicationContext context = builder.createApplicationContext(); return (Filter) context.getBean(STR); } public static final SecurityRealm NO_AUTHENTICATION = new None();
|
/**
* Creates {@link Filter} that all the incoming HTTP requests will go through
* for authentication.
*
* <p>
* The default implementation uses {@link #getSecurityComponents()} and builds
* a standard filter chain from /WEB-INF/security/SecurityFilters.groovy.
* But subclasses can override this to completely change the filter sequence.
*
* <p>
* For other plugins that want to contribute {@link Filter}, see
* {@link PluginServletFilter}.
*
* @since 1.271
*/
|
Creates <code>Filter</code> that all the incoming HTTP requests will go through for authentication. The default implementation uses <code>#getSecurityComponents()</code> and builds a standard filter chain from /WEB-INF/security/SecurityFilters.groovy. But subclasses can override this to completely change the filter sequence. For other plugins that want to contribute <code>Filter</code>, see <code>PluginServletFilter</code>
|
createFilter
|
{
"repo_name": "andresrc/jenkins",
"path": "core/src/main/java/hudson/security/SecurityRealm.java",
"license": "mit",
"size": 27402
}
|
[
"groovy.lang.Binding",
"hudson.util.spring.BeanBuilder",
"javax.servlet.Filter",
"javax.servlet.FilterConfig",
"org.springframework.web.context.WebApplicationContext"
] |
import groovy.lang.Binding; import hudson.util.spring.BeanBuilder; import javax.servlet.Filter; import javax.servlet.FilterConfig; import org.springframework.web.context.WebApplicationContext;
|
import groovy.lang.*; import hudson.util.spring.*; import javax.servlet.*; import org.springframework.web.context.*;
|
[
"groovy.lang",
"hudson.util.spring",
"javax.servlet",
"org.springframework.web"
] |
groovy.lang; hudson.util.spring; javax.servlet; org.springframework.web;
| 1,003,168
|
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.DEFAULT_STYLE);
}
|
String function() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.DEFAULT_STYLE); }
|
/**
* Generates a String representation of the contents of this type.
* This is an extension method, produced by the 'ts' xjc plugin
*
*/
|
Generates a String representation of the contents of this type. This is an extension method, produced by the 'ts' xjc plugin
|
toString
|
{
"repo_name": "fpompermaier/onvif",
"path": "onvif-ws-client/src/main/java/org/onvif/ver10/deviceio/wsdl/SerialPort.java",
"license": "apache-2.0",
"size": 3214
}
|
[
"org.apache.commons.lang3.builder.ToStringBuilder",
"org.apache.cxf.xjc.runtime.JAXBToStringStyle"
] |
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.cxf.xjc.runtime.JAXBToStringStyle;
|
import org.apache.commons.lang3.builder.*; import org.apache.cxf.xjc.runtime.*;
|
[
"org.apache.commons",
"org.apache.cxf"
] |
org.apache.commons; org.apache.cxf;
| 2,831,954
|
public ChangeDetector getChangeDetector();
|
ChangeDetector function();
|
/**
* Gets the change detector item.
*
* @return the change detector item
*/
|
Gets the change detector item
|
getChangeDetector
|
{
"repo_name": "abifet/incubator-samoa",
"path": "samoa-api/src/main/java/org/apache/samoa/learners/AdaptiveLearner.java",
"license": "apache-2.0",
"size": 1519
}
|
[
"org.apache.samoa.moa.classifiers.core.driftdetection.ChangeDetector"
] |
import org.apache.samoa.moa.classifiers.core.driftdetection.ChangeDetector;
|
import org.apache.samoa.moa.classifiers.core.driftdetection.*;
|
[
"org.apache.samoa"
] |
org.apache.samoa;
| 828,320
|
public static TransformerFactory getTransformerFactory() throws TransformerFactoryConfigurationError {
if (transformerFactory == null) {
boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false")
.equalsIgnoreCase("true");
ClassLoader prevTCCL = SecurityActions.getTCCL();
try {
if (tccl_jaxp) {
SecurityActions.setTCCL(TransformerUtil.class.getClassLoader());
}
transformerFactory = TransformerFactory.newInstance();
try {
transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
} catch (TransformerConfigurationException ignored) {
// some platforms don't support this. For example our testsuite pulls Selenium which requires Xalan 2.7.1
logger.warn("XML External Entity switches are not supported. You may get XML injection vulnerabilities.");
}
try {
transformerFactory.setAttribute(FixXMLConstants.ACCESS_EXTERNAL_DTD, "");
transformerFactory.setAttribute(FixXMLConstants.ACCESS_EXTERNAL_STYLESHEET, "");
} catch (Exception ignored) {
// some platforms don't support this. For example our testsuite pulls Selenium which requires Xalan 2.7.1
logger.warn("XML External Entity switches are not supported. You may get XML injection vulnerabilities.");
}
} finally {
if (tccl_jaxp) {
SecurityActions.setTCCL(prevTCCL);
}
}
}
return transformerFactory;
}
|
static TransformerFactory function() throws TransformerFactoryConfigurationError { if (transformerFactory == null) { boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false") .equalsIgnoreCase("true"); ClassLoader prevTCCL = SecurityActions.getTCCL(); try { if (tccl_jaxp) { SecurityActions.setTCCL(TransformerUtil.class.getClassLoader()); } transformerFactory = TransformerFactory.newInstance(); try { transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (TransformerConfigurationException ignored) { logger.warn(STR); } try { transformerFactory.setAttribute(FixXMLConstants.ACCESS_EXTERNAL_DTD, STR"); } catch (Exception ignored) { logger.warn(STR); } } finally { if (tccl_jaxp) { SecurityActions.setTCCL(prevTCCL); } } } return transformerFactory; }
|
/**
* <p>Creates a {@link TransformerFactory}. The returned instance is cached and shared between different
* threads.</p>
*
* @return
*
* @throws TransformerFactoryConfigurationError
*/
|
Creates a <code>TransformerFactory</code>. The returned instance is cached and shared between different threads
|
getTransformerFactory
|
{
"repo_name": "thomasdarimont/keycloak",
"path": "saml-core/src/main/java/org/keycloak/saml/common/util/TransformerUtil.java",
"license": "apache-2.0",
"size": 17689
}
|
[
"javax.xml.XMLConstants",
"javax.xml.transform.TransformerConfigurationException",
"javax.xml.transform.TransformerFactory",
"javax.xml.transform.TransformerFactoryConfigurationError",
"org.keycloak.saml.common.constants.GeneralConstants",
"org.keycloak.saml.processing.core.util.FixXMLConstants"
] |
import javax.xml.XMLConstants; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactoryConfigurationError; import org.keycloak.saml.common.constants.GeneralConstants; import org.keycloak.saml.processing.core.util.FixXMLConstants;
|
import javax.xml.*; import javax.xml.transform.*; import org.keycloak.saml.common.constants.*; import org.keycloak.saml.processing.core.util.*;
|
[
"javax.xml",
"org.keycloak.saml"
] |
javax.xml; org.keycloak.saml;
| 2,538,193
|
@Test(expected = GenieNotFoundException.class)
public void cantUpdateRuntimeForNonExistentCluster() throws GenieException {
final String id = UUID.randomUUID().toString();
final JobEntity jobEntity = Mockito.mock(JobEntity.class);
Mockito.when(this.jobRepo.findOne(JOB_1_ID)).thenReturn(jobEntity);
Mockito.when(this.clusterRepo.findOne(Mockito.eq(id))).thenReturn(null);
this.jobPersistenceService.updateJobWithRuntimeEnvironment(JOB_1_ID, id, "bar", Lists.newArrayList(), 1);
}
|
@Test(expected = GenieNotFoundException.class) void function() throws GenieException { final String id = UUID.randomUUID().toString(); final JobEntity jobEntity = Mockito.mock(JobEntity.class); Mockito.when(this.jobRepo.findOne(JOB_1_ID)).thenReturn(jobEntity); Mockito.when(this.clusterRepo.findOne(Mockito.eq(id))).thenReturn(null); this.jobPersistenceService.updateJobWithRuntimeEnvironment(JOB_1_ID, id, "bar", Lists.newArrayList(), 1); }
|
/**
* Test the updateJobWithRuntime method.
*
* @throws GenieException For any problem
*/
|
Test the updateJobWithRuntime method
|
cantUpdateRuntimeForNonExistentCluster
|
{
"repo_name": "ajoymajumdar/genie",
"path": "genie-core/src/test/java/com/netflix/genie/core/jpa/services/JpaJobPersistenceServiceImplUnitTests.java",
"license": "apache-2.0",
"size": 23606
}
|
[
"com.google.common.collect.Lists",
"com.netflix.genie.common.exceptions.GenieException",
"com.netflix.genie.common.exceptions.GenieNotFoundException",
"com.netflix.genie.core.jpa.entities.JobEntity",
"java.util.UUID",
"org.junit.Test",
"org.mockito.Mockito"
] |
import com.google.common.collect.Lists; import com.netflix.genie.common.exceptions.GenieException; import com.netflix.genie.common.exceptions.GenieNotFoundException; import com.netflix.genie.core.jpa.entities.JobEntity; import java.util.UUID; import org.junit.Test; import org.mockito.Mockito;
|
import com.google.common.collect.*; import com.netflix.genie.common.exceptions.*; import com.netflix.genie.core.jpa.entities.*; import java.util.*; import org.junit.*; import org.mockito.*;
|
[
"com.google.common",
"com.netflix.genie",
"java.util",
"org.junit",
"org.mockito"
] |
com.google.common; com.netflix.genie; java.util; org.junit; org.mockito;
| 2,228,703
|
public void createProxyClient() {
HttpClient client = new OkHttpAsyncHttpClientBuilder()
.proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("<proxy-host>", 8888)))
.build();
}
|
void function() { HttpClient client = new OkHttpAsyncHttpClientBuilder() .proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress(STR, 8888))) .build(); }
|
/**
* Sample code for creating async Netty HTTP client with proxy.
*/
|
Sample code for creating async Netty HTTP client with proxy
|
createProxyClient
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/core/azure-core-http-okhttp/src/samples/java/com/azure/core/http/okhttp/ReadmeSamples.java",
"license": "mit",
"size": 1124
}
|
[
"com.azure.core.http.HttpClient",
"com.azure.core.http.ProxyOptions",
"java.net.InetSocketAddress"
] |
import com.azure.core.http.HttpClient; import com.azure.core.http.ProxyOptions; import java.net.InetSocketAddress;
|
import com.azure.core.http.*; import java.net.*;
|
[
"com.azure.core",
"java.net"
] |
com.azure.core; java.net;
| 2,702,503
|
public boolean isEditable() {
if (Build.VERSION.SDK_INT >= 18) {
return mInfo.isEditable();
} else {
return false;
}
}
|
boolean function() { if (Build.VERSION.SDK_INT >= 18) { return mInfo.isEditable(); } else { return false; } }
|
/**
* Gets if the node is editable.
*
* @return True if the node is editable, false otherwise.
*/
|
Gets if the node is editable
|
isEditable
|
{
"repo_name": "AndroidX/androidx",
"path": "core/core/src/main/java/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.java",
"license": "apache-2.0",
"size": 160272
}
|
[
"android.os.Build"
] |
import android.os.Build;
|
import android.os.*;
|
[
"android.os"
] |
android.os;
| 10,982
|
int getMinSamplingInterval() throws IOException, UnavailableDeviceException, ClosedDeviceException;
|
int getMinSamplingInterval() throws IOException, UnavailableDeviceException, ClosedDeviceException;
|
/**
* Gets the minimum output sampling interval (in microseconds) that can be set using
* {@link #setSamplingInterval setSamplingInterval}.
*
* @return the minimum output sampling interval (in microseconds).
* @throws IOException
* if some other I/O error occurs.
* @throws UnavailableDeviceException
* if this device is not currently available - such as it is locked by another
* application.
* @throws ClosedDeviceException
* if the device has been closed.
*/
|
Gets the minimum output sampling interval (in microseconds) that can be set using <code>#setSamplingInterval setSamplingInterval</code>
|
getMinSamplingInterval
|
{
"repo_name": "gavinying/kura",
"path": "target-platform/jdk.dio-parent/src/dev/src/share/classes/jdk/dio/dac/DACChannel.java",
"license": "epl-1.0",
"size": 22136
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,911,475
|
@Override
public void addGameScreenText(double x, double y,
String text, NotificationType type,
boolean isTalking) {
// ignored
}
|
void function(double x, double y, String text, NotificationType type, boolean isTalking) { }
|
/**
* adds a text box on the screen
*
* @param x x
* @param y y
* @param text text to display
* @param type type of text
* @param isTalking chat?
*/
|
adds a text box on the screen
|
addGameScreenText
|
{
"repo_name": "markuskeunecke/stendhal",
"path": "src/games/stendhal/bot/curses/CursesUI.java",
"license": "gpl-2.0",
"size": 2552
}
|
[
"games.stendhal.common.NotificationType"
] |
import games.stendhal.common.NotificationType;
|
import games.stendhal.common.*;
|
[
"games.stendhal.common"
] |
games.stendhal.common;
| 2,362,394
|
private boolean hasSameNameAndSignature(IFunctionDefinition other, boolean otherIsInterface, ICompilerProject project)
{
// Compare method names.
String name1 = getBaseName();
String name2 = other.getBaseName();
if (!name1.equals(name2))
return false;
// If other is an interface, then we don't need to compare namespaces.
// As long as the signature match, and the caller guarantees to us that "other" is in fact an
// interface above us in the derivation chain, then we can ignore the namespaces.
// If we did not ignore them, they would not match, since by definition interfaces are in a different
// namespace
if (!otherIsInterface)
{
// Compare method namespaces.
// Note that equals() for namespace references
// actually compares URIs for non-builtin namespaces.
INamespaceReference nsRef1 = getNamespaceReference();
INamespaceReference nsRef2 = other.getNamespaceReference();
if (!nsRef1.equals(nsRef2))
return false;
}
else
{
// you must only call this when "this" is a member of a class
assert (getFunctionClassification() == FunctionClassification.CLASS_MEMBER);
// we can only implement an interface if we are public
if (!NamespaceDefinition.getPublicNamespaceDefinition().equals(this.getNamespaceReference()))
return false;
}
return hasCompatibleSignature(other, project);
}
|
boolean function(IFunctionDefinition other, boolean otherIsInterface, ICompilerProject project) { String name1 = getBaseName(); String name2 = other.getBaseName(); if (!name1.equals(name2)) return false; if (!otherIsInterface) { INamespaceReference nsRef1 = getNamespaceReference(); INamespaceReference nsRef2 = other.getNamespaceReference(); if (!nsRef1.equals(nsRef2)) return false; } else { assert (getFunctionClassification() == FunctionClassification.CLASS_MEMBER); if (!NamespaceDefinition.getPublicNamespaceDefinition().equals(this.getNamespaceReference())) return false; } return hasCompatibleSignature(other, project); }
|
/**
* Compares the signatures of two methods.
*
* @param other is a function to compare "this" to. Must be from a super
* type
* @param otherIsInterface true if "other" is a function from an interface
*/
|
Compares the signatures of two methods
|
hasSameNameAndSignature
|
{
"repo_name": "greg-dove/flex-falcon",
"path": "compiler/src/main/java/org/apache/flex/compiler/internal/definitions/FunctionDefinition.java",
"license": "apache-2.0",
"size": 22394
}
|
[
"org.apache.flex.compiler.definitions.IFunctionDefinition",
"org.apache.flex.compiler.definitions.references.INamespaceReference",
"org.apache.flex.compiler.projects.ICompilerProject"
] |
import org.apache.flex.compiler.definitions.IFunctionDefinition; import org.apache.flex.compiler.definitions.references.INamespaceReference; import org.apache.flex.compiler.projects.ICompilerProject;
|
import org.apache.flex.compiler.definitions.*; import org.apache.flex.compiler.definitions.references.*; import org.apache.flex.compiler.projects.*;
|
[
"org.apache.flex"
] |
org.apache.flex;
| 2,275,761
|
public String toStringUtf8() {
try {
return new String(bytes, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("UTF-8 not supported?", e);
}
}
// =================================================================
// equals() and hashCode()
|
String function() { try { return new String(bytes, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(STR, e); } }
|
/**
* Constructs a new {@code String} by decoding the bytes as UTF-8.
*/
|
Constructs a new String by decoding the bytes as UTF-8
|
toStringUtf8
|
{
"repo_name": "BozhkoAlexander/mtasa-blue",
"path": "vendor/google-breakpad/src/third_party/protobuf/protobuf/java/src/main/java/com/google/protobuf/ByteString.java",
"license": "gpl-3.0",
"size": 11737
}
|
[
"java.io.UnsupportedEncodingException"
] |
import java.io.UnsupportedEncodingException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,696,435
|
public void onClick(View arg0) {
if (arg0.equals(mBtnSet)) {
if (null == mValueEdit.getText().toString()
|| mValueEdit.getText().toString().equals("")) {
Toast
.makeText(this, R.string.input_null_tip, Toast.LENGTH_LONG)
.show();
return;
}
if (LONGEST_NUM_LENGHT < mValueEdit.getText().toString().length()
|| 0 == mValueEdit.getText().toString().length()) {
Toast.makeText(this, R.string.input_length_error,
Toast.LENGTH_LONG).show();
return;
}
int inputValue = Integer.valueOf(mValueEdit.getText().toString());
if (inputValue > LARGEST_NUM) {
Toast.makeText(this, R.string.input_length_error,
Toast.LENGTH_LONG).show();
return;
}
setAudioData(inputValue);
}
}
|
void function(View arg0) { if (arg0.equals(mBtnSet)) { if (null == mValueEdit.getText().toString() mValueEdit.getText().toString().equals("")) { Toast .makeText(this, R.string.input_null_tip, Toast.LENGTH_LONG) .show(); return; } if (LONGEST_NUM_LENGHT < mValueEdit.getText().toString().length() 0 == mValueEdit.getText().toString().length()) { Toast.makeText(this, R.string.input_length_error, Toast.LENGTH_LONG).show(); return; } int inputValue = Integer.valueOf(mValueEdit.getText().toString()); if (inputValue > LARGEST_NUM) { Toast.makeText(this, R.string.input_length_error, Toast.LENGTH_LONG).show(); return; } setAudioData(inputValue); } }
|
/**
* click the set button.
*
* @param arg0
* : click which view
*/
|
click the set button
|
onClick
|
{
"repo_name": "rex-xxx/mt6572_x201",
"path": "mediatek/packages/apps/EngineerMode/src/com/mediatek/engineermode/audio/AudioSpeechEnhancement.java",
"license": "gpl-2.0",
"size": 16731
}
|
[
"android.view.View",
"android.widget.Toast"
] |
import android.view.View; import android.widget.Toast;
|
import android.view.*; import android.widget.*;
|
[
"android.view",
"android.widget"
] |
android.view; android.widget;
| 859,022
|
void log(String message) {
Log.d(TAG, message);
}
|
void log(String message) { Log.d(TAG, message); }
|
/**
* Prints a log message (convenience method).
*/
|
Prints a log message (convenience method)
|
log
|
{
"repo_name": "playgameservices/android-basic-samples",
"path": "CollectAllTheStars2/src/main/java/com/google/example/games/catt2/MainActivity.java",
"license": "apache-2.0",
"size": 38491
}
|
[
"android.util.Log"
] |
import android.util.Log;
|
import android.util.*;
|
[
"android.util"
] |
android.util;
| 2,885,744
|
@MonitorableStatusValue( name = "state", description = "The current execution state of the service." )
public ExecutionLifecycleState getState( ) {
return Service.this.lifecycleState;
}
|
@MonitorableStatusValue( name = "state", description = STR ) ExecutionLifecycleState function( ) { return Service.this.lifecycleState; }
|
/**
* Returns the current execution state of the service.
* @return the execution state
*/
|
Returns the current execution state of the service
|
getState
|
{
"repo_name": "Talvish/Tales",
"path": "product/services/src/com/talvish/tales/services/Service.java",
"license": "apache-2.0",
"size": 43265
}
|
[
"com.talvish.tales.system.ExecutionLifecycleState",
"com.talvish.tales.system.status.MonitorableStatusValue"
] |
import com.talvish.tales.system.ExecutionLifecycleState; import com.talvish.tales.system.status.MonitorableStatusValue;
|
import com.talvish.tales.system.*; import com.talvish.tales.system.status.*;
|
[
"com.talvish.tales"
] |
com.talvish.tales;
| 1,280,585
|
return ID3v24Frames.FRAME_ID_INITIAL_KEY;
}
|
return ID3v24Frames.FRAME_ID_INITIAL_KEY; }
|
/**
* The ID3v2 frame identifier
*
* @return the ID3v2 frame identifier for this frame type
*/
|
The ID3v2 frame identifier
|
getIdentifier
|
{
"repo_name": "dubenju/javay",
"path": "src/java/org/jaudiotagger/tag/id3/framebody/FrameBodyTKEY.java",
"license": "apache-2.0",
"size": 2978
}
|
[
"org.jaudiotagger.tag.id3.ID3v24Frames"
] |
import org.jaudiotagger.tag.id3.ID3v24Frames;
|
import org.jaudiotagger.tag.id3.*;
|
[
"org.jaudiotagger.tag"
] |
org.jaudiotagger.tag;
| 1,596,482
|
public GridCoverageBuilder setValues(final DataBuffer data, Dimension size) {
ArgumentChecks.ensureNonNull("data", data);
if (size != null) {
size = new Dimension(size);
ArgumentChecks.ensureStrictlyPositive("width", size.width);
ArgumentChecks.ensureStrictlyPositive("height", size.height);
}
this.size = size;
buffer = data;
image = null;
raster = null;
return this;
}
/**
* Reverses axis direction in the specified grid dimension.
* For example if grid indices are (<var>column</var>, <var>row</var>),
* then {@code flipGridAxis(1)} will reverse the direction of rows axis.
* Invoking this method a second time for the same dimension will cancel the flipping.
*
* <p>When building coverage with a {@linkplain #setDomain(Envelope) domain specified by an envelope}
* (i.e. with no explicit <cite>grid to CRS</cite> transform), the default {@code GridCoverageBuilder}
|
GridCoverageBuilder function(final DataBuffer data, Dimension size) { ArgumentChecks.ensureNonNull("data", data); if (size != null) { size = new Dimension(size); ArgumentChecks.ensureStrictlyPositive("width", size.width); ArgumentChecks.ensureStrictlyPositive(STR, size.height); } this.size = size; buffer = data; image = null; raster = null; return this; } /** * Reverses axis direction in the specified grid dimension. * For example if grid indices are (<var>column</var>, <var>row</var>), * then {@code flipGridAxis(1)} will reverse the direction of rows axis. * Invoking this method a second time for the same dimension will cancel the flipping. * * <p>When building coverage with a {@linkplain #setDomain(Envelope) domain specified by an envelope} * (i.e. with no explicit <cite>grid to CRS</cite> transform), the default {@code GridCoverageBuilder}
|
/**
* Sets a two-dimensional slice of sample values as a Java2D data buffer.
* The {@linkplain DataBuffer#getNumBanks() number of banks} will be the number of bands in the image.
* If {@linkplain #setRanges(SampleDimension...) sample dimensions are specified}, then the number of
* bands must be equal to the number of sample dimensions.
*
* @param data the data buffer to be wrapped in a {@code GridCoverage}. Can not be {@code null}.
* @param size the image size in pixels, or {@code null} if unspecified. If null, then the image
* size will be taken from the {@linkplain GridGeometry#getExtent() grid extent}.
* @return {@code this} for method invocation chaining.
* @throws IllegalArgumentException if {@code width} or {@code height} is negative or equals to zero.
*/
|
Sets a two-dimensional slice of sample values as a Java2D data buffer. The DataBuffer#getNumBanks() number of banks will be the number of bands in the image. If #setRanges(SampleDimension...) sample dimensions are specified, then the number of bands must be equal to the number of sample dimensions
|
setValues
|
{
"repo_name": "apache/sis",
"path": "core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverageBuilder.java",
"license": "apache-2.0",
"size": 26534
}
|
[
"java.awt.Dimension",
"java.awt.image.DataBuffer",
"org.apache.sis.util.ArgumentChecks",
"org.opengis.geometry.Envelope"
] |
import java.awt.Dimension; import java.awt.image.DataBuffer; import org.apache.sis.util.ArgumentChecks; import org.opengis.geometry.Envelope;
|
import java.awt.*; import java.awt.image.*; import org.apache.sis.util.*; import org.opengis.geometry.*;
|
[
"java.awt",
"org.apache.sis",
"org.opengis.geometry"
] |
java.awt; org.apache.sis; org.opengis.geometry;
| 1,175,489
|
listenerList.add(SpanModelListener.class, listener);
}
|
listenerList.add(SpanModelListener.class, listener); }
|
/**
* Add listener to model
*/
|
Add listener to model
|
addSpanModelListener
|
{
"repo_name": "nextreports/nextreports-designer",
"path": "src/ro/nextreports/designer/grid/AbstractSpanModel.java",
"license": "apache-2.0",
"size": 4104
}
|
[
"ro.nextreports.designer.grid.event.SpanModelListener"
] |
import ro.nextreports.designer.grid.event.SpanModelListener;
|
import ro.nextreports.designer.grid.event.*;
|
[
"ro.nextreports.designer"
] |
ro.nextreports.designer;
| 2,568,929
|
public static Link buildConstraintLink(final Class<? extends ConstraintViolationException> clazz,
final ServletContext context,
final UriInfo uriInfo) {
String path = context.getContextPath();
if (path.equals("/")) {
path = "";
}
final String constraintURI = uriInfo == null ? "" : String.format("%s://%s%s%s%s.rdf",
uriInfo.getBaseUri().getScheme(), uriInfo.getBaseUri().getAuthority(), path,
CONSTRAINT_DIR, clazz.getName().substring(clazz.getName().lastIndexOf('.') + 1));
return Link.fromUri(constraintURI).rel(CONSTRAINED_BY.getURI()).build();
}
|
static Link function(final Class<? extends ConstraintViolationException> clazz, final ServletContext context, final UriInfo uriInfo) { String path = context.getContextPath(); if (path.equals("/")) { path = STRSTR%s: uriInfo.getBaseUri().getScheme(), uriInfo.getBaseUri().getAuthority(), path, CONSTRAINT_DIR, clazz.getName().substring(clazz.getName().lastIndexOf('.') + 1)); return Link.fromUri(constraintURI).rel(CONSTRAINED_BY.getURI()).build(); }
|
/**
* Creates a constrainedBy link header with the appropriate RDF URL for the exception.
*
* @param clazz the class of the exception to build the link for.
* @param context ServletContext ServletContext that we're running in.
* @param uriInfo UriInfo UriInfo from the ExceptionMapper.
* @return Link A http://www.w3.org/ns/ldp#constrainedBy link header
*/
|
Creates a constrainedBy link header with the appropriate RDF URL for the exception
|
buildConstraintLink
|
{
"repo_name": "whikloj/fcrepo4",
"path": "fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/exceptionhandlers/ConstraintExceptionMapper.java",
"license": "apache-2.0",
"size": 3383
}
|
[
"javax.servlet.ServletContext",
"javax.ws.rs.core.Link",
"javax.ws.rs.core.UriInfo",
"org.fcrepo.kernel.api.exception.ConstraintViolationException"
] |
import javax.servlet.ServletContext; import javax.ws.rs.core.Link; import javax.ws.rs.core.UriInfo; import org.fcrepo.kernel.api.exception.ConstraintViolationException;
|
import javax.servlet.*; import javax.ws.rs.core.*; import org.fcrepo.kernel.api.exception.*;
|
[
"javax.servlet",
"javax.ws",
"org.fcrepo.kernel"
] |
javax.servlet; javax.ws; org.fcrepo.kernel;
| 542,033
|
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<PrivateLinkResourceInner> list(String resourceGroupName, String clusterName, Context context) {
return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context));
}
|
@ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<PrivateLinkResourceInner> function(String resourceGroupName, String clusterName, Context context) { return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context)); }
|
/**
* Returns the list of private link resources.
*
* @param resourceGroupName The name of the resource group containing the Kusto cluster.
* @param clusterName The name of the Kusto cluster.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of private link resources as paginated response with {@link PagedIterable}.
*/
|
Returns the list of private link resources
|
list
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateLinkResourcesClientImpl.java",
"license": "mit",
"size": 21190
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedIterable",
"com.azure.core.util.Context",
"com.azure.resourcemanager.kusto.fluent.models.PrivateLinkResourceInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.resourcemanager.kusto.fluent.models.PrivateLinkResourceInner;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.kusto.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,731,055
|
public RegionScanner instantiateRegionScanner(Scan scan,
IndexScannerContext indexScannerContext) throws IOException {
List<KeyValueScanner> scanners = new ArrayList<KeyValueScanner>();
for (Map.Entry<byte[], NavigableSet<byte[]>> entry : scan
.getFamilyMap().entrySet()) {
Store store = region.getStores().get(entry.getKey());
StoreScanner scanner = store.getScanner(scan, entry.getValue());
scanners.add(scanner);
}
return new IndexedRegionScanner(scan, scanners, indexScannerContext);
}
|
RegionScanner function(Scan scan, IndexScannerContext indexScannerContext) throws IOException { List<KeyValueScanner> scanners = new ArrayList<KeyValueScanner>(); for (Map.Entry<byte[], NavigableSet<byte[]>> entry : scan .getFamilyMap().entrySet()) { Store store = region.getStores().get(entry.getKey()); StoreScanner scanner = store.getScanner(scan, entry.getValue()); scanners.add(scanner); } return new IndexedRegionScanner(scan, scanners, indexScannerContext); }
|
/**
* Instantiate a customized {@link RegionScanner}. StoreScanners are
* constructed outside of it.
*
* @param scan
* @param indexScannerContext
* @return
* @throws IOException
*/
|
Instantiate a customized <code>RegionScanner</code>. StoreScanners are constructed outside of it
|
instantiateRegionScanner
|
{
"repo_name": "danix800/hbase-indexed",
"path": "src/org/apache/hadoop/hbase/regionserver/IndexedHRegion.java",
"license": "apache-2.0",
"size": 23604
}
|
[
"java.io.IOException",
"java.util.ArrayList",
"java.util.List",
"java.util.Map",
"java.util.NavigableSet",
"org.apache.hadoop.hbase.client.Scan",
"org.apache.hadoop.hbase.regionserver.indexed.IndexScannerContext"
] |
import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.NavigableSet; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.regionserver.indexed.IndexScannerContext;
|
import java.io.*; import java.util.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.regionserver.indexed.*;
|
[
"java.io",
"java.util",
"org.apache.hadoop"
] |
java.io; java.util; org.apache.hadoop;
| 1,940,561
|
//
// JobExecution (only)
//
public JobExecutionEntity createJobExecution(long jobInstanceId, Properties jobParameters, Date createTime);
|
JobExecutionEntity function(long jobInstanceId, Properties jobParameters, Date createTime);
|
/**
* Creates new job execution.
*
* Responsible for making any necessary updates to instance as well.
*
* @param jobInstanceId
* @param jobParameters
* @param create time
* @return
*/
|
Creates new job execution. Responsible for making any necessary updates to instance as well
|
createJobExecution
|
{
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/services/IPersistenceManagerService.java",
"license": "epl-1.0",
"size": 24166
}
|
[
"com.ibm.jbatch.container.persistence.jpa.JobExecutionEntity",
"java.util.Date",
"java.util.Properties"
] |
import com.ibm.jbatch.container.persistence.jpa.JobExecutionEntity; import java.util.Date; import java.util.Properties;
|
import com.ibm.jbatch.container.persistence.jpa.*; import java.util.*;
|
[
"com.ibm.jbatch",
"java.util"
] |
com.ibm.jbatch; java.util;
| 412,780
|
public void listTablesSelected(){
int idxstorage = getListStorages().getSelectedIndex();
int idxtables = getListTables().getSelectedIndex();
if( idxstorage == -1 || idxtables == -1 )return;
String[][] preview = Controller.getInstance().getStorages().get(idxstorage).getPreviewForTable((String)getListTables().getSelectedValue(), 10);
DefaultTableModel dtm = (DefaultTableModel)getTablePreview().getModel();
dtm.setColumnCount(preview[0].length);
dtm.setRowCount(10);
for(int i=0;i<preview.length&&i<10;i++){
for(int j=0;j<preview[0].length;j++){
dtm.setValueAt(preview[i][j], i,j);
}
}
DefaultListModel dlm = (DefaultListModel)getListColumns().getModel();
dlm.clear();
for (int i=1;i<=preview[0].length;i++){
dlm.addElement("V"+i);
}
}
|
void function(){ int idxstorage = getListStorages().getSelectedIndex(); int idxtables = getListTables().getSelectedIndex(); if( idxstorage == -1 idxtables == -1 )return; String[][] preview = Controller.getInstance().getStorages().get(idxstorage).getPreviewForTable((String)getListTables().getSelectedValue(), 10); DefaultTableModel dtm = (DefaultTableModel)getTablePreview().getModel(); dtm.setColumnCount(preview[0].length); dtm.setRowCount(10); for(int i=0;i<preview.length&&i<10;i++){ for(int j=0;j<preview[0].length;j++){ dtm.setValueAt(preview[i][j], i,j); } } DefaultListModel dlm = (DefaultListModel)getListColumns().getModel(); dlm.clear(); for (int i=1;i<=preview[0].length;i++){ dlm.addElement("V"+i); } }
|
/**
* A table is selected, its columns are shown to the user.
*/
|
A table is selected, its columns are shown to the user
|
listTablesSelected
|
{
"repo_name": "alkida/bidal",
"path": "src/main/java/analyzer/ManageTablesWindow.java",
"license": "lgpl-3.0",
"size": 24760
}
|
[
"javax.swing.DefaultListModel",
"javax.swing.table.DefaultTableModel"
] |
import javax.swing.DefaultListModel; import javax.swing.table.DefaultTableModel;
|
import javax.swing.*; import javax.swing.table.*;
|
[
"javax.swing"
] |
javax.swing;
| 527,856
|
public Map<OperatorParameter, String> getOperatorArgumentsMap(){
if(arguments != null){
Map<OperatorParameter, String> map = new HashMap<OperatorParameter, String>();
for (Argument arg : arguments) {
if(arg.getOperatorName() != null){
map.put(arg.getOperatorName(), arg.getValue());
}
}
return map;
}
return null;
}
|
Map<OperatorParameter, String> function(){ if(arguments != null){ Map<OperatorParameter, String> map = new HashMap<OperatorParameter, String>(); for (Argument arg : arguments) { if(arg.getOperatorName() != null){ map.put(arg.getOperatorName(), arg.getValue()); } } return map; } return null; }
|
/**
* returns a map of all operator arguments
* @return map of all operator arguments or null if message doesn't contain operator arguments
*/
|
returns a map of all operator arguments
|
getOperatorArgumentsMap
|
{
"repo_name": "mwach/tactics",
"path": "src/main/java/itti/com/pl/eda/tactics/network/message/Message.java",
"license": "gpl-2.0",
"size": 9121
}
|
[
"java.util.HashMap",
"java.util.Map"
] |
import java.util.HashMap; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,042,025
|
public List<BackupInfo> getBackupHistoryForTable(TableName name) throws IOException {
List<BackupInfo> history = getBackupHistory();
List<BackupInfo> tableHistory = new ArrayList<BackupInfo>();
for (BackupInfo info : history) {
List<TableName> tables = info.getTableNames();
if (tables.contains(name)) {
tableHistory.add(info);
}
}
return tableHistory;
}
|
List<BackupInfo> function(TableName name) throws IOException { List<BackupInfo> history = getBackupHistory(); List<BackupInfo> tableHistory = new ArrayList<BackupInfo>(); for (BackupInfo info : history) { List<TableName> tables = info.getTableNames(); if (tables.contains(name)) { tableHistory.add(info); } } return tableHistory; }
|
/**
* Get history for a table
* @param name table name
* @return history for a table
* @throws IOException
*/
|
Get history for a table
|
getBackupHistoryForTable
|
{
"repo_name": "gustavoanatoly/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java",
"license": "apache-2.0",
"size": 67577
}
|
[
"java.io.IOException",
"java.util.ArrayList",
"java.util.List",
"org.apache.hadoop.hbase.TableName",
"org.apache.hadoop.hbase.backup.BackupInfo"
] |
import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.backup.BackupInfo;
|
import java.io.*; import java.util.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.backup.*;
|
[
"java.io",
"java.util",
"org.apache.hadoop"
] |
java.io; java.util; org.apache.hadoop;
| 1,075,206
|
private void updateEmitterLifeTime(ParticleEmitterComponent emitter, float delta) {
if (emitter.lifeTime != ParticleEmitterComponent.INDEFINITE_EMITTER_LIFETIME) {
emitter.lifeTime = Math.max(0, emitter.lifeTime - delta);
if (emitter.lifeTime == 0) {
emitter.enabled = false;
if (emitter.particlePool.deadParticles() == emitter.maxParticles) {
if (emitter.destroyEntityWhenDead) {
emitter.ownerEntity.destroy();
} else {
emitter.ownerEntity.removeComponent(ParticleEmitterComponent.class);
}
}
}
}
}
|
void function(ParticleEmitterComponent emitter, float delta) { if (emitter.lifeTime != ParticleEmitterComponent.INDEFINITE_EMITTER_LIFETIME) { emitter.lifeTime = Math.max(0, emitter.lifeTime - delta); if (emitter.lifeTime == 0) { emitter.enabled = false; if (emitter.particlePool.deadParticles() == emitter.maxParticles) { if (emitter.destroyEntityWhenDead) { emitter.ownerEntity.destroy(); } else { emitter.ownerEntity.removeComponent(ParticleEmitterComponent.class); } } } } }
|
/**
* Updates the particle emitters lifetime and disables or removes it potentially.
* In case the life time runs out, the emitter is disabled.
* In case no more particles in the pool are alive, the emitter is destroyed.
* @param emitter emitter to update
* @param delta delta time
*/
|
Updates the particle emitters lifetime and disables or removes it potentially. In case the life time runs out, the emitter is disabled. In case no more particles in the pool are alive, the emitter is destroyed
|
updateEmitterLifeTime
|
{
"repo_name": "Malanius/Terasology",
"path": "engine/src/main/java/org/terasology/particles/updating/ParticleUpdaterImpl.java",
"license": "apache-2.0",
"size": 15807
}
|
[
"org.terasology.particles.components.ParticleEmitterComponent"
] |
import org.terasology.particles.components.ParticleEmitterComponent;
|
import org.terasology.particles.components.*;
|
[
"org.terasology.particles"
] |
org.terasology.particles;
| 2,700,113
|
protected Concept attemptParseConcept(Node node) throws XPathExpressionException {
String urn = (String) DOMUtil.compileXPathExpr("@rdf:about", nc).evaluate(node, XPathConstants.STRING);
if (urn == null || urn.isEmpty()) {
return null;
}
//Build our concept/named individual
Concept concept = new Concept(urn);
concept.setLabel((String) DOMUtil.compileXPathExpr("rdfs:label", nc).evaluate(node, XPathConstants.STRING));
concept.setPreferredLabel((String) DOMUtil.compileXPathExpr("skos:prefLabel", nc).evaluate(node, XPathConstants.STRING));
concept.setDefinition((String) DOMUtil.compileXPathExpr("skos:definition", nc).evaluate(node, XPathConstants.STRING));
return concept;
}
|
Concept function(Node node) throws XPathExpressionException { String urn = (String) DOMUtil.compileXPathExpr(STR, nc).evaluate(node, XPathConstants.STRING); if (urn == null urn.isEmpty()) { return null; } Concept concept = new Concept(urn); concept.setLabel((String) DOMUtil.compileXPathExpr(STR, nc).evaluate(node, XPathConstants.STRING)); concept.setPreferredLabel((String) DOMUtil.compileXPathExpr(STR, nc).evaluate(node, XPathConstants.STRING)); concept.setDefinition((String) DOMUtil.compileXPathExpr(STR, nc).evaluate(node, XPathConstants.STRING)); return concept; }
|
/**
* Parses a skos:Concept element (ignoring any relations)
*
* If the specified node is missing requisite data null will be returned
*
* @param node an owl:NamedIndividual or skos:ConceptNode node
* @return
* @throws XPathExpressionException
*/
|
Parses a skos:Concept element (ignoring any relations) If the specified node is missing requisite data null will be returned
|
attemptParseConcept
|
{
"repo_name": "AuScope/ABIN-Portal",
"path": "src/main/java/org/auscope/portal/server/domain/vocab/ConceptFactory.java",
"license": "gpl-3.0",
"size": 7124
}
|
[
"javax.xml.xpath.XPathConstants",
"javax.xml.xpath.XPathExpressionException",
"org.auscope.portal.server.util.DOMUtil",
"org.w3c.dom.Node"
] |
import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import org.auscope.portal.server.util.DOMUtil; import org.w3c.dom.Node;
|
import javax.xml.xpath.*; import org.auscope.portal.server.util.*; import org.w3c.dom.*;
|
[
"javax.xml",
"org.auscope.portal",
"org.w3c.dom"
] |
javax.xml; org.auscope.portal; org.w3c.dom;
| 2,544,354
|
protected String getClassSignature(long classID) {
CommandPacket command = new CommandPacket(
JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
JDWPCommands.ReferenceTypeCommandSet.SignatureCommand);
command.setNextValueAsReferenceTypeID(classID);
ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(command);
checkReplyPacket(reply, "ReferenceType::Signature command");
String signature = reply.getNextValueAsString();
return signature;
}
|
String function(long classID) { CommandPacket command = new CommandPacket( JDWPCommands.ReferenceTypeCommandSet.CommandSetID, JDWPCommands.ReferenceTypeCommandSet.SignatureCommand); command.setNextValueAsReferenceTypeID(classID); ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(command); checkReplyPacket(reply, STR); String signature = reply.getNextValueAsString(); return signature; }
|
/**
* Returns jni signature for selected classID
*
* @param classID
* @return jni signature for selected classID
*/
|
Returns jni signature for selected classID
|
getClassSignature
|
{
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "external/apache-harmony/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/share/JDWPTestCase.java",
"license": "gpl-3.0",
"size": 31315
}
|
[
"org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket",
"org.apache.harmony.jpda.tests.framework.jdwp.JDWPCommands",
"org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket"
] |
import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; import org.apache.harmony.jpda.tests.framework.jdwp.JDWPCommands; import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket;
|
import org.apache.harmony.jpda.tests.framework.jdwp.*;
|
[
"org.apache.harmony"
] |
org.apache.harmony;
| 1,162,436
|
static long toBIO(PrivateKey key) throws Exception {
if (key == null) {
return 0;
}
ByteBufAllocator allocator = ByteBufAllocator.DEFAULT;
PemEncoded pem = PemPrivateKey.toPEM(allocator, true, key);
try {
return toBIO(allocator, pem.retain());
} finally {
pem.release();
}
}
|
static long toBIO(PrivateKey key) throws Exception { if (key == null) { return 0; } ByteBufAllocator allocator = ByteBufAllocator.DEFAULT; PemEncoded pem = PemPrivateKey.toPEM(allocator, true, key); try { return toBIO(allocator, pem.retain()); } finally { pem.release(); } }
|
/**
* Return the pointer to a <a href="https://www.openssl.org/docs/crypto/BIO_get_mem_ptr.html">in-memory BIO</a>
* or {@code 0} if the {@code key} is {@code null}. The BIO contains the content of the {@code key}.
*/
|
Return the pointer to a in-memory BIO or 0 if the key is null. The BIO contains the content of the key
|
toBIO
|
{
"repo_name": "KatsuraKKKK/netty",
"path": "handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java",
"license": "apache-2.0",
"size": 33607
}
|
[
"io.netty.buffer.ByteBufAllocator",
"java.security.PrivateKey"
] |
import io.netty.buffer.ByteBufAllocator; import java.security.PrivateKey;
|
import io.netty.buffer.*; import java.security.*;
|
[
"io.netty.buffer",
"java.security"
] |
io.netty.buffer; java.security;
| 2,067,812
|
void setRuntimeCamelCatalog(RuntimeCamelCatalog runtimeCamelCatalog);
|
void setRuntimeCamelCatalog(RuntimeCamelCatalog runtimeCamelCatalog);
|
/**
* Sets the {@link RuntimeCamelCatalog} to use.
*/
|
Sets the <code>RuntimeCamelCatalog</code> to use
|
setRuntimeCamelCatalog
|
{
"repo_name": "christophd/camel",
"path": "core/camel-api/src/main/java/org/apache/camel/ExtendedCamelContext.java",
"license": "apache-2.0",
"size": 29137
}
|
[
"org.apache.camel.catalog.RuntimeCamelCatalog"
] |
import org.apache.camel.catalog.RuntimeCamelCatalog;
|
import org.apache.camel.catalog.*;
|
[
"org.apache.camel"
] |
org.apache.camel;
| 2,479,427
|
public static EventCollection all(final Map<String, Object> params) throws EasyPostException {
return all(params, null);
}
|
static EventCollection function(final Map<String, Object> params) throws EasyPostException { return all(params, null); }
|
/**
* Get a list of Events.
*
* @param params A map of parameters to pass to the API.
* @return EventCollection object
* @throws EasyPostException when the request fails.
*/
|
Get a list of Events
|
all
|
{
"repo_name": "EasyPost/easypost-java",
"path": "src/main/java/com/easypost/model/Event.java",
"license": "mit",
"size": 3848
}
|
[
"com.easypost.exception.EasyPostException",
"java.util.Map"
] |
import com.easypost.exception.EasyPostException; import java.util.Map;
|
import com.easypost.exception.*; import java.util.*;
|
[
"com.easypost.exception",
"java.util"
] |
com.easypost.exception; java.util;
| 2,049,829
|
public Element getCompositeLabelTextElement() {
String fontSize = Integer.toString(App.prefs.getIntPref(PrefKey.CHART_COMPOSITE_PLOT_LABEL_FONT_SIZE, 10));
Text compositeLabelText = parent.getSVGDocument()
.createTextNode(App.prefs.getPref(PrefKey.CHART_COMPOSITE_LABEL_TEXT, "Composite"));
Element compositeLabelTextElement = parent.getSVGDocument().createElementNS(SVGDOMImplementation.SVG_NAMESPACE_URI, "text");
compositeLabelTextElement.setAttributeNS(null, "x", "0");
compositeLabelTextElement.setAttributeNS(null, "y", "0");
compositeLabelTextElement.setAttributeNS(null, "font-family", App.prefs.getPref(PrefKey.CHART_FONT_FAMILY, "Verdana"));
compositeLabelTextElement.setAttributeNS(null, "font-size", fontSize);
compositeLabelTextElement.appendChild(compositeLabelText);
return compositeLabelTextElement;
}
|
Element function() { String fontSize = Integer.toString(App.prefs.getIntPref(PrefKey.CHART_COMPOSITE_PLOT_LABEL_FONT_SIZE, 10)); Text compositeLabelText = parent.getSVGDocument() .createTextNode(App.prefs.getPref(PrefKey.CHART_COMPOSITE_LABEL_TEXT, STR)); Element compositeLabelTextElement = parent.getSVGDocument().createElementNS(SVGDOMImplementation.SVG_NAMESPACE_URI, "text"); compositeLabelTextElement.setAttributeNS(null, "x", "0"); compositeLabelTextElement.setAttributeNS(null, "y", "0"); compositeLabelTextElement.setAttributeNS(null, STR, App.prefs.getPref(PrefKey.CHART_FONT_FAMILY, STR)); compositeLabelTextElement.setAttributeNS(null, STR, fontSize); compositeLabelTextElement.appendChild(compositeLabelText); return compositeLabelTextElement; }
|
/**
* Returns a composite label text element based on the input parameters.
*
* @return compositeLabelTextElement
*/
|
Returns a composite label text element based on the input parameters
|
getCompositeLabelTextElement
|
{
"repo_name": "petebrew/fhaes",
"path": "fhaes/src/main/java/org/fhaes/neofhchart/svg/CompositePlotElementBuilder.java",
"license": "gpl-3.0",
"size": 7299
}
|
[
"org.apache.batik.dom.svg.SVGDOMImplementation",
"org.fhaes.preferences.App",
"org.fhaes.preferences.FHAESPreferences",
"org.w3c.dom.Element",
"org.w3c.dom.Text"
] |
import org.apache.batik.dom.svg.SVGDOMImplementation; import org.fhaes.preferences.App; import org.fhaes.preferences.FHAESPreferences; import org.w3c.dom.Element; import org.w3c.dom.Text;
|
import org.apache.batik.dom.svg.*; import org.fhaes.preferences.*; import org.w3c.dom.*;
|
[
"org.apache.batik",
"org.fhaes.preferences",
"org.w3c.dom"
] |
org.apache.batik; org.fhaes.preferences; org.w3c.dom;
| 2,470,715
|
public String translateStateMask(final int stateMask) {
StringBuilder sb = new StringBuilder();
appendStateToSBIfMatches(sb, stateMask, Bundle.RESOLVED, "RESOLVED");
appendStateToSBIfMatches(sb, stateMask, Bundle.STARTING, "STARTING");
appendStateToSBIfMatches(sb, stateMask, Bundle.ACTIVE, "ACTIVE");
appendStateToSBIfMatches(sb, stateMask, Bundle.STOPPING, "STOPPING");
return sb.toString();
}
|
String function(final int stateMask) { StringBuilder sb = new StringBuilder(); appendStateToSBIfMatches(sb, stateMask, Bundle.RESOLVED, STR); appendStateToSBIfMatches(sb, stateMask, Bundle.STARTING, STR); appendStateToSBIfMatches(sb, stateMask, Bundle.ACTIVE, STR); appendStateToSBIfMatches(sb, stateMask, Bundle.STOPPING, STR); return sb.toString(); }
|
/**
* Translates a Bundle stateMask to a human readable format. Only {@link Bundle#RESOLVED},
* {@link Bundle#STARTING}, {@link Bundle#ACTIVE} and {@link Bundle#STOPPING} states are
* translated.
*
* @param stateMask
* The stateMask of the Bundle.
* @return The {@link String} representation of the stateMask. E.g.: 'RESOLVED, STARTING'.
*/
|
Translates a Bundle stateMask to a human readable format. Only <code>Bundle#RESOLVED</code>, <code>Bundle#STARTING</code>, <code>Bundle#ACTIVE</code> and <code>Bundle#STOPPING</code> states are translated
|
translateStateMask
|
{
"repo_name": "zsigmond-czine-everit/ecm-component-webconsole",
"path": "src/main/java/org/everit/osgi/ecm/component/webconsole/TemplateUtil.java",
"license": "apache-2.0",
"size": 6646
}
|
[
"org.osgi.framework.Bundle"
] |
import org.osgi.framework.Bundle;
|
import org.osgi.framework.*;
|
[
"org.osgi.framework"
] |
org.osgi.framework;
| 1,135,320
|
public static void writeToFile(File file, byte[] content) throws IOException {
FileOutputStream fos = null;
try {
if (file == null) {
throw new FileNotFoundException("No file specified.");
} else if (!file.exists() && !file.getParentFile().exists() && !file.getParentFile().mkdirs()) {
throw new FileNotFoundException("Could not find or create file:" + file.getName());
}
fos = new FileOutputStream(file);
fos.write(content);
} finally {
Closeables.closeQuietly(fos);
}
}
|
static void function(File file, byte[] content) throws IOException { FileOutputStream fos = null; try { if (file == null) { throw new FileNotFoundException(STR); } else if (!file.exists() && !file.getParentFile().exists() && !file.getParentFile().mkdirs()) { throw new FileNotFoundException(STR + file.getName()); } fos = new FileOutputStream(file); fos.write(content); } finally { Closeables.closeQuietly(fos); } }
|
/**
* Writes {@link String} content to {@link File}.
*/
|
Writes <code>String</code> content to <code>File</code>
|
writeToFile
|
{
"repo_name": "rajdavies/fabric8",
"path": "components/fabric8-utils/src/main/java/io/fabric8/utils/Files.java",
"license": "apache-2.0",
"size": 19018
}
|
[
"java.io.File",
"java.io.FileNotFoundException",
"java.io.FileOutputStream",
"java.io.IOException"
] |
import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,522,559
|
void setAcceptListener(ChannelListener<? super C> listener);
class Setter<C extends Channel> implements ChannelListener.Setter<C> {
private final AcceptListenerSettable<C> settable;
public Setter(final AcceptListenerSettable<C> settable) {
this.settable = settable;
}
|
void setAcceptListener(ChannelListener<? super C> listener); class Setter<C extends Channel> implements ChannelListener.Setter<C> { private final AcceptListenerSettable<C> settable; public Setter(final AcceptListenerSettable<C> settable) { this.settable = settable; }
|
/**
* Set the accept listener.
*
* @param listener the accept listener
*/
|
Set the accept listener
|
setAcceptListener
|
{
"repo_name": "xnio/xnio",
"path": "api/src/main/java/org/xnio/channels/AcceptListenerSettable.java",
"license": "apache-2.0",
"size": 1976
}
|
[
"java.nio.channels.Channel",
"org.xnio.ChannelListener"
] |
import java.nio.channels.Channel; import org.xnio.ChannelListener;
|
import java.nio.channels.*; import org.xnio.*;
|
[
"java.nio",
"org.xnio"
] |
java.nio; org.xnio;
| 2,906,693
|
@Override
public void fromPNML(OMElement subRoot, IdRefLinker idr)
throws InnerBuildException, InvalidIDException, VoidRepositoryException;
|
void function(OMElement subRoot, IdRefLinker idr) throws InnerBuildException, InvalidIDException, VoidRepositoryException;
|
/**
* set values to conform PNML document
*/
|
set values to conform PNML document
|
fromPNML
|
{
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-PT-HLPNG/src/fr/lip6/move/pnml/pthlpng/integers/Subtraction.java",
"license": "epl-1.0",
"size": 2764
}
|
[
"fr.lip6.move.pnml.framework.utils.IdRefLinker",
"fr.lip6.move.pnml.framework.utils.exception.InnerBuildException",
"fr.lip6.move.pnml.framework.utils.exception.InvalidIDException",
"fr.lip6.move.pnml.framework.utils.exception.VoidRepositoryException",
"org.apache.axiom.om.OMElement"
] |
import fr.lip6.move.pnml.framework.utils.IdRefLinker; import fr.lip6.move.pnml.framework.utils.exception.InnerBuildException; import fr.lip6.move.pnml.framework.utils.exception.InvalidIDException; import fr.lip6.move.pnml.framework.utils.exception.VoidRepositoryException; import org.apache.axiom.om.OMElement;
|
import fr.lip6.move.pnml.framework.utils.*; import fr.lip6.move.pnml.framework.utils.exception.*; import org.apache.axiom.om.*;
|
[
"fr.lip6.move",
"org.apache.axiom"
] |
fr.lip6.move; org.apache.axiom;
| 301,598
|
public Collection setAttributes(URI configurationName, Collection datas, ClassLoader classLoader) throws InvalidConfigException;
|
Collection function(URI configurationName, Collection datas, ClassLoader classLoader) throws InvalidConfigException;
|
/**
* Given a conifguration name and a set of GBeanDatas, apply all the saved
* attribute values to those GBeans before the caller attempts to load
* them.
*
* @param configurationName The configuration in question
* @param datas The initial GBeanData's for all the GBeans in
* the configuration
* @param classLoader
* @return The modified GBeanData's
* @throws InvalidConfigException If something bad happens
*/
|
Given a conifguration name and a set of GBeanDatas, apply all the saved attribute values to those GBeans before the caller attempts to load them
|
setAttributes
|
{
"repo_name": "meetdestiny/geronimo-trader",
"path": "modules/kernel/src/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java",
"license": "apache-2.0",
"size": 5295
}
|
[
"java.util.Collection"
] |
import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 730,138
|
public DateTime lastSuccessfulTestFailoverTime() {
return this.lastSuccessfulTestFailoverTime;
}
|
DateTime function() { return this.lastSuccessfulTestFailoverTime; }
|
/**
* Get the Last successful test failover time.
*
* @return the lastSuccessfulTestFailoverTime value
*/
|
Get the Last successful test failover time
|
lastSuccessfulTestFailoverTime
|
{
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/recoveryservices.siterecovery/mgmt-v2018_01_10/src/main/java/com/microsoft/azure/management/recoveryservices/siterecovery/v2018_01_10/ReplicationProtectedItemProperties.java",
"license": "mit",
"size": 22062
}
|
[
"org.joda.time.DateTime"
] |
import org.joda.time.DateTime;
|
import org.joda.time.*;
|
[
"org.joda.time"
] |
org.joda.time;
| 1,678,388
|
public static CollectionReaderDescription createDescription(TypeSystemDescription tsd, File baseFileOrDirectory,
boolean recurse, CharacterEncoding encoding, String language, boolean disableProgress, int num2process,
int num2skip, String viewName, String... fileSuffixesToProcess) throws ResourceInitializationException {
return CollectionReaderFactory.createDescription(FileSystemCollectionReader.class, tsd, PARAM_BASE_FILE,
baseFileOrDirectory.getAbsolutePath(), PARAM_ENCODING, encoding.name(), PARAM_RECURSE, recurse,
PARAM_DISABLE_PROGRESS, disableProgress, PARAM_FILESUFFIXES_TO_PROCESS, fileSuffixesToProcess,
PARAM_LANGUAGE, language, PARAM_NUM2PROCESS, num2process, PARAM_NUM2SKIP, num2skip, PARAM_VIEWNAME,
viewName);
}
|
static CollectionReaderDescription function(TypeSystemDescription tsd, File baseFileOrDirectory, boolean recurse, CharacterEncoding encoding, String language, boolean disableProgress, int num2process, int num2skip, String viewName, String... fileSuffixesToProcess) throws ResourceInitializationException { return CollectionReaderFactory.createDescription(FileSystemCollectionReader.class, tsd, PARAM_BASE_FILE, baseFileOrDirectory.getAbsolutePath(), PARAM_ENCODING, encoding.name(), PARAM_RECURSE, recurse, PARAM_DISABLE_PROGRESS, disableProgress, PARAM_FILESUFFIXES_TO_PROCESS, fileSuffixesToProcess, PARAM_LANGUAGE, language, PARAM_NUM2PROCESS, num2process, PARAM_NUM2SKIP, num2skip, PARAM_VIEWNAME, viewName); }
|
/**
* This method creates a collection reader that uses the CcpDocumentMetadataHandler class by
* default
*
* @param tsd
* @param baseFileOrDirectory
* @param recurse
* @param encoding
* @param language
* @param disableProgress
* @param num2process
* @param num2skip
* @param viewName
* @param fileSuffixesToProcess
* @return
* @throws ResourceInitializationException
*/
|
This method creates a collection reader that uses the CcpDocumentMetadataHandler class by default
|
createDescription
|
{
"repo_name": "UCDenver-ccp/ccp-nlp",
"path": "ccp-nlp-uima-collections/src/main/java/edu/ucdenver/ccp/nlp/uima/collections/file/FileSystemCollectionReader.java",
"license": "bsd-3-clause",
"size": 11004
}
|
[
"edu.ucdenver.ccp.common.file.CharacterEncoding",
"java.io.File",
"org.apache.uima.collection.CollectionReaderDescription",
"org.apache.uima.fit.factory.CollectionReaderFactory",
"org.apache.uima.resource.ResourceInitializationException",
"org.apache.uima.resource.metadata.TypeSystemDescription"
] |
import edu.ucdenver.ccp.common.file.CharacterEncoding; import java.io.File; import org.apache.uima.collection.CollectionReaderDescription; import org.apache.uima.fit.factory.CollectionReaderFactory; import org.apache.uima.resource.ResourceInitializationException; import org.apache.uima.resource.metadata.TypeSystemDescription;
|
import edu.ucdenver.ccp.common.file.*; import java.io.*; import org.apache.uima.collection.*; import org.apache.uima.fit.factory.*; import org.apache.uima.resource.*; import org.apache.uima.resource.metadata.*;
|
[
"edu.ucdenver.ccp",
"java.io",
"org.apache.uima"
] |
edu.ucdenver.ccp; java.io; org.apache.uima;
| 1,175,234
|
public EvaluationRecord exec(){
validateConfig();
if(singleInput){
for(String param : this.evaluations.keySet()){
labelIndices.put(param, 0);
}
}
sd.evaluate(data, evaluations, labelIndices, listeners.toArray(new Listener[0]));
return new EvaluationRecord(evaluations);
}
|
EvaluationRecord function(){ validateConfig(); if(singleInput){ for(String param : this.evaluations.keySet()){ labelIndices.put(param, 0); } } sd.evaluate(data, evaluations, labelIndices, listeners.toArray(new Listener[0])); return new EvaluationRecord(evaluations); }
|
/**
* Run the evaluation.
*
* Note that the evaluations in the returned {@link EvaluationRecord} are the evaluations set using {@link #evaluate(String, int, IEvaluation[])},
* it does not matter which you use to access results.
*
* @return The specified listeners, in an {@link EvaluationRecord} for easy access.
*/
|
Run the evaluation. Note that the evaluations in the returned <code>EvaluationRecord</code> are the evaluations set using <code>#evaluate(String, int, IEvaluation[])</code>, it does not matter which you use to access results
|
exec
|
{
"repo_name": "deeplearning4j/deeplearning4j",
"path": "nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/config/EvaluationConfig.java",
"license": "apache-2.0",
"size": 6662
}
|
[
"org.nd4j.autodiff.listeners.Listener",
"org.nd4j.autodiff.listeners.records.EvaluationRecord"
] |
import org.nd4j.autodiff.listeners.Listener; import org.nd4j.autodiff.listeners.records.EvaluationRecord;
|
import org.nd4j.autodiff.listeners.*; import org.nd4j.autodiff.listeners.records.*;
|
[
"org.nd4j.autodiff"
] |
org.nd4j.autodiff;
| 2,765,399
|
public static short searchOpcode( String name ) {
name = name.toLowerCase(Locale.ENGLISH);
for (short i = 0; i < Const.OPCODE_NAMES_LENGTH; i++) {
if (Const.getOpcodeName(i).equals(name)) {
return i;
}
}
return -1;
}
|
static short function( String name ) { name = name.toLowerCase(Locale.ENGLISH); for (short i = 0; i < Const.OPCODE_NAMES_LENGTH; i++) { if (Const.getOpcodeName(i).equals(name)) { return i; } } return -1; }
|
/** Map opcode names to opcode numbers. E.g., return Constants.ALOAD for "aload"
*/
|
Map opcode names to opcode numbers. E.g., return Constants.ALOAD for "aload"
|
searchOpcode
|
{
"repo_name": "apache/commons-bcel",
"path": "src/main/java/org/apache/bcel/classfile/Utility.java",
"license": "apache-2.0",
"size": 64448
}
|
[
"java.util.Locale",
"org.apache.bcel.Const"
] |
import java.util.Locale; import org.apache.bcel.Const;
|
import java.util.*; import org.apache.bcel.*;
|
[
"java.util",
"org.apache.bcel"
] |
java.util; org.apache.bcel;
| 595,715
|
public static MinguoCalendar nowInSystemTime() {
return SystemClock.inLocalView().now(MinguoCalendar.axis());
}
|
static MinguoCalendar function() { return SystemClock.inLocalView().now(MinguoCalendar.axis()); }
|
/**
* <p>Obtains the current calendar date in system time. </p>
*
* <p>Convenient short-cut for: {@code SystemClock.inLocalView().now(MinguoCalendar.axis())}. </p>
*
* @return current calendar date in system time zone using the system clock
* @see SystemClock#inLocalView()
* @see net.time4j.ZonalClock#now(net.time4j.engine.Chronology)
* @since 3.23/4.19
*/
|
Obtains the current calendar date in system time. Convenient short-cut for: SystemClock.inLocalView().now(MinguoCalendar.axis()).
|
nowInSystemTime
|
{
"repo_name": "MenoData/Time4J",
"path": "base/src/main/java/net/time4j/calendar/MinguoCalendar.java",
"license": "lgpl-2.1",
"size": 37523
}
|
[
"net.time4j.SystemClock"
] |
import net.time4j.SystemClock;
|
import net.time4j.*;
|
[
"net.time4j"
] |
net.time4j;
| 19,173
|
public void noticeTimeout() {
if (!amRedeemed) {
amRedeemed = true;
myIssuer.removeReservation(this);
Trace.comm.eventi("expiring reservation " + myWho + "|" + myWhere +
"|" + myAuthCode);
}
}
|
void function() { if (!amRedeemed) { amRedeemed = true; myIssuer.removeReservation(this); Trace.comm.eventi(STR + myWho + " " + myWhere + " " + myAuthCode); } }
|
/**
* Handle reservation expiration.
*/
|
Handle reservation expiration
|
noticeTimeout
|
{
"repo_name": "frandallfarmer/Elko",
"path": "ServerCore/java/org/elkoserver/server/context/Reservation.java",
"license": "mit",
"size": 3811
}
|
[
"org.elkoserver.util.trace.Trace"
] |
import org.elkoserver.util.trace.Trace;
|
import org.elkoserver.util.trace.*;
|
[
"org.elkoserver.util"
] |
org.elkoserver.util;
| 676,551
|
@Test
public void testAutoCloseOnBookieFailure() throws Exception {
try (DurableDataLog log = createDurableDataLog()) {
log.initialize(TIMEOUT);
try {
// Suspend a bookie (this will trigger write errors).
stopFirstBookie();
// First write should fail. Either a DataLogNotAvailableException (insufficient bookies) or
// WriteFailureException (general unable to write) should be thrown.
AssertExtensions.assertSuppliedFutureThrows(
"First write did not fail with the appropriate exception.",
() -> log.append(new CompositeByteArraySegment(getWriteData()), TIMEOUT),
ex -> ex instanceof RetriesExhaustedException
&& (ex.getCause() instanceof DataLogNotAvailableException
|| isLedgerClosedException(ex.getCause()))
|| ex instanceof ObjectClosedException
|| ex instanceof CancellationException);
// Subsequent writes should be rejected since the BookKeeperLog is now closed.
AssertExtensions.assertSuppliedFutureThrows(
"Second write did not fail with the appropriate exception.",
() -> log.append(new CompositeByteArraySegment(getWriteData()), TIMEOUT),
ex -> ex instanceof ObjectClosedException
|| ex instanceof CancellationException);
} finally {
// Don't forget to resume the bookie.
restartFirstBookie();
}
}
}
|
void function() throws Exception { try (DurableDataLog log = createDurableDataLog()) { log.initialize(TIMEOUT); try { stopFirstBookie(); AssertExtensions.assertSuppliedFutureThrows( STR, () -> log.append(new CompositeByteArraySegment(getWriteData()), TIMEOUT), ex -> ex instanceof RetriesExhaustedException && (ex.getCause() instanceof DataLogNotAvailableException isLedgerClosedException(ex.getCause())) ex instanceof ObjectClosedException ex instanceof CancellationException); AssertExtensions.assertSuppliedFutureThrows( STR, () -> log.append(new CompositeByteArraySegment(getWriteData()), TIMEOUT), ex -> ex instanceof ObjectClosedException ex instanceof CancellationException); } finally { restartFirstBookie(); } } }
|
/**
* Tests the ability to auto-close upon a permanent write failure caused by BookKeeper.
*
* @throws Exception If one got thrown.
*/
|
Tests the ability to auto-close upon a permanent write failure caused by BookKeeper
|
testAutoCloseOnBookieFailure
|
{
"repo_name": "pravega/pravega",
"path": "segmentstore/storage/impl/src/test/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLogTests.java",
"license": "apache-2.0",
"size": 46311
}
|
[
"io.pravega.common.ObjectClosedException",
"io.pravega.common.util.CompositeByteArraySegment",
"io.pravega.common.util.RetriesExhaustedException",
"io.pravega.segmentstore.storage.DataLogNotAvailableException",
"io.pravega.segmentstore.storage.DurableDataLog",
"io.pravega.test.common.AssertExtensions",
"java.util.concurrent.CancellationException"
] |
import io.pravega.common.ObjectClosedException; import io.pravega.common.util.CompositeByteArraySegment; import io.pravega.common.util.RetriesExhaustedException; import io.pravega.segmentstore.storage.DataLogNotAvailableException; import io.pravega.segmentstore.storage.DurableDataLog; import io.pravega.test.common.AssertExtensions; import java.util.concurrent.CancellationException;
|
import io.pravega.common.*; import io.pravega.common.util.*; import io.pravega.segmentstore.storage.*; import io.pravega.test.common.*; import java.util.concurrent.*;
|
[
"io.pravega.common",
"io.pravega.segmentstore",
"io.pravega.test",
"java.util"
] |
io.pravega.common; io.pravega.segmentstore; io.pravega.test; java.util;
| 1,066,367
|
public static int addCoordinate(Connection con, CoordinatePK pk,
List<CoordinatePoint> coordinatePoints)
throws SQLException {
SilverTrace.info("coordinates", "CoordinatesDAO.addCoordinate()", "root.MSG_GEN_PARAM_VALUE",
"pk = " + pk.toString() + " and coordinatePoints = " + coordinatePoints.toString());
int coordinateId = getMaxCoordinateId(con, pk) + 1;
for (CoordinatePoint point : coordinatePoints) {
SilverTrace.info("coordinates", "CoordinatesDAO.addCoordinate()",
"root.MSG_GEN_PARAM_VALUE", "Try to insert point = "
+ point.toString());
addCoordinatePoint(con, pk, point, coordinateId);
SilverTrace.info("coordinates", "CoordinatesDAO.addCoordinate()",
"root.MSG_GEN_PARAM_VALUE", "insertion of point = "
+ point.toString() + " succeeded !");
}
return coordinateId;
}
|
static int function(Connection con, CoordinatePK pk, List<CoordinatePoint> coordinatePoints) throws SQLException { SilverTrace.info(STR, STR, STR, STR + pk.toString() + STR + coordinatePoints.toString()); int coordinateId = getMaxCoordinateId(con, pk) + 1; for (CoordinatePoint point : coordinatePoints) { SilverTrace.info(STR, STR, STR, STR + point.toString()); addCoordinatePoint(con, pk, point, coordinateId); SilverTrace.info(STR, STR, STR, STR + point.toString() + STR); } return coordinateId; }
|
/**
* Method declaration
* @param con
* @param pk
* @param coordinatePoints
* @return
* @throws SQLException
* @see
*/
|
Method declaration
|
addCoordinate
|
{
"repo_name": "stephaneperry/Silverpeas-Core",
"path": "ejb-core/node/src/main/java/com/stratelia/webactiv/util/coordinates/ejb/CoordinatesDAO.java",
"license": "agpl-3.0",
"size": 19647
}
|
[
"com.stratelia.silverpeas.silvertrace.SilverTrace",
"com.stratelia.webactiv.util.coordinates.model.CoordinatePK",
"com.stratelia.webactiv.util.coordinates.model.CoordinatePoint",
"java.sql.Connection",
"java.sql.SQLException",
"java.util.List"
] |
import com.stratelia.silverpeas.silvertrace.SilverTrace; import com.stratelia.webactiv.util.coordinates.model.CoordinatePK; import com.stratelia.webactiv.util.coordinates.model.CoordinatePoint; import java.sql.Connection; import java.sql.SQLException; import java.util.List;
|
import com.stratelia.silverpeas.silvertrace.*; import com.stratelia.webactiv.util.coordinates.model.*; import java.sql.*; import java.util.*;
|
[
"com.stratelia.silverpeas",
"com.stratelia.webactiv",
"java.sql",
"java.util"
] |
com.stratelia.silverpeas; com.stratelia.webactiv; java.sql; java.util;
| 51,352
|
public void setIdentifierTypeSubFieldMapperService(
IdentifierTypeSubFieldMapperService identifierTypeSubFieldMapperService) {
this.identifierTypeSubFieldMapperService = identifierTypeSubFieldMapperService;
}
|
void function( IdentifierTypeSubFieldMapperService identifierTypeSubFieldMapperService) { this.identifierTypeSubFieldMapperService = identifierTypeSubFieldMapperService; }
|
/**
* Set the identifier type sub field mapper service.
*
* @param identifierTypeSubFieldMapperService
*/
|
Set the identifier type sub field mapper service
|
setIdentifierTypeSubFieldMapperService
|
{
"repo_name": "nate-rcl/irplus",
"path": "ir_service/src/edu/ur/ir/oai/metadata/provider/service/DefaultMarcExportService.java",
"license": "apache-2.0",
"size": 33477
}
|
[
"edu.ur.ir.item.metadata.marc.IdentifierTypeSubFieldMapperService"
] |
import edu.ur.ir.item.metadata.marc.IdentifierTypeSubFieldMapperService;
|
import edu.ur.ir.item.metadata.marc.*;
|
[
"edu.ur.ir"
] |
edu.ur.ir;
| 1,005,398
|
protected void processRequest(final DatagramSocket s, final DatagramPacket packetIn) {
try {
// check client
final InetSocketAddress localAddress = (InetSocketAddress) s.getLocalSocketAddress();
final InetSocketAddress remoteAddress = new InetSocketAddress(packetIn.getAddress(), packetIn.getPort());
final String secret = getSharedSecret(remoteAddress, makeRadiusPacket(packetIn, "1234567890", RadiusPacket.RESERVED));
if (secret == null) {
if (logger.isInfoEnabled())
logger.info("ignoring packet from unknown client " + remoteAddress + " received on local address " + localAddress);
return;
}
// parse packet
final RadiusPacket request = makeRadiusPacket(packetIn, secret, RadiusPacket.UNDEFINED);
if (logger.isInfoEnabled())
logger.info("received packet from " + remoteAddress + " on local address " + localAddress + ": " + request);
// handle packet
logger.trace("about to call RadiusServer.handlePacket()");
final RadiusPacket response = handlePacket(localAddress, remoteAddress, request, secret);
// send response
if (response != null) {
if (logger.isInfoEnabled())
logger.info("send response: " + response);
final DatagramPacket packetOut = makeDatagramPacket(response, secret, remoteAddress.getAddress(), packetIn.getPort(), request);
s.send(packetOut);
}
else
logger.info("no response sent");
}
catch (IOException ioe) {
// error while reading/writing socket
logger.error("communication error", ioe);
}
catch (RadiusException re) {
// malformed packet
logger.error("malformed Radius packet", re);
}
}
|
void function(final DatagramSocket s, final DatagramPacket packetIn) { try { final InetSocketAddress localAddress = (InetSocketAddress) s.getLocalSocketAddress(); final InetSocketAddress remoteAddress = new InetSocketAddress(packetIn.getAddress(), packetIn.getPort()); final String secret = getSharedSecret(remoteAddress, makeRadiusPacket(packetIn, STR, RadiusPacket.RESERVED)); if (secret == null) { if (logger.isInfoEnabled()) logger.info(STR + remoteAddress + STR + localAddress); return; } final RadiusPacket request = makeRadiusPacket(packetIn, secret, RadiusPacket.UNDEFINED); if (logger.isInfoEnabled()) logger.info(STR + remoteAddress + STR + localAddress + STR + request); logger.trace(STR); final RadiusPacket response = handlePacket(localAddress, remoteAddress, request, secret); if (response != null) { if (logger.isInfoEnabled()) logger.info(STR + response); final DatagramPacket packetOut = makeDatagramPacket(response, secret, remoteAddress.getAddress(), packetIn.getPort(), request); s.send(packetOut); } else logger.info(STR); } catch (IOException ioe) { logger.error(STR, ioe); } catch (RadiusException re) { logger.error(STR, re); } }
|
/**
* Process a single received request
*
* @param s
* socket to send response on
* @param packetIn
* data packet
*/
|
Process a single received request
|
processRequest
|
{
"repo_name": "talkincode/ToughRADIUS",
"path": "src/main/java/org/tinyradius/util/RadiusServer.java",
"license": "lgpl-3.0",
"size": 19211
}
|
[
"java.io.IOException",
"java.net.DatagramPacket",
"java.net.DatagramSocket",
"java.net.InetSocketAddress",
"org.tinyradius.packet.RadiusPacket"
] |
import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetSocketAddress; import org.tinyradius.packet.RadiusPacket;
|
import java.io.*; import java.net.*; import org.tinyradius.packet.*;
|
[
"java.io",
"java.net",
"org.tinyradius.packet"
] |
java.io; java.net; org.tinyradius.packet;
| 1,233,346
|
public Object insertToolContent(String id, String toolId, Properties reqProps);
|
Object function(String id, String toolId, Properties reqProps);
|
/**
* insert lti tool content
* @param id
* @param toolId
* @param reqProps
* @return
*/
|
insert lti tool content
|
insertToolContent
|
{
"repo_name": "udayg/sakai",
"path": "basiclti/basiclti-api/src/java/org/sakaiproject/lti/api/LTIService.java",
"license": "apache-2.0",
"size": 24047
}
|
[
"java.util.Properties"
] |
import java.util.Properties;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,282,001
|
protected void attachAdditionalDocumentFields(Product product, SolrInputDocument document) {
//Empty implementation. Placeholder for others to extend and add additional fields
}
|
void function(Product product, SolrInputDocument document) { }
|
/**
* Implementors can extend this and override this method to add additional fields to the Solr document.
*
* @param product
* @param document
*/
|
Implementors can extend this and override this method to add additional fields to the Solr document
|
attachAdditionalDocumentFields
|
{
"repo_name": "takbani/blcdemo",
"path": "core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrIndexServiceImpl.java",
"license": "apache-2.0",
"size": 39983
}
|
[
"org.apache.solr.common.SolrInputDocument",
"org.broadleafcommerce.core.catalog.domain.Product"
] |
import org.apache.solr.common.SolrInputDocument; import org.broadleafcommerce.core.catalog.domain.Product;
|
import org.apache.solr.common.*; import org.broadleafcommerce.core.catalog.domain.*;
|
[
"org.apache.solr",
"org.broadleafcommerce.core"
] |
org.apache.solr; org.broadleafcommerce.core;
| 660,233
|
@Override
protected void addGlobalActions(IMenuManager menuManager) {
menuManager.insertAfter("additions-end", new Separator("ui-actions"));
menuManager.insertAfter("ui-actions", showPropertiesViewAction);
refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
menuManager.insertAfter("ui-actions", refreshViewerAction);
super.addGlobalActions(menuManager);
}
|
void function(IMenuManager menuManager) { menuManager.insertAfter(STR, new Separator(STR)); menuManager.insertAfter(STR, showPropertiesViewAction); refreshViewerAction.setEnabled(refreshViewerAction.isEnabled()); menuManager.insertAfter(STR, refreshViewerAction); super.addGlobalActions(menuManager); }
|
/**
* This inserts global actions before the "additions-end" separator.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
This inserts global actions before the "additions-end" separator.
|
addGlobalActions
|
{
"repo_name": "KAMP-Research/KAMP",
"path": "bundles/Toometa/de.uka.ipd.sdq.dsexplore.qml.contracttype.editor/src/de/uka/ipd/sdq/dsexplore/qml/contracttype/presentation/QMLContractTypeActionBarContributor.java",
"license": "apache-2.0",
"size": 14121
}
|
[
"org.eclipse.jface.action.IMenuManager",
"org.eclipse.jface.action.Separator"
] |
import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.Separator;
|
import org.eclipse.jface.action.*;
|
[
"org.eclipse.jface"
] |
org.eclipse.jface;
| 77,512
|
public void addSystemEnvironment()
{
Properties systemEnvVars = CommandLineUtils.getSystemEnvVars();
for ( Object o : systemEnvVars.keySet() )
{
String key = (String) o;
if ( !envVars.containsKey( key ) )
{
addEnvironment( key, systemEnvVars.getProperty( key ) );
}
}
}
|
void function() { Properties systemEnvVars = CommandLineUtils.getSystemEnvVars(); for ( Object o : systemEnvVars.keySet() ) { String key = (String) o; if ( !envVars.containsKey( key ) ) { addEnvironment( key, systemEnvVars.getProperty( key ) ); } } }
|
/**
* Add system environment variables
*/
|
Add system environment variables
|
addSystemEnvironment
|
{
"repo_name": "Reissner/maven-latex-plugin",
"path": "maven-latex-plugin/src/main/java/org/codehaus/plexus/util/cli/Commandline.java",
"license": "apache-2.0",
"size": 23162
}
|
[
"java.util.Properties"
] |
import java.util.Properties;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,002,508
|
@Generated(hash = 713229351)
public void update() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.update(this);
}
|
@Generated(hash = 713229351) void function() { if (myDao == null) { throw new DaoException(STR); } myDao.update(this); }
|
/**
* Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
* Entity must attached to an entity context.
*/
|
Convenient call for <code>org.greenrobot.greendao.AbstractDao#update(Object)</code>. Entity must attached to an entity context
|
update
|
{
"repo_name": "hisab-app/hisab-android",
"path": "app/src/main/java/io/github/zkhan93/hisab/model/notification/LocalGroup.java",
"license": "gpl-3.0",
"size": 3977
}
|
[
"org.greenrobot.greendao.DaoException",
"org.greenrobot.greendao.annotation.Generated"
] |
import org.greenrobot.greendao.DaoException; import org.greenrobot.greendao.annotation.Generated;
|
import org.greenrobot.greendao.*; import org.greenrobot.greendao.annotation.*;
|
[
"org.greenrobot.greendao"
] |
org.greenrobot.greendao;
| 1,500,182
|
@FIXVersion(introduced = "4.4")
@TagNumRef(tagNum = TagNum.SettlInstSource)
public SettlInstSource getSettlInstSource() {
return settlInstSource;
}
|
@FIXVersion(introduced = "4.4") @TagNumRef(tagNum = TagNum.SettlInstSource) SettlInstSource function() { return settlInstSource; }
|
/**
* Message field getter.
* @return field value
*/
|
Message field getter
|
getSettlInstSource
|
{
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/group/DeliveryInstructionGroup.java",
"license": "gpl-3.0",
"size": 11975
}
|
[
"net.hades.fix.message.anno.FIXVersion",
"net.hades.fix.message.anno.TagNumRef",
"net.hades.fix.message.type.SettlInstSource",
"net.hades.fix.message.type.TagNum"
] |
import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.SettlInstSource; import net.hades.fix.message.type.TagNum;
|
import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*;
|
[
"net.hades.fix"
] |
net.hades.fix;
| 44,005
|
Long lrange(ValueStreamingChannel<V> channel, K key, long start, long stop);
|
Long lrange(ValueStreamingChannel<V> channel, K key, long start, long stop);
|
/**
* Get a range of elements from a list.
*
* @param channel the channel.
* @param key the key.
* @param start the start type: long.
* @param stop the stop type: long.
* @return Long count of elements in the specified range.
*/
|
Get a range of elements from a list
|
lrange
|
{
"repo_name": "mp911de/lettuce",
"path": "src/main/templates/io/lettuce/core/api/RedisListCommands.java",
"license": "apache-2.0",
"size": 10011
}
|
[
"io.lettuce.core.output.ValueStreamingChannel"
] |
import io.lettuce.core.output.ValueStreamingChannel;
|
import io.lettuce.core.output.*;
|
[
"io.lettuce.core"
] |
io.lettuce.core;
| 1,165,453
|
private static void setTaskFailureException(Collection<TaskState> taskStates, Throwable t) {
for (TaskState taskState : taskStates) {
taskState.setTaskFailureException(t);
}
}
|
static void function(Collection<TaskState> taskStates, Throwable t) { for (TaskState taskState : taskStates) { taskState.setTaskFailureException(t); } }
|
/**
* Sets the {@link ConfigurationKeys#TASK_FAILURE_EXCEPTION_KEY} for each given {@link TaskState} to the given
* {@link Throwable}.
*/
|
Sets the <code>ConfigurationKeys#TASK_FAILURE_EXCEPTION_KEY</code> for each given <code>TaskState</code> to the given <code>Throwable</code>
|
setTaskFailureException
|
{
"repo_name": "ydai1124/gobblin-1",
"path": "gobblin-runtime/src/main/java/gobblin/runtime/SafeDatasetCommit.java",
"license": "apache-2.0",
"size": 16022
}
|
[
"java.util.Collection"
] |
import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 499,813
|
private static String jsonNodeToString(JsonNode jsonNode, ApiVersionBean apiVersion) {
String prettifiedSwaggerDefinition = null;
try {
if (apiVersion.getDefinitionType() == ApiDefinitionType.SwaggerJSON) {
prettifiedSwaggerDefinition = new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(jsonNode);
} else if (apiVersion.getDefinitionType() == ApiDefinitionType.SwaggerYAML) {
prettifiedSwaggerDefinition = new YAMLMapper().writerWithDefaultPrettyPrinter().writeValueAsString(jsonNode);
}
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return prettifiedSwaggerDefinition;
}
|
static String function(JsonNode jsonNode, ApiVersionBean apiVersion) { String prettifiedSwaggerDefinition = null; try { if (apiVersion.getDefinitionType() == ApiDefinitionType.SwaggerJSON) { prettifiedSwaggerDefinition = new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(jsonNode); } else if (apiVersion.getDefinitionType() == ApiDefinitionType.SwaggerYAML) { prettifiedSwaggerDefinition = new YAMLMapper().writerWithDefaultPrettyPrinter().writeValueAsString(jsonNode); } } catch (JsonProcessingException e) { e.printStackTrace(); } return prettifiedSwaggerDefinition; }
|
/**
* Transforms a jsonNode to a prettified json or yaml string depending on the api definition type
*
* @param jsonNode jsonNode to prettify
* @param apiVersion apiVersion to determine the definition type
* @return prettified swagger definition as yaml or json string
*/
|
Transforms a jsonNode to a prettified json or yaml string depending on the api definition type
|
jsonNodeToString
|
{
"repo_name": "apiman/apiman",
"path": "manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/SwaggerWsdlHelper.java",
"license": "apache-2.0",
"size": 10073
}
|
[
"com.fasterxml.jackson.core.JsonProcessingException",
"com.fasterxml.jackson.databind.JsonNode",
"com.fasterxml.jackson.databind.ObjectMapper",
"com.fasterxml.jackson.dataformat.yaml.YAMLMapper",
"io.apiman.manager.api.beans.apis.ApiDefinitionType",
"io.apiman.manager.api.beans.apis.ApiVersionBean"
] |
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import io.apiman.manager.api.beans.apis.ApiDefinitionType; import io.apiman.manager.api.beans.apis.ApiVersionBean;
|
import com.fasterxml.jackson.core.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.dataformat.yaml.*; import io.apiman.manager.api.beans.apis.*;
|
[
"com.fasterxml.jackson",
"io.apiman.manager"
] |
com.fasterxml.jackson; io.apiman.manager;
| 1,150,931
|
protected int parse(BufferedReader breader, TestElement el, int parseCount) {
int actualCount = 0;
String line = null;
try {
// read one line at a time using
// BufferedReader
line = breader.readLine();
while (line != null) {
if (line.length() > 0) {
actualCount += this.parseLine(line, el);
}
// we check the count to see if we have exceeded
// the number of lines to parse. There's no way
// to know where to stop in the file. Therefore
// we use break to escape the while loop when
// we've reached the count.
if (parseCount != -1 && actualCount >= parseCount) {
break;
}
line = breader.readLine();
}
if (line == null) {
breader.close();
this.READER = null;
}
} catch (IOException ioe) {
log.error("Error reading log file", ioe);
}
return actualCount;
}
|
int function(BufferedReader breader, TestElement el, int parseCount) { int actualCount = 0; String line = null; try { line = breader.readLine(); while (line != null) { if (line.length() > 0) { actualCount += this.parseLine(line, el); } if (parseCount != -1 && actualCount >= parseCount) { break; } line = breader.readLine(); } if (line == null) { breader.close(); this.READER = null; } } catch (IOException ioe) { log.error(STR, ioe); } return actualCount; }
|
/**
* The method is responsible for reading each line, and breaking out of the
* while loop if a set number of lines is given.<br>
* Note: empty lines will not be counted
*
* @param breader {@link BufferedReader} to read lines from
* @param el {@link TestElement} to read lines into
* @param parseCount number of lines to read
* @return number of lines parsed
*/
|
The method is responsible for reading each line, and breaking out of the while loop if a set number of lines is given. Note: empty lines will not be counted
|
parse
|
{
"repo_name": "max3163/jmeter",
"path": "src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/TCLogParser.java",
"license": "apache-2.0",
"size": 20425
}
|
[
"java.io.BufferedReader",
"java.io.IOException",
"org.apache.jmeter.testelement.TestElement"
] |
import java.io.BufferedReader; import java.io.IOException; import org.apache.jmeter.testelement.TestElement;
|
import java.io.*; import org.apache.jmeter.testelement.*;
|
[
"java.io",
"org.apache.jmeter"
] |
java.io; org.apache.jmeter;
| 2,181,054
|
public int getState() throws RemoteException, MonitorException {
return msm.getState(cookie);
}
|
int function() throws RemoteException, MonitorException { return msm.getState(cookie); }
|
/**
* Providers use this method to find the state of this session
*
* @throws MonitorException
* 1) If there is no such session
*
* @throws RemoteException
* if there is a communication error
**/
|
Providers use this method to find the state of this session
|
getState
|
{
"repo_name": "s13372/SORCER",
"path": "core/sorcer-platform/src/main/java/sorcer/core/monitor/MonitorableSession.java",
"license": "apache-2.0",
"size": 7660
}
|
[
"java.rmi.RemoteException"
] |
import java.rmi.RemoteException;
|
import java.rmi.*;
|
[
"java.rmi"
] |
java.rmi;
| 2,107,140
|
@ApiModelProperty(value = "")
public List<String> getSupportedWesVersions() {
return supportedWesVersions;
}
|
@ApiModelProperty(value = "") List<String> function() { return supportedWesVersions; }
|
/**
* Get supportedWesVersions
* @return supportedWesVersions
**/
|
Get supportedWesVersions
|
getSupportedWesVersions
|
{
"repo_name": "Consonance/consonance",
"path": "swagger-ga4gh-client/src/main/java/io/swagger/client/model/Ga4ghWesServiceInfo.java",
"license": "gpl-3.0",
"size": 9188
}
|
[
"io.swagger.annotations.ApiModelProperty",
"java.util.List"
] |
import io.swagger.annotations.ApiModelProperty; import java.util.List;
|
import io.swagger.annotations.*; import java.util.*;
|
[
"io.swagger.annotations",
"java.util"
] |
io.swagger.annotations; java.util;
| 464,682
|
@Deprecated
@RequestMapping(value = "/transactionList", method = RequestMethod.GET)
@ResponseBody
public Model getBusinessTransactionsData(Model model,
@RequestParam("application") String applicationName,
@RequestParam("from") long from,
@RequestParam("to") long to,
@RequestParam(value = "filter", required = false) String filterText,
@RequestParam(value = "limit", required = false, defaultValue = "10000") int limit) {
limit = LimitUtils.checkRange(limit);
Range range = new Range(from, to);
// TODO more refactoring needed: partially separated out server map lookup logic.
LimitedScanResult<List<TransactionId>> traceIdList = filteredMapService.selectTraceIdsFromApplicationTraceIndex(applicationName, range, limit);
Filter filter = filterBuilder.build(filterText);
BusinessTransactions selectBusinessTransactions = transactionInfoService.selectBusinessTransactions(traceIdList.getScanData(), applicationName, range, filter);
model.addAttribute("lastFetchedTimestamp", traceIdList.getLimitedTime());
model.addAttribute("rpcList", selectBusinessTransactions.getBusinessTransaction());
model.addAttribute("requestList", selectBusinessTransactions.getBusinessTransaction());
model.addAttribute("scatterList", selectBusinessTransactions.getBusinessTransaction());
model.addAttribute("applicationName", applicationName);
model.addAttribute("from", new Date(from));
model.addAttribute("to", new Date(to));
model.addAttribute("urlCount", selectBusinessTransactions.getURLCount());
model.addAttribute("totalCount", selectBusinessTransactions.getTotalCallCount());
model.addAttribute("filterText", filterText);
model.addAttribute("filter", filter);
// Deprecated jsp -> need json dump
return model;
}
|
@RequestMapping(value = STR, method = RequestMethod.GET) Model function(Model model, @RequestParam(STR) String applicationName, @RequestParam("from") long from, @RequestParam("to") long to, @RequestParam(value = STR, required = false) String filterText, @RequestParam(value = "limit", required = false, defaultValue = "10000") int limit) { limit = LimitUtils.checkRange(limit); Range range = new Range(from, to); LimitedScanResult<List<TransactionId>> traceIdList = filteredMapService.selectTraceIdsFromApplicationTraceIndex(applicationName, range, limit); Filter filter = filterBuilder.build(filterText); BusinessTransactions selectBusinessTransactions = transactionInfoService.selectBusinessTransactions(traceIdList.getScanData(), applicationName, range, filter); model.addAttribute(STR, traceIdList.getLimitedTime()); model.addAttribute(STR, selectBusinessTransactions.getBusinessTransaction()); model.addAttribute(STR, selectBusinessTransactions.getBusinessTransaction()); model.addAttribute(STR, selectBusinessTransactions.getBusinessTransaction()); model.addAttribute(STR, applicationName); model.addAttribute("from", new Date(from)); model.addAttribute("to", new Date(to)); model.addAttribute(STR, selectBusinessTransactions.getURLCount()); model.addAttribute(STR, selectBusinessTransactions.getTotalCallCount()); model.addAttribute(STR, filterText); model.addAttribute(STR, filter); return model; }
|
/**
* executed URLs in applicationname query within from ~ to timeframe
*
* @param model
* @param applicationName
* @param from
* @param to
* @return
*/
|
executed URLs in applicationname query within from ~ to timeframe
|
getBusinessTransactionsData
|
{
"repo_name": "KRDeNaT/pinpoint",
"path": "web/src/main/java/com/navercorp/pinpoint/web/controller/BusinessTransactionController.java",
"license": "apache-2.0",
"size": 9762
}
|
[
"com.navercorp.pinpoint.web.filter.Filter",
"com.navercorp.pinpoint.web.util.LimitUtils",
"com.navercorp.pinpoint.web.vo.BusinessTransactions",
"com.navercorp.pinpoint.web.vo.LimitedScanResult",
"com.navercorp.pinpoint.web.vo.Range",
"com.navercorp.pinpoint.web.vo.TransactionId",
"java.util.Date",
"java.util.List",
"org.springframework.ui.Model",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestMethod",
"org.springframework.web.bind.annotation.RequestParam"
] |
import com.navercorp.pinpoint.web.filter.Filter; import com.navercorp.pinpoint.web.util.LimitUtils; import com.navercorp.pinpoint.web.vo.BusinessTransactions; import com.navercorp.pinpoint.web.vo.LimitedScanResult; import com.navercorp.pinpoint.web.vo.Range; import com.navercorp.pinpoint.web.vo.TransactionId; import java.util.Date; import java.util.List; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam;
|
import com.navercorp.pinpoint.web.filter.*; import com.navercorp.pinpoint.web.util.*; import com.navercorp.pinpoint.web.vo.*; import java.util.*; import org.springframework.ui.*; import org.springframework.web.bind.annotation.*;
|
[
"com.navercorp.pinpoint",
"java.util",
"org.springframework.ui",
"org.springframework.web"
] |
com.navercorp.pinpoint; java.util; org.springframework.ui; org.springframework.web;
| 2,883,551
|
private void updateFramePadding() {
Resources r = getContext().getResources();
int frameMargin = r.getDimensionPixelSize(R.dimen.md_dialog_frame_margin);
View contentScrollView = view.findViewById(R.id.contentScrollView);
int paddingTop = contentScrollView.getPaddingTop();
int paddingBottom = contentScrollView.getPaddingBottom();
if (!hasActionButtons())
paddingBottom = frameMargin;
if (titleFrame.getVisibility() == View.GONE)
paddingTop = frameMargin;
contentScrollView.setPadding(contentScrollView.getPaddingLeft(), paddingTop,
contentScrollView.getPaddingRight(), paddingBottom);
if (listView != null) {
// Padding below title is reduced for divider.
final int titlePaddingBottom = (int) mBuilder.context.getResources().getDimension(R.dimen.md_title_frame_margin_bottom_list);
titleFrame.setPadding(titleFrame.getPaddingLeft(),
titleFrame.getPaddingTop(),
titleFrame.getPaddingRight(),
titlePaddingBottom);
}
}
|
void function() { Resources r = getContext().getResources(); int frameMargin = r.getDimensionPixelSize(R.dimen.md_dialog_frame_margin); View contentScrollView = view.findViewById(R.id.contentScrollView); int paddingTop = contentScrollView.getPaddingTop(); int paddingBottom = contentScrollView.getPaddingBottom(); if (!hasActionButtons()) paddingBottom = frameMargin; if (titleFrame.getVisibility() == View.GONE) paddingTop = frameMargin; contentScrollView.setPadding(contentScrollView.getPaddingLeft(), paddingTop, contentScrollView.getPaddingRight(), paddingBottom); if (listView != null) { final int titlePaddingBottom = (int) mBuilder.context.getResources().getDimension(R.dimen.md_title_frame_margin_bottom_list); titleFrame.setPadding(titleFrame.getPaddingLeft(), titleFrame.getPaddingTop(), titleFrame.getPaddingRight(), titlePaddingBottom); } }
|
/**
* To account for scrolling content and overscroll glows, the frame padding/margins sometimes
* must be set on inner views. This is dependent on the visibility of the title bar and action
* buttons. This method determines where the padding or margins are needed and applies them.
*/
|
To account for scrolling content and overscroll glows, the frame padding/margins sometimes must be set on inner views. This is dependent on the visibility of the title bar and action buttons. This method determines where the padding or margins are needed and applies them
|
updateFramePadding
|
{
"repo_name": "simarpreetsingharora/puautologin",
"path": "library/src/main/java/com/afollestad/materialdialogs/MaterialDialog.java",
"license": "gpl-3.0",
"size": 73849
}
|
[
"android.content.res.Resources",
"android.view.View"
] |
import android.content.res.Resources; import android.view.View;
|
import android.content.res.*; import android.view.*;
|
[
"android.content",
"android.view"
] |
android.content; android.view;
| 1,409,347
|
private void setStartButtonEnable(boolean bEnable) {
Message msg = mAutoTestHandler
.obtainMessage(YgpsActivity.HANDLE_START_BUTTON_UPDATE);
msg.arg1 = bEnable ? MESSAGE_ARG_1 : MESSAGE_ARG_0;
mAutoTestHandler.sendMessage(msg);
}
|
void function(boolean bEnable) { Message msg = mAutoTestHandler .obtainMessage(YgpsActivity.HANDLE_START_BUTTON_UPDATE); msg.arg1 = bEnable ? MESSAGE_ARG_1 : MESSAGE_ARG_0; mAutoTestHandler.sendMessage(msg); }
|
/**
* Refresh auto test UI.
*
* @param bEnable
* Auto test start or not
*/
|
Refresh auto test UI
|
setStartButtonEnable
|
{
"repo_name": "mtk6582/android_device_lg_leon",
"path": "gps/YGPS/src/com/mediatek/ygps/YgpsActivity.java",
"license": "gpl-2.0",
"size": 104247
}
|
[
"android.os.Message"
] |
import android.os.Message;
|
import android.os.*;
|
[
"android.os"
] |
android.os;
| 426,933
|
public VUserInfo getUserInfo(int handle) {
try {
return mService.getUserInfo(handle);
} catch (RemoteException re) {
Log.w(TAG, "Could not get user info", re);
return null;
}
}
|
VUserInfo function(int handle) { try { return mService.getUserInfo(handle); } catch (RemoteException re) { Log.w(TAG, STR, re); return null; } }
|
/**
* Returns the UserInfo object describing a specific user.
* @param handle the user handle of the user whose information is being requested.
* @return the UserInfo object for a specific user.
* @hide
*/
|
Returns the UserInfo object describing a specific user
|
getUserInfo
|
{
"repo_name": "codehz/container",
"path": "lib/src/main/java/com/lody/virtual/os/VUserManager.java",
"license": "gpl-3.0",
"size": 12833
}
|
[
"android.os.RemoteException",
"android.util.Log"
] |
import android.os.RemoteException; import android.util.Log;
|
import android.os.*; import android.util.*;
|
[
"android.os",
"android.util"
] |
android.os; android.util;
| 2,630,508
|
public static Element createRuleElement(RuleElementDTO ruleElementDTO, Document doc) throws PolicyBuilderException {
TargetElementDTO targetElementDTO = ruleElementDTO.getTargetElementDTO();
ConditionElementDT0 conditionElementDT0 = ruleElementDTO.getConditionElementDT0();
List<ObligationElementDTO> obligationElementDTOs = ruleElementDTO.getObligationElementDTOs();
Element ruleElement = doc.createElement(PolicyConstants.RULE_ELEMENT);
if(ruleElementDTO.getRuleId() != null && ruleElementDTO.getRuleId().trim().length() > 0){
ruleElement.setAttribute(PolicyConstants.RULE_ID, ruleElementDTO.getRuleId());
}
if(ruleElementDTO.getRuleEffect() != null && ruleElementDTO.getRuleEffect().trim().length() > 0){
ruleElement.setAttribute(PolicyConstants.RULE_EFFECT,
ruleElementDTO.getRuleEffect());
}
if(ruleElementDTO.getRuleDescription() != null && ruleElementDTO.getRuleDescription().
trim().length() > 0){
Element descriptionElement = doc.createElement(PolicyConstants.
DESCRIPTION_ELEMENT);
descriptionElement.setTextContent(ruleElementDTO.getRuleDescription());
ruleElement.appendChild(descriptionElement);
}
if(targetElementDTO != null ){
Element targetElement = createTargetElement(targetElementDTO, doc);
ruleElement.appendChild(targetElement);
}
if(conditionElementDT0 != null){
ruleElement.appendChild(createConditionElement(conditionElementDT0, doc));
}
if(obligationElementDTOs != null && obligationElementDTOs.size() > 0){
List<ObligationElementDTO> obligations = new ArrayList<ObligationElementDTO>();
List<ObligationElementDTO> advices = new ArrayList<ObligationElementDTO>();
for(ObligationElementDTO obligationElementDTO : obligationElementDTOs){
if(obligationElementDTO.getType() == ObligationElementDTO.ADVICE){
advices.add(obligationElementDTO);
} else {
obligations.add(obligationElementDTO);
}
}
Element obligation = createObligationsElement(obligations, doc);
Element advice = createAdvicesElement(advices, doc);
if(obligation != null){
ruleElement.appendChild(obligation);
}
if(advice != null){
ruleElement.appendChild(advice);
}
}
return ruleElement;
}
|
static Element function(RuleElementDTO ruleElementDTO, Document doc) throws PolicyBuilderException { TargetElementDTO targetElementDTO = ruleElementDTO.getTargetElementDTO(); ConditionElementDT0 conditionElementDT0 = ruleElementDTO.getConditionElementDT0(); List<ObligationElementDTO> obligationElementDTOs = ruleElementDTO.getObligationElementDTOs(); Element ruleElement = doc.createElement(PolicyConstants.RULE_ELEMENT); if(ruleElementDTO.getRuleId() != null && ruleElementDTO.getRuleId().trim().length() > 0){ ruleElement.setAttribute(PolicyConstants.RULE_ID, ruleElementDTO.getRuleId()); } if(ruleElementDTO.getRuleEffect() != null && ruleElementDTO.getRuleEffect().trim().length() > 0){ ruleElement.setAttribute(PolicyConstants.RULE_EFFECT, ruleElementDTO.getRuleEffect()); } if(ruleElementDTO.getRuleDescription() != null && ruleElementDTO.getRuleDescription(). trim().length() > 0){ Element descriptionElement = doc.createElement(PolicyConstants. DESCRIPTION_ELEMENT); descriptionElement.setTextContent(ruleElementDTO.getRuleDescription()); ruleElement.appendChild(descriptionElement); } if(targetElementDTO != null ){ Element targetElement = createTargetElement(targetElementDTO, doc); ruleElement.appendChild(targetElement); } if(conditionElementDT0 != null){ ruleElement.appendChild(createConditionElement(conditionElementDT0, doc)); } if(obligationElementDTOs != null && obligationElementDTOs.size() > 0){ List<ObligationElementDTO> obligations = new ArrayList<ObligationElementDTO>(); List<ObligationElementDTO> advices = new ArrayList<ObligationElementDTO>(); for(ObligationElementDTO obligationElementDTO : obligationElementDTOs){ if(obligationElementDTO.getType() == ObligationElementDTO.ADVICE){ advices.add(obligationElementDTO); } else { obligations.add(obligationElementDTO); } } Element obligation = createObligationsElement(obligations, doc); Element advice = createAdvicesElement(advices, doc); if(obligation != null){ ruleElement.appendChild(obligation); } if(advice != null){ ruleElement.appendChild(advice); } } return ruleElement; }
|
/**
* This creates XML representation of rule element using RuleElementDTO object
*
* @param ruleElementDTO RuleElementDTO
* @param doc Document
* @return DOM element
* @throws PolicyBuilderException throws
*/
|
This creates XML representation of rule element using RuleElementDTO object
|
createRuleElement
|
{
"repo_name": "shaundmorris/arbitro",
"path": "modules/arbitro-utils/src/main/java/com/connexta/arbitro/utils/PolicyUtils.java",
"license": "apache-2.0",
"size": 39198
}
|
[
"com.connexta.arbitro.utils.Constants",
"com.connexta.arbitro.utils.exception.PolicyBuilderException",
"com.connexta.arbitro.utils.policy.dto.ConditionElementDT0",
"com.connexta.arbitro.utils.policy.dto.ObligationElementDTO",
"com.connexta.arbitro.utils.policy.dto.RuleElementDTO",
"com.connexta.arbitro.utils.policy.dto.TargetElementDTO",
"java.util.ArrayList",
"java.util.List",
"org.w3c.dom.Document",
"org.w3c.dom.Element"
] |
import com.connexta.arbitro.utils.Constants; import com.connexta.arbitro.utils.exception.PolicyBuilderException; import com.connexta.arbitro.utils.policy.dto.ConditionElementDT0; import com.connexta.arbitro.utils.policy.dto.ObligationElementDTO; import com.connexta.arbitro.utils.policy.dto.RuleElementDTO; import com.connexta.arbitro.utils.policy.dto.TargetElementDTO; import java.util.ArrayList; import java.util.List; import org.w3c.dom.Document; import org.w3c.dom.Element;
|
import com.connexta.arbitro.utils.*; import com.connexta.arbitro.utils.exception.*; import com.connexta.arbitro.utils.policy.dto.*; import java.util.*; import org.w3c.dom.*;
|
[
"com.connexta.arbitro",
"java.util",
"org.w3c.dom"
] |
com.connexta.arbitro; java.util; org.w3c.dom;
| 654,838
|
public void addListener(InstallEventListener listener, String notificationType) {
eventManager.addListener(listener, notificationType);
}
|
void function(InstallEventListener listener, String notificationType) { eventManager.addListener(listener, notificationType); }
|
/**
* Adds a listener to eventManager
*
* @param listener the event listener to add
* @param notificationType the notification type
*/
|
Adds a listener to eventManager
|
addListener
|
{
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java",
"license": "epl-1.0",
"size": 93799
}
|
[
"com.ibm.ws.install.InstallEventListener"
] |
import com.ibm.ws.install.InstallEventListener;
|
import com.ibm.ws.install.*;
|
[
"com.ibm.ws"
] |
com.ibm.ws;
| 2,721,820
|
@Override
public void start(BundleContext bc) throws Exception {
logger.debug("db4o persistence bundle has been started.");
}
|
void function(BundleContext bc) throws Exception { logger.debug(STR); }
|
/**
* Called whenever the OSGi framework starts our bundle
*/
|
Called whenever the OSGi framework starts our bundle
|
start
|
{
"repo_name": "watou/openhab",
"path": "bundles/persistence/org.openhab.persistence.db4o/src/main/java/org/openhab/persistence/db4o/internal/Db4oActivator.java",
"license": "epl-1.0",
"size": 1135
}
|
[
"org.osgi.framework.BundleContext"
] |
import org.osgi.framework.BundleContext;
|
import org.osgi.framework.*;
|
[
"org.osgi.framework"
] |
org.osgi.framework;
| 1,272,924
|
@ServiceMethod(returns = ReturnType.SINGLE)
public PollerFlux<PollResult<Void>, Void> beginDeleteByResourceGroupAsync(
String resourceGroupName,
String locationName,
String managedInstanceName,
String databaseName,
String backupName) {
Mono<Response<Flux<ByteBuffer>>> mono =
deleteByResourceGroupWithResponseAsync(
resourceGroupName, locationName, managedInstanceName, databaseName, backupName);
return this
.client
.<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE);
}
|
@ServiceMethod(returns = ReturnType.SINGLE) PollerFlux<PollResult<Void>, Void> function( String resourceGroupName, String locationName, String managedInstanceName, String databaseName, String backupName) { Mono<Response<Flux<ByteBuffer>>> mono = deleteByResourceGroupWithResponseAsync( resourceGroupName, locationName, managedInstanceName, databaseName, backupName); return this .client .<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); }
|
/**
* Deletes a long term retention backup.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param locationName The location of the database.
* @param managedInstanceName The name of the managed instance.
* @param databaseName The name of the managed database.
* @param backupName The backup name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/
|
Deletes a long term retention backup
|
beginDeleteByResourceGroupAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/implementation/LongTermRetentionManagedInstanceBackupsClientImpl.java",
"license": "mit",
"size": 162168
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.Context",
"com.azure.core.util.polling.PollerFlux",
"java.nio.ByteBuffer"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.PollerFlux; import java.nio.ByteBuffer;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*; import java.nio.*;
|
[
"com.azure.core",
"java.nio"
] |
com.azure.core; java.nio;
| 2,812,896
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.