repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 194 | func_name stringlengths 6 111 | whole_func_string stringlengths 80 3.8k | language stringclasses 1
value | func_code_string stringlengths 80 3.8k | func_code_tokens listlengths 20 697 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 434 | split_name stringclasses 1
value | func_code_url stringlengths 111 308 |
|---|---|---|---|---|---|---|---|---|---|---|
box/box-java-sdk | src/main/java/com/box/sdk/BoxDeveloperEditionAPIConnection.java | BoxDeveloperEditionAPIConnection.getAppUserConnection | public static BoxDeveloperEditionAPIConnection getAppUserConnection(String userId, BoxConfig boxConfig) {
return getAppUserConnection(userId, boxConfig.getClientId(), boxConfig.getClientSecret(),
boxConfig.getJWTEncryptionPreferences());
} | java | public static BoxDeveloperEditionAPIConnection getAppUserConnection(String userId, BoxConfig boxConfig) {
return getAppUserConnection(userId, boxConfig.getClientId(), boxConfig.getClientSecret(),
boxConfig.getJWTEncryptionPreferences());
} | [
"public",
"static",
"BoxDeveloperEditionAPIConnection",
"getAppUserConnection",
"(",
"String",
"userId",
",",
"BoxConfig",
"boxConfig",
")",
"{",
"return",
"getAppUserConnection",
"(",
"userId",
",",
"boxConfig",
".",
"getClientId",
"(",
")",
",",
"boxConfig",
".",
... | Creates a new Box Developer Edition connection with App User token levaraging BoxConfig.
@param userId the user ID to use for an App User.
@param boxConfig box configuration settings object
@return a new instance of BoxAPIConnection. | [
"Creates",
"a",
"new",
"Box",
"Developer",
"Edition",
"connection",
"with",
"App",
"User",
"token",
"levaraging",
"BoxConfig",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxDeveloperEditionAPIConnection.java#L282-L285 |
alkacon/opencms-core | src/org/opencms/importexport/CmsImportVersion7.java | CmsImportVersion7.addProjectRules | protected void addProjectRules(Digester digester, String xpath) {
digester.addCallMethod(xpath + N_NAME, "setProjectName", 0);
digester.addCallMethod(xpath + N_DESCRIPTION, "setProjectDescription", 0);
digester.addCallMethod(xpath + N_MANAGERSGROUP, "setProjectManagers", 0);
digester.ad... | java | protected void addProjectRules(Digester digester, String xpath) {
digester.addCallMethod(xpath + N_NAME, "setProjectName", 0);
digester.addCallMethod(xpath + N_DESCRIPTION, "setProjectDescription", 0);
digester.addCallMethod(xpath + N_MANAGERSGROUP, "setProjectManagers", 0);
digester.ad... | [
"protected",
"void",
"addProjectRules",
"(",
"Digester",
"digester",
",",
"String",
"xpath",
")",
"{",
"digester",
".",
"addCallMethod",
"(",
"xpath",
"+",
"N_NAME",
",",
"\"setProjectName\"",
",",
"0",
")",
";",
"digester",
".",
"addCallMethod",
"(",
"xpath",... | Adds the XML digester rules for projects.<p>
@param digester the digester to add the rules to
@param xpath the base xpath for the rules | [
"Adds",
"the",
"XML",
"digester",
"rules",
"for",
"projects",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsImportVersion7.java#L3036-L3044 |
alkacon/opencms-core | src/org/opencms/search/solr/CmsSolrQuery.java | CmsSolrQuery.setDateRanges | public void setDateRanges(Map<String, CmsPair<Date, Date>> dateRanges) {
if ((dateRanges != null) && !dateRanges.isEmpty()) {
// remove the date ranges
for (Map.Entry<String, CmsPair<Date, Date>> entry : dateRanges.entrySet()) {
removeFacetField(entry.getKey());
... | java | public void setDateRanges(Map<String, CmsPair<Date, Date>> dateRanges) {
if ((dateRanges != null) && !dateRanges.isEmpty()) {
// remove the date ranges
for (Map.Entry<String, CmsPair<Date, Date>> entry : dateRanges.entrySet()) {
removeFacetField(entry.getKey());
... | [
"public",
"void",
"setDateRanges",
"(",
"Map",
"<",
"String",
",",
"CmsPair",
"<",
"Date",
",",
"Date",
">",
">",
"dateRanges",
")",
"{",
"if",
"(",
"(",
"dateRanges",
"!=",
"null",
")",
"&&",
"!",
"dateRanges",
".",
"isEmpty",
"(",
")",
")",
"{",
... | Sets date ranges.<p>
This call will overwrite all existing date ranges for the given keys (name of the date facet field).<p>
The parameter Map uses as:<p>
<ul>
<li><code>keys: </code>Solr field name {@link org.opencms.search.fields.CmsSearchField} and
<li><code>values: </code> pairs with min date as first and max dat... | [
"Sets",
"date",
"ranges",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/solr/CmsSolrQuery.java#L328-L344 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/PropertiesUtils.java | PropertiesUtils.loadProperties | public static Properties loadProperties(final ClassLoader loader, final String resource) {
checkNotNull("loader", loader);
checkNotNull("resource", resource);
final Properties props = new Properties();
try (final InputStream inStream = loader.getResourceAsStream(resource)) {
... | java | public static Properties loadProperties(final ClassLoader loader, final String resource) {
checkNotNull("loader", loader);
checkNotNull("resource", resource);
final Properties props = new Properties();
try (final InputStream inStream = loader.getResourceAsStream(resource)) {
... | [
"public",
"static",
"Properties",
"loadProperties",
"(",
"final",
"ClassLoader",
"loader",
",",
"final",
"String",
"resource",
")",
"{",
"checkNotNull",
"(",
"\"loader\"",
",",
"loader",
")",
";",
"checkNotNull",
"(",
"\"resource\"",
",",
"resource",
")",
";",
... | Loads a resource from the classpath as properties.
@param loader
Class loader to use.
@param resource
Resource to load.
@return Properties. | [
"Loads",
"a",
"resource",
"from",
"the",
"classpath",
"as",
"properties",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/PropertiesUtils.java#L77-L91 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_conditionTime_POST | public OvhOvhPabxDialplanExtensionConditionTime billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_conditionTime_POST(String billingAccount, String serviceName, Long dialplanId, Long extensionId, Date timeFrom, Date timeTo, OvhOvhPabxDialplanExtensionConditionTimeWeekDayEnum weekDay) throws IO... | java | public OvhOvhPabxDialplanExtensionConditionTime billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_conditionTime_POST(String billingAccount, String serviceName, Long dialplanId, Long extensionId, Date timeFrom, Date timeTo, OvhOvhPabxDialplanExtensionConditionTimeWeekDayEnum weekDay) throws IO... | [
"public",
"OvhOvhPabxDialplanExtensionConditionTime",
"billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_conditionTime_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"dialplanId",
",",
"Long",
"extensionId",
",",
"Date",
... | Create a new time condition for an extension
REST: POST /telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}/extension/{extensionId}/conditionTime
@param timeTo [required] The time of the day when the extension will stop to be executed
@param timeFrom [required] The time of the day when the extensio... | [
"Create",
"a",
"new",
"time",
"condition",
"for",
"an",
"extension"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7100-L7109 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/TrainsImpl.java | TrainsImpl.getStatus | public List<ModelTrainingInfo> getStatus(UUID appId, String versionId) {
return getStatusWithServiceResponseAsync(appId, versionId).toBlocking().single().body();
} | java | public List<ModelTrainingInfo> getStatus(UUID appId, String versionId) {
return getStatusWithServiceResponseAsync(appId, versionId).toBlocking().single().body();
} | [
"public",
"List",
"<",
"ModelTrainingInfo",
">",
"getStatus",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
")",
"{",
"return",
"getStatusWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
... | Gets the training status of all models (intents and entities) for the specified LUIS app. You must call the train API to train the LUIS app before you call this API to get training status. "appID" specifies the LUIS app ID. "versionId" specifies the version number of the LUIS app. For example, "0.1".
@param appId The ... | [
"Gets",
"the",
"training",
"status",
"of",
"all",
"models",
"(",
"intents",
"and",
"entities",
")",
"for",
"the",
"specified",
"LUIS",
"app",
".",
"You",
"must",
"call",
"the",
"train",
"API",
"to",
"train",
"the",
"LUIS",
"app",
"before",
"you",
"call",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/TrainsImpl.java#L164-L166 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/Check.java | Check.superiorOrEqual | public static void superiorOrEqual(double a, double b)
{
if (a < b)
{
throw new LionEngineException(ERROR_ARGUMENT + String.valueOf(a) + ERROR_SUPERIOR + String.valueOf(b));
}
} | java | public static void superiorOrEqual(double a, double b)
{
if (a < b)
{
throw new LionEngineException(ERROR_ARGUMENT + String.valueOf(a) + ERROR_SUPERIOR + String.valueOf(b));
}
} | [
"public",
"static",
"void",
"superiorOrEqual",
"(",
"double",
"a",
",",
"double",
"b",
")",
"{",
"if",
"(",
"a",
"<",
"b",
")",
"{",
"throw",
"new",
"LionEngineException",
"(",
"ERROR_ARGUMENT",
"+",
"String",
".",
"valueOf",
"(",
"a",
")",
"+",
"ERROR... | Check if <code>a</code> is superior to <code>b</code>.
@param a The parameter to test.
@param b The parameter to compare to.
@throws LionEngineException If check failed. | [
"Check",
"if",
"<code",
">",
"a<",
"/",
"code",
">",
"is",
"superior",
"to",
"<code",
">",
"b<",
"/",
"code",
">",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/Check.java#L67-L73 |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/StringBindings.java | StringBindings.toUpperCase | public static StringBinding toUpperCase(ObservableValue<String> text, ObservableValue<Locale> locale) {
return Bindings.createStringBinding(() -> {
final Locale localeValue = locale.getValue() == null ? Locale.getDefault() : locale.getValue();
return text.getValue() == null ? "" : text.getValue().toUpperCas... | java | public static StringBinding toUpperCase(ObservableValue<String> text, ObservableValue<Locale> locale) {
return Bindings.createStringBinding(() -> {
final Locale localeValue = locale.getValue() == null ? Locale.getDefault() : locale.getValue();
return text.getValue() == null ? "" : text.getValue().toUpperCas... | [
"public",
"static",
"StringBinding",
"toUpperCase",
"(",
"ObservableValue",
"<",
"String",
">",
"text",
",",
"ObservableValue",
"<",
"Locale",
">",
"locale",
")",
"{",
"return",
"Bindings",
".",
"createStringBinding",
"(",
"(",
")",
"->",
"{",
"final",
"Locale... | Creates a string binding that contains the value of the given observable string converted to uppercase with the
given locale. See {@link String#toUpperCase(Locale)}.
If the given observable string has a value of `null` the created binding will contain an empty string.
If the given observable locale has a value of `nu... | [
"Creates",
"a",
"string",
"binding",
"that",
"contains",
"the",
"value",
"of",
"the",
"given",
"observable",
"string",
"converted",
"to",
"uppercase",
"with",
"the",
"given",
"locale",
".",
"See",
"{",
"@link",
"String#toUpperCase",
"(",
"Locale",
")",
"}",
... | train | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/StringBindings.java#L198-L204 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/Iterate.java | Iterate.addAllIterable | public static <T> boolean addAllIterable(Iterable<? extends T> iterable, Collection<T> targetCollection)
{
if (iterable == null)
{
throw new NullPointerException();
}
if (iterable instanceof Collection<?>)
{
return targetCollection.addAll((Collection<T... | java | public static <T> boolean addAllIterable(Iterable<? extends T> iterable, Collection<T> targetCollection)
{
if (iterable == null)
{
throw new NullPointerException();
}
if (iterable instanceof Collection<?>)
{
return targetCollection.addAll((Collection<T... | [
"public",
"static",
"<",
"T",
">",
"boolean",
"addAllIterable",
"(",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"iterable",
",",
"Collection",
"<",
"T",
">",
"targetCollection",
")",
"{",
"if",
"(",
"iterable",
"==",
"null",
")",
"{",
"throw",
"new",
"... | Add all elements from the source Iterable to the target collection, returns true if any element was added. | [
"Add",
"all",
"elements",
"from",
"the",
"source",
"Iterable",
"to",
"the",
"target",
"collection",
"returns",
"true",
"if",
"any",
"element",
"was",
"added",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/Iterate.java#L1124-L1137 |
UrielCh/ovh-java-sdk | ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java | ApiOvhPackxdsl.packName_exchangeLite_services_POST | public OvhTask packName_exchangeLite_services_POST(String packName, Boolean antispam, String displayName, String email, String firstName, String initials, String lastName, String password) throws IOException {
String qPath = "/pack/xdsl/{packName}/exchangeLite/services";
StringBuilder sb = path(qPath, packName);
... | java | public OvhTask packName_exchangeLite_services_POST(String packName, Boolean antispam, String displayName, String email, String firstName, String initials, String lastName, String password) throws IOException {
String qPath = "/pack/xdsl/{packName}/exchangeLite/services";
StringBuilder sb = path(qPath, packName);
... | [
"public",
"OvhTask",
"packName_exchangeLite_services_POST",
"(",
"String",
"packName",
",",
"Boolean",
"antispam",
",",
"String",
"displayName",
",",
"String",
"email",
",",
"String",
"firstName",
",",
"String",
"initials",
",",
"String",
"lastName",
",",
"String",
... | Activate a exchange lite service
REST: POST /pack/xdsl/{packName}/exchangeLite/services
@param initials [required] Initials
@param antispam [required] [default=true] Antispam protection
@param firstName [required] First name
@param lastName [required] Last name
@param email [required] Email address
@param password [re... | [
"Activate",
"a",
"exchange",
"lite",
"service"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L653-L666 |
gitblit/fathom | fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java | ControllerHandler.validateDeclaredReturns | protected void validateDeclaredReturns() {
boolean returnsObject = void.class != method.getReturnType();
if (returnsObject) {
for (Return declaredReturn : declaredReturns) {
if (declaredReturn.code() >= 200 && declaredReturn.code() < 300) {
return;
... | java | protected void validateDeclaredReturns() {
boolean returnsObject = void.class != method.getReturnType();
if (returnsObject) {
for (Return declaredReturn : declaredReturns) {
if (declaredReturn.code() >= 200 && declaredReturn.code() < 300) {
return;
... | [
"protected",
"void",
"validateDeclaredReturns",
"(",
")",
"{",
"boolean",
"returnsObject",
"=",
"void",
".",
"class",
"!=",
"method",
".",
"getReturnType",
"(",
")",
";",
"if",
"(",
"returnsObject",
")",
"{",
"for",
"(",
"Return",
"declaredReturn",
":",
"dec... | Validates the declared Returns of the controller method. If the controller method returns an object then
it must also declare a successful @Return with a status code in the 200 range. | [
"Validates",
"the",
"declared",
"Returns",
"of",
"the",
"controller",
"method",
".",
"If",
"the",
"controller",
"method",
"returns",
"an",
"object",
"then",
"it",
"must",
"also",
"declare",
"a",
"successful"
] | train | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java#L512-L523 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java | AbstractServerDetector.getSingleStringAttribute | protected String getSingleStringAttribute(MBeanServerExecutor pMBeanServerExecutor, String pMBeanName, String pAttribute) {
Set<ObjectName> serverMBeanNames = searchMBeans(pMBeanServerExecutor, pMBeanName);
if (serverMBeanNames.size() == 0) {
return null;
}
Set<String> attrib... | java | protected String getSingleStringAttribute(MBeanServerExecutor pMBeanServerExecutor, String pMBeanName, String pAttribute) {
Set<ObjectName> serverMBeanNames = searchMBeans(pMBeanServerExecutor, pMBeanName);
if (serverMBeanNames.size() == 0) {
return null;
}
Set<String> attrib... | [
"protected",
"String",
"getSingleStringAttribute",
"(",
"MBeanServerExecutor",
"pMBeanServerExecutor",
",",
"String",
"pMBeanName",
",",
"String",
"pAttribute",
")",
"{",
"Set",
"<",
"ObjectName",
">",
"serverMBeanNames",
"=",
"searchMBeans",
"(",
"pMBeanServerExecutor",
... | Get a single attribute for a given MBeanName pattern.
@param pMBeanServerExecutor MBeanServer manager to query
@param pMBeanName a MBean name or pattern. If multiple MBeans are found, each is queried for the attribute
@param pAttribute the attribute to lookup
@return the string value of the attribute or null if either... | [
"Get",
"a",
"single",
"attribute",
"for",
"a",
"given",
"MBeanName",
"pattern",
"."
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java#L123-L139 |
jbundle/jbundle | thin/base/screen/cal/other/src/main/java/org/jbundle/thin/base/screen/cal/opt/CachedInfo.java | CachedInfo.setCacheData | public synchronized void setCacheData(Date startTime, Date endTime, String description, String [] rgstrMeals)
{
if (startTime != null)
m_startTime = startTime;
if (endTime != null)
m_endTime = endTime;
if (description != null)
m_description = description;
... | java | public synchronized void setCacheData(Date startTime, Date endTime, String description, String [] rgstrMeals)
{
if (startTime != null)
m_startTime = startTime;
if (endTime != null)
m_endTime = endTime;
if (description != null)
m_description = description;
... | [
"public",
"synchronized",
"void",
"setCacheData",
"(",
"Date",
"startTime",
",",
"Date",
"endTime",
",",
"String",
"description",
",",
"String",
"[",
"]",
"rgstrMeals",
")",
"{",
"if",
"(",
"startTime",
"!=",
"null",
")",
"m_startTime",
"=",
"startTime",
";"... | Change the cache data without calling the methods to change the underlying model.
This method is used by the lineItem to change the screen model without calling a change to the model. | [
"Change",
"the",
"cache",
"data",
"without",
"calling",
"the",
"methods",
"to",
"change",
"the",
"underlying",
"model",
".",
"This",
"method",
"is",
"used",
"by",
"the",
"lineItem",
"to",
"change",
"the",
"screen",
"model",
"without",
"calling",
"a",
"change... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/cal/other/src/main/java/org/jbundle/thin/base/screen/cal/opt/CachedInfo.java#L229-L239 |
emfjson/emfjson-jackson | src/main/java/org/emfjson/jackson/utils/EObjects.java | EObjects.setOrAdd | public static void setOrAdd(EObject owner, EReference reference, Object value) {
if (value != null) {
if (reference.isMany()) {
@SuppressWarnings("unchecked")
Collection<EObject> values = (Collection<EObject>) owner.eGet(reference, false);
if (values != null && value instanceof EObject) {
values.a... | java | public static void setOrAdd(EObject owner, EReference reference, Object value) {
if (value != null) {
if (reference.isMany()) {
@SuppressWarnings("unchecked")
Collection<EObject> values = (Collection<EObject>) owner.eGet(reference, false);
if (values != null && value instanceof EObject) {
values.a... | [
"public",
"static",
"void",
"setOrAdd",
"(",
"EObject",
"owner",
",",
"EReference",
"reference",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"if",
"(",
"reference",
".",
"isMany",
"(",
")",
")",
"{",
"@",
"SuppressWarn... | Set or add a value to an object reference. The value must be
an EObject.
@param owner
@param reference
@param value | [
"Set",
"or",
"add",
"a",
"value",
"to",
"an",
"object",
"reference",
".",
"The",
"value",
"must",
"be",
"an",
"EObject",
"."
] | train | https://github.com/emfjson/emfjson-jackson/blob/5f4488d1b07d499003351606cf76ee0c4ac39964/src/main/java/org/emfjson/jackson/utils/EObjects.java#L36-L48 |
LearnLib/learnlib | commons/counterexamples/src/main/java/de/learnlib/counterexamples/GlobalSuffixFinders.java | GlobalSuffixFinders.findRivestSchapire | public static <I, O> List<Word<I>> findRivestSchapire(Query<I, O> ceQuery,
AccessSequenceTransformer<I> asTransformer,
SuffixOutput<I, O> hypOutput,
... | java | public static <I, O> List<Word<I>> findRivestSchapire(Query<I, O> ceQuery,
AccessSequenceTransformer<I> asTransformer,
SuffixOutput<I, O> hypOutput,
... | [
"public",
"static",
"<",
"I",
",",
"O",
">",
"List",
"<",
"Word",
"<",
"I",
">",
">",
"findRivestSchapire",
"(",
"Query",
"<",
"I",
",",
"O",
">",
"ceQuery",
",",
"AccessSequenceTransformer",
"<",
"I",
">",
"asTransformer",
",",
"SuffixOutput",
"<",
"I... | Returns the suffix (plus all of its suffixes, if {@code allSuffixes} is true) found by the binary search access
sequence transformation.
@param ceQuery
the counterexample query
@param asTransformer
the access sequence transformer
@param hypOutput
interface to the hypothesis output
@param oracle
interface to the SUL ou... | [
"Returns",
"the",
"suffix",
"(",
"plus",
"all",
"of",
"its",
"suffixes",
"if",
"{",
"@code",
"allSuffixes",
"}",
"is",
"true",
")",
"found",
"by",
"the",
"binary",
"search",
"access",
"sequence",
"transformation",
"."
] | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/commons/counterexamples/src/main/java/de/learnlib/counterexamples/GlobalSuffixFinders.java#L332-L339 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.getBondOrderSum | public static double getBondOrderSum(IAtomContainer container, IAtom atom) {
double count = 0;
for (IBond bond : container.getConnectedBondsList(atom)) {
IBond.Order order = bond.getOrder();
if (order != null) {
count += order.numeric();
}
}
... | java | public static double getBondOrderSum(IAtomContainer container, IAtom atom) {
double count = 0;
for (IBond bond : container.getConnectedBondsList(atom)) {
IBond.Order order = bond.getOrder();
if (order != null) {
count += order.numeric();
}
}
... | [
"public",
"static",
"double",
"getBondOrderSum",
"(",
"IAtomContainer",
"container",
",",
"IAtom",
"atom",
")",
"{",
"double",
"count",
"=",
"0",
";",
"for",
"(",
"IBond",
"bond",
":",
"container",
".",
"getConnectedBondsList",
"(",
"atom",
")",
")",
"{",
... | Returns the sum of the bond order equivalents for a given IAtom. It
considers single bonds as 1.0, double bonds as 2.0, triple bonds as 3.0,
and quadruple bonds as 4.0.
@param atom The atom for which to calculate the bond order sum
@return The number of bond order equivalents for this atom | [
"Returns",
"the",
"sum",
"of",
"the",
"bond",
"order",
"equivalents",
"for",
"a",
"given",
"IAtom",
".",
"It",
"considers",
"single",
"bonds",
"as",
"1",
".",
"0",
"double",
"bonds",
"as",
"2",
".",
"0",
"triple",
"bonds",
"as",
"3",
".",
"0",
"and",... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L1708-L1717 |
JodaOrg/joda-time | src/main/java/org/joda/time/Period.java | Period.withFields | public Period withFields(ReadablePeriod period) {
if (period == null) {
return this;
}
int[] newValues = getValues(); // cloned
newValues = super.mergePeriodInto(newValues, period);
return new Period(newValues, getPeriodType());
} | java | public Period withFields(ReadablePeriod period) {
if (period == null) {
return this;
}
int[] newValues = getValues(); // cloned
newValues = super.mergePeriodInto(newValues, period);
return new Period(newValues, getPeriodType());
} | [
"public",
"Period",
"withFields",
"(",
"ReadablePeriod",
"period",
")",
"{",
"if",
"(",
"period",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"int",
"[",
"]",
"newValues",
"=",
"getValues",
"(",
")",
";",
"// cloned",
"newValues",
"=",
"super",
... | Creates a new Period instance with the fields from the specified period
copied on top of those from this period.
<p>
This period instance is immutable and unaffected by this method call.
@param period the period to copy from, null ignored
@return the new period instance
@throws IllegalArgumentException if a field typ... | [
"Creates",
"a",
"new",
"Period",
"instance",
"with",
"the",
"fields",
"from",
"the",
"specified",
"period",
"copied",
"on",
"top",
"of",
"those",
"from",
"this",
"period",
".",
"<p",
">",
"This",
"period",
"instance",
"is",
"immutable",
"and",
"unaffected",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Period.java#L853-L860 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/TransactionImpl.java | TransactionImpl.tryLock | public boolean tryLock(Object obj, int lockMode)
{
if (log.isDebugEnabled()) log.debug("Try to lock object was called on tx " + this);
checkOpen();
try
{
lock(obj, lockMode);
return true;
}
catch (LockNotGrantedException ex)
{... | java | public boolean tryLock(Object obj, int lockMode)
{
if (log.isDebugEnabled()) log.debug("Try to lock object was called on tx " + this);
checkOpen();
try
{
lock(obj, lockMode);
return true;
}
catch (LockNotGrantedException ex)
{... | [
"public",
"boolean",
"tryLock",
"(",
"Object",
"obj",
",",
"int",
"lockMode",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"log",
".",
"debug",
"(",
"\"Try to lock object was called on tx \"",
"+",
"this",
")",
";",
"checkOpen",
"(",
"... | Upgrade the lock on the given object to the given lock mode. Method <code>
tryLock</code> is the same as <code>lock</code> except it returns a boolean
indicating whether the lock was granted instead of generating an exception.
@param obj Description of Parameter
@param lockMode Description of Parameter
@... | [
"Upgrade",
"the",
"lock",
"on",
"the",
"given",
"object",
"to",
"the",
"given",
"lock",
"mode",
".",
"Method",
"<code",
">",
"tryLock<",
"/",
"code",
">",
"is",
"the",
"same",
"as",
"<code",
">",
"lock<",
"/",
"code",
">",
"except",
"it",
"returns",
... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/TransactionImpl.java#L659-L672 |
fabiomaffioletti/jsondoc | jsondoc-springmvc/src/main/java/org/jsondoc/springmvc/scanner/AbstractSpringJSONDocScanner.java | AbstractSpringJSONDocScanner.mergeApiDoc | @Override
public ApiDoc mergeApiDoc(Class<?> controller, ApiDoc apiDoc) {
ApiDoc jsondocApiDoc = JSONDocApiDocBuilder.build(controller);
BeanUtils.copyProperties(jsondocApiDoc, apiDoc, new String[] { "methods", "supportedversions", "auth" });
return apiDoc;
} | java | @Override
public ApiDoc mergeApiDoc(Class<?> controller, ApiDoc apiDoc) {
ApiDoc jsondocApiDoc = JSONDocApiDocBuilder.build(controller);
BeanUtils.copyProperties(jsondocApiDoc, apiDoc, new String[] { "methods", "supportedversions", "auth" });
return apiDoc;
} | [
"@",
"Override",
"public",
"ApiDoc",
"mergeApiDoc",
"(",
"Class",
"<",
"?",
">",
"controller",
",",
"ApiDoc",
"apiDoc",
")",
"{",
"ApiDoc",
"jsondocApiDoc",
"=",
"JSONDocApiDocBuilder",
".",
"build",
"(",
"controller",
")",
";",
"BeanUtils",
".",
"copyProperti... | Once the ApiDoc has been initialized and filled with other data (version,
auth, etc) it's time to merge the documentation with JSONDoc annotation,
if existing. | [
"Once",
"the",
"ApiDoc",
"has",
"been",
"initialized",
"and",
"filled",
"with",
"other",
"data",
"(",
"version",
"auth",
"etc",
")",
"it",
"s",
"time",
"to",
"merge",
"the",
"documentation",
"with",
"JSONDoc",
"annotation",
"if",
"existing",
"."
] | train | https://github.com/fabiomaffioletti/jsondoc/blob/26bf413c236e7c3b66f534c2451b157783c1f45e/jsondoc-springmvc/src/main/java/org/jsondoc/springmvc/scanner/AbstractSpringJSONDocScanner.java#L219-L224 |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/tuplemr/mapred/lib/output/PangoolMultipleOutputs.java | PangoolMultipleOutputs.setSpecificNamedOutputContext | public static void setSpecificNamedOutputContext(Configuration conf, Job job, String namedOutput) {
for(Map.Entry<String, String> entries : conf) {
String confKey = entries.getKey();
String confValue = entries.getValue();
if(confKey.startsWith(MO_PREFIX + namedOutput + CONF)) {
// Specific context key, v... | java | public static void setSpecificNamedOutputContext(Configuration conf, Job job, String namedOutput) {
for(Map.Entry<String, String> entries : conf) {
String confKey = entries.getKey();
String confValue = entries.getValue();
if(confKey.startsWith(MO_PREFIX + namedOutput + CONF)) {
// Specific context key, v... | [
"public",
"static",
"void",
"setSpecificNamedOutputContext",
"(",
"Configuration",
"conf",
",",
"Job",
"job",
",",
"String",
"namedOutput",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entries",
":",
"conf",
")",
"{",
"Str... | Iterates over the Configuration and sets the specific context found for the namedOutput in the Job instance.
Package-access so it can be unit tested. The specific context is configured in method this.
{@link #addNamedOutputContext(Job, String, String, String)}.
@param conf
The configuration that may contain specific c... | [
"Iterates",
"over",
"the",
"Configuration",
"and",
"sets",
"the",
"specific",
"context",
"found",
"for",
"the",
"namedOutput",
"in",
"the",
"Job",
"instance",
".",
"Package",
"-",
"access",
"so",
"it",
"can",
"be",
"unit",
"tested",
".",
"The",
"specific",
... | train | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/tuplemr/mapred/lib/output/PangoolMultipleOutputs.java#L255-L273 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.createAccountAcquisition | public AccountAcquisition createAccountAcquisition(final String accountCode, final AccountAcquisition acquisition) {
final String path = Account.ACCOUNT_RESOURCE + "/" + accountCode + AccountAcquisition.ACCOUNT_ACQUISITION_RESOURCE;
return doPOST(path, acquisition, AccountAcquisition.class);
} | java | public AccountAcquisition createAccountAcquisition(final String accountCode, final AccountAcquisition acquisition) {
final String path = Account.ACCOUNT_RESOURCE + "/" + accountCode + AccountAcquisition.ACCOUNT_ACQUISITION_RESOURCE;
return doPOST(path, acquisition, AccountAcquisition.class);
} | [
"public",
"AccountAcquisition",
"createAccountAcquisition",
"(",
"final",
"String",
"accountCode",
",",
"final",
"AccountAcquisition",
"acquisition",
")",
"{",
"final",
"String",
"path",
"=",
"Account",
".",
"ACCOUNT_RESOURCE",
"+",
"\"/\"",
"+",
"accountCode",
"+",
... | Sets the acquisition details for an account
<p>
https://dev.recurly.com/docs/create-account-acquisition
@param accountCode The account's account code
@param acquisition The AccountAcquisition data
@return The created AccountAcquisition object | [
"Sets",
"the",
"acquisition",
"details",
"for",
"an",
"account",
"<p",
">",
"https",
":",
"//",
"dev",
".",
"recurly",
".",
"com",
"/",
"docs",
"/",
"create",
"-",
"account",
"-",
"acquisition"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1961-L1964 |
jfinal/jfinal | src/main/java/com/jfinal/template/stat/Lexer.java | Lexer.addIdParaToken | boolean addIdParaToken(Token idToken, Token paraToken) {
tokens.add(idToken);
tokens.add(paraToken);
// if (lookForwardLineFeed() && (deletePreviousTextTokenBlankTails() || lexemeBegin == 0)) {
if (lookForwardLineFeedAndEof() && deletePreviousTextTokenBlankTails()) {
prepareNextScan(peek() != EOF ? ... | java | boolean addIdParaToken(Token idToken, Token paraToken) {
tokens.add(idToken);
tokens.add(paraToken);
// if (lookForwardLineFeed() && (deletePreviousTextTokenBlankTails() || lexemeBegin == 0)) {
if (lookForwardLineFeedAndEof() && deletePreviousTextTokenBlankTails()) {
prepareNextScan(peek() != EOF ? ... | [
"boolean",
"addIdParaToken",
"(",
"Token",
"idToken",
",",
"Token",
"paraToken",
")",
"{",
"tokens",
".",
"add",
"(",
"idToken",
")",
";",
"tokens",
".",
"add",
"(",
"paraToken",
")",
";",
"// if (lookForwardLineFeed() && (deletePreviousTextTokenBlankTails() || lexeme... | 带参指令处于独立行时删除前后空白字符,并且再删除一个后续的换行符
处于独立行是指:向前看无有用内容,在前面情况成立的基础之上
再向后看如果也无可用内容,前一个条件成立才开执行后续动作
向前看时 forward 在移动,意味着正在删除空白字符(通过 lookForwardLineFeed()方法)
向后看时也会在碰到空白 + '\n' 时删空白字符 (通过 deletePreviousTextTokenBlankTails()方法) | [
"带参指令处于独立行时删除前后空白字符,并且再删除一个后续的换行符",
"处于独立行是指:向前看无有用内容,在前面情况成立的基础之上",
"再向后看如果也无可用内容,前一个条件成立才开执行后续动作"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/template/stat/Lexer.java#L508-L520 |
Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/thrift/ThriftClient.java | ThriftClient.build | public static ThriftClient build(String host, int port) throws TException {
return build(host, port, null);
} | java | public static ThriftClient build(String host, int port) throws TException {
return build(host, port, null);
} | [
"public",
"static",
"ThriftClient",
"build",
"(",
"String",
"host",
",",
"int",
"port",
")",
"throws",
"TException",
"{",
"return",
"build",
"(",
"host",
",",
"port",
",",
"null",
")",
";",
"}"
] | Returns a new client for the specified host.
@param host the Cassandra host address.
@param port the Cassandra host RPC port.
@return a new client for the specified host.
@throws TException if there is any problem with the {@code set_keyspace} call. | [
"Returns",
"a",
"new",
"client",
"for",
"the",
"specified",
"host",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/thrift/ThriftClient.java#L72-L74 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java | DwgUtil.getRawLong | public static Vector getRawLong(int[] data, int offset) {
Vector v = new Vector();
// TODO: Incorrecto. Repasar ...
// _val = struct.unpack('<l', _long)[0]
int val = 0;
v.add(new Integer(offset+32));
v.add(new Integer(val));
return v;
} | java | public static Vector getRawLong(int[] data, int offset) {
Vector v = new Vector();
// TODO: Incorrecto. Repasar ...
// _val = struct.unpack('<l', _long)[0]
int val = 0;
v.add(new Integer(offset+32));
v.add(new Integer(val));
return v;
} | [
"public",
"static",
"Vector",
"getRawLong",
"(",
"int",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"Vector",
"v",
"=",
"new",
"Vector",
"(",
")",
";",
"// TODO: Incorrecto. Repasar ...",
"// _val = struct.unpack('<l', _long)[0]",
"int",
"val",
"=",
"0",
... | Read a long value from a group of unsigned bytes
@param data Array of unsigned bytes obtained from the DWG binary file
@param offset The current bit offset where the value begins
@throws Exception If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.
@return Vector This vecto... | [
"Read",
"a",
"long",
"value",
"from",
"a",
"group",
"of",
"unsigned",
"bytes"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java#L388-L396 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SendUsersMessageRequest.java | SendUsersMessageRequest.withUsers | public SendUsersMessageRequest withUsers(java.util.Map<String, EndpointSendConfiguration> users) {
setUsers(users);
return this;
} | java | public SendUsersMessageRequest withUsers(java.util.Map<String, EndpointSendConfiguration> users) {
setUsers(users);
return this;
} | [
"public",
"SendUsersMessageRequest",
"withUsers",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"EndpointSendConfiguration",
">",
"users",
")",
"{",
"setUsers",
"(",
"users",
")",
";",
"return",
"this",
";",
"}"
] | A map that associates user IDs with EndpointSendConfiguration objects. Within an EndpointSendConfiguration
object, you can tailor the message for a user by specifying message overrides or substitutions.
@param users
A map that associates user IDs with EndpointSendConfiguration objects. Within an EndpointSendConfigurat... | [
"A",
"map",
"that",
"associates",
"user",
"IDs",
"with",
"EndpointSendConfiguration",
"objects",
".",
"Within",
"an",
"EndpointSendConfiguration",
"object",
"you",
"can",
"tailor",
"the",
"message",
"for",
"a",
"user",
"by",
"specifying",
"message",
"overrides",
"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SendUsersMessageRequest.java#L216-L219 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java | SynchronousRequest.getAllContinentFloorID | public List<Integer> getAllContinentFloorID(int continentID) throws GuildWars2Exception {
try {
Response<List<Integer>> response = gw2API.getAllContinentFloorIDs(Integer.toString(continentID)).execute();
if (!response.isSuccessful()) throwError(response.code(), response.errorBody());
return response.body();
... | java | public List<Integer> getAllContinentFloorID(int continentID) throws GuildWars2Exception {
try {
Response<List<Integer>> response = gw2API.getAllContinentFloorIDs(Integer.toString(continentID)).execute();
if (!response.isSuccessful()) throwError(response.code(), response.errorBody());
return response.body();
... | [
"public",
"List",
"<",
"Integer",
">",
"getAllContinentFloorID",
"(",
"int",
"continentID",
")",
"throws",
"GuildWars2Exception",
"{",
"try",
"{",
"Response",
"<",
"List",
"<",
"Integer",
">>",
"response",
"=",
"gw2API",
".",
"getAllContinentFloorIDs",
"(",
"Int... | For more info on continents API go <a href="https://wiki.guildwars2.com/wiki/API:2/continents">here</a><br/>
Get all continent floor ids
@param continentID {@link Continent#id}
@return list of continent floor ids
@throws GuildWars2Exception see {@link ErrorCode} for detail
@see ContinentFloor continent floor info | [
"For",
"more",
"info",
"on",
"continents",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"continents",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Get",
"all"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java#L1392-L1400 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/dml/SQLMergeClause.java | SQLMergeClause.addFlag | public SQLMergeClause addFlag(Position position, String flag) {
metadata.addFlag(new QueryFlag(position, flag));
return this;
} | java | public SQLMergeClause addFlag(Position position, String flag) {
metadata.addFlag(new QueryFlag(position, flag));
return this;
} | [
"public",
"SQLMergeClause",
"addFlag",
"(",
"Position",
"position",
",",
"String",
"flag",
")",
"{",
"metadata",
".",
"addFlag",
"(",
"new",
"QueryFlag",
"(",
"position",
",",
"flag",
")",
")",
";",
"return",
"this",
";",
"}"
] | Add the given String literal at the given position as a query flag
@param position position
@param flag query flag
@return the current object | [
"Add",
"the",
"given",
"String",
"literal",
"at",
"the",
"given",
"position",
"as",
"a",
"query",
"flag"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/dml/SQLMergeClause.java#L88-L91 |
Sefford/fraggle | fraggle/src/main/java/com/sefford/fraggle/FraggleManager.java | FraggleManager.performTransaction | protected void performTransaction(Fragment frag, int flags, FragmentTransaction ft, int containerId) {
configureAdditionMode(frag, flags, ft, containerId);
ft.commitAllowingStateLoss();
} | java | protected void performTransaction(Fragment frag, int flags, FragmentTransaction ft, int containerId) {
configureAdditionMode(frag, flags, ft, containerId);
ft.commitAllowingStateLoss();
} | [
"protected",
"void",
"performTransaction",
"(",
"Fragment",
"frag",
",",
"int",
"flags",
",",
"FragmentTransaction",
"ft",
",",
"int",
"containerId",
")",
"{",
"configureAdditionMode",
"(",
"frag",
",",
"flags",
",",
"ft",
",",
"containerId",
")",
";",
"ft",
... | Commits the transaction to the Fragment Manager.
@param frag Fragment to add
@param flags Added flags to the Fragment configuration
@param ft Transaction to add the fragment
@param containerId Target containerID | [
"Commits",
"the",
"transaction",
"to",
"the",
"Fragment",
"Manager",
"."
] | train | https://github.com/Sefford/fraggle/blob/d1b65a99ecc3c3faeef8f288ca6225bbf475c3a3/fraggle/src/main/java/com/sefford/fraggle/FraggleManager.java#L270-L273 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java | AddressClient.insertAddress | @BetaApi
public final Operation insertAddress(ProjectRegionName region, Address addressResource) {
InsertAddressHttpRequest request =
InsertAddressHttpRequest.newBuilder()
.setRegion(region == null ? null : region.toString())
.setAddressResource(addressResource)
.build... | java | @BetaApi
public final Operation insertAddress(ProjectRegionName region, Address addressResource) {
InsertAddressHttpRequest request =
InsertAddressHttpRequest.newBuilder()
.setRegion(region == null ? null : region.toString())
.setAddressResource(addressResource)
.build... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertAddress",
"(",
"ProjectRegionName",
"region",
",",
"Address",
"addressResource",
")",
"{",
"InsertAddressHttpRequest",
"request",
"=",
"InsertAddressHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setRegion",
"("... | Creates an address resource in the specified project using the data included in the request.
<p>Sample code:
<pre><code>
try (AddressClient addressClient = AddressClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
Address addressResource = Address.newBuilder().build();
Operat... | [
"Creates",
"an",
"address",
"resource",
"in",
"the",
"specified",
"project",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddressClient.java#L506-L515 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/RTreeIndexCoreExtension.java | RTreeIndexCoreExtension.createRTreeIndex | public void createRTreeIndex(String tableName, String geometryColumnName) {
String sqlName = GeoPackageProperties.getProperty(SQL_PROPERTY,
CREATE_PROPERTY);
executeSQL(sqlName, tableName, geometryColumnName);
} | java | public void createRTreeIndex(String tableName, String geometryColumnName) {
String sqlName = GeoPackageProperties.getProperty(SQL_PROPERTY,
CREATE_PROPERTY);
executeSQL(sqlName, tableName, geometryColumnName);
} | [
"public",
"void",
"createRTreeIndex",
"(",
"String",
"tableName",
",",
"String",
"geometryColumnName",
")",
"{",
"String",
"sqlName",
"=",
"GeoPackageProperties",
".",
"getProperty",
"(",
"SQL_PROPERTY",
",",
"CREATE_PROPERTY",
")",
";",
"executeSQL",
"(",
"sqlName"... | Create the RTree Index Virtual Table
@param tableName
table name
@param geometryColumnName
geometry column name | [
"Create",
"the",
"RTree",
"Index",
"Virtual",
"Table"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/RTreeIndexCoreExtension.java#L421-L426 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.zone_zoneName_redirection_id_GET | public OvhRedirection zone_zoneName_redirection_id_GET(String zoneName, Long id) throws IOException {
String qPath = "/domain/zone/{zoneName}/redirection/{id}";
StringBuilder sb = path(qPath, zoneName, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhRedirection.class);
} | java | public OvhRedirection zone_zoneName_redirection_id_GET(String zoneName, Long id) throws IOException {
String qPath = "/domain/zone/{zoneName}/redirection/{id}";
StringBuilder sb = path(qPath, zoneName, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhRedirection.class);
} | [
"public",
"OvhRedirection",
"zone_zoneName_redirection_id_GET",
"(",
"String",
"zoneName",
",",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/zone/{zoneName}/redirection/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath"... | Get this object properties
REST: GET /domain/zone/{zoneName}/redirection/{id}
@param zoneName [required] The internal name of your zone
@param id [required] Id of the object | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L847-L852 |
vtatai/srec | core/src/main/java/com/github/srec/command/base/BaseCommand.java | BaseCommand.coerceToString | protected static String coerceToString(Value value, ExecutionContext context) {
if (value == null)
return null;
if (!(value instanceof StringValue))
throw new CommandExecutionException("Value " + value + ", class "
+ value.getClass().getCanonicalName() + " is not a string");
String str = value.toString... | java | protected static String coerceToString(Value value, ExecutionContext context) {
if (value == null)
return null;
if (!(value instanceof StringValue))
throw new CommandExecutionException("Value " + value + ", class "
+ value.getClass().getCanonicalName() + " is not a string");
String str = value.toString... | [
"protected",
"static",
"String",
"coerceToString",
"(",
"Value",
"value",
",",
"ExecutionContext",
"context",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"!",
"(",
"value",
"instanceof",
"StringValue",
")",
")",
"thro... | Coerces a value to String. Throws a
{@link com.github.srec.command.exception.CommandExecutionException} if
value is not of the expected type.
@param value
The value
@param context
The context used to evaluate the text, required if there is
string interpolation
@return The converted value | [
"Coerces",
"a",
"value",
"to",
"String",
".",
"Throws",
"a",
"{",
"@link",
"com",
".",
"github",
".",
"srec",
".",
"command",
".",
"exception",
".",
"CommandExecutionException",
"}",
"if",
"value",
"is",
"not",
"of",
"the",
"expected",
"type",
"."
] | train | https://github.com/vtatai/srec/blob/87fa6754a6a5f8569ef628db4d149eea04062568/core/src/main/java/com/github/srec/command/base/BaseCommand.java#L56-L66 |
m-m-m/util | validation/src/main/java/net/sf/mmm/util/validation/base/collection/AbstractMapValidatorBuilder.java | AbstractMapValidatorBuilder.withKeys | public <SUB extends ObjectValidatorBuilder<K, ? extends SELF, ?>> SUB withKeys(BiFunction<ObjectValidatorBuilderFactory<SELF>, K, SUB> factory) {
if (this.keySubBuilder != null) {
throw new IllegalStateException("keySubBuilder already exists!");
}
SUB sub = factory.apply(getSubFactory(), null);
t... | java | public <SUB extends ObjectValidatorBuilder<K, ? extends SELF, ?>> SUB withKeys(BiFunction<ObjectValidatorBuilderFactory<SELF>, K, SUB> factory) {
if (this.keySubBuilder != null) {
throw new IllegalStateException("keySubBuilder already exists!");
}
SUB sub = factory.apply(getSubFactory(), null);
t... | [
"public",
"<",
"SUB",
"extends",
"ObjectValidatorBuilder",
"<",
"K",
",",
"?",
"extends",
"SELF",
",",
"?",
">",
">",
"SUB",
"withKeys",
"(",
"BiFunction",
"<",
"ObjectValidatorBuilderFactory",
"<",
"SELF",
">",
",",
"K",
",",
"SUB",
">",
"factory",
")",
... | Creates a new {@link ObjectValidatorBuilder builder} for the {@link AbstractValidator validators} to invoke for
each {@link Map#keySet() key} in the {@link Map}.<br/>
Use {@link #and()} to return to this builder after the sub-builder is complete.<br/>
A typical usage looks like this:
<pre>
[...].withKeys((f, v) -> f.c... | [
"Creates",
"a",
"new",
"{",
"@link",
"ObjectValidatorBuilder",
"builder",
"}",
"for",
"the",
"{",
"@link",
"AbstractValidator",
"validators",
"}",
"to",
"invoke",
"for",
"each",
"{",
"@link",
"Map#keySet",
"()",
"key",
"}",
"in",
"the",
"{",
"@link",
"Map",
... | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/validation/src/main/java/net/sf/mmm/util/validation/base/collection/AbstractMapValidatorBuilder.java#L91-L99 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.hosting_web_serviceName_bandwidth_duration_GET | public OvhOrder hosting_web_serviceName_bandwidth_duration_GET(String serviceName, String duration, OvhBandwidthOfferEnum traffic) throws IOException {
String qPath = "/order/hosting/web/{serviceName}/bandwidth/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
query(sb, "traffic", traffic);
St... | java | public OvhOrder hosting_web_serviceName_bandwidth_duration_GET(String serviceName, String duration, OvhBandwidthOfferEnum traffic) throws IOException {
String qPath = "/order/hosting/web/{serviceName}/bandwidth/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
query(sb, "traffic", traffic);
St... | [
"public",
"OvhOrder",
"hosting_web_serviceName_bandwidth_duration_GET",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhBandwidthOfferEnum",
"traffic",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/hosting/web/{serviceName}/bandwidth/{du... | Get prices and contracts information
REST: GET /order/hosting/web/{serviceName}/bandwidth/{duration}
@param traffic [required] Available offers to increase bandwidth quota (unit: GB)
@param serviceName [required] The internal name of your hosting
@param duration [required] Duration | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L4800-L4806 |
ralscha/wampspring | src/main/java/ch/rasc/wampspring/user/UserEventMessenger.java | UserEventMessenger.sendToUsers | public void sendToUsers(String topicURI, Object event, Set<String> eligibleUsers) {
Set<String> eligibleSessionIds = null;
if (eligibleUsers != null && !eligibleUsers.isEmpty()) {
eligibleSessionIds = new HashSet<>(eligibleUsers.size());
for (String user : eligibleUsers) {
for (SimpSession session : thi... | java | public void sendToUsers(String topicURI, Object event, Set<String> eligibleUsers) {
Set<String> eligibleSessionIds = null;
if (eligibleUsers != null && !eligibleUsers.isEmpty()) {
eligibleSessionIds = new HashSet<>(eligibleUsers.size());
for (String user : eligibleUsers) {
for (SimpSession session : thi... | [
"public",
"void",
"sendToUsers",
"(",
"String",
"topicURI",
",",
"Object",
"event",
",",
"Set",
"<",
"String",
">",
"eligibleUsers",
")",
"{",
"Set",
"<",
"String",
">",
"eligibleSessionIds",
"=",
"null",
";",
"if",
"(",
"eligibleUsers",
"!=",
"null",
"&&"... | Send an {@link EventMessage} to every client that is currently subscribed to the
given topicURI and are listed in the eligibleUsers set. If no user of the provided
set is subscribed to the topicURI nothing happens.
@param topicURI the name of the topic
@param event the payload of the {@link EventMessage}
@param eligib... | [
"Send",
"an",
"{",
"@link",
"EventMessage",
"}",
"to",
"every",
"client",
"that",
"is",
"currently",
"subscribed",
"to",
"the",
"given",
"topicURI",
"and",
"are",
"listed",
"in",
"the",
"eligibleUsers",
"set",
".",
"If",
"no",
"user",
"of",
"the",
"provide... | train | https://github.com/ralscha/wampspring/blob/7571bb6773b848c580b29890587eb35397bfe5b5/src/main/java/ch/rasc/wampspring/user/UserEventMessenger.java#L145-L160 |
biezhi/anima | src/main/java/io/github/biezhi/anima/core/AnimaQuery.java | AnimaQuery.queryOne | public <S> S queryOne(Class<S> type, String sql, List<Object> params) {
if (Anima.of().isUseSQLLimit()) {
sql += " LIMIT 1";
}
List<S> list = queryList(type, sql, params);
return AnimaUtils.isNotEmpty(list) ? list.get(0) : null;
} | java | public <S> S queryOne(Class<S> type, String sql, List<Object> params) {
if (Anima.of().isUseSQLLimit()) {
sql += " LIMIT 1";
}
List<S> list = queryList(type, sql, params);
return AnimaUtils.isNotEmpty(list) ? list.get(0) : null;
} | [
"public",
"<",
"S",
">",
"S",
"queryOne",
"(",
"Class",
"<",
"S",
">",
"type",
",",
"String",
"sql",
",",
"List",
"<",
"Object",
">",
"params",
")",
"{",
"if",
"(",
"Anima",
".",
"of",
"(",
")",
".",
"isUseSQLLimit",
"(",
")",
")",
"{",
"sql",
... | Querying a model
@param type model type
@param sql sql statement
@param params params
@param <S>
@return S | [
"Querying",
"a",
"model"
] | train | https://github.com/biezhi/anima/blob/d6655e47ac4c08d9d7f961ac0569062bead8b1ed/src/main/java/io/github/biezhi/anima/core/AnimaQuery.java#L1098-L1104 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.consent_campaignName_decision_GET | public OvhConsent consent_campaignName_decision_GET(String campaignName) throws IOException {
String qPath = "/me/consent/{campaignName}/decision";
StringBuilder sb = path(qPath, campaignName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhConsent.class);
} | java | public OvhConsent consent_campaignName_decision_GET(String campaignName) throws IOException {
String qPath = "/me/consent/{campaignName}/decision";
StringBuilder sb = path(qPath, campaignName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhConsent.class);
} | [
"public",
"OvhConsent",
"consent_campaignName_decision_GET",
"(",
"String",
"campaignName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/consent/{campaignName}/decision\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"campaignName",
... | Get decision value for a consent campaign
REST: GET /me/consent/{campaignName}/decision
@param campaignName [required] Consent campaign name | [
"Get",
"decision",
"value",
"for",
"a",
"consent",
"campaign"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1562-L1567 |
facebook/fresco | imagepipeline-base/src/main/java/com/facebook/imagepipeline/cache/CountingLruMap.java | CountingLruMap.put | @Nullable
public synchronized V put(K key, V value) {
// We do remove and insert instead of just replace, in order to cause a structural change
// to the map, as we always want the latest inserted element to be last in the queue.
V oldValue = mMap.remove(key);
mSizeInBytes -= getValueSizeInBytes(oldVa... | java | @Nullable
public synchronized V put(K key, V value) {
// We do remove and insert instead of just replace, in order to cause a structural change
// to the map, as we always want the latest inserted element to be last in the queue.
V oldValue = mMap.remove(key);
mSizeInBytes -= getValueSizeInBytes(oldVa... | [
"@",
"Nullable",
"public",
"synchronized",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"// We do remove and insert instead of just replace, in order to cause a structural change",
"// to the map, as we always want the latest inserted element to be last in the queue.",
"... | Adds the element to the map, and removes the old element with the same key if any. | [
"Adds",
"the",
"element",
"to",
"the",
"map",
"and",
"removes",
"the",
"old",
"element",
"with",
"the",
"same",
"key",
"if",
"any",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/cache/CountingLruMap.java#L85-L94 |
tumblr/jumblr | src/main/java/com/tumblr/jumblr/JumblrClient.java | JumblrClient.postCreate | public Long postCreate(String blogName, Map<String, ?> detail) throws IOException {
return requestBuilder.postMultipart(JumblrClient.blogPath(blogName, "/post"), detail).getId();
} | java | public Long postCreate(String blogName, Map<String, ?> detail) throws IOException {
return requestBuilder.postMultipart(JumblrClient.blogPath(blogName, "/post"), detail).getId();
} | [
"public",
"Long",
"postCreate",
"(",
"String",
"blogName",
",",
"Map",
"<",
"String",
",",
"?",
">",
"detail",
")",
"throws",
"IOException",
"{",
"return",
"requestBuilder",
".",
"postMultipart",
"(",
"JumblrClient",
".",
"blogPath",
"(",
"blogName",
",",
"\... | Create a post
@param blogName The blog name for the post
@param detail the detail to save
@return Long the created post's id
@throws IOException if any file specified in detail cannot be read | [
"Create",
"a",
"post"
] | train | https://github.com/tumblr/jumblr/blob/373629fd545defb016e227ea758f092507fbd624/src/main/java/com/tumblr/jumblr/JumblrClient.java#L384-L386 |
msgpack/msgpack-java | msgpack-core/src/main/java/org/msgpack/core/buffer/MessageBuffer.java | MessageBuffer.newMessageBuffer | private static MessageBuffer newMessageBuffer(byte[] arr, int off, int len)
{
checkNotNull(arr);
if (mbArrConstructor != null) {
return newInstance(mbArrConstructor, arr, off, len);
}
return new MessageBuffer(arr, off, len);
} | java | private static MessageBuffer newMessageBuffer(byte[] arr, int off, int len)
{
checkNotNull(arr);
if (mbArrConstructor != null) {
return newInstance(mbArrConstructor, arr, off, len);
}
return new MessageBuffer(arr, off, len);
} | [
"private",
"static",
"MessageBuffer",
"newMessageBuffer",
"(",
"byte",
"[",
"]",
"arr",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"checkNotNull",
"(",
"arr",
")",
";",
"if",
"(",
"mbArrConstructor",
"!=",
"null",
")",
"{",
"return",
"newInstance",
... | Creates a new MessageBuffer instance backed by a java heap array
@param arr
@return | [
"Creates",
"a",
"new",
"MessageBuffer",
"instance",
"backed",
"by",
"a",
"java",
"heap",
"array"
] | train | https://github.com/msgpack/msgpack-java/blob/16e370e348215a72a14c210b42d448d513aee015/msgpack-core/src/main/java/org/msgpack/core/buffer/MessageBuffer.java#L273-L280 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisStorage.java | RedisStorage.removeCalendar | @Override
public boolean removeCalendar(String calendarName, Jedis jedis) throws JobPersistenceException {
final String calendarTriggersSetKey = redisSchema.calendarTriggersSetKey(calendarName);
if(jedis.scard(calendarTriggersSetKey) > 0){
throw new JobPersistenceException(String.format... | java | @Override
public boolean removeCalendar(String calendarName, Jedis jedis) throws JobPersistenceException {
final String calendarTriggersSetKey = redisSchema.calendarTriggersSetKey(calendarName);
if(jedis.scard(calendarTriggersSetKey) > 0){
throw new JobPersistenceException(String.format... | [
"@",
"Override",
"public",
"boolean",
"removeCalendar",
"(",
"String",
"calendarName",
",",
"Jedis",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"final",
"String",
"calendarTriggersSetKey",
"=",
"redisSchema",
".",
"calendarTriggersSetKey",
"(",
"calendarNam... | Remove (delete) the <code>{@link org.quartz.Calendar}</code> with the given name.
@param calendarName the name of the calendar to be removed
@param jedis a thread-safe Redis connection
@return true if a calendar with the given name was found and removed | [
"Remove",
"(",
"delete",
")",
"the",
"<code",
">",
"{"
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisStorage.java#L323-L337 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/trees/Treebank.java | Treebank.loadPath | public void loadPath(String pathName, String suffix, boolean recursively) {
loadPath(new File(pathName), new ExtensionFileFilter(suffix, recursively));
} | java | public void loadPath(String pathName, String suffix, boolean recursively) {
loadPath(new File(pathName), new ExtensionFileFilter(suffix, recursively));
} | [
"public",
"void",
"loadPath",
"(",
"String",
"pathName",
",",
"String",
"suffix",
",",
"boolean",
"recursively",
")",
"{",
"loadPath",
"(",
"new",
"File",
"(",
"pathName",
")",
",",
"new",
"ExtensionFileFilter",
"(",
"suffix",
",",
"recursively",
")",
")",
... | Load trees from given directory.
@param pathName File or directory name
@param suffix Extension of files to load: If <code>pathName</code>
is a directory, then, if this is
non-<code>null</code>, all and only files ending in "." followed
by this extension will be loaded; if it is <code>null</code>,
all files in... | [
"Load",
"trees",
"from",
"given",
"directory",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/Treebank.java#L166-L168 |
banq/jdonframework | JdonAccessory/jdon-hibernate3x/src/main/java/com/jdon/model/query/block/BlockStrategy.java | BlockStrategy.getBlock | public Block getBlock(String sqlquery, Collection queryParams, int startIndex, int count) {
Debug.logVerbose("[JdonFramework]enter getBlock .. ", module);
if ((count > this.blockLength) || (count <= 0)) { // every query max
// length must be
// little than
// blockLength
count = this.blockLength;
... | java | public Block getBlock(String sqlquery, Collection queryParams, int startIndex, int count) {
Debug.logVerbose("[JdonFramework]enter getBlock .. ", module);
if ((count > this.blockLength) || (count <= 0)) { // every query max
// length must be
// little than
// blockLength
count = this.blockLength;
... | [
"public",
"Block",
"getBlock",
"(",
"String",
"sqlquery",
",",
"Collection",
"queryParams",
",",
"int",
"startIndex",
",",
"int",
"count",
")",
"{",
"Debug",
".",
"logVerbose",
"(",
"\"[JdonFramework]enter getBlock .. \"",
",",
"module",
")",
";",
"if",
"(",
"... | get a data block by the sql sentence.
@param sqlqueryAllCount
@param sqlquery
@return if not found, return null; | [
"get",
"a",
"data",
"block",
"by",
"the",
"sql",
"sentence",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-hibernate3x/src/main/java/com/jdon/model/query/block/BlockStrategy.java#L142-L159 |
banq/jdonframework | JdonAccessory/jdon-struts1x/src/main/java/com/jdon/strutsutil/ModelListAction.java | ModelListAction.setModellistByModel | private void setModellistByModel(ModelListForm listForm, PageIterator pageIterator, HttpServletRequest request) {
Collection c = null;
try {
listForm.setAllCount(pageIterator.getAllCount());
if (pageIterator.getCount() != 0)
listForm.setCount(pageIterator.getCount());
c = new ArrayList(pageIterat... | java | private void setModellistByModel(ModelListForm listForm, PageIterator pageIterator, HttpServletRequest request) {
Collection c = null;
try {
listForm.setAllCount(pageIterator.getAllCount());
if (pageIterator.getCount() != 0)
listForm.setCount(pageIterator.getCount());
c = new ArrayList(pageIterat... | [
"private",
"void",
"setModellistByModel",
"(",
"ModelListForm",
"listForm",
",",
"PageIterator",
"pageIterator",
",",
"HttpServletRequest",
"request",
")",
"{",
"Collection",
"c",
"=",
"null",
";",
"try",
"{",
"listForm",
".",
"setAllCount",
"(",
"pageIterator",
"... | /*
the elements in pageIterator is Model type we directly add them in result | [
"/",
"*",
"the",
"elements",
"in",
"pageIterator",
"is",
"Model",
"type",
"we",
"directly",
"add",
"them",
"in",
"result"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-struts1x/src/main/java/com/jdon/strutsutil/ModelListAction.java#L100-L119 |
xetorthio/jedis | src/main/java/redis/clients/jedis/BinaryJedis.java | BinaryJedis.setex | @Override
public String setex(final byte[] key, final int seconds, final byte[] value) {
checkIsInMultiOrPipeline();
client.setex(key, seconds, value);
return client.getStatusCodeReply();
} | java | @Override
public String setex(final byte[] key, final int seconds, final byte[] value) {
checkIsInMultiOrPipeline();
client.setex(key, seconds, value);
return client.getStatusCodeReply();
} | [
"@",
"Override",
"public",
"String",
"setex",
"(",
"final",
"byte",
"[",
"]",
"key",
",",
"final",
"int",
"seconds",
",",
"final",
"byte",
"[",
"]",
"value",
")",
"{",
"checkIsInMultiOrPipeline",
"(",
")",
";",
"client",
".",
"setex",
"(",
"key",
",",
... | The command is exactly equivalent to the following group of commands:
{@link #set(byte[], byte[]) SET} + {@link #expire(byte[], int) EXPIRE}. The operation is
atomic.
<p>
Time complexity: O(1)
@param key
@param seconds
@param value
@return Status code reply | [
"The",
"command",
"is",
"exactly",
"equivalent",
"to",
"the",
"following",
"group",
"of",
"commands",
":",
"{"
] | train | https://github.com/xetorthio/jedis/blob/ef4ab403f9d8fd88bd05092fea96de2e9db0bede/src/main/java/redis/clients/jedis/BinaryJedis.java#L660-L665 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualFile.java | VirtualFile.getChildren | public List<VirtualFile> getChildren(VirtualFileFilter filter) throws IOException {
// isDirectory does the read security check
if (!isDirectory()) { return Collections.emptyList(); }
if (filter == null) { filter = MatchAllVirtualFileFilter.INSTANCE; }
FilterVirtualFileVisitor visitor = ... | java | public List<VirtualFile> getChildren(VirtualFileFilter filter) throws IOException {
// isDirectory does the read security check
if (!isDirectory()) { return Collections.emptyList(); }
if (filter == null) { filter = MatchAllVirtualFileFilter.INSTANCE; }
FilterVirtualFileVisitor visitor = ... | [
"public",
"List",
"<",
"VirtualFile",
">",
"getChildren",
"(",
"VirtualFileFilter",
"filter",
")",
"throws",
"IOException",
"{",
"// isDirectory does the read security check",
"if",
"(",
"!",
"isDirectory",
"(",
")",
")",
"{",
"return",
"Collections",
".",
"emptyLis... | Get the children
@param filter to filter the children
@return the children
@throws IOException for any problem accessing the virtual file system
@throws IllegalStateException if the file is closed or it is a leaf node | [
"Get",
"the",
"children"
] | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualFile.java#L422-L429 |
wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/router/AbstractRouter.java | AbstractRouter.getReverseRouteFor | @Override
public String getReverseRouteFor(Controller controller, String method, String var1, Object val1) {
return getReverseRouteFor(controller, method, ImmutableMap.of(var1, val1));
} | java | @Override
public String getReverseRouteFor(Controller controller, String method, String var1, Object val1) {
return getReverseRouteFor(controller, method, ImmutableMap.of(var1, val1));
} | [
"@",
"Override",
"public",
"String",
"getReverseRouteFor",
"(",
"Controller",
"controller",
",",
"String",
"method",
",",
"String",
"var1",
",",
"Object",
"val1",
")",
"{",
"return",
"getReverseRouteFor",
"(",
"controller",
",",
"method",
",",
"ImmutableMap",
".... | Gets the url of the route handled by the specified action method.
@param controller the controller object
@param method the controller method
@param var1 the first parameter name
@param val1 the first parameter value
@return the url, {@literal null} if the action method is not found. | [
"Gets",
"the",
"url",
"of",
"the",
"route",
"handled",
"by",
"the",
"specified",
"action",
"method",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/router/AbstractRouter.java#L154-L157 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/FileSteps.java | FileSteps.uploadFile | @Conditioned
@Lorsque("J'utilise l'élément '(.*)-(.*)' pour uploader le fichier '(.*)'[\\.|\\?]")
@Then("I use '(.*)-(.*)' element to upload '(.*)' file[\\.|\\?]")
public void uploadFile(String page, String element, String filename, List<GherkinStepCondition> conditions) throws FailureException, TechnicalEx... | java | @Conditioned
@Lorsque("J'utilise l'élément '(.*)-(.*)' pour uploader le fichier '(.*)'[\\.|\\?]")
@Then("I use '(.*)-(.*)' element to upload '(.*)' file[\\.|\\?]")
public void uploadFile(String page, String element, String filename, List<GherkinStepCondition> conditions) throws FailureException, TechnicalEx... | [
"@",
"Conditioned",
"@",
"Lorsque",
"(",
"\"J'utilise l'élément '(.*)-(.*)' pour uploader le fichier '(.*)'[\\\\.|\\\\?]\")",
"",
"@",
"Then",
"(",
"\"I use '(.*)-(.*)' element to upload '(.*)' file[\\\\.|\\\\?]\"",
")",
"public",
"void",
"uploadFile",
"(",
"String",
"page",
",",... | Waits the full download of a file with a maximum timeout in seconds.
@param page
The page to upload the file from
@param element
The file input field
@param filename
The name of the file to upload (from the default downloaded files directory)
@param conditions
List of 'expected' values condition and 'actual' values ({... | [
"Waits",
"the",
"full",
"download",
"of",
"a",
"file",
"with",
"a",
"maximum",
"timeout",
"in",
"seconds",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/FileSteps.java#L155-L160 |
Whiley/WhileyCompiler | src/main/java/wyil/interpreter/Interpreter.java | Interpreter.executeVariableDeclaration | private Status executeVariableDeclaration(Decl.Variable stmt, CallStack frame) {
// We only need to do something if this has an initialiser
if(stmt.hasInitialiser()) {
RValue value = executeExpression(ANY_T, stmt.getInitialiser(), frame);
frame.putLocal(stmt.getName(),value);
}
return Status.NEXT;
} | java | private Status executeVariableDeclaration(Decl.Variable stmt, CallStack frame) {
// We only need to do something if this has an initialiser
if(stmt.hasInitialiser()) {
RValue value = executeExpression(ANY_T, stmt.getInitialiser(), frame);
frame.putLocal(stmt.getName(),value);
}
return Status.NEXT;
} | [
"private",
"Status",
"executeVariableDeclaration",
"(",
"Decl",
".",
"Variable",
"stmt",
",",
"CallStack",
"frame",
")",
"{",
"// We only need to do something if this has an initialiser",
"if",
"(",
"stmt",
".",
"hasInitialiser",
"(",
")",
")",
"{",
"RValue",
"value",... | Execute a variable declaration statement at a given point in the function or method
body
@param stmt
--- The statement to execute
@param frame
--- The current stack frame
@return | [
"Execute",
"a",
"variable",
"declaration",
"statement",
"at",
"a",
"given",
"point",
"in",
"the",
"function",
"or",
"method",
"body"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/interpreter/Interpreter.java#L517-L524 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java | InstanceGroupManagerClient.resizeInstanceGroupManager | @BetaApi
public final Operation resizeInstanceGroupManager(Integer size, String instanceGroupManager) {
ResizeInstanceGroupManagerHttpRequest request =
ResizeInstanceGroupManagerHttpRequest.newBuilder()
.setSize(size)
.setInstanceGroupManager(instanceGroupManager)
.bui... | java | @BetaApi
public final Operation resizeInstanceGroupManager(Integer size, String instanceGroupManager) {
ResizeInstanceGroupManagerHttpRequest request =
ResizeInstanceGroupManagerHttpRequest.newBuilder()
.setSize(size)
.setInstanceGroupManager(instanceGroupManager)
.bui... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"resizeInstanceGroupManager",
"(",
"Integer",
"size",
",",
"String",
"instanceGroupManager",
")",
"{",
"ResizeInstanceGroupManagerHttpRequest",
"request",
"=",
"ResizeInstanceGroupManagerHttpRequest",
".",
"newBuilder",
"(",
"... | Resizes the managed instance group. If you increase the size, the group creates new instances
using the current instance template. If you decrease the size, the group deletes instances. The
resize operation is marked DONE when the resize actions are scheduled even if the group has not
yet added or deleted any instances... | [
"Resizes",
"the",
"managed",
"instance",
"group",
".",
"If",
"you",
"increase",
"the",
"size",
"the",
"group",
"creates",
"new",
"instances",
"using",
"the",
"current",
"instance",
"template",
".",
"If",
"you",
"decrease",
"the",
"size",
"the",
"group",
"del... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java#L1663-L1672 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/model/BucketReplicationConfiguration.java | BucketReplicationConfiguration.setRules | public void setRules(Map<String, ReplicationRule> rules) {
if (rules == null) {
throw new IllegalArgumentException(
"Replication rules cannot be null");
}
this.rules = new HashMap<String, ReplicationRule>(rules);
} | java | public void setRules(Map<String, ReplicationRule> rules) {
if (rules == null) {
throw new IllegalArgumentException(
"Replication rules cannot be null");
}
this.rules = new HashMap<String, ReplicationRule>(rules);
} | [
"public",
"void",
"setRules",
"(",
"Map",
"<",
"String",
",",
"ReplicationRule",
">",
"rules",
")",
"{",
"if",
"(",
"rules",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Replication rules cannot be null\"",
")",
";",
"}",
"this",... | Sets the replication rules for the Amazon S3 bucket.
@param rules
the replication rules for the Amazon S3 bucket.
@throws IllegalArgumentException
if the rules are null. | [
"Sets",
"the",
"replication",
"rules",
"for",
"the",
"Amazon",
"S3",
"bucket",
"."
] | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/model/BucketReplicationConfiguration.java#L93-L99 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java | FactoryMultiView.computePnPwithEPnP | public static Estimate1ofPnP computePnPwithEPnP(int numIterations, double magicNumber) {
PnPLepetitEPnP alg = new PnPLepetitEPnP(magicNumber);
alg.setNumIterations(numIterations);
return new WrapPnPLepetitEPnP(alg);
} | java | public static Estimate1ofPnP computePnPwithEPnP(int numIterations, double magicNumber) {
PnPLepetitEPnP alg = new PnPLepetitEPnP(magicNumber);
alg.setNumIterations(numIterations);
return new WrapPnPLepetitEPnP(alg);
} | [
"public",
"static",
"Estimate1ofPnP",
"computePnPwithEPnP",
"(",
"int",
"numIterations",
",",
"double",
"magicNumber",
")",
"{",
"PnPLepetitEPnP",
"alg",
"=",
"new",
"PnPLepetitEPnP",
"(",
"magicNumber",
")",
";",
"alg",
".",
"setNumIterations",
"(",
"numIterations"... | Returns a solution to the PnP problem for 4 or more points using EPnP. Fast and fairly
accurate algorithm. Can handle general and planar scenario automatically.
<p>NOTE: Observations are in normalized image coordinates NOT pixels.</p>
@see PnPLepetitEPnP
@param numIterations If more then zero then non-linear optimi... | [
"Returns",
"a",
"solution",
"to",
"the",
"PnP",
"problem",
"for",
"4",
"or",
"more",
"points",
"using",
"EPnP",
".",
"Fast",
"and",
"fairly",
"accurate",
"algorithm",
".",
"Can",
"handle",
"general",
"and",
"planar",
"scenario",
"automatically",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L511-L515 |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/IterableOfProtosSubject.java | IterableOfProtosSubject.withPartialScope | public IterableOfProtosFluentAssertion<M> withPartialScope(FieldScope fieldScope) {
return usingConfig(config.withPartialScope(checkNotNull(fieldScope, "fieldScope")));
} | java | public IterableOfProtosFluentAssertion<M> withPartialScope(FieldScope fieldScope) {
return usingConfig(config.withPartialScope(checkNotNull(fieldScope, "fieldScope")));
} | [
"public",
"IterableOfProtosFluentAssertion",
"<",
"M",
">",
"withPartialScope",
"(",
"FieldScope",
"fieldScope",
")",
"{",
"return",
"usingConfig",
"(",
"config",
".",
"withPartialScope",
"(",
"checkNotNull",
"(",
"fieldScope",
",",
"\"fieldScope\"",
")",
")",
")",
... | Limits the comparison of Protocol buffers to the defined {@link FieldScope}.
<p>This method is additive and has well-defined ordering semantics. If the invoking {@link
ProtoFluentAssertion} is already scoped to a {@link FieldScope} {@code X}, and this method is
invoked with {@link FieldScope} {@code Y}, the resultant ... | [
"Limits",
"the",
"comparison",
"of",
"Protocol",
"buffers",
"to",
"the",
"defined",
"{",
"@link",
"FieldScope",
"}",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/IterableOfProtosSubject.java#L878-L880 |
samskivert/pythagoras | src/main/java/pythagoras/f/Matrix3.java | Matrix3.setToReflection | public Matrix3 setToReflection (float x, float y, float z) {
float x2 = -2f*x, y2 = -2f*y, z2 = -2f*z;
float xy2 = x2*y, xz2 = x2*z, yz2 = y2*z;
return set(1f + x2*x, xy2, xz2,
xy2, 1f + y2*y, yz2,
xz2, yz2, 1f + z2*z);
} | java | public Matrix3 setToReflection (float x, float y, float z) {
float x2 = -2f*x, y2 = -2f*y, z2 = -2f*z;
float xy2 = x2*y, xz2 = x2*z, yz2 = y2*z;
return set(1f + x2*x, xy2, xz2,
xy2, 1f + y2*y, yz2,
xz2, yz2, 1f + z2*z);
} | [
"public",
"Matrix3",
"setToReflection",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"float",
"x2",
"=",
"-",
"2f",
"*",
"x",
",",
"y2",
"=",
"-",
"2f",
"*",
"y",
",",
"z2",
"=",
"-",
"2f",
"*",
"z",
";",
"float",
"xy2",... | Sets this to a reflection across a plane intersecting the origin with the supplied normal.
@return a reference to this matrix, for chaining. | [
"Sets",
"this",
"to",
"a",
"reflection",
"across",
"a",
"plane",
"intersecting",
"the",
"origin",
"with",
"the",
"supplied",
"normal",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Matrix3.java#L243-L249 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowController.java | FlowController.execute | public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response )
throws Exception
{
//
// Don't actually run the action (and perform the associated synchronization) if there are too many
... | java | public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response )
throws Exception
{
//
// Don't actually run the action (and perform the associated synchronization) if there are too many
... | [
"public",
"ActionForward",
"execute",
"(",
"ActionMapping",
"mapping",
",",
"ActionForm",
"form",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"Exception",
"{",
"//",
"// Don't actually run the action (and perform the associated... | Perform decision logic to determine the next URI to be displayed.
@param mapping the Struts ActionMapping for the current action being processed.
@param form the form-bean (if any) associated with the Struts action being processed. May be null.
@param request the current HttpServletRequest.
@param response the curren... | [
"Perform",
"decision",
"logic",
"to",
"determine",
"the",
"next",
"URI",
"to",
"be",
"displayed",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowController.java#L307-L366 |
auth0/Lock.Android | lib/src/main/java/com/auth0/android/lock/views/SocialButton.java | SocialButton.setStyle | public void setStyle(AuthConfig config, @AuthMode int mode) {
final Drawable logo = config.getLogo(getContext());
final int backgroundColor = config.getBackgroundColor(getContext());
Drawable touchBackground = getTouchFeedbackBackground(backgroundColor, smallSize ? ViewUtils.Corners.ALL : ViewUt... | java | public void setStyle(AuthConfig config, @AuthMode int mode) {
final Drawable logo = config.getLogo(getContext());
final int backgroundColor = config.getBackgroundColor(getContext());
Drawable touchBackground = getTouchFeedbackBackground(backgroundColor, smallSize ? ViewUtils.Corners.ALL : ViewUt... | [
"public",
"void",
"setStyle",
"(",
"AuthConfig",
"config",
",",
"@",
"AuthMode",
"int",
"mode",
")",
"{",
"final",
"Drawable",
"logo",
"=",
"config",
".",
"getLogo",
"(",
"getContext",
"(",
")",
")",
";",
"final",
"int",
"backgroundColor",
"=",
"config",
... | Configures the button with the given connection information.
@param config contains the connection information.
@param mode the current button mode. Used to prefix the title with "Log In" or "Sign Up". | [
"Configures",
"the",
"button",
"with",
"the",
"given",
"connection",
"information",
"."
] | train | https://github.com/auth0/Lock.Android/blob/8eb2a979048d2eb6cf0ec631e82e6c3fe6e7d220/lib/src/main/java/com/auth0/android/lock/views/SocialButton.java#L71-L96 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java | StaticTypeCheckingSupport.allParametersAndArgumentsMatchWithDefaultParams | static int allParametersAndArgumentsMatchWithDefaultParams(Parameter[] params, ClassNode[] args) {
int dist = 0;
ClassNode ptype = null;
// we already know the lengths are equal
for (int i = 0, j = 0; i < params.length; i++) {
Parameter param = params[i];
ClassNod... | java | static int allParametersAndArgumentsMatchWithDefaultParams(Parameter[] params, ClassNode[] args) {
int dist = 0;
ClassNode ptype = null;
// we already know the lengths are equal
for (int i = 0, j = 0; i < params.length; i++) {
Parameter param = params[i];
ClassNod... | [
"static",
"int",
"allParametersAndArgumentsMatchWithDefaultParams",
"(",
"Parameter",
"[",
"]",
"params",
",",
"ClassNode",
"[",
"]",
"args",
")",
"{",
"int",
"dist",
"=",
"0",
";",
"ClassNode",
"ptype",
"=",
"null",
";",
"// we already know the lengths are equal",
... | Checks that arguments and parameter types match, expecting that the number of parameters is strictly greater
than the number of arguments, allowing possible inclusion of default parameters.
@param params method parameters
@param args type arguments
@return -1 if arguments do not match, 0 if arguments are of the exac... | [
"Checks",
"that",
"arguments",
"and",
"parameter",
"types",
"match",
"expecting",
"that",
"the",
"number",
"of",
"parameters",
"is",
"strictly",
"greater",
"than",
"the",
"number",
"of",
"arguments",
"allowing",
"possible",
"inclusion",
"of",
"default",
"parameter... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java#L384-L409 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/MediaApi.java | MediaApi.removeMedia | public ApiSuccessResponse removeMedia(String mediatype, LogoutMediaData logoutMediaData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = removeMediaWithHttpInfo(mediatype, logoutMediaData);
return resp.getData();
} | java | public ApiSuccessResponse removeMedia(String mediatype, LogoutMediaData logoutMediaData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = removeMediaWithHttpInfo(mediatype, logoutMediaData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"removeMedia",
"(",
"String",
"mediatype",
",",
"LogoutMediaData",
"logoutMediaData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"removeMediaWithHttpInfo",
"(",
"mediatype",
",",
"logou... | Log out of a media channel
Log out the current agent on the specified media channels. You can make a [/media/{mediatype}/ready](/reference/workspace/Media/index.html#readyAgentState) or [/media/{mediatype}/not-ready](/reference/workspace/Media/index.html#notReadyAgentState) request to log in to the media channel again.... | [
"Log",
"out",
"of",
"a",
"media",
"channel",
"Log",
"out",
"the",
"current",
"agent",
"on",
"the",
"specified",
"media",
"channels",
".",
"You",
"can",
"make",
"a",
"[",
"/",
"media",
"/",
"{",
"mediatype",
"}",
"/",
"ready",
"]",
"(",
"/",
"referenc... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/MediaApi.java#L3917-L3920 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/lock/LockManager.java | LockManager.lockerWaitingOn | public boolean lockerWaitingOn(Locker locker, Locker target)
{
//-------------------------------------------------------------
// Locker can be waiting on at most one lock. If that lock
// is held by target or if any of the holders of that lock
// is waiting on the target then locker... | java | public boolean lockerWaitingOn(Locker locker, Locker target)
{
//-------------------------------------------------------------
// Locker can be waiting on at most one lock. If that lock
// is held by target or if any of the holders of that lock
// is waiting on the target then locker... | [
"public",
"boolean",
"lockerWaitingOn",
"(",
"Locker",
"locker",
",",
"Locker",
"target",
")",
"{",
"//-------------------------------------------------------------",
"// Locker can be waiting on at most one lock. If that lock",
"// is held by target or if any of the holders of that lock",... | /*
Return true iff the given locker is waiting on the given target;
recurse as necessary. | [
"/",
"*",
"Return",
"true",
"iff",
"the",
"given",
"locker",
"is",
"waiting",
"on",
"the",
"given",
"target",
";",
"recurse",
"as",
"necessary",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/lock/LockManager.java#L412-L437 |
spring-projects/spring-mobile | spring-mobile-device/src/main/java/org/springframework/mobile/device/util/ResolverUtils.java | ResolverUtils.isTablet | public static boolean isTablet(Device device, SitePreference sitePreference) {
return sitePreference == SitePreference.TABLET || device != null && device.isTablet() && sitePreference == null;
} | java | public static boolean isTablet(Device device, SitePreference sitePreference) {
return sitePreference == SitePreference.TABLET || device != null && device.isTablet() && sitePreference == null;
} | [
"public",
"static",
"boolean",
"isTablet",
"(",
"Device",
"device",
",",
"SitePreference",
"sitePreference",
")",
"{",
"return",
"sitePreference",
"==",
"SitePreference",
".",
"TABLET",
"||",
"device",
"!=",
"null",
"&&",
"device",
".",
"isTablet",
"(",
")",
"... | Should the combination of {@link Device} and {@link SitePreference} be handled
as a tablet device
@param device the resolved device
@param sitePreference the specified site preference
@return true if tablet | [
"Should",
"the",
"combination",
"of",
"{"
] | train | https://github.com/spring-projects/spring-mobile/blob/a402cbcaf208e24288b957f44c9984bd6e8bf064/spring-mobile-device/src/main/java/org/springframework/mobile/device/util/ResolverUtils.java#L59-L61 |
TrueNight/Utils | utils/src/main/java/xyz/truenight/utils/Cache.java | Cache.that | @SuppressWarnings("unchecked")
public static <T> T that(Object key, Supplier<T> what) {
if (CACHE.get(key) != null) {
try {
return (T) CACHE.get(key);
} catch (ClassCastException e) {
System.out.print("E/Cache: Can't use cached object: wrong type");
... | java | @SuppressWarnings("unchecked")
public static <T> T that(Object key, Supplier<T> what) {
if (CACHE.get(key) != null) {
try {
return (T) CACHE.get(key);
} catch (ClassCastException e) {
System.out.print("E/Cache: Can't use cached object: wrong type");
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"that",
"(",
"Object",
"key",
",",
"Supplier",
"<",
"T",
">",
"what",
")",
"{",
"if",
"(",
"CACHE",
".",
"get",
"(",
"key",
")",
"!=",
"null",
")",
"{",
"... | Registers creator of item and returns item from cache or creator | [
"Registers",
"creator",
"of",
"item",
"and",
"returns",
"item",
"from",
"cache",
"or",
"creator"
] | train | https://github.com/TrueNight/Utils/blob/78a11faa16258b09f08826797370310ab650530c/utils/src/main/java/xyz/truenight/utils/Cache.java#L33-L46 |
powermock/powermock | powermock-modules/powermock-module-javaagent/src/main/java/sun/tools/attach/HotSpotVirtualMachine.java | HotSpotVirtualMachine.loadAgentLibrary | private void loadAgentLibrary(String agentLibrary, boolean isAbsolute, String options)
throws AgentLoadException, AgentInitializationException, IOException
{
InputStream in = execute("load",
agentLibrary,
isAbsolute ? "true" : "false"... | java | private void loadAgentLibrary(String agentLibrary, boolean isAbsolute, String options)
throws AgentLoadException, AgentInitializationException, IOException
{
InputStream in = execute("load",
agentLibrary,
isAbsolute ? "true" : "false"... | [
"private",
"void",
"loadAgentLibrary",
"(",
"String",
"agentLibrary",
",",
"boolean",
"isAbsolute",
",",
"String",
"options",
")",
"throws",
"AgentLoadException",
",",
"AgentInitializationException",
",",
"IOException",
"{",
"InputStream",
"in",
"=",
"execute",
"(",
... | /*
Load agent library
If isAbsolute is true then the agent library is the absolute path
to the library and thus will not be expanded in the target VM.
if isAbsolute is false then the agent library is just a library
name and it will be expended in the target VM. | [
"/",
"*",
"Load",
"agent",
"library",
"If",
"isAbsolute",
"is",
"true",
"then",
"the",
"agent",
"library",
"is",
"the",
"absolute",
"path",
"to",
"the",
"library",
"and",
"thus",
"will",
"not",
"be",
"expanded",
"in",
"the",
"target",
"VM",
".",
"if",
... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-modules/powermock-module-javaagent/src/main/java/sun/tools/attach/HotSpotVirtualMachine.java#L54-L70 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java | NetworkInterfacesInner.listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync | public Observable<ServiceResponse<Page<NetworkInterfaceIPConfigurationInner>>> listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) {
return listVirtualMach... | java | public Observable<ServiceResponse<Page<NetworkInterfaceIPConfigurationInner>>> listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) {
return listVirtualMach... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"NetworkInterfaceIPConfigurationInner",
">",
">",
">",
"listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"virtualMachineSca... | Get the specified network interface ip configuration in a virtual machine scale set.
@param resourceGroupName The name of the resource group.
@param virtualMachineScaleSetName The name of the virtual machine scale set.
@param virtualmachineIndex The virtual machine index.
@param networkInterfaceName The name of the ne... | [
"Get",
"the",
"specified",
"network",
"interface",
"ip",
"configuration",
"in",
"a",
"virtual",
"machine",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java#L2005-L2017 |
alkacon/opencms-core | src/org/opencms/ade/contenteditor/CmsContentEditorActionElement.java | CmsContentEditorActionElement.addExternalResourceTags | private void addExternalResourceTags(StringBuffer sb, CmsContentDefinition definition) {
Set<String> includedScripts = new HashSet<String>();
Set<String> includedStyles = new HashSet<String>();
for (CmsExternalWidgetConfiguration configuration : definition.getExternalWidgetConfigurations())... | java | private void addExternalResourceTags(StringBuffer sb, CmsContentDefinition definition) {
Set<String> includedScripts = new HashSet<String>();
Set<String> includedStyles = new HashSet<String>();
for (CmsExternalWidgetConfiguration configuration : definition.getExternalWidgetConfigurations())... | [
"private",
"void",
"addExternalResourceTags",
"(",
"StringBuffer",
"sb",
",",
"CmsContentDefinition",
"definition",
")",
"{",
"Set",
"<",
"String",
">",
"includedScripts",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"Set",
"<",
"String",
">",
"... | Adds link and script tags to the buffer if required for external widgets.<p>
@param sb the string buffer to append the tags to
@param definition the content definition | [
"Adds",
"link",
"and",
"script",
"tags",
"to",
"the",
"buffer",
"if",
"required",
"for",
"external",
"widgets",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/contenteditor/CmsContentEditorActionElement.java#L97-L117 |
fommil/matrix-toolkits-java | src/main/java/no/uib/cipr/matrix/DenseLU.java | DenseLU.rcond | public double rcond(Matrix A, Norm norm) {
if (norm != Norm.One && norm != Norm.Infinity)
throw new IllegalArgumentException(
"Only the 1 or the Infinity norms are supported");
double anorm = A.norm(norm);
int n = A.numRows();
intW info = new intW(0);
... | java | public double rcond(Matrix A, Norm norm) {
if (norm != Norm.One && norm != Norm.Infinity)
throw new IllegalArgumentException(
"Only the 1 or the Infinity norms are supported");
double anorm = A.norm(norm);
int n = A.numRows();
intW info = new intW(0);
... | [
"public",
"double",
"rcond",
"(",
"Matrix",
"A",
",",
"Norm",
"norm",
")",
"{",
"if",
"(",
"norm",
"!=",
"Norm",
".",
"One",
"&&",
"norm",
"!=",
"Norm",
".",
"Infinity",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Only the 1 or the Infinity norm... | Computes the reciprocal condition number, using either the infinity norm
of the 1 norm.
@param A
The matrix this is a decomposition of
@param norm
Either <code>Norm.One</code> or <code>Norm.Infinity</code>
@return The reciprocal condition number. Values close to unity indicate a
well-conditioned system, while numbers ... | [
"Computes",
"the",
"reciprocal",
"condition",
"number",
"using",
"either",
"the",
"infinity",
"norm",
"of",
"the",
"1",
"norm",
"."
] | train | https://github.com/fommil/matrix-toolkits-java/blob/6157618bc86bcda3749af2a60bf869d8f3292960/src/main/java/no/uib/cipr/matrix/DenseLU.java#L138-L157 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/LongStream.java | LongStream.flatMap | @NotNull
public LongStream flatMap(@NotNull final LongFunction<? extends LongStream> mapper) {
return new LongStream(params, new LongFlatMap(iterator, mapper));
} | java | @NotNull
public LongStream flatMap(@NotNull final LongFunction<? extends LongStream> mapper) {
return new LongStream(params, new LongFlatMap(iterator, mapper));
} | [
"@",
"NotNull",
"public",
"LongStream",
"flatMap",
"(",
"@",
"NotNull",
"final",
"LongFunction",
"<",
"?",
"extends",
"LongStream",
">",
"mapper",
")",
"{",
"return",
"new",
"LongStream",
"(",
"params",
",",
"new",
"LongFlatMap",
"(",
"iterator",
",",
"mappe... | Returns a stream consisting of the results of replacing each element of
this stream with the contents of a mapped stream produced by applying
the provided mapping function to each element.
<p>This is an intermediate operation.
<p>Example:
<pre>
mapper: (a) -> [a, a + 5]
stream: [1, 2, 3, 4]
result: [1, 6, 2, 7, 3,... | [
"Returns",
"a",
"stream",
"consisting",
"of",
"the",
"results",
"of",
"replacing",
"each",
"element",
"of",
"this",
"stream",
"with",
"the",
"contents",
"of",
"a",
"mapped",
"stream",
"produced",
"by",
"applying",
"the",
"provided",
"mapping",
"function",
"to"... | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/LongStream.java#L563-L566 |
alkacon/opencms-core | src/org/opencms/acacia/shared/CmsEntity.java | CmsEntity.addAttributeValue | public void addAttributeValue(String attributeName, String value) {
if (m_entityAttributes.containsKey(attributeName)) {
throw new RuntimeException("Attribute already exists with a entity type value.");
}
if (m_simpleAttributes.containsKey(attributeName)) {
m_simpl... | java | public void addAttributeValue(String attributeName, String value) {
if (m_entityAttributes.containsKey(attributeName)) {
throw new RuntimeException("Attribute already exists with a entity type value.");
}
if (m_simpleAttributes.containsKey(attributeName)) {
m_simpl... | [
"public",
"void",
"addAttributeValue",
"(",
"String",
"attributeName",
",",
"String",
"value",
")",
"{",
"if",
"(",
"m_entityAttributes",
".",
"containsKey",
"(",
"attributeName",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Attribute already exists wi... | Adds the given attribute value.<p>
@param attributeName the attribute name
@param value the attribute value | [
"Adds",
"the",
"given",
"attribute",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/acacia/shared/CmsEntity.java#L248-L261 |
vnesek/nmote-iim4j | src/main/java/com/nmote/iim4j/IIMFile.java | IIMFile.addDateTimeHelper | public void addDateTimeHelper(int ds, Date date) throws SerializationException, InvalidDataSetException {
if (date == null) {
return;
}
DataSetInfo dsi = dsiFactory.create(ds);
SimpleDateFormat df = new SimpleDateFormat(dsi.getSerializer().toString());
String value = df.format(date);
byte[] da... | java | public void addDateTimeHelper(int ds, Date date) throws SerializationException, InvalidDataSetException {
if (date == null) {
return;
}
DataSetInfo dsi = dsiFactory.create(ds);
SimpleDateFormat df = new SimpleDateFormat(dsi.getSerializer().toString());
String value = df.format(date);
byte[] da... | [
"public",
"void",
"addDateTimeHelper",
"(",
"int",
"ds",
",",
"Date",
"date",
")",
"throws",
"SerializationException",
",",
"InvalidDataSetException",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"return",
";",
"}",
"DataSetInfo",
"dsi",
"=",
"dsiFactory",
... | Adds a data set with date-time value to IIM file.
@param ds
data set id (see constants in IIM class)
@param date
date to set. Null values are silently ignored.
@throws SerializationException
if value can't be serialized by data set's serializer
@throws InvalidDataSetException
if data set isn't defined | [
"Adds",
"a",
"data",
"set",
"with",
"date",
"-",
"time",
"value",
"to",
"IIM",
"file",
"."
] | train | https://github.com/vnesek/nmote-iim4j/blob/ec55b02fc644cd722e93051ac0bdb96b00cb42a8/src/main/java/com/nmote/iim4j/IIMFile.java#L102-L114 |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/ScatterGatherConfiguration.java | ScatterGatherConfiguration.addBroadcastSetForGatherFunction | public void addBroadcastSetForGatherFunction(String name, DataSet<?> data) {
this.bcVarsGather.add(new Tuple2<>(name, data));
} | java | public void addBroadcastSetForGatherFunction(String name, DataSet<?> data) {
this.bcVarsGather.add(new Tuple2<>(name, data));
} | [
"public",
"void",
"addBroadcastSetForGatherFunction",
"(",
"String",
"name",
",",
"DataSet",
"<",
"?",
">",
"data",
")",
"{",
"this",
".",
"bcVarsGather",
".",
"add",
"(",
"new",
"Tuple2",
"<>",
"(",
"name",
",",
"data",
")",
")",
";",
"}"
] | Adds a data set as a broadcast set to the gather function.
@param name The name under which the broadcast data is available in the gather function.
@param data The data set to be broadcast. | [
"Adds",
"a",
"data",
"set",
"as",
"a",
"broadcast",
"set",
"to",
"the",
"gather",
"function",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/ScatterGatherConfiguration.java#L71-L73 |
xiancloud/xian | xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/StackTraceFilter.java | StackTraceFilter.getFilteredStackTrace | public static String getFilteredStackTrace(Throwable t, int ref) {
StringWriter sw = new StringWriter();
FilterWriter filterWriter = new StackTraceFilterWriter(sw);
printStackTrace(t, filterWriter, ref);
return sw.getBuffer().toString();
} | java | public static String getFilteredStackTrace(Throwable t, int ref) {
StringWriter sw = new StringWriter();
FilterWriter filterWriter = new StackTraceFilterWriter(sw);
printStackTrace(t, filterWriter, ref);
return sw.getBuffer().toString();
} | [
"public",
"static",
"String",
"getFilteredStackTrace",
"(",
"Throwable",
"t",
",",
"int",
"ref",
")",
"{",
"StringWriter",
"sw",
"=",
"new",
"StringWriter",
"(",
")",
";",
"FilterWriter",
"filterWriter",
"=",
"new",
"StackTraceFilterWriter",
"(",
"sw",
")",
";... | Filter stack trace by selecting the {@link Throwable} using a reference position. Intermediate throwables will be printed
with just their header.
@param t the throwable
@param ref throwable reference position, see {@link #getThrowable(List, int)}.
@return String containing the stack trace.
@since 1.11.1 | [
"Filter",
"stack",
"trace",
"by",
"selecting",
"the",
"{",
"@link",
"Throwable",
"}",
"using",
"a",
"reference",
"position",
".",
"Intermediate",
"throwables",
"will",
"be",
"printed",
"with",
"just",
"their",
"header",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/StackTraceFilter.java#L247-L255 |
glyptodon/guacamole-client | guacamole/src/main/java/org/apache/guacamole/tunnel/InterceptedStream.java | InterceptedStream.setStreamError | public void setStreamError(int code, String message) {
// Map status code to GuacamoleStatus, assuming SERVER_ERROR by default
GuacamoleStatus status = GuacamoleStatus.fromGuacamoleStatusCode(code);
if (status == null)
status = GuacamoleStatus.SERVER_ERROR;
// Associate str... | java | public void setStreamError(int code, String message) {
// Map status code to GuacamoleStatus, assuming SERVER_ERROR by default
GuacamoleStatus status = GuacamoleStatus.fromGuacamoleStatusCode(code);
if (status == null)
status = GuacamoleStatus.SERVER_ERROR;
// Associate str... | [
"public",
"void",
"setStreamError",
"(",
"int",
"code",
",",
"String",
"message",
")",
"{",
"// Map status code to GuacamoleStatus, assuming SERVER_ERROR by default",
"GuacamoleStatus",
"status",
"=",
"GuacamoleStatus",
".",
"fromGuacamoleStatusCode",
"(",
"code",
")",
";",... | Reports that this InterceptedStream did not complete successfully due to
an error described by the given status code and human-readable message.
The error reported by this call can later be retrieved as a
GuacamoleStreamException by calling getStreamError().
@param code
The Guacamole protocol status code which describ... | [
"Reports",
"that",
"this",
"InterceptedStream",
"did",
"not",
"complete",
"successfully",
"due",
"to",
"an",
"error",
"described",
"by",
"the",
"given",
"status",
"code",
"and",
"human",
"-",
"readable",
"message",
".",
"The",
"error",
"reported",
"by",
"this"... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/tunnel/InterceptedStream.java#L123-L133 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/trie/bintrie/BinTrie.java | BinTrie.load | public boolean load(String path, V[] value)
{
byte[] bytes = IOUtil.readBytes(path);
if (bytes == null) return false;
_ValueArray valueArray = new _ValueArray(value);
ByteArray byteArray = new ByteArray(bytes);
for (int i = 0; i < child.length; ++i)
{
int ... | java | public boolean load(String path, V[] value)
{
byte[] bytes = IOUtil.readBytes(path);
if (bytes == null) return false;
_ValueArray valueArray = new _ValueArray(value);
ByteArray byteArray = new ByteArray(bytes);
for (int i = 0; i < child.length; ++i)
{
int ... | [
"public",
"boolean",
"load",
"(",
"String",
"path",
",",
"V",
"[",
"]",
"value",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"IOUtil",
".",
"readBytes",
"(",
"path",
")",
";",
"if",
"(",
"bytes",
"==",
"null",
")",
"return",
"false",
";",
"_ValueArra... | 从磁盘加载二分数组树
@param path 路径
@param value 额外提供的值数组,按照值的字典序。(之所以要求提供它,是因为泛型的保存不归树管理)
@return 是否成功 | [
"从磁盘加载二分数组树"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/trie/bintrie/BinTrie.java#L412-L430 |
jronrun/benayn | benayn-berkeley/src/main/java/com/benayn/berkeley/Berkeley.java | Berkeley.of | public static BerkeleyStore of(String envHomePath, String storeName) {
return env(envHomePath).connection(storeName, null);
} | java | public static BerkeleyStore of(String envHomePath, String storeName) {
return env(envHomePath).connection(storeName, null);
} | [
"public",
"static",
"BerkeleyStore",
"of",
"(",
"String",
"envHomePath",
",",
"String",
"storeName",
")",
"{",
"return",
"env",
"(",
"envHomePath",
")",
".",
"connection",
"(",
"storeName",
",",
"null",
")",
";",
"}"
] | Returns a new {@link BerkeleyStore} instance, {@link Environment} with {@link Berkeley#defaultEnvironmentConfig()
and {@link EntityStore} with {@link Berkeley#defaultStoreConfig()} | [
"Returns",
"a",
"new",
"{"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-berkeley/src/main/java/com/benayn/berkeley/Berkeley.java#L123-L125 |
joelittlejohn/jsonschema2pojo | jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/util/NameHelper.java | NameHelper.getSetterName | public String getSetterName(String propertyName, JsonNode node) {
propertyName = getPropertyNameForAccessor(propertyName, node);
String prefix = "set";
String setterName;
if (propertyName.length() > 1 && Character.isUpperCase(propertyName.charAt(1))) {
setterName = prefix +... | java | public String getSetterName(String propertyName, JsonNode node) {
propertyName = getPropertyNameForAccessor(propertyName, node);
String prefix = "set";
String setterName;
if (propertyName.length() > 1 && Character.isUpperCase(propertyName.charAt(1))) {
setterName = prefix +... | [
"public",
"String",
"getSetterName",
"(",
"String",
"propertyName",
",",
"JsonNode",
"node",
")",
"{",
"propertyName",
"=",
"getPropertyNameForAccessor",
"(",
"propertyName",
",",
"node",
")",
";",
"String",
"prefix",
"=",
"\"set\"",
";",
"String",
"setterName",
... | Generate setter method name for property.
@param propertyName
@param node
@return | [
"Generate",
"setter",
"method",
"name",
"for",
"property",
"."
] | train | https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/util/NameHelper.java#L128-L145 |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.getFloat | @PublicEvolving
public float getFloat(ConfigOption<Float> configOption, float overrideDefault) {
Object o = getRawValueFromOption(configOption);
if (o == null) {
return overrideDefault;
}
return convertToFloat(o, configOption.defaultValue());
} | java | @PublicEvolving
public float getFloat(ConfigOption<Float> configOption, float overrideDefault) {
Object o = getRawValueFromOption(configOption);
if (o == null) {
return overrideDefault;
}
return convertToFloat(o, configOption.defaultValue());
} | [
"@",
"PublicEvolving",
"public",
"float",
"getFloat",
"(",
"ConfigOption",
"<",
"Float",
">",
"configOption",
",",
"float",
"overrideDefault",
")",
"{",
"Object",
"o",
"=",
"getRawValueFromOption",
"(",
"configOption",
")",
";",
"if",
"(",
"o",
"==",
"null",
... | Returns the value associated with the given config option as a float.
If no value is mapped under any key of the option, it returns the specified
default instead of the option's default value.
@param configOption The configuration option
@param overrideDefault The value to return if no value was mapper for any key of ... | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"config",
"option",
"as",
"a",
"float",
".",
"If",
"no",
"value",
"is",
"mapped",
"under",
"any",
"key",
"of",
"the",
"option",
"it",
"returns",
"the",
"specified",
"default",
"instead",
"of"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L456-L463 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/query/QueryImpl.java | QueryImpl.setRelationEntities | protected List<Object> setRelationEntities(List enhanceEntities, Client client, EntityMetadata m)
{
// Enhance entities can contain or may not contain relation.
// if it contain a relation means it is a child
// if it does not then it means it is a parent.
List<Object> result = new A... | java | protected List<Object> setRelationEntities(List enhanceEntities, Client client, EntityMetadata m)
{
// Enhance entities can contain or may not contain relation.
// if it contain a relation means it is a child
// if it does not then it means it is a parent.
List<Object> result = new A... | [
"protected",
"List",
"<",
"Object",
">",
"setRelationEntities",
"(",
"List",
"enhanceEntities",
",",
"Client",
"client",
",",
"EntityMetadata",
"m",
")",
"{",
"// Enhance entities can contain or may not contain relation.",
"// if it contain a relation means it is a child",
"// ... | Sets the relation entities.
@param enhanceEntities
the enhance entities
@param client
the client
@param m
the m
@return the list | [
"Sets",
"the",
"relation",
"entities",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/query/QueryImpl.java#L218-L254 |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/Table.java | Table.addRow | protected void addRow(int uniqueID, Map<String, Object> map)
{
m_rows.put(Integer.valueOf(uniqueID), new MapRow(map));
} | java | protected void addRow(int uniqueID, Map<String, Object> map)
{
m_rows.put(Integer.valueOf(uniqueID), new MapRow(map));
} | [
"protected",
"void",
"addRow",
"(",
"int",
"uniqueID",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"m_rows",
".",
"put",
"(",
"Integer",
".",
"valueOf",
"(",
"uniqueID",
")",
",",
"new",
"MapRow",
"(",
"map",
")",
")",
";",
"}"
... | Adds a row to the internal storage, indexed by primary key.
@param uniqueID unique ID of the row
@param map row data as a simpe map | [
"Adds",
"a",
"row",
"to",
"the",
"internal",
"storage",
"indexed",
"by",
"primary",
"key",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/Table.java#L106-L109 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509Key.java | X509Key.parse | public static PublicKey parse(DerValue in) throws IOException
{
AlgorithmId algorithm;
PublicKey subjectKey;
if (in.tag != DerValue.tag_Sequence)
throw new IOException("corrupt subject key");
algorithm = AlgorithmId.parse(in.data.getDerValue());
try {
... | java | public static PublicKey parse(DerValue in) throws IOException
{
AlgorithmId algorithm;
PublicKey subjectKey;
if (in.tag != DerValue.tag_Sequence)
throw new IOException("corrupt subject key");
algorithm = AlgorithmId.parse(in.data.getDerValue());
try {
... | [
"public",
"static",
"PublicKey",
"parse",
"(",
"DerValue",
"in",
")",
"throws",
"IOException",
"{",
"AlgorithmId",
"algorithm",
";",
"PublicKey",
"subjectKey",
";",
"if",
"(",
"in",
".",
"tag",
"!=",
"DerValue",
".",
"tag_Sequence",
")",
"throw",
"new",
"IOE... | Construct X.509 subject public key from a DER value. If
the runtime environment is configured with a specific class for
this kind of key, a subclass is returned. Otherwise, a generic
X509Key object is returned.
<P>This mechanism gurantees that keys (and algorithms) may be
freely manipulated and transferred, without ... | [
"Construct",
"X",
".",
"509",
"subject",
"public",
"key",
"from",
"a",
"DER",
"value",
".",
"If",
"the",
"runtime",
"environment",
"is",
"configured",
"with",
"a",
"specific",
"class",
"for",
"this",
"kind",
"of",
"key",
"a",
"subclass",
"is",
"returned",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509Key.java#L160-L180 |
Kickflip/kickflip-android-sdk | sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java | KickflipApiClient.startStreamWithUser | private void startStreamWithUser(User user, Stream stream, final KickflipCallback cb) {
checkNotNull(user);
checkNotNull(stream);
GenericData data = new GenericData();
data.put("uuid", user.getUUID());
data.put("private", stream.isPrivate());
if (stream.getTitle() != null... | java | private void startStreamWithUser(User user, Stream stream, final KickflipCallback cb) {
checkNotNull(user);
checkNotNull(stream);
GenericData data = new GenericData();
data.put("uuid", user.getUUID());
data.put("private", stream.isPrivate());
if (stream.getTitle() != null... | [
"private",
"void",
"startStreamWithUser",
"(",
"User",
"user",
",",
"Stream",
"stream",
",",
"final",
"KickflipCallback",
"cb",
")",
"{",
"checkNotNull",
"(",
"user",
")",
";",
"checkNotNull",
"(",
"stream",
")",
";",
"GenericData",
"data",
"=",
"new",
"Gene... | Start a new Stream owned by the given User. Must be called after
{@link io.kickflip.sdk.api.KickflipApiClient#createNewUser(KickflipCallback)}
Delivers stream endpoint destination data via a {@link io.kickflip.sdk.api.KickflipCallback}.
@param user The Kickflip User on whose behalf this request is performed.
@param cb... | [
"Start",
"a",
"new",
"Stream",
"owned",
"by",
"the",
"given",
"User",
".",
"Must",
"be",
"called",
"after",
"{",
"@link",
"io",
".",
"kickflip",
".",
"sdk",
".",
"api",
".",
"KickflipApiClient#createNewUser",
"(",
"KickflipCallback",
")",
"}",
"Delivers",
... | train | https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java#L331-L347 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerCommunicationLinksInner.java | ServerCommunicationLinksInner.getAsync | public Observable<ServerCommunicationLinkInner> getAsync(String resourceGroupName, String serverName, String communicationLinkName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, communicationLinkName).map(new Func1<ServiceResponse<ServerCommunicationLinkInner>, ServerCommunicationLinkInner... | java | public Observable<ServerCommunicationLinkInner> getAsync(String resourceGroupName, String serverName, String communicationLinkName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, communicationLinkName).map(new Func1<ServiceResponse<ServerCommunicationLinkInner>, ServerCommunicationLinkInner... | [
"public",
"Observable",
"<",
"ServerCommunicationLinkInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"communicationLinkName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"server... | Returns a server communication link.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param communicationLinkName The name of the server communication link.
@throws... | [
"Returns",
"a",
"server",
"communication",
"link",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerCommunicationLinksInner.java#L210-L217 |
spring-cloud/spring-cloud-netflix | spring-cloud-netflix-eureka-server/src/main/java/org/springframework/cloud/netflix/eureka/server/InstanceRegistry.java | InstanceRegistry.openForTraffic | @Override
public void openForTraffic(ApplicationInfoManager applicationInfoManager, int count) {
super.openForTraffic(applicationInfoManager,
count == 0 ? this.defaultOpenForTrafficCount : count);
} | java | @Override
public void openForTraffic(ApplicationInfoManager applicationInfoManager, int count) {
super.openForTraffic(applicationInfoManager,
count == 0 ? this.defaultOpenForTrafficCount : count);
} | [
"@",
"Override",
"public",
"void",
"openForTraffic",
"(",
"ApplicationInfoManager",
"applicationInfoManager",
",",
"int",
"count",
")",
"{",
"super",
".",
"openForTraffic",
"(",
"applicationInfoManager",
",",
"count",
"==",
"0",
"?",
"this",
".",
"defaultOpenForTraf... | If
{@link PeerAwareInstanceRegistryImpl#openForTraffic(ApplicationInfoManager, int)}
is called with a zero argument, it means that leases are not automatically
cancelled if the instance hasn't sent any renewals recently. This happens for a
standalone server. It seems like a bad default, so we set it to the smallest
non... | [
"If",
"{"
] | train | https://github.com/spring-cloud/spring-cloud-netflix/blob/03b1e326ce5971c41239890dc71cae616366cff8/spring-cloud-netflix-eureka-server/src/main/java/org/springframework/cloud/netflix/eureka/server/InstanceRegistry.java#L77-L81 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/Matrix.java | Matrix.multiplyTranspose | public Matrix multiplyTranspose(final Matrix B, ExecutorService threadPool)
{
Matrix C = new DenseMatrix(this.rows(), B.rows());
multiplyTranspose(B, C, threadPool);
return C;
} | java | public Matrix multiplyTranspose(final Matrix B, ExecutorService threadPool)
{
Matrix C = new DenseMatrix(this.rows(), B.rows());
multiplyTranspose(B, C, threadPool);
return C;
} | [
"public",
"Matrix",
"multiplyTranspose",
"(",
"final",
"Matrix",
"B",
",",
"ExecutorService",
"threadPool",
")",
"{",
"Matrix",
"C",
"=",
"new",
"DenseMatrix",
"(",
"this",
".",
"rows",
"(",
")",
",",
"B",
".",
"rows",
"(",
")",
")",
";",
"multiplyTransp... | Returns the new matrix <i>C</i> that is <i>C = A*B<sup>T</sup></i>
@param B the matrix to multiply by the transpose of
@param threadPool the source of threads to do computation in parallel
@return the result C | [
"Returns",
"the",
"new",
"matrix",
"<i",
">",
"C<",
"/",
"i",
">",
"that",
"is",
"<i",
">",
"C",
"=",
"A",
"*",
"B<sup",
">",
"T<",
"/",
"sup",
">",
"<",
"/",
"i",
">"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/Matrix.java#L366-L371 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AOStream.java | AOStream.startOrIncludeInWriteRange | private final TickRange startOrIncludeInWriteRange(
TickRange writeRange,
long lowerBound,
long upperBound,
TickRange r)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "startOrIncludeInWriteRange");
if (writeRange == null)
{
writeRange = new... | java | private final TickRange startOrIncludeInWriteRange(
TickRange writeRange,
long lowerBound,
long upperBound,
TickRange r)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "startOrIncludeInWriteRange");
if (writeRange == null)
{
writeRange = new... | [
"private",
"final",
"TickRange",
"startOrIncludeInWriteRange",
"(",
"TickRange",
"writeRange",
",",
"long",
"lowerBound",
",",
"long",
"upperBound",
",",
"TickRange",
"r",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
"... | Helper method. We are given a range, writeRange, which may be null. We are
also given a range r (which is not null), that needs to be included in writeRange.
The constraint on the inclusion is the resulting writeRange should be in the interval
[lowerBound, upperBound].
@param writeRange
@param lowerBound
@param upperBo... | [
"Helper",
"method",
".",
"We",
"are",
"given",
"a",
"range",
"writeRange",
"which",
"may",
"be",
"null",
".",
"We",
"are",
"also",
"given",
"a",
"range",
"r",
"(",
"which",
"is",
"not",
"null",
")",
"that",
"needs",
"to",
"be",
"included",
"in",
"wri... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AOStream.java#L2683-L2707 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/EntityUtils.java | EntityUtils.getRenderViewOffset | public static Point getRenderViewOffset(float partialTick)
{
Entity entity = Minecraft.getMinecraft().getRenderViewEntity();
if (partialTick == 0)
return new Point(entity.posX, entity.posY, entity.posZ);
double x = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTick;
double y = entity.l... | java | public static Point getRenderViewOffset(float partialTick)
{
Entity entity = Minecraft.getMinecraft().getRenderViewEntity();
if (partialTick == 0)
return new Point(entity.posX, entity.posY, entity.posZ);
double x = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTick;
double y = entity.l... | [
"public",
"static",
"Point",
"getRenderViewOffset",
"(",
"float",
"partialTick",
")",
"{",
"Entity",
"entity",
"=",
"Minecraft",
".",
"getMinecraft",
"(",
")",
".",
"getRenderViewEntity",
"(",
")",
";",
"if",
"(",
"partialTick",
"==",
"0",
")",
"return",
"ne... | Gets the render view offset for the current view entity.
@param partialTick the partial tick
@return the render view offset | [
"Gets",
"the",
"render",
"view",
"offset",
"for",
"the",
"current",
"view",
"entity",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/EntityUtils.java#L263-L273 |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java | CleverTapAPI.instanceWithConfig | @SuppressWarnings({"unused", "WeakerAccess"})
public static CleverTapAPI instanceWithConfig(Context context, @NonNull CleverTapInstanceConfig config){
//noinspection ConstantConditions
if (config == null) {
Logger.v("CleverTapInstanceConfig cannot be null");
return null;
... | java | @SuppressWarnings({"unused", "WeakerAccess"})
public static CleverTapAPI instanceWithConfig(Context context, @NonNull CleverTapInstanceConfig config){
//noinspection ConstantConditions
if (config == null) {
Logger.v("CleverTapInstanceConfig cannot be null");
return null;
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unused\"",
",",
"\"WeakerAccess\"",
"}",
")",
"public",
"static",
"CleverTapAPI",
"instanceWithConfig",
"(",
"Context",
"context",
",",
"@",
"NonNull",
"CleverTapInstanceConfig",
"config",
")",
"{",
"//noinspection ConstantCondition... | Returns an instance of the CleverTap SDK using CleverTapInstanceConfig.
@param context The Android context
@param config The {@link CleverTapInstanceConfig} object
@return The {@link CleverTapAPI} object | [
"Returns",
"an",
"instance",
"of",
"the",
"CleverTap",
"SDK",
"using",
"CleverTapInstanceConfig",
"."
] | train | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java#L514-L530 |
darcy-framework/darcy-web | src/main/java/com/redhat/darcy/web/HtmlTable.java | HtmlTable.byRowColumn | protected Locator byRowColumn(int rowIndex, int colIndex) {
if (rowIndex < 1) {
throw new IllegalArgumentException("Row index must be greater than 0.");
}
if (colIndex < 1) {
throw new IllegalArgumentException("Column index must be greater than 0.");
}
S... | java | protected Locator byRowColumn(int rowIndex, int colIndex) {
if (rowIndex < 1) {
throw new IllegalArgumentException("Row index must be greater than 0.");
}
if (colIndex < 1) {
throw new IllegalArgumentException("Column index must be greater than 0.");
}
S... | [
"protected",
"Locator",
"byRowColumn",
"(",
"int",
"rowIndex",
",",
"int",
"colIndex",
")",
"{",
"if",
"(",
"rowIndex",
"<",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Row index must be greater than 0.\"",
")",
";",
"}",
"if",
"(",
"col... | Conveniently allows column implementations to lookup cells inside a column without
duplicating the effort to come up with xpath for each column's cells. Simply use this method
with that column's index.
@return A locator that finds a cell based on a row and column index. It does this by
constructing an xpath. If a {@co... | [
"Conveniently",
"allows",
"column",
"implementations",
"to",
"lookup",
"cells",
"inside",
"a",
"column",
"without",
"duplicating",
"the",
"effort",
"to",
"come",
"up",
"with",
"xpath",
"for",
"each",
"column",
"s",
"cells",
".",
"Simply",
"use",
"this",
"metho... | train | https://github.com/darcy-framework/darcy-web/blob/4e9b67c9f39d53fec5bf5ad40ddfdc828d9df472/src/main/java/com/redhat/darcy/web/HtmlTable.java#L193-L207 |
Mthwate/DatLib | src/main/java/com/mthwate/datlib/HashUtils.java | HashUtils.sha1Hex | public static String sha1Hex(String data, Charset charset) throws NoSuchAlgorithmException {
return sha1Hex(data.getBytes(charset));
} | java | public static String sha1Hex(String data, Charset charset) throws NoSuchAlgorithmException {
return sha1Hex(data.getBytes(charset));
} | [
"public",
"static",
"String",
"sha1Hex",
"(",
"String",
"data",
",",
"Charset",
"charset",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"return",
"sha1Hex",
"(",
"data",
".",
"getBytes",
"(",
"charset",
")",
")",
";",
"}"
] | Hashes a string using the SHA-1 algorithm. Returns a hexadecimal result.
@since 1.1
@param data the string to hash
@param charset the charset of the string
@return the hexadecimal SHA-1 hash of the string
@throws NoSuchAlgorithmException the algorithm is not supported by existing providers | [
"Hashes",
"a",
"string",
"using",
"the",
"SHA",
"-",
"1",
"algorithm",
".",
"Returns",
"a",
"hexadecimal",
"result",
"."
] | train | https://github.com/Mthwate/DatLib/blob/f0b3a9f9cf6fdc773d4f86234ebd95986c9b6077/src/main/java/com/mthwate/datlib/HashUtils.java#L286-L288 |
igniterealtime/Smack | smack-im/src/main/java/org/jivesoftware/smack/roster/RosterEntry.java | RosterEntry.toRosterItem | private static RosterPacket.Item toRosterItem(RosterEntry entry, String name, boolean includeAskAttribute) {
RosterPacket.Item item = new RosterPacket.Item(entry.getJid(), name);
item.setItemType(entry.getType());
if (includeAskAttribute) {
item.setSubscriptionPending(entry.isSubscri... | java | private static RosterPacket.Item toRosterItem(RosterEntry entry, String name, boolean includeAskAttribute) {
RosterPacket.Item item = new RosterPacket.Item(entry.getJid(), name);
item.setItemType(entry.getType());
if (includeAskAttribute) {
item.setSubscriptionPending(entry.isSubscri... | [
"private",
"static",
"RosterPacket",
".",
"Item",
"toRosterItem",
"(",
"RosterEntry",
"entry",
",",
"String",
"name",
",",
"boolean",
"includeAskAttribute",
")",
"{",
"RosterPacket",
".",
"Item",
"item",
"=",
"new",
"RosterPacket",
".",
"Item",
"(",
"entry",
"... | Convert a roster entry with the given name to a roster item. As per RFC 6121 § 2.1.2.2., clients MUST NOT include
the 'ask' attribute, thus set {@code includeAskAttribute} to {@code false}.
@param entry the roster entry.
@param name the name of the roster item.
@param includeAskAttribute whether or not to include the ... | [
"Convert",
"a",
"roster",
"entry",
"with",
"the",
"given",
"name",
"to",
"a",
"roster",
"item",
".",
"As",
"per",
"RFC",
"6121",
"§",
"2",
".",
"1",
".",
"2",
".",
"2",
".",
"clients",
"MUST",
"NOT",
"include",
"the",
"ask",
"attribute",
"thus",
"s... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-im/src/main/java/org/jivesoftware/smack/roster/RosterEntry.java#L319-L331 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAExEntityManager.java | JPAExEntityManager.toStringPuIds | private static final String toStringPuIds(String desc, JPAPuId[] puids)
{
StringBuilder sbuf = new StringBuilder(desc);
sbuf.append('\n');
for (JPAPuId puid : puids)
{
sbuf.append(" ")
.append(puid)
.append('\n');
... | java | private static final String toStringPuIds(String desc, JPAPuId[] puids)
{
StringBuilder sbuf = new StringBuilder(desc);
sbuf.append('\n');
for (JPAPuId puid : puids)
{
sbuf.append(" ")
.append(puid)
.append('\n');
... | [
"private",
"static",
"final",
"String",
"toStringPuIds",
"(",
"String",
"desc",
",",
"JPAPuId",
"[",
"]",
"puids",
")",
"{",
"StringBuilder",
"sbuf",
"=",
"new",
"StringBuilder",
"(",
"desc",
")",
";",
"sbuf",
".",
"append",
"(",
"'",
"'",
")",
";",
"f... | Helper method to convert the input puids to a String for tr.debug(). | [
"Helper",
"method",
"to",
"convert",
"the",
"input",
"puids",
"to",
"a",
"String",
"for",
"tr",
".",
"debug",
"()",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAExEntityManager.java#L777-L788 |
pravega/pravega | common/src/main/java/io/pravega/common/util/btree/BTreeIndex.java | BTreeIndex.processSplitPage | private void processSplitPage(List<BTreePage> splitResult, PageModificationContext context) {
PageWrapper originalPage = context.getPageWrapper();
for (int i = 0; i < splitResult.size(); i++) {
val page = splitResult.get(i);
ByteArraySegment newPageKey;
long newOffset... | java | private void processSplitPage(List<BTreePage> splitResult, PageModificationContext context) {
PageWrapper originalPage = context.getPageWrapper();
for (int i = 0; i < splitResult.size(); i++) {
val page = splitResult.get(i);
ByteArraySegment newPageKey;
long newOffset... | [
"private",
"void",
"processSplitPage",
"(",
"List",
"<",
"BTreePage",
">",
"splitResult",
",",
"PageModificationContext",
"context",
")",
"{",
"PageWrapper",
"originalPage",
"=",
"context",
".",
"getPageWrapper",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0"... | Processes a Page Split result. The first split page will replace the existing page, while the remaining pages
will need to be inserted as children into the parent.
@param splitResult The result of the original BTreePage's splitIfNecessary() call.
@param context Processing context. | [
"Processes",
"a",
"Page",
"Split",
"result",
".",
"The",
"first",
"split",
"page",
"will",
"replace",
"the",
"existing",
"page",
"while",
"the",
"remaining",
"pages",
"will",
"need",
"to",
"be",
"inserted",
"as",
"children",
"into",
"the",
"parent",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/BTreeIndex.java#L469-L500 |
Microsoft/malmo | Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/MazeDecoratorImplementation.java | MazeDecoratorImplementation.distBetweenPoints | private int distBetweenPoints(int x1, int z1, int x2, int z2, boolean bAllowDiags)
{
// Total cells is the sum of the distances we need to travel along the x and the z axes, plus one for the end cell.
int w = Math.abs(x2 - x1);
int h = Math.abs(z2 - z1);
if (bAllowDiags)
{
... | java | private int distBetweenPoints(int x1, int z1, int x2, int z2, boolean bAllowDiags)
{
// Total cells is the sum of the distances we need to travel along the x and the z axes, plus one for the end cell.
int w = Math.abs(x2 - x1);
int h = Math.abs(z2 - z1);
if (bAllowDiags)
{
... | [
"private",
"int",
"distBetweenPoints",
"(",
"int",
"x1",
",",
"int",
"z1",
",",
"int",
"x2",
",",
"int",
"z2",
",",
"boolean",
"bAllowDiags",
")",
"{",
"// Total cells is the sum of the distances we need to travel along the x and the z axes, plus one for the end cell.",
"in... | Calculate the number of cells on the shortest path between (x1,z1) and (x2,z2)
@param x1
@param z1
@param x2
@param z2
@param bAllowDiags Whether the cells are 8-connected or 4-connected.
@return The number of cells on the shortest path, including start and end cells. | [
"Calculate",
"the",
"number",
"of",
"cells",
"on",
"the",
"shortest",
"path",
"between",
"(",
"x1",
"z1",
")",
"and",
"(",
"x2",
"z2",
")"
] | train | https://github.com/Microsoft/malmo/blob/4139cd6f3e52f6e893a931a1d4b70d35f8e70e5a/Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/MazeDecoratorImplementation.java#L754-L768 |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/portlet/container/services/PortletCookieServiceImpl.java | PortletCookieServiceImpl.convertToCookie | protected Cookie convertToCookie(IPortalCookie portalCookie, boolean secure) {
final Cookie cookie = new Cookie(this.cookieName, portalCookie.getValue());
// Set the cookie's fields
cookie.setComment(this.comment);
cookie.setMaxAge(this.maxAge);
cookie.setSecure(secure);
... | java | protected Cookie convertToCookie(IPortalCookie portalCookie, boolean secure) {
final Cookie cookie = new Cookie(this.cookieName, portalCookie.getValue());
// Set the cookie's fields
cookie.setComment(this.comment);
cookie.setMaxAge(this.maxAge);
cookie.setSecure(secure);
... | [
"protected",
"Cookie",
"convertToCookie",
"(",
"IPortalCookie",
"portalCookie",
",",
"boolean",
"secure",
")",
"{",
"final",
"Cookie",
"cookie",
"=",
"new",
"Cookie",
"(",
"this",
".",
"cookieName",
",",
"portalCookie",
".",
"getValue",
"(",
")",
")",
";",
"... | Convert the {@link IPortalCookie} into a servlet {@link Cookie}.
@param portalCookie
@return | [
"Convert",
"the",
"{",
"@link",
"IPortalCookie",
"}",
"into",
"a",
"servlet",
"{",
"@link",
"Cookie",
"}",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/portlet/container/services/PortletCookieServiceImpl.java#L359-L374 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularDistortBase_F64.java | EquirectangularDistortBase_F64.compute | @Override
public void compute(int x, int y, Point2D_F64 out ) {
// grab precomputed normalized image coordinate at canonical location
Point3D_F64 v = vectors[y*outWidth+x];
// move to requested orientation
GeometryMath_F64.mult(R,v,n); // TODO make faster by not using an array based matrix
// compute pixel ... | java | @Override
public void compute(int x, int y, Point2D_F64 out ) {
// grab precomputed normalized image coordinate at canonical location
Point3D_F64 v = vectors[y*outWidth+x];
// move to requested orientation
GeometryMath_F64.mult(R,v,n); // TODO make faster by not using an array based matrix
// compute pixel ... | [
"@",
"Override",
"public",
"void",
"compute",
"(",
"int",
"x",
",",
"int",
"y",
",",
"Point2D_F64",
"out",
")",
"{",
"// grab precomputed normalized image coordinate at canonical location",
"Point3D_F64",
"v",
"=",
"vectors",
"[",
"y",
"*",
"outWidth",
"+",
"x",
... | Input is in pinhole camera pixel coordinates. Output is in equirectangular coordinates
@param x Pixel x-coordinate in rendered pinhole camera
@param y Pixel y-coordinate in rendered pinhole camera | [
"Input",
"is",
"in",
"pinhole",
"camera",
"pixel",
"coordinates",
".",
"Output",
"is",
"in",
"equirectangular",
"coordinates"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularDistortBase_F64.java#L107-L116 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java | PoolsImpl.removeNodes | public void removeNodes(String poolId, NodeRemoveParameter nodeRemoveParameter) {
removeNodesWithServiceResponseAsync(poolId, nodeRemoveParameter).toBlocking().single().body();
} | java | public void removeNodes(String poolId, NodeRemoveParameter nodeRemoveParameter) {
removeNodesWithServiceResponseAsync(poolId, nodeRemoveParameter).toBlocking().single().body();
} | [
"public",
"void",
"removeNodes",
"(",
"String",
"poolId",
",",
"NodeRemoveParameter",
"nodeRemoveParameter",
")",
"{",
"removeNodesWithServiceResponseAsync",
"(",
"poolId",
",",
"nodeRemoveParameter",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
... | Removes compute nodes from the specified pool.
This operation can only run when the allocation state of the pool is steady. When this operation runs, the allocation state changes from steady to resizing.
@param poolId The ID of the pool from which you want to remove nodes.
@param nodeRemoveParameter The parameters for... | [
"Removes",
"compute",
"nodes",
"from",
"the",
"specified",
"pool",
".",
"This",
"operation",
"can",
"only",
"run",
"when",
"the",
"allocation",
"state",
"of",
"the",
"pool",
"is",
"steady",
".",
"When",
"this",
"operation",
"runs",
"the",
"allocation",
"stat... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L3404-L3406 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.endsWithAny | public static boolean endsWithAny(final CharSequence sequence, final CharSequence... searchStrings) {
if (isEmpty(sequence) || ArrayUtils.isEmpty(searchStrings)) {
return false;
}
for (final CharSequence searchString : searchStrings) {
if (endsWith(sequence, searchString)... | java | public static boolean endsWithAny(final CharSequence sequence, final CharSequence... searchStrings) {
if (isEmpty(sequence) || ArrayUtils.isEmpty(searchStrings)) {
return false;
}
for (final CharSequence searchString : searchStrings) {
if (endsWith(sequence, searchString)... | [
"public",
"static",
"boolean",
"endsWithAny",
"(",
"final",
"CharSequence",
"sequence",
",",
"final",
"CharSequence",
"...",
"searchStrings",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"sequence",
")",
"||",
"ArrayUtils",
".",
"isEmpty",
"(",
"searchStrings",
")",
"... | <p>Check if a CharSequence ends with any of the provided case-sensitive suffixes.</p>
<pre>
StringUtils.endsWithAny(null, null) = false
StringUtils.endsWithAny(null, new String[] {"abc"}) = false
StringUtils.endsWithAny("abcxyz", null) = false
StringUtils.endsWithAny("abcxyz", new String[] {""}) = true
Strin... | [
"<p",
">",
"Check",
"if",
"a",
"CharSequence",
"ends",
"with",
"any",
"of",
"the",
"provided",
"case",
"-",
"sensitive",
"suffixes",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L8743-L8753 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/validate/PropertyValidator.java | PropertyValidator.assertOne | public void assertOne(final String propertyName,
final PropertyList properties) throws ValidationException {
if (properties.getProperties(propertyName).size() != 1) {
throw new ValidationException(ASSERT_ONE_MESSAGE, new Object[] {propertyName});
}
} | java | public void assertOne(final String propertyName,
final PropertyList properties) throws ValidationException {
if (properties.getProperties(propertyName).size() != 1) {
throw new ValidationException(ASSERT_ONE_MESSAGE, new Object[] {propertyName});
}
} | [
"public",
"void",
"assertOne",
"(",
"final",
"String",
"propertyName",
",",
"final",
"PropertyList",
"properties",
")",
"throws",
"ValidationException",
"{",
"if",
"(",
"properties",
".",
"getProperties",
"(",
"propertyName",
")",
".",
"size",
"(",
")",
"!=",
... | Ensure a property occurs once.
@param propertyName
the property name
@param properties
a list of properties to query
@throws ValidationException
when the specified property does not occur once | [
"Ensure",
"a",
"property",
"occurs",
"once",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/validate/PropertyValidator.java#L107-L113 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.eachLine | public static <T> T eachLine(Reader self, int firstLine, @ClosureParams(value=FromString.class,options={"String","String,Integer"}) Closure<T> closure) throws IOException {
BufferedReader br;
int count = firstLine;
T result = null;
if (self instanceof BufferedReader)
br = (B... | java | public static <T> T eachLine(Reader self, int firstLine, @ClosureParams(value=FromString.class,options={"String","String,Integer"}) Closure<T> closure) throws IOException {
BufferedReader br;
int count = firstLine;
T result = null;
if (self instanceof BufferedReader)
br = (B... | [
"public",
"static",
"<",
"T",
">",
"T",
"eachLine",
"(",
"Reader",
"self",
",",
"int",
"firstLine",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FromString",
".",
"class",
",",
"options",
"=",
"{",
"\"String\"",
",",
"\"String,Integer\"",
"}",
")",
"Cl... | Iterates through the given reader line by line. Each line is passed to the
given 1 or 2 arg closure. If the closure has two arguments, the line count is passed
as the second argument. The Reader is closed before this method returns.
@param self a Reader, closed after the method returns
@param firstLine the line ... | [
"Iterates",
"through",
"the",
"given",
"reader",
"line",
"by",
"line",
".",
"Each",
"line",
"is",
"passed",
"to",
"the",
"given",
"1",
"or",
"2",
"arg",
"closure",
".",
"If",
"the",
"closure",
"has",
"two",
"arguments",
"the",
"line",
"count",
"is",
"p... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L441-L469 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/validation/AbstractWFieldIndicator.java | AbstractWFieldIndicator.showIndicatorsForComponent | protected void showIndicatorsForComponent(final List<Diagnostic> diags, final int severity) {
FieldIndicatorModel model = getComponentModel();
if (model != null && !model.diagnostics.isEmpty()) {
model = getOrCreateComponentModel();
model.diagnostics.clear();
}
if (diags != null && !diags.isEmpty()) {
... | java | protected void showIndicatorsForComponent(final List<Diagnostic> diags, final int severity) {
FieldIndicatorModel model = getComponentModel();
if (model != null && !model.diagnostics.isEmpty()) {
model = getOrCreateComponentModel();
model.diagnostics.clear();
}
if (diags != null && !diags.isEmpty()) {
... | [
"protected",
"void",
"showIndicatorsForComponent",
"(",
"final",
"List",
"<",
"Diagnostic",
">",
"diags",
",",
"final",
"int",
"severity",
")",
"{",
"FieldIndicatorModel",
"model",
"=",
"getComponentModel",
"(",
")",
";",
"if",
"(",
"model",
"!=",
"null",
"&&"... | Iterates over the {@link Diagnostic}s and finds the diagnostics that related to {@link #relatedField}.
@param diags A List of Diagnostic objects.
@param severity A Diagnostic severity code. e.g. {@link Diagnostic#ERROR} | [
"Iterates",
"over",
"the",
"{",
"@link",
"Diagnostic",
"}",
"s",
"and",
"finds",
"the",
"diagnostics",
"that",
"related",
"to",
"{",
"@link",
"#relatedField",
"}",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/validation/AbstractWFieldIndicator.java#L54-L76 |
sworisbreathing/sfmf4j | sfmf4j-nio2/src/main/java/com/github/sworisbreathing/sfmf4j/nio2/WatchServiceFileMonitorServiceImpl.java | WatchServiceFileMonitorServiceImpl.resolveEventWithCorrectPath | private synchronized WatchEvent<Path> resolveEventWithCorrectPath(final WatchKey key, final WatchEvent<Path> event) {
Path correctPath = Paths.get(pathsByWatchKey.get(key));
return new ResolvedPathWatchEvent(event, correctPath);
} | java | private synchronized WatchEvent<Path> resolveEventWithCorrectPath(final WatchKey key, final WatchEvent<Path> event) {
Path correctPath = Paths.get(pathsByWatchKey.get(key));
return new ResolvedPathWatchEvent(event, correctPath);
} | [
"private",
"synchronized",
"WatchEvent",
"<",
"Path",
">",
"resolveEventWithCorrectPath",
"(",
"final",
"WatchKey",
"key",
",",
"final",
"WatchEvent",
"<",
"Path",
">",
"event",
")",
"{",
"Path",
"correctPath",
"=",
"Paths",
".",
"get",
"(",
"pathsByWatchKey",
... | Resolves a watch event with its absolute path.
@param key the watch key (used to look up the parent path)
@param event the event to resolve
@return a copy of the event, with a resolved path | [
"Resolves",
"a",
"watch",
"event",
"with",
"its",
"absolute",
"path",
"."
] | train | https://github.com/sworisbreathing/sfmf4j/blob/826c2c02af69d55f98e64fbcfae23d0c7bac3f19/sfmf4j-nio2/src/main/java/com/github/sworisbreathing/sfmf4j/nio2/WatchServiceFileMonitorServiceImpl.java#L201-L204 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/Sketches.java | Sketches.getUpperBound | public static double getUpperBound(final int numStdDev, final Memory srcMem) {
return Sketch.upperBound(getRetainedEntries(srcMem), getThetaLong(srcMem), numStdDev, getEmpty(srcMem));
} | java | public static double getUpperBound(final int numStdDev, final Memory srcMem) {
return Sketch.upperBound(getRetainedEntries(srcMem), getThetaLong(srcMem), numStdDev, getEmpty(srcMem));
} | [
"public",
"static",
"double",
"getUpperBound",
"(",
"final",
"int",
"numStdDev",
",",
"final",
"Memory",
"srcMem",
")",
"{",
"return",
"Sketch",
".",
"upperBound",
"(",
"getRetainedEntries",
"(",
"srcMem",
")",
",",
"getThetaLong",
"(",
"srcMem",
")",
",",
"... | Gets the approximate upper error bound from a valid memory image of a Sketch
given the specified number of Standard Deviations.
This will return getEstimate() if isEmpty() is true.
@param numStdDev
<a href="{@docRoot}/resources/dictionary.html#numStdDev">See Number of Standard Deviations</a>
@param srcMem
<a href="{@d... | [
"Gets",
"the",
"approximate",
"upper",
"error",
"bound",
"from",
"a",
"valid",
"memory",
"image",
"of",
"a",
"Sketch",
"given",
"the",
"specified",
"number",
"of",
"Standard",
"Deviations",
".",
"This",
"will",
"return",
"getEstimate",
"()",
"if",
"isEmpty",
... | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/Sketches.java#L296-L298 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.