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 |
|---|---|---|---|---|---|---|---|---|---|---|
apiman/apiman | common/util/src/main/java/io/apiman/common/util/ReflectionUtils.java | ReflectionUtils.findSetter | public static Method findSetter(Class<?> onClass, Class<?> targetClass) {
"""
Squishy way to find a setter method.
@param onClass, targetClass
"""
Method[] methods = onClass.getMethods();
for (Method method : methods) {
Class<?>[] ptypes = method.getParameterTypes();
if... | java | public static Method findSetter(Class<?> onClass, Class<?> targetClass) {
Method[] methods = onClass.getMethods();
for (Method method : methods) {
Class<?>[] ptypes = method.getParameterTypes();
if (method.getName().startsWith("set") && ptypes.length == 1 && ptypes[0] == targetCl... | [
"public",
"static",
"Method",
"findSetter",
"(",
"Class",
"<",
"?",
">",
"onClass",
",",
"Class",
"<",
"?",
">",
"targetClass",
")",
"{",
"Method",
"[",
"]",
"methods",
"=",
"onClass",
".",
"getMethods",
"(",
")",
";",
"for",
"(",
"Method",
"method",
... | Squishy way to find a setter method.
@param onClass, targetClass | [
"Squishy",
"way",
"to",
"find",
"a",
"setter",
"method",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/util/src/main/java/io/apiman/common/util/ReflectionUtils.java#L73-L82 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/gremlin/optimizer/ExpandOrsOptimization.java | ExpandOrsOptimization.expandOrs | private List<GroovyExpression> expandOrs(GroovyExpression expr, OptimizationContext context) {
"""
Recursively traverses the given expression, expanding or expressions
wherever they are found.
@param expr
@param context
@return expressions that should be unioned together to get the query result
"""
... | java | private List<GroovyExpression> expandOrs(GroovyExpression expr, OptimizationContext context) {
if (GremlinQueryOptimizer.isOrExpression(expr)) {
return expandOrFunction(expr, context);
}
return processOtherExpression(expr, context);
} | [
"private",
"List",
"<",
"GroovyExpression",
">",
"expandOrs",
"(",
"GroovyExpression",
"expr",
",",
"OptimizationContext",
"context",
")",
"{",
"if",
"(",
"GremlinQueryOptimizer",
".",
"isOrExpression",
"(",
"expr",
")",
")",
"{",
"return",
"expandOrFunction",
"("... | Recursively traverses the given expression, expanding or expressions
wherever they are found.
@param expr
@param context
@return expressions that should be unioned together to get the query result | [
"Recursively",
"traverses",
"the",
"given",
"expression",
"expanding",
"or",
"expressions",
"wherever",
"they",
"are",
"found",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/gremlin/optimizer/ExpandOrsOptimization.java#L350-L356 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/ws/BatchStatusValidator.java | BatchStatusValidator.validateStatusAtInstanceRestart | public static void validateStatusAtInstanceRestart(long jobInstanceId, Properties restartJobParameters) throws JobRestartException, JobExecutionAlreadyCompleteException {
"""
validates job is restart-able,
validates the jobInstance is in failed or stopped
"""
IPersistenceManagerService iPers = Servic... | java | public static void validateStatusAtInstanceRestart(long jobInstanceId, Properties restartJobParameters) throws JobRestartException, JobExecutionAlreadyCompleteException {
IPersistenceManagerService iPers = ServicesManagerStaticAnchor.getServicesManager().getPersistenceManagerService();
WSJobInstance jo... | [
"public",
"static",
"void",
"validateStatusAtInstanceRestart",
"(",
"long",
"jobInstanceId",
",",
"Properties",
"restartJobParameters",
")",
"throws",
"JobRestartException",
",",
"JobExecutionAlreadyCompleteException",
"{",
"IPersistenceManagerService",
"iPers",
"=",
"ServicesM... | validates job is restart-able,
validates the jobInstance is in failed or stopped | [
"validates",
"job",
"is",
"restart",
"-",
"able",
"validates",
"the",
"jobInstance",
"is",
"in",
"failed",
"or",
"stopped"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/ws/BatchStatusValidator.java#L48-L58 |
BlueBrain/bluima | modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/cleanup/HyphenRemover.java | HyphenRemover.dehyphenate | public static String dehyphenate(String text, String docId) {
"""
Removes ligatures, multiple spaces and hypens from a text file
"""
return dehyphenate(new LineNumberReader(new StringReader(text)), docId);
} | java | public static String dehyphenate(String text, String docId) {
return dehyphenate(new LineNumberReader(new StringReader(text)), docId);
} | [
"public",
"static",
"String",
"dehyphenate",
"(",
"String",
"text",
",",
"String",
"docId",
")",
"{",
"return",
"dehyphenate",
"(",
"new",
"LineNumberReader",
"(",
"new",
"StringReader",
"(",
"text",
")",
")",
",",
"docId",
")",
";",
"}"
] | Removes ligatures, multiple spaces and hypens from a text file | [
"Removes",
"ligatures",
"multiple",
"spaces",
"and",
"hypens",
"from",
"a",
"text",
"file"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/cleanup/HyphenRemover.java#L152-L154 |
kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/widget/file/FileTypeFilter.java | FileTypeFilter.addRule | public void addRule (String description, String... extensions) {
"""
Adds new rule to {@link FileTypeFilter}
@param description rule description used in FileChooser's file type select box
@param extensions list of extensions without leading dot, eg. 'jpg', 'png' etc.
"""
rules.add(new Rule(description, ext... | java | public void addRule (String description, String... extensions) {
rules.add(new Rule(description, extensions));
} | [
"public",
"void",
"addRule",
"(",
"String",
"description",
",",
"String",
"...",
"extensions",
")",
"{",
"rules",
".",
"add",
"(",
"new",
"Rule",
"(",
"description",
",",
"extensions",
")",
")",
";",
"}"
] | Adds new rule to {@link FileTypeFilter}
@param description rule description used in FileChooser's file type select box
@param extensions list of extensions without leading dot, eg. 'jpg', 'png' etc. | [
"Adds",
"new",
"rule",
"to",
"{"
] | train | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/widget/file/FileTypeFilter.java#L57-L59 |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/helpers/InstantSearch.java | InstantSearch.registerSearchView | @SuppressWarnings( {
"""
Registers the Search Widget of an Activity's Menu to trigger search requests on text change, replacing the current one if any.
@param activity The searchable Activity, see {@link android.app.SearchableInfo}.
@param menu The Menu that contains a search item.
@param id The ide... | java | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public void registerSearchView(@NonNull final Activity activity, @NonNull Menu menu, int id) {
searchMenu = menu;
searchMenuId = id;
final SearchViewFacade actionView = new SearchViewFacade(menu, id);
registerSearchVi... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"void",
"registerSearchView",
"(",
"@",
"NonNull",
"final",
"Activity",
"activity",
",",
"@",
"NonNull",
"Menu",
"menu",
",",
"int",
"id",
")",
... | Registers the Search Widget of an Activity's Menu to trigger search requests on text change, replacing the current one if any.
@param activity The searchable Activity, see {@link android.app.SearchableInfo}.
@param menu The Menu that contains a search item.
@param id The identifier of the menu's search item. | [
"Registers",
"the",
"Search",
"Widget",
"of",
"an",
"Activity",
"s",
"Menu",
"to",
"trigger",
"search",
"requests",
"on",
"text",
"change",
"replacing",
"the",
"current",
"one",
"if",
"any",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/helpers/InstantSearch.java#L189-L195 |
sirthias/parboiled | parboiled-core/src/main/java/org/parboiled/common/StringUtils.java | StringUtils.startsWith | public static boolean startsWith(String string, String prefix) {
"""
Test whether a string starts with a given prefix, handling null values without exceptions.
StringUtils.startsWith(null, null) = false
StringUtils.startsWith(null, "abc") = false
StringUtils.startsWith("abc", null) = true
StringUtils.sta... | java | public static boolean startsWith(String string, String prefix) {
return string != null && (prefix == null || string.startsWith(prefix));
} | [
"public",
"static",
"boolean",
"startsWith",
"(",
"String",
"string",
",",
"String",
"prefix",
")",
"{",
"return",
"string",
"!=",
"null",
"&&",
"(",
"prefix",
"==",
"null",
"||",
"string",
".",
"startsWith",
"(",
"prefix",
")",
")",
";",
"}"
] | Test whether a string starts with a given prefix, handling null values without exceptions.
StringUtils.startsWith(null, null) = false
StringUtils.startsWith(null, "abc") = false
StringUtils.startsWith("abc", null) = true
StringUtils.startsWith("abc", "ab") = true
StringUtils.startsWith("abc", "abc") = true
@para... | [
"Test",
"whether",
"a",
"string",
"starts",
"with",
"a",
"given",
"prefix",
"handling",
"null",
"values",
"without",
"exceptions",
"."
] | train | https://github.com/sirthias/parboiled/blob/84f3ed43e3e171b4c6ab5e6ca6297d264a9d686a/parboiled-core/src/main/java/org/parboiled/common/StringUtils.java#L306-L308 |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/depdcy/AbstractExcelWriter.java | AbstractExcelWriter.putBooleanMapping | public void putBooleanMapping(String property, Object trueValue, Object falseValue) {
"""
用于向boolean映射集合中添加映射值
@param property 属性名
@param trueValue 当此属性为true时的值
@param falseValue 当此属性为false时的值
@see #booleanMapping
"""
Map<String, Object> mapping = new HashMap<>(2);
mapping.put(TRUE, tr... | java | public void putBooleanMapping(String property, Object trueValue, Object falseValue) {
Map<String, Object> mapping = new HashMap<>(2);
mapping.put(TRUE, trueValue);
mapping.put(FALSE, falseValue);
this.getBooleanMapping().put(property, mapping);
} | [
"public",
"void",
"putBooleanMapping",
"(",
"String",
"property",
",",
"Object",
"trueValue",
",",
"Object",
"falseValue",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"mapping",
"=",
"new",
"HashMap",
"<>",
"(",
"2",
")",
";",
"mapping",
".",
"pu... | 用于向boolean映射集合中添加映射值
@param property 属性名
@param trueValue 当此属性为true时的值
@param falseValue 当此属性为false时的值
@see #booleanMapping | [
"用于向boolean映射集合中添加映射值"
] | train | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/depdcy/AbstractExcelWriter.java#L375-L380 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/io/ReaderSource.java | ReaderSource.setInputOffsets | public void setInputOffsets(int proc, int row, int rowStart) {
"""
Method called to change the default offsets this source has. Generally
done when the underlying Reader had been partially read earlier (like
reading the xml declaration before starting real parsing).
"""
mInputProcessed = proc;
... | java | public void setInputOffsets(int proc, int row, int rowStart)
{
mInputProcessed = proc;
mInputRow = row;
mInputRowStart = rowStart;
} | [
"public",
"void",
"setInputOffsets",
"(",
"int",
"proc",
",",
"int",
"row",
",",
"int",
"rowStart",
")",
"{",
"mInputProcessed",
"=",
"proc",
";",
"mInputRow",
"=",
"row",
";",
"mInputRowStart",
"=",
"rowStart",
";",
"}"
] | Method called to change the default offsets this source has. Generally
done when the underlying Reader had been partially read earlier (like
reading the xml declaration before starting real parsing). | [
"Method",
"called",
"to",
"change",
"the",
"default",
"offsets",
"this",
"source",
"has",
".",
"Generally",
"done",
"when",
"the",
"underlying",
"Reader",
"had",
"been",
"partially",
"read",
"earlier",
"(",
"like",
"reading",
"the",
"xml",
"declaration",
"befo... | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/io/ReaderSource.java#L51-L56 |
wildfly/wildfly-build-tools | provisioning/src/main/java/org/wildfly/build/provisioning/model/ServerProvisioningFeaturePack.java | ServerProvisioningFeaturePack.getConfigOverride | private static ConfigOverride getConfigOverride(FeaturePack featurePack, ServerProvisioningDescription.FeaturePack featurePackProvisioningDescription, ArtifactFileResolver artifactFileResolver) throws IOException, XMLStreamException {
"""
Retrieves the {@link org.wildfly.build.common.model.ConfigOverride} to use w... | java | private static ConfigOverride getConfigOverride(FeaturePack featurePack, ServerProvisioningDescription.FeaturePack featurePackProvisioningDescription, ArtifactFileResolver artifactFileResolver) throws IOException, XMLStreamException {
ConfigOverride configOverride = featurePackProvisioningDescription.getConfigO... | [
"private",
"static",
"ConfigOverride",
"getConfigOverride",
"(",
"FeaturePack",
"featurePack",
",",
"ServerProvisioningDescription",
".",
"FeaturePack",
"featurePackProvisioningDescription",
",",
"ArtifactFileResolver",
"artifactFileResolver",
")",
"throws",
"IOException",
",",
... | Retrieves the {@link org.wildfly.build.common.model.ConfigOverride} to use when provisioning the feature pack.
If the description includes high level subsystems filtering, instead of config override, this method will create a {@link org.wildfly.build.common.model.ConfigOverride}, containing a {@link org.wildfly.build.... | [
"Retrieves",
"the",
"{",
"@link",
"org",
".",
"wildfly",
".",
"build",
".",
"common",
".",
"model",
".",
"ConfigOverride",
"}",
"to",
"use",
"when",
"provisioning",
"the",
"feature",
"pack",
"."
] | train | https://github.com/wildfly/wildfly-build-tools/blob/520a5f2e58e6a24097d63fd65c51a8fc29847a61/provisioning/src/main/java/org/wildfly/build/provisioning/model/ServerProvisioningFeaturePack.java#L210-L239 |
LMAX-Exchange/disruptor | src/main/java/com/lmax/disruptor/RingBuffer.java | RingBuffer.createMultiProducer | public static <E> RingBuffer<E> createMultiProducer(
EventFactory<E> factory,
int bufferSize,
WaitStrategy waitStrategy) {
"""
Create a new multiple producer RingBuffer with the specified wait strategy.
@param <E> Class of the event stored in the ring buffer.
@param factory used to... | java | public static <E> RingBuffer<E> createMultiProducer(
EventFactory<E> factory,
int bufferSize,
WaitStrategy waitStrategy)
{
MultiProducerSequencer sequencer = new MultiProducerSequencer(bufferSize, waitStrategy);
return new RingBuffer<E>(factory, sequencer);
} | [
"public",
"static",
"<",
"E",
">",
"RingBuffer",
"<",
"E",
">",
"createMultiProducer",
"(",
"EventFactory",
"<",
"E",
">",
"factory",
",",
"int",
"bufferSize",
",",
"WaitStrategy",
"waitStrategy",
")",
"{",
"MultiProducerSequencer",
"sequencer",
"=",
"new",
"M... | Create a new multiple producer RingBuffer with the specified wait strategy.
@param <E> Class of the event stored in the ring buffer.
@param factory used to create the events within the ring buffer.
@param bufferSize number of elements to create within the ring buffer.
@param waitStrategy used to determine how t... | [
"Create",
"a",
"new",
"multiple",
"producer",
"RingBuffer",
"with",
"the",
"specified",
"wait",
"strategy",
"."
] | train | https://github.com/LMAX-Exchange/disruptor/blob/4266d00c5250190313446fdd7c8aa7a4edb5c818/src/main/java/com/lmax/disruptor/RingBuffer.java#L133-L141 |
asciidoctor/asciidoclet | src/main/java/org/asciidoctor/Asciidoclet.java | Asciidoclet.validOptions | @SuppressWarnings("UnusedDeclaration")
public static boolean validOptions(String[][] options, DocErrorReporter errorReporter) {
"""
Processes the input options by delegating to the standard handler.
_Javadoc spec requirement._
@param options input option array
@param errorReporter error handling
@retur... | java | @SuppressWarnings("UnusedDeclaration")
public static boolean validOptions(String[][] options, DocErrorReporter errorReporter) {
return validOptions(options, errorReporter, new StandardAdapter());
} | [
"@",
"SuppressWarnings",
"(",
"\"UnusedDeclaration\"",
")",
"public",
"static",
"boolean",
"validOptions",
"(",
"String",
"[",
"]",
"[",
"]",
"options",
",",
"DocErrorReporter",
"errorReporter",
")",
"{",
"return",
"validOptions",
"(",
"options",
",",
"errorReport... | Processes the input options by delegating to the standard handler.
_Javadoc spec requirement._
@param options input option array
@param errorReporter error handling
@return success | [
"Processes",
"the",
"input",
"options",
"by",
"delegating",
"to",
"the",
"standard",
"handler",
"."
] | train | https://github.com/asciidoctor/asciidoclet/blob/6c43ce214e48797d2b5e8d59c31b65304279717b/src/main/java/org/asciidoctor/Asciidoclet.java#L254-L257 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updateCustomPrebuiltEntityRoleWithServiceResponseAsync | public Observable<ServiceResponse<OperationStatus>> updateCustomPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdateCustomPrebuiltEntityRoleOptionalParameter updateCustomPrebuiltEntityRoleOptionalParameter) {
"""
Update an entity role for a given entity.
@p... | java | public Observable<ServiceResponse<OperationStatus>> updateCustomPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdateCustomPrebuiltEntityRoleOptionalParameter updateCustomPrebuiltEntityRoleOptionalParameter) {
if (this.client.endpoint() == null) {
... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"OperationStatus",
">",
">",
"updateCustomPrebuiltEntityRoleWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
",",
"UpdateCustomPrebuiltEntityRo... | Update an entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role ID.
@param updateCustomPrebuiltEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws I... | [
"Update",
"an",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L13714-L13733 |
Red5/red5-io | src/main/java/org/red5/io/matroska/ParserUtils.java | ParserUtils.parseString | public static String parseString(InputStream inputStream, final int size) throws IOException {
"""
method used to parse string
@param inputStream
- stream to get value
@param size
- size of the value in bytes
@return - parsed value as {@link String}
@throws IOException
- in case of IO error
"""
... | java | public static String parseString(InputStream inputStream, final int size) throws IOException {
if (0 == size) {
return "";
}
byte[] buffer = new byte[size];
int numberOfReadsBytes = inputStream.read(buffer, 0, size);
assert numberOfReadsBytes == size;
return... | [
"public",
"static",
"String",
"parseString",
"(",
"InputStream",
"inputStream",
",",
"final",
"int",
"size",
")",
"throws",
"IOException",
"{",
"if",
"(",
"0",
"==",
"size",
")",
"{",
"return",
"\"\"",
";",
"}",
"byte",
"[",
"]",
"buffer",
"=",
"new",
... | method used to parse string
@param inputStream
- stream to get value
@param size
- size of the value in bytes
@return - parsed value as {@link String}
@throws IOException
- in case of IO error | [
"method",
"used",
"to",
"parse",
"string"
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/matroska/ParserUtils.java#L77-L87 |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java | RESTClient.sendAndReceive | private RESTResponse sendAndReceive(String header, byte[] body) throws IOException {
"""
we reconnect and retry up to MAX_SOCKET_RETRIES before giving up.
"""
// Fail before trying if socket has been closed.
if (isClosed()) {
throw new IOException("Socket has been closed");
... | java | private RESTResponse sendAndReceive(String header, byte[] body) throws IOException {
// Fail before trying if socket has been closed.
if (isClosed()) {
throw new IOException("Socket has been closed");
}
Exception lastException = null;
for (int attempt ... | [
"private",
"RESTResponse",
"sendAndReceive",
"(",
"String",
"header",
",",
"byte",
"[",
"]",
"body",
")",
"throws",
"IOException",
"{",
"// Fail before trying if socket has been closed.\r",
"if",
"(",
"isClosed",
"(",
")",
")",
"{",
"throw",
"new",
"IOException",
... | we reconnect and retry up to MAX_SOCKET_RETRIES before giving up. | [
"we",
"reconnect",
"and",
"retry",
"up",
"to",
"MAX_SOCKET_RETRIES",
"before",
"giving",
"up",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java#L407-L429 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/ReferenceField.java | ReferenceField.syncReference | public void syncReference(Record record) {
"""
Synchronize this refernce field with this record.
Adds the behaviors to sync this field and the record.
Used for popup screenfields where the referencerecord has a detail to display on change.
@param record The reference record to synchronize.
"""
this.... | java | public void syncReference(Record record)
{
this.setReferenceRecord(record);
BaseField recordKeyField = (BaseField)record.getCounterField();
if ((recordKeyField.isNull()) && (!this.isNull())
&& (!record.isModified())
&& (record.getEditMode() != DBConstants.EDIT_CUR... | [
"public",
"void",
"syncReference",
"(",
"Record",
"record",
")",
"{",
"this",
".",
"setReferenceRecord",
"(",
"record",
")",
";",
"BaseField",
"recordKeyField",
"=",
"(",
"BaseField",
")",
"record",
".",
"getCounterField",
"(",
")",
";",
"if",
"(",
"(",
"r... | Synchronize this refernce field with this record.
Adds the behaviors to sync this field and the record.
Used for popup screenfields where the referencerecord has a detail to display on change.
@param record The reference record to synchronize. | [
"Synchronize",
"this",
"refernce",
"field",
"with",
"this",
"record",
".",
"Adds",
"the",
"behaviors",
"to",
"sync",
"this",
"field",
"and",
"the",
"record",
".",
"Used",
"for",
"popup",
"screenfields",
"where",
"the",
"referencerecord",
"has",
"a",
"detail",
... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/ReferenceField.java#L214-L242 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java | DefaultFeatureForm.setValue | @Api
public void setValue(String name, ShortAttribute attribute) {
"""
Apply a short attribute value on the form, with the given name.
@param name attribute name
@param attribute attribute value
@since 1.11.1
"""
FormItem item = formWidget.getField(name);
if (item != null) {
item.setValue(attribut... | java | @Api
public void setValue(String name, ShortAttribute attribute) {
FormItem item = formWidget.getField(name);
if (item != null) {
item.setValue(attribute.getValue());
}
} | [
"@",
"Api",
"public",
"void",
"setValue",
"(",
"String",
"name",
",",
"ShortAttribute",
"attribute",
")",
"{",
"FormItem",
"item",
"=",
"formWidget",
".",
"getField",
"(",
"name",
")",
";",
"if",
"(",
"item",
"!=",
"null",
")",
"{",
"item",
".",
"setVa... | Apply a short attribute value on the form, with the given name.
@param name attribute name
@param attribute attribute value
@since 1.11.1 | [
"Apply",
"a",
"short",
"attribute",
"value",
"on",
"the",
"form",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java#L497-L503 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.getObject | public JSONObject getObject(String objectID, List<String> attributesToRetrieve) throws AlgoliaException {
"""
Get an object from this index
@param objectID the unique identifier of the object to retrieve
@param attributesToRetrieve contains the list of attributes to retrieve.
"""
return thi... | java | public JSONObject getObject(String objectID, List<String> attributesToRetrieve) throws AlgoliaException {
return this.getObject(objectID, attributesToRetrieve, RequestOptions.empty);
} | [
"public",
"JSONObject",
"getObject",
"(",
"String",
"objectID",
",",
"List",
"<",
"String",
">",
"attributesToRetrieve",
")",
"throws",
"AlgoliaException",
"{",
"return",
"this",
".",
"getObject",
"(",
"objectID",
",",
"attributesToRetrieve",
",",
"RequestOptions",
... | Get an object from this index
@param objectID the unique identifier of the object to retrieve
@param attributesToRetrieve contains the list of attributes to retrieve. | [
"Get",
"an",
"object",
"from",
"this",
"index"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L256-L258 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/tagging/disambiguation/MultiWordChunker2.java | MultiWordChunker2.formatPosTag | protected String formatPosTag(String posTag, int position, int multiwordLength) {
"""
Override this method if you want format POS tag differently
@param posTag POS tag for the multiword
@param position Position of the token in the multiword
@return Returns formatted POS tag for the multiword
"""
return ... | java | protected String formatPosTag(String posTag, int position, int multiwordLength) {
return tagFormat != null ? String.format(tagFormat, posTag) : posTag;
} | [
"protected",
"String",
"formatPosTag",
"(",
"String",
"posTag",
",",
"int",
"position",
",",
"int",
"multiwordLength",
")",
"{",
"return",
"tagFormat",
"!=",
"null",
"?",
"String",
".",
"format",
"(",
"tagFormat",
",",
"posTag",
")",
":",
"posTag",
";",
"}... | Override this method if you want format POS tag differently
@param posTag POS tag for the multiword
@param position Position of the token in the multiword
@return Returns formatted POS tag for the multiword | [
"Override",
"this",
"method",
"if",
"you",
"want",
"format",
"POS",
"tag",
"differently"
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/tagging/disambiguation/MultiWordChunker2.java#L89-L91 |
infinispan/infinispan | core/src/main/java/org/infinispan/configuration/parsing/ParseUtils.java | ParseUtils.unexpectedAttribute | public static XMLStreamException unexpectedAttribute(final XMLStreamReader reader, final String name) {
"""
Get an exception reporting an unexpected XML attribute.
@param reader the stream reader
@param name the attribute name
@return the exception
"""
return new XMLStreamException("Unexpected attri... | java | public static XMLStreamException unexpectedAttribute(final XMLStreamReader reader, final String name) {
return new XMLStreamException("Unexpected attribute '" + name + "' encountered",
reader.getLocation());
} | [
"public",
"static",
"XMLStreamException",
"unexpectedAttribute",
"(",
"final",
"XMLStreamReader",
"reader",
",",
"final",
"String",
"name",
")",
"{",
"return",
"new",
"XMLStreamException",
"(",
"\"Unexpected attribute '\"",
"+",
"name",
"+",
"\"' encountered\"",
",",
... | Get an exception reporting an unexpected XML attribute.
@param reader the stream reader
@param name the attribute name
@return the exception | [
"Get",
"an",
"exception",
"reporting",
"an",
"unexpected",
"XML",
"attribute",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/configuration/parsing/ParseUtils.java#L66-L69 |
JoeKerouac/utils | src/main/java/com/joe/utils/reflect/ClassUtils.java | ClassUtils.loadClass | @SuppressWarnings("unchecked")
public static <T> Class<T> loadClass(String className, ClassLoader loader) {
"""
使用指定ClassLoader加载class
@param className class名字
@param loader 加载class的ClassLoader
@param <T> class实际类型
@return class
"""
Assert.notNull(className, "className不能为null");
... | java | @SuppressWarnings("unchecked")
public static <T> Class<T> loadClass(String className, ClassLoader loader) {
Assert.notNull(className, "className不能为null");
Assert.notNull(loader, "loader不能为null");
switch (className) {
case "boolean":
return (Class<T>) boolean.class... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Class",
"<",
"T",
">",
"loadClass",
"(",
"String",
"className",
",",
"ClassLoader",
"loader",
")",
"{",
"Assert",
".",
"notNull",
"(",
"className",
",",
"\"className不能为nu... | 使用指定ClassLoader加载class
@param className class名字
@param loader 加载class的ClassLoader
@param <T> class实际类型
@return class | [
"使用指定ClassLoader加载class"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/reflect/ClassUtils.java#L78-L106 |
apereo/cas | core/cas-server-core-configuration-api/src/main/java/org/apereo/cas/configuration/loader/ConfigurationPropertiesLoaderFactory.java | ConfigurationPropertiesLoaderFactory.getLoader | public BaseConfigurationPropertiesLoader getLoader(final Resource resource,
final String name) {
"""
Gets loader.
@param resource the resource
@param name the name
@return the loader
"""
val filename = StringUtils.defaultString(resource.ge... | java | public BaseConfigurationPropertiesLoader getLoader(final Resource resource,
final String name) {
val filename = StringUtils.defaultString(resource.getFilename()).toLowerCase();
if (filename.endsWith(".properties")) {
return new SimpleCo... | [
"public",
"BaseConfigurationPropertiesLoader",
"getLoader",
"(",
"final",
"Resource",
"resource",
",",
"final",
"String",
"name",
")",
"{",
"val",
"filename",
"=",
"StringUtils",
".",
"defaultString",
"(",
"resource",
".",
"getFilename",
"(",
")",
")",
".",
"toL... | Gets loader.
@param resource the resource
@param name the name
@return the loader | [
"Gets",
"loader",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-configuration-api/src/main/java/org/apereo/cas/configuration/loader/ConfigurationPropertiesLoaderFactory.java#L37-L52 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/UniversalTimeScale.java | UniversalTimeScale.toBigDecimalTrunc | @Deprecated
public static BigDecimal toBigDecimalTrunc(BigDecimal universalTime, int timeScale) {
"""
Convert a time in the Universal Time Scale into another time
scale. The division used to do the conversion rounds down.
NOTE: This is an internal routine used by the tool that
generates the to and from li... | java | @Deprecated
public static BigDecimal toBigDecimalTrunc(BigDecimal universalTime, int timeScale)
{
TimeScaleData data = getTimeScaleData(timeScale);
BigDecimal units = new BigDecimal(data.units);
BigDecimal epochOffset = new BigDecimal(data.epochOffset);
return universalT... | [
"@",
"Deprecated",
"public",
"static",
"BigDecimal",
"toBigDecimalTrunc",
"(",
"BigDecimal",
"universalTime",
",",
"int",
"timeScale",
")",
"{",
"TimeScaleData",
"data",
"=",
"getTimeScaleData",
"(",
"timeScale",
")",
";",
"BigDecimal",
"units",
"=",
"new",
"BigDe... | Convert a time in the Universal Time Scale into another time
scale. The division used to do the conversion rounds down.
NOTE: This is an internal routine used by the tool that
generates the to and from limits. Use it at your own risk.
@param universalTime the time in the Universal Time scale
@param timeScale the time... | [
"Convert",
"a",
"time",
"in",
"the",
"Universal",
"Time",
"Scale",
"into",
"another",
"time",
"scale",
".",
"The",
"division",
"used",
"to",
"do",
"the",
"conversion",
"rounds",
"down",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/UniversalTimeScale.java#L598-L606 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/OPTICSXi.java | OPTICSXi.updateFilterSDASet | private static void updateFilterSDASet(double mib, List<SteepDownArea> sdaset, double ixi) {
"""
Update the mib values of SteepDownAreas, and remove obsolete areas.
@param mib Maximum in-between value
@param sdaset Set of steep down areas.
"""
Iterator<SteepDownArea> iter = sdaset.iterator();
while... | java | private static void updateFilterSDASet(double mib, List<SteepDownArea> sdaset, double ixi) {
Iterator<SteepDownArea> iter = sdaset.iterator();
while(iter.hasNext()) {
SteepDownArea sda = iter.next();
if(sda.getMaximum() * ixi <= mib) {
iter.remove();
}
else {
// Update
... | [
"private",
"static",
"void",
"updateFilterSDASet",
"(",
"double",
"mib",
",",
"List",
"<",
"SteepDownArea",
">",
"sdaset",
",",
"double",
"ixi",
")",
"{",
"Iterator",
"<",
"SteepDownArea",
">",
"iter",
"=",
"sdaset",
".",
"iterator",
"(",
")",
";",
"while"... | Update the mib values of SteepDownAreas, and remove obsolete areas.
@param mib Maximum in-between value
@param sdaset Set of steep down areas. | [
"Update",
"the",
"mib",
"values",
"of",
"SteepDownAreas",
"and",
"remove",
"obsolete",
"areas",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/OPTICSXi.java#L380-L394 |
reactor/reactor-netty | src/main/java/reactor/netty/http/client/HttpClient.java | HttpClient.mapConnect | public final HttpClient mapConnect(BiFunction<? super Mono<? extends Connection>, ? super Bootstrap, ? extends Mono<? extends Connection>> connector) {
"""
Intercept the connection lifecycle and allows to delay, transform or inject a
context.
@param connector A bi function mapping the default connection and co... | java | public final HttpClient mapConnect(BiFunction<? super Mono<? extends Connection>, ? super Bootstrap, ? extends Mono<? extends Connection>> connector) {
return new HttpClientOnConnectMap(this, connector);
} | [
"public",
"final",
"HttpClient",
"mapConnect",
"(",
"BiFunction",
"<",
"?",
"super",
"Mono",
"<",
"?",
"extends",
"Connection",
">",
",",
"?",
"super",
"Bootstrap",
",",
"?",
"extends",
"Mono",
"<",
"?",
"extends",
"Connection",
">",
">",
"connector",
")",... | Intercept the connection lifecycle and allows to delay, transform or inject a
context.
@param connector A bi function mapping the default connection and configured
bootstrap to a target connection.
@return a new {@link HttpClient} | [
"Intercept",
"the",
"connection",
"lifecycle",
"and",
"allows",
"to",
"delay",
"transform",
"or",
"inject",
"a",
"context",
"."
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/http/client/HttpClient.java#L413-L415 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/models/History.java | History.addExtraInfo | public void addExtraInfo(String key, Object value) {
"""
Add key value pair to extra info
@param key Key of new item
@param value New value to add
"""
// Turn extraInfo into map
Map<String, Object> infoMap = (HashMap<String, Object>)getMapFromJSON(extraInfo);
// Add value
in... | java | public void addExtraInfo(String key, Object value) {
// Turn extraInfo into map
Map<String, Object> infoMap = (HashMap<String, Object>)getMapFromJSON(extraInfo);
// Add value
infoMap.put(key, value);
// Turn back into string
extraInfo = getJSONFromMap(infoMap);
} | [
"public",
"void",
"addExtraInfo",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"// Turn extraInfo into map",
"Map",
"<",
"String",
",",
"Object",
">",
"infoMap",
"=",
"(",
"HashMap",
"<",
"String",
",",
"Object",
">",
")",
"getMapFromJSON",
"(",
... | Add key value pair to extra info
@param key Key of new item
@param value New value to add | [
"Add",
"key",
"value",
"pair",
"to",
"extra",
"info"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/models/History.java#L409-L417 |
asciidoctor/asciidoctor-maven-plugin | src/main/java/org/asciidoctor/maven/AsciidoctorHelper.java | AsciidoctorHelper.addAttribute | public static void addAttribute(String attribute, Object value, AttributesBuilder attributesBuilder) {
"""
Adds an attribute into a {@link AttributesBuilder} taking care of Maven's XML parsing special cases like
toggles toggles, nulls, etc.
@param attribute Asciidoctor attribute name
@param value ... | java | public static void addAttribute(String attribute, Object value, AttributesBuilder attributesBuilder) {
// NOTE Maven interprets an empty value as null, so we need to explicitly convert it to empty string (see #36)
// NOTE In Asciidoctor, an empty string represents a true value
if (value == null ... | [
"public",
"static",
"void",
"addAttribute",
"(",
"String",
"attribute",
",",
"Object",
"value",
",",
"AttributesBuilder",
"attributesBuilder",
")",
"{",
"// NOTE Maven interprets an empty value as null, so we need to explicitly convert it to empty string (see #36)",
"// NOTE In Ascii... | Adds an attribute into a {@link AttributesBuilder} taking care of Maven's XML parsing special cases like
toggles toggles, nulls, etc.
@param attribute Asciidoctor attribute name
@param value Asciidoctor attribute value
@param attributesBuilder AsciidoctorJ AttributesBuilder | [
"Adds",
"an",
"attribute",
"into",
"a",
"{",
"@link",
"AttributesBuilder",
"}",
"taking",
"care",
"of",
"Maven",
"s",
"XML",
"parsing",
"special",
"cases",
"like",
"toggles",
"toggles",
"nulls",
"etc",
"."
] | train | https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/880938df1c638aaabedb3c944cd3e0ea1844109e/src/main/java/org/asciidoctor/maven/AsciidoctorHelper.java#L47-L64 |
sundrio/sundrio | codegen/src/main/java/io/sundr/codegen/processor/JavaGeneratingProcessor.java | JavaGeneratingProcessor.generateFromResources | public void generateFromResources(TypeDef model, String resourceName) throws IOException {
"""
Generates a source file from the specified {@link io.sundr.codegen.model.TypeDef}.
@param model The model of the class to generate.
@param resourceName The template to use.
@throws IOE... | java | public void generateFromResources(TypeDef model, String resourceName) throws IOException {
try {
generateFromResources(model, processingEnv
.getFiler()
.createSourceFile(model.getFullyQualifiedName()), resourceName);
} catch (FilerException e) {
... | [
"public",
"void",
"generateFromResources",
"(",
"TypeDef",
"model",
",",
"String",
"resourceName",
")",
"throws",
"IOException",
"{",
"try",
"{",
"generateFromResources",
"(",
"model",
",",
"processingEnv",
".",
"getFiler",
"(",
")",
".",
"createSourceFile",
"(",
... | Generates a source file from the specified {@link io.sundr.codegen.model.TypeDef}.
@param model The model of the class to generate.
@param resourceName The template to use.
@throws IOException If it fails to create the source file. | [
"Generates",
"a",
"source",
"file",
"from",
"the",
"specified",
"{"
] | train | https://github.com/sundrio/sundrio/blob/4e38368f4db0d950f7c41a8c75e15b0baff1f69a/codegen/src/main/java/io/sundr/codegen/processor/JavaGeneratingProcessor.java#L46-L54 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/utils/PropertyLookup.java | PropertyLookup.create | public static PropertyLookup create(final File propfile, final Map defaults, final IPropertyLookup defaultsLookup) {
"""
Calls base constructor feeding defaults from Map and IPropertyLookup params
@param propfile File containing property data
@param defaults Map of default properties
@param defaul... | java | public static PropertyLookup create(final File propfile, final Map defaults, final IPropertyLookup defaultsLookup) {
return new PropertyLookup(propfile, defaults, defaultsLookup);
} | [
"public",
"static",
"PropertyLookup",
"create",
"(",
"final",
"File",
"propfile",
",",
"final",
"Map",
"defaults",
",",
"final",
"IPropertyLookup",
"defaultsLookup",
")",
"{",
"return",
"new",
"PropertyLookup",
"(",
"propfile",
",",
"defaults",
",",
"defaultsLooku... | Calls base constructor feeding defaults from Map and IPropertyLookup params
@param propfile File containing property data
@param defaults Map of default properties
@param defaultsLookup IPropertyLookup of default properties
@return lookup | [
"Calls",
"base",
"constructor",
"feeding",
"defaults",
"from",
"Map",
"and",
"IPropertyLookup",
"params"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/utils/PropertyLookup.java#L179-L181 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/util/impl/Contracts.java | Contracts.assertStringParameterNotEmpty | public static void assertStringParameterNotEmpty(String parameter, String parameterName) {
"""
Asserts that the given {@code String} is neither {@code null} nor an empty string.
@param parameter the parameter to validate
@param parameterName the name of the parameter, will be used in the logging message in cas... | java | public static void assertStringParameterNotEmpty(String parameter, String parameterName) {
assertParameterNotNull( parameter, parameterName );
if ( parameter.length() == 0 ) {
throw log.parameterSringMustNotBeEmpty( parameterName );
}
} | [
"public",
"static",
"void",
"assertStringParameterNotEmpty",
"(",
"String",
"parameter",
",",
"String",
"parameterName",
")",
"{",
"assertParameterNotNull",
"(",
"parameter",
",",
"parameterName",
")",
";",
"if",
"(",
"parameter",
".",
"length",
"(",
")",
"==",
... | Asserts that the given {@code String} is neither {@code null} nor an empty string.
@param parameter the parameter to validate
@param parameterName the name of the parameter, will be used in the logging message in case the given object is
{@code null} or empty.
@throws IllegalArgumentException in case the given paramet... | [
"Asserts",
"that",
"the",
"given",
"{",
"@code",
"String",
"}",
"is",
"neither",
"{",
"@code",
"null",
"}",
"nor",
"an",
"empty",
"string",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/util/impl/Contracts.java#L60-L65 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java | Value.bytesArray | public static Value bytesArray(@Nullable Iterable<ByteArray> v) {
"""
Returns an {@code ARRAY<BYTES>} value.
@param v the source of element values. This may be {@code null} to produce a value for which
{@code isNull()} is {@code true}. Individual elements may also be {@code null}.
"""
return new BytesA... | java | public static Value bytesArray(@Nullable Iterable<ByteArray> v) {
return new BytesArrayImpl(v == null, v == null ? null : immutableCopyOf(v));
} | [
"public",
"static",
"Value",
"bytesArray",
"(",
"@",
"Nullable",
"Iterable",
"<",
"ByteArray",
">",
"v",
")",
"{",
"return",
"new",
"BytesArrayImpl",
"(",
"v",
"==",
"null",
",",
"v",
"==",
"null",
"?",
"null",
":",
"immutableCopyOf",
"(",
"v",
")",
")... | Returns an {@code ARRAY<BYTES>} value.
@param v the source of element values. This may be {@code null} to produce a value for which
{@code isNull()} is {@code true}. Individual elements may also be {@code null}. | [
"Returns",
"an",
"{",
"@code",
"ARRAY<BYTES",
">",
"}",
"value",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java#L302-L304 |
flow/commons | src/main/java/com/flowpowered/commons/hashing/SignedTenBitTripleHashed.java | SignedTenBitTripleHashed.positiveRightShift | public static int positiveRightShift(int key, int shift) {
"""
Shifts the given key to the right.<br> <br> This method only works for keys if all 3 sub-keys are positive
@param key the key
@param shift the right shift
"""
int single = 0x3FF >> shift;
int shiftMask = (single << 22) | (sing... | java | public static int positiveRightShift(int key, int shift) {
int single = 0x3FF >> shift;
int shiftMask = (single << 22) | (single << 11) | single;
return shiftMask & (key >> shift);
} | [
"public",
"static",
"int",
"positiveRightShift",
"(",
"int",
"key",
",",
"int",
"shift",
")",
"{",
"int",
"single",
"=",
"0x3FF",
">>",
"shift",
";",
"int",
"shiftMask",
"=",
"(",
"single",
"<<",
"22",
")",
"|",
"(",
"single",
"<<",
"11",
")",
"|",
... | Shifts the given key to the right.<br> <br> This method only works for keys if all 3 sub-keys are positive
@param key the key
@param shift the right shift | [
"Shifts",
"the",
"given",
"key",
"to",
"the",
"right",
".",
"<br",
">",
"<br",
">",
"This",
"method",
"only",
"works",
"for",
"keys",
"if",
"all",
"3",
"sub",
"-",
"keys",
"are",
"positive"
] | train | https://github.com/flow/commons/blob/0690efdac06fd728fcd7e9cf10f2b1319379c45b/src/main/java/com/flowpowered/commons/hashing/SignedTenBitTripleHashed.java#L104-L108 |
wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java | CacheUtils.isNotModified | public static boolean isNotModified(Context context, long lastModified, String etag) {
"""
Check whether the request can send a NOT_MODIFIED response.
@param context the context
@param lastModified the last modification date
@param etag the etag.
@return true if the content is modified
"""
... | java | public static boolean isNotModified(Context context, long lastModified, String etag) {
// First check etag. Important, if there is an If-None-Match header, we MUST not check the
// If-Modified-Since header, regardless of whether If-None-Match matches or not. This is in
// accordance with section... | [
"public",
"static",
"boolean",
"isNotModified",
"(",
"Context",
"context",
",",
"long",
"lastModified",
",",
"String",
"etag",
")",
"{",
"// First check etag. Important, if there is an If-None-Match header, we MUST not check the",
"// If-Modified-Since header, regardless of whether I... | Check whether the request can send a NOT_MODIFIED response.
@param context the context
@param lastModified the last modification date
@param etag the etag.
@return true if the content is modified | [
"Check",
"whether",
"the",
"request",
"can",
"send",
"a",
"NOT_MODIFIED",
"response",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java#L73-L100 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java | MutableBigInteger.divide | long divide(long v, MutableBigInteger quotient) {
"""
Internally used to calculate the quotient of this div v and places the
quotient in the provided MutableBigInteger object and the remainder is
returned.
@return the remainder of the division will be returned.
"""
if (v == 0)
throw n... | java | long divide(long v, MutableBigInteger quotient) {
if (v == 0)
throw new ArithmeticException("BigInteger divide by zero");
// Dividend is zero
if (intLen == 0) {
quotient.intLen = quotient.offset = 0;
return 0;
}
if (v < 0)
v = -v;
... | [
"long",
"divide",
"(",
"long",
"v",
",",
"MutableBigInteger",
"quotient",
")",
"{",
"if",
"(",
"v",
"==",
"0",
")",
"throw",
"new",
"ArithmeticException",
"(",
"\"BigInteger divide by zero\"",
")",
";",
"// Dividend is zero",
"if",
"(",
"intLen",
"==",
"0",
... | Internally used to calculate the quotient of this div v and places the
quotient in the provided MutableBigInteger object and the remainder is
returned.
@return the remainder of the division will be returned. | [
"Internally",
"used",
"to",
"calculate",
"the",
"quotient",
"of",
"this",
"div",
"v",
"and",
"places",
"the",
"quotient",
"in",
"the",
"provided",
"MutableBigInteger",
"object",
"and",
"the",
"remainder",
"is",
"returned",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java#L1437-L1457 |
kochedykov/jlibmodbus | src/com/intelligt/modbus/jlibmodbus/master/ModbusMaster.java | ModbusMaster.writeFileRecord | final public void writeFileRecord(int serverAddress, ModbusFileRecord record) throws
ModbusProtocolException, ModbusNumberException, ModbusIOException {
"""
This function code is used to perform a file record write. All Request Data Lengths are
provided in terms of number of bytes and all Record Lengt... | java | final public void writeFileRecord(int serverAddress, ModbusFileRecord record) throws
ModbusProtocolException, ModbusNumberException, ModbusIOException {
processRequest(ModbusRequestBuilder.getInstance().buildWriteFileRecord(serverAddress, record));
} | [
"final",
"public",
"void",
"writeFileRecord",
"(",
"int",
"serverAddress",
",",
"ModbusFileRecord",
"record",
")",
"throws",
"ModbusProtocolException",
",",
"ModbusNumberException",
",",
"ModbusIOException",
"{",
"processRequest",
"(",
"ModbusRequestBuilder",
".",
"getIns... | This function code is used to perform a file record write. All Request Data Lengths are
provided in terms of number of bytes and all Record Lengths are provided in terms of the
number of 16-bit words.
A file is an organization of records. Each file contains 10000 records, addressed 0000 to
9999 decimal or 0X0000 to 0X2... | [
"This",
"function",
"code",
"is",
"used",
"to",
"perform",
"a",
"file",
"record",
"write",
".",
"All",
"Request",
"Data",
"Lengths",
"are",
"provided",
"in",
"terms",
"of",
"number",
"of",
"bytes",
"and",
"all",
"Record",
"Lengths",
"are",
"provided",
"in"... | train | https://github.com/kochedykov/jlibmodbus/blob/197cb39e2649e61a6fe3cb7dc91a701d847e14be/src/com/intelligt/modbus/jlibmodbus/master/ModbusMaster.java#L424-L427 |
craigwblake/redline | src/main/java/org/redline_rpm/Util.java | Util.empty | public static void empty( WritableByteChannel out, ByteBuffer buffer) throws IOException {
"""
Empties the contents of the given buffer into the
writable channel provided. The buffer will be copied
to the channel in it's entirety.
@param out the channel to write to
@param buffer the buffer to write out to th... | java | public static void empty( WritableByteChannel out, ByteBuffer buffer) throws IOException {
while ( buffer.hasRemaining()) out.write( buffer);
} | [
"public",
"static",
"void",
"empty",
"(",
"WritableByteChannel",
"out",
",",
"ByteBuffer",
"buffer",
")",
"throws",
"IOException",
"{",
"while",
"(",
"buffer",
".",
"hasRemaining",
"(",
")",
")",
"out",
".",
"write",
"(",
"buffer",
")",
";",
"}"
] | Empties the contents of the given buffer into the
writable channel provided. The buffer will be copied
to the channel in it's entirety.
@param out the channel to write to
@param buffer the buffer to write out to the channel
@throws IOException if an IO error occurs | [
"Empties",
"the",
"contents",
"of",
"the",
"given",
"buffer",
"into",
"the",
"writable",
"channel",
"provided",
".",
"The",
"buffer",
"will",
"be",
"copied",
"to",
"the",
"channel",
"in",
"it",
"s",
"entirety",
"."
] | train | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Util.java#L89-L91 |
google/closure-compiler | src/com/google/javascript/jscomp/AliasStrings.java | AliasStrings.shouldReplaceWithAlias | private static boolean shouldReplaceWithAlias(String str, StringInfo info) {
"""
Dictates the policy for replacing a string with an alias.
@param str The string literal
@param info Accumulated information about a string
"""
// Optimize for code size. Are aliases smaller than strings?
//
// Thi... | java | private static boolean shouldReplaceWithAlias(String str, StringInfo info) {
// Optimize for code size. Are aliases smaller than strings?
//
// This logic optimizes for the size of uncompressed code, but it tends to
// get good results for the size of the gzipped code too.
//
// gzip actually p... | [
"private",
"static",
"boolean",
"shouldReplaceWithAlias",
"(",
"String",
"str",
",",
"StringInfo",
"info",
")",
"{",
"// Optimize for code size. Are aliases smaller than strings?",
"//",
"// This logic optimizes for the size of uncompressed code, but it tends to",
"// get good results... | Dictates the policy for replacing a string with an alias.
@param str The string literal
@param info Accumulated information about a string | [
"Dictates",
"the",
"policy",
"for",
"replacing",
"a",
"string",
"with",
"an",
"alias",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AliasStrings.java#L257-L277 |
icode/ameba | src/main/java/ameba/message/internal/BeanPathProperties.java | BeanPathProperties.put | public void put(String path, Set<String> properties) {
"""
Set the properties for a given path.
@param path path
@param properties properties set
"""
pathMap.put(path, new Props(this, null, path, properties));
} | java | public void put(String path, Set<String> properties) {
pathMap.put(path, new Props(this, null, path, properties));
} | [
"public",
"void",
"put",
"(",
"String",
"path",
",",
"Set",
"<",
"String",
">",
"properties",
")",
"{",
"pathMap",
".",
"put",
"(",
"path",
",",
"new",
"Props",
"(",
"this",
",",
"null",
",",
"path",
",",
"properties",
")",
")",
";",
"}"
] | Set the properties for a given path.
@param path path
@param properties properties set | [
"Set",
"the",
"properties",
"for",
"a",
"given",
"path",
"."
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/message/internal/BeanPathProperties.java#L130-L132 |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/net/InetAddressResolver.java | InetAddressResolver.resolveAddresses | private synchronized boolean resolveAddresses() {
"""
Returns true if anything changed from the last time this was invoked.
"""
boolean changed;
try {
InetAddress[] addresses = InetAddress.getAllByName(mHost);
if (mResolutionResults instanceof UnknownHostException) {
... | java | private synchronized boolean resolveAddresses() {
boolean changed;
try {
InetAddress[] addresses = InetAddress.getAllByName(mHost);
if (mResolutionResults instanceof UnknownHostException) {
changed = true;
}
else {
// Result... | [
"private",
"synchronized",
"boolean",
"resolveAddresses",
"(",
")",
"{",
"boolean",
"changed",
";",
"try",
"{",
"InetAddress",
"[",
"]",
"addresses",
"=",
"InetAddress",
".",
"getAllByName",
"(",
"mHost",
")",
";",
"if",
"(",
"mResolutionResults",
"instanceof",
... | Returns true if anything changed from the last time this was invoked. | [
"Returns",
"true",
"if",
"anything",
"changed",
"from",
"the",
"last",
"time",
"this",
"was",
"invoked",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/net/InetAddressResolver.java#L112-L146 |
landawn/AbacusUtil | src/com/landawn/abacus/util/CSVUtil.java | CSVUtil.exportCSV | public static long exportCSV(final Writer out, final ResultSet rs, final long offset, final long count, final boolean writeTitle, final boolean quoted)
throws UncheckedSQLException, UncheckedIOException {
"""
Exports the data from database to CVS.
@param out
@param rs
@param offset
@param count
... | java | public static long exportCSV(final Writer out, final ResultSet rs, final long offset, final long count, final boolean writeTitle, final boolean quoted)
throws UncheckedSQLException, UncheckedIOException {
return exportCSV(out, rs, null, offset, count, writeTitle, quoted);
} | [
"public",
"static",
"long",
"exportCSV",
"(",
"final",
"Writer",
"out",
",",
"final",
"ResultSet",
"rs",
",",
"final",
"long",
"offset",
",",
"final",
"long",
"count",
",",
"final",
"boolean",
"writeTitle",
",",
"final",
"boolean",
"quoted",
")",
"throws",
... | Exports the data from database to CVS.
@param out
@param rs
@param offset
@param count
@param writeTitle
@param quoted
@return | [
"Exports",
"the",
"data",
"from",
"database",
"to",
"CVS",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/CSVUtil.java#L937-L940 |
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/cache/internal/ZipFileDataStore.java | ZipFileDataStore.addLast | public ZipFileData addLast(ZipFileData newLastData, int maximumSize) {
"""
Add data as the last data of the store. If the addition pushes a cell
out of the list, answer the data of the cell which was removed.
Throw an exception if the path of the new data is already stored.
@param newLastData The new data ... | java | public ZipFileData addLast(ZipFileData newLastData, int maximumSize) {
String newLastPath = newLastData.path;
Cell dupCell = cells.get(newLastPath);
if ( dupCell != null ) {
throw new IllegalArgumentException("Path [ " + newLastPath + " ] is already stored");
}
int ... | [
"public",
"ZipFileData",
"addLast",
"(",
"ZipFileData",
"newLastData",
",",
"int",
"maximumSize",
")",
"{",
"String",
"newLastPath",
"=",
"newLastData",
".",
"path",
";",
"Cell",
"dupCell",
"=",
"cells",
".",
"get",
"(",
"newLastPath",
")",
";",
"if",
"(",
... | Add data as the last data of the store. If the addition pushes a cell
out of the list, answer the data of the cell which was removed.
Throw an exception if the path of the new data is already stored.
@param newLastData The new data to add as the last data of the store.
@param maximumSize The maximum size of the stor... | [
"Add",
"data",
"as",
"the",
"last",
"data",
"of",
"the",
"store",
".",
"If",
"the",
"addition",
"pushes",
"a",
"cell",
"out",
"of",
"the",
"list",
"answer",
"the",
"data",
"of",
"the",
"cell",
"which",
"was",
"removed",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/cache/internal/ZipFileDataStore.java#L325-L358 |
Netflix/conductor | redis-persistence/src/main/java/com/netflix/conductor/dao/dynomite/RedisExecutionDAO.java | RedisExecutionDAO.correlateTaskToWorkflowInDS | @VisibleForTesting
void correlateTaskToWorkflowInDS(String taskId, String workflowInstanceId) {
"""
Stores the correlation of a task to the workflow instance in the datastore
@param taskId the taskId to be correlated
@param workflowInstanceId the workflowId to which the tasks belongs to
"""
Str... | java | @VisibleForTesting
void correlateTaskToWorkflowInDS(String taskId, String workflowInstanceId) {
String workflowToTaskKey = nsKey(WORKFLOW_TO_TASKS, workflowInstanceId);
dynoClient.sadd(workflowToTaskKey, taskId);
logger.debug("Task mapped in WORKFLOW_TO_TASKS with workflowToTaskKey: {}, work... | [
"@",
"VisibleForTesting",
"void",
"correlateTaskToWorkflowInDS",
"(",
"String",
"taskId",
",",
"String",
"workflowInstanceId",
")",
"{",
"String",
"workflowToTaskKey",
"=",
"nsKey",
"(",
"WORKFLOW_TO_TASKS",
",",
"workflowInstanceId",
")",
";",
"dynoClient",
".",
"sad... | Stores the correlation of a task to the workflow instance in the datastore
@param taskId the taskId to be correlated
@param workflowInstanceId the workflowId to which the tasks belongs to | [
"Stores",
"the",
"correlation",
"of",
"a",
"task",
"to",
"the",
"workflow",
"instance",
"in",
"the",
"datastore"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/redis-persistence/src/main/java/com/netflix/conductor/dao/dynomite/RedisExecutionDAO.java#L534-L540 |
app55/app55-java | src/support/java/org/apache/harmony/beans/internal/nls/Messages.java | Messages.getString | static public String getString(String msg, Object arg1, Object arg2) {
"""
Retrieves a message which takes 2 arguments.
@param msg
String the key to look up.
@param arg1
Object an object to insert in the formatted output.
@param arg2
Object another object to insert in the formatted output.
@return String ... | java | static public String getString(String msg, Object arg1, Object arg2)
{
return getString(msg, new Object[] { arg1, arg2 });
} | [
"static",
"public",
"String",
"getString",
"(",
"String",
"msg",
",",
"Object",
"arg1",
",",
"Object",
"arg2",
")",
"{",
"return",
"getString",
"(",
"msg",
",",
"new",
"Object",
"[",
"]",
"{",
"arg1",
",",
"arg2",
"}",
")",
";",
"}"
] | Retrieves a message which takes 2 arguments.
@param msg
String the key to look up.
@param arg1
Object an object to insert in the formatted output.
@param arg2
Object another object to insert in the formatted output.
@return String the message for that key in the system message bundle. | [
"Retrieves",
"a",
"message",
"which",
"takes",
"2",
"arguments",
"."
] | train | https://github.com/app55/app55-java/blob/73e51d0f3141a859dfbd37ca9becef98477e553e/src/support/java/org/apache/harmony/beans/internal/nls/Messages.java#L119-L122 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientImpl.java | KeyVaultClientImpl.deleteKey | public KeyBundle deleteKey(String vaultBaseUrl, String keyName) {
"""
Deletes a key of any type from storage in Azure Key Vault. The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usab... | java | public KeyBundle deleteKey(String vaultBaseUrl, String keyName) {
return deleteKeyWithServiceResponseAsync(vaultBaseUrl, keyName).toBlocking().single().body();
} | [
"public",
"KeyBundle",
"deleteKey",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
")",
"{",
"return",
"deleteKeyWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"keyName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
"... | Deletes a key of any type from storage in Azure Key Vault. The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. Authorizatio... | [
"Deletes",
"a",
"key",
"of",
"any",
"type",
"from",
"storage",
"in",
"Azure",
"Key",
"Vault",
".",
"The",
"delete",
"key",
"operation",
"cannot",
"be",
"used",
"to",
"remove",
"individual",
"versions",
"of",
"a",
"key",
".",
"This",
"operation",
"removes",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientImpl.java#L836-L838 |
calrissian/mango | mango-core/src/main/java/org/calrissian/mango/collect/FluentCloseableIterable.java | FluentCloseableIterable.transform | public final <E> FluentCloseableIterable<E> transform(Function<? super T, ? extends E> function) {
"""
Returns a fluent iterable that applies {@code function} to each element of this
fluent iterable.
<p>The returned fluent iterable's iterator supports {@code remove()} if this iterable's
iterator does. After a... | java | public final <E> FluentCloseableIterable<E> transform(Function<? super T, ? extends E> function) {
return from(CloseableIterables.transform(this, function));
} | [
"public",
"final",
"<",
"E",
">",
"FluentCloseableIterable",
"<",
"E",
">",
"transform",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"E",
">",
"function",
")",
"{",
"return",
"from",
"(",
"CloseableIterables",
".",
"transform",
"(",
"th... | Returns a fluent iterable that applies {@code function} to each element of this
fluent iterable.
<p>The returned fluent iterable's iterator supports {@code remove()} if this iterable's
iterator does. After a successful {@code remove()} call, this fluent iterable no longer
contains the corresponding element. | [
"Returns",
"a",
"fluent",
"iterable",
"that",
"applies",
"{",
"@code",
"function",
"}",
"to",
"each",
"element",
"of",
"this",
"fluent",
"iterable",
"."
] | train | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/collect/FluentCloseableIterable.java#L188-L190 |
code4everything/util | src/main/java/com/zhazhapan/util/BeanUtils.java | BeanUtils.deserialize | public static <T> T deserialize(String file, Class<T> clazz) throws IOException, ClassNotFoundException {
"""
反序列化对象
@param file 对象文件
@param clazz 类
@param <T> 类型
@return 反序列化后的对象
@throws IOException 异常
@throws ClassNotFoundException 异常
@since 1.0.8
"""
return TypeUtils.castToJavaBean(dese... | java | public static <T> T deserialize(String file, Class<T> clazz) throws IOException, ClassNotFoundException {
return TypeUtils.castToJavaBean(deserialize(file), clazz);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"deserialize",
"(",
"String",
"file",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"return",
"TypeUtils",
".",
"castToJavaBean",
"(",
"deserialize",
"(",
"file... | 反序列化对象
@param file 对象文件
@param clazz 类
@param <T> 类型
@return 反序列化后的对象
@throws IOException 异常
@throws ClassNotFoundException 异常
@since 1.0.8 | [
"反序列化对象"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/BeanUtils.java#L138-L140 |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/insight/AdvancedInsightRequest.java | AdvancedInsightRequest.withNumberAndCountry | public static AdvancedInsightRequest withNumberAndCountry(String number, String country) {
"""
Construct a AdvancedInsightRequest with a number and country.
@param number A single phone number that you need insight about in national or international format.
@param country If a number does not have a country c... | java | public static AdvancedInsightRequest withNumberAndCountry(String number, String country) {
return new Builder(number).country(country).build();
} | [
"public",
"static",
"AdvancedInsightRequest",
"withNumberAndCountry",
"(",
"String",
"number",
",",
"String",
"country",
")",
"{",
"return",
"new",
"Builder",
"(",
"number",
")",
".",
"country",
"(",
"country",
")",
".",
"build",
"(",
")",
";",
"}"
] | Construct a AdvancedInsightRequest with a number and country.
@param number A single phone number that you need insight about in national or international format.
@param country If a number does not have a country code or it is uncertain, set the two-character country code.
@return A new {@link AdvancedInsightReques... | [
"Construct",
"a",
"AdvancedInsightRequest",
"with",
"a",
"number",
"and",
"country",
"."
] | train | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/insight/AdvancedInsightRequest.java#L63-L65 |
progolden/vraptor-boilerplate | vraptor-boilerplate-usercontrol/src/main/java/br/com/caelum/vraptor/boilerplate/user/UserBS.java | UserBS.authenticate | public UserAccessToken authenticate(String email, String pwd, String device) {
"""
Autenticar o usuário que está efetuando login e salva na sessão de usuário.
@param email E-mail do usuário.
@param pwd Passoword do usuário.
@param device ID do dispositivo de onde a autenticação veio.
@return UserAccessToken ... | java | public UserAccessToken authenticate(String email, String pwd, String device) {
Criteria criteria = this.dao.newCriteria(User.class)
.add(Restrictions.eq("deleted", false))
.add(Restrictions.or(
Restrictions.eq("email", email),
Restrictions.eq("username", email)
))
.add(Restrictions.eq("passw... | [
"public",
"UserAccessToken",
"authenticate",
"(",
"String",
"email",
",",
"String",
"pwd",
",",
"String",
"device",
")",
"{",
"Criteria",
"criteria",
"=",
"this",
".",
"dao",
".",
"newCriteria",
"(",
"User",
".",
"class",
")",
".",
"add",
"(",
"Restriction... | Autenticar o usuário que está efetuando login e salva na sessão de usuário.
@param email E-mail do usuário.
@param pwd Passoword do usuário.
@param device ID do dispositivo de onde a autenticação veio.
@return UserAccessToken Usuário existe e tem acesso ao sistema. | [
"Autenticar",
"o",
"usuário",
"que",
"está",
"efetuando",
"login",
"e",
"salva",
"na",
"sessão",
"de",
"usuário",
"."
] | train | https://github.com/progolden/vraptor-boilerplate/blob/3edf45cc0dc5aec61b16ca326b4d72c82d1d3e07/vraptor-boilerplate-usercontrol/src/main/java/br/com/caelum/vraptor/boilerplate/user/UserBS.java#L41-L56 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/entitylists/EntityUrl.java | EntityUrl.deleteEntityUrl | public static MozuUrl deleteEntityUrl(String entityListFullName, String id) {
"""
Get Resource Url for DeleteEntity
@param entityListFullName The full name of the EntityList including namespace in name@nameSpace format
@param id Unique identifier of the customer segment to retrieve.
@return String Resource Ur... | java | public static MozuUrl deleteEntityUrl(String entityListFullName, String id)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/entitylists/{entityListFullName}/entities/{id}");
formatter.formatUrl("entityListFullName", entityListFullName);
formatter.formatUrl("id", id);
return new MozuUrl(formatte... | [
"public",
"static",
"MozuUrl",
"deleteEntityUrl",
"(",
"String",
"entityListFullName",
",",
"String",
"id",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/entitylists/{entityListFullName}/entities/{id}\"",
")",
";",
"formatter",
"... | Get Resource Url for DeleteEntity
@param entityListFullName The full name of the EntityList including namespace in name@nameSpace format
@param id Unique identifier of the customer segment to retrieve.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"DeleteEntity"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/entitylists/EntityUrl.java#L90-L96 |
facebookarchive/hadoop-20 | src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorJobTracker.java | SimulatorJobTracker.startTracker | public static SimulatorJobTracker startTracker(JobConf conf, long startTime)
throws IOException, InterruptedException {
"""
Start the SimulatorJobTracker with given configuration after
creating its own SimulatorEngine. Pretty much
used for debugging only.
@param conf :The starting configuration of the Simulat... | java | public static SimulatorJobTracker startTracker(JobConf conf, long startTime)
throws IOException, InterruptedException {
return startTracker(conf, startTime, new SimulatorEngine());
} | [
"public",
"static",
"SimulatorJobTracker",
"startTracker",
"(",
"JobConf",
"conf",
",",
"long",
"startTime",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"return",
"startTracker",
"(",
"conf",
",",
"startTime",
",",
"new",
"SimulatorEngine",
"(",
... | Start the SimulatorJobTracker with given configuration after
creating its own SimulatorEngine. Pretty much
used for debugging only.
@param conf :The starting configuration of the SimulatorJobTracker
@param startTime :The starting time of simulation
@return void
@throws IOException
@throws InterruptedException | [
"Start",
"the",
"SimulatorJobTracker",
"with",
"given",
"configuration",
"after",
"creating",
"its",
"own",
"SimulatorEngine",
".",
"Pretty",
"much",
"used",
"for",
"debugging",
"only",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorJobTracker.java#L125-L128 |
atomix/atomix | utils/src/main/java/io/atomix/utils/time/Versioned.java | Versioned.valueOrElse | public static <U> U valueOrElse(Versioned<U> versioned, U defaultValue) {
"""
Returns the value of the specified Versioned object if non-null or else returns
a default value.
@param versioned versioned object
@param defaultValue default value to return if versioned object is null
@param <U> type ... | java | public static <U> U valueOrElse(Versioned<U> versioned, U defaultValue) {
return versioned == null ? defaultValue : versioned.value();
} | [
"public",
"static",
"<",
"U",
">",
"U",
"valueOrElse",
"(",
"Versioned",
"<",
"U",
">",
"versioned",
",",
"U",
"defaultValue",
")",
"{",
"return",
"versioned",
"==",
"null",
"?",
"defaultValue",
":",
"versioned",
".",
"value",
"(",
")",
";",
"}"
] | Returns the value of the specified Versioned object if non-null or else returns
a default value.
@param versioned versioned object
@param defaultValue default value to return if versioned object is null
@param <U> type of the versioned value
@return versioned value or default value if versioned object is n... | [
"Returns",
"the",
"value",
"of",
"the",
"specified",
"Versioned",
"object",
"if",
"non",
"-",
"null",
"or",
"else",
"returns",
"a",
"default",
"value",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/utils/src/main/java/io/atomix/utils/time/Versioned.java#L114-L116 |
instacount/appengine-counter | src/main/java/io/instacount/appengine/counter/service/ShardedCounterServiceImpl.java | ShardedCounterServiceImpl.createCounterData | @VisibleForTesting
protected CounterData createCounterData(final String counterName) {
"""
Helper method to create the {@link CounterData} associated with the supplied counter information.
@param counterName
@return
@throws IllegalArgumentException If the {@code counterName} is invalid.
@throws CounterExist... | java | @VisibleForTesting
protected CounterData createCounterData(final String counterName)
{
this.counterNameValidator.validateCounterName(counterName);
final Key<CounterData> counterKey = CounterData.key(counterName);
// Perform a transactional GET to see if the counter exists. If it does, throw an exception. Othe... | [
"@",
"VisibleForTesting",
"protected",
"CounterData",
"createCounterData",
"(",
"final",
"String",
"counterName",
")",
"{",
"this",
".",
"counterNameValidator",
".",
"validateCounterName",
"(",
"counterName",
")",
";",
"final",
"Key",
"<",
"CounterData",
">",
"count... | Helper method to create the {@link CounterData} associated with the supplied counter information.
@param counterName
@return
@throws IllegalArgumentException If the {@code counterName} is invalid.
@throws CounterExistsException If the counter with {@code counterName} already exists in the Datastore. | [
"Helper",
"method",
"to",
"create",
"the",
"{",
"@link",
"CounterData",
"}",
"associated",
"with",
"the",
"supplied",
"counter",
"information",
"."
] | train | https://github.com/instacount/appengine-counter/blob/60aa86ab28f173ec1642539926b69924b8bda238/src/main/java/io/instacount/appengine/counter/service/ShardedCounterServiceImpl.java#L1210-L1237 |
Appendium/objectlabkit | utils/src/main/java/net/objectlab/kit/util/Util.java | Util.buildStackTraceString | public static String buildStackTraceString(final Throwable ex) {
"""
finds out the stack trace up to where the exception was thrown.
@return String that contains the stack trace
"""
final StringBuilder context = new StringBuilder(ex.toString());
final StringWriter sw = new StringWriter();
... | java | public static String buildStackTraceString(final Throwable ex) {
final StringBuilder context = new StringBuilder(ex.toString());
final StringWriter sw = new StringWriter();
ex.printStackTrace(new PrintWriter(sw, true));
context.append('\n');
context.append(sw.toString());
... | [
"public",
"static",
"String",
"buildStackTraceString",
"(",
"final",
"Throwable",
"ex",
")",
"{",
"final",
"StringBuilder",
"context",
"=",
"new",
"StringBuilder",
"(",
"ex",
".",
"toString",
"(",
")",
")",
";",
"final",
"StringWriter",
"sw",
"=",
"new",
"St... | finds out the stack trace up to where the exception was thrown.
@return String that contains the stack trace | [
"finds",
"out",
"the",
"stack",
"trace",
"up",
"to",
"where",
"the",
"exception",
"was",
"thrown",
"."
] | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/utils/src/main/java/net/objectlab/kit/util/Util.java#L110-L118 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java | SqlDateTimeUtils.timeToInternal | public static int timeToInternal(java.sql.Time time, TimeZone tz) {
"""
Converts the Java type used for UDF parameters of SQL TIME type
({@link java.sql.Time}) to internal representation (int).
<p>Converse of {@link #internalToTime(int)}.
"""
long ts = time.getTime() + tz.getOffset(time.getTime());
ret... | java | public static int timeToInternal(java.sql.Time time, TimeZone tz) {
long ts = time.getTime() + tz.getOffset(time.getTime());
return (int) (ts % MILLIS_PER_DAY);
} | [
"public",
"static",
"int",
"timeToInternal",
"(",
"java",
".",
"sql",
".",
"Time",
"time",
",",
"TimeZone",
"tz",
")",
"{",
"long",
"ts",
"=",
"time",
".",
"getTime",
"(",
")",
"+",
"tz",
".",
"getOffset",
"(",
"time",
".",
"getTime",
"(",
")",
")"... | Converts the Java type used for UDF parameters of SQL TIME type
({@link java.sql.Time}) to internal representation (int).
<p>Converse of {@link #internalToTime(int)}. | [
"Converts",
"the",
"Java",
"type",
"used",
"for",
"UDF",
"parameters",
"of",
"SQL",
"TIME",
"type",
"(",
"{",
"@link",
"java",
".",
"sql",
".",
"Time",
"}",
")",
"to",
"internal",
"representation",
"(",
"int",
")",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java#L197-L200 |
navnorth/LRJavaLib | src/com/navnorth/learningregistry/LRSigner.java | LRSigner.normalizeMap | private Map<String, Object> normalizeMap(Map<String, Object> doc) {
"""
Normalizes document as LRSignature Python module does
- nulls converted to string literal "null"
- booleans converted to string literals "true" or "false"
- numeric values in lists are dropped
- nested maps/JSON documents are normalized
@... | java | private Map<String, Object> normalizeMap(Map<String, Object> doc) {
final Map<String, Object> result = new LinkedHashMap<String, Object>();
for (String key : doc.keySet()) {
Object value = doc.get(key);
if (value == null) {
result.put(key, nullLiteral);
} else if (value instanceof ... | [
"private",
"Map",
"<",
"String",
",",
"Object",
">",
"normalizeMap",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"doc",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"result",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"Object",... | Normalizes document as LRSignature Python module does
- nulls converted to string literal "null"
- booleans converted to string literals "true" or "false"
- numeric values in lists are dropped
- nested maps/JSON documents are normalized
@param doc Document to normalize | [
"Normalizes",
"document",
"as",
"LRSignature",
"Python",
"module",
"does",
"-",
"nulls",
"converted",
"to",
"string",
"literal",
"null",
"-",
"booleans",
"converted",
"to",
"string",
"literals",
"true",
"or",
"false",
"-",
"numeric",
"values",
"in",
"lists",
"... | train | https://github.com/navnorth/LRJavaLib/blob/27af28b9f80d772273592414e7d0dccffaac09e1/src/com/navnorth/learningregistry/LRSigner.java#L153-L174 |
akquinet/needle | src/main/java/de/akquinet/jbosscc/needle/reflection/ReflectionUtil.java | ReflectionUtil.getFieldValue | public static Object getFieldValue(final Object object, final String fieldName) {
"""
Get the value of a given field on a given object via reflection.
@param object
-- target object of field access
@param fieldName
-- name of the field
@return -- the value of the represented field in object; primitive value... | java | public static Object getFieldValue(final Object object, final String fieldName) {
return getFieldValue(object, object.getClass(), fieldName);
} | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"final",
"Object",
"object",
",",
"final",
"String",
"fieldName",
")",
"{",
"return",
"getFieldValue",
"(",
"object",
",",
"object",
".",
"getClass",
"(",
")",
",",
"fieldName",
")",
";",
"}"
] | Get the value of a given field on a given object via reflection.
@param object
-- target object of field access
@param fieldName
-- name of the field
@return -- the value of the represented field in object; primitive values
are wrapped in an appropriate object before being returned | [
"Get",
"the",
"value",
"of",
"a",
"given",
"field",
"on",
"a",
"given",
"object",
"via",
"reflection",
"."
] | train | https://github.com/akquinet/needle/blob/8b411c521246b8212882485edc01644f9aac7e24/src/main/java/de/akquinet/jbosscc/needle/reflection/ReflectionUtil.java#L276-L278 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java | ContinuousDistributions.multinomialGaussianPdf | public static double multinomialGaussianPdf(double[] mean, double[][] covariance, double[] x) {
"""
Calculates the PDF of Multinomial Normal Distribution for a particular x.
@param mean
@param covariance
@param x The x record
@return The multinomialGaussianPdf of x
"""
Mu... | java | public static double multinomialGaussianPdf(double[] mean, double[][] covariance, double[] x) {
MultivariateNormalDistribution gaussian = new
MultivariateNormalDistribution(mean, covariance);
return gaussian.density(x);
} | [
"public",
"static",
"double",
"multinomialGaussianPdf",
"(",
"double",
"[",
"]",
"mean",
",",
"double",
"[",
"]",
"[",
"]",
"covariance",
",",
"double",
"[",
"]",
"x",
")",
"{",
"MultivariateNormalDistribution",
"gaussian",
"=",
"new",
"MultivariateNormalDistrib... | Calculates the PDF of Multinomial Normal Distribution for a particular x.
@param mean
@param covariance
@param x The x record
@return The multinomialGaussianPdf of x | [
"Calculates",
"the",
"PDF",
"of",
"Multinomial",
"Normal",
"Distribution",
"for",
"a",
"particular",
"x",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java#L658-L662 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/util/image/ImageGridViewAdapter.java | ImageGridViewAdapter.clickOn | public boolean clickOn(int index) {
"""
Click an image
@param index
@return True if handled here; False, let the caller handle it, i.e. launch 3rd party app to open attachment
"""
ImageItem item = getItem(index);
if (item == null || TextUtils.isEmpty(item.mimeType)) {
return false;
}
// For non-... | java | public boolean clickOn(int index) {
ImageItem item = getItem(index);
if (item == null || TextUtils.isEmpty(item.mimeType)) {
return false;
}
// For non-image items, the first tap will start it downloading
if (!Util.isMimeTypeImage(item.mimeType)) {
// It is being downloaded, do nothing (prevent double t... | [
"public",
"boolean",
"clickOn",
"(",
"int",
"index",
")",
"{",
"ImageItem",
"item",
"=",
"getItem",
"(",
"index",
")",
";",
"if",
"(",
"item",
"==",
"null",
"||",
"TextUtils",
".",
"isEmpty",
"(",
"item",
".",
"mimeType",
")",
")",
"{",
"return",
"fa... | Click an image
@param index
@return True if handled here; False, let the caller handle it, i.e. launch 3rd party app to open attachment | [
"Click",
"an",
"image"
] | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/util/image/ImageGridViewAdapter.java#L123-L151 |
offbynull/coroutines | instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java | GenericGenerators.returnValue | public static InsnList returnValue(Type returnType, InsnList returnValueInsnList) {
"""
Generates instructions that returns a value.
@param returnType return type of the method this generated bytecode is for
@param returnValueInsnList instructions that produce the return value (should leave it on the top of th... | java | public static InsnList returnValue(Type returnType, InsnList returnValueInsnList) {
Validate.notNull(returnType);
Validate.isTrue(returnType.getSort() != Type.METHOD);
InsnList ret = new InsnList();
ret.add(returnValueInsnList);
switch (returnType.getSort()) {
... | [
"public",
"static",
"InsnList",
"returnValue",
"(",
"Type",
"returnType",
",",
"InsnList",
"returnValueInsnList",
")",
"{",
"Validate",
".",
"notNull",
"(",
"returnType",
")",
";",
"Validate",
".",
"isTrue",
"(",
"returnType",
".",
"getSort",
"(",
")",
"!=",
... | Generates instructions that returns a value.
@param returnType return type of the method this generated bytecode is for
@param returnValueInsnList instructions that produce the return value (should leave it on the top of the stack)
@return instructions to return a value
@throws NullPointerException if any argument is ... | [
"Generates",
"instructions",
"that",
"returns",
"a",
"value",
"."
] | train | https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L1029-L1066 |
lamydev/Android-Notification | core/src/zemin/notification/NotificationViewCallback.java | NotificationViewCallback.onClickContentView | public void onClickContentView(NotificationView view, View contentView, NotificationEntry entry) {
"""
Called when the view has been clicked.
@param view
@param contentView
@param entry
@return boolean true, if handled.
"""
if (DBG) Log.v(TAG, "onClickContentView - " + entry.ID);
} | java | public void onClickContentView(NotificationView view, View contentView, NotificationEntry entry) {
if (DBG) Log.v(TAG, "onClickContentView - " + entry.ID);
} | [
"public",
"void",
"onClickContentView",
"(",
"NotificationView",
"view",
",",
"View",
"contentView",
",",
"NotificationEntry",
"entry",
")",
"{",
"if",
"(",
"DBG",
")",
"Log",
".",
"v",
"(",
"TAG",
",",
"\"onClickContentView - \"",
"+",
"entry",
".",
"ID",
"... | Called when the view has been clicked.
@param view
@param contentView
@param entry
@return boolean true, if handled. | [
"Called",
"when",
"the",
"view",
"has",
"been",
"clicked",
"."
] | train | https://github.com/lamydev/Android-Notification/blob/6d6571d2862cb6edbacf9a78125418f7d621c3f8/core/src/zemin/notification/NotificationViewCallback.java#L177-L179 |
voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.printBatchTaskLog | public static void printBatchTaskLog(int batchId, int taskId, Logger logger, String message) {
"""
Print log to the following logger ( Info level )
@param batchId
@param taskId
@param logger
@param message
"""
logger.info("[Rebalance batch/task id " + batchId + "/" + taskId + "] " + message);
... | java | public static void printBatchTaskLog(int batchId, int taskId, Logger logger, String message) {
logger.info("[Rebalance batch/task id " + batchId + "/" + taskId + "] " + message);
} | [
"public",
"static",
"void",
"printBatchTaskLog",
"(",
"int",
"batchId",
",",
"int",
"taskId",
",",
"Logger",
"logger",
",",
"String",
"message",
")",
"{",
"logger",
".",
"info",
"(",
"\"[Rebalance batch/task id \"",
"+",
"batchId",
"+",
"\"/\"",
"+",
"taskId",... | Print log to the following logger ( Info level )
@param batchId
@param taskId
@param logger
@param message | [
"Print",
"log",
"to",
"the",
"following",
"logger",
"(",
"Info",
"level",
")"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L464-L466 |
ops4j/org.ops4j.pax.wicket | service/src/main/java/org/ops4j/pax/wicket/util/proxy/LazyInitProxyFactory.java | LazyInitProxyFactory.createProxy | public static Object createProxy(final Class<?> type, final ProxyTargetLocator locator) {
"""
<p>createProxy.</p>
@param type a {@link java.lang.Class} object.
@param locator a {@link org.ops4j.pax.wicket.spi.ProxyTargetLocator} object.
@return a {@link java.lang.Object} object.
"""
if (type.isPri... | java | public static Object createProxy(final Class<?> type, final ProxyTargetLocator locator) {
if (type.isPrimitive() || BUILTINS.contains(type) || Enum.class.isAssignableFrom(type)) {
// We special-case primitives as sometimes people use these as
// SpringBeans (WICKET-603, WICKET-906). Go f... | [
"public",
"static",
"Object",
"createProxy",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"ProxyTargetLocator",
"locator",
")",
"{",
"if",
"(",
"type",
".",
"isPrimitive",
"(",
")",
"||",
"BUILTINS",
".",
"contains",
"(",
"type",
")",
"||"... | <p>createProxy.</p>
@param type a {@link java.lang.Class} object.
@param locator a {@link org.ops4j.pax.wicket.spi.ProxyTargetLocator} object.
@return a {@link java.lang.Object} object. | [
"<p",
">",
"createProxy",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ops4j/org.ops4j.pax.wicket/blob/ef7cb4bdf918e9e61ec69789b9c690567616faa9/service/src/main/java/org/ops4j/pax/wicket/util/proxy/LazyInitProxyFactory.java#L60-L106 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java | SimpleDateFormat.subFormat | protected String subFormat(char ch, int count, int beginOffset,
FieldPosition pos, DateFormatSymbols fmtData,
Calendar cal)
throws IllegalArgumentException {
"""
Formats a single field, given its pattern character. Subclasses may
override this... | java | protected String subFormat(char ch, int count, int beginOffset,
FieldPosition pos, DateFormatSymbols fmtData,
Calendar cal)
throws IllegalArgumentException
{
// Note: formatData is ignored
return subFormat(ch, count, beginOffset, ... | [
"protected",
"String",
"subFormat",
"(",
"char",
"ch",
",",
"int",
"count",
",",
"int",
"beginOffset",
",",
"FieldPosition",
"pos",
",",
"DateFormatSymbols",
"fmtData",
",",
"Calendar",
"cal",
")",
"throws",
"IllegalArgumentException",
"{",
"// Note: formatData is i... | Formats a single field, given its pattern character. Subclasses may
override this method in order to modify or add formatting
capabilities.
@param ch the pattern character
@param count the number of times ch is repeated in the pattern
@param beginOffset the offset of the output string at the start of
this field; used ... | [
"Formats",
"a",
"single",
"field",
"given",
"its",
"pattern",
"character",
".",
"Subclasses",
"may",
"override",
"this",
"method",
"in",
"order",
"to",
"modify",
"or",
"add",
"formatting",
"capabilities",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java#L1501-L1508 |
spring-projects/spring-boot | spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/ConnectionInputStream.java | ConnectionInputStream.checkedRead | public int checkedRead(byte[] buffer, int offset, int length) throws IOException {
"""
Read a number of bytes from the stream (checking that the end of the stream hasn't
been reached).
@param buffer the destination buffer
@param offset the buffer offset
@param length the length to read
@return the amount of d... | java | public int checkedRead(byte[] buffer, int offset, int length) throws IOException {
int amountRead = read(buffer, offset, length);
if (amountRead == -1) {
throw new IOException("End of stream");
}
return amountRead;
} | [
"public",
"int",
"checkedRead",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"int",
"amountRead",
"=",
"read",
"(",
"buffer",
",",
"offset",
",",
"length",
")",
";",
"if",
"(",
"amountR... | Read a number of bytes from the stream (checking that the end of the stream hasn't
been reached).
@param buffer the destination buffer
@param offset the buffer offset
@param length the length to read
@return the amount of data read
@throws IOException in case of I/O errors | [
"Read",
"a",
"number",
"of",
"bytes",
"from",
"the",
"stream",
"(",
"checking",
"that",
"the",
"end",
"of",
"the",
"stream",
"hasn",
"t",
"been",
"reached",
")",
"."
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/ConnectionInputStream.java#L94-L100 |
jmrozanec/cron-utils | src/main/java/com/cronutils/model/time/generator/OnDayOfWeekValueGenerator.java | OnDayOfWeekValueGenerator.generateNoneValues | private int generateNoneValues(final On on, final int year, final int month, final int reference) {
"""
Generate valid days of the month for the days of week expression. This method requires that you
pass it a -1 for the reference value when starting to generate a sequence of day values. That allows
it to handle... | java | private int generateNoneValues(final On on, final int year, final int month, final int reference) {
// the day of week the first of the month is on
final int dowForFirstDoM = LocalDate.of(year, month, 1).getDayOfWeek().getValue();// 1-7
// the day of week we need, normalize to jdk8time
f... | [
"private",
"int",
"generateNoneValues",
"(",
"final",
"On",
"on",
",",
"final",
"int",
"year",
",",
"final",
"int",
"month",
",",
"final",
"int",
"reference",
")",
"{",
"// the day of week the first of the month is on",
"final",
"int",
"dowForFirstDoM",
"=",
"Loca... | Generate valid days of the month for the days of week expression. This method requires that you
pass it a -1 for the reference value when starting to generate a sequence of day values. That allows
it to handle the special case of which day of the month is the initial matching value.
@param on The expression obj... | [
"Generate",
"valid",
"days",
"of",
"the",
"month",
"for",
"the",
"days",
"of",
"week",
"expression",
".",
"This",
"method",
"requires",
"that",
"you",
"pass",
"it",
"a",
"-",
"1",
"for",
"the",
"reference",
"value",
"when",
"starting",
"to",
"generate",
... | train | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/time/generator/OnDayOfWeekValueGenerator.java#L136-L161 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java | QueryParameters.updateValue | public QueryParameters updateValue(String key, Object value) {
"""
Updates value of specified key
@param key Key
@param value Value
@return this instance of QueryParameters
"""
this.values.put(processKey(key), value);
return this;
} | java | public QueryParameters updateValue(String key, Object value) {
this.values.put(processKey(key), value);
return this;
} | [
"public",
"QueryParameters",
"updateValue",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"this",
".",
"values",
".",
"put",
"(",
"processKey",
"(",
"key",
")",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Updates value of specified key
@param key Key
@param value Value
@return this instance of QueryParameters | [
"Updates",
"value",
"of",
"specified",
"key"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java#L331-L335 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AuthorityConfigurableSecurityController.java | AuthorityConfigurableSecurityController.setIdAuthorityMap | public void setIdAuthorityMap(Map<String, String> idAuthorityMap) {
"""
Each entry of the idConfigAttributeDefinitionMap contains a SecurityControllerId
together with its actionClusters. When using this SecurityController as
FallBack, this map can be used to configure commands that are
declared/used in code.
... | java | public void setIdAuthorityMap(Map<String, String> idAuthorityMap)
{
idConfigAttributeDefinitionMap = new HashMap<String, List<ConfigAttribute>>(idAuthorityMap
.size());
for (Map.Entry<String, String> entry : idAuthorityMap.entrySet())
{
idConfigAttributeDefinition... | [
"public",
"void",
"setIdAuthorityMap",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"idAuthorityMap",
")",
"{",
"idConfigAttributeDefinitionMap",
"=",
"new",
"HashMap",
"<",
"String",
",",
"List",
"<",
"ConfigAttribute",
">",
">",
"(",
"idAuthorityMap",
".",
... | Each entry of the idConfigAttributeDefinitionMap contains a SecurityControllerId
together with its actionClusters. When using this SecurityController as
FallBack, this map can be used to configure commands that are
declared/used in code.
@param idAuthorityMap | [
"Each",
"entry",
"of",
"the",
"idConfigAttributeDefinitionMap",
"contains",
"a",
"SecurityControllerId",
"together",
"with",
"its",
"actionClusters",
".",
"When",
"using",
"this",
"SecurityController",
"as",
"FallBack",
"this",
"map",
"can",
"be",
"used",
"to",
"con... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AuthorityConfigurableSecurityController.java#L85-L93 |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/MpRoSitePool.java | MpRoSitePool.doWork | boolean doWork(long txnId, TransactionTask task) {
"""
Attempt to start the transaction represented by the given task. Need the txn ID for future reference.
@return true if work was started successfully, false if not.
"""
boolean retval = canAcceptWork();
if (!retval) {
return fal... | java | boolean doWork(long txnId, TransactionTask task)
{
boolean retval = canAcceptWork();
if (!retval) {
return false;
}
MpRoSiteContext site;
// Repair case
if (m_busySites.containsKey(txnId)) {
site = m_busySites.get(txnId);
}
else... | [
"boolean",
"doWork",
"(",
"long",
"txnId",
",",
"TransactionTask",
"task",
")",
"{",
"boolean",
"retval",
"=",
"canAcceptWork",
"(",
")",
";",
"if",
"(",
"!",
"retval",
")",
"{",
"return",
"false",
";",
"}",
"MpRoSiteContext",
"site",
";",
"// Repair case"... | Attempt to start the transaction represented by the given task. Need the txn ID for future reference.
@return true if work was started successfully, false if not. | [
"Attempt",
"to",
"start",
"the",
"transaction",
"represented",
"by",
"the",
"given",
"task",
".",
"Need",
"the",
"txn",
"ID",
"for",
"future",
"reference",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/MpRoSitePool.java#L218-L245 |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java | ApkBuilder.verbosePrintln | private void verbosePrintln(String format, Object... args) {
"""
Output a given message if the verbose mode is enabled.
@param format the format string for {@link String#format(String, Object...)}
@param args the string arguments
"""
if (mVerboseStream != null) {
mVerboseStream.println(St... | java | private void verbosePrintln(String format, Object... args) {
if (mVerboseStream != null) {
mVerboseStream.println(String.format(format, args));
}
} | [
"private",
"void",
"verbosePrintln",
"(",
"String",
"format",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"mVerboseStream",
"!=",
"null",
")",
"{",
"mVerboseStream",
".",
"println",
"(",
"String",
".",
"format",
"(",
"format",
",",
"args",
")",
")... | Output a given message if the verbose mode is enabled.
@param format the format string for {@link String#format(String, Object...)}
@param args the string arguments | [
"Output",
"a",
"given",
"message",
"if",
"the",
"verbose",
"mode",
"is",
"enabled",
"."
] | train | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L862-L866 |
jbundle/osgi | obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java | ObrClassFinderService.addBootstrapRepository | public void addBootstrapRepository(RepositoryAdmin repositoryAdmin, BundleContext context) {
"""
Add the standard obr repository, so I can get the bundles that I need.
@param repositoryAdmin
@param context
"""
if (repositoryAdmin == null)
return;
String repository = context.getPro... | java | public void addBootstrapRepository(RepositoryAdmin repositoryAdmin, BundleContext context)
{
if (repositoryAdmin == null)
return;
String repository = context.getProperty("jbundle.repository.url");
if (repository != null)
if (repository.length() > 0)
this.addRep... | [
"public",
"void",
"addBootstrapRepository",
"(",
"RepositoryAdmin",
"repositoryAdmin",
",",
"BundleContext",
"context",
")",
"{",
"if",
"(",
"repositoryAdmin",
"==",
"null",
")",
"return",
";",
"String",
"repository",
"=",
"context",
".",
"getProperty",
"(",
"\"jb... | Add the standard obr repository, so I can get the bundles that I need.
@param repositoryAdmin
@param context | [
"Add",
"the",
"standard",
"obr",
"repository",
"so",
"I",
"can",
"get",
"the",
"bundles",
"that",
"I",
"need",
"."
] | train | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java#L94-L105 |
alkacon/opencms-core | src/org/opencms/xml/CmsXmlContentDefinition.java | CmsXmlContentDefinition.validateAttribute | protected static String validateAttribute(Element element, String attributeName, String requiredValue)
throws CmsXmlException {
"""
Validates if a given attribute exists at the given element with an (optional) specified value.<p>
If the required value is not <code>null</code>, the attribute must have exactl... | java | protected static String validateAttribute(Element element, String attributeName, String requiredValue)
throws CmsXmlException {
Attribute attribute = element.attribute(attributeName);
if (attribute == null) {
throw new CmsXmlException(
Messages.get().container(Messages.E... | [
"protected",
"static",
"String",
"validateAttribute",
"(",
"Element",
"element",
",",
"String",
"attributeName",
",",
"String",
"requiredValue",
")",
"throws",
"CmsXmlException",
"{",
"Attribute",
"attribute",
"=",
"element",
".",
"attribute",
"(",
"attributeName",
... | Validates if a given attribute exists at the given element with an (optional) specified value.<p>
If the required value is not <code>null</code>, the attribute must have exactly this
value set.<p>
If no value is required, some simple validation is performed on the attribute value,
like a check that the value does not... | [
"Validates",
"if",
"a",
"given",
"attribute",
"exists",
"at",
"the",
"given",
"element",
"with",
"an",
"(",
"optional",
")",
"specified",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlContentDefinition.java#L555-L583 |
google/closure-templates | java/src/com/google/template/soy/jssrc/internal/V1JsExprTranslator.java | V1JsExprTranslator.translateVar | private static String translateVar(SoyToJsVariableMappings variableMappings, Matcher matcher) {
"""
Helper function to translate a variable or data reference.
<p>Examples:
<pre>
$boo --> opt_data.boo (var ref)
</pre>
@param variableMappings The current replacement JS expressions for the local v... | java | private static String translateVar(SoyToJsVariableMappings variableMappings, Matcher matcher) {
Preconditions.checkArgument(matcher.matches());
String firstPart = matcher.group(1);
StringBuilder exprTextSb = new StringBuilder();
// ------ Translate the first key, which may be a variable or a data key ... | [
"private",
"static",
"String",
"translateVar",
"(",
"SoyToJsVariableMappings",
"variableMappings",
",",
"Matcher",
"matcher",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"matcher",
".",
"matches",
"(",
")",
")",
";",
"String",
"firstPart",
"=",
"matcher"... | Helper function to translate a variable or data reference.
<p>Examples:
<pre>
$boo --> opt_data.boo (var ref)
</pre>
@param variableMappings The current replacement JS expressions for the local variables (and
foreach-loop special functions) current in scope.
@param matcher Matcher formed from {@link V1JsExp... | [
"Helper",
"function",
"to",
"translate",
"a",
"variable",
"or",
"data",
"reference",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/internal/V1JsExprTranslator.java#L143-L160 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getPageIdsContainingTemplateFragments | public List<Integer> getPageIdsContainingTemplateFragments(List<String> templateFragments) throws WikiApiException {
"""
Returns a list containing the ids of all pages that contain a
template the name of which starts with any of the given Strings.
@param templateFragments
the beginning of the templates that h... | java | public List<Integer> getPageIdsContainingTemplateFragments(List<String> templateFragments) throws WikiApiException{
return getFragmentFilteredPageIds(templateFragments,true);
} | [
"public",
"List",
"<",
"Integer",
">",
"getPageIdsContainingTemplateFragments",
"(",
"List",
"<",
"String",
">",
"templateFragments",
")",
"throws",
"WikiApiException",
"{",
"return",
"getFragmentFilteredPageIds",
"(",
"templateFragments",
",",
"true",
")",
";",
"}"
] | Returns a list containing the ids of all pages that contain a
template the name of which starts with any of the given Strings.
@param templateFragments
the beginning of the templates that have to be matched
@return An list with the ids of the pages that contain templates
beginning with any String in templateFragments
... | [
"Returns",
"a",
"list",
"containing",
"the",
"ids",
"of",
"all",
"pages",
"that",
"contain",
"a",
"template",
"the",
"name",
"of",
"which",
"starts",
"with",
"any",
"of",
"the",
"given",
"Strings",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L705-L707 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java | StructureTools.getAtomsCAInContact | public static AtomContactSet getAtomsCAInContact(Chain chain, double cutoff) {
"""
Returns the set of intra-chain contacts for the given chain for C-alpha
atoms (including non-standard aminoacids appearing as HETATM groups),
i.e. the contact map. Uses a geometric hashing algorithm that speeds up
the calculation... | java | public static AtomContactSet getAtomsCAInContact(Chain chain, double cutoff) {
Grid grid = new Grid(cutoff);
Atom[] atoms = getAtomCAArray(chain);
grid.addAtoms(atoms);
return grid.getAtomContacts();
} | [
"public",
"static",
"AtomContactSet",
"getAtomsCAInContact",
"(",
"Chain",
"chain",
",",
"double",
"cutoff",
")",
"{",
"Grid",
"grid",
"=",
"new",
"Grid",
"(",
"cutoff",
")",
";",
"Atom",
"[",
"]",
"atoms",
"=",
"getAtomCAArray",
"(",
"chain",
")",
";",
... | Returns the set of intra-chain contacts for the given chain for C-alpha
atoms (including non-standard aminoacids appearing as HETATM groups),
i.e. the contact map. Uses a geometric hashing algorithm that speeds up
the calculation without need of full distance matrix. The parsing mode
{@link FileParsingParameters#setAli... | [
"Returns",
"the",
"set",
"of",
"intra",
"-",
"chain",
"contacts",
"for",
"the",
"given",
"chain",
"for",
"C",
"-",
"alpha",
"atoms",
"(",
"including",
"non",
"-",
"standard",
"aminoacids",
"appearing",
"as",
"HETATM",
"groups",
")",
"i",
".",
"e",
".",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L1452-L1460 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/time/FormatCache.java | FormatCache.getInstance | public F getInstance(final String pattern, TimeZone timeZone, Locale locale) {
"""
<p>Gets a formatter instance using the specified pattern, time zone
and locale.</p>
@param pattern {@link java.text.SimpleDateFormat} compatible
pattern, non-null
@param timeZone the time zone, null means use the default Tim... | java | public F getInstance(final String pattern, TimeZone timeZone, Locale locale) {
Validate.notNull(pattern, "pattern must not be null");
if (timeZone == null) {
timeZone = TimeZone.getDefault();
}
if (locale == null) {
locale = Locale.getDefault();
}
... | [
"public",
"F",
"getInstance",
"(",
"final",
"String",
"pattern",
",",
"TimeZone",
"timeZone",
",",
"Locale",
"locale",
")",
"{",
"Validate",
".",
"notNull",
"(",
"pattern",
",",
"\"pattern must not be null\"",
")",
";",
"if",
"(",
"timeZone",
"==",
"null",
"... | <p>Gets a formatter instance using the specified pattern, time zone
and locale.</p>
@param pattern {@link java.text.SimpleDateFormat} compatible
pattern, non-null
@param timeZone the time zone, null means use the default TimeZone
@param locale the locale, null means use the default Locale
@return a pattern based da... | [
"<p",
">",
"Gets",
"a",
"formatter",
"instance",
"using",
"the",
"specified",
"pattern",
"time",
"zone",
"and",
"locale",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/FormatCache.java#L74-L94 |
stephanrauh/AngularFaces | AngularFaces_2.0/AngularFaces-core/src/main/java/de/beyondjava/angularFaces/core/i18n/I18n.java | I18n.slurp | public static String slurp(final InputStream is, final int bufferSize) {
"""
copied from http://stackoverflow.com/questions/309424/read-convert-an-inputstream-to-a-string
@param is file to be read
@param bufferSize size of the buffer used to read the file
@return file content as String
"""
final char[] ... | java | public static String slurp(final InputStream is, final int bufferSize) {
final char[] buffer = new char[bufferSize];
final StringBuilder out = new StringBuilder();
try {
final Reader in = new InputStreamReader(is, "UTF-8");
try {
for (;;) {
int rsz = in.read(buffer, 0, buffer.length);
if (rsz ... | [
"public",
"static",
"String",
"slurp",
"(",
"final",
"InputStream",
"is",
",",
"final",
"int",
"bufferSize",
")",
"{",
"final",
"char",
"[",
"]",
"buffer",
"=",
"new",
"char",
"[",
"bufferSize",
"]",
";",
"final",
"StringBuilder",
"out",
"=",
"new",
"Str... | copied from http://stackoverflow.com/questions/309424/read-convert-an-inputstream-to-a-string
@param is file to be read
@param bufferSize size of the buffer used to read the file
@return file content as String | [
"copied",
"from",
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"/",
"309424",
"/",
"read",
"-",
"convert",
"-",
"an",
"-",
"inputstream",
"-",
"to",
"-",
"a",
"-",
"string"
] | train | https://github.com/stephanrauh/AngularFaces/blob/43d915f004645b1bbbf2625214294dab0858ba01/AngularFaces_2.0/AngularFaces-core/src/main/java/de/beyondjava/angularFaces/core/i18n/I18n.java#L145-L166 |
strator-dev/greenpepper | greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/RepositoryType.java | RepositoryType.asFactoryArguments | public String asFactoryArguments(Repository repository, EnvironmentType env, boolean withStyle, String user, String pwd) {
"""
<p>asFactoryArguments.</p>
@param repository a {@link com.greenpepper.server.domain.Repository} object.
@param env a {@link com.greenpepper.server.domain.EnvironmentType} object.
@par... | java | public String asFactoryArguments(Repository repository, EnvironmentType env, boolean withStyle, String user, String pwd)
{
StringBuilder sb = new StringBuilder();
sb.append(getRepositoryTypeClass(env)).append(";");
sb.append(withStyle || name.equals("FILE") ? repository.getBaseTestUrl() : withNoStyle(r... | [
"public",
"String",
"asFactoryArguments",
"(",
"Repository",
"repository",
",",
"EnvironmentType",
"env",
",",
"boolean",
"withStyle",
",",
"String",
"user",
",",
"String",
"pwd",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb... | <p>asFactoryArguments.</p>
@param repository a {@link com.greenpepper.server.domain.Repository} object.
@param env a {@link com.greenpepper.server.domain.EnvironmentType} object.
@param withStyle a boolean.
@param user a {@link java.lang.String} object.
@param pwd a {@link java.lang.String} object.
@return a {@link ja... | [
"<p",
">",
"asFactoryArguments",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/RepositoryType.java#L223-L240 |
cdk/cdk | tool/charges/src/main/java/org/openscience/cdk/charges/PiElectronegativity.java | PiElectronegativity.calculatePiElectronegativity | public double calculatePiElectronegativity(IAtomContainer ac, IAtom atom, int maxIterations, int maxResonStruc) {
"""
calculate the electronegativity of orbitals pi.
@param ac IAtomContainer
@param atom atom for which effective atom electronegativity should be calculated
@p... | java | public double calculatePiElectronegativity(IAtomContainer ac, IAtom atom, int maxIterations, int maxResonStruc) {
maxI = maxIterations;
maxRS = maxResonStruc;
double electronegativity = 0;
try {
if (!ac.equals(acOldP)) {
molPi = ac.getBuilder().newInstance(I... | [
"public",
"double",
"calculatePiElectronegativity",
"(",
"IAtomContainer",
"ac",
",",
"IAtom",
"atom",
",",
"int",
"maxIterations",
",",
"int",
"maxResonStruc",
")",
"{",
"maxI",
"=",
"maxIterations",
";",
"maxRS",
"=",
"maxResonStruc",
";",
"double",
"electronega... | calculate the electronegativity of orbitals pi.
@param ac IAtomContainer
@param atom atom for which effective atom electronegativity should be calculated
@param maxIterations The maximal number of Iteration
@param maxResonStruc The maximal number of Resonance Structu... | [
"calculate",
"the",
"electronegativity",
"of",
"orbitals",
"pi",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/PiElectronegativity.java#L97-L131 |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/FacebookBatcher.java | FacebookBatcher.getAccessToken | public static String getAccessToken(String clientId, String clientSecret, String code, String redirectUri) {
"""
Get a user access token from Facebook. Normally you obtain this from the client-side SDK (javascript, iphone, etc)
but if you are driving the OAuth flow manually, this method is the last step.
see ... | java | public static String getAccessToken(String clientId, String clientSecret, String code, String redirectUri) {
RequestBuilder call = new RequestBuilder(GRAPH_ENDPOINT + "oauth/access_token", HttpMethod.GET);
call.setTimeout(10 * 1000); // this is a somewhat crude hack but seems reasonable right now
call.addParam... | [
"public",
"static",
"String",
"getAccessToken",
"(",
"String",
"clientId",
",",
"String",
"clientSecret",
",",
"String",
"code",
",",
"String",
"redirectUri",
")",
"{",
"RequestBuilder",
"call",
"=",
"new",
"RequestBuilder",
"(",
"GRAPH_ENDPOINT",
"+",
"\"oauth/ac... | Get a user access token from Facebook. Normally you obtain this from the client-side SDK (javascript, iphone, etc)
but if you are driving the OAuth flow manually, this method is the last step.
see https://developers.facebook.com/docs/authentication/ | [
"Get",
"a",
"user",
"access",
"token",
"from",
"Facebook",
".",
"Normally",
"you",
"obtain",
"this",
"from",
"the",
"client",
"-",
"side",
"SDK",
"(",
"javascript",
"iphone",
"etc",
")",
"but",
"if",
"you",
"are",
"driving",
"the",
"OAuth",
"flow",
"manu... | train | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/FacebookBatcher.java#L79-L105 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceCompositeGroupService.java | ReferenceCompositeGroupService.findGroupWithLock | @Override
public ILockableEntityGroup findGroupWithLock(String key, String lockOwner)
throws GroupsException {
"""
Returns a pre-existing <code>IEntityGroup</code> or null if the <code>IGroupMember</code>
does not exist.
"""
CompositeEntityIdentifier ent = newCompositeEntityIdentifier(... | java | @Override
public ILockableEntityGroup findGroupWithLock(String key, String lockOwner)
throws GroupsException {
CompositeEntityIdentifier ent = newCompositeEntityIdentifier(key);
IIndividualGroupService service = getComponentService(ent);
return (service == null) ? null : service.... | [
"@",
"Override",
"public",
"ILockableEntityGroup",
"findGroupWithLock",
"(",
"String",
"key",
",",
"String",
"lockOwner",
")",
"throws",
"GroupsException",
"{",
"CompositeEntityIdentifier",
"ent",
"=",
"newCompositeEntityIdentifier",
"(",
"key",
")",
";",
"IIndividualGr... | Returns a pre-existing <code>IEntityGroup</code> or null if the <code>IGroupMember</code>
does not exist. | [
"Returns",
"a",
"pre",
"-",
"existing",
"<code",
">",
"IEntityGroup<",
"/",
"code",
">",
"or",
"null",
"if",
"the",
"<code",
">",
"IGroupMember<",
"/",
"code",
">",
"does",
"not",
"exist",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceCompositeGroupService.java#L81-L87 |
brettwooldridge/SansOrm | src/main/java/com/zaxxer/sansorm/SqlClosureElf.java | SqlClosureElf.executeUpdate | public static int executeUpdate(final String sql, final Object... args) {
"""
Executes an update or insert statement.
@param sql The SQL to execute.
@param args The query parameters used
@return the number of rows updated
"""
return SqlClosure.sqlExecute(c -> executeUpdate(c, sql, args));
} | java | public static int executeUpdate(final String sql, final Object... args)
{
return SqlClosure.sqlExecute(c -> executeUpdate(c, sql, args));
} | [
"public",
"static",
"int",
"executeUpdate",
"(",
"final",
"String",
"sql",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"return",
"SqlClosure",
".",
"sqlExecute",
"(",
"c",
"->",
"executeUpdate",
"(",
"c",
",",
"sql",
",",
"args",
")",
")",
";",
"}... | Executes an update or insert statement.
@param sql The SQL to execute.
@param args The query parameters used
@return the number of rows updated | [
"Executes",
"an",
"update",
"or",
"insert",
"statement",
"."
] | train | https://github.com/brettwooldridge/SansOrm/blob/ab22721db79c5f20c0e8483f09eda2844d596557/src/main/java/com/zaxxer/sansorm/SqlClosureElf.java#L153-L156 |
OrienteerBAP/wicket-orientdb | wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/OSchemaHelper.java | OSchemaHelper.oAbstractClass | public OSchemaHelper oAbstractClass(String className, String... superClasses) {
"""
Create if required abstract {@link OClass}
@param className name of a class to create
@param superClasses list of superclasses
@return this helper
"""
return oClass(className, true, superClasses);
} | java | public OSchemaHelper oAbstractClass(String className, String... superClasses)
{
return oClass(className, true, superClasses);
} | [
"public",
"OSchemaHelper",
"oAbstractClass",
"(",
"String",
"className",
",",
"String",
"...",
"superClasses",
")",
"{",
"return",
"oClass",
"(",
"className",
",",
"true",
",",
"superClasses",
")",
";",
"}"
] | Create if required abstract {@link OClass}
@param className name of a class to create
@param superClasses list of superclasses
@return this helper | [
"Create",
"if",
"required",
"abstract",
"{"
] | train | https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/OSchemaHelper.java#L76-L79 |
keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/ConcatVectorTable.java | ConcatVectorTable.valueEquals | public boolean valueEquals(ConcatVectorTable other, double tolerance) {
"""
Deep comparison for equality of value, plus tolerance, for every concatvector in the table, plus dimensional
arrangement. This is mostly useful for testing.
@param other the vector table to compare against
@param tolerance the toleran... | java | public boolean valueEquals(ConcatVectorTable other, double tolerance) {
if (!Arrays.equals(other.getDimensions(), getDimensions())) return false;
for (int[] assignment : this) {
if (!getAssignmentValue(assignment).get().valueEquals(other.getAssignmentValue(assignment).get(), tolerance)) {
... | [
"public",
"boolean",
"valueEquals",
"(",
"ConcatVectorTable",
"other",
",",
"double",
"tolerance",
")",
"{",
"if",
"(",
"!",
"Arrays",
".",
"equals",
"(",
"other",
".",
"getDimensions",
"(",
")",
",",
"getDimensions",
"(",
")",
")",
")",
"return",
"false",... | Deep comparison for equality of value, plus tolerance, for every concatvector in the table, plus dimensional
arrangement. This is mostly useful for testing.
@param other the vector table to compare against
@param tolerance the tolerance to use in value comparisons
@return whether the two tables are equivalent by value | [
"Deep",
"comparison",
"for",
"equality",
"of",
"value",
"plus",
"tolerance",
"for",
"every",
"concatvector",
"in",
"the",
"table",
"plus",
"dimensional",
"arrangement",
".",
"This",
"is",
"mostly",
"useful",
"for",
"testing",
"."
] | train | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/ConcatVectorTable.java#L95-L103 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/particles/ConfigurableEmitter.java | ConfigurableEmitter.setPosition | public void setPosition(float x, float y, boolean moveParticles) {
"""
Set the position of this particle source
@param x
The x coodinate of that this emitter should spawn at
@param y
The y coodinate of that this emitter should spawn at
@param moveParticles
True if particles should be moved with the emitter... | java | public void setPosition(float x, float y, boolean moveParticles) {
if (moveParticles) {
adjust = true;
adjustx -= this.x - x;
adjusty -= this.y - y;
}
this.x = x;
this.y = y;
} | [
"public",
"void",
"setPosition",
"(",
"float",
"x",
",",
"float",
"y",
",",
"boolean",
"moveParticles",
")",
"{",
"if",
"(",
"moveParticles",
")",
"{",
"adjust",
"=",
"true",
";",
"adjustx",
"-=",
"this",
".",
"x",
"-",
"x",
";",
"adjusty",
"-=",
"th... | Set the position of this particle source
@param x
The x coodinate of that this emitter should spawn at
@param y
The y coodinate of that this emitter should spawn at
@param moveParticles
True if particles should be moved with the emitter | [
"Set",
"the",
"position",
"of",
"this",
"particle",
"source"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ConfigurableEmitter.java#L234-L242 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java | base_resource.add_resource | protected base_response add_resource(nitro_service service,options option) throws Exception {
"""
Use this method to perform a add operation on netscaler resource.
@param service nitro_service object.
@param option options class object.
@return status of the operation performed.
@throws Exception
"""
if... | java | protected base_response add_resource(nitro_service service,options option) throws Exception
{
if (!service.isLogin() && !this.get_object_type().equals("login"))
service.login();
String sessionid = service.get_sessionid();
String request = resource_to_string(service, sessionid, option);
return post_data(ser... | [
"protected",
"base_response",
"add_resource",
"(",
"nitro_service",
"service",
",",
"options",
"option",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"service",
".",
"isLogin",
"(",
")",
"&&",
"!",
"this",
".",
"get_object_type",
"(",
")",
".",
"equals",... | Use this method to perform a add operation on netscaler resource.
@param service nitro_service object.
@param option options class object.
@return status of the operation performed.
@throws Exception | [
"Use",
"this",
"method",
"to",
"perform",
"a",
"add",
"operation",
"on",
"netscaler",
"resource",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java#L163-L170 |
javalite/activejdbc | javalite-common/src/main/java/org/javalite/common/Base64.java | Base64.getMimeEncoder | public static Encoder getMimeEncoder(int lineLength, byte[] lineSeparator) {
"""
Returns a {@link Encoder} that encodes using the
<a href="#mime">MIME</a> type base64 encoding scheme
with specified line length and line separators.
@param lineLength
the length of each output line (rounded down to nearest mu... | java | public static Encoder getMimeEncoder(int lineLength, byte[] lineSeparator) {
a(lineSeparator).shouldNotBeNull();
int[] base64 = Decoder.fromBase64;
for (byte b : lineSeparator) {
if (base64[b & 0xff] != -1)
throw new IllegalArgumentException(
"... | [
"public",
"static",
"Encoder",
"getMimeEncoder",
"(",
"int",
"lineLength",
",",
"byte",
"[",
"]",
"lineSeparator",
")",
"{",
"a",
"(",
"lineSeparator",
")",
".",
"shouldNotBeNull",
"(",
")",
";",
"int",
"[",
"]",
"base64",
"=",
"Decoder",
".",
"fromBase64"... | Returns a {@link Encoder} that encodes using the
<a href="#mime">MIME</a> type base64 encoding scheme
with specified line length and line separators.
@param lineLength
the length of each output line (rounded down to nearest multiple
of 4). If {@code lineLength <= 0} the output will not be separated
in lines
@param ... | [
"Returns",
"a",
"{",
"@link",
"Encoder",
"}",
"that",
"encodes",
"using",
"the",
"<a",
"href",
"=",
"#mime",
">",
"MIME<",
"/",
"a",
">",
"type",
"base64",
"encoding",
"scheme",
"with",
"specified",
"line",
"length",
"and",
"line",
"separators",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/javalite-common/src/main/java/org/javalite/common/Base64.java#L112-L124 |
fabric8io/kubernetes-client | kubernetes-client/src/main/java/io/fabric8/kubernetes/client/Config.java | Config.fromKubeconfig | public static Config fromKubeconfig(String context, String kubeconfigContents, String kubeconfigPath) {
"""
Note: kubeconfigPath is optional (see note on loadFromKubeConfig)
"""
// we allow passing context along here, since downstream accepts it
Config config = new Config();
Config.loadFromKubeconf... | java | public static Config fromKubeconfig(String context, String kubeconfigContents, String kubeconfigPath) {
// we allow passing context along here, since downstream accepts it
Config config = new Config();
Config.loadFromKubeconfig(config, context, kubeconfigContents, kubeconfigPath);
return config;
} | [
"public",
"static",
"Config",
"fromKubeconfig",
"(",
"String",
"context",
",",
"String",
"kubeconfigContents",
",",
"String",
"kubeconfigPath",
")",
"{",
"// we allow passing context along here, since downstream accepts it",
"Config",
"config",
"=",
"new",
"Config",
"(",
... | Note: kubeconfigPath is optional (see note on loadFromKubeConfig) | [
"Note",
":",
"kubeconfigPath",
"is",
"optional",
"(",
"see",
"note",
"on",
"loadFromKubeConfig",
")"
] | train | https://github.com/fabric8io/kubernetes-client/blob/141668a882ed8e902c045a5cd0a80f14bd17d132/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/Config.java#L446-L451 |
weld/core | impl/src/main/java/org/jboss/weld/metadata/Selectors.java | Selectors.matchPath | public static boolean matchPath(String pattern, String str) {
"""
Tests whether or not a given path matches a given pattern.
<p/>
If you need to call this method multiple times with the same pattern you
should rather use TokenizedPath
@param pattern The pattern to match against. Must not be <code>null</code>... | java | public static boolean matchPath(String pattern, String str) {
String[] patDirs = tokenize(pattern);
return matchPath(patDirs, tokenize(str), true);
} | [
"public",
"static",
"boolean",
"matchPath",
"(",
"String",
"pattern",
",",
"String",
"str",
")",
"{",
"String",
"[",
"]",
"patDirs",
"=",
"tokenize",
"(",
"pattern",
")",
";",
"return",
"matchPath",
"(",
"patDirs",
",",
"tokenize",
"(",
"str",
")",
",",
... | Tests whether or not a given path matches a given pattern.
<p/>
If you need to call this method multiple times with the same pattern you
should rather use TokenizedPath
@param pattern The pattern to match against. Must not be <code>null</code>
.
@param str The path to match, as a String. Must not be <code>null</co... | [
"Tests",
"whether",
"or",
"not",
"a",
"given",
"path",
"matches",
"a",
"given",
"pattern",
".",
"<p",
"/",
">",
"If",
"you",
"need",
"to",
"call",
"this",
"method",
"multiple",
"times",
"with",
"the",
"same",
"pattern",
"you",
"should",
"rather",
"use",
... | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/metadata/Selectors.java#L52-L55 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/generation/MapperConstructor.java | MapperConstructor.wrappedMapping | private String wrappedMapping(boolean makeDest,NullPointerControl npc,MappingType mtd,MappingType mts) {
"""
This method adds the Null Pointer Control to mapping created by the mapping method.
wrapMapping is used to wrap the mapping returned by mapping method.
@param makeDest true if destination is a new insta... | java | private String wrappedMapping(boolean makeDest,NullPointerControl npc,MappingType mtd,MappingType mts){
String sClass = source.getName();
String dClass = destination.getName();
String str = (makeDest?" "+sClass+" "+stringOfGetSource +" = ("+sClass+") $1;"
:" "+dClass+" "+stringO... | [
"private",
"String",
"wrappedMapping",
"(",
"boolean",
"makeDest",
",",
"NullPointerControl",
"npc",
",",
"MappingType",
"mtd",
",",
"MappingType",
"mts",
")",
"{",
"String",
"sClass",
"=",
"source",
".",
"getName",
"(",
")",
";",
"String",
"dClass",
"=",
"d... | This method adds the Null Pointer Control to mapping created by the mapping method.
wrapMapping is used to wrap the mapping returned by mapping method.
@param makeDest true if destination is a new instance, false otherwise
@param npc a NullPointerControl chosen
@param mtd Mapping Type of destination
@param mts Mapping... | [
"This",
"method",
"adds",
"the",
"Null",
"Pointer",
"Control",
"to",
"mapping",
"created",
"by",
"the",
"mapping",
"method",
".",
"wrapMapping",
"is",
"used",
"to",
"wrap",
"the",
"mapping",
"returned",
"by",
"mapping",
"method",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/generation/MapperConstructor.java#L109-L130 |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/client/defaults/DefaultUserCredentials.java | DefaultUserCredentials.set | @Override
public void set(final String name, final UserCredentials other) throws IOException {
"""
Copy credentials from another existing user.
This method can be called only once per instance.
This default implementation should never be called.
@param name Name of the new user.
@param other Credentials of a... | java | @Override
public void set(final String name, final UserCredentials other) throws IOException {
throw new RuntimeException("Not implemented! Attempt to set user " + name + " from: " + other);
} | [
"@",
"Override",
"public",
"void",
"set",
"(",
"final",
"String",
"name",
",",
"final",
"UserCredentials",
"other",
")",
"throws",
"IOException",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Not implemented! Attempt to set user \"",
"+",
"name",
"+",
"\" from: \... | Copy credentials from another existing user.
This method can be called only once per instance.
This default implementation should never be called.
@param name Name of the new user.
@param other Credentials of another user.
@throws RuntimeException always throws. | [
"Copy",
"credentials",
"from",
"another",
"existing",
"user",
".",
"This",
"method",
"can",
"be",
"called",
"only",
"once",
"per",
"instance",
".",
"This",
"default",
"implementation",
"should",
"never",
"be",
"called",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/client/defaults/DefaultUserCredentials.java#L49-L52 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_11_01/src/main/java/com/microsoft/azure/management/storage/v2018_11_01/implementation/StorageAccountsInner.java | StorageAccountsInner.beginFailover | public void beginFailover(String resourceGroupName, String accountName) {
"""
Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary af... | java | public void beginFailover(String resourceGroupName, String accountName) {
beginFailoverWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body();
} | [
"public",
"void",
"beginFailover",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
")",
"{",
"beginFailoverWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"b... | Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover.
@param resourceGroupName The name of the resource group within the u... | [
"Failover",
"request",
"can",
"be",
"triggered",
"for",
"a",
"storage",
"account",
"in",
"case",
"of",
"availability",
"issues",
".",
"The",
"failover",
"occurs",
"from",
"the",
"storage",
"account",
"s",
"primary",
"cluster",
"to",
"secondary",
"cluster",
"fo... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_11_01/src/main/java/com/microsoft/azure/management/storage/v2018_11_01/implementation/StorageAccountsInner.java#L1353-L1355 |
threerings/nenya | core/src/main/java/com/threerings/media/util/ArcPath.java | ArcPath.getTranslatedInstance | public Path getTranslatedInstance (int x, int y) {
"""
Return a copy of the path, translated by the specified amounts.
"""
int startx = (int)(_center.x + Math.round(Math.cos(_sangle) * _xradius));
int starty = (int)(_center.y + Math.round(Math.sin(_sangle) * _yradius));
return new ArcP... | java | public Path getTranslatedInstance (int x, int y)
{
int startx = (int)(_center.x + Math.round(Math.cos(_sangle) * _xradius));
int starty = (int)(_center.y + Math.round(Math.sin(_sangle) * _yradius));
return new ArcPath(new Point(startx + x, starty + y),
_xradius, _yradius, _sangl... | [
"public",
"Path",
"getTranslatedInstance",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"int",
"startx",
"=",
"(",
"int",
")",
"(",
"_center",
".",
"x",
"+",
"Math",
".",
"round",
"(",
"Math",
".",
"cos",
"(",
"_sangle",
")",
"*",
"_xradius",
")",
... | Return a copy of the path, translated by the specified amounts. | [
"Return",
"a",
"copy",
"of",
"the",
"path",
"translated",
"by",
"the",
"specified",
"amounts",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/ArcPath.java#L90-L97 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getHexEncoded | @Nonnull
public static String getHexEncoded (@Nonnull final String sInput, @Nonnull final Charset aCharset) {
"""
Convert a string to a byte array and than to a hexadecimal encoded string.
@param sInput
The source string. May not be <code>null</code>.
@param aCharset
The charset to use. May not be <code>nu... | java | @Nonnull
public static String getHexEncoded (@Nonnull final String sInput, @Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (sInput, "Input");
ValueEnforcer.notNull (aCharset, "Charset");
return getHexEncoded (sInput.getBytes (aCharset));
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"getHexEncoded",
"(",
"@",
"Nonnull",
"final",
"String",
"sInput",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sInput",
",",
"\"Input\"",
")",
";",
"Value... | Convert a string to a byte array and than to a hexadecimal encoded string.
@param sInput
The source string. May not be <code>null</code>.
@param aCharset
The charset to use. May not be <code>null</code>.
@return The String representation of the byte array of the string. | [
"Convert",
"a",
"string",
"to",
"a",
"byte",
"array",
"and",
"than",
"to",
"a",
"hexadecimal",
"encoded",
"string",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L601-L608 |
oglimmer/utils | src/main/java/de/oglimmer/utils/random/RandomString.java | RandomString.getRandomString | public static String getRandomString(final int size, final int start, final int length) {
"""
Creates a size byte long unicode string. All codes are >= start and < start+length
@param size number of characters in the return string
@param start start code
@param length all generated codes are within this... | java | public static String getRandomString(final int size, final int start, final int length) {
final StringBuilder buff = new StringBuilder(size);
for (int i = 0; i < size; i++) {
buff.append((char) (RAN.nextInt(length) + start));
}
return buff.toString();
} | [
"public",
"static",
"String",
"getRandomString",
"(",
"final",
"int",
"size",
",",
"final",
"int",
"start",
",",
"final",
"int",
"length",
")",
"{",
"final",
"StringBuilder",
"buff",
"=",
"new",
"StringBuilder",
"(",
"size",
")",
";",
"for",
"(",
"int",
... | Creates a size byte long unicode string. All codes are >= start and < start+length
@param size number of characters in the return string
@param start start code
@param length all generated codes are within this range
@return | [
"Creates",
"a",
"size",
"byte",
"long",
"unicode",
"string",
".",
"All",
"codes",
"are",
">",
";",
"=",
"start",
"and",
"<",
";",
"start",
"+",
"length"
] | train | https://github.com/oglimmer/utils/blob/bc46c57a24e60c9dbda4c73a810c163b0ce407ea/src/main/java/de/oglimmer/utils/random/RandomString.java#L26-L33 |
Erudika/para | para-server/src/main/java/com/erudika/para/rest/RestUtils.java | RestUtils.getBatchReadResponse | public static Response getBatchReadResponse(App app, List<String> ids) {
"""
Batch read response as JSON.
@param app the current App object
@param ids list of ids
@return status code 200 or 400
"""
try (final Metrics.Context context = Metrics.time(app == null ? null : app.getAppid(),
RestUtils.class, ... | java | public static Response getBatchReadResponse(App app, List<String> ids) {
try (final Metrics.Context context = Metrics.time(app == null ? null : app.getAppid(),
RestUtils.class, "batch", "read")) {
if (app != null && ids != null && !ids.isEmpty()) {
ArrayList<ParaObject> results = new ArrayList<>(ids.size()... | [
"public",
"static",
"Response",
"getBatchReadResponse",
"(",
"App",
"app",
",",
"List",
"<",
"String",
">",
"ids",
")",
"{",
"try",
"(",
"final",
"Metrics",
".",
"Context",
"context",
"=",
"Metrics",
".",
"time",
"(",
"app",
"==",
"null",
"?",
"null",
... | Batch read response as JSON.
@param app the current App object
@param ids list of ids
@return status code 200 or 400 | [
"Batch",
"read",
"response",
"as",
"JSON",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/rest/RestUtils.java#L480-L495 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/requests/RestAction.java | RestAction.queueAfter | public ScheduledFuture<?> queueAfter(long delay, TimeUnit unit, Consumer<? super T> success, ScheduledExecutorService executor) {
"""
Schedules a call to {@link #queue(java.util.function.Consumer)} to be executed after the specified {@code delay}.
<br>This is an <b>asynchronous</b> operation that will return a
{... | java | public ScheduledFuture<?> queueAfter(long delay, TimeUnit unit, Consumer<? super T> success, ScheduledExecutorService executor)
{
return queueAfter(delay, unit, success, null, executor);
} | [
"public",
"ScheduledFuture",
"<",
"?",
">",
"queueAfter",
"(",
"long",
"delay",
",",
"TimeUnit",
"unit",
",",
"Consumer",
"<",
"?",
"super",
"T",
">",
"success",
",",
"ScheduledExecutorService",
"executor",
")",
"{",
"return",
"queueAfter",
"(",
"delay",
","... | Schedules a call to {@link #queue(java.util.function.Consumer)} to be executed after the specified {@code delay}.
<br>This is an <b>asynchronous</b> operation that will return a
{@link java.util.concurrent.ScheduledFuture ScheduledFuture} representing the task.
<p>This operation gives no access to the failure callback... | [
"Schedules",
"a",
"call",
"to",
"{",
"@link",
"#queue",
"(",
"java",
".",
"util",
".",
"function",
".",
"Consumer",
")",
"}",
"to",
"be",
"executed",
"after",
"the",
"specified",
"{",
"@code",
"delay",
"}",
".",
"<br",
">",
"This",
"is",
"an",
"<b",
... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/requests/RestAction.java#L694-L697 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/date/GosuDateUtil.java | GosuDateUtil.addMinutes | public static Date addMinutes(Date date, int iMinutes ) {
"""
Adds the specified (signed) amount of minutes to the given date. For
example, to subtract 5 minutes from the current time of the date, you can
achieve it by calling: <code>addMinutes(Date, -5)</code>.
@param date The time.
@param iMinutes The ... | java | public static Date addMinutes(Date date, int iMinutes ) {
Calendar dateTime = dateToCalendar(date);
dateTime.add(Calendar.MINUTE, iMinutes);
return dateTime.getTime();
} | [
"public",
"static",
"Date",
"addMinutes",
"(",
"Date",
"date",
",",
"int",
"iMinutes",
")",
"{",
"Calendar",
"dateTime",
"=",
"dateToCalendar",
"(",
"date",
")",
";",
"dateTime",
".",
"add",
"(",
"Calendar",
".",
"MINUTE",
",",
"iMinutes",
")",
";",
"ret... | Adds the specified (signed) amount of minutes to the given date. For
example, to subtract 5 minutes from the current time of the date, you can
achieve it by calling: <code>addMinutes(Date, -5)</code>.
@param date The time.
@param iMinutes The amount of minutes to add.
@return A new date with the minutes added. | [
"Adds",
"the",
"specified",
"(",
"signed",
")",
"amount",
"of",
"minutes",
"to",
"the",
"given",
"date",
".",
"For",
"example",
"to",
"subtract",
"5",
"minutes",
"from",
"the",
"current",
"time",
"of",
"the",
"date",
"you",
"can",
"achieve",
"it",
"by",
... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/date/GosuDateUtil.java#L44-L48 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/LastaAction.java | LastaAction.forwardByParam | protected HtmlResponse forwardByParam(Class<?> actionType, Object... params) {
"""
Forward to the action (index method) by the parameters on GET.
<pre>
<span style="color: #3F7E5E">// e.g. /member/edit/?foo=3</span>
return forwardByParam(MemberEditAction.class, "foo", 3);
<span style="color: #3F7E5E">// e.g.... | java | protected HtmlResponse forwardByParam(Class<?> actionType, Object... params) {
assertArgumentNotNull("actionType", actionType);
assertArgumentNotNull("params", params);
return forwardWith(actionType, params(params));
} | [
"protected",
"HtmlResponse",
"forwardByParam",
"(",
"Class",
"<",
"?",
">",
"actionType",
",",
"Object",
"...",
"params",
")",
"{",
"assertArgumentNotNull",
"(",
"\"actionType\"",
",",
"actionType",
")",
";",
"assertArgumentNotNull",
"(",
"\"params\"",
",",
"param... | Forward to the action (index method) by the parameters on GET.
<pre>
<span style="color: #3F7E5E">// e.g. /member/edit/?foo=3</span>
return forwardByParam(MemberEditAction.class, "foo", 3);
<span style="color: #3F7E5E">// e.g. /member/edit/?foo=3&bar=qux</span>
return forwardByParam(MemberEditAction.class, "foo", ... | [
"Forward",
"to",
"the",
"action",
"(",
"index",
"method",
")",
"by",
"the",
"parameters",
"on",
"GET",
".",
"<pre",
">",
"<span",
"style",
"=",
"color",
":",
"#3F7E5E",
">",
"//",
"e",
".",
"g",
".",
"/",
"member",
"/",
"edit",
"/",
"?foo",
"=",
... | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/LastaAction.java#L435-L439 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/EventCollector.java | EventCollector.registerJob | public void registerJob(final ExecutionGraph executionGraph, final boolean profilingAvailable,
final long submissionTimestamp) {
"""
Registers a job in form of its execution graph representation
with the job progress collector. The collector will subscribe
to state changes of the individual subtasks. A separa... | java | public void registerJob(final ExecutionGraph executionGraph, final boolean profilingAvailable,
final long submissionTimestamp) {
final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(executionGraph, true);
while (it.hasNext()) {
final ExecutionVertex vertex = it.next();
// Register the listen... | [
"public",
"void",
"registerJob",
"(",
"final",
"ExecutionGraph",
"executionGraph",
",",
"final",
"boolean",
"profilingAvailable",
",",
"final",
"long",
"submissionTimestamp",
")",
"{",
"final",
"Iterator",
"<",
"ExecutionVertex",
">",
"it",
"=",
"new",
"ExecutionGra... | Registers a job in form of its execution graph representation
with the job progress collector. The collector will subscribe
to state changes of the individual subtasks. A separate
deregistration is not necessary since the job progress collector
periodically discards outdated progress information.
@param executionGraph... | [
"Registers",
"a",
"job",
"in",
"form",
"of",
"its",
"execution",
"graph",
"representation",
"with",
"the",
"job",
"progress",
"collector",
".",
"The",
"collector",
"will",
"subscribe",
"to",
"state",
"changes",
"of",
"the",
"individual",
"subtasks",
".",
"A",
... | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/EventCollector.java#L462-L482 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Messager.java | Messager.printWarning | public void printWarning(SourcePosition pos, String msg) {
"""
Print warning message, increment warning count.
Part of DocErrorReporter.
@param pos the position where the error occurs
@param msg message to print
"""
if (diagListener != null) {
report(DiagnosticType.WARNING, pos, msg);
... | java | public void printWarning(SourcePosition pos, String msg) {
if (diagListener != null) {
report(DiagnosticType.WARNING, pos, msg);
return;
}
if (nwarnings < MaxWarnings) {
String prefix = (pos == null) ? programName : pos.toString();
PrintWriter war... | [
"public",
"void",
"printWarning",
"(",
"SourcePosition",
"pos",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"diagListener",
"!=",
"null",
")",
"{",
"report",
"(",
"DiagnosticType",
".",
"WARNING",
",",
"pos",
",",
"msg",
")",
";",
"return",
";",
"}",
"i... | Print warning message, increment warning count.
Part of DocErrorReporter.
@param pos the position where the error occurs
@param msg message to print | [
"Print",
"warning",
"message",
"increment",
"warning",
"count",
".",
"Part",
"of",
"DocErrorReporter",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Messager.java#L194-L207 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.