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 |
|---|---|---|---|---|---|---|---|---|---|---|
mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java | IOUtils.writeStream | public static boolean writeStream(File file, InputStream stream) throws IOException {
"""
write file
@param file
@param stream
@return
@see {@link #writeStream(File, InputStream, boolean)}
"""
return writeStream(file, stream, false);
} | java | public static boolean writeStream(File file, InputStream stream) throws IOException {
return writeStream(file, stream, false);
} | [
"public",
"static",
"boolean",
"writeStream",
"(",
"File",
"file",
",",
"InputStream",
"stream",
")",
"throws",
"IOException",
"{",
"return",
"writeStream",
"(",
"file",
",",
"stream",
",",
"false",
")",
";",
"}"
] | write file
@param file
@param stream
@return
@see {@link #writeStream(File, InputStream, boolean)} | [
"write",
"file"
] | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java#L1211-L1213 |
h2oai/h2o-3 | h2o-algos/src/main/java/hex/util/DimensionReductionUtils.java | DimensionReductionUtils.getTransformedEigenvectors | public static double[][] getTransformedEigenvectors(DataInfo dinfo, double[][] vEigenIn) {
"""
This function will tranform the eigenvectors calculated for a matrix T(A) to the ones calculated for
matrix A.
@param dinfo
@param vEigenIn
@return transformed eigenvectors
"""
Frame tempFrame = new Fra... | java | public static double[][] getTransformedEigenvectors(DataInfo dinfo, double[][] vEigenIn) {
Frame tempFrame = new Frame(dinfo._adaptedFrame);
Frame eigFrame = new water.util.ArrayUtils().frame(vEigenIn);
tempFrame.add(eigFrame);
LinearAlgebraUtils.SMulTask stsk = new LinearAlgebraUtils.S... | [
"public",
"static",
"double",
"[",
"]",
"[",
"]",
"getTransformedEigenvectors",
"(",
"DataInfo",
"dinfo",
",",
"double",
"[",
"]",
"[",
"]",
"vEigenIn",
")",
"{",
"Frame",
"tempFrame",
"=",
"new",
"Frame",
"(",
"dinfo",
".",
"_adaptedFrame",
")",
";",
"F... | This function will tranform the eigenvectors calculated for a matrix T(A) to the ones calculated for
matrix A.
@param dinfo
@param vEigenIn
@return transformed eigenvectors | [
"This",
"function",
"will",
"tranform",
"the",
"eigenvectors",
"calculated",
"for",
"a",
"matrix",
"T",
"(",
"A",
")",
"to",
"the",
"ones",
"calculated",
"for",
"matrix",
"A",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/util/DimensionReductionUtils.java#L118-L139 |
cdk/cdk | base/valencycheck/src/main/java/org/openscience/cdk/tools/SmilesValencyChecker.java | SmilesValencyChecker.isSaturated | public boolean isSaturated(IBond bond, IAtomContainer atomContainer) throws CDKException {
"""
Returns whether a bond is saturated. A bond is saturated if
<b>both</b> Atoms in the bond are saturated.
"""
logger.debug("isBondSaturated?: ", bond);
IAtom[] atoms = BondManipulator.getAtomArray(bon... | java | public boolean isSaturated(IBond bond, IAtomContainer atomContainer) throws CDKException {
logger.debug("isBondSaturated?: ", bond);
IAtom[] atoms = BondManipulator.getAtomArray(bond);
boolean isSaturated = true;
for (int i = 0; i < atoms.length; i++) {
logger.debug("isSatura... | [
"public",
"boolean",
"isSaturated",
"(",
"IBond",
"bond",
",",
"IAtomContainer",
"atomContainer",
")",
"throws",
"CDKException",
"{",
"logger",
".",
"debug",
"(",
"\"isBondSaturated?: \"",
",",
"bond",
")",
";",
"IAtom",
"[",
"]",
"atoms",
"=",
"BondManipulator"... | Returns whether a bond is saturated. A bond is saturated if
<b>both</b> Atoms in the bond are saturated. | [
"Returns",
"whether",
"a",
"bond",
"is",
"saturated",
".",
"A",
"bond",
"is",
"saturated",
"if",
"<b",
">",
"both<",
"/",
"b",
">",
"Atoms",
"in",
"the",
"bond",
"are",
"saturated",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/valencycheck/src/main/java/org/openscience/cdk/tools/SmilesValencyChecker.java#L198-L208 |
lonnyj/liquibase-spatial | src/main/java/liquibase/ext/spatial/preconditions/SpatialIndexExistsPrecondition.java | SpatialIndexExistsPrecondition.getIndexExample | protected Index getIndexExample(final Database database, final Schema schema,
final String tableName) {
"""
Generates the {@link Index} example (taken from {@link IndexExistsPrecondition}).
@param database
the database instance.
@param schema
the schema instance.
@param tableName
the table name of... | java | protected Index getIndexExample(final Database database, final Schema schema,
final String tableName) {
final Index example = new Index();
if (tableName != null) {
example.setTable((Table) new Table().setName(
database.correctObjectName(getTableName(), Table.class)).setSchem... | [
"protected",
"Index",
"getIndexExample",
"(",
"final",
"Database",
"database",
",",
"final",
"Schema",
"schema",
",",
"final",
"String",
"tableName",
")",
"{",
"final",
"Index",
"example",
"=",
"new",
"Index",
"(",
")",
";",
"if",
"(",
"tableName",
"!=",
"... | Generates the {@link Index} example (taken from {@link IndexExistsPrecondition}).
@param database
the database instance.
@param schema
the schema instance.
@param tableName
the table name of the index.
@return the index example. | [
"Generates",
"the",
"{",
"@link",
"Index",
"}",
"example",
"(",
"taken",
"from",
"{",
"@link",
"IndexExistsPrecondition",
"}",
")",
"."
] | train | https://github.com/lonnyj/liquibase-spatial/blob/36ae41b0d3d08bb00a22c856e51ffeed08891c0e/src/main/java/liquibase/ext/spatial/preconditions/SpatialIndexExistsPrecondition.java#L187-L202 |
box/box-java-sdk | src/main/java/com/box/sdk/RetentionPolicyParams.java | RetentionPolicyParams.addCustomNotificationRecipient | public void addCustomNotificationRecipient(String userID) {
"""
Add a user by ID to the list of people to notify when the retention period is ending.
@param userID The ID of the user to add to the list.
"""
BoxUser user = new BoxUser(null, userID);
this.customNotificationRecipients.add(user.ne... | java | public void addCustomNotificationRecipient(String userID) {
BoxUser user = new BoxUser(null, userID);
this.customNotificationRecipients.add(user.new Info());
} | [
"public",
"void",
"addCustomNotificationRecipient",
"(",
"String",
"userID",
")",
"{",
"BoxUser",
"user",
"=",
"new",
"BoxUser",
"(",
"null",
",",
"userID",
")",
";",
"this",
".",
"customNotificationRecipients",
".",
"add",
"(",
"user",
".",
"new",
"Info",
"... | Add a user by ID to the list of people to notify when the retention period is ending.
@param userID The ID of the user to add to the list. | [
"Add",
"a",
"user",
"by",
"ID",
"to",
"the",
"list",
"of",
"people",
"to",
"notify",
"when",
"the",
"retention",
"period",
"is",
"ending",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/RetentionPolicyParams.java#L85-L89 |
gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/RestfulService.java | RestfulService.findJob | public JobIdentifier findJob(String pipelineName, String pipelineCounter, String stageName, String stageCounter, String buildName, Long buildId) {
"""
buildId should only be given when caller is absolutely sure about the job instance
(makes sense in agent-uploading artifacts/properties scenario because agent won'... | java | public JobIdentifier findJob(String pipelineName, String pipelineCounter, String stageName, String stageCounter, String buildName, Long buildId) {
JobConfigIdentifier jobConfigIdentifier = goConfigService.translateToActualCase(new JobConfigIdentifier(pipelineName, stageName, buildName));
PipelineIdenti... | [
"public",
"JobIdentifier",
"findJob",
"(",
"String",
"pipelineName",
",",
"String",
"pipelineCounter",
",",
"String",
"stageName",
",",
"String",
"stageCounter",
",",
"String",
"buildName",
",",
"Long",
"buildId",
")",
"{",
"JobConfigIdentifier",
"jobConfigIdentifier"... | buildId should only be given when caller is absolutely sure about the job instance
(makes sense in agent-uploading artifacts/properties scenario because agent won't run a job if its copied over(it only executes real jobs)) -JJ
<p>
This does not return pipelineLabel | [
"buildId",
"should",
"only",
"be",
"given",
"when",
"caller",
"is",
"absolutely",
"sure",
"about",
"the",
"job",
"instance",
"(",
"makes",
"sense",
"in",
"agent",
"-",
"uploading",
"artifacts",
"/",
"properties",
"scenario",
"because",
"agent",
"won",
"t",
"... | train | https://github.com/gocd/gocd/blob/59a8480e23d6c06de39127635108dff57603cb71/server/src/main/java/com/thoughtworks/go/server/service/RestfulService.java#L46-L73 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.lastIndexOf | public static int lastIndexOf(final CharSequence seq, final int searchChar, final int startPos) {
"""
Returns the index within <code>seq</code> of the last occurrence of
the specified character, searching backward starting at the
specified index. For values of <code>searchChar</code> in the range
from 0 to 0xFF... | java | public static int lastIndexOf(final CharSequence seq, final int searchChar, final int startPos) {
if (isEmpty(seq)) {
return INDEX_NOT_FOUND;
}
return CharSequenceUtils.lastIndexOf(seq, searchChar, startPos);
} | [
"public",
"static",
"int",
"lastIndexOf",
"(",
"final",
"CharSequence",
"seq",
",",
"final",
"int",
"searchChar",
",",
"final",
"int",
"startPos",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"seq",
")",
")",
"{",
"return",
"INDEX_NOT_FOUND",
";",
"}",
"return",
... | Returns the index within <code>seq</code> of the last occurrence of
the specified character, searching backward starting at the
specified index. For values of <code>searchChar</code> in the range
from 0 to 0xFFFF (inclusive), the index returned is the largest
value <i>k</i> such that:
<blockquote><pre>
(this.charAt(<i>... | [
"Returns",
"the",
"index",
"within",
"<code",
">",
"seq<",
"/",
"code",
">",
"of",
"the",
"last",
"occurrence",
"of",
"the",
"specified",
"character",
"searching",
"backward",
"starting",
"at",
"the",
"specified",
"index",
".",
"For",
"values",
"of",
"<code"... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L1726-L1731 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java | HttpBuilder.postAsync | public <T> CompletableFuture<T> postAsync(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) {
"""
Executes an asynchronous POST request on the configured URI (asynchronous alias to the `post(Class,Closure)` method), with additional
configuration provided by the configuration closure. The ... | java | public <T> CompletableFuture<T> postAsync(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) {
return CompletableFuture.supplyAsync(() -> post(type, closure), getExecutor());
} | [
"public",
"<",
"T",
">",
"CompletableFuture",
"<",
"T",
">",
"postAsync",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"@",
"DelegatesTo",
"(",
"HttpConfig",
".",
"class",
")",
"final",
"Closure",
"closure",
")",
"{",
"return",
"CompletableFuture",
... | Executes an asynchronous POST request on the configured URI (asynchronous alias to the `post(Class,Closure)` method), with additional
configuration provided by the configuration closure. The result will be cast to the specified `type`.
[source,groovy]
----
def http = HttpBuilder.configure {
request.uri = 'http://local... | [
"Executes",
"an",
"asynchronous",
"POST",
"request",
"on",
"the",
"configured",
"URI",
"(",
"asynchronous",
"alias",
"to",
"the",
"post",
"(",
"Class",
"Closure",
")",
"method",
")",
"with",
"additional",
"configuration",
"provided",
"by",
"the",
"configuration"... | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L856-L858 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java | ComponentFactory.newFragment | public static <T> Fragment newFragment(final String id, final String markupId,
final MarkupContainer markupProvider, final IModel<T> model) {
"""
Factory method for create a new {@link Fragment}.
@param <T>
the generic type
@param id
the id
@param markupId
The associated id of the associated markup fragm... | java | public static <T> Fragment newFragment(final String id, final String markupId,
final MarkupContainer markupProvider, final IModel<T> model)
{
final Fragment fragment = new Fragment(id, markupId, markupProvider, model);
fragment.setOutputMarkupId(true);
return fragment;
} | [
"public",
"static",
"<",
"T",
">",
"Fragment",
"newFragment",
"(",
"final",
"String",
"id",
",",
"final",
"String",
"markupId",
",",
"final",
"MarkupContainer",
"markupProvider",
",",
"final",
"IModel",
"<",
"T",
">",
"model",
")",
"{",
"final",
"Fragment",
... | Factory method for create a new {@link Fragment}.
@param <T>
the generic type
@param id
the id
@param markupId
The associated id of the associated markup fragment
@param markupProvider
The component whose markup contains the fragment's markup
@param model
The model for this {@link Fragment}
@return The new {@link Frag... | [
"Factory",
"method",
"for",
"create",
"a",
"new",
"{",
"@link",
"Fragment",
"}",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java#L336-L342 |
morfologik/morfologik-stemming | morfologik-stemming/src/main/java/morfologik/stemming/Dictionary.java | Dictionary.read | public static Dictionary read(InputStream fsaStream, InputStream metadataStream) throws IOException {
"""
Attempts to load a dictionary from opened streams of FSA dictionary data
and associated metadata. Input streams are not closed automatically.
@param fsaStream The stream with FSA data
@param metadataStrea... | java | public static Dictionary read(InputStream fsaStream, InputStream metadataStream) throws IOException {
return new Dictionary(FSA.read(fsaStream), DictionaryMetadata.read(metadataStream));
} | [
"public",
"static",
"Dictionary",
"read",
"(",
"InputStream",
"fsaStream",
",",
"InputStream",
"metadataStream",
")",
"throws",
"IOException",
"{",
"return",
"new",
"Dictionary",
"(",
"FSA",
".",
"read",
"(",
"fsaStream",
")",
",",
"DictionaryMetadata",
".",
"re... | Attempts to load a dictionary from opened streams of FSA dictionary data
and associated metadata. Input streams are not closed automatically.
@param fsaStream The stream with FSA data
@param metadataStream The stream with metadata
@return Returns an instantiated {@link Dictionary}.
@throws IOException if an I/O error ... | [
"Attempts",
"to",
"load",
"a",
"dictionary",
"from",
"opened",
"streams",
"of",
"FSA",
"dictionary",
"data",
"and",
"associated",
"metadata",
".",
"Input",
"streams",
"are",
"not",
"closed",
"automatically",
"."
] | train | https://github.com/morfologik/morfologik-stemming/blob/9d9099cc5ec4155a0eb8dfecdc23d01cbd734f6e/morfologik-stemming/src/main/java/morfologik/stemming/Dictionary.java#L101-L103 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/DefaultConvolutionInstance.java | DefaultConvolutionInstance.convn | @Override
public INDArray convn(INDArray input, INDArray kernel, Convolution.Type type, int[] axes) {
"""
ND Convolution
@param input the input to op
@param kernel the kernel to op with
@param type the opType of convolution
@param axes the axes to do the convolution along
@return the convolution of... | java | @Override
public INDArray convn(INDArray input, INDArray kernel, Convolution.Type type, int[] axes) {
throw new UnsupportedOperationException();
} | [
"@",
"Override",
"public",
"INDArray",
"convn",
"(",
"INDArray",
"input",
",",
"INDArray",
"kernel",
",",
"Convolution",
".",
"Type",
"type",
",",
"int",
"[",
"]",
"axes",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
")",
";",
"}"
] | ND Convolution
@param input the input to op
@param kernel the kernel to op with
@param type the opType of convolution
@param axes the axes to do the convolution along
@return the convolution of the given input and kernel | [
"ND",
"Convolution"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/DefaultConvolutionInstance.java#L37-L40 |
meertensinstituut/mtas | src/main/java/mtas/parser/cql/util/MtasCQLParserSentencePartCondition.java | MtasCQLParserSentencePartCondition.setFirstOccurence | public void setFirstOccurence(int min, int max) throws ParseException {
"""
Sets the first occurence.
@param min the min
@param max the max
@throws ParseException the parse exception
"""
if (fullCondition == null) {
if ((min < 0) || (min > max) || (max < 1)) {
throw new ParseException("I... | java | public void setFirstOccurence(int min, int max) throws ParseException {
if (fullCondition == null) {
if ((min < 0) || (min > max) || (max < 1)) {
throw new ParseException("Illegal number {" + min + "," + max + "}");
}
if (min == 0) {
firstOptional = true;
}
firstMinimum... | [
"public",
"void",
"setFirstOccurence",
"(",
"int",
"min",
",",
"int",
"max",
")",
"throws",
"ParseException",
"{",
"if",
"(",
"fullCondition",
"==",
"null",
")",
"{",
"if",
"(",
"(",
"min",
"<",
"0",
")",
"||",
"(",
"min",
">",
"max",
")",
"||",
"(... | Sets the first occurence.
@param min the min
@param max the max
@throws ParseException the parse exception | [
"Sets",
"the",
"first",
"occurence",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/parser/cql/util/MtasCQLParserSentencePartCondition.java#L83-L96 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java | AbstractEJBRuntime.createPersistentAutomaticTimers | protected int createPersistentAutomaticTimers(String appName, String moduleName, List<AutomaticTimerBean> timerBeans) throws RuntimeWarning {
"""
Only called if persistent timers exist <p>
Creates the persistent automatic timers for the specified module. <p>
The default behavior is that persistent timers are... | java | protected int createPersistentAutomaticTimers(String appName, String moduleName, List<AutomaticTimerBean> timerBeans) throws RuntimeWarning {
for (AutomaticTimerBean timerBean : timerBeans) {
if (timerBean.getNumPersistentTimers() != 0) {
Tr.warning(tc, "AUTOMATIC_PERSISTENT_TIMERS_N... | [
"protected",
"int",
"createPersistentAutomaticTimers",
"(",
"String",
"appName",
",",
"String",
"moduleName",
",",
"List",
"<",
"AutomaticTimerBean",
">",
"timerBeans",
")",
"throws",
"RuntimeWarning",
"{",
"for",
"(",
"AutomaticTimerBean",
"timerBean",
":",
"timerBea... | Only called if persistent timers exist <p>
Creates the persistent automatic timers for the specified module. <p>
The default behavior is that persistent timers are not supported and
warnings will be logged if they are present. Subclasses should override
this method if different behavior is required. <p>
@param appNa... | [
"Only",
"called",
"if",
"persistent",
"timers",
"exist",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L1779-L1787 |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/HttpServerRequestActionBuilder.java | HttpServerRequestActionBuilder.queryParam | public HttpServerRequestActionBuilder queryParam(String name, String value) {
"""
Adds a query param to the request uri.
@param name
@param value
@return
"""
httpMessage.queryParam(name, value);
return this;
} | java | public HttpServerRequestActionBuilder queryParam(String name, String value) {
httpMessage.queryParam(name, value);
return this;
} | [
"public",
"HttpServerRequestActionBuilder",
"queryParam",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"httpMessage",
".",
"queryParam",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a query param to the request uri.
@param name
@param value
@return | [
"Adds",
"a",
"query",
"param",
"to",
"the",
"request",
"uri",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/HttpServerRequestActionBuilder.java#L111-L114 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/script/ScriptVars.java | ScriptVars.getScriptVar | public static String getScriptVar(ScriptContext context, String key) {
"""
Gets a script variable.
@param context the context of the script.
@param key the key of the variable.
@return the value of the variable, might be {@code null} if no value was previously set.
@throws IllegalArgumentException if the {@c... | java | public static String getScriptVar(ScriptContext context, String key) {
return getScriptVarImpl(getScriptName(context), key);
} | [
"public",
"static",
"String",
"getScriptVar",
"(",
"ScriptContext",
"context",
",",
"String",
"key",
")",
"{",
"return",
"getScriptVarImpl",
"(",
"getScriptName",
"(",
"context",
")",
",",
"key",
")",
";",
"}"
] | Gets a script variable.
@param context the context of the script.
@param key the key of the variable.
@return the value of the variable, might be {@code null} if no value was previously set.
@throws IllegalArgumentException if the {@code context} is {@code null} or it does not contain the name of the script. | [
"Gets",
"a",
"script",
"variable",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ScriptVars.java#L249-L251 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/db/Context.java | Context.isTMNoTransaction | public static boolean isTMNoTransaction()
throws EFapsException {
"""
Is a transaction associated with a target object for transaction manager?
@return <i>true</i> if a transaction associated, otherwise <i>false</i>
@throws EFapsException if the status of the transaction manager could not
be evaluated... | java | public static boolean isTMNoTransaction()
throws EFapsException
{
try {
return Context.TRANSMANAG.getStatus() == Status.STATUS_NO_TRANSACTION;
} catch (final SystemException e) {
throw new EFapsException(Context.class, "isTMNoTransaction.SystemException", e);
... | [
"public",
"static",
"boolean",
"isTMNoTransaction",
"(",
")",
"throws",
"EFapsException",
"{",
"try",
"{",
"return",
"Context",
".",
"TRANSMANAG",
".",
"getStatus",
"(",
")",
"==",
"Status",
".",
"STATUS_NO_TRANSACTION",
";",
"}",
"catch",
"(",
"final",
"Syste... | Is a transaction associated with a target object for transaction manager?
@return <i>true</i> if a transaction associated, otherwise <i>false</i>
@throws EFapsException if the status of the transaction manager could not
be evaluated
@see #TRANSMANAG | [
"Is",
"a",
"transaction",
"associated",
"with",
"a",
"target",
"object",
"for",
"transaction",
"manager?"
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/Context.java#L1147-L1155 |
k3po/k3po | specification/socks5/src/main/java/org/kaazing/specification/socks5/internal/Functions.java | Functions.acceptClientToken | @Function
public static boolean acceptClientToken(GSSContext context, byte[] token) {
"""
Accept a client token to establish a secure communication channel.
@param context GSSContext for which a connection has been established to the remote peer
@param token the client side token (client side, as in the toke... | java | @Function
public static boolean acceptClientToken(GSSContext context, byte[] token) {
try {
if (!context.isEstablished()) {
byte[] nextToken = context.acceptSecContext(token, 0, token.length);
return nextToken == null;
}
return true;
... | [
"@",
"Function",
"public",
"static",
"boolean",
"acceptClientToken",
"(",
"GSSContext",
"context",
",",
"byte",
"[",
"]",
"token",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"context",
".",
"isEstablished",
"(",
")",
")",
"{",
"byte",
"[",
"]",
"nextToken",
... | Accept a client token to establish a secure communication channel.
@param context GSSContext for which a connection has been established to the remote peer
@param token the client side token (client side, as in the token had
to be bootstrapped by the client and this peer uses that token
to update the GSSContext)
@retur... | [
"Accept",
"a",
"client",
"token",
"to",
"establish",
"a",
"secure",
"communication",
"channel",
"."
] | train | https://github.com/k3po/k3po/blob/3ca4fd31ab4a397893aa640c62ada0e485c8bbd4/specification/socks5/src/main/java/org/kaazing/specification/socks5/internal/Functions.java#L221-L232 |
mangstadt/biweekly | src/main/java/biweekly/util/ListMultimap.java | ListMultimap.putAll | public void putAll(K key, Collection<? extends V> values) {
"""
Adds multiple values to the multimap.
@param key the key
@param values the values to add
"""
if (values.isEmpty()) {
return;
}
key = sanitizeKey(key);
List<V> list = map.get(key);
if (list == null) {
list = new ArrayList<V>();
... | java | public void putAll(K key, Collection<? extends V> values) {
if (values.isEmpty()) {
return;
}
key = sanitizeKey(key);
List<V> list = map.get(key);
if (list == null) {
list = new ArrayList<V>();
map.put(key, list);
}
list.addAll(values);
} | [
"public",
"void",
"putAll",
"(",
"K",
"key",
",",
"Collection",
"<",
"?",
"extends",
"V",
">",
"values",
")",
"{",
"if",
"(",
"values",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"key",
"=",
"sanitizeKey",
"(",
"key",
")",
";",
"List... | Adds multiple values to the multimap.
@param key the key
@param values the values to add | [
"Adds",
"multiple",
"values",
"to",
"the",
"multimap",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/ListMultimap.java#L135-L147 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.beginGetTroubleshootingAsync | public Observable<TroubleshootingResultInner> beginGetTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) {
"""
Initiate troubleshooting on a specified resource.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The na... | java | public Observable<TroubleshootingResultInner> beginGetTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) {
return beginGetTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1<ServiceResponse<Troubles... | [
"public",
"Observable",
"<",
"TroubleshootingResultInner",
">",
"beginGetTroubleshootingAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"TroubleshootingParameters",
"parameters",
")",
"{",
"return",
"beginGetTroubleshootingWithServiceResponse... | Initiate troubleshooting on a specified resource.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher resource.
@param parameters Parameters that define the resource to troubleshoot.
@throws IllegalArgumentException thrown if parameters fail the validation... | [
"Initiate",
"troubleshooting",
"on",
"a",
"specified",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L1566-L1573 |
wildfly/wildfly-core | protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java | AbstractMessageHandler.registerActiveOperation | protected <T, A> ActiveOperation<T, A> registerActiveOperation(A attachment) {
"""
Register an active operation. The operation-id will be generated.
@param attachment the shared attachment
@return the active operation
"""
final ActiveOperation.CompletedCallback<T> callback = getDefaultCallback();
... | java | protected <T, A> ActiveOperation<T, A> registerActiveOperation(A attachment) {
final ActiveOperation.CompletedCallback<T> callback = getDefaultCallback();
return registerActiveOperation(attachment, callback);
} | [
"protected",
"<",
"T",
",",
"A",
">",
"ActiveOperation",
"<",
"T",
",",
"A",
">",
"registerActiveOperation",
"(",
"A",
"attachment",
")",
"{",
"final",
"ActiveOperation",
".",
"CompletedCallback",
"<",
"T",
">",
"callback",
"=",
"getDefaultCallback",
"(",
")... | Register an active operation. The operation-id will be generated.
@param attachment the shared attachment
@return the active operation | [
"Register",
"an",
"active",
"operation",
".",
"The",
"operation",
"-",
"id",
"will",
"be",
"generated",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java#L340-L343 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.getRewrittenResourceURI | public static String getRewrittenResourceURI( ServletContext servletContext, HttpServletRequest request,
HttpServletResponse response, String path, Map params,
String fragment, boolean forXML )
throws URISynt... | java | public static String getRewrittenResourceURI( ServletContext servletContext, HttpServletRequest request,
HttpServletResponse response, String path, Map params,
String fragment, boolean forXML )
throws URISynt... | [
"public",
"static",
"String",
"getRewrittenResourceURI",
"(",
"ServletContext",
"servletContext",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"String",
"path",
",",
"Map",
"params",
",",
"String",
"fragment",
",",
"boolean",
"for... | Create a fully-rewritten URI given a path and parameters.
<p> Calls the rewriter service using a type of {@link URLType#RESOURCE}. </p>
@param servletContext the current ServletContext.
@param request the current HttpServletRequest.
@param response the current HttpServletResponse.
@param path the path to process into... | [
"Create",
"a",
"fully",
"-",
"rewritten",
"URI",
"given",
"a",
"path",
"and",
"parameters",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L1546-L1552 |
Azure/azure-sdk-for-java | containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersInner.java | StartContainersInner.launchExec | public ContainerExecResponseInner launchExec(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) {
"""
Starts the exec command for a specific container instance.
Starts the exec command for a specified container instance in a specified resource gro... | java | public ContainerExecResponseInner launchExec(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) {
return launchExecWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).toBlocking().single().body();... | [
"public",
"ContainerExecResponseInner",
"launchExec",
"(",
"String",
"resourceGroupName",
",",
"String",
"containerGroupName",
",",
"String",
"containerName",
",",
"ContainerExecRequest",
"containerExecRequest",
")",
"{",
"return",
"launchExecWithServiceResponseAsync",
"(",
"... | Starts the exec command for a specific container instance.
Starts the exec command for a specified container instance in a specified resource group and container group.
@param resourceGroupName The name of the resource group.
@param containerGroupName The name of the container group.
@param containerName The name of t... | [
"Starts",
"the",
"exec",
"command",
"for",
"a",
"specific",
"container",
"instance",
".",
"Starts",
"the",
"exec",
"command",
"for",
"a",
"specified",
"container",
"instance",
"in",
"a",
"specified",
"resource",
"group",
"and",
"container",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersInner.java#L76-L78 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscNodeConfigurationsInner.java | DscNodeConfigurationsInner.createOrUpdateAsync | public Observable<DscNodeConfigurationInner> createOrUpdateAsync(String resourceGroupName, String automationAccountName, String nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParameters parameters) {
"""
Create the node configuration identified by node configuration name.
@param resourceGroupName Name... | java | public Observable<DscNodeConfigurationInner> createOrUpdateAsync(String resourceGroupName, String automationAccountName, String nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, automationAccountName, nodeConfigurat... | [
"public",
"Observable",
"<",
"DscNodeConfigurationInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"nodeConfigurationName",
",",
"DscNodeConfigurationCreateOrUpdateParameters",
"parameters",
")",
"{",... | Create the node configuration identified by node configuration name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param nodeConfigurationName The create or update parameters for configuration.
@param parameters The create or update paramete... | [
"Create",
"the",
"node",
"configuration",
"identified",
"by",
"node",
"configuration",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscNodeConfigurationsInner.java#L309-L316 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/api/API.java | API.getLongLivedNonce | public String getLongLivedNonce(String apiUrl) {
"""
Returns a nonce that will be valid for the lifetime of the ZAP process to used with the API call specified by the URL
@param apiUrl the API URL
@return a nonce that will be valid for the lifetime of the ZAP process
@since 2.6.0
"""
String nonce = Long.t... | java | public String getLongLivedNonce(String apiUrl) {
String nonce = Long.toHexString(random.nextLong());
this.nonces.put(nonce, new Nonce(nonce, apiUrl, false));
return nonce;
} | [
"public",
"String",
"getLongLivedNonce",
"(",
"String",
"apiUrl",
")",
"{",
"String",
"nonce",
"=",
"Long",
".",
"toHexString",
"(",
"random",
".",
"nextLong",
"(",
")",
")",
";",
"this",
".",
"nonces",
".",
"put",
"(",
"nonce",
",",
"new",
"Nonce",
"(... | Returns a nonce that will be valid for the lifetime of the ZAP process to used with the API call specified by the URL
@param apiUrl the API URL
@return a nonce that will be valid for the lifetime of the ZAP process
@since 2.6.0 | [
"Returns",
"a",
"nonce",
"that",
"will",
"be",
"valid",
"for",
"the",
"lifetime",
"of",
"the",
"ZAP",
"process",
"to",
"used",
"with",
"the",
"API",
"call",
"specified",
"by",
"the",
"URL"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/api/API.java#L841-L845 |
RestComm/Restcomm-Connect | restcomm/restcomm.http/src/main/java/org/restcomm/connect/http/AccountsEndpoint.java | AccountsEndpoint.updateAccountAsXmlPost | @Path("/ {
"""
The {accountSid} could be the email address of the account we need to update. Later we check if this is SID or EMAIL
"""accountSid}")
@Consumes(APPLICATION_FORM_URLENCODED)
@POST
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response updateAccountAsXml... | java | @Path("/{accountSid}")
@Consumes(APPLICATION_FORM_URLENCODED)
@POST
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response updateAccountAsXmlPost(@PathParam("accountSid") final String accountSid,
final MultivaluedMap<String, String> data,
@HeaderParam(... | [
"@",
"Path",
"(",
"\"/{accountSid}\"",
")",
"@",
"Consumes",
"(",
"APPLICATION_FORM_URLENCODED",
")",
"@",
"POST",
"@",
"Produces",
"(",
"{",
"MediaType",
".",
"APPLICATION_XML",
",",
"MediaType",
".",
"APPLICATION_JSON",
"}",
")",
"public",
"Response",
"updateA... | The {accountSid} could be the email address of the account we need to update. Later we check if this is SID or EMAIL | [
"The",
"{",
"accountSid",
"}",
"could",
"be",
"the",
"email",
"address",
"of",
"the",
"account",
"we",
"need",
"to",
"update",
".",
"Later",
"we",
"check",
"if",
"this",
"is",
"SID",
"or",
"EMAIL"
] | train | https://github.com/RestComm/Restcomm-Connect/blob/2194dee4fc524cdfd0af77a218ba5f212f97f7c5/restcomm/restcomm.http/src/main/java/org/restcomm/connect/http/AccountsEndpoint.java#L894-L903 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java | KeyUtil.generateKeyPair | public static KeyPair generateKeyPair(String algorithm, int keySize, byte[] seed) {
"""
生成用于非对称加密的公钥和私钥<br>
密钥对生成算法见:https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyPairGenerator
@param algorithm 非对称加密算法
@param keySize 密钥模(modulus )长度
@param seed 种子
@return {@link KeyPa... | java | public static KeyPair generateKeyPair(String algorithm, int keySize, byte[] seed) {
// SM2算法需要单独定义其曲线生成
if ("SM2".equalsIgnoreCase(algorithm)) {
final ECGenParameterSpec sm2p256v1 = new ECGenParameterSpec(SM2_DEFAULT_CURVE);
return generateKeyPair(algorithm, keySize, seed, sm2p256v1);
}
return gen... | [
"public",
"static",
"KeyPair",
"generateKeyPair",
"(",
"String",
"algorithm",
",",
"int",
"keySize",
",",
"byte",
"[",
"]",
"seed",
")",
"{",
"// SM2算法需要单独定义其曲线生成\r",
"if",
"(",
"\"SM2\"",
".",
"equalsIgnoreCase",
"(",
"algorithm",
")",
")",
"{",
"final",
"E... | 生成用于非对称加密的公钥和私钥<br>
密钥对生成算法见:https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyPairGenerator
@param algorithm 非对称加密算法
@param keySize 密钥模(modulus )长度
@param seed 种子
@return {@link KeyPair} | [
"生成用于非对称加密的公钥和私钥<br",
">",
"密钥对生成算法见:https",
":",
"//",
"docs",
".",
"oracle",
".",
"com",
"/",
"javase",
"/",
"7",
"/",
"docs",
"/",
"technotes",
"/",
"guides",
"/",
"security",
"/",
"StandardNames",
".",
"html#KeyPairGenerator"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java#L345-L353 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.queryAppStream | public GetAppStreamResponse queryAppStream(String app, String stream) {
"""
get detail of your stream by app name and stream name
@param app app name
@param stream stream name
@return the response
"""
GetAppStreamRequest request = new GetAppStreamRequest();
request.setApp(app);
req... | java | public GetAppStreamResponse queryAppStream(String app, String stream) {
GetAppStreamRequest request = new GetAppStreamRequest();
request.setApp(app);
request.setStream(stream);
return queryAppStream(request);
} | [
"public",
"GetAppStreamResponse",
"queryAppStream",
"(",
"String",
"app",
",",
"String",
"stream",
")",
"{",
"GetAppStreamRequest",
"request",
"=",
"new",
"GetAppStreamRequest",
"(",
")",
";",
"request",
".",
"setApp",
"(",
"app",
")",
";",
"request",
".",
"se... | get detail of your stream by app name and stream name
@param app app name
@param stream stream name
@return the response | [
"get",
"detail",
"of",
"your",
"stream",
"by",
"app",
"name",
"and",
"stream",
"name"
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L834-L839 |
chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java | CalligraphyUtils.pullFontPathFromView | static String pullFontPathFromView(Context context, AttributeSet attrs, int[] attributeId) {
"""
Tries to pull the Custom Attribute directly from the TextView.
@param context Activity Context
@param attrs View Attributes
@param attributeId if -1 returns null.
@return null if attribute is not define... | java | static String pullFontPathFromView(Context context, AttributeSet attrs, int[] attributeId) {
if (attributeId == null || attrs == null)
return null;
final String attributeName;
try {
attributeName = context.getResources().getResourceEntryName(attributeId[0]);
} ca... | [
"static",
"String",
"pullFontPathFromView",
"(",
"Context",
"context",
",",
"AttributeSet",
"attrs",
",",
"int",
"[",
"]",
"attributeId",
")",
"{",
"if",
"(",
"attributeId",
"==",
"null",
"||",
"attrs",
"==",
"null",
")",
"return",
"null",
";",
"final",
"S... | Tries to pull the Custom Attribute directly from the TextView.
@param context Activity Context
@param attrs View Attributes
@param attributeId if -1 returns null.
@return null if attribute is not defined or added to View | [
"Tries",
"to",
"pull",
"the",
"Custom",
"Attribute",
"directly",
"from",
"the",
"TextView",
"."
] | train | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java#L157-L173 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryFileApi.java | RepositoryFileApi.getFile | @Deprecated
public RepositoryFile getFile(String filePath, Integer projectId, String ref) throws GitLabApiException {
"""
Get file from repository. Allows you to receive information about file in repository like name, size, content.
Note that file content is Base64 encoded.
<pre><code>GitLab Endpoint: GET ... | java | @Deprecated
public RepositoryFile getFile(String filePath, Integer projectId, String ref) throws GitLabApiException {
if (isApiVersion(ApiVersion.V3)) {
return (getFileV3(filePath, projectId, ref));
} else {
return (getFile(projectId, filePath, ref, true));
}
} | [
"@",
"Deprecated",
"public",
"RepositoryFile",
"getFile",
"(",
"String",
"filePath",
",",
"Integer",
"projectId",
",",
"String",
"ref",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"isApiVersion",
"(",
"ApiVersion",
".",
"V3",
")",
")",
"{",
"return",
... | Get file from repository. Allows you to receive information about file in repository like name, size, content.
Note that file content is Base64 encoded.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/files</code></pre>
@param filePath (required) - Full path to the file. Ex. lib/class.rb
@param projectId (re... | [
"Get",
"file",
"from",
"repository",
".",
"Allows",
"you",
"to",
"receive",
"information",
"about",
"file",
"in",
"repository",
"like",
"name",
"size",
"content",
".",
"Note",
"that",
"file",
"content",
"is",
"Base64",
"encoded",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryFileApi.java#L131-L139 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFSUtils.java | VFSUtils.writeFile | public static void writeFile(VirtualFile virtualFile, byte[] bytes) throws IOException {
"""
Write the given bytes to the given virtual file, replacing its current contents (if any) or creating a new file if
one does not exist.
@param virtualFile the virtual file to write
@param bytes the bytes
@throws... | java | public static void writeFile(VirtualFile virtualFile, byte[] bytes) throws IOException {
final File file = virtualFile.getPhysicalFile();
file.getParentFile().mkdirs();
final FileOutputStream fos = new FileOutputStream(file);
try {
fos.write(bytes);
fos.close();
... | [
"public",
"static",
"void",
"writeFile",
"(",
"VirtualFile",
"virtualFile",
",",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
"{",
"final",
"File",
"file",
"=",
"virtualFile",
".",
"getPhysicalFile",
"(",
")",
";",
"file",
".",
"getParentFile",
"... | Write the given bytes to the given virtual file, replacing its current contents (if any) or creating a new file if
one does not exist.
@param virtualFile the virtual file to write
@param bytes the bytes
@throws IOException if an error occurs | [
"Write",
"the",
"given",
"bytes",
"to",
"the",
"given",
"virtual",
"file",
"replacing",
"its",
"current",
"contents",
"(",
"if",
"any",
")",
"or",
"creating",
"a",
"new",
"file",
"if",
"one",
"does",
"not",
"exist",
"."
] | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L451-L461 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryDetector.java | QuatSymmetryDetector.calcLocalSymmetries | public static List<QuatSymmetryResults> calcLocalSymmetries(
List<Subunit> subunits, QuatSymmetryParameters symmParams,
SubunitClustererParameters clusterParams) {
"""
Returns a List of LOCAL symmetry results. This means that a subset of the
{@link SubunitCluster} is left out of the symmetry calculation. Ea... | java | public static List<QuatSymmetryResults> calcLocalSymmetries(
List<Subunit> subunits, QuatSymmetryParameters symmParams,
SubunitClustererParameters clusterParams) {
Stoichiometry composition = SubunitClusterer.cluster(subunits, clusterParams);
return calcLocalSymmetries(composition, symmParams);
} | [
"public",
"static",
"List",
"<",
"QuatSymmetryResults",
">",
"calcLocalSymmetries",
"(",
"List",
"<",
"Subunit",
">",
"subunits",
",",
"QuatSymmetryParameters",
"symmParams",
",",
"SubunitClustererParameters",
"clusterParams",
")",
"{",
"Stoichiometry",
"composition",
"... | Returns a List of LOCAL symmetry results. This means that a subset of the
{@link SubunitCluster} is left out of the symmetry calculation. Each
element of the List is one possible LOCAL symmetry result.
<p>
Determine local symmetry if global structure is: (1) asymmetric, C1; (2)
heteromeric (belongs to more than 1 subun... | [
"Returns",
"a",
"List",
"of",
"LOCAL",
"symmetry",
"results",
".",
"This",
"means",
"that",
"a",
"subset",
"of",
"the",
"{",
"@link",
"SubunitCluster",
"}",
"is",
"left",
"out",
"of",
"the",
"symmetry",
"calculation",
".",
"Each",
"element",
"of",
"the",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryDetector.java#L175-L181 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/lang/parser/GosuParserFactory.java | GosuParserFactory.createParser | public static IGosuParser createParser( String strSource, ISymbolTable symTable, IScriptabilityModifier scriptabilityConstraint ) {
"""
Creates an IGosuParser appropriate for parsing and executing Gosu.
@param strSource The text of the the rule source
@param symTable The symbol tab... | java | public static IGosuParser createParser( String strSource, ISymbolTable symTable, IScriptabilityModifier scriptabilityConstraint )
{
return CommonServices.getGosuParserFactory().createParser( strSource, symTable, scriptabilityConstraint );
} | [
"public",
"static",
"IGosuParser",
"createParser",
"(",
"String",
"strSource",
",",
"ISymbolTable",
"symTable",
",",
"IScriptabilityModifier",
"scriptabilityConstraint",
")",
"{",
"return",
"CommonServices",
".",
"getGosuParserFactory",
"(",
")",
".",
"createParser",
"(... | Creates an IGosuParser appropriate for parsing and executing Gosu.
@param strSource The text of the the rule source
@param symTable The symbol table the parser uses to parse and execute the rule
@param scriptabilityConstraint Specifies the types of methods/properties that are visible
@ret... | [
"Creates",
"an",
"IGosuParser",
"appropriate",
"for",
"parsing",
"and",
"executing",
"Gosu",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/lang/parser/GosuParserFactory.java#L22-L25 |
chr78rm/tracelogger | src/main/java/de/christofreichardt/diagnosis/AbstractTracer.java | AbstractTracer.logException | public void logException(LogLevel logLevel, Throwable throwable, Class clazz, String methodName) {
"""
Logs an exception with the given logLevel and the originating class.
@param logLevel one of the predefined levels INFO, WARNING, ERROR, FATAL and SEVERE
@param throwable the to be logged throwable
@param cla... | java | public void logException(LogLevel logLevel, Throwable throwable, Class clazz, String methodName) {
Date timeStamp = new Date();
char border[] = new char[logLevel.toString().length() + 4];
Arrays.fill(border, '*');
String message;
if (throwable.getMessage() != null) {
message = throwabl... | [
"public",
"void",
"logException",
"(",
"LogLevel",
"logLevel",
",",
"Throwable",
"throwable",
",",
"Class",
"clazz",
",",
"String",
"methodName",
")",
"{",
"Date",
"timeStamp",
"=",
"new",
"Date",
"(",
")",
";",
"char",
"border",
"[",
"]",
"=",
"new",
"c... | Logs an exception with the given logLevel and the originating class.
@param logLevel one of the predefined levels INFO, WARNING, ERROR, FATAL and SEVERE
@param throwable the to be logged throwable
@param clazz the originating class
@param methodName the name of the relevant method | [
"Logs",
"an",
"exception",
"with",
"the",
"given",
"logLevel",
"and",
"the",
"originating",
"class",
"."
] | train | https://github.com/chr78rm/tracelogger/blob/ad22452b20f8111ad4d367302c2b26a100a20200/src/main/java/de/christofreichardt/diagnosis/AbstractTracer.java#L542-L563 |
roboconf/roboconf-platform | core/roboconf-target-iaas-openstack/src/main/java/net/roboconf/target/openstack/internal/OpenstackIaasHandler.java | OpenstackIaasHandler.swiftApi | static SwiftApi swiftApi( Map<String,String> targetProperties ) throws TargetException {
"""
Creates a JCloud context for Swift.
@param targetProperties the target properties
@return a non-null object
@throws TargetException if the target properties are invalid
"""
validate( targetProperties );
return ... | java | static SwiftApi swiftApi( Map<String,String> targetProperties ) throws TargetException {
validate( targetProperties );
return ContextBuilder
.newBuilder( PROVIDER_SWIFT )
.endpoint( targetProperties.get( API_URL ))
.credentials( identity( targetProperties ), targetProperties.get( PASSWORD ))
.build... | [
"static",
"SwiftApi",
"swiftApi",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"targetProperties",
")",
"throws",
"TargetException",
"{",
"validate",
"(",
"targetProperties",
")",
";",
"return",
"ContextBuilder",
".",
"newBuilder",
"(",
"PROVIDER_SWIFT",
")",
... | Creates a JCloud context for Swift.
@param targetProperties the target properties
@return a non-null object
@throws TargetException if the target properties are invalid | [
"Creates",
"a",
"JCloud",
"context",
"for",
"Swift",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-openstack/src/main/java/net/roboconf/target/openstack/internal/OpenstackIaasHandler.java#L374-L382 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/NamespaceDto.java | NamespaceDto.transformToDto | public static NamespaceDto transformToDto(Namespace namespace) {
"""
Converts a namespace entity to a DTO.
@param namespace The entity to convert.
@return The namespace DTO.
@throws WebApplicationException If an error occurs.
"""
if (namespace == null) {
throw new WebApplicat... | java | public static NamespaceDto transformToDto(Namespace namespace) {
if (namespace == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
NamespaceDto result = createDtoObject(NamespaceDto.class, namespace);... | [
"public",
"static",
"NamespaceDto",
"transformToDto",
"(",
"Namespace",
"namespace",
")",
"{",
"if",
"(",
"namespace",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object cannot be converted to Dto object.\"",
",",
"Status",
"."... | Converts a namespace entity to a DTO.
@param namespace The entity to convert.
@return The namespace DTO.
@throws WebApplicationException If an error occurs. | [
"Converts",
"a",
"namespace",
"entity",
"to",
"a",
"DTO",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/NamespaceDto.java#L74-L85 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/DefaultEntityManager.java | DefaultEntityManager.putDefaultCallback | private void putDefaultCallback(CallbackType callbackType, CallbackMetadata metadata) {
"""
Puts/adds the given callback type and its metadata to the list of default listeners.
@param callbackType
the event type
@param metadata
the callback metadata
"""
List<CallbackMetadata> metadataList = globalCal... | java | private void putDefaultCallback(CallbackType callbackType, CallbackMetadata metadata) {
List<CallbackMetadata> metadataList = globalCallbacks.get(callbackType);
if (metadataList == null) {
metadataList = new ArrayList<>();
globalCallbacks.put(callbackType, metadataList);
}
metadataList.add(m... | [
"private",
"void",
"putDefaultCallback",
"(",
"CallbackType",
"callbackType",
",",
"CallbackMetadata",
"metadata",
")",
"{",
"List",
"<",
"CallbackMetadata",
">",
"metadataList",
"=",
"globalCallbacks",
".",
"get",
"(",
"callbackType",
")",
";",
"if",
"(",
"metada... | Puts/adds the given callback type and its metadata to the list of default listeners.
@param callbackType
the event type
@param metadata
the callback metadata | [
"Puts",
"/",
"adds",
"the",
"given",
"callback",
"type",
"and",
"its",
"metadata",
"to",
"the",
"list",
"of",
"default",
"listeners",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/DefaultEntityManager.java#L423-L430 |
mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyContentItemMoved | public final void notifyContentItemMoved(int fromPosition, int toPosition) {
"""
Notifies that an existing content item is moved to another position.
@param fromPosition the original position.
@param toPosition the new position.
"""
if (fromPosition < 0 || toPosition < 0 || fromPosition >= conten... | java | public final void notifyContentItemMoved(int fromPosition, int toPosition) {
if (fromPosition < 0 || toPosition < 0 || fromPosition >= contentItemCount || toPosition >= contentItemCount) {
throw new IndexOutOfBoundsException("The given fromPosition " + fromPosition + " or toPosition "
... | [
"public",
"final",
"void",
"notifyContentItemMoved",
"(",
"int",
"fromPosition",
",",
"int",
"toPosition",
")",
"{",
"if",
"(",
"fromPosition",
"<",
"0",
"||",
"toPosition",
"<",
"0",
"||",
"fromPosition",
">=",
"contentItemCount",
"||",
"toPosition",
">=",
"c... | Notifies that an existing content item is moved to another position.
@param fromPosition the original position.
@param toPosition the new position. | [
"Notifies",
"that",
"an",
"existing",
"content",
"item",
"is",
"moved",
"to",
"another",
"position",
"."
] | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L269-L275 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/TermOfUsePanel.java | TermOfUsePanel.newContractPanel | protected Component newContractPanel(final String id,
final IModel<HeaderContentListModelBean> model) {
"""
Factory method for creating the new {@link Component} for the contract. This method is
invoked in the constructor from the derived classes and can be overridden so users can
provide their own version of ... | java | protected Component newContractPanel(final String id,
final IModel<HeaderContentListModelBean> model)
{
return new ContractPanel(id, Model.of(model.getObject()));
} | [
"protected",
"Component",
"newContractPanel",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"HeaderContentListModelBean",
">",
"model",
")",
"{",
"return",
"new",
"ContractPanel",
"(",
"id",
",",
"Model",
".",
"of",
"(",
"model",
".",
"getObject",... | Factory method for creating the new {@link Component} for the contract. This method is
invoked in the constructor from the derived classes and can be overridden so users can
provide their own version of a new {@link Component} for the contract.
@param id
the id
@param model
the model
@return the new {@link Component} ... | [
"Factory",
"method",
"for",
"creating",
"the",
"new",
"{",
"@link",
"Component",
"}",
"for",
"the",
"contract",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/TermOfUsePanel.java#L191-L195 |
wellner/jcarafe | jcarafe-core/src/main/java/org/mitre/jcarafe/jarafe/JarafeMETrainer.java | JarafeMETrainer.addTrainingInstance | public void addTrainingInstance(String label, List<String> features) {
"""
/*
@param label - A string value that is the "gold standard" label for this training instance
@param features - A list of strings that correspond to the names of the features present for this training instance
"""
maxent.addInsta... | java | public void addTrainingInstance(String label, List<String> features) {
maxent.addInstance(label,features);
} | [
"public",
"void",
"addTrainingInstance",
"(",
"String",
"label",
",",
"List",
"<",
"String",
">",
"features",
")",
"{",
"maxent",
".",
"addInstance",
"(",
"label",
",",
"features",
")",
";",
"}"
] | /*
@param label - A string value that is the "gold standard" label for this training instance
@param features - A list of strings that correspond to the names of the features present for this training instance | [
"/",
"*"
] | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/org/mitre/jcarafe/jarafe/JarafeMETrainer.java#L28-L30 |
nlalevee/jsourcemap | jsourcemap/src/java/org/hibnet/jsourcemap/IndexedSourceMapConsumer.java | IndexedSourceMapConsumer._parseMappings | @Override
void _parseMappings(String aStr, String aSourceRoot) {
"""
Parse the mappings in a string in to a data structure which we can easily query (the ordered arrays in the `this.__generatedMappings` and
`this.__originalMappings` properties).
"""
this.__generatedMappings = new ArrayList<>();
... | java | @Override
void _parseMappings(String aStr, String aSourceRoot) {
this.__generatedMappings = new ArrayList<>();
this.__originalMappings = new ArrayList<>();
for (int i = 0; i < this._sections.size(); i++) {
ParsedSection section = this._sections.get(i);
List<ParsedMapp... | [
"@",
"Override",
"void",
"_parseMappings",
"(",
"String",
"aStr",
",",
"String",
"aSourceRoot",
")",
"{",
"this",
".",
"__generatedMappings",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"this",
".",
"__originalMappings",
"=",
"new",
"ArrayList",
"<>",
"(",... | Parse the mappings in a string in to a data structure which we can easily query (the ordered arrays in the `this.__generatedMappings` and
`this.__originalMappings` properties). | [
"Parse",
"the",
"mappings",
"in",
"a",
"string",
"in",
"to",
"a",
"data",
"structure",
"which",
"we",
"can",
"easily",
"query",
"(",
"the",
"ordered",
"arrays",
"in",
"the",
"this",
".",
"__generatedMappings",
"and",
"this",
".",
"__originalMappings",
"prope... | train | https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/IndexedSourceMapConsumer.java#L250-L289 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationManager.java | DestinationManager.addPseudoDestination | public final void addPseudoDestination(SIBUuid12 destinationUuid, BaseDestinationHandler handler) {
"""
Link a pseudo destination ID to a real destination handler. This is used to link destination
IDs created for remote durable pub/sub to the appropriate Pub/Sub destination handler which
hosts a localization of ... | java | public final void addPseudoDestination(SIBUuid12 destinationUuid, BaseDestinationHandler handler)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addPseudoDestination", new Object[] { destinationUuid, handler });
destinationIndex.addPseudoUuid(handler,... | [
"public",
"final",
"void",
"addPseudoDestination",
"(",
"SIBUuid12",
"destinationUuid",
",",
"BaseDestinationHandler",
"handler",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr"... | Link a pseudo destination ID to a real destination handler. This is used to link destination
IDs created for remote durable pub/sub to the appropriate Pub/Sub destination handler which
hosts a localization of some durable subscription.
@param destinationUuid The pseudo destination ID to link.
@param handler The pub/su... | [
"Link",
"a",
"pseudo",
"destination",
"ID",
"to",
"a",
"real",
"destination",
"handler",
".",
"This",
"is",
"used",
"to",
"link",
"destination",
"IDs",
"created",
"for",
"remote",
"durable",
"pub",
"/",
"sub",
"to",
"the",
"appropriate",
"Pub",
"/",
"Sub",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationManager.java#L1638-L1645 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java | DomainsInner.createOrUpdateOwnershipIdentifierAsync | public Observable<DomainOwnershipIdentifierInner> createOrUpdateOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier) {
"""
Creates an ownership identifier for a domain or updates identifier details for an existing identifer.
C... | java | public Observable<DomainOwnershipIdentifierInner> createOrUpdateOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier) {
return createOrUpdateOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name, dom... | [
"public",
"Observable",
"<",
"DomainOwnershipIdentifierInner",
">",
"createOrUpdateOwnershipIdentifierAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"domainName",
",",
"String",
"name",
",",
"DomainOwnershipIdentifierInner",
"domainOwnershipIdentifier",
")",
"{",
... | Creates an ownership identifier for a domain or updates identifier details for an existing identifer.
Creates an ownership identifier for a domain or updates identifier details for an existing identifer.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param domainName Name of domain... | [
"Creates",
"an",
"ownership",
"identifier",
"for",
"a",
"domain",
"or",
"updates",
"identifier",
"details",
"for",
"an",
"existing",
"identifer",
".",
"Creates",
"an",
"ownership",
"identifier",
"for",
"a",
"domain",
"or",
"updates",
"identifier",
"details",
"fo... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java#L1552-L1559 |
twotoasters/JazzyListView | library-recyclerview/src/main/java/com/twotoasters/jazzylistview/recyclerview/JazzyRecyclerViewScrollListener.java | JazzyRecyclerViewScrollListener.notifyAdditionalOnScrolledListener | private void notifyAdditionalOnScrolledListener(RecyclerView recyclerView, int dx, int dy) {
"""
Notifies the OnScrollListener of an onScroll event, since JazzyListView is the primary listener for onScroll events.
"""
if (mAdditionalOnScrollListener != null) {
mAdditionalOnScrollListener.on... | java | private void notifyAdditionalOnScrolledListener(RecyclerView recyclerView, int dx, int dy) {
if (mAdditionalOnScrollListener != null) {
mAdditionalOnScrollListener.onScrolled(recyclerView, dx, dy);
}
} | [
"private",
"void",
"notifyAdditionalOnScrolledListener",
"(",
"RecyclerView",
"recyclerView",
",",
"int",
"dx",
",",
"int",
"dy",
")",
"{",
"if",
"(",
"mAdditionalOnScrollListener",
"!=",
"null",
")",
"{",
"mAdditionalOnScrollListener",
".",
"onScrolled",
"(",
"recy... | Notifies the OnScrollListener of an onScroll event, since JazzyListView is the primary listener for onScroll events. | [
"Notifies",
"the",
"OnScrollListener",
"of",
"an",
"onScroll",
"event",
"since",
"JazzyListView",
"is",
"the",
"primary",
"listener",
"for",
"onScroll",
"events",
"."
] | train | https://github.com/twotoasters/JazzyListView/blob/4a69239f90374a71e7d4073448ca049bd074f7fe/library-recyclerview/src/main/java/com/twotoasters/jazzylistview/recyclerview/JazzyRecyclerViewScrollListener.java#L107-L111 |
SeaCloudsEU/SeaCloudsPlatform | sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/TemplateRestEntity.java | TemplateRestEntity.getTemplates | @GET
public List<ITemplate> getTemplates(@QueryParam("providerId") String providerId, @QueryParam("serviceIds") String serviceIds) {
"""
Gets a the list of available templates from where we can get metrics,
host information, etc.
<pre>
GET /templates
Request:
GET /templates{?serviceId} HTTP/1.1
Res... | java | @GET
public List<ITemplate> getTemplates(@QueryParam("providerId") String providerId, @QueryParam("serviceIds") String serviceIds) {
logger.debug("StartOf getTemplates - REQUEST for /templates");
TemplateHelperE templateRestHelper = getTemplateHelper();
// we remove the blank spaces just in... | [
"@",
"GET",
"public",
"List",
"<",
"ITemplate",
">",
"getTemplates",
"(",
"@",
"QueryParam",
"(",
"\"providerId\"",
")",
"String",
"providerId",
",",
"@",
"QueryParam",
"(",
"\"serviceIds\"",
")",
"String",
"serviceIds",
")",
"{",
"logger",
".",
"debug",
"("... | Gets a the list of available templates from where we can get metrics,
host information, etc.
<pre>
GET /templates
Request:
GET /templates{?serviceId} HTTP/1.1
Response:
HTTP/1.1 200 Ok
{@code
<?xml version="1.0" encoding="UTF-8"?>
<collection href="/templates">
<items offset="0" total="1">
<wsag:Template>...</wsag:... | [
"Gets",
"a",
"the",
"list",
"of",
"available",
"templates",
"from",
"where",
"we",
"can",
"get",
"metrics",
"host",
"information",
"etc",
"."
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/TemplateRestEntity.java#L155-L174 |
Crab2died/Excel4J | src/main/java/com/github/crab2died/ExcelUtils.java | ExcelUtils.noTemplateSheet2Excel | public void noTemplateSheet2Excel(List<NoTemplateSheetWrapper> sheets, OutputStream os)
throws Excel4JException, IOException {
"""
无模板、基于注解、多sheet数据
@param sheets 待导出sheet数据
@param os 生成的Excel输出文件流
@throws Excel4JException 异常
@throws IOException 异常
"""
try (Workbook workbook... | java | public void noTemplateSheet2Excel(List<NoTemplateSheetWrapper> sheets, OutputStream os)
throws Excel4JException, IOException {
try (Workbook workbook = exportExcelNoTemplateHandler(sheets, true)) {
workbook.write(os);
}
} | [
"public",
"void",
"noTemplateSheet2Excel",
"(",
"List",
"<",
"NoTemplateSheetWrapper",
">",
"sheets",
",",
"OutputStream",
"os",
")",
"throws",
"Excel4JException",
",",
"IOException",
"{",
"try",
"(",
"Workbook",
"workbook",
"=",
"exportExcelNoTemplateHandler",
"(",
... | 无模板、基于注解、多sheet数据
@param sheets 待导出sheet数据
@param os 生成的Excel输出文件流
@throws Excel4JException 异常
@throws IOException 异常 | [
"无模板、基于注解、多sheet数据"
] | train | https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/ExcelUtils.java#L1163-L1169 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.deleteCertificateAsync | public ServiceFuture<DeletedCertificateBundle> deleteCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback<DeletedCertificateBundle> serviceCallback) {
"""
Deletes a certificate from a specified key vault.
Deletes all versions of a certificate object along with its associated policy.... | java | public ServiceFuture<DeletedCertificateBundle> deleteCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback<DeletedCertificateBundle> serviceCallback) {
return ServiceFuture.fromResponse(deleteCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallback);
... | [
"public",
"ServiceFuture",
"<",
"DeletedCertificateBundle",
">",
"deleteCertificateAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
",",
"final",
"ServiceCallback",
"<",
"DeletedCertificateBundle",
">",
"serviceCallback",
")",
"{",
"return",
"Servi... | Deletes a certificate from a specified key vault.
Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission.
@param vaultBaseUrl The vault name, for e... | [
"Deletes",
"a",
"certificate",
"from",
"a",
"specified",
"key",
"vault",
".",
"Deletes",
"all",
"versions",
"of",
"a",
"certificate",
"object",
"along",
"with",
"its",
"associated",
"policy",
".",
"Delete",
"certificate",
"cannot",
"be",
"used",
"to",
"remove"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L5339-L5341 |
VoltDB/voltdb | src/frontend/org/voltdb/DefaultProcedureManager.java | DefaultProcedureManager.generateCrudReplicatedUpdate | private static String generateCrudReplicatedUpdate(Table table, Constraint pkey) {
"""
Create a statement like:
"update <table> set {<each-column = ?>...} where {<pkey-column = ?>...}
for a replicated table.
"""
StringBuilder sb = new StringBuilder();
sb.append("UPDATE " + table.getTypeName()... | java | private static String generateCrudReplicatedUpdate(Table table, Constraint pkey)
{
StringBuilder sb = new StringBuilder();
sb.append("UPDATE " + table.getTypeName() + " SET ");
generateCrudExpressionColumns(table, sb);
generateCrudPKeyWhereClause(null, pkey, sb);
sb.append('... | [
"private",
"static",
"String",
"generateCrudReplicatedUpdate",
"(",
"Table",
"table",
",",
"Constraint",
"pkey",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"UPDATE \"",
"+",
"table",
".",
"getTypeNa... | Create a statement like:
"update <table> set {<each-column = ?>...} where {<pkey-column = ?>...}
for a replicated table. | [
"Create",
"a",
"statement",
"like",
":",
"update",
"<table",
">",
"set",
"{",
"<each",
"-",
"column",
"=",
"?",
">",
"...",
"}",
"where",
"{",
"<pkey",
"-",
"column",
"=",
"?",
">",
"...",
"}",
"for",
"a",
"replicated",
"table",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/DefaultProcedureManager.java#L415-L425 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java | StaticTypeCheckingVisitor.findCurrentInstanceOfClass | protected ClassNode findCurrentInstanceOfClass(final Expression expr, final ClassNode type) {
"""
A helper method which determines which receiver class should be used in error messages when a field or attribute
is not found. The returned type class depends on whether we have temporary type information available (... | java | protected ClassNode findCurrentInstanceOfClass(final Expression expr, final ClassNode type) {
if (!typeCheckingContext.temporaryIfBranchTypeInformation.empty()) {
List<ClassNode> nodes = getTemporaryTypesForExpression(expr);
if (nodes != null && nodes.size() == 1) return nodes.get(0);
... | [
"protected",
"ClassNode",
"findCurrentInstanceOfClass",
"(",
"final",
"Expression",
"expr",
",",
"final",
"ClassNode",
"type",
")",
"{",
"if",
"(",
"!",
"typeCheckingContext",
".",
"temporaryIfBranchTypeInformation",
".",
"empty",
"(",
")",
")",
"{",
"List",
"<",
... | A helper method which determines which receiver class should be used in error messages when a field or attribute
is not found. The returned type class depends on whether we have temporary type information available (due to
instanceof checks) and whether there is a single candidate in that case.
@param expr the express... | [
"A",
"helper",
"method",
"which",
"determines",
"which",
"receiver",
"class",
"should",
"be",
"used",
"in",
"error",
"messages",
"when",
"a",
"field",
"or",
"attribute",
"is",
"not",
"found",
".",
"The",
"returned",
"type",
"class",
"depends",
"on",
"whether... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java#L1507-L1513 |
oehf/ipf-oht-atna | nodeauth/src/main/java/org/openhealthtools/ihe/atna/nodeauth/SecurityDomain.java | SecurityDomain.fixKeyManagers | private void fixKeyManagers() {
"""
If a keystore alias is defined, then override the key manager assigned
to with an alias-sensitive wrapper that selects the proper key from your
assigned key alias.
"""
// If the key manager factory is null, do not continue
if (null == keyManagerFactory || n... | java | private void fixKeyManagers() {
// If the key manager factory is null, do not continue
if (null == keyManagerFactory || null == keyManagerFactory.getKeyManagers()) {
return;
}
KeyManager[] defaultKeyManagers = keyManagerFactory.getKeyManagers();
KeyManager[] newKeyMan... | [
"private",
"void",
"fixKeyManagers",
"(",
")",
"{",
"// If the key manager factory is null, do not continue",
"if",
"(",
"null",
"==",
"keyManagerFactory",
"||",
"null",
"==",
"keyManagerFactory",
".",
"getKeyManagers",
"(",
")",
")",
"{",
"return",
";",
"}",
"KeyMa... | If a keystore alias is defined, then override the key manager assigned
to with an alias-sensitive wrapper that selects the proper key from your
assigned key alias. | [
"If",
"a",
"keystore",
"alias",
"is",
"defined",
"then",
"override",
"the",
"key",
"manager",
"assigned",
"to",
"with",
"an",
"alias",
"-",
"sensitive",
"wrapper",
"that",
"selects",
"the",
"proper",
"key",
"from",
"your",
"assigned",
"key",
"alias",
"."
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/nodeauth/src/main/java/org/openhealthtools/ihe/atna/nodeauth/SecurityDomain.java#L438-L458 |
primefaces/primefaces | src/main/java/org/primefaces/expression/SearchExpressionFacade.java | SearchExpressionFacade.validateExpressions | protected static void validateExpressions(FacesContext context, UIComponent source, String expressions, String[] splittedExpressions) {
"""
Validates the given search expressions. We only validate it, for performance reasons, if the current {@link ProjectStage} is
{@link ProjectStage#Development}.
@param conte... | java | protected static void validateExpressions(FacesContext context, UIComponent source, String expressions, String[] splittedExpressions) {
if (context.isProjectStage(ProjectStage.Development)) {
if (splittedExpressions.length > 1) {
if (expressions.contains(SearchExpressionConstants.NO... | [
"protected",
"static",
"void",
"validateExpressions",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"source",
",",
"String",
"expressions",
",",
"String",
"[",
"]",
"splittedExpressions",
")",
"{",
"if",
"(",
"context",
".",
"isProjectStage",
"(",
"ProjectSt... | Validates the given search expressions. We only validate it, for performance reasons, if the current {@link ProjectStage} is
{@link ProjectStage#Development}.
@param context The {@link FacesContext}.
@param source The source component. E.g. a button.
@param expressions The search expression.
@param splittedExpressions... | [
"Validates",
"the",
"given",
"search",
"expressions",
".",
"We",
"only",
"validate",
"it",
"for",
"performance",
"reasons",
"if",
"the",
"current",
"{",
"@link",
"ProjectStage",
"}",
"is",
"{",
"@link",
"ProjectStage#Development",
"}",
"."
] | train | https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/expression/SearchExpressionFacade.java#L786-L799 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updateSubList | public OperationStatus updateSubList(UUID appId, String versionId, UUID clEntityId, int subListId, WordListBaseUpdateObject wordListBaseUpdateObject) {
"""
Updates one of the closed list's sublists.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list entity extr... | java | public OperationStatus updateSubList(UUID appId, String versionId, UUID clEntityId, int subListId, WordListBaseUpdateObject wordListBaseUpdateObject) {
return updateSubListWithServiceResponseAsync(appId, versionId, clEntityId, subListId, wordListBaseUpdateObject).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"updateSubList",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"clEntityId",
",",
"int",
"subListId",
",",
"WordListBaseUpdateObject",
"wordListBaseUpdateObject",
")",
"{",
"return",
"updateSubListWithServiceResponseAsync",
"(... | Updates one of the closed list's sublists.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list entity extractor ID.
@param subListId The sublist ID.
@param wordListBaseUpdateObject A sublist update object containing the new canonical form and the list of words.
@throws I... | [
"Updates",
"one",
"of",
"the",
"closed",
"list",
"s",
"sublists",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L4968-L4970 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/inputs/InputType.java | InputType.convolutional3D | @Deprecated
public static InputType convolutional3D(long depth, long height, long width, long channels) {
"""
Input type for 3D convolutional (CNN3D) data in NDHWC format, that is 5d with shape
[miniBatchSize, depth, height, width, channels].
@param height height of the input
@param width Width of t... | java | @Deprecated
public static InputType convolutional3D(long depth, long height, long width, long channels) {
return convolutional3D(Convolution3D.DataFormat.NDHWC, depth, height, width, channels);
} | [
"@",
"Deprecated",
"public",
"static",
"InputType",
"convolutional3D",
"(",
"long",
"depth",
",",
"long",
"height",
",",
"long",
"width",
",",
"long",
"channels",
")",
"{",
"return",
"convolutional3D",
"(",
"Convolution3D",
".",
"DataFormat",
".",
"NDHWC",
","... | Input type for 3D convolutional (CNN3D) data in NDHWC format, that is 5d with shape
[miniBatchSize, depth, height, width, channels].
@param height height of the input
@param width Width of the input
@param depth Depth of the input
@param channels Number of channels of the input
@return InputTypeConvolutional3D... | [
"Input",
"type",
"for",
"3D",
"convolutional",
"(",
"CNN3D",
")",
"data",
"in",
"NDHWC",
"format",
"that",
"is",
"5d",
"with",
"shape",
"[",
"miniBatchSize",
"depth",
"height",
"width",
"channels",
"]",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/inputs/InputType.java#L142-L145 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Image.java | Image.getScaledCopy | public Image getScaledCopy(int width, int height) {
"""
<p>Get a scaled copy of this image.</p>
<p>This will only scale the <strong>canvas</strong>, it will not
scale the underlying texture data. For a downscale, the texture will
get clipped. For an upscale, the texture will be repetated on both axis</p>
<... | java | public Image getScaledCopy(int width, int height) {
init();
Image image = copy();
image.width = width;
image.height = height;
image.centerX = width / 2;
image.centerY = height / 2;
image.textureOffsetX *= (width/(float) this.width);
image.textureOffsetY *= (height/(float) this.height);
im... | [
"public",
"Image",
"getScaledCopy",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"init",
"(",
")",
";",
"Image",
"image",
"=",
"copy",
"(",
")",
";",
"image",
".",
"width",
"=",
"width",
";",
"image",
".",
"height",
"=",
"height",
";",
"ima... | <p>Get a scaled copy of this image.</p>
<p>This will only scale the <strong>canvas</strong>, it will not
scale the underlying texture data. For a downscale, the texture will
get clipped. For an upscale, the texture will be repetated on both axis</p>
<p>Also note that the underlying texture might be bigger than the in... | [
"<p",
">",
"Get",
"a",
"scaled",
"copy",
"of",
"this",
"image",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Image.java#L1236-L1250 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/tree/analysis/Frame.java | Frame.setLocal | public void setLocal(final int i, final V value)
throws IndexOutOfBoundsException {
"""
Sets the value of the given local variable.
@param i
a local variable index.
@param value
the new value of this local variable.
@throws IndexOutOfBoundsException
if the variable does not exist.
"""
... | java | public void setLocal(final int i, final V value)
throws IndexOutOfBoundsException {
if (i >= locals) {
throw new IndexOutOfBoundsException(
"Trying to access an inexistant local variable " + i);
}
values[i] = value;
} | [
"public",
"void",
"setLocal",
"(",
"final",
"int",
"i",
",",
"final",
"V",
"value",
")",
"throws",
"IndexOutOfBoundsException",
"{",
"if",
"(",
"i",
">=",
"locals",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"Trying to access an inexistant local... | Sets the value of the given local variable.
@param i
a local variable index.
@param value
the new value of this local variable.
@throws IndexOutOfBoundsException
if the variable does not exist. | [
"Sets",
"the",
"value",
"of",
"the",
"given",
"local",
"variable",
"."
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/tree/analysis/Frame.java#L173-L180 |
ACRA/acra | acra-core/src/main/java/org/acra/file/CrashReportFileNameParser.java | CrashReportFileNameParser.getTimestamp | @NonNull
public Calendar getTimestamp(@NonNull String reportFileName) {
"""
Gets the timestamp of a report from its name
@param reportFileName Name of the report to get the timestamp from.
@return timestamp of the report
"""
final String timestamp = reportFileName.replace(ACRAConstants.REPORTFI... | java | @NonNull
public Calendar getTimestamp(@NonNull String reportFileName) {
final String timestamp = reportFileName.replace(ACRAConstants.REPORTFILE_EXTENSION, "").replace(ACRAConstants.SILENT_SUFFIX, "");
final Calendar calendar = Calendar.getInstance();
try {
calendar.setTime(new S... | [
"@",
"NonNull",
"public",
"Calendar",
"getTimestamp",
"(",
"@",
"NonNull",
"String",
"reportFileName",
")",
"{",
"final",
"String",
"timestamp",
"=",
"reportFileName",
".",
"replace",
"(",
"ACRAConstants",
".",
"REPORTFILE_EXTENSION",
",",
"\"\"",
")",
".",
"rep... | Gets the timestamp of a report from its name
@param reportFileName Name of the report to get the timestamp from.
@return timestamp of the report | [
"Gets",
"the",
"timestamp",
"of",
"a",
"report",
"from",
"its",
"name"
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-core/src/main/java/org/acra/file/CrashReportFileNameParser.java#L71-L80 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernel.java | FactoryKernel.random2D_I32 | public static Kernel2D_S32 random2D_I32(int width , int offset, int min, int max, Random rand) {
"""
Creates a random 2D kernel drawn from a uniform distribution.
@param width Kernel's width.
@param offset Offset for element zero in the kernel
@param min minimum value.
@param max maximum value.
@param rand ... | java | public static Kernel2D_S32 random2D_I32(int width , int offset, int min, int max, Random rand) {
Kernel2D_S32 ret = new Kernel2D_S32(width,offset);
int range = max - min;
for (int i = 0; i < ret.data.length; i++) {
ret.data[i] = rand.nextInt(range) + min;
}
return ret;
} | [
"public",
"static",
"Kernel2D_S32",
"random2D_I32",
"(",
"int",
"width",
",",
"int",
"offset",
",",
"int",
"min",
",",
"int",
"max",
",",
"Random",
"rand",
")",
"{",
"Kernel2D_S32",
"ret",
"=",
"new",
"Kernel2D_S32",
"(",
"width",
",",
"offset",
")",
";"... | Creates a random 2D kernel drawn from a uniform distribution.
@param width Kernel's width.
@param offset Offset for element zero in the kernel
@param min minimum value.
@param max maximum value.
@param rand Random number generator.
@return Randomized kernel. | [
"Creates",
"a",
"random",
"2D",
"kernel",
"drawn",
"from",
"a",
"uniform",
"distribution",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernel.java#L277-L286 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEManager.java | CmsADEManager.findEntryPoint | public String findEntryPoint(CmsObject cms, String openPath) {
"""
Finds the entry point to a sitemap.<p>
@param cms the CMS context
@param openPath the resource path to find the sitemap to
@return the sitemap entry point
"""
CmsADEConfigData configData = lookupConfiguration(cms, openPath);
... | java | public String findEntryPoint(CmsObject cms, String openPath) {
CmsADEConfigData configData = lookupConfiguration(cms, openPath);
String result = configData.getBasePath();
if (result == null) {
return cms.getRequestContext().addSiteRoot("/");
}
return result;
} | [
"public",
"String",
"findEntryPoint",
"(",
"CmsObject",
"cms",
",",
"String",
"openPath",
")",
"{",
"CmsADEConfigData",
"configData",
"=",
"lookupConfiguration",
"(",
"cms",
",",
"openPath",
")",
";",
"String",
"result",
"=",
"configData",
".",
"getBasePath",
"(... | Finds the entry point to a sitemap.<p>
@param cms the CMS context
@param openPath the resource path to find the sitemap to
@return the sitemap entry point | [
"Finds",
"the",
"entry",
"point",
"to",
"a",
"sitemap",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEManager.java#L296-L304 |
kiegroup/drools | drools-core/src/main/java/org/drools/core/common/TruthMaintenanceSystem.java | TruthMaintenanceSystem.enableTMS | private void enableTMS(Object object, ObjectTypeConf conf) {
"""
TMS will be automatically enabled when the first logical insert happens.
We will take all the already asserted objects of the same type and initialize
the equality map.
@param object the logically inserted object.
@param conf the type's confi... | java | private void enableTMS(Object object, ObjectTypeConf conf) {
Iterator<InternalFactHandle> it = ((ClassAwareObjectStore) ep.getObjectStore()).iterateFactHandles(getActualClass(object));
while (it.hasNext()) {
InternalFactHandle handle = it.next();
if (handle != null && handle.get... | [
"private",
"void",
"enableTMS",
"(",
"Object",
"object",
",",
"ObjectTypeConf",
"conf",
")",
"{",
"Iterator",
"<",
"InternalFactHandle",
">",
"it",
"=",
"(",
"(",
"ClassAwareObjectStore",
")",
"ep",
".",
"getObjectStore",
"(",
")",
")",
".",
"iterateFactHandle... | TMS will be automatically enabled when the first logical insert happens.
We will take all the already asserted objects of the same type and initialize
the equality map.
@param object the logically inserted object.
@param conf the type's configuration. | [
"TMS",
"will",
"be",
"automatically",
"enabled",
"when",
"the",
"first",
"logical",
"insert",
"happens",
"."
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/common/TruthMaintenanceSystem.java#L262-L277 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java | ReflectUtil.getMethod | public static Method getMethod(Class<?> clazz, String methodName, Class<?>... paramTypes) throws SecurityException {
"""
查找指定方法 如果找不到对应的方法则返回<code>null</code>
<p>
此方法为精准获取方法名,即方法名和参数数量和类型必须一致,否则返回<code>null</code>。
</p>
@param clazz 类,如果为{@code null}返回{@code null}
@param methodName 方法名,如果为空字符串返回{@code nul... | java | public static Method getMethod(Class<?> clazz, String methodName, Class<?>... paramTypes) throws SecurityException {
return getMethod(clazz, false, methodName, paramTypes);
} | [
"public",
"static",
"Method",
"getMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"...",
"paramTypes",
")",
"throws",
"SecurityException",
"{",
"return",
"getMethod",
"(",
"clazz",
",",
"false",
",",... | 查找指定方法 如果找不到对应的方法则返回<code>null</code>
<p>
此方法为精准获取方法名,即方法名和参数数量和类型必须一致,否则返回<code>null</code>。
</p>
@param clazz 类,如果为{@code null}返回{@code null}
@param methodName 方法名,如果为空字符串返回{@code null}
@param paramTypes 参数类型,指定参数类型如果是方法的子类也算
@return 方法
@throws SecurityException 无权访问抛出异常 | [
"查找指定方法",
"如果找不到对应的方法则返回<code",
">",
"null<",
"/",
"code",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L431-L433 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spy1st | public static <T> Predicate<T> spy1st(Predicate<T> predicate, Box<T> param) {
"""
Proxies a predicate spying for parameter.
@param <T> the predicate parameter type
@param predicate the predicate that will be spied
@param param a box that will be containing spied parameter
@return the proxied predicate
""... | java | public static <T> Predicate<T> spy1st(Predicate<T> predicate, Box<T> param) {
return spy(predicate, Box.<Boolean>empty(), param);
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"spy1st",
"(",
"Predicate",
"<",
"T",
">",
"predicate",
",",
"Box",
"<",
"T",
">",
"param",
")",
"{",
"return",
"spy",
"(",
"predicate",
",",
"Box",
".",
"<",
"Boolean",
">",
"empty",
... | Proxies a predicate spying for parameter.
@param <T> the predicate parameter type
@param predicate the predicate that will be spied
@param param a box that will be containing spied parameter
@return the proxied predicate | [
"Proxies",
"a",
"predicate",
"spying",
"for",
"parameter",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L506-L508 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierDatabase.java | TypeQualifierDatabase.setReturnValue | public void setReturnValue(MethodDescriptor methodDesc, TypeQualifierValue<?> tqv, TypeQualifierAnnotation tqa) {
"""
Set a TypeQualifierAnnotation on a method return value.
@param methodDesc
the method
@param tqv
the type qualifier
@param tqa
the type qualifier annotation
"""
Map<TypeQualifier... | java | public void setReturnValue(MethodDescriptor methodDesc, TypeQualifierValue<?> tqv, TypeQualifierAnnotation tqa) {
Map<TypeQualifierValue<?>, TypeQualifierAnnotation> map = returnValueMap.get(methodDesc);
if (map == null) {
map = new HashMap<>();
returnValueMap.put(methodDesc, map... | [
"public",
"void",
"setReturnValue",
"(",
"MethodDescriptor",
"methodDesc",
",",
"TypeQualifierValue",
"<",
"?",
">",
"tqv",
",",
"TypeQualifierAnnotation",
"tqa",
")",
"{",
"Map",
"<",
"TypeQualifierValue",
"<",
"?",
">",
",",
"TypeQualifierAnnotation",
">",
"map"... | Set a TypeQualifierAnnotation on a method return value.
@param methodDesc
the method
@param tqv
the type qualifier
@param tqa
the type qualifier annotation | [
"Set",
"a",
"TypeQualifierAnnotation",
"on",
"a",
"method",
"return",
"value",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierDatabase.java#L65-L76 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java | NodeIndexer.addReferenceValue | protected void addReferenceValue(Document doc, String fieldName, Object internalValue) {
"""
Adds the reference value to the document as the named field. The value's
string representation is added as the reference data. Additionally the
reference data is stored in the index.
@param doc The document ... | java | protected void addReferenceValue(Document doc, String fieldName, Object internalValue)
{
String uuid = internalValue.toString();
doc.add(createFieldWithoutNorms(fieldName, uuid, PropertyType.REFERENCE));
doc.add(new Field(FieldNames.PROPERTIES, FieldNames.createNamedValue(fieldName, uuid), Field.St... | [
"protected",
"void",
"addReferenceValue",
"(",
"Document",
"doc",
",",
"String",
"fieldName",
",",
"Object",
"internalValue",
")",
"{",
"String",
"uuid",
"=",
"internalValue",
".",
"toString",
"(",
")",
";",
"doc",
".",
"add",
"(",
"createFieldWithoutNorms",
"... | Adds the reference value to the document as the named field. The value's
string representation is added as the reference data. Additionally the
reference data is stored in the index.
@param doc The document to which to add the field
@param fieldName The name of the field to add
@param internalValue The v... | [
"Adds",
"the",
"reference",
"value",
"to",
"the",
"document",
"as",
"the",
"named",
"field",
".",
"The",
"value",
"s",
"string",
"representation",
"is",
"added",
"as",
"the",
"reference",
"data",
".",
"Additionally",
"the",
"reference",
"data",
"is",
"stored... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java#L790-L796 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.objIntConsumer | public static <T> ObjIntConsumer<T> objIntConsumer(CheckedObjIntConsumer<T> consumer, Consumer<Throwable> handler) {
"""
Wrap a {@link CheckedObjIntConsumer} in a {@link ObjIntConsumer} with a custom handler for checked exceptions.
"""
return (t, u) -> {
try {
consumer.accep... | java | public static <T> ObjIntConsumer<T> objIntConsumer(CheckedObjIntConsumer<T> consumer, Consumer<Throwable> handler) {
return (t, u) -> {
try {
consumer.accept(t, u);
}
catch (Throwable e) {
handler.accept(e);
throw new IllegalSt... | [
"public",
"static",
"<",
"T",
">",
"ObjIntConsumer",
"<",
"T",
">",
"objIntConsumer",
"(",
"CheckedObjIntConsumer",
"<",
"T",
">",
"consumer",
",",
"Consumer",
"<",
"Throwable",
">",
"handler",
")",
"{",
"return",
"(",
"t",
",",
"u",
")",
"->",
"{",
"t... | Wrap a {@link CheckedObjIntConsumer} in a {@link ObjIntConsumer} with a custom handler for checked exceptions. | [
"Wrap",
"a",
"{"
] | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L253-L264 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/application/StateManager.java | StateManager.writeState | public void writeState(FacesContext context, Object state)
throws IOException {
"""
<p>Save the state represented in the specified state
<code>Object</code> instance, in an implementation dependent
manner.</p>
<p/>
<p>This method will typically simply delegate the actual
writing to the <code>writeSt... | java | public void writeState(FacesContext context, Object state)
throws IOException {
if (null != state && state.getClass().isArray() &&
state.getClass().getComponentType().equals(Object.class)) {
Object stateArray[] = (Object[]) state;
if (2 == stateArray.length) {
... | [
"public",
"void",
"writeState",
"(",
"FacesContext",
"context",
",",
"Object",
"state",
")",
"throws",
"IOException",
"{",
"if",
"(",
"null",
"!=",
"state",
"&&",
"state",
".",
"getClass",
"(",
")",
".",
"isArray",
"(",
")",
"&&",
"state",
".",
"getClass... | <p>Save the state represented in the specified state
<code>Object</code> instance, in an implementation dependent
manner.</p>
<p/>
<p>This method will typically simply delegate the actual
writing to the <code>writeState()</code> method of the
{@link ResponseStateManager} instance provided by the
{@link RenderKit} being... | [
"<p",
">",
"Save",
"the",
"state",
"represented",
"in",
"the",
"specified",
"state",
"<code",
">",
"Object<",
"/",
"code",
">",
"instance",
"in",
"an",
"implementation",
"dependent",
"manner",
".",
"<",
"/",
"p",
">",
"<p",
"/",
">",
"<p",
">",
"This",... | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/application/StateManager.java#L377-L388 |
aoindustries/ao-taglib | src/main/java/com/aoindustries/taglib/Scope.java | Scope.getScopeId | public static int getScopeId(String scope) throws JspTagException {
"""
Gets the PageContext scope value for the textual scope name.
@exception JspTagException if invalid scope
"""
if(scope==null || PAGE.equals(scope)) return PageContext.PAGE_SCOPE;
else if(REQUEST.equals(scope)) return PageContext.RE... | java | public static int getScopeId(String scope) throws JspTagException {
if(scope==null || PAGE.equals(scope)) return PageContext.PAGE_SCOPE;
else if(REQUEST.equals(scope)) return PageContext.REQUEST_SCOPE;
else if(SESSION.equals(scope)) return PageContext.SESSION_SCOPE;
else if(APPLICATION.equals(scope)) return Pag... | [
"public",
"static",
"int",
"getScopeId",
"(",
"String",
"scope",
")",
"throws",
"JspTagException",
"{",
"if",
"(",
"scope",
"==",
"null",
"||",
"PAGE",
".",
"equals",
"(",
"scope",
")",
")",
"return",
"PageContext",
".",
"PAGE_SCOPE",
";",
"else",
"if",
... | Gets the PageContext scope value for the textual scope name.
@exception JspTagException if invalid scope | [
"Gets",
"the",
"PageContext",
"scope",
"value",
"for",
"the",
"textual",
"scope",
"name",
"."
] | train | https://github.com/aoindustries/ao-taglib/blob/5670eba8485196bd42d31d3ff09a42deacb025f8/src/main/java/com/aoindustries/taglib/Scope.java#L51-L57 |
apiman/apiman | gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/api/auth/AuthFactory.java | AuthFactory.getAuth | public static AuthHandler getAuth(Vertx vertx, Router router, VertxEngineConfig apimanConfig) {
"""
Creates an auth handler of the type indicated in the `auth` section of config.
@param vertx the vert.x instance
@param router the vert.x web router to protect
@param apimanConfig the apiman config
@return an a... | java | public static AuthHandler getAuth(Vertx vertx, Router router, VertxEngineConfig apimanConfig) {
String type = apimanConfig.getAuth().getString("type", "NONE");
JsonObject authConfig = apimanConfig.getAuth().getJsonObject("config", new JsonObject());
switch(AuthType.getType(type)) {
case... | [
"public",
"static",
"AuthHandler",
"getAuth",
"(",
"Vertx",
"vertx",
",",
"Router",
"router",
",",
"VertxEngineConfig",
"apimanConfig",
")",
"{",
"String",
"type",
"=",
"apimanConfig",
".",
"getAuth",
"(",
")",
".",
"getString",
"(",
"\"type\"",
",",
"\"NONE\"... | Creates an auth handler of the type indicated in the `auth` section of config.
@param vertx the vert.x instance
@param router the vert.x web router to protect
@param apimanConfig the apiman config
@return an auth handler | [
"Creates",
"an",
"auth",
"handler",
"of",
"the",
"type",
"indicated",
"in",
"the",
"auth",
"section",
"of",
"config",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/api/auth/AuthFactory.java#L54-L68 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/utils/PermissionUtil.java | PermissionUtil.canInteract | public static boolean canInteract(Member issuer, Emote emote) {
"""
Check whether the provided {@link net.dv8tion.jda.core.entities.Member Member} can use the specified {@link net.dv8tion.jda.core.entities.Emote Emote}.
<p>If the specified Member is not in the emote's guild or the emote provided is fake this wi... | java | public static boolean canInteract(Member issuer, Emote emote)
{
Checks.notNull(issuer, "Issuer Member");
Checks.notNull(emote, "Target Emote");
if (!issuer.getGuild().equals(emote.getGuild()))
throw new IllegalArgumentException("The issuer and target are not in the same Guild")... | [
"public",
"static",
"boolean",
"canInteract",
"(",
"Member",
"issuer",
",",
"Emote",
"emote",
")",
"{",
"Checks",
".",
"notNull",
"(",
"issuer",
",",
"\"Issuer Member\"",
")",
";",
"Checks",
".",
"notNull",
"(",
"emote",
",",
"\"Target Emote\"",
")",
";",
... | Check whether the provided {@link net.dv8tion.jda.core.entities.Member Member} can use the specified {@link net.dv8tion.jda.core.entities.Emote Emote}.
<p>If the specified Member is not in the emote's guild or the emote provided is fake this will return false.
Otherwise it will check if the emote is restricted to any ... | [
"Check",
"whether",
"the",
"provided",
"{",
"@link",
"net",
".",
"dv8tion",
".",
"jda",
".",
"core",
".",
"entities",
".",
"Member",
"Member",
"}",
"can",
"use",
"the",
"specified",
"{",
"@link",
"net",
".",
"dv8tion",
".",
"jda",
".",
"core",
".",
"... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/utils/PermissionUtil.java#L139-L165 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.getProject | public Project getProject(String namespace, String project) throws GitLabApiException {
"""
Get a specific project, which is owned by the authentication user.
<pre><code>GET /projects/:id</code></pre>
@param namespace the name of the project namespace or group
@param project the name of the project to get
... | java | public Project getProject(String namespace, String project) throws GitLabApiException {
if (namespace == null) {
throw new RuntimeException("namespace cannot be null");
}
if (project == null) {
throw new RuntimeException("project cannot be null");
}
Str... | [
"public",
"Project",
"getProject",
"(",
"String",
"namespace",
",",
"String",
"project",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"namespace",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"namespace cannot be null\"",
")",
";",
... | Get a specific project, which is owned by the authentication user.
<pre><code>GET /projects/:id</code></pre>
@param namespace the name of the project namespace or group
@param project the name of the project to get
@return the specified project
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"specific",
"project",
"which",
"is",
"owned",
"by",
"the",
"authentication",
"user",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L617-L636 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/KeyArea.java | KeyArea.getKeyField | public KeyField getKeyField(int iKeyFieldSeq, boolean bForceUniqueKey) {
"""
Get this key field taking into account whether the key must be unique.
Add one key field (the counter field if this isn't a unique key area and you want to force a unique key).
@param bForceUniqueKey If params must be unique, if they ar... | java | public KeyField getKeyField(int iKeyFieldSeq, boolean bForceUniqueKey)
{
KeyField keyField = null;
if (iKeyFieldSeq != this.getKeyFields(false, true))
keyField = this.getKeyField(iKeyFieldSeq);
else
keyField = this.getRecord().getKeyArea(0).getKeyField(0); // Special... | [
"public",
"KeyField",
"getKeyField",
"(",
"int",
"iKeyFieldSeq",
",",
"boolean",
"bForceUniqueKey",
")",
"{",
"KeyField",
"keyField",
"=",
"null",
";",
"if",
"(",
"iKeyFieldSeq",
"!=",
"this",
".",
"getKeyFields",
"(",
"false",
",",
"true",
")",
")",
"keyFie... | Get this key field taking into account whether the key must be unique.
Add one key field (the counter field if this isn't a unique key area and you want to force a unique key).
@param bForceUniqueKey If params must be unique, if they aren't, add the unique key to the end.
@return The Key field. | [
"Get",
"this",
"key",
"field",
"taking",
"into",
"account",
"whether",
"the",
"key",
"must",
"be",
"unique",
".",
"Add",
"one",
"key",
"field",
"(",
"the",
"counter",
"field",
"if",
"this",
"isn",
"t",
"a",
"unique",
"key",
"area",
"and",
"you",
"want"... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/KeyArea.java#L565-L573 |
duracloud/mill | workman/src/main/java/org/duracloud/mill/dup/DuplicationTaskProcessor.java | DuplicationTaskProcessor.cleanProperties | private void cleanProperties(Map<String, String> props) {
"""
Pull out the system-generated properties, to allow the properties that
are added to the duplicated item to be only the user-defined properties.
@param props
"""
if (props != null) {
props.remove(StorageProvider.PROPERTIES_CON... | java | private void cleanProperties(Map<String, String> props) {
if (props != null) {
props.remove(StorageProvider.PROPERTIES_CONTENT_MD5);
props.remove(StorageProvider.PROPERTIES_CONTENT_CHECKSUM);
props.remove(StorageProvider.PROPERTIES_CONTENT_MODIFIED);
props.remove(... | [
"private",
"void",
"cleanProperties",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"props",
")",
"{",
"if",
"(",
"props",
"!=",
"null",
")",
"{",
"props",
".",
"remove",
"(",
"StorageProvider",
".",
"PROPERTIES_CONTENT_MD5",
")",
";",
"props",
".",
"re... | Pull out the system-generated properties, to allow the properties that
are added to the duplicated item to be only the user-defined properties.
@param props | [
"Pull",
"out",
"the",
"system",
"-",
"generated",
"properties",
"to",
"allow",
"the",
"properties",
"that",
"are",
"added",
"to",
"the",
"duplicated",
"item",
"to",
"be",
"only",
"the",
"user",
"-",
"defined",
"properties",
"."
] | train | https://github.com/duracloud/mill/blob/854ac6edcba7fa2cab60993f172e82c2d1dad4bd/workman/src/main/java/org/duracloud/mill/dup/DuplicationTaskProcessor.java#L356-L373 |
ecclesia/kipeto | kipeto/src/main/java/de/ecclesia/kipeto/RepositoryResolver.java | RepositoryResolver.determinateLocalIP | private String determinateLocalIP() throws IOException {
"""
Ermittelt anhand der Default-Repository-URL die IP-Adresse der
Netzwerkkarte, die Verbindung zum Repository hat.
"""
Socket socket = null;
try {
URL url = new URL(defaultRepositoryUrl);
int port = url.getPort() > -1 ? url.getPort() : url.... | java | private String determinateLocalIP() throws IOException {
Socket socket = null;
try {
URL url = new URL(defaultRepositoryUrl);
int port = url.getPort() > -1 ? url.getPort() : url.getDefaultPort();
log.debug("Determinating local IP-Adress by connect to {}:{}", defaultRepositoryUrl, port);
InetAddress ad... | [
"private",
"String",
"determinateLocalIP",
"(",
")",
"throws",
"IOException",
"{",
"Socket",
"socket",
"=",
"null",
";",
"try",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"defaultRepositoryUrl",
")",
";",
"int",
"port",
"=",
"url",
".",
"getPort",
"(",
"... | Ermittelt anhand der Default-Repository-URL die IP-Adresse der
Netzwerkkarte, die Verbindung zum Repository hat. | [
"Ermittelt",
"anhand",
"der",
"Default",
"-",
"Repository",
"-",
"URL",
"die",
"IP",
"-",
"Adresse",
"der",
"Netzwerkkarte",
"die",
"Verbindung",
"zum",
"Repository",
"hat",
"."
] | train | https://github.com/ecclesia/kipeto/blob/ea39a10ae4eaa550f71a856ab2f2845270a64913/kipeto/src/main/java/de/ecclesia/kipeto/RepositoryResolver.java#L105-L131 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/MPXReader.java | MPXReader.populateCalendar | private void populateCalendar(Record record, ProjectCalendar calendar, boolean isBaseCalendar) {
"""
Populates a calendar instance.
@param record MPX record
@param calendar calendar instance
@param isBaseCalendar true if this is a base calendar
"""
if (isBaseCalendar == true)
{
calend... | java | private void populateCalendar(Record record, ProjectCalendar calendar, boolean isBaseCalendar)
{
if (isBaseCalendar == true)
{
calendar.setName(record.getString(0));
}
else
{
calendar.setParent(m_projectFile.getCalendarByName(record.getString(0)));
}
calen... | [
"private",
"void",
"populateCalendar",
"(",
"Record",
"record",
",",
"ProjectCalendar",
"calendar",
",",
"boolean",
"isBaseCalendar",
")",
"{",
"if",
"(",
"isBaseCalendar",
"==",
"true",
")",
"{",
"calendar",
".",
"setName",
"(",
"record",
".",
"getString",
"(... | Populates a calendar instance.
@param record MPX record
@param calendar calendar instance
@param isBaseCalendar true if this is a base calendar | [
"Populates",
"a",
"calendar",
"instance",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/MPXReader.java#L717-L737 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/circuitbreaker/SlidingWindowCounter.java | SlidingWindowCounter.trimAndSum | private EventCount trimAndSum(long tickerNanos) {
"""
Sums up buckets within the time window, and removes all the others.
"""
final long oldLimit = tickerNanos - slidingWindowNanos;
final Iterator<Bucket> iterator = reservoir.iterator();
long success = 0;
long failure = 0;
... | java | private EventCount trimAndSum(long tickerNanos) {
final long oldLimit = tickerNanos - slidingWindowNanos;
final Iterator<Bucket> iterator = reservoir.iterator();
long success = 0;
long failure = 0;
while (iterator.hasNext()) {
final Bucket bucket = iterator.next();
... | [
"private",
"EventCount",
"trimAndSum",
"(",
"long",
"tickerNanos",
")",
"{",
"final",
"long",
"oldLimit",
"=",
"tickerNanos",
"-",
"slidingWindowNanos",
";",
"final",
"Iterator",
"<",
"Bucket",
">",
"iterator",
"=",
"reservoir",
".",
"iterator",
"(",
")",
";",... | Sums up buckets within the time window, and removes all the others. | [
"Sums",
"up",
"buckets",
"within",
"the",
"time",
"window",
"and",
"removes",
"all",
"the",
"others",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/circuitbreaker/SlidingWindowCounter.java#L123-L140 |
prometheus/client_java | simpleclient_caffeine/src/main/java/io/prometheus/client/cache/caffeine/CacheMetricsCollector.java | CacheMetricsCollector.addCache | public void addCache(String cacheName, AsyncLoadingCache cache) {
"""
Add or replace the cache with the given name.
<p>
Any references any previous cache with this name is invalidated.
@param cacheName The name of the cache, will be the metrics label value
@param cache The cache being monitored
"""
... | java | public void addCache(String cacheName, AsyncLoadingCache cache) {
children.put(cacheName, cache.synchronous());
} | [
"public",
"void",
"addCache",
"(",
"String",
"cacheName",
",",
"AsyncLoadingCache",
"cache",
")",
"{",
"children",
".",
"put",
"(",
"cacheName",
",",
"cache",
".",
"synchronous",
"(",
")",
")",
";",
"}"
] | Add or replace the cache with the given name.
<p>
Any references any previous cache with this name is invalidated.
@param cacheName The name of the cache, will be the metrics label value
@param cache The cache being monitored | [
"Add",
"or",
"replace",
"the",
"cache",
"with",
"the",
"given",
"name",
".",
"<p",
">",
"Any",
"references",
"any",
"previous",
"cache",
"with",
"this",
"name",
"is",
"invalidated",
"."
] | train | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient_caffeine/src/main/java/io/prometheus/client/cache/caffeine/CacheMetricsCollector.java#L75-L77 |
Daytron/SimpleDialogFX | src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java | Dialog.setFontFamily | public void setFontFamily(String header_font_family, String details_font_family) {
"""
Sets both font families for the header and the details label with two
font families <code>String</code> parameters given.
@param header_font_family The header font family in <code>Strings</code>
@param details_font_family T... | java | public void setFontFamily(String header_font_family, String details_font_family) {
this.headerLabel
.setStyle("-fx-font-family: \"" + header_font_family + "\";");
this.detailsLabel
.setStyle("-fx-font-family: \"" + details_font_family + "\";");
} | [
"public",
"void",
"setFontFamily",
"(",
"String",
"header_font_family",
",",
"String",
"details_font_family",
")",
"{",
"this",
".",
"headerLabel",
".",
"setStyle",
"(",
"\"-fx-font-family: \\\"\"",
"+",
"header_font_family",
"+",
"\"\\\";\"",
")",
";",
"this",
".",... | Sets both font families for the header and the details label with two
font families <code>String</code> parameters given.
@param header_font_family The header font family in <code>Strings</code>
@param details_font_family The details font family in
<code>Strings</code> | [
"Sets",
"both",
"font",
"families",
"for",
"the",
"header",
"and",
"the",
"details",
"label",
"with",
"two",
"font",
"families",
"<code",
">",
"String<",
"/",
"code",
">",
"parameters",
"given",
"."
] | train | https://github.com/Daytron/SimpleDialogFX/blob/54e813dbb0ebabad8e0a81b6b5f05e518747611e/src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java#L792-L797 |
Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapCircleThumbnail.java | BootstrapCircleThumbnail.updateImageState | protected void updateImageState() {
"""
This method is called when the Circle Image needs to be recreated due to changes in size etc.
A Paint object uses a BitmapShader to draw a center-cropped, circular image onto the View
Canvas. A Matrix on the BitmapShader scales the original Bitmap to match the current view... | java | protected void updateImageState() {
float viewWidth = getWidth();
float viewHeight = getHeight();
if ((int) viewWidth <= 0 || (int) viewHeight <= 0) {
return;
}
if (sourceBitmap != null) {
BitmapShader imageShader = new BitmapShader(sourceBitmap, Shader.... | [
"protected",
"void",
"updateImageState",
"(",
")",
"{",
"float",
"viewWidth",
"=",
"getWidth",
"(",
")",
";",
"float",
"viewHeight",
"=",
"getHeight",
"(",
")",
";",
"if",
"(",
"(",
"int",
")",
"viewWidth",
"<=",
"0",
"||",
"(",
"int",
")",
"viewHeight... | This method is called when the Circle Image needs to be recreated due to changes in size etc.
A Paint object uses a BitmapShader to draw a center-cropped, circular image onto the View
Canvas. A Matrix on the BitmapShader scales the original Bitmap to match the current view
bounds, avoiding any inefficiencies in duplica... | [
"This",
"method",
"is",
"called",
"when",
"the",
"Circle",
"Image",
"needs",
"to",
"be",
"recreated",
"due",
"to",
"changes",
"in",
"size",
"etc",
".",
"A",
"Paint",
"object",
"uses",
"a",
"BitmapShader",
"to",
"draw",
"a",
"center",
"-",
"cropped",
"cir... | train | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapCircleThumbnail.java#L81-L121 |
eobermuhlner/big-math | ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigComplex.java | BigComplex.valueOf | public static BigComplex valueOf(double real, double imaginary) {
"""
Returns a complex number with the specified real and imaginary {@code double} parts.
@param real the real {@code double} part
@param imaginary the imaginary {@code double} part
@return the complex number
"""
return valueOf(BigDecimal.... | java | public static BigComplex valueOf(double real, double imaginary) {
return valueOf(BigDecimal.valueOf(real), BigDecimal.valueOf(imaginary));
} | [
"public",
"static",
"BigComplex",
"valueOf",
"(",
"double",
"real",
",",
"double",
"imaginary",
")",
"{",
"return",
"valueOf",
"(",
"BigDecimal",
".",
"valueOf",
"(",
"real",
")",
",",
"BigDecimal",
".",
"valueOf",
"(",
"imaginary",
")",
")",
";",
"}"
] | Returns a complex number with the specified real and imaginary {@code double} parts.
@param real the real {@code double} part
@param imaginary the imaginary {@code double} part
@return the complex number | [
"Returns",
"a",
"complex",
"number",
"with",
"the",
"specified",
"real",
"and",
"imaginary",
"{",
"@code",
"double",
"}",
"parts",
"."
] | train | https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigComplex.java#L508-L510 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/EnumUtils.java | EnumUtils.generateBitVector | @GwtIncompatible("incompatible method")
@SafeVarargs
public static <E extends Enum<E>> long generateBitVector(final Class<E> enumClass, final E... values) {
"""
<p>Creates a long bit vector representation of the given array of Enum values.</p>
<p>This generates a value that is usable by {@link EnumUtils... | java | @GwtIncompatible("incompatible method")
@SafeVarargs
public static <E extends Enum<E>> long generateBitVector(final Class<E> enumClass, final E... values) {
Validate.noNullElements(values);
return generateBitVector(enumClass, Arrays.asList(values));
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"@",
"SafeVarargs",
"public",
"static",
"<",
"E",
"extends",
"Enum",
"<",
"E",
">",
">",
"long",
"generateBitVector",
"(",
"final",
"Class",
"<",
"E",
">",
"enumClass",
",",
"final",
"E",
"...",
... | <p>Creates a long bit vector representation of the given array of Enum values.</p>
<p>This generates a value that is usable by {@link EnumUtils#processBitVector}.</p>
<p>Do not use this method if you have more than 64 values in your Enum, as this
would create a value greater than a long can hold.</p>
@param enumClas... | [
"<p",
">",
"Creates",
"a",
"long",
"bit",
"vector",
"representation",
"of",
"the",
"given",
"array",
"of",
"Enum",
"values",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/EnumUtils.java#L203-L208 |
dhanji/sitebricks | sitebricks-converter/src/main/java/com/google/sitebricks/conversion/generics/Generics.java | Generics.getExactSuperType | public static Type getExactSuperType(Type type, Class<?> searchClass) {
"""
With type a supertype of searchClass, returns the exact supertype of the
given class, including type parameters. For example, with
<tt>class StringList implements List<String></tt>,
<tt>getExactSuperType(StringList.class, Collecti... | java | public static Type getExactSuperType(Type type, Class<?> searchClass)
{
if (type instanceof ParameterizedType || type instanceof Class<?>
|| type instanceof GenericArrayType)
{
Class<?> clazz = erase(type);
if (searchClass == clazz)
{
return type;
}
if (!searchClass.isAssignabl... | [
"public",
"static",
"Type",
"getExactSuperType",
"(",
"Type",
"type",
",",
"Class",
"<",
"?",
">",
"searchClass",
")",
"{",
"if",
"(",
"type",
"instanceof",
"ParameterizedType",
"||",
"type",
"instanceof",
"Class",
"<",
"?",
">",
"||",
"type",
"instanceof",
... | With type a supertype of searchClass, returns the exact supertype of the
given class, including type parameters. For example, with
<tt>class StringList implements List<String></tt>,
<tt>getExactSuperType(StringList.class, Collection.class)</tt> returns a
{@link ParameterizedType} representing <tt>Collection<St... | [
"With",
"type",
"a",
"supertype",
"of",
"searchClass",
"returns",
"the",
"exact",
"supertype",
"of",
"the",
"given",
"class",
"including",
"type",
"parameters",
".",
"For",
"example",
"with",
"<tt",
">",
"class",
"StringList",
"implements",
"List<",
";",
"St... | train | https://github.com/dhanji/sitebricks/blob/8682029a78bd48fb8566173d970800499e9e5d97/sitebricks-converter/src/main/java/com/google/sitebricks/conversion/generics/Generics.java#L169-L193 |
moparisthebest/beehive | beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlSubstitutionFragment.java | SqlSubstitutionFragment.getPreparedStatementText | protected String getPreparedStatementText(ControlBeanContext context, Method m, Object[] args) {
"""
Return the text for a PreparedStatement from this fragment. This type of fragment
typically evaluates any reflection parameters at this point. The exception
is if the reflected result is a ComplexSqlFragment, it... | java | protected String getPreparedStatementText(ControlBeanContext context, Method m, Object[] args) {
StringBuilder sb = new StringBuilder();
for (SqlFragment frag : _children) {
boolean complexFragment = frag.hasComplexValue(context, m, args);
if (frag.hasParamValue() && !complexFr... | [
"protected",
"String",
"getPreparedStatementText",
"(",
"ControlBeanContext",
"context",
",",
"Method",
"m",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"SqlFragment",
"frag",
":",
... | Return the text for a PreparedStatement from this fragment. This type of fragment
typically evaluates any reflection parameters at this point. The exception
is if the reflected result is a ComplexSqlFragment, it that case the sql text
is retrieved from the fragment in this method. The parameter values are
retrieved i... | [
"Return",
"the",
"text",
"for",
"a",
"PreparedStatement",
"from",
"this",
"fragment",
".",
"This",
"type",
"of",
"fragment",
"typically",
"evaluates",
"any",
"reflection",
"parameters",
"at",
"this",
"point",
".",
"The",
"exception",
"is",
"if",
"the",
"reflec... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlSubstitutionFragment.java#L119-L136 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutboundServiceContextImpl.java | HttpOutboundServiceContextImpl.sendRequestHeaders | @Override
public VirtualConnection sendRequestHeaders(InterChannelCallback callback, boolean bForce) throws MessageSentException {
"""
Send the headers for the outgoing request asynchronously.
If the write can be done immediately, the VirtualConnection will be
returned and the callback will not be used. Th... | java | @Override
public VirtualConnection sendRequestHeaders(InterChannelCallback callback, boolean bForce) throws MessageSentException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "sendRequestHeaders(async)");
}
if (headersSent()) {
thro... | [
"@",
"Override",
"public",
"VirtualConnection",
"sendRequestHeaders",
"(",
"InterChannelCallback",
"callback",
",",
"boolean",
"bForce",
")",
"throws",
"MessageSentException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"... | Send the headers for the outgoing request asynchronously.
If the write can be done immediately, the VirtualConnection will be
returned and the callback will not be used. The caller is responsible
for handling that situation in their code. A null return code means
that the async write is in progress.
The boolean bForc... | [
"Send",
"the",
"headers",
"for",
"the",
"outgoing",
"request",
"asynchronously",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutboundServiceContextImpl.java#L923-L947 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/EnvelopesApi.java | EnvelopesApi.updateDocuments | public EnvelopeDocumentsResult updateDocuments(String accountId, String envelopeId, EnvelopeDefinition envelopeDefinition) throws ApiException {
"""
Adds one or more documents to an existing envelope document.
Adds one or more documents to an existing envelope document.
@param accountId The external account numb... | java | public EnvelopeDocumentsResult updateDocuments(String accountId, String envelopeId, EnvelopeDefinition envelopeDefinition) throws ApiException {
return updateDocuments(accountId, envelopeId, envelopeDefinition, null);
} | [
"public",
"EnvelopeDocumentsResult",
"updateDocuments",
"(",
"String",
"accountId",
",",
"String",
"envelopeId",
",",
"EnvelopeDefinition",
"envelopeDefinition",
")",
"throws",
"ApiException",
"{",
"return",
"updateDocuments",
"(",
"accountId",
",",
"envelopeId",
",",
"... | Adds one or more documents to an existing envelope document.
Adds one or more documents to an existing envelope document.
@param accountId The external account number (int) or account ID Guid. (required)
@param envelopeId The envelopeId Guid of the envelope being accessed. (required)
@param envelopeDefinition (optiona... | [
"Adds",
"one",
"or",
"more",
"documents",
"to",
"an",
"existing",
"envelope",
"document",
".",
"Adds",
"one",
"or",
"more",
"documents",
"to",
"an",
"existing",
"envelope",
"document",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L5130-L5132 |
SvenEwald/xmlbeam | src/main/java/org/xmlbeam/ProjectionInvocationHandler.java | ProjectionInvocationHandler.unwrapArgs | private static void unwrapArgs(final Class<?>[] types, final Object[] args) {
"""
If parameter is instance of Callable or Supplier then resolve its value.
@param args
@param args2
"""
if (args == null) {
return;
}
try {
for (int i = 0; i < args.length; ++i) {... | java | private static void unwrapArgs(final Class<?>[] types, final Object[] args) {
if (args == null) {
return;
}
try {
for (int i = 0; i < args.length; ++i) {
args[i] = ReflectionHelper.unwrap(types[i], args[i]);
}
} catch (Exception e) {
... | [
"private",
"static",
"void",
"unwrapArgs",
"(",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"types",
",",
"final",
"Object",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"args",
"==",
"null",
")",
"{",
"return",
";",
"}",
"try",
"{",
"for",
"(",
"int",
... | If parameter is instance of Callable or Supplier then resolve its value.
@param args
@param args2 | [
"If",
"parameter",
"is",
"instance",
"of",
"Callable",
"or",
"Supplier",
"then",
"resolve",
"its",
"value",
"."
] | train | https://github.com/SvenEwald/xmlbeam/blob/acaac1b8fa28d246f17187f5e3c6696458a0b447/src/main/java/org/xmlbeam/ProjectionInvocationHandler.java#L893-L905 |
frostwire/frostwire-jlibtorrent | src/main/java/com/frostwire/jlibtorrent/SessionHandle.java | SessionHandle.dhtGetItem | public void dhtGetItem(byte[] key, byte[] salt) {
"""
Query the DHT for a mutable item under the public key {@code key}.
this is an ed25519 key. The {@code salt} argument is optional and may be left
as an empty string if no salt is to be used.
<p>
if the item is found in the DHT, a {@link DhtMutableItemAlert} ... | java | public void dhtGetItem(byte[] key, byte[] salt) {
s.dht_get_item(Vectors.bytes2byte_vector(key), Vectors.bytes2byte_vector(salt));
} | [
"public",
"void",
"dhtGetItem",
"(",
"byte",
"[",
"]",
"key",
",",
"byte",
"[",
"]",
"salt",
")",
"{",
"s",
".",
"dht_get_item",
"(",
"Vectors",
".",
"bytes2byte_vector",
"(",
"key",
")",
",",
"Vectors",
".",
"bytes2byte_vector",
"(",
"salt",
")",
")",... | Query the DHT for a mutable item under the public key {@code key}.
this is an ed25519 key. The {@code salt} argument is optional and may be left
as an empty string if no salt is to be used.
<p>
if the item is found in the DHT, a {@link DhtMutableItemAlert} is
posted.
@param key
@param salt | [
"Query",
"the",
"DHT",
"for",
"a",
"mutable",
"item",
"under",
"the",
"public",
"key",
"{",
"@code",
"key",
"}",
".",
"this",
"is",
"an",
"ed25519",
"key",
".",
"The",
"{",
"@code",
"salt",
"}",
"argument",
"is",
"optional",
"and",
"may",
"be",
"left... | train | https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/SessionHandle.java#L481-L483 |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/IteratorStream.java | IteratorStream.queued | @Override
public Stream<T> queued(int queueSize) {
"""
Returns a Stream with elements from a temporary queue which is filled by reading the elements from the specified iterator asynchronously.
@param stream
@param queueSize Default value is 8
@return
"""
final Iterator<T> iter = iterator();
... | java | @Override
public Stream<T> queued(int queueSize) {
final Iterator<T> iter = iterator();
if (iter instanceof QueuedIterator && ((QueuedIterator<? extends T>) iter).max() >= queueSize) {
return newStream(elements, sorted, cmp);
} else {
return newStream(Stream.p... | [
"@",
"Override",
"public",
"Stream",
"<",
"T",
">",
"queued",
"(",
"int",
"queueSize",
")",
"{",
"final",
"Iterator",
"<",
"T",
">",
"iter",
"=",
"iterator",
"(",
")",
";",
"if",
"(",
"iter",
"instanceof",
"QueuedIterator",
"&&",
"(",
"(",
"QueuedItera... | Returns a Stream with elements from a temporary queue which is filled by reading the elements from the specified iterator asynchronously.
@param stream
@param queueSize Default value is 8
@return | [
"Returns",
"a",
"Stream",
"with",
"elements",
"from",
"a",
"temporary",
"queue",
"which",
"is",
"filled",
"by",
"reading",
"the",
"elements",
"from",
"the",
"specified",
"iterator",
"asynchronously",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/IteratorStream.java#L3336-L3345 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java | ApiOvhEmailpro.service_account_email_sendOnBehalfTo_allowedAccountId_GET | public OvhAccountSendOnBehalfTo service_account_email_sendOnBehalfTo_allowedAccountId_GET(String service, String email, Long allowedAccountId) throws IOException {
"""
Get this object properties
REST: GET /email/pro/{service}/account/{email}/sendOnBehalfTo/{allowedAccountId}
@param service [required] The inter... | java | public OvhAccountSendOnBehalfTo service_account_email_sendOnBehalfTo_allowedAccountId_GET(String service, String email, Long allowedAccountId) throws IOException {
String qPath = "/email/pro/{service}/account/{email}/sendOnBehalfTo/{allowedAccountId}";
StringBuilder sb = path(qPath, service, email, allowedAccountId... | [
"public",
"OvhAccountSendOnBehalfTo",
"service_account_email_sendOnBehalfTo_allowedAccountId_GET",
"(",
"String",
"service",
",",
"String",
"email",
",",
"Long",
"allowedAccountId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/pro/{service}/account/{emai... | Get this object properties
REST: GET /email/pro/{service}/account/{email}/sendOnBehalfTo/{allowedAccountId}
@param service [required] The internal name of your pro organization
@param email [required] Default email for this mailbox
@param allowedAccountId [required] Account id to give send on behalf to
API beta | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java#L575-L580 |
infinispan/infinispan | core/src/main/java/org/infinispan/distribution/ch/impl/ScatteredConsistentHashFactory.java | ScatteredConsistentHashFactory.updateMembers | @Override
public ScatteredConsistentHash updateMembers(ScatteredConsistentHash baseCH, List<Address> actualMembers,
Map<Address, Float> actualCapacityFactors) {
"""
Leavers are removed and segments without owners are assigned new owners. Joiners might get some of th... | java | @Override
public ScatteredConsistentHash updateMembers(ScatteredConsistentHash baseCH, List<Address> actualMembers,
Map<Address, Float> actualCapacityFactors) {
if (actualMembers.size() == 0)
throw new IllegalArgumentException("Can't construct a consistent... | [
"@",
"Override",
"public",
"ScatteredConsistentHash",
"updateMembers",
"(",
"ScatteredConsistentHash",
"baseCH",
",",
"List",
"<",
"Address",
">",
"actualMembers",
",",
"Map",
"<",
"Address",
",",
"Float",
">",
"actualCapacityFactors",
")",
"{",
"if",
"(",
"actual... | Leavers are removed and segments without owners are assigned new owners. Joiners might get some of the un-owned
segments but otherwise they are not taken into account (that should happen during a rebalance).
@param baseCH An existing consistent hash instance, should not be {@code null}
@param actualMembers A list of a... | [
"Leavers",
"are",
"removed",
"and",
"segments",
"without",
"owners",
"are",
"assigned",
"new",
"owners",
".",
"Joiners",
"might",
"get",
"some",
"of",
"the",
"un",
"-",
"owned",
"segments",
"but",
"otherwise",
"they",
"are",
"not",
"taken",
"into",
"account"... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/distribution/ch/impl/ScatteredConsistentHashFactory.java#L64-L80 |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelCreateHandler.java | ChannelCreateHandler.handleGroupChannel | private void handleGroupChannel(JsonNode channel) {
"""
Handles a group channel creation.
@param channel The channel data.
"""
long channelId = channel.get("id").asLong();
if (!api.getGroupChannelById(channelId).isPresent()) {
GroupChannel groupChannel = new GroupChannelImpl(api,... | java | private void handleGroupChannel(JsonNode channel) {
long channelId = channel.get("id").asLong();
if (!api.getGroupChannelById(channelId).isPresent()) {
GroupChannel groupChannel = new GroupChannelImpl(api, channel);
GroupChannelCreateEvent event = new GroupChannelCreateEventImpl(... | [
"private",
"void",
"handleGroupChannel",
"(",
"JsonNode",
"channel",
")",
"{",
"long",
"channelId",
"=",
"channel",
".",
"get",
"(",
"\"id\"",
")",
".",
"asLong",
"(",
")",
";",
"if",
"(",
"!",
"api",
".",
"getGroupChannelById",
"(",
"channelId",
")",
".... | Handles a group channel creation.
@param channel The channel data. | [
"Handles",
"a",
"group",
"channel",
"creation",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelCreateHandler.java#L141-L149 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/component/basic/AbstractComponent.java | AbstractComponent.createWave | private Wave createWave(final WaveGroup waveGroup, final WaveType waveType, final Class<?> componentClass, final WaveBean waveBean, final WaveBean... waveBeans) {
"""
Build a wave object with its dedicated WaveBean.
@param waveGroup the group of the wave
@param waveType the type of the wave
@param componentCl... | java | private Wave createWave(final WaveGroup waveGroup, final WaveType waveType, final Class<?> componentClass, final WaveBean waveBean, final WaveBean... waveBeans) {
final List<WaveBean> waveBeanList = new ArrayList<>();
waveBeanList.add(waveBean);
if (waveBeans.length > 0) {
waveBeanL... | [
"private",
"Wave",
"createWave",
"(",
"final",
"WaveGroup",
"waveGroup",
",",
"final",
"WaveType",
"waveType",
",",
"final",
"Class",
"<",
"?",
">",
"componentClass",
",",
"final",
"WaveBean",
"waveBean",
",",
"final",
"WaveBean",
"...",
"waveBeans",
")",
"{",... | Build a wave object with its dedicated WaveBean.
@param waveGroup the group of the wave
@param waveType the type of the wave
@param componentClass the component class if any
@param waveBean the wave bean that holds all required data
@param waveBeans the extra Wave Beans that holds all other required data
@return the ... | [
"Build",
"a",
"wave",
"object",
"with",
"its",
"dedicated",
"WaveBean",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/component/basic/AbstractComponent.java#L337-L356 |
mapbox/mapbox-navigation-android | libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/utils/RouteUtils.java | RouteUtils.findCurrentBannerInstructions | @Nullable
public BannerInstructions findCurrentBannerInstructions(LegStep currentStep, double stepDistanceRemaining) {
"""
Given the current step / current step distance remaining, this function will
find the current instructions to be shown.
@param currentStep holding the current banner instructio... | java | @Nullable
public BannerInstructions findCurrentBannerInstructions(LegStep currentStep, double stepDistanceRemaining) {
if (isValidBannerInstructions(currentStep)) {
List<BannerInstructions> instructions = sortBannerInstructions(currentStep.bannerInstructions());
for (BannerInstructions instruction : i... | [
"@",
"Nullable",
"public",
"BannerInstructions",
"findCurrentBannerInstructions",
"(",
"LegStep",
"currentStep",
",",
"double",
"stepDistanceRemaining",
")",
"{",
"if",
"(",
"isValidBannerInstructions",
"(",
"currentStep",
")",
")",
"{",
"List",
"<",
"BannerInstructions... | Given the current step / current step distance remaining, this function will
find the current instructions to be shown.
@param currentStep holding the current banner instructions
@param stepDistanceRemaining to determine progress along the currentStep
@return the current banner instructions based on the curr... | [
"Given",
"the",
"current",
"step",
"/",
"current",
"step",
"distance",
"remaining",
"this",
"function",
"will",
"find",
"the",
"current",
"instructions",
"to",
"be",
"shown",
"."
] | train | https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/utils/RouteUtils.java#L118-L131 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/DefaultDatastoreReader.java | DefaultDatastoreReader.load | public <E> E load(Class<E> entityClass, DatastoreKey key) {
"""
Retrieves and returns the entity with the given key.
@param entityClass
the expected result type
@param key
the entity key
@return the entity with the given key, or <code>null</code>, if no entity exists with the given
key.
@throws EntityMana... | java | public <E> E load(Class<E> entityClass, DatastoreKey key) {
return fetch(entityClass, key.nativeKey());
} | [
"public",
"<",
"E",
">",
"E",
"load",
"(",
"Class",
"<",
"E",
">",
"entityClass",
",",
"DatastoreKey",
"key",
")",
"{",
"return",
"fetch",
"(",
"entityClass",
",",
"key",
".",
"nativeKey",
"(",
")",
")",
";",
"}"
] | Retrieves and returns the entity with the given key.
@param entityClass
the expected result type
@param key
the entity key
@return the entity with the given key, or <code>null</code>, if no entity exists with the given
key.
@throws EntityManagerException
if any error occurs while accessing the Datastore. | [
"Retrieves",
"and",
"returns",
"the",
"entity",
"with",
"the",
"given",
"key",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/DefaultDatastoreReader.java#L191-L193 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.makeAbsolute | @Pure
public static URL makeAbsolute(URL filename, File current) {
"""
Make the given filename absolute from the given root if it is not already absolute.
<table border="1" width="100%" summary="Cases">
<thead>
<tr>
<td>{@code filename}</td><td>{@code current}</td><td>Result</td>
</tr>
</thead>
<tr>
<td... | java | @Pure
public static URL makeAbsolute(URL filename, File current) {
try {
return makeAbsolute(filename, current == null ? null : current.toURI().toURL());
} catch (MalformedURLException exception) {
//
}
return filename;
} | [
"@",
"Pure",
"public",
"static",
"URL",
"makeAbsolute",
"(",
"URL",
"filename",
",",
"File",
"current",
")",
"{",
"try",
"{",
"return",
"makeAbsolute",
"(",
"filename",
",",
"current",
"==",
"null",
"?",
"null",
":",
"current",
".",
"toURI",
"(",
")",
... | Make the given filename absolute from the given root if it is not already absolute.
<table border="1" width="100%" summary="Cases">
<thead>
<tr>
<td>{@code filename}</td><td>{@code current}</td><td>Result</td>
</tr>
</thead>
<tr>
<td><code>null</code></td>
<td><code>null</code></td>
<td><code>null</code></td>
</tr>
<t... | [
"Make",
"the",
"given",
"filename",
"absolute",
"from",
"the",
"given",
"root",
"if",
"it",
"is",
"not",
"already",
"absolute",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L2255-L2263 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/FeatureInfoBuilder.java | FeatureInfoBuilder.buildResultsInfoMessageAndClose | public String buildResultsInfoMessageAndClose(FeatureIndexResults results, double tolerance, LatLng clickLocation, Projection projection) {
"""
Build a feature results information message and close the results
@param results feature index results
@param tolerance distance tolerance
@param clickLocat... | java | public String buildResultsInfoMessageAndClose(FeatureIndexResults results, double tolerance, LatLng clickLocation, Projection projection) {
String message = null;
try {
message = buildResultsInfoMessage(results, tolerance, clickLocation, projection);
} finally {
results.... | [
"public",
"String",
"buildResultsInfoMessageAndClose",
"(",
"FeatureIndexResults",
"results",
",",
"double",
"tolerance",
",",
"LatLng",
"clickLocation",
",",
"Projection",
"projection",
")",
"{",
"String",
"message",
"=",
"null",
";",
"try",
"{",
"message",
"=",
... | Build a feature results information message and close the results
@param results feature index results
@param tolerance distance tolerance
@param clickLocation map click location
@param projection desired geometry projection
@return results message or null if no results | [
"Build",
"a",
"feature",
"results",
"information",
"message",
"and",
"close",
"the",
"results"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/FeatureInfoBuilder.java#L276-L286 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/AbstractDb.java | AbstractDb.pageForEntityList | public List<Entity> pageForEntityList(Entity where, int page, int numPerPage) throws SQLException {
"""
分页查询,结果为Entity列表,不计算总数<br>
查询条件为多个key value对表示,默认key = value,如果使用其它条件可以使用:where.put("key", " > 1"),value也可以传Condition对象,key被忽略
@param where 条件实体类(包含表名)
@param page 页码
@param numPerPage 每页条目数
@return 结果... | java | public List<Entity> pageForEntityList(Entity where, int page, int numPerPage) throws SQLException {
return pageForEntityList(where, new Page(page, numPerPage));
} | [
"public",
"List",
"<",
"Entity",
">",
"pageForEntityList",
"(",
"Entity",
"where",
",",
"int",
"page",
",",
"int",
"numPerPage",
")",
"throws",
"SQLException",
"{",
"return",
"pageForEntityList",
"(",
"where",
",",
"new",
"Page",
"(",
"page",
",",
"numPerPag... | 分页查询,结果为Entity列表,不计算总数<br>
查询条件为多个key value对表示,默认key = value,如果使用其它条件可以使用:where.put("key", " > 1"),value也可以传Condition对象,key被忽略
@param where 条件实体类(包含表名)
@param page 页码
@param numPerPage 每页条目数
@return 结果对象
@throws SQLException SQL执行异常
@since 3.2.2 | [
"分页查询,结果为Entity列表,不计算总数<br",
">",
"查询条件为多个key",
"value对表示,默认key",
"=",
"value,如果使用其它条件可以使用:where",
".",
"put",
"(",
"key",
">",
";",
"1",
")",
",value也可以传Condition对象,key被忽略"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L659-L661 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsFileTable.java | CmsFileTable.filterTable | public void filterTable(String search) {
"""
Filters the displayed resources.<p>
Only resources where either the resource name, the title or the nav-text contains the given substring are shown.<p>
@param search the search term
"""
m_container.removeAllContainerFilters();
if (CmsStringUtil.... | java | public void filterTable(String search) {
m_container.removeAllContainerFilters();
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(search)) {
m_container.addContainerFilter(
new Or(
new SimpleStringFilter(CmsResourceTableProperty.PROPERTY_RESOURCE_NAME, searc... | [
"public",
"void",
"filterTable",
"(",
"String",
"search",
")",
"{",
"m_container",
".",
"removeAllContainerFilters",
"(",
")",
";",
"if",
"(",
"CmsStringUtil",
".",
"isNotEmptyOrWhitespaceOnly",
"(",
"search",
")",
")",
"{",
"m_container",
".",
"addContainerFilter... | Filters the displayed resources.<p>
Only resources where either the resource name, the title or the nav-text contains the given substring are shown.<p>
@param search the search term | [
"Filters",
"the",
"displayed",
"resources",
".",
"<p",
">",
"Only",
"resources",
"where",
"either",
"the",
"resource",
"name",
"the",
"title",
"or",
"the",
"nav",
"-",
"text",
"contains",
"the",
"given",
"substring",
"are",
"shown",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsFileTable.java#L555-L568 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java | JDBC4CallableStatement.getBigDecimal | @Override
@Deprecated
public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException {
"""
Deprecated. use getBigDecimal(int parameterIndex) or getBigDecimal(String parameterName)
"""
checkClosed();
throw SQLError.noSupport();
} | java | @Override
@Deprecated
public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"@",
"Deprecated",
"public",
"BigDecimal",
"getBigDecimal",
"(",
"int",
"parameterIndex",
",",
"int",
"scale",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(",
")",
";",
"}"
] | Deprecated. use getBigDecimal(int parameterIndex) or getBigDecimal(String parameterName) | [
"Deprecated",
".",
"use",
"getBigDecimal",
"(",
"int",
"parameterIndex",
")",
"or",
"getBigDecimal",
"(",
"String",
"parameterName",
")"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java#L70-L76 |
vznet/mongo-jackson-mapper | src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java | JacksonDBCollection.ensureIndex | public void ensureIndex(DBObject keys, String name) throws MongoException {
"""
calls {@link DBCollection#ensureIndex(com.mongodb.DBObject, java.lang.String, boolean)} with unique=false
@param keys fields to use for index
@param name an identifier for the index
@throws MongoException If an error occurred
... | java | public void ensureIndex(DBObject keys, String name) throws MongoException {
ensureIndex(keys, name, false);
} | [
"public",
"void",
"ensureIndex",
"(",
"DBObject",
"keys",
",",
"String",
"name",
")",
"throws",
"MongoException",
"{",
"ensureIndex",
"(",
"keys",
",",
"name",
",",
"false",
")",
";",
"}"
] | calls {@link DBCollection#ensureIndex(com.mongodb.DBObject, java.lang.String, boolean)} with unique=false
@param keys fields to use for index
@param name an identifier for the index
@throws MongoException If an error occurred | [
"calls",
"{",
"@link",
"DBCollection#ensureIndex",
"(",
"com",
".",
"mongodb",
".",
"DBObject",
"java",
".",
"lang",
".",
"String",
"boolean",
")",
"}",
"with",
"unique",
"=",
"false"
] | train | https://github.com/vznet/mongo-jackson-mapper/blob/ecd189aefa89636cddf70fb383f5d676be347976/src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java#L710-L712 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/Record.java | Record.moveFieldToThin | public void moveFieldToThin(FieldInfo fieldInfo, BaseField field, Record record) {
"""
Move the data in this record to the thin version.
@param fieldInfo The destination thin field.
@param field The source field (or null to auto-find)
@param record The source record (or null if field supplied)
"""
i... | java | public void moveFieldToThin(FieldInfo fieldInfo, BaseField field, Record record)
{
if ((field == null) || (!field.getFieldName().equals(fieldInfo.getFieldName())))
{
field = null;
if (record != null)
field = record.getField(fieldInfo.getFieldName());
}... | [
"public",
"void",
"moveFieldToThin",
"(",
"FieldInfo",
"fieldInfo",
",",
"BaseField",
"field",
",",
"Record",
"record",
")",
"{",
"if",
"(",
"(",
"field",
"==",
"null",
")",
"||",
"(",
"!",
"field",
".",
"getFieldName",
"(",
")",
".",
"equals",
"(",
"f... | Move the data in this record to the thin version.
@param fieldInfo The destination thin field.
@param field The source field (or null to auto-find)
@param record The source record (or null if field supplied) | [
"Move",
"the",
"data",
"in",
"this",
"record",
"to",
"the",
"thin",
"version",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L3290-L3305 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/plugins/RxJavaPlugins.java | RxJavaPlugins.createIoScheduler | @NonNull
@GwtIncompatible
public static Scheduler createIoScheduler(@NonNull ThreadFactory threadFactory) {
"""
Create an instance of the default {@link Scheduler} used for {@link Schedulers#io()}
except using {@code threadFactory} for thread creation.
<p>History: 2.0.5 - experimental
@param threadFacto... | java | @NonNull
@GwtIncompatible
public static Scheduler createIoScheduler(@NonNull ThreadFactory threadFactory) {
return new IoScheduler(ObjectHelper.requireNonNull(threadFactory, "threadFactory is null"));
} | [
"@",
"NonNull",
"@",
"GwtIncompatible",
"public",
"static",
"Scheduler",
"createIoScheduler",
"(",
"@",
"NonNull",
"ThreadFactory",
"threadFactory",
")",
"{",
"return",
"new",
"IoScheduler",
"(",
"ObjectHelper",
".",
"requireNonNull",
"(",
"threadFactory",
",",
"\"t... | Create an instance of the default {@link Scheduler} used for {@link Schedulers#io()}
except using {@code threadFactory} for thread creation.
<p>History: 2.0.5 - experimental
@param threadFactory thread factory to use for creating worker threads. Note that this takes precedence over any
system properties for configuring... | [
"Create",
"an",
"instance",
"of",
"the",
"default",
"{"
] | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/plugins/RxJavaPlugins.java#L1224-L1228 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.writeParagraphVectors | public static void writeParagraphVectors(ParagraphVectors vectors, File file) {
"""
This method saves ParagraphVectors model into compressed zip file
@param file
"""
try (FileOutputStream fos = new FileOutputStream(file);
BufferedOutputStream stream = new BufferedOutputStream(fos)) {
... | java | public static void writeParagraphVectors(ParagraphVectors vectors, File file) {
try (FileOutputStream fos = new FileOutputStream(file);
BufferedOutputStream stream = new BufferedOutputStream(fos)) {
writeParagraphVectors(vectors, stream);
} catch (Exception e) {
thro... | [
"public",
"static",
"void",
"writeParagraphVectors",
"(",
"ParagraphVectors",
"vectors",
",",
"File",
"file",
")",
"{",
"try",
"(",
"FileOutputStream",
"fos",
"=",
"new",
"FileOutputStream",
"(",
"file",
")",
";",
"BufferedOutputStream",
"stream",
"=",
"new",
"B... | This method saves ParagraphVectors model into compressed zip file
@param file | [
"This",
"method",
"saves",
"ParagraphVectors",
"model",
"into",
"compressed",
"zip",
"file"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L406-L413 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.