repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/Criteria.java | Criteria.addGreaterOrEqualThanField | public void addGreaterOrEqualThanField(String attribute, Object value) {
"""
Adds GreaterOrEqual Than (>=) criteria,
customer_id >= person_id
@param attribute The field name to be used
@param value The field name to compare with
"""
// PAW
// addSelectionCriteria(FieldCriteria.buildNotLess... | java | public void addGreaterOrEqualThanField(String attribute, Object value)
{
// PAW
// addSelectionCriteria(FieldCriteria.buildNotLessCriteria(attribute, value, getAlias()));
addSelectionCriteria(FieldCriteria.buildNotLessCriteria(attribute, value, getUserAlias(attribute)));
} | [
"public",
"void",
"addGreaterOrEqualThanField",
"(",
"String",
"attribute",
",",
"Object",
"value",
")",
"{",
"// PAW\r",
"// addSelectionCriteria(FieldCriteria.buildNotLessCriteria(attribute, value, getAlias()));\r",
"addSelectionCriteria",
"(",
"FieldCriteria",
".",
"buildNotLess... | Adds GreaterOrEqual Than (>=) criteria,
customer_id >= person_id
@param attribute The field name to be used
@param value The field name to compare with | [
"Adds",
"GreaterOrEqual",
"Than",
"(",
">",
"=",
")",
"criteria",
"customer_id",
">",
"=",
"person_id"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/Criteria.java#L421-L426 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/util/Organizer.java | Organizer.sortByJavaBeanProperty | @SuppressWarnings("unchecked")
public static <T> Collection<T> sortByJavaBeanProperty(String aProperyName,
Collection<T> aCollection, boolean aDescending) {
"""
Sort collection of object by a given property name
@param <T>
the type class name
@param aProperyName
the property name
@param aDescending
boo... | java | @SuppressWarnings("unchecked")
public static <T> Collection<T> sortByJavaBeanProperty(String aProperyName,
Collection<T> aCollection, boolean aDescending)
{
if (aCollection == null)
return (Collection<T>) new ArrayList<T>();
if (aProperyName == null)
throw new IllegalArgumentException(
"aPrope... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Collection",
"<",
"T",
">",
"sortByJavaBeanProperty",
"(",
"String",
"aProperyName",
",",
"Collection",
"<",
"T",
">",
"aCollection",
",",
"boolean",
"aDescending",
")",
"{... | Sort collection of object by a given property name
@param <T>
the type class name
@param aProperyName
the property name
@param aDescending
boolean if sorting descending or not
@param aCollection
the collection of object to sort
@return the collection of sorted collection of the property | [
"Sort",
"collection",
"of",
"object",
"by",
"a",
"given",
"property",
"name"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/Organizer.java#L967-L982 |
cycorp/api-suite | core-api/src/main/java/com/cyc/session/exception/SessionCommandException.java | SessionCommandException.fromThrowable | public static SessionCommandException fromThrowable(String message, Throwable cause) {
"""
Converts a Throwable to a SessionCommandException with the specified detail message. If the
Throwable is a SessionCommandException and if the Throwable's message is identical to the
one supplied, the Throwable will be pass... | java | public static SessionCommandException fromThrowable(String message, Throwable cause) {
return (cause instanceof SessionCommandException && Objects.equals(message, cause.getMessage()))
? (SessionCommandException) cause
: new SessionCommandException(message, cause);
} | [
"public",
"static",
"SessionCommandException",
"fromThrowable",
"(",
"String",
"message",
",",
"Throwable",
"cause",
")",
"{",
"return",
"(",
"cause",
"instanceof",
"SessionCommandException",
"&&",
"Objects",
".",
"equals",
"(",
"message",
",",
"cause",
".",
"getM... | Converts a Throwable to a SessionCommandException with the specified detail message. If the
Throwable is a SessionCommandException and if the Throwable's message is identical to the
one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in
a new SessionCommandException with the det... | [
"Converts",
"a",
"Throwable",
"to",
"a",
"SessionCommandException",
"with",
"the",
"specified",
"detail",
"message",
".",
"If",
"the",
"Throwable",
"is",
"a",
"SessionCommandException",
"and",
"if",
"the",
"Throwable",
"s",
"message",
"is",
"identical",
"to",
"t... | train | https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/session/exception/SessionCommandException.java#L63-L67 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java | PoolsImpl.patchAsync | public Observable<Void> patchAsync(String poolId, PoolPatchParameter poolPatchParameter, PoolPatchOptions poolPatchOptions) {
"""
Updates the properties of the specified pool.
This only replaces the pool properties specified in the request. For example, if the pool has a start task associated with it, and a reque... | java | public Observable<Void> patchAsync(String poolId, PoolPatchParameter poolPatchParameter, PoolPatchOptions poolPatchOptions) {
return patchWithServiceResponseAsync(poolId, poolPatchParameter, poolPatchOptions).map(new Func1<ServiceResponseWithHeaders<Void, PoolPatchHeaders>, Void>() {
@Override
... | [
"public",
"Observable",
"<",
"Void",
">",
"patchAsync",
"(",
"String",
"poolId",
",",
"PoolPatchParameter",
"poolPatchParameter",
",",
"PoolPatchOptions",
"poolPatchOptions",
")",
"{",
"return",
"patchWithServiceResponseAsync",
"(",
"poolId",
",",
"poolPatchParameter",
... | Updates the properties of the specified pool.
This only replaces the pool properties specified in the request. For example, if the pool has a start task associated with it, and a request does not specify a start task element, then the pool keeps the existing start task.
@param poolId The ID of the pool to update.
@par... | [
"Updates",
"the",
"properties",
"of",
"the",
"specified",
"pool",
".",
"This",
"only",
"replaces",
"the",
"pool",
"properties",
"specified",
"in",
"the",
"request",
".",
"For",
"example",
"if",
"the",
"pool",
"has",
"a",
"start",
"task",
"associated",
"with"... | 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#L1968-L1975 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/AvroUtils.java | AvroUtils.copyProperties | private static void copyProperties(Schema oldSchema, Schema newSchema) {
"""
*
Copy properties from old Avro Schema to new Avro Schema
@param oldSchema Old Avro Schema to copy properties from
@param newSchema New Avro Schema to copy properties to
"""
Preconditions.checkNotNull(oldSchema);
Preconditi... | java | private static void copyProperties(Schema oldSchema, Schema newSchema) {
Preconditions.checkNotNull(oldSchema);
Preconditions.checkNotNull(newSchema);
Map<String, JsonNode> props = oldSchema.getJsonProps();
copyProperties(props, newSchema);
} | [
"private",
"static",
"void",
"copyProperties",
"(",
"Schema",
"oldSchema",
",",
"Schema",
"newSchema",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"oldSchema",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"newSchema",
")",
";",
"Map",
"<",
"St... | *
Copy properties from old Avro Schema to new Avro Schema
@param oldSchema Old Avro Schema to copy properties from
@param newSchema New Avro Schema to copy properties to | [
"*",
"Copy",
"properties",
"from",
"old",
"Avro",
"Schema",
"to",
"new",
"Avro",
"Schema"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/AvroUtils.java#L780-L786 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java | ElementPlugin.updateVisibility | @Override
protected void updateVisibility(boolean visible, boolean activated) {
"""
Sets the visibility of the contained resource and any registered components.
@param visible Visibility state to set
"""
super.updateVisibility(visible, activated);
if (registeredComponents != null) {
... | java | @Override
protected void updateVisibility(boolean visible, boolean activated) {
super.updateVisibility(visible, activated);
if (registeredComponents != null) {
for (BaseUIComponent component : registeredComponents) {
if (!visible) {
component.setAttri... | [
"@",
"Override",
"protected",
"void",
"updateVisibility",
"(",
"boolean",
"visible",
",",
"boolean",
"activated",
")",
"{",
"super",
".",
"updateVisibility",
"(",
"visible",
",",
"activated",
")",
";",
"if",
"(",
"registeredComponents",
"!=",
"null",
")",
"{",... | Sets the visibility of the contained resource and any registered components.
@param visible Visibility state to set | [
"Sets",
"the",
"visibility",
"of",
"the",
"contained",
"resource",
"and",
"any",
"registered",
"components",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L292-L311 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createNiceMock | public static <T> T createNiceMock(Class<T> type, ConstructorArgs constructorArgs, Method... methods) {
"""
Creates a nice mock object that supports mocking of final and native
methods and invokes a specific constructor.
@param <T> the type of the mock object
@param type the type of the... | java | public static <T> T createNiceMock(Class<T> type, ConstructorArgs constructorArgs, Method... methods) {
return doMock(type, false, new NiceMockStrategy(), constructorArgs, methods);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"createNiceMock",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"ConstructorArgs",
"constructorArgs",
",",
"Method",
"...",
"methods",
")",
"{",
"return",
"doMock",
"(",
"type",
",",
"false",
",",
"new",
"NiceMockStrateg... | Creates a nice mock object that supports mocking of final and native
methods and invokes a specific constructor.
@param <T> the type of the mock object
@param type the type of the mock object
@param constructorArgs The constructor arguments that will be used to invoke a
special constructor.
@par... | [
"Creates",
"a",
"nice",
"mock",
"object",
"that",
"supports",
"mocking",
"of",
"final",
"and",
"native",
"methods",
"and",
"invokes",
"a",
"specific",
"constructor",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L205-L207 |
groupby/api-java | src/main/java/com/groupbyinc/util/UrlBeautifier.java | UrlBeautifier.addRefinementMapping | public void addRefinementMapping(char token, String name) {
"""
<code>
Set up a mapping for a refinement.
Note: you cannot use vowels for mapping tokens to prevent dictionary word creation.
The order in which this method is called determines where in the URL the refinements will show up.
</code>
@param toke... | java | public void addRefinementMapping(char token, String name) {
Navigation mapping = new Navigation();
setValues(mapping, name, String.valueOf(token));
addMapping(mapping);
} | [
"public",
"void",
"addRefinementMapping",
"(",
"char",
"token",
",",
"String",
"name",
")",
"{",
"Navigation",
"mapping",
"=",
"new",
"Navigation",
"(",
")",
";",
"setValues",
"(",
"mapping",
",",
"name",
",",
"String",
".",
"valueOf",
"(",
"token",
")",
... | <code>
Set up a mapping for a refinement.
Note: you cannot use vowels for mapping tokens to prevent dictionary word creation.
The order in which this method is called determines where in the URL the refinements will show up.
</code>
@param token
The single letter to represent this refinement in the lookup.
@param name... | [
"<code",
">",
"Set",
"up",
"a",
"mapping",
"for",
"a",
"refinement",
".",
"Note",
":",
"you",
"cannot",
"use",
"vowels",
"for",
"mapping",
"tokens",
"to",
"prevent",
"dictionary",
"word",
"creation",
".",
"The",
"order",
"in",
"which",
"this",
"method",
... | train | https://github.com/groupby/api-java/blob/257c4ed0777221e5e4ade3b29b9921300fac4e2e/src/main/java/com/groupbyinc/util/UrlBeautifier.java#L468-L472 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/GenericCollectionTypeResolver.java | GenericCollectionTypeResolver.getGenericFieldType | private static Class getGenericFieldType(Field field, int typeIndex, int nestingLevel) {
"""
Extract the generic type from the given field.
@param field the field to check the type for
@param typeIndex the index of the type (e.g. 0 for Collections,
0 for Map keys, 1 for Map values)
@param nestingLevel the nest... | java | private static Class getGenericFieldType(Field field, int typeIndex, int nestingLevel) {
return toClass(extractType(null, field.getGenericType(), typeIndex, nestingLevel));
} | [
"private",
"static",
"Class",
"getGenericFieldType",
"(",
"Field",
"field",
",",
"int",
"typeIndex",
",",
"int",
"nestingLevel",
")",
"{",
"return",
"toClass",
"(",
"extractType",
"(",
"null",
",",
"field",
".",
"getGenericType",
"(",
")",
",",
"typeIndex",
... | Extract the generic type from the given field.
@param field the field to check the type for
@param typeIndex the index of the type (e.g. 0 for Collections,
0 for Map keys, 1 for Map values)
@param nestingLevel the nesting level of the target type
@return the generic type, or <code>null</code> if none | [
"Extract",
"the",
"generic",
"type",
"from",
"the",
"given",
"field",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/GenericCollectionTypeResolver.java#L312-L314 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/data/nodeaudit/NodeAuditSearch.java | NodeAuditSearch.submitPackage | public List<Advisory> submitPackage(JsonObject packageJson) throws SearchException, IOException {
"""
Submits the package.json file to the Node Audit API and returns a list of
zero or more Advisories.
@param packageJson the package.json file retrieved from the Dependency
@return a List of zero or more Advisor... | java | public List<Advisory> submitPackage(JsonObject packageJson) throws SearchException, IOException {
try {
final byte[] packageDatabytes = packageJson.toString().getBytes(StandardCharsets.UTF_8);
final URLConnectionFactory factory = new URLConnectionFactory(settings);
final Http... | [
"public",
"List",
"<",
"Advisory",
">",
"submitPackage",
"(",
"JsonObject",
"packageJson",
")",
"throws",
"SearchException",
",",
"IOException",
"{",
"try",
"{",
"final",
"byte",
"[",
"]",
"packageDatabytes",
"=",
"packageJson",
".",
"toString",
"(",
")",
".",... | Submits the package.json file to the Node Audit API and returns a list of
zero or more Advisories.
@param packageJson the package.json file retrieved from the Dependency
@return a List of zero or more Advisory object
@throws SearchException if Node Audit API is unable to analyze the
package
@throws IOException if it's... | [
"Submits",
"the",
"package",
".",
"json",
"file",
"to",
"the",
"Node",
"Audit",
"API",
"and",
"returns",
"a",
"list",
"of",
"zero",
"or",
"more",
"Advisories",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nodeaudit/NodeAuditSearch.java#L101-L148 |
wisdom-framework/wisdom | core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java | CryptoServiceSingleton.decryptAESWithCBC | @Override
public String decryptAESWithCBC(String value, String salt) {
"""
Decrypt a String with the AES encryption advanced using 'AES/CBC/PKCS5Padding'. Unlike the regular
encode/decode AES method using ECB (Electronic Codebook), it uses Cipher-block chaining (CBC). The salt and
initialization vector must ... | java | @Override
public String decryptAESWithCBC(String value, String salt) {
return decryptAESWithCBC(value, getSecretPrefix(), salt, getDefaultIV());
} | [
"@",
"Override",
"public",
"String",
"decryptAESWithCBC",
"(",
"String",
"value",
",",
"String",
"salt",
")",
"{",
"return",
"decryptAESWithCBC",
"(",
"value",
",",
"getSecretPrefix",
"(",
")",
",",
"salt",
",",
"getDefaultIV",
"(",
")",
")",
";",
"}"
] | Decrypt a String with the AES encryption advanced using 'AES/CBC/PKCS5Padding'. Unlike the regular
encode/decode AES method using ECB (Electronic Codebook), it uses Cipher-block chaining (CBC). The salt and
initialization vector must be valid hex Strings. This method use parts of the application secret as private
key a... | [
"Decrypt",
"a",
"String",
"with",
"the",
"AES",
"encryption",
"advanced",
"using",
"AES",
"/",
"CBC",
"/",
"PKCS5Padding",
".",
"Unlike",
"the",
"regular",
"encode",
"/",
"decode",
"AES",
"method",
"using",
"ECB",
"(",
"Electronic",
"Codebook",
")",
"it",
... | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java#L153-L156 |
rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.formatCurrency | public static String formatCurrency(Object data, String currencyCode, Locale locale) {
"""
See {@link #formatCurrency(org.rythmengine.template.ITemplate, Object, String, java.util.Locale)}
@param data
@param currencyCode
@param locale
@return the currency string
"""
return formatCurrency(null, da... | java | public static String formatCurrency(Object data, String currencyCode, Locale locale) {
return formatCurrency(null, data, currencyCode, locale);
} | [
"public",
"static",
"String",
"formatCurrency",
"(",
"Object",
"data",
",",
"String",
"currencyCode",
",",
"Locale",
"locale",
")",
"{",
"return",
"formatCurrency",
"(",
"null",
",",
"data",
",",
"currencyCode",
",",
"locale",
")",
";",
"}"
] | See {@link #formatCurrency(org.rythmengine.template.ITemplate, Object, String, java.util.Locale)}
@param data
@param currencyCode
@param locale
@return the currency string | [
"See",
"{",
"@link",
"#formatCurrency",
"(",
"org",
".",
"rythmengine",
".",
"template",
".",
"ITemplate",
"Object",
"String",
"java",
".",
"util",
".",
"Locale",
")",
"}"
] | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L1494-L1496 |
timewalker74/ffmq | core/src/main/java/net/timewalker/ffmq4/remote/session/RemoteMessageProducer.java | RemoteMessageProducer.sendToDestination | @Override
protected final void sendToDestination(Destination destination, boolean destinationOverride, Message srcMessage, int deliveryMode, int priority, long timeToLive) throws JMSException {
"""
/* (non-Javadoc)
@see net.timewalker.ffmq4.common.session.AbstractMessageProducer#sendToDestination(javax.jms.Desti... | java | @Override
protected final void sendToDestination(Destination destination, boolean destinationOverride, Message srcMessage, int deliveryMode, int priority, long timeToLive) throws JMSException
{
externalAccessLock.readLock().lock();
try
{
checkNotClosed();
((RemoteSession)session).dis... | [
"@",
"Override",
"protected",
"final",
"void",
"sendToDestination",
"(",
"Destination",
"destination",
",",
"boolean",
"destinationOverride",
",",
"Message",
"srcMessage",
",",
"int",
"deliveryMode",
",",
"int",
"priority",
",",
"long",
"timeToLive",
")",
"throws",
... | /* (non-Javadoc)
@see net.timewalker.ffmq4.common.session.AbstractMessageProducer#sendToDestination(javax.jms.Destination, boolean, javax.jms.Message, int, int, long) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/timewalker74/ffmq/blob/638773ee29a4a5f9c6119ed74ad14ac9c46382b3/core/src/main/java/net/timewalker/ffmq4/remote/session/RemoteMessageProducer.java#L45-L59 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractWSelectList.java | AbstractWSelectList.optionToCode | protected String optionToCode(final Object option, final int index) {
"""
Retrieves the code for the given option. Will return null if there is no matching option.
@param option the option
@param index the index of the option in the list.
@return the code for the given option, or null if there is no matching ... | java | protected String optionToCode(final Object option, final int index) {
if (index < 0) {
List<?> options = getOptions();
if (options == null || options.isEmpty()) {
Integrity.issue(this, "No options available, so cannot convert the option \""
+ option + "\" to a code.");
} else {
StringBuffer me... | [
"protected",
"String",
"optionToCode",
"(",
"final",
"Object",
"option",
",",
"final",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"List",
"<",
"?",
">",
"options",
"=",
"getOptions",
"(",
")",
";",
"if",
"(",
"options",
"==",
... | Retrieves the code for the given option. Will return null if there is no matching option.
@param option the option
@param index the index of the option in the list.
@return the code for the given option, or null if there is no matching option. | [
"Retrieves",
"the",
"code",
"for",
"the",
"given",
"option",
".",
"Will",
"return",
"null",
"if",
"there",
"is",
"no",
"matching",
"option",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractWSelectList.java#L126-L163 |
kite-sdk/kite | kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/impl/EntitySerDe.java | EntitySerDe.serializeOCCColumn | private void serializeOCCColumn(Object fieldValue, PutAction putAction) {
"""
Serialize the OCC column value, and update the putAction with the
serialized bytes.
@param fieldValue
The value to serialize
@param putAction
The PutAction to update.
"""
// OCC Version mapping, so serialize as a long to t... | java | private void serializeOCCColumn(Object fieldValue, PutAction putAction) {
// OCC Version mapping, so serialize as a long to the version check
// column qualifier in the system column family.
Long currVersion = (Long) fieldValue;
VersionCheckAction versionCheckAction = new VersionCheckAction(currVersion)... | [
"private",
"void",
"serializeOCCColumn",
"(",
"Object",
"fieldValue",
",",
"PutAction",
"putAction",
")",
"{",
"// OCC Version mapping, so serialize as a long to the version check",
"// column qualifier in the system column family.",
"Long",
"currVersion",
"=",
"(",
"Long",
")",
... | Serialize the OCC column value, and update the putAction with the
serialized bytes.
@param fieldValue
The value to serialize
@param putAction
The PutAction to update. | [
"Serialize",
"the",
"OCC",
"column",
"value",
"and",
"update",
"the",
"putAction",
"with",
"the",
"serialized",
"bytes",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/impl/EntitySerDe.java#L278-L286 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/IOUtils.java | IOUtils.copy | public static void copy(InputStream input, OutputStream output) throws IOException {
"""
Writes all the contents of a Reader to a Writer.
@param input
the input to read from
@param output
the output to write to
@throws java.io.IOException
if an IOExcption occurs
"""
byte[] buf = new byte[BUFFER_SIZE]... | java | public static void copy(InputStream input, OutputStream output) throws IOException {
byte[] buf = new byte[BUFFER_SIZE];
int num = 0;
while ((num = input.read(buf, 0, buf.length)) != -1) {
output.write(buf, 0, num);
}
} | [
"public",
"static",
"void",
"copy",
"(",
"InputStream",
"input",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"BUFFER_SIZE",
"]",
";",
"int",
"num",
"=",
"0",
";",
"while",
"(",
"("... | Writes all the contents of a Reader to a Writer.
@param input
the input to read from
@param output
the output to write to
@throws java.io.IOException
if an IOExcption occurs | [
"Writes",
"all",
"the",
"contents",
"of",
"a",
"Reader",
"to",
"a",
"Writer",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/IOUtils.java#L85-L92 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/api/Table.java | Table.replaceColumn | public Table replaceColumn(final String columnName, final Column<?> newColumn) {
"""
Replaces an existing column (by name) in this table with the given new column
@param columnName String name of the column to be replaced
@param newColumn Column to be added
"""
int colIndex = columnIndex(columnNam... | java | public Table replaceColumn(final String columnName, final Column<?> newColumn) {
int colIndex = columnIndex(columnName);
return replaceColumn(colIndex, newColumn);
} | [
"public",
"Table",
"replaceColumn",
"(",
"final",
"String",
"columnName",
",",
"final",
"Column",
"<",
"?",
">",
"newColumn",
")",
"{",
"int",
"colIndex",
"=",
"columnIndex",
"(",
"columnName",
")",
";",
"return",
"replaceColumn",
"(",
"colIndex",
",",
"newC... | Replaces an existing column (by name) in this table with the given new column
@param columnName String name of the column to be replaced
@param newColumn Column to be added | [
"Replaces",
"an",
"existing",
"column",
"(",
"by",
"name",
")",
"in",
"this",
"table",
"with",
"the",
"given",
"new",
"column"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/api/Table.java#L268-L271 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java | JdbcCpoAdapter.newWhere | @Override
public <T> CpoWhere newWhere(int logical, String attr, int comp, T value) throws CpoException {
"""
DOCUMENT ME!
@param logical DOCUMENT ME!
@param attr DOCUMENT ME!
@param comp DOCUMENT ME!
@param value DOCUMENT ME!
@return DOCUMENT ME!
@throws CpoException DOCUMENT ME!
"""
ret... | java | @Override
public <T> CpoWhere newWhere(int logical, String attr, int comp, T value) throws CpoException {
return new JdbcCpoWhere(logical, attr, comp, value);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"CpoWhere",
"newWhere",
"(",
"int",
"logical",
",",
"String",
"attr",
",",
"int",
"comp",
",",
"T",
"value",
")",
"throws",
"CpoException",
"{",
"return",
"new",
"JdbcCpoWhere",
"(",
"logical",
",",
"attr",
",",
... | DOCUMENT ME!
@param logical DOCUMENT ME!
@param attr DOCUMENT ME!
@param comp DOCUMENT ME!
@param value DOCUMENT ME!
@return DOCUMENT ME!
@throws CpoException DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java#L1189-L1192 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/config/ConfigValueHelper.java | ConfigValueHelper.checkNotNegativeInteger | protected static void checkNotNegativeInteger(String configKey, int configValue) throws SofaRpcRuntimeException {
"""
检查数字是否为非负数(>=0)
@param configKey 配置项
@param configValue 配置值
@throws SofaRpcRuntimeException 非法异常
"""
if (configValue < 0) {
throw ExceptionUtils.buildRuntime(configKe... | java | protected static void checkNotNegativeInteger(String configKey, int configValue) throws SofaRpcRuntimeException {
if (configValue < 0) {
throw ExceptionUtils.buildRuntime(configKey, configValue + "", "must >= 0");
}
} | [
"protected",
"static",
"void",
"checkNotNegativeInteger",
"(",
"String",
"configKey",
",",
"int",
"configValue",
")",
"throws",
"SofaRpcRuntimeException",
"{",
"if",
"(",
"configValue",
"<",
"0",
")",
"{",
"throw",
"ExceptionUtils",
".",
"buildRuntime",
"(",
"conf... | 检查数字是否为非负数(>=0)
@param configKey 配置项
@param configValue 配置值
@throws SofaRpcRuntimeException 非法异常 | [
"检查数字是否为非负数(",
">",
"=",
"0",
")"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/config/ConfigValueHelper.java#L171-L175 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/protocol/protocolip_stats.java | protocolip_stats.get_nitro_response | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
"""
<pre>
converts nitro response into object and returns the object array in case of get request.
</pre>
"""
protocolip_stats[] resources = new protocolip_stats[1];
protocolip_response result = (proto... | java | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
protocolip_stats[] resources = new protocolip_stats[1];
protocolip_response result = (protocolip_response) service.get_payload_formatter().string_to_resource(protocolip_response.class, response);
if(result.erro... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"protocolip_stats",
"[",
"]",
"resources",
"=",
"new",
"protocolip_stats",
"[",
"1",
"]",
";",
"protocolip_re... | <pre>
converts nitro response into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"converts",
"nitro",
"response",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/protocol/protocolip_stats.java#L510-L529 |
mangstadt/biweekly | src/main/java/biweekly/io/chain/ChainingXmlWriter.java | ChainingXmlWriter.outputProperty | public ChainingXmlWriter outputProperty(String name, String value) {
"""
Assigns an output property to the JAXP transformer (see
{@link Transformer#setOutputProperty}).
@param name the property name
@param value the property value
@return this
"""
outputProperties.put(name, value);
return this;
} | java | public ChainingXmlWriter outputProperty(String name, String value) {
outputProperties.put(name, value);
return this;
} | [
"public",
"ChainingXmlWriter",
"outputProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"outputProperties",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Assigns an output property to the JAXP transformer (see
{@link Transformer#setOutputProperty}).
@param name the property name
@param value the property value
@return this | [
"Assigns",
"an",
"output",
"property",
"to",
"the",
"JAXP",
"transformer",
"(",
"see",
"{"
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/chain/ChainingXmlWriter.java#L102-L105 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newPageNotFoundException | public static PageNotFoundException newPageNotFoundException(String message, Object... args) {
"""
Constructs and initializes a new {@link PageNotFoundException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link PageNo... | java | public static PageNotFoundException newPageNotFoundException(String message, Object... args) {
return newPageNotFoundException(null, message, args);
} | [
"public",
"static",
"PageNotFoundException",
"newPageNotFoundException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newPageNotFoundException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link PageNotFoundException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link PageNotFoundException}.
@param args {@link Object[] arguments} used to replace format placeholders in the {@link ... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"PageNotFoundException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L817-L819 |
mscharhag/oleaster | oleaster-matcher/src/main/java/com/mscharhag/oleaster/matcher/matchers/ExceptionMatcher.java | ExceptionMatcher.toThrow | public <T extends Exception> void toThrow(Class<T> expectedExceptionClass, String expectedMessage) {
"""
Checks if an exception of type {@code expectedExceptionClass} with message {@code expectedMessage} was thrown.
<p>This method throws an {@code AssertionError} if:
<ul>
<li>no exception was thrown.</li>
<li>... | java | public <T extends Exception> void toThrow(Class<T> expectedExceptionClass, String expectedMessage) {
Arguments.ensureNotNull(expectedMessage, "expectedMessage cannot be null");
this.toThrow(expectedExceptionClass);
String exceptionMessage = this.exception.getMessage();
Expectations.expectTrue(expectedMess... | [
"public",
"<",
"T",
"extends",
"Exception",
">",
"void",
"toThrow",
"(",
"Class",
"<",
"T",
">",
"expectedExceptionClass",
",",
"String",
"expectedMessage",
")",
"{",
"Arguments",
".",
"ensureNotNull",
"(",
"expectedMessage",
",",
"\"expectedMessage cannot be null\"... | Checks if an exception of type {@code expectedExceptionClass} with message {@code expectedMessage} was thrown.
<p>This method throws an {@code AssertionError} if:
<ul>
<li>no exception was thrown.</li>
<li>the thrown exception is not an instance of {@code expectedExceptionClass}</li>
<li>the message of the thrown excep... | [
"Checks",
"if",
"an",
"exception",
"of",
"type",
"{"
] | train | https://github.com/mscharhag/oleaster/blob/ce8c6fe2346cd0c0cf5f641417ff85019d1d09ac/oleaster-matcher/src/main/java/com/mscharhag/oleaster/matcher/matchers/ExceptionMatcher.java#L67-L73 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java | ConstructorUtils.getMatchingAccessibleConstructor | public static <T> Constructor<T> getMatchingAccessibleConstructor(final Class<T> cls,
final Class<?>... parameterTypes) {
"""
<p>Finds an accessible constructor with compatible parameters.</p>
<p>This checks all the constructor and finds one with compatible parameters
This requires that every param... | java | public static <T> Constructor<T> getMatchingAccessibleConstructor(final Class<T> cls,
final Class<?>... parameterTypes) {
Validate.notNull(cls, "class cannot be null");
// see if we can find the constructor directly
// most of the time this works and it's much faster
try {
... | [
"public",
"static",
"<",
"T",
">",
"Constructor",
"<",
"T",
">",
"getMatchingAccessibleConstructor",
"(",
"final",
"Class",
"<",
"T",
">",
"cls",
",",
"final",
"Class",
"<",
"?",
">",
"...",
"parameterTypes",
")",
"{",
"Validate",
".",
"notNull",
"(",
"c... | <p>Finds an accessible constructor with compatible parameters.</p>
<p>This checks all the constructor and finds one with compatible parameters
This requires that every parameter is assignable from the given parameter types.
This is a more flexible search than the normal exact matching algorithm.</p>
<p>First it check... | [
"<p",
">",
"Finds",
"an",
"accessible",
"constructor",
"with",
"compatible",
"parameters",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java#L247-L284 |
chocotan/datepicker4j | src/main/java/io/loli/datepicker/DatePicker.java | DatePicker.selectDay | void selectDay(int year, int month, int day) {
"""
Set date to text field
@param year
year to set
@param month
month to set
@param day
day to set
"""
Calendar cal = Calendar.getInstance();
cal.set(year, month, day);
Date date = cal.getTime();
this.field.setText(simpleDat... | java | void selectDay(int year, int month, int day) {
Calendar cal = Calendar.getInstance();
cal.set(year, month, day);
Date date = cal.getTime();
this.field.setText(simpleDateFormat.format(date));
if (popup != null) {
popup.hide();
popup = null;
}
} | [
"void",
"selectDay",
"(",
"int",
"year",
",",
"int",
"month",
",",
"int",
"day",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"set",
"(",
"year",
",",
"month",
",",
"day",
")",
";",
"Date",
"date",
... | Set date to text field
@param year
year to set
@param month
month to set
@param day
day to set | [
"Set",
"date",
"to",
"text",
"field"
] | train | https://github.com/chocotan/datepicker4j/blob/d65d7a6b29f9efe77aeec2024dc31a38a7852676/src/main/java/io/loli/datepicker/DatePicker.java#L109-L118 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toDecimal | public static String toDecimal(Object value, String defaultValue) {
"""
cast a double to a decimal value (String:xx.xx)
@param value Object to cast
@param defaultValue
@return casted decimal value
"""
double res = toDoubleValue(value, true, Double.NaN);
if (Double.isNaN(res)) return defaultValue;
retur... | java | public static String toDecimal(Object value, String defaultValue) {
double res = toDoubleValue(value, true, Double.NaN);
if (Double.isNaN(res)) return defaultValue;
return toDecimal(res);
} | [
"public",
"static",
"String",
"toDecimal",
"(",
"Object",
"value",
",",
"String",
"defaultValue",
")",
"{",
"double",
"res",
"=",
"toDoubleValue",
"(",
"value",
",",
"true",
",",
"Double",
".",
"NaN",
")",
";",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"... | cast a double to a decimal value (String:xx.xx)
@param value Object to cast
@param defaultValue
@return casted decimal value | [
"cast",
"a",
"double",
"to",
"a",
"decimal",
"value",
"(",
"String",
":",
"xx",
".",
"xx",
")"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L849-L853 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/FieldReaderWriter.java | FieldReaderWriter.findInstanceStateManager | private ISMgr findInstanceStateManager(Object instance) {
"""
Discover the instance state manager for the specific object instance. Will fail by exception rather than
returning null.
@param instance the object instance on which to look
@return the discovered state manager
"""
Class<?> clazz = typeDescri... | java | private ISMgr findInstanceStateManager(Object instance) {
Class<?> clazz = typeDescriptor.getReloadableType().getClazz();
try {
Field fieldAccessorField = clazz.getField(Constants.fInstanceFieldsName);
if (fieldAccessorField == null) {
throw new IllegalStateException("Cant find field accessor for type " +... | [
"private",
"ISMgr",
"findInstanceStateManager",
"(",
"Object",
"instance",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"typeDescriptor",
".",
"getReloadableType",
"(",
")",
".",
"getClazz",
"(",
")",
";",
"try",
"{",
"Field",
"fieldAccessorField",
"=",
"... | Discover the instance state manager for the specific object instance. Will fail by exception rather than
returning null.
@param instance the object instance on which to look
@return the discovered state manager | [
"Discover",
"the",
"instance",
"state",
"manager",
"for",
"the",
"specific",
"object",
"instance",
".",
"Will",
"fail",
"by",
"exception",
"rather",
"than",
"returning",
"null",
"."
] | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/FieldReaderWriter.java#L383-L409 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/utils/TopKSampler.java | TopKSampler.addSample | public void addSample(final T item, final long hash, final int value) {
"""
Adds a sample to statistics collection. This method is non-blocking and will
use the "Sampler" thread pool to record results if the sampler is enabled. If not
sampling this is a NOOP
"""
if (enabled)
{
fi... | java | public void addSample(final T item, final long hash, final int value)
{
if (enabled)
{
final Object lock = this;
samplerExecutor.execute(new Runnable()
{
public void run()
{
// samplerExecutor is single threaded ... | [
"public",
"void",
"addSample",
"(",
"final",
"T",
"item",
",",
"final",
"long",
"hash",
",",
"final",
"int",
"value",
")",
"{",
"if",
"(",
"enabled",
")",
"{",
"final",
"Object",
"lock",
"=",
"this",
";",
"samplerExecutor",
".",
"execute",
"(",
"new",
... | Adds a sample to statistics collection. This method is non-blocking and will
use the "Sampler" thread pool to record results if the sampler is enabled. If not
sampling this is a NOOP | [
"Adds",
"a",
"sample",
"to",
"statistics",
"collection",
".",
"This",
"method",
"is",
"non",
"-",
"blocking",
"and",
"will",
"use",
"the",
"Sampler",
"thread",
"pool",
"to",
"record",
"results",
"if",
"the",
"sampler",
"is",
"enabled",
".",
"If",
"not",
... | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/TopKSampler.java#L92-L120 |
EdwardRaff/JSAT | JSAT/src/jsat/io/LIBSVMLoader.java | LIBSVMLoader.loadC | public static ClassificationDataSet loadC(Reader reader, double sparseRatio, int vectorLength, DataStore store) throws IOException {
"""
Loads a new classification data set from a LIBSVM file, assuming the
label is a nominal target value
@param reader the input stream for the file to load
@param sparseRatio t... | java | public static ClassificationDataSet loadC(Reader reader, double sparseRatio, int vectorLength, DataStore store) throws IOException
{
return (ClassificationDataSet) loadG(reader, sparseRatio, vectorLength, true, store);
} | [
"public",
"static",
"ClassificationDataSet",
"loadC",
"(",
"Reader",
"reader",
",",
"double",
"sparseRatio",
",",
"int",
"vectorLength",
",",
"DataStore",
"store",
")",
"throws",
"IOException",
"{",
"return",
"(",
"ClassificationDataSet",
")",
"loadG",
"(",
"reade... | Loads a new classification data set from a LIBSVM file, assuming the
label is a nominal target value
@param reader the input stream for the file to load
@param sparseRatio the fraction of non zero values to qualify a data
point as sparse
@param vectorLength the pre-determined length of each vector. If given a
negative... | [
"Loads",
"a",
"new",
"classification",
"data",
"set",
"from",
"a",
"LIBSVM",
"file",
"assuming",
"the",
"label",
"is",
"a",
"nominal",
"target",
"value"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/io/LIBSVMLoader.java#L252-L255 |
aws/aws-sdk-java | aws-java-sdk-discovery/src/main/java/com/amazonaws/services/applicationdiscovery/model/ListConfigurationsResult.java | ListConfigurationsResult.withConfigurations | public ListConfigurationsResult withConfigurations(java.util.Map<String, String>... configurations) {
"""
<p>
Returns configuration details, including the configuration ID, attribute names, and attribute values.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #se... | java | public ListConfigurationsResult withConfigurations(java.util.Map<String, String>... configurations) {
if (this.configurations == null) {
setConfigurations(new java.util.ArrayList<java.util.Map<String, String>>(configurations.length));
}
for (java.util.Map<String, String> ele : config... | [
"public",
"ListConfigurationsResult",
"withConfigurations",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"...",
"configurations",
")",
"{",
"if",
"(",
"this",
".",
"configurations",
"==",
"null",
")",
"{",
"setConfigurations",
"(",
... | <p>
Returns configuration details, including the configuration ID, attribute names, and attribute values.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setConfigurations(java.util.Collection)} or {@link #withConfigurations(java.util.Collection)} if you want
to override ... | [
"<p",
">",
"Returns",
"configuration",
"details",
"including",
"the",
"configuration",
"ID",
"attribute",
"names",
"and",
"attribute",
"values",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-discovery/src/main/java/com/amazonaws/services/applicationdiscovery/model/ListConfigurationsResult.java#L81-L89 |
att/AAF | cadi/core/src/main/java/com/att/cadi/filter/CadiAccess.java | CadiAccess.buildLine | public final static StringBuilder buildLine(Level level, StringBuilder sb, Object[] elements) {
"""
Add the "Level" to the Buildline for Logging types that don't specify, or straight Streams, etc. Then buildline
Build a line of code onto a StringBuilder based on Objects. Analyze whether
spaces need including... | java | public final static StringBuilder buildLine(Level level, StringBuilder sb, Object[] elements) {
sb.append(level.name());
return buildLine(sb,elements);
} | [
"public",
"final",
"static",
"StringBuilder",
"buildLine",
"(",
"Level",
"level",
",",
"StringBuilder",
"sb",
",",
"Object",
"[",
"]",
"elements",
")",
"{",
"sb",
".",
"append",
"(",
"level",
".",
"name",
"(",
")",
")",
";",
"return",
"buildLine",
"(",
... | Add the "Level" to the Buildline for Logging types that don't specify, or straight Streams, etc. Then buildline
Build a line of code onto a StringBuilder based on Objects. Analyze whether
spaces need including.
@param level
@param sb
@param elements
@return | [
"Add",
"the",
"Level",
"to",
"the",
"Buildline",
"for",
"Logging",
"types",
"that",
"don",
"t",
"specify",
"or",
"straight",
"Streams",
"etc",
".",
"Then",
"buildline"
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/core/src/main/java/com/att/cadi/filter/CadiAccess.java#L80-L83 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java | ApiOvhDbaaslogs.serviceName_option_optionId_GET | public OvhOption serviceName_option_optionId_GET(String serviceName, String optionId) throws IOException {
"""
Returns details of a subscribed option
REST: GET /dbaas/logs/{serviceName}/option/{optionId}
@param serviceName [required] Service name
@param optionId [required] Option ID
"""
String qPath = "... | java | public OvhOption serviceName_option_optionId_GET(String serviceName, String optionId) throws IOException {
String qPath = "/dbaas/logs/{serviceName}/option/{optionId}";
StringBuilder sb = path(qPath, serviceName, optionId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhOption.... | [
"public",
"OvhOption",
"serviceName_option_optionId_GET",
"(",
"String",
"serviceName",
",",
"String",
"optionId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/logs/{serviceName}/option/{optionId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
... | Returns details of a subscribed option
REST: GET /dbaas/logs/{serviceName}/option/{optionId}
@param serviceName [required] Service name
@param optionId [required] Option ID | [
"Returns",
"details",
"of",
"a",
"subscribed",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L636-L641 |
the-fascinator/plugin-authentication-internal | src/main/java/com/googlecode/fascinator/authentication/internal/InternalAuthentication.java | InternalAuthentication.logIn | @Override
public User logIn(String username, String password)
throws AuthenticationException {
"""
Tests the user's username/password validity.
@param username The username of the user logging in.
@param password The password of the user logging in.
@return A user object for the newly logged i... | java | @Override
public User logIn(String username, String password)
throws AuthenticationException {
// Find our user
String uPwd = file_store.getProperty(username);
if (uPwd == null) {
throw new AuthenticationException("User '" + username
+ "' not found... | [
"@",
"Override",
"public",
"User",
"logIn",
"(",
"String",
"username",
",",
"String",
"password",
")",
"throws",
"AuthenticationException",
"{",
"// Find our user",
"String",
"uPwd",
"=",
"file_store",
".",
"getProperty",
"(",
"username",
")",
";",
"if",
"(",
... | Tests the user's username/password validity.
@param username The username of the user logging in.
@param password The password of the user logging in.
@return A user object for the newly logged in user.
@throws AuthenticationException if there was an error logging in. | [
"Tests",
"the",
"user",
"s",
"username",
"/",
"password",
"validity",
"."
] | train | https://github.com/the-fascinator/plugin-authentication-internal/blob/a2b9a0eda9b43bf20583036a406c83c938be3042/src/main/java/com/googlecode/fascinator/authentication/internal/InternalAuthentication.java#L257-L274 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java | ClassWriterImpl.getClassLinks | private Content getClassLinks(LinkInfoImpl.Kind context, List<?> list) {
"""
Get links to the given classes.
@param context the id of the context where the link will be printed
@param list the list of classes
@return a content tree for the class list
"""
Object[] typeList = list.toArray();
... | java | private Content getClassLinks(LinkInfoImpl.Kind context, List<?> list) {
Object[] typeList = list.toArray();
Content dd = new HtmlTree(HtmlTag.DD);
for (int i = 0; i < list.size(); i++) {
if (i > 0) {
Content separator = new StringContent(", ");
dd.add... | [
"private",
"Content",
"getClassLinks",
"(",
"LinkInfoImpl",
".",
"Kind",
"context",
",",
"List",
"<",
"?",
">",
"list",
")",
"{",
"Object",
"[",
"]",
"typeList",
"=",
"list",
".",
"toArray",
"(",
")",
";",
"Content",
"dd",
"=",
"new",
"HtmlTree",
"(",
... | Get links to the given classes.
@param context the id of the context where the link will be printed
@param list the list of classes
@return a content tree for the class list | [
"Get",
"links",
"to",
"the",
"given",
"classes",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java#L584-L603 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformaction.java | transformaction.get | public static transformaction get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch transformaction resource of given name .
"""
transformaction obj = new transformaction();
obj.set_name(name);
transformaction response = (transformaction) obj.get_resource(service);
return... | java | public static transformaction get(nitro_service service, String name) throws Exception{
transformaction obj = new transformaction();
obj.set_name(name);
transformaction response = (transformaction) obj.get_resource(service);
return response;
} | [
"public",
"static",
"transformaction",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"transformaction",
"obj",
"=",
"new",
"transformaction",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"tra... | Use this API to fetch transformaction resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"transformaction",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformaction.java#L499-L504 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/ExceptionFactory.java | ExceptionFactory.createExecutionException | public static RedisCommandExecutionException createExecutionException(String message, Throwable cause) {
"""
Create a {@link RedisCommandExecutionException} with a detail message and optionally a {@link Throwable cause}. Specific
Redis error messages may create subtypes of {@link RedisCommandExecutionException}.
... | java | public static RedisCommandExecutionException createExecutionException(String message, Throwable cause) {
if (message != null) {
if (message.startsWith("BUSY")) {
return cause != null ? new RedisBusyException(message, cause) : new RedisBusyException(message);
}
... | [
"public",
"static",
"RedisCommandExecutionException",
"createExecutionException",
"(",
"String",
"message",
",",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"message",
"!=",
"null",
")",
"{",
"if",
"(",
"message",
".",
"startsWith",
"(",
"\"BUSY\"",
")",
")",
"... | Create a {@link RedisCommandExecutionException} with a detail message and optionally a {@link Throwable cause}. Specific
Redis error messages may create subtypes of {@link RedisCommandExecutionException}.
@param message the detail message.
@param cause the nested exception, may be {@literal null}.
@return the {@link R... | [
"Create",
"a",
"{",
"@link",
"RedisCommandExecutionException",
"}",
"with",
"a",
"detail",
"message",
"and",
"optionally",
"a",
"{",
"@link",
"Throwable",
"cause",
"}",
".",
"Specific",
"Redis",
"error",
"messages",
"may",
"create",
"subtypes",
"of",
"{",
"@li... | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/ExceptionFactory.java#L119-L140 |
dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Category.java | Category.of | public static Category of(String description, Node itemIcon, Group... groups) {
"""
Creates a new category from groups.
@param description Category name, for display in {@link CategoryView}
@param itemIcon Icon to be shown next to the category name
@param groups {@link Group} with {@link Setting} to b... | java | public static Category of(String description, Node itemIcon, Group... groups) {
return new Category(description, itemIcon, groups);
} | [
"public",
"static",
"Category",
"of",
"(",
"String",
"description",
",",
"Node",
"itemIcon",
",",
"Group",
"...",
"groups",
")",
"{",
"return",
"new",
"Category",
"(",
"description",
",",
"itemIcon",
",",
"groups",
")",
";",
"}"
] | Creates a new category from groups.
@param description Category name, for display in {@link CategoryView}
@param itemIcon Icon to be shown next to the category name
@param groups {@link Group} with {@link Setting} to be shown in the {@link CategoryView}
@return initialized Category object | [
"Creates",
"a",
"new",
"category",
"from",
"groups",
"."
] | train | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Category.java#L116-L118 |
facebookarchive/hadoop-20 | src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/SensorsParser.java | SensorsParser.readGroup | private EventRecord readGroup(EventRecord er, StringBuffer sb, String prefix) {
"""
Reads and parses lines that provide the output
of a group of sensors with the same functionality.
@param er the EventRecord to which the new attributes are added
@param sb the text to parse
@param prefix a String prefix speci... | java | private EventRecord readGroup(EventRecord er, StringBuffer sb, String prefix) {
Pattern pattern = Pattern.compile(".*(" + prefix
+ "\\s*\\d*)\\s*:\\s*(\\+?\\d+)", Pattern.MULTILINE);
Matcher matcher = pattern.matcher(sb);
while (matcher.find())
er.set(matcher.group(1), matcher.group(2));
... | [
"private",
"EventRecord",
"readGroup",
"(",
"EventRecord",
"er",
",",
"StringBuffer",
"sb",
",",
"String",
"prefix",
")",
"{",
"Pattern",
"pattern",
"=",
"Pattern",
".",
"compile",
"(",
"\".*(\"",
"+",
"prefix",
"+",
"\"\\\\s*\\\\d*)\\\\s*:\\\\s*(\\\\+?\\\\d+)\"",
... | Reads and parses lines that provide the output
of a group of sensors with the same functionality.
@param er the EventRecord to which the new attributes are added
@param sb the text to parse
@param prefix a String prefix specifying the common prefix of the
sensors' names in the group (e.g. "fan", "in", "temp"
@return ... | [
"Reads",
"and",
"parses",
"lines",
"that",
"provide",
"the",
"output",
"of",
"a",
"group",
"of",
"sensors",
"with",
"the",
"same",
"functionality",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/SensorsParser.java#L73-L83 |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/ltc/impl/LocalTranCurrentImpl.java | LocalTranCurrentImpl.suspend | public LocalTransactionCoordinator suspend() {
"""
Disassociates the LTC scope from the thread.
@return the LocalTransactionCoordinator instance representing the LTC scope
disassociated from the thread. If there was no LTC scope, returns null.
"""
if (tc.isEntryEnabled()) Tr.entry(tc, "suspend", th... | java | public LocalTransactionCoordinator suspend()
{
if (tc.isEntryEnabled()) Tr.entry(tc, "suspend", this);
final LocalTranCoordImpl ltc = _coord;
if (ltc != null)
{
_coord = null;
ltc.suspend(); // suspend any native context
inv... | [
"public",
"LocalTransactionCoordinator",
"suspend",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"suspend\"",
",",
"this",
")",
";",
"final",
"LocalTranCoordImpl",
"ltc",
"=",
"_coord",
";",
... | Disassociates the LTC scope from the thread.
@return the LocalTransactionCoordinator instance representing the LTC scope
disassociated from the thread. If there was no LTC scope, returns null. | [
"Disassociates",
"the",
"LTC",
"scope",
"from",
"the",
"thread",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/ltc/impl/LocalTranCurrentImpl.java#L178-L193 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/SQSSession.java | SQSSession.createProducer | @Override
public MessageProducer createProducer(Destination destination) throws JMSException {
"""
Creates a <code>MessageProducer</code> for the specified destination.
Only queue destinations are supported at this time.
@param destination
a queue destination
@return new message producer
@throws JMSExce... | java | @Override
public MessageProducer createProducer(Destination destination) throws JMSException {
checkClosed();
if (destination != null && !(destination instanceof SQSQueueDestination)) {
throw new JMSException("Actual type of Destination/Queue has to be SQSQueueDestination");
}
... | [
"@",
"Override",
"public",
"MessageProducer",
"createProducer",
"(",
"Destination",
"destination",
")",
"throws",
"JMSException",
"{",
"checkClosed",
"(",
")",
";",
"if",
"(",
"destination",
"!=",
"null",
"&&",
"!",
"(",
"destination",
"instanceof",
"SQSQueueDesti... | Creates a <code>MessageProducer</code> for the specified destination.
Only queue destinations are supported at this time.
@param destination
a queue destination
@return new message producer
@throws JMSException
If session is closed or queue destination is not used | [
"Creates",
"a",
"<code",
">",
"MessageProducer<",
"/",
"code",
">",
"for",
"the",
"specified",
"destination",
".",
"Only",
"queue",
"destinations",
"are",
"supported",
"at",
"this",
"time",
"."
] | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/SQSSession.java#L532-L545 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/RDBMEntityLockStore.java | RDBMEntityLockStore.primUpdate | private void primUpdate(IEntityLock lock, Date newExpiration, Integer newType, Connection conn)
throws SQLException, LockingException {
"""
Updates the lock's <code>expiration</code> and <code>lockType</code> in the underlying store.
The SQL is over-qualified to make sure the row has not been updated ... | java | private void primUpdate(IEntityLock lock, Date newExpiration, Integer newType, Connection conn)
throws SQLException, LockingException {
Integer typeID =
EntityTypesLocator.getEntityTypes().getEntityIDFromType(lock.getEntityType());
String key = lock.getEntityKey();
in... | [
"private",
"void",
"primUpdate",
"(",
"IEntityLock",
"lock",
",",
"Date",
"newExpiration",
",",
"Integer",
"newType",
",",
"Connection",
"conn",
")",
"throws",
"SQLException",
",",
"LockingException",
"{",
"Integer",
"typeID",
"=",
"EntityTypesLocator",
".",
"getE... | Updates the lock's <code>expiration</code> and <code>lockType</code> in the underlying store.
The SQL is over-qualified to make sure the row has not been updated since the lock was last
checked.
@param lock
@param newExpiration java.util.Date
@param newType Integer
@param conn Connection | [
"Updates",
"the",
"lock",
"s",
"<code",
">",
"expiration<",
"/",
"code",
">",
"and",
"<code",
">",
"lockType<",
"/",
"code",
">",
"in",
"the",
"underlying",
"store",
".",
"The",
"SQL",
"is",
"over",
"-",
"qualified",
"to",
"make",
"sure",
"the",
"row",... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/RDBMEntityLockStore.java#L513-L550 |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/pattern/Patterns.java | Patterns.regex | public static Pattern regex(final java.util.regex.Pattern p) {
"""
Adapts a regular expression pattern to a {@link Pattern}.
<p><em>WARNING</em>: in addition to regular expression cost, the returned {@code Pattern} object needs
to make a substring copy every time it's evaluated. This can incur excessive copyin... | java | public static Pattern regex(final java.util.regex.Pattern p) {
return new Pattern() {
@Override
public int match(CharSequence src, int begin, int end) {
if (begin > end)
return MISMATCH;
Matcher matcher = p.matcher(src.subSequence(begin, end));
if (matcher.lookingAt())
... | [
"public",
"static",
"Pattern",
"regex",
"(",
"final",
"java",
".",
"util",
".",
"regex",
".",
"Pattern",
"p",
")",
"{",
"return",
"new",
"Pattern",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"match",
"(",
"CharSequence",
"src",
",",
"int",
"begin... | Adapts a regular expression pattern to a {@link Pattern}.
<p><em>WARNING</em>: in addition to regular expression cost, the returned {@code Pattern} object needs
to make a substring copy every time it's evaluated. This can incur excessive copying and memory overhead
when parsing large strings. Consider implementing {@c... | [
"Adapts",
"a",
"regular",
"expression",
"pattern",
"to",
"a",
"{",
"@link",
"Pattern",
"}",
"."
] | train | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/pattern/Patterns.java#L518-L530 |
glyptodon/guacamole-client | extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java | RestrictedGuacamoleTunnelService.tryAdd | private <T> boolean tryAdd(ConcurrentHashMultiset<T> multiset, T value, int max) {
"""
Attempts to add a single instance of the given value to the given
multiset without exceeding the specified maximum number of values. If
the value cannot be added without exceeding the maximum, false is
returned.
@param <T>... | java | private <T> boolean tryAdd(ConcurrentHashMultiset<T> multiset, T value, int max) {
// Repeatedly attempt to add a new value to the given multiset until we
// explicitly succeed or explicitly fail
while (true) {
// Get current number of values
int count = multiset.count(... | [
"private",
"<",
"T",
">",
"boolean",
"tryAdd",
"(",
"ConcurrentHashMultiset",
"<",
"T",
">",
"multiset",
",",
"T",
"value",
",",
"int",
"max",
")",
"{",
"// Repeatedly attempt to add a new value to the given multiset until we",
"// explicitly succeed or explicitly fail",
... | Attempts to add a single instance of the given value to the given
multiset without exceeding the specified maximum number of values. If
the value cannot be added without exceeding the maximum, false is
returned.
@param <T>
The type of values contained within the multiset.
@param multiset
The multiset to attempt to ad... | [
"Attempts",
"to",
"add",
"a",
"single",
"instance",
"of",
"the",
"given",
"value",
"to",
"the",
"given",
"multiset",
"without",
"exceeding",
"the",
"specified",
"maximum",
"number",
"of",
"values",
".",
"If",
"the",
"value",
"cannot",
"be",
"added",
"without... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java#L109-L130 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/QuadTree.java | QuadTree.getIterator | public QuadTreeIterator getIterator(Geometry query, double tolerance) {
"""
Gets an iterator on the QuadTree. The query will be the Envelope2D that
bounds the input Geometry. To reuse the existing iterator on the same
QuadTree but with a new query, use the reset_iterator function on the
QuadTree_iterator.
\par... | java | public QuadTreeIterator getIterator(Geometry query, double tolerance) {
QuadTreeImpl.QuadTreeIteratorImpl iterator = m_impl.getIterator(query, tolerance);
return new QuadTreeIterator(iterator, false);
} | [
"public",
"QuadTreeIterator",
"getIterator",
"(",
"Geometry",
"query",
",",
"double",
"tolerance",
")",
"{",
"QuadTreeImpl",
".",
"QuadTreeIteratorImpl",
"iterator",
"=",
"m_impl",
".",
"getIterator",
"(",
"query",
",",
"tolerance",
")",
";",
"return",
"new",
"Q... | Gets an iterator on the QuadTree. The query will be the Envelope2D that
bounds the input Geometry. To reuse the existing iterator on the same
QuadTree but with a new query, use the reset_iterator function on the
QuadTree_iterator.
\param query The Geometry used for the query. If the
Geometry is a Line segment, then the... | [
"Gets",
"an",
"iterator",
"on",
"the",
"QuadTree",
".",
"The",
"query",
"will",
"be",
"the",
"Envelope2D",
"that",
"bounds",
"the",
"input",
"Geometry",
".",
"To",
"reuse",
"the",
"existing",
"iterator",
"on",
"the",
"same",
"QuadTree",
"but",
"with",
"a",... | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/QuadTree.java#L263-L266 |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java | JJDocMojo.createReportLink | private void createReportLink (final Sink sink, final File sourceDirectory, final File grammarFile, String linkPath) {
"""
Create a table row containing a link to the JJDoc report for a grammar
file.
@param sink
The sink to write the report
@param sourceDirectory
The source directory of the grammar file.
@... | java | private void createReportLink (final Sink sink, final File sourceDirectory, final File grammarFile, String linkPath)
{
sink.tableRow ();
sink.tableCell ();
if (linkPath.startsWith ("/"))
{
linkPath = linkPath.substring (1);
}
sink.link (linkPath);
String grammarFileRelativePath = sou... | [
"private",
"void",
"createReportLink",
"(",
"final",
"Sink",
"sink",
",",
"final",
"File",
"sourceDirectory",
",",
"final",
"File",
"grammarFile",
",",
"String",
"linkPath",
")",
"{",
"sink",
".",
"tableRow",
"(",
")",
";",
"sink",
".",
"tableCell",
"(",
"... | Create a table row containing a link to the JJDoc report for a grammar
file.
@param sink
The sink to write the report
@param sourceDirectory
The source directory of the grammar file.
@param grammarFile
The JavaCC grammar file.
@param linkPath
The path to the JJDoc output. | [
"Create",
"a",
"table",
"row",
"containing",
"a",
"link",
"to",
"the",
"JJDoc",
"report",
"for",
"a",
"grammar",
"file",
"."
] | train | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java#L455-L473 |
TGIO/RNCryptorNative | rncryptor-native/src/main/java/tgio/rncryptor/RNCryptorNative.java | RNCryptorNative.encryptFile | public static void encryptFile(File raw, File encryptedFile, String password) throws IOException {
"""
Encrypts file using password
@param raw the original file to be encrypted
@param encryptedFile the result file
@param password strong generated password
@throws IOException
"""
byte[] b = readByte... | java | public static void encryptFile(File raw, File encryptedFile, String password) throws IOException {
byte[] b = readBytes(raw);
String encodedImage = Base64.encodeToString(b, Base64.DEFAULT);
byte[] encryptedBytes = new RNCryptorNative().encrypt(encodedImage, password);
writeBytes(encrypte... | [
"public",
"static",
"void",
"encryptFile",
"(",
"File",
"raw",
",",
"File",
"encryptedFile",
",",
"String",
"password",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"b",
"=",
"readBytes",
"(",
"raw",
")",
";",
"String",
"encodedImage",
"=",
"Base64... | Encrypts file using password
@param raw the original file to be encrypted
@param encryptedFile the result file
@param password strong generated password
@throws IOException | [
"Encrypts",
"file",
"using",
"password"
] | train | https://github.com/TGIO/RNCryptorNative/blob/5209f10b988e4033c0b769a40b0d6cc99ea16af7/rncryptor-native/src/main/java/tgio/rncryptor/RNCryptorNative.java#L98-L103 |
dropbox/dropbox-sdk-java | examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/Main.java | Main.doHome | public void doHome(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
"""
account to their Dropbox account. If nobody is logged in, redirect to "/".
"""
if (!common.checkGet(request, response)) return;
// If nobody's logged in, send the browser to... | java | public void doHome(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
if (!common.checkGet(request, response)) return;
// If nobody's logged in, send the browser to "/".
User user = common.getLoggedInUser(request);
if (user == null) {
... | [
"public",
"void",
"doHome",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"if",
"(",
"!",
"common",
".",
"checkGet",
"(",
"request",
",",
"response",
")",
")",
"return",
... | account to their Dropbox account. If nobody is logged in, redirect to "/". | [
"account",
"to",
"their",
"Dropbox",
"account",
".",
"If",
"nobody",
"is",
"logged",
"in",
"redirect",
"to",
"/",
"."
] | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/Main.java#L187-L236 |
prestodb/presto | presto-spi/src/main/java/com/facebook/presto/spi/predicate/SortedRangeSet.java | SortedRangeSet.copyOf | static SortedRangeSet copyOf(Type type, Iterable<Range> ranges) {
"""
Provided Ranges are unioned together to form the SortedRangeSet
"""
return new Builder(type).addAll(ranges).build();
} | java | static SortedRangeSet copyOf(Type type, Iterable<Range> ranges)
{
return new Builder(type).addAll(ranges).build();
} | [
"static",
"SortedRangeSet",
"copyOf",
"(",
"Type",
"type",
",",
"Iterable",
"<",
"Range",
">",
"ranges",
")",
"{",
"return",
"new",
"Builder",
"(",
"type",
")",
".",
"addAll",
"(",
"ranges",
")",
".",
"build",
"(",
")",
";",
"}"
] | Provided Ranges are unioned together to form the SortedRangeSet | [
"Provided",
"Ranges",
"are",
"unioned",
"together",
"to",
"form",
"the",
"SortedRangeSet"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-spi/src/main/java/com/facebook/presto/spi/predicate/SortedRangeSet.java#L100-L103 |
paymill/paymill-java | src/main/java/com/paymill/services/ClientService.java | ClientService.createWithEmailAndDescription | public Client createWithEmailAndDescription( String email, String description ) {
"""
Creates a {@link Client} object.
@param email
Mail address for the {@link Client} or <code>null</code>
@param description
Description for the client or <code>null</code>
@return {@link Client} object, which represents a PAYM... | java | public Client createWithEmailAndDescription( String email, String description ) {
ParameterMap<String, String> params = new ParameterMap<String, String>();
if( StringUtils.isNotBlank( email ) )
params.add( "email", email );
if( StringUtils.isNotBlank( description ) )
params.add( "description", d... | [
"public",
"Client",
"createWithEmailAndDescription",
"(",
"String",
"email",
",",
"String",
"description",
")",
"{",
"ParameterMap",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"ParameterMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"i... | Creates a {@link Client} object.
@param email
Mail address for the {@link Client} or <code>null</code>
@param description
Description for the client or <code>null</code>
@return {@link Client} object, which represents a PAYMILL client. | [
"Creates",
"a",
"{"
] | train | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/ClientService.java#L132-L140 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/openal/SoundStore.java | SoundStore.playAsSoundAt | int playAsSoundAt(int buffer,float pitch,float gain,boolean loop,float x, float y, float z) {
"""
Play the specified buffer as a sound effect with the specified
pitch and gain.
@param buffer The ID of the buffer to play
@param pitch The pitch to play at
@param gain The gain to play at
@param loop True if th... | java | int playAsSoundAt(int buffer,float pitch,float gain,boolean loop,float x, float y, float z) {
gain *= soundVolume;
if (gain == 0) {
gain = 0.001f;
}
if (soundWorks) {
if (sounds) {
int nextSource = findFreeSource();
if (nextSource == -1) {
return -1;
}
AL10.alSourceSt... | [
"int",
"playAsSoundAt",
"(",
"int",
"buffer",
",",
"float",
"pitch",
",",
"float",
"gain",
",",
"boolean",
"loop",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"gain",
"*=",
"soundVolume",
";",
"if",
"(",
"gain",
"==",
"0",
")... | Play the specified buffer as a sound effect with the specified
pitch and gain.
@param buffer The ID of the buffer to play
@param pitch The pitch to play at
@param gain The gain to play at
@param loop True if the sound should loop
@param x The x position to play the sound from
@param y The y position to play the sound ... | [
"Play",
"the",
"specified",
"buffer",
"as",
"a",
"sound",
"effect",
"with",
"the",
"specified",
"pitch",
"and",
"gain",
"."
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/openal/SoundStore.java#L394-L429 |
tvesalainen/util | util/src/main/java/org/vesalainen/util/CharSequences.java | CharSequences.indexOf | public static int indexOf(CharSequence seq, CharSequence pattern, int fromIndex) {
"""
Returns index of pattern, starting at fromIndex, or -1 if pattern not found
@param seq
@param pattern
@param fromIndex
@return
@see java.lang.String#indexOf(java.lang.String, int)
"""
return indexOf(seq, patter... | java | public static int indexOf(CharSequence seq, CharSequence pattern, int fromIndex)
{
return indexOf(seq, pattern, (int a, int b)->{return a==b;}, fromIndex);
} | [
"public",
"static",
"int",
"indexOf",
"(",
"CharSequence",
"seq",
",",
"CharSequence",
"pattern",
",",
"int",
"fromIndex",
")",
"{",
"return",
"indexOf",
"(",
"seq",
",",
"pattern",
",",
"(",
"int",
"a",
",",
"int",
"b",
")",
"->",
"{",
"return",
"a",
... | Returns index of pattern, starting at fromIndex, or -1 if pattern not found
@param seq
@param pattern
@param fromIndex
@return
@see java.lang.String#indexOf(java.lang.String, int) | [
"Returns",
"index",
"of",
"pattern",
"starting",
"at",
"fromIndex",
"or",
"-",
"1",
"if",
"pattern",
"not",
"found"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/CharSequences.java#L221-L224 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/FragmentJoiner.java | FragmentJoiner.getRMS | public static double getRMS(Atom[] ca1, Atom[]ca2,JointFragments frag) throws StructureException {
"""
Get the RMS of the JointFragments pair frag
@param ca1 the array of all atoms of structure1
@param ca2 the array of all atoms of structure1
@param frag the JointFragments object that contains the list of ide... | java | public static double getRMS(Atom[] ca1, Atom[]ca2,JointFragments frag) throws StructureException {
// now svd ftmp and check if the rms is < X ...
AlternativeAlignment ali = new AlternativeAlignment();
ali.apairs_from_idxlst(frag);
double rms = 999;
int[] idx1 = ali.getIdx1();
int[] idx2 = ali.getIdx2... | [
"public",
"static",
"double",
"getRMS",
"(",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2",
",",
"JointFragments",
"frag",
")",
"throws",
"StructureException",
"{",
"// now svd ftmp and check if the rms is < X ...",
"AlternativeAlignment",
"ali",
"=",
"... | Get the RMS of the JointFragments pair frag
@param ca1 the array of all atoms of structure1
@param ca2 the array of all atoms of structure1
@param frag the JointFragments object that contains the list of identical positions
@return the rms | [
"Get",
"the",
"RMS",
"of",
"the",
"JointFragments",
"pair",
"frag"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/FragmentJoiner.java#L296-L322 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.acceptLanguage | public static ULocale acceptLanguage(String acceptLanguageList, ULocale[] availableLocales,
boolean[] fallback) {
"""
<strong>[icu]</strong> Based on a HTTP formatted list of acceptable locales, determine an available
locale for the user. NullPointerException is thrown if acceptLanguageList or
avail... | java | public static ULocale acceptLanguage(String acceptLanguageList, ULocale[] availableLocales,
boolean[] fallback) {
if (acceptLanguageList == null) {
throw new NullPointerException();
}
ULocale acceptList[] = null;
try {
acceptList = parseAcceptLanguage(... | [
"public",
"static",
"ULocale",
"acceptLanguage",
"(",
"String",
"acceptLanguageList",
",",
"ULocale",
"[",
"]",
"availableLocales",
",",
"boolean",
"[",
"]",
"fallback",
")",
"{",
"if",
"(",
"acceptLanguageList",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPo... | <strong>[icu]</strong> Based on a HTTP formatted list of acceptable locales, determine an available
locale for the user. NullPointerException is thrown if acceptLanguageList or
availableLocales is null. If fallback is non-null, it will contain true if a
fallback locale (one not in the acceptLanguageList) was returned... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Based",
"on",
"a",
"HTTP",
"formatted",
"list",
"of",
"acceptable",
"locales",
"determine",
"an",
"available",
"locale",
"for",
"the",
"user",
".",
"NullPointerException",
"is",
"thrown",
"if",
"ac... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1922-L1937 |
alkacon/opencms-core | src/org/opencms/widgets/A_CmsNativeComplexWidget.java | A_CmsNativeComplexWidget.initConfiguration | public final void initConfiguration(String config) {
"""
Initializes the configuration date from the given configuration string.<p>
This should be called by subclasses of this class.<p>
@param config the widget configuration string
"""
m_configuration = config;
m_configurationMap = Cm... | java | public final void initConfiguration(String config) {
m_configuration = config;
m_configurationMap = CmsStringUtil.splitAsMap(config, "|", ":");
m_configurationMap.put(CmsContentDefinition.PARAM_INIT_CALL, INIT_FUNCTION_PREFIX + getName());
m_jsonConfig = new JSONObject(new HashMap<... | [
"public",
"final",
"void",
"initConfiguration",
"(",
"String",
"config",
")",
"{",
"m_configuration",
"=",
"config",
";",
"m_configurationMap",
"=",
"CmsStringUtil",
".",
"splitAsMap",
"(",
"config",
",",
"\"|\"",
",",
"\":\"",
")",
";",
"m_configurationMap",
".... | Initializes the configuration date from the given configuration string.<p>
This should be called by subclasses of this class.<p>
@param config the widget configuration string | [
"Initializes",
"the",
"configuration",
"date",
"from",
"the",
"given",
"configuration",
"string",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/A_CmsNativeComplexWidget.java#L109-L115 |
msteiger/jxmapviewer2 | jxmapviewer2/src/main/java/org/jxmapviewer/viewer/util/GeoUtil.java | GeoUtil.getBitmapCoordinate | public static Point2D getBitmapCoordinate(double latitude, double longitude, int zoomLevel, TileFactoryInfo info) {
"""
Given a position (latitude/longitude pair) and a zoom level, return the appropriate point in <em>pixels</em>. The
zoom level is necessary because pixel coordinates are in terms of the zoom level... | java | public static Point2D getBitmapCoordinate(double latitude, double longitude, int zoomLevel, TileFactoryInfo info)
{
double x = info.getMapCenterInPixelsAtZoom(zoomLevel).getX() + longitude
* info.getLongitudeDegreeWidthInPixels(zoomLevel);
double e = Math.sin(latitude * (Math.PI / 18... | [
"public",
"static",
"Point2D",
"getBitmapCoordinate",
"(",
"double",
"latitude",
",",
"double",
"longitude",
",",
"int",
"zoomLevel",
",",
"TileFactoryInfo",
"info",
")",
"{",
"double",
"x",
"=",
"info",
".",
"getMapCenterInPixelsAtZoom",
"(",
"zoomLevel",
")",
... | Given a position (latitude/longitude pair) and a zoom level, return the appropriate point in <em>pixels</em>. The
zoom level is necessary because pixel coordinates are in terms of the zoom level
@param latitude the latitude
@param longitude the longitude
@param zoomLevel the zoom level to extract the pixel coordinate f... | [
"Given",
"a",
"position",
"(",
"latitude",
"/",
"longitude",
"pair",
")",
"and",
"a",
"zoom",
"level",
"return",
"the",
"appropriate",
"point",
"in",
"<em",
">",
"pixels<",
"/",
"em",
">",
".",
"The",
"zoom",
"level",
"is",
"necessary",
"because",
"pixel... | train | https://github.com/msteiger/jxmapviewer2/blob/82639273b0aac983b6026fb90aa925c0cf596410/jxmapviewer2/src/main/java/org/jxmapviewer/viewer/util/GeoUtil.java#L98-L114 |
morfologik/morfologik-stemming | morfologik-stemming/src/main/java/morfologik/stemming/BufferUtils.java | BufferUtils.clearAndEnsureCapacity | public static CharBuffer clearAndEnsureCapacity(CharBuffer buffer, int elements) {
"""
Ensure the buffer's capacity is large enough to hold a given number
of elements. If the input buffer is not large enough, a new buffer is allocated
and returned.
@param elements The required number of elements to be appende... | java | public static CharBuffer clearAndEnsureCapacity(CharBuffer buffer, int elements) {
if (buffer == null || buffer.capacity() < elements) {
buffer = CharBuffer.allocate(elements);
} else {
buffer.clear();
}
return buffer;
} | [
"public",
"static",
"CharBuffer",
"clearAndEnsureCapacity",
"(",
"CharBuffer",
"buffer",
",",
"int",
"elements",
")",
"{",
"if",
"(",
"buffer",
"==",
"null",
"||",
"buffer",
".",
"capacity",
"(",
")",
"<",
"elements",
")",
"{",
"buffer",
"=",
"CharBuffer",
... | Ensure the buffer's capacity is large enough to hold a given number
of elements. If the input buffer is not large enough, a new buffer is allocated
and returned.
@param elements The required number of elements to be appended to the buffer.
@param buffer
The buffer to check or <code>null</code> if a new buffer should ... | [
"Ensure",
"the",
"buffer",
"s",
"capacity",
"is",
"large",
"enough",
"to",
"hold",
"a",
"given",
"number",
"of",
"elements",
".",
"If",
"the",
"input",
"buffer",
"is",
"not",
"large",
"enough",
"a",
"new",
"buffer",
"is",
"allocated",
"and",
"returned",
... | train | https://github.com/morfologik/morfologik-stemming/blob/9d9099cc5ec4155a0eb8dfecdc23d01cbd734f6e/morfologik-stemming/src/main/java/morfologik/stemming/BufferUtils.java#L56-L63 |
VoltDB/voltdb | src/frontend/org/voltdb/sysprocs/LoadSinglepartitionTable.java | LoadSinglepartitionTable.partitionValueFromInvocation | public static Object partitionValueFromInvocation(Table catTable, VoltTable table) throws Exception {
"""
Note: I (JHH) can't figure out what uses this code. It may be dead.
Called by the client interface to partition this invocation based on parameters.
@param tables The set of active tables in the catalog.... | java | public static Object partitionValueFromInvocation(Table catTable, VoltTable table) throws Exception {
if (catTable.getIsreplicated()) {
throw new Exception("Target table for LoadSinglepartitionTable is replicated.");
}
// check the number of columns
int colCount = catTable.g... | [
"public",
"static",
"Object",
"partitionValueFromInvocation",
"(",
"Table",
"catTable",
",",
"VoltTable",
"table",
")",
"throws",
"Exception",
"{",
"if",
"(",
"catTable",
".",
"getIsreplicated",
"(",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"Target tab... | Note: I (JHH) can't figure out what uses this code. It may be dead.
Called by the client interface to partition this invocation based on parameters.
@param tables The set of active tables in the catalog.
@param spi The stored procedure invocation object
@return An object suitable for hashing to a partition with The H... | [
"Note",
":",
"I",
"(",
"JHH",
")",
"can",
"t",
"figure",
"out",
"what",
"uses",
"this",
"code",
".",
"It",
"may",
"be",
"dead",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/LoadSinglepartitionTable.java#L238-L266 |
opendigitaleducation/web-utils | src/main/java/org/vertx/java/core/http/RouteMatcher.java | RouteMatcher.patchWithRegEx | public RouteMatcher patchWithRegEx(String regex, Handler<HttpServerRequest> handler) {
"""
Specify a handler that will be called for a matching HTTP PATCH
@param regex A regular expression
@param handler The handler to call
"""
addRegEx(regex, handler, patchBindings);
return this;
} | java | public RouteMatcher patchWithRegEx(String regex, Handler<HttpServerRequest> handler) {
addRegEx(regex, handler, patchBindings);
return this;
} | [
"public",
"RouteMatcher",
"patchWithRegEx",
"(",
"String",
"regex",
",",
"Handler",
"<",
"HttpServerRequest",
">",
"handler",
")",
"{",
"addRegEx",
"(",
"regex",
",",
"handler",
",",
"patchBindings",
")",
";",
"return",
"this",
";",
"}"
] | Specify a handler that will be called for a matching HTTP PATCH
@param regex A regular expression
@param handler The handler to call | [
"Specify",
"a",
"handler",
"that",
"will",
"be",
"called",
"for",
"a",
"matching",
"HTTP",
"PATCH"
] | train | https://github.com/opendigitaleducation/web-utils/blob/5c12f7e8781a9a0fbbe7b8d9fb741627aa97a1e3/src/main/java/org/vertx/java/core/http/RouteMatcher.java#L289-L292 |
jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplator.setVariable | public void setVariable(String variableName, String variableValue, boolean isOptional)
throws VariableNotDefinedException {
"""
Sets a template variable.
<p>
For variables that are used in blocks, the variable value must be set before <code>addBlock()</code> is called.
@param variableName the nam... | java | public void setVariable(String variableName, String variableValue, boolean isOptional)
throws VariableNotDefinedException {
int varNo = mtp.lookupVariableName(variableName);
if (varNo == -1) {
if (isOptional) {
return;
}
throw new Va... | [
"public",
"void",
"setVariable",
"(",
"String",
"variableName",
",",
"String",
"variableValue",
",",
"boolean",
"isOptional",
")",
"throws",
"VariableNotDefinedException",
"{",
"int",
"varNo",
"=",
"mtp",
".",
"lookupVariableName",
"(",
"variableName",
")",
";",
"... | Sets a template variable.
<p>
For variables that are used in blocks, the variable value must be set before <code>addBlock()</code> is called.
@param variableName the name of the variable to be set. Case-insensitive.
@param variableValue the new value of the variable. May be <code>null</code>.
@param isOptional specifi... | [
"Sets",
"a",
"template",
"variable",
".",
"<p",
">",
"For",
"variables",
"that",
"are",
"used",
"in",
"blocks",
"the",
"variable",
"value",
"must",
"be",
"set",
"before",
"<code",
">",
"addBlock",
"()",
"<",
"/",
"code",
">",
"is",
"called",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L365-L375 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/config/refresher/HttpRefresher.java | HttpRefresher.refreshAgainstNode | private Observable<ProposedBucketConfigContext> refreshAgainstNode(final String bucketName,
final NetworkAddress hostname) {
"""
Helper method to fetch a config from a specific node of the cluster.
@param bucketName the name of the bucket.
@param hostname the hostname of the node to fetch from.
@retur... | java | private Observable<ProposedBucketConfigContext> refreshAgainstNode(final String bucketName,
final NetworkAddress hostname) {
final Credential credential = registrations().get(bucketName);
if (credential == null) {
LOGGER.debug("Ignoring refresh attempt since it seems the bucket regis... | [
"private",
"Observable",
"<",
"ProposedBucketConfigContext",
">",
"refreshAgainstNode",
"(",
"final",
"String",
"bucketName",
",",
"final",
"NetworkAddress",
"hostname",
")",
"{",
"final",
"Credential",
"credential",
"=",
"registrations",
"(",
")",
".",
"get",
"(",
... | Helper method to fetch a config from a specific node of the cluster.
@param bucketName the name of the bucket.
@param hostname the hostname of the node to fetch from.
@return a raw configuration or an error. | [
"Helper",
"method",
"to",
"fetch",
"a",
"config",
"from",
"a",
"specific",
"node",
"of",
"the",
"cluster",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/config/refresher/HttpRefresher.java#L316-L358 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java | BitsUtil.cycleLeftC | public static long cycleLeftC(long v, int shift, int len) {
"""
Rotate a long to the left, cyclic with length len
@param v Bits
@param shift Shift value
@param len Length
@return cycled bit set
"""
return shift == 0 ? v : shift < 0 ? cycleRightC(v, -shift, len) : //
(((v) << (shift)) | ((v) >... | java | public static long cycleLeftC(long v, int shift, int len) {
return shift == 0 ? v : shift < 0 ? cycleRightC(v, -shift, len) : //
(((v) << (shift)) | ((v) >>> ((len) - (shift)))) & ((1 << len) - 1);
} | [
"public",
"static",
"long",
"cycleLeftC",
"(",
"long",
"v",
",",
"int",
"shift",
",",
"int",
"len",
")",
"{",
"return",
"shift",
"==",
"0",
"?",
"v",
":",
"shift",
"<",
"0",
"?",
"cycleRightC",
"(",
"v",
",",
"-",
"shift",
",",
"len",
")",
":",
... | Rotate a long to the left, cyclic with length len
@param v Bits
@param shift Shift value
@param len Length
@return cycled bit set | [
"Rotate",
"a",
"long",
"to",
"the",
"left",
"cyclic",
"with",
"length",
"len"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java#L839-L842 |
Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/meta/AbstractBlockMeta.java | AbstractBlockMeta.tempPath | public static String tempPath(StorageDir dir, long sessionId, long blockId) {
"""
All blocks are created as temp blocks before committed. They are stored in BlockStore under a
subdir of its {@link StorageDir}, the subdir is tmpFolder/sessionId % maxSubdirMax.
tmpFolder is a property of {@link PropertyKey#WORKER_... | java | public static String tempPath(StorageDir dir, long sessionId, long blockId) {
final String tmpDir = ServerConfiguration.get(PropertyKey.WORKER_DATA_TMP_FOLDER);
final int subDirMax = ServerConfiguration.getInt(PropertyKey.WORKER_DATA_TMP_SUBDIR_MAX);
return PathUtils.concatPath(dir.getDirPath(), tmpDir, se... | [
"public",
"static",
"String",
"tempPath",
"(",
"StorageDir",
"dir",
",",
"long",
"sessionId",
",",
"long",
"blockId",
")",
"{",
"final",
"String",
"tmpDir",
"=",
"ServerConfiguration",
".",
"get",
"(",
"PropertyKey",
".",
"WORKER_DATA_TMP_FOLDER",
")",
";",
"f... | All blocks are created as temp blocks before committed. They are stored in BlockStore under a
subdir of its {@link StorageDir}, the subdir is tmpFolder/sessionId % maxSubdirMax.
tmpFolder is a property of {@link PropertyKey#WORKER_DATA_TMP_FOLDER}.
maxSubdirMax is a property of {@link PropertyKey#WORKER_DATA_TMP_SUBDIR... | [
"All",
"blocks",
"are",
"created",
"as",
"temp",
"blocks",
"before",
"committed",
".",
"They",
"are",
"stored",
"in",
"BlockStore",
"under",
"a",
"subdir",
"of",
"its",
"{",
"@link",
"StorageDir",
"}",
"the",
"subdir",
"is",
"tmpFolder",
"/",
"sessionId",
... | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/meta/AbstractBlockMeta.java#L43-L49 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/utils/StringUtilities.java | StringUtilities.skipLws | private static int skipLws(byte[] buf, int start) {
"""
Skip all linear white spaces
@param buf the buf which is being scanned for lws
@param start the offset to start at
@return the next position in buf which isn't a lws character
"""
int i;
for (i = start; i < buf.length; i++) {
... | java | private static int skipLws(byte[] buf, int start) {
int i;
for (i = start; i < buf.length; i++) {
if (!isLws(buf[i])) {
return i;
}
}
return i;
} | [
"private",
"static",
"int",
"skipLws",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"start",
")",
"{",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"start",
";",
"i",
"<",
"buf",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"!",
"isLws",
"(",
... | Skip all linear white spaces
@param buf the buf which is being scanned for lws
@param start the offset to start at
@return the next position in buf which isn't a lws character | [
"Skip",
"all",
"linear",
"white",
"spaces"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/utils/StringUtilities.java#L270-L280 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/http/XMLHTTPResponseHandler.java | XMLHTTPResponseHandler.convertToObject | @Override
protected Document convertToObject(HTTPResponse httpResponse) {
"""
This function converts the HTTP response content to the specific object.
@param httpResponse
The HTTP response
@return The object
"""
//get response text
Document document=null;
String content=http... | java | @Override
protected Document convertToObject(HTTPResponse httpResponse)
{
//get response text
Document document=null;
String content=httpResponse.getContent();
if(content!=null)
{
//get response encoding
String encoding=this.getResponseDataEncoding... | [
"@",
"Override",
"protected",
"Document",
"convertToObject",
"(",
"HTTPResponse",
"httpResponse",
")",
"{",
"//get response text",
"Document",
"document",
"=",
"null",
";",
"String",
"content",
"=",
"httpResponse",
".",
"getContent",
"(",
")",
";",
"if",
"(",
"c... | This function converts the HTTP response content to the specific object.
@param httpResponse
The HTTP response
@return The object | [
"This",
"function",
"converts",
"the",
"HTTP",
"response",
"content",
"to",
"the",
"specific",
"object",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/XMLHTTPResponseHandler.java#L317-L351 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/expressions/Expressions.java | Expressions.notLike | public static NotLike notLike(Expression<String> left, Expression<String> right, char wildCardCharacter) {
"""
Creates a NotLike expression from the given expressions.
@param left The left expression.
@param right The right expression.
@param wildCardCharacter The character to use as a wildcardCharacter
@re... | java | public static NotLike notLike(Expression<String> left, Expression<String> right, char wildCardCharacter) {
return new NotLike(left, right, wildCardCharacter);
} | [
"public",
"static",
"NotLike",
"notLike",
"(",
"Expression",
"<",
"String",
">",
"left",
",",
"Expression",
"<",
"String",
">",
"right",
",",
"char",
"wildCardCharacter",
")",
"{",
"return",
"new",
"NotLike",
"(",
"left",
",",
"right",
",",
"wildCardCharacte... | Creates a NotLike expression from the given expressions.
@param left The left expression.
@param right The right expression.
@param wildCardCharacter The character to use as a wildcardCharacter
@return A NotLike expression. | [
"Creates",
"a",
"NotLike",
"expression",
"from",
"the",
"given",
"expressions",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/expressions/Expressions.java#L663-L665 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/SampleableConcurrentHashMap.java | SampleableConcurrentHashMap.fetchKeys | public int fetchKeys(int tableIndex, int size, List<K> keys) {
"""
Fetches keys from given <code>tableIndex</code> as <code>size</code>
and puts them into <code>keys</code> list.
@param tableIndex Index (checkpoint) for starting point of fetch operation
@param size Count of how many keys will be fetched... | java | public int fetchKeys(int tableIndex, int size, List<K> keys) {
final long now = Clock.currentTimeMillis();
final Segment<K, V> segment = segments[0];
final HashEntry<K, V>[] currentTable = segment.table;
int nextTableIndex;
if (tableIndex >= 0 && tableIndex < segment.table.length... | [
"public",
"int",
"fetchKeys",
"(",
"int",
"tableIndex",
",",
"int",
"size",
",",
"List",
"<",
"K",
">",
"keys",
")",
"{",
"final",
"long",
"now",
"=",
"Clock",
".",
"currentTimeMillis",
"(",
")",
";",
"final",
"Segment",
"<",
"K",
",",
"V",
">",
"s... | Fetches keys from given <code>tableIndex</code> as <code>size</code>
and puts them into <code>keys</code> list.
@param tableIndex Index (checkpoint) for starting point of fetch operation
@param size Count of how many keys will be fetched
@param keys List that fetched keys will be put into
@return the next ... | [
"Fetches",
"keys",
"from",
"given",
"<code",
">",
"tableIndex<",
"/",
"code",
">",
"as",
"<code",
">",
"size<",
"/",
"code",
">",
"and",
"puts",
"them",
"into",
"<code",
">",
"keys<",
"/",
"code",
">",
"list",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/SampleableConcurrentHashMap.java#L66-L91 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/core/Config.java | Config.getString | public String getString(String key, String defaultValue) {
"""
Retrieves a configuration value with the given key
@param key The key of the configuration value (e.g. application.name)
@param defaultValue The default value to return of no key is found
@return The configured value as String or the passed defaut... | java | public String getString(String key, String defaultValue) {
return this.props.getValueOrDefault(key, defaultValue);
} | [
"public",
"String",
"getString",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"return",
"this",
".",
"props",
".",
"getValueOrDefault",
"(",
"key",
",",
"defaultValue",
")",
";",
"}"
] | Retrieves a configuration value with the given key
@param key The key of the configuration value (e.g. application.name)
@param defaultValue The default value to return of no key is found
@return The configured value as String or the passed defautlValue if the key is not configured | [
"Retrieves",
"a",
"configuration",
"value",
"with",
"the",
"given",
"key"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/core/Config.java#L164-L166 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/ReservoirItemsSketch.java | ReservoirItemsSketch.estimateSubsetSum | public SampleSubsetSummary estimateSubsetSum(final Predicate<T> predicate) {
"""
Computes an estimated subset sum from the entire stream for objects matching a given
predicate. Provides a lower bound, estimate, and upper bound using a target of 2 standard
deviations.
<p>This is technically a heuristic method,... | java | public SampleSubsetSummary estimateSubsetSum(final Predicate<T> predicate) {
if (itemsSeen_ == 0) {
return new SampleSubsetSummary(0.0, 0.0, 0.0, 0.0);
}
final long numSamples = getNumSamples();
final double samplingRate = numSamples / (double) itemsSeen_;
assert samplingRate >= 0.0;
asse... | [
"public",
"SampleSubsetSummary",
"estimateSubsetSum",
"(",
"final",
"Predicate",
"<",
"T",
">",
"predicate",
")",
"{",
"if",
"(",
"itemsSeen_",
"==",
"0",
")",
"{",
"return",
"new",
"SampleSubsetSummary",
"(",
"0.0",
",",
"0.0",
",",
"0.0",
",",
"0.0",
")"... | Computes an estimated subset sum from the entire stream for objects matching a given
predicate. Provides a lower bound, estimate, and upper bound using a target of 2 standard
deviations.
<p>This is technically a heuristic method, and tries to err on the conservative side.</p>
@param predicate A predicate to use when ... | [
"Computes",
"an",
"estimated",
"subset",
"sum",
"from",
"the",
"entire",
"stream",
"for",
"objects",
"matching",
"a",
"given",
"predicate",
".",
"Provides",
"a",
"lower",
"bound",
"estimate",
"and",
"upper",
"bound",
"using",
"a",
"target",
"of",
"2",
"stand... | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/ReservoirItemsSketch.java#L501-L531 |
PinaeOS/nala | src/main/java/org/pinae/nala/xb/Xml.java | Xml.toXML | public static String toXML(Object object, String encoding, Properties properties) throws MarshalException {
"""
<p>将对象生成XML文本</p>
配置属性主要包括:
<ul>
<li>node: 是否使用节点模式 (true:false) </li>
<li>lowcase: 是否使用全小写 (true:false) </li>
<li>pretty: 是否格式化输出 (true:false) </li>
<li>cdata 是否支持CDATA节点 (true:false) </li>
<l... | java | public static String toXML(Object object, String encoding, Properties properties) throws MarshalException {
Marshaller marshaller = new XmlMarshaller(object);
marshaller.enableLowCase(properties.contains("lowcase") ? Boolean.parseBoolean(properties.get("lowcase").toString()) : true);
marshaller.enablePrettyPri... | [
"public",
"static",
"String",
"toXML",
"(",
"Object",
"object",
",",
"String",
"encoding",
",",
"Properties",
"properties",
")",
"throws",
"MarshalException",
"{",
"Marshaller",
"marshaller",
"=",
"new",
"XmlMarshaller",
"(",
"object",
")",
";",
"marshaller",
".... | <p>将对象生成XML文本</p>
配置属性主要包括:
<ul>
<li>node: 是否使用节点模式 (true:false) </li>
<li>lowcase: 是否使用全小写 (true:false) </li>
<li>pretty: 是否格式化输出 (true:false) </li>
<li>cdata 是否支持CDATA节点 (true:false) </li>
<li>indent 文档缩进 (默认 \t) </li>
<li>endofline 结尾换行符 (默认 \n) </li>
<li>document-start 插入文档开始部分 </li>
<li>document-end 插入文档结束部分 </l... | [
"<p",
">",
"将对象生成XML文本<",
"/",
"p",
">"
] | train | https://github.com/PinaeOS/nala/blob/2047ade4af197cec938278d300d111ea94af6fbf/src/main/java/org/pinae/nala/xb/Xml.java#L128-L146 |
oboehm/jfachwert | src/main/java/de/jfachwert/pruefung/NumberValidator.java | NumberValidator.normalize | public String normalize(String value) {
"""
Normalisiert einen String, sodass er zur Generierung einer Zahl
herangezogen werden kann.
@param value z.B. "1,234.5"
@return normalisiert, z.B. "1234.5"
"""
if (!value.matches("[\\d,.]+([eE]\\d+)?")) {
throw new InvalidValueException(value, ... | java | public String normalize(String value) {
if (!value.matches("[\\d,.]+([eE]\\d+)?")) {
throw new InvalidValueException(value, NUMBER);
}
Locale locale = guessLocale(value);
DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance(locale);
df.setParseBigDecimal(true)... | [
"public",
"String",
"normalize",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"!",
"value",
".",
"matches",
"(",
"\"[\\\\d,.]+([eE]\\\\d+)?\"",
")",
")",
"{",
"throw",
"new",
"InvalidValueException",
"(",
"value",
",",
"NUMBER",
")",
";",
"}",
"Locale",
"l... | Normalisiert einen String, sodass er zur Generierung einer Zahl
herangezogen werden kann.
@param value z.B. "1,234.5"
@return normalisiert, z.B. "1234.5" | [
"Normalisiert",
"einen",
"String",
"sodass",
"er",
"zur",
"Generierung",
"einer",
"Zahl",
"herangezogen",
"werden",
"kann",
"."
] | train | https://github.com/oboehm/jfachwert/blob/67b513d29e3114c7aee65cd1ea7a5b7e540b0d1b/src/main/java/de/jfachwert/pruefung/NumberValidator.java#L104-L116 |
bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/ScanUploader.java | ScanUploader.createNewScanFromExistingScan | private ScanStatus createNewScanFromExistingScan(String scanId, ScanOptions scanOptions, ScanStatus existingScanStatus) {
"""
Takes an existing ScanStatus and creates a new plan from it. This method validates that a plan existed for each
placement in the existing ScanStatus but otherwise recreates the plan exact... | java | private ScanStatus createNewScanFromExistingScan(String scanId, ScanOptions scanOptions, ScanStatus existingScanStatus) {
List<ScanRangeStatus> pendingScanRangeStatuses = Lists.newArrayList();
Multimap<String, ScanRangeStatus> scanRangeStatusesByPlacement = HashMultimap.create();
for (ScanRange... | [
"private",
"ScanStatus",
"createNewScanFromExistingScan",
"(",
"String",
"scanId",
",",
"ScanOptions",
"scanOptions",
",",
"ScanStatus",
"existingScanStatus",
")",
"{",
"List",
"<",
"ScanRangeStatus",
">",
"pendingScanRangeStatuses",
"=",
"Lists",
".",
"newArrayList",
"... | Takes an existing ScanStatus and creates a new plan from it. This method validates that a plan existed for each
placement in the existing ScanStatus but otherwise recreates the plan exactly as it ran. This means that any
ScanOptions related to generating the plan, such as {@link ScanOptions#getRangeScanSplitSize()} a... | [
"Takes",
"an",
"existing",
"ScanStatus",
"and",
"creates",
"a",
"new",
"plan",
"from",
"it",
".",
"This",
"method",
"validates",
"that",
"a",
"plan",
"existed",
"for",
"each",
"placement",
"in",
"the",
"existing",
"ScanStatus",
"but",
"otherwise",
"recreates",... | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/ScanUploader.java#L167-L190 |
dhemery/hartley | src/main/java/com/dhemery/expressing/Expressive.java | Expressive.waitUntil | public <S> void waitUntil(S subject, Feature<? super S, Boolean> feature) {
"""
Wait until a polled sample of the feature is {@code true}.
Uses a default ticker.
"""
waitUntil(subject, feature, eventually(), isQuietlyTrue());
} | java | public <S> void waitUntil(S subject, Feature<? super S, Boolean> feature) {
waitUntil(subject, feature, eventually(), isQuietlyTrue());
} | [
"public",
"<",
"S",
">",
"void",
"waitUntil",
"(",
"S",
"subject",
",",
"Feature",
"<",
"?",
"super",
"S",
",",
"Boolean",
">",
"feature",
")",
"{",
"waitUntil",
"(",
"subject",
",",
"feature",
",",
"eventually",
"(",
")",
",",
"isQuietlyTrue",
"(",
... | Wait until a polled sample of the feature is {@code true}.
Uses a default ticker. | [
"Wait",
"until",
"a",
"polled",
"sample",
"of",
"the",
"feature",
"is",
"{"
] | train | https://github.com/dhemery/hartley/blob/7754bd6bc12695f2249601b8890da530a61fcf33/src/main/java/com/dhemery/expressing/Expressive.java#L230-L232 |
konmik/nucleus | nucleus/src/main/java/nucleus/presenter/RxPresenter.java | RxPresenter.restartableFirst | public <T> void restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext) {
"""
This is a shortcut for calling {@link #restartableFirst(int, Func0, Action2, Action2)} with the last parameter = null.
"""
restartableFirst(restartableId, observableFac... | java | public <T> void restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext) {
restartableFirst(restartableId, observableFactory, onNext, null);
} | [
"public",
"<",
"T",
">",
"void",
"restartableFirst",
"(",
"int",
"restartableId",
",",
"final",
"Func0",
"<",
"Observable",
"<",
"T",
">",
">",
"observableFactory",
",",
"final",
"Action2",
"<",
"View",
",",
"T",
">",
"onNext",
")",
"{",
"restartableFirst"... | This is a shortcut for calling {@link #restartableFirst(int, Func0, Action2, Action2)} with the last parameter = null. | [
"This",
"is",
"a",
"shortcut",
"for",
"calling",
"{"
] | train | https://github.com/konmik/nucleus/blob/b161484a2bbf66a7896a8c1f61fa7187856ca5f7/nucleus/src/main/java/nucleus/presenter/RxPresenter.java#L147-L149 |
operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.keyDown | public void keyDown(String key, List<ModifierPressed> modifiers) {
"""
Press Key.
@param key key to press
@param modifiers modifiers held
"""
systemInputManager.keyDown(key, modifiers);
} | java | public void keyDown(String key, List<ModifierPressed> modifiers) {
systemInputManager.keyDown(key, modifiers);
} | [
"public",
"void",
"keyDown",
"(",
"String",
"key",
",",
"List",
"<",
"ModifierPressed",
">",
"modifiers",
")",
"{",
"systemInputManager",
".",
"keyDown",
"(",
"key",
",",
"modifiers",
")",
";",
"}"
] | Press Key.
@param key key to press
@param modifiers modifiers held | [
"Press",
"Key",
"."
] | train | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L620-L622 |
otto-de/edison-hal | src/main/java/de/otto/edison/hal/Links.java | Links.getLinkBy | public Optional<Link> getLinkBy(final String rel) {
"""
<p>
Returns the first (if any) link having the specified link-relation type.
</p>
<p>
If CURIs are used to shorten custom link-relation types, it is possible to either use expanded link-relation types,
or the CURI of the link-relation type. Using CURIs t... | java | public Optional<Link> getLinkBy(final String rel) {
final List<Link> links = getLinksBy(rel);
return links.isEmpty()
? Optional.empty()
: Optional.of(links.get(0));
} | [
"public",
"Optional",
"<",
"Link",
">",
"getLinkBy",
"(",
"final",
"String",
"rel",
")",
"{",
"final",
"List",
"<",
"Link",
">",
"links",
"=",
"getLinksBy",
"(",
"rel",
")",
";",
"return",
"links",
".",
"isEmpty",
"(",
")",
"?",
"Optional",
".",
"emp... | <p>
Returns the first (if any) link having the specified link-relation type.
</p>
<p>
If CURIs are used to shorten custom link-relation types, it is possible to either use expanded link-relation types,
or the CURI of the link-relation type. Using CURIs to retrieve links is not recommended, because it
requires that the ... | [
"<p",
">",
"Returns",
"the",
"first",
"(",
"if",
"any",
")",
"link",
"having",
"the",
"specified",
"link",
"-",
"relation",
"type",
".",
"<",
"/",
"p",
">",
"<p",
">",
"If",
"CURIs",
"are",
"used",
"to",
"shorten",
"custom",
"link",
"-",
"relation",
... | train | https://github.com/otto-de/edison-hal/blob/1582d2b49d1f0d9103e03bf742f18afa9d166992/src/main/java/de/otto/edison/hal/Links.java#L177-L182 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java | OjbTagsHandler.forAllCollectionDefinitions | public void forAllCollectionDefinitions(String template, Properties attributes) throws XDocletException {
"""
Processes the template for all collection definitions of the current class definition.
@param template The template
@param attributes The attributes of the tag
@exception XDocl... | java | public void forAllCollectionDefinitions(String template, Properties attributes) throws XDocletException
{
for (Iterator it = _curClassDef.getCollections(); it.hasNext(); )
{
_curCollectionDef = (CollectionDescriptorDef)it.next();
if (!isFeatureIgnored(LEVEL_COLLECTION) &... | [
"public",
"void",
"forAllCollectionDefinitions",
"(",
"String",
"template",
",",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"for",
"(",
"Iterator",
"it",
"=",
"_curClassDef",
".",
"getCollections",
"(",
")",
";",
"it",
".",
"hasNext",
"(... | Processes the template for all collection definitions of the current class definition.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException if an error occurs
@doc.tag type="block" | [
"Processes",
"the",
"template",
"for",
"all",
"collection",
"definitions",
"of",
"the",
"current",
"class",
"definition",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L1062-L1074 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/MapExtensions.java | MapExtensions.operator_minus | @Pure
public static <K, V> Map<K, V> operator_minus(Map<K, V> left, final Map<? extends K, ? extends V> right) {
"""
Replies the elements of the left map without the pairs in the right map.
If the pair's values differ from
the value within the map, the map entry is not removed.
<p>
The difference is an immu... | java | @Pure
public static <K, V> Map<K, V> operator_minus(Map<K, V> left, final Map<? extends K, ? extends V> right) {
return Maps.filterEntries(left, new Predicate<Entry<K, V>>() {
@Override
public boolean apply(Entry<K, V> input) {
final V value = right.get(input.getKey());
if (value == null) {
return... | [
"@",
"Pure",
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"operator_minus",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"left",
",",
"final",
"Map",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"right",
")... | Replies the elements of the left map without the pairs in the right map.
If the pair's values differ from
the value within the map, the map entry is not removed.
<p>
The difference is an immutable
snapshot of the state of the maps at the time this method is called. It
will never change, even if the maps change at a la... | [
"Replies",
"the",
"elements",
"of",
"the",
"left",
"map",
"without",
"the",
"pairs",
"in",
"the",
"right",
"map",
".",
"If",
"the",
"pair",
"s",
"values",
"differ",
"from",
"the",
"value",
"within",
"the",
"map",
"the",
"map",
"entry",
"is",
"not",
"re... | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/MapExtensions.java#L334-L346 |
pedrovgs/Renderers | renderers/src/main/java/com/pedrogomez/renderers/RVRendererAdapter.java | RVRendererAdapter.diffUpdate | public void diffUpdate(List<T> newList) {
"""
Provides a ready to use diff update for our adapter based on the implementation of the
standard equals method from Object.
@param newList to refresh our content
"""
if (getCollection().size() == 0) {
addAll(newList);
notifyDataSetChanged();
... | java | public void diffUpdate(List<T> newList) {
if (getCollection().size() == 0) {
addAll(newList);
notifyDataSetChanged();
} else {
DiffCallback diffCallback = new DiffCallback(collection, newList);
DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(diffCallback);
clear();
ad... | [
"public",
"void",
"diffUpdate",
"(",
"List",
"<",
"T",
">",
"newList",
")",
"{",
"if",
"(",
"getCollection",
"(",
")",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"addAll",
"(",
"newList",
")",
";",
"notifyDataSetChanged",
"(",
")",
";",
"}",
"else... | Provides a ready to use diff update for our adapter based on the implementation of the
standard equals method from Object.
@param newList to refresh our content | [
"Provides",
"a",
"ready",
"to",
"use",
"diff",
"update",
"for",
"our",
"adapter",
"based",
"on",
"the",
"implementation",
"of",
"the",
"standard",
"equals",
"method",
"from",
"Object",
"."
] | train | https://github.com/pedrovgs/Renderers/blob/7477fb6e3984468b32b59c8520b66afb765081ea/renderers/src/main/java/com/pedrogomez/renderers/RVRendererAdapter.java#L201-L212 |
jbundle/jbundle | base/message/trx/src/main/java/org/jbundle/base/message/trx/transport/soap/SOAPMessageTransport.java | SOAPMessageTransport.printSource | public void printSource(Source src, PrintStream out) {
"""
A utility method to print this source tree to the given stream.
"""
TransformerFactory tFact = TransformerFactory.newInstance();
try {
Transformer transformer = tFact.newTransformer();
Result result = new Stream... | java | public void printSource(Source src, PrintStream out)
{
TransformerFactory tFact = TransformerFactory.newInstance();
try {
Transformer transformer = tFact.newTransformer();
Result result = new StreamResult( out );
transformer.transform(src, result);
} catc... | [
"public",
"void",
"printSource",
"(",
"Source",
"src",
",",
"PrintStream",
"out",
")",
"{",
"TransformerFactory",
"tFact",
"=",
"TransformerFactory",
".",
"newInstance",
"(",
")",
";",
"try",
"{",
"Transformer",
"transformer",
"=",
"tFact",
".",
"newTransformer"... | A utility method to print this source tree to the given stream. | [
"A",
"utility",
"method",
"to",
"print",
"this",
"source",
"tree",
"to",
"the",
"given",
"stream",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/trx/src/main/java/org/jbundle/base/message/trx/transport/soap/SOAPMessageTransport.java#L393-L406 |
oboehm/jfachwert | src/main/java/de/jfachwert/pruefung/AccessValidator.java | AccessValidator.access | public static <T> T access(T[] array, int n) {
"""
Liefert das n-te Element des uebergebenen Arrays zurueck, falls ein
korrekter Index uebergaben wird
@param <T> Typ-Parameter
@param array Array, auf das zugegriffen wird
@param n Array-Index, beginnend bei 0
@return n -te Element des Arrays
"""
... | java | public static <T> T access(T[] array, int n) {
int max = array.length - 1;
if ((n < 0) || (n > max)) {
throw new InvalidValueException(n, "n", Range.between(0, max));
}
return array[n];
} | [
"public",
"static",
"<",
"T",
">",
"T",
"access",
"(",
"T",
"[",
"]",
"array",
",",
"int",
"n",
")",
"{",
"int",
"max",
"=",
"array",
".",
"length",
"-",
"1",
";",
"if",
"(",
"(",
"n",
"<",
"0",
")",
"||",
"(",
"n",
">",
"max",
")",
")",
... | Liefert das n-te Element des uebergebenen Arrays zurueck, falls ein
korrekter Index uebergaben wird
@param <T> Typ-Parameter
@param array Array, auf das zugegriffen wird
@param n Array-Index, beginnend bei 0
@return n -te Element des Arrays | [
"Liefert",
"das",
"n",
"-",
"te",
"Element",
"des",
"uebergebenen",
"Arrays",
"zurueck",
"falls",
"ein",
"korrekter",
"Index",
"uebergaben",
"wird"
] | train | https://github.com/oboehm/jfachwert/blob/67b513d29e3114c7aee65cd1ea7a5b7e540b0d1b/src/main/java/de/jfachwert/pruefung/AccessValidator.java#L46-L52 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java | Error.emptyConstructorAbsent | public static void emptyConstructorAbsent(Class<?> aClass) {
"""
Thrown if the class haven't an empty constructor.
@param aClass class to analyze
"""
throw new MalformedBeanException(MSG.INSTANCE.message(malformedBeanException1,aClass.getSimpleName()));
} | java | public static void emptyConstructorAbsent(Class<?> aClass){
throw new MalformedBeanException(MSG.INSTANCE.message(malformedBeanException1,aClass.getSimpleName()));
} | [
"public",
"static",
"void",
"emptyConstructorAbsent",
"(",
"Class",
"<",
"?",
">",
"aClass",
")",
"{",
"throw",
"new",
"MalformedBeanException",
"(",
"MSG",
".",
"INSTANCE",
".",
"message",
"(",
"malformedBeanException1",
",",
"aClass",
".",
"getSimpleName",
"("... | Thrown if the class haven't an empty constructor.
@param aClass class to analyze | [
"Thrown",
"if",
"the",
"class",
"haven",
"t",
"an",
"empty",
"constructor",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L632-L634 |
byoutline/CachedField | cachedfield/src/main/java/com/byoutline/cachedfield/internal/CachedValue.java | CachedValue.addStateListener | public synchronized void addStateListener(@Nonnull EndpointStateListener<VALUE_TYPE, ARG_TYPE> listener) throws IllegalArgumentException {
"""
Register listener that will be informed each time {@link FieldState}
changes.
@param listener
@throws IllegalArgumentException if listener is null
"""
chec... | java | public synchronized void addStateListener(@Nonnull EndpointStateListener<VALUE_TYPE, ARG_TYPE> listener) throws IllegalArgumentException {
checkListenerNonNull(listener);
fieldStateListeners.add(listener);
if (informStateListenerOnAdd) {
informStateListener(getStateAndValue(), listen... | [
"public",
"synchronized",
"void",
"addStateListener",
"(",
"@",
"Nonnull",
"EndpointStateListener",
"<",
"VALUE_TYPE",
",",
"ARG_TYPE",
">",
"listener",
")",
"throws",
"IllegalArgumentException",
"{",
"checkListenerNonNull",
"(",
"listener",
")",
";",
"fieldStateListene... | Register listener that will be informed each time {@link FieldState}
changes.
@param listener
@throws IllegalArgumentException if listener is null | [
"Register",
"listener",
"that",
"will",
"be",
"informed",
"each",
"time",
"{",
"@link",
"FieldState",
"}",
"changes",
"."
] | train | https://github.com/byoutline/CachedField/blob/73d83072cdca22d2b3f5b3d60a93b8a26d9513e6/cachedfield/src/main/java/com/byoutline/cachedfield/internal/CachedValue.java#L130-L136 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_account_accountName_migrate_destinationServiceName_destinationEmailAddress_GET | public ArrayList<String> domain_account_accountName_migrate_destinationServiceName_destinationEmailAddress_GET(String domain, String accountName, String destinationServiceName, Long quota) throws IOException {
"""
List of email address available for migration
REST: GET /email/domain/{domain}/account/{accountNam... | java | public ArrayList<String> domain_account_accountName_migrate_destinationServiceName_destinationEmailAddress_GET(String domain, String accountName, String destinationServiceName, Long quota) throws IOException {
String qPath = "/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEma... | [
"public",
"ArrayList",
"<",
"String",
">",
"domain_account_accountName_migrate_destinationServiceName_destinationEmailAddress_GET",
"(",
"String",
"domain",
",",
"String",
"accountName",
",",
"String",
"destinationServiceName",
",",
"Long",
"quota",
")",
"throws",
"IOExceptio... | List of email address available for migration
REST: GET /email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress
@param quota [required] Account maximum size
@param domain [required] Name of your domain name
@param accountName [required] Name of account
@param destinationSe... | [
"List",
"of",
"email",
"address",
"available",
"for",
"migration"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L467-L473 |
tomdcc/sham | sham-core/src/main/java/org/shamdata/Sham.java | Sham.setSeed | public void setSeed(long seedVal) {
"""
Sets the random seem value for Sham's internal random number generator. Since
{@link java.util.Random java.util.Random} does not allow us to set this directly
(the {@link Random#setSeed(long) Random.setSeed()} and {@link Random#Random(long) new Random(seed)} calls don't se... | java | public void setSeed(long seedVal) {
try {
Field f = Random.class.getDeclaredField("seed"); //NoSuchFieldException
f.setAccessible(true);
AtomicLong seed = (AtomicLong) f.get(random);
seed.set(seedVal);
} catch(NoSuchFieldException e) {
throw new RuntimeException("Couldn't access seed field - perhaps ... | [
"public",
"void",
"setSeed",
"(",
"long",
"seedVal",
")",
"{",
"try",
"{",
"Field",
"f",
"=",
"Random",
".",
"class",
".",
"getDeclaredField",
"(",
"\"seed\"",
")",
";",
"//NoSuchFieldException",
"f",
".",
"setAccessible",
"(",
"true",
")",
";",
"AtomicLon... | Sets the random seem value for Sham's internal random number generator. Since
{@link java.util.Random java.util.Random} does not allow us to set this directly
(the {@link Random#setSeed(long) Random.setSeed()} and {@link Random#Random(long) new Random(seed)} calls don't set it directly,
the seed gets mutated first), we... | [
"Sets",
"the",
"random",
"seem",
"value",
"for",
"Sham",
"s",
"internal",
"random",
"number",
"generator",
".",
"Since",
"{",
"@link",
"java",
".",
"util",
".",
"Random",
"java",
".",
"util",
".",
"Random",
"}",
"does",
"not",
"allow",
"us",
"to",
"set... | train | https://github.com/tomdcc/sham/blob/33ede5e7130888736d6c84368e16a56e9e31e033/sham-core/src/main/java/org/shamdata/Sham.java#L322-L335 |
facebookarchive/hadoop-20 | src/contrib/benchmark/src/java/org/apache/hadoop/mapred/GenWriterThread.java | GenWriterThread.prepare | @Override
public GenThread[] prepare(JobConf conf, Text key, Text value)
throws IOException {
"""
Create a number of threads to generate write traffics
@param conf
@param key name of the mapper
@param value location of data input
@return
@throws IOException
"""
this.rtc = new GenWriterRu... | java | @Override
public GenThread[] prepare(JobConf conf, Text key, Text value)
throws IOException {
this.rtc = new GenWriterRunTimeConstants();
super.prepare(conf, key, value, rtc);
rtc.task_name = key.toString() + rtc.taskID;
rtc.roll_interval = conf.getLong(WRITER_ROLL_INTERVAL_KEY,
... | [
"@",
"Override",
"public",
"GenThread",
"[",
"]",
"prepare",
"(",
"JobConf",
"conf",
",",
"Text",
"key",
",",
"Text",
"value",
")",
"throws",
"IOException",
"{",
"this",
".",
"rtc",
"=",
"new",
"GenWriterRunTimeConstants",
"(",
")",
";",
"super",
".",
"p... | Create a number of threads to generate write traffics
@param conf
@param key name of the mapper
@param value location of data input
@return
@throws IOException | [
"Create",
"a",
"number",
"of",
"threads",
"to",
"generate",
"write",
"traffics"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/benchmark/src/java/org/apache/hadoop/mapred/GenWriterThread.java#L298-L319 |
buschmais/jqa-core-framework | report/src/main/java/com/buschmais/jqassistant/core/report/api/LanguageHelper.java | LanguageHelper.getLanguageElement | public static LanguageElement getLanguageElement(CompositeObject descriptor) {
"""
Return the {@link LanguageElement} associated with a {@link CompositeObject}.
The method uses a breadth-first-search to identify a descriptor type annotated with {@link LanguageElement}.
@param descriptor
The descriptor.
@re... | java | public static LanguageElement getLanguageElement(CompositeObject descriptor) {
Queue<Class<?>> queue = new LinkedList<>();
Class<?>[] descriptorTypes = descriptor.getClass().getInterfaces();
do {
queue.addAll(Arrays.asList(descriptorTypes));
Class<?> descriptorType = queu... | [
"public",
"static",
"LanguageElement",
"getLanguageElement",
"(",
"CompositeObject",
"descriptor",
")",
"{",
"Queue",
"<",
"Class",
"<",
"?",
">",
">",
"queue",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"Class",
"<",
"?",
">",
"[",
"]",
"descriptorTyp... | Return the {@link LanguageElement} associated with a {@link CompositeObject}.
The method uses a breadth-first-search to identify a descriptor type annotated with {@link LanguageElement}.
@param descriptor
The descriptor.
@return The resolved {@link LanguageElement} | [
"Return",
"the",
"{",
"@link",
"LanguageElement",
"}",
"associated",
"with",
"a",
"{",
"@link",
"CompositeObject",
"}",
"."
] | train | https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/report/src/main/java/com/buschmais/jqassistant/core/report/api/LanguageHelper.java#L26-L41 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/MenuFlyoutExample.java | MenuFlyoutExample.addMenuItem | private void addMenuItem(final WComponent parent, final String text,
final WText selectedMenuText) {
"""
Adds an example menu item with the given text and an example action to the a parent component.
@param parent the component to add the menu item to.
@param text the text to display on the menu item.
@par... | java | private void addMenuItem(final WComponent parent, final String text,
final WText selectedMenuText) {
WMenuItem menuItem = new WMenuItem(text, new ExampleMenuAction(selectedMenuText));
menuItem.setActionObject(text);
if (parent instanceof WSubMenu) {
((WSubMenu) parent).add(menuItem);
} else {
((WMenuIt... | [
"private",
"void",
"addMenuItem",
"(",
"final",
"WComponent",
"parent",
",",
"final",
"String",
"text",
",",
"final",
"WText",
"selectedMenuText",
")",
"{",
"WMenuItem",
"menuItem",
"=",
"new",
"WMenuItem",
"(",
"text",
",",
"new",
"ExampleMenuAction",
"(",
"s... | Adds an example menu item with the given text and an example action to the a parent component.
@param parent the component to add the menu item to.
@param text the text to display on the menu item.
@param selectedMenuText the WText to display the selected menu item. | [
"Adds",
"an",
"example",
"menu",
"item",
"with",
"the",
"given",
"text",
"and",
"an",
"example",
"action",
"to",
"the",
"a",
"parent",
"component",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/MenuFlyoutExample.java#L138-L147 |
aws/aws-sdk-java | aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeAccountAuditConfigurationResult.java | DescribeAccountAuditConfigurationResult.withAuditCheckConfigurations | public DescribeAccountAuditConfigurationResult withAuditCheckConfigurations(java.util.Map<String, AuditCheckConfiguration> auditCheckConfigurations) {
"""
<p>
Which audit checks are enabled and disabled for this account.
</p>
@param auditCheckConfigurations
Which audit checks are enabled and disabled for thi... | java | public DescribeAccountAuditConfigurationResult withAuditCheckConfigurations(java.util.Map<String, AuditCheckConfiguration> auditCheckConfigurations) {
setAuditCheckConfigurations(auditCheckConfigurations);
return this;
} | [
"public",
"DescribeAccountAuditConfigurationResult",
"withAuditCheckConfigurations",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AuditCheckConfiguration",
">",
"auditCheckConfigurations",
")",
"{",
"setAuditCheckConfigurations",
"(",
"auditCheckConfigurations",
... | <p>
Which audit checks are enabled and disabled for this account.
</p>
@param auditCheckConfigurations
Which audit checks are enabled and disabled for this account.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Which",
"audit",
"checks",
"are",
"enabled",
"and",
"disabled",
"for",
"this",
"account",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeAccountAuditConfigurationResult.java#L203-L206 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/XMLBuilder.java | XMLBuilder.startElement | public void startElement(String elemName, Attributes attrs) {
"""
Start a new XML element using the given name and attribute set.
"""
writeStartElement(elemName, attrs);
m_tagStack.push(elemName);
} | java | public void startElement(String elemName, Attributes attrs) {
writeStartElement(elemName, attrs);
m_tagStack.push(elemName);
} | [
"public",
"void",
"startElement",
"(",
"String",
"elemName",
",",
"Attributes",
"attrs",
")",
"{",
"writeStartElement",
"(",
"elemName",
",",
"attrs",
")",
";",
"m_tagStack",
".",
"push",
"(",
"elemName",
")",
";",
"}"
] | Start a new XML element using the given name and attribute set. | [
"Start",
"a",
"new",
"XML",
"element",
"using",
"the",
"given",
"name",
"and",
"attribute",
"set",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/XMLBuilder.java#L81-L84 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/markup/SimpleImageMediaMarkupBuilder.java | SimpleImageMediaMarkupBuilder.getSrcSetRenditions | protected @Nullable String getSrcSetRenditions(@NotNull Media media, @NotNull MediaFormat mediaFormat, long @NotNull... widths) {
"""
Generate srcset list from the resolved renditions for the ratio of the given media formats and the given widths.
Widths that have no match are ignored.
@param media Media
@param ... | java | protected @Nullable String getSrcSetRenditions(@NotNull Media media, @NotNull MediaFormat mediaFormat, long @NotNull... widths) {
StringBuilder srcset = new StringBuilder();
for (long width : widths) {
Optional<String> url = media.getRenditions().stream()
.filter(rendition -> Ratio.matches(rend... | [
"protected",
"@",
"Nullable",
"String",
"getSrcSetRenditions",
"(",
"@",
"NotNull",
"Media",
"media",
",",
"@",
"NotNull",
"MediaFormat",
"mediaFormat",
",",
"long",
"@",
"NotNull",
".",
".",
".",
"widths",
")",
"{",
"StringBuilder",
"srcset",
"=",
"new",
"S... | Generate srcset list from the resolved renditions for the ratio of the given media formats and the given widths.
Widths that have no match are ignored.
@param media Media
@param mediaFormat Media format
@param widths widths
@return srcset String or null if no matching renditions found | [
"Generate",
"srcset",
"list",
"from",
"the",
"resolved",
"renditions",
"for",
"the",
"ratio",
"of",
"the",
"given",
"media",
"formats",
"and",
"the",
"given",
"widths",
".",
"Widths",
"that",
"have",
"no",
"match",
"are",
"ignored",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/markup/SimpleImageMediaMarkupBuilder.java#L206-L229 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/OracleHelper.java | OracleHelper.psSetBytes | @Override
public void psSetBytes(PreparedStatement pstmtImpl, int i, byte[] x) throws SQLException {
"""
- allow for special handling of Oracle prepared statement setBytes
If byte[] > 2000 bytes, use setBinaryStream
"""
int length = (x == null ? 0 : x.length);
if (tc.isDebugEnabled())
... | java | @Override
public void psSetBytes(PreparedStatement pstmtImpl, int i, byte[] x) throws SQLException {
int length = (x == null ? 0 : x.length);
if (tc.isDebugEnabled())
Tr.debug(this, tc, "psSetBytes: " + length);
if ((x != null) && (length > 2000)) {
if (tc.isDebugEna... | [
"@",
"Override",
"public",
"void",
"psSetBytes",
"(",
"PreparedStatement",
"pstmtImpl",
",",
"int",
"i",
",",
"byte",
"[",
"]",
"x",
")",
"throws",
"SQLException",
"{",
"int",
"length",
"=",
"(",
"x",
"==",
"null",
"?",
"0",
":",
"x",
".",
"length",
... | - allow for special handling of Oracle prepared statement setBytes
If byte[] > 2000 bytes, use setBinaryStream | [
"-",
"allow",
"for",
"special",
"handling",
"of",
"Oracle",
"prepared",
"statement",
"setBytes",
"If",
"byte",
"[]",
">",
"2000",
"bytes",
"use",
"setBinaryStream"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/OracleHelper.java#L724-L736 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java | Expressions.booleanPath | public static BooleanPath booleanPath(Path<?> parent, String property) {
"""
Create a new Path expression
@param parent parent path
@param property property name
@return property path
"""
return new BooleanPath(PathMetadataFactory.forProperty(parent, property));
} | java | public static BooleanPath booleanPath(Path<?> parent, String property) {
return new BooleanPath(PathMetadataFactory.forProperty(parent, property));
} | [
"public",
"static",
"BooleanPath",
"booleanPath",
"(",
"Path",
"<",
"?",
">",
"parent",
",",
"String",
"property",
")",
"{",
"return",
"new",
"BooleanPath",
"(",
"PathMetadataFactory",
".",
"forProperty",
"(",
"parent",
",",
"property",
")",
")",
";",
"}"
] | Create a new Path expression
@param parent parent path
@param property property name
@return property path | [
"Create",
"a",
"new",
"Path",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L1537-L1539 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseSdense2hyb | public static int cusparseSdense2hyb(
cusparseHandle handle,
int m,
int n,
cusparseMatDescr descrA,
Pointer A,
int lda,
Pointer nnzPerRow,
cusparseHybMat hybA,
int userEllWidth,
int partitionType) {
"""
Description: ... | java | public static int cusparseSdense2hyb(
cusparseHandle handle,
int m,
int n,
cusparseMatDescr descrA,
Pointer A,
int lda,
Pointer nnzPerRow,
cusparseHybMat hybA,
int userEllWidth,
int partitionType)
{
return c... | [
"public",
"static",
"int",
"cusparseSdense2hyb",
"(",
"cusparseHandle",
"handle",
",",
"int",
"m",
",",
"int",
"n",
",",
"cusparseMatDescr",
"descrA",
",",
"Pointer",
"A",
",",
"int",
"lda",
",",
"Pointer",
"nnzPerRow",
",",
"cusparseHybMat",
"hybA",
",",
"i... | Description: This routine converts a dense matrix to a sparse matrix
in HYB storage format. | [
"Description",
":",
"This",
"routine",
"converts",
"a",
"dense",
"matrix",
"to",
"a",
"sparse",
"matrix",
"in",
"HYB",
"storage",
"format",
"."
] | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L11807-L11820 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/ReflectionUtil.java | ReflectionUtil.getFullTemplateType | public static FullTypeInfo getFullTemplateType(Type type, int templatePosition) {
"""
Extract the full template type information from the given type's template parameter at the
given position.
@param type type to extract the full template parameter information from
@param templatePosition describing at which ... | java | public static FullTypeInfo getFullTemplateType(Type type, int templatePosition) {
if (type instanceof ParameterizedType) {
return getFullTemplateType(((ParameterizedType) type).getActualTypeArguments()[templatePosition]);
} else {
throw new IllegalArgumentException();
}
} | [
"public",
"static",
"FullTypeInfo",
"getFullTemplateType",
"(",
"Type",
"type",
",",
"int",
"templatePosition",
")",
"{",
"if",
"(",
"type",
"instanceof",
"ParameterizedType",
")",
"{",
"return",
"getFullTemplateType",
"(",
"(",
"(",
"ParameterizedType",
")",
"typ... | Extract the full template type information from the given type's template parameter at the
given position.
@param type type to extract the full template parameter information from
@param templatePosition describing at which position the template type parameter is
@return Full type information describing the template p... | [
"Extract",
"the",
"full",
"template",
"type",
"information",
"from",
"the",
"given",
"type",
"s",
"template",
"parameter",
"at",
"the",
"given",
"position",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/ReflectionUtil.java#L169-L175 |
Netflix/spectator | spectator-ext-ipc/src/main/java/com/netflix/spectator/ipc/IpcLogEntry.java | IpcLogEntry.addResponseHeader | public IpcLogEntry addResponseHeader(String name, String value) {
"""
Add a response header value. For special headers in {@link NetflixHeader} it will
automatically fill in the more specific fields based on the header values.
"""
if (serverAsg == null && name.equalsIgnoreCase(NetflixHeader.ASG.headerName... | java | public IpcLogEntry addResponseHeader(String name, String value) {
if (serverAsg == null && name.equalsIgnoreCase(NetflixHeader.ASG.headerName())) {
withServerAsg(value);
} else if (serverZone == null && name.equalsIgnoreCase(NetflixHeader.Zone.headerName())) {
withServerZone(value);
} else if (s... | [
"public",
"IpcLogEntry",
"addResponseHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"serverAsg",
"==",
"null",
"&&",
"name",
".",
"equalsIgnoreCase",
"(",
"NetflixHeader",
".",
"ASG",
".",
"headerName",
"(",
")",
")",
")",
"{"... | Add a response header value. For special headers in {@link NetflixHeader} it will
automatically fill in the more specific fields based on the header values. | [
"Add",
"a",
"response",
"header",
"value",
".",
"For",
"special",
"headers",
"in",
"{"
] | train | https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-ext-ipc/src/main/java/com/netflix/spectator/ipc/IpcLogEntry.java#L522-L535 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/support/FbBotMillMockMediator.java | FbBotMillMockMediator.sendQuickReplyPayload | public void sendQuickReplyPayload(String payload) {
"""
Sends a quickreply to all the registered bots. Used to simulate a user
interacting with buttons.
@param payload
the payload to send.
"""
MessageEnvelope envelope = new MessageEnvelope();
QuickReply quickReply = new QuickReply("Sample", payload);
... | java | public void sendQuickReplyPayload(String payload) {
MessageEnvelope envelope = new MessageEnvelope();
QuickReply quickReply = new QuickReply("Sample", payload);
ReceivedMessage message = new ReceivedMessage();
message.setQuickReply(quickReply);
envelope.setMessage(message);
envelope.setSender(new User(face... | [
"public",
"void",
"sendQuickReplyPayload",
"(",
"String",
"payload",
")",
"{",
"MessageEnvelope",
"envelope",
"=",
"new",
"MessageEnvelope",
"(",
")",
";",
"QuickReply",
"quickReply",
"=",
"new",
"QuickReply",
"(",
"\"Sample\"",
",",
"payload",
")",
";",
"Receiv... | Sends a quickreply to all the registered bots. Used to simulate a user
interacting with buttons.
@param payload
the payload to send. | [
"Sends",
"a",
"quickreply",
"to",
"all",
"the",
"registered",
"bots",
".",
"Used",
"to",
"simulate",
"a",
"user",
"interacting",
"with",
"buttons",
"."
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/support/FbBotMillMockMediator.java#L183-L196 |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/voice/VoiceClient.java | VoiceClient.modifyCall | public ModifyCallResponse modifyCall(String uuid, ModifyCallAction action) throws IOException, NexmoClientException {
"""
Modify an ongoing call.
<p>
This method modifies an ongoing call, identified by "uuid". Modifications to the call can be one of:
<ul>
<li>Terminate the call (hangup)
<li>Mute a call leg (m... | java | public ModifyCallResponse modifyCall(String uuid, ModifyCallAction action) throws IOException, NexmoClientException {
return this.modifyCall(new CallModifier(uuid, action));
} | [
"public",
"ModifyCallResponse",
"modifyCall",
"(",
"String",
"uuid",
",",
"ModifyCallAction",
"action",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"this",
".",
"modifyCall",
"(",
"new",
"CallModifier",
"(",
"uuid",
",",
"action",
")"... | Modify an ongoing call.
<p>
This method modifies an ongoing call, identified by "uuid". Modifications to the call can be one of:
<ul>
<li>Terminate the call (hangup)
<li>Mute a call leg (mute)
<li>Unmute a call leg (unmute)
<li>Earmuff a call leg (earmuff)
<li>Unearmuff a call leg (unearmuff)
</ul>
@param uuid The U... | [
"Modify",
"an",
"ongoing",
"call",
".",
"<p",
">",
"This",
"method",
"modifies",
"an",
"ongoing",
"call",
"identified",
"by",
"uuid",
".",
"Modifications",
"to",
"the",
"call",
"can",
"be",
"one",
"of",
":",
"<ul",
">",
"<li",
">",
"Terminate",
"the",
... | train | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/voice/VoiceClient.java#L155-L157 |
sniggle/simple-pgp | simple-pgp-android/src/main/java/me/sniggle/pgp/crypt/PGPMessageEncryptor.java | PGPMessageEncryptor.encryptAndSign | private void encryptAndSign(PGPSecretKey pgpSecretKey, String password, String inputDataName, InputStream inputData, OutputStream encryptedDataStream) throws PGPException, IOException {
"""
encrypts and if possible (secret key and password provided) signs the target stream
@param pgpSecretKey
the secret key
@... | java | private void encryptAndSign(PGPSecretKey pgpSecretKey, String password, String inputDataName, InputStream inputData, OutputStream encryptedDataStream) throws PGPException, IOException {
LOGGER.trace("encryptAndSign(PGPSecretKey, String, String, InputStream, OutputStream)");
LOGGER.trace("Secret Key: {}, Passwor... | [
"private",
"void",
"encryptAndSign",
"(",
"PGPSecretKey",
"pgpSecretKey",
",",
"String",
"password",
",",
"String",
"inputDataName",
",",
"InputStream",
"inputData",
",",
"OutputStream",
"encryptedDataStream",
")",
"throws",
"PGPException",
",",
"IOException",
"{",
"L... | encrypts and if possible (secret key and password provided) signs the target stream
@param pgpSecretKey
the secret key
@param password
the password for the private key
@param inputDataName
the name of the data
@param inputData
the plain input data
@param encryptedDataStream
the encrypted data stream
@throws PGPExcepti... | [
"encrypts",
"and",
"if",
"possible",
"(",
"secret",
"key",
"and",
"password",
"provided",
")",
"signs",
"the",
"target",
"stream"
] | train | https://github.com/sniggle/simple-pgp/blob/2ab83e4d370b8189f767d8e4e4c7e6020e60fbe3/simple-pgp-android/src/main/java/me/sniggle/pgp/crypt/PGPMessageEncryptor.java#L49-L99 |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/CopyToModule.java | CopyToModule.performCopytoTask | private void performCopytoTask(final Map<FileInfo, FileInfo> copyToMap) {
"""
Execute copy-to task, generate copy-to targets base on sources.
@param copyToMap target to source map of URIs relative to temporary directory
"""
for (final Map.Entry<FileInfo, FileInfo> entry : copyToMap.entrySet()) {
... | java | private void performCopytoTask(final Map<FileInfo, FileInfo> copyToMap) {
for (final Map.Entry<FileInfo, FileInfo> entry : copyToMap.entrySet()) {
final URI copytoTarget = entry.getKey().uri;
final URI copytoSource = entry.getValue().uri;
final URI srcFile = job.tempDirURI.re... | [
"private",
"void",
"performCopytoTask",
"(",
"final",
"Map",
"<",
"FileInfo",
",",
"FileInfo",
">",
"copyToMap",
")",
"{",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"FileInfo",
",",
"FileInfo",
">",
"entry",
":",
"copyToMap",
".",
"entrySet",
"(",
"... | Execute copy-to task, generate copy-to targets base on sources.
@param copyToMap target to source map of URIs relative to temporary directory | [
"Execute",
"copy",
"-",
"to",
"task",
"generate",
"copy",
"-",
"to",
"targets",
"base",
"on",
"sources",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/CopyToModule.java#L162-L188 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/aspera/transfer/AsperaTransferManager.java | AsperaTransferManager.listFiles | private void listFiles(File dir, List<File> results) {
"""
Lists files in the directory given and adds them to the result list
passed in, optionally adding subdirectories recursively.
"""
File[] found = dir.listFiles();
if ( found != null ) {
for ( File f : found ) {
... | java | private void listFiles(File dir, List<File> results) {
File[] found = dir.listFiles();
if ( found != null ) {
for ( File f : found ) {
if (f.isDirectory()) {
//do nothing
} else {
results.add(f);
}
... | [
"private",
"void",
"listFiles",
"(",
"File",
"dir",
",",
"List",
"<",
"File",
">",
"results",
")",
"{",
"File",
"[",
"]",
"found",
"=",
"dir",
".",
"listFiles",
"(",
")",
";",
"if",
"(",
"found",
"!=",
"null",
")",
"{",
"for",
"(",
"File",
"f",
... | Lists files in the directory given and adds them to the result list
passed in, optionally adding subdirectories recursively. | [
"Lists",
"files",
"in",
"the",
"directory",
"given",
"and",
"adds",
"them",
"to",
"the",
"result",
"list",
"passed",
"in",
"optionally",
"adding",
"subdirectories",
"recursively",
"."
] | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/aspera/transfer/AsperaTransferManager.java#L551-L562 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.