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 |
|---|---|---|---|---|---|---|---|---|---|---|
netplex/json-smart-v2 | json-smart/src/main/java/net/minidev/json/parser/JSONParser.java | JSONParser.parse | public <T> T parse(InputStream in, JsonReaderI<T> mapper) throws ParseException, UnsupportedEncodingException {
"""
use to return Primitive Type, or String, Or JsonObject or JsonArray
generated by a ContainerFactory
"""
return getPBinStream().parse(in, mapper);
} | java | public <T> T parse(InputStream in, JsonReaderI<T> mapper) throws ParseException, UnsupportedEncodingException {
return getPBinStream().parse(in, mapper);
} | [
"public",
"<",
"T",
">",
"T",
"parse",
"(",
"InputStream",
"in",
",",
"JsonReaderI",
"<",
"T",
">",
"mapper",
")",
"throws",
"ParseException",
",",
"UnsupportedEncodingException",
"{",
"return",
"getPBinStream",
"(",
")",
".",
"parse",
"(",
"in",
",",
"map... | use to return Primitive Type, or String, Or JsonObject or JsonArray
generated by a ContainerFactory | [
"use",
"to",
"return",
"Primitive",
"Type",
"or",
"String",
"Or",
"JsonObject",
"or",
"JsonArray",
"generated",
"by",
"a",
"ContainerFactory"
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/parser/JSONParser.java#L222-L224 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/config/CommonConfigUtils.java | CommonConfigUtils.getLongConfigAttribute | public long getLongConfigAttribute(Map<String, Object> props, String key, long defaultValue) {
"""
Returns the value for the configuration attribute matching the key provided. If the value does not exist or is empty, the
provided default value will be returned.
"""
if (props.containsKey(key)) {
... | java | public long getLongConfigAttribute(Map<String, Object> props, String key, long defaultValue) {
if (props.containsKey(key)) {
return (Long) props.get(key);
}
return defaultValue;
} | [
"public",
"long",
"getLongConfigAttribute",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
",",
"String",
"key",
",",
"long",
"defaultValue",
")",
"{",
"if",
"(",
"props",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"return",
"(",
"Long",
"... | Returns the value for the configuration attribute matching the key provided. If the value does not exist or is empty, the
provided default value will be returned. | [
"Returns",
"the",
"value",
"for",
"the",
"configuration",
"attribute",
"matching",
"the",
"key",
"provided",
".",
"If",
"the",
"value",
"does",
"not",
"exist",
"or",
"is",
"empty",
"the",
"provided",
"default",
"value",
"will",
"be",
"returned",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/config/CommonConfigUtils.java#L152-L157 |
kubernetes-client/java | examples/src/main/java/io/kubernetes/client/examples/ExpandedExample.java | ExpandedExample.printLog | public static void printLog(String namespace, String podName) throws ApiException {
"""
Print out the Log for specific Pods
@param namespace
@param podName
@throws ApiException
"""
// https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CoreV1Api.md#readNamespacedPodLog
String rea... | java | public static void printLog(String namespace, String podName) throws ApiException {
// https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CoreV1Api.md#readNamespacedPodLog
String readNamespacedPodLog =
COREV1_API.readNamespacedPodLog(
podName,
namespace,
... | [
"public",
"static",
"void",
"printLog",
"(",
"String",
"namespace",
",",
"String",
"podName",
")",
"throws",
"ApiException",
"{",
"// https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CoreV1Api.md#readNamespacedPodLog",
"String",
"readNamespacedPodLog",
"=",
"... | Print out the Log for specific Pods
@param namespace
@param podName
@throws ApiException | [
"Print",
"out",
"the",
"Log",
"for",
"specific",
"Pods"
] | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/examples/src/main/java/io/kubernetes/client/examples/ExpandedExample.java#L255-L270 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/plugins/ServerPluginRepository.java | ServerPluginRepository.overrideAndRegisterPlugin | private void overrideAndRegisterPlugin(File sourceFile) {
"""
Move or copy plugin to directory extensions/plugins. If a version of this plugin
already exists then it's deleted.
"""
File destDir = fs.getInstalledPluginsDir();
File destFile = new File(destDir, sourceFile.getName());
if (destFile.exi... | java | private void overrideAndRegisterPlugin(File sourceFile) {
File destDir = fs.getInstalledPluginsDir();
File destFile = new File(destDir, sourceFile.getName());
if (destFile.exists()) {
// plugin with same filename already installed
deleteQuietly(destFile);
}
try {
moveFile(sourceFi... | [
"private",
"void",
"overrideAndRegisterPlugin",
"(",
"File",
"sourceFile",
")",
"{",
"File",
"destDir",
"=",
"fs",
".",
"getInstalledPluginsDir",
"(",
")",
";",
"File",
"destFile",
"=",
"new",
"File",
"(",
"destDir",
",",
"sourceFile",
".",
"getName",
"(",
"... | Move or copy plugin to directory extensions/plugins. If a version of this plugin
already exists then it's deleted. | [
"Move",
"or",
"copy",
"plugin",
"to",
"directory",
"extensions",
"/",
"plugins",
".",
"If",
"a",
"version",
"of",
"this",
"plugin",
"already",
"exists",
"then",
"it",
"s",
"deleted",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/plugins/ServerPluginRepository.java#L173-L199 |
jenetics/jenetics | jenetics/src/main/java/io/jenetics/engine/Codecs.java | Codecs.ofVector | public static <A> Codec<ISeq<A>, AnyGene<A>> ofVector(
final Supplier<? extends A> supplier,
final int length
) {
"""
Return a scala {@code Codec} with the given allele {@link Supplier} and
{@code Chromosome} length. The {@code supplier} is responsible for
creating new random alleles.
@param <A> the alle... | java | public static <A> Codec<ISeq<A>, AnyGene<A>> ofVector(
final Supplier<? extends A> supplier,
final int length
) {
return ofVector(supplier, Predicates.TRUE, length);
} | [
"public",
"static",
"<",
"A",
">",
"Codec",
"<",
"ISeq",
"<",
"A",
">",
",",
"AnyGene",
"<",
"A",
">",
">",
"ofVector",
"(",
"final",
"Supplier",
"<",
"?",
"extends",
"A",
">",
"supplier",
",",
"final",
"int",
"length",
")",
"{",
"return",
"ofVecto... | Return a scala {@code Codec} with the given allele {@link Supplier} and
{@code Chromosome} length. The {@code supplier} is responsible for
creating new random alleles.
@param <A> the allele type
@param supplier the allele-supplier which is used for creating new,
random alleles
@param length the vector length
@return a... | [
"Return",
"a",
"scala",
"{",
"@code",
"Codec",
"}",
"with",
"the",
"given",
"allele",
"{",
"@link",
"Supplier",
"}",
"and",
"{",
"@code",
"Chromosome",
"}",
"length",
".",
"The",
"{",
"@code",
"supplier",
"}",
"is",
"responsible",
"for",
"creating",
"new... | train | https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics/src/main/java/io/jenetics/engine/Codecs.java#L458-L463 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.photos_upload | public T photos_upload(File photo, Long albumId)
throws FacebookException, IOException {
"""
Uploads a photo to Facebook.
@param photo an image file
@param albumId the album into which the photo should be uploaded
@return a T with the standard Facebook photo information
@see <a href="http://wiki.developers... | java | public T photos_upload(File photo, Long albumId)
throws FacebookException, IOException {
return photos_upload(photo, /*caption*/null, albumId);
} | [
"public",
"T",
"photos_upload",
"(",
"File",
"photo",
",",
"Long",
"albumId",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"return",
"photos_upload",
"(",
"photo",
",",
"/*caption*/",
"null",
",",
"albumId",
")",
";",
"}"
] | Uploads a photo to Facebook.
@param photo an image file
@param albumId the album into which the photo should be uploaded
@return a T with the standard Facebook photo information
@see <a href="http://wiki.developers.facebook.com/index.php/Photos.upload">
Developers wiki: Photos.upload</a> | [
"Uploads",
"a",
"photo",
"to",
"Facebook",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L1308-L1311 |
rubenlagus/TelegramBots | telegrambots-extensions/src/main/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/DefaultBotCommand.java | DefaultBotCommand.processMessage | @Override
public void processMessage(AbsSender absSender, Message message, String[] arguments) {
"""
Process the message and execute the command
@param absSender absSender to send messages over
@param message the message to process
@param arguments passed arguments
"""
execute(absSender, mes... | java | @Override
public void processMessage(AbsSender absSender, Message message, String[] arguments) {
execute(absSender, message.getFrom(), message.getChat(), message.getMessageId(), arguments);
} | [
"@",
"Override",
"public",
"void",
"processMessage",
"(",
"AbsSender",
"absSender",
",",
"Message",
"message",
",",
"String",
"[",
"]",
"arguments",
")",
"{",
"execute",
"(",
"absSender",
",",
"message",
".",
"getFrom",
"(",
")",
",",
"message",
".",
"getC... | Process the message and execute the command
@param absSender absSender to send messages over
@param message the message to process
@param arguments passed arguments | [
"Process",
"the",
"message",
"and",
"execute",
"the",
"command"
] | train | https://github.com/rubenlagus/TelegramBots/blob/d62354915d7664597a40fd9858f16bce67ef1478/telegrambots-extensions/src/main/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/DefaultBotCommand.java#L33-L36 |
sagiegurari/fax4j | src/main/java/org/fax4j/bridge/email/DefaultMailMessageParser.java | DefaultMailMessageParser.getFileInfoFromInputDataImpl | @Override
protected FileInfo getFileInfoFromInputDataImpl(Message inputData) {
"""
This function returns the file info from the request data.
@param inputData
The input data
@return The file info
"""
FileInfo fileInfo=null;
try
{
//get file info
fileI... | java | @Override
protected FileInfo getFileInfoFromInputDataImpl(Message inputData)
{
FileInfo fileInfo=null;
try
{
//get file info
fileInfo=this.getFileInfo(inputData);
}
catch(MessagingException exception)
{
throw new FaxException("U... | [
"@",
"Override",
"protected",
"FileInfo",
"getFileInfoFromInputDataImpl",
"(",
"Message",
"inputData",
")",
"{",
"FileInfo",
"fileInfo",
"=",
"null",
";",
"try",
"{",
"//get file info",
"fileInfo",
"=",
"this",
".",
"getFileInfo",
"(",
"inputData",
")",
";",
"}"... | This function returns the file info from the request data.
@param inputData
The input data
@return The file info | [
"This",
"function",
"returns",
"the",
"file",
"info",
"from",
"the",
"request",
"data",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/bridge/email/DefaultMailMessageParser.java#L61-L80 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/Message.java | Message.create | public static Message create(final BandwidthClient client, final Map<String, Object> params) throws Exception {
"""
Factory method to send a message from a params object, given a client instance
@param client the client
@param params the params
@return the message
@throws IOException unexpected error
"""
... | java | public static Message create(final BandwidthClient client, final Map<String, Object> params) throws Exception {
final String messageUri = client.getUserResourceUri(BandwidthConstants.MESSAGES_URI_PATH);
final RestResponse response = client.post(messageUri, params);
final String messageId = response... | [
"public",
"static",
"Message",
"create",
"(",
"final",
"BandwidthClient",
"client",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"throws",
"Exception",
"{",
"final",
"String",
"messageUri",
"=",
"client",
".",
"getUserResourceUri",
"(... | Factory method to send a message from a params object, given a client instance
@param client the client
@param params the params
@return the message
@throws IOException unexpected error | [
"Factory",
"method",
"to",
"send",
"a",
"message",
"from",
"a",
"params",
"object",
"given",
"a",
"client",
"instance"
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Message.java#L198-L204 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/matrix/GrowingSparseMatrix.java | GrowingSparseMatrix.setRow | public void setRow(int row, DoubleVector data) {
"""
{@inheritDoc}
The size of the matrix will be expanded if either row or
col is larger than the largest previously seen row or column value.
When the matrix is expanded by either dimension, the values for the new
row/column will all be assumed to be zero.
... | java | public void setRow(int row, DoubleVector data) {
checkIndices(row, data.length() -1);
if (cols <= data.length())
cols = data.length();
Vectors.copy(updateRow(row), data);
} | [
"public",
"void",
"setRow",
"(",
"int",
"row",
",",
"DoubleVector",
"data",
")",
"{",
"checkIndices",
"(",
"row",
",",
"data",
".",
"length",
"(",
")",
"-",
"1",
")",
";",
"if",
"(",
"cols",
"<=",
"data",
".",
"length",
"(",
")",
")",
"cols",
"="... | {@inheritDoc}
The size of the matrix will be expanded if either row or
col is larger than the largest previously seen row or column value.
When the matrix is expanded by either dimension, the values for the new
row/column will all be assumed to be zero. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/GrowingSparseMatrix.java#L272-L279 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java | VirtualMachinesInner.beginRedeployAsync | public Observable<OperationStatusResponseInner> beginRedeployAsync(String resourceGroupName, String vmName) {
"""
The operation to redeploy a virtual machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@throws IllegalArgumentException thrown if para... | java | public Observable<OperationStatusResponseInner> beginRedeployAsync(String resourceGroupName, String vmName) {
return beginRedeployWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Override
p... | [
"public",
"Observable",
"<",
"OperationStatusResponseInner",
">",
"beginRedeployAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
")",
"{",
"return",
"beginRedeployWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmName",
")",
".",
"map",
"(... | The operation to redeploy a virtual machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatusResponseInner object | [
"The",
"operation",
"to",
"redeploy",
"a",
"virtual",
"machine",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java#L2407-L2414 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/process/ProcessFaxClientSpi.java | ProcessFaxClientSpi.createProcessCommand | protected String createProcessCommand(Enum<?> templateNameEnum,FaxJob faxJob) {
"""
Creates the process command from the fax job data.
@param templateNameEnum
The template name
@param faxJob
The fax job object
@return The process command to execute
"""
//get template name
String tem... | java | protected String createProcessCommand(Enum<?> templateNameEnum,FaxJob faxJob)
{
//get template name
String templateName=templateNameEnum.toString();
//get template
String template=this.getTemplate(templateName);
String command=null;
if(template!=null)
{
... | [
"protected",
"String",
"createProcessCommand",
"(",
"Enum",
"<",
"?",
">",
"templateNameEnum",
",",
"FaxJob",
"faxJob",
")",
"{",
"//get template name",
"String",
"templateName",
"=",
"templateNameEnum",
".",
"toString",
"(",
")",
";",
"//get template",
"String",
... | Creates the process command from the fax job data.
@param templateNameEnum
The template name
@param faxJob
The fax job object
@return The process command to execute | [
"Creates",
"the",
"process",
"command",
"from",
"the",
"fax",
"job",
"data",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/process/ProcessFaxClientSpi.java#L538-L553 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.injectBeanField | @SuppressWarnings("unused")
@Internal
protected final void injectBeanField(BeanResolutionContext resolutionContext, DefaultBeanContext context, int index, Object bean) {
"""
Injects the value of a field of a bean that requires reflection.
@param resolutionContext The resolution context
@param context ... | java | @SuppressWarnings("unused")
@Internal
protected final void injectBeanField(BeanResolutionContext resolutionContext, DefaultBeanContext context, int index, Object bean) {
FieldInjectionPoint fieldInjectionPoint = fieldInjectionPoints.get(index);
boolean isInject = fieldInjectionPoint.getAnnotatio... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"@",
"Internal",
"protected",
"final",
"void",
"injectBeanField",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"DefaultBeanContext",
"context",
",",
"int",
"index",
",",
"Object",
"bean",
")",
"{",
"FieldIn... | Injects the value of a field of a bean that requires reflection.
@param resolutionContext The resolution context
@param context The bean context
@param index The index of the field
@param bean The bean being injected | [
"Injects",
"the",
"value",
"of",
"a",
"field",
"of",
"a",
"bean",
"that",
"requires",
"reflection",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L706-L729 |
bq-development/lib-ws | src/main/java/io/corbel/lib/ws/cli/ServiceRunnerWithVersionResource.java | ServiceRunnerWithVersionResource.configureService | @Override
protected void configureService(Environment environment, ApplicationContext context) {
"""
Subclasses have to call super.configureService(...) to register version resource
"""
super.configureService(environment, context);
environment.jersey().register(new ArtifactIdVersionResource... | java | @Override
protected void configureService(Environment environment, ApplicationContext context) {
super.configureService(environment, context);
environment.jersey().register(new ArtifactIdVersionResource(getArtifactId()));
} | [
"@",
"Override",
"protected",
"void",
"configureService",
"(",
"Environment",
"environment",
",",
"ApplicationContext",
"context",
")",
"{",
"super",
".",
"configureService",
"(",
"environment",
",",
"context",
")",
";",
"environment",
".",
"jersey",
"(",
")",
"... | Subclasses have to call super.configureService(...) to register version resource | [
"Subclasses",
"have",
"to",
"call",
"super",
".",
"configureService",
"(",
"...",
")",
"to",
"register",
"version",
"resource"
] | train | https://github.com/bq-development/lib-ws/blob/2a32235adcbcea961a9b6bc6ebce2629896d177b/src/main/java/io/corbel/lib/ws/cli/ServiceRunnerWithVersionResource.java#L22-L26 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataAllValuesFromImpl_CustomFieldSerializer.java | OWLDataAllValuesFromImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataAllValuesFromImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.googl... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataAllValuesFromImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLDataAllValuesFromImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataAllValuesFromImpl_CustomFieldSerializer.java#L94-L97 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/AbstractPoint.java | AbstractPoint.searchX | public static final int searchX(Point[] points, Point key) {
"""
Searches given key in array in x-order
@param points
@param key
@return Like in Arrays.binarySearch
@see java.util.Arrays
"""
return Arrays.binarySearch(points, key, xcomp);
} | java | public static final int searchX(Point[] points, Point key)
{
return Arrays.binarySearch(points, key, xcomp);
} | [
"public",
"static",
"final",
"int",
"searchX",
"(",
"Point",
"[",
"]",
"points",
",",
"Point",
"key",
")",
"{",
"return",
"Arrays",
".",
"binarySearch",
"(",
"points",
",",
"key",
",",
"xcomp",
")",
";",
"}"
] | Searches given key in array in x-order
@param points
@param key
@return Like in Arrays.binarySearch
@see java.util.Arrays | [
"Searches",
"given",
"key",
"in",
"array",
"in",
"x",
"-",
"order"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/AbstractPoint.java#L293-L296 |
mpetazzoni/ttorrent | ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java | CommunicationManager.addTorrent | public TorrentManager addTorrent(String dotTorrentFilePath,
String downloadDirPath,
PieceStorageFactory pieceStorageFactory) throws IOException {
"""
Adds torrent to storage with specified {@link PieceStorageFactory}.
It can be used for skippin... | java | public TorrentManager addTorrent(String dotTorrentFilePath,
String downloadDirPath,
PieceStorageFactory pieceStorageFactory) throws IOException {
return addTorrent(dotTorrentFilePath, downloadDirPath, pieceStorageFactory, Collections.<TorrentList... | [
"public",
"TorrentManager",
"addTorrent",
"(",
"String",
"dotTorrentFilePath",
",",
"String",
"downloadDirPath",
",",
"PieceStorageFactory",
"pieceStorageFactory",
")",
"throws",
"IOException",
"{",
"return",
"addTorrent",
"(",
"dotTorrentFilePath",
",",
"downloadDirPath",
... | Adds torrent to storage with specified {@link PieceStorageFactory}.
It can be used for skipping initial validation of data
@param dotTorrentFilePath path to torrent metadata file
@param downloadDirPath path to directory where downloaded files are placed
@param pieceStorageFactory factory for creating {@link PieceSt... | [
"Adds",
"torrent",
"to",
"storage",
"with",
"specified",
"{",
"@link",
"PieceStorageFactory",
"}",
".",
"It",
"can",
"be",
"used",
"for",
"skipping",
"initial",
"validation",
"of",
"data"
] | train | https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java#L156-L160 |
OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/EscapableResourceIdSplitter.java | EscapableResourceIdSplitter.splitIdIntoElements | @Override
public List<String> splitIdIntoElements(String id) {
"""
Splits a resource id into a list of elements.
Elements in the resource id are delimited by colons (:).
Colons can be escaped by a backslash (\:).
Backslashes are escaped when paired (\\).
For example, the following resources id:
a:b\::... | java | @Override
public List<String> splitIdIntoElements(String id) {
Preconditions.checkNotNull(id, "id argument");
List<String> elements = Lists.newArrayList();
int startOfNextElement = 0;
int numConsecutiveEscapeCharacters = 0;
char[] idChars = id.toCharArray();
for (int... | [
"@",
"Override",
"public",
"List",
"<",
"String",
">",
"splitIdIntoElements",
"(",
"String",
"id",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"id",
",",
"\"id argument\"",
")",
";",
"List",
"<",
"String",
">",
"elements",
"=",
"Lists",
".",
"newA... | Splits a resource id into a list of elements.
Elements in the resource id are delimited by colons (:).
Colons can be escaped by a backslash (\:).
Backslashes are escaped when paired (\\).
For example, the following resources id:
a:b\::c\\:d
will result in the following elements:
a, b:, c\, d
@param id the resource i... | [
"Splits",
"a",
"resource",
"id",
"into",
"a",
"list",
"of",
"elements",
"."
] | train | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/EscapableResourceIdSplitter.java#L50-L74 |
alkacon/opencms-core | src/org/opencms/i18n/CmsLocaleManager.java | CmsLocaleManager.getMainLocale | public static Locale getMainLocale(CmsObject cms, CmsResource res) {
"""
Utility method to get the primary locale for a given resource.<p>
@param cms the current CMS context
@param res the resource for which the locale should be retrieved
@return the primary locale
"""
CmsLocaleManager localeMa... | java | public static Locale getMainLocale(CmsObject cms, CmsResource res) {
CmsLocaleManager localeManager = OpenCms.getLocaleManager();
List<Locale> defaultLocales = null;
// must switch project id in stored Admin context to match current project
String defaultNames = null;
try {
... | [
"public",
"static",
"Locale",
"getMainLocale",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"res",
")",
"{",
"CmsLocaleManager",
"localeManager",
"=",
"OpenCms",
".",
"getLocaleManager",
"(",
")",
";",
"List",
"<",
"Locale",
">",
"defaultLocales",
"=",
"null",
... | Utility method to get the primary locale for a given resource.<p>
@param cms the current CMS context
@param res the resource for which the locale should be retrieved
@return the primary locale | [
"Utility",
"method",
"to",
"get",
"the",
"primary",
"locale",
"for",
"a",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsLocaleManager.java#L322-L349 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/LastaAction.java | LastaAction.redirectById | protected HtmlResponse redirectById(Class<?> actionType, Number... ids) {
"""
Redirect to the action (index method) by the IDs on URL.
<pre>
<span style="color: #3F7E5E">// e.g. /member/edit/3/</span>
return redirectById(MemberEditAction.class, 3);
<span style="color: #3F7E5E">// e.g. /member/edit/3/197/</sp... | java | protected HtmlResponse redirectById(Class<?> actionType, Number... ids) {
assertArgumentNotNull("actionType", actionType);
assertArgumentNotNull("ids", ids);
final Object[] objAry = (Object[]) ids; // to suppress warning
return redirectWith(actionType, moreUrl(objAry));
} | [
"protected",
"HtmlResponse",
"redirectById",
"(",
"Class",
"<",
"?",
">",
"actionType",
",",
"Number",
"...",
"ids",
")",
"{",
"assertArgumentNotNull",
"(",
"\"actionType\"",
",",
"actionType",
")",
";",
"assertArgumentNotNull",
"(",
"\"ids\"",
",",
"ids",
")",
... | Redirect to the action (index method) by the IDs on URL.
<pre>
<span style="color: #3F7E5E">// e.g. /member/edit/3/</span>
return redirectById(MemberEditAction.class, 3);
<span style="color: #3F7E5E">// e.g. /member/edit/3/197/</span>
return redirectById(MemberEditAction.class, 3, 197);
<span style="color: #3F7E5E">/... | [
"Redirect",
"to",
"the",
"action",
"(",
"index",
"method",
")",
"by",
"the",
"IDs",
"on",
"URL",
".",
"<pre",
">",
"<span",
"style",
"=",
"color",
":",
"#3F7E5E",
">",
"//",
"e",
".",
"g",
".",
"/",
"member",
"/",
"edit",
"/",
"3",
"/",
"<",
"/... | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/LastaAction.java#L283-L288 |
flow/commons | src/main/java/com/flowpowered/commons/LogicUtil.java | LogicUtil.equalsAny | public static <A, B> boolean equalsAny(A object, B... objects) {
"""
Checks if the object equals one of the other objects given
@param object to check
@param objects to use equals against
@return True if one of the objects equal the object
"""
for (B o : objects) {
if (bothNullOrEqual(... | java | public static <A, B> boolean equalsAny(A object, B... objects) {
for (B o : objects) {
if (bothNullOrEqual(o, object)) {
return true;
}
}
return false;
} | [
"public",
"static",
"<",
"A",
",",
"B",
">",
"boolean",
"equalsAny",
"(",
"A",
"object",
",",
"B",
"...",
"objects",
")",
"{",
"for",
"(",
"B",
"o",
":",
"objects",
")",
"{",
"if",
"(",
"bothNullOrEqual",
"(",
"o",
",",
"object",
")",
")",
"{",
... | Checks if the object equals one of the other objects given
@param object to check
@param objects to use equals against
@return True if one of the objects equal the object | [
"Checks",
"if",
"the",
"object",
"equals",
"one",
"of",
"the",
"other",
"objects",
"given"
] | train | https://github.com/flow/commons/blob/0690efdac06fd728fcd7e9cf10f2b1319379c45b/src/main/java/com/flowpowered/commons/LogicUtil.java#L58-L65 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.rotateLocal | public Matrix4x3f rotateLocal(float ang, float x, float y, float z, Matrix4x3f dest) {
"""
Pre-multiply a rotation to this matrix by rotating the given amount of radians
about the specified <code>(x, y, z)</code> axis and store the result in <code>dest</code>.
<p>
The axis described by the three components need... | java | public Matrix4x3f rotateLocal(float ang, float x, float y, float z, Matrix4x3f dest) {
float s = (float) Math.sin(ang);
float c = (float) Math.cosFromSin(s, ang);
float C = 1.0f - c;
float xx = x * x, xy = x * y, xz = x * z;
float yy = y * y, yz = y * z;
float zz = z * z;... | [
"public",
"Matrix4x3f",
"rotateLocal",
"(",
"float",
"ang",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
",",
"Matrix4x3f",
"dest",
")",
"{",
"float",
"s",
"=",
"(",
"float",
")",
"Math",
".",
"sin",
"(",
"ang",
")",
";",
"float",
"c",
... | Pre-multiply a rotation to this matrix by rotating the given amount of radians
about the specified <code>(x, y, z)</code> axis and store the result in <code>dest</code>.
<p>
The axis described by the three components needs to be a unit vector.
<p>
When used with a right-handed coordinate system, the produced rotation w... | [
"Pre",
"-",
"multiply",
"a",
"rotation",
"to",
"this",
"matrix",
"by",
"rotating",
"the",
"given",
"amount",
"of",
"radians",
"about",
"the",
"specified",
"<code",
">",
"(",
"x",
"y",
"z",
")",
"<",
"/",
"code",
">",
"axis",
"and",
"store",
"the",
"r... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L4138-L4180 |
metamx/java-util | src/main/java/com/metamx/common/lifecycle/Lifecycle.java | Lifecycle.addHandler | public void addHandler(Handler handler, Stage stage) {
"""
Adds a handler to the Lifecycle. If the lifecycle has already been started, it throws an {@link ISE}
@param handler The hander to add to the lifecycle
@param stage The stage to add the lifecycle at
@throws ISE indicates that the lifecycle has alre... | java | public void addHandler(Handler handler, Stage stage)
{
synchronized (handlers) {
if (started.get()) {
throw new ISE("Cannot add a handler after the Lifecycle has started, it doesn't work that way.");
}
handlers.get(stage).add(handler);
}
} | [
"public",
"void",
"addHandler",
"(",
"Handler",
"handler",
",",
"Stage",
"stage",
")",
"{",
"synchronized",
"(",
"handlers",
")",
"{",
"if",
"(",
"started",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"ISE",
"(",
"\"Cannot add a handler after the Lifecyc... | Adds a handler to the Lifecycle. If the lifecycle has already been started, it throws an {@link ISE}
@param handler The hander to add to the lifecycle
@param stage The stage to add the lifecycle at
@throws ISE indicates that the lifecycle has already been started and thus cannot be added to | [
"Adds",
"a",
"handler",
"to",
"the",
"Lifecycle",
".",
"If",
"the",
"lifecycle",
"has",
"already",
"been",
"started",
"it",
"throws",
"an",
"{",
"@link",
"ISE",
"}"
] | train | https://github.com/metamx/java-util/blob/9d204043da1136e94fb2e2d63e3543a29bf54b4d/src/main/java/com/metamx/common/lifecycle/Lifecycle.java#L150-L158 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PlainChangesLogImpl.java | PlainChangesLogImpl.createCopy | public static PlainChangesLogImpl createCopy(List<ItemState> items, String pairId, PlainChangesLog originalLog) {
"""
Creates a new instance of {@link PlainChangesLogImpl} by copying metadata from originalLog
instance with Items and PairID provided. Metadata will be copied excluding PairID.
@param items
@para... | java | public static PlainChangesLogImpl createCopy(List<ItemState> items, String pairId, PlainChangesLog originalLog)
{
if (originalLog.getSession() != null)
{
return new PlainChangesLogImpl(items, originalLog.getSession().getId(), originalLog.getEventType(), pairId,
originalLog.getSession... | [
"public",
"static",
"PlainChangesLogImpl",
"createCopy",
"(",
"List",
"<",
"ItemState",
">",
"items",
",",
"String",
"pairId",
",",
"PlainChangesLog",
"originalLog",
")",
"{",
"if",
"(",
"originalLog",
".",
"getSession",
"(",
")",
"!=",
"null",
")",
"{",
"re... | Creates a new instance of {@link PlainChangesLogImpl} by copying metadata from originalLog
instance with Items and PairID provided. Metadata will be copied excluding PairID.
@param items
@param originalLog
@return | [
"Creates",
"a",
"new",
"instance",
"of",
"{",
"@link",
"PlainChangesLogImpl",
"}",
"by",
"copying",
"metadata",
"from",
"originalLog",
"instance",
"with",
"Items",
"and",
"PairID",
"provided",
".",
"Metadata",
"will",
"be",
"copied",
"excluding",
"PairID",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PlainChangesLogImpl.java#L348-L356 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/CollectionLiteralsTypeComputer.java | CollectionLiteralsTypeComputer.isSubtypeButNotSynonym | protected boolean isSubtypeButNotSynonym(LightweightTypeReference expectation, Class<?> clazz) {
"""
Same as {@link LightweightTypeReference#isSubtypeOf(Class)} but does not accept synonym types as subtypes.
"""
if (expectation.isType(clazz)) {
return true;
}
ITypeReferenceOwner owner = expectation.ge... | java | protected boolean isSubtypeButNotSynonym(LightweightTypeReference expectation, Class<?> clazz) {
if (expectation.isType(clazz)) {
return true;
}
ITypeReferenceOwner owner = expectation.getOwner();
JvmType declaredType = owner.getServices().getTypeReferences().findDeclaredType(clazz, owner.getContextResourceS... | [
"protected",
"boolean",
"isSubtypeButNotSynonym",
"(",
"LightweightTypeReference",
"expectation",
",",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"if",
"(",
"expectation",
".",
"isType",
"(",
"clazz",
")",
")",
"{",
"return",
"true",
";",
"}",
"ITypeReferenceO... | Same as {@link LightweightTypeReference#isSubtypeOf(Class)} but does not accept synonym types as subtypes. | [
"Same",
"as",
"{"
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/CollectionLiteralsTypeComputer.java#L352-L366 |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/JDBCUtil.java | JDBCUtil.dropIndex | public static boolean dropIndex (Connection conn, String table, String cname, String iname)
throws SQLException {
"""
Removes a named index from the specified table.
@return true if the index was dropped, false if it did not exist in the first place.
"""
if (!tableContainsIndex(conn, table, ... | java | public static boolean dropIndex (Connection conn, String table, String cname, String iname)
throws SQLException
{
if (!tableContainsIndex(conn, table, cname, iname)) {
return false;
}
String update = "ALTER TABLE " + table + " DROP INDEX " + iname;
PreparedStatem... | [
"public",
"static",
"boolean",
"dropIndex",
"(",
"Connection",
"conn",
",",
"String",
"table",
",",
"String",
"cname",
",",
"String",
"iname",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"!",
"tableContainsIndex",
"(",
"conn",
",",
"table",
",",
"cname",
... | Removes a named index from the specified table.
@return true if the index was dropped, false if it did not exist in the first place. | [
"Removes",
"a",
"named",
"index",
"from",
"the",
"specified",
"table",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/JDBCUtil.java#L560-L578 |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/serializer/HttpResponseBodyDecoder.java | HttpResponseBodyDecoder.deserializePage | private static Object deserializePage(String value, Type resultType, Type wireType, SerializerAdapter serializer, SerializerEncoding encoding) throws IOException {
"""
Deserializes a response body as a Page<T> given that {@param wireType} is either:
1. A type that implements the interface
2. Is of {@link Page}
... | java | private static Object deserializePage(String value, Type resultType, Type wireType, SerializerAdapter serializer, SerializerEncoding encoding) throws IOException {
final Type wireResponseType;
if (wireType == Page.class) {
// If the type is the 'Page' interface [i.e. `@ReturnValueWireType(P... | [
"private",
"static",
"Object",
"deserializePage",
"(",
"String",
"value",
",",
"Type",
"resultType",
",",
"Type",
"wireType",
",",
"SerializerAdapter",
"serializer",
",",
"SerializerEncoding",
"encoding",
")",
"throws",
"IOException",
"{",
"final",
"Type",
"wireResp... | Deserializes a response body as a Page<T> given that {@param wireType} is either:
1. A type that implements the interface
2. Is of {@link Page}
@param value The string to deserialize
@param resultType The type T, of the page contents.
@param wireType The {@link Type} that either is, or implements {@link Page}
@param s... | [
"Deserializes",
"a",
"response",
"body",
"as",
"a",
"Page<T",
">",
"given",
"that",
"{",
"@param",
"wireType",
"}",
"is",
"either",
":",
"1",
".",
"A",
"type",
"that",
"implements",
"the",
"interface",
"2",
".",
"Is",
"of",
"{",
"@link",
"Page",
"}"
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/serializer/HttpResponseBodyDecoder.java#L237-L248 |
JodaOrg/joda-time | src/main/java/org/joda/time/Period.java | Period.plusMinutes | public Period plusMinutes(int minutes) {
"""
Returns a new period plus the specified number of minutes added.
<p>
This period instance is immutable and unaffected by this method call.
@param minutes the amount of minutes to add, may be negative
@return the new period plus the increased minutes
@throws Unsu... | java | public Period plusMinutes(int minutes) {
if (minutes == 0) {
return this;
}
int[] values = getValues(); // cloned
getPeriodType().addIndexedField(this, PeriodType.MINUTE_INDEX, values, minutes);
return new Period(values, getPeriodType());
} | [
"public",
"Period",
"plusMinutes",
"(",
"int",
"minutes",
")",
"{",
"if",
"(",
"minutes",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"int",
"[",
"]",
"values",
"=",
"getValues",
"(",
")",
";",
"// cloned",
"getPeriodType",
"(",
")",
".",
"addIn... | Returns a new period plus the specified number of minutes added.
<p>
This period instance is immutable and unaffected by this method call.
@param minutes the amount of minutes to add, may be negative
@return the new period plus the increased minutes
@throws UnsupportedOperationException if the field is not supported | [
"Returns",
"a",
"new",
"period",
"plus",
"the",
"specified",
"number",
"of",
"minutes",
"added",
".",
"<p",
">",
"This",
"period",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Period.java#L1159-L1166 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Transaction.java | Transaction.addSignedInput | public TransactionInput addSignedInput(TransactionOutput output, ECKey signingKey) {
"""
Adds an input that points to the given output and contains a valid signature for it, calculated using the
signing key.
"""
return addSignedInput(output.getOutPointFor(), output.getScriptPubKey(), signingKey);
... | java | public TransactionInput addSignedInput(TransactionOutput output, ECKey signingKey) {
return addSignedInput(output.getOutPointFor(), output.getScriptPubKey(), signingKey);
} | [
"public",
"TransactionInput",
"addSignedInput",
"(",
"TransactionOutput",
"output",
",",
"ECKey",
"signingKey",
")",
"{",
"return",
"addSignedInput",
"(",
"output",
".",
"getOutPointFor",
"(",
")",
",",
"output",
".",
"getScriptPubKey",
"(",
")",
",",
"signingKey"... | Adds an input that points to the given output and contains a valid signature for it, calculated using the
signing key. | [
"Adds",
"an",
"input",
"that",
"points",
"to",
"the",
"given",
"output",
"and",
"contains",
"a",
"valid",
"signature",
"for",
"it",
"calculated",
"using",
"the",
"signing",
"key",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Transaction.java#L1001-L1003 |
radkovo/SwingBox | src/main/java/org/fit/cssbox/swingbox/view/ElementBoxView.java | ElementBoxView.getChildAllocation | @Override
public Shape getChildAllocation(int index, Shape a) {
"""
/*protected void paintChild(Graphics g, View v, Shape rect, int index)
{
System.err.println("Painting " + v);
v.paint(g, rect);
}
"""
// zvyraznovanie !
if (a != null /* && isAllocationValid() */)
{
... | java | @Override
public Shape getChildAllocation(int index, Shape a)
{
// zvyraznovanie !
if (a != null /* && isAllocationValid() */)
{
Box tmpBox = getBox(getView(index));
Rectangle alloc = (a instanceof Rectangle) ? (Rectangle) a : a.getBounds();
//alloc.s... | [
"@",
"Override",
"public",
"Shape",
"getChildAllocation",
"(",
"int",
"index",
",",
"Shape",
"a",
")",
"{",
"// zvyraznovanie !",
"if",
"(",
"a",
"!=",
"null",
"/* && isAllocationValid() */",
")",
"{",
"Box",
"tmpBox",
"=",
"getBox",
"(",
"getView",
"(",
"in... | /*protected void paintChild(Graphics g, View v, Shape rect, int index)
{
System.err.println("Painting " + v);
v.paint(g, rect);
} | [
"/",
"*",
"protected",
"void",
"paintChild",
"(",
"Graphics",
"g",
"View",
"v",
"Shape",
"rect",
"int",
"index",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"Painting",
"+",
"v",
")",
";",
"v",
".",
"paint",
"(",
"g",
"rect",
")",
";",
"... | train | https://github.com/radkovo/SwingBox/blob/ff370f3dc54d248e4c8852c17513618c83c25984/src/main/java/org/fit/cssbox/swingbox/view/ElementBoxView.java#L475-L489 |
vkostyukov/la4j | src/main/java/org/la4j/Vectors.java | Vectors.asMulFunction | public static VectorFunction asMulFunction(final double arg) {
"""
Creates a mul function that multiplies given {@code value} by it's argument.
@param arg a value to be multiplied by function's argument
@return a closure that does {@code _ * _}
"""
return new VectorFunction() {
@Overr... | java | public static VectorFunction asMulFunction(final double arg) {
return new VectorFunction() {
@Override
public double evaluate(int i, double value) {
return value * arg;
}
};
} | [
"public",
"static",
"VectorFunction",
"asMulFunction",
"(",
"final",
"double",
"arg",
")",
"{",
"return",
"new",
"VectorFunction",
"(",
")",
"{",
"@",
"Override",
"public",
"double",
"evaluate",
"(",
"int",
"i",
",",
"double",
"value",
")",
"{",
"return",
... | Creates a mul function that multiplies given {@code value} by it's argument.
@param arg a value to be multiplied by function's argument
@return a closure that does {@code _ * _} | [
"Creates",
"a",
"mul",
"function",
"that",
"multiplies",
"given",
"{",
"@code",
"value",
"}",
"by",
"it",
"s",
"argument",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Vectors.java#L186-L193 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XDSRepositoryAuditor.java | XDSRepositoryAuditor.auditProvideAndRegisterEvent | protected void auditProvideAndRegisterEvent (
IHETransactionEventTypeCodes transaction,
RFC3881EventOutcomeCodes eventOutcome,
String sourceUserId, String sourceIpAddress,
String userName,
String repositoryEndpointUri,
String submissionSetUniqueId,
String patientId,
List<Coded... | java | protected void auditProvideAndRegisterEvent (
IHETransactionEventTypeCodes transaction,
RFC3881EventOutcomeCodes eventOutcome,
String sourceUserId, String sourceIpAddress,
String userName,
String repositoryEndpointUri,
String submissionSetUniqueId,
String patientId,
List<Coded... | [
"protected",
"void",
"auditProvideAndRegisterEvent",
"(",
"IHETransactionEventTypeCodes",
"transaction",
",",
"RFC3881EventOutcomeCodes",
"eventOutcome",
",",
"String",
"sourceUserId",
",",
"String",
"sourceIpAddress",
",",
"String",
"userName",
",",
"String",
"repositoryEndp... | Generically sends audit messages for XDS Document Repository Provide And Register Document Set events
@param transaction The specific IHE Transaction (ITI-15 or ITI-41)
@param eventOutcome The event outcome indicator
@param sourceUserId The Active Participant UserID for the document consumer (if using WS-Addressing)
@... | [
"Generically",
"sends",
"audit",
"messages",
"for",
"XDS",
"Document",
"Repository",
"Provide",
"And",
"Register",
"Document",
"Set",
"events"
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XDSRepositoryAuditor.java#L378-L402 |
andrehertwig/admintool | admin-tools-security/admin-tools-security-dbuser/src/main/java/de/chandre/admintool/security/dbuser/contoller/ATSecDBAbctractController.java | ATSecDBAbctractController.handleException | protected <E extends Throwable, V extends ATSecDBValidator> Set<ATError> handleException(E e, Log logger, V validator,
String key, String suffix, String defaultMessagePrefix) {
"""
logging the error and creates {@link ATError} list output
@param e
@param logger
@param validator
@param key
@param suffix... | java | protected <E extends Throwable, V extends ATSecDBValidator> Set<ATError> handleException(E e, Log logger, V validator,
String key, String suffix, String defaultMessagePrefix) {
return handleException(e, logger, validator, key, suffix, defaultMessagePrefix, new Object[] {});
} | [
"protected",
"<",
"E",
"extends",
"Throwable",
",",
"V",
"extends",
"ATSecDBValidator",
">",
"Set",
"<",
"ATError",
">",
"handleException",
"(",
"E",
"e",
",",
"Log",
"logger",
",",
"V",
"validator",
",",
"String",
"key",
",",
"String",
"suffix",
",",
"S... | logging the error and creates {@link ATError} list output
@param e
@param logger
@param validator
@param key
@param suffix
@param defaultMessagePrefix
@return | [
"logging",
"the",
"error",
"and",
"creates",
"{",
"@link",
"ATError",
"}",
"list",
"output"
] | train | https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-security/admin-tools-security-dbuser/src/main/java/de/chandre/admintool/security/dbuser/contoller/ATSecDBAbctractController.java#L52-L55 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/redis/Cache.java | Cache.zcount | public Long zcount(Object key, double min, double max) {
"""
返回有序集 key 中, score 值在 min 和 max 之间(默认包括 score 值等于 min 或 max )的成员的数量。
关于参数 min 和 max 的详细使用方法,请参考 ZRANGEBYSCORE 命令。
"""
Jedis jedis = getJedis();
try {
return jedis.zcount(keyToBytes(key), min, max);
}
finally {close(jedis);}
} | java | public Long zcount(Object key, double min, double max) {
Jedis jedis = getJedis();
try {
return jedis.zcount(keyToBytes(key), min, max);
}
finally {close(jedis);}
} | [
"public",
"Long",
"zcount",
"(",
"Object",
"key",
",",
"double",
"min",
",",
"double",
"max",
")",
"{",
"Jedis",
"jedis",
"=",
"getJedis",
"(",
")",
";",
"try",
"{",
"return",
"jedis",
".",
"zcount",
"(",
"keyToBytes",
"(",
"key",
")",
",",
"min",
... | 返回有序集 key 中, score 值在 min 和 max 之间(默认包括 score 值等于 min 或 max )的成员的数量。
关于参数 min 和 max 的详细使用方法,请参考 ZRANGEBYSCORE 命令。 | [
"返回有序集",
"key",
"中,",
"score",
"值在",
"min",
"和",
"max",
"之间",
"(",
"默认包括",
"score",
"值等于",
"min",
"或",
"max",
")",
"的成员的数量。",
"关于参数",
"min",
"和",
"max",
"的详细使用方法,请参考",
"ZRANGEBYSCORE",
"命令。"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/redis/Cache.java#L1030-L1036 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/Transformation2D.java | Transformation2D.setRotate | void setRotate(double angle_in_Radians, Point2D rotationCenter) {
"""
Sets this transformation to be a rotation around point rotationCenter.
When the axis Y is directed up and X is directed to the right, the
positive angle corresponds to the anti-clockwise rotation. When the axis
Y is directed down and X is d... | java | void setRotate(double angle_in_Radians, Point2D rotationCenter) {
setRotate(Math.cos(angle_in_Radians), Math.sin(angle_in_Radians),
rotationCenter);
} | [
"void",
"setRotate",
"(",
"double",
"angle_in_Radians",
",",
"Point2D",
"rotationCenter",
")",
"{",
"setRotate",
"(",
"Math",
".",
"cos",
"(",
"angle_in_Radians",
")",
",",
"Math",
".",
"sin",
"(",
"angle_in_Radians",
")",
",",
"rotationCenter",
")",
";",
"}... | Sets this transformation to be a rotation around point rotationCenter.
When the axis Y is directed up and X is directed to the right, the
positive angle corresponds to the anti-clockwise rotation. When the axis
Y is directed down and X is directed to the right, the positive angle
corresponds to the clockwise rotation.... | [
"Sets",
"this",
"transformation",
"to",
"be",
"a",
"rotation",
"around",
"point",
"rotationCenter",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/Transformation2D.java#L709-L712 |
voldemort/voldemort | src/java/voldemort/utils/UpdateClusterUtils.java | UpdateClusterUtils.updateCluster | public static Cluster updateCluster(Cluster currentCluster, List<Node> updatedNodeList) {
"""
Concatenates the list of current nodes in the given cluster with the new
nodes provided and returns an updated cluster metadata. <br>
If the nodes being updated already exist in the current metadata, we take
the update... | java | public static Cluster updateCluster(Cluster currentCluster, List<Node> updatedNodeList) {
List<Node> newNodeList = new ArrayList<Node>(updatedNodeList);
for(Node currentNode: currentCluster.getNodes()) {
if(!updatedNodeList.contains(currentNode))
newNodeList.add(currentNode);... | [
"public",
"static",
"Cluster",
"updateCluster",
"(",
"Cluster",
"currentCluster",
",",
"List",
"<",
"Node",
">",
"updatedNodeList",
")",
"{",
"List",
"<",
"Node",
">",
"newNodeList",
"=",
"new",
"ArrayList",
"<",
"Node",
">",
"(",
"updatedNodeList",
")",
";"... | Concatenates the list of current nodes in the given cluster with the new
nodes provided and returns an updated cluster metadata. <br>
If the nodes being updated already exist in the current metadata, we take
the updated ones
@param currentCluster The current cluster metadata
@param updatedNodeList The list of new node... | [
"Concatenates",
"the",
"list",
"of",
"current",
"nodes",
"in",
"the",
"given",
"cluster",
"with",
"the",
"new",
"nodes",
"provided",
"and",
"returns",
"an",
"updated",
"cluster",
"metadata",
".",
"<br",
">",
"If",
"the",
"nodes",
"being",
"updated",
"already... | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/UpdateClusterUtils.java#L120-L131 |
james-hu/jabb-core | src/main/java/net/sf/jabb/camel/RegistryUtility.java | RegistryUtility.addDecoder | @SuppressWarnings("unchecked")
static public void addDecoder(CamelContext context, String name, ChannelUpstreamHandler decoder) {
"""
Adds an Netty decoder to Registry.<br>
向Registry中增加一个给Netty用的decoder。
@param context The CamelContext must be based on CombinedRegistry, otherwise ClassCastException will be thr... | java | @SuppressWarnings("unchecked")
static public void addDecoder(CamelContext context, String name, ChannelUpstreamHandler decoder){
CombinedRegistry registry = getCombinedRegistry(context);
addCodecOnly(registry, name, decoder);
List<ChannelUpstreamHandler> decoders;
Object o = registry.lookup(NAME_DECOD... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"public",
"void",
"addDecoder",
"(",
"CamelContext",
"context",
",",
"String",
"name",
",",
"ChannelUpstreamHandler",
"decoder",
")",
"{",
"CombinedRegistry",
"registry",
"=",
"getCombinedRegistry",
"(",
... | Adds an Netty decoder to Registry.<br>
向Registry中增加一个给Netty用的decoder。
@param context The CamelContext must be based on CombinedRegistry, otherwise ClassCastException will be thrown.<br>
这个context必须是采用CombinedRegistry类型的Registry的,否则会抛出格式转换异常。
@param name Name of the decoder in Registry.<br>
decoder在Registry中的名字。
@param... | [
"Adds",
"an",
"Netty",
"decoder",
"to",
"Registry",
".",
"<br",
">",
"向Registry中增加一个给Netty用的decoder。"
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/camel/RegistryUtility.java#L106-L124 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/actions/PurgeEndpointAction.java | PurgeEndpointAction.resolveEndpointName | protected Endpoint resolveEndpointName(String endpointName) {
"""
Resolve the endpoint by name.
@param endpointName the name to resolve
@return the Endpoint object
"""
try {
return beanFactory.getBean(endpointName, Endpoint.class);
} catch (BeansException e) {
throw ne... | java | protected Endpoint resolveEndpointName(String endpointName) {
try {
return beanFactory.getBean(endpointName, Endpoint.class);
} catch (BeansException e) {
throw new CitrusRuntimeException(String.format("Unable to resolve endpoint for name '%s'", endpointName), e);
}
} | [
"protected",
"Endpoint",
"resolveEndpointName",
"(",
"String",
"endpointName",
")",
"{",
"try",
"{",
"return",
"beanFactory",
".",
"getBean",
"(",
"endpointName",
",",
"Endpoint",
".",
"class",
")",
";",
"}",
"catch",
"(",
"BeansException",
"e",
")",
"{",
"t... | Resolve the endpoint by name.
@param endpointName the name to resolve
@return the Endpoint object | [
"Resolve",
"the",
"endpoint",
"by",
"name",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/actions/PurgeEndpointAction.java#L144-L150 |
acromusashi/acromusashi-stream-ml | src/main/java/acromusashi/stream/ml/anomaly/lof/LofCalculator.java | LofCalculator.calculateLofWithoutUpdate | public static double calculateLofWithoutUpdate(int kn, LofPoint targetPoint, LofDataSet dataSet) {
"""
指定したK値、対象点、データセットを基に局所外れ係数スコアを算出する。<br>
本メソッド呼び出しによってデータセットの更新は行われない。<br>
学習データの更新を伴わないため、高速に処理が可能となっている。
@param kn K値
@param targetPoint 対象点
@param dataSet 学習データセット
@return LOFスコア
"""
// 対象点の... | java | public static double calculateLofWithoutUpdate(int kn, LofPoint targetPoint, LofDataSet dataSet)
{
// 対象点のK距離、K距離近傍を算出する。
KDistanceResult kResult = calculateKDistance(kn, targetPoint, dataSet);
LofPoint tmpPoint = targetPoint.deepCopy();
tmpPoint.setkDistance(kResult.getkDistance())... | [
"public",
"static",
"double",
"calculateLofWithoutUpdate",
"(",
"int",
"kn",
",",
"LofPoint",
"targetPoint",
",",
"LofDataSet",
"dataSet",
")",
"{",
"// 対象点のK距離、K距離近傍を算出する。",
"KDistanceResult",
"kResult",
"=",
"calculateKDistance",
"(",
"kn",
",",
"targetPoint",
",",
... | 指定したK値、対象点、データセットを基に局所外れ係数スコアを算出する。<br>
本メソッド呼び出しによってデータセットの更新は行われない。<br>
学習データの更新を伴わないため、高速に処理が可能となっている。
@param kn K値
@param targetPoint 対象点
@param dataSet 学習データセット
@return LOFスコア | [
"指定したK値、対象点、データセットを基に局所外れ係数スコアを算出する。<br",
">",
"本メソッド呼び出しによってデータセットの更新は行われない。<br",
">",
"学習データの更新を伴わないため、高速に処理が可能となっている。"
] | train | https://github.com/acromusashi/acromusashi-stream-ml/blob/26d6799a917cacda68e21d506c75cfeb17d832a6/src/main/java/acromusashi/stream/ml/anomaly/lof/LofCalculator.java#L117-L131 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.setOrtho2D | public Matrix4x3d setOrtho2D(double left, double right, double bottom, double top) {
"""
Set this matrix to be an orthographic projection transformation for a right-handed coordinate system.
<p>
This method is equivalent to calling {@link #setOrtho(double, double, double, double, double, double) setOrtho()} with... | java | public Matrix4x3d setOrtho2D(double left, double right, double bottom, double top) {
m00 = 2.0 / (right - left);
m01 = 0.0;
m02 = 0.0;
m10 = 0.0;
m11 = 2.0 / (top - bottom);
m12 = 0.0;
m20 = 0.0;
m21 = 0.0;
m22 = -1.0;
m30 = -(right + left)... | [
"public",
"Matrix4x3d",
"setOrtho2D",
"(",
"double",
"left",
",",
"double",
"right",
",",
"double",
"bottom",
",",
"double",
"top",
")",
"{",
"m00",
"=",
"2.0",
"/",
"(",
"right",
"-",
"left",
")",
";",
"m01",
"=",
"0.0",
";",
"m02",
"=",
"0.0",
";... | Set this matrix to be an orthographic projection transformation for a right-handed coordinate system.
<p>
This method is equivalent to calling {@link #setOrtho(double, double, double, double, double, double) setOrtho()} with
<code>zNear=-1</code> and <code>zFar=+1</code>.
<p>
In order to apply the orthographic projecti... | [
"Set",
"this",
"matrix",
"to",
"be",
"an",
"orthographic",
"projection",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
".",
"<p",
">",
"This",
"method",
"is",
"equivalent",
"to",
"calling",
"{",
"@link",
"#setOrtho",
"(",
"dou... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L7712-L7727 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/base/base_resource.java | base_resource.add_resource | protected base_resource[] add_resource(nitro_service service, options option) throws Exception {
"""
Use this method to perform a add operation on MPS resource.
@param service nitro_service object.
@param option options class object.
@return status of the operation performed.
@throws Exception
"""
if (... | java | protected base_resource[] add_resource(nitro_service service, options option) throws Exception
{
if (!service.isLogin() && !get_object_type().equals("login"))
service.login();
String request = resource_to_string(service, option);
return post_data(service, request);
} | [
"protected",
"base_resource",
"[",
"]",
"add_resource",
"(",
"nitro_service",
"service",
",",
"options",
"option",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"service",
".",
"isLogin",
"(",
")",
"&&",
"!",
"get_object_type",
"(",
")",
".",
"equals",
... | Use this method to perform a add operation on MPS 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",
"MPS",
"resource",
"."
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/base/base_resource.java#L216-L223 |
jMotif/SAX | src/main/java/net/seninp/jmotif/distance/EuclideanDistance.java | EuclideanDistance.seriesDistance | public double seriesDistance(double[][] series1, double[][] series2) throws Exception {
"""
Calculates Euclidean distance between two multi-dimensional time-series of equal length.
@param series1 The first series.
@param series2 The second series.
@return The eclidean distance.
@throws Exception if error occ... | java | public double seriesDistance(double[][] series1, double[][] series2) throws Exception {
if (series1.length == series2.length) {
Double res = 0D;
for (int i = 0; i < series1.length; i++) {
res = res + distance2(series1[i], series2[i]);
}
return Math.sqrt(res);
}
else {... | [
"public",
"double",
"seriesDistance",
"(",
"double",
"[",
"]",
"[",
"]",
"series1",
",",
"double",
"[",
"]",
"[",
"]",
"series2",
")",
"throws",
"Exception",
"{",
"if",
"(",
"series1",
".",
"length",
"==",
"series2",
".",
"length",
")",
"{",
"Double",
... | Calculates Euclidean distance between two multi-dimensional time-series of equal length.
@param series1 The first series.
@param series2 The second series.
@return The eclidean distance.
@throws Exception if error occures. | [
"Calculates",
"Euclidean",
"distance",
"between",
"two",
"multi",
"-",
"dimensional",
"time",
"-",
"series",
"of",
"equal",
"length",
"."
] | train | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/distance/EuclideanDistance.java#L119-L130 |
kmi/iserve | iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/GenericLogicDiscoverer.java | GenericLogicDiscoverer.findOperationsConsumingAll | @Override
public Map<URI, MatchResult> findOperationsConsumingAll(Set<URI> inputTypes) {
"""
Discover registered operations that consume all the types of input provided. That is, all those that have as input
the types provided. All the input types should be matched to different inputs.
@param inputTypes th... | java | @Override
public Map<URI, MatchResult> findOperationsConsumingAll(Set<URI> inputTypes) {
return findOperationsConsumingAll(inputTypes, LogicConceptMatchType.Plugin);
} | [
"@",
"Override",
"public",
"Map",
"<",
"URI",
",",
"MatchResult",
">",
"findOperationsConsumingAll",
"(",
"Set",
"<",
"URI",
">",
"inputTypes",
")",
"{",
"return",
"findOperationsConsumingAll",
"(",
"inputTypes",
",",
"LogicConceptMatchType",
".",
"Plugin",
")",
... | Discover registered operations that consume all the types of input provided. That is, all those that have as input
the types provided. All the input types should be matched to different inputs.
@param inputTypes the types of input to be consumed
@return a Set containing all the matching operations. If there are no sol... | [
"Discover",
"registered",
"operations",
"that",
"consume",
"all",
"the",
"types",
"of",
"input",
"provided",
".",
"That",
"is",
"all",
"those",
"that",
"have",
"as",
"input",
"the",
"types",
"provided",
".",
"All",
"the",
"input",
"types",
"should",
"be",
... | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/GenericLogicDiscoverer.java#L248-L251 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java | Validator.expectMatch | public void expectMatch(String name, String anotherName, String message) {
"""
Validates to fields to (case-insensitive) match
@param name The field to check
@param anotherName The field to check against
@param message A custom error message instead of the default one
"""
String value = Optional.o... | java | public void expectMatch(String name, String anotherName, String message) {
String value = Optional.ofNullable(get(name)).orElse("");
String anotherValue = Optional.ofNullable(get(anotherName)).orElse("");
if (( StringUtils.isBlank(value) && StringUtils.isBlank(anotherValue) ) || ( StringUtils.i... | [
"public",
"void",
"expectMatch",
"(",
"String",
"name",
",",
"String",
"anotherName",
",",
"String",
"message",
")",
"{",
"String",
"value",
"=",
"Optional",
".",
"ofNullable",
"(",
"get",
"(",
"name",
")",
")",
".",
"orElse",
"(",
"\"\"",
")",
";",
"S... | Validates to fields to (case-insensitive) match
@param name The field to check
@param anotherName The field to check against
@param message A custom error message instead of the default one | [
"Validates",
"to",
"fields",
"to",
"(",
"case",
"-",
"insensitive",
")",
"match"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java#L208-L215 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/TreeMenuExample.java | TreeMenuExample.buildTreeMenuWithDecoratedLabel | private WMenu buildTreeMenuWithDecoratedLabel() {
"""
Tree menu containing image in the items. This example demonstrates creating {@link WSubMenu} and
{@link WMenuItem} components with {@link WDecoratedLabel}.
@return menu with a decorated label
"""
WMenu menu = new WMenu(WMenu.MenuType.TREE);
WDecora... | java | private WMenu buildTreeMenuWithDecoratedLabel() {
WMenu menu = new WMenu(WMenu.MenuType.TREE);
WDecoratedLabel dLabel = new WDecoratedLabel(null, new WText("Settings Menu"), new WImage(
"/image/settings.png", "settings"));
WSubMenu settings = new WSubMenu(dLabel);
settings.setMode(WSubMenu.MenuMode.LAZY);
... | [
"private",
"WMenu",
"buildTreeMenuWithDecoratedLabel",
"(",
")",
"{",
"WMenu",
"menu",
"=",
"new",
"WMenu",
"(",
"WMenu",
".",
"MenuType",
".",
"TREE",
")",
";",
"WDecoratedLabel",
"dLabel",
"=",
"new",
"WDecoratedLabel",
"(",
"null",
",",
"new",
"WText",
"(... | Tree menu containing image in the items. This example demonstrates creating {@link WSubMenu} and
{@link WMenuItem} components with {@link WDecoratedLabel}.
@return menu with a decorated label | [
"Tree",
"menu",
"containing",
"image",
"in",
"the",
"items",
".",
"This",
"example",
"demonstrates",
"creating",
"{",
"@link",
"WSubMenu",
"}",
"and",
"{",
"@link",
"WMenuItem",
"}",
"components",
"with",
"{",
"@link",
"WDecoratedLabel",
"}",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/TreeMenuExample.java#L152-L187 |
aws/aws-sdk-java | aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/model/ReEncryptRequest.java | ReEncryptRequest.withSourceEncryptionContext | public ReEncryptRequest withSourceEncryptionContext(java.util.Map<String, String> sourceEncryptionContext) {
"""
<p>
Encryption context used to encrypt and decrypt the data specified in the <code>CiphertextBlob</code> parameter.
</p>
@param sourceEncryptionContext
Encryption context used to encrypt and decry... | java | public ReEncryptRequest withSourceEncryptionContext(java.util.Map<String, String> sourceEncryptionContext) {
setSourceEncryptionContext(sourceEncryptionContext);
return this;
} | [
"public",
"ReEncryptRequest",
"withSourceEncryptionContext",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"sourceEncryptionContext",
")",
"{",
"setSourceEncryptionContext",
"(",
"sourceEncryptionContext",
")",
";",
"return",
"this",
";",
... | <p>
Encryption context used to encrypt and decrypt the data specified in the <code>CiphertextBlob</code> parameter.
</p>
@param sourceEncryptionContext
Encryption context used to encrypt and decrypt the data specified in the <code>CiphertextBlob</code>
parameter.
@return Returns a reference to this object so that meth... | [
"<p",
">",
"Encryption",
"context",
"used",
"to",
"encrypt",
"and",
"decrypt",
"the",
"data",
"specified",
"in",
"the",
"<code",
">",
"CiphertextBlob<",
"/",
"code",
">",
"parameter",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/model/ReEncryptRequest.java#L206-L209 |
grpc/grpc-java | api/src/main/java/io/grpc/MethodDescriptor.java | MethodDescriptor.generateFullMethodName | public static String generateFullMethodName(String fullServiceName, String methodName) {
"""
Generate the fully qualified method name. This matches the name
@param fullServiceName the fully qualified service name that is prefixed with the package name
@param methodName the short method name
@since 1.0.0
... | java | public static String generateFullMethodName(String fullServiceName, String methodName) {
return checkNotNull(fullServiceName, "fullServiceName")
+ "/"
+ checkNotNull(methodName, "methodName");
} | [
"public",
"static",
"String",
"generateFullMethodName",
"(",
"String",
"fullServiceName",
",",
"String",
"methodName",
")",
"{",
"return",
"checkNotNull",
"(",
"fullServiceName",
",",
"\"fullServiceName\"",
")",
"+",
"\"/\"",
"+",
"checkNotNull",
"(",
"methodName",
... | Generate the fully qualified method name. This matches the name
@param fullServiceName the fully qualified service name that is prefixed with the package name
@param methodName the short method name
@since 1.0.0 | [
"Generate",
"the",
"fully",
"qualified",
"method",
"name",
".",
"This",
"matches",
"the",
"name"
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/api/src/main/java/io/grpc/MethodDescriptor.java#L386-L390 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/objdetect/Yolo2OutputLayer.java | Yolo2OutputLayer.getProbabilityMatrix | public INDArray getProbabilityMatrix(INDArray networkOutput, int example, int classNumber) {
"""
Get the probability matrix (probability of the specified class, assuming an object is present, for all x/y
positions), from the network output activations array
@param networkOutput Network output activations
@par... | java | public INDArray getProbabilityMatrix(INDArray networkOutput, int example, int classNumber){
//Input format: [minibatch, 5B+C, H, W], with order [x,y,w,h,c]
//Therefore: probabilities for class I is at depths 5B + classNumber
val bbs = layerConf().getBoundingBoxes().size(0);
INDArray con... | [
"public",
"INDArray",
"getProbabilityMatrix",
"(",
"INDArray",
"networkOutput",
",",
"int",
"example",
",",
"int",
"classNumber",
")",
"{",
"//Input format: [minibatch, 5B+C, H, W], with order [x,y,w,h,c]",
"//Therefore: probabilities for class I is at depths 5B + classNumber",
"val"... | Get the probability matrix (probability of the specified class, assuming an object is present, for all x/y
positions), from the network output activations array
@param networkOutput Network output activations
@param example Example number, in minibatch
@param classNumber Class number
@return Confidence matrix | [
"Get",
"the",
"probability",
"matrix",
"(",
"probability",
"of",
"the",
"specified",
"class",
"assuming",
"an",
"object",
"is",
"present",
"for",
"all",
"x",
"/",
"y",
"positions",
")",
"from",
"the",
"network",
"output",
"activations",
"array"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/objdetect/Yolo2OutputLayer.java#L666-L673 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClassManager.java | CSSClassManager.getClass | public CSSClass getClass(String name, Object owner) throws CSSNamingConflict {
"""
Retrieve a single class by name and owner
@param name Class name
@param owner Class owner
@return existing (old) class
@throws CSSNamingConflict if an owner was specified and doesn't match
"""
CSSClass existing = store... | java | public CSSClass getClass(String name, Object owner) throws CSSNamingConflict {
CSSClass existing = store.get(name);
// Not found.
if (existing == null) {
return null;
}
// Different owner
if (owner != null && existing.getOwner() != owner) {
throw new CSSNamingConflict("CSS class nami... | [
"public",
"CSSClass",
"getClass",
"(",
"String",
"name",
",",
"Object",
"owner",
")",
"throws",
"CSSNamingConflict",
"{",
"CSSClass",
"existing",
"=",
"store",
".",
"get",
"(",
"name",
")",
";",
"// Not found.",
"if",
"(",
"existing",
"==",
"null",
")",
"{... | Retrieve a single class by name and owner
@param name Class name
@param owner Class owner
@return existing (old) class
@throws CSSNamingConflict if an owner was specified and doesn't match | [
"Retrieve",
"a",
"single",
"class",
"by",
"name",
"and",
"owner"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClassManager.java#L83-L94 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/packet/Message.java | Message.addBody | public Body addBody(String language, String body) {
"""
Adds a body with a corresponding language.
@param language the language of the body being added.
@param body the body being added to the message.
@return the new {@link org.jivesoftware.smack.packet.Message.Body}
@throws NullPointerException if the body... | java | public Body addBody(String language, String body) {
language = determineLanguage(language);
removeBody(language);
Body messageBody = new Body(language, body);
addExtension(messageBody);
return messageBody;
} | [
"public",
"Body",
"addBody",
"(",
"String",
"language",
",",
"String",
"body",
")",
"{",
"language",
"=",
"determineLanguage",
"(",
"language",
")",
";",
"removeBody",
"(",
"language",
")",
";",
"Body",
"messageBody",
"=",
"new",
"Body",
"(",
"language",
"... | Adds a body with a corresponding language.
@param language the language of the body being added.
@param body the body being added to the message.
@return the new {@link org.jivesoftware.smack.packet.Message.Body}
@throws NullPointerException if the body is null, a null pointer exception is thrown
@since 3.0.2 | [
"Adds",
"a",
"body",
"with",
"a",
"corresponding",
"language",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/packet/Message.java#L380-L388 |
Azure/azure-sdk-for-java | common/azure-common-auth/src/main/java/com/azure/common/auth/credentials/DelegatedTokenCredentials.java | DelegatedTokenCredentials.fromFile | public static DelegatedTokenCredentials fromFile(File authFile, String redirectUrl) throws IOException {
"""
Creates a new instance of the DelegatedTokenCredentials from an auth file.
@param authFile The credentials based on the file
@param redirectUrl the URL to redirect to after authentication in Active Dire... | java | public static DelegatedTokenCredentials fromFile(File authFile, String redirectUrl) throws IOException {
return new DelegatedTokenCredentials(ApplicationTokenCredentials.fromFile(authFile), redirectUrl);
} | [
"public",
"static",
"DelegatedTokenCredentials",
"fromFile",
"(",
"File",
"authFile",
",",
"String",
"redirectUrl",
")",
"throws",
"IOException",
"{",
"return",
"new",
"DelegatedTokenCredentials",
"(",
"ApplicationTokenCredentials",
".",
"fromFile",
"(",
"authFile",
")"... | Creates a new instance of the DelegatedTokenCredentials from an auth file.
@param authFile The credentials based on the file
@param redirectUrl the URL to redirect to after authentication in Active Directory
@return a new delegated token credentials
@throws IOException exception thrown from file access errors. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"DelegatedTokenCredentials",
"from",
"an",
"auth",
"file",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common-auth/src/main/java/com/azure/common/auth/credentials/DelegatedTokenCredentials.java#L73-L75 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java | AbstractHttpTransport.getParameter | protected static String getParameter(HttpServletRequest request, String[] aliases) {
"""
Returns the value of the requested parameter from the request, or null
@param request
the request object
@param aliases
array of query arg names by which the request may be specified
@return the value of the param, or n... | java | protected static String getParameter(HttpServletRequest request, String[] aliases) {
final String sourceMethod = "getParameter"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{request.getQueryString(), Arrays.as... | [
"protected",
"static",
"String",
"getParameter",
"(",
"HttpServletRequest",
"request",
",",
"String",
"[",
"]",
"aliases",
")",
"{",
"final",
"String",
"sourceMethod",
"=",
"\"getParameter\"",
";",
"//$NON-NLS-1$\r",
"boolean",
"isTraceLogging",
"=",
"log",
".",
"... | Returns the value of the requested parameter from the request, or null
@param request
the request object
@param aliases
array of query arg names by which the request may be specified
@return the value of the param, or null if it is not specified under the
specified names | [
"Returns",
"the",
"value",
"of",
"the",
"requested",
"parameter",
"from",
"the",
"request",
"or",
"null"
] | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java#L506-L527 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.setOrthoSymmetricLH | public Matrix4x3d setOrthoSymmetricLH(double width, double height, double zNear, double zFar) {
"""
Set this matrix to be a symmetric orthographic projection transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code>.
<p>
This method is equivalent to calling {@link #s... | java | public Matrix4x3d setOrthoSymmetricLH(double width, double height, double zNear, double zFar) {
return setOrthoSymmetricLH(width, height, zNear, zFar, false);
} | [
"public",
"Matrix4x3d",
"setOrthoSymmetricLH",
"(",
"double",
"width",
",",
"double",
"height",
",",
"double",
"zNear",
",",
"double",
"zFar",
")",
"{",
"return",
"setOrthoSymmetricLH",
"(",
"width",
",",
"height",
",",
"zNear",
",",
"zFar",
",",
"false",
")... | Set this matrix to be a symmetric orthographic projection transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code>.
<p>
This method is equivalent to calling {@link #setOrthoLH(double, double, double, double, double, double) setOrthoLH()} with
<code>left=-width/2</code>, <co... | [
"Set",
"this",
"matrix",
"to",
"be",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"using",
"OpenGL",
"s",
"NDC",
"z",
"range",
"of",
"<code",
">",
"[",
"-",
"1",
"..",
"+",
"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L7503-L7505 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_rule_ruleId_GET | public OvhOvhPabxDialplanExtensionRule billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_rule_ruleId_GET(String billingAccount, String serviceName, Long dialplanId, Long extensionId, Long ruleId) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}... | java | public OvhOvhPabxDialplanExtensionRule billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_rule_ruleId_GET(String billingAccount, String serviceName, Long dialplanId, Long extensionId, Long ruleId) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan... | [
"public",
"OvhOvhPabxDialplanExtensionRule",
"billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_rule_ruleId_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"dialplanId",
",",
"Long",
"extensionId",
",",
"Long",
"ruleId",
... | Get this object properties
REST: GET /telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}/extension/{extensionId}/rule/{ruleId}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param dialplanId [required]
@param extensionId [required]
@param ruleId [req... | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7243-L7248 |
jhalterman/failsafe | src/main/java/net/jodah/failsafe/FailsafeExecutor.java | FailsafeExecutor.get | public <T extends R> T get(CheckedSupplier<T> supplier) {
"""
Executes the {@code supplier} until a successful result is returned or the configured policies are exceeded.
@throws NullPointerException if the {@code supplier} is null
@throws FailsafeException if the {@code supplier} fails with a checked Exceptio... | java | public <T extends R> T get(CheckedSupplier<T> supplier) {
return call(execution -> Assert.notNull(supplier, "supplier"));
} | [
"public",
"<",
"T",
"extends",
"R",
">",
"T",
"get",
"(",
"CheckedSupplier",
"<",
"T",
">",
"supplier",
")",
"{",
"return",
"call",
"(",
"execution",
"->",
"Assert",
".",
"notNull",
"(",
"supplier",
",",
"\"supplier\"",
")",
")",
";",
"}"
] | Executes the {@code supplier} until a successful result is returned or the configured policies are exceeded.
@throws NullPointerException if the {@code supplier} is null
@throws FailsafeException if the {@code supplier} fails with a checked Exception or if interrupted while
waiting to perform a retry.
@throws CircuitB... | [
"Executes",
"the",
"{",
"@code",
"supplier",
"}",
"until",
"a",
"successful",
"result",
"is",
"returned",
"or",
"the",
"configured",
"policies",
"are",
"exceeded",
"."
] | train | https://github.com/jhalterman/failsafe/blob/65fcd3a82f7b232d2ff59bc525a59d693dd8e223/src/main/java/net/jodah/failsafe/FailsafeExecutor.java#L68-L70 |
google/auto | value/src/main/java/com/google/auto/value/processor/TemplateVars.java | TemplateVars.readerFromUrl | private static Reader readerFromUrl(String resourceName) throws IOException {
"""
through the getResourceAsStream should be a lot more efficient than reopening the jar.
"""
URL resourceUrl = TemplateVars.class.getResource(resourceName);
InputStream in;
try {
if (resourceUrl.getProtocol().equa... | java | private static Reader readerFromUrl(String resourceName) throws IOException {
URL resourceUrl = TemplateVars.class.getResource(resourceName);
InputStream in;
try {
if (resourceUrl.getProtocol().equalsIgnoreCase("file")) {
in = inputStreamFromFile(resourceUrl);
} else if (resourceUrl.getP... | [
"private",
"static",
"Reader",
"readerFromUrl",
"(",
"String",
"resourceName",
")",
"throws",
"IOException",
"{",
"URL",
"resourceUrl",
"=",
"TemplateVars",
".",
"class",
".",
"getResource",
"(",
"resourceName",
")",
";",
"InputStream",
"in",
";",
"try",
"{",
... | through the getResourceAsStream should be a lot more efficient than reopening the jar. | [
"through",
"the",
"getResourceAsStream",
"should",
"be",
"a",
"lot",
"more",
"efficient",
"than",
"reopening",
"the",
"jar",
"."
] | train | https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/value/src/main/java/com/google/auto/value/processor/TemplateVars.java#L156-L171 |
nmdp-bioinformatics/ngs | reads/src/main/java/org/nmdp/ngs/reads/paired/PairedEndFastqReader.java | PairedEndFastqReader.streamInterleaved | public static void streamInterleaved(final Readable readable, final PairedEndListener listener) throws IOException {
"""
Stream the specified interleaved paired end reads. Per the interleaved format, all reads must be sorted and paired.
@param readable readable, must not be null
@param listener paired end lis... | java | public static void streamInterleaved(final Readable readable, final PairedEndListener listener) throws IOException {
checkNotNull(readable);
checkNotNull(listener);
StreamListener streamListener = new StreamListener() {
private Fastq left;
@Override
... | [
"public",
"static",
"void",
"streamInterleaved",
"(",
"final",
"Readable",
"readable",
",",
"final",
"PairedEndListener",
"listener",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"readable",
")",
";",
"checkNotNull",
"(",
"listener",
")",
";",
"StreamLi... | Stream the specified interleaved paired end reads. Per the interleaved format, all reads must be sorted and paired.
@param readable readable, must not be null
@param listener paired end listener, must not be null
@throws IOException if an I/O error occurs | [
"Stream",
"the",
"specified",
"interleaved",
"paired",
"end",
"reads",
".",
"Per",
"the",
"interleaved",
"format",
"all",
"reads",
"must",
"be",
"sorted",
"and",
"paired",
"."
] | train | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/reads/src/main/java/org/nmdp/ngs/reads/paired/PairedEndFastqReader.java#L265-L294 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/acknowledge/BulkSQSOperation.java | BulkSQSOperation.bulkAction | public void bulkAction(List<SQSMessageIdentifier> messageIdentifierList, int indexOfMessage)
throws JMSException {
"""
Bulk action on list of message identifiers up to the provided index
@param messageIdentifierList
Container for the list of message identifiers
@param indexOfMessage
The action wi... | java | public void bulkAction(List<SQSMessageIdentifier> messageIdentifierList, int indexOfMessage)
throws JMSException {
assert indexOfMessage > 0;
assert indexOfMessage <= messageIdentifierList.size();
Map<String, List<String>> receiptHandleWithSameQueueUrl = new HashMap<String, List<St... | [
"public",
"void",
"bulkAction",
"(",
"List",
"<",
"SQSMessageIdentifier",
">",
"messageIdentifierList",
",",
"int",
"indexOfMessage",
")",
"throws",
"JMSException",
"{",
"assert",
"indexOfMessage",
">",
"0",
";",
"assert",
"indexOfMessage",
"<=",
"messageIdentifierLis... | Bulk action on list of message identifiers up to the provided index
@param messageIdentifierList
Container for the list of message identifiers
@param indexOfMessage
The action will apply to all messages up to this index
@throws JMSException
if <code>action</code> throws | [
"Bulk",
"action",
"on",
"list",
"of",
"message",
"identifiers",
"up",
"to",
"the",
"provided",
"index"
] | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/acknowledge/BulkSQSOperation.java#L43-L77 |
foundation-runtime/service-directory | 1.1/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryLookupService.java | DirectoryLookupService.removeNotificationHandler | public void removeNotificationHandler(String serviceName, NotificationHandler handler) {
"""
Remove the NotificationHandler from the Service.
@param serviceName
the service name.
@param handler
the NotificationHandler for the service.
"""
ServiceInstanceUtils.validateServiceName(serviceName);
... | java | public void removeNotificationHandler(String serviceName, NotificationHandler handler){
ServiceInstanceUtils.validateServiceName(serviceName);
if (handler == null) {
throw new ServiceException(ErrorCode.SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR,
ErrorCode.SERVICE_DIRECTORY_N... | [
"public",
"void",
"removeNotificationHandler",
"(",
"String",
"serviceName",
",",
"NotificationHandler",
"handler",
")",
"{",
"ServiceInstanceUtils",
".",
"validateServiceName",
"(",
"serviceName",
")",
";",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"throw",
"... | Remove the NotificationHandler from the Service.
@param serviceName
the service name.
@param handler
the NotificationHandler for the service. | [
"Remove",
"the",
"NotificationHandler",
"from",
"the",
"Service",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/1.1/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryLookupService.java#L231-L251 |
apache/groovy | src/main/java/org/apache/groovy/ast/tools/ClassNodeUtils.java | ClassNodeUtils.addGeneratedConstructor | public static void addGeneratedConstructor(ClassNode classNode, ConstructorNode consNode) {
"""
Add a method that is marked as @Generated.
@see ClassNode#addConstructor(ConstructorNode)
"""
classNode.addConstructor(consNode);
markAsGenerated(classNode, consNode);
} | java | public static void addGeneratedConstructor(ClassNode classNode, ConstructorNode consNode) {
classNode.addConstructor(consNode);
markAsGenerated(classNode, consNode);
} | [
"public",
"static",
"void",
"addGeneratedConstructor",
"(",
"ClassNode",
"classNode",
",",
"ConstructorNode",
"consNode",
")",
"{",
"classNode",
".",
"addConstructor",
"(",
"consNode",
")",
";",
"markAsGenerated",
"(",
"classNode",
",",
"consNode",
")",
";",
"}"
] | Add a method that is marked as @Generated.
@see ClassNode#addConstructor(ConstructorNode) | [
"Add",
"a",
"method",
"that",
"is",
"marked",
"as",
"@Generated",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/apache/groovy/ast/tools/ClassNodeUtils.java#L132-L135 |
elki-project/elki | elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java | GeneratorXMLDatabaseConnection.processElementGamma | private void processElementGamma(GeneratorSingleCluster cluster, Node cur) {
"""
Process a 'gamma' Element in the XML stream.
@param cluster
@param cur Current document nod
"""
double k = 1.0;
double theta = 1.0;
String kstr = ((Element) cur).getAttribute(ATTR_K);
if(kstr != null && kstr.le... | java | private void processElementGamma(GeneratorSingleCluster cluster, Node cur) {
double k = 1.0;
double theta = 1.0;
String kstr = ((Element) cur).getAttribute(ATTR_K);
if(kstr != null && kstr.length() > 0) {
k = ParseUtil.parseDouble(kstr);
}
String thetastr = ((Element) cur).getAttribute(ATT... | [
"private",
"void",
"processElementGamma",
"(",
"GeneratorSingleCluster",
"cluster",
",",
"Node",
"cur",
")",
"{",
"double",
"k",
"=",
"1.0",
";",
"double",
"theta",
"=",
"1.0",
";",
"String",
"kstr",
"=",
"(",
"(",
"Element",
")",
"cur",
")",
".",
"getAt... | Process a 'gamma' Element in the XML stream.
@param cluster
@param cur Current document nod | [
"Process",
"a",
"gamma",
"Element",
"in",
"the",
"XML",
"stream",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L459-L484 |
astrapi69/jaulp-wicket | jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/application/OnlineSessionUsers.java | OnlineSessionUsers.replaceSessionId | public synchronized ID replaceSessionId(final USER user, final ID oldSessionId,
final ID newSessionId, final SESSION newSession) {
"""
Replace the given old session id with the new one.
@param user
the user
@param oldSessionId
the old session id
@param newSessionId
the new session id
@param newSession
... | java | public synchronized ID replaceSessionId(final USER user, final ID oldSessionId,
final ID newSessionId, final SESSION newSession)
{
remove(oldSessionId);
return addOnline(user, newSessionId, newSession);
} | [
"public",
"synchronized",
"ID",
"replaceSessionId",
"(",
"final",
"USER",
"user",
",",
"final",
"ID",
"oldSessionId",
",",
"final",
"ID",
"newSessionId",
",",
"final",
"SESSION",
"newSession",
")",
"{",
"remove",
"(",
"oldSessionId",
")",
";",
"return",
"addOn... | Replace the given old session id with the new one.
@param user
the user
@param oldSessionId
the old session id
@param newSessionId
the new session id
@param newSession
the new session object
@return the new session id that is associated with the given user. | [
"Replace",
"the",
"given",
"old",
"session",
"id",
"with",
"the",
"new",
"one",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/application/OnlineSessionUsers.java#L129-L134 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalFormat.java | DateIntervalFormat.getInstance | public static final DateIntervalFormat getInstance(String skeleton,
ULocale locale,
DateIntervalInfo dtitvinf) {
"""
Construct a DateIntervalFormat from skeleton
a DateIntervalInfo, and the given locale.
<P>
In ... | java | public static final DateIntervalFormat getInstance(String skeleton,
ULocale locale,
DateIntervalInfo dtitvinf)
{
// clone. If it is frozen, clone returns itself, otherwise, clone
// returns a copy.
... | [
"public",
"static",
"final",
"DateIntervalFormat",
"getInstance",
"(",
"String",
"skeleton",
",",
"ULocale",
"locale",
",",
"DateIntervalInfo",
"dtitvinf",
")",
"{",
"// clone. If it is frozen, clone returns itself, otherwise, clone",
"// returns a copy.",
"dtitvinf",
"=",
"(... | Construct a DateIntervalFormat from skeleton
a DateIntervalInfo, and the given locale.
<P>
In this factory method, user provides its own date interval pattern
information, instead of using those pre-defined data in resource file.
This factory method is for powerful users who want to provide their own
interval patterns... | [
"Construct",
"a",
"DateIntervalFormat",
"from",
"skeleton",
"a",
"DateIntervalInfo",
"and",
"the",
"given",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalFormat.java#L554-L563 |
ops4j/org.ops4j.base | ops4j-base-lang/src/main/java/org/ops4j/lang/PostConditionException.java | PostConditionException.validateNull | public static void validateNull( Object object, String identifier )
throws PostConditionException {
"""
Validates that the object is null.
@param object The object to be validated.
@param identifier The name of the object.
@throws PostConditionException if the object is not null.
"""
... | java | public static void validateNull( Object object, String identifier )
throws PostConditionException
{
if( object == null )
{
return;
}
throw new PostConditionException( identifier + " was NOT NULL." );
} | [
"public",
"static",
"void",
"validateNull",
"(",
"Object",
"object",
",",
"String",
"identifier",
")",
"throws",
"PostConditionException",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"return",
";",
"}",
"throw",
"new",
"PostConditionException",
"(",
"ide... | Validates that the object is null.
@param object The object to be validated.
@param identifier The name of the object.
@throws PostConditionException if the object is not null. | [
"Validates",
"that",
"the",
"object",
"is",
"null",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/PostConditionException.java#L65-L73 |
gsi-upm/BeastTool | beast-tool/src/main/java/es/upm/dit/gsi/beast/mock/jadex/common/MockAgentPlan.java | MockAgentPlan.sendRequestToDF | protected String sendRequestToDF(String df_service, Object msgContent) {
"""
Method to send Request messages to a specific df_service
@param df_service
The name of the df_service
@param msgContent
The content of the message to be sent
@return Message sent to + the name of the df_service
"""
IDF... | java | protected String sendRequestToDF(String df_service, Object msgContent) {
IDFComponentDescription[] receivers = getReceivers(df_service);
if (receivers.length > 0) {
IMessageEvent mevent = createMessageEvent("send_request");
mevent.getParameter(SFipa.CONTENT).setValue(msgContent)... | [
"protected",
"String",
"sendRequestToDF",
"(",
"String",
"df_service",
",",
"Object",
"msgContent",
")",
"{",
"IDFComponentDescription",
"[",
"]",
"receivers",
"=",
"getReceivers",
"(",
"df_service",
")",
";",
"if",
"(",
"receivers",
".",
"length",
">",
"0",
"... | Method to send Request messages to a specific df_service
@param df_service
The name of the df_service
@param msgContent
The content of the message to be sent
@return Message sent to + the name of the df_service | [
"Method",
"to",
"send",
"Request",
"messages",
"to",
"a",
"specific",
"df_service"
] | train | https://github.com/gsi-upm/BeastTool/blob/cc7fdc75cb818c5d60802aaf32c27829e0ca144c/beast-tool/src/main/java/es/upm/dit/gsi/beast/mock/jadex/common/MockAgentPlan.java#L51-L67 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/rename/CmsRenameDialog.java | CmsRenameDialog.loadAndShow | public void loadAndShow() {
"""
Loads the necessary data for the rename dialog from the server and then displays the rename dialog.<p>
"""
CmsRpcAction<CmsRenameInfoBean> infoAction = new CmsRpcAction<CmsRenameInfoBean>() {
@Override
public void execute() {
... | java | public void loadAndShow() {
CmsRpcAction<CmsRenameInfoBean> infoAction = new CmsRpcAction<CmsRenameInfoBean>() {
@Override
public void execute() {
start(0, true);
CmsCoreProvider.getVfsService().getRenameInfo(m_structureId, this);
}... | [
"public",
"void",
"loadAndShow",
"(",
")",
"{",
"CmsRpcAction",
"<",
"CmsRenameInfoBean",
">",
"infoAction",
"=",
"new",
"CmsRpcAction",
"<",
"CmsRenameInfoBean",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"{",
"start",
"(",
... | Loads the necessary data for the rename dialog from the server and then displays the rename dialog.<p> | [
"Loads",
"the",
"necessary",
"data",
"for",
"the",
"rename",
"dialog",
"from",
"the",
"server",
"and",
"then",
"displays",
"the",
"rename",
"dialog",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/rename/CmsRenameDialog.java#L68-L93 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java | HtmlTree.A | public static HtmlTree A(HtmlVersion htmlVersion, String attr, Content body) {
"""
Generates an HTML anchor tag with an id or a name attribute and content.
@param htmlVersion the version of the generated HTML
@param attr name or id attribute for the anchor tag
@param body content for the anchor tag
@return a... | java | public static HtmlTree A(HtmlVersion htmlVersion, String attr, Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.A);
htmltree.addAttr((htmlVersion == HtmlVersion.HTML4)
? HtmlAttr.NAME
: HtmlAttr.ID,
nullCheck(attr));
htmltree.addContent(nul... | [
"public",
"static",
"HtmlTree",
"A",
"(",
"HtmlVersion",
"htmlVersion",
",",
"String",
"attr",
",",
"Content",
"body",
")",
"{",
"HtmlTree",
"htmltree",
"=",
"new",
"HtmlTree",
"(",
"HtmlTag",
".",
"A",
")",
";",
"htmltree",
".",
"addAttr",
"(",
"(",
"ht... | Generates an HTML anchor tag with an id or a name attribute and content.
@param htmlVersion the version of the generated HTML
@param attr name or id attribute for the anchor tag
@param body content for the anchor tag
@return an HtmlTree object | [
"Generates",
"an",
"HTML",
"anchor",
"tag",
"with",
"an",
"id",
"or",
"a",
"name",
"attribute",
"and",
"content",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java#L243-L251 |
lucmoreau/ProvToolbox | prov-model/src/main/java/org/openprovenance/prov/model/DOMProcessing.java | DOMProcessing.newElement | final static public Element newElement(QualifiedName elementName, String value, QualifiedName type) {
"""
Creates a DOM {@link Element} for a {@link QualifiedName} and content given by value and type
@param elementName a {@link QualifiedName} to denote the element name
@param value for the created {@link Element... | java | final static public Element newElement(QualifiedName elementName, String value, QualifiedName type) {
org.w3c.dom.Document doc = builder.newDocument();
String qualifiedNameString;
qualifiedNameString= qualifiedNameToString(elementName.toQName());
Element el = doc.createElementNS(elementName.getNamespaceURI(),
... | [
"final",
"static",
"public",
"Element",
"newElement",
"(",
"QualifiedName",
"elementName",
",",
"String",
"value",
",",
"QualifiedName",
"type",
")",
"{",
"org",
".",
"w3c",
".",
"dom",
".",
"Document",
"doc",
"=",
"builder",
".",
"newDocument",
"(",
")",
... | Creates a DOM {@link Element} for a {@link QualifiedName} and content given by value and type
@param elementName a {@link QualifiedName} to denote the element name
@param value for the created {@link Element}
@param type of the value
@return a new {@link Element} | [
"Creates",
"a",
"DOM",
"{"
] | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-model/src/main/java/org/openprovenance/prov/model/DOMProcessing.java#L166-L182 |
mapsforge/mapsforge | mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/GeoUtils.java | GeoUtils.computeBitmask | public static short computeBitmask(final Geometry geometry, final TileCoordinate tile, final int enlargementInMeter) {
"""
A tile on zoom level <i>z</i> has exactly 16 sub tiles on zoom level <i>z+2</i>. For each of these 16 sub tiles
it is analyzed if the given way needs to be included. The result is represented... | java | public static short computeBitmask(final Geometry geometry, final TileCoordinate tile, final int enlargementInMeter) {
List<TileCoordinate> subtiles = tile
.translateToZoomLevel((byte) (tile.getZoomlevel() + SUBTILE_ZOOMLEVEL_DIFFERENCE));
short bitmask = 0;
int tileCounter = 0;... | [
"public",
"static",
"short",
"computeBitmask",
"(",
"final",
"Geometry",
"geometry",
",",
"final",
"TileCoordinate",
"tile",
",",
"final",
"int",
"enlargementInMeter",
")",
"{",
"List",
"<",
"TileCoordinate",
">",
"subtiles",
"=",
"tile",
".",
"translateToZoomLeve... | A tile on zoom level <i>z</i> has exactly 16 sub tiles on zoom level <i>z+2</i>. For each of these 16 sub tiles
it is analyzed if the given way needs to be included. The result is represented as a 16 bit short value. Each bit
represents one of the 16 sub tiles. A bit is set to 1 if the sub tile needs to include the way... | [
"A",
"tile",
"on",
"zoom",
"level",
"<i",
">",
"z<",
"/",
"i",
">",
"has",
"exactly",
"16",
"sub",
"tiles",
"on",
"zoom",
"level",
"<i",
">",
"z",
"+",
"2<",
"/",
"i",
">",
".",
"For",
"each",
"of",
"these",
"16",
"sub",
"tiles",
"it",
"is",
... | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/GeoUtils.java#L138-L153 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java | CPDefinitionOptionRelPersistenceImpl.findByCPDefinitionId | @Override
public List<CPDefinitionOptionRel> findByCPDefinitionId(
long CPDefinitionId, int start, int end) {
"""
Returns a range of all the cp definition option rels where CPDefinitionId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code>... | java | @Override
public List<CPDefinitionOptionRel> findByCPDefinitionId(
long CPDefinitionId, int start, int end) {
return findByCPDefinitionId(CPDefinitionId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionOptionRel",
">",
"findByCPDefinitionId",
"(",
"long",
"CPDefinitionId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCPDefinitionId",
"(",
"CPDefinitionId",
",",
"start",
",",
"end",
",",... | Returns a range of all the cp definition option rels where CPDefinitionId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first resu... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"definition",
"option",
"rels",
"where",
"CPDefinitionId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java#L2566-L2570 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/xml/XML.java | XML.checksAttributesExistence | private XML checksAttributesExistence(Class<?> aClass,String[] attributes) {
"""
Verifies that the attributes exist in aClass.
@param aClass Class to check
@param attributes list of the names attributes to check.
@return this instance of XML
"""
if(!classExists(aClass)) Error.xmlClassInexistent(this.xmlP... | java | private XML checksAttributesExistence(Class<?> aClass,String[] attributes){
if(!classExists(aClass)) Error.xmlClassInexistent(this.xmlPath,aClass);
for (String attributeName : attributes)
try{ aClass.getDeclaredField(attributeName); }
catch (Exception e){ Error.attributeInexistent(attributeName, ... | [
"private",
"XML",
"checksAttributesExistence",
"(",
"Class",
"<",
"?",
">",
"aClass",
",",
"String",
"[",
"]",
"attributes",
")",
"{",
"if",
"(",
"!",
"classExists",
"(",
"aClass",
")",
")",
"Error",
".",
"xmlClassInexistent",
"(",
"this",
".",
"xmlPath",
... | Verifies that the attributes exist in aClass.
@param aClass Class to check
@param attributes list of the names attributes to check.
@return this instance of XML | [
"Verifies",
"that",
"the",
"attributes",
"exist",
"in",
"aClass",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/xml/XML.java#L421-L427 |
qcloudsms/qcloudsms_java | src/main/java/com/github/qcloudsms/VoiceFileStatus.java | VoiceFileStatus.get | public VoiceFileStatusResult get(String fid)
throws HTTPException, JSONException, IOException {
"""
查询语音文件审核状态
@param fid 语音文件fid
@return {@link}VoiceFileStatusResult
@throws HTTPException http status exception
@throws JSONException json parse exception
@throws IOException network problem
... | java | public VoiceFileStatusResult get(String fid)
throws HTTPException, JSONException, IOException {
long random = SmsSenderUtil.getRandom();
long now = SmsSenderUtil.getCurrentTime();
JSONObject body = new JSONObject()
.put("fid", fid)
.put("sig", SmsSenderUtil.c... | [
"public",
"VoiceFileStatusResult",
"get",
"(",
"String",
"fid",
")",
"throws",
"HTTPException",
",",
"JSONException",
",",
"IOException",
"{",
"long",
"random",
"=",
"SmsSenderUtil",
".",
"getRandom",
"(",
")",
";",
"long",
"now",
"=",
"SmsSenderUtil",
".",
"g... | 查询语音文件审核状态
@param fid 语音文件fid
@return {@link}VoiceFileStatusResult
@throws HTTPException http status exception
@throws JSONException json parse exception
@throws IOException network problem | [
"查询语音文件审核状态"
] | train | https://github.com/qcloudsms/qcloudsms_java/blob/920ba838b4fdafcbf684e71bb09846de72294eea/src/main/java/com/github/qcloudsms/VoiceFileStatus.java#L39-L70 |
google/error-prone | core/src/main/java/com/google/errorprone/refaster/ULabeledStatement.java | ULabeledStatement.inlineLabel | @Nullable
static Name inlineLabel(@Nullable CharSequence label, Inliner inliner) {
"""
Returns either the {@code Name} bound to the specified label, or a {@code Name} representing
the original label if none is already bound.
"""
return (label == null)
? null
: inliner.asName(inliner.getO... | java | @Nullable
static Name inlineLabel(@Nullable CharSequence label, Inliner inliner) {
return (label == null)
? null
: inliner.asName(inliner.getOptionalBinding(new Key(label)).or(label));
} | [
"@",
"Nullable",
"static",
"Name",
"inlineLabel",
"(",
"@",
"Nullable",
"CharSequence",
"label",
",",
"Inliner",
"inliner",
")",
"{",
"return",
"(",
"label",
"==",
"null",
")",
"?",
"null",
":",
"inliner",
".",
"asName",
"(",
"inliner",
".",
"getOptionalBi... | Returns either the {@code Name} bound to the specified label, or a {@code Name} representing
the original label if none is already bound. | [
"Returns",
"either",
"the",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/refaster/ULabeledStatement.java#L47-L52 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/validate/ParameterValidator.java | ParameterValidator.assertOne | public void assertOne(final String paramName,
final ParameterList parameters) throws ValidationException {
"""
Ensure a parameter occurs once.
@param paramName
the parameter name
@param parameters
a list of parameters to query
@throws ValidationException
when the specified parameter does not oc... | java | public void assertOne(final String paramName,
final ParameterList parameters) throws ValidationException {
if (parameters.getParameters(paramName).size() != 1) {
throw new ValidationException(ASSERT_ONE_MESSAGE, new Object[] {paramName});
}
} | [
"public",
"void",
"assertOne",
"(",
"final",
"String",
"paramName",
",",
"final",
"ParameterList",
"parameters",
")",
"throws",
"ValidationException",
"{",
"if",
"(",
"parameters",
".",
"getParameters",
"(",
"paramName",
")",
".",
"size",
"(",
")",
"!=",
"1",
... | Ensure a parameter occurs once.
@param paramName
the parameter name
@param parameters
a list of parameters to query
@throws ValidationException
when the specified parameter does not occur once | [
"Ensure",
"a",
"parameter",
"occurs",
"once",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/validate/ParameterValidator.java#L91-L97 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java | PossibleIncompleteSerialization.visitClassContext | @Override
public void visitClassContext(ClassContext classContext) {
"""
implements the visitor to look for classes that are serializable, and are derived from non serializable classes and don't either implement methods in
Externalizable or Serializable to save parent class fields.
@param classContext
the... | java | @Override
public void visitClassContext(ClassContext classContext) {
try {
JavaClass cls = classContext.getJavaClass();
if (isSerializable(cls)) {
JavaClass superCls = cls.getSuperClass();
if (!isSerializable(superCls) && hasSerializableFields(superCls... | [
"@",
"Override",
"public",
"void",
"visitClassContext",
"(",
"ClassContext",
"classContext",
")",
"{",
"try",
"{",
"JavaClass",
"cls",
"=",
"classContext",
".",
"getJavaClass",
"(",
")",
";",
"if",
"(",
"isSerializable",
"(",
"cls",
")",
")",
"{",
"JavaClass... | implements the visitor to look for classes that are serializable, and are derived from non serializable classes and don't either implement methods in
Externalizable or Serializable to save parent class fields.
@param classContext
the context object of the currently parsed class | [
"implements",
"the",
"visitor",
"to",
"look",
"for",
"classes",
"that",
"are",
"serializable",
"and",
"are",
"derived",
"from",
"non",
"serializable",
"classes",
"and",
"don",
"t",
"either",
"implement",
"methods",
"in",
"Externalizable",
"or",
"Serializable",
"... | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java#L62-L75 |
GCRC/nunaliit | nunaliit2-json/src/main/java/org/json/XMLTokener.java | XMLTokener.unescapeEntity | static String unescapeEntity(String e) {
"""
Unescapes an XML entity encoding;
@param e entity (only the actual entity value, not the preceding & or ending ;
@return
"""
// validate
if (e == null || e.isEmpty()) {
return "";
}
// if our entity is an encoded unicode... | java | static String unescapeEntity(String e) {
// validate
if (e == null || e.isEmpty()) {
return "";
}
// if our entity is an encoded unicode point, parse it.
if (e.charAt(0) == '#') {
int cp;
if (e.charAt(1) == 'x') {
// hex encoded... | [
"static",
"String",
"unescapeEntity",
"(",
"String",
"e",
")",
"{",
"// validate",
"if",
"(",
"e",
"==",
"null",
"||",
"e",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"// if our entity is an encoded unicode point, parse it.",
"if",
"(",
... | Unescapes an XML entity encoding;
@param e entity (only the actual entity value, not the preceding & or ending ;
@return | [
"Unescapes",
"an",
"XML",
"entity",
"encoding",
";"
] | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-json/src/main/java/org/json/XMLTokener.java#L159-L182 |
opendatatrentino/s-match | src/main/java/it/unitn/disi/common/components/Configurable.java | Configurable.loadProperties | public static Properties loadProperties(String filename) throws ConfigurableException {
"""
Loads the properties from the properties file.
@param filename the properties file name
@return Properties instance
@throws ConfigurableException ConfigurableException
"""
log.info("Loading properties from... | java | public static Properties loadProperties(String filename) throws ConfigurableException {
log.info("Loading properties from " + filename);
Properties properties = new Properties();
FileInputStream input = null;
try {
input = new FileInputStream(filename);
prop... | [
"public",
"static",
"Properties",
"loadProperties",
"(",
"String",
"filename",
")",
"throws",
"ConfigurableException",
"{",
"log",
".",
"info",
"(",
"\"Loading properties from \"",
"+",
"filename",
")",
";",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",... | Loads the properties from the properties file.
@param filename the properties file name
@return Properties instance
@throws ConfigurableException ConfigurableException | [
"Loads",
"the",
"properties",
"from",
"the",
"properties",
"file",
"."
] | train | https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/common/components/Configurable.java#L192-L215 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/document/SymbolTable.java | SymbolTable.containsSymbol | public boolean containsSymbol(char[] buffer, int offset, int length) {
"""
Returns true if the symbol table already contains the specified
symbol.
@param buffer The buffer containing the symbol to look for.
@param offset The offset into the buffer.
@param length The length of the symbol in the buffer.
""... | java | public boolean containsSymbol(char[] buffer, int offset, int length) {
// search for identical symbol
int bucket = hash(buffer, offset, length) % fTableSize;
OUTER: for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) {
if (length == entry.characters.length) {
... | [
"public",
"boolean",
"containsSymbol",
"(",
"char",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"// search for identical symbol",
"int",
"bucket",
"=",
"hash",
"(",
"buffer",
",",
"offset",
",",
"length",
")",
"%",
"fTableSize",... | Returns true if the symbol table already contains the specified
symbol.
@param buffer The buffer containing the symbol to look for.
@param offset The offset into the buffer.
@param length The length of the symbol in the buffer. | [
"Returns",
"true",
"if",
"the",
"symbol",
"table",
"already",
"contains",
"the",
"specified",
"symbol",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/document/SymbolTable.java#L215-L232 |
XDean/Java-EX | src/main/java/xdean/jex/util/reflect/AnnotationUtil.java | AnnotationUtil.addAnnotation | @SuppressWarnings("unchecked")
public static void addAnnotation(Field field, Annotation annotation) {
"""
Add annotation to Field<br>
Note that you may need to give the root field.
@param field
@param annotation
@author XDean
@see java.lang.reflect.Field
@see #createAnnotationFromMap(Class, Map)
@see R... | java | @SuppressWarnings("unchecked")
public static void addAnnotation(Field field, Annotation annotation) {
field.getAnnotation(Annotation.class);// prevent declaredAnnotations haven't initialized
Map<Class<? extends Annotation>, Annotation> annos;
try {
annos = (Map<Class<? extends Annotation>, Anno... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"void",
"addAnnotation",
"(",
"Field",
"field",
",",
"Annotation",
"annotation",
")",
"{",
"field",
".",
"getAnnotation",
"(",
"Annotation",
".",
"class",
")",
";",
"// prevent declaredAnnotat... | Add annotation to Field<br>
Note that you may need to give the root field.
@param field
@param annotation
@author XDean
@see java.lang.reflect.Field
@see #createAnnotationFromMap(Class, Map)
@see ReflectUtil#getRootFields(Class) | [
"Add",
"annotation",
"to",
"Field<br",
">",
"Note",
"that",
"you",
"may",
"need",
"to",
"give",
"the",
"root",
"field",
"."
] | train | https://github.com/XDean/Java-EX/blob/9208ba71c5b2af9f9bd979d01fab2ff5e433b3e7/src/main/java/xdean/jex/util/reflect/AnnotationUtil.java#L173-L191 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysInner.java | P2sVpnGatewaysInner.getByResourceGroupAsync | public Observable<P2SVpnGatewayInner> getByResourceGroupAsync(String resourceGroupName, String gatewayName) {
"""
Retrieves the details of a virtual wan p2s vpn gateway.
@param resourceGroupName The resource group name of the P2SVpnGateway.
@param gatewayName The name of the gateway.
@throws IllegalArgumentEx... | java | public Observable<P2SVpnGatewayInner> getByResourceGroupAsync(String resourceGroupName, String gatewayName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1<ServiceResponse<P2SVpnGatewayInner>, P2SVpnGatewayInner>() {
@Override
public P2SV... | [
"public",
"Observable",
"<",
"P2SVpnGatewayInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"gatewayName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"gatewayName",
")",
".",
"... | Retrieves the details of a virtual wan p2s vpn gateway.
@param resourceGroupName The resource group name of the P2SVpnGateway.
@param gatewayName The name of the gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the P2SVpnGatewayInner object | [
"Retrieves",
"the",
"details",
"of",
"a",
"virtual",
"wan",
"p2s",
"vpn",
"gateway",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysInner.java#L163-L170 |
twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ZooKeeperClient.java | ZooKeeperClient.digestCredentials | public static Credentials digestCredentials(String username, String password) {
"""
Creates a set of credentials for the zoo keeper digest authentication mechanism.
@param username the username to authenticate with
@param password the password to authenticate with
@return a set of credentials that can be used... | java | public static Credentials digestCredentials(String username, String password) {
MorePreconditions.checkNotBlank(username);
Objects.requireNonNull(password);
// TODO(John Sirois): DigestAuthenticationProvider is broken - uses platform default charset
// (on server) and so we just have to hope here that ... | [
"public",
"static",
"Credentials",
"digestCredentials",
"(",
"String",
"username",
",",
"String",
"password",
")",
"{",
"MorePreconditions",
".",
"checkNotBlank",
"(",
"username",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"password",
")",
";",
"// TODO(John... | Creates a set of credentials for the zoo keeper digest authentication mechanism.
@param username the username to authenticate with
@param password the password to authenticate with
@return a set of credentials that can be used to authenticate the zoo keeper client | [
"Creates",
"a",
"set",
"of",
"credentials",
"for",
"the",
"zoo",
"keeper",
"digest",
"authentication",
"mechanism",
"."
] | train | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ZooKeeperClient.java#L121-L130 |
grpc/grpc-java | api/src/main/java/io/grpc/ServiceProviders.java | ServiceProviders.getCandidatesViaHardCoded | @VisibleForTesting
static <T> Iterable<T> getCandidatesViaHardCoded(Class<T> klass, Iterable<Class<?>> hardcoded) {
"""
Load providers from a hard-coded list. This avoids using getResource(), which has performance
problems on Android (see https://github.com/grpc/grpc-java/issues/2037).
"""
List<T> list ... | java | @VisibleForTesting
static <T> Iterable<T> getCandidatesViaHardCoded(Class<T> klass, Iterable<Class<?>> hardcoded) {
List<T> list = new ArrayList<>();
for (Class<?> candidate : hardcoded) {
list.add(create(klass, candidate));
}
return list;
} | [
"@",
"VisibleForTesting",
"static",
"<",
"T",
">",
"Iterable",
"<",
"T",
">",
"getCandidatesViaHardCoded",
"(",
"Class",
"<",
"T",
">",
"klass",
",",
"Iterable",
"<",
"Class",
"<",
"?",
">",
">",
"hardcoded",
")",
"{",
"List",
"<",
"T",
">",
"list",
... | Load providers from a hard-coded list. This avoids using getResource(), which has performance
problems on Android (see https://github.com/grpc/grpc-java/issues/2037). | [
"Load",
"providers",
"from",
"a",
"hard",
"-",
"coded",
"list",
".",
"This",
"avoids",
"using",
"getResource",
"()",
"which",
"has",
"performance",
"problems",
"on",
"Android",
"(",
"see",
"https",
":",
"//",
"github",
".",
"com",
"/",
"grpc",
"/",
"grpc... | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/api/src/main/java/io/grpc/ServiceProviders.java#L121-L128 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/domassign/MultiMap.java | MultiMap.getOrCreate | public D getOrCreate(E el, P pseudo) {
"""
Gets the data or creates an empty list if it does not exist yet.
@param el the element
@param pseudo a pseudo-element or null, if no pseudo-element is required
@return the stored data
"""
D ret;
if (pseudo == null)
{
ret = mainMa... | java | public D getOrCreate(E el, P pseudo)
{
D ret;
if (pseudo == null)
{
ret = mainMap.get(el);
if (ret == null)
{
ret = createDataInstance();
mainMap.put(el, ret);
}
}
else
{
HashM... | [
"public",
"D",
"getOrCreate",
"(",
"E",
"el",
",",
"P",
"pseudo",
")",
"{",
"D",
"ret",
";",
"if",
"(",
"pseudo",
"==",
"null",
")",
"{",
"ret",
"=",
"mainMap",
".",
"get",
"(",
"el",
")",
";",
"if",
"(",
"ret",
"==",
"null",
")",
"{",
"ret",... | Gets the data or creates an empty list if it does not exist yet.
@param el the element
@param pseudo a pseudo-element or null, if no pseudo-element is required
@return the stored data | [
"Gets",
"the",
"data",
"or",
"creates",
"an",
"empty",
"list",
"if",
"it",
"does",
"not",
"exist",
"yet",
"."
] | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/domassign/MultiMap.java#L96-L124 |
aequologica/geppaequo | geppaequo-core/src/main/java/net/aequologica/neo/geppaequo/auth/MethodUtils.java | MethodUtils.getAccessibleMethod | public static Method getAccessibleMethod(
Class<?> clazz,
String methodName,
Class<?>[] parameterTypes) {
"""
<p>Return an accessible method (that is, one that can be invoked via
reflection) with given name and parameters. If no such method
can be found, return <code>null<... | java | public static Method getAccessibleMethod(
Class<?> clazz,
String methodName,
Class<?>[] parameterTypes) {
try {
MethodDescriptor md = new MethodDescriptor(clazz, methodName, parameterTypes, true);
// Check the cache first
Method me... | [
"public",
"static",
"Method",
"getAccessibleMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
")",
"{",
"try",
"{",
"MethodDescriptor",
"md",
"=",
"new",
"MethodDescriptor",
... | <p>Return an accessible method (that is, one that can be invoked via
reflection) with given name and parameters. If no such method
can be found, return <code>null</code>.
This is just a convenient wrapper for
{@link #getAccessibleMethod(Method method)}.</p>
@param clazz get method from this class
@param methodName ge... | [
"<p",
">",
"Return",
"an",
"accessible",
"method",
"(",
"that",
"is",
"one",
"that",
"can",
"be",
"invoked",
"via",
"reflection",
")",
"with",
"given",
"name",
"and",
"parameters",
".",
"If",
"no",
"such",
"method",
"can",
"be",
"found",
"return",
"<code... | train | https://github.com/aequologica/geppaequo/blob/b72e5f6356535fd045a931f8c544d4a8ea6e35a2/geppaequo-core/src/main/java/net/aequologica/neo/geppaequo/auth/MethodUtils.java#L727-L747 |
lightblue-platform/lightblue-migrator | facade/src/main/java/com/redhat/lightblue/migrator/facade/ServiceFacade.java | ServiceFacade.getWithTimeout | private <T> T getWithTimeout(ListenableFuture<T> listenableFuture, String methodName, FacadeOperation facadeOperation, int destinationCallTimeout) throws InterruptedException, ExecutionException, TimeoutException {
"""
Call destination (lightblue) using a timeout in dual read/write phases.
Do not use facade timeo... | java | private <T> T getWithTimeout(ListenableFuture<T> listenableFuture, String methodName, FacadeOperation facadeOperation, int destinationCallTimeout) throws InterruptedException, ExecutionException, TimeoutException {
// not reading from source/legacy means this is either proxy or kinda proxy phase
// in t... | [
"private",
"<",
"T",
">",
"T",
"getWithTimeout",
"(",
"ListenableFuture",
"<",
"T",
">",
"listenableFuture",
",",
"String",
"methodName",
",",
"FacadeOperation",
"facadeOperation",
",",
"int",
"destinationCallTimeout",
")",
"throws",
"InterruptedException",
",",
"Ex... | Call destination (lightblue) using a timeout in dual read/write phases.
Do not use facade timeout during lightblue proxy and kinda proxy phases (when
reading from source is disabled).
@param listenableFuture
@param methodName method name is used to read method specific timeout
configuration
@param destinationCallTimeo... | [
"Call",
"destination",
"(",
"lightblue",
")",
"using",
"a",
"timeout",
"in",
"dual",
"read",
"/",
"write",
"phases",
".",
"Do",
"not",
"use",
"facade",
"timeout",
"during",
"lightblue",
"proxy",
"and",
"kinda",
"proxy",
"phases",
"(",
"when",
"reading",
"f... | train | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/facade/src/main/java/com/redhat/lightblue/migrator/facade/ServiceFacade.java#L198-L206 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PhotosetsApi.java | PhotosetsApi.editPhotos | public Response editPhotos(String photosetId, String primaryPhotoId, List<String> photoIds) throws JinxException {
"""
Modify the photos in a photoset. Use this method to add, remove and re-order photos.
<br>
This method requires authentication with 'write' permission.
<br>
This method has no specific response... | java | public Response editPhotos(String photosetId, String primaryPhotoId, List<String> photoIds) throws JinxException {
JinxUtils.validateParams(photosetId, primaryPhotoId, photoIds);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photosets.editPhotos");
params.put("photoset_id", ... | [
"public",
"Response",
"editPhotos",
"(",
"String",
"photosetId",
",",
"String",
"primaryPhotoId",
",",
"List",
"<",
"String",
">",
"photoIds",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"photosetId",
",",
"primaryPhotoId",
",",
... | Modify the photos in a photoset. Use this method to add, remove and re-order photos.
<br>
This method requires authentication with 'write' permission.
<br>
This method has no specific response - It returns an empty success response if it completes without error.
@param photosetId id of the photoset to modify. The ... | [
"Modify",
"the",
"photos",
"in",
"a",
"photoset",
".",
"Use",
"this",
"method",
"to",
"add",
"remove",
"and",
"re",
"-",
"order",
"photos",
".",
"<br",
">",
"This",
"method",
"requires",
"authentication",
"with",
"write",
"permission",
".",
"<br",
">",
"... | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosetsApi.java#L162-L176 |
agmip/agmip-common-functions | src/main/java/org/agmip/functions/PTSaxton2006.java | PTSaxton2006.calcSatMatric | public static String calcSatMatric(String slsnd, String slcly, String omPct) {
"""
Equation 16 for calculating Saturated conductivity (matric soil), mm/h
@param slsnd Sand weight percentage by layer ([0,100]%)
@param slcly Clay weight percentage by layer ([0,100]%)
@param omPct Organic matter weight percentag... | java | public static String calcSatMatric(String slsnd, String slcly, String omPct) {
String satMt = divide(calcSaturatedMoisture(slsnd, slcly, omPct), "100");
String mt33 = divide(calcMoisture33Kpa(slsnd, slcly, omPct), "100");
String lamda = calcLamda(slsnd, slcly, omPct);
String ret = produ... | [
"public",
"static",
"String",
"calcSatMatric",
"(",
"String",
"slsnd",
",",
"String",
"slcly",
",",
"String",
"omPct",
")",
"{",
"String",
"satMt",
"=",
"divide",
"(",
"calcSaturatedMoisture",
"(",
"slsnd",
",",
"slcly",
",",
"omPct",
")",
",",
"\"100\"",
... | Equation 16 for calculating Saturated conductivity (matric soil), mm/h
@param slsnd Sand weight percentage by layer ([0,100]%)
@param slcly Clay weight percentage by layer ([0,100]%)
@param omPct Organic matter weight percentage by layer ([0,100]%), (=
SLOC * 1.72) | [
"Equation",
"16",
"for",
"calculating",
"Saturated",
"conductivity",
"(",
"matric",
"soil",
")",
"mm",
"/",
"h"
] | train | https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/functions/PTSaxton2006.java#L337-L345 |
zandero/rest.vertx | src/main/java/com/zandero/rest/data/ClassFactory.java | ClassFactory.constructType | public static <T> Object constructType(Class<T> type, String fromValue) throws ClassFactoryException {
"""
Aims to construct given type utilizing a constructor that takes String or other primitive type values
@param type to be constructed
@param fromValue constructor param
@param <T> type of value
... | java | public static <T> Object constructType(Class<T> type, String fromValue) throws ClassFactoryException {
Assert.notNull(type, "Missing type!");
// a primitive or "simple" type
if (isSimpleType(type)) {
return stringToPrimitiveType(fromValue, type);
}
// have a constructor that accepts a single argument (S... | [
"public",
"static",
"<",
"T",
">",
"Object",
"constructType",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"fromValue",
")",
"throws",
"ClassFactoryException",
"{",
"Assert",
".",
"notNull",
"(",
"type",
",",
"\"Missing type!\"",
")",
";",
"// a primi... | Aims to construct given type utilizing a constructor that takes String or other primitive type values
@param type to be constructed
@param fromValue constructor param
@param <T> type of value
@return class object
@throws ClassFactoryException in case type could not be constructed | [
"Aims",
"to",
"construct",
"given",
"type",
"utilizing",
"a",
"constructor",
"that",
"takes",
"String",
"or",
"other",
"primitive",
"type",
"values"
] | train | https://github.com/zandero/rest.vertx/blob/ba458720cf59e076953eab9dac7227eeaf9e58ce/src/main/java/com/zandero/rest/data/ClassFactory.java#L455-L488 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/miner/SIFSearcher.java | SIFSearcher.searchSIF | public boolean searchSIF(Model model, OutputStream out) {
"""
Searches the given model with the contained miners.
Writes the textual result to the given output stream.
Closes the stream at the end.
Produces the simplest version of SIF format.
@param model model to search
@param out stream to write
@retur... | java | public boolean searchSIF(Model model, OutputStream out)
{
return searchSIF(model, out, new SIFToText() {
@Override
public String convert(SIFInteraction inter)
{
return inter.toString();
}
});
} | [
"public",
"boolean",
"searchSIF",
"(",
"Model",
"model",
",",
"OutputStream",
"out",
")",
"{",
"return",
"searchSIF",
"(",
"model",
",",
"out",
",",
"new",
"SIFToText",
"(",
")",
"{",
"@",
"Override",
"public",
"String",
"convert",
"(",
"SIFInteraction",
"... | Searches the given model with the contained miners.
Writes the textual result to the given output stream.
Closes the stream at the end.
Produces the simplest version of SIF format.
@param model model to search
@param out stream to write
@return true if any output produced successfully | [
"Searches",
"the",
"given",
"model",
"with",
"the",
"contained",
"miners",
".",
"Writes",
"the",
"textual",
"result",
"to",
"the",
"given",
"output",
"stream",
".",
"Closes",
"the",
"stream",
"at",
"the",
"end",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/miner/SIFSearcher.java#L194-L203 |
autermann/yaml | src/main/java/com/github/autermann/yaml/nodes/YamlMappingNode.java | YamlMappingNode.put | public T put(YamlNode key, int value) {
"""
Adds the specified {@code key}/{@code value} pair to this mapping.
@param key the key
@param value the value
@return {@code this}
"""
return put(key, getNodeFactory().intNode(value));
} | java | public T put(YamlNode key, int value) {
return put(key, getNodeFactory().intNode(value));
} | [
"public",
"T",
"put",
"(",
"YamlNode",
"key",
",",
"int",
"value",
")",
"{",
"return",
"put",
"(",
"key",
",",
"getNodeFactory",
"(",
")",
".",
"intNode",
"(",
"value",
")",
")",
";",
"}"
] | Adds the specified {@code key}/{@code value} pair to this mapping.
@param key the key
@param value the value
@return {@code this} | [
"Adds",
"the",
"specified",
"{",
"@code",
"key",
"}",
"/",
"{",
"@code",
"value",
"}",
"pair",
"to",
"this",
"mapping",
"."
] | train | https://github.com/autermann/yaml/blob/5f8ab03e4fec3a2abe72c03561cdaa3a3936634d/src/main/java/com/github/autermann/yaml/nodes/YamlMappingNode.java#L516-L518 |
datacleaner/AnalyzerBeans | core/src/main/java/org/eobjects/analyzer/util/convert/ResourceConverter.java | ResourceConverter.parseStructure | public ResourceStructure parseStructure(String str) {
"""
Parses a string in order to produce a {@link ResourceStructure} object
@param str
@return
"""
Matcher matcher = RESOURCE_PATTERN.matcher(str);
if (!matcher.find()) {
logger.info("Did not find any scheme definition in reso... | java | public ResourceStructure parseStructure(String str) {
Matcher matcher = RESOURCE_PATTERN.matcher(str);
if (!matcher.find()) {
logger.info("Did not find any scheme definition in resource path: {}. Using default scheme: {}.", str,
_defaultScheme);
return new Res... | [
"public",
"ResourceStructure",
"parseStructure",
"(",
"String",
"str",
")",
"{",
"Matcher",
"matcher",
"=",
"RESOURCE_PATTERN",
".",
"matcher",
"(",
"str",
")",
";",
"if",
"(",
"!",
"matcher",
".",
"find",
"(",
")",
")",
"{",
"logger",
".",
"info",
"(",
... | Parses a string in order to produce a {@link ResourceStructure} object
@param str
@return | [
"Parses",
"a",
"string",
"in",
"order",
"to",
"produce",
"a",
"{",
"@link",
"ResourceStructure",
"}",
"object"
] | train | https://github.com/datacleaner/AnalyzerBeans/blob/f82dae080d80d2a647b706a5fb22b3ea250613b3/core/src/main/java/org/eobjects/analyzer/util/convert/ResourceConverter.java#L161-L171 |
spring-projects/spring-android | spring-android-rest-template/src/main/java/org/springframework/http/converter/json/MappingJackson2HttpMessageConverter.java | MappingJackson2HttpMessageConverter.getJavaType | protected JavaType getJavaType(Type type, Class<?> contextClass) {
"""
Return the Jackson {@link JavaType} for the specified type and context class.
<p>The default implementation returns {@link ObjectMapper#constructType(java.lang.reflect.Type)}
or {@code ObjectMapper.getTypeFactory().constructType(type, context... | java | protected JavaType getJavaType(Type type, Class<?> contextClass) {
return (contextClass != null) ?
this.objectMapper.getTypeFactory().constructType(type, contextClass) :
this.objectMapper.constructType(type);
} | [
"protected",
"JavaType",
"getJavaType",
"(",
"Type",
"type",
",",
"Class",
"<",
"?",
">",
"contextClass",
")",
"{",
"return",
"(",
"contextClass",
"!=",
"null",
")",
"?",
"this",
".",
"objectMapper",
".",
"getTypeFactory",
"(",
")",
".",
"constructType",
"... | Return the Jackson {@link JavaType} for the specified type and context class.
<p>The default implementation returns {@link ObjectMapper#constructType(java.lang.reflect.Type)}
or {@code ObjectMapper.getTypeFactory().constructType(type, contextClass)},
but this can be overridden in subclasses, to allow for custom generic... | [
"Return",
"the",
"Jackson",
"{"
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/http/converter/json/MappingJackson2HttpMessageConverter.java#L232-L236 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java | SARLOperationHelper._hasSideEffects | protected Boolean _hasSideEffects(XCollectionLiteral expression, ISideEffectContext context) {
"""
Test if the given expression has side effects.
@param expression the expression.
@param context the list of context expressions.
@return {@code true} if the expression has side effects.
"""
context.open();... | java | protected Boolean _hasSideEffects(XCollectionLiteral expression, ISideEffectContext context) {
context.open();
for (final XExpression ex : expression.getElements()) {
if (hasSideEffects(ex, context)) {
return true;
}
}
context.close();
return false;
} | [
"protected",
"Boolean",
"_hasSideEffects",
"(",
"XCollectionLiteral",
"expression",
",",
"ISideEffectContext",
"context",
")",
"{",
"context",
".",
"open",
"(",
")",
";",
"for",
"(",
"final",
"XExpression",
"ex",
":",
"expression",
".",
"getElements",
"(",
")",
... | Test if the given expression has side effects.
@param expression the expression.
@param context the list of context expressions.
@return {@code true} if the expression has side effects. | [
"Test",
"if",
"the",
"given",
"expression",
"has",
"side",
"effects",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java#L464-L473 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxRetentionPolicy.java | BoxRetentionPolicy.createIndefinitePolicy | public static BoxRetentionPolicy.Info createIndefinitePolicy(BoxAPIConnection api, String name) {
"""
Used to create a new indefinite retention policy.
@param api the API connection to be used by the created user.
@param name the name of the retention policy.
@return the created retention policy's info.
"""... | java | public static BoxRetentionPolicy.Info createIndefinitePolicy(BoxAPIConnection api, String name) {
return createRetentionPolicy(api, name, TYPE_INDEFINITE, 0, ACTION_REMOVE_RETENTION);
} | [
"public",
"static",
"BoxRetentionPolicy",
".",
"Info",
"createIndefinitePolicy",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"name",
")",
"{",
"return",
"createRetentionPolicy",
"(",
"api",
",",
"name",
",",
"TYPE_INDEFINITE",
",",
"0",
",",
"ACTION_REMOVE_RETENT... | Used to create a new indefinite retention policy.
@param api the API connection to be used by the created user.
@param name the name of the retention policy.
@return the created retention policy's info. | [
"Used",
"to",
"create",
"a",
"new",
"indefinite",
"retention",
"policy",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxRetentionPolicy.java#L93-L95 |
jenkinsci/jenkins | core/src/main/java/hudson/util/Futures.java | Futures.precomputed | public static <T> Future<T> precomputed(final T value) {
"""
Creates a {@link Future} instance that already has its value pre-computed.
"""
return new Future<T>() {
public boolean cancel(boolean mayInterruptIfRunning) {
return false;
}
public boolean... | java | public static <T> Future<T> precomputed(final T value) {
return new Future<T>() {
public boolean cancel(boolean mayInterruptIfRunning) {
return false;
}
public boolean isCancelled() {
return false;
}
public boolean isD... | [
"public",
"static",
"<",
"T",
">",
"Future",
"<",
"T",
">",
"precomputed",
"(",
"final",
"T",
"value",
")",
"{",
"return",
"new",
"Future",
"<",
"T",
">",
"(",
")",
"{",
"public",
"boolean",
"cancel",
"(",
"boolean",
"mayInterruptIfRunning",
")",
"{",
... | Creates a {@link Future} instance that already has its value pre-computed. | [
"Creates",
"a",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/Futures.java#L39-L61 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/FieldToUpperHandler.java | FieldToUpperHandler.doSetData | public int doSetData(Object objData, boolean bDisplayOption, int iMoveMode) {
"""
Move the physical binary data to this field.
@param objData the raw data to set the basefield to.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The err... | java | public int doSetData(Object objData, boolean bDisplayOption, int iMoveMode)
{
if (objData instanceof String)
objData = ((String)objData).toUpperCase();
return super.doSetData(objData, bDisplayOption, iMoveMode);
} | [
"public",
"int",
"doSetData",
"(",
"Object",
"objData",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"if",
"(",
"objData",
"instanceof",
"String",
")",
"objData",
"=",
"(",
"(",
"String",
")",
"objData",
")",
".",
"toUpperCase",
"("... | Move the physical binary data to this field.
@param objData the raw data to set the basefield to.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_RETURN if okay). | [
"Move",
"the",
"physical",
"binary",
"data",
"to",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/FieldToUpperHandler.java#L55-L60 |
cycorp/api-suite | core-api/src/main/java/com/cyc/kb/exception/DeleteException.java | DeleteException.fromThrowable | public static DeleteException fromThrowable(String message, Throwable cause) {
"""
Converts a Throwable to a DeleteException with the specified detail message. If the
Throwable is a DeleteException and if the Throwable's message is identical to the
one supplied, the Throwable will be passed through unmodified; o... | java | public static DeleteException fromThrowable(String message, Throwable cause) {
return (cause instanceof DeleteException && Objects.equals(message, cause.getMessage()))
? (DeleteException) cause
: new DeleteException(message, cause);
} | [
"public",
"static",
"DeleteException",
"fromThrowable",
"(",
"String",
"message",
",",
"Throwable",
"cause",
")",
"{",
"return",
"(",
"cause",
"instanceof",
"DeleteException",
"&&",
"Objects",
".",
"equals",
"(",
"message",
",",
"cause",
".",
"getMessage",
"(",
... | Converts a Throwable to a DeleteException with the specified detail message. If the
Throwable is a DeleteException and if the Throwable's message is identical to the
one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in
a new DeleteException with the detail message.
@param cau... | [
"Converts",
"a",
"Throwable",
"to",
"a",
"DeleteException",
"with",
"the",
"specified",
"detail",
"message",
".",
"If",
"the",
"Throwable",
"is",
"a",
"DeleteException",
"and",
"if",
"the",
"Throwable",
"s",
"message",
"is",
"identical",
"to",
"the",
"one",
... | train | https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/kb/exception/DeleteException.java#L62-L66 |
taimos/dvalin | interconnect/model/src/main/java/de/taimos/dvalin/interconnect/model/service/DaemonScanner.java | DaemonScanner.getAnnotation | public static <A extends Annotation> A getAnnotation(final Class<A> annotation, final Method method) {
"""
Checks also the inheritance hierarchy.
@param annotation Annotation
@param method Method
@param <A> Annotation
@return Annotation or null
"""
try {
return DaemonScanne... | java | public static <A extends Annotation> A getAnnotation(final Class<A> annotation, final Method method) {
try {
return DaemonScanner.isAnnotationPresent(annotation, method.getDeclaringClass(), method.getName(), method.getParameterTypes());
} catch(final NoSuchMethodException e) {
re... | [
"public",
"static",
"<",
"A",
"extends",
"Annotation",
">",
"A",
"getAnnotation",
"(",
"final",
"Class",
"<",
"A",
">",
"annotation",
",",
"final",
"Method",
"method",
")",
"{",
"try",
"{",
"return",
"DaemonScanner",
".",
"isAnnotationPresent",
"(",
"annotat... | Checks also the inheritance hierarchy.
@param annotation Annotation
@param method Method
@param <A> Annotation
@return Annotation or null | [
"Checks",
"also",
"the",
"inheritance",
"hierarchy",
"."
] | train | https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/interconnect/model/src/main/java/de/taimos/dvalin/interconnect/model/service/DaemonScanner.java#L147-L153 |
hypercube1024/firefly | firefly/src/main/java/com/firefly/codec/http2/model/MimeTypes.java | MimeTypes.addMimeMapping | public void addMimeMapping(String extension, String type) {
"""
Set a mime mapping
@param extension the extension
@param type the mime type
"""
_mimeMap.put(StringUtils.asciiToLowerCase(extension), normalizeMimeType(type));
} | java | public void addMimeMapping(String extension, String type) {
_mimeMap.put(StringUtils.asciiToLowerCase(extension), normalizeMimeType(type));
} | [
"public",
"void",
"addMimeMapping",
"(",
"String",
"extension",
",",
"String",
"type",
")",
"{",
"_mimeMap",
".",
"put",
"(",
"StringUtils",
".",
"asciiToLowerCase",
"(",
"extension",
")",
",",
"normalizeMimeType",
"(",
"type",
")",
")",
";",
"}"
] | Set a mime mapping
@param extension the extension
@param type the mime type | [
"Set",
"a",
"mime",
"mapping"
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/codec/http2/model/MimeTypes.java#L309-L311 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/colors/ColorInterpolator.java | ColorInterpolator.interpolateColor | public static Color interpolateColor( Color color1, Color color2, float fraction ) {
"""
Interpolate a color at a given fraction between 0 and 1.
@param color1 start color.
@param color2 end color.
@param fraction the fraction to interpolate.
@return the new color.
"""
float int2Float = 1f / 255f... | java | public static Color interpolateColor( Color color1, Color color2, float fraction ) {
float int2Float = 1f / 255f;
fraction = Math.min(fraction, 1f);
fraction = Math.max(fraction, 0f);
float r1 = color1.getRed() * int2Float;
float g1 = color1.getGreen() * int2Float;
float... | [
"public",
"static",
"Color",
"interpolateColor",
"(",
"Color",
"color1",
",",
"Color",
"color2",
",",
"float",
"fraction",
")",
"{",
"float",
"int2Float",
"=",
"1f",
"/",
"255f",
";",
"fraction",
"=",
"Math",
".",
"min",
"(",
"fraction",
",",
"1f",
")",
... | Interpolate a color at a given fraction between 0 and 1.
@param color1 start color.
@param color2 end color.
@param fraction the fraction to interpolate.
@return the new color. | [
"Interpolate",
"a",
"color",
"at",
"a",
"given",
"fraction",
"between",
"0",
"and",
"1",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/colors/ColorInterpolator.java#L161-L196 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.