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 |
|---|---|---|---|---|---|---|---|---|---|---|
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dictionary/CustomDictionary.java | CustomDictionary.add | public static boolean add(String word, String natureWithFrequency) {
"""
往自定义词典中插入一个新词(非覆盖模式)<br>
动态增删不会持久化到词典文件
@param word 新词 如“裸婚”
@param natureWithFrequency 词性和其对应的频次,比如“nz 1 v 2”,null时表示“nz 1”
@return 是否插入成功(失败的原因可能是不覆盖、natureWithFrequency有问题等,后者可以通过调试模式了解原因)
"""
if (contains(... | java | public static boolean add(String word, String natureWithFrequency)
{
if (contains(word)) return false;
return insert(word, natureWithFrequency);
} | [
"public",
"static",
"boolean",
"add",
"(",
"String",
"word",
",",
"String",
"natureWithFrequency",
")",
"{",
"if",
"(",
"contains",
"(",
"word",
")",
")",
"return",
"false",
";",
"return",
"insert",
"(",
"word",
",",
"natureWithFrequency",
")",
";",
"}"
] | 往自定义词典中插入一个新词(非覆盖模式)<br>
动态增删不会持久化到词典文件
@param word 新词 如“裸婚”
@param natureWithFrequency 词性和其对应的频次,比如“nz 1 v 2”,null时表示“nz 1”
@return 是否插入成功(失败的原因可能是不覆盖、natureWithFrequency有问题等,后者可以通过调试模式了解原因) | [
"往自定义词典中插入一个新词(非覆盖模式)<br",
">",
"动态增删不会持久化到词典文件"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/CustomDictionary.java#L265-L269 |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/CodeBuilderFactory.java | CodeBuilderFactory.createOverridingInjector | public static Injector createOverridingInjector(Injector originalInjector, com.google.inject.Module module) {
"""
Create an injector that override the given injectors with the modules.
@param originalInjector the original injector.
@param modules the overriding modules.
@return the new injector.
"""
fin... | java | public static Injector createOverridingInjector(Injector originalInjector, com.google.inject.Module module) {
final Map<Key<?>, Binding<?>> bindings = originalInjector.getBindings();
return Guice.createInjector(Modules2.mixin((binder) -> {
for(Binding<?> binding: bindings.values()) {
final Type typeLiteral =... | [
"public",
"static",
"Injector",
"createOverridingInjector",
"(",
"Injector",
"originalInjector",
",",
"com",
".",
"google",
".",
"inject",
".",
"Module",
"module",
")",
"{",
"final",
"Map",
"<",
"Key",
"<",
"?",
">",
",",
"Binding",
"<",
"?",
">",
">",
"... | Create an injector that override the given injectors with the modules.
@param originalInjector the original injector.
@param modules the overriding modules.
@return the new injector. | [
"Create",
"an",
"injector",
"that",
"override",
"the",
"given",
"injectors",
"with",
"the",
"modules",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/CodeBuilderFactory.java#L204-L216 |
Graylog2/graylog2-server | graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/parser/PipelineRuleParser.java | PipelineRuleParser.parseRule | public Rule parseRule(String id, String rule, boolean silent, PipelineClassloader ruleClassLoader) throws ParseException {
"""
Parses the given rule source and optionally generates a Java class for it if the classloader is not null.
@param id the id of the rule, necessary to generate code
@param rule rule sour... | java | public Rule parseRule(String id, String rule, boolean silent, PipelineClassloader ruleClassLoader) throws ParseException {
final ParseContext parseContext = new ParseContext(silent);
final SyntaxErrorListener errorListener = new SyntaxErrorListener(parseContext);
final RuleLangLexer lexer = new... | [
"public",
"Rule",
"parseRule",
"(",
"String",
"id",
",",
"String",
"rule",
",",
"boolean",
"silent",
",",
"PipelineClassloader",
"ruleClassLoader",
")",
"throws",
"ParseException",
"{",
"final",
"ParseContext",
"parseContext",
"=",
"new",
"ParseContext",
"(",
"sil... | Parses the given rule source and optionally generates a Java class for it if the classloader is not null.
@param id the id of the rule, necessary to generate code
@param rule rule source code
@param silent don't emit status messages during parsing
@param ruleClassLoader the classloader to load the generated code into ... | [
"Parses",
"the",
"given",
"rule",
"source",
"and",
"optionally",
"generates",
"a",
"Java",
"class",
"for",
"it",
"if",
"the",
"classloader",
"is",
"not",
"null",
"."
] | train | https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/parser/PipelineRuleParser.java#L147-L188 |
spotbugs/spotbugs | spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/BugLoader.java | BugLoader.createEngine | private static IFindBugsEngine createEngine(@Nonnull Project p, BugReporter pcb) {
"""
Create the IFindBugsEngine that will be used to analyze the application.
@param p
the Project
@param pcb
the PrintCallBack
@return the IFindBugsEngine
"""
FindBugs2 engine = new FindBugs2();
engine.set... | java | private static IFindBugsEngine createEngine(@Nonnull Project p, BugReporter pcb) {
FindBugs2 engine = new FindBugs2();
engine.setBugReporter(pcb);
engine.setProject(p);
engine.setDetectorFactoryCollection(DetectorFactoryCollection.instance());
//
// Honor -effort option... | [
"private",
"static",
"IFindBugsEngine",
"createEngine",
"(",
"@",
"Nonnull",
"Project",
"p",
",",
"BugReporter",
"pcb",
")",
"{",
"FindBugs2",
"engine",
"=",
"new",
"FindBugs2",
"(",
")",
";",
"engine",
".",
"setBugReporter",
"(",
"pcb",
")",
";",
"engine",
... | Create the IFindBugsEngine that will be used to analyze the application.
@param p
the Project
@param pcb
the PrintCallBack
@return the IFindBugsEngine | [
"Create",
"the",
"IFindBugsEngine",
"that",
"will",
"be",
"used",
"to",
"analyze",
"the",
"application",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/BugLoader.java#L124-L137 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/Utils.java | Utils.collapseStackToArray | public static int collapseStackToArray(MethodVisitor mv, String desc) {
"""
/*
Produce the bytecode that will collapse the stack entries into an array - the descriptor describes what is being packed.
@param mv the method visitor to receive the instructions to package the data
@param desc the descriptor for th... | java | public static int collapseStackToArray(MethodVisitor mv, String desc) {
// Descriptor is of the format (Ljava/lang/String;IZZ)V
String descSequence = Utils.getParamSequence(desc);
if (descSequence == null) {
return 0; // nothing to do, there are no parameters
}
int count = descSequence.length();
// Creat... | [
"public",
"static",
"int",
"collapseStackToArray",
"(",
"MethodVisitor",
"mv",
",",
"String",
"desc",
")",
"{",
"// Descriptor is of the format (Ljava/lang/String;IZZ)V",
"String",
"descSequence",
"=",
"Utils",
".",
"getParamSequence",
"(",
"desc",
")",
";",
"if",
"("... | /*
Produce the bytecode that will collapse the stack entries into an array - the descriptor describes what is being packed.
@param mv the method visitor to receive the instructions to package the data
@param desc the descriptor for the method that shows (through its parameters) the contents of the stack | [
"/",
"*",
"Produce",
"the",
"bytecode",
"that",
"will",
"collapse",
"the",
"stack",
"entries",
"into",
"an",
"array",
"-",
"the",
"descriptor",
"describes",
"what",
"is",
"being",
"packed",
"."
] | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/Utils.java#L1689-L1750 |
jbundle/jbundle | thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/ReceiveQueueProxy.java | ReceiveQueueProxy.removeRemoteMessageFilter | public boolean removeRemoteMessageFilter(BaseMessageFilter messageFilter, boolean bFreeFilter) throws RemoteException {
"""
Remove this remote message filter.
@param messageFilter The message filter to remove.
@param bFreeFilter If true, free the remote filter.
"""
BaseTransport transport = this.crea... | java | public boolean removeRemoteMessageFilter(BaseMessageFilter messageFilter, boolean bFreeFilter) throws RemoteException
{
BaseTransport transport = this.createProxyTransport(REMOVE_REMOTE_MESSAGE_FILTER);
transport.addParam(FILTER, messageFilter); // Don't use COMMAND
transport.addParam(FREE... | [
"public",
"boolean",
"removeRemoteMessageFilter",
"(",
"BaseMessageFilter",
"messageFilter",
",",
"boolean",
"bFreeFilter",
")",
"throws",
"RemoteException",
"{",
"BaseTransport",
"transport",
"=",
"this",
".",
"createProxyTransport",
"(",
"REMOVE_REMOTE_MESSAGE_FILTER",
")... | Remove this remote message filter.
@param messageFilter The message filter to remove.
@param bFreeFilter If true, free the remote filter. | [
"Remove",
"this",
"remote",
"message",
"filter",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/ReceiveQueueProxy.java#L98-L108 |
gallandarakhneorg/afc | maven/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java | AbstractArakhneMojo.findFiles | public final synchronized void findFiles(File directory, FileFilter filter, Map<? super File, File> fileOut) {
"""
Replies a map of files which are found on the file system. The map has the
found files as keys and the search directory as values.
@param directory
is the directory to search in.
@param filter
... | java | public final synchronized void findFiles(File directory, FileFilter filter, Map<? super File, File> fileOut) {
findFiles(directory, filter, fileOut, null);
} | [
"public",
"final",
"synchronized",
"void",
"findFiles",
"(",
"File",
"directory",
",",
"FileFilter",
"filter",
",",
"Map",
"<",
"?",
"super",
"File",
",",
"File",
">",
"fileOut",
")",
"{",
"findFiles",
"(",
"directory",
",",
"filter",
",",
"fileOut",
",",
... | Replies a map of files which are found on the file system. The map has the
found files as keys and the search directory as values.
@param directory
is the directory to search in.
@param filter
is the file selector
@param fileOut
is the list of files to fill. | [
"Replies",
"a",
"map",
"of",
"files",
"which",
"are",
"found",
"on",
"the",
"file",
"system",
".",
"The",
"map",
"has",
"the",
"found",
"files",
"as",
"keys",
"and",
"the",
"search",
"directory",
"as",
"values",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/maven/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java#L719-L721 |
teatrove/teatrove | tea/src/main/java/org/teatrove/tea/compiler/Type.java | Type.toPrimitive | public Type toPrimitive() {
"""
Returns a new type from this one that represents a primitive type.
If this type cannot be represented by a primitive, then this is
returned.
"""
if (mPrimitive) {
return this;
}
else {
Class<?> primitive = convertToPrimitive(mObj... | java | public Type toPrimitive() {
if (mPrimitive) {
return this;
}
else {
Class<?> primitive = convertToPrimitive(mObjectClass);
if (primitive.isPrimitive()) { return new Type(primitive); }
else { return new Type(mGenericType, primitive); }
}
... | [
"public",
"Type",
"toPrimitive",
"(",
")",
"{",
"if",
"(",
"mPrimitive",
")",
"{",
"return",
"this",
";",
"}",
"else",
"{",
"Class",
"<",
"?",
">",
"primitive",
"=",
"convertToPrimitive",
"(",
"mObjectClass",
")",
";",
"if",
"(",
"primitive",
".",
"isP... | Returns a new type from this one that represents a primitive type.
If this type cannot be represented by a primitive, then this is
returned. | [
"Returns",
"a",
"new",
"type",
"from",
"this",
"one",
"that",
"represents",
"a",
"primitive",
"type",
".",
"If",
"this",
"type",
"cannot",
"be",
"represented",
"by",
"a",
"primitive",
"then",
"this",
"is",
"returned",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/tea/src/main/java/org/teatrove/tea/compiler/Type.java#L252-L261 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java | BlobContainersInner.createOrUpdateImmutabilityPolicyAsync | public Observable<ImmutabilityPolicyInner> createOrUpdateImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays, String ifMatch) {
"""
Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not requ... | java | public Observable<ImmutabilityPolicyInner> createOrUpdateImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays, String ifMatch) {
return createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, contai... | [
"public",
"Observable",
"<",
"ImmutabilityPolicyInner",
">",
"createOrUpdateImmutabilityPolicyAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"containerName",
",",
"int",
"immutabilityPeriodSinceCreationInDays",
",",
"String",
"ifMatch... | Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param accountName The name of the storage account within the specified res... | [
"Creates",
"or",
"updates",
"an",
"unlocked",
"immutability",
"policy",
".",
"ETag",
"in",
"If",
"-",
"Match",
"is",
"honored",
"if",
"given",
"but",
"not",
"required",
"for",
"this",
"operation",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java#L1127-L1134 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/HintedHandOffManager.java | HintedHandOffManager.scheduleHintDelivery | public void scheduleHintDelivery(final InetAddress to, final boolean precompact) {
"""
/*
This method is used to deliver hints to a particular endpoint.
When we learn that some endpoint is back up we deliver the data
to him via an event driven mechanism.
"""
// We should not deliver hints to the sam... | java | public void scheduleHintDelivery(final InetAddress to, final boolean precompact)
{
// We should not deliver hints to the same host in 2 different threads
if (!queuedDeliveries.add(to))
return;
logger.debug("Scheduling delivery of Hints to {}", to);
executor.execute(new ... | [
"public",
"void",
"scheduleHintDelivery",
"(",
"final",
"InetAddress",
"to",
",",
"final",
"boolean",
"precompact",
")",
"{",
"// We should not deliver hints to the same host in 2 different threads",
"if",
"(",
"!",
"queuedDeliveries",
".",
"add",
"(",
"to",
")",
")",
... | /*
This method is used to deliver hints to a particular endpoint.
When we learn that some endpoint is back up we deliver the data
to him via an event driven mechanism. | [
"/",
"*",
"This",
"method",
"is",
"used",
"to",
"deliver",
"hints",
"to",
"a",
"particular",
"endpoint",
".",
"When",
"we",
"learn",
"that",
"some",
"endpoint",
"is",
"back",
"up",
"we",
"deliver",
"the",
"data",
"to",
"him",
"via",
"an",
"event",
"dri... | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/HintedHandOffManager.java#L529-L556 |
astrapi69/jaulp-wicket | jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/ComponentFinder.java | ComponentFinder.findOrCreateNewAjaxRequestTarget | public static AjaxRequestTarget findOrCreateNewAjaxRequestTarget(
final WebApplication application, final Page page) {
"""
Finds the current {@link AjaxRequestTarget} or creates a new ajax request target from the
given application and page if the current {@link AjaxRequestTarget} is null.
@param application
... | java | public static AjaxRequestTarget findOrCreateNewAjaxRequestTarget(
final WebApplication application, final Page page)
{
final AjaxRequestTarget target = findAjaxRequestTarget();
if (target != null)
{
return target;
}
return newAjaxRequestTarget(application, page);
} | [
"public",
"static",
"AjaxRequestTarget",
"findOrCreateNewAjaxRequestTarget",
"(",
"final",
"WebApplication",
"application",
",",
"final",
"Page",
"page",
")",
"{",
"final",
"AjaxRequestTarget",
"target",
"=",
"findAjaxRequestTarget",
"(",
")",
";",
"if",
"(",
"target"... | Finds the current {@link AjaxRequestTarget} or creates a new ajax request target from the
given application and page if the current {@link AjaxRequestTarget} is null.
@param application
the web application
@param page
page on which ajax response is made
@return an AjaxRequestTarget instance
@see WebApplication#newAja... | [
"Finds",
"the",
"current",
"{",
"@link",
"AjaxRequestTarget",
"}",
"or",
"creates",
"a",
"new",
"ajax",
"request",
"target",
"from",
"the",
"given",
"application",
"and",
"page",
"if",
"the",
"current",
"{",
"@link",
"AjaxRequestTarget",
"}",
"is",
"null",
"... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/ComponentFinder.java#L72-L81 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/PrepareRequestInterceptor.java | PrepareRequestInterceptor.prepareIPSUri | private String prepareIPSUri(String action, Context context) throws FMSException {
"""
Method to construct the IPS URI
@param action
the entity name
@param context
the context
@return the IPS URI
@throws FMSException
the FMSException
"""
StringBuilder uri = new StringBuilder();
uri.append(Config.g... | java | private String prepareIPSUri(String action, Context context) throws FMSException {
StringBuilder uri = new StringBuilder();
uri.append(Config.getProperty(Config.BASE_URL_PLATFORMSERVICE)).append("/").append(context.getAppDBID())
.append("?act=").append(action).append("&token=").append(context.getAppToken());
r... | [
"private",
"String",
"prepareIPSUri",
"(",
"String",
"action",
",",
"Context",
"context",
")",
"throws",
"FMSException",
"{",
"StringBuilder",
"uri",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"uri",
".",
"append",
"(",
"Config",
".",
"getProperty",
"(",
"C... | Method to construct the IPS URI
@param action
the entity name
@param context
the context
@return the IPS URI
@throws FMSException
the FMSException | [
"Method",
"to",
"construct",
"the",
"IPS",
"URI"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/PrepareRequestInterceptor.java#L411-L416 |
cdk/cdk | tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java | GasteigerPEPEPartialCharges.setFlags | private IAtomContainer setFlags(IAtomContainer container, IAtomContainer ac, boolean b) {
"""
Set the Flags to atoms and bonds from an atomContainer.
@param container Container with the flags
@param ac Container to put the flags
@param b True, if the the flag is true
@return Container... | java | private IAtomContainer setFlags(IAtomContainer container, IAtomContainer ac, boolean b) {
for (Iterator<IAtom> it = container.atoms().iterator(); it.hasNext();) {
int positionA = ac.indexOf(it.next());
ac.getAtom(positionA).setFlag(CDKConstants.REACTIVE_CENTER, b);
}
for ... | [
"private",
"IAtomContainer",
"setFlags",
"(",
"IAtomContainer",
"container",
",",
"IAtomContainer",
"ac",
",",
"boolean",
"b",
")",
"{",
"for",
"(",
"Iterator",
"<",
"IAtom",
">",
"it",
"=",
"container",
".",
"atoms",
"(",
")",
".",
"iterator",
"(",
")",
... | Set the Flags to atoms and bonds from an atomContainer.
@param container Container with the flags
@param ac Container to put the flags
@param b True, if the the flag is true
@return Container with added flags | [
"Set",
"the",
"Flags",
"to",
"atoms",
"and",
"bonds",
"from",
"an",
"atomContainer",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java#L475-L486 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/math/ArrayMath.java | ArrayMath.sampleFromDistribution | public static int sampleFromDistribution(double[] d, Random random) {
"""
Samples from the distribution over values 0 through d.length given by d.
Assumes that the distribution sums to 1.0.
@param d the distribution to sample from
@return a value from 0 to d.length
"""
// sample from the uniform [0,1... | java | public static int sampleFromDistribution(double[] d, Random random) {
// sample from the uniform [0,1]
double r = random.nextDouble();
// now compare its value to cumulative values to find what interval it falls in
double total = 0;
for (int i = 0; i < d.length - 1; i++) {
if (Double.isN... | [
"public",
"static",
"int",
"sampleFromDistribution",
"(",
"double",
"[",
"]",
"d",
",",
"Random",
"random",
")",
"{",
"// sample from the uniform [0,1]\r",
"double",
"r",
"=",
"random",
".",
"nextDouble",
"(",
")",
";",
"// now compare its value to cumulative values t... | Samples from the distribution over values 0 through d.length given by d.
Assumes that the distribution sums to 1.0.
@param d the distribution to sample from
@return a value from 0 to d.length | [
"Samples",
"from",
"the",
"distribution",
"over",
"values",
"0",
"through",
"d",
".",
"length",
"given",
"by",
"d",
".",
"Assumes",
"that",
"the",
"distribution",
"sums",
"to",
"1",
".",
"0",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/math/ArrayMath.java#L1231-L1246 |
sundrio/sundrio | codegen/src/main/java/io/sundr/codegen/processor/JavaGeneratingProcessor.java | JavaGeneratingProcessor.generateFromStringTemplate | public <T> void generateFromStringTemplate(T model, String outputPath, String content) throws IOException {
"""
Generates a source file from the specified {@link io.sundr.codegen.model.TypeDef}.
@param model The model of the class to generate.
@param outputPath Where to save the generated class.
@p... | java | public <T> void generateFromStringTemplate(T model, String outputPath, String content) throws IOException {
generateFromStringTemplate(model, new String[0], outputPath, content);
} | [
"public",
"<",
"T",
">",
"void",
"generateFromStringTemplate",
"(",
"T",
"model",
",",
"String",
"outputPath",
",",
"String",
"content",
")",
"throws",
"IOException",
"{",
"generateFromStringTemplate",
"(",
"model",
",",
"new",
"String",
"[",
"0",
"]",
",",
... | Generates a source file from the specified {@link io.sundr.codegen.model.TypeDef}.
@param model The model of the class to generate.
@param outputPath Where to save the generated class.
@param content The template to use.
@throws IOException If it fails to create the source file. | [
"Generates",
"a",
"source",
"file",
"from",
"the",
"specified",
"{",
"@link",
"io",
".",
"sundr",
".",
"codegen",
".",
"model",
".",
"TypeDef",
"}",
"."
] | train | https://github.com/sundrio/sundrio/blob/4e38368f4db0d950f7c41a8c75e15b0baff1f69a/codegen/src/main/java/io/sundr/codegen/processor/JavaGeneratingProcessor.java#L139-L141 |
ops4j/org.ops4j.base | ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java | Resources.getFloat | public float getFloat( String key, float defaultValue )
throws MissingResourceException {
"""
Retrieve a float from bundle.
@param key the key of resource
@param defaultValue the default value if key is missing
@return the resource float
@throws MissingResourceException if the requested ... | java | public float getFloat( String key, float defaultValue )
throws MissingResourceException
{
try
{
return getFloat( key );
}
catch( MissingResourceException mre )
{
return defaultValue;
}
} | [
"public",
"float",
"getFloat",
"(",
"String",
"key",
",",
"float",
"defaultValue",
")",
"throws",
"MissingResourceException",
"{",
"try",
"{",
"return",
"getFloat",
"(",
"key",
")",
";",
"}",
"catch",
"(",
"MissingResourceException",
"mre",
")",
"{",
"return",... | Retrieve a float from bundle.
@param key the key of resource
@param defaultValue the default value if key is missing
@return the resource float
@throws MissingResourceException if the requested key is unknown | [
"Retrieve",
"a",
"float",
"from",
"bundle",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java#L427-L438 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/search/bingimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/search/imagesearch/implementation/BingImagesImpl.java | BingImagesImpl.trendingWithServiceResponseAsync | public Observable<ServiceResponse<TrendingImages>> trendingWithServiceResponseAsync(TrendingOptionalParameter trendingOptionalParameter) {
"""
The Image Trending Search API lets you search on Bing and get back a list of images that are trending based on search requests made by others. The images are broken out int... | java | public Observable<ServiceResponse<TrendingImages>> trendingWithServiceResponseAsync(TrendingOptionalParameter trendingOptionalParameter) {
final String acceptLanguage = trendingOptionalParameter != null ? trendingOptionalParameter.acceptLanguage() : null;
final String userAgent = trendingOptionalParamet... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"TrendingImages",
">",
">",
"trendingWithServiceResponseAsync",
"(",
"TrendingOptionalParameter",
"trendingOptionalParameter",
")",
"{",
"final",
"String",
"acceptLanguage",
"=",
"trendingOptionalParameter",
"!=",
"null",
... | The Image Trending Search API lets you search on Bing and get back a list of images that are trending based on search requests made by others. The images are broken out into different categories. For example, Popular People Searches. For a list of markets that support trending images, see [Trending Images](https://docs... | [
"The",
"Image",
"Trending",
"Search",
"API",
"lets",
"you",
"search",
"on",
"Bing",
"and",
"get",
"back",
"a",
"list",
"of",
"images",
"that",
"are",
"trending",
"based",
"on",
"search",
"requests",
"made",
"by",
"others",
".",
"The",
"images",
"are",
"b... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/search/bingimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/search/imagesearch/implementation/BingImagesImpl.java#L824-L836 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/MSPDIReader.java | MSPDIReader.isSplit | private boolean isSplit(ProjectCalendar calendar, List<TimephasedWork> list) {
"""
Test to determine if this is a split task.
@param calendar current calendar
@param list timephased resource assignment list
@return boolean flag
"""
boolean result = false;
for (TimephasedWork assignment : list)... | java | private boolean isSplit(ProjectCalendar calendar, List<TimephasedWork> list)
{
boolean result = false;
for (TimephasedWork assignment : list)
{
if (calendar != null && assignment.getTotalAmount().getDuration() == 0)
{
Duration calendarWork = calendar.getWork(assignment... | [
"private",
"boolean",
"isSplit",
"(",
"ProjectCalendar",
"calendar",
",",
"List",
"<",
"TimephasedWork",
">",
"list",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"for",
"(",
"TimephasedWork",
"assignment",
":",
"list",
")",
"{",
"if",
"(",
"calendar",
... | Test to determine if this is a split task.
@param calendar current calendar
@param list timephased resource assignment list
@return boolean flag | [
"Test",
"to",
"determine",
"if",
"this",
"is",
"a",
"split",
"task",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDIReader.java#L1739-L1755 |
kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java | URIUtils.buildURIAsString | public static String buildURIAsString(String scheme, String authority, String path,
String query, String fragment) throws URISyntaxException {
"""
Helper method for building URI as String
@param scheme
@param authority
@param path
@param query
@param fragment
@return
@throws URISyntaxException
... | java | public static String buildURIAsString(String scheme, String authority, String path,
String query, String fragment) throws URISyntaxException {
URI helperURI;
try {
helperURI = new URI(scheme, authority, path, query, fragment);
} catch (URISyntaxException e) {
... | [
"public",
"static",
"String",
"buildURIAsString",
"(",
"String",
"scheme",
",",
"String",
"authority",
",",
"String",
"path",
",",
"String",
"query",
",",
"String",
"fragment",
")",
"throws",
"URISyntaxException",
"{",
"URI",
"helperURI",
";",
"try",
"{",
"hel... | Helper method for building URI as String
@param scheme
@param authority
@param path
@param query
@param fragment
@return
@throws URISyntaxException | [
"Helper",
"method",
"for",
"building",
"URI",
"as",
"String"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java#L222-L231 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/ListFixture.java | ListFixture.addTo | public void addTo(Object value, List aList) {
"""
Adds new element to end of list.
@param value value to add.
@param aList list to add to.
"""
Object cleanValue = cleanupValue(value);
aList.add(cleanValue);
} | java | public void addTo(Object value, List aList) {
Object cleanValue = cleanupValue(value);
aList.add(cleanValue);
} | [
"public",
"void",
"addTo",
"(",
"Object",
"value",
",",
"List",
"aList",
")",
"{",
"Object",
"cleanValue",
"=",
"cleanupValue",
"(",
"value",
")",
";",
"aList",
".",
"add",
"(",
"cleanValue",
")",
";",
"}"
] | Adds new element to end of list.
@param value value to add.
@param aList list to add to. | [
"Adds",
"new",
"element",
"to",
"end",
"of",
"list",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/ListFixture.java#L106-L109 |
broadinstitute/barclay | src/main/java/org/broadinstitute/barclay/utils/Utils.java | Utils.nonNull | public static <T> T nonNull(final T object, final String message) {
"""
Checks that an {@link Object} is not {@code null} and returns the same object or throws an {@link IllegalArgumentException}
@param object any Object
@param message the text message that would be passed to the exception thrown when {@code o =... | java | public static <T> T nonNull(final T object, final String message) {
if (object == null) {
throw new IllegalArgumentException(message);
}
return object;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"nonNull",
"(",
"final",
"T",
"object",
",",
"final",
"String",
"message",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"message",
")",
";",
"}",
"return... | Checks that an {@link Object} is not {@code null} and returns the same object or throws an {@link IllegalArgumentException}
@param object any Object
@param message the text message that would be passed to the exception thrown when {@code o == null}.
@return the same object
@throws IllegalArgumentException if a {@code o... | [
"Checks",
"that",
"an",
"{"
] | train | https://github.com/broadinstitute/barclay/blob/7e56d725766b0da3baff23e79a31c3d01c3589c2/src/main/java/org/broadinstitute/barclay/utils/Utils.java#L42-L47 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPUtils.java | RTMPUtils.encodeHeaderByte | public static void encodeHeaderByte(IoBuffer out, byte headerSize, int channelId) {
"""
Encodes header size marker and channel id into header marker.
@param out output buffer
@param headerSize Header size marker
@param channelId Channel used
"""
if (channelId <= 63) {
out.put((byte) ... | java | public static void encodeHeaderByte(IoBuffer out, byte headerSize, int channelId) {
if (channelId <= 63) {
out.put((byte) ((headerSize << 6) + channelId));
} else if (channelId <= 319) {
out.put((byte) (headerSize << 6));
out.put((byte) (channelId - 64));
... | [
"public",
"static",
"void",
"encodeHeaderByte",
"(",
"IoBuffer",
"out",
",",
"byte",
"headerSize",
",",
"int",
"channelId",
")",
"{",
"if",
"(",
"channelId",
"<=",
"63",
")",
"{",
"out",
".",
"put",
"(",
"(",
"byte",
")",
"(",
"(",
"headerSize",
"<<",
... | Encodes header size marker and channel id into header marker.
@param out output buffer
@param headerSize Header size marker
@param channelId Channel used | [
"Encodes",
"header",
"size",
"marker",
"and",
"channel",
"id",
"into",
"header",
"marker",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPUtils.java#L124-L136 |
jcuda/jcurand | JCurandJava/src/main/java/jcuda/jcurand/JCurand.java | JCurand.curandGenerateNormal | public static int curandGenerateNormal(curandGenerator generator, Pointer outputPtr, long n, float mean, float stddev) {
"""
<pre>
Generate normally distributed floats.
Use generator to generate num float results into the device memory at
outputPtr. The device memory must have been previously allocated and b... | java | public static int curandGenerateNormal(curandGenerator generator, Pointer outputPtr, long n, float mean, float stddev)
{
return checkResult(curandGenerateNormalNative(generator, outputPtr, n, mean, stddev));
} | [
"public",
"static",
"int",
"curandGenerateNormal",
"(",
"curandGenerator",
"generator",
",",
"Pointer",
"outputPtr",
",",
"long",
"n",
",",
"float",
"mean",
",",
"float",
"stddev",
")",
"{",
"return",
"checkResult",
"(",
"curandGenerateNormalNative",
"(",
"generat... | <pre>
Generate normally distributed floats.
Use generator to generate num float results into the device memory at
outputPtr. The device memory must have been previously allocated and be
large enough to hold all the results. Launches are done with the stream
set using ::curandSetStream(), or the null stream if no str... | [
"<pre",
">",
"Generate",
"normally",
"distributed",
"floats",
"."
] | train | https://github.com/jcuda/jcurand/blob/0f463d2bb72cd93b3988f7ce148cdb6069ba4fd9/JCurandJava/src/main/java/jcuda/jcurand/JCurand.java#L680-L683 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/trace/Tracer.java | Tracer.withSpan | public final Runnable withSpan(Span span, Runnable runnable) {
"""
Returns a {@link Runnable} that runs the given task with the given {@code Span} in the current
context.
<p>Users may consider to use {@link SpanBuilder#startSpanAndRun(Runnable)}.
<p>Any error will end up as a {@link Status#UNKNOWN}.
<p>I... | java | public final Runnable withSpan(Span span, Runnable runnable) {
return CurrentSpanUtils.withSpan(span, /* endSpan= */ false, runnable);
} | [
"public",
"final",
"Runnable",
"withSpan",
"(",
"Span",
"span",
",",
"Runnable",
"runnable",
")",
"{",
"return",
"CurrentSpanUtils",
".",
"withSpan",
"(",
"span",
",",
"/* endSpan= */",
"false",
",",
"runnable",
")",
";",
"}"
] | Returns a {@link Runnable} that runs the given task with the given {@code Span} in the current
context.
<p>Users may consider to use {@link SpanBuilder#startSpanAndRun(Runnable)}.
<p>Any error will end up as a {@link Status#UNKNOWN}.
<p>IMPORTANT: Caller must manually propagate the entire {@code io.grpc.Context} whe... | [
"Returns",
"a",
"{",
"@link",
"Runnable",
"}",
"that",
"runs",
"the",
"given",
"task",
"with",
"the",
"given",
"{",
"@code",
"Span",
"}",
"in",
"the",
"current",
"context",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/Tracer.java#L218-L220 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/MurmurHashUtil.java | MurmurHashUtil.hashUnsafeBytesByWords | public static int hashUnsafeBytesByWords(Object base, long offset, int lengthInBytes) {
"""
Hash unsafe bytes, length must be aligned to 4 bytes.
@param base base unsafe object
@param offset offset for unsafe object
@param lengthInBytes length in bytes
@return hash code
"""
return hashUnsafeBytesByWords(... | java | public static int hashUnsafeBytesByWords(Object base, long offset, int lengthInBytes) {
return hashUnsafeBytesByWords(base, offset, lengthInBytes, DEFAULT_SEED);
} | [
"public",
"static",
"int",
"hashUnsafeBytesByWords",
"(",
"Object",
"base",
",",
"long",
"offset",
",",
"int",
"lengthInBytes",
")",
"{",
"return",
"hashUnsafeBytesByWords",
"(",
"base",
",",
"offset",
",",
"lengthInBytes",
",",
"DEFAULT_SEED",
")",
";",
"}"
] | Hash unsafe bytes, length must be aligned to 4 bytes.
@param base base unsafe object
@param offset offset for unsafe object
@param lengthInBytes length in bytes
@return hash code | [
"Hash",
"unsafe",
"bytes",
"length",
"must",
"be",
"aligned",
"to",
"4",
"bytes",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/MurmurHashUtil.java#L40-L42 |
augustd/burp-suite-utils | src/main/java/com/codemagi/burp/Utils.java | Utils.noNulls | public static String noNulls(String test, String output, String defaultOutput) {
"""
Outputs the String output if the test String is not empty, otherwise
outputs default
@param test String to test for emptyness
@param output String to output if the test String is not empty
@param defaultOutput String to outp... | java | public static String noNulls(String test, String output, String defaultOutput) {
if (isEmpty(test)) {
return defaultOutput;
}
return output;
} | [
"public",
"static",
"String",
"noNulls",
"(",
"String",
"test",
",",
"String",
"output",
",",
"String",
"defaultOutput",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"test",
")",
")",
"{",
"return",
"defaultOutput",
";",
"}",
"return",
"output",
";",
"}"
] | Outputs the String output if the test String is not empty, otherwise
outputs default
@param test String to test for emptyness
@param output String to output if the test String is not empty
@param defaultOutput String to output if the test String is empty
@return Object Empty String if the input was null, the input unc... | [
"Outputs",
"the",
"String",
"output",
"if",
"the",
"test",
"String",
"is",
"not",
"empty",
"otherwise",
"outputs",
"default"
] | train | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/Utils.java#L153-L159 |
alkacon/opencms-core | src/org/opencms/ui/apps/scheduler/CmsJobManagerApp.java | CmsJobManagerApp.openEditDialog | public CmsJobEditView openEditDialog(String jobId, boolean copy) {
"""
Creates the edit view for the given job id.<p>
@param jobId the id of the job to edit, or null to create a new job
@param copy <code>true</code> to create a copy of the given job
@return the edit view
"""
if (m_dialogWindow ... | java | public CmsJobEditView openEditDialog(String jobId, boolean copy) {
if (m_dialogWindow != null) {
m_dialogWindow.close();
}
m_dialogWindow = CmsBasicDialog.prepareWindow(DialogWidth.wide);
CmsScheduledJobInfo job = null;
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(jo... | [
"public",
"CmsJobEditView",
"openEditDialog",
"(",
"String",
"jobId",
",",
"boolean",
"copy",
")",
"{",
"if",
"(",
"m_dialogWindow",
"!=",
"null",
")",
"{",
"m_dialogWindow",
".",
"close",
"(",
")",
";",
"}",
"m_dialogWindow",
"=",
"CmsBasicDialog",
".",
"pr... | Creates the edit view for the given job id.<p>
@param jobId the id of the job to edit, or null to create a new job
@param copy <code>true</code> to create a copy of the given job
@return the edit view | [
"Creates",
"the",
"edit",
"view",
"for",
"the",
"given",
"job",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/scheduler/CmsJobManagerApp.java#L151-L191 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/MSPDIReader.java | MSPDIReader.readPredecessor | private void readPredecessor(Task currTask, Project.Tasks.Task.PredecessorLink link) {
"""
This method extracts data for a single predecessor from an MSPDI file.
@param currTask Current task object
@param link Predecessor data
"""
BigInteger uid = link.getPredecessorUID();
if (uid != null)
... | java | private void readPredecessor(Task currTask, Project.Tasks.Task.PredecessorLink link)
{
BigInteger uid = link.getPredecessorUID();
if (uid != null)
{
Task prevTask = m_projectFile.getTaskByUniqueID(Integer.valueOf(uid.intValue()));
if (prevTask != null)
{
Relat... | [
"private",
"void",
"readPredecessor",
"(",
"Task",
"currTask",
",",
"Project",
".",
"Tasks",
".",
"Task",
".",
"PredecessorLink",
"link",
")",
"{",
"BigInteger",
"uid",
"=",
"link",
".",
"getPredecessorUID",
"(",
")",
";",
"if",
"(",
"uid",
"!=",
"null",
... | This method extracts data for a single predecessor from an MSPDI file.
@param currTask Current task object
@param link Predecessor data | [
"This",
"method",
"extracts",
"data",
"for",
"a",
"single",
"predecessor",
"from",
"an",
"MSPDI",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDIReader.java#L1503-L1545 |
apereo/cas | support/cas-server-support-scim/src/main/java/org/apereo/cas/scim/v1/ScimV1PrincipalProvisioner.java | ScimV1PrincipalProvisioner.updateUserResource | @SneakyThrows
protected boolean updateUserResource(final UserResource user, final Principal p, final Credential credential) {
"""
Update user resource boolean.
@param user the user
@param p the p
@param credential the credential
@return the boolean
"""
this.mapper.map(user, p, ... | java | @SneakyThrows
protected boolean updateUserResource(final UserResource user, final Principal p, final Credential credential) {
this.mapper.map(user, p, credential);
return endpoint.update(user) != null;
} | [
"@",
"SneakyThrows",
"protected",
"boolean",
"updateUserResource",
"(",
"final",
"UserResource",
"user",
",",
"final",
"Principal",
"p",
",",
"final",
"Credential",
"credential",
")",
"{",
"this",
".",
"mapper",
".",
"map",
"(",
"user",
",",
"p",
",",
"crede... | Update user resource boolean.
@param user the user
@param p the p
@param credential the credential
@return the boolean | [
"Update",
"user",
"resource",
"boolean",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-scim/src/main/java/org/apereo/cas/scim/v1/ScimV1PrincipalProvisioner.java#L89-L93 |
kopihao/peasy-recyclerview | peasy-recyclerview/src/main/java/com/kopirealm/peasyrecyclerview/PeasyRecyclerView.java | PeasyRecyclerView.configureRecyclerViewScrollEvent | private void configureRecyclerViewScrollEvent() {
"""
*
Provide default {@link RecyclerView.OnScrollListener} of provided recyclerView
"""
getRecyclerView().addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(@NonNull final RecyclerView re... | java | private void configureRecyclerViewScrollEvent() {
getRecyclerView().addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(@NonNull final RecyclerView recyclerView, final int dx, final int dy) {
super.onScrolled(recyclerView, dx, dy);
... | [
"private",
"void",
"configureRecyclerViewScrollEvent",
"(",
")",
"{",
"getRecyclerView",
"(",
")",
".",
"addOnScrollListener",
"(",
"new",
"RecyclerView",
".",
"OnScrollListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onScrolled",
"(",
"@",
"NonNull",... | *
Provide default {@link RecyclerView.OnScrollListener} of provided recyclerView | [
"*",
"Provide",
"default",
"{"
] | train | https://github.com/kopihao/peasy-recyclerview/blob/a26071849e5d5b5b1febe685f205558b49908f87/peasy-recyclerview/src/main/java/com/kopirealm/peasyrecyclerview/PeasyRecyclerView.java#L167-L207 |
jbundle/jbundle | thin/base/util/util/src/main/java/org/jbundle/thin/base/util/Application.java | Application.registerUniqueApplication | public int registerUniqueApplication(String strQueueName, String strQueueType) {
"""
Register this unique application so there will be only one running.
@param strQueueName The (optional) Queue that this app services.
@param strQueueType The (optional) QueueType for this queue.
@return NORMAL_RETURN If I regist... | java | public int registerUniqueApplication(String strQueueName, String strQueueType)
{
// HACK - This works if you are careful about starting the server... DONT TRUST THIS CODE!
// todo(don) - THIS DOES NOT WORK CORRECTLY (need to register this app with jini or write an entry in a table or use the lock se... | [
"public",
"int",
"registerUniqueApplication",
"(",
"String",
"strQueueName",
",",
"String",
"strQueueType",
")",
"{",
"// HACK - This works if you are careful about starting the server... DONT TRUST THIS CODE!",
"// todo(don) - THIS DOES NOT WORK CORRECTLY (need to register this app with jin... | Register this unique application so there will be only one running.
@param strQueueName The (optional) Queue that this app services.
@param strQueueType The (optional) QueueType for this queue.
@return NORMAL_RETURN If I registered the app okay, ERROR_RETURN if not (The app is already running) | [
"Register",
"this",
"unique",
"application",
"so",
"there",
"will",
"be",
"only",
"one",
"running",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/util/util/src/main/java/org/jbundle/thin/base/util/Application.java#L1233-L1242 |
OpenBEL/openbel-framework | org.openbel.framework.api/src/main/java/org/openbel/framework/api/OrthologizedKam.java | OrthologizedKam.wrapEdge | private KamEdge wrapEdge(KamEdge kamEdge) {
"""
Wrap a {@link KamEdge} as an {@link OrthologousEdge} to allow conversion
of the edge label by the {@link SpeciesDialect}. The edge's
{@link KamNode}s are also wrapped.
@param kamEdge {@link KamEdge}
@return the wrapped kam edge,
<ol>
<li>{@code null} if {@co... | java | private KamEdge wrapEdge(KamEdge kamEdge) {
if (kamEdge == null) {
return null;
}
TermParameter param = etp.get(kamEdge.getId());
if (param != null) {
return new OrthologousEdge(kamEdge, param);
}
return kamEdge;
} | [
"private",
"KamEdge",
"wrapEdge",
"(",
"KamEdge",
"kamEdge",
")",
"{",
"if",
"(",
"kamEdge",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"TermParameter",
"param",
"=",
"etp",
".",
"get",
"(",
"kamEdge",
".",
"getId",
"(",
")",
")",
";",
"if",... | Wrap a {@link KamEdge} as an {@link OrthologousEdge} to allow conversion
of the edge label by the {@link SpeciesDialect}. The edge's
{@link KamNode}s are also wrapped.
@param kamEdge {@link KamEdge}
@return the wrapped kam edge,
<ol>
<li>{@code null} if {@code kamEdge} input is {@code null}</li>
<li>{@link Orthologou... | [
"Wrap",
"a",
"{",
"@link",
"KamEdge",
"}",
"as",
"an",
"{",
"@link",
"OrthologousEdge",
"}",
"to",
"allow",
"conversion",
"of",
"the",
"edge",
"label",
"by",
"the",
"{",
"@link",
"SpeciesDialect",
"}",
".",
"The",
"edge",
"s",
"{",
"@link",
"KamNode",
... | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.api/src/main/java/org/openbel/framework/api/OrthologizedKam.java#L552-L563 |
alkacon/opencms-core | src/org/opencms/ui/dataview/CmsPagingControls.java | CmsPagingControls.setPage | public void setPage(int page, boolean fireChanged) {
"""
Sets the page index.<p>
@param page the page index
@param fireChanged true if the registered listeners should be notified
"""
m_page = page;
m_label.setValue("( " + (1 + m_page) + " / " + (m_lastPage + 1) + " )");
int start =... | java | public void setPage(int page, boolean fireChanged) {
m_page = page;
m_label.setValue("( " + (1 + m_page) + " / " + (m_lastPage + 1) + " )");
int start = (m_page * m_pageSize) + 1;
int end = Math.min((start + m_pageSize) - 1, m_resultCount);
String resultsMsg = CmsVaadinUtils.get... | [
"public",
"void",
"setPage",
"(",
"int",
"page",
",",
"boolean",
"fireChanged",
")",
"{",
"m_page",
"=",
"page",
";",
"m_label",
".",
"setValue",
"(",
"\"( \"",
"+",
"(",
"1",
"+",
"m_page",
")",
"+",
"\" / \"",
"+",
"(",
"m_lastPage",
"+",
"1",
")",... | Sets the page index.<p>
@param page the page index
@param fireChanged true if the registered listeners should be notified | [
"Sets",
"the",
"page",
"index",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/dataview/CmsPagingControls.java#L233-L248 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.loadBalancing_serviceName_backend_POST | public OvhLoadBalancingTask loadBalancing_serviceName_backend_POST(String serviceName, String ipBackend, OvhLoadBalancingBackendProbeEnum probe, Long weight) throws IOException {
"""
Add a new backend on your IP load balancing
REST: POST /ip/loadBalancing/{serviceName}/backend
@param weight [required] Weight o... | java | public OvhLoadBalancingTask loadBalancing_serviceName_backend_POST(String serviceName, String ipBackend, OvhLoadBalancingBackendProbeEnum probe, Long weight) throws IOException {
String qPath = "/ip/loadBalancing/{serviceName}/backend";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new H... | [
"public",
"OvhLoadBalancingTask",
"loadBalancing_serviceName_backend_POST",
"(",
"String",
"serviceName",
",",
"String",
"ipBackend",
",",
"OvhLoadBalancingBackendProbeEnum",
"probe",
",",
"Long",
"weight",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip... | Add a new backend on your IP load balancing
REST: POST /ip/loadBalancing/{serviceName}/backend
@param weight [required] Weight of the backend on its zone, must be between 1 and 100
@param probe [required] The type of probe used
@param ipBackend [required] IP of your backend
@param serviceName [required] The internal n... | [
"Add",
"a",
"new",
"backend",
"on",
"your",
"IP",
"load",
"balancing"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L1455-L1464 |
MGunlogson/CuckooFilter4J | src/main/java/com/github/mgunlogson/cuckoofilter4j/FilterTable.java | FilterTable.deleteTag | void deleteTag(long bucketIndex, int posInBucket) {
"""
Deletes (clears) a tag at a specific bucket index and position
@param bucketIndex bucket index
@param posInBucket position in bucket
"""
long tagStartIdx = getTagOffset(bucketIndex, posInBucket);
memBlock.clear(tagStartIdx, tagStartIdx + bitsPer... | java | void deleteTag(long bucketIndex, int posInBucket) {
long tagStartIdx = getTagOffset(bucketIndex, posInBucket);
memBlock.clear(tagStartIdx, tagStartIdx + bitsPerTag);
} | [
"void",
"deleteTag",
"(",
"long",
"bucketIndex",
",",
"int",
"posInBucket",
")",
"{",
"long",
"tagStartIdx",
"=",
"getTagOffset",
"(",
"bucketIndex",
",",
"posInBucket",
")",
";",
"memBlock",
".",
"clear",
"(",
"tagStartIdx",
",",
"tagStartIdx",
"+",
"bitsPerT... | Deletes (clears) a tag at a specific bucket index and position
@param bucketIndex bucket index
@param posInBucket position in bucket | [
"Deletes",
"(",
"clears",
")",
"a",
"tag",
"at",
"a",
"specific",
"bucket",
"index",
"and",
"position"
] | train | https://github.com/MGunlogson/CuckooFilter4J/blob/e8472aa150b201f05046d1c81cac5a5ca4348db8/src/main/java/com/github/mgunlogson/cuckoofilter4j/FilterTable.java#L255-L258 |
fuzzylite/jfuzzylite | jfuzzylite/src/main/java/com/fuzzylite/Benchmark.java | Benchmark.prepare | public void prepare(Reader reader, long numberOfLines) throws IOException {
"""
Reads and loads into memory the set of expected values from the engine
@param reader is the reader of a set of lines containing space-separated
values
@param numberOfLines is the maximum number of lines to read from the
reader, a... | java | public void prepare(Reader reader, long numberOfLines) throws IOException {
this.expected = new ArrayList<double[]>();
BufferedReader bufferedReader = new BufferedReader(reader);
try {
String line;
int lineNumber = 0;
while (lineNumber != numberOfLines
... | [
"public",
"void",
"prepare",
"(",
"Reader",
"reader",
",",
"long",
"numberOfLines",
")",
"throws",
"IOException",
"{",
"this",
".",
"expected",
"=",
"new",
"ArrayList",
"<",
"double",
"[",
"]",
">",
"(",
")",
";",
"BufferedReader",
"bufferedReader",
"=",
"... | Reads and loads into memory the set of expected values from the engine
@param reader is the reader of a set of lines containing space-separated
values
@param numberOfLines is the maximum number of lines to read from the
reader, and a value $f@n=(\infty, -1]$f@ reads the entire file.
@throws IOException if the reader c... | [
"Reads",
"and",
"loads",
"into",
"memory",
"the",
"set",
"of",
"expected",
"values",
"from",
"the",
"engine"
] | train | https://github.com/fuzzylite/jfuzzylite/blob/583ac1928f39512af75de80d560e67448039595a/jfuzzylite/src/main/java/com/fuzzylite/Benchmark.java#L284-L315 |
apereo/cas | support/cas-server-support-ws-sts-api/src/main/java/org/apereo/cas/support/util/CryptoUtils.java | CryptoUtils.getSecurityProperties | public static Properties getSecurityProperties(final String file, final String psw, final String alias) {
"""
Gets security properties.
@param file the file
@param psw the psw
@param alias the alias
@return the security properties
"""
val p = new Properties();
p.put("org.apache.ws.secu... | java | public static Properties getSecurityProperties(final String file, final String psw, final String alias) {
val p = new Properties();
p.put("org.apache.ws.security.crypto.provider", "org.apache.ws.security.components.crypto.Merlin");
p.put("org.apache.ws.security.crypto.merlin.keystore.type", "jks... | [
"public",
"static",
"Properties",
"getSecurityProperties",
"(",
"final",
"String",
"file",
",",
"final",
"String",
"psw",
",",
"final",
"String",
"alias",
")",
"{",
"val",
"p",
"=",
"new",
"Properties",
"(",
")",
";",
"p",
".",
"put",
"(",
"\"org.apache.ws... | Gets security properties.
@param file the file
@param psw the psw
@param alias the alias
@return the security properties | [
"Gets",
"security",
"properties",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ws-sts-api/src/main/java/org/apereo/cas/support/util/CryptoUtils.java#L37-L47 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java | NetworkConfig.loadChannel | Channel loadChannel(HFClient client, String channelName) throws NetworkConfigurationException {
"""
Returns a channel configured using the details in the Network Configuration file
@param client The associated client
@param channelName The name of the channel
@return A configured Channel instance
"""... | java | Channel loadChannel(HFClient client, String channelName) throws NetworkConfigurationException {
return loadChannel(client, channelName, networkConfigAddPeerHandlerDefault, networkConfigAddOrdererHandlerDefault);
} | [
"Channel",
"loadChannel",
"(",
"HFClient",
"client",
",",
"String",
"channelName",
")",
"throws",
"NetworkConfigurationException",
"{",
"return",
"loadChannel",
"(",
"client",
",",
"channelName",
",",
"networkConfigAddPeerHandlerDefault",
",",
"networkConfigAddOrdererHandle... | Returns a channel configured using the details in the Network Configuration file
@param client The associated client
@param channelName The name of the channel
@return A configured Channel instance | [
"Returns",
"a",
"channel",
"configured",
"using",
"the",
"details",
"in",
"the",
"Network",
"Configuration",
"file"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L444-L446 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/IslamicCalendar.java | IslamicCalendar.handleGetMonthLength | @Override
protected int handleGetMonthLength(int extendedYear, int month) {
"""
Return the length (in days) of the given month.
@param extendedYear The hijri year
@param month The hijri month, 0-based
"""
int length;
if (cType == CalculationType.ISLAMIC_CIVIL
|| cType... | java | @Override
protected int handleGetMonthLength(int extendedYear, int month) {
int length;
if (cType == CalculationType.ISLAMIC_CIVIL
|| cType == CalculationType.ISLAMIC_TBLA
|| (cType == CalculationType.ISLAMIC_UMALQURA && (extendedYear < UMALQURA_YEAR_START || exten... | [
"@",
"Override",
"protected",
"int",
"handleGetMonthLength",
"(",
"int",
"extendedYear",
",",
"int",
"month",
")",
"{",
"int",
"length",
";",
"if",
"(",
"cType",
"==",
"CalculationType",
".",
"ISLAMIC_CIVIL",
"||",
"cType",
"==",
"CalculationType",
".",
"ISLAM... | Return the length (in days) of the given month.
@param extendedYear The hijri year
@param month The hijri month, 0-based | [
"Return",
"the",
"length",
"(",
"in",
"days",
")",
"of",
"the",
"given",
"month",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/IslamicCalendar.java#L711-L739 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/api/Changes.java | Changes.continuousChanges | public Changes continuousChanges() {
"""
Requests Change notifications of feed type continuous.
<p>Feed notifications are accessed in an <i>iterator</i> style.</p>
<P>
This method will connect to the changes feed; any configuration options applied after calling
it will be ignored.
</P>
@return this Changes... | java | public Changes continuousChanges() {
final URI uri = this.databaseHelper.changesUri("feed", "continuous");
final InputStream in = client.get(uri);
try {
final InputStreamReader is = new InputStreamReader(in, "UTF-8");
setReader(new BufferedReader(is));
} catch (Un... | [
"public",
"Changes",
"continuousChanges",
"(",
")",
"{",
"final",
"URI",
"uri",
"=",
"this",
".",
"databaseHelper",
".",
"changesUri",
"(",
"\"feed\"",
",",
"\"continuous\"",
")",
";",
"final",
"InputStream",
"in",
"=",
"client",
".",
"get",
"(",
"uri",
")... | Requests Change notifications of feed type continuous.
<p>Feed notifications are accessed in an <i>iterator</i> style.</p>
<P>
This method will connect to the changes feed; any configuration options applied after calling
it will be ignored.
</P>
@return this Changes instance connected to a continuous feed, use
{@link ... | [
"Requests",
"Change",
"notifications",
"of",
"feed",
"type",
"continuous",
".",
"<p",
">",
"Feed",
"notifications",
"are",
"accessed",
"in",
"an",
"<i",
">",
"iterator<",
"/",
"i",
">",
"style",
".",
"<",
"/",
"p",
">",
"<P",
">",
"This",
"method",
"wi... | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/api/Changes.java#L108-L120 |
graphql-java/graphql-java | src/main/java/graphql/execution/ExecutionStrategy.java | ExecutionStrategy.completeValueForList | protected FieldValueInfo completeValueForList(ExecutionContext executionContext, ExecutionStrategyParameters parameters, Iterable<Object> iterableValues) {
"""
Called to complete a list of value for a field based on a list type. This iterates the values and calls
{@link #completeValue(ExecutionContext, Execution... | java | protected FieldValueInfo completeValueForList(ExecutionContext executionContext, ExecutionStrategyParameters parameters, Iterable<Object> iterableValues) {
Collection<Object> values = FpKit.toCollection(iterableValues);
ExecutionStepInfo executionStepInfo = parameters.getExecutionStepInfo();
Gr... | [
"protected",
"FieldValueInfo",
"completeValueForList",
"(",
"ExecutionContext",
"executionContext",
",",
"ExecutionStrategyParameters",
"parameters",
",",
"Iterable",
"<",
"Object",
">",
"iterableValues",
")",
"{",
"Collection",
"<",
"Object",
">",
"values",
"=",
"FpKit... | Called to complete a list of value for a field based on a list type. This iterates the values and calls
{@link #completeValue(ExecutionContext, ExecutionStrategyParameters)} for each value.
@param executionContext contains the top level execution parameters
@param parameters contains the parameters holding the ... | [
"Called",
"to",
"complete",
"a",
"list",
"of",
"value",
"for",
"a",
"field",
"based",
"on",
"a",
"list",
"type",
".",
"This",
"iterates",
"the",
"values",
"and",
"calls",
"{",
"@link",
"#completeValue",
"(",
"ExecutionContext",
"ExecutionStrategyParameters",
"... | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/execution/ExecutionStrategy.java#L485-L545 |
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/BaseLevel.java | BaseLevel.getClosestSpecNodeByTargetId | public SpecNode getClosestSpecNodeByTargetId(final String targetId, final SpecNode callerNode, final boolean checkParentNode) {
"""
This function checks the levels nodes and child nodes to see if it can match a spec topic for a topic database id.
@param targetId The topic database id
@param callerNo... | java | public SpecNode getClosestSpecNodeByTargetId(final String targetId, final SpecNode callerNode, final boolean checkParentNode) {
final SpecNode retValue = super.getClosestSpecNodeByTargetId(targetId, callerNode, checkParentNode);
if (retValue != null) {
return retValue;
} else {
... | [
"public",
"SpecNode",
"getClosestSpecNodeByTargetId",
"(",
"final",
"String",
"targetId",
",",
"final",
"SpecNode",
"callerNode",
",",
"final",
"boolean",
"checkParentNode",
")",
"{",
"final",
"SpecNode",
"retValue",
"=",
"super",
".",
"getClosestSpecNodeByTargetId",
... | This function checks the levels nodes and child nodes to see if it can match a spec topic for a topic database id.
@param targetId The topic database id
@param callerNode The node that called this function so that it isn't rechecked
@param checkParentNode If the function should check the levels parents... | [
"This",
"function",
"checks",
"the",
"levels",
"nodes",
"and",
"child",
"nodes",
"to",
"see",
"if",
"it",
"can",
"match",
"a",
"spec",
"topic",
"for",
"a",
"topic",
"database",
"id",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/BaseLevel.java#L101-L119 |
undertow-io/undertow | core/src/main/java/io/undertow/server/handlers/proxy/ProxyHandler.java | ProxyHandler.addRequestHeader | @Deprecated
public ProxyHandler addRequestHeader(final HttpString header, final String value) {
"""
Adds a request header to the outgoing request. If the header resolves to null or an empty string
it will not be added, however any existing header with the same name will be removed.
@param header The header... | java | @Deprecated
public ProxyHandler addRequestHeader(final HttpString header, final String value) {
requestHeaders.put(header, ExchangeAttributes.constant(value));
return this;
} | [
"@",
"Deprecated",
"public",
"ProxyHandler",
"addRequestHeader",
"(",
"final",
"HttpString",
"header",
",",
"final",
"String",
"value",
")",
"{",
"requestHeaders",
".",
"put",
"(",
"header",
",",
"ExchangeAttributes",
".",
"constant",
"(",
"value",
")",
")",
"... | Adds a request header to the outgoing request. If the header resolves to null or an empty string
it will not be added, however any existing header with the same name will be removed.
@param header The header name
@param value The header value attribute.
@return this | [
"Adds",
"a",
"request",
"header",
"to",
"the",
"outgoing",
"request",
".",
"If",
"the",
"header",
"resolves",
"to",
"null",
"or",
"an",
"empty",
"string",
"it",
"will",
"not",
"be",
"added",
"however",
"any",
"existing",
"header",
"with",
"the",
"same",
... | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/proxy/ProxyHandler.java#L237-L241 |
datacleaner/DataCleaner | engine/utils/src/main/java/org/datacleaner/util/CsvConfigurationDetection.java | CsvConfigurationDetection.suggestCsvConfiguration | public CsvConfiguration suggestCsvConfiguration(final String encoding, final List<String> columnNames)
throws IllegalStateException {
"""
Auto-detect the {@link CsvConfiguration} of a CSV style data file,
providing the encoding externally.
@param encoding
@return a detected CSV configuration
@thr... | java | public CsvConfiguration suggestCsvConfiguration(final String encoding, final List<String> columnNames)
throws IllegalStateException {
final byte[] sample = getSampleBuffer();
return suggestCsvConfiguration(sample, encoding, columnNames);
} | [
"public",
"CsvConfiguration",
"suggestCsvConfiguration",
"(",
"final",
"String",
"encoding",
",",
"final",
"List",
"<",
"String",
">",
"columnNames",
")",
"throws",
"IllegalStateException",
"{",
"final",
"byte",
"[",
"]",
"sample",
"=",
"getSampleBuffer",
"(",
")"... | Auto-detect the {@link CsvConfiguration} of a CSV style data file,
providing the encoding externally.
@param encoding
@return a detected CSV configuration
@throws IllegalStateException if an error occurs during auto-detection | [
"Auto",
"-",
"detect",
"the",
"{",
"@link",
"CsvConfiguration",
"}",
"of",
"a",
"CSV",
"style",
"data",
"file",
"providing",
"the",
"encoding",
"externally",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/utils/src/main/java/org/datacleaner/util/CsvConfigurationDetection.java#L119-L123 |
brettonw/Bag | src/main/java/com/brettonw/bag/Bag.java | Bag.getBagArray | public BagArray getBagArray (String key, Supplier<BagArray> notFound) {
"""
Retrieve a mapped element and return it as a BagArray.
@param key A string value used to index the element.
@param notFound A function to create a new BagArray if the requested key was not found
@return The element as a BagArray, or n... | java | public BagArray getBagArray (String key, Supplier<BagArray> notFound) {
Object object = getObject (key);
return (object instanceof BagArray) ? (BagArray) object : notFound.get ();
} | [
"public",
"BagArray",
"getBagArray",
"(",
"String",
"key",
",",
"Supplier",
"<",
"BagArray",
">",
"notFound",
")",
"{",
"Object",
"object",
"=",
"getObject",
"(",
"key",
")",
";",
"return",
"(",
"object",
"instanceof",
"BagArray",
")",
"?",
"(",
"BagArray"... | Retrieve a mapped element and return it as a BagArray.
@param key A string value used to index the element.
@param notFound A function to create a new BagArray if the requested key was not found
@return The element as a BagArray, or notFound if the element is not found. | [
"Retrieve",
"a",
"mapped",
"element",
"and",
"return",
"it",
"as",
"a",
"BagArray",
"."
] | train | https://github.com/brettonw/Bag/blob/25c0ff74893b6c9a2c61bf0f97189ab82e0b2f56/src/main/java/com/brettonw/bag/Bag.java#L130-L133 |
dnault/therapi-runtime-javadoc | therapi-runtime-javadoc/src/main/java/com/github/therapi/runtimejavadoc/RuntimeJavadoc.java | RuntimeJavadoc.getJavadoc | public static ClassJavadoc getJavadoc(String qualifiedClassName, ClassLoader classLoader) {
"""
Gets the Javadoc of the given class, using the given {@link ClassLoader} to find the Javadoc resource.
<p>
The return value is always non-null. If no Javadoc is available, the returned object's
{@link BaseJavadoc#isE... | java | public static ClassJavadoc getJavadoc(String qualifiedClassName, ClassLoader classLoader) {
final String resourceName = getResourceName(qualifiedClassName);
try (InputStream is = classLoader.getResourceAsStream(resourceName)) {
return parseJavadocResource(qualifiedClassName, is);
} c... | [
"public",
"static",
"ClassJavadoc",
"getJavadoc",
"(",
"String",
"qualifiedClassName",
",",
"ClassLoader",
"classLoader",
")",
"{",
"final",
"String",
"resourceName",
"=",
"getResourceName",
"(",
"qualifiedClassName",
")",
";",
"try",
"(",
"InputStream",
"is",
"=",
... | Gets the Javadoc of the given class, using the given {@link ClassLoader} to find the Javadoc resource.
<p>
The return value is always non-null. If no Javadoc is available, the returned object's
{@link BaseJavadoc#isEmpty isEmpty()} method will return {@code true}.
@param qualifiedClassName the fully qualified name of ... | [
"Gets",
"the",
"Javadoc",
"of",
"the",
"given",
"class",
"using",
"the",
"given",
"{",
"@link",
"ClassLoader",
"}",
"to",
"find",
"the",
"Javadoc",
"resource",
".",
"<p",
">",
"The",
"return",
"value",
"is",
"always",
"non",
"-",
"null",
".",
"If",
"no... | train | https://github.com/dnault/therapi-runtime-javadoc/blob/74902191dcf74b870e296653b2adf7dbb747c189/therapi-runtime-javadoc/src/main/java/com/github/therapi/runtimejavadoc/RuntimeJavadoc.java#L63-L70 |
alkacon/opencms-core | src/org/opencms/ui/apps/CmsWorkplaceAppManager.java | CmsWorkplaceAppManager.getEditorForType | public I_CmsEditor getEditorForType(I_CmsResourceType type, boolean plainText) {
"""
Returns the editor for the given resource type.<p>
@param type the resource type to edit
@param plainText if plain text editing is required
@return the editor
"""
List<I_CmsEditor> editors = new ArrayList<I_Cms... | java | public I_CmsEditor getEditorForType(I_CmsResourceType type, boolean plainText) {
List<I_CmsEditor> editors = new ArrayList<I_CmsEditor>();
for (int i = 0; i < EDITORS.length; i++) {
if (EDITORS[i].matchesType(type, plainText)) {
editors.add(EDITORS[i]);
}
... | [
"public",
"I_CmsEditor",
"getEditorForType",
"(",
"I_CmsResourceType",
"type",
",",
"boolean",
"plainText",
")",
"{",
"List",
"<",
"I_CmsEditor",
">",
"editors",
"=",
"new",
"ArrayList",
"<",
"I_CmsEditor",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
... | Returns the editor for the given resource type.<p>
@param type the resource type to edit
@param plainText if plain text editing is required
@return the editor | [
"Returns",
"the",
"editor",
"for",
"the",
"given",
"resource",
"type",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/CmsWorkplaceAppManager.java#L499-L521 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/FileUtils.java | FileUtils.toXML | public static String toXML(final String aFilePath, final String aPattern, final boolean aDeepTransformation)
throws FileNotFoundException, TransformerException {
"""
Creates a string of XML that describes the supplied file or directory (and, optionally, all its
subdirectories). Includes absolute path,... | java | public static String toXML(final String aFilePath, final String aPattern, final boolean aDeepTransformation)
throws FileNotFoundException, TransformerException {
final Element element = toElement(aFilePath, aPattern, aDeepTransformation);
return DOMUtils.toXML(element);
} | [
"public",
"static",
"String",
"toXML",
"(",
"final",
"String",
"aFilePath",
",",
"final",
"String",
"aPattern",
",",
"final",
"boolean",
"aDeepTransformation",
")",
"throws",
"FileNotFoundException",
",",
"TransformerException",
"{",
"final",
"Element",
"element",
"... | Creates a string of XML that describes the supplied file or directory (and, optionally, all its
subdirectories). Includes absolute path, last modified time, read/write permissions, etc.
@param aFilePath The file or directory to be returned as XML
@param aPattern A regular expression pattern to evaluate file matches ag... | [
"Creates",
"a",
"string",
"of",
"XML",
"that",
"describes",
"the",
"supplied",
"file",
"or",
"directory",
"(",
"and",
"optionally",
"all",
"its",
"subdirectories",
")",
".",
"Includes",
"absolute",
"path",
"last",
"modified",
"time",
"read",
"/",
"write",
"p... | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/FileUtils.java#L168-L172 |
perwendel/spark | src/main/java/spark/RouteImpl.java | RouteImpl.create | public static RouteImpl create(final String path, String acceptType, final Route route) {
"""
Wraps the route in RouteImpl
@param path the path
@param acceptType the accept type
@param route the route
@return the wrapped route
"""
if (acceptType == null) {
acceptType = DEFA... | java | public static RouteImpl create(final String path, String acceptType, final Route route) {
if (acceptType == null) {
acceptType = DEFAULT_ACCEPT_TYPE;
}
return new RouteImpl(path, acceptType, route) {
@Override
public Object handle(Request request, Response res... | [
"public",
"static",
"RouteImpl",
"create",
"(",
"final",
"String",
"path",
",",
"String",
"acceptType",
",",
"final",
"Route",
"route",
")",
"{",
"if",
"(",
"acceptType",
"==",
"null",
")",
"{",
"acceptType",
"=",
"DEFAULT_ACCEPT_TYPE",
";",
"}",
"return",
... | Wraps the route in RouteImpl
@param path the path
@param acceptType the accept type
@param route the route
@return the wrapped route | [
"Wraps",
"the",
"route",
"in",
"RouteImpl"
] | train | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/RouteImpl.java#L65-L75 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java | TimeZoneFormat.formatOffsetISO8601Basic | public final String formatOffsetISO8601Basic(int offset, boolean useUtcIndicator, boolean isShort, boolean ignoreSeconds) {
"""
Returns the ISO 8601 basic time zone string for the given offset.
For example, "-08", "-0830" and "Z"
@param offset the offset from GMT(UTC) in milliseconds.
@param useUtcIndicator t... | java | public final String formatOffsetISO8601Basic(int offset, boolean useUtcIndicator, boolean isShort, boolean ignoreSeconds) {
return formatOffsetISO8601(offset, true, useUtcIndicator, isShort, ignoreSeconds);
} | [
"public",
"final",
"String",
"formatOffsetISO8601Basic",
"(",
"int",
"offset",
",",
"boolean",
"useUtcIndicator",
",",
"boolean",
"isShort",
",",
"boolean",
"ignoreSeconds",
")",
"{",
"return",
"formatOffsetISO8601",
"(",
"offset",
",",
"true",
",",
"useUtcIndicator... | Returns the ISO 8601 basic time zone string for the given offset.
For example, "-08", "-0830" and "Z"
@param offset the offset from GMT(UTC) in milliseconds.
@param useUtcIndicator true if ISO 8601 UTC indicator "Z" is used when the offset is 0.
@param isShort true if shortest form is used.
@param ignoreSeconds true i... | [
"Returns",
"the",
"ISO",
"8601",
"basic",
"time",
"zone",
"string",
"for",
"the",
"given",
"offset",
".",
"For",
"example",
"-",
"08",
"-",
"0830",
"and",
"Z"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java#L718-L720 |
52North/matlab-connector | common/src/main/java/org/n52/matlab/connector/MatlabResult.java | MatlabResult.addResult | public MatlabResult addResult(String name, MatlabValue result) {
"""
Adds a result {@link MatlabValue}.
@param name the name of the result
@param result the result <code>MatlabValue</code>
@return this
"""
checkNotNull(name);
checkNotNull(result);
this.results.put(name, result)... | java | public MatlabResult addResult(String name, MatlabValue result) {
checkNotNull(name);
checkNotNull(result);
this.results.put(name, result);
return this;
} | [
"public",
"MatlabResult",
"addResult",
"(",
"String",
"name",
",",
"MatlabValue",
"result",
")",
"{",
"checkNotNull",
"(",
"name",
")",
";",
"checkNotNull",
"(",
"result",
")",
";",
"this",
".",
"results",
".",
"put",
"(",
"name",
",",
"result",
")",
";"... | Adds a result {@link MatlabValue}.
@param name the name of the result
@param result the result <code>MatlabValue</code>
@return this | [
"Adds",
"a",
"result",
"{",
"@link",
"MatlabValue",
"}",
"."
] | train | https://github.com/52North/matlab-connector/blob/f00089cb535776c8cf973fcfaa0c5c3e1045afbf/common/src/main/java/org/n52/matlab/connector/MatlabResult.java#L68-L73 |
apache/flink | flink-filesystems/flink-swift-fs-hadoop/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.getPasswordFromCredentialProviders | protected char[] getPasswordFromCredentialProviders(String name)
throws IOException {
"""
Try and resolve the provided element name as a credential provider
alias.
@param name alias of the provisioned credential
@return password or null if not found
@throws IOException
"""
char[] pass = null;
... | java | protected char[] getPasswordFromCredentialProviders(String name)
throws IOException {
char[] pass = null;
try {
List<CredentialProvider> providers =
CredentialProviderFactory.getProviders(this);
if (providers != null) {
for (CredentialProvider provider : providers) {
... | [
"protected",
"char",
"[",
"]",
"getPasswordFromCredentialProviders",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"char",
"[",
"]",
"pass",
"=",
"null",
";",
"try",
"{",
"List",
"<",
"CredentialProvider",
">",
"providers",
"=",
"CredentialProviderFa... | Try and resolve the provided element name as a credential provider
alias.
@param name alias of the provisioned credential
@return password or null if not found
@throws IOException | [
"Try",
"and",
"resolve",
"the",
"provided",
"element",
"name",
"as",
"a",
"credential",
"provider",
"alias",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-swift-fs-hadoop/src/main/java/org/apache/hadoop/conf/Configuration.java#L1929-L1957 |
jayantk/jklol | src/com/jayantkrish/jklol/models/dynamic/DynamicVariableSet.java | DynamicVariableSet.fromVariables | public static DynamicVariableSet fromVariables(VariableNumMap variables) {
"""
Creates a {@code DynamicVariableSet} containing {@code variables}
and no plates.
@param variables
@return
"""
return new DynamicVariableSet(variables, Collections.<String> emptyList(),
Collections.<DynamicVariableSe... | java | public static DynamicVariableSet fromVariables(VariableNumMap variables) {
return new DynamicVariableSet(variables, Collections.<String> emptyList(),
Collections.<DynamicVariableSet> emptyList(), new int[0]);
} | [
"public",
"static",
"DynamicVariableSet",
"fromVariables",
"(",
"VariableNumMap",
"variables",
")",
"{",
"return",
"new",
"DynamicVariableSet",
"(",
"variables",
",",
"Collections",
".",
"<",
"String",
">",
"emptyList",
"(",
")",
",",
"Collections",
".",
"<",
"D... | Creates a {@code DynamicVariableSet} containing {@code variables}
and no plates.
@param variables
@return | [
"Creates",
"a",
"{",
"@code",
"DynamicVariableSet",
"}",
"containing",
"{",
"@code",
"variables",
"}",
"and",
"no",
"plates",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/dynamic/DynamicVariableSet.java#L63-L66 |
beangle/beangle3 | ioc/spring/src/main/java/org/beangle/inject/spring/config/BeanDefinitionParser.java | BeanDefinitionParser.createBeanDefinition | protected AbstractBeanDefinition createBeanDefinition(String className, String parentName)
throws ClassNotFoundException {
"""
Create a bean definition for the given class name and parent name.
@param className the name of the bean class
@param parentName the name of the bean's parent bean
@return the n... | java | protected AbstractBeanDefinition createBeanDefinition(String className, String parentName)
throws ClassNotFoundException {
return BeanDefinitionReaderUtils.createBeanDefinition(parentName, className, null);
} | [
"protected",
"AbstractBeanDefinition",
"createBeanDefinition",
"(",
"String",
"className",
",",
"String",
"parentName",
")",
"throws",
"ClassNotFoundException",
"{",
"return",
"BeanDefinitionReaderUtils",
".",
"createBeanDefinition",
"(",
"parentName",
",",
"className",
","... | Create a bean definition for the given class name and parent name.
@param className the name of the bean class
@param parentName the name of the bean's parent bean
@return the newly created bean definition
@throws java.lang.ClassNotFoundException
if bean class resolution was attempted but failed | [
"Create",
"a",
"bean",
"definition",
"for",
"the",
"given",
"class",
"name",
"and",
"parent",
"name",
"."
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/ioc/spring/src/main/java/org/beangle/inject/spring/config/BeanDefinitionParser.java#L320-L323 |
deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-client/src/main/java/org/nd4j/parameterserver/client/ParameterServerClient.java | ParameterServerClient.onNDArrayPartial | @Override
public void onNDArrayPartial(INDArray arr, long idx, int... dimensions) {
"""
Used for partial updates using tensor along
dimension
@param arr the array to count as an update
@param idx the index for the tensor along dimension
@param dimensions the dimensions to act on for the tenso... | java | @Override
public void onNDArrayPartial(INDArray arr, long idx, int... dimensions) {
INDArray get = this.arr.get();
get.tensorAlongDimension((int) idx, dimensions).assign(arr);
} | [
"@",
"Override",
"public",
"void",
"onNDArrayPartial",
"(",
"INDArray",
"arr",
",",
"long",
"idx",
",",
"int",
"...",
"dimensions",
")",
"{",
"INDArray",
"get",
"=",
"this",
".",
"arr",
".",
"get",
"(",
")",
";",
"get",
".",
"tensorAlongDimension",
"(",
... | Used for partial updates using tensor along
dimension
@param arr the array to count as an update
@param idx the index for the tensor along dimension
@param dimensions the dimensions to act on for the tensor along dimension | [
"Used",
"for",
"partial",
"updates",
"using",
"tensor",
"along",
"dimension"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-client/src/main/java/org/nd4j/parameterserver/client/ParameterServerClient.java#L320-L325 |
orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.getGeometryFields | public static List<String> getGeometryFields(Connection connection,TableLocation location) throws SQLException {
"""
Find geometry fields name of a table.
@param connection Active connection
@param location Table location
@return A list of Geometry fields name
@throws SQLException
"""
return ... | java | public static List<String> getGeometryFields(Connection connection,TableLocation location) throws SQLException {
return getGeometryFields(connection, location.getCatalog(), location.getSchema(), location.getTable());
} | [
"public",
"static",
"List",
"<",
"String",
">",
"getGeometryFields",
"(",
"Connection",
"connection",
",",
"TableLocation",
"location",
")",
"throws",
"SQLException",
"{",
"return",
"getGeometryFields",
"(",
"connection",
",",
"location",
".",
"getCatalog",
"(",
"... | Find geometry fields name of a table.
@param connection Active connection
@param location Table location
@return A list of Geometry fields name
@throws SQLException | [
"Find",
"geometry",
"fields",
"name",
"of",
"a",
"table",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L241-L243 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/index/Index.java | Index.searchCost | public static long searchCost(IndexType idxType, SearchKeyType keyType, long totRecs, long matchRecs) {
"""
Estimates the number of block accesses required to find all index records
matching a search range, given the specified numbers of total records and
matching records.
<p>
This number does <em>not</em> inc... | java | public static long searchCost(IndexType idxType, SearchKeyType keyType, long totRecs, long matchRecs) {
if (idxType == IndexType.HASH)
return HashIndex.searchCost(keyType, totRecs, matchRecs);
else if (idxType == IndexType.BTREE)
return BTreeIndex.searchCost(keyType, totRecs, matchRecs);
else
throw... | [
"public",
"static",
"long",
"searchCost",
"(",
"IndexType",
"idxType",
",",
"SearchKeyType",
"keyType",
",",
"long",
"totRecs",
",",
"long",
"matchRecs",
")",
"{",
"if",
"(",
"idxType",
"==",
"IndexType",
".",
"HASH",
")",
"return",
"HashIndex",
".",
"search... | Estimates the number of block accesses required to find all index records
matching a search range, given the specified numbers of total records and
matching records.
<p>
This number does <em>not</em> include the block accesses required to
retrieve data records.
</p>
@param idxType
the index type
@param keyType
the typ... | [
"Estimates",
"the",
"number",
"of",
"block",
"accesses",
"required",
"to",
"find",
"all",
"index",
"records",
"matching",
"a",
"search",
"range",
"given",
"the",
"specified",
"numbers",
"of",
"total",
"records",
"and",
"matching",
"records",
".",
"<p",
">",
... | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/index/Index.java#L49-L56 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/TrueTypeFont.java | TrueTypeFont.getFullFontStream | public PdfStream getFullFontStream() throws IOException, DocumentException {
"""
Returns a PdfStream object with the full font program.
@return a PdfStream with the font program
@since 2.1.3
"""
if (cff) {
return new StreamFont(readCffFont(), "Type1C", compressionLevel);
}
... | java | public PdfStream getFullFontStream() throws IOException, DocumentException {
if (cff) {
return new StreamFont(readCffFont(), "Type1C", compressionLevel);
}
else {
byte[] b = getFullFont();
int lengths[] = new int[]{b.length};
return new StreamFont(b, length... | [
"public",
"PdfStream",
"getFullFontStream",
"(",
")",
"throws",
"IOException",
",",
"DocumentException",
"{",
"if",
"(",
"cff",
")",
"{",
"return",
"new",
"StreamFont",
"(",
"readCffFont",
"(",
")",
",",
"\"Type1C\"",
",",
"compressionLevel",
")",
";",
"}",
... | Returns a PdfStream object with the full font program.
@return a PdfStream with the font program
@since 2.1.3 | [
"Returns",
"a",
"PdfStream",
"object",
"with",
"the",
"full",
"font",
"program",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/TrueTypeFont.java#L1339-L1348 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.data_proContact_POST | public OvhProContact data_proContact_POST(String authority, String authorityWebsite, Long contactId, String jobDescription, String licenseNumber) throws IOException {
"""
Post new information about .pro contact information
REST: POST /domain/data/proContact
@param jobDescription [required] Description of your ... | java | public OvhProContact data_proContact_POST(String authority, String authorityWebsite, Long contactId, String jobDescription, String licenseNumber) throws IOException {
String qPath = "/domain/data/proContact";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "a... | [
"public",
"OvhProContact",
"data_proContact_POST",
"(",
"String",
"authority",
",",
"String",
"authorityWebsite",
",",
"Long",
"contactId",
",",
"String",
"jobDescription",
",",
"String",
"licenseNumber",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\... | Post new information about .pro contact information
REST: POST /domain/data/proContact
@param jobDescription [required] Description of your job
@param authority [required] Authority that certify your profesional status
@param authorityWebsite [required] Website of the authority that certify your profesional status
@pa... | [
"Post",
"new",
"information",
"about",
".",
"pro",
"contact",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L288-L299 |
hdecarne/java-default | src/main/java/de/carne/util/SystemProperties.java | SystemProperties.intValue | public static int intValue(Class<?> clazz, String key, int defaultValue) {
"""
Gets a {@code int} system property value.
@param clazz the {@linkplain Class} to derive the property key from.
@param key the property key (relative to the submitted {@linkplain Class}) to get.
@param defaultValue the default value... | java | public static int intValue(Class<?> clazz, String key, int defaultValue) {
return intValue(clazz.getName() + key, defaultValue);
} | [
"public",
"static",
"int",
"intValue",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"return",
"intValue",
"(",
"clazz",
".",
"getName",
"(",
")",
"+",
"key",
",",
"defaultValue",
")",
";",
"}"
] | Gets a {@code int} system property value.
@param clazz the {@linkplain Class} to derive the property key from.
@param key the property key (relative to the submitted {@linkplain Class}) to get.
@param defaultValue the default value to return in case the property is not defined.
@return the property value or the submit... | [
"Gets",
"a",
"{",
"@code",
"int",
"}",
"system",
"property",
"value",
"."
] | train | https://github.com/hdecarne/java-default/blob/ca16f6fdb0436e90e9e2df3106055e320bb3c9e3/src/main/java/de/carne/util/SystemProperties.java#L157-L159 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/operations/ClassPath.java | ClassPath.newInstance | @SuppressWarnings("unchecked")
public static <T> T newInstance(Class<?> aClass, Class<?>[] parameterTypes,Object[] initargs)
throws SetupException {
"""
Use a constructor of the a class to create an instance
@param aClass the class the create
@param parameterTypes the constructor parameter types
@param ini... | java | @SuppressWarnings("unchecked")
public static <T> T newInstance(Class<?> aClass, Class<?>[] parameterTypes,Object[] initargs)
throws SetupException
{
try
{
//Get constructor
Constructor<?> constructor = aClass.getConstructor(parameterTypes);
return (T)constructor.newInstance(initargs);... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"Class",
"<",
"?",
">",
"aClass",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
",",
"Object",
"[",
"]",
"initargs",
")",
"throws... | Use a constructor of the a class to create an instance
@param aClass the class the create
@param parameterTypes the constructor parameter types
@param initargs the constructor initial arguments
@param <T> the class type
@return the initiate object
@throws SetupException when internal error occurs | [
"Use",
"a",
"constructor",
"of",
"the",
"a",
"class",
"to",
"create",
"an",
"instance"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/operations/ClassPath.java#L223-L238 |
JodaOrg/joda-time | src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java | DateTimeZoneBuilder.writeTo | public void writeTo(String zoneID, DataOutput out) throws IOException {
"""
Encodes a built DateTimeZone to the given stream. Call readFrom to
decode the data into a DateTimeZone object.
@param out the output stream to receive the encoded DateTimeZone
@since 1.5 (parameter added)
"""
// pass fals... | java | public void writeTo(String zoneID, DataOutput out) throws IOException {
// pass false so zone id is not written out
DateTimeZone zone = toDateTimeZone(zoneID, false);
if (zone instanceof FixedDateTimeZone) {
out.writeByte('F'); // 'F' for fixed
out.writeUTF(zone.getNameK... | [
"public",
"void",
"writeTo",
"(",
"String",
"zoneID",
",",
"DataOutput",
"out",
")",
"throws",
"IOException",
"{",
"// pass false so zone id is not written out",
"DateTimeZone",
"zone",
"=",
"toDateTimeZone",
"(",
"zoneID",
",",
"false",
")",
";",
"if",
"(",
"zone... | Encodes a built DateTimeZone to the given stream. Call readFrom to
decode the data into a DateTimeZone object.
@param out the output stream to receive the encoded DateTimeZone
@since 1.5 (parameter added) | [
"Encodes",
"a",
"built",
"DateTimeZone",
"to",
"the",
"given",
"stream",
".",
"Call",
"readFrom",
"to",
"decode",
"the",
"data",
"into",
"a",
"DateTimeZone",
"object",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java#L464-L482 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/BackupEnginesInner.java | BackupEnginesInner.get | public BackupEngineBaseResourceInner get(String vaultName, String resourceGroupName, String backupEngineName) {
"""
Returns backup management server registered to Recovery Services Vault.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource group where the... | java | public BackupEngineBaseResourceInner get(String vaultName, String resourceGroupName, String backupEngineName) {
return getWithServiceResponseAsync(vaultName, resourceGroupName, backupEngineName).toBlocking().single().body();
} | [
"public",
"BackupEngineBaseResourceInner",
"get",
"(",
"String",
"vaultName",
",",
"String",
"resourceGroupName",
",",
"String",
"backupEngineName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"vaultName",
",",
"resourceGroupName",
",",
"backupEngineName",
")"... | Returns backup management server registered to Recovery Services Vault.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@param backupEngineName Name of the backup management server.
@throws IllegalArgumentEx... | [
"Returns",
"backup",
"management",
"server",
"registered",
"to",
"Recovery",
"Services",
"Vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/BackupEnginesInner.java#L332-L334 |
bwkimmel/java-util | src/main/java/ca/eandb/util/io/FileUtil.java | FileUtil.getApplicationDataDirectory | public static File getApplicationDataDirectory(final String applicationName) {
"""
Returns the appropriate working directory for storing application data. The result of this method is platform
dependant: On linux, it will return ~/applicationName, on windows, the working directory will be located in the
user's a... | java | public static File getApplicationDataDirectory(final String applicationName) {
final String userHome = System.getProperty("user.home", ".");
final File workingDirectory;
final String osName = System.getProperty("os.name", "").toLowerCase();
if (osName.contains("windows")) {
fin... | [
"public",
"static",
"File",
"getApplicationDataDirectory",
"(",
"final",
"String",
"applicationName",
")",
"{",
"final",
"String",
"userHome",
"=",
"System",
".",
"getProperty",
"(",
"\"user.home\"",
",",
"\".\"",
")",
";",
"final",
"File",
"workingDirectory",
";"... | Returns the appropriate working directory for storing application data. The result of this method is platform
dependant: On linux, it will return ~/applicationName, on windows, the working directory will be located in the
user's application data folder. For Mac OS systems, the working directory will be placed in the pr... | [
"Returns",
"the",
"appropriate",
"working",
"directory",
"for",
"storing",
"application",
"data",
".",
"The",
"result",
"of",
"this",
"method",
"is",
"platform",
"dependant",
":",
"On",
"linux",
"it",
"will",
"return",
"~",
"/",
"applicationName",
"on",
"windo... | train | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/io/FileUtil.java#L349-L368 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jAssociationQueries.java | BaseNeo4jAssociationQueries.initRemoveAssociationRowQuery | private static String initRemoveAssociationRowQuery(EntityKeyMetadata ownerEntityKeyMetadata, AssociationKeyMetadata associationKeyMetadata) {
"""
/*
Example with association:
MATCH (n:ENTITY:table {id: {0}}) -[r:role] - (e)
DELETE r
Example with embedded collection:
MATCH (n:ENTITY:table {id: {0}}) -[r... | java | private static String initRemoveAssociationRowQuery(EntityKeyMetadata ownerEntityKeyMetadata, AssociationKeyMetadata associationKeyMetadata) {
StringBuilder queryBuilder = new StringBuilder( "MATCH " );
queryBuilder.append( "(n:" );
queryBuilder.append( ENTITY );
queryBuilder.append( ":" );
appendLabel( owner... | [
"private",
"static",
"String",
"initRemoveAssociationRowQuery",
"(",
"EntityKeyMetadata",
"ownerEntityKeyMetadata",
",",
"AssociationKeyMetadata",
"associationKeyMetadata",
")",
"{",
"StringBuilder",
"queryBuilder",
"=",
"new",
"StringBuilder",
"(",
"\"MATCH \"",
")",
";",
... | /*
Example with association:
MATCH (n:ENTITY:table {id: {0}}) -[r:role] - (e)
DELETE r
Example with embedded collection:
MATCH (n:ENTITY:table {id: {0}}) -[r:role] - (e:EMBEDDED)
DELETE r, e
Example with indexes:
MATCH (n:ENTITY:table {id: {0}}) -[r:role {index: {1}}] - (e)
DELETE r | [
"/",
"*",
"Example",
"with",
"association",
":"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jAssociationQueries.java#L190-L220 |
sailthru/sailthru-java-client | src/main/com/sailthru/client/AbstractSailthruClient.java | AbstractSailthruClient.apiGet | public JsonResponse apiGet(ApiAction action, Map<String, Object> data) throws IOException {
"""
HTTP GET Request with Map
@param action API action
@param data Parameter data
@throws IOException
"""
return httpRequestJson(action, HttpRequestMethod.GET, data);
} | java | public JsonResponse apiGet(ApiAction action, Map<String, Object> data) throws IOException {
return httpRequestJson(action, HttpRequestMethod.GET, data);
} | [
"public",
"JsonResponse",
"apiGet",
"(",
"ApiAction",
"action",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
")",
"throws",
"IOException",
"{",
"return",
"httpRequestJson",
"(",
"action",
",",
"HttpRequestMethod",
".",
"GET",
",",
"data",
")",
";",... | HTTP GET Request with Map
@param action API action
@param data Parameter data
@throws IOException | [
"HTTP",
"GET",
"Request",
"with",
"Map"
] | train | https://github.com/sailthru/sailthru-java-client/blob/62b491f6a39b41b836bfc021779200d29b6d2069/src/main/com/sailthru/client/AbstractSailthruClient.java#L252-L254 |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/internal/io/Schema.java | Schema.arrayOf | public static Schema arrayOf(Schema componentSchema) {
"""
Creates an {@link Type#ARRAY ARRAY} {@link Schema} of the given component type.
@param componentSchema Schema of the array component.
@return A {@link Schema} of {@link Type#ARRAY ARRAY} type.
"""
return new Schema(Type.ARRAY, null, componentSche... | java | public static Schema arrayOf(Schema componentSchema) {
return new Schema(Type.ARRAY, null, componentSchema, null, null, null, null, null);
} | [
"public",
"static",
"Schema",
"arrayOf",
"(",
"Schema",
"componentSchema",
")",
"{",
"return",
"new",
"Schema",
"(",
"Type",
".",
"ARRAY",
",",
"null",
",",
"componentSchema",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"... | Creates an {@link Type#ARRAY ARRAY} {@link Schema} of the given component type.
@param componentSchema Schema of the array component.
@return A {@link Schema} of {@link Type#ARRAY ARRAY} type. | [
"Creates",
"an",
"{"
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/internal/io/Schema.java#L175-L177 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/CatalogUtil.java | CatalogUtil.getSerializedCatalogStringFromJar | public static String getSerializedCatalogStringFromJar(InMemoryJarfile jarfile) {
"""
Convenience method to extract the catalog commands from an InMemoryJarfile as a string
"""
byte[] serializedCatalogBytes = jarfile.get(CatalogUtil.CATALOG_FILENAME);
String serializedCatalog = new String(seria... | java | public static String getSerializedCatalogStringFromJar(InMemoryJarfile jarfile)
{
byte[] serializedCatalogBytes = jarfile.get(CatalogUtil.CATALOG_FILENAME);
String serializedCatalog = new String(serializedCatalogBytes, Constants.UTF8ENCODING);
return serializedCatalog;
} | [
"public",
"static",
"String",
"getSerializedCatalogStringFromJar",
"(",
"InMemoryJarfile",
"jarfile",
")",
"{",
"byte",
"[",
"]",
"serializedCatalogBytes",
"=",
"jarfile",
".",
"get",
"(",
"CatalogUtil",
".",
"CATALOG_FILENAME",
")",
";",
"String",
"serializedCatalog"... | Convenience method to extract the catalog commands from an InMemoryJarfile as a string | [
"Convenience",
"method",
"to",
"extract",
"the",
"catalog",
"commands",
"from",
"an",
"InMemoryJarfile",
"as",
"a",
"string"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/CatalogUtil.java#L283-L288 |
voldemort/voldemort | src/java/voldemort/utils/UpdateClusterUtils.java | UpdateClusterUtils.addPartitionsToNode | public static Node addPartitionsToNode(final Node node, final Set<Integer> donatedPartitions) {
"""
Add the set of partitions to the node provided
@param node The node to which we'll add the partitions
@param donatedPartitions The list of partitions to add
@return The new node with the new partitions
"""
... | java | public static Node addPartitionsToNode(final Node node, final Set<Integer> donatedPartitions) {
List<Integer> deepCopy = new ArrayList<Integer>(node.getPartitionIds());
deepCopy.addAll(donatedPartitions);
Collections.sort(deepCopy);
return updateNode(node, deepCopy);
} | [
"public",
"static",
"Node",
"addPartitionsToNode",
"(",
"final",
"Node",
"node",
",",
"final",
"Set",
"<",
"Integer",
">",
"donatedPartitions",
")",
"{",
"List",
"<",
"Integer",
">",
"deepCopy",
"=",
"new",
"ArrayList",
"<",
"Integer",
">",
"(",
"node",
".... | Add the set of partitions to the node provided
@param node The node to which we'll add the partitions
@param donatedPartitions The list of partitions to add
@return The new node with the new partitions | [
"Add",
"the",
"set",
"of",
"partitions",
"to",
"the",
"node",
"provided"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/UpdateClusterUtils.java#L89-L94 |
finmath/finmath-lib | src/main/java6/net/finmath/marketdata/model/curves/DiscountCurve.java | DiscountCurve.createDiscountCurveFromDiscountFactors | public static DiscountCurve createDiscountCurveFromDiscountFactors(String name, double[] times, double[] givenDiscountFactors) {
"""
Create a discount curve from given times and given discount factors using default interpolation and extrapolation methods.
@param name The name of this discount curve.
@param tim... | java | public static DiscountCurve createDiscountCurveFromDiscountFactors(String name, double[] times, double[] givenDiscountFactors) {
DiscountCurve discountFactors = new DiscountCurve(name);
for(int timeIndex=0; timeIndex<times.length;timeIndex++) {
discountFactors.addDiscountFactor(times[timeIndex], givenDiscountFa... | [
"public",
"static",
"DiscountCurve",
"createDiscountCurveFromDiscountFactors",
"(",
"String",
"name",
",",
"double",
"[",
"]",
"times",
",",
"double",
"[",
"]",
"givenDiscountFactors",
")",
"{",
"DiscountCurve",
"discountFactors",
"=",
"new",
"DiscountCurve",
"(",
"... | Create a discount curve from given times and given discount factors using default interpolation and extrapolation methods.
@param name The name of this discount curve.
@param times Array of times as doubles.
@param givenDiscountFactors Array of corresponding discount factors.
@return A new discount factor object. | [
"Create",
"a",
"discount",
"curve",
"from",
"given",
"times",
"and",
"given",
"discount",
"factors",
"using",
"default",
"interpolation",
"and",
"extrapolation",
"methods",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/marketdata/model/curves/DiscountCurve.java#L158-L166 |
dkmfbk/knowledgestore | ks-core/src/main/java/eu/fbk/knowledgestore/data/Stream.java | Stream.getProperty | public final <V> V getProperty(final String name, final Class<V> type) {
"""
Returns a metadata property about the stream. Note that {@code Stream} wrappers obtained
through intermediate operations don't have their own properties, but instead access the
metadata properties of the source {@code Stream}.
@param... | java | public final <V> V getProperty(final String name, final Class<V> type) {
Preconditions.checkNotNull(name);
try {
Object value = null;
synchronized (this.state) {
if (this.state.properties != null) {
value = this.state.properties.get(name);
... | [
"public",
"final",
"<",
"V",
">",
"V",
"getProperty",
"(",
"final",
"String",
"name",
",",
"final",
"Class",
"<",
"V",
">",
"type",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"name",
")",
";",
"try",
"{",
"Object",
"value",
"=",
"null",
";"... | Returns a metadata property about the stream. Note that {@code Stream} wrappers obtained
through intermediate operations don't have their own properties, but instead access the
metadata properties of the source {@code Stream}.
@param name
the name of the property
@param type
the type of the property value (conversion ... | [
"Returns",
"a",
"metadata",
"property",
"about",
"the",
"stream",
".",
"Note",
"that",
"{",
"@code",
"Stream",
"}",
"wrappers",
"obtained",
"through",
"intermediate",
"operations",
"don",
"t",
"have",
"their",
"own",
"properties",
"but",
"instead",
"access",
"... | train | https://github.com/dkmfbk/knowledgestore/blob/a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a/ks-core/src/main/java/eu/fbk/knowledgestore/data/Stream.java#L873-L886 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/HeadersImpl.java | HeadersImpl.addUniqueHeadLine | @Override
public void addUniqueHeadLine(final String type, final String aLine) {
"""
Records a line for inclusion in the html/head, if it has not already been included.
@param type the type of line.
@param aLine the line to include.
"""
ArrayList<String> lines = headers.get(type);
if (lines == null) ... | java | @Override
public void addUniqueHeadLine(final String type, final String aLine) {
ArrayList<String> lines = headers.get(type);
if (lines == null) {
lines = new ArrayList<>();
lines.add(aLine);
headers.put(type, lines);
} else if (!lines.contains(aLine)) {
lines.add(aLine);
}
} | [
"@",
"Override",
"public",
"void",
"addUniqueHeadLine",
"(",
"final",
"String",
"type",
",",
"final",
"String",
"aLine",
")",
"{",
"ArrayList",
"<",
"String",
">",
"lines",
"=",
"headers",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"lines",
"==",
"n... | Records a line for inclusion in the html/head, if it has not already been included.
@param type the type of line.
@param aLine the line to include. | [
"Records",
"a",
"line",
"for",
"inclusion",
"in",
"the",
"html",
"/",
"head",
"if",
"it",
"has",
"not",
"already",
"been",
"included",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/HeadersImpl.java#L80-L91 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/socks/Proxy.java | Proxy.setDefaultProxy | public static void setDefaultProxy(InetAddress ipAddress,int port,
String user) {
"""
Sets SOCKS4 proxy as default.
@param ipAddress Host address on which SOCKS4 server is running.
@param port Port on which SOCKS4 server is running.
@param user Username to use for communica... | java | public static void setDefaultProxy(InetAddress ipAddress,int port,
String user){
defaultProxy = new Socks4Proxy(ipAddress,port,user);
} | [
"public",
"static",
"void",
"setDefaultProxy",
"(",
"InetAddress",
"ipAddress",
",",
"int",
"port",
",",
"String",
"user",
")",
"{",
"defaultProxy",
"=",
"new",
"Socks4Proxy",
"(",
"ipAddress",
",",
"port",
",",
"user",
")",
";",
"}"
] | Sets SOCKS4 proxy as default.
@param ipAddress Host address on which SOCKS4 server is running.
@param port Port on which SOCKS4 server is running.
@param user Username to use for communications with proxy. | [
"Sets",
"SOCKS4",
"proxy",
"as",
"default",
"."
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/socks/Proxy.java#L216-L219 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java | SegmentClipper.isOnTheSameSideOut | private boolean isOnTheSameSideOut(final long pX0, final long pY0, final long pX1, final long pY1) {
"""
Optimization for lines (as opposed to Path)
If both points are outside of the clip area and "on the same side of the outside" (sic)
we don't need to compute anything anymore as it won't draw a line in the end... | java | private boolean isOnTheSameSideOut(final long pX0, final long pY0, final long pX1, final long pY1) {
return (pX0 < mXMin && pX1 < mXMin)
|| (pX0 > mXMax && pX1 > mXMax)
|| (pY0 < mYMin && pY1 < mYMin)
|| (pY0 > mYMax && pY1 > mYMax);
} | [
"private",
"boolean",
"isOnTheSameSideOut",
"(",
"final",
"long",
"pX0",
",",
"final",
"long",
"pY0",
",",
"final",
"long",
"pX1",
",",
"final",
"long",
"pY1",
")",
"{",
"return",
"(",
"pX0",
"<",
"mXMin",
"&&",
"pX1",
"<",
"mXMin",
")",
"||",
"(",
"... | Optimization for lines (as opposed to Path)
If both points are outside of the clip area and "on the same side of the outside" (sic)
we don't need to compute anything anymore as it won't draw a line in the end
@since 6.0.0 | [
"Optimization",
"for",
"lines",
"(",
"as",
"opposed",
"to",
"Path",
")",
"If",
"both",
"points",
"are",
"outside",
"of",
"the",
"clip",
"area",
"and",
"on",
"the",
"same",
"side",
"of",
"the",
"outside",
"(",
"sic",
")",
"we",
"don",
"t",
"need",
"to... | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java#L241-L246 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/UserAPI.java | UserAPI.userTagGet | public static UserTagGetResult userTagGet(String access_token,Integer tagid,String next_openid) {
"""
标签管理 获取标签下粉丝列表
@since 2.8.1
@param access_token access_token
@param tagid tagid
@param next_openid 第一个拉取的OPENID,不填默认从头开始拉取
@return result
"""
String json = String.format("{\"tagid\":%d,\"next_openid\":\... | java | public static UserTagGetResult userTagGet(String access_token,Integer tagid,String next_openid){
String json = String.format("{\"tagid\":%d,\"next_openid\":\"%s\"}",tagid,next_openid==null?"":next_openid);
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.setUri(BASE_... | [
"public",
"static",
"UserTagGetResult",
"userTagGet",
"(",
"String",
"access_token",
",",
"Integer",
"tagid",
",",
"String",
"next_openid",
")",
"{",
"String",
"json",
"=",
"String",
".",
"format",
"(",
"\"{\\\"tagid\\\":%d,\\\"next_openid\\\":\\\"%s\\\"}\"",
",",
"ta... | 标签管理 获取标签下粉丝列表
@since 2.8.1
@param access_token access_token
@param tagid tagid
@param next_openid 第一个拉取的OPENID,不填默认从头开始拉取
@return result | [
"标签管理",
"获取标签下粉丝列表"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/UserAPI.java#L355-L364 |
biezhi/anima | src/main/java/io/github/biezhi/anima/core/AnimaQuery.java | AnimaQuery.buildUpdateSQL | private <S extends Model> String buildUpdateSQL(S model, Map<String, Object> updateColumns) {
"""
Build a update statement.
@param model model instance
@param updateColumns update columns
@param <S>
@return update sql
"""
SQLParams sqlParams = SQLParams.builder()
.model(mo... | java | private <S extends Model> String buildUpdateSQL(S model, Map<String, Object> updateColumns) {
SQLParams sqlParams = SQLParams.builder()
.model(model)
.modelClass(this.modelClass)
.tableName(this.tableName)
.pkName(this.primaryKeyColumn)
... | [
"private",
"<",
"S",
"extends",
"Model",
">",
"String",
"buildUpdateSQL",
"(",
"S",
"model",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"updateColumns",
")",
"{",
"SQLParams",
"sqlParams",
"=",
"SQLParams",
".",
"builder",
"(",
")",
".",
"model",
"("... | Build a update statement.
@param model model instance
@param updateColumns update columns
@param <S>
@return update sql | [
"Build",
"a",
"update",
"statement",
"."
] | train | https://github.com/biezhi/anima/blob/d6655e47ac4c08d9d7f961ac0569062bead8b1ed/src/main/java/io/github/biezhi/anima/core/AnimaQuery.java#L1446-L1457 |
zutnop/telekom-workflow-engine | telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/NodeBuilder.java | NodeBuilder.findPartnerNodeId | private int findPartnerNodeId( Tree<Row> current, Type type ) {
"""
Some node producing elements do not define an id themselves but deduce their id based
on their block-opening or block-closing partner. E.g. a WHILE_DO_END deduces its id
based on its WHILE_DO_BEGIN partner.
"""
switch( type ) {
... | java | private int findPartnerNodeId( Tree<Row> current, Type type ){
switch( type ) {
case JOIN_FIRST:
case JOIN_ALL:
case WHILE_DO_END:
// The partner is the previous sibling which is the SPLIT or WHILE_DO_BEGIN
return current.getPrevious().getConte... | [
"private",
"int",
"findPartnerNodeId",
"(",
"Tree",
"<",
"Row",
">",
"current",
",",
"Type",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"JOIN_FIRST",
":",
"case",
"JOIN_ALL",
":",
"case",
"WHILE_DO_END",
":",
"// The partner is the previous sib... | Some node producing elements do not define an id themselves but deduce their id based
on their block-opening or block-closing partner. E.g. a WHILE_DO_END deduces its id
based on its WHILE_DO_BEGIN partner. | [
"Some",
"node",
"producing",
"elements",
"do",
"not",
"define",
"an",
"id",
"themselves",
"but",
"deduce",
"their",
"id",
"based",
"on",
"their",
"block",
"-",
"opening",
"or",
"block",
"-",
"closing",
"partner",
".",
"E",
".",
"g",
".",
"a",
"WHILE_DO_E... | train | https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/NodeBuilder.java#L176-L196 |
hdbeukel/james-core | src/main/java/org/jamesframework/core/util/SetUtilities.java | SetUtilities.getRandomSubset | public static <T> Collection<T> getRandomSubset(Set<? extends T> set, int size, Random rg, Collection<T> subset) {
"""
<p>
Selects a random subset of a specific size from a given set (uniformly distributed).
Applies a full scan algorithm that iterates once through the given set and selects each item with probabi... | java | public static <T> Collection<T> getRandomSubset(Set<? extends T> set, int size, Random rg, Collection<T> subset) {
// check size
if(size < 0 || size > set.size()){
throw new IllegalArgumentException("Error in SetUtilities: desired subset size should be a number in [0,|set|].");
}
... | [
"public",
"static",
"<",
"T",
">",
"Collection",
"<",
"T",
">",
"getRandomSubset",
"(",
"Set",
"<",
"?",
"extends",
"T",
">",
"set",
",",
"int",
"size",
",",
"Random",
"rg",
",",
"Collection",
"<",
"T",
">",
"subset",
")",
"{",
"// check size",
"if",... | <p>
Selects a random subset of a specific size from a given set (uniformly distributed).
Applies a full scan algorithm that iterates once through the given set and selects each item with probability
(#remaining to select)/(#remaining to scan). It can be proven that this algorithm creates uniformly distributed
random su... | [
"<p",
">",
"Selects",
"a",
"random",
"subset",
"of",
"a",
"specific",
"size",
"from",
"a",
"given",
"set",
"(",
"uniformly",
"distributed",
")",
".",
"Applies",
"a",
"full",
"scan",
"algorithm",
"that",
"iterates",
"once",
"through",
"the",
"given",
"set",... | train | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/util/SetUtilities.java#L78-L104 |
alexvasilkov/GestureViews | sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java | DemoActivity.applyFullImageState | private void applyFullImageState(float position, boolean isLeaving) {
"""
Applying top image animation state: fading out toolbar and background.
"""
views.fullBackground.setVisibility(position == 0f ? View.INVISIBLE : View.VISIBLE);
views.fullBackground.setAlpha(position);
views.fullIm... | java | private void applyFullImageState(float position, boolean isLeaving) {
views.fullBackground.setVisibility(position == 0f ? View.INVISIBLE : View.VISIBLE);
views.fullBackground.setAlpha(position);
views.fullImageToolbar.setVisibility(position == 0f ? View.INVISIBLE : View.VISIBLE);
views.... | [
"private",
"void",
"applyFullImageState",
"(",
"float",
"position",
",",
"boolean",
"isLeaving",
")",
"{",
"views",
".",
"fullBackground",
".",
"setVisibility",
"(",
"position",
"==",
"0f",
"?",
"View",
".",
"INVISIBLE",
":",
"View",
".",
"VISIBLE",
")",
";"... | Applying top image animation state: fading out toolbar and background. | [
"Applying",
"top",
"image",
"animation",
"state",
":",
"fading",
"out",
"toolbar",
"and",
"background",
"."
] | train | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java#L146-L155 |
cache2k/cache2k | cache2k-api/src/main/java/org/cache2k/configuration/Cache2kConfiguration.java | Cache2kConfiguration.setAsyncListeners | public void setAsyncListeners(Collection<CustomizationSupplier<CacheEntryOperationListener<K,V>>> c) {
"""
Adds the collection of customizations to the existing list. This method is intended to
improve integration with bean configuration mechanisms that use the set method and
construct a set or list, like Spring... | java | public void setAsyncListeners(Collection<CustomizationSupplier<CacheEntryOperationListener<K,V>>> c) {
getAsyncListeners().addAll(c);
} | [
"public",
"void",
"setAsyncListeners",
"(",
"Collection",
"<",
"CustomizationSupplier",
"<",
"CacheEntryOperationListener",
"<",
"K",
",",
"V",
">",
">",
">",
"c",
")",
"{",
"getAsyncListeners",
"(",
")",
".",
"addAll",
"(",
"c",
")",
";",
"}"
] | Adds the collection of customizations to the existing list. This method is intended to
improve integration with bean configuration mechanisms that use the set method and
construct a set or list, like Springs' bean XML configuration. | [
"Adds",
"the",
"collection",
"of",
"customizations",
"to",
"the",
"existing",
"list",
".",
"This",
"method",
"is",
"intended",
"to",
"improve",
"integration",
"with",
"bean",
"configuration",
"mechanisms",
"that",
"use",
"the",
"set",
"method",
"and",
"construct... | train | https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/configuration/Cache2kConfiguration.java#L562-L564 |
openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/animation/Animations.java | Animations.createFadeTransition | public static FadeTransition createFadeTransition(final Node node, final double fromValue, final double toValue, final int cycleCount, final double duration) {
"""
Method to create a FadeTransition with several parameters.
@param node the node to which the transition should be applied
@param fromValue the opac... | java | public static FadeTransition createFadeTransition(final Node node, final double fromValue, final double toValue, final int cycleCount, final double duration) {
assert node != null;
final FadeTransition fadeTransition = new FadeTransition(Duration.millis(duration), node);
fadeTransition.... | [
"public",
"static",
"FadeTransition",
"createFadeTransition",
"(",
"final",
"Node",
"node",
",",
"final",
"double",
"fromValue",
",",
"final",
"double",
"toValue",
",",
"final",
"int",
"cycleCount",
",",
"final",
"double",
"duration",
")",
"{",
"assert",
"node",... | Method to create a FadeTransition with several parameters.
@param node the node to which the transition should be applied
@param fromValue the opacity value from which the transition should start
@param toValue the opacity value where the transition should end
@param cycleCount the number of times the animation should... | [
"Method",
"to",
"create",
"a",
"FadeTransition",
"with",
"several",
"parameters",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/animation/Animations.java#L65-L74 |
alkacon/opencms-core | src/org/opencms/ui/CmsVaadinUtils.java | CmsVaadinUtils.hasPathAsItemId | public static boolean hasPathAsItemId(Container cnt, String path) {
"""
Checks if path is itemid in container.<p>
@param cnt to be checked
@param path as itemid
@return true id path is itemid in container
"""
return cnt.containsId(path) || cnt.containsId(CmsFileUtil.toggleTrailingSeparator(path))... | java | public static boolean hasPathAsItemId(Container cnt, String path) {
return cnt.containsId(path) || cnt.containsId(CmsFileUtil.toggleTrailingSeparator(path));
} | [
"public",
"static",
"boolean",
"hasPathAsItemId",
"(",
"Container",
"cnt",
",",
"String",
"path",
")",
"{",
"return",
"cnt",
".",
"containsId",
"(",
"path",
")",
"||",
"cnt",
".",
"containsId",
"(",
"CmsFileUtil",
".",
"toggleTrailingSeparator",
"(",
"path",
... | Checks if path is itemid in container.<p>
@param cnt to be checked
@param path as itemid
@return true id path is itemid in container | [
"Checks",
"if",
"path",
"is",
"itemid",
"in",
"container",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsVaadinUtils.java#L948-L951 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ObjectGraphNode.java | ObjectGraphNode.getSize | private int getSize(final String fieldType, final Object fieldValue) {
"""
Calculates the size of a field value obtained using the reflection API.
@param fieldType the Field's type (class), needed to return the correct values for primitives.
@param fieldValue the field's value (primitives are boxed).
@retur... | java | private int getSize(final String fieldType, final Object fieldValue) {
Integer fieldSize = SIMPLE_SIZES.get(fieldType);
if (fieldSize != null) {
if (PRIMITIVE_TYPES.contains(fieldType)) {
return fieldSize;
}
return OBJREF_SIZE + fieldSize;
} else if (fieldValue instanceof String) {
return (OBJRE... | [
"private",
"int",
"getSize",
"(",
"final",
"String",
"fieldType",
",",
"final",
"Object",
"fieldValue",
")",
"{",
"Integer",
"fieldSize",
"=",
"SIMPLE_SIZES",
".",
"get",
"(",
"fieldType",
")",
";",
"if",
"(",
"fieldSize",
"!=",
"null",
")",
"{",
"if",
"... | Calculates the size of a field value obtained using the reflection API.
@param fieldType the Field's type (class), needed to return the correct values for primitives.
@param fieldValue the field's value (primitives are boxed).
@return an approximation of amount of memory the field occupies, in bytes. | [
"Calculates",
"the",
"size",
"of",
"a",
"field",
"value",
"obtained",
"using",
"the",
"reflection",
"API",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ObjectGraphNode.java#L177-L195 |
wcm-io/wcm-io-tooling | commons/crx-packmgr-helper/src/main/java/io/wcm/tooling/commons/packmgr/unpack/ContentUnpacker.java | ContentUnpacker.getNamespacePrefixes | private Set<String> getNamespacePrefixes(ZipFile zipFile, ZipArchiveEntry entry) throws IOException {
"""
Parses XML file with namespace-aware SAX parser to get defined namespaces prefixes in order of appearance
(to keep the same order when outputting the XML file again).
@param zipFile ZIP file
@param entry ZI... | java | private Set<String> getNamespacePrefixes(ZipFile zipFile, ZipArchiveEntry entry) throws IOException {
try (InputStream entryStream = zipFile.getInputStream(entry)) {
SAXParser parser = SAX_PARSER_FACTORY.newSAXParser();
final Set<String> prefixes = new LinkedHashSet<>();
final AtomicBoolean found... | [
"private",
"Set",
"<",
"String",
">",
"getNamespacePrefixes",
"(",
"ZipFile",
"zipFile",
",",
"ZipArchiveEntry",
"entry",
")",
"throws",
"IOException",
"{",
"try",
"(",
"InputStream",
"entryStream",
"=",
"zipFile",
".",
"getInputStream",
"(",
"entry",
")",
")",
... | Parses XML file with namespace-aware SAX parser to get defined namespaces prefixes in order of appearance
(to keep the same order when outputting the XML file again).
@param zipFile ZIP file
@param entry ZIP entry
@return Ordered set with namespace prefixes in correct order.
Returns null if given XML file does not cont... | [
"Parses",
"XML",
"file",
"with",
"namespace",
"-",
"aware",
"SAX",
"parser",
"to",
"get",
"defined",
"namespaces",
"prefixes",
"in",
"order",
"of",
"appearance",
"(",
"to",
"keep",
"the",
"same",
"order",
"when",
"outputting",
"the",
"XML",
"file",
"again",
... | train | https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/commons/crx-packmgr-helper/src/main/java/io/wcm/tooling/commons/packmgr/unpack/ContentUnpacker.java#L217-L250 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/support/action/Action.java | Action.moveFileToEmptyPath | public static Action moveFileToEmptyPath(final String srcPath, final String destPath) {
"""
Moves the file/directory to a new location, which must not already exist.
@param srcPath Source path
@param destPath Destination path which must not exist
@return A moveFileToEmptyPath action
"""
if (srcPath ... | java | public static Action moveFileToEmptyPath(final String srcPath, final String destPath) {
if (srcPath == null)
throw new IllegalArgumentException("The srcPath variable cannot be null");
if (destPath == null)
throw new IllegalArgumentException("The destPath variable cannot be null")... | [
"public",
"static",
"Action",
"moveFileToEmptyPath",
"(",
"final",
"String",
"srcPath",
",",
"final",
"String",
"destPath",
")",
"{",
"if",
"(",
"srcPath",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The srcPath variable cannot be null\"",
... | Moves the file/directory to a new location, which must not already exist.
@param srcPath Source path
@param destPath Destination path which must not exist
@return A moveFileToEmptyPath action | [
"Moves",
"the",
"file",
"/",
"directory",
"to",
"a",
"new",
"location",
"which",
"must",
"not",
"already",
"exist",
"."
] | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/support/action/Action.java#L294-L327 |
aws/aws-sdk-java | aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/model/Message.java | Message.withAttributes | public Message withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
A map of the attributes requested in <code> <a>ReceiveMessage</a> </code> to their respective values. Supported
attributes:
</p>
<ul>
<li>
<p>
<code>ApproximateReceiveCount</code>
</p>
</li>
<li>
<p>
<code>ApproximateFirs... | java | public Message withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"Message",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map of the attributes requested in <code> <a>ReceiveMessage</a> </code> to their respective values. Supported
attributes:
</p>
<ul>
<li>
<p>
<code>ApproximateReceiveCount</code>
</p>
</li>
<li>
<p>
<code>ApproximateFirstReceiveTimestamp</code>
</p>
</li>
<li>
<p>
<code>MessageDeduplicationId</code>
</p>
</li>
<li... | [
"<p",
">",
"A",
"map",
"of",
"the",
"attributes",
"requested",
"in",
"<code",
">",
"<a",
">",
"ReceiveMessage<",
"/",
"a",
">",
"<",
"/",
"code",
">",
"to",
"their",
"respective",
"values",
".",
"Supported",
"attributes",
":",
"<",
"/",
"p",
">",
"<u... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/model/Message.java#L582-L585 |
apache/flink | flink-scala/src/main/java/org/apache/flink/api/scala/operators/ScalaCsvOutputFormat.java | ScalaCsvOutputFormat.setInputType | @Override
public void setInputType(TypeInformation<?> type, ExecutionConfig executionConfig) {
"""
The purpose of this method is solely to check whether the data type to be processed
is in fact a tuple type.
"""
if (!type.isTupleType()) {
throw new InvalidProgramException("The " + ScalaCsvOutputFormat.c... | java | @Override
public void setInputType(TypeInformation<?> type, ExecutionConfig executionConfig) {
if (!type.isTupleType()) {
throw new InvalidProgramException("The " + ScalaCsvOutputFormat.class.getSimpleName() +
" can only be used to write tuple data sets.");
}
} | [
"@",
"Override",
"public",
"void",
"setInputType",
"(",
"TypeInformation",
"<",
"?",
">",
"type",
",",
"ExecutionConfig",
"executionConfig",
")",
"{",
"if",
"(",
"!",
"type",
".",
"isTupleType",
"(",
")",
")",
"{",
"throw",
"new",
"InvalidProgramException",
... | The purpose of this method is solely to check whether the data type to be processed
is in fact a tuple type. | [
"The",
"purpose",
"of",
"this",
"method",
"is",
"solely",
"to",
"check",
"whether",
"the",
"data",
"type",
"to",
"be",
"processed",
"is",
"in",
"fact",
"a",
"tuple",
"type",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-scala/src/main/java/org/apache/flink/api/scala/operators/ScalaCsvOutputFormat.java#L223-L229 |
baratine/baratine | web/src/main/java/com/caucho/v5/store/io/StoreFsyncServiceImpl.java | StoreFsyncServiceImpl.scheduleFsync | public void scheduleFsync(long sequence, K key, Result<Boolean> result) {
"""
Schedule an fsync for the given sequence, but do not request a flush.
The fsync can occur before the flush, depending on other clients.
@param sequence the sequence allocated from allocateFsyncSequence
@param result notifies the cal... | java | public void scheduleFsync(long sequence, K key, Result<Boolean> result)
{
_requestSequence = Math.max(_requestSequence, sequence);
if (sequence <= _tailSequence) {
result.ok(Boolean.TRUE);
}
else {
_storeFsync.addResult(key, result);
}
} | [
"public",
"void",
"scheduleFsync",
"(",
"long",
"sequence",
",",
"K",
"key",
",",
"Result",
"<",
"Boolean",
">",
"result",
")",
"{",
"_requestSequence",
"=",
"Math",
".",
"max",
"(",
"_requestSequence",
",",
"sequence",
")",
";",
"if",
"(",
"sequence",
"... | Schedule an fsync for the given sequence, but do not request a flush.
The fsync can occur before the flush, depending on other clients.
@param sequence the sequence allocated from allocateFsyncSequence
@param result notifies the caller when the fsync completes | [
"Schedule",
"an",
"fsync",
"for",
"the",
"given",
"sequence",
"but",
"do",
"not",
"request",
"a",
"flush",
".",
"The",
"fsync",
"can",
"occur",
"before",
"the",
"flush",
"depending",
"on",
"other",
"clients",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/store/io/StoreFsyncServiceImpl.java#L127-L137 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/GraphEdgeIdFinder.java | GraphEdgeIdFinder.fillEdgeIDs | public void fillEdgeIDs(GHIntHashSet edgeIds, Geometry geometry, EdgeFilter filter) {
"""
This method fills the edgeIds hash with edgeIds found inside the specified geometry
"""
if (geometry instanceof Point) {
GHPoint point = GHPoint.create((Point) geometry);
findClosestEdgeToP... | java | public void fillEdgeIDs(GHIntHashSet edgeIds, Geometry geometry, EdgeFilter filter) {
if (geometry instanceof Point) {
GHPoint point = GHPoint.create((Point) geometry);
findClosestEdgeToPoint(edgeIds, point, filter);
} else if (geometry instanceof LineString) {
PointL... | [
"public",
"void",
"fillEdgeIDs",
"(",
"GHIntHashSet",
"edgeIds",
",",
"Geometry",
"geometry",
",",
"EdgeFilter",
"filter",
")",
"{",
"if",
"(",
"geometry",
"instanceof",
"Point",
")",
"{",
"GHPoint",
"point",
"=",
"GHPoint",
".",
"create",
"(",
"(",
"Point",... | This method fills the edgeIds hash with edgeIds found inside the specified geometry | [
"This",
"method",
"fills",
"the",
"edgeIds",
"hash",
"with",
"edgeIds",
"found",
"inside",
"the",
"specified",
"geometry"
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/GraphEdgeIdFinder.java#L118-L136 |
umano/AndroidSlidingUpPanel | library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java | ViewDragHelper.clampMag | private float clampMag(float value, float absMin, float absMax) {
"""
Clamp the magnitude of value for absMin and absMax.
If the value is below the minimum, it will be clamped to zero.
If the value is above the maximum, it will be clamped to the maximum.
@param value Value to clamp
@param absMin Absolute val... | java | private float clampMag(float value, float absMin, float absMax) {
final float absValue = Math.abs(value);
if (absValue < absMin) return 0;
if (absValue > absMax) return value > 0 ? absMax : -absMax;
return value;
} | [
"private",
"float",
"clampMag",
"(",
"float",
"value",
",",
"float",
"absMin",
",",
"float",
"absMax",
")",
"{",
"final",
"float",
"absValue",
"=",
"Math",
".",
"abs",
"(",
"value",
")",
";",
"if",
"(",
"absValue",
"<",
"absMin",
")",
"return",
"0",
... | Clamp the magnitude of value for absMin and absMax.
If the value is below the minimum, it will be clamped to zero.
If the value is above the maximum, it will be clamped to the maximum.
@param value Value to clamp
@param absMin Absolute value of the minimum significant value to return
@param absMax Absolute value of th... | [
"Clamp",
"the",
"magnitude",
"of",
"value",
"for",
"absMin",
"and",
"absMax",
".",
"If",
"the",
"value",
"is",
"below",
"the",
"minimum",
"it",
"will",
"be",
"clamped",
"to",
"zero",
".",
"If",
"the",
"value",
"is",
"above",
"the",
"maximum",
"it",
"wi... | train | https://github.com/umano/AndroidSlidingUpPanel/blob/45a460435b07e764138a700328836cafc1ed5c42/library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java#L697-L702 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/cdn/CdnClient.java | CdnClient.setDomainOrigin | public void setDomainOrigin(String domain, String peer) {
"""
Update origin of specified domain acceleration.
@param domain Name of the domain.
@param peer The peer address of new origin.
"""
List<OriginPeer> origin = new ArrayList<OriginPeer>();
origin.add(new OriginPeer().withPeer(peer));... | java | public void setDomainOrigin(String domain, String peer) {
List<OriginPeer> origin = new ArrayList<OriginPeer>();
origin.add(new OriginPeer().withPeer(peer));
SetDomainOriginRequest request = new SetDomainOriginRequest()
.withDomain(domain)
.withOrigin(origin);
... | [
"public",
"void",
"setDomainOrigin",
"(",
"String",
"domain",
",",
"String",
"peer",
")",
"{",
"List",
"<",
"OriginPeer",
">",
"origin",
"=",
"new",
"ArrayList",
"<",
"OriginPeer",
">",
"(",
")",
";",
"origin",
".",
"add",
"(",
"new",
"OriginPeer",
"(",
... | Update origin of specified domain acceleration.
@param domain Name of the domain.
@param peer The peer address of new origin. | [
"Update",
"origin",
"of",
"specified",
"domain",
"acceleration",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/cdn/CdnClient.java#L303-L310 |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/util/ClassUtils.java | ClassUtils.findPossibleConstructor | @SuppressWarnings( {
"""
<p>findPossibleConstructor.</p>
@param klass a {@link java.lang.Class} object.
@param args a {@link java.lang.Object} object.
@param <T> a T object.
@return a {@link java.lang.reflect.Constructor} object.
@throws java.lang.NoSuchMethodException if any.
""""unchecked"})
publi... | java | @SuppressWarnings({"unchecked"})
public static <T> Constructor<T> findPossibleConstructor( Class<T> klass, Object... args ) throws NoSuchMethodException
{
for (Constructor constructor : klass.getConstructors())
{
if (arityMatches(constructor, args)) return constructor;
}
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"public",
"static",
"<",
"T",
">",
"Constructor",
"<",
"T",
">",
"findPossibleConstructor",
"(",
"Class",
"<",
"T",
">",
"klass",
",",
"Object",
"...",
"args",
")",
"throws",
"NoSuchMethodExceptio... | <p>findPossibleConstructor.</p>
@param klass a {@link java.lang.Class} object.
@param args a {@link java.lang.Object} object.
@param <T> a T object.
@return a {@link java.lang.reflect.Constructor} object.
@throws java.lang.NoSuchMethodException if any. | [
"<p",
">",
"findPossibleConstructor",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/util/ClassUtils.java#L83-L92 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.addDeleteAction | void addDeleteAction(Table table, Row row) {
"""
Adds a delete action to the row and the transaction manager.
@param table the table of the row
@param row the deleted row
@throws HsqlException
"""
// tempActionHistory.add("add delete action " + actionTimestamp);
if (abortTransaction) {
... | java | void addDeleteAction(Table table, Row row) {
// tempActionHistory.add("add delete action " + actionTimestamp);
if (abortTransaction) {
// throw Error.error(ErrorCode.X_40001);
}
database.txManager.addDeleteAction(this, table, row);
} | [
"void",
"addDeleteAction",
"(",
"Table",
"table",
",",
"Row",
"row",
")",
"{",
"// tempActionHistory.add(\"add delete action \" + actionTimestamp);",
"if",
"(",
"abortTransaction",
")",
"{",
"// throw Error.error(ErrorCode.X_40001);",
"}",
"database",
".",
"... | Adds a delete action to the row and the transaction manager.
@param table the table of the row
@param row the deleted row
@throws HsqlException | [
"Adds",
"a",
"delete",
"action",
"to",
"the",
"row",
"and",
"the",
"transaction",
"manager",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L444-L453 |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/OLAPSession.java | OLAPSession.mergeShard | public boolean mergeShard(String shard, Date expireDate) {
"""
Request a merge of the OLAP shard with the given name belonging to this session's
application. Optionally set the shard's expire-date to the given value. True is
returned if the merge was successful. An exception is thrown if an error occurred.
@p... | java | public boolean mergeShard(String shard, Date expireDate) {
Utils.require(!Utils.isEmpty(shard), "shard");
try {
// Send a POST request to "/{application}/_shards/{shard}[?expire-date=<date>]"
StringBuilder uri = new StringBuilder(Utils.isEmpty(m_restClient.getApiPrefix()) ? "... | [
"public",
"boolean",
"mergeShard",
"(",
"String",
"shard",
",",
"Date",
"expireDate",
")",
"{",
"Utils",
".",
"require",
"(",
"!",
"Utils",
".",
"isEmpty",
"(",
"shard",
")",
",",
"\"shard\"",
")",
";",
"try",
"{",
"// Send a POST request to \"/{application}/_... | Request a merge of the OLAP shard with the given name belonging to this session's
application. Optionally set the shard's expire-date to the given value. True is
returned if the merge was successful. An exception is thrown if an error occurred.
@param shard Shard name.
@param expireDate Optional value for s... | [
"Request",
"a",
"merge",
"of",
"the",
"OLAP",
"shard",
"with",
"the",
"given",
"name",
"belonging",
"to",
"this",
"session",
"s",
"application",
".",
"Optionally",
"set",
"the",
"shard",
"s",
"expire",
"-",
"date",
"to",
"the",
"given",
"value",
".",
"Tr... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/OLAPSession.java#L219-L239 |
Netflix/conductor | core/src/main/java/com/netflix/conductor/core/execution/mapper/DecisionTaskMapper.java | DecisionTaskMapper.getEvaluatedCaseValue | @VisibleForTesting
String getEvaluatedCaseValue(WorkflowTask taskToSchedule, Map<String, Object> taskInput) {
"""
This method evaluates the case expression of a decision task and returns a string representation of the evaluated result.
@param taskToSchedule: The decision task that has the case expression to... | java | @VisibleForTesting
String getEvaluatedCaseValue(WorkflowTask taskToSchedule, Map<String, Object> taskInput) {
String expression = taskToSchedule.getCaseExpression();
String caseValue;
if (expression != null) {
logger.debug("Case being evaluated using decision expression: {}", exp... | [
"@",
"VisibleForTesting",
"String",
"getEvaluatedCaseValue",
"(",
"WorkflowTask",
"taskToSchedule",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"taskInput",
")",
"{",
"String",
"expression",
"=",
"taskToSchedule",
".",
"getCaseExpression",
"(",
")",
";",
"Strin... | This method evaluates the case expression of a decision task and returns a string representation of the evaluated result.
@param taskToSchedule: The decision task that has the case expression to be evaluated.
@param taskInput: the input which has the values that will be used in evaluating the case expression.
@re... | [
"This",
"method",
"evaluates",
"the",
"case",
"expression",
"of",
"a",
"decision",
"task",
"and",
"returns",
"a",
"string",
"representation",
"of",
"the",
"evaluated",
"result",
"."
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/core/execution/mapper/DecisionTaskMapper.java#L119-L141 |
wkgcass/Style | src/main/java/net/cassite/style/SwitchBlock.java | SwitchBlock.Case | @SuppressWarnings("unchecked")
public SwitchBlock<T, R> Case(T ca, VFunc0 func) {
"""
add a Case block to the expression
@param ca the object for switch-expression to match
@param func function to apply when matches
@return <code>this</code>
"""
return Case(ca, (def<R>) $(func));... | java | @SuppressWarnings("unchecked")
public SwitchBlock<T, R> Case(T ca, VFunc0 func) {
return Case(ca, (def<R>) $(func));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"SwitchBlock",
"<",
"T",
",",
"R",
">",
"Case",
"(",
"T",
"ca",
",",
"VFunc0",
"func",
")",
"{",
"return",
"Case",
"(",
"ca",
",",
"(",
"def",
"<",
"R",
">",
")",
"$",
"(",
"func",
")"... | add a Case block to the expression
@param ca the object for switch-expression to match
@param func function to apply when matches
@return <code>this</code> | [
"add",
"a",
"Case",
"block",
"to",
"the",
"expression"
] | train | https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/SwitchBlock.java#L64-L67 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/LocPathIterator.java | LocPathIterator.setRoot | public void setRoot(int context, Object environment) {
"""
Initialize the context values for this expression
after it is cloned.
@param context The XPath runtime context for this
transformation.
"""
m_context = context;
XPathContext xctxt = (XPathContext)environment;
m_execContext = xctx... | java | public void setRoot(int context, Object environment)
{
m_context = context;
XPathContext xctxt = (XPathContext)environment;
m_execContext = xctxt;
m_cdtm = xctxt.getDTM(context);
m_currentContextNode = context; // only if top level?
// Yech, shouldn't have to do this. -sb
... | [
"public",
"void",
"setRoot",
"(",
"int",
"context",
",",
"Object",
"environment",
")",
"{",
"m_context",
"=",
"context",
";",
"XPathContext",
"xctxt",
"=",
"(",
"XPathContext",
")",
"environment",
";",
"m_execContext",
"=",
"xctxt",
";",
"m_cdtm",
"=",
"xctx... | Initialize the context values for this expression
after it is cloned.
@param context The XPath runtime context for this
transformation. | [
"Initialize",
"the",
"context",
"values",
"for",
"this",
"expression",
"after",
"it",
"is",
"cloned",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/LocPathIterator.java#L357-L381 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/data/artifactory/ArtifactorySearch.java | ArtifactorySearch.checkHashes | private void checkHashes(Dependency dependency, String sha1, String sha256, String md5) throws FileNotFoundException {
"""
Validates the hashes of the dependency.
@param dependency the dependency
@param sha1 the SHA1 checksum
@param sha256 the SHA256 checksum
@param md5 the MD5 checksum
@throws FileNotFound... | java | private void checkHashes(Dependency dependency, String sha1, String sha256, String md5) throws FileNotFoundException {
final String md5sum = dependency.getMd5sum();
if (!md5.equals(md5sum)) {
throw new FileNotFoundException("Artifact found by API is not matching the md5 "
... | [
"private",
"void",
"checkHashes",
"(",
"Dependency",
"dependency",
",",
"String",
"sha1",
",",
"String",
"sha256",
",",
"String",
"md5",
")",
"throws",
"FileNotFoundException",
"{",
"final",
"String",
"md5sum",
"=",
"dependency",
".",
"getMd5sum",
"(",
")",
";... | Validates the hashes of the dependency.
@param dependency the dependency
@param sha1 the SHA1 checksum
@param sha256 the SHA256 checksum
@param md5 the MD5 checksum
@throws FileNotFoundException thrown if one of the checksums does not
match | [
"Validates",
"the",
"hashes",
"of",
"the",
"dependency",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/artifactory/ArtifactorySearch.java#L246-L262 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/logical_disk.java | logical_disk.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
logical_disk_responses result = (logical_disk_responses) service.get_pa... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
logical_disk_responses result = (logical_disk_responses) service.get_payload_formatter().string_to_resource(logical_disk_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcod... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"logical_disk_responses",
"result",
"=",
"(",
"logical_disk_responses",
")",
"service",
".",
"get_payload_form... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/logical_disk.java#L387-L404 |
carewebframework/carewebframework-core | org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpUtil.java | HelpUtil.removeViewer | protected static void removeViewer(Page page, IHelpViewer viewer, boolean close) {
"""
Remove and optionally close the specified help viewer if is the active viewer for the
specified page.
@param page The page owner the help viewer.
@param viewer The viewer to remove.
@param close If true, close the help vie... | java | protected static void removeViewer(Page page, IHelpViewer viewer, boolean close) {
if (viewer != null && viewer == page.getAttribute(VIEWER_ATTRIB)) {
removeViewer(page, close);
}
} | [
"protected",
"static",
"void",
"removeViewer",
"(",
"Page",
"page",
",",
"IHelpViewer",
"viewer",
",",
"boolean",
"close",
")",
"{",
"if",
"(",
"viewer",
"!=",
"null",
"&&",
"viewer",
"==",
"page",
".",
"getAttribute",
"(",
"VIEWER_ATTRIB",
")",
")",
"{",
... | Remove and optionally close the specified help viewer if is the active viewer for the
specified page.
@param page The page owner the help viewer.
@param viewer The viewer to remove.
@param close If true, close the help viewer after removing it. | [
"Remove",
"and",
"optionally",
"close",
"the",
"specified",
"help",
"viewer",
"if",
"is",
"the",
"active",
"viewer",
"for",
"the",
"specified",
"page",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpUtil.java#L176-L180 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.