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 JButton getBCancel() {
if (bCancel == null) {
bCancel = new JButton();
bCancel.setText("cancelar");
}
return bCancel;
}
|
JButton function() { if (bCancel == null) { bCancel = new JButton(); bCancel.setText(STR); } return bCancel; }
|
/**
* This method initializes bCancel
*
* @return javax.swing.JButton
*/
|
This method initializes bCancel
|
getBCancel
|
{
"repo_name": "iCarto/siga",
"path": "extCAD/src/com/iver/cit/gvsig/project/documents/view/legend/gui/LayerProperties.java",
"license": "gpl-3.0",
"size": 8614
}
|
[
"javax.swing.JButton"
] |
import javax.swing.JButton;
|
import javax.swing.*;
|
[
"javax.swing"
] |
javax.swing;
| 69,527
|
public Number getAsNumber() throws TemplateModelException {
try {
Object value = object.__tojava__(java.lang.Number.class);
if (value == null || value == Py.NoConversion) {
return Double.valueOf(object.__float__().getValue());
}
return (Number) value;
} catch (PyException e) {
throw new TemplateModelException(e);
}
}
|
Number function() throws TemplateModelException { try { Object value = object.__tojava__(java.lang.Number.class); if (value == null value == Py.NoConversion) { return Double.valueOf(object.__float__().getValue()); } return (Number) value; } catch (PyException e) { throw new TemplateModelException(e); } }
|
/**
* Returns either {@link PyObject#__tojava__(java.lang.Class)} with
* {@link java.lang.Number}.class as argument. If that fails, returns
* {@link PyObject#__float__()}.
*/
|
Returns either <code>PyObject#__tojava__(java.lang.Class)</code> with <code>java.lang.Number</code>.class as argument. If that fails, returns <code>PyObject#__float__()</code>
|
getAsNumber
|
{
"repo_name": "apache/incubator-freemarker",
"path": "src/main/java/freemarker/ext/jython/JythonNumberModel.java",
"license": "apache-2.0",
"size": 2424
}
|
[
"freemarker.template.TemplateModelException",
"org.python.core.Py",
"org.python.core.PyException"
] |
import freemarker.template.TemplateModelException; import org.python.core.Py; import org.python.core.PyException;
|
import freemarker.template.*; import org.python.core.*;
|
[
"freemarker.template",
"org.python.core"
] |
freemarker.template; org.python.core;
| 2,778,762
|
protected void addDecimalMinutesPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_DocumentRoot_decimalMinutes_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_DocumentRoot_decimalMinutes_feature", "_UI_DocumentRoot_type"),
GmlPackage.eINSTANCE.getDocumentRoot_DecimalMinutes(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
|
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), GmlPackage.eINSTANCE.getDocumentRoot_DecimalMinutes(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
|
/**
* This adds a property descriptor for the Decimal Minutes feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
This adds a property descriptor for the Decimal Minutes feature.
|
addDecimalMinutesPropertyDescriptor
|
{
"repo_name": "markus1978/citygml4emf",
"path": "de.hub.citygml.emf.ecore.edit/src/net/opengis/gml/provider/DocumentRootItemProvider.java",
"license": "apache-2.0",
"size": 218886
}
|
[
"net.opengis.gml.GmlPackage",
"org.eclipse.emf.edit.provider.ComposeableAdapterFactory",
"org.eclipse.emf.edit.provider.ItemPropertyDescriptor"
] |
import net.opengis.gml.GmlPackage; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
|
import net.opengis.gml.*; import org.eclipse.emf.edit.provider.*;
|
[
"net.opengis.gml",
"org.eclipse.emf"
] |
net.opengis.gml; org.eclipse.emf;
| 1,356,659
|
public String toBase64() throws IOException {
return ImageUtil.toBase64(image);
}
|
String function() throws IOException { return ImageUtil.toBase64(image); }
|
/**
* Covert this image into a Base64 string
* @return
* The image in base64
* @throws IOException
* If an error occurred while writing/reading into base64
*/
|
Covert this image into a Base64 string
|
toBase64
|
{
"repo_name": "Sleeksnap/sleeksnap",
"path": "src/org/sleeksnap/upload/ImageUpload.java",
"license": "gpl-3.0",
"size": 1856
}
|
[
"java.io.IOException",
"org.sleeksnap.util.Utils"
] |
import java.io.IOException; import org.sleeksnap.util.Utils;
|
import java.io.*; import org.sleeksnap.util.*;
|
[
"java.io",
"org.sleeksnap.util"
] |
java.io; org.sleeksnap.util;
| 1,896,892
|
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<LatencyScorecardInner>> getLatencyScorecardsWithResponseAsync(
String resourceGroupName,
String profileName,
String experimentName,
LatencyScorecardAggregationInterval aggregationInterval,
String endDateTimeUtc,
String country) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (profileName == null) {
return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null."));
}
if (experimentName == null) {
return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null."));
}
if (aggregationInterval == null) {
return Mono
.error(new IllegalArgumentException("Parameter aggregationInterval is required and cannot be null."));
}
final String apiVersion = "2019-11-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.getLatencyScorecards(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
apiVersion,
resourceGroupName,
profileName,
experimentName,
endDateTimeUtc,
country,
aggregationInterval,
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
|
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<LatencyScorecardInner>> function( String resourceGroupName, String profileName, String experimentName, LatencyScorecardAggregationInterval aggregationInterval, String endDateTimeUtc, String country) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (profileName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (experimentName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (aggregationInterval == null) { return Mono .error(new IllegalArgumentException(STR)); } final String apiVersion = STR; final String accept = STR; return FluxUtil .withContext( context -> service .getLatencyScorecards( this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, resourceGroupName, profileName, experimentName, endDateTimeUtc, country, aggregationInterval, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); }
|
/**
* Gets a Latency Scorecard for a given Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param aggregationInterval The aggregation interval of the Latency Scorecard.
* @param endDateTimeUtc The end DateTime of the Latency Scorecard in UTC.
* @param country The country associated with the Latency Scorecard. Values are country ISO codes as specified here-
* https://www.iso.org/iso-3166-country-codes.html.
* @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 Latency Scorecard for a given Experiment.
*/
|
Gets a Latency Scorecard for a given Experiment
|
getLatencyScorecardsWithResponseAsync
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/ReportsClientImpl.java",
"license": "mit",
"size": 34692
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.FluxUtil",
"com.azure.resourcemanager.frontdoor.fluent.models.LatencyScorecardInner",
"com.azure.resourcemanager.frontdoor.models.LatencyScorecardAggregationInterval"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.frontdoor.fluent.models.LatencyScorecardInner; import com.azure.resourcemanager.frontdoor.models.LatencyScorecardAggregationInterval;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.frontdoor.fluent.models.*; import com.azure.resourcemanager.frontdoor.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 1,397,145
|
public ClientDiscoveryForProperties properties() {
return this.properties;
}
|
ClientDiscoveryForProperties function() { return this.properties; }
|
/**
* Get shoeBox properties for the given operation.
*
* @return the properties value
*/
|
Get shoeBox properties for the given operation
|
properties
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/recoveryservices.backup/mgmt-v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/ClientDiscoveryValueForSingleApiInner.java",
"license": "mit",
"size": 3614
}
|
[
"com.microsoft.azure.management.recoveryservices.backup.v2017_07_01.ClientDiscoveryForProperties"
] |
import com.microsoft.azure.management.recoveryservices.backup.v2017_07_01.ClientDiscoveryForProperties;
|
import com.microsoft.azure.management.recoveryservices.backup.v2017_07_01.*;
|
[
"com.microsoft.azure"
] |
com.microsoft.azure;
| 1,946,020
|
public static List<HistoryValues> getHistoryValuesList(Map<Integer,
Map<Integer, HistoryValues>> allHistoryMap, boolean showCommentsInHistory) {
List<HistoryValues> historyList=new ArrayList<HistoryValues>();
if (allHistoryMap!=null) {
Iterator<Integer> itrHistoryMap=allHistoryMap.keySet().iterator();
while (itrHistoryMap.hasNext()) {
Integer transactionID = itrHistoryMap.next();
Map<Integer, HistoryValues> changesMap=allHistoryMap.get(transactionID);
Set<Integer> changedFieldIDs = changesMap.keySet();
Integer mostSpecificField = null;
String transactionComment = null;
if (changedFieldIDs.contains(SystemFields.INTEGER_COMMENT)) {
//the transaction comments are shown in the comment column of the most specific fields's row
//single comments, like any other explicit field are shown in a separate row but only if showCommentsInHistory = true
if (changedFieldIDs.size()>1) {
//a transaction which contains both a comment and other field changes:
//save the comment to the transaction's most specific fields comment column
//but remove it as a row
HistoryValues commentHistoryValue = changesMap.remove(SystemFields.INTEGER_COMMENT);
transactionComment = (String)commentHistoryValue.getNewValue();
mostSpecificField = getMostSpecificFieldForComment(changedFieldIDs);
}
if (!showCommentsInHistory) {
//this comment is single one: remove if the comments are not shown in the history
changesMap.remove(SystemFields.INTEGER_COMMENT);
}
}
Iterator<Integer> itrChanges=changedFieldIDs.iterator();
while (itrChanges.hasNext()) {
Integer fieldID = itrChanges.next();
HistoryValues histValues = changesMap.get(fieldID);
if (mostSpecificField!=null && fieldID.equals(mostSpecificField)) {
histValues.setTransactionComment(transactionComment);
}
historyList.add(histValues);
}
}
}
if (historyList.size() > 0) {
// sort all history beans chronologically
Collections.sort(historyList, new HistoryComparator());
}
return historyList;
}
|
static List<HistoryValues> function(Map<Integer, Map<Integer, HistoryValues>> allHistoryMap, boolean showCommentsInHistory) { List<HistoryValues> historyList=new ArrayList<HistoryValues>(); if (allHistoryMap!=null) { Iterator<Integer> itrHistoryMap=allHistoryMap.keySet().iterator(); while (itrHistoryMap.hasNext()) { Integer transactionID = itrHistoryMap.next(); Map<Integer, HistoryValues> changesMap=allHistoryMap.get(transactionID); Set<Integer> changedFieldIDs = changesMap.keySet(); Integer mostSpecificField = null; String transactionComment = null; if (changedFieldIDs.contains(SystemFields.INTEGER_COMMENT)) { if (changedFieldIDs.size()>1) { HistoryValues commentHistoryValue = changesMap.remove(SystemFields.INTEGER_COMMENT); transactionComment = (String)commentHistoryValue.getNewValue(); mostSpecificField = getMostSpecificFieldForComment(changedFieldIDs); } if (!showCommentsInHistory) { changesMap.remove(SystemFields.INTEGER_COMMENT); } } Iterator<Integer> itrChanges=changedFieldIDs.iterator(); while (itrChanges.hasNext()) { Integer fieldID = itrChanges.next(); HistoryValues histValues = changesMap.get(fieldID); if (mostSpecificField!=null && fieldID.equals(mostSpecificField)) { histValues.setTransactionComment(transactionComment); } historyList.add(histValues); } } } if (historyList.size() > 0) { Collections.sort(historyList, new HistoryComparator()); } return historyList; }
|
/**
* Get the list of HistoryValues from the map of Map<Integer, Map<Integer, HistoryValues>>
* @param allHistoryMap
* @param showCommentsInHistory whether the comment fields should be melt together with the most specific field
* from the transaction in this case allHistoryMap contains all history values (history and comment)
* @return
*/
|
Get the list of HistoryValues from the map of Map>
|
getHistoryValuesList
|
{
"repo_name": "trackplus/Genji",
"path": "src/main/java/com/aurel/track/item/history/HistoryLoaderBL.java",
"license": "gpl-3.0",
"size": 65673
}
|
[
"com.aurel.track.fieldType.constants.SystemFields",
"java.util.ArrayList",
"java.util.Collections",
"java.util.Iterator",
"java.util.List",
"java.util.Map",
"java.util.Set"
] |
import com.aurel.track.fieldType.constants.SystemFields; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set;
|
import com.aurel.track.*; import java.util.*;
|
[
"com.aurel.track",
"java.util"
] |
com.aurel.track; java.util;
| 2,252,073
|
@R101Setting(type=SettingsType.BOOLEAN, defaultValue="false", displayName="Normalized")
public void setNormalized(String val) {
this.normalized = Boolean.parseBoolean(val.toLowerCase());
}
|
@R101Setting(type=SettingsType.BOOLEAN, defaultValue="false", displayName=STR) void function(String val) { this.normalized = Boolean.parseBoolean(val.toLowerCase()); }
|
/**
* A setter for object construction
*
* @param val
*/
|
A setter for object construction
|
setNormalized
|
{
"repo_name": "valegrajales/recommendation_systems_lab1",
"path": "recommender101/src/org/recommender101/eval/metrics/extensions/Gini.java",
"license": "mit",
"size": 14356
}
|
[
"org.recommender101.gui.annotations.R101Setting"
] |
import org.recommender101.gui.annotations.R101Setting;
|
import org.recommender101.gui.annotations.*;
|
[
"org.recommender101.gui"
] |
org.recommender101.gui;
| 2,078,010
|
public CellType getType()
{
return CellType.BOOLEAN_FORMULA;
}
|
CellType function() { return CellType.BOOLEAN_FORMULA; }
|
/**
* Returns the cell type
*
* @return The cell type
*/
|
Returns the cell type
|
getType
|
{
"repo_name": "stefandmn/AREasy",
"path": "src/java/org/areasy/common/parser/excel/read/biff/SharedBooleanFormulaRecord.java",
"license": "lgpl-3.0",
"size": 4512
}
|
[
"org.areasy.common.parser.excel.CellType"
] |
import org.areasy.common.parser.excel.CellType;
|
import org.areasy.common.parser.excel.*;
|
[
"org.areasy.common"
] |
org.areasy.common;
| 2,492,013
|
@SuppressWarnings("resource")
public static String titleCase(String val, String wordSeparators) {
if (wordSeparators == null) {
return (val == null)
? ""
: new CharArray(val).toTitleCase().toString();
}
return (val == null)
? ""
: new CharArray(val).toTitleCase(wordSeparators.toCharArray()).toString();
}
|
@SuppressWarnings(STR) static String function(String val, String wordSeparators) { if (wordSeparators == null) { return (val == null) ? STR" : new CharArray(val).toTitleCase(wordSeparators.toCharArray()).toString(); }
|
/**
* Returns the titlecase representation of the specified string
*
* @param val
* the string
* @param wordSeparators
* a string containing word separator characters
*
* @return the titlecase representation of the specified string
*/
|
Returns the titlecase representation of the specified string
|
titleCase
|
{
"repo_name": "appnativa/rare",
"path": "source/rare/core/com/appnativa/rare/scripting/Functions.java",
"license": "gpl-3.0",
"size": 107843
}
|
[
"com.appnativa.util.CharArray"
] |
import com.appnativa.util.CharArray;
|
import com.appnativa.util.*;
|
[
"com.appnativa.util"
] |
com.appnativa.util;
| 2,073,849
|
public void setGmtCreated(Date gmtCreated) {
this.gmtCreated = gmtCreated;
}
|
void function(Date gmtCreated) { this.gmtCreated = gmtCreated; }
|
/**
* Setter method for property <tt>gmtCreated</tt>.
*
* @param gmtCreated value to be assigned to property gmtCreated
*/
|
Setter method for property gmtCreated
|
setGmtCreated
|
{
"repo_name": "danlley/myteay",
"path": "myteay-core-model/src/main/java/com/myteay/core/model/dinner/MtShopModel.java",
"license": "gpl-3.0",
"size": 4001
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,422,318
|
private void checkGratuityPR(ServiceAgreementTemplate serviceAgreementTemplate) {
if (!serviceAgreementTemplate.hasActivePostingRuleFor(EventType.GRATUITY)) {
throw new DomainException("error.accounting.postingRules.gratuity.StandaloneEnrolmentGratuityPR.must.have.gratuityPR");
}
}
|
void function(ServiceAgreementTemplate serviceAgreementTemplate) { if (!serviceAgreementTemplate.hasActivePostingRuleFor(EventType.GRATUITY)) { throw new DomainException(STR); } }
|
/**
* Check gratuity pr.
* Check if a posting rule with gratuity event type already exists.
* Such posting rule must exists first because standalone PR is calculated
* based on grauity PR
*
* @param serviceAgreementTemplate the service agreement template
*/
|
Check gratuity pr. Check if a posting rule with gratuity event type already exists. Such posting rule must exists first because standalone PR is calculated based on grauity PR
|
checkGratuityPR
|
{
"repo_name": "gil-l/fenix",
"path": "src/main/java/org/fenixedu/academic/domain/accounting/postingRules/gratuity/StandaloneEnrolmentGratuityPR.java",
"license": "lgpl-3.0",
"size": 13185
}
|
[
"org.fenixedu.academic.domain.accounting.EventType",
"org.fenixedu.academic.domain.accounting.ServiceAgreementTemplate",
"org.fenixedu.academic.domain.exceptions.DomainException"
] |
import org.fenixedu.academic.domain.accounting.EventType; import org.fenixedu.academic.domain.accounting.ServiceAgreementTemplate; import org.fenixedu.academic.domain.exceptions.DomainException;
|
import org.fenixedu.academic.domain.accounting.*; import org.fenixedu.academic.domain.exceptions.*;
|
[
"org.fenixedu.academic"
] |
org.fenixedu.academic;
| 401,803
|
private List<ProtocolPersonBase> getProtocolPersons(ActionForm form) {
return ((ProtocolForm) form).getProtocolDocument().getProtocol().getProtocolPersons();
}
|
List<ProtocolPersonBase> function(ActionForm form) { return ((ProtocolForm) form).getProtocolDocument().getProtocol().getProtocolPersons(); }
|
/**
* This method is to get list of protocol persons
* @param form
* @return
*/
|
This method is to get list of protocol persons
|
getProtocolPersons
|
{
"repo_name": "kuali/kc",
"path": "coeus-impl/src/main/java/org/kuali/kra/irb/personnel/ProtocolPersonnelAction.java",
"license": "agpl-3.0",
"size": 21153
}
|
[
"java.util.List",
"org.apache.struts.action.ActionForm",
"org.kuali.kra.irb.ProtocolForm",
"org.kuali.kra.protocol.personnel.ProtocolPersonBase"
] |
import java.util.List; import org.apache.struts.action.ActionForm; import org.kuali.kra.irb.ProtocolForm; import org.kuali.kra.protocol.personnel.ProtocolPersonBase;
|
import java.util.*; import org.apache.struts.action.*; import org.kuali.kra.irb.*; import org.kuali.kra.protocol.personnel.*;
|
[
"java.util",
"org.apache.struts",
"org.kuali.kra"
] |
java.util; org.apache.struts; org.kuali.kra;
| 455,528
|
@Deprecated
public static List collectAll(Collection self, Closure transform) {
return collectNested(self, transform);
}
/**
* Recursively iterates through this collection transforming each non-Collection value
* into a new value using the closure as a transformer. Returns a potentially nested
* list of transformed values.
* <pre class="groovyTestCase">
* assert [2,[4,6],[8],[]] == [1,[2,3],[4],[]].collectNested { it * 2 }
|
static List function(Collection self, Closure transform) { return collectNested(self, transform); } /** * Recursively iterates through this collection transforming each non-Collection value * into a new value using the closure as a transformer. Returns a potentially nested * list of transformed values. * <pre class=STR> * assert [2,[4,6],[8],[]] == [1,[2,3],[4],[]].collectNested { it * 2 }
|
/**
* Deprecated alias for collectNested
*
* @deprecated Use collectNested instead
* @see #collectNested(Collection, Closure)
*/
|
Deprecated alias for collectNested
|
collectAll
|
{
"repo_name": "armsargis/groovy",
"path": "src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java",
"license": "apache-2.0",
"size": 698233
}
|
[
"groovy.lang.Closure",
"java.util.Collection",
"java.util.List"
] |
import groovy.lang.Closure; import java.util.Collection; import java.util.List;
|
import groovy.lang.*; import java.util.*;
|
[
"groovy.lang",
"java.util"
] |
groovy.lang; java.util;
| 2,496,995
|
private void pruneIfNeeded( int neededSpace )
{
if ( (mTotalSize + neededSpace) < mMaxCacheSizeInBytes )
{
return;
}
if ( VolleyLog.DEBUG )
{
VolleyLog.v("Pruning old cache entries.");
}
long before = mTotalSize;
int prunedFiles = 0;
long startTime = SystemClock.elapsedRealtime();
Iterator<Map.Entry<String, CacheHeader>> iterator = mEntries.entrySet().iterator();
while ( iterator.hasNext() )
{
Map.Entry<String, CacheHeader> entry = iterator.next();
CacheHeader e = entry.getValue();
boolean deleted = getFileForKey(e.key).delete();
if ( deleted )
{
mTotalSize -= e.size;
}
else
{
VolleyLog.d("Could not delete cache entry for key=%s, filename=%s", e.key, getFilenameForKey(e.key));
}
iterator.remove();
prunedFiles++;
if ( (mTotalSize + neededSpace) < mMaxCacheSizeInBytes * HYSTERESIS_FACTOR )
{
break;
}
}
if ( VolleyLog.DEBUG )
{
VolleyLog.v("pruned %d files, %d bytes, %d ms", prunedFiles, (mTotalSize - before), SystemClock.elapsedRealtime() - startTime);
}
}
|
void function( int neededSpace ) { if ( (mTotalSize + neededSpace) < mMaxCacheSizeInBytes ) { return; } if ( VolleyLog.DEBUG ) { VolleyLog.v(STR); } long before = mTotalSize; int prunedFiles = 0; long startTime = SystemClock.elapsedRealtime(); Iterator<Map.Entry<String, CacheHeader>> iterator = mEntries.entrySet().iterator(); while ( iterator.hasNext() ) { Map.Entry<String, CacheHeader> entry = iterator.next(); CacheHeader e = entry.getValue(); boolean deleted = getFileForKey(e.key).delete(); if ( deleted ) { mTotalSize -= e.size; } else { VolleyLog.d(STR, e.key, getFilenameForKey(e.key)); } iterator.remove(); prunedFiles++; if ( (mTotalSize + neededSpace) < mMaxCacheSizeInBytes * HYSTERESIS_FACTOR ) { break; } } if ( VolleyLog.DEBUG ) { VolleyLog.v(STR, prunedFiles, (mTotalSize - before), SystemClock.elapsedRealtime() - startTime); } }
|
/**
* Prunes the cache to fit the amount of bytes specified.
*
* @param neededSpace
* The amount of bytes we are trying to fit into the cache.
*/
|
Prunes the cache to fit the amount of bytes specified
|
pruneIfNeeded
|
{
"repo_name": "hi0001234d/im_android_lib_volley",
"path": "src/com/android/volley/toolbox/DiskBasedCache.java",
"license": "apache-2.0",
"size": 15622
}
|
[
"android.os.SystemClock",
"com.android.volley.VolleyLog",
"java.util.Iterator",
"java.util.Map"
] |
import android.os.SystemClock; import com.android.volley.VolleyLog; import java.util.Iterator; import java.util.Map;
|
import android.os.*; import com.android.volley.*; import java.util.*;
|
[
"android.os",
"com.android.volley",
"java.util"
] |
android.os; com.android.volley; java.util;
| 126,783
|
public static WorldServer getWorld(String name)
{
if ( name == null || name.isEmpty() )
throw new IllegalArgumentException("World name cannot be empty or null");
for ( WorldServer world : DimensionManager.getWorlds() )
{
String dimName = "DIM" + world.provider.dimensionId;
String saveFolder = world.provider.getSaveFolder();
if (world.provider.dimensionId == 0)
{ // Special case for dimension 0 (overworld)
if ( WorldBorder.SERVER.getFolderName().equals(name) )
return world;
}
else if ( saveFolder.equals(name) || dimName.equals(name) )
return world;
}
return null;
}
|
static WorldServer function(String name) { if ( name == null name.isEmpty() ) throw new IllegalArgumentException(STR); for ( WorldServer world : DimensionManager.getWorlds() ) { String dimName = "DIM" + world.provider.dimensionId; String saveFolder = world.provider.getSaveFolder(); if (world.provider.dimensionId == 0) { if ( WorldBorder.SERVER.getFolderName().equals(name) ) return world; } else if ( saveFolder.equals(name) dimName.equals(name) ) return world; } return null; }
|
/**
* Performs a case-sensitive search for a loaded world by a given name.
*
* First, it tries to match the name with dimension 0 (overworld), then it tries to
* match from the world's save folder name (e.g. DIM_MYST10) and then finally the
* Dynmap compatible identifier (e.g. DIM10)
*
* @param name Name of world to find
* @return World if found, else null
*/
|
Performs a case-sensitive search for a loaded world by a given name. First, it tries to match the name with dimension 0 (overworld), then it tries to match from the world's save folder name (e.g. DIM_MYST10) and then finally the Dynmap compatible identifier (e.g. DIM10)
|
getWorld
|
{
"repo_name": "AnodeCathode/WorldBorder-Forge",
"path": "src/main/java/com/wimbli/WorldBorder/forge/Worlds.java",
"license": "bsd-3-clause",
"size": 2790
}
|
[
"com.wimbli.WorldBorder",
"net.minecraft.world.WorldServer",
"net.minecraftforge.common.DimensionManager"
] |
import com.wimbli.WorldBorder; import net.minecraft.world.WorldServer; import net.minecraftforge.common.DimensionManager;
|
import com.wimbli.*; import net.minecraft.world.*; import net.minecraftforge.common.*;
|
[
"com.wimbli",
"net.minecraft.world",
"net.minecraftforge.common"
] |
com.wimbli; net.minecraft.world; net.minecraftforge.common;
| 688,016
|
@SuppressWarnings({"StringEquality"})
@Nullable public Class<?> deployedClass(String clsName, String... alias) {
Class<?> cls = clss.get(clsName);
if (cls == null) {
try {
cls = Class.forName(clsName, true, clsLdr);
Class<?> cur = clss.putIfAbsent(clsName, cls);
if (cur == null) {
for (String a : alias) {
clss.putIfAbsent(a, cls);
}
onDeployed(cls);
}
}
catch (ClassNotFoundException ignored) {
// Check aliases.
for (String a : alias) {
cls = clss.get(a);
if (cls != null)
return cls;
else if (!a.equals(clsName)) {
try {
cls = Class.forName(a, true, clsLdr);
}
catch (ClassNotFoundException ignored0) {
continue;
}
Class<?> cur = clss.putIfAbsent(a, cls);
if (cur == null) {
for (String a1 : alias) {
// The original alias has already been put into the map,
// so we don't try to put it again here.
if (a1 != a)
clss.putIfAbsent(a1, cls);
}
onDeployed(cls);
}
return cls;
}
}
}
}
return cls;
}
|
@SuppressWarnings({STR}) @Nullable Class<?> function(String clsName, String... alias) { Class<?> cls = clss.get(clsName); if (cls == null) { try { cls = Class.forName(clsName, true, clsLdr); Class<?> cur = clss.putIfAbsent(clsName, cls); if (cur == null) { for (String a : alias) { clss.putIfAbsent(a, cls); } onDeployed(cls); } } catch (ClassNotFoundException ignored) { for (String a : alias) { cls = clss.get(a); if (cls != null) return cls; else if (!a.equals(clsName)) { try { cls = Class.forName(a, true, clsLdr); } catch (ClassNotFoundException ignored0) { continue; } Class<?> cur = clss.putIfAbsent(a, cls); if (cur == null) { for (String a1 : alias) { if (a1 != a) clss.putIfAbsent(a1, cls); } onDeployed(cls); } return cls; } } } } return cls; }
|
/**
* Gets class for a name.
*
* @param clsName Class name.
* @param alias Optional array of aliases.
* @return Class for given name.
*/
|
Gets class for a name
|
deployedClass
|
{
"repo_name": "ilantukh/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeployment.java",
"license": "apache-2.0",
"size": 24311
}
|
[
"org.jetbrains.annotations.Nullable"
] |
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.*;
|
[
"org.jetbrains.annotations"
] |
org.jetbrains.annotations;
| 1,884,116
|
public ApiLand getLand() {
return land;
}
|
ApiLand function() { return land; }
|
/**
* Gets the land.
*
* @return the land
*/
|
Gets the land
|
getLand
|
{
"repo_name": "Tabinol/Secuboid",
"path": "src/main/java/me/tabinol/secuboid/lands/collisions/CollisionsEntry.java",
"license": "gpl-3.0",
"size": 3810
}
|
[
"me.tabinol.secuboidapi.lands.ApiLand"
] |
import me.tabinol.secuboidapi.lands.ApiLand;
|
import me.tabinol.secuboidapi.lands.*;
|
[
"me.tabinol.secuboidapi"
] |
me.tabinol.secuboidapi;
| 2,064,008
|
public static void execute(ExecutablePool pool, String region, EventID eventId,
Object callbackArg) {
AbstractOp op = new ClearOpImpl(region, eventId, callbackArg);
pool.execute(op);
}
|
static void function(ExecutablePool pool, String region, EventID eventId, Object callbackArg) { AbstractOp op = new ClearOpImpl(region, eventId, callbackArg); pool.execute(op); }
|
/**
* Does a region clear on a server using connections from the given pool to communicate with the
* server.
*
* @param pool the pool to use to communicate with the server.
* @param region the name of the region to do the clear on
* @param eventId the event id for this clear
* @param callbackArg an optional callback arg to pass to any cache callbacks
*/
|
Does a region clear on a server using connections from the given pool to communicate with the server
|
execute
|
{
"repo_name": "jdeppe-pivotal/geode",
"path": "geode-core/src/main/java/org/apache/geode/cache/client/internal/ClearOp.java",
"license": "apache-2.0",
"size": 3661
}
|
[
"org.apache.geode.internal.cache.EventID"
] |
import org.apache.geode.internal.cache.EventID;
|
import org.apache.geode.internal.cache.*;
|
[
"org.apache.geode"
] |
org.apache.geode;
| 1,655,384
|
public SearchRequestBuilder setPostFilter(BytesReference postFilter) {
sourceBuilder().postFilter(postFilter);
return this;
}
|
SearchRequestBuilder function(BytesReference postFilter) { sourceBuilder().postFilter(postFilter); return this; }
|
/**
* Sets a filter on the query executed that only applies to the search query
* (and not facets for example).
*/
|
Sets a filter on the query executed that only applies to the search query (and not facets for example)
|
setPostFilter
|
{
"repo_name": "gmile/elasticsearch",
"path": "src/main/java/org/elasticsearch/action/search/SearchRequestBuilder.java",
"license": "apache-2.0",
"size": 38410
}
|
[
"org.elasticsearch.common.bytes.BytesReference"
] |
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.*;
|
[
"org.elasticsearch.common"
] |
org.elasticsearch.common;
| 2,683,086
|
void setRotation (DMatrix3C R);
void setQuaternion (DQuaternionC q);
void setLinearVel (double x, double y, double z);
void setLinearVel (DVector3C v);
void setAngularVel (double x, double y, double z);
void setAngularVel (DVector3C v);
|
void setRotation (DMatrix3C R); void setQuaternion (DQuaternionC q); void setLinearVel (double x, double y, double z); void setLinearVel (DVector3C v); void setAngularVel (double x, double y, double z); void setAngularVel (DVector3C v);
|
/**
* Set the angular velocity of a body.
*/
|
Set the angular velocity of a body
|
setAngularVel
|
{
"repo_name": "billhj/Etoile-java",
"path": "Ode4j/src/org/ode4j/ode/DBody.java",
"license": "mit",
"size": 23245
}
|
[
"org.ode4j.math.DMatrix3C",
"org.ode4j.math.DQuaternionC",
"org.ode4j.math.DVector3C"
] |
import org.ode4j.math.DMatrix3C; import org.ode4j.math.DQuaternionC; import org.ode4j.math.DVector3C;
|
import org.ode4j.math.*;
|
[
"org.ode4j.math"
] |
org.ode4j.math;
| 2,337,743
|
public void populateDependencyContentItems(String site, DmContentItemTO item, boolean populateUpdatedDependecinesOnly);
|
void function(String site, DmContentItemTO item, boolean populateUpdatedDependecinesOnly);
|
/**
* populate dependencies as content items into the given content item
*
* @param site
* @param item
* @param populateUpdatedDependecinesOnly
*/
|
populate dependencies as content items into the given content item
|
populateDependencyContentItems
|
{
"repo_name": "hlim/studio",
"path": "alfresco-svcs/src/main/java/org/craftercms/cstudio/alfresco/dm/service/api/DmDependencyService.java",
"license": "gpl-3.0",
"size": 7381
}
|
[
"org.craftercms.cstudio.alfresco.dm.to.DmContentItemTO"
] |
import org.craftercms.cstudio.alfresco.dm.to.DmContentItemTO;
|
import org.craftercms.cstudio.alfresco.dm.to.*;
|
[
"org.craftercms.cstudio"
] |
org.craftercms.cstudio;
| 2,218,772
|
static class CDateFunction extends AbstractFunctionNode
{
public Object execute(Vector values, AspContext context)
throws AspException
{
if (values.size()!=1) {
throw new AspException("Invalid number of arguments: " +
values.size());
}
return Types.coerceToDate(values.get(0));
}
}
|
static class CDateFunction extends AbstractFunctionNode { Object function(Vector values, AspContext context) throws AspException { if (values.size()!=1) { throw new AspException(STR + values.size()); } return Types.coerceToDate(values.get(0)); } }
|
/**
* Executes this function.
* @param values Parameters for this expression.
* @param context AspContext under which to evaluate this expression.
* @return Return value of this expression.
* @throws AspException if an error occurs.
* @see AbstractFunction#execute(Vector,AspContext)
*/
|
Executes this function
|
execute
|
{
"repo_name": "lazerdye/arrowheadasp",
"path": "src/com/tripi/asp/VBScriptGlobals.java",
"license": "gpl-2.0",
"size": 122003
}
|
[
"java.util.Vector"
] |
import java.util.Vector;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,058,135
|
public Target getTarget(String targetName) throws NoSuchTargetException {
Target target = targets.get(targetName);
if (target != null) {
return target;
}
// No such target.
// If there's a file on the disk that's not mentioned in the BUILD file,
// produce a more informative error. NOTE! this code path is only executed
// on failure, which is (relatively) very rare. In the common case no
// stat(2) is executed.
Path filename = getPackageDirectory().getRelative(targetName);
String suffix;
if (!new PathFragment(targetName).isNormalized()) {
// Don't check for file existence in this case because the error message
// would be confusing and wrong. If the targetName is "foo/bar/.", and
// there is a directory "foo/bar", it doesn't mean that "//pkg:foo/bar/."
// is a valid label.
suffix = "";
} else if (filename.isDirectory()) {
suffix = "; however, a source directory of this name exists. (Perhaps add "
+ "'exports_files([\"" + targetName + "\"])' to " + name + "/BUILD, or define a "
+ "filegroup?)";
} else if (filename.exists()) {
suffix = "; however, a source file of this name exists. (Perhaps add "
+ "'exports_files([\"" + targetName + "\"])' to " + name + "/BUILD?)";
} else {
suffix = SpellChecker.didYouMean(targetName, targets.keySet());
}
throw makeNoSuchTargetException(targetName, suffix);
}
|
Target function(String targetName) throws NoSuchTargetException { Target target = targets.get(targetName); if (target != null) { return target; } Path filename = getPackageDirectory().getRelative(targetName); String suffix; if (!new PathFragment(targetName).isNormalized()) { suffix = STR; however, a source directory of this name exists. (Perhaps add STR'exports_files([\STR\STR + name + "/BUILD, or define a STRfilegroup?)"; } else if (filename.exists()) { suffix = "; however, a source file of this name exists. (Perhaps add STR'exports_files([\STR\STR + name + STR; } else { suffix = SpellChecker.didYouMean(targetName, targets.keySet()); } throw makeNoSuchTargetException(targetName, suffix); }
|
/**
* Returns the target (a member of this package) whose name is "targetName".
* First rules are searched, then output files, then input files. The target
* name must be valid, as defined by {@code LabelValidator#validateTargetName}.
*
* @throws NoSuchTargetException if the specified target was not found.
*/
|
Returns the target (a member of this package) whose name is "targetName". First rules are searched, then output files, then input files. The target name must be valid, as defined by LabelValidator#validateTargetName
|
getTarget
|
{
"repo_name": "Asana/bazel",
"path": "src/main/java/com/google/devtools/build/lib/packages/Package.java",
"license": "apache-2.0",
"size": 53148
}
|
[
"com.google.devtools.build.lib.util.SpellChecker",
"com.google.devtools.build.lib.vfs.Path",
"com.google.devtools.build.lib.vfs.PathFragment"
] |
import com.google.devtools.build.lib.util.SpellChecker; import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment;
|
import com.google.devtools.build.lib.util.*; import com.google.devtools.build.lib.vfs.*;
|
[
"com.google.devtools"
] |
com.google.devtools;
| 2,673,638
|
return essenceIsIdentified;
}
/**
* Sets the value of the essenceIsIdentified property.
*
* @param value
* allowed object is
* {@link Boolean }
|
return essenceIsIdentified; } /** * Sets the value of the essenceIsIdentified property. * * @param value * allowed object is * {@link Boolean }
|
/**
* Gets the value of the essenceIsIdentified property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
|
Gets the value of the essenceIsIdentified property
|
getEssenceIsIdentified
|
{
"repo_name": "DSRCorporation/imf-conversion",
"path": "imf-essence-descriptors/src/main/java/org/smpte_ra/reg/_395/_2014/_13/_1/aaf/ContainerDefinition.java",
"license": "gpl-3.0",
"size": 9453
}
|
[
"org.smpte_ra.reg._2003._2012.Boolean"
] |
import org.smpte_ra.reg._2003._2012.Boolean;
|
import org.smpte_ra.reg.*;
|
[
"org.smpte_ra.reg"
] |
org.smpte_ra.reg;
| 25,866
|
public static Collection<Descriptor> getSortedDescriptorsForGlobalConfig() {
return getSortedDescriptorsForGlobalConfig(Predicates.<GlobalConfigurationCategory>alwaysTrue());
}
|
static Collection<Descriptor> function() { return getSortedDescriptorsForGlobalConfig(Predicates.<GlobalConfigurationCategory>alwaysTrue()); }
|
/**
* Like {@link #getSortedDescriptorsForGlobalConfig(Predicate)} but with a constant truth predicate, to include all descriptors.
*/
|
Like <code>#getSortedDescriptorsForGlobalConfig(Predicate)</code> but with a constant truth predicate, to include all descriptors
|
getSortedDescriptorsForGlobalConfig
|
{
"repo_name": "KostyaSha/jenkins",
"path": "core/src/main/java/hudson/Functions.java",
"license": "mit",
"size": 69172
}
|
[
"com.google.common.base.Predicates",
"hudson.model.Descriptor",
"java.util.Collection"
] |
import com.google.common.base.Predicates; import hudson.model.Descriptor; import java.util.Collection;
|
import com.google.common.base.*; import hudson.model.*; import java.util.*;
|
[
"com.google.common",
"hudson.model",
"java.util"
] |
com.google.common; hudson.model; java.util;
| 2,707,527
|
@Test
public void testExpandShardedWrite() {
runShardedWrite(
Arrays.asList("one", "two", "three", "four", "five", "six"),
IDENTITY_MAP,
Optional.of(20));
}
|
void function() { runShardedWrite( Arrays.asList("one", "two", "three", "four", "five", "six"), IDENTITY_MAP, Optional.of(20)); }
|
/**
* Test that Write with a configured number of shards produces the desired number of shards even
* when there are too few elements.
*/
|
Test that Write with a configured number of shards produces the desired number of shards even when there are too few elements
|
testExpandShardedWrite
|
{
"repo_name": "sammcveety/DataflowJavaSDK",
"path": "sdk/src/test/java/com/google/cloud/dataflow/sdk/io/WriteTest.java",
"license": "apache-2.0",
"size": 18276
}
|
[
"com.google.common.base.Optional",
"java.util.Arrays"
] |
import com.google.common.base.Optional; import java.util.Arrays;
|
import com.google.common.base.*; import java.util.*;
|
[
"com.google.common",
"java.util"
] |
com.google.common; java.util;
| 79,933
|
@Test
public void testNonRecursiveMonitor() throws Exception {
// Create the mock artifact API structure
final Mockery mockery = new Mockery();
final OverlayContainer rootOverlay = this.mockArtifactDataStructure(mockery);
// Use this to create an interpreted container, only want one root
InterpretedContainer interpretedContainer = createInterpretedContainer(mockery, rootOverlay, oneRootStructureHelper);
// We'll register !/c against the fake root at /a/b. Therefore the mocker needs to make sure the "!" appears at the front of the whole string
final CaptureNotificationListener notificationListenerMatcher = this.mockRegisterAgainstArtifactNotifier(mockery, "/a/b", Collections.singleton("!/a/b/c"), rootOverlay);
// Now we need to add a mock for the callback, make sure the path has been corrected to just /c even though it is /a/b/c on the artifact API
final Container interpretedRoot = interpretedContainer.getEntry("/a/b").adapt(Container.class);
final NotificationListener notificationListener = mockery.mock(NotificationListener.class);
mockery.checking(new Expectations() {
{
oneOf(notificationListener).notifyEntryChange(with(new NotificationMatcher(interpretedRoot, Collections.<String> emptySet())),
with(new NotificationMatcher(interpretedRoot, Collections.<String> emptySet())),
with(new NotificationMatcher(interpretedRoot, Collections.singleton("/c"))));
}
});
Notifier testObject = interpretedRoot.adapt(Notifier.class);
testObject.registerForNotifications(new DefaultNotification(interpretedRoot, Collections.singleton("!/c")), notificationListener);
notificationListenerMatcher.listener.notifyEntryChange(new DefaultArtifactNotification(rootOverlay, Collections.<String> emptySet()),
new DefaultArtifactNotification(rootOverlay, Collections.<String> emptySet()),
new DefaultArtifactNotification(rootOverlay, Collections.singleton("/a/b/c")));
// Make sure the righ paths were passed into the calls
mockery.assertIsSatisfied();
}
|
void function() throws Exception { final Mockery mockery = new Mockery(); final OverlayContainer rootOverlay = this.mockArtifactDataStructure(mockery); InterpretedContainer interpretedContainer = createInterpretedContainer(mockery, rootOverlay, oneRootStructureHelper); final CaptureNotificationListener notificationListenerMatcher = this.mockRegisterAgainstArtifactNotifier(mockery, "/a/b", Collections.singleton(STR), rootOverlay); final Container interpretedRoot = interpretedContainer.getEntry("/a/b").adapt(Container.class); final NotificationListener notificationListener = mockery.mock(NotificationListener.class); mockery.checking(new Expectations() { { oneOf(notificationListener).notifyEntryChange(with(new NotificationMatcher(interpretedRoot, Collections.<String> emptySet())), with(new NotificationMatcher(interpretedRoot, Collections.<String> emptySet())), with(new NotificationMatcher(interpretedRoot, Collections.singleton("/c")))); } }); Notifier testObject = interpretedRoot.adapt(Notifier.class); testObject.registerForNotifications(new DefaultNotification(interpretedRoot, Collections.singleton("!/c")), notificationListener); notificationListenerMatcher.listener.notifyEntryChange(new DefaultArtifactNotification(rootOverlay, Collections.<String> emptySet()), new DefaultArtifactNotification(rootOverlay, Collections.<String> emptySet()), new DefaultArtifactNotification(rootOverlay, Collections.singleton(STR))); mockery.assertIsSatisfied(); }
|
/**
* This test makes sure that if a path has ! on the front then it is converted to the right path to pass into the artifact layer
*
* @throws Exception
*/
|
This test makes sure that if a path has ! on the front then it is converted to the right path to pass into the artifact layer
|
testNonRecursiveMonitor
|
{
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.adaptable.module/test/com/ibm/ws/adaptable/module/internal/InterpretedNotifierTest.java",
"license": "epl-1.0",
"size": 53167
}
|
[
"com.ibm.wsspi.adaptable.module.Container",
"com.ibm.wsspi.adaptable.module.DefaultNotification",
"com.ibm.wsspi.adaptable.module.InterpretedContainer",
"com.ibm.wsspi.adaptable.module.Notifier",
"com.ibm.wsspi.artifact.DefaultArtifactNotification",
"com.ibm.wsspi.artifact.overlay.OverlayContainer",
"java.util.Collections",
"org.jmock.Expectations",
"org.jmock.Mockery"
] |
import com.ibm.wsspi.adaptable.module.Container; import com.ibm.wsspi.adaptable.module.DefaultNotification; import com.ibm.wsspi.adaptable.module.InterpretedContainer; import com.ibm.wsspi.adaptable.module.Notifier; import com.ibm.wsspi.artifact.DefaultArtifactNotification; import com.ibm.wsspi.artifact.overlay.OverlayContainer; import java.util.Collections; import org.jmock.Expectations; import org.jmock.Mockery;
|
import com.ibm.wsspi.adaptable.module.*; import com.ibm.wsspi.artifact.*; import com.ibm.wsspi.artifact.overlay.*; import java.util.*; import org.jmock.*;
|
[
"com.ibm.wsspi",
"java.util",
"org.jmock"
] |
com.ibm.wsspi; java.util; org.jmock;
| 36,211
|
private Map<TopicPartition, Long> fetchCommittedOffsets(Set<TopicPartition> partitions) {
while (true) {
long now = time.milliseconds();
RequestFuture<Map<TopicPartition, Long>> future = coordinator.fetchOffsets(partitions, now);
if (!future.isDone())
pollFuture(future, requestTimeoutMs);
if (future.isDone()) {
if (future.succeeded())
return future.value();
handleRequestFailure(future);
}
}
}
|
Map<TopicPartition, Long> function(Set<TopicPartition> partitions) { while (true) { long now = time.milliseconds(); RequestFuture<Map<TopicPartition, Long>> future = coordinator.fetchOffsets(partitions, now); if (!future.isDone()) pollFuture(future, requestTimeoutMs); if (future.isDone()) { if (future.succeeded()) return future.value(); handleRequestFailure(future); } } }
|
/**
* Lookup the committed offsets for a set of partitions. This will block until the coordinator has
* responded to the offset fetch request.
* @param partitions List of partitions to get offsets for
* @return Map from partition to its respective offset
*/
|
Lookup the committed offsets for a set of partitions. This will block until the coordinator has responded to the offset fetch request
|
fetchCommittedOffsets
|
{
"repo_name": "gdfm/kafka",
"path": "clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java",
"license": "apache-2.0",
"size": 65660
}
|
[
"java.util.Map",
"java.util.Set",
"org.apache.kafka.clients.consumer.internals.RequestFuture",
"org.apache.kafka.common.TopicPartition"
] |
import java.util.Map; import java.util.Set; import org.apache.kafka.clients.consumer.internals.RequestFuture; import org.apache.kafka.common.TopicPartition;
|
import java.util.*; import org.apache.kafka.clients.consumer.internals.*; import org.apache.kafka.common.*;
|
[
"java.util",
"org.apache.kafka"
] |
java.util; org.apache.kafka;
| 2,575,449
|
public void windowGainedFocus(WindowEvent e)
{
((WindowFocusListener) a).windowGainedFocus(e);
((WindowFocusListener) b).windowGainedFocus(e);
}
|
void function(WindowEvent e) { ((WindowFocusListener) a).windowGainedFocus(e); ((WindowFocusListener) b).windowGainedFocus(e); }
|
/**
* Handles this event by dispatching it to the "a" and "b" listener
* instances.
*
* @param e the event to handle
* @since 1.4
*/
|
Handles this event by dispatching it to the "a" and "b" listener instances
|
windowGainedFocus
|
{
"repo_name": "github-lis/JamVM-PH",
"path": "src/classpath/java/awt/AWTEventMulticaster.java",
"license": "gpl-2.0",
"size": 34513
}
|
[
"java.awt.event.WindowEvent",
"java.awt.event.WindowFocusListener"
] |
import java.awt.event.WindowEvent; import java.awt.event.WindowFocusListener;
|
import java.awt.event.*;
|
[
"java.awt"
] |
java.awt;
| 2,752,093
|
@Test(expected = ConstraintViolationException.class)
public void validatesOutputForNonNull() throws Exception {
new JSR303Test.Foo().nullValue();
}
|
@Test(expected = ConstraintViolationException.class) void function() throws Exception { new JSR303Test.Foo().nullValue(); }
|
/**
* NotNull can validate method output.
* @throws Exception If something goes wrong
*/
|
NotNull can validate method output
|
validatesOutputForNonNull
|
{
"repo_name": "shelan/jcabi-aspects",
"path": "src/test/java/com/jcabi/aspects/JSR303Test.java",
"license": "bsd-3-clause",
"size": 5952
}
|
[
"javax.validation.ConstraintViolationException",
"org.junit.Test"
] |
import javax.validation.ConstraintViolationException; import org.junit.Test;
|
import javax.validation.*; import org.junit.*;
|
[
"javax.validation",
"org.junit"
] |
javax.validation; org.junit;
| 906,664
|
public boolean revokeMissingDiskStores(final String diskStoreId) {
// make sure that the disk store we're revoking is actually missing
boolean found = false;
PersistentMemberDetails[] details = listMissingDiskStores();
if (details != null) {
for (PersistentMemberDetails member : details) {
if (member.getDiskStoreId().equalsIgnoreCase(diskStoreId)) {
found = true;
break;
}
}
}
if (!found) {
return false;
}
PersistentMemberPattern pattern = new PersistentMemberPattern(UUID.fromString(diskStoreId));
boolean success = false;
try {
PrepareRevokePersistentIDRequest.send(dm, pattern);
success = true;
} finally {
if (success) {
// revoke the persistent member if were able to prepare the revoke
RevokePersistentIDRequest.send(dm, pattern);
} else {
// otherwise, cancel the revoke.
PrepareRevokePersistentIDRequest.cancel(dm, pattern);
}
}
return success;
}
|
boolean function(final String diskStoreId) { boolean found = false; PersistentMemberDetails[] details = listMissingDiskStores(); if (details != null) { for (PersistentMemberDetails member : details) { if (member.getDiskStoreId().equalsIgnoreCase(diskStoreId)) { found = true; break; } } } if (!found) { return false; } PersistentMemberPattern pattern = new PersistentMemberPattern(UUID.fromString(diskStoreId)); boolean success = false; try { PrepareRevokePersistentIDRequest.send(dm, pattern); success = true; } finally { if (success) { RevokePersistentIDRequest.send(dm, pattern); } else { PrepareRevokePersistentIDRequest.cancel(dm, pattern); } } return success; }
|
/**
* Revokes or ignores the missing diskStore for which the region Initialization is stopped
*
* @param diskStoreId UUID of the disk store to revoke
* @return successful or failure
*/
|
Revokes or ignores the missing diskStore for which the region Initialization is stopped
|
revokeMissingDiskStores
|
{
"repo_name": "masaki-yamakawa/geode",
"path": "geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java",
"license": "apache-2.0",
"size": 53962
}
|
[
"java.util.UUID",
"org.apache.geode.internal.admin.remote.PrepareRevokePersistentIDRequest",
"org.apache.geode.internal.admin.remote.RevokePersistentIDRequest",
"org.apache.geode.internal.cache.persistence.PersistentMemberPattern",
"org.apache.geode.management.PersistentMemberDetails"
] |
import java.util.UUID; import org.apache.geode.internal.admin.remote.PrepareRevokePersistentIDRequest; import org.apache.geode.internal.admin.remote.RevokePersistentIDRequest; import org.apache.geode.internal.cache.persistence.PersistentMemberPattern; import org.apache.geode.management.PersistentMemberDetails;
|
import java.util.*; import org.apache.geode.internal.admin.remote.*; import org.apache.geode.internal.cache.persistence.*; import org.apache.geode.management.*;
|
[
"java.util",
"org.apache.geode"
] |
java.util; org.apache.geode;
| 657,597
|
public void buildTimeSeries() {
TestObservableId id1 = TestObservableId.of("1");
TestObservableId id2 = TestObservableId.of("2");
LocalDateDoubleTimeSeries timeSeries1 = LocalDateDoubleTimeSeries.builder()
.put(date(2011, 3, 8), 1)
.put(date(2011, 3, 9), 2)
.put(date(2011, 3, 10), 3)
.build();
LocalDateDoubleTimeSeries timeSeries2 = LocalDateDoubleTimeSeries.builder()
.put(date(2012, 4, 8), 10)
.put(date(2012, 4, 9), 20)
.put(date(2012, 4, 10), 30)
.build();
Map<ObservableId, LocalDateDoubleTimeSeries> timeSeries = ImmutableMap.of(id1, timeSeries1, id2, timeSeries2);
DefaultMarketDataFactory marketDataFactory =
new DefaultMarketDataFactory(
new TestTimeSeriesProvider(timeSeries),
ObservableMarketDataFunction.none(),
FeedIdMapping.identity());
CalculationRequirements requirements = CalculationRequirements.builder()
.addTimeSeries(id1, id2)
.build();
CalculationEnvironment marketData = marketDataFactory.buildCalculationEnvironment(
requirements,
MarketEnvironment.empty(date(2015, 3, 25)),
MARKET_DATA_CONFIG);
assertThat(marketData.getTimeSeries(id1)).isEqualTo(timeSeries1);
assertThat(marketData.getTimeSeries(id2)).isEqualTo(timeSeries2);
}
|
void function() { TestObservableId id1 = TestObservableId.of("1"); TestObservableId id2 = TestObservableId.of("2"); LocalDateDoubleTimeSeries timeSeries1 = LocalDateDoubleTimeSeries.builder() .put(date(2011, 3, 8), 1) .put(date(2011, 3, 9), 2) .put(date(2011, 3, 10), 3) .build(); LocalDateDoubleTimeSeries timeSeries2 = LocalDateDoubleTimeSeries.builder() .put(date(2012, 4, 8), 10) .put(date(2012, 4, 9), 20) .put(date(2012, 4, 10), 30) .build(); Map<ObservableId, LocalDateDoubleTimeSeries> timeSeries = ImmutableMap.of(id1, timeSeries1, id2, timeSeries2); DefaultMarketDataFactory marketDataFactory = new DefaultMarketDataFactory( new TestTimeSeriesProvider(timeSeries), ObservableMarketDataFunction.none(), FeedIdMapping.identity()); CalculationRequirements requirements = CalculationRequirements.builder() .addTimeSeries(id1, id2) .build(); CalculationEnvironment marketData = marketDataFactory.buildCalculationEnvironment( requirements, MarketEnvironment.empty(date(2015, 3, 25)), MARKET_DATA_CONFIG); assertThat(marketData.getTimeSeries(id1)).isEqualTo(timeSeries1); assertThat(marketData.getTimeSeries(id2)).isEqualTo(timeSeries2); }
|
/**
* Tests building time series from requirements.
*/
|
Tests building time series from requirements
|
buildTimeSeries
|
{
"repo_name": "nssales/Strata",
"path": "modules/engine/src/test/java/com/opengamma/strata/engine/marketdata/DefaultMarketDataFactoryTest.java",
"license": "apache-2.0",
"size": 65385
}
|
[
"com.google.common.collect.ImmutableMap",
"com.opengamma.strata.basics.market.ObservableId",
"com.opengamma.strata.collect.CollectProjectAssertions",
"com.opengamma.strata.collect.timeseries.LocalDateDoubleTimeSeries",
"com.opengamma.strata.engine.marketdata.function.ObservableMarketDataFunction",
"com.opengamma.strata.engine.marketdata.mapping.FeedIdMapping",
"java.util.Map"
] |
import com.google.common.collect.ImmutableMap; import com.opengamma.strata.basics.market.ObservableId; import com.opengamma.strata.collect.CollectProjectAssertions; import com.opengamma.strata.collect.timeseries.LocalDateDoubleTimeSeries; import com.opengamma.strata.engine.marketdata.function.ObservableMarketDataFunction; import com.opengamma.strata.engine.marketdata.mapping.FeedIdMapping; import java.util.Map;
|
import com.google.common.collect.*; import com.opengamma.strata.basics.market.*; import com.opengamma.strata.collect.*; import com.opengamma.strata.collect.timeseries.*; import com.opengamma.strata.engine.marketdata.function.*; import com.opengamma.strata.engine.marketdata.mapping.*; import java.util.*;
|
[
"com.google.common",
"com.opengamma.strata",
"java.util"
] |
com.google.common; com.opengamma.strata; java.util;
| 1,160,531
|
void writeArgumentsComment(Iterator<String> argumentsType, Iterator<String> argumentsName, Writer writer) throws IOException {
while(argumentsType.hasNext()) {
String type = argumentsType.next();
String name = argumentsName.next();
writer.append(TAB2).append(" * @param ").append(OPENBRACE).append(type).append(CLOSEBRACE).append(SPACE).append(name).append(CR);
}
}
|
void writeArgumentsComment(Iterator<String> argumentsType, Iterator<String> argumentsName, Writer writer) throws IOException { while(argumentsType.hasNext()) { String type = argumentsType.next(); String name = argumentsName.next(); writer.append(TAB2).append(STR).append(OPENBRACE).append(type).append(CLOSEBRACE).append(SPACE).append(name).append(CR); } }
|
/**
* write js documentation for arguments
* @param argumentsType
* @param argumentsName
* @param writer
* @throws IOException
*/
|
write js documentation for arguments
|
writeArgumentsComment
|
{
"repo_name": "hhdevelopment/ocelot",
"path": "ocelot-processor/src/main/java/org/ocelotds/processors/visitors/DataServiceVisitorJsBuilder.java",
"license": "mpl-2.0",
"size": 9957
}
|
[
"java.io.IOException",
"java.io.Writer",
"java.util.Iterator"
] |
import java.io.IOException; import java.io.Writer; import java.util.Iterator;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 2,716,095
|
public void addTimeZone(ZoneId timeZone) {
ArgumentChecker.notNull(timeZone, "timeZone");
addExternalId(ExternalSchemes.timeZoneRegionId(timeZone));
}
|
void function(ZoneId timeZone) { ArgumentChecker.notNull(timeZone, STR); addExternalId(ExternalSchemes.timeZoneRegionId(timeZone)); }
|
/**
* Adds a search for a time-zone by adding the matching bundle.
*
* @param timeZone the time-zone to search for, not null
*/
|
Adds a search for a time-zone by adding the matching bundle
|
addTimeZone
|
{
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Master/src/main/java/com/opengamma/master/region/RegionSearchRequest.java",
"license": "apache-2.0",
"size": 23296
}
|
[
"com.opengamma.core.id.ExternalSchemes",
"com.opengamma.util.ArgumentChecker",
"org.threeten.bp.ZoneId"
] |
import com.opengamma.core.id.ExternalSchemes; import com.opengamma.util.ArgumentChecker; import org.threeten.bp.ZoneId;
|
import com.opengamma.core.id.*; import com.opengamma.util.*; import org.threeten.bp.*;
|
[
"com.opengamma.core",
"com.opengamma.util",
"org.threeten.bp"
] |
com.opengamma.core; com.opengamma.util; org.threeten.bp;
| 1,936,797
|
public RouteDefinition fromF(String uri, Object... args) {
getRouteCollection().setCamelContext(getContext());
RouteDefinition answer = getRouteCollection().from(String.format(uri, args));
configureRoute(answer);
return answer;
}
|
RouteDefinition function(String uri, Object... args) { getRouteCollection().setCamelContext(getContext()); RouteDefinition answer = getRouteCollection().from(String.format(uri, args)); configureRoute(answer); return answer; }
|
/**
* Creates a new route from the given URI input
*
* @param uri the String formatted from uri
* @param args arguments for the string formatting of the uri
* @return the builder
*/
|
Creates a new route from the given URI input
|
fromF
|
{
"repo_name": "adessaigne/camel",
"path": "core/camel-core-engine/src/main/java/org/apache/camel/builder/RouteBuilder.java",
"license": "apache-2.0",
"size": 22911
}
|
[
"org.apache.camel.model.RouteDefinition"
] |
import org.apache.camel.model.RouteDefinition;
|
import org.apache.camel.model.*;
|
[
"org.apache.camel"
] |
org.apache.camel;
| 710,010
|
public void setColors(List<Gradient> values) {
JsArray<JavaScriptObject> gradients = JsArray.createArray().cast();
for (Gradient g : values) {
gradients.push(g.getJsObj());
}
setAttribute("colors", gradients, true, true);
}
|
void function(List<Gradient> values) { JsArray<JavaScriptObject> gradients = JsArray.createArray().cast(); for (Gradient g : values) { gradients.push(g.getJsObj()); } setAttribute(STR, gradients, true, true); }
|
/**
* Array of gradients to override the color of items and legends.
*
* @param values
*/
|
Array of gradients to override the color of items and legends
|
setColors
|
{
"repo_name": "ahome-it/ahome-touch",
"path": "ahome-touch/src/main/java/com/ait/toolkit/sencha/touch/charts/client/AbstractChart.java",
"license": "apache-2.0",
"size": 56753
}
|
[
"com.ait.toolkit.sencha.touch.charts.client.laf.Gradient",
"com.google.gwt.core.client.JavaScriptObject",
"com.google.gwt.core.client.JsArray",
"java.util.List"
] |
import com.ait.toolkit.sencha.touch.charts.client.laf.Gradient; import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.core.client.JsArray; import java.util.List;
|
import com.ait.toolkit.sencha.touch.charts.client.laf.*; import com.google.gwt.core.client.*; import java.util.*;
|
[
"com.ait.toolkit",
"com.google.gwt",
"java.util"
] |
com.ait.toolkit; com.google.gwt; java.util;
| 855,095
|
@Override
public MenuItem findItem(int id) {
// TODO Auto-generated method stub
return null;
}
|
MenuItem function(int id) { return null; }
|
/**
* Diese Funktion wird nicht verwendet.
*/
|
Diese Funktion wird nicht verwendet
|
findItem
|
{
"repo_name": "danielhartwig/sms-vdr-remote",
"path": "sms-vdr-app/src/de/hartwig/smsvdrremote/SettingActivity.java",
"license": "mit",
"size": 13339
}
|
[
"android.view.MenuItem"
] |
import android.view.MenuItem;
|
import android.view.*;
|
[
"android.view"
] |
android.view;
| 480,178
|
@Deprecated
protected void primitiveMkdir(Path f, FsPermission absolutePermission,
boolean createParent)
throws IOException {
if (!createParent) { // parent must exist.
// since the this.mkdirs makes parent dirs automatically
// we must throw exception if parent does not exist.
final FileStatus stat = getFileStatus(f.getParent());
if (stat == null) {
throw new FileNotFoundException("Missing parent:" + f);
}
if (!stat.isDirectory()) {
throw new ParentNotDirectoryException("parent is not a dir");
}
// parent does exist - go ahead with mkdir of leaf
}
// Default impl is to assume that permissions do not matter and hence
// calling the regular mkdirs is good enough.
// FSs that implement permissions should override this.
if (!this.mkdirs(f, absolutePermission)) {
throw new IOException("mkdir of "+ f + " failed");
}
}
|
void function(Path f, FsPermission absolutePermission, boolean createParent) throws IOException { if (!createParent) { final FileStatus stat = getFileStatus(f.getParent()); if (stat == null) { throw new FileNotFoundException(STR + f); } if (!stat.isDirectory()) { throw new ParentNotDirectoryException(STR); } } if (!this.mkdirs(f, absolutePermission)) { throw new IOException(STR+ f + STR); } }
|
/**
* This version of the mkdirs method assumes that the permission is absolute.
* It has been added to support the FileContext that processes the permission
* with umask before calling this method.
* This a temporary method added to support the transition from FileSystem
* to FileContext for user applications.
*/
|
This version of the mkdirs method assumes that the permission is absolute. It has been added to support the FileContext that processes the permission with umask before calling this method. This a temporary method added to support the transition from FileSystem to FileContext for user applications
|
primitiveMkdir
|
{
"repo_name": "jth/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java",
"license": "apache-2.0",
"size": 112636
}
|
[
"java.io.FileNotFoundException",
"java.io.IOException",
"org.apache.hadoop.fs.permission.FsPermission"
] |
import java.io.FileNotFoundException; import java.io.IOException; import org.apache.hadoop.fs.permission.FsPermission;
|
import java.io.*; import org.apache.hadoop.fs.permission.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 1,045,949
|
protected static boolean formatHasNoLanguage(Format format) {
return TextUtils.isEmpty(format.language) || formatHasLanguage(format, C.LANGUAGE_UNDETERMINED);
}
|
static boolean function(Format format) { return TextUtils.isEmpty(format.language) formatHasLanguage(format, C.LANGUAGE_UNDETERMINED); }
|
/**
* Returns whether a {@link Format} does not define a language.
*
* @param format The {@link Format}.
* @return Whether the {@link Format} does not define a language.
*/
|
Returns whether a <code>Format</code> does not define a language
|
formatHasNoLanguage
|
{
"repo_name": "KiminRyu/ExoPlayer",
"path": "library/core/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java",
"license": "apache-2.0",
"size": 55885
}
|
[
"android.text.TextUtils",
"com.google.android.exoplayer2.Format"
] |
import android.text.TextUtils; import com.google.android.exoplayer2.Format;
|
import android.text.*; import com.google.android.exoplayer2.*;
|
[
"android.text",
"com.google.android"
] |
android.text; com.google.android;
| 2,062,754
|
@Override
protected void setHeightAndWidth() {
width = icons.getWidth();
height = icons.getHeight();
}
protected Sprite icon;
protected SpriteSet icons;
|
void function() { width = icons.getWidth(); height = icons.getHeight(); } protected Sprite icon; protected SpriteSet icons;
|
/**
* Sets Height and Width of the gauge based on the orientation.
*/
|
Sets Height and Width of the gauge based on the orientation
|
setHeightAndWidth
|
{
"repo_name": "BinaryAura/Customize",
"path": "src/main/java/net/binaryaura/customize/client/gui/huditem/HudItemIcon.java",
"license": "mit",
"size": 1503
}
|
[
"net.binaryaura.customize.client.gui.Sprite",
"net.binaryaura.customize.client.gui.SpriteSet"
] |
import net.binaryaura.customize.client.gui.Sprite; import net.binaryaura.customize.client.gui.SpriteSet;
|
import net.binaryaura.customize.client.gui.*;
|
[
"net.binaryaura.customize"
] |
net.binaryaura.customize;
| 1,011,028
|
public PSResource getResource() {
return this.resource;
}
|
PSResource function() { return this.resource; }
|
/**
* Returns the associated PSResource.
*
* @return the resource
*/
|
Returns the associated PSResource
|
getResource
|
{
"repo_name": "Guronzan/Apache-XmlGraphics",
"path": "src/main/java/org/apache/xmlgraphics/ps/dsc/events/AbstractResourceDSCComment.java",
"license": "apache-2.0",
"size": 3630
}
|
[
"org.apache.xmlgraphics.ps.PSResource"
] |
import org.apache.xmlgraphics.ps.PSResource;
|
import org.apache.xmlgraphics.ps.*;
|
[
"org.apache.xmlgraphics"
] |
org.apache.xmlgraphics;
| 2,874,543
|
@Deprecated
public static SkipHead skipHead(Map<String, List<Long>> targetObjects, ChildOption childOption, String startFrom,
GraphModify2 request) {
return skipHead().target(targetObjects).option(childOption).startFrom(startFrom).request(request).build();
}
|
static SkipHead function(Map<String, List<Long>> targetObjects, ChildOption childOption, String startFrom, GraphModify2 request) { return skipHead().target(targetObjects).option(childOption).startFrom(startFrom).request(request).build(); }
|
/**
* Create a new {@link SkipHead} request.
* @param targetObjects the target objects
* @param childOption how to process child objects
* @param startFrom the class from which to start the actual processing
* @param request the processor to use
* @return the new request
* @deprecated use {@link Requests.SkipHeadBuilder} from {@link #skipHead()}, see this method for an example
*/
|
Create a new <code>SkipHead</code> request
|
skipHead
|
{
"repo_name": "dpwrussell/openmicroscopy",
"path": "components/blitz/src/omero/gateway/util/Requests.java",
"license": "gpl-2.0",
"size": 113616
}
|
[
"java.util.List",
"java.util.Map"
] |
import java.util.List; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 532,257
|
protected void writeMessageContent(MessageExchange exchange, NormalizedMessage message,
OutputStream out, String path) throws MessagingException {
Source src = message.getContent();
if (src == null) {
throw new MessagingException("No message content in the inbound message for message exchange: " + exchange);
}
try {
getTransformer().toResult(src, new StreamResult(out), encoding);
} catch (TransformerException e) {
throw new MessagingException(e);
}
}
|
void function(MessageExchange exchange, NormalizedMessage message, OutputStream out, String path) throws MessagingException { Source src = message.getContent(); if (src == null) { throw new MessagingException(STR + exchange); } try { getTransformer().toResult(src, new StreamResult(out), encoding); } catch (TransformerException e) { throw new MessagingException(e); } }
|
/**
* Writes the message content to the given output stream
*
* @param message the message who's content we are about to write
* @param out the destination of the output
* @param path the name of the output resource (file, uri, url)
*/
|
Writes the message content to the given output stream
|
writeMessageContent
|
{
"repo_name": "apache/servicemix-utils",
"path": "src/main/java/org/apache/servicemix/components/util/DefaultFileMarshaler.java",
"license": "apache-2.0",
"size": 6541
}
|
[
"java.io.OutputStream",
"javax.jbi.messaging.MessageExchange",
"javax.jbi.messaging.MessagingException",
"javax.jbi.messaging.NormalizedMessage",
"javax.xml.transform.Source",
"javax.xml.transform.TransformerException",
"javax.xml.transform.stream.StreamResult"
] |
import java.io.OutputStream; import javax.jbi.messaging.MessageExchange; import javax.jbi.messaging.MessagingException; import javax.jbi.messaging.NormalizedMessage; import javax.xml.transform.Source; import javax.xml.transform.TransformerException; import javax.xml.transform.stream.StreamResult;
|
import java.io.*; import javax.jbi.messaging.*; import javax.xml.transform.*; import javax.xml.transform.stream.*;
|
[
"java.io",
"javax.jbi",
"javax.xml"
] |
java.io; javax.jbi; javax.xml;
| 2,763,550
|
private String initiateMultipartUpload(PutObjectRequest origReq, boolean isUsingEncryption) {
InitiateMultipartUploadRequest req = null;
if (isUsingEncryption && origReq instanceof EncryptedPutObjectRequest) {
req = new EncryptedInitiateMultipartUploadRequest(
origReq.getBucketName(), origReq.getKey()).withCannedACL(
origReq.getCannedAcl()).withObjectMetadata(origReq.getMetadata());
((EncryptedInitiateMultipartUploadRequest) req)
.setMaterialsDescription(((EncryptedPutObjectRequest) origReq).getMaterialsDescription());
} else {
req = new InitiateMultipartUploadRequest(origReq.getBucketName(), origReq.getKey())
.withCannedACL(origReq.getCannedAcl())
.withObjectMetadata(origReq.getMetadata());
}
TransferManager.appendMultipartUserAgent(req);
req.withAccessControlList(origReq.getAccessControlList())
.withStorageClass(origReq.getStorageClass())
.withRedirectLocation(origReq.getRedirectLocation())
.withSSECustomerKey(origReq.getSSECustomerKey())
.withSSEAwsKeyManagementParams(origReq.getSSEAwsKeyManagementParams())
.withGeneralProgressListener(origReq.getGeneralProgressListener())
.withRequestMetricCollector(origReq.getRequestMetricCollector())
;
String uploadId = s3.initiateMultipartUpload(req).getUploadId();
log.debug("Initiated new multipart upload: " + uploadId);
return uploadId;
}
|
String function(PutObjectRequest origReq, boolean isUsingEncryption) { InitiateMultipartUploadRequest req = null; if (isUsingEncryption && origReq instanceof EncryptedPutObjectRequest) { req = new EncryptedInitiateMultipartUploadRequest( origReq.getBucketName(), origReq.getKey()).withCannedACL( origReq.getCannedAcl()).withObjectMetadata(origReq.getMetadata()); ((EncryptedInitiateMultipartUploadRequest) req) .setMaterialsDescription(((EncryptedPutObjectRequest) origReq).getMaterialsDescription()); } else { req = new InitiateMultipartUploadRequest(origReq.getBucketName(), origReq.getKey()) .withCannedACL(origReq.getCannedAcl()) .withObjectMetadata(origReq.getMetadata()); } TransferManager.appendMultipartUserAgent(req); req.withAccessControlList(origReq.getAccessControlList()) .withStorageClass(origReq.getStorageClass()) .withRedirectLocation(origReq.getRedirectLocation()) .withSSECustomerKey(origReq.getSSECustomerKey()) .withSSEAwsKeyManagementParams(origReq.getSSEAwsKeyManagementParams()) .withGeneralProgressListener(origReq.getGeneralProgressListener()) .withRequestMetricCollector(origReq.getRequestMetricCollector()) ; String uploadId = s3.initiateMultipartUpload(req).getUploadId(); log.debug(STR + uploadId); return uploadId; }
|
/**
* Initiates a multipart upload and returns the upload id
* @param isUsingEncryption
*/
|
Initiates a multipart upload and returns the upload id
|
initiateMultipartUpload
|
{
"repo_name": "galaxynut/aws-sdk-java",
"path": "aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/UploadCallable.java",
"license": "apache-2.0",
"size": 14713
}
|
[
"com.amazonaws.services.s3.model.EncryptedInitiateMultipartUploadRequest",
"com.amazonaws.services.s3.model.EncryptedPutObjectRequest",
"com.amazonaws.services.s3.model.InitiateMultipartUploadRequest",
"com.amazonaws.services.s3.model.PutObjectRequest",
"com.amazonaws.services.s3.transfer.TransferManager"
] |
import com.amazonaws.services.s3.model.EncryptedInitiateMultipartUploadRequest; import com.amazonaws.services.s3.model.EncryptedPutObjectRequest; import com.amazonaws.services.s3.model.InitiateMultipartUploadRequest; import com.amazonaws.services.s3.model.PutObjectRequest; import com.amazonaws.services.s3.transfer.TransferManager;
|
import com.amazonaws.services.s3.model.*; import com.amazonaws.services.s3.transfer.*;
|
[
"com.amazonaws.services"
] |
com.amazonaws.services;
| 2,874,627
|
@ApiMethod(name = "getProfile", path = "profile", httpMethod = HttpMethod.GET)
public Profile getProfile(final User user) throws UnauthorizedException {
if (user == null) {
throw new UnauthorizedException("Authorization required");
}
String userId = user.getUserId();
Key<Profile> key = Key.create(Profile.class, userId);
Profile profile = ofy().load().key(key).now();
return profile;
}
|
@ApiMethod(name = STR, path = STR, httpMethod = HttpMethod.GET) Profile function(final User user) throws UnauthorizedException { if (user == null) { throw new UnauthorizedException(STR); } String userId = user.getUserId(); Key<Profile> key = Key.create(Profile.class, userId); Profile profile = ofy().load().key(key).now(); return profile; }
|
/**
* Returns a Profile object associated with the given user object. The cloud
* endpoints system automatically inject the User object.
*
* @param user
* A User object injected by the cloud endpoints.
* @return Profile object.
* @throws UnauthorizedException
* when the User object is null.
*/
|
Returns a Profile object associated with the given user object. The cloud endpoints system automatically inject the User object
|
getProfile
|
{
"repo_name": "snknikolov/conference-central",
"path": "src/main/java/com/google/devrel/training/conference/spi/ConferenceApi.java",
"license": "apache-2.0",
"size": 30923
}
|
[
"com.google.api.server.spi.config.ApiMethod",
"com.google.api.server.spi.response.UnauthorizedException",
"com.google.appengine.api.users.User",
"com.google.devrel.training.conference.domain.Profile",
"com.google.devrel.training.conference.service.OfyService",
"com.googlecode.objectify.Key"
] |
import com.google.api.server.spi.config.ApiMethod; import com.google.api.server.spi.response.UnauthorizedException; import com.google.appengine.api.users.User; import com.google.devrel.training.conference.domain.Profile; import com.google.devrel.training.conference.service.OfyService; import com.googlecode.objectify.Key;
|
import com.google.api.server.spi.config.*; import com.google.api.server.spi.response.*; import com.google.appengine.api.users.*; import com.google.devrel.training.conference.domain.*; import com.google.devrel.training.conference.service.*; import com.googlecode.objectify.*;
|
[
"com.google.api",
"com.google.appengine",
"com.google.devrel",
"com.googlecode.objectify"
] |
com.google.api; com.google.appengine; com.google.devrel; com.googlecode.objectify;
| 581,402
|
public ButtonGroup getToolBarGroup() {
return toolbarGroup;
}
|
ButtonGroup function() { return toolbarGroup; }
|
/**
* Returns the toolbar button group.
*
* @return the tool bar group
*/
|
Returns the toolbar button group
|
getToolBarGroup
|
{
"repo_name": "xiruibing/beautyeye",
"path": "src_all/SwingSets2_for_be_lnf/src/SwingSet2.java",
"license": "apache-2.0",
"size": 56329
}
|
[
"javax.swing.ButtonGroup"
] |
import javax.swing.ButtonGroup;
|
import javax.swing.*;
|
[
"javax.swing"
] |
javax.swing;
| 2,632,850
|
public final boolean reload()
{
this.uuids.clear();
try
{
BufferedReader reader = new BufferedReader( new FileReader( this.file ) );
String line;
while( (line = reader.readLine()) != null )
{
line = line.trim();
if( !line.isEmpty() )
{
this.uuids.add( UUID.fromString( line ) );
}
}
reader.close();
return true;
} catch( IOException e )
{
CatRestrictor.getInstance().getLogger().log( Level.SEVERE, "Could not read \"{0}\"", this.file.getPath());
return false;
}
}
|
final boolean function() { this.uuids.clear(); try { BufferedReader reader = new BufferedReader( new FileReader( this.file ) ); String line; while( (line = reader.readLine()) != null ) { line = line.trim(); if( !line.isEmpty() ) { this.uuids.add( UUID.fromString( line ) ); } } reader.close(); return true; } catch( IOException e ) { CatRestrictor.getInstance().getLogger().log( Level.SEVERE, STR{0}\"", this.file.getPath()); return false; } }
|
/**
* Reloads the current whitelist from file. Only needed if the file was modified externally.
* @return False on error;
*/
|
Reloads the current whitelist from file. Only needed if the file was modified externally
|
reload
|
{
"repo_name": "zwostein/CatRestrictor",
"path": "src/main/java/de/catnet/catrestrictor/Whitelist.java",
"license": "gpl-3.0",
"size": 5419
}
|
[
"java.io.BufferedReader",
"java.io.FileReader",
"java.io.IOException",
"java.util.UUID",
"java.util.logging.Level"
] |
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.UUID; import java.util.logging.Level;
|
import java.io.*; import java.util.*; import java.util.logging.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 2,864,968
|
private void close() {
if(byteArrayInputStream != null) {
try {
byteArrayInputStream.close();
} catch (IOException e) {
logger.log(Level.ERROR,"Closing outputstream failed", e);
}
}
if(outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
logger.log(Level.ERROR, "Closing outputstream failed", e);
}
}
if(inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
logger.log(Level.ERROR, "Closing inputStream failed", e);
}
}
}
|
void function() { if(byteArrayInputStream != null) { try { byteArrayInputStream.close(); } catch (IOException e) { logger.log(Level.ERROR,STR, e); } } if(outputStream != null) { try { outputStream.close(); } catch (IOException e) { logger.log(Level.ERROR, STR, e); } } if(inputStream != null) { try { inputStream.close(); } catch (IOException e) { logger.log(Level.ERROR, STR, e); } } }
|
/**
* Close all input/output streams after every run.
*/
|
Close all input/output streams after every run
|
close
|
{
"repo_name": "scoophealth/oscar",
"path": "src/main/java/org/oscarehr/integration/excelleris/com/colcamex/www/core/HL7LabHandler.java",
"license": "gpl-2.0",
"size": 12576
}
|
[
"java.io.IOException",
"org.apache.log4j.Level"
] |
import java.io.IOException; import org.apache.log4j.Level;
|
import java.io.*; import org.apache.log4j.*;
|
[
"java.io",
"org.apache.log4j"
] |
java.io; org.apache.log4j;
| 24,618
|
public CompletableFuture<Void> delete() {
return close().thenRun(context::delete);
}
public static class Builder extends io.atomix.catalyst.util.Builder<CopycatServer> {
private static final Duration DEFAULT_RAFT_ELECTION_TIMEOUT = Duration.ofMillis(1000);
private static final Duration DEFAULT_RAFT_HEARTBEAT_INTERVAL = Duration.ofMillis(150);
private static final Duration DEFAULT_RAFT_SESSION_TIMEOUT = Duration.ofMillis(5000);
private Transport transport;
private Storage storage;
private Serializer serializer;
private StateMachine stateMachine;
private Address address;
private Set<Address> cluster;
private Duration electionTimeout = DEFAULT_RAFT_ELECTION_TIMEOUT;
private Duration heartbeatInterval = DEFAULT_RAFT_HEARTBEAT_INTERVAL;
private Duration sessionTimeout = DEFAULT_RAFT_SESSION_TIMEOUT;
private Builder(Address address, Collection<Address> cluster) {
this.address = Assert.notNull(address, "address");
this.cluster = new HashSet<>(Assert.notNull(cluster, "cluster"));
this.cluster.add(address);
}
|
CompletableFuture<Void> function() { return close().thenRun(context::delete); } public static class Builder extends io.atomix.catalyst.util.Builder<CopycatServer> { private static final Duration DEFAULT_RAFT_ELECTION_TIMEOUT = Duration.ofMillis(1000); private static final Duration DEFAULT_RAFT_HEARTBEAT_INTERVAL = Duration.ofMillis(150); private static final Duration DEFAULT_RAFT_SESSION_TIMEOUT = Duration.ofMillis(5000); private Transport transport; private Storage storage; private Serializer serializer; private StateMachine stateMachine; private Address address; private Set<Address> cluster; private Duration electionTimeout = DEFAULT_RAFT_ELECTION_TIMEOUT; private Duration heartbeatInterval = DEFAULT_RAFT_HEARTBEAT_INTERVAL; private Duration sessionTimeout = DEFAULT_RAFT_SESSION_TIMEOUT; private Builder(Address address, Collection<Address> cluster) { this.address = Assert.notNull(address, STR); this.cluster = new HashSet<>(Assert.notNull(cluster, STR)); this.cluster.add(address); }
|
/**
* Deletes the Raft server and its logs.
*
* @return A completable future to be completed once the server has been deleted.
*/
|
Deletes the Raft server and its logs
|
delete
|
{
"repo_name": "madjam/copycat-1",
"path": "server/src/main/java/io/atomix/copycat/server/CopycatServer.java",
"license": "apache-2.0",
"size": 19565
}
|
[
"io.atomix.catalyst.serializer.Serializer",
"io.atomix.catalyst.transport.Address",
"io.atomix.catalyst.transport.Transport",
"io.atomix.catalyst.util.Assert",
"io.atomix.copycat.server.storage.Storage",
"java.time.Duration",
"java.util.Collection",
"java.util.HashSet",
"java.util.Set",
"java.util.concurrent.CompletableFuture"
] |
import io.atomix.catalyst.serializer.Serializer; import io.atomix.catalyst.transport.Address; import io.atomix.catalyst.transport.Transport; import io.atomix.catalyst.util.Assert; import io.atomix.copycat.server.storage.Storage; import java.time.Duration; import java.util.Collection; import java.util.HashSet; import java.util.Set; import java.util.concurrent.CompletableFuture;
|
import io.atomix.catalyst.serializer.*; import io.atomix.catalyst.transport.*; import io.atomix.catalyst.util.*; import io.atomix.copycat.server.storage.*; import java.time.*; import java.util.*; import java.util.concurrent.*;
|
[
"io.atomix.catalyst",
"io.atomix.copycat",
"java.time",
"java.util"
] |
io.atomix.catalyst; io.atomix.copycat; java.time; java.util;
| 417,005
|
Map<String, BlobMetadata> listBlobsByPrefix(String blobNamePrefix) throws IOException;
|
Map<String, BlobMetadata> listBlobsByPrefix(String blobNamePrefix) throws IOException;
|
/**
* Lists all blobs in the container that match the specified prefix.
*
* @param blobNamePrefix
* The prefix to match against blob names in the container.
* @return A map of the matching blobs in the container. The keys in the map are the names of the blobs
* and the values are {@link BlobMetadata}, containing basic information about each blob.
* @throws IOException if there were any failures in reading from the blob container.
*/
|
Lists all blobs in the container that match the specified prefix
|
listBlobsByPrefix
|
{
"repo_name": "EvilMcJerkface/crate",
"path": "server/src/main/java/org/elasticsearch/common/blobstore/BlobContainer.java",
"license": "apache-2.0",
"size": 8698
}
|
[
"java.io.IOException",
"java.util.Map"
] |
import java.io.IOException; import java.util.Map;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 1,788,464
|
public void testConstructor18() {
try {
new ThreadPoolExecutor(1, 0, 1L, SECONDS,
new ArrayBlockingQueue<Runnable>(10),
new SimpleThreadFactory(),
new NoOpREHandler());
shouldThrow();
} catch (IllegalArgumentException success) {}
}
|
void function() { try { new ThreadPoolExecutor(1, 0, 1L, SECONDS, new ArrayBlockingQueue<Runnable>(10), new SimpleThreadFactory(), new NoOpREHandler()); shouldThrow(); } catch (IllegalArgumentException success) {} }
|
/**
* Constructor throws if maximumPoolSize is equal to zero
*/
|
Constructor throws if maximumPoolSize is equal to zero
|
testConstructor18
|
{
"repo_name": "YouDiSN/OpenJDK-Research",
"path": "jdk9/jdk/test/java/util/concurrent/tck/ThreadPoolExecutorTest.java",
"license": "gpl-2.0",
"size": 80711
}
|
[
"java.util.concurrent.ArrayBlockingQueue",
"java.util.concurrent.ThreadPoolExecutor"
] |
import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.*;
|
[
"java.util"
] |
java.util;
| 914,481
|
@Override public void exitTitle_string(@NotNull CSSParser.Title_stringContext ctx) { }
|
@Override public void exitTitle_string(@NotNull CSSParser.Title_stringContext ctx) { }
|
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
|
The default implementation does nothing
|
enterTitle_string
|
{
"repo_name": "andra49/CSSGenerator",
"path": "CSSGenerator/src/CSSBaseListener.java",
"license": "mit",
"size": 4957
}
|
[
"org.antlr.v4.runtime.misc.NotNull"
] |
import org.antlr.v4.runtime.misc.NotNull;
|
import org.antlr.v4.runtime.misc.*;
|
[
"org.antlr.v4"
] |
org.antlr.v4;
| 385,980
|
private void processEFactor(Connection connection)
throws SQLException, ObjectStoreException {
long bT = System.currentTimeMillis(); // to monitor time spent in the process
ResultSet res = getEFactors(connection);
int count = 0;
int prevRank = -1;
int prevSub = -1;
ExperimentalFactor ef = null;
String name = null;
while (res.next()) {
Integer submissionId = new Integer(res.getInt("experiment_id"));
if (deletedSubMap.containsKey(submissionId)) {
continue;
}
Integer rank = new Integer(res.getInt("rank"));
String value = res.getString("value");
// the data is alternating between EF types and names, in order.
if (submissionId != prevSub) {
// except for the first record, this is a new EF object
if (!res.isFirst()) {
submissionEFMap.put(prevSub, ef);
LOG.info("EF MAP: " + dccIdMap.get(prevSub) + "|" + ef.efNames);
LOG.info("EF MAP types: " + rank + "|" + ef.efTypes);
}
ef = new ExperimentalFactor();
}
if (rank != prevRank || submissionId != prevSub) {
// this is a name
if (getPreferredSynonym(value) != null) {
value = getPreferredSynonym(value);
}
ef.efNames.add(value);
name = value;
count++;
} else {
// this is a type
ef.efTypes.put(name, value);
name = null;
if (res.isLast()) {
submissionEFMap.put(submissionId, ef);
LOG.debug("EF MAP last: " + submissionId + "|" + rank + "|" + ef.efNames);
}
}
prevRank = rank;
prevSub = submissionId;
}
res.close();
LOG.info("created " + count + " experimental factors");
LOG.info("PROCESS TIME experimental factors: " + (System.currentTimeMillis() - bT) + " ms");
}
|
void function(Connection connection) throws SQLException, ObjectStoreException { long bT = System.currentTimeMillis(); ResultSet res = getEFactors(connection); int count = 0; int prevRank = -1; int prevSub = -1; ExperimentalFactor ef = null; String name = null; while (res.next()) { Integer submissionId = new Integer(res.getInt(STR)); if (deletedSubMap.containsKey(submissionId)) { continue; } Integer rank = new Integer(res.getInt("rank")); String value = res.getString("value"); if (submissionId != prevSub) { if (!res.isFirst()) { submissionEFMap.put(prevSub, ef); LOG.info(STR + dccIdMap.get(prevSub) + " " + ef.efNames); LOG.info(STR + rank + " " + ef.efTypes); } ef = new ExperimentalFactor(); } if (rank != prevRank submissionId != prevSub) { if (getPreferredSynonym(value) != null) { value = getPreferredSynonym(value); } ef.efNames.add(value); name = value; count++; } else { ef.efTypes.put(name, value); name = null; if (res.isLast()) { submissionEFMap.put(submissionId, ef); LOG.debug(STR + submissionId + " " + rank + " " + ef.efNames); } } prevRank = rank; prevSub = submissionId; } res.close(); LOG.info(STR + count + STR); LOG.info(STR + (System.currentTimeMillis() - bT) + STR); }
|
/**
* ==========================
* EXPERIMENTAL FACTORS
* ==========================
*/
|
========================== EXPERIMENTAL FACTORS ==========================
|
processEFactor
|
{
"repo_name": "drhee/toxoMine",
"path": "bio/sources/chado-db/main/src/org/intermine/bio/dataconversion/ModEncodeMetaDataProcessor.java",
"license": "lgpl-2.1",
"size": 177770
}
|
[
"java.sql.Connection",
"java.sql.ResultSet",
"java.sql.SQLException",
"org.intermine.objectstore.ObjectStoreException"
] |
import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import org.intermine.objectstore.ObjectStoreException;
|
import java.sql.*; import org.intermine.objectstore.*;
|
[
"java.sql",
"org.intermine.objectstore"
] |
java.sql; org.intermine.objectstore;
| 2,519,049
|
public void AppendBytes(ByteBuffer buf) { data.put(buf); }
|
void functions(ByteBuffer buf) { data.put(buf); }
|
/**
* Append a byte of data to the primary buffer
*/
|
Append a byte of data to the primary buffer
|
AppendByte
|
{
"repo_name": "deniskin82/hypertable",
"path": "src/java/Core/org/hypertable/AsyncComm/CommBuf.java",
"license": "gpl-3.0",
"size": 4204
}
|
[
"java.nio.ByteBuffer"
] |
import java.nio.ByteBuffer;
|
import java.nio.*;
|
[
"java.nio"
] |
java.nio;
| 1,343,006
|
private void setCatalinaHome() {
if (System.getProperty("catalina.home") != null)
return;
File bootstrapJar =
new File(System.getProperty("user.dir"), "bootstrap.jar");
if (bootstrapJar.exists()) {
try {
System.setProperty
("catalina.home",
(new File(System.getProperty("user.dir"), ".."))
.getCanonicalPath());
} catch (Exception e) {
// Ignore
System.setProperty("catalina.home",
System.getProperty("user.dir"));
}
} else {
System.setProperty("catalina.home",
System.getProperty("user.dir"));
}
}
|
void function() { if (System.getProperty(STR) != null) return; File bootstrapJar = new File(System.getProperty(STR), STR); if (bootstrapJar.exists()) { try { System.setProperty (STR, (new File(System.getProperty(STR), "..")) .getCanonicalPath()); } catch (Exception e) { System.setProperty(STR, System.getProperty(STR)); } } else { System.setProperty(STR, System.getProperty(STR)); } }
|
/**
* Set the <code>catalina.home</code> System property to the current
* working directory if it has not been set.
*/
|
Set the <code>catalina.home</code> System property to the current working directory if it has not been set
|
setCatalinaHome
|
{
"repo_name": "devjin24/howtomcatworks",
"path": "bookrefer/jakarta-tomcat-5.0.18-src/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Bootstrap.java",
"license": "apache-2.0",
"size": 15004
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,867,359
|
Collection<V> replaceValues(@Nullable K key, Iterable<? extends V> values);
|
Collection<V> replaceValues(@Nullable K key, Iterable<? extends V> values);
|
/**
* Stores a collection of values with the same key, replacing any existing
* values for that key.
*
* @param key key to store in the multimap
* @param values values to store in the multimap
* @return the collection of replaced values, or an empty collection if no
* values were previously associated with the key. The collection
* <i>may</i> be modifiable, but updating it will have no effect on the
* multimap.
*/
|
Stores a collection of values with the same key, replacing any existing values for that key
|
replaceValues
|
{
"repo_name": "eugeneiiim/AndroidCollections",
"path": "src/com/google/common/collect/Multimap.java",
"license": "apache-2.0",
"size": 9663
}
|
[
"java.util.Collection"
] |
import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 21,989
|
List<GitHubIssue> getIssues(String user, String repo);
|
List<GitHubIssue> getIssues(String user, String repo);
|
/**
* Public operation to return the forks for the given repository.
*
* @param user GitHub user
* @param repo GitHub repository
* @return list of repository issues
*/
|
Public operation to return the forks for the given repository
|
getIssues
|
{
"repo_name": "spring-projects/spring-social-github",
"path": "spring-social-github/src/main/java/org/springframework/social/github/api/RepoOperations.java",
"license": "apache-2.0",
"size": 2978
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,763,302
|
public Subclass timeoutConfiguration(TimeoutConfiguration timeoutConfiguration) {
setTimeoutConfiguration(timeoutConfiguration);
return getSubclass();
}
|
Subclass function(TimeoutConfiguration timeoutConfiguration) { setTimeoutConfiguration(timeoutConfiguration); return getSubclass(); }
|
/**
* Sets the optional timeouts used by the client.
*
* @param timeoutConfiguration The {@link TimeoutConfiguration} object with the custom timeouts.
* @return This object for method chaining.
*/
|
Sets the optional timeouts used by the client
|
timeoutConfiguration
|
{
"repo_name": "jentfoo/aws-sdk-java",
"path": "aws-java-sdk-opensdk/src/main/java/com/amazonaws/opensdk/protect/client/SdkSyncClientBuilder.java",
"license": "apache-2.0",
"size": 10847
}
|
[
"com.amazonaws.opensdk.config.TimeoutConfiguration"
] |
import com.amazonaws.opensdk.config.TimeoutConfiguration;
|
import com.amazonaws.opensdk.config.*;
|
[
"com.amazonaws.opensdk"
] |
com.amazonaws.opensdk;
| 2,525,667
|
public SQFParseException addUndefinedMessage(Token token) {
SQFParseException ex;
if (options.isWarningAsError()) {
ex = new SQFParseException(token, "Possibly undefined variable " + token);
getErrors().add(ex);
} else {
ex = new Warning(token, "Possibly undefined variable " + token);
getWarnings().add((Warning)ex);
}
return ex;
}
|
SQFParseException function(Token token) { SQFParseException ex; if (options.isWarningAsError()) { ex = new SQFParseException(token, STR + token); getErrors().add(ex); } else { ex = new Warning(token, STR + token); getWarnings().add((Warning)ex); } return ex; }
|
/**
* Adds undefined message for specified token.
*
* @param token token of undefined variable
* @return
*/
|
Adds undefined message for specified token
|
addUndefinedMessage
|
{
"repo_name": "SkaceKamen/sqflint",
"path": "src/cz/zipek/sqflint/linter/Linter.java",
"license": "mit",
"size": 6193
}
|
[
"cz.zipek.sqflint.parser.Token"
] |
import cz.zipek.sqflint.parser.Token;
|
import cz.zipek.sqflint.parser.*;
|
[
"cz.zipek.sqflint"
] |
cz.zipek.sqflint;
| 2,472,499
|
private long listOffset(TopicPartition partition, long timestamp) {
while (true) {
RequestFuture<Long> future = sendListOffsetRequest(partition, timestamp);
client.poll(future);
if (future.succeeded())
return future.value();
if (!future.isRetriable())
throw future.exception();
if (future.exception() instanceof InvalidMetadataException)
client.awaitMetadataUpdate();
else
Utils.sleep(retryBackoffMs);
}
}
|
long function(TopicPartition partition, long timestamp) { while (true) { RequestFuture<Long> future = sendListOffsetRequest(partition, timestamp); client.poll(future); if (future.succeeded()) return future.value(); if (!future.isRetriable()) throw future.exception(); if (future.exception() instanceof InvalidMetadataException) client.awaitMetadataUpdate(); else Utils.sleep(retryBackoffMs); } }
|
/**
* Fetch a single offset before the given timestamp for the partition.
*
* @param partition The partition that needs fetching offset.
* @param timestamp The timestamp for fetching offset.
* @return The offset of the message that is published before the given timestamp
*/
|
Fetch a single offset before the given timestamp for the partition
|
listOffset
|
{
"repo_name": "wayilau/kafka",
"path": "clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java",
"license": "apache-2.0",
"size": 25991
}
|
[
"org.apache.kafka.common.TopicPartition",
"org.apache.kafka.common.errors.InvalidMetadataException",
"org.apache.kafka.common.utils.Utils"
] |
import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.errors.InvalidMetadataException; import org.apache.kafka.common.utils.Utils;
|
import org.apache.kafka.common.*; import org.apache.kafka.common.errors.*; import org.apache.kafka.common.utils.*;
|
[
"org.apache.kafka"
] |
org.apache.kafka;
| 823,579
|
public OAuth2Request remove(TokenRequest tokenRequest);
|
OAuth2Request function(TokenRequest tokenRequest);
|
/**
* Look up and return the OAuth2Request associated with the given TokenRequest.
*
* @param tokenRequest
* @return
*/
|
Look up and return the OAuth2Request associated with the given TokenRequest
|
remove
|
{
"repo_name": "jungyang/oauth-client-master",
"path": "spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/implicit/ImplicitGrantService.java",
"license": "apache-2.0",
"size": 1114
}
|
[
"org.springframework.security.oauth2.provider.OAuth2Request",
"org.springframework.security.oauth2.provider.TokenRequest"
] |
import org.springframework.security.oauth2.provider.OAuth2Request; import org.springframework.security.oauth2.provider.TokenRequest;
|
import org.springframework.security.oauth2.provider.*;
|
[
"org.springframework.security"
] |
org.springframework.security;
| 958,302
|
ListenableFuture<TaskInfo> getTaskInfo(TaskId taskId, TaskState currentState);
|
ListenableFuture<TaskInfo> getTaskInfo(TaskId taskId, TaskState currentState);
|
/**
* Gets future info for the task after the state changes from
* {@code current state}. If the task has not been created yet, an
* uninitialized task is created and the future is returned. If the task
* is already in a final state, the info is returned immediately.
* <p>
* NOTE: this design assumes that only tasks that will eventually exist are
* queried.
*/
|
Gets future info for the task after the state changes from current state. If the task has not been created yet, an uninitialized task is created and the future is returned. If the task is already in a final state, the info is returned immediately. queried
|
getTaskInfo
|
{
"repo_name": "Yaliang/presto",
"path": "presto-main/src/main/java/com/facebook/presto/execution/TaskManager.java",
"license": "apache-2.0",
"size": 5194
}
|
[
"com.google.common.util.concurrent.ListenableFuture"
] |
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.*;
|
[
"com.google.common"
] |
com.google.common;
| 2,498,089
|
public final void setTitle(@NonNull CharSequence title) {
this.title.setText(title);
}
|
final void function(@NonNull CharSequence title) { this.title.setText(title); }
|
/**
* Updates the dialog's title.
*/
|
Updates the dialog's title
|
setTitle
|
{
"repo_name": "simarpreetsingharora/puautologin",
"path": "library/src/main/java/com/afollestad/materialdialogs/MaterialDialog.java",
"license": "gpl-3.0",
"size": 73849
}
|
[
"android.support.annotation.NonNull"
] |
import android.support.annotation.NonNull;
|
import android.support.annotation.*;
|
[
"android.support"
] |
android.support;
| 1,409,369
|
private final void createTasks() {
// start thread which periodically stabilizes with successor
this.maintenanceTasks.scheduleWithFixedDelay(new StabilizeTask(
this.localNode, this.references, this.entries),
ChordImpl.STABILIZE_TASK_START,
ChordImpl.STABILIZE_TASK_INTERVAL, TimeUnit.SECONDS);
// start thread which periodically attempts to fix finger table
this.maintenanceTasks.scheduleWithFixedDelay(new FixFingerTask(
this.localNode, this.getID(), this.references),
ChordImpl.FIX_FINGER_TASK_START,
ChordImpl.FIX_FINGER_TASK_INTERVAL, TimeUnit.SECONDS);
// start thread which periodically checks whether predecessor has
// failed
this.maintenanceTasks.scheduleWithFixedDelay(new CheckPredecessorTask(
this.references), ChordImpl.CHECK_PREDECESSOR_TASK_START,
ChordImpl.CHECK_PREDECESSOR_TASK_INTERVAL, TimeUnit.SECONDS);
}
|
final void function() { this.maintenanceTasks.scheduleWithFixedDelay(new StabilizeTask( this.localNode, this.references, this.entries), ChordImpl.STABILIZE_TASK_START, ChordImpl.STABILIZE_TASK_INTERVAL, TimeUnit.SECONDS); this.maintenanceTasks.scheduleWithFixedDelay(new FixFingerTask( this.localNode, this.getID(), this.references), ChordImpl.FIX_FINGER_TASK_START, ChordImpl.FIX_FINGER_TASK_INTERVAL, TimeUnit.SECONDS); this.maintenanceTasks.scheduleWithFixedDelay(new CheckPredecessorTask( this.references), ChordImpl.CHECK_PREDECESSOR_TASK_START, ChordImpl.CHECK_PREDECESSOR_TASK_INTERVAL, TimeUnit.SECONDS); }
|
/**
* Creates the tasks that must be executed periodically to maintain the
* Chord overlay network and schedules them with help of a
* {@link ScheduledExecutorService}.
*/
|
Creates the tasks that must be executed periodically to maintain the Chord overlay network and schedules them with help of a <code>ScheduledExecutorService</code>
|
createTasks
|
{
"repo_name": "yahiaelgamal/PeerBox",
"path": "src/de/uniba/wiai/lspi/chord/service/impl/ChordImpl.java",
"license": "gpl-2.0",
"size": 31341
}
|
[
"java.util.concurrent.TimeUnit"
] |
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.*;
|
[
"java.util"
] |
java.util;
| 2,096,042
|
boolean canCreateSpace = false;
try {
List<MembershipEntry> memberships = getSpaceCreationMemberships();
if(memberships == null || memberships.isEmpty()) {
// no membership - anyone can create a space
canCreateSpace = true;
} else {
Identity userIdentity = ConversationState.getCurrent().getIdentity();
for(MembershipEntry membership : memberships) {
if(userIdentity.isMemberOf(membership)) {
canCreateSpace = true;
break;
}
}
}
} catch(Exception e) {
log.error("Error while checking if the user can create spaces - Cause : " + e.getMessage(), e);
canCreateSpace = false;
}
return canCreateSpace;
}
|
boolean canCreateSpace = false; try { List<MembershipEntry> memberships = getSpaceCreationMemberships(); if(memberships == null memberships.isEmpty()) { canCreateSpace = true; } else { Identity userIdentity = ConversationState.getCurrent().getIdentity(); for(MembershipEntry membership : memberships) { if(userIdentity.isMemberOf(membership)) { canCreateSpace = true; break; } } } } catch(Exception e) { log.error(STR + e.getMessage(), e); canCreateSpace = false; } return canCreateSpace; }
|
/**
* Check if the authenticated user can create spaces
* @return true if the authenticated user can create spaces
*/
|
Check if the authenticated user can create spaces
|
canCreateSpace
|
{
"repo_name": "exo-addons/spaces-administration",
"path": "services/src/main/java/org/exoplatform/addons/spacesadministration/SpacesAdministrationService.java",
"license": "lgpl-3.0",
"size": 5465
}
|
[
"java.util.List",
"org.exoplatform.services.security.ConversationState",
"org.exoplatform.services.security.Identity",
"org.exoplatform.services.security.MembershipEntry"
] |
import java.util.List; import org.exoplatform.services.security.ConversationState; import org.exoplatform.services.security.Identity; import org.exoplatform.services.security.MembershipEntry;
|
import java.util.*; import org.exoplatform.services.security.*;
|
[
"java.util",
"org.exoplatform.services"
] |
java.util; org.exoplatform.services;
| 1,847,004
|
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 Event Hub 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 Event Hub REST API operations
|
listSinglePageAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/OperationsInner.java",
"license": "mit",
"size": 13997
}
|
[
"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;
| 10,573
|
@GET
@Path("/apps/{app-id}/versions/{version-id}/{program-type}/{program-id}/status")
public void getStatus(HttpRequest request, HttpResponder responder,
@PathParam("namespace-id") String namespaceId,
@PathParam("app-id") String appId,
@PathParam("version-id") String versionId,
@PathParam("program-type") String type,
@PathParam("program-id") String programId) throws Exception {
ApplicationId applicationId = new ApplicationId(namespaceId, appId, versionId);
if (SCHEDULES.equals(type)) {
getScheduleStatus(responder, applicationId, programId);
return;
}
ProgramType programType;
try {
programType = ProgramType.valueOfCategoryName(type);
} catch (IllegalArgumentException e) {
throw new BadRequestException(e);
}
ProgramId program = applicationId.program(programType, programId);
ProgramStatus programStatus = lifecycleService.getProgramStatus(program);
Map<String, String> status = ImmutableMap.of("status", programStatus.name());
responder.sendJson(HttpResponseStatus.OK, status);
}
|
@Path(STR) void function(HttpRequest request, HttpResponder responder, @PathParam(STR) String namespaceId, @PathParam(STR) String appId, @PathParam(STR) String versionId, @PathParam(STR) String type, @PathParam(STR) String programId) throws Exception { ApplicationId applicationId = new ApplicationId(namespaceId, appId, versionId); if (SCHEDULES.equals(type)) { getScheduleStatus(responder, applicationId, programId); return; } ProgramType programType; try { programType = ProgramType.valueOfCategoryName(type); } catch (IllegalArgumentException e) { throw new BadRequestException(e); } ProgramId program = applicationId.program(programType, programId); ProgramStatus programStatus = lifecycleService.getProgramStatus(program); Map<String, String> status = ImmutableMap.of(STR, programStatus.name()); responder.sendJson(HttpResponseStatus.OK, status); }
|
/**
* Returns status of a type specified by the type{flows,workflows,mapreduce,spark,services,schedules}.
*/
|
Returns status of a type specified by the type{flows,workflows,mapreduce,spark,services,schedules}
|
getStatus
|
{
"repo_name": "caskdata/cdap",
"path": "cdap-app-fabric/src/main/java/co/cask/cdap/gateway/handlers/ProgramLifecycleHttpHandler.java",
"license": "apache-2.0",
"size": 60900
}
|
[
"co.cask.cdap.common.BadRequestException",
"co.cask.cdap.proto.ProgramStatus",
"co.cask.cdap.proto.ProgramType",
"co.cask.cdap.proto.id.ApplicationId",
"co.cask.cdap.proto.id.ProgramId",
"co.cask.http.HttpResponder",
"com.google.common.collect.ImmutableMap",
"java.util.Map",
"javax.ws.rs.Path",
"javax.ws.rs.PathParam",
"org.jboss.netty.handler.codec.http.HttpRequest",
"org.jboss.netty.handler.codec.http.HttpResponseStatus"
] |
import co.cask.cdap.common.BadRequestException; import co.cask.cdap.proto.ProgramStatus; import co.cask.cdap.proto.ProgramType; import co.cask.cdap.proto.id.ApplicationId; import co.cask.cdap.proto.id.ProgramId; import co.cask.http.HttpResponder; import com.google.common.collect.ImmutableMap; import java.util.Map; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import org.jboss.netty.handler.codec.http.HttpRequest; import org.jboss.netty.handler.codec.http.HttpResponseStatus;
|
import co.cask.cdap.common.*; import co.cask.cdap.proto.*; import co.cask.cdap.proto.id.*; import co.cask.http.*; import com.google.common.collect.*; import java.util.*; import javax.ws.rs.*; import org.jboss.netty.handler.codec.http.*;
|
[
"co.cask.cdap",
"co.cask.http",
"com.google.common",
"java.util",
"javax.ws",
"org.jboss.netty"
] |
co.cask.cdap; co.cask.http; com.google.common; java.util; javax.ws; org.jboss.netty;
| 854,792
|
T merge(T other);
}
// internal settings only
public static final Setting<String> TRIBE_NAME_SETTING = Setting.simpleString("tribe.name", Property.NodeScope);
private final ClusterService clusterService;
private final String[] blockIndicesWrite;
private final String[] blockIndicesRead;
private final String[] blockIndicesMetadata;
private static final String ON_CONFLICT_ANY = "any", ON_CONFLICT_DROP = "drop", ON_CONFLICT_PREFER = "prefer_";
public static final Setting<String> ON_CONFLICT_SETTING = new Setting<>("tribe.on_conflict", ON_CONFLICT_ANY, (s) -> {
switch (s) {
case ON_CONFLICT_ANY:
case ON_CONFLICT_DROP:
return s;
default:
if (s.startsWith(ON_CONFLICT_PREFER) && s.length() > ON_CONFLICT_PREFER.length()) {
return s;
}
throw new IllegalArgumentException(
"Invalid value for [tribe.on_conflict] must be either [any, drop or start with prefer_] but was: [" + s + "]");
}
}, Property.NodeScope);
public static final Setting<Boolean> BLOCKS_METADATA_SETTING =
Setting.boolSetting("tribe.blocks.metadata", false, Property.NodeScope);
public static final Setting<Boolean> BLOCKS_WRITE_SETTING =
Setting.boolSetting("tribe.blocks.write", false, Property.NodeScope);
public static final Setting<List<String>> BLOCKS_WRITE_INDICES_SETTING =
Setting.listSetting("tribe.blocks.write.indices", Collections.emptyList(), Function.identity(), Property.NodeScope);
public static final Setting<List<String>> BLOCKS_READ_INDICES_SETTING =
Setting.listSetting("tribe.blocks.read.indices", Collections.emptyList(), Function.identity(), Property.NodeScope);
public static final Setting<List<String>> BLOCKS_METADATA_INDICES_SETTING =
Setting.listSetting("tribe.blocks.metadata.indices", Collections.emptyList(), Function.identity(), Property.NodeScope);
public static final Set<String> TRIBE_SETTING_KEYS = Sets.newHashSet(TRIBE_NAME_SETTING.getKey(), ON_CONFLICT_SETTING.getKey(),
BLOCKS_METADATA_INDICES_SETTING.getKey(), BLOCKS_METADATA_SETTING.getKey(), BLOCKS_READ_INDICES_SETTING.getKey(), BLOCKS_WRITE_INDICES_SETTING.getKey(), BLOCKS_WRITE_SETTING.getKey());
// these settings should be passed through to each tribe client, if they are not set explicitly
private static final List<Setting<?>> PASS_THROUGH_SETTINGS = Arrays.asList(
NetworkService.GLOBAL_NETWORK_HOST_SETTING,
NetworkService.GLOBAL_NETWORK_BINDHOST_SETTING,
NetworkService.GLOBAL_NETWORK_PUBLISHHOST_SETTING,
TransportSettings.HOST,
TransportSettings.BIND_HOST,
TransportSettings.PUBLISH_HOST
);
private final String onConflict;
private final Set<String> droppedIndices = ConcurrentCollections.newConcurrentSet();
private final List<Node> nodes = new CopyOnWriteArrayList<>();
private final NamedWriteableRegistry namedWriteableRegistry;
public TribeService(Settings settings, ClusterService clusterService, final String tribeNodeId,
NamedWriteableRegistry namedWriteableRegistry, Function<Settings, Node> clientNodeBuilder) {
super(settings);
this.clusterService = clusterService;
this.namedWriteableRegistry = namedWriteableRegistry;
Map<String, Settings> nodesSettings = new HashMap<>(settings.getGroups("tribe", true));
nodesSettings.remove("blocks"); // remove prefix settings that don't indicate a client
nodesSettings.remove("on_conflict"); // remove prefix settings that don't indicate a client
for (Map.Entry<String, Settings> entry : nodesSettings.entrySet()) {
Settings clientSettings = buildClientSettings(entry.getKey(), tribeNodeId, settings, entry.getValue());
nodes.add(clientNodeBuilder.apply(clientSettings));
}
this.blockIndicesMetadata = BLOCKS_METADATA_INDICES_SETTING.get(settings).toArray(Strings.EMPTY_ARRAY);
this.blockIndicesRead = BLOCKS_READ_INDICES_SETTING.get(settings).toArray(Strings.EMPTY_ARRAY);
this.blockIndicesWrite = BLOCKS_WRITE_INDICES_SETTING.get(settings).toArray(Strings.EMPTY_ARRAY);
this.onConflict = ON_CONFLICT_SETTING.get(settings);
}
|
T merge(T other); } public static final Setting<String> TRIBE_NAME_SETTING = Setting.simpleString(STR, Property.NodeScope); private final ClusterService clusterService; private final String[] blockIndicesWrite; private final String[] blockIndicesRead; private final String[] blockIndicesMetadata; private static final String ON_CONFLICT_ANY = "any", ON_CONFLICT_DROP = "drop", ON_CONFLICT_PREFER = STR; public static final Setting<String> ON_CONFLICT_SETTING = new Setting<>(STR, ON_CONFLICT_ANY, (s) -> { switch (s) { case ON_CONFLICT_ANY: case ON_CONFLICT_DROP: return s; default: if (s.startsWith(ON_CONFLICT_PREFER) && s.length() > ON_CONFLICT_PREFER.length()) { return s; } throw new IllegalArgumentException( STR + s + "]"); } }, Property.NodeScope); public static final Setting<Boolean> BLOCKS_METADATA_SETTING = Setting.boolSetting(STR, false, Property.NodeScope); public static final Setting<Boolean> BLOCKS_WRITE_SETTING = Setting.boolSetting(STR, false, Property.NodeScope); public static final Setting<List<String>> BLOCKS_WRITE_INDICES_SETTING = Setting.listSetting(STR, Collections.emptyList(), Function.identity(), Property.NodeScope); public static final Setting<List<String>> BLOCKS_READ_INDICES_SETTING = Setting.listSetting(STR, Collections.emptyList(), Function.identity(), Property.NodeScope); public static final Setting<List<String>> BLOCKS_METADATA_INDICES_SETTING = Setting.listSetting(STR, Collections.emptyList(), Function.identity(), Property.NodeScope); public static final Set<String> TRIBE_SETTING_KEYS = Sets.newHashSet(TRIBE_NAME_SETTING.getKey(), ON_CONFLICT_SETTING.getKey(), BLOCKS_METADATA_INDICES_SETTING.getKey(), BLOCKS_METADATA_SETTING.getKey(), BLOCKS_READ_INDICES_SETTING.getKey(), BLOCKS_WRITE_INDICES_SETTING.getKey(), BLOCKS_WRITE_SETTING.getKey()); private static final List<Setting<?>> PASS_THROUGH_SETTINGS = Arrays.asList( NetworkService.GLOBAL_NETWORK_HOST_SETTING, NetworkService.GLOBAL_NETWORK_BINDHOST_SETTING, NetworkService.GLOBAL_NETWORK_PUBLISHHOST_SETTING, TransportSettings.HOST, TransportSettings.BIND_HOST, TransportSettings.PUBLISH_HOST ); private final String onConflict; private final Set<String> droppedIndices = ConcurrentCollections.newConcurrentSet(); private final List<Node> nodes = new CopyOnWriteArrayList<>(); private final NamedWriteableRegistry namedWriteableRegistry; public TribeService(Settings settings, ClusterService clusterService, final String tribeNodeId, NamedWriteableRegistry namedWriteableRegistry, Function<Settings, Node> clientNodeBuilder) { super(settings); this.clusterService = clusterService; this.namedWriteableRegistry = namedWriteableRegistry; Map<String, Settings> nodesSettings = new HashMap<>(settings.getGroups("tribe", true)); nodesSettings.remove(STR); nodesSettings.remove(STR); for (Map.Entry<String, Settings> entry : nodesSettings.entrySet()) { Settings clientSettings = buildClientSettings(entry.getKey(), tribeNodeId, settings, entry.getValue()); nodes.add(clientNodeBuilder.apply(clientSettings)); } this.blockIndicesMetadata = BLOCKS_METADATA_INDICES_SETTING.get(settings).toArray(Strings.EMPTY_ARRAY); this.blockIndicesRead = BLOCKS_READ_INDICES_SETTING.get(settings).toArray(Strings.EMPTY_ARRAY); this.blockIndicesWrite = BLOCKS_WRITE_INDICES_SETTING.get(settings).toArray(Strings.EMPTY_ARRAY); this.onConflict = ON_CONFLICT_SETTING.get(settings); }
|
/**
* Merges this custom metadata with other, returning either this or <code>other</code> custom metadata
* for tribe cluster state. This method should not mutate either <code>this</code> or the
* <code>other</code> custom metadata.
*
* @param other custom meta data
* @return the same instance or <code>other</code> custom metadata based on implementation
* if both the instances are considered equal, implementations should return this
* instance to avoid redundant cluster state changes.
*/
|
Merges this custom metadata with other, returning either this or <code>other</code> custom metadata for tribe cluster state. This method should not mutate either <code>this</code> or the <code>other</code> custom metadata
|
merge
|
{
"repo_name": "alexshadow007/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/tribe/TribeService.java",
"license": "apache-2.0",
"size": 33128
}
|
[
"java.util.Arrays",
"java.util.Collections",
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"java.util.Set",
"java.util.concurrent.CopyOnWriteArrayList",
"java.util.function.Function",
"org.elasticsearch.cluster.service.ClusterService",
"org.elasticsearch.common.Strings",
"org.elasticsearch.common.io.stream.NamedWriteableRegistry",
"org.elasticsearch.common.network.NetworkService",
"org.elasticsearch.common.settings.Setting",
"org.elasticsearch.common.settings.Settings",
"org.elasticsearch.common.util.concurrent.ConcurrentCollections",
"org.elasticsearch.common.util.set.Sets",
"org.elasticsearch.node.Node",
"org.elasticsearch.transport.TransportSettings"
] |
import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import java.util.function.Function; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.network.NetworkService; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.node.Node; import org.elasticsearch.transport.TransportSettings;
|
import java.util.*; import java.util.concurrent.*; import java.util.function.*; import org.elasticsearch.cluster.service.*; import org.elasticsearch.common.*; import org.elasticsearch.common.io.stream.*; import org.elasticsearch.common.network.*; import org.elasticsearch.common.settings.*; import org.elasticsearch.common.util.concurrent.*; import org.elasticsearch.common.util.set.*; import org.elasticsearch.node.*; import org.elasticsearch.transport.*;
|
[
"java.util",
"org.elasticsearch.cluster",
"org.elasticsearch.common",
"org.elasticsearch.node",
"org.elasticsearch.transport"
] |
java.util; org.elasticsearch.cluster; org.elasticsearch.common; org.elasticsearch.node; org.elasticsearch.transport;
| 1,437,261
|
public String getBundlerClass() {
return bundlerClass.equals(NoneArgsBundler.class.getCanonicalName()) ? null : bundlerClass;
}
|
String function() { return bundlerClass.equals(NoneArgsBundler.class.getCanonicalName()) ? null : bundlerClass; }
|
/**
* Get the full qualified name of the ArgsBundler class.
*
* @return null if no custom bundler has been set. Otherwise the fully qualified name of the
* custom bundler class.
*/
|
Get the full qualified name of the ArgsBundler class
|
getBundlerClass
|
{
"repo_name": "sockeqwe/fragmentargs",
"path": "processor/src/main/java/com/hannesdorfmann/fragmentargs/processor/ArgumentAnnotatedField.java",
"license": "apache-2.0",
"size": 7514
}
|
[
"com.hannesdorfmann.fragmentargs.bundler.NoneArgsBundler"
] |
import com.hannesdorfmann.fragmentargs.bundler.NoneArgsBundler;
|
import com.hannesdorfmann.fragmentargs.bundler.*;
|
[
"com.hannesdorfmann.fragmentargs"
] |
com.hannesdorfmann.fragmentargs;
| 1,879,137
|
public FragmentDescriptor getFragmentFromJar (Resource jar, List<FragmentDescriptor> frags)
throws Exception
{
//check if the jar has a web-fragment.xml
FragmentDescriptor d = null;
for (FragmentDescriptor frag: frags)
{
Resource fragResource = frag.getResource(); //eg jar:file:///a/b/c/foo.jar!/META-INF/web-fragment.xml
if (Resource.isContainedIn(fragResource,jar))
{
d = frag;
break;
}
}
return d;
}
|
FragmentDescriptor function (Resource jar, List<FragmentDescriptor> frags) throws Exception { FragmentDescriptor d = null; for (FragmentDescriptor frag: frags) { Resource fragResource = frag.getResource(); if (Resource.isContainedIn(fragResource,jar)) { d = frag; break; } } return d; }
|
/**
* Get the web-fragment.xml from a jar
*
* @param jar
* @param frags
* @return
* @throws Exception
*/
|
Get the web-fragment.xml from a jar
|
getFragmentFromJar
|
{
"repo_name": "xmpace/jetty-read",
"path": "jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationConfiguration.java",
"license": "apache-2.0",
"size": 21877
}
|
[
"java.util.List",
"org.eclipse.jetty.util.resource.Resource",
"org.eclipse.jetty.webapp.FragmentDescriptor"
] |
import java.util.List; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.FragmentDescriptor;
|
import java.util.*; import org.eclipse.jetty.util.resource.*; import org.eclipse.jetty.webapp.*;
|
[
"java.util",
"org.eclipse.jetty"
] |
java.util; org.eclipse.jetty;
| 1,332,899
|
@Override
protected void onBoundsChange(Rect bounds) {
super.onBoundsChange(bounds);
updateShape();
}
|
void function(Rect bounds) { super.onBoundsChange(bounds); updateShape(); }
|
/**
* Called when the bounds of the drawable changes due to layout
*
* @param bounds The new bounds of the drawable
*/
|
Called when the bounds of the drawable changes due to layout
|
onBoundsChange
|
{
"repo_name": "yggie/pulltorefresh",
"path": "PullToRefreshLib/src/main/java/com/github/yggie/pulltorefresh/StatusView.java",
"license": "mit",
"size": 15276
}
|
[
"android.graphics.Rect"
] |
import android.graphics.Rect;
|
import android.graphics.*;
|
[
"android.graphics"
] |
android.graphics;
| 371,776
|
public void setParameter(String name, Object value) {
if (DOMConstants.DOM_ERROR_HANDLER_PARAM.equals(name)) {
if (value != null && !(value instanceof DOMErrorHandler)) {
throw createDOMException
((short) 17 ,
"domconfig.param.type",
new Object[] { name });
}
errorHandler = value;
return;
}
Integer i = (Integer) booleanParamIndexes.get(name);
if (i == null) {
throw createDOMException
(DOMException.NOT_FOUND_ERR,
"domconfig.param.not.found",
new Object[] { name });
}
if (value == null) {
throw createDOMException
(DOMException.NOT_SUPPORTED_ERR,
"domconfig.param.value",
new Object[] { name });
}
if (!(value instanceof Boolean)) {
throw createDOMException
((short) 17 ,
"domconfig.param.type",
new Object[] { name });
}
int index = i.intValue();
boolean val = ((Boolean) value).booleanValue();
if (booleanParamReadOnly[index]
&& booleanParamValues[index] != val) {
throw createDOMException
(DOMException.NOT_SUPPORTED_ERR,
"domconfig.param.value",
new Object[] { name });
}
booleanParamValues[index] = val;
if (name.equals(DOMConstants.DOM_INFOSET_PARAM)) {
setParameter(DOMConstants.DOM_VALIDATE_IF_SCHEMA_PARAM, Boolean.FALSE);
setParameter(DOMConstants.DOM_ENTITIES_PARAM, Boolean.FALSE);
setParameter(DOMConstants.DOM_DATATYPE_NORMALIZATION_PARAM, Boolean.FALSE);
setParameter(DOMConstants.DOM_CDATA_SECTIONS_PARAM, Boolean.FALSE);
setParameter(DOMConstants.DOM_WELL_FORMED_PARAM, Boolean.TRUE);
setParameter(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE_PARAM, Boolean.TRUE);
setParameter(DOMConstants.DOM_COMMENTS_PARAM, Boolean.TRUE);
setParameter(DOMConstants.DOM_NAMESPACES_PARAM, Boolean.TRUE);
}
}
|
void function(String name, Object value) { if (DOMConstants.DOM_ERROR_HANDLER_PARAM.equals(name)) { if (value != null && !(value instanceof DOMErrorHandler)) { throw createDOMException ((short) 17 , STR, new Object[] { name }); } errorHandler = value; return; } Integer i = (Integer) booleanParamIndexes.get(name); if (i == null) { throw createDOMException (DOMException.NOT_FOUND_ERR, STR, new Object[] { name }); } if (value == null) { throw createDOMException (DOMException.NOT_SUPPORTED_ERR, STR, new Object[] { name }); } if (!(value instanceof Boolean)) { throw createDOMException ((short) 17 , STR, new Object[] { name }); } int index = i.intValue(); boolean val = ((Boolean) value).booleanValue(); if (booleanParamReadOnly[index] && booleanParamValues[index] != val) { throw createDOMException (DOMException.NOT_SUPPORTED_ERR, STR, new Object[] { name }); } booleanParamValues[index] = val; if (name.equals(DOMConstants.DOM_INFOSET_PARAM)) { setParameter(DOMConstants.DOM_VALIDATE_IF_SCHEMA_PARAM, Boolean.FALSE); setParameter(DOMConstants.DOM_ENTITIES_PARAM, Boolean.FALSE); setParameter(DOMConstants.DOM_DATATYPE_NORMALIZATION_PARAM, Boolean.FALSE); setParameter(DOMConstants.DOM_CDATA_SECTIONS_PARAM, Boolean.FALSE); setParameter(DOMConstants.DOM_WELL_FORMED_PARAM, Boolean.TRUE); setParameter(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE_PARAM, Boolean.TRUE); setParameter(DOMConstants.DOM_COMMENTS_PARAM, Boolean.TRUE); setParameter(DOMConstants.DOM_NAMESPACES_PARAM, Boolean.TRUE); } }
|
/**
* Sets the given parameter.
*/
|
Sets the given parameter
|
setParameter
|
{
"repo_name": "adufilie/flex-sdk",
"path": "modules/thirdparty/batik/sources/org/apache/flex/forks/batik/dom/AbstractDocument.java",
"license": "apache-2.0",
"size": 95805
}
|
[
"org.apache.flex.forks.batik.util.DOMConstants",
"org.w3c.dom.DOMErrorHandler",
"org.w3c.dom.DOMException"
] |
import org.apache.flex.forks.batik.util.DOMConstants; import org.w3c.dom.DOMErrorHandler; import org.w3c.dom.DOMException;
|
import org.apache.flex.forks.batik.util.*; import org.w3c.dom.*;
|
[
"org.apache.flex",
"org.w3c.dom"
] |
org.apache.flex; org.w3c.dom;
| 1,088,574
|
public void insertUpdate(DocumentEvent e) {
documentChanged(e);
}
|
void function(DocumentEvent e) { documentChanged(e); }
|
/**
* Gives notification that there was an insert into the document. The range
* given by the DocumentEvent bounds the freshly inserted region.
* @param e the document event
*/
|
Gives notification that there was an insert into the document. The range given by the DocumentEvent bounds the freshly inserted region
|
insertUpdate
|
{
"repo_name": "amon-ra/jbackpack",
"path": "src/ch/fhnw/jbackpack/BackupMainPanel.java",
"license": "gpl-3.0",
"size": 263918
}
|
[
"javax.swing.event.DocumentEvent"
] |
import javax.swing.event.DocumentEvent;
|
import javax.swing.event.*;
|
[
"javax.swing"
] |
javax.swing;
| 1,245,137
|
EndpointUriFactory getEndpointUriFactory(String scheme);
|
EndpointUriFactory getEndpointUriFactory(String scheme);
|
/**
* Gets the {@link EndpointUriFactory} for the given component name.
*/
|
Gets the <code>EndpointUriFactory</code> for the given component name
|
getEndpointUriFactory
|
{
"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.spi.EndpointUriFactory"
] |
import org.apache.camel.spi.EndpointUriFactory;
|
import org.apache.camel.spi.*;
|
[
"org.apache.camel"
] |
org.apache.camel;
| 2,479,433
|
@IgniteSpiConfiguration(optional = true)
public TcpCommunicationSpi setDirectBuffer(boolean directBuf) {
this.directBuf = directBuf;
return this;
}
|
@IgniteSpiConfiguration(optional = true) TcpCommunicationSpi function(boolean directBuf) { this.directBuf = directBuf; return this; }
|
/**
* Sets flag to allocate direct or heap buffer in SPI.
* If value is {@code true}, then SPI will use {@link ByteBuffer#allocateDirect(int)} call.
* Otherwise, SPI will use {@link ByteBuffer#allocate(int)} call.
* <p>
* If not provided, default value is {@code true}.
*
* @param directBuf Flag indicates to allocate direct or heap buffer in SPI.
* @return {@code this} for chaining.
*/
|
Sets flag to allocate direct or heap buffer in SPI. If value is true, then SPI will use <code>ByteBuffer#allocateDirect(int)</code> call. Otherwise, SPI will use <code>ByteBuffer#allocate(int)</code> call. If not provided, default value is true
|
setDirectBuffer
|
{
"repo_name": "amirakhmedov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java",
"license": "apache-2.0",
"size": 184489
}
|
[
"org.apache.ignite.spi.IgniteSpiConfiguration"
] |
import org.apache.ignite.spi.IgniteSpiConfiguration;
|
import org.apache.ignite.spi.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 1,904,266
|
protected void addCheckRule(
CmsXmlContentDefinition contentDefinition,
String elementName,
String invalidate,
String type) throws CmsXmlException {
I_CmsXmlSchemaType schemaType = contentDefinition.getSchemaType(elementName);
if (schemaType == null) {
// no element with the given name
throw new CmsXmlException(Messages.get().container(
Messages.ERR_XMLCONTENT_CHECK_INVALID_ELEM_1,
elementName));
}
if (!CmsXmlVfsFileValue.TYPE_NAME.equals(schemaType.getTypeName())
&& !CmsXmlVarLinkValue.TYPE_NAME.equals(schemaType.getTypeName())) {
// element is not a OpenCmsVfsFile
throw new CmsXmlException(Messages.get().container(
Messages.ERR_XMLCONTENT_CHECK_INVALID_TYPE_1,
elementName));
}
// cache the check rule data
Boolean invalidateParent = null;
if ((invalidate == null)
|| invalidate.equalsIgnoreCase(Boolean.TRUE.toString())
|| invalidate.equalsIgnoreCase(APPINFO_ATTR_TYPE_NODE)) {
invalidateParent = Boolean.FALSE;
} else if (invalidate.equalsIgnoreCase(APPINFO_ATTR_TYPE_PARENT)) {
invalidateParent = Boolean.TRUE;
}
if (invalidateParent != null) {
m_relations.put(elementName, invalidateParent);
}
CmsRelationType relationType = (type == null ? CmsRelationType.XML_WEAK : CmsRelationType.valueOfXml(type));
m_relations.put(RELATION_TYPE_PREFIX + elementName, relationType);
if (invalidateParent != null) {
// check the whole xpath hierarchy
String path = elementName;
while (CmsStringUtil.isNotEmptyOrWhitespaceOnly(path)) {
if (!isInvalidateParent(path)) {
// if invalidate type = node, then the node needs to be optional
if (contentDefinition.getSchemaType(path).getMinOccurs() > 0) {
// element is not optional
throw new CmsXmlException(Messages.get().container(
Messages.ERR_XMLCONTENT_CHECK_NOT_OPTIONAL_1,
path));
}
// no need to further check
break;
} else if (!CmsXmlUtils.isDeepXpath(path)) {
// if invalidate type = parent, then the node needs to be nested
// document root can not be invalidated
throw new CmsXmlException(Messages.get().container(Messages.ERR_XMLCONTENT_CHECK_NOT_EMPTY_DOC_0));
}
path = CmsXmlUtils.removeLastXpathElement(path);
}
}
}
|
void function( CmsXmlContentDefinition contentDefinition, String elementName, String invalidate, String type) throws CmsXmlException { I_CmsXmlSchemaType schemaType = contentDefinition.getSchemaType(elementName); if (schemaType == null) { throw new CmsXmlException(Messages.get().container( Messages.ERR_XMLCONTENT_CHECK_INVALID_ELEM_1, elementName)); } if (!CmsXmlVfsFileValue.TYPE_NAME.equals(schemaType.getTypeName()) && !CmsXmlVarLinkValue.TYPE_NAME.equals(schemaType.getTypeName())) { throw new CmsXmlException(Messages.get().container( Messages.ERR_XMLCONTENT_CHECK_INVALID_TYPE_1, elementName)); } Boolean invalidateParent = null; if ((invalidate == null) invalidate.equalsIgnoreCase(Boolean.TRUE.toString()) invalidate.equalsIgnoreCase(APPINFO_ATTR_TYPE_NODE)) { invalidateParent = Boolean.FALSE; } else if (invalidate.equalsIgnoreCase(APPINFO_ATTR_TYPE_PARENT)) { invalidateParent = Boolean.TRUE; } if (invalidateParent != null) { m_relations.put(elementName, invalidateParent); } CmsRelationType relationType = (type == null ? CmsRelationType.XML_WEAK : CmsRelationType.valueOfXml(type)); m_relations.put(RELATION_TYPE_PREFIX + elementName, relationType); if (invalidateParent != null) { String path = elementName; while (CmsStringUtil.isNotEmptyOrWhitespaceOnly(path)) { if (!isInvalidateParent(path)) { if (contentDefinition.getSchemaType(path).getMinOccurs() > 0) { throw new CmsXmlException(Messages.get().container( Messages.ERR_XMLCONTENT_CHECK_NOT_OPTIONAL_1, path)); } break; } else if (!CmsXmlUtils.isDeepXpath(path)) { throw new CmsXmlException(Messages.get().container(Messages.ERR_XMLCONTENT_CHECK_NOT_EMPTY_DOC_0)); } path = CmsXmlUtils.removeLastXpathElement(path); } } }
|
/**
* Adds a check rule for a specified element.<p>
*
* @param contentDefinition the XML content definition this XML content handler belongs to
* @param elementName the element name to add the rule to
* @param invalidate
* <code>false</code>, to disable link check
* <code>true</code> or <code>node</code>, to invalidate just the single node if the link is broken
* <code>parent</code>, if this rule will invalidate the whole parent node in nested content
* @param type the relation type
*
* @throws CmsXmlException in case an unknown element name is used
*/
|
Adds a check rule for a specified element
|
addCheckRule
|
{
"repo_name": "comundus/opencms-comundus",
"path": "src/main/java/org/opencms/xml/content/CmsDefaultXmlContentHandler.java",
"license": "lgpl-2.1",
"size": 81088
}
|
[
"org.opencms.relations.CmsRelationType",
"org.opencms.util.CmsStringUtil",
"org.opencms.xml.CmsXmlContentDefinition",
"org.opencms.xml.CmsXmlException",
"org.opencms.xml.CmsXmlUtils",
"org.opencms.xml.types.CmsXmlVarLinkValue",
"org.opencms.xml.types.CmsXmlVfsFileValue"
] |
import org.opencms.relations.CmsRelationType; import org.opencms.util.CmsStringUtil; import org.opencms.xml.CmsXmlContentDefinition; import org.opencms.xml.CmsXmlException; import org.opencms.xml.CmsXmlUtils; import org.opencms.xml.types.CmsXmlVarLinkValue; import org.opencms.xml.types.CmsXmlVfsFileValue;
|
import org.opencms.relations.*; import org.opencms.util.*; import org.opencms.xml.*; import org.opencms.xml.types.*;
|
[
"org.opencms.relations",
"org.opencms.util",
"org.opencms.xml"
] |
org.opencms.relations; org.opencms.util; org.opencms.xml;
| 2,019,625
|
@Override
public Response exportAPIProduct(String name, String version, String providerName, String revisionNumber,
String format, Boolean preserveStatus, Boolean exportLatestRevision,
MessageContext messageContext) throws APIManagementException {
//If not specified status is preserved by default
preserveStatus = preserveStatus == null || preserveStatus;
// Default export format is YAML
ExportFormat exportFormat = StringUtils.isNotEmpty(format) ? ExportFormat.valueOf(format.toUpperCase()) :
ExportFormat.YAML;
ImportExportAPI importExportAPI = APIImportExportUtil.getImportExportAPI();
try {
File file =
importExportAPI.exportAPIProduct(null, name, version, providerName, revisionNumber, exportFormat,
preserveStatus, true, true, exportLatestRevision);
return Response.ok(file)
.header(RestApiConstants.HEADER_CONTENT_DISPOSITION, "attachment; filename=\""
+ file.getName() + "\"")
.build();
} catch (APIManagementException | APIImportExportException e) {
RestApiUtil.handleInternalServerError("Error while exporting " +
RestApiConstants.RESOURCE_API_PRODUCT, e, log);
}
return null;
}
|
Response function(String name, String version, String providerName, String revisionNumber, String format, Boolean preserveStatus, Boolean exportLatestRevision, MessageContext messageContext) throws APIManagementException { preserveStatus = preserveStatus == null preserveStatus; ExportFormat exportFormat = StringUtils.isNotEmpty(format) ? ExportFormat.valueOf(format.toUpperCase()) : ExportFormat.YAML; ImportExportAPI importExportAPI = APIImportExportUtil.getImportExportAPI(); try { File file = importExportAPI.exportAPIProduct(null, name, version, providerName, revisionNumber, exportFormat, preserveStatus, true, true, exportLatestRevision); return Response.ok(file) .header(RestApiConstants.HEADER_CONTENT_DISPOSITION, STRSTR\STRError while exporting " + RestApiConstants.RESOURCE_API_PRODUCT, e, log); } return null; }
|
/**
* Exports an API Product from API Manager. Meta information, API Product icon, documentation, client certificates
* and dependent APIs are exported. This service generates a zipped archive which contains all the above mentioned
* resources for a given API Product.
*
* @param name Name of the API Product that needs to be exported
* @param version Version of the API Product that needs to be exported
* @param providerName Provider name of the API Product that needs to be exported
* @param format Format of output documents. Can be YAML or JSON
* @param preserveStatus Preserve API Product status on export
* @param messageContext Message Context
* @return Zipped file containing exported API Product
* @throws APIManagementException
*/
|
Exports an API Product from API Manager. Meta information, API Product icon, documentation, client certificates and dependent APIs are exported. This service generates a zipped archive which contains all the above mentioned resources for a given API Product
|
exportAPIProduct
|
{
"repo_name": "tharikaGitHub/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/impl/ApiProductsApiServiceImpl.java",
"license": "apache-2.0",
"size": 60847
}
|
[
"java.io.File",
"javax.ws.rs.core.Response",
"org.apache.commons.lang3.StringUtils",
"org.apache.cxf.jaxrs.ext.MessageContext",
"org.wso2.carbon.apimgt.api.APIManagementException",
"org.wso2.carbon.apimgt.impl.importexport.ExportFormat",
"org.wso2.carbon.apimgt.impl.importexport.ImportExportAPI",
"org.wso2.carbon.apimgt.impl.importexport.utils.APIImportExportUtil",
"org.wso2.carbon.apimgt.rest.api.common.RestApiConstants"
] |
import java.io.File; import javax.ws.rs.core.Response; import org.apache.commons.lang3.StringUtils; import org.apache.cxf.jaxrs.ext.MessageContext; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.impl.importexport.ExportFormat; import org.wso2.carbon.apimgt.impl.importexport.ImportExportAPI; import org.wso2.carbon.apimgt.impl.importexport.utils.APIImportExportUtil; import org.wso2.carbon.apimgt.rest.api.common.RestApiConstants;
|
import java.io.*; import javax.ws.rs.core.*; import org.apache.commons.lang3.*; import org.apache.cxf.jaxrs.ext.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.impl.importexport.*; import org.wso2.carbon.apimgt.impl.importexport.utils.*; import org.wso2.carbon.apimgt.rest.api.common.*;
|
[
"java.io",
"javax.ws",
"org.apache.commons",
"org.apache.cxf",
"org.wso2.carbon"
] |
java.io; javax.ws; org.apache.commons; org.apache.cxf; org.wso2.carbon;
| 1,436,889
|
private void findTargets(Board board) {
// Initializashuns!
targetPlaces = new ArrayList<Integer[]>();
settledPieces = new ArrayList<Integer[]>();
boolean lastRowFull = true;
if (color == 1) { // Red, bottom
for (int row = 0; row < 17; row++) {
if (lastRowFull) {
for (int col = 0; col < 17; col++) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
}
} else return;
}
} else if (color == 2) { // Orange, bottom left
for (int col = 0; col < 17; col++) {
if (lastRowFull) {
for (int row = 0; row < 17; row++) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
}
} else return;
}
} else if (color == 3) { // Yellow, top right
if (board.getBoard()[12][4] == 0) {
targetPlaces.add(new Integer[] {12, 4});
lastRowFull = false;
} else settledPieces.add(new Integer[] {12, 4});
if (lastRowFull) {
int row = 11, col = 4;
while (row < 13 && col < 6) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
row++;
col++;
}
}
if (lastRowFull) {
int row = 10, col = 4;
while (row < 13 && col < 7) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
row++;
col++;
}
}
if (lastRowFull) {
int row = 9, col = 4;
while (row < 13 && col < 8) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
row++;
col++;
}
}
if (lastRowFull) {
int row = 8, col = 4;
while (row < 13 && col < 9) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
row++;
col++;
}
}
if (lastRowFull) {
int row = 7, col = 4;
while (row < 13 && col < 10) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
row++;
col++;
}
}
if (lastRowFull) {
int row = 6, col = 4;
while (row < 13 && col < 11) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
row++;
col++;
}
}
} else if (color == 4) { // Green, top
for (int row = 16; row >= 0; row--) {
if (lastRowFull) {
for (int col = 0; col < 17; col++) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
}
} else return;
}
} else if (color == 5) { // Blue, top left
for (int col = 16; col >= 0; col--) {
if (lastRowFull) {
for (int row = 0; row < 17; row++) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
}
} else return;
}
} else if (color == 6) { // Purple, bottom left
if (board.getBoard()[4][12] == 0) {
targetPlaces.add(new Integer[] {4, 12});
lastRowFull = false;
} else settledPieces.add(new Integer[] {4, 12});
if (lastRowFull) {
int row = 4, col = 11;
while (row < 6 && col < 13) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
row++;
col++;
}
}
if (lastRowFull) {
int row = 4, col = 10;
while (row < 7 && col < 13) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
row++;
col++;
}
}
if (lastRowFull) {
int row = 4, col = 9;
while (row < 8 && col < 13) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
row++;
col++;
}
}
if (lastRowFull) {
int row = 4, col = 8;
while (row < 9 && col < 13) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
row++;
col++;
}
}
if (lastRowFull) {
int row = 4, col = 7;
while (row < 10 && col < 13) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
row++;
col++;
}
}
if (lastRowFull) {
int row = 4, col = 6;
while (row < 11 && col < 13) {
if (board.getBoard()[row][col] == 0) {
lastRowFull = false;
targetPlaces.add(new Integer[] {row, col});
} else if (board.getBoard()[row][col] != -1) {
settledPieces.add(new Integer[] {row, col});
}
row++;
col++;
}
}
} else System.out.println("you dun goofed, son");
}
|
void function(Board board) { targetPlaces = new ArrayList<Integer[]>(); settledPieces = new ArrayList<Integer[]>(); boolean lastRowFull = true; if (color == 1) { for (int row = 0; row < 17; row++) { if (lastRowFull) { for (int col = 0; col < 17; col++) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } } } else return; } } else if (color == 2) { for (int col = 0; col < 17; col++) { if (lastRowFull) { for (int row = 0; row < 17; row++) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } } } else return; } } else if (color == 3) { if (board.getBoard()[12][4] == 0) { targetPlaces.add(new Integer[] {12, 4}); lastRowFull = false; } else settledPieces.add(new Integer[] {12, 4}); if (lastRowFull) { int row = 11, col = 4; while (row < 13 && col < 6) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } row++; col++; } } if (lastRowFull) { int row = 10, col = 4; while (row < 13 && col < 7) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } row++; col++; } } if (lastRowFull) { int row = 9, col = 4; while (row < 13 && col < 8) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } row++; col++; } } if (lastRowFull) { int row = 8, col = 4; while (row < 13 && col < 9) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } row++; col++; } } if (lastRowFull) { int row = 7, col = 4; while (row < 13 && col < 10) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } row++; col++; } } if (lastRowFull) { int row = 6, col = 4; while (row < 13 && col < 11) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } row++; col++; } } } else if (color == 4) { for (int row = 16; row >= 0; row--) { if (lastRowFull) { for (int col = 0; col < 17; col++) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } } } else return; } } else if (color == 5) { for (int col = 16; col >= 0; col--) { if (lastRowFull) { for (int row = 0; row < 17; row++) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } } } else return; } } else if (color == 6) { if (board.getBoard()[4][12] == 0) { targetPlaces.add(new Integer[] {4, 12}); lastRowFull = false; } else settledPieces.add(new Integer[] {4, 12}); if (lastRowFull) { int row = 4, col = 11; while (row < 6 && col < 13) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } row++; col++; } } if (lastRowFull) { int row = 4, col = 10; while (row < 7 && col < 13) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } row++; col++; } } if (lastRowFull) { int row = 4, col = 9; while (row < 8 && col < 13) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } row++; col++; } } if (lastRowFull) { int row = 4, col = 8; while (row < 9 && col < 13) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } row++; col++; } } if (lastRowFull) { int row = 4, col = 7; while (row < 10 && col < 13) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } row++; col++; } } if (lastRowFull) { int row = 4, col = 6; while (row < 11 && col < 13) { if (board.getBoard()[row][col] == 0) { lastRowFull = false; targetPlaces.add(new Integer[] {row, col}); } else if (board.getBoard()[row][col] != -1) { settledPieces.add(new Integer[] {row, col}); } row++; col++; } } } else System.out.println(STR); }
|
/**
* Locates the farthest row that needs to be filled given the player
* @param board Current state of the board
*/
|
Locates the farthest row that needs to be filled given the player
|
findTargets
|
{
"repo_name": "Qwe1rty/ChineseCheckersClient",
"path": "src/Algorithm.java",
"license": "apache-2.0",
"size": 24257
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 136,177
|
private static String buildQueryString(HashMap<String, String> entries) {
StringBuilder sb = new StringBuilder();
Integer entryCount = 0;
for (Entry<String, String> entry : entries.entrySet()) {
if (entryCount > 0) {
sb.append("&");
}
String encodedName = URL.encodeQueryString(entry.getKey());
sb.append(encodedName);
sb.append("=");
String encodedValue = URL.encodeQueryString(entry.getValue());
sb.append(encodedValue);
entryCount++;
}
return sb.toString();
}
|
static String function(HashMap<String, String> entries) { StringBuilder sb = new StringBuilder(); Integer entryCount = 0; for (Entry<String, String> entry : entries.entrySet()) { if (entryCount > 0) { sb.append("&"); } String encodedName = URL.encodeQueryString(entry.getKey()); sb.append(encodedName); sb.append("="); String encodedValue = URL.encodeQueryString(entry.getValue()); sb.append(encodedValue); entryCount++; } return sb.toString(); }
|
/**
* A worker that builds a HTTP query string from a HashMap of key-value
* entries.
*
* @param entries a HashMap of key-value pairs
* @return the query, as a String
*/
|
A worker that builds a HTTP query string from a HashMap of key-value entries
|
buildQueryString
|
{
"repo_name": "mdpiper/wmt-client",
"path": "src/edu/colorado/csdms/wmt/client/control/DataTransfer.java",
"license": "mit",
"size": 46635
}
|
[
"com.google.gwt.http.client.URL",
"java.util.HashMap",
"java.util.Map"
] |
import com.google.gwt.http.client.URL; import java.util.HashMap; import java.util.Map;
|
import com.google.gwt.http.client.*; import java.util.*;
|
[
"com.google.gwt",
"java.util"
] |
com.google.gwt; java.util;
| 973,978
|
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<VpnGatewayInner> resetAsync(String resourceGroupName, String gatewayName) {
return beginResetAsync(resourceGroupName, gatewayName).last().flatMap(this.client::getLroFinalResultOrError);
}
|
@ServiceMethod(returns = ReturnType.SINGLE) Mono<VpnGatewayInner> function(String resourceGroupName, String gatewayName) { return beginResetAsync(resourceGroupName, gatewayName).last().flatMap(this.client::getLroFinalResultOrError); }
|
/**
* Resets the primary of the vpn gateway in the specified resource group.
*
* @param resourceGroupName The resource group name of the VpnGateway.
* @param gatewayName The name of the gateway.
* @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 vpnGateway Resource on successful completion of {@link Mono}.
*/
|
Resets the primary of the vpn gateway in the specified resource group
|
resetAsync
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VpnGatewaysClientImpl.java",
"license": "mit",
"size": 124002
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.network.fluent.models.VpnGatewayInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.network.fluent.models.VpnGatewayInner;
|
import com.azure.core.annotation.*; import com.azure.resourcemanager.network.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 682,113
|
public static QName getNamespaceAndName(DMNModelInstrumentedBase localElement, Map<String, QName> importAliases, QName typeRef, String modelNamespace) {
if (localElement instanceof org.kie.dmn.model.v1_1.KieDMNModelInstrumentedBase) {
if (!typeRef.getPrefix().equals(XMLConstants.DEFAULT_NS_PREFIX)) {
return new QName(localElement.getNamespaceURI(typeRef.getPrefix()), typeRef.getLocalPart());
} else {
for (Entry<String, QName> alias : importAliases.entrySet()) {
String prefix = alias.getKey() + ".";
if (typeRef.getLocalPart().startsWith(prefix)) {
return new QName(alias.getValue().getNamespaceURI(), typeRef.getLocalPart().replace(prefix, ""));
}
}
return new QName(localElement.getNamespaceURI(typeRef.getPrefix()), typeRef.getLocalPart());
}
} else { // DMN v1.2 onwards:
for (BuiltInType bi : DMNTypeRegistryV12.ITEMDEF_TYPEREF_FEEL_BUILTIN) {
for (String biName : bi.getNames()) {
if (biName.equals(typeRef.getLocalPart())) {
return new QName(localElement.getURIFEEL(), typeRef.getLocalPart());
}
}
}
for (Entry<String, QName> alias : importAliases.entrySet()) {
String prefix = alias.getKey() + ".";
if (typeRef.getLocalPart().startsWith(prefix)) {
return new QName(alias.getValue().getNamespaceURI(), typeRef.getLocalPart().replace(prefix, ""));
}
}
for (String nsKey : localElement.recurseNsKeys()) {
String prefix = nsKey + ".";
if (typeRef.getLocalPart().startsWith(prefix)) {
return new QName(localElement.getNamespaceURI(nsKey), typeRef.getLocalPart().replace(prefix, ""));
}
}
return new QName(modelNamespace, typeRef.getLocalPart());
}
}
|
static QName function(DMNModelInstrumentedBase localElement, Map<String, QName> importAliases, QName typeRef, String modelNamespace) { if (localElement instanceof org.kie.dmn.model.v1_1.KieDMNModelInstrumentedBase) { if (!typeRef.getPrefix().equals(XMLConstants.DEFAULT_NS_PREFIX)) { return new QName(localElement.getNamespaceURI(typeRef.getPrefix()), typeRef.getLocalPart()); } else { for (Entry<String, QName> alias : importAliases.entrySet()) { String prefix = alias.getKey() + "."; if (typeRef.getLocalPart().startsWith(prefix)) { return new QName(alias.getValue().getNamespaceURI(), typeRef.getLocalPart().replace(prefix, STR.STRSTR.STR")); } } return new QName(modelNamespace, typeRef.getLocalPart()); } }
|
/**
* Given a typeRef in the form of prefix:localname or importalias.localname, resolves namespace and localname appropriately.
* <br>Example: <code>feel:string</code> would be resolved as <code>http://www.omg.org/spec/FEEL/20140401, string</code>.
* <br>Example: <code>myimport.tPerson</code> assuming an external model namespace as "http://drools.org" would be resolved as <code>http://drools.org, tPerson</code>.
* @param localElement the local element is used to determine the namespace from the prefix if present, as in the form prefix:localname
* @param importAliases the map of import aliases is used to determine the namespace, as in the form importalias.localname
* @param typeRef the typeRef to be resolved.
* @return
*/
|
Given a typeRef in the form of prefix:localname or importalias.localname, resolves namespace and localname appropriately. Example: <code>feel:string</code> would be resolved as <code>HREF string</code>. Example: <code>myimport.tPerson</code> assuming an external model namespace as "HREF" would be resolved as <code>HREF tPerson</code>
|
getNamespaceAndName
|
{
"repo_name": "mbiarnes/drools",
"path": "kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/compiler/DMNCompilerImpl.java",
"license": "apache-2.0",
"size": 36325
}
|
[
"java.util.Map",
"javax.xml.XMLConstants",
"javax.xml.namespace.QName",
"org.kie.dmn.model.api.DMNModelInstrumentedBase"
] |
import java.util.Map; import javax.xml.XMLConstants; import javax.xml.namespace.QName; import org.kie.dmn.model.api.DMNModelInstrumentedBase;
|
import java.util.*; import javax.xml.*; import javax.xml.namespace.*; import org.kie.dmn.model.api.*;
|
[
"java.util",
"javax.xml",
"org.kie.dmn"
] |
java.util; javax.xml; org.kie.dmn;
| 2,877,023
|
protected HttpMethodBase setupConnection(String method, String bucketName, String objectKey, Map requestParameters) throws S3ServiceException
{
if (bucketName == null) {
throw new S3ServiceException("Cannot connect to S3 Service with a null path");
}
String hostname = generateS3HostnameForBucket(bucketName);
// Allow for non-standard virtual directory paths on the server-side
String virtualPath = this.jets3tProperties.getStringProperty(
"s3service.s3-endpoint-virtual-path", "");
// Determine the resource string (ie the item's path in S3, including the bucket name)
String resourceString = "/";
if (hostname.equals(Constants.S3_HOSTNAME) && bucketName != null && bucketName.length() > 0) {
resourceString += bucketName + "/";
}
resourceString += (objectKey != null? RestUtils.encodeUrlString(objectKey) : "");
// Construct a URL representing a connection for the S3 resource.
String url = null;
if (isHttpsOnly()) {
int securePort = this.jets3tProperties.getIntProperty("s3service.s3-endpoint-https-port", 443);
url = "https://" + hostname + ":" + securePort + virtualPath + resourceString;
} else {
int insecurePort = this.jets3tProperties.getIntProperty("s3service.s3-endpoint-http-port", 80);
url = "http://" + hostname + ":" + insecurePort + virtualPath + resourceString;
}
if (log.isDebugEnabled()) {
log.debug("S3 URL: " + url);
}
// Add additional request parameters to the URL for special cases (eg ACL operations)
url = addRequestParametersToUrlPath(url, requestParameters);
HttpMethodBase httpMethod = null;
if ("PUT".equals(method)) {
httpMethod = new PutMethod(url);
} else if ("HEAD".equals(method)) {
httpMethod = new HeadMethod(url);
} else if ("GET".equals(method)) {
httpMethod = new GetMethod(url);
} else if ("DELETE".equals(method)) {
httpMethod = new DeleteMethod(url);
} else {
throw new IllegalArgumentException("Unrecognised HTTP method name: " + method);
}
// Set mandatory Request headers.
if (httpMethod.getRequestHeader("Date") == null) {
httpMethod.setRequestHeader("Date", ServiceUtils.formatRfc822Date(
getCurrentTimeWithOffset()));
}
if (httpMethod.getRequestHeader("Content-Type") == null) {
httpMethod.setRequestHeader("Content-Type", "");
}
// Set DevPay request headers.
if (getDevPayUserToken() != null || getDevPayProductToken() != null) {
// DevPay tokens have been provided, include these with the request.
if (getDevPayProductToken() != null) {
String securityToken = getDevPayUserToken() + "," + getDevPayProductToken();
httpMethod.setRequestHeader("x-amz-security-token", securityToken);
if (log.isDebugEnabled()) {
log.debug("Including DevPay user and product tokens in request: "
+ "x-amz-security-token=" + securityToken);
}
} else {
httpMethod.setRequestHeader("x-amz-security-token", getDevPayUserToken());
if (log.isDebugEnabled()) {
log.debug("Including DevPay user token in request: x-amz-security-token="
+ getDevPayUserToken());
}
}
}
// Set Requester Pays header to allow access to these buckets.
if (this.isRequesterPaysEnabled()) {
String[] requesterPaysHeaderAndValue = Constants.REQUESTER_PAYS_BUCKET_FLAG.split("=");
httpMethod.setRequestHeader(requesterPaysHeaderAndValue[0], requesterPaysHeaderAndValue[1]);
if (log.isDebugEnabled()) {
log.debug("Including Requester Pays header in request: " +
Constants.REQUESTER_PAYS_BUCKET_FLAG);
}
}
return httpMethod;
}
////////////////////////////////////////////////////////////////
// Methods below this point implement S3Service abstract methods
////////////////////////////////////////////////////////////////
|
HttpMethodBase function(String method, String bucketName, String objectKey, Map requestParameters) throws S3ServiceException { if (bucketName == null) { throw new S3ServiceException(STR); } String hostname = generateS3HostnameForBucket(bucketName); String virtualPath = this.jets3tProperties.getStringProperty( STR, STR/STR/STRSTRs3service.s3-endpoint-https-portSTRhttps: } else { int insecurePort = this.jets3tProperties.getIntProperty(STR, 80); url = STRS3 URL: STRPUTSTRHEADSTRGETSTRDELETESTRUnrecognised HTTP method name: STRDateSTRDateSTRContent-TypeSTRContent-TypeSTRSTR,STRx-amz-security-tokenSTRIncluding DevPay user and product tokens in request: STRx-amz-security-token=STRx-amz-security-tokenSTRIncluding DevPay user token in request: x-amz-security-token=STR=STRIncluding Requester Pays header in request: " + Constants.REQUESTER_PAYS_BUCKET_FLAG); } } return httpMethod; }
|
/**
* Creates an {@link HttpMethod} object to handle a particular connection method.
*
* @param method
* the HTTP method/connection-type to use, must be one of: PUT, HEAD, GET, DELETE
* @param bucketName
* the bucket's name
* @param objectKey
* the object's key name, may be null if the operation is on a bucket only.
* @return
* the HTTP method object used to perform the request
*
* @throws S3ServiceException
*/
|
Creates an <code>HttpMethod</code> object to handle a particular connection method
|
setupConnection
|
{
"repo_name": "hyperic/jets3t",
"path": "src/org/jets3t/service/impl/rest/httpclient/RestS3Service.java",
"license": "apache-2.0",
"size": 91998
}
|
[
"java.util.Map",
"org.apache.commons.httpclient.HttpMethodBase",
"org.jets3t.service.Constants",
"org.jets3t.service.S3ServiceException"
] |
import java.util.Map; import org.apache.commons.httpclient.HttpMethodBase; import org.jets3t.service.Constants; import org.jets3t.service.S3ServiceException;
|
import java.util.*; import org.apache.commons.httpclient.*; import org.jets3t.service.*;
|
[
"java.util",
"org.apache.commons",
"org.jets3t.service"
] |
java.util; org.apache.commons; org.jets3t.service;
| 1,982,011
|
default Vector3d getVelocity() {
return get(Keys.VELOCITY).get();
}
|
default Vector3d getVelocity() { return get(Keys.VELOCITY).get(); }
|
/**
* Gets the {@link Vector3d} representation of this entity's current
* velocity.
*
* @return The current velocity
*/
|
Gets the <code>Vector3d</code> representation of this entity's current velocity
|
getVelocity
|
{
"repo_name": "JBYoshi/SpongeAPI",
"path": "src/main/java/org/spongepowered/api/entity/Entity.java",
"license": "mit",
"size": 19795
}
|
[
"com.flowpowered.math.vector.Vector3d",
"org.spongepowered.api.data.key.Keys"
] |
import com.flowpowered.math.vector.Vector3d; import org.spongepowered.api.data.key.Keys;
|
import com.flowpowered.math.vector.*; import org.spongepowered.api.data.key.*;
|
[
"com.flowpowered.math",
"org.spongepowered.api"
] |
com.flowpowered.math; org.spongepowered.api;
| 2,390,141
|
public Participant validateWinner(Score score, Match match);
|
Participant function(Score score, Match match);
|
/**
* Errechnet aus dem Score, also allen Sets, den Gewinner des Matches.
*
* @param score
* Score des Matches
* @return Berechneter Gewinner des Matches
*/
|
Errechnet aus dem Score, also allen Sets, den Gewinner des Matches
|
validateWinner
|
{
"repo_name": "sgeyer-tgm/Bracket",
"path": "src/main/java/at/egkr/api/data/SportType.java",
"license": "mit",
"size": 1667
}
|
[
"at.egkr.api.data.draw.Match",
"at.egkr.api.data.draw.Score"
] |
import at.egkr.api.data.draw.Match; import at.egkr.api.data.draw.Score;
|
import at.egkr.api.data.draw.*;
|
[
"at.egkr.api"
] |
at.egkr.api;
| 205,937
|
@Override
public Row get(byte[] row) {
reportRead(1);
try {
return new Result(row, getRowMap(row));
} catch (Exception e) {
LOG.debug("get failed for table: " + getTransactionAwareName() + ", row: " + Bytes.toStringBinary(row), e);
throw new DataSetException("get failed", e);
}
}
|
Row function(byte[] row) { reportRead(1); try { return new Result(row, getRowMap(row)); } catch (Exception e) { LOG.debug(STR + getTransactionAwareName() + STR + Bytes.toStringBinary(row), e); throw new DataSetException(STR, e); } }
|
/**
* NOTE: Depending on the use-case, calling this method may be much less
* efficient than calling same method with columns as parameters because it may always require round trip to
* persistent store
*/
|
efficient than calling same method with columns as parameters because it may always require round trip to persistent store
|
get
|
{
"repo_name": "chtyim/cdap",
"path": "cdap-data-fabric/src/main/java/co/cask/cdap/data2/dataset2/lib/table/BufferingTable.java",
"license": "apache-2.0",
"size": 39272
}
|
[
"co.cask.cdap.api.common.Bytes",
"co.cask.cdap.api.dataset.DataSetException",
"co.cask.cdap.api.dataset.table.Result",
"co.cask.cdap.api.dataset.table.Row"
] |
import co.cask.cdap.api.common.Bytes; import co.cask.cdap.api.dataset.DataSetException; import co.cask.cdap.api.dataset.table.Result; import co.cask.cdap.api.dataset.table.Row;
|
import co.cask.cdap.api.common.*; import co.cask.cdap.api.dataset.*; import co.cask.cdap.api.dataset.table.*;
|
[
"co.cask.cdap"
] |
co.cask.cdap;
| 1,269,579
|
public MultipleCurrencyAmount presentValueFromPrice(final InterestRateFutureOptionMarginTransaction option, final double price) {
ArgumentChecker.notNull(option, "Option on STIR futures");
double pv = (price - option.getReferencePrice()) * option.getUnderlyingSecurity().getUnderlyingFuture().getPaymentAccrualFactor() * option.getUnderlyingSecurity().getUnderlyingFuture().getNotional()
* option.getQuantity();
return MultipleCurrencyAmount.of(option.getUnderlyingSecurity().getCurrency(), pv);
}
|
MultipleCurrencyAmount function(final InterestRateFutureOptionMarginTransaction option, final double price) { ArgumentChecker.notNull(option, STR); double pv = (price - option.getReferencePrice()) * option.getUnderlyingSecurity().getUnderlyingFuture().getPaymentAccrualFactor() * option.getUnderlyingSecurity().getUnderlyingFuture().getNotional() * option.getQuantity(); return MultipleCurrencyAmount.of(option.getUnderlyingSecurity().getCurrency(), pv); }
|
/**
* Compute the present value of a future transaction from a quoted price.
* @param option The future option.
* @param price The quoted price.
* @return The present value.
*/
|
Compute the present value of a future transaction from a quoted price
|
presentValueFromPrice
|
{
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/interestrate/future/provider/InterestRateFutureOptionMarginTransactionGenericMethod.java",
"license": "apache-2.0",
"size": 4169
}
|
[
"com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionMarginTransaction",
"com.opengamma.util.ArgumentChecker",
"com.opengamma.util.money.MultipleCurrencyAmount"
] |
import com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionMarginTransaction; import com.opengamma.util.ArgumentChecker; import com.opengamma.util.money.MultipleCurrencyAmount;
|
import com.opengamma.analytics.financial.interestrate.future.derivative.*; import com.opengamma.util.*; import com.opengamma.util.money.*;
|
[
"com.opengamma.analytics",
"com.opengamma.util"
] |
com.opengamma.analytics; com.opengamma.util;
| 1,024,316
|
public void setPathMatcher(PathMatcher pathMatcher) {
Assert.notNull(pathMatcher, "PathMatcher must not be null");
this.pathMatcher = pathMatcher;
}
|
void function(PathMatcher pathMatcher) { Assert.notNull(pathMatcher, STR); this.pathMatcher = pathMatcher; }
|
/**
* Set the PathMatcher implementation to use for this resource pattern resolver.
* Default is AntPathMatcher.
* @param pathMatcher The pathMatches implementation used, must not be null
* @see AntPathMatcher
*/
|
Set the PathMatcher implementation to use for this resource pattern resolver. Default is AntPathMatcher
|
setPathMatcher
|
{
"repo_name": "spring-cloud/spring-cloud-aws",
"path": "spring-cloud-aws-core/src/main/java/org/springframework/cloud/aws/core/io/s3/PathMatchingSimpleStorageResourcePatternResolver.java",
"license": "apache-2.0",
"size": 11950
}
|
[
"org.springframework.util.Assert",
"org.springframework.util.PathMatcher"
] |
import org.springframework.util.Assert; import org.springframework.util.PathMatcher;
|
import org.springframework.util.*;
|
[
"org.springframework.util"
] |
org.springframework.util;
| 1,061,476
|
EAttribute getEParameterToObjectMapEntry_Value();
|
EAttribute getEParameterToObjectMapEntry_Value();
|
/**
* Returns the meta object for the attribute '{@link java.util.Map.Entry
* <em>Value</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @return the meta object for the attribute '<em>Value</em>'.
* @see java.util.Map.Entry
* @see #getEParameterToObjectMapEntry()
* @generated
*/
|
Returns the meta object for the attribute '<code>java.util.Map.Entry Value</code>'.
|
getEParameterToObjectMapEntry_Value
|
{
"repo_name": "enterpriseDomain/ClassMaker",
"path": "bundles/org.enterprisedomain.ecp/src/org/enterprisedomain/ecp/ECPPackage.java",
"license": "apache-2.0",
"size": 10648
}
|
[
"org.eclipse.emf.ecore.EAttribute"
] |
import org.eclipse.emf.ecore.EAttribute;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 2,102,293
|
private boolean handleDPad(int keyCode, boolean down) {
byte[] buffer = new byte[1];
if (keyCode < KeyEvent.KEYCODE_DPAD_UP ||
keyCode > KeyEvent.KEYCODE_DPAD_CENTER) {
return false;
}
if (down) {
if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
buffer[0] = '\r';
mSerialService.write( buffer );
} else {
char code;
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_UP:
code = 'A';
break;
case KeyEvent.KEYCODE_DPAD_DOWN:
code = 'B';
break;
case KeyEvent.KEYCODE_DPAD_LEFT:
code = 'D';
break;
default:
case KeyEvent.KEYCODE_DPAD_RIGHT:
code = 'C';
break;
}
buffer[0] = 27; // ESC
mSerialService.write( buffer );
// if (mEmulatorView.getKeypadApplicationMode()) {
// buffer[0] = 'O';
// mSerialService.write( buffer );
// } else {
buffer[0] = '[';
mSerialService.write( buffer );
// }
buffer[0] = (byte)code;
mSerialService.write( buffer );
}
}
return true;
}
|
boolean function(int keyCode, boolean down) { byte[] buffer = new byte[1]; if (keyCode < KeyEvent.KEYCODE_DPAD_UP keyCode > KeyEvent.KEYCODE_DPAD_CENTER) { return false; } if (down) { if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) { buffer[0] = '\r'; mSerialService.write( buffer ); } else { char code; switch (keyCode) { case KeyEvent.KEYCODE_DPAD_UP: code = 'A'; break; case KeyEvent.KEYCODE_DPAD_DOWN: code = 'B'; break; case KeyEvent.KEYCODE_DPAD_LEFT: code = 'D'; break; default: case KeyEvent.KEYCODE_DPAD_RIGHT: code = 'C'; break; } buffer[0] = 27; mSerialService.write( buffer ); buffer[0] = '['; mSerialService.write( buffer ); buffer[0] = (byte)code; mSerialService.write( buffer ); } } return true; }
|
/**
* Handle dpad left-right-up-down events. Don't handle
* dpad-center, that's our control key.
* @param keyCode
* @param down
*/
|
Handle dpad left-right-up-down events. Don't handle dpad-center, that's our control key
|
handleDPad
|
{
"repo_name": "nickiaconis/brickster",
"path": "android/src/com/codefox421/brickster/BricksTer.java",
"license": "mit",
"size": 118234
}
|
[
"android.view.KeyEvent"
] |
import android.view.KeyEvent;
|
import android.view.*;
|
[
"android.view"
] |
android.view;
| 641,651
|
public static List<EducationResource> getMedia(String path, Audience audience) {
File f = new File(path);
List<EducationResource> media = new ArrayList<EducationResource>();
try {
InputStream in = new FileInputStream(f);
media = getMedia(in, audience);
} catch (IOException e) {
Log.e(TAG, "IO error: " + e.getMessage() );
}
return media;
}
|
static List<EducationResource> function(String path, Audience audience) { File f = new File(path); List<EducationResource> media = new ArrayList<EducationResource>(); try { InputStream in = new FileInputStream(f); media = getMedia(in, audience); } catch (IOException e) { Log.e(TAG, STR + e.getMessage() ); } return media; }
|
/**
* Returns a list of available help info
*
* @param path Path to the resource list xml file
* @return
*/
|
Returns a list of available help info
|
getMedia
|
{
"repo_name": "SahilArora92/vit-04",
"path": "src/org/moca/activity/EducationResourceList.java",
"license": "bsd-3-clause",
"size": 12077
}
|
[
"android.util.Log",
"java.io.File",
"java.io.FileInputStream",
"java.io.IOException",
"java.io.InputStream",
"java.util.ArrayList",
"java.util.List",
"org.moca.media.EducationResource"
] |
import android.util.Log; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import org.moca.media.EducationResource;
|
import android.util.*; import java.io.*; import java.util.*; import org.moca.media.*;
|
[
"android.util",
"java.io",
"java.util",
"org.moca.media"
] |
android.util; java.io; java.util; org.moca.media;
| 769,431
|
@Test
public void testRemoveLibs() throws Exception {
final File testDirectory = createTestDirectory();
final File libDir = new File(testDirectory, "lib");
FileUtils.forceMkdir(libDir);
final File toRemove = new File(libDir, "toremove.jar");
FileUtils.touch(toRemove);
final File toKeep = new File(libDir, "tokeep.jar");
FileUtils.touch(toKeep);
final Libs libs = new Libs();
libs.setRemovals(Collections.singletonList(toRemove.getName()));
when(agent.getLibs()).thenReturn(libs);
// The mojo should remove only the configured library
mojo.removeLibs(agent, testDirectory);
assertThat(toRemove).doesNotExist();
assertThat(toKeep).exists();
}
|
void function() throws Exception { final File testDirectory = createTestDirectory(); final File libDir = new File(testDirectory, "lib"); FileUtils.forceMkdir(libDir); final File toRemove = new File(libDir, STR); FileUtils.touch(toRemove); final File toKeep = new File(libDir, STR); FileUtils.touch(toKeep); final Libs libs = new Libs(); libs.setRemovals(Collections.singletonList(toRemove.getName())); when(agent.getLibs()).thenReturn(libs); mojo.removeLibs(agent, testDirectory); assertThat(toRemove).doesNotExist(); assertThat(toKeep).exists(); }
|
/**
* Test the removal of libraries from the Flume installation.
*
* @throws Exception
* If any errors occur during the test run.
*/
|
Test the removal of libraries from the Flume installation
|
testRemoveLibs
|
{
"repo_name": "jrh3k5/flume-agent-maven-plugin",
"path": "src/test/java/com/github/jrh3k5/mojo/flume/AbstractFlumeAgentsMojoTest.java",
"license": "apache-2.0",
"size": 18629
}
|
[
"java.io.File",
"java.util.Collections",
"org.apache.commons.io.FileUtils",
"org.fest.assertions.Assertions",
"org.powermock.api.mockito.PowerMockito"
] |
import java.io.File; import java.util.Collections; import org.apache.commons.io.FileUtils; import org.fest.assertions.Assertions; import org.powermock.api.mockito.PowerMockito;
|
import java.io.*; import java.util.*; import org.apache.commons.io.*; import org.fest.assertions.*; import org.powermock.api.mockito.*;
|
[
"java.io",
"java.util",
"org.apache.commons",
"org.fest.assertions",
"org.powermock.api"
] |
java.io; java.util; org.apache.commons; org.fest.assertions; org.powermock.api;
| 872,841
|
private static Document createDoc(
String documentElement
) throws ParserConfigurationException {
Document doc = TestUtils.newDocument();
Element root = doc.createElementNS(null, documentElement);
doc.appendChild(root);
return doc;
}
|
static Document function( String documentElement ) throws ParserConfigurationException { Document doc = TestUtils.newDocument(); Element root = doc.createElementNS(null, documentElement); doc.appendChild(root); return doc; }
|
/**
* Method createDoc
*
* @param documentElement
* @return
* @throws ParserConfigurationException
*/
|
Method createDoc
|
createDoc
|
{
"repo_name": "apache/santuario-java",
"path": "src/test/java/org/apache/xml/security/test/dom/c14n/helper/AttrCompareTest.java",
"license": "apache-2.0",
"size": 7576
}
|
[
"javax.xml.parsers.ParserConfigurationException",
"org.apache.xml.security.test.dom.TestUtils",
"org.w3c.dom.Document",
"org.w3c.dom.Element"
] |
import javax.xml.parsers.ParserConfigurationException; import org.apache.xml.security.test.dom.TestUtils; import org.w3c.dom.Document; import org.w3c.dom.Element;
|
import javax.xml.parsers.*; import org.apache.xml.security.test.dom.*; import org.w3c.dom.*;
|
[
"javax.xml",
"org.apache.xml",
"org.w3c.dom"
] |
javax.xml; org.apache.xml; org.w3c.dom;
| 2,616,088
|
public boolean render(Context context, Writer writer,
String logTag, SimpleNode nodeTree)
{
InternalContextAdapterImpl ica =
new InternalContextAdapterImpl(context);
ica.pushCurrentTemplateName(logTag);
try
{
try
{
nodeTree.init(ica, this);
}
catch (TemplateInitException pex)
{
throw new ParseErrorException(pex, null);
}
catch(RuntimeException e)
{
throw e;
}
catch(Exception e)
{
String msg = "RuntimeInstance.render(): init exception for tag = "+logTag;
getLog().error(msg, e);
throw new VelocityException(msg, e);
}
try
{
if (provideEvaluateScope)
{
Object previous = ica.get(evaluateScopeName);
context.put(evaluateScopeName, new Scope(this, previous));
}
nodeTree.render(ica, writer);
}
catch (StopCommand stop)
{
if (!stop.isFor(this))
{
throw stop;
}
else if (getLog().isDebugEnabled())
{
getLog().debug(stop.getMessage());
}
}
catch (IOException e)
{
throw new VelocityException("IO Error in writer: " + e.getMessage(), e);
}
}
finally
{
ica.popCurrentTemplateName();
if (provideEvaluateScope)
{
Object obj = ica.get(evaluateScopeName);
if (obj instanceof Scope)
{
Scope scope = (Scope)obj;
if (scope.getParent() != null)
{
ica.put(evaluateScopeName, scope.getParent());
}
else if (scope.getReplaced() != null)
{
ica.put(evaluateScopeName, scope.getReplaced());
}
else
{
ica.remove(evaluateScopeName);
}
}
}
}
return true;
}
|
boolean function(Context context, Writer writer, String logTag, SimpleNode nodeTree) { InternalContextAdapterImpl ica = new InternalContextAdapterImpl(context); ica.pushCurrentTemplateName(logTag); try { try { nodeTree.init(ica, this); } catch (TemplateInitException pex) { throw new ParseErrorException(pex, null); } catch(RuntimeException e) { throw e; } catch(Exception e) { String msg = STR+logTag; getLog().error(msg, e); throw new VelocityException(msg, e); } try { if (provideEvaluateScope) { Object previous = ica.get(evaluateScopeName); context.put(evaluateScopeName, new Scope(this, previous)); } nodeTree.render(ica, writer); } catch (StopCommand stop) { if (!stop.isFor(this)) { throw stop; } else if (getLog().isDebugEnabled()) { getLog().debug(stop.getMessage()); } } catch (IOException e) { throw new VelocityException(STR + e.getMessage(), e); } } finally { ica.popCurrentTemplateName(); if (provideEvaluateScope) { Object obj = ica.get(evaluateScopeName); if (obj instanceof Scope) { Scope scope = (Scope)obj; if (scope.getParent() != null) { ica.put(evaluateScopeName, scope.getParent()); } else if (scope.getReplaced() != null) { ica.put(evaluateScopeName, scope.getReplaced()); } else { ica.remove(evaluateScopeName); } } } } return true; }
|
/**
* Initializes and renders the AST {@link SimpleNode} using the context
* into the output writer.
*
* @param context context to use in rendering input string
* @param writer Writer in which to render the output
* @param logTag string to be used as the template name for log messages
* in case of error
* @param nodeTree SimpleNode which is the root of the AST to be rendered
*
* @return true if successful, false otherwise. If false, see
* Velocity runtime log for errors
* @throws ParseErrorException The template could not be parsed.
* @throws MethodInvocationException A method on a context object could not be invoked.
* @throws ResourceNotFoundException A referenced resource could not be loaded.
* @since Velocity 1.6
*/
|
Initializes and renders the AST <code>SimpleNode</code> using the context into the output writer
|
render
|
{
"repo_name": "diydyq/velocity-engine",
"path": "velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java",
"license": "apache-2.0",
"size": 59750
}
|
[
"java.io.IOException",
"java.io.Writer",
"org.apache.velocity.context.Context",
"org.apache.velocity.context.InternalContextAdapterImpl",
"org.apache.velocity.exception.ParseErrorException",
"org.apache.velocity.exception.TemplateInitException",
"org.apache.velocity.exception.VelocityException",
"org.apache.velocity.runtime.directive.Scope",
"org.apache.velocity.runtime.directive.StopCommand",
"org.apache.velocity.runtime.parser.node.SimpleNode"
] |
import java.io.IOException; import java.io.Writer; import org.apache.velocity.context.Context; import org.apache.velocity.context.InternalContextAdapterImpl; import org.apache.velocity.exception.ParseErrorException; import org.apache.velocity.exception.TemplateInitException; import org.apache.velocity.exception.VelocityException; import org.apache.velocity.runtime.directive.Scope; import org.apache.velocity.runtime.directive.StopCommand; import org.apache.velocity.runtime.parser.node.SimpleNode;
|
import java.io.*; import org.apache.velocity.context.*; import org.apache.velocity.exception.*; import org.apache.velocity.runtime.directive.*; import org.apache.velocity.runtime.parser.node.*;
|
[
"java.io",
"org.apache.velocity"
] |
java.io; org.apache.velocity;
| 1,443,999
|
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux<DiskEncryptionSetInner> listByResourceGroupAsync(String resourceGroupName, Context context) {
return new PagedFlux<>(
() -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
}
|
@ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux<DiskEncryptionSetInner> function(String resourceGroupName, Context context) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); }
|
/**
* Lists all the disk encryption sets under a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ApiErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List disk encryption set operation response.
*/
|
Lists all the disk encryption sets under a resource group
|
listByResourceGroupAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/DiskEncryptionSetsClientImpl.java",
"license": "mit",
"size": 81126
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedFlux",
"com.azure.core.util.Context",
"com.azure.resourcemanager.compute.fluent.models.DiskEncryptionSetInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedFlux; import com.azure.core.util.Context; import com.azure.resourcemanager.compute.fluent.models.DiskEncryptionSetInner;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.compute.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,747,636
|
public void assertNotJavaBlank(AssertionInfo info, CharSequence actual) {
if (isJavaBlank(actual)) throw failures.failure(info, shouldNotBeBlank(actual));
}
|
void function(AssertionInfo info, CharSequence actual) { if (isJavaBlank(actual)) throw failures.failure(info, shouldNotBeBlank(actual)); }
|
/**
* Asserts that the given {@code CharSequence} is {@code Null}, empty or contains at least one non-whitespace character
* according to {@link Character#isWhitespace(char)}.
*
* @param info contains information about the assertion.
* @param actual the given {@code CharSequence}.
* @throws AssertionError if the given {@code CharSequence} is blank.
*/
|
Asserts that the given CharSequence is Null, empty or contains at least one non-whitespace character according to <code>Character#isWhitespace(char)</code>
|
assertNotJavaBlank
|
{
"repo_name": "xasx/assertj-core",
"path": "src/main/java/org/assertj/core/internal/Strings.java",
"license": "apache-2.0",
"size": 53576
}
|
[
"org.assertj.core.api.AssertionInfo",
"org.assertj.core.error.ShouldNotBeBlank"
] |
import org.assertj.core.api.AssertionInfo; import org.assertj.core.error.ShouldNotBeBlank;
|
import org.assertj.core.api.*; import org.assertj.core.error.*;
|
[
"org.assertj.core"
] |
org.assertj.core;
| 2,731,730
|
public Vector3D getScale() {
return getGlobalMatrix().getScale();
}
|
Vector3D function() { return getGlobalMatrix().getScale(); }
|
/**
* Returns the scale of the component.
*
* @return The scale of the component
*/
|
Returns the scale of the component
|
getScale
|
{
"repo_name": "sacooper/ECSE-429-Project-Group1",
"path": "ca.mcgill.sel.ram.gui/src/ca/mcgill/sel/ram/ui/components/RamRectangleComponent.java",
"license": "gpl-2.0",
"size": 28284
}
|
[
"org.mt4j.util.math.Vector3D"
] |
import org.mt4j.util.math.Vector3D;
|
import org.mt4j.util.math.*;
|
[
"org.mt4j.util"
] |
org.mt4j.util;
| 15,020
|
public void setUpdated_at(Date updated_at) {
this.updated_at = updated_at;
}
|
void function(Date updated_at) { this.updated_at = updated_at; }
|
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column security_group_rules.updated_at
*
* @param updated_at the value for security_group_rules.updated_at
*
* @mbggenerated Tue May 26 15:53:09 CST 2015
*/
|
This method was generated by MyBatis Generator. This method sets the value of the database column security_group_rules.updated_at
|
setUpdated_at
|
{
"repo_name": "wolabs/womano",
"path": "main/java/com/culabs/unicomportal/model/db/DBSecurityGroupRules.java",
"license": "apache-2.0",
"size": 14192
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,814,152
|
@Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11")
public void setIsInsert(long value) {
this.isInsert = value;
}
/**
* Gets the value of the val property.
*
* @return
* possible object is
* {@link SoapAddressArea }
|
@Generated(value = STR, date = STR, comments = STR) void function(long value) { this.isInsert = value; } /** * Gets the value of the val property. * * * possible object is * {@link SoapAddressArea }
|
/**
* Sets the value of the isInsert property.
*
*/
|
Sets the value of the isInsert property
|
setIsInsert
|
{
"repo_name": "kanonirov/lanb-client",
"path": "src/main/java/ru/lanbilling/webservice/wsdl/InsupdAddressArea.java",
"license": "mit",
"size": 2771
}
|
[
"javax.annotation.Generated"
] |
import javax.annotation.Generated;
|
import javax.annotation.*;
|
[
"javax.annotation"
] |
javax.annotation;
| 2,614,183
|
@WebMethod(operationName = "removeAllMembers")
@CacheEvict(value={GroupMember.Cache.NAME, Role.Cache.NAME}, allEntries = true)
void removeAllMembers( @WebParam(name="groupId") String groupId ) throws RiceIllegalArgumentException;
|
@WebMethod(operationName = STR) @CacheEvict(value={GroupMember.Cache.NAME, Role.Cache.NAME}, allEntries = true) void removeAllMembers( @WebParam(name=STR) String groupId ) throws RiceIllegalArgumentException;
|
/**
* Removes all members from the group with the given groupId.
*
* @param groupId Id of the Group object to remove the members from
* @throws RiceIllegalArgumentException if the groupId is null or blank
*/
|
Removes all members from the group with the given groupId
|
removeAllMembers
|
{
"repo_name": "mztaylor/rice-git",
"path": "rice-middleware/kim/kim-api/src/main/java/org/kuali/rice/kim/api/group/GroupService.java",
"license": "apache-2.0",
"size": 32391
}
|
[
"javax.jws.WebMethod",
"javax.jws.WebParam",
"org.kuali.rice.core.api.exception.RiceIllegalArgumentException",
"org.kuali.rice.kim.api.role.Role",
"org.springframework.cache.annotation.CacheEvict"
] |
import javax.jws.WebMethod; import javax.jws.WebParam; import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; import org.kuali.rice.kim.api.role.Role; import org.springframework.cache.annotation.CacheEvict;
|
import javax.jws.*; import org.kuali.rice.core.api.exception.*; import org.kuali.rice.kim.api.role.*; import org.springframework.cache.annotation.*;
|
[
"javax.jws",
"org.kuali.rice",
"org.springframework.cache"
] |
javax.jws; org.kuali.rice; org.springframework.cache;
| 2,711,664
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.