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 |
|---|---|---|---|---|---|---|---|---|---|---|
morimekta/utils | io-util/src/main/java/net/morimekta/util/Strings.java | Strings.commonSuffix | public static int commonSuffix(String text1, String text2) {
"""
Determine the common suffix of two strings
@param text1 First string.
@param text2 Second string.
@return The number of characters common to the end of each string.
"""
// Performance analysis: http://neil.fraser.name/news/2007/10/09/
... | java | public static int commonSuffix(String text1, String text2) {
// Performance analysis: http://neil.fraser.name/news/2007/10/09/
int text1_length = text1.length();
int text2_length = text2.length();
int n = Math.min(text1_length, text2_length);
for (int i = 1; i <= n; i++) {
... | [
"public",
"static",
"int",
"commonSuffix",
"(",
"String",
"text1",
",",
"String",
"text2",
")",
"{",
"// Performance analysis: http://neil.fraser.name/news/2007/10/09/",
"int",
"text1_length",
"=",
"text1",
".",
"length",
"(",
")",
";",
"int",
"text2_length",
"=",
"... | Determine the common suffix of two strings
@param text1 First string.
@param text2 Second string.
@return The number of characters common to the end of each string. | [
"Determine",
"the",
"common",
"suffix",
"of",
"two",
"strings"
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/io-util/src/main/java/net/morimekta/util/Strings.java#L697-L708 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/ModifyingCollectionWithItself.java | ModifyingCollectionWithItself.describe | private Description describe(MethodInvocationTree methodInvocationTree, VisitorState state) {
"""
We expect that the lhs is a field and the rhs is an identifier, specifically a parameter to the
method. We base our suggested fixes on this expectation.
<p>Case 1: If lhs is a field and rhs is an identifier, find ... | java | private Description describe(MethodInvocationTree methodInvocationTree, VisitorState state) {
ExpressionTree receiver = ASTHelpers.getReceiver(methodInvocationTree);
List<? extends ExpressionTree> arguments = methodInvocationTree.getArguments();
ExpressionTree argument;
// .addAll(int, Collection); for... | [
"private",
"Description",
"describe",
"(",
"MethodInvocationTree",
"methodInvocationTree",
",",
"VisitorState",
"state",
")",
"{",
"ExpressionTree",
"receiver",
"=",
"ASTHelpers",
".",
"getReceiver",
"(",
"methodInvocationTree",
")",
";",
"List",
"<",
"?",
"extends",
... | We expect that the lhs is a field and the rhs is an identifier, specifically a parameter to the
method. We base our suggested fixes on this expectation.
<p>Case 1: If lhs is a field and rhs is an identifier, find a method parameter of the same type
and similar name and suggest it as the rhs. (Guess that they have miss... | [
"We",
"expect",
"that",
"the",
"lhs",
"is",
"a",
"field",
"and",
"the",
"rhs",
"is",
"an",
"identifier",
"specifically",
"a",
"parameter",
"to",
"the",
"method",
".",
"We",
"base",
"our",
"suggested",
"fixes",
"on",
"this",
"expectation",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/ModifyingCollectionWithItself.java#L101-L114 |
alkacon/opencms-core | src/org/opencms/cmis/CmsCmisUtil.java | CmsCmisUtil.ensureLock | public static boolean ensureLock(CmsObject cms, CmsResource resource) throws CmsException {
"""
Tries to lock a resource and throws an exception if it can't be locked.<p>
Returns true only if the resource wasn't already locked before.<p>
@param cms the CMS context
@param resource the resource to lock
@retu... | java | public static boolean ensureLock(CmsObject cms, CmsResource resource) throws CmsException {
CmsLock lock = cms.getLock(resource);
if (lock.isOwnedBy(cms.getRequestContext().getCurrentUser())) {
return false;
}
cms.lockResourceTemporary(resource);
return true;
... | [
"public",
"static",
"boolean",
"ensureLock",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"CmsLock",
"lock",
"=",
"cms",
".",
"getLock",
"(",
"resource",
")",
";",
"if",
"(",
"lock",
".",
"isOwnedBy",
"(",
"c... | Tries to lock a resource and throws an exception if it can't be locked.<p>
Returns true only if the resource wasn't already locked before.<p>
@param cms the CMS context
@param resource the resource to lock
@return true if the resource wasn't already locked
@throws CmsException if something goes wrong | [
"Tries",
"to",
"lock",
"a",
"resource",
"and",
"throws",
"an",
"exception",
"if",
"it",
"can",
"t",
"be",
"locked",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cmis/CmsCmisUtil.java#L434-L442 |
icode/ameba | src/main/java/ameba/core/Addon.java | Addon.unsubscribeSystemEvent | protected static <E extends Event> void unsubscribeSystemEvent(Class<E> eventClass, final Listener<E> listener) {
"""
<p>unsubscribeSystemEvent.</p>
@param eventClass a {@link java.lang.Class} object.
@param listener a {@link ameba.event.Listener} object.
@param <E> a E object.
"""
SystemEventBu... | java | protected static <E extends Event> void unsubscribeSystemEvent(Class<E> eventClass, final Listener<E> listener) {
SystemEventBus.unsubscribe(eventClass, listener);
} | [
"protected",
"static",
"<",
"E",
"extends",
"Event",
">",
"void",
"unsubscribeSystemEvent",
"(",
"Class",
"<",
"E",
">",
"eventClass",
",",
"final",
"Listener",
"<",
"E",
">",
"listener",
")",
"{",
"SystemEventBus",
".",
"unsubscribe",
"(",
"eventClass",
","... | <p>unsubscribeSystemEvent.</p>
@param eventClass a {@link java.lang.Class} object.
@param listener a {@link ameba.event.Listener} object.
@param <E> a E object. | [
"<p",
">",
"unsubscribeSystemEvent",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/core/Addon.java#L94-L96 |
OpenLiberty/open-liberty | dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONObject.java | JSONObject.writeObject | public void writeObject(Writer writer, int indentDepth, boolean contentOnly)
throws IOException {
"""
Method to write out the JSON formatted object. Same as calling writeObject(writer,indentDepth,contentOnly,false);
@param writer The writer to use when serializing the JSON structure.
@param indentDepth How ... | java | public void writeObject(Writer writer, int indentDepth, boolean contentOnly)
throws IOException
{
if (logger.isLoggable(Level.FINER)) logger.entering(className, "writeObject(Writer, int, boolean)");
writeObject(writer,indentDepth,contentOnly, false);
if (logger.isLoggable(Level.FINER)) l... | [
"public",
"void",
"writeObject",
"(",
"Writer",
"writer",
",",
"int",
"indentDepth",
",",
"boolean",
"contentOnly",
")",
"throws",
"IOException",
"{",
"if",
"(",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINER",
")",
")",
"logger",
".",
"entering",
... | Method to write out the JSON formatted object. Same as calling writeObject(writer,indentDepth,contentOnly,false);
@param writer The writer to use when serializing the JSON structure.
@param indentDepth How far to indent the text for object's JSON format.
@param contentOnly Flag to debnnote whether to assign this as an... | [
"Method",
"to",
"write",
"out",
"the",
"JSON",
"formatted",
"object",
".",
"Same",
"as",
"calling",
"writeObject",
"(",
"writer",
"indentDepth",
"contentOnly",
"false",
")",
";"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONObject.java#L141-L147 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/ServiceLoaderHelper.java | ServiceLoaderHelper.getAllSPIImplementations | @Nonnull
@ReturnsMutableCopy
public static <T> ICommonsList <T> getAllSPIImplementations (@Nonnull final Class <T> aSPIClass) {
"""
Uses the {@link ServiceLoader} to load all SPI implementations of the
passed class
@param <T>
The implementation type to be loaded
@param aSPIClass
The SPI interface class.... | java | @Nonnull
@ReturnsMutableCopy
public static <T> ICommonsList <T> getAllSPIImplementations (@Nonnull final Class <T> aSPIClass)
{
return getAllSPIImplementations (aSPIClass, ClassLoaderHelper.getDefaultClassLoader (), null);
} | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"<",
"T",
">",
"ICommonsList",
"<",
"T",
">",
"getAllSPIImplementations",
"(",
"@",
"Nonnull",
"final",
"Class",
"<",
"T",
">",
"aSPIClass",
")",
"{",
"return",
"getAllSPIImplementations",
"(",
"aS... | Uses the {@link ServiceLoader} to load all SPI implementations of the
passed class
@param <T>
The implementation type to be loaded
@param aSPIClass
The SPI interface class. May not be <code>null</code>.
@return A list of all currently available plugins | [
"Uses",
"the",
"{",
"@link",
"ServiceLoader",
"}",
"to",
"load",
"all",
"SPI",
"implementations",
"of",
"the",
"passed",
"class"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/ServiceLoaderHelper.java#L63-L68 |
netty/netty | handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java | AbstractTrafficShapingHandler.checkWriteSuspend | void checkWriteSuspend(ChannelHandlerContext ctx, long delay, long queueSize) {
"""
Check the writability according to delay and size for the channel.
Set if necessary setUserDefinedWritability status.
@param delay the computed delay
@param queueSize the current queueSize
"""
if (queueSize > maxWrit... | java | void checkWriteSuspend(ChannelHandlerContext ctx, long delay, long queueSize) {
if (queueSize > maxWriteSize || delay > maxWriteDelay) {
setUserDefinedWritability(ctx, false);
}
} | [
"void",
"checkWriteSuspend",
"(",
"ChannelHandlerContext",
"ctx",
",",
"long",
"delay",
",",
"long",
"queueSize",
")",
"{",
"if",
"(",
"queueSize",
">",
"maxWriteSize",
"||",
"delay",
">",
"maxWriteDelay",
")",
"{",
"setUserDefinedWritability",
"(",
"ctx",
",",
... | Check the writability according to delay and size for the channel.
Set if necessary setUserDefinedWritability status.
@param delay the computed delay
@param queueSize the current queueSize | [
"Check",
"the",
"writability",
"according",
"to",
"delay",
"and",
"size",
"for",
"the",
"channel",
".",
"Set",
"if",
"necessary",
"setUserDefinedWritability",
"status",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java#L597-L601 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java | Expressions.asSimple | public static <T> SimpleExpression<T> asSimple(Expression<T> expr) {
"""
Create a new SimpleExpression
@param expr expression
@return new SimpleExpression
"""
Expression<T> underlyingMixin = ExpressionUtils.extract(expr);
if (underlyingMixin instanceof PathImpl) {
return new Sim... | java | public static <T> SimpleExpression<T> asSimple(Expression<T> expr) {
Expression<T> underlyingMixin = ExpressionUtils.extract(expr);
if (underlyingMixin instanceof PathImpl) {
return new SimplePath<T>((PathImpl<T>) underlyingMixin);
} else if (underlyingMixin instanceof OperationImpl)... | [
"public",
"static",
"<",
"T",
">",
"SimpleExpression",
"<",
"T",
">",
"asSimple",
"(",
"Expression",
"<",
"T",
">",
"expr",
")",
"{",
"Expression",
"<",
"T",
">",
"underlyingMixin",
"=",
"ExpressionUtils",
".",
"extract",
"(",
"expr",
")",
";",
"if",
"... | Create a new SimpleExpression
@param expr expression
@return new SimpleExpression | [
"Create",
"a",
"new",
"SimpleExpression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L2169-L2189 |
sebastiangraf/perfidix | src/main/java/org/perfidix/result/BenchmarkResult.java | BenchmarkResult.addData | public void addData(final BenchmarkMethod meth, final AbstractMeter meter, final double data) {
"""
Adding a dataset to a given meter and adapting the underlaying result model.
@param meth where the result is corresponding to
@param meter where the result is corresponding to
@param data the data itself
... | java | public void addData(final BenchmarkMethod meth, final AbstractMeter meter, final double data) {
final Class<?> clazz = meth.getMethodToBench().getDeclaringClass();
if (!elements.containsKey(clazz)) {
elements.put(clazz, new ClassResult(clazz));
}
final ClassResult clazzResu... | [
"public",
"void",
"addData",
"(",
"final",
"BenchmarkMethod",
"meth",
",",
"final",
"AbstractMeter",
"meter",
",",
"final",
"double",
"data",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"clazz",
"=",
"meth",
".",
"getMethodToBench",
"(",
")",
".",
"getDecla... | Adding a dataset to a given meter and adapting the underlaying result model.
@param meth where the result is corresponding to
@param meter where the result is corresponding to
@param data the data itself | [
"Adding",
"a",
"dataset",
"to",
"a",
"given",
"meter",
"and",
"adapting",
"the",
"underlaying",
"result",
"model",
"."
] | train | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/result/BenchmarkResult.java#L79-L101 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/subsystem/FeatureRepository.java | FeatureRepository.writeBadManifestEntry | private void writeBadManifestEntry(PrintWriter writer, File f, BadFeature bf) {
"""
Write the data to the cache. This should stay in sync
with {@link #updateBadManifestCache(String)}, which does the reading.
@param writer
@param f
@param bf
@see #updateBadManifestCache(String)
"""
writer.write(f... | java | private void writeBadManifestEntry(PrintWriter writer, File f, BadFeature bf) {
writer.write(f.getAbsolutePath()); // 0
writer.write(FeatureDefinitionUtils.SPLIT_CHAR);
writer.write(String.valueOf(bf.lastModified)); // 1
writer.write(FeatureDefinitionUtils.SPLIT_CHAR);
writer.wri... | [
"private",
"void",
"writeBadManifestEntry",
"(",
"PrintWriter",
"writer",
",",
"File",
"f",
",",
"BadFeature",
"bf",
")",
"{",
"writer",
".",
"write",
"(",
"f",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"// 0",
"writer",
".",
"write",
"(",
"FeatureDefini... | Write the data to the cache. This should stay in sync
with {@link #updateBadManifestCache(String)}, which does the reading.
@param writer
@param f
@param bf
@see #updateBadManifestCache(String) | [
"Write",
"the",
"data",
"to",
"the",
"cache",
".",
"This",
"should",
"stay",
"in",
"sync",
"with",
"{",
"@link",
"#updateBadManifestCache",
"(",
"String",
")",
"}",
"which",
"does",
"the",
"reading",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/subsystem/FeatureRepository.java#L339-L345 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserver.java | ReframingResponseObserver.onResponseImpl | @Override
protected void onResponseImpl(InnerT response) {
"""
Accept a new response from inner/upstream callable. This message will be processed by the
{@link Reframer} in the delivery loop and the output will be delivered to the downstream {@link
ResponseObserver}.
<p>If the delivery loop is stopped, this... | java | @Override
protected void onResponseImpl(InnerT response) {
IllegalStateException error = null;
// Guard against unsolicited notifications
if (!awaitingInner || !newItem.compareAndSet(null, response)) {
// Notify downstream if it's still open
error = new IllegalStateException("Received unsolic... | [
"@",
"Override",
"protected",
"void",
"onResponseImpl",
"(",
"InnerT",
"response",
")",
"{",
"IllegalStateException",
"error",
"=",
"null",
";",
"// Guard against unsolicited notifications",
"if",
"(",
"!",
"awaitingInner",
"||",
"!",
"newItem",
".",
"compareAndSet",
... | Accept a new response from inner/upstream callable. This message will be processed by the
{@link Reframer} in the delivery loop and the output will be delivered to the downstream {@link
ResponseObserver}.
<p>If the delivery loop is stopped, this will restart it. | [
"Accept",
"a",
"new",
"response",
"from",
"inner",
"/",
"upstream",
"callable",
".",
"This",
"message",
"will",
"be",
"processed",
"by",
"the",
"{",
"@link",
"Reframer",
"}",
"in",
"the",
"delivery",
"loop",
"and",
"the",
"output",
"will",
"be",
"delivered... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserver.java#L193-L209 |
tzaeschke/zoodb | src/org/zoodb/internal/ZooClassDef.java | ZooClassDef.bootstrapZooClassDef | public static ZooClassDef bootstrapZooClassDef() {
"""
Methods used for bootstrapping the schema of newly created databases.
@return Meta schema instance
"""
ZooClassDef meta = new ZooClassDef(ZooClassDef.class.getName(), 51, 50, 51, 0);
ArrayList<ZooFieldDef> fields = new ArrayList<ZooFieldDef>();
fiel... | java | public static ZooClassDef bootstrapZooClassDef() {
ZooClassDef meta = new ZooClassDef(ZooClassDef.class.getName(), 51, 50, 51, 0);
ArrayList<ZooFieldDef> fields = new ArrayList<ZooFieldDef>();
fields.add(new ZooFieldDef(meta, "className", String.class.getName(), 0,
JdoType.STRING, 70));
fields.add(new ZooF... | [
"public",
"static",
"ZooClassDef",
"bootstrapZooClassDef",
"(",
")",
"{",
"ZooClassDef",
"meta",
"=",
"new",
"ZooClassDef",
"(",
"ZooClassDef",
".",
"class",
".",
"getName",
"(",
")",
",",
"51",
",",
"50",
",",
"51",
",",
"0",
")",
";",
"ArrayList",
"<",... | Methods used for bootstrapping the schema of newly created databases.
@return Meta schema instance | [
"Methods",
"used",
"for",
"bootstrapping",
"the",
"schema",
"of",
"newly",
"created",
"databases",
"."
] | train | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/ZooClassDef.java#L116-L141 |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/MPEGAudioFrameHeader.java | MPEGAudioFrameHeader.findSampleRate | private int findSampleRate(int sampleIndex, int version) {
"""
Based on the sample rate index found in the header, attempt to lookup
and set the sample rate from the table.
@param sampleIndex the sample rate index read from the header
"""
int ind = -1;
switch (version)
{
case MPEG_V_1:
ind = ... | java | private int findSampleRate(int sampleIndex, int version)
{
int ind = -1;
switch (version)
{
case MPEG_V_1:
ind = 0;
break;
case MPEG_V_2:
ind = 1;
break;
case MPEG_V_25:
ind = 2;
}
if ((ind != -1) && (sampleIndex >= 0) && (sampleIndex <= 3))
{
return sampleTable[sampleInde... | [
"private",
"int",
"findSampleRate",
"(",
"int",
"sampleIndex",
",",
"int",
"version",
")",
"{",
"int",
"ind",
"=",
"-",
"1",
";",
"switch",
"(",
"version",
")",
"{",
"case",
"MPEG_V_1",
":",
"ind",
"=",
"0",
";",
"break",
";",
"case",
"MPEG_V_2",
":"... | Based on the sample rate index found in the header, attempt to lookup
and set the sample rate from the table.
@param sampleIndex the sample rate index read from the header | [
"Based",
"on",
"the",
"sample",
"rate",
"index",
"found",
"in",
"the",
"header",
"attempt",
"to",
"lookup",
"and",
"set",
"the",
"sample",
"rate",
"from",
"the",
"table",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/MPEGAudioFrameHeader.java#L295-L316 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/FileUtils.java | FileUtils.toHashMap | public static Map<String, List<String>> toHashMap(final String aFilePath, final String aPattern,
final String... aIgnoreList) throws FileNotFoundException {
"""
Returns a Map representation of the supplied directory's structure. The map contains the file name as the key
and its path as the value. If a... | java | public static Map<String, List<String>> toHashMap(final String aFilePath, final String aPattern,
final String... aIgnoreList) throws FileNotFoundException {
final String filePattern = aPattern != null ? aPattern : WILDCARD;
final RegexFileFilter filter = new RegexFileFilter(filePattern);
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"toHashMap",
"(",
"final",
"String",
"aFilePath",
",",
"final",
"String",
"aPattern",
",",
"final",
"String",
"...",
"aIgnoreList",
")",
"throws",
"FileNotFoundException",
"{",
"... | Returns a Map representation of the supplied directory's structure. The map contains the file name as the key
and its path as the value. If a file with a name occurs more than once, multiple path values are returned for
that file name key. The map that is returned is unmodifiable.
@param aFilePath The directory of whi... | [
"Returns",
"a",
"Map",
"representation",
"of",
"the",
"supplied",
"directory",
"s",
"structure",
".",
"The",
"map",
"contains",
"the",
"file",
"name",
"as",
"the",
"key",
"and",
"its",
"path",
"as",
"the",
"value",
".",
"If",
"a",
"file",
"with",
"a",
... | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/FileUtils.java#L214-L241 |
Sciss/abc4j | abc/src/main/java/abc/xml/Abc2xml.java | Abc2xml.writeAsMusicXML | public void writeAsMusicXML(Tune tune, File file) throws IOException {
"""
Writes the specified tune to the specified file as MusicXML.
@param file
A file.
@param tune
A tune.
@throws IOException
Thrown if the file cannot be created.
"""
BufferedWriter writer = new BufferedWriter(new FileWriter(file... | java | public void writeAsMusicXML(Tune tune, File file) throws IOException {
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
Document doc = createMusicXmlDOM(tune);
// dumpDOM(doc);
writeAsMusicXML(doc, writer);
writer.flush();
writer.close();
} | [
"public",
"void",
"writeAsMusicXML",
"(",
"Tune",
"tune",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"BufferedWriter",
"writer",
"=",
"new",
"BufferedWriter",
"(",
"new",
"FileWriter",
"(",
"file",
")",
")",
";",
"Document",
"doc",
"=",
"createM... | Writes the specified tune to the specified file as MusicXML.
@param file
A file.
@param tune
A tune.
@throws IOException
Thrown if the file cannot be created. | [
"Writes",
"the",
"specified",
"tune",
"to",
"the",
"specified",
"file",
"as",
"MusicXML",
"."
] | train | https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/xml/Abc2xml.java#L175-L182 |
ltearno/hexa.tools | hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/properties/PropertyValues.java | PropertyValues.hasObjectDynamicProperty | boolean hasObjectDynamicProperty( Object object, String propertyName ) {
"""
Whether a dynamic property value has already been set on this object
"""
DynamicPropertyBag bag = propertyBagAccess.getObjectDynamicPropertyBag( object );
return bag != null && bag.contains( propertyName );
} | java | boolean hasObjectDynamicProperty( Object object, String propertyName )
{
DynamicPropertyBag bag = propertyBagAccess.getObjectDynamicPropertyBag( object );
return bag != null && bag.contains( propertyName );
} | [
"boolean",
"hasObjectDynamicProperty",
"(",
"Object",
"object",
",",
"String",
"propertyName",
")",
"{",
"DynamicPropertyBag",
"bag",
"=",
"propertyBagAccess",
".",
"getObjectDynamicPropertyBag",
"(",
"object",
")",
";",
"return",
"bag",
"!=",
"null",
"&&",
"bag",
... | Whether a dynamic property value has already been set on this object | [
"Whether",
"a",
"dynamic",
"property",
"value",
"has",
"already",
"been",
"set",
"on",
"this",
"object"
] | train | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/properties/PropertyValues.java#L229-L233 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java | ValueEnforcer.noNullValue | @Nullable
public static <T extends Iterable <?>> T noNullValue (final T aValue, final String sName) {
"""
Check that the passed iterable contains no <code>null</code> value. But the
whole iterable can be <code>null</code> or empty.
@param <T>
Type to be checked and returned
@param aValue
The collection to... | java | @Nullable
public static <T extends Iterable <?>> T noNullValue (final T aValue, final String sName)
{
if (isEnabled ())
return noNullValue (aValue, () -> sName);
return aValue;
} | [
"@",
"Nullable",
"public",
"static",
"<",
"T",
"extends",
"Iterable",
"<",
"?",
">",
">",
"T",
"noNullValue",
"(",
"final",
"T",
"aValue",
",",
"final",
"String",
"sName",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
")",
"return",
"noNullValue",
"(",
... | Check that the passed iterable contains no <code>null</code> value. But the
whole iterable can be <code>null</code> or empty.
@param <T>
Type to be checked and returned
@param aValue
The collection to check. May be <code>null</code>.
@param sName
The name of the value (e.g. the parameter name)
@return The passed value... | [
"Check",
"that",
"the",
"passed",
"iterable",
"contains",
"no",
"<code",
">",
"null<",
"/",
"code",
">",
"value",
".",
"But",
"the",
"whole",
"iterable",
"can",
"be",
"<code",
">",
"null<",
"/",
"code",
">",
"or",
"empty",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java#L927-L933 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java | RedisClusterStorage.unsetTriggerState | @Override
public boolean unsetTriggerState(String triggerHashKey, JedisCluster jedis) throws JobPersistenceException {
"""
Unsets the state of the given trigger key by removing the trigger from all trigger state sets.
@param triggerHashKey the redis key of the desired trigger hash
@param jedis a t... | java | @Override
public boolean unsetTriggerState(String triggerHashKey, JedisCluster jedis) throws JobPersistenceException {
boolean removed = false;
List<Long> responses = new ArrayList<>(RedisTriggerState.values().length);
for (RedisTriggerState state : RedisTriggerState.values()) {
... | [
"@",
"Override",
"public",
"boolean",
"unsetTriggerState",
"(",
"String",
"triggerHashKey",
",",
"JedisCluster",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"boolean",
"removed",
"=",
"false",
";",
"List",
"<",
"Long",
">",
"responses",
"=",
"new",
"... | Unsets the state of the given trigger key by removing the trigger from all trigger state sets.
@param triggerHashKey the redis key of the desired trigger hash
@param jedis a thread-safe Redis connection
@return true if the trigger was removed, false if the trigger was stateless
@throws JobPersistenceException... | [
"Unsets",
"the",
"state",
"of",
"the",
"given",
"trigger",
"key",
"by",
"removing",
"the",
"trigger",
"from",
"all",
"trigger",
"state",
"sets",
"."
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java#L241-L256 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java | ColumnFamilyMetrics.createColumnFamilyGauge | protected <T extends Number> Gauge<T> createColumnFamilyGauge(final String name, Gauge<T> gauge) {
"""
Create a gauge that will be part of a merged version of all column families. The global gauge
will merge each CF gauge by adding their values
"""
return createColumnFamilyGauge(name, gauge, new Gaug... | java | protected <T extends Number> Gauge<T> createColumnFamilyGauge(final String name, Gauge<T> gauge)
{
return createColumnFamilyGauge(name, gauge, new Gauge<Long>()
{
public Long value()
{
long total = 0;
for (Metric cfGauge : allColumnFamilyMetric... | [
"protected",
"<",
"T",
"extends",
"Number",
">",
"Gauge",
"<",
"T",
">",
"createColumnFamilyGauge",
"(",
"final",
"String",
"name",
",",
"Gauge",
"<",
"T",
">",
"gauge",
")",
"{",
"return",
"createColumnFamilyGauge",
"(",
"name",
",",
"gauge",
",",
"new",
... | Create a gauge that will be part of a merged version of all column families. The global gauge
will merge each CF gauge by adding their values | [
"Create",
"a",
"gauge",
"that",
"will",
"be",
"part",
"of",
"a",
"merged",
"version",
"of",
"all",
"column",
"families",
".",
"The",
"global",
"gauge",
"will",
"merge",
"each",
"CF",
"gauge",
"by",
"adding",
"their",
"values"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java#L639-L653 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/AbstractCalendarFactory.java | AbstractCalendarFactory.updateBaseCalendarNames | private void updateBaseCalendarNames(List<Pair<ProjectCalendar, Integer>> baseCalendars, HashMap<Integer, ProjectCalendar> map) {
"""
The way calendars are stored in an MPP14 file means that there
can be forward references between the base calendar unique ID for a
derived calendar, and the base calendar itself. ... | java | private void updateBaseCalendarNames(List<Pair<ProjectCalendar, Integer>> baseCalendars, HashMap<Integer, ProjectCalendar> map)
{
for (Pair<ProjectCalendar, Integer> pair : baseCalendars)
{
ProjectCalendar cal = pair.getFirst();
Integer baseCalendarID = pair.getSecond();
Projec... | [
"private",
"void",
"updateBaseCalendarNames",
"(",
"List",
"<",
"Pair",
"<",
"ProjectCalendar",
",",
"Integer",
">",
">",
"baseCalendars",
",",
"HashMap",
"<",
"Integer",
",",
"ProjectCalendar",
">",
"map",
")",
"{",
"for",
"(",
"Pair",
"<",
"ProjectCalendar",... | The way calendars are stored in an MPP14 file means that there
can be forward references between the base calendar unique ID for a
derived calendar, and the base calendar itself. To get around this,
we initially populate the base calendar name attribute with the
base calendar unique ID, and now in this method we can co... | [
"The",
"way",
"calendars",
"are",
"stored",
"in",
"an",
"MPP14",
"file",
"means",
"that",
"there",
"can",
"be",
"forward",
"references",
"between",
"the",
"base",
"calendar",
"unique",
"ID",
"for",
"a",
"derived",
"calendar",
"and",
"the",
"base",
"calendar"... | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/AbstractCalendarFactory.java#L295-L312 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java | AbstractHibernateCriteriaBuilder.countDistinct | public org.grails.datastore.mapping.query.api.ProjectionList countDistinct(String propertyName, String alias) {
"""
Adds a projection that allows the criteria to return the distinct property count
@param propertyName The name of the property
@param alias The alias to use
"""
final CountProjection p... | java | public org.grails.datastore.mapping.query.api.ProjectionList countDistinct(String propertyName, String alias) {
final CountProjection proj = Projections.countDistinct(calculatePropertyName(propertyName));
addProjectionToList(proj, alias);
return this;
} | [
"public",
"org",
".",
"grails",
".",
"datastore",
".",
"mapping",
".",
"query",
".",
"api",
".",
"ProjectionList",
"countDistinct",
"(",
"String",
"propertyName",
",",
"String",
"alias",
")",
"{",
"final",
"CountProjection",
"proj",
"=",
"Projections",
".",
... | Adds a projection that allows the criteria to return the distinct property count
@param propertyName The name of the property
@param alias The alias to use | [
"Adds",
"a",
"projection",
"that",
"allows",
"the",
"criteria",
"to",
"return",
"the",
"distinct",
"property",
"count"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java#L438-L442 |
phax/ph-oton | ph-oton-html/src/main/java/com/helger/html/markdown/MarkdownHelper.java | MarkdownHelper._appendHexEntity | private static void _appendHexEntity (final StringBuilder out, final char value) {
"""
Append the given char as a hexadecimal HTML entity.
@param out
The StringBuilder to write to.
@param value
The character.
"""
out.append ("&#x").append (Integer.toHexString (value)).append (';');
} | java | private static void _appendHexEntity (final StringBuilder out, final char value)
{
out.append ("&#x").append (Integer.toHexString (value)).append (';');
} | [
"private",
"static",
"void",
"_appendHexEntity",
"(",
"final",
"StringBuilder",
"out",
",",
"final",
"char",
"value",
")",
"{",
"out",
".",
"append",
"(",
"\"&#x\"",
")",
".",
"append",
"(",
"Integer",
".",
"toHexString",
"(",
"value",
")",
")",
".",
"ap... | Append the given char as a hexadecimal HTML entity.
@param out
The StringBuilder to write to.
@param value
The character. | [
"Append",
"the",
"given",
"char",
"as",
"a",
"hexadecimal",
"HTML",
"entity",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/markdown/MarkdownHelper.java#L373-L376 |
appium/java-client | src/main/java/io/appium/java_client/screenrecording/ScreenRecordingUploadOptions.java | ScreenRecordingUploadOptions.withAuthCredentials | public ScreenRecordingUploadOptions withAuthCredentials(String user, String pass) {
"""
Sets the credentials for remote ftp/http authentication (if needed).
This option only has an effect if remotePath is provided.
@param user The name of the user for the remote authentication.
@param pass The password for th... | java | public ScreenRecordingUploadOptions withAuthCredentials(String user, String pass) {
this.user = checkNotNull(user);
this.pass = checkNotNull(pass);
return this;
} | [
"public",
"ScreenRecordingUploadOptions",
"withAuthCredentials",
"(",
"String",
"user",
",",
"String",
"pass",
")",
"{",
"this",
".",
"user",
"=",
"checkNotNull",
"(",
"user",
")",
";",
"this",
".",
"pass",
"=",
"checkNotNull",
"(",
"pass",
")",
";",
"return... | Sets the credentials for remote ftp/http authentication (if needed).
This option only has an effect if remotePath is provided.
@param user The name of the user for the remote authentication.
@param pass The password for the remote authentication.
@return self instance for chaining. | [
"Sets",
"the",
"credentials",
"for",
"remote",
"ftp",
"/",
"http",
"authentication",
"(",
"if",
"needed",
")",
".",
"This",
"option",
"only",
"has",
"an",
"effect",
"if",
"remotePath",
"is",
"provided",
"."
] | train | https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/screenrecording/ScreenRecordingUploadOptions.java#L55-L59 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java | ImageLoading.saveBmp | public static void saveBmp(Bitmap src, String fileName) throws ImageSaveException {
"""
Saving image in bmp to file
@param src source image
@param fileName destination file name
@throws ImageSaveException if it is unable to save image
"""
try {
BitmapUtil.save(src, fileName);
... | java | public static void saveBmp(Bitmap src, String fileName) throws ImageSaveException {
try {
BitmapUtil.save(src, fileName);
} catch (IOException e) {
throw new ImageSaveException(e);
}
} | [
"public",
"static",
"void",
"saveBmp",
"(",
"Bitmap",
"src",
",",
"String",
"fileName",
")",
"throws",
"ImageSaveException",
"{",
"try",
"{",
"BitmapUtil",
".",
"save",
"(",
"src",
",",
"fileName",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{... | Saving image in bmp to file
@param src source image
@param fileName destination file name
@throws ImageSaveException if it is unable to save image | [
"Saving",
"image",
"in",
"bmp",
"to",
"file"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java#L343-L349 |
nakamura5akihito/six-util | src/main/java/jp/go/aist/six/util/search/RelationalBinding.java | RelationalBinding.lessEqualBinding | public static RelationalBinding lessEqualBinding(
final String property,
final Object value
) {
"""
Creates a 'LESS_EQUAL' binding.
@param property
the property.
@param value
the value to which the property should be related.
@return
a 'LESS_EQUAL' binding.
"""
... | java | public static RelationalBinding lessEqualBinding(
final String property,
final Object value
)
{
return (new RelationalBinding( property, Relation.LESS_EQUAL, value ));
} | [
"public",
"static",
"RelationalBinding",
"lessEqualBinding",
"(",
"final",
"String",
"property",
",",
"final",
"Object",
"value",
")",
"{",
"return",
"(",
"new",
"RelationalBinding",
"(",
"property",
",",
"Relation",
".",
"LESS_EQUAL",
",",
"value",
")",
")",
... | Creates a 'LESS_EQUAL' binding.
@param property
the property.
@param value
the value to which the property should be related.
@return
a 'LESS_EQUAL' binding. | [
"Creates",
"a",
"LESS_EQUAL",
"binding",
"."
] | train | https://github.com/nakamura5akihito/six-util/blob/a6db388a345e220cea2b1fa6324d15c80c6278b6/src/main/java/jp/go/aist/six/util/search/RelationalBinding.java#L110-L116 |
OpenLiberty/open-liberty | dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java | J2EEManagementObjectNameFactory.createResourceObjectName | public static ObjectName createResourceObjectName(String serverName, String resourceType, String keyName) {
"""
Creates a Resource ObjectName for a Resource MBean
@param serverName
@param keyName
@return ObjectName is the JSR77 spec naming convention for Resource MBeans
"""
ObjectName objectName;
... | java | public static ObjectName createResourceObjectName(String serverName, String resourceType, String keyName) {
ObjectName objectName;
Hashtable<String, String> props = new Hashtable<String, String>();
props.put(TYPE_SERVER, serverName);
objectName = createObjectName(resourceType, keyName, ... | [
"public",
"static",
"ObjectName",
"createResourceObjectName",
"(",
"String",
"serverName",
",",
"String",
"resourceType",
",",
"String",
"keyName",
")",
"{",
"ObjectName",
"objectName",
";",
"Hashtable",
"<",
"String",
",",
"String",
">",
"props",
"=",
"new",
"H... | Creates a Resource ObjectName for a Resource MBean
@param serverName
@param keyName
@return ObjectName is the JSR77 spec naming convention for Resource MBeans | [
"Creates",
"a",
"Resource",
"ObjectName",
"for",
"a",
"Resource",
"MBean"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java#L200-L209 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ChangesHolder.java | ChangesHolder.writeValue | private static void writeValue(ObjectOutput out, Fieldable field) throws IOException {
"""
Serialize the value into the given {@link ObjectOutput}
@param out the stream in which we serialize the value
@param field the field from which we extract the value
@throws IOException if the value could not be serialized... | java | private static void writeValue(ObjectOutput out, Fieldable field) throws IOException
{
Object o = field.stringValue();
if (o != null)
{
// Use writeObject instead of writeUTF because the value could contain unsupported
// characters
out.writeObject(o);
return;
... | [
"private",
"static",
"void",
"writeValue",
"(",
"ObjectOutput",
"out",
",",
"Fieldable",
"field",
")",
"throws",
"IOException",
"{",
"Object",
"o",
"=",
"field",
".",
"stringValue",
"(",
")",
";",
"if",
"(",
"o",
"!=",
"null",
")",
"{",
"// Use writeObject... | Serialize the value into the given {@link ObjectOutput}
@param out the stream in which we serialize the value
@param field the field from which we extract the value
@throws IOException if the value could not be serialized | [
"Serialize",
"the",
"value",
"into",
"the",
"given",
"{"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ChangesHolder.java#L322-L340 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentCurrentBillingFeaturesInner.java | ComponentCurrentBillingFeaturesInner.updateAsync | public Observable<ApplicationInsightsComponentBillingFeaturesInner> updateAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentBillingFeaturesInner billingFeaturesProperties) {
"""
Update current billing features for an Application Insights component.
@param resourceGroupName The nam... | java | public Observable<ApplicationInsightsComponentBillingFeaturesInner> updateAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentBillingFeaturesInner billingFeaturesProperties) {
return updateWithServiceResponseAsync(resourceGroupName, resourceName, billingFeaturesProperties).map(new F... | [
"public",
"Observable",
"<",
"ApplicationInsightsComponentBillingFeaturesInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ApplicationInsightsComponentBillingFeaturesInner",
"billingFeaturesProperties",
")",
"{",
"return",
"updat... | Update current billing features for an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param billingFeaturesProperties Properties that need to be specified to update billing features for an Applicatio... | [
"Update",
"current",
"billing",
"features",
"for",
"an",
"Application",
"Insights",
"component",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentCurrentBillingFeaturesInner.java#L191-L198 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/provisioning/ObjectsApi.java | ObjectsApi.searchSkills | public Results<Skill> searchSkills(Integer limit, Integer offset, String searchTerm, String searchKey, String matchMethod, String sortKey, Boolean sortAscending, String sortMethod, Boolean inUse) throws ProvisioningApiException {
"""
Get Skills.
Get Skills from Configuration Server with the specified filters.
@p... | java | public Results<Skill> searchSkills(Integer limit, Integer offset, String searchTerm, String searchKey, String matchMethod, String sortKey, Boolean sortAscending, String sortMethod, Boolean inUse) throws ProvisioningApiException {
try {
GetObjectsSuccessResponse resp = objectsApi.getObject(
"dn-groups",
... | [
"public",
"Results",
"<",
"Skill",
">",
"searchSkills",
"(",
"Integer",
"limit",
",",
"Integer",
"offset",
",",
"String",
"searchTerm",
",",
"String",
"searchKey",
",",
"String",
"matchMethod",
",",
"String",
"sortKey",
",",
"Boolean",
"sortAscending",
",",
"S... | Get Skills.
Get Skills from Configuration Server with the specified filters.
@param limit The number of objects the Provisioning API should return. (optional)
@param offset The number of matches the Provisioning API should skip in the returned objects. (optional)
@param searchTerm The term that you want to search for i... | [
"Get",
"Skills",
".",
"Get",
"Skills",
"from",
"Configuration",
"Server",
"with",
"the",
"specified",
"filters",
"."
] | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/ObjectsApi.java#L312-L343 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java | DateFunctions.dateAddStr | public static Expression dateAddStr(String expression, int n, DatePart part) {
"""
Returned expression results in Performs Date arithmetic. n and part are used to define an interval or duration,
which is then added (or subtracted) to the date string in a supported format, returning the result.
"""
ret... | java | public static Expression dateAddStr(String expression, int n, DatePart part) {
return dateAddStr(x(expression), n, part);
} | [
"public",
"static",
"Expression",
"dateAddStr",
"(",
"String",
"expression",
",",
"int",
"n",
",",
"DatePart",
"part",
")",
"{",
"return",
"dateAddStr",
"(",
"x",
"(",
"expression",
")",
",",
"n",
",",
"part",
")",
";",
"}"
] | Returned expression results in Performs Date arithmetic. n and part are used to define an interval or duration,
which is then added (or subtracted) to the date string in a supported format, returning the result. | [
"Returned",
"expression",
"results",
"in",
"Performs",
"Date",
"arithmetic",
".",
"n",
"and",
"part",
"are",
"used",
"to",
"define",
"an",
"interval",
"or",
"duration",
"which",
"is",
"then",
"added",
"(",
"or",
"subtracted",
")",
"to",
"the",
"date",
"str... | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java#L98-L100 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfOutline.java | PdfOutline.initOutline | void initOutline(PdfOutline parent, String title, boolean open) {
"""
Helper for the constructors.
@param parent the parent outline
@param title the title for this outline
@param open <CODE>true</CODE> if the children are visible
"""
this.open = open;
this.parent = parent;
writer = p... | java | void initOutline(PdfOutline parent, String title, boolean open) {
this.open = open;
this.parent = parent;
writer = parent.writer;
put(PdfName.TITLE, new PdfString(title, PdfObject.TEXT_UNICODE));
parent.addKid(this);
if (destination != null && !destination.hasPage()) // b... | [
"void",
"initOutline",
"(",
"PdfOutline",
"parent",
",",
"String",
"title",
",",
"boolean",
"open",
")",
"{",
"this",
".",
"open",
"=",
"open",
";",
"this",
".",
"parent",
"=",
"parent",
";",
"writer",
"=",
"parent",
".",
"writer",
";",
"put",
"(",
"... | Helper for the constructors.
@param parent the parent outline
@param title the title for this outline
@param open <CODE>true</CODE> if the children are visible | [
"Helper",
"for",
"the",
"constructors",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfOutline.java#L324-L332 |
iipc/webarchive-commons | src/main/java/org/archive/io/ArchiveReader.java | ArchiveReader.getInputStream | protected InputStream getInputStream(final File f, final long offset)
throws IOException {
"""
Convenience method for constructors.
@param f File to read.
@param offset Offset at which to start reading.
@return InputStream to read from.
@throws IOException If failed open or fail to get a memory
mapped b... | java | protected InputStream getInputStream(final File f, final long offset)
throws IOException {
FileInputStream fin = new FileInputStream(f);
return new BufferedInputStream(fin);
} | [
"protected",
"InputStream",
"getInputStream",
"(",
"final",
"File",
"f",
",",
"final",
"long",
"offset",
")",
"throws",
"IOException",
"{",
"FileInputStream",
"fin",
"=",
"new",
"FileInputStream",
"(",
"f",
")",
";",
"return",
"new",
"BufferedInputStream",
"(",
... | Convenience method for constructors.
@param f File to read.
@param offset Offset at which to start reading.
@return InputStream to read from.
@throws IOException If failed open or fail to get a memory
mapped byte buffer on file. | [
"Convenience",
"method",
"for",
"constructors",
"."
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/ArchiveReader.java#L126-L130 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/Stoichiometry.java | Stoichiometry.setStrategy | public void setStrategy(StringOverflowStrategy strategy) {
"""
Change string representation of a stoichiometry in case number of clusters exceeds number of letters in the alphabet.
This action may invalidate alphas already assigned to the clusters.
@param strategy
{@link StringOverflowStrategy} used in this sto... | java | public void setStrategy(StringOverflowStrategy strategy) {
if(strategy==StringOverflowStrategy.CUSTOM) {
throw new IllegalArgumentException("Set this strategy by providing a function of the type Function<List<SubunitCluster>,String>.");
}
if(this.strategy != strategy) {
this.strategy = strategy;
if(orde... | [
"public",
"void",
"setStrategy",
"(",
"StringOverflowStrategy",
"strategy",
")",
"{",
"if",
"(",
"strategy",
"==",
"StringOverflowStrategy",
".",
"CUSTOM",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Set this strategy by providing a function of the type Fu... | Change string representation of a stoichiometry in case number of clusters exceeds number of letters in the alphabet.
This action may invalidate alphas already assigned to the clusters.
@param strategy
{@link StringOverflowStrategy} used in this stoichiometry
to construct human-readable representation in case number
of... | [
"Change",
"string",
"representation",
"of",
"a",
"stoichiometry",
"in",
"case",
"number",
"of",
"clusters",
"exceeds",
"number",
"of",
"letters",
"in",
"the",
"alphabet",
".",
"This",
"action",
"may",
"invalidate",
"alphas",
"already",
"assigned",
"to",
"the",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/Stoichiometry.java#L285-L295 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageLoaderCurrent.java | ImageLoaderCurrent.processINodes | private void processINodes(DataInputStream in, ImageVisitor v,
long numInodes, boolean skipBlocks) throws IOException {
"""
Process the INode records stored in the fsimage.
@param in Datastream to process
@param v Visitor to walk over INodes
@param numInodes Number of INodes stored in file
@param skipB... | java | private void processINodes(DataInputStream in, ImageVisitor v,
long numInodes, boolean skipBlocks) throws IOException {
v.visitEnclosingElement(ImageElement.INODES,
ImageElement.NUM_INODES, numInodes);
if (LayoutVersion.supports(Feature.FSIMAGE_NAME_OPTIMIZATION, imageVersion)) {
proces... | [
"private",
"void",
"processINodes",
"(",
"DataInputStream",
"in",
",",
"ImageVisitor",
"v",
",",
"long",
"numInodes",
",",
"boolean",
"skipBlocks",
")",
"throws",
"IOException",
"{",
"v",
".",
"visitEnclosingElement",
"(",
"ImageElement",
".",
"INODES",
",",
"Im... | Process the INode records stored in the fsimage.
@param in Datastream to process
@param v Visitor to walk over INodes
@param numInodes Number of INodes stored in file
@param skipBlocks Process all the blocks within the INode?
@throws VisitException
@throws IOException | [
"Process",
"the",
"INode",
"records",
"stored",
"in",
"the",
"fsimage",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageLoaderCurrent.java#L322-L335 |
xerial/snappy-java | src/main/java/org/xerial/snappy/Snappy.java | Snappy.rawUncompress | public static int rawUncompress(byte[] input, int inputOffset, int inputLength, Object output, int outputOffset)
throws IOException {
"""
Uncompress the content in the input buffer. The uncompressed data is
written to the output buffer.
<p/>
Note that if you pass the wrong data or the range [inputOf... | java | public static int rawUncompress(byte[] input, int inputOffset, int inputLength, Object output, int outputOffset)
throws IOException
{
if (input == null || output == null) {
throw new NullPointerException("input or output is null");
}
return impl.rawUncompress(input, i... | [
"public",
"static",
"int",
"rawUncompress",
"(",
"byte",
"[",
"]",
"input",
",",
"int",
"inputOffset",
",",
"int",
"inputLength",
",",
"Object",
"output",
",",
"int",
"outputOffset",
")",
"throws",
"IOException",
"{",
"if",
"(",
"input",
"==",
"null",
"||"... | Uncompress the content in the input buffer. The uncompressed data is
written to the output buffer.
<p/>
Note that if you pass the wrong data or the range [inputOffset,
inputOffset + inputLength) that cannot be uncompressed, your JVM might
crash due to the access violation exception issued in the native code
written in ... | [
"Uncompress",
"the",
"content",
"in",
"the",
"input",
"buffer",
".",
"The",
"uncompressed",
"data",
"is",
"written",
"to",
"the",
"output",
"buffer",
".",
"<p",
"/",
">",
"Note",
"that",
"if",
"you",
"pass",
"the",
"wrong",
"data",
"or",
"the",
"range",
... | train | https://github.com/xerial/snappy-java/blob/9df6ed7bbce88186c82f2e7cdcb7b974421b3340/src/main/java/org/xerial/snappy/Snappy.java#L468-L475 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java | VirtualNetworkTapsInner.updateTags | public VirtualNetworkTapInner updateTags(String resourceGroupName, String tapName) {
"""
Updates an VirtualNetworkTap tags.
@param resourceGroupName The name of the resource group.
@param tapName The name of the tap.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudExcep... | java | public VirtualNetworkTapInner updateTags(String resourceGroupName, String tapName) {
return updateTagsWithServiceResponseAsync(resourceGroupName, tapName).toBlocking().last().body();
} | [
"public",
"VirtualNetworkTapInner",
"updateTags",
"(",
"String",
"resourceGroupName",
",",
"String",
"tapName",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"tapName",
")",
".",
"toBlocking",
"(",
")",
".",
"last",
"(",
")... | Updates an VirtualNetworkTap tags.
@param resourceGroupName The name of the resource group.
@param tapName The name of the tap.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked... | [
"Updates",
"an",
"VirtualNetworkTap",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java#L529-L531 |
allengeorge/libraft | libraft-core/src/main/java/io/libraft/algorithm/RaftAlgorithm.java | RaftAlgorithm.becomeLeader | synchronized void becomeLeader(long expectedCurrentTerm) throws StorageException {
"""
Transition this server from {@link Role#CANDIDATE} to {@link Role#LEADER}.
<p/>
<strong>This method is package-private for testing
reasons only!</strong> It should <strong>never</strong>
be called in a non-test context!
@... | java | synchronized void becomeLeader(long expectedCurrentTerm) throws StorageException {
long currentTerm = store.getCurrentTerm();
checkArgument(currentTerm == expectedCurrentTerm, "currentTerm:%s expectedCurrentTerm:%s", currentTerm, expectedCurrentTerm);
String votedFor = store.getVotedFor(expect... | [
"synchronized",
"void",
"becomeLeader",
"(",
"long",
"expectedCurrentTerm",
")",
"throws",
"StorageException",
"{",
"long",
"currentTerm",
"=",
"store",
".",
"getCurrentTerm",
"(",
")",
";",
"checkArgument",
"(",
"currentTerm",
"==",
"expectedCurrentTerm",
",",
"\"c... | Transition this server from {@link Role#CANDIDATE} to {@link Role#LEADER}.
<p/>
<strong>This method is package-private for testing
reasons only!</strong> It should <strong>never</strong>
be called in a non-test context!
@param expectedCurrentTerm election term in which this {@code RaftAlgorithm} instance should
be lea... | [
"Transition",
"this",
"server",
"from",
"{",
"@link",
"Role#CANDIDATE",
"}",
"to",
"{",
"@link",
"Role#LEADER",
"}",
".",
"<p",
"/",
">",
"<strong",
">",
"This",
"method",
"is",
"package",
"-",
"private",
"for",
"testing",
"reasons",
"only!<",
"/",
"strong... | train | https://github.com/allengeorge/libraft/blob/00d68bb5e68d4020af59df3c8a9a14380108ac89/libraft-core/src/main/java/io/libraft/algorithm/RaftAlgorithm.java#L1125-L1169 |
tweea/matrixjavalib-main-web | src/main/java/net/matrix/web/http/HTTPs.java | HTTPs.encodeHttpBasic | public static String encodeHttpBasic(final String username, final String password) {
"""
客户端对 Http Basic 验证的 Header 进行编码。
@param username
用户名
@param password
密码
@return 编码字符串
"""
String encode = username + ':' + password;
return "Basic " + Base64.encodeBase64String(encode.getBytes(Charsets.UTF_8));
... | java | public static String encodeHttpBasic(final String username, final String password) {
String encode = username + ':' + password;
return "Basic " + Base64.encodeBase64String(encode.getBytes(Charsets.UTF_8));
} | [
"public",
"static",
"String",
"encodeHttpBasic",
"(",
"final",
"String",
"username",
",",
"final",
"String",
"password",
")",
"{",
"String",
"encode",
"=",
"username",
"+",
"'",
"'",
"+",
"password",
";",
"return",
"\"Basic \"",
"+",
"Base64",
".",
"encodeBa... | 客户端对 Http Basic 验证的 Header 进行编码。
@param username
用户名
@param password
密码
@return 编码字符串 | [
"客户端对",
"Http",
"Basic",
"验证的",
"Header",
"进行编码。"
] | train | https://github.com/tweea/matrixjavalib-main-web/blob/c3386e728e6f97ff3a3d2cd94769e82840b1266f/src/main/java/net/matrix/web/http/HTTPs.java#L55-L58 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.waitForText | public <T extends TextView> T waitForText(Class<T> classToFilterBy, String text, int expectedMinimumNumberOfMatches, long timeout, boolean scroll, boolean onlyVisible, boolean hardStoppage) {
"""
Waits for a text to be shown.
@param classToFilterBy the class to filter by
@param text the text that needs to be s... | java | public <T extends TextView> T waitForText(Class<T> classToFilterBy, String text, int expectedMinimumNumberOfMatches, long timeout, boolean scroll, boolean onlyVisible, boolean hardStoppage) {
final long endTime = SystemClock.uptimeMillis() + timeout;
while (true) {
final boolean timedOut = SystemClock.uptimeMil... | [
"public",
"<",
"T",
"extends",
"TextView",
">",
"T",
"waitForText",
"(",
"Class",
"<",
"T",
">",
"classToFilterBy",
",",
"String",
"text",
",",
"int",
"expectedMinimumNumberOfMatches",
",",
"long",
"timeout",
",",
"boolean",
"scroll",
",",
"boolean",
"onlyVisi... | Waits for a text to be shown.
@param classToFilterBy the class to filter by
@param text the text that needs to be shown, specified as a regular expression.
@param expectedMinimumNumberOfMatches the minimum number of matches of text that must be shown. {@code 0} means any number of matches
@param timeout the amount of ... | [
"Waits",
"for",
"a",
"text",
"to",
"be",
"shown",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L615-L635 |
Pi4J/pi4j | pi4j-core/src/main/java/com/pi4j/jni/Serial.java | Serial.write | public synchronized static void write(int fd, CharBuffer ... data) throws IllegalStateException, IOException {
"""
<p>Sends one or more ASCII CharBuffers to the serial port/device identified by the given file descriptor.</p>
@param fd
The file descriptor of the serial port/device.
@param data
One or more ASC... | java | public synchronized static void write(int fd, CharBuffer ... data) throws IllegalStateException, IOException {
write(fd, StandardCharsets.US_ASCII, data);
} | [
"public",
"synchronized",
"static",
"void",
"write",
"(",
"int",
"fd",
",",
"CharBuffer",
"...",
"data",
")",
"throws",
"IllegalStateException",
",",
"IOException",
"{",
"write",
"(",
"fd",
",",
"StandardCharsets",
".",
"US_ASCII",
",",
"data",
")",
";",
"}"... | <p>Sends one or more ASCII CharBuffers to the serial port/device identified by the given file descriptor.</p>
@param fd
The file descriptor of the serial port/device.
@param data
One or more ASCII CharBuffers (or an array) of data to be transmitted. (variable-length-argument) | [
"<p",
">",
"Sends",
"one",
"or",
"more",
"ASCII",
"CharBuffers",
"to",
"the",
"serial",
"port",
"/",
"device",
"identified",
"by",
"the",
"given",
"file",
"descriptor",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-core/src/main/java/com/pi4j/jni/Serial.java#L840-L842 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/JUnit3FloatingPointComparisonWithoutDelta.java | JUnit3FloatingPointComparisonWithoutDelta.isNumeric | private boolean isNumeric(VisitorState state, Type type) {
"""
Determines if the type is a numeric type, including reference types.
<p>Type.isNumeric() does not handle reference types properly.
"""
Type trueType = unboxedTypeOrType(state, type);
return trueType.isNumeric();
} | java | private boolean isNumeric(VisitorState state, Type type) {
Type trueType = unboxedTypeOrType(state, type);
return trueType.isNumeric();
} | [
"private",
"boolean",
"isNumeric",
"(",
"VisitorState",
"state",
",",
"Type",
"type",
")",
"{",
"Type",
"trueType",
"=",
"unboxedTypeOrType",
"(",
"state",
",",
"type",
")",
";",
"return",
"trueType",
".",
"isNumeric",
"(",
")",
";",
"}"
] | Determines if the type is a numeric type, including reference types.
<p>Type.isNumeric() does not handle reference types properly. | [
"Determines",
"if",
"the",
"type",
"is",
"a",
"numeric",
"type",
"including",
"reference",
"types",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/JUnit3FloatingPointComparisonWithoutDelta.java#L135-L138 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsOuTree.java | CmsOuTree.addChildrenForGroupsNode | private void addChildrenForGroupsNode(I_CmsOuTreeType type, String ouItem) {
"""
Add groups for given group parent item.
@param type the tree type
@param ouItem group parent item
"""
try {
// Cut of type-specific prefix from ouItem with substring()
List<CmsGroup> groups = m... | java | private void addChildrenForGroupsNode(I_CmsOuTreeType type, String ouItem) {
try {
// Cut of type-specific prefix from ouItem with substring()
List<CmsGroup> groups = m_app.readGroupsForOu(m_cms, ouItem.substring(1), type, false);
for (CmsGroup group : groups) {
... | [
"private",
"void",
"addChildrenForGroupsNode",
"(",
"I_CmsOuTreeType",
"type",
",",
"String",
"ouItem",
")",
"{",
"try",
"{",
"// Cut of type-specific prefix from ouItem with substring()",
"List",
"<",
"CmsGroup",
">",
"groups",
"=",
"m_app",
".",
"readGroupsForOu",
"("... | Add groups for given group parent item.
@param type the tree type
@param ouItem group parent item | [
"Add",
"groups",
"for",
"given",
"group",
"parent",
"item",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsOuTree.java#L257-L277 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/MapView.java | MapView.setTileProvider | public void setTileProvider(final MapTileProviderBase base) {
"""
enables you to programmatically set the tile provider (zip, assets, sqlite, etc)
@since 4.4
@param base
@see MapTileProviderBasic
"""
this.mTileProvider.detach();
mTileProvider.clearTileCache();
this.mTileProvider=base;
mTileProvider... | java | public void setTileProvider(final MapTileProviderBase base){
this.mTileProvider.detach();
mTileProvider.clearTileCache();
this.mTileProvider=base;
mTileProvider.getTileRequestCompleteHandlers().add(mTileRequestCompleteHandler);
updateTileSizeForDensity(mTileProvider.getTileSource());
this.mMapOverlay = ne... | [
"public",
"void",
"setTileProvider",
"(",
"final",
"MapTileProviderBase",
"base",
")",
"{",
"this",
".",
"mTileProvider",
".",
"detach",
"(",
")",
";",
"mTileProvider",
".",
"clearTileCache",
"(",
")",
";",
"this",
".",
"mTileProvider",
"=",
"base",
";",
"mT... | enables you to programmatically set the tile provider (zip, assets, sqlite, etc)
@since 4.4
@param base
@see MapTileProviderBasic | [
"enables",
"you",
"to",
"programmatically",
"set",
"the",
"tile",
"provider",
"(",
"zip",
"assets",
"sqlite",
"etc",
")"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/MapView.java#L1768-L1779 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_easyHunting_serviceName_hunting_agent_agentId_eventToken_GET | public OvhEventToken billingAccount_easyHunting_serviceName_hunting_agent_agentId_eventToken_GET(String billingAccount, String serviceName, Long agentId) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}/easyHunting/{serviceName}/hunting/agent/{agentId}/eventToken
@param... | java | public OvhEventToken billingAccount_easyHunting_serviceName_hunting_agent_agentId_eventToken_GET(String billingAccount, String serviceName, Long agentId) throws IOException {
String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/hunting/agent/{agentId}/eventToken";
StringBuilder sb = path(qPath, bil... | [
"public",
"OvhEventToken",
"billingAccount_easyHunting_serviceName_hunting_agent_agentId_eventToken_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"agentId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAcco... | Get this object properties
REST: GET /telephony/{billingAccount}/easyHunting/{serviceName}/hunting/agent/{agentId}/eventToken
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param agentId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L2543-L2548 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java | ApplicationSession.setUserAttributes | public void setUserAttributes(Map<String, Object> attributes) {
"""
Add the given key/value pairs to the user attributes.
@param attributes
a map of key/value pairs.
"""
userAttributes.putAll(attributes);
propertyChangeSupport.firePropertyChange(USER_ATTRIBUTES, null, userAttributes);
} | java | public void setUserAttributes(Map<String, Object> attributes)
{
userAttributes.putAll(attributes);
propertyChangeSupport.firePropertyChange(USER_ATTRIBUTES, null, userAttributes);
} | [
"public",
"void",
"setUserAttributes",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
")",
"{",
"userAttributes",
".",
"putAll",
"(",
"attributes",
")",
";",
"propertyChangeSupport",
".",
"firePropertyChange",
"(",
"USER_ATTRIBUTES",
",",
"null",
"... | Add the given key/value pairs to the user attributes.
@param attributes
a map of key/value pairs. | [
"Add",
"the",
"given",
"key",
"/",
"value",
"pairs",
"to",
"the",
"user",
"attributes",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java#L230-L234 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/idemix/WeakBB.java | WeakBB.weakBBSign | public static ECP weakBBSign(BIG sk, BIG m) {
"""
Produces a WBB signature for a give message
@param sk Secret key
@param m Message
@return Signature
"""
BIG exp = IdemixUtils.modAdd(sk, m, IdemixUtils.GROUP_ORDER);
exp.invmodp(IdemixUtils.GROUP_ORDER);
return IdemixUtils.genG1.m... | java | public static ECP weakBBSign(BIG sk, BIG m) {
BIG exp = IdemixUtils.modAdd(sk, m, IdemixUtils.GROUP_ORDER);
exp.invmodp(IdemixUtils.GROUP_ORDER);
return IdemixUtils.genG1.mul(exp);
} | [
"public",
"static",
"ECP",
"weakBBSign",
"(",
"BIG",
"sk",
",",
"BIG",
"m",
")",
"{",
"BIG",
"exp",
"=",
"IdemixUtils",
".",
"modAdd",
"(",
"sk",
",",
"m",
",",
"IdemixUtils",
".",
"GROUP_ORDER",
")",
";",
"exp",
".",
"invmodp",
"(",
"IdemixUtils",
"... | Produces a WBB signature for a give message
@param sk Secret key
@param m Message
@return Signature | [
"Produces",
"a",
"WBB",
"signature",
"for",
"a",
"give",
"message"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/idemix/WeakBB.java#L71-L76 |
phax/ph-web | ph-servlet/src/main/java/com/helger/servlet/response/UnifiedResponse.java | UnifiedResponse.setContent | @Nonnull
public final UnifiedResponse setContent (@Nonnull final byte [] aContent) {
"""
Set the response content. To return an empty response pass in a new empty
array, but not <code>null</code>.
@param aContent
The content to be returned. Is <b>not</b> copied inside! May not be
<code>null</code> but mayb... | java | @Nonnull
public final UnifiedResponse setContent (@Nonnull final byte [] aContent)
{
ValueEnforcer.notNull (aContent, "Content");
return setContent (aContent, 0, aContent.length);
} | [
"@",
"Nonnull",
"public",
"final",
"UnifiedResponse",
"setContent",
"(",
"@",
"Nonnull",
"final",
"byte",
"[",
"]",
"aContent",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aContent",
",",
"\"Content\"",
")",
";",
"return",
"setContent",
"(",
"aContent",
... | Set the response content. To return an empty response pass in a new empty
array, but not <code>null</code>.
@param aContent
The content to be returned. Is <b>not</b> copied inside! May not be
<code>null</code> but maybe empty.
@return this | [
"Set",
"the",
"response",
"content",
".",
"To",
"return",
"an",
"empty",
"response",
"pass",
"in",
"a",
"new",
"empty",
"array",
"but",
"not",
"<code",
">",
"null<",
"/",
"code",
">",
"."
] | train | https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-servlet/src/main/java/com/helger/servlet/response/UnifiedResponse.java#L433-L438 |
voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.dumpStoreDefsToFile | public static void dumpStoreDefsToFile(String outputDirName,
String fileName,
List<StoreDefinition> storeDefs) {
"""
Prints a stores xml to a file.
@param outputDirName
@param fileName
@param list of storeDefs
"""
... | java | public static void dumpStoreDefsToFile(String outputDirName,
String fileName,
List<StoreDefinition> storeDefs) {
if(outputDirName != null) {
File outputDir = new File(outputDirName);
if(!outputDir.exis... | [
"public",
"static",
"void",
"dumpStoreDefsToFile",
"(",
"String",
"outputDirName",
",",
"String",
"fileName",
",",
"List",
"<",
"StoreDefinition",
">",
"storeDefs",
")",
"{",
"if",
"(",
"outputDirName",
"!=",
"null",
")",
"{",
"File",
"outputDir",
"=",
"new",
... | Prints a stores xml to a file.
@param outputDirName
@param fileName
@param list of storeDefs | [
"Prints",
"a",
"stores",
"xml",
"to",
"a",
"file",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L569-L586 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/SkewGeneralizedNormalDistribution.java | SkewGeneralizedNormalDistribution.quantile | public static double quantile(double x, double mu, double sigma, double skew) {
"""
Inverse cumulative probability density function (probit) of a normal
distribution.
@param x value to evaluate probit function at
@param mu Mean value
@param sigma Standard deviation.
@return The probit of the given normal di... | java | public static double quantile(double x, double mu, double sigma, double skew) {
x = NormalDistribution.standardNormalQuantile(x);
if(Math.abs(skew) > 0.) {
x = (1. - FastMath.exp(-skew * x)) / skew;
}
return mu + sigma * x;
} | [
"public",
"static",
"double",
"quantile",
"(",
"double",
"x",
",",
"double",
"mu",
",",
"double",
"sigma",
",",
"double",
"skew",
")",
"{",
"x",
"=",
"NormalDistribution",
".",
"standardNormalQuantile",
"(",
"x",
")",
";",
"if",
"(",
"Math",
".",
"abs",
... | Inverse cumulative probability density function (probit) of a normal
distribution.
@param x value to evaluate probit function at
@param mu Mean value
@param sigma Standard deviation.
@return The probit of the given normal distribution at x. | [
"Inverse",
"cumulative",
"probability",
"density",
"function",
"(",
"probit",
")",
"of",
"a",
"normal",
"distribution",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/SkewGeneralizedNormalDistribution.java#L250-L256 |
netplex/json-smart-v2 | json-smart/src/main/java/net/minidev/json/JSONArray.java | JSONArray.toJSONString | public static String toJSONString(List<? extends Object> list, JSONStyle compression) {
"""
Convert a list to JSON text. The result is a JSON array. If this list is
also a JSONAware, JSONAware specific behaviours will be omitted at this
top level.
@see net.minidev.json.JSONValue#toJSONString(Object)
@param... | java | public static String toJSONString(List<? extends Object> list, JSONStyle compression) {
StringBuilder sb = new StringBuilder();
try {
writeJSONString(list, sb, compression);
} catch (IOException e) {
// Can not append on a string builder
}
return sb.toString();
} | [
"public",
"static",
"String",
"toJSONString",
"(",
"List",
"<",
"?",
"extends",
"Object",
">",
"list",
",",
"JSONStyle",
"compression",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"try",
"{",
"writeJSONString",
"(",
"list",
... | Convert a list to JSON text. The result is a JSON array. If this list is
also a JSONAware, JSONAware specific behaviours will be omitted at this
top level.
@see net.minidev.json.JSONValue#toJSONString(Object)
@param list
@param compression
Indicate compression level
@return JSON text, or "null" if list is null. | [
"Convert",
"a",
"list",
"to",
"JSON",
"text",
".",
"The",
"result",
"is",
"a",
"JSON",
"array",
".",
"If",
"this",
"list",
"is",
"also",
"a",
"JSONAware",
"JSONAware",
"specific",
"behaviours",
"will",
"be",
"omitted",
"at",
"this",
"top",
"level",
"."
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/JSONArray.java#L49-L57 |
apereo/cas | support/cas-server-support-consent-couchdb/src/main/java/org/apereo/cas/couchdb/consent/ConsentDecisionCouchDbRepository.java | ConsentDecisionCouchDbRepository.findByPrincipalAndId | @View(name = "by_principal_and_id", map = "function(doc) {
"""
Find a consent decision by +long+ ID and principal name. For CouchDb, this ID is randomly generated and the pair should be unique, with a very high
probability, but is not guaranteed. This method is mostly only used by tests.
@param principal User to... | java | @View(name = "by_principal_and_id", map = "function(doc) {emit([doc.principal, doc.id], doc)}")
public CouchDbConsentDecision findByPrincipalAndId(final String principal, final long id) {
val view = createQuery("by_principal_and_id").key(ComplexKey.of(principal, id)).limit(1).includeDocs(true);
retu... | [
"@",
"View",
"(",
"name",
"=",
"\"by_principal_and_id\"",
",",
"map",
"=",
"\"function(doc) {emit([doc.principal, doc.id], doc)}\"",
")",
"public",
"CouchDbConsentDecision",
"findByPrincipalAndId",
"(",
"final",
"String",
"principal",
",",
"final",
"long",
"id",
")",
"{... | Find a consent decision by +long+ ID and principal name. For CouchDb, this ID is randomly generated and the pair should be unique, with a very high
probability, but is not guaranteed. This method is mostly only used by tests.
@param principal User to search for.
@param id decision id to search for.
@return First consen... | [
"Find",
"a",
"consent",
"decision",
"by",
"+",
"long",
"+",
"ID",
"and",
"principal",
"name",
".",
"For",
"CouchDb",
"this",
"ID",
"is",
"randomly",
"generated",
"and",
"the",
"pair",
"should",
"be",
"unique",
"with",
"a",
"very",
"high",
"probability",
... | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-consent-couchdb/src/main/java/org/apereo/cas/couchdb/consent/ConsentDecisionCouchDbRepository.java#L75-L79 |
jenkinsci/jenkins | core/src/main/java/hudson/model/ItemGroupMixIn.java | ItemGroupMixIn.redirectAfterCreateItem | protected String redirectAfterCreateItem(StaplerRequest req, TopLevelItem result) throws IOException {
"""
Computes the redirection target URL for the newly created {@link TopLevelItem}.
"""
return req.getContextPath()+'/'+result.getUrl()+"configure";
} | java | protected String redirectAfterCreateItem(StaplerRequest req, TopLevelItem result) throws IOException {
return req.getContextPath()+'/'+result.getUrl()+"configure";
} | [
"protected",
"String",
"redirectAfterCreateItem",
"(",
"StaplerRequest",
"req",
",",
"TopLevelItem",
"result",
")",
"throws",
"IOException",
"{",
"return",
"req",
".",
"getContextPath",
"(",
")",
"+",
"'",
"'",
"+",
"result",
".",
"getUrl",
"(",
")",
"+",
"\... | Computes the redirection target URL for the newly created {@link TopLevelItem}. | [
"Computes",
"the",
"redirection",
"target",
"URL",
"for",
"the",
"newly",
"created",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ItemGroupMixIn.java#L216-L218 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.methodInvocation | public static Matcher<ExpressionTree> methodInvocation(
final Matcher<ExpressionTree> methodSelectMatcher) {
"""
Matches an AST node if it is a method invocation and the method select matches {@code
methodSelectMatcher}. Ignores any arguments.
"""
return new Matcher<ExpressionTree>() {
@Overri... | java | public static Matcher<ExpressionTree> methodInvocation(
final Matcher<ExpressionTree> methodSelectMatcher) {
return new Matcher<ExpressionTree>() {
@Override
public boolean matches(ExpressionTree expressionTree, VisitorState state) {
if (!(expressionTree instanceof MethodInvocationTree)) {... | [
"public",
"static",
"Matcher",
"<",
"ExpressionTree",
">",
"methodInvocation",
"(",
"final",
"Matcher",
"<",
"ExpressionTree",
">",
"methodSelectMatcher",
")",
"{",
"return",
"new",
"Matcher",
"<",
"ExpressionTree",
">",
"(",
")",
"{",
"@",
"Override",
"public",... | Matches an AST node if it is a method invocation and the method select matches {@code
methodSelectMatcher}. Ignores any arguments. | [
"Matches",
"an",
"AST",
"node",
"if",
"it",
"is",
"a",
"method",
"invocation",
"and",
"the",
"method",
"select",
"matches",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L374-L386 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container/src/com/ibm/ws/jpa/container/osgi/internal/JPAComponentImpl.java | JPAComponentImpl.processWebModulePersistenceXml | private void processWebModulePersistenceXml(JPAApplInfo applInfo, ContainerInfo warContainerInfo, ClassLoader warClassLoader) {
"""
Locates and processes all persistence.xml file in a WAR module. <p>
@param applInfo the application archive information
@param module the WAR module archive information
"""
... | java | private void processWebModulePersistenceXml(JPAApplInfo applInfo, ContainerInfo warContainerInfo, ClassLoader warClassLoader) {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled()) {
Tr.entry(tc, "processWebModulePersistenceXml : " + applInfo.... | [
"private",
"void",
"processWebModulePersistenceXml",
"(",
"JPAApplInfo",
"applInfo",
",",
"ContainerInfo",
"warContainerInfo",
",",
"ClassLoader",
"warClassLoader",
")",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"... | Locates and processes all persistence.xml file in a WAR module. <p>
@param applInfo the application archive information
@param module the WAR module archive information | [
"Locates",
"and",
"processes",
"all",
"persistence",
".",
"xml",
"file",
"in",
"a",
"WAR",
"module",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container/src/com/ibm/ws/jpa/container/osgi/internal/JPAComponentImpl.java#L485-L532 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java | SDMath.clipByValue | public SDVariable clipByValue(SDVariable x, double clipValueMin, double clipValueMax) {
"""
Element-wise clipping function:<br>
out[i] = in[i] if in[i] >= clipValueMin and in[i] <= clipValueMax<br>
out[i] = clipValueMin if in[i] < clipValueMin<br>
out[i] = clipValueMax if in[i] > clipValueMax<br>
@param x ... | java | public SDVariable clipByValue(SDVariable x, double clipValueMin, double clipValueMax) {
return clipByValue(null, x, clipValueMin, clipValueMax);
} | [
"public",
"SDVariable",
"clipByValue",
"(",
"SDVariable",
"x",
",",
"double",
"clipValueMin",
",",
"double",
"clipValueMax",
")",
"{",
"return",
"clipByValue",
"(",
"null",
",",
"x",
",",
"clipValueMin",
",",
"clipValueMax",
")",
";",
"}"
] | Element-wise clipping function:<br>
out[i] = in[i] if in[i] >= clipValueMin and in[i] <= clipValueMax<br>
out[i] = clipValueMin if in[i] < clipValueMin<br>
out[i] = clipValueMax if in[i] > clipValueMax<br>
@param x Input variable
@param clipValueMin Minimum value for clipping
@param clipValueMax Maximum val... | [
"Element",
"-",
"wise",
"clipping",
"function",
":",
"<br",
">",
"out",
"[",
"i",
"]",
"=",
"in",
"[",
"i",
"]",
"if",
"in",
"[",
"i",
"]",
">",
"=",
"clipValueMin",
"and",
"in",
"[",
"i",
"]",
"<",
"=",
"clipValueMax<br",
">",
"out",
"[",
"i",... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L447-L449 |
ops4j/org.ops4j.pax.web | pax-web-extender-whiteboard/src/main/java/org/ops4j/pax/web/extender/whiteboard/internal/tracker/AbstractTracker.java | AbstractTracker.createFilter | private static Filter createFilter(final BundleContext bundleContext, final Class<?> trackedClass) {
"""
Creates an OSGi filter for the classes.
@param bundleContext
a bundle context
@param trackedClass
the class being tracked
@return osgi filter
"""
final String filter = "(" + Constants.OBJECTCLASS ... | java | private static Filter createFilter(final BundleContext bundleContext, final Class<?> trackedClass) {
final String filter = "(" + Constants.OBJECTCLASS + "=" + trackedClass.getName() + ")";
try {
return bundleContext.createFilter(filter);
} catch (InvalidSyntaxException e) {
throw new IllegalArgumentExc... | [
"private",
"static",
"Filter",
"createFilter",
"(",
"final",
"BundleContext",
"bundleContext",
",",
"final",
"Class",
"<",
"?",
">",
"trackedClass",
")",
"{",
"final",
"String",
"filter",
"=",
"\"(\"",
"+",
"Constants",
".",
"OBJECTCLASS",
"+",
"\"=\"",
"+",
... | Creates an OSGi filter for the classes.
@param bundleContext
a bundle context
@param trackedClass
the class being tracked
@return osgi filter | [
"Creates",
"an",
"OSGi",
"filter",
"for",
"the",
"classes",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-extender-whiteboard/src/main/java/org/ops4j/pax/web/extender/whiteboard/internal/tracker/AbstractTracker.java#L119-L126 |
linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/stock/ProxyBuilder.java | ProxyBuilder.getInvocationHandler | public static InvocationHandler getInvocationHandler(Object instance) {
"""
Returns the proxy's {@link InvocationHandler}.
@throws IllegalArgumentException if the object supplied is not a proxy created by this class.
"""
try {
Field field = instance.getClass().getDeclaredField(FIELD_NAME... | java | public static InvocationHandler getInvocationHandler(Object instance) {
try {
Field field = instance.getClass().getDeclaredField(FIELD_NAME_HANDLER);
field.setAccessible(true);
return (InvocationHandler) field.get(instance);
} catch (NoSuchFieldException e) {
... | [
"public",
"static",
"InvocationHandler",
"getInvocationHandler",
"(",
"Object",
"instance",
")",
"{",
"try",
"{",
"Field",
"field",
"=",
"instance",
".",
"getClass",
"(",
")",
".",
"getDeclaredField",
"(",
"FIELD_NAME_HANDLER",
")",
";",
"field",
".",
"setAccess... | Returns the proxy's {@link InvocationHandler}.
@throws IllegalArgumentException if the object supplied is not a proxy created by this class. | [
"Returns",
"the",
"proxy",
"s",
"{",
"@link",
"InvocationHandler",
"}",
"."
] | train | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/stock/ProxyBuilder.java#L394-L405 |
rolfl/MicroBench | src/main/java/net/tuis/ubench/UBench.java | UBench.addDoubleTask | public UBench addDoubleTask(String name, DoubleSupplier task) {
"""
Include a double-specialized named task in to the benchmark.
@param name
The name of the task. Only one task with any one name is
allowed.
@param task
The task to perform
@return The same object, for chaining calls.
"""
return ... | java | public UBench addDoubleTask(String name, DoubleSupplier task) {
return addDoubleTask(name, task, null);
} | [
"public",
"UBench",
"addDoubleTask",
"(",
"String",
"name",
",",
"DoubleSupplier",
"task",
")",
"{",
"return",
"addDoubleTask",
"(",
"name",
",",
"task",
",",
"null",
")",
";",
"}"
] | Include a double-specialized named task in to the benchmark.
@param name
The name of the task. Only one task with any one name is
allowed.
@param task
The task to perform
@return The same object, for chaining calls. | [
"Include",
"a",
"double",
"-",
"specialized",
"named",
"task",
"in",
"to",
"the",
"benchmark",
"."
] | train | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/UBench.java#L270-L272 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.getAt | @SuppressWarnings("unchecked")
public static List<Character> getAt(char[] array, Range range) {
"""
Support the subscript operator with a range for a char array
@param array a char array
@param range a range indicating the indices for the items to retrieve
@return list of the retrieved chars
@since 1.5.0... | java | @SuppressWarnings("unchecked")
public static List<Character> getAt(char[] array, Range range) {
return primitiveArrayGet(array, range);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"List",
"<",
"Character",
">",
"getAt",
"(",
"char",
"[",
"]",
"array",
",",
"Range",
"range",
")",
"{",
"return",
"primitiveArrayGet",
"(",
"array",
",",
"range",
")",
";",
"}"
] | Support the subscript operator with a range for a char array
@param array a char array
@param range a range indicating the indices for the items to retrieve
@return list of the retrieved chars
@since 1.5.0 | [
"Support",
"the",
"subscript",
"operator",
"with",
"a",
"range",
"for",
"a",
"char",
"array"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L13623-L13626 |
eyp/serfj | src/main/java/net/sf/serfj/client/Client.java | Client.deleteRequest | public Object deleteRequest(String restUrl, Map<String, String> params) throws IOException, WebServiceException {
"""
Do a DELETE HTTP request to the given REST-URL.
@param restUrl
REST URL.
@param params
Parameters for adding to the query string.
@throws IOException
if the request go bad.
"""
return... | java | public Object deleteRequest(String restUrl, Map<String, String> params) throws IOException, WebServiceException {
return this.postRequest(HttpMethod.DELETE, restUrl, params);
} | [
"public",
"Object",
"deleteRequest",
"(",
"String",
"restUrl",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"IOException",
",",
"WebServiceException",
"{",
"return",
"this",
".",
"postRequest",
"(",
"HttpMethod",
".",
"DELETE",
",",
... | Do a DELETE HTTP request to the given REST-URL.
@param restUrl
REST URL.
@param params
Parameters for adding to the query string.
@throws IOException
if the request go bad. | [
"Do",
"a",
"DELETE",
"HTTP",
"request",
"to",
"the",
"given",
"REST",
"-",
"URL",
"."
] | train | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/client/Client.java#L158-L160 |
TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocket.java | WebSocket.addHeader | public WebSocket addHeader(String name, String value) {
"""
Add a pair of extra HTTP header.
@param name
An HTTP header name. When {@code null} or an empty
string is given, no header is added.
@param value
The value of the HTTP header.
@return
{@code this} object.
"""
mHandshakeBuilder.add... | java | public WebSocket addHeader(String name, String value)
{
mHandshakeBuilder.addHeader(name, value);
return this;
} | [
"public",
"WebSocket",
"addHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"mHandshakeBuilder",
".",
"addHeader",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Add a pair of extra HTTP header.
@param name
An HTTP header name. When {@code null} or an empty
string is given, no header is added.
@param value
The value of the HTTP header.
@return
{@code this} object. | [
"Add",
"a",
"pair",
"of",
"extra",
"HTTP",
"header",
"."
] | train | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocket.java#L1467-L1472 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Operators.java | Operators.resolveUnary | OperatorSymbol resolveUnary(DiagnosticPosition pos, JCTree.Tag tag, Type op) {
"""
Entry point for resolving a unary operator given an operator tag and an argument type.
"""
return resolve(tag,
unaryOperators,
unop -> unop.test(op),
unop -> unop.resolve(o... | java | OperatorSymbol resolveUnary(DiagnosticPosition pos, JCTree.Tag tag, Type op) {
return resolve(tag,
unaryOperators,
unop -> unop.test(op),
unop -> unop.resolve(op),
() -> reportErrorIfNeeded(pos, tag, op));
} | [
"OperatorSymbol",
"resolveUnary",
"(",
"DiagnosticPosition",
"pos",
",",
"JCTree",
".",
"Tag",
"tag",
",",
"Type",
"op",
")",
"{",
"return",
"resolve",
"(",
"tag",
",",
"unaryOperators",
",",
"unop",
"->",
"unop",
".",
"test",
"(",
"op",
")",
",",
"unop"... | Entry point for resolving a unary operator given an operator tag and an argument type. | [
"Entry",
"point",
"for",
"resolving",
"a",
"unary",
"operator",
"given",
"an",
"operator",
"tag",
"and",
"an",
"argument",
"type",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Operators.java#L149-L155 |
gs2io/gs2-java-sdk-core | src/main/java/io/gs2/AbstractGs2Client.java | AbstractGs2Client.createHttpPut | protected HttpPut createHttpPut(String url, IGs2Credential credential, String service, String module, String function, String body) {
"""
POSTリクエストを生成
@param url アクセス先URL
@param credential 認証情報
@param service アクセス先サービス
@param module アクセス先モジュール
@param function アクセス先ファンクション
@param body リクエストボディ
@return リクエス... | java | protected HttpPut createHttpPut(String url, IGs2Credential credential, String service, String module, String function, String body) {
Long timestamp = System.currentTimeMillis()/1000;
url = StringUtils.replace(url, "{service}", service);
url = StringUtils.replace(url, "{region}", region.getName());
HttpPut put ... | [
"protected",
"HttpPut",
"createHttpPut",
"(",
"String",
"url",
",",
"IGs2Credential",
"credential",
",",
"String",
"service",
",",
"String",
"module",
",",
"String",
"function",
",",
"String",
"body",
")",
"{",
"Long",
"timestamp",
"=",
"System",
".",
"current... | POSTリクエストを生成
@param url アクセス先URL
@param credential 認証情報
@param service アクセス先サービス
@param module アクセス先モジュール
@param function アクセス先ファンクション
@param body リクエストボディ
@return リクエストオブジェクト | [
"POSTリクエストを生成"
] | train | https://github.com/gs2io/gs2-java-sdk-core/blob/fe66ee4e374664b101b07c41221a3b32c844127d/src/main/java/io/gs2/AbstractGs2Client.java#L137-L146 |
Netflix/conductor | client/src/main/java/com/netflix/conductor/client/http/MetadataClient.java | MetadataClient.getTaskDef | public TaskDef getTaskDef(String taskType) {
"""
Retrieve the task definition of a given task type
@param taskType type of task for which to retrieve the definition
@return Task Definition for the given task type
"""
Preconditions.checkArgument(StringUtils.isNotBlank(taskType), "Task type cannot be... | java | public TaskDef getTaskDef(String taskType) {
Preconditions.checkArgument(StringUtils.isNotBlank(taskType), "Task type cannot be blank");
return getForEntity("metadata/taskdefs/{tasktype}", null, TaskDef.class, taskType);
} | [
"public",
"TaskDef",
"getTaskDef",
"(",
"String",
"taskType",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"taskType",
")",
",",
"\"Task type cannot be blank\"",
")",
";",
"return",
"getForEntity",
"(",
"\"metadata/tas... | Retrieve the task definition of a given task type
@param taskType type of task for which to retrieve the definition
@return Task Definition for the given task type | [
"Retrieve",
"the",
"task",
"definition",
"of",
"a",
"given",
"task",
"type"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/client/src/main/java/com/netflix/conductor/client/http/MetadataClient.java#L161-L164 |
belaban/JGroups | src/org/jgroups/util/Promise.java | Promise._getResultWithTimeout | protected T _getResultWithTimeout(final long timeout) throws TimeoutException {
"""
Blocks until a result is available, or timeout milliseconds have elapsed. Needs to be called with lock held
@param timeout in ms
@return An object
@throws TimeoutException If a timeout occurred (implies that timeout > 0)
"""... | java | protected T _getResultWithTimeout(final long timeout) throws TimeoutException {
if(timeout <= 0)
cond.waitFor(this::hasResult);
else if(!cond.waitFor(this::hasResult, timeout, TimeUnit.MILLISECONDS))
throw new TimeoutException();
return result;
} | [
"protected",
"T",
"_getResultWithTimeout",
"(",
"final",
"long",
"timeout",
")",
"throws",
"TimeoutException",
"{",
"if",
"(",
"timeout",
"<=",
"0",
")",
"cond",
".",
"waitFor",
"(",
"this",
"::",
"hasResult",
")",
";",
"else",
"if",
"(",
"!",
"cond",
".... | Blocks until a result is available, or timeout milliseconds have elapsed. Needs to be called with lock held
@param timeout in ms
@return An object
@throws TimeoutException If a timeout occurred (implies that timeout > 0) | [
"Blocks",
"until",
"a",
"result",
"is",
"available",
"or",
"timeout",
"milliseconds",
"have",
"elapsed",
".",
"Needs",
"to",
"be",
"called",
"with",
"lock",
"held"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/Promise.java#L143-L149 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBase.java | DTMDefaultBase.getTypedNextSibling | public int getTypedNextSibling(int nodeHandle, int nodeType) {
"""
Given a node handle, advance to its next sibling.
If not yet resolved, waits for more nodes to be added to the document and
tries again.
@param nodeHandle int Handle of the node.
@return int Node-number of next sibling,
or DTM.NULL to indicate... | java | public int getTypedNextSibling(int nodeHandle, int nodeType)
{
if (nodeHandle == DTM.NULL)
return DTM.NULL;
int node = makeNodeIdentity(nodeHandle);
int eType;
while ((node = _nextsib(node)) != DTM.NULL &&
((eType = _exptype(node)) != nodeType &&
m_expandedNameTable.getType(eType)!= nodeType));... | [
"public",
"int",
"getTypedNextSibling",
"(",
"int",
"nodeHandle",
",",
"int",
"nodeType",
")",
"{",
"if",
"(",
"nodeHandle",
"==",
"DTM",
".",
"NULL",
")",
"return",
"DTM",
".",
"NULL",
";",
"int",
"node",
"=",
"makeNodeIdentity",
"(",
"nodeHandle",
")",
... | Given a node handle, advance to its next sibling.
If not yet resolved, waits for more nodes to be added to the document and
tries again.
@param nodeHandle int Handle of the node.
@return int Node-number of next sibling,
or DTM.NULL to indicate none exists. | [
"Given",
"a",
"node",
"handle",
"advance",
"to",
"its",
"next",
"sibling",
".",
"If",
"not",
"yet",
"resolved",
"waits",
"for",
"more",
"nodes",
"to",
"be",
"added",
"to",
"the",
"document",
"and",
"tries",
"again",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBase.java#L1153-L1165 |
grycap/coreutils | coreutils-common/src/main/java/es/upv/grycap/coreutils/common/config/Configurer.java | Configurer.loadConfig | public Config loadConfig(final @Nullable String confname, final String rootPath, final boolean reset) {
"""
Loads and merges application configuration with default properties.
@param confname - optional configuration filename
@param rootPath - only load configuration properties underneath this path that this cod... | java | public Config loadConfig(final @Nullable String confname, final String rootPath, final boolean reset) {
final Config config = loadConfig(confname, rootPath);
if (reset) COREUTILS_CONTEXT.eventBus().post(new ConfigurationChangedEvent(config));
return config;
} | [
"public",
"Config",
"loadConfig",
"(",
"final",
"@",
"Nullable",
"String",
"confname",
",",
"final",
"String",
"rootPath",
",",
"final",
"boolean",
"reset",
")",
"{",
"final",
"Config",
"config",
"=",
"loadConfig",
"(",
"confname",
",",
"rootPath",
")",
";",... | Loads and merges application configuration with default properties.
@param confname - optional configuration filename
@param rootPath - only load configuration properties underneath this path that this code
module owns and understands
@param reset - set to <tt>true</tt> will send a notification to all the components su... | [
"Loads",
"and",
"merges",
"application",
"configuration",
"with",
"default",
"properties",
"."
] | train | https://github.com/grycap/coreutils/blob/e6db61dc50b49ea7276c0c29c7401204681a10c2/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/config/Configurer.java#L77-L81 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/installation/InstalledIdentityImpl.java | InstalledIdentityImpl.updateState | @Override
protected void updateState(final String name, final InstallationModificationImpl modification, final InstallationModificationImpl.InstallationState state) {
"""
Update the installed identity using the modified state from the modification.
@param name the identity name
@param modification the modi... | java | @Override
protected void updateState(final String name, final InstallationModificationImpl modification, final InstallationModificationImpl.InstallationState state) {
final PatchableTarget.TargetInfo identityInfo = modification.getModifiedState();
this.identity = new Identity() {
@Overri... | [
"@",
"Override",
"protected",
"void",
"updateState",
"(",
"final",
"String",
"name",
",",
"final",
"InstallationModificationImpl",
"modification",
",",
"final",
"InstallationModificationImpl",
".",
"InstallationState",
"state",
")",
"{",
"final",
"PatchableTarget",
".",... | Update the installed identity using the modified state from the modification.
@param name the identity name
@param modification the modification
@param state the installation state
@return the installed identity | [
"Update",
"the",
"installed",
"identity",
"using",
"the",
"modified",
"state",
"from",
"the",
"modification",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/installation/InstalledIdentityImpl.java#L115-L153 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointPixelRegionNCC.java | DescribePointPixelRegionNCC.isInBounds | public boolean isInBounds( int c_x , int c_y ) {
"""
The entire region must be inside the image because any outside pixels will change the statistics
"""
return BoofMiscOps.checkInside(image, c_x, c_y, radiusWidth, radiusHeight);
} | java | public boolean isInBounds( int c_x , int c_y ) {
return BoofMiscOps.checkInside(image, c_x, c_y, radiusWidth, radiusHeight);
} | [
"public",
"boolean",
"isInBounds",
"(",
"int",
"c_x",
",",
"int",
"c_y",
")",
"{",
"return",
"BoofMiscOps",
".",
"checkInside",
"(",
"image",
",",
"c_x",
",",
"c_y",
",",
"radiusWidth",
",",
"radiusHeight",
")",
";",
"}"
] | The entire region must be inside the image because any outside pixels will change the statistics | [
"The",
"entire",
"region",
"must",
"be",
"inside",
"the",
"image",
"because",
"any",
"outside",
"pixels",
"will",
"change",
"the",
"statistics"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointPixelRegionNCC.java#L45-L47 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ServerKeysInner.java | ServerKeysInner.createOrUpdateAsync | public Observable<ServerKeyInner> createOrUpdateAsync(String resourceGroupName, String serverName, String keyName, ServerKeyInner parameters) {
"""
Creates or updates a server key.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resour... | java | public Observable<ServerKeyInner> createOrUpdateAsync(String resourceGroupName, String serverName, String keyName, ServerKeyInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, keyName, parameters).map(new Func1<ServiceResponse<ServerKeyInner>, ServerKeyInner>() {
... | [
"public",
"Observable",
"<",
"ServerKeyInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"keyName",
",",
"ServerKeyInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
... | Creates or updates a server key.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param keyName The name of the server key to be operated on (updated or created). T... | [
"Creates",
"or",
"updates",
"a",
"server",
"key",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ServerKeysInner.java#L351-L358 |
OpenVidu/openvidu | openvidu-server/src/main/java/io/openvidu/server/core/SessionManager.java | SessionManager.closeSession | public Set<Participant> closeSession(String sessionId, EndReason reason) {
"""
Closes an existing session by releasing all resources that were allocated for
it. Once closed, the session can be reopened (will be empty and it will use
another Media Pipeline). Existing participants will be evicted. <br/>
<strong>D... | java | public Set<Participant> closeSession(String sessionId, EndReason reason) {
Session session = sessions.get(sessionId);
if (session == null) {
throw new OpenViduException(Code.ROOM_NOT_FOUND_ERROR_CODE, "Session '" + sessionId + "' not found");
}
if (session.isClosed()) {
this.closeSessionAndEmptyCollection... | [
"public",
"Set",
"<",
"Participant",
">",
"closeSession",
"(",
"String",
"sessionId",
",",
"EndReason",
"reason",
")",
"{",
"Session",
"session",
"=",
"sessions",
".",
"get",
"(",
"sessionId",
")",
";",
"if",
"(",
"session",
"==",
"null",
")",
"{",
"thro... | Closes an existing session by releasing all resources that were allocated for
it. Once closed, the session can be reopened (will be empty and it will use
another Media Pipeline). Existing participants will be evicted. <br/>
<strong>Dev advice:</strong> The session event handler should send
notifications to the existing... | [
"Closes",
"an",
"existing",
"session",
"by",
"releasing",
"all",
"resources",
"that",
"were",
"allocated",
"for",
"it",
".",
"Once",
"closed",
"the",
"session",
"can",
"be",
"reopened",
"(",
"will",
"be",
"empty",
"and",
"it",
"will",
"use",
"another",
"Me... | train | https://github.com/OpenVidu/openvidu/blob/89db47dd37949ceab29e5228371a8fcab04d8d55/openvidu-server/src/main/java/io/openvidu/server/core/SessionManager.java#L436-L457 |
gitblit/fathom | fathom-security/src/main/java/fathom/security/SecurityManager.java | SecurityManager.parseDefinedRealms | protected Collection<Realm> parseDefinedRealms(Config config) {
"""
Parse the Realms from the Config object.
@param config
@return an ordered collection of Realms
"""
List<Realm> realms = new ArrayList<>();
// Parse the Realms
if (config.hasPath("realms")) {
log.trace(... | java | protected Collection<Realm> parseDefinedRealms(Config config) {
List<Realm> realms = new ArrayList<>();
// Parse the Realms
if (config.hasPath("realms")) {
log.trace("Parsing Realm definitions");
for (Config realmConfig : config.getConfigList("realms")) {
... | [
"protected",
"Collection",
"<",
"Realm",
">",
"parseDefinedRealms",
"(",
"Config",
"config",
")",
"{",
"List",
"<",
"Realm",
">",
"realms",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// Parse the Realms",
"if",
"(",
"config",
".",
"hasPath",
"(",
"\"re... | Parse the Realms from the Config object.
@param config
@return an ordered collection of Realms | [
"Parse",
"the",
"Realms",
"from",
"the",
"Config",
"object",
"."
] | train | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-security/src/main/java/fathom/security/SecurityManager.java#L256-L288 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/ListAttributeDefinition.java | ListAttributeDefinition.parseAndSetParameter | @Deprecated
public void parseAndSetParameter(String value, ModelNode operation, XMLStreamReader reader) throws XMLStreamException {
"""
Parses whole value as list attribute
@deprecated in favour of using {@link AttributeParser attribute parser}
@param value String with "," separated string elements
@param ... | java | @Deprecated
public void parseAndSetParameter(String value, ModelNode operation, XMLStreamReader reader) throws XMLStreamException {
//we use manual parsing here, and not #getParser().. to preserve backward compatibility.
if (value != null) {
for (String element : value.split(",")) {
... | [
"@",
"Deprecated",
"public",
"void",
"parseAndSetParameter",
"(",
"String",
"value",
",",
"ModelNode",
"operation",
",",
"XMLStreamReader",
"reader",
")",
"throws",
"XMLStreamException",
"{",
"//we use manual parsing here, and not #getParser().. to preserve backward compatibility... | Parses whole value as list attribute
@deprecated in favour of using {@link AttributeParser attribute parser}
@param value String with "," separated string elements
@param operation operation to with this list elements are added
@param reader xml reader from where reading is be done
@throws XMLStreamException if {@code... | [
"Parses",
"whole",
"value",
"as",
"list",
"attribute"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/ListAttributeDefinition.java#L240-L248 |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/annotations/Annotations.java | Annotations.processConnectionDefinitions | private ArrayList<ConnectionDefinition> processConnectionDefinitions(AnnotationRepository annotationRepository,
ClassLoader classLoader,
ArrayList<? extends ConfigProperty> configProperties,
ArrayList<? extends ConfigProperty> plainConfigProperties)
throws Exception {
"""
Process: @Connecti... | java | private ArrayList<ConnectionDefinition> processConnectionDefinitions(AnnotationRepository annotationRepository,
ClassLoader classLoader,
ArrayList<? extends ConfigProperty> configProperties,
ArrayList<? extends ConfigProperty> plainConfigProperties)
throws Exception
{
Collection<Annotat... | [
"private",
"ArrayList",
"<",
"ConnectionDefinition",
">",
"processConnectionDefinitions",
"(",
"AnnotationRepository",
"annotationRepository",
",",
"ClassLoader",
"classLoader",
",",
"ArrayList",
"<",
"?",
"extends",
"ConfigProperty",
">",
"configProperties",
",",
"ArrayLis... | Process: @ConnectionDefinitions
@param annotationRepository The annotation repository
@param classLoader The class loader
@param configProperties Config properties
@param plainConfigProperties Plain config properties
@return The updated metadata
@exception Exception Thrown if an error occurs | [
"Process",
":"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/annotations/Annotations.java#L551-L578 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupsInner.java | ApplicationSecurityGroupsInner.getByResourceGroup | public ApplicationSecurityGroupInner getByResourceGroup(String resourceGroupName, String applicationSecurityGroupName) {
"""
Gets information about the specified application security group.
@param resourceGroupName The name of the resource group.
@param applicationSecurityGroupName The name of the application ... | java | public ApplicationSecurityGroupInner getByResourceGroup(String resourceGroupName, String applicationSecurityGroupName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).toBlocking().single().body();
} | [
"public",
"ApplicationSecurityGroupInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"applicationSecurityGroupName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"applicationSecurityGroupName",
")",
... | Gets information about the specified application security group.
@param resourceGroupName The name of the resource group.
@param applicationSecurityGroupName The name of the application security group.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the reques... | [
"Gets",
"information",
"about",
"the",
"specified",
"application",
"security",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupsInner.java#L266-L268 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/PatternMatchingFunctions.java | PatternMatchingFunctions.regexpLike | public static Expression regexpLike(String expression, String pattern) {
"""
Returned expression results in True if the string value matches the regular expression pattern
"""
return regexpLike(x(expression), pattern);
} | java | public static Expression regexpLike(String expression, String pattern) {
return regexpLike(x(expression), pattern);
} | [
"public",
"static",
"Expression",
"regexpLike",
"(",
"String",
"expression",
",",
"String",
"pattern",
")",
"{",
"return",
"regexpLike",
"(",
"x",
"(",
"expression",
")",
",",
"pattern",
")",
";",
"}"
] | Returned expression results in True if the string value matches the regular expression pattern | [
"Returned",
"expression",
"results",
"in",
"True",
"if",
"the",
"string",
"value",
"matches",
"the",
"regular",
"expression",
"pattern"
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/PatternMatchingFunctions.java#L63-L65 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/TransitiveGroup.java | TransitiveGroup.getTransitives | public Collection<GroupTransition> getTransitives(String groupIn, String groupOut) {
"""
Get the transitive groups list to reach a group from another.
@param groupIn The first group.
@param groupOut The last group.
@return The transitive groups.
"""
final GroupTransition transition = new GroupTra... | java | public Collection<GroupTransition> getTransitives(String groupIn, String groupOut)
{
final GroupTransition transition = new GroupTransition(groupIn, groupOut);
if (!transitives.containsKey(transition))
{
return Collections.emptyList();
}
return transitives.... | [
"public",
"Collection",
"<",
"GroupTransition",
">",
"getTransitives",
"(",
"String",
"groupIn",
",",
"String",
"groupOut",
")",
"{",
"final",
"GroupTransition",
"transition",
"=",
"new",
"GroupTransition",
"(",
"groupIn",
",",
"groupOut",
")",
";",
"if",
"(",
... | Get the transitive groups list to reach a group from another.
@param groupIn The first group.
@param groupOut The last group.
@return The transitive groups. | [
"Get",
"the",
"transitive",
"groups",
"list",
"to",
"reach",
"a",
"group",
"from",
"another",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/TransitiveGroup.java#L153-L161 |
mikepenz/FastAdapter | library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java | SubItemUtil.countSelectedSubItems | public static <T extends IItem & IExpandable> int countSelectedSubItems(final FastAdapter adapter, T header) {
"""
counts the selected items in the adapter underneath an expandable item, recursively
@param adapter the adapter instance
@param header the header who's selected children should be counted
@return... | java | public static <T extends IItem & IExpandable> int countSelectedSubItems(final FastAdapter adapter, T header) {
SelectExtension extension = (SelectExtension) adapter.getExtension(SelectExtension.class);
if (extension != null) {
Set<IItem> selections = extension.getSelectedItems();
... | [
"public",
"static",
"<",
"T",
"extends",
"IItem",
"&",
"IExpandable",
">",
"int",
"countSelectedSubItems",
"(",
"final",
"FastAdapter",
"adapter",
",",
"T",
"header",
")",
"{",
"SelectExtension",
"extension",
"=",
"(",
"SelectExtension",
")",
"adapter",
".",
"... | counts the selected items in the adapter underneath an expandable item, recursively
@param adapter the adapter instance
@param header the header who's selected children should be counted
@return number of selected items underneath the header | [
"counts",
"the",
"selected",
"items",
"in",
"the",
"adapter",
"underneath",
"an",
"expandable",
"item",
"recursively"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java#L179-L186 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newConversionException | public static ConversionException newConversionException(Throwable cause, String message, Object... args) {
"""
Constructs and initializes a new {@link ConversionException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link... | java | public static ConversionException newConversionException(Throwable cause, String message, Object... args) {
return new ConversionException(format(message, args), cause);
} | [
"public",
"static",
"ConversionException",
"newConversionException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"ConversionException",
"(",
"format",
"(",
"message",
",",
"args",
")",
",",
"cause... | Constructs and initializes a new {@link ConversionException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link ConversionException} was thrown.
@param message {@link String} describi... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"ConversionException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Obje... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L803-L805 |
shibme/jbotstats | src/me/shib/java/lib/jbotstats/AnalyticsBot.java | AnalyticsBot.setWebhook | @Override
public boolean setWebhook(String url, InputFile certificate) throws IOException {
"""
Use this method to specify a url and receive incoming updates via an outgoing webhook.
Whenever there is an update for the bot, an HTTPS POST request to the specified url will be sent, containing a JSON-serialized ... | java | @Override
public boolean setWebhook(String url, InputFile certificate) throws IOException {
AnalyticsData data = new AnalyticsData("setWebhook");
IOException ioException = null;
boolean returned = false;
data.setValue("url", url);
data.setValue("certificate", certificate);
... | [
"@",
"Override",
"public",
"boolean",
"setWebhook",
"(",
"String",
"url",
",",
"InputFile",
"certificate",
")",
"throws",
"IOException",
"{",
"AnalyticsData",
"data",
"=",
"new",
"AnalyticsData",
"(",
"\"setWebhook\"",
")",
";",
"IOException",
"ioException",
"=",
... | Use this method to specify a url and receive incoming updates via an outgoing webhook.
Whenever there is an update for the bot, an HTTPS POST request to the specified url will be sent, containing a JSON-serialized Update.
In case of an unsuccessful request, it will give up after a reasonable amount of attempts.
You wil... | [
"Use",
"this",
"method",
"to",
"specify",
"a",
"url",
"and",
"receive",
"incoming",
"updates",
"via",
"an",
"outgoing",
"webhook",
".",
"Whenever",
"there",
"is",
"an",
"update",
"for",
"the",
"bot",
"an",
"HTTPS",
"POST",
"request",
"to",
"the",
"specifie... | train | https://github.com/shibme/jbotstats/blob/ba15c43a0722c2b7fd2a8396852bec787cca7b9d/src/me/shib/java/lib/jbotstats/AnalyticsBot.java#L252-L271 |
EdwardRaff/JSAT | JSAT/src/jsat/distributions/kernels/GeneralRBFKernel.java | GeneralRBFKernel.setSigma | public void setSigma(double sigma) {
"""
Sets the kernel width parameter, which must be a positive value. Larger
values indicate a larger width
@param sigma the sigma value
"""
if(sigma <= 0 || Double.isNaN(sigma) || Double.isInfinite(sigma))
throw new IllegalArgumentException("Sigma mu... | java | public void setSigma(double sigma)
{
if(sigma <= 0 || Double.isNaN(sigma) || Double.isInfinite(sigma))
throw new IllegalArgumentException("Sigma must be a positive constant, not " + sigma);
this.sigma = sigma;
this.sigmaSqrd2Inv = 0.5/(sigma*sigma);
} | [
"public",
"void",
"setSigma",
"(",
"double",
"sigma",
")",
"{",
"if",
"(",
"sigma",
"<=",
"0",
"||",
"Double",
".",
"isNaN",
"(",
"sigma",
")",
"||",
"Double",
".",
"isInfinite",
"(",
"sigma",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
... | Sets the kernel width parameter, which must be a positive value. Larger
values indicate a larger width
@param sigma the sigma value | [
"Sets",
"the",
"kernel",
"width",
"parameter",
"which",
"must",
"be",
"a",
"positive",
"value",
".",
"Larger",
"values",
"indicate",
"a",
"larger",
"width"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/kernels/GeneralRBFKernel.java#L57-L63 |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TxXATerminator.java | TxXATerminator.getTxWrapper | protected JCATranWrapper getTxWrapper(Xid xid, boolean addAssociation) throws XAException {
"""
Gets the Transaction from the TxExecutionContextHandler that imported it
@param xid
@param addAssociation
@return
@throws XAException (XAER_NOTA) - thrown if the specified XID is invalid
"""
if (tc.isE... | java | protected JCATranWrapper getTxWrapper(Xid xid, boolean addAssociation) throws XAException
{
if (tc.isEntryEnabled()) Tr.entry(tc, "getTxWrapper", xid);
final JCATranWrapper txWrapper = TxExecutionContextHandler.getTxWrapper(xid, addAssociation);
if(txWrapper.getTransaction() == null)
... | [
"protected",
"JCATranWrapper",
"getTxWrapper",
"(",
"Xid",
"xid",
",",
"boolean",
"addAssociation",
")",
"throws",
"XAException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"getTxWrapper\"",
",",
"xid",
... | Gets the Transaction from the TxExecutionContextHandler that imported it
@param xid
@param addAssociation
@return
@throws XAException (XAER_NOTA) - thrown if the specified XID is invalid | [
"Gets",
"the",
"Transaction",
"from",
"the",
"TxExecutionContextHandler",
"that",
"imported",
"it"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TxXATerminator.java#L260-L275 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/RSA.java | RSA.encryptStr | @Deprecated
public String encryptStr(String data, KeyType keyType) {
"""
分组加密
@param data 数据
@param keyType 密钥类型
@return 加密后的密文
@throws CryptoException 加密异常
@deprecated 请使用 {@link #encryptBcd(String, KeyType)}
"""
return encryptBcd(data, keyType, CharsetUtil.CHARSET_UTF_8);
} | java | @Deprecated
public String encryptStr(String data, KeyType keyType) {
return encryptBcd(data, keyType, CharsetUtil.CHARSET_UTF_8);
} | [
"@",
"Deprecated",
"public",
"String",
"encryptStr",
"(",
"String",
"data",
",",
"KeyType",
"keyType",
")",
"{",
"return",
"encryptBcd",
"(",
"data",
",",
"keyType",
",",
"CharsetUtil",
".",
"CHARSET_UTF_8",
")",
";",
"}"
] | 分组加密
@param data 数据
@param keyType 密钥类型
@return 加密后的密文
@throws CryptoException 加密异常
@deprecated 请使用 {@link #encryptBcd(String, KeyType)} | [
"分组加密"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/RSA.java#L127-L130 |
belaban/JGroups | src/org/jgroups/util/Bits.java | Bits.writeInt | public static void writeInt(int num, DataOutput out) throws IOException {
"""
Writes an int to an output stream
@param num the int to be written
@param out the output stream
"""
if(num == 0) {
out.write(0);
return;
}
final byte bytes_needed=bytesRequiredFor(num... | java | public static void writeInt(int num, DataOutput out) throws IOException {
if(num == 0) {
out.write(0);
return;
}
final byte bytes_needed=bytesRequiredFor(num);
out.write(bytes_needed);
for(int i=0; i < bytes_needed; i++)
out.write(getByteAt(num... | [
"public",
"static",
"void",
"writeInt",
"(",
"int",
"num",
",",
"DataOutput",
"out",
")",
"throws",
"IOException",
"{",
"if",
"(",
"num",
"==",
"0",
")",
"{",
"out",
".",
"write",
"(",
"0",
")",
";",
"return",
";",
"}",
"final",
"byte",
"bytes_needed... | Writes an int to an output stream
@param num the int to be written
@param out the output stream | [
"Writes",
"an",
"int",
"to",
"an",
"output",
"stream"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/Bits.java#L102-L111 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java | TreeScanner.visitIntersectionType | @Override
public R visitIntersectionType(IntersectionTypeTree node, P p) {
"""
{@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning
"""
return scan(node.getBounds(), p);
} | java | @Override
public R visitIntersectionType(IntersectionTypeTree node, P p) {
return scan(node.getBounds(), p);
} | [
"@",
"Override",
"public",
"R",
"visitIntersectionType",
"(",
"IntersectionTypeTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"scan",
"(",
"node",
".",
"getBounds",
"(",
")",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"scans",
"the",
"children",
"in",
"left",
"to",
"right",
"order",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java#L778-L781 |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/index/OIndexMVRBTreeAbstract.java | OIndexMVRBTreeAbstract.getEntriesBetween | public Collection<ODocument> getEntriesBetween(final Object iRangeFrom, final Object iRangeTo) {
"""
Returns a set of documents with key between the range passed as parameter. Range bounds are included.
@param iRangeFrom
Starting range
@param iRangeTo
Ending range
@see #getEntriesBetween(Object, Object, boo... | java | public Collection<ODocument> getEntriesBetween(final Object iRangeFrom, final Object iRangeTo) {
return getEntriesBetween(iRangeFrom, iRangeTo, true);
} | [
"public",
"Collection",
"<",
"ODocument",
">",
"getEntriesBetween",
"(",
"final",
"Object",
"iRangeFrom",
",",
"final",
"Object",
"iRangeTo",
")",
"{",
"return",
"getEntriesBetween",
"(",
"iRangeFrom",
",",
"iRangeTo",
",",
"true",
")",
";",
"}"
] | Returns a set of documents with key between the range passed as parameter. Range bounds are included.
@param iRangeFrom
Starting range
@param iRangeTo
Ending range
@see #getEntriesBetween(Object, Object, boolean)
@return | [
"Returns",
"a",
"set",
"of",
"documents",
"with",
"key",
"between",
"the",
"range",
"passed",
"as",
"parameter",
".",
"Range",
"bounds",
"are",
"included",
"."
] | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/index/OIndexMVRBTreeAbstract.java#L287-L289 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java | AmazonSQSMessagingClientWrapper.logAndGetAmazonClientException | private String logAndGetAmazonClientException(AmazonClientException ace, String action) {
"""
Create generic error message for <code>AmazonClientException</code>. Message include
Action.
"""
String errorMessage = "AmazonClientException: " + action + ".";
LOG.error(errorMessage, ace);
r... | java | private String logAndGetAmazonClientException(AmazonClientException ace, String action) {
String errorMessage = "AmazonClientException: " + action + ".";
LOG.error(errorMessage, ace);
return errorMessage;
} | [
"private",
"String",
"logAndGetAmazonClientException",
"(",
"AmazonClientException",
"ace",
",",
"String",
"action",
")",
"{",
"String",
"errorMessage",
"=",
"\"AmazonClientException: \"",
"+",
"action",
"+",
"\".\"",
";",
"LOG",
".",
"error",
"(",
"errorMessage",
"... | Create generic error message for <code>AmazonClientException</code>. Message include
Action. | [
"Create",
"generic",
"error",
"message",
"for",
"<code",
">",
"AmazonClientException<",
"/",
"code",
">",
".",
"Message",
"include",
"Action",
"."
] | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java#L413-L417 |
linkedin/PalDB | paldb/src/main/java/com/linkedin/paldb/api/PalDB.java | PalDB.createWriter | public static StoreWriter createWriter(File file, Configuration config) {
"""
Creates a store writer with the specified <code>file</code> as destination.
<p>
The parent folder is created if missing.
@param file location of the output file
@param config configuration
@return a store writer
"""
return... | java | public static StoreWriter createWriter(File file, Configuration config) {
return StoreImpl.createWriter(file, config);
} | [
"public",
"static",
"StoreWriter",
"createWriter",
"(",
"File",
"file",
",",
"Configuration",
"config",
")",
"{",
"return",
"StoreImpl",
".",
"createWriter",
"(",
"file",
",",
"config",
")",
";",
"}"
] | Creates a store writer with the specified <code>file</code> as destination.
<p>
The parent folder is created if missing.
@param file location of the output file
@param config configuration
@return a store writer | [
"Creates",
"a",
"store",
"writer",
"with",
"the",
"specified",
"<code",
">",
"file<",
"/",
"code",
">",
"as",
"destination",
".",
"<p",
">",
"The",
"parent",
"folder",
"is",
"created",
"if",
"missing",
"."
] | train | https://github.com/linkedin/PalDB/blob/d05ccdd3f67855eb2675dbd82599f19aa7a9f650/paldb/src/main/java/com/linkedin/paldb/api/PalDB.java#L97-L99 |
openbaton/openbaton-client | sdk/src/main/java/org/openbaton/sdk/api/rest/UserAgent.java | UserAgent.changePassword | @Help(help = "Change a user's password")
public void changePassword(String oldPassword, String newPassword) throws SDKException {
"""
Changes a User's password.
@param oldPassword the User's old password
@param newPassword the User's new password
@throws SDKException if the request fails
"""
HashMap... | java | @Help(help = "Change a user's password")
public void changePassword(String oldPassword, String newPassword) throws SDKException {
HashMap<String, String> requestBody = new HashMap<>();
requestBody.put("old_pwd", oldPassword);
requestBody.put("new_pwd", newPassword);
requestPut("changepwd", requestBod... | [
"@",
"Help",
"(",
"help",
"=",
"\"Change a user's password\"",
")",
"public",
"void",
"changePassword",
"(",
"String",
"oldPassword",
",",
"String",
"newPassword",
")",
"throws",
"SDKException",
"{",
"HashMap",
"<",
"String",
",",
"String",
">",
"requestBody",
"... | Changes a User's password.
@param oldPassword the User's old password
@param newPassword the User's new password
@throws SDKException if the request fails | [
"Changes",
"a",
"User",
"s",
"password",
"."
] | train | https://github.com/openbaton/openbaton-client/blob/6ca6dd6b62a23940d312213d6fa489d5b636061a/sdk/src/main/java/org/openbaton/sdk/api/rest/UserAgent.java#L105-L112 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyDecoder.java | KeyDecoder.decodeShortObjDesc | public static Short decodeShortObjDesc(byte[] src, int srcOffset)
throws CorruptEncodingException {
"""
Decodes a signed Short object from exactly 1 or 3 bytes, as encoded for
descending order. If null is returned, then 1 byte was read.
@param src source of encoded bytes
@param srcOffset offset into ... | java | public static Short decodeShortObjDesc(byte[] src, int srcOffset)
throws CorruptEncodingException
{
try {
int b = src[srcOffset];
if (b == NULL_BYTE_HIGH || b == NULL_BYTE_LOW) {
return null;
}
return decodeShortDesc(src, srcOff... | [
"public",
"static",
"Short",
"decodeShortObjDesc",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"throws",
"CorruptEncodingException",
"{",
"try",
"{",
"int",
"b",
"=",
"src",
"[",
"srcOffset",
"]",
";",
"if",
"(",
"b",
"==",
"NULL_BYTE_HIGH"... | Decodes a signed Short object from exactly 1 or 3 bytes, as encoded for
descending order. If null is returned, then 1 byte was read.
@param src source of encoded bytes
@param srcOffset offset into source array
@return signed Short object or null | [
"Decodes",
"a",
"signed",
"Short",
"object",
"from",
"exactly",
"1",
"or",
"3",
"bytes",
"as",
"encoded",
"for",
"descending",
"order",
".",
"If",
"null",
"is",
"returned",
"then",
"1",
"byte",
"was",
"read",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyDecoder.java#L174-L186 |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.parseUserIdentity | private void parseUserIdentity(CloudTrailEventData eventData) throws IOException {
"""
Parses the {@link UserIdentity} in CloudTrailEventData
@param eventData {@link CloudTrailEventData} needs to parse.
@throws IOException
"""
JsonToken nextToken = jsonParser.nextToken();
if (nextToken == J... | java | private void parseUserIdentity(CloudTrailEventData eventData) throws IOException {
JsonToken nextToken = jsonParser.nextToken();
if (nextToken == JsonToken.VALUE_NULL) {
eventData.add(CloudTrailEventField.userIdentity.name(), null);
return;
}
if (nextToken != Jso... | [
"private",
"void",
"parseUserIdentity",
"(",
"CloudTrailEventData",
"eventData",
")",
"throws",
"IOException",
"{",
"JsonToken",
"nextToken",
"=",
"jsonParser",
".",
"nextToken",
"(",
")",
";",
"if",
"(",
"nextToken",
"==",
"JsonToken",
".",
"VALUE_NULL",
")",
"... | Parses the {@link UserIdentity} in CloudTrailEventData
@param eventData {@link CloudTrailEventData} needs to parse.
@throws IOException | [
"Parses",
"the",
"{",
"@link",
"UserIdentity",
"}",
"in",
"CloudTrailEventData"
] | train | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L215-L265 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowTriggersInner.java | WorkflowTriggersInner.listCallbackUrlAsync | public Observable<WorkflowTriggerCallbackUrlInner> listCallbackUrlAsync(String resourceGroupName, String workflowName, String triggerName) {
"""
Get the callback URL for a workflow trigger.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param triggerName The workflow... | java | public Observable<WorkflowTriggerCallbackUrlInner> listCallbackUrlAsync(String resourceGroupName, String workflowName, String triggerName) {
return listCallbackUrlWithServiceResponseAsync(resourceGroupName, workflowName, triggerName).map(new Func1<ServiceResponse<WorkflowTriggerCallbackUrlInner>, WorkflowTrigge... | [
"public",
"Observable",
"<",
"WorkflowTriggerCallbackUrlInner",
">",
"listCallbackUrlAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
",",
"String",
"triggerName",
")",
"{",
"return",
"listCallbackUrlWithServiceResponseAsync",
"(",
"resourceGroupName... | Get the callback URL for a workflow trigger.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param triggerName The workflow trigger name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the WorkflowTriggerCallbackUrlInner obj... | [
"Get",
"the",
"callback",
"URL",
"for",
"a",
"workflow",
"trigger",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowTriggersInner.java#L860-L867 |
alrocar/POIProxy | es.alrocar.map.vector/src/main/java/es/alrocar/map/vector/provider/LRUVectorTileCache.java | LRUVectorTileCache.put | public synchronized Object put(final String key, final Object value) {
"""
Adds an Object to the cache. If the cache is full, removes the last
"""
try {
if (maxCacheSize == 0) {
return null;
}
// if the key isn't in the cache and the cache is full...
if (!super.containsKey(key) && !list.isEm... | java | public synchronized Object put(final String key, final Object value) {
try {
if (maxCacheSize == 0) {
return null;
}
// if the key isn't in the cache and the cache is full...
if (!super.containsKey(key) && !list.isEmpty()
&& list.size() + 1 > maxCacheSize) {
final Object deadKey = list.remov... | [
"public",
"synchronized",
"Object",
"put",
"(",
"final",
"String",
"key",
",",
"final",
"Object",
"value",
")",
"{",
"try",
"{",
"if",
"(",
"maxCacheSize",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"// if the key isn't in the cache and the cache is full..... | Adds an Object to the cache. If the cache is full, removes the last | [
"Adds",
"an",
"Object",
"to",
"the",
"cache",
".",
"If",
"the",
"cache",
"is",
"full",
"removes",
"the",
"last"
] | train | https://github.com/alrocar/POIProxy/blob/e1dabe738a862478b2580e90d5fc4209a2997868/es.alrocar.map.vector/src/main/java/es/alrocar/map/vector/provider/LRUVectorTileCache.java#L82-L100 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.email_exchange_organizationName_service_exchangeService_outlook_duration_GET | public OvhOrder email_exchange_organizationName_service_exchangeService_outlook_duration_GET(String organizationName, String exchangeService, String duration, OvhOutlookVersionEnum licence, String primaryEmailAddress) throws IOException {
"""
Get prices and contracts information
REST: GET /order/email/exchange/... | java | public OvhOrder email_exchange_organizationName_service_exchangeService_outlook_duration_GET(String organizationName, String exchangeService, String duration, OvhOutlookVersionEnum licence, String primaryEmailAddress) throws IOException {
String qPath = "/order/email/exchange/{organizationName}/service/{exchangeServi... | [
"public",
"OvhOrder",
"email_exchange_organizationName_service_exchangeService_outlook_duration_GET",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"duration",
",",
"OvhOutlookVersionEnum",
"licence",
",",
"String",
"primaryEmailAddress",
")"... | Get prices and contracts information
REST: GET /order/email/exchange/{organizationName}/service/{exchangeService}/outlook/{duration}
@param licence [required] Outlook version
@param primaryEmailAddress [required] Primary email address for account which You want to buy an outlook
@param organizationName [required] The ... | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L3832-L3839 |
pravega/pravega | segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/SegmentChunk.java | SegmentChunk.forSegment | static SegmentChunk forSegment(String segmentName, long startOffset) {
"""
Creates a new instance of the SegmentChunk class.
@param segmentName The name of the owning Segment (not the name of this SegmentChunk).
@param startOffset The offset within the owning Segment where this SegmentChunk starts at.
@return... | java | static SegmentChunk forSegment(String segmentName, long startOffset) {
return new SegmentChunk(StreamSegmentNameUtils.getSegmentChunkName(segmentName, startOffset), startOffset);
} | [
"static",
"SegmentChunk",
"forSegment",
"(",
"String",
"segmentName",
",",
"long",
"startOffset",
")",
"{",
"return",
"new",
"SegmentChunk",
"(",
"StreamSegmentNameUtils",
".",
"getSegmentChunkName",
"(",
"segmentName",
",",
"startOffset",
")",
",",
"startOffset",
"... | Creates a new instance of the SegmentChunk class.
@param segmentName The name of the owning Segment (not the name of this SegmentChunk).
@param startOffset The offset within the owning Segment where this SegmentChunk starts at.
@return A new SegmentChunk. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"SegmentChunk",
"class",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/SegmentChunk.java#L66-L68 |
hal/elemento | core/src/main/java/org/jboss/gwt/elemento/core/Elements.java | Elements.innerHtml | public static void innerHtml(HTMLElement element, SafeHtml html) {
"""
Convenience method to set the inner HTML of the given element.
"""
if (element != null) {
element.innerHTML = html.asString();
}
} | java | public static void innerHtml(HTMLElement element, SafeHtml html) {
if (element != null) {
element.innerHTML = html.asString();
}
} | [
"public",
"static",
"void",
"innerHtml",
"(",
"HTMLElement",
"element",
",",
"SafeHtml",
"html",
")",
"{",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"element",
".",
"innerHTML",
"=",
"html",
".",
"asString",
"(",
")",
";",
"}",
"}"
] | Convenience method to set the inner HTML of the given element. | [
"Convenience",
"method",
"to",
"set",
"the",
"inner",
"HTML",
"of",
"the",
"given",
"element",
"."
] | train | https://github.com/hal/elemento/blob/26da2d5a1fe2ec55b779737dbaeda25a942eee61/core/src/main/java/org/jboss/gwt/elemento/core/Elements.java#L798-L802 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.getChild | @Pure
public static <T extends Node> T getChild(Node parent, Class<T> type) {
"""
Replies the first child node that has the specified type.
@param <T> is the type of the desired child
@param parent is the element from which the child must be extracted.
@param type is the type of the desired child
@return th... | java | @Pure
public static <T extends Node> T getChild(Node parent, Class<T> type) {
assert parent != null : AssertMessages.notNullParameter(0);
assert type != null : AssertMessages.notNullParameter(1);
final NodeList children = parent.getChildNodes();
final int len = children.getLength();
for (int i = 0; i < len; ... | [
"@",
"Pure",
"public",
"static",
"<",
"T",
"extends",
"Node",
">",
"T",
"getChild",
"(",
"Node",
"parent",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"assert",
"parent",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
"0",
")",
... | Replies the first child node that has the specified type.
@param <T> is the type of the desired child
@param parent is the element from which the child must be extracted.
@param type is the type of the desired child
@return the child node or <code>null</code> if none. | [
"Replies",
"the",
"first",
"child",
"node",
"that",
"has",
"the",
"specified",
"type",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L1305-L1318 |
phax/ph-commons | ph-dao/src/main/java/com/helger/dao/wal/AbstractMapBasedWALDAO.java | AbstractMapBasedWALDAO.internalUpdateItem | @MustBeLocked (ELockType.WRITE)
protected final void internalUpdateItem (@Nonnull final IMPLTYPE aItem, final boolean bInvokeCallbacks) {
"""
Update an existing item including invoking the callback. Must only be
invoked inside a write-lock.
@param aItem
The item to be updated. May not be <code>null</code>.
... | java | @MustBeLocked (ELockType.WRITE)
protected final void internalUpdateItem (@Nonnull final IMPLTYPE aItem, final boolean bInvokeCallbacks)
{
// Add to map - ensure to overwrite any existing
_addItem (aItem, EDAOActionType.UPDATE);
// Trigger save changes
super.markAsChanged (aItem, EDAOActionType.UPDA... | [
"@",
"MustBeLocked",
"(",
"ELockType",
".",
"WRITE",
")",
"protected",
"final",
"void",
"internalUpdateItem",
"(",
"@",
"Nonnull",
"final",
"IMPLTYPE",
"aItem",
",",
"final",
"boolean",
"bInvokeCallbacks",
")",
"{",
"// Add to map - ensure to overwrite any existing",
... | Update an existing item including invoking the callback. Must only be
invoked inside a write-lock.
@param aItem
The item to be updated. May not be <code>null</code>.
@param bInvokeCallbacks
<code>true</code> to invoke callbacks, <code>false</code> to not do
so.
@throws IllegalArgumentException
If no item with the same... | [
"Update",
"an",
"existing",
"item",
"including",
"invoking",
"the",
"callback",
".",
"Must",
"only",
"be",
"invoked",
"inside",
"a",
"write",
"-",
"lock",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-dao/src/main/java/com/helger/dao/wal/AbstractMapBasedWALDAO.java#L361-L375 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_tcp_farm_farmId_server_serverId_PUT | public void serviceName_tcp_farm_farmId_server_serverId_PUT(String serviceName, Long farmId, Long serverId, OvhBackendTCPServer body) throws IOException {
"""
Alter this object properties
REST: PUT /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}/server/{serverId}
@param body [required] New object properties
... | java | public void serviceName_tcp_farm_farmId_server_serverId_PUT(String serviceName, Long farmId, Long serverId, OvhBackendTCPServer body) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/tcp/farm/{farmId}/server/{serverId}";
StringBuilder sb = path(qPath, serviceName, farmId, serverId);
exec(qPath,... | [
"public",
"void",
"serviceName_tcp_farm_farmId_server_serverId_PUT",
"(",
"String",
"serviceName",
",",
"Long",
"farmId",
",",
"Long",
"serverId",
",",
"OvhBackendTCPServer",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceNa... | Alter this object properties
REST: PUT /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}/server/{serverId}
@param body [required] New object properties
@param serviceName [required] The internal name of your IP load balancing
@param farmId [required] Id of your farm
@param serverId [required] Id of your server | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1627-L1631 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java | FilesImpl.listFromTask | public PagedList<NodeFile> listFromTask(final String jobId, final String taskId, final Boolean recursive, final FileListFromTaskOptions fileListFromTaskOptions) {
"""
Lists the files in a task's directory on its compute node.
@param jobId The ID of the job that contains the task.
@param taskId The ID of the ta... | java | public PagedList<NodeFile> listFromTask(final String jobId, final String taskId, final Boolean recursive, final FileListFromTaskOptions fileListFromTaskOptions) {
ServiceResponseWithHeaders<Page<NodeFile>, FileListFromTaskHeaders> response = listFromTaskSinglePageAsync(jobId, taskId, recursive, fileListFromTask... | [
"public",
"PagedList",
"<",
"NodeFile",
">",
"listFromTask",
"(",
"final",
"String",
"jobId",
",",
"final",
"String",
"taskId",
",",
"final",
"Boolean",
"recursive",
",",
"final",
"FileListFromTaskOptions",
"fileListFromTaskOptions",
")",
"{",
"ServiceResponseWithHead... | Lists the files in a task's directory on its compute node.
@param jobId The ID of the job that contains the task.
@param taskId The ID of the task whose files you want to list.
@param recursive Whether to list children of the task directory. This parameter can be used in combination with the filter parameter to list s... | [
"Lists",
"the",
"files",
"in",
"a",
"task",
"s",
"directory",
"on",
"its",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java#L1736-L1751 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.