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 |
|---|---|---|---|---|---|---|---|---|---|---|
ansell/csvstream | src/main/java/com/github/ansell/csv/stream/CSVStream.java | CSVStream.parse | public static <T> void parse(final InputStream inputStream, final Consumer<List<String>> headersValidator,
final BiFunction<List<String>, List<String>, T> lineConverter, final Consumer<T> resultConsumer)
throws IOException, CSVStreamException {
"""
Stream a CSV file from the given InputStream through the hea... | java | public static <T> void parse(final InputStream inputStream, final Consumer<List<String>> headersValidator,
final BiFunction<List<String>, List<String>, T> lineConverter, final Consumer<T> resultConsumer)
throws IOException, CSVStreamException {
try (final Reader inputStreamReader = new BufferedReader(
new I... | [
"public",
"static",
"<",
"T",
">",
"void",
"parse",
"(",
"final",
"InputStream",
"inputStream",
",",
"final",
"Consumer",
"<",
"List",
"<",
"String",
">",
">",
"headersValidator",
",",
"final",
"BiFunction",
"<",
"List",
"<",
"String",
">",
",",
"List",
... | Stream a CSV file from the given InputStream through the header validator,
line checker, and if the line checker succeeds, send the checked/converted
line to the consumer.
@param inputStream
The {@link InputStream} containing the CSV file.
@param headersValidator
The validator of the header line. Throwing
IllegalArgum... | [
"Stream",
"a",
"CSV",
"file",
"from",
"the",
"given",
"InputStream",
"through",
"the",
"header",
"validator",
"line",
"checker",
"and",
"if",
"the",
"line",
"checker",
"succeeds",
"send",
"the",
"checked",
"/",
"converted",
"line",
"to",
"the",
"consumer",
"... | train | https://github.com/ansell/csvstream/blob/9468bfbd6997fbc4237eafc990ba811cd5905dc1/src/main/java/com/github/ansell/csv/stream/CSVStream.java#L95-L102 |
kiegroup/drools | drools-compiler/src/main/java/org/drools/compiler/lang/DRL6Expressions.java | DRL6Expressions.xpathSeparator | public final void xpathSeparator() throws RecognitionException {
"""
src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:559:1: xpathSeparator : ( DIV | QUESTION_DIV );
"""
try {
// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:560:5: ( DIV | QUESTION_DIV )
// src/main/resourc... | java | public final void xpathSeparator() throws RecognitionException {
try {
// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:560:5: ( DIV | QUESTION_DIV )
// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:
{
if ( input.LA(1)==DIV||input.LA(1)==QUESTION_DIV ) {
input.consume()... | [
"public",
"final",
"void",
"xpathSeparator",
"(",
")",
"throws",
"RecognitionException",
"{",
"try",
"{",
"// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:560:5: ( DIV | QUESTION_DIV )",
"// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:",
"{",
"if",
"(... | src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:559:1: xpathSeparator : ( DIV | QUESTION_DIV ); | [
"src",
"/",
"main",
"/",
"resources",
"/",
"org",
"/",
"drools",
"/",
"compiler",
"/",
"lang",
"/",
"DRL6Expressions",
".",
"g",
":",
"559",
":",
"1",
":",
"xpathSeparator",
":",
"(",
"DIV",
"|",
"QUESTION_DIV",
")",
";"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/lang/DRL6Expressions.java#L4023-L4049 |
WASdev/tool.accelerate.core | liberty-starter-application/src/main/java/com/ibm/liberty/starter/StarterUtil.java | StarterUtil.populateFilesList | public static void populateFilesList(File dir, List<File> filesListInDir) {
"""
Generate the list of files in the directory and all of its sub-directories (recursive)
@param dir - The directory
@param filesListInDir - List to store the files
"""
File[] files = dir.listFiles();
for(File file : files){... | java | public static void populateFilesList(File dir, List<File> filesListInDir) {
File[] files = dir.listFiles();
for(File file : files){
if(file.isFile()){
filesListInDir.add(file);
}else{
populateFilesList(file, filesListInDir);
}
}
} | [
"public",
"static",
"void",
"populateFilesList",
"(",
"File",
"dir",
",",
"List",
"<",
"File",
">",
"filesListInDir",
")",
"{",
"File",
"[",
"]",
"files",
"=",
"dir",
".",
"listFiles",
"(",
")",
";",
"for",
"(",
"File",
"file",
":",
"files",
")",
"{"... | Generate the list of files in the directory and all of its sub-directories (recursive)
@param dir - The directory
@param filesListInDir - List to store the files | [
"Generate",
"the",
"list",
"of",
"files",
"in",
"the",
"directory",
"and",
"all",
"of",
"its",
"sub",
"-",
"directories",
"(",
"recursive",
")"
] | train | https://github.com/WASdev/tool.accelerate.core/blob/6511da654a69a25a76573eb76eefff349d9c4d80/liberty-starter-application/src/main/java/com/ibm/liberty/starter/StarterUtil.java#L74-L83 |
haifengl/smile | core/src/main/java/smile/neighbor/MPLSH.java | MPLSH.learn | public void learn(RNNSearch<double[], double[]> range, double[][] samples, double radius, int Nz) {
"""
Train the posteriori multiple probe algorithm.
@param range the neighborhood search data structure.
@param radius the radius for range search.
@param Nz the number of quantized values.
"""
learn(r... | java | public void learn(RNNSearch<double[], double[]> range, double[][] samples, double radius, int Nz) {
learn(range, samples, radius, Nz, 0.2);
} | [
"public",
"void",
"learn",
"(",
"RNNSearch",
"<",
"double",
"[",
"]",
",",
"double",
"[",
"]",
">",
"range",
",",
"double",
"[",
"]",
"[",
"]",
"samples",
",",
"double",
"radius",
",",
"int",
"Nz",
")",
"{",
"learn",
"(",
"range",
",",
"samples",
... | Train the posteriori multiple probe algorithm.
@param range the neighborhood search data structure.
@param radius the radius for range search.
@param Nz the number of quantized values. | [
"Train",
"the",
"posteriori",
"multiple",
"probe",
"algorithm",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/neighbor/MPLSH.java#L858-L860 |
threerings/nenya | core/src/main/java/com/threerings/geom/GeomUtil.java | GeomUtil.whichSide | public static int whichSide (Point p1, double theta, Point p2) {
"""
Returns less than zero if <code>p2</code> is on the left hand side of the line created by
<code>p1</code> and <code>theta</code> and greater than zero if it is on the right hand
side. In theory, it will return zero if the point is on the line, ... | java | public static int whichSide (Point p1, double theta, Point p2)
{
// obtain the point defining the right hand normal (N)
theta += Math.PI/2;
int x = p1.x + (int)Math.round(1000*Math.cos(theta)),
y = p1.y + (int)Math.round(1000*Math.sin(theta));
// now dot the vector from ... | [
"public",
"static",
"int",
"whichSide",
"(",
"Point",
"p1",
",",
"double",
"theta",
",",
"Point",
"p2",
")",
"{",
"// obtain the point defining the right hand normal (N)",
"theta",
"+=",
"Math",
".",
"PI",
"/",
"2",
";",
"int",
"x",
"=",
"p1",
".",
"x",
"+... | Returns less than zero if <code>p2</code> is on the left hand side of the line created by
<code>p1</code> and <code>theta</code> and greater than zero if it is on the right hand
side. In theory, it will return zero if the point is on the line, but due to rounding errors
it almost always decides that it's not exactly on... | [
"Returns",
"less",
"than",
"zero",
"if",
"<code",
">",
"p2<",
"/",
"code",
">",
"is",
"on",
"the",
"left",
"hand",
"side",
"of",
"the",
"line",
"created",
"by",
"<code",
">",
"p1<",
"/",
"code",
">",
"and",
"<code",
">",
"theta<",
"/",
"code",
">",... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/geom/GeomUtil.java#L160-L171 |
tzaeschke/zoodb | src/org/zoodb/internal/DataDeSerializer.java | DataDeSerializer.readObject | public ZooPC readObject(int page, int offs, boolean skipIfCached) {
"""
This method returns an object that is read from the input
stream.
@param page page id
@param offs offset in page
@param skipIfCached Set 'true' to skip objects that are already in the cache
@return The read object.
"""
long cl... | java | public ZooPC readObject(int page, int offs, boolean skipIfCached) {
long clsOid = in.startReading(page, offs);
long ts = in.getHeaderTimestamp();
//Read first object:
long oid = in.readLong();
//check cache
ZooPC pc = cache.findCoByOID(oid);
if (skipIfCached && ... | [
"public",
"ZooPC",
"readObject",
"(",
"int",
"page",
",",
"int",
"offs",
",",
"boolean",
"skipIfCached",
")",
"{",
"long",
"clsOid",
"=",
"in",
".",
"startReading",
"(",
"page",
",",
"offs",
")",
";",
"long",
"ts",
"=",
"in",
".",
"getHeaderTimestamp",
... | This method returns an object that is read from the input
stream.
@param page page id
@param offs offset in page
@param skipIfCached Set 'true' to skip objects that are already in the cache
@return The read object. | [
"This",
"method",
"returns",
"an",
"object",
"that",
"is",
"read",
"from",
"the",
"input",
"stream",
"."
] | train | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/DataDeSerializer.java#L152-L194 |
mnlipp/jgrapes | org.jgrapes.http/src/org/jgrapes/http/HttpServer.java | HttpServer.onAccepted | @Handler(channels = NetworkChannel.class)
public void onAccepted(Accepted event, IOSubchannel netChannel) {
"""
Creates a new downstream connection as {@link LinkedIOSubchannel}
of the network connection, a {@link HttpRequestDecoder} and a
{@link HttpResponseEncoder}.
@param event
the accepted event
... | java | @Handler(channels = NetworkChannel.class)
public void onAccepted(Accepted event, IOSubchannel netChannel) {
new WebAppMsgChannel(event, netChannel);
} | [
"@",
"Handler",
"(",
"channels",
"=",
"NetworkChannel",
".",
"class",
")",
"public",
"void",
"onAccepted",
"(",
"Accepted",
"event",
",",
"IOSubchannel",
"netChannel",
")",
"{",
"new",
"WebAppMsgChannel",
"(",
"event",
",",
"netChannel",
")",
";",
"}"
] | Creates a new downstream connection as {@link LinkedIOSubchannel}
of the network connection, a {@link HttpRequestDecoder} and a
{@link HttpResponseEncoder}.
@param event
the accepted event | [
"Creates",
"a",
"new",
"downstream",
"connection",
"as",
"{",
"@link",
"LinkedIOSubchannel",
"}",
"of",
"the",
"network",
"connection",
"a",
"{",
"@link",
"HttpRequestDecoder",
"}",
"and",
"a",
"{",
"@link",
"HttpResponseEncoder",
"}",
"."
] | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.http/src/org/jgrapes/http/HttpServer.java#L237-L240 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/fieldaccessor/FieldAccessor.java | FieldAccessor.setLabel | public void setLabel(final Object targetObj, final String label) {
"""
ラベル情報を設定します。
<p>ラベル情報を保持するフィールドがない場合は、処理はスキップされます。</p>
@param targetObj フィールドが定義されているクラスのインスタンス
@param label ラベル情報
@throws IllegalArgumentException {@literal targetObj == null or label == null}
@throws IllegalArgumentException {@literal la... | java | public void setLabel(final Object targetObj, final String label) {
ArgUtils.notNull(targetObj, "targetObj");
ArgUtils.notEmpty(label, "label");
labelSetter.ifPresent(setter -> setter.set(targetObj, label));
} | [
"public",
"void",
"setLabel",
"(",
"final",
"Object",
"targetObj",
",",
"final",
"String",
"label",
")",
"{",
"ArgUtils",
".",
"notNull",
"(",
"targetObj",
",",
"\"targetObj\"",
")",
";",
"ArgUtils",
".",
"notEmpty",
"(",
"label",
",",
"\"label\"",
")",
";... | ラベル情報を設定します。
<p>ラベル情報を保持するフィールドがない場合は、処理はスキップされます。</p>
@param targetObj フィールドが定義されているクラスのインスタンス
@param label ラベル情報
@throws IllegalArgumentException {@literal targetObj == null or label == null}
@throws IllegalArgumentException {@literal label is empty} | [
"ラベル情報を設定します。",
"<p",
">",
"ラベル情報を保持するフィールドがない場合は、処理はスキップされます。<",
"/",
"p",
">"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/fieldaccessor/FieldAccessor.java#L423-L429 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java | CPDefinitionOptionRelPersistenceImpl.findByC_C | @Override
public CPDefinitionOptionRel findByC_C(long CPDefinitionId, long CPOptionId)
throws NoSuchCPDefinitionOptionRelException {
"""
Returns the cp definition option rel where CPDefinitionId = ? and CPOptionId = ? or throws a {@link NoSuchCPDefinitionOptionRelException} if it could not be found.
... | java | @Override
public CPDefinitionOptionRel findByC_C(long CPDefinitionId, long CPOptionId)
throws NoSuchCPDefinitionOptionRelException {
CPDefinitionOptionRel cpDefinitionOptionRel = fetchByC_C(CPDefinitionId,
CPOptionId);
if (cpDefinitionOptionRel == null) {
StringBundler msg = new StringBundler(6);
msg... | [
"@",
"Override",
"public",
"CPDefinitionOptionRel",
"findByC_C",
"(",
"long",
"CPDefinitionId",
",",
"long",
"CPOptionId",
")",
"throws",
"NoSuchCPDefinitionOptionRelException",
"{",
"CPDefinitionOptionRel",
"cpDefinitionOptionRel",
"=",
"fetchByC_C",
"(",
"CPDefinitionId",
... | Returns the cp definition option rel where CPDefinitionId = ? and CPOptionId = ? or throws a {@link NoSuchCPDefinitionOptionRelException} if it could not be found.
@param CPDefinitionId the cp definition ID
@param CPOptionId the cp option ID
@return the matching cp definition option rel
@throws NoSuchCPDefinit... | [
"Returns",
"the",
"cp",
"definition",
"option",
"rel",
"where",
"CPDefinitionId",
"=",
"?",
";",
"and",
"CPOptionId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPDefinitionOptionRelException",
"}",
"if",
"it",
"could",
"not",
"be",
"found"... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java#L3063-L3090 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java | FileWriter.writeLines | public <T> File writeLines(Collection<T> list, LineSeparator lineSeparator, boolean isAppend) throws IORuntimeException {
"""
将列表写入文件
@param <T> 集合元素类型
@param list 列表
@param lineSeparator 换行符枚举(Windows、Mac或Linux换行符)
@param isAppend 是否追加
@return 目标文件
@throws IORuntimeException IO异常
@since 3.1.0
"""
... | java | public <T> File writeLines(Collection<T> list, LineSeparator lineSeparator, boolean isAppend) throws IORuntimeException {
try (PrintWriter writer = getPrintWriter(isAppend)){
for (T t : list) {
if (null != t) {
writer.print(t.toString());
printNewLine(writer, lineSeparator);
writer.flush()... | [
"public",
"<",
"T",
">",
"File",
"writeLines",
"(",
"Collection",
"<",
"T",
">",
"list",
",",
"LineSeparator",
"lineSeparator",
",",
"boolean",
"isAppend",
")",
"throws",
"IORuntimeException",
"{",
"try",
"(",
"PrintWriter",
"writer",
"=",
"getPrintWriter",
"(... | 将列表写入文件
@param <T> 集合元素类型
@param list 列表
@param lineSeparator 换行符枚举(Windows、Mac或Linux换行符)
@param isAppend 是否追加
@return 目标文件
@throws IORuntimeException IO异常
@since 3.1.0 | [
"将列表写入文件"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java#L197-L208 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/xmlhelpers/AbstractXmlReader.java | AbstractXmlReader.readCharactersUntilEndTag | protected String readCharactersUntilEndTag(XMLEventReader reader,
QName tagName)
throws XMLStreamException, JournalException {
"""
Loop through a series of character events, accumulating the data into a
String. The character events should be terminated by... | java | protected String readCharactersUntilEndTag(XMLEventReader reader,
QName tagName)
throws XMLStreamException, JournalException {
StringBuffer stringValue = new StringBuffer();
while (true) {
XMLEvent event = reader.nextEvent();
... | [
"protected",
"String",
"readCharactersUntilEndTag",
"(",
"XMLEventReader",
"reader",
",",
"QName",
"tagName",
")",
"throws",
"XMLStreamException",
",",
"JournalException",
"{",
"StringBuffer",
"stringValue",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"while",
"(",
"... | Loop through a series of character events, accumulating the data into a
String. The character events should be terminated by an EndTagEvent with
the expected tag name. | [
"Loop",
"through",
"a",
"series",
"of",
"character",
"events",
"accumulating",
"the",
"data",
"into",
"a",
"String",
".",
"The",
"character",
"events",
"should",
"be",
"terminated",
"by",
"an",
"EndTagEvent",
"with",
"the",
"expected",
"tag",
"name",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/xmlhelpers/AbstractXmlReader.java#L103-L118 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java | JDBCResultSet.updateShort | public void updateShort(int columnIndex, short x) throws SQLException {
"""
<!-- start generic documentation -->
Updates the designated column with a <code>short</code> value.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the under... | java | public void updateShort(int columnIndex, short x) throws SQLException {
startUpdate(columnIndex);
preparedStatement.setIntParameter(columnIndex, x);
} | [
"public",
"void",
"updateShort",
"(",
"int",
"columnIndex",
",",
"short",
"x",
")",
"throws",
"SQLException",
"{",
"startUpdate",
"(",
"columnIndex",
")",
";",
"preparedStatement",
".",
"setIntParameter",
"(",
"columnIndex",
",",
"x",
")",
";",
"}"
] | <!-- start generic documentation -->
Updates the designated column with a <code>short</code> value.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the <code>updateRow</code> or
<code>insertRow</code> methods ... | [
"<!",
"--",
"start",
"generic",
"documentation",
"--",
">",
"Updates",
"the",
"designated",
"column",
"with",
"a",
"<code",
">",
"short<",
"/",
"code",
">",
"value",
".",
"The",
"updater",
"methods",
"are",
"used",
"to",
"update",
"column",
"values",
"in",... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java#L2717-L2720 |
mguymon/naether | src/main/java/com/tobedevoured/naether/PathClassLoader.java | PathClassLoader.execStaticMethod | public Object execStaticMethod( String className, String methodName, List params ) throws ClassLoaderException {
"""
Helper for executing static methods on a Class
@param className String fully qualified class
@param methodName String method name
@param params List of method parameters
@return Object result
... | java | public Object execStaticMethod( String className, String methodName, List params ) throws ClassLoaderException {
return execStaticMethod( className, methodName, params, null );
} | [
"public",
"Object",
"execStaticMethod",
"(",
"String",
"className",
",",
"String",
"methodName",
",",
"List",
"params",
")",
"throws",
"ClassLoaderException",
"{",
"return",
"execStaticMethod",
"(",
"className",
",",
"methodName",
",",
"params",
",",
"null",
")",
... | Helper for executing static methods on a Class
@param className String fully qualified class
@param methodName String method name
@param params List of method parameters
@return Object result
@throws ClassLoaderException exception | [
"Helper",
"for",
"executing",
"static",
"methods",
"on",
"a",
"Class"
] | train | https://github.com/mguymon/naether/blob/218d8fd36c0b8b6e16d66e5715975570b4560ec4/src/main/java/com/tobedevoured/naether/PathClassLoader.java#L220-L222 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/BasePanel.java | BasePanel.setProperty | public void setProperty(String strProperty, String strValue) {
"""
Set this property.
@param strProperty The property key.
@param strValue The property value.
"""
if (this.getTask() != null)
this.getTask().setProperty(strProperty, strValue);
} | java | public void setProperty(String strProperty, String strValue)
{
if (this.getTask() != null)
this.getTask().setProperty(strProperty, strValue);
} | [
"public",
"void",
"setProperty",
"(",
"String",
"strProperty",
",",
"String",
"strValue",
")",
"{",
"if",
"(",
"this",
".",
"getTask",
"(",
")",
"!=",
"null",
")",
"this",
".",
"getTask",
"(",
")",
".",
"setProperty",
"(",
"strProperty",
",",
"strValue",... | Set this property.
@param strProperty The property key.
@param strValue The property value. | [
"Set",
"this",
"property",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/BasePanel.java#L1364-L1368 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java | VirtualMachineScaleSetVMsInner.beginUpdate | public VirtualMachineScaleSetVMInner beginUpdate(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) {
"""
Updates a virtual machine of a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM sca... | java | public VirtualMachineScaleSetVMInner beginUpdate(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).toBlocking().single().body();
} | [
"public",
"VirtualMachineScaleSetVMInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"String",
"instanceId",
",",
"VirtualMachineScaleSetVMInner",
"parameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"res... | Updates a virtual machine of a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set where the extension should be create or updated.
@param instanceId The instance ID of the virtual machine.
@param parameters Parameters supplied to the Update Virtual... | [
"Updates",
"a",
"virtual",
"machine",
"of",
"a",
"VM",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java#L769-L771 |
camunda/camunda-commons | utils/src/main/java/org/camunda/commons/utils/EnsureUtil.java | EnsureUtil.ensureNotNull | public static void ensureNotNull(String parameterName, Object value) {
"""
Ensures that the parameter is not null.
@param parameterName the parameter name
@param value the value to ensure to be not null
@throws IllegalArgumentException if the parameter value is null
"""
if(value == null) {
throw... | java | public static void ensureNotNull(String parameterName, Object value) {
if(value == null) {
throw LOG.parameterIsNullException(parameterName);
}
} | [
"public",
"static",
"void",
"ensureNotNull",
"(",
"String",
"parameterName",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"LOG",
".",
"parameterIsNullException",
"(",
"parameterName",
")",
";",
"}",
"}"
] | Ensures that the parameter is not null.
@param parameterName the parameter name
@param value the value to ensure to be not null
@throws IllegalArgumentException if the parameter value is null | [
"Ensures",
"that",
"the",
"parameter",
"is",
"not",
"null",
"."
] | train | https://github.com/camunda/camunda-commons/blob/bd3195db47c92c25717288fe9e6735f8e882f247/utils/src/main/java/org/camunda/commons/utils/EnsureUtil.java#L33-L37 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ProcessDefinitionManager.java | ProcessDefinitionManager.cascadeDeleteProcessInstancesForProcessDefinition | protected void cascadeDeleteProcessInstancesForProcessDefinition(String processDefinitionId, boolean skipCustomListeners, boolean skipIoMappings) {
"""
Cascades the deletion of the process definition to the process instances.
Skips the custom listeners if the flag was set to true.
@param processDefinitionId th... | java | protected void cascadeDeleteProcessInstancesForProcessDefinition(String processDefinitionId, boolean skipCustomListeners, boolean skipIoMappings) {
getProcessInstanceManager()
.deleteProcessInstancesByProcessDefinition(processDefinitionId, "deleted process definition", true, skipCustomListeners, skipIoMappi... | [
"protected",
"void",
"cascadeDeleteProcessInstancesForProcessDefinition",
"(",
"String",
"processDefinitionId",
",",
"boolean",
"skipCustomListeners",
",",
"boolean",
"skipIoMappings",
")",
"{",
"getProcessInstanceManager",
"(",
")",
".",
"deleteProcessInstancesByProcessDefinitio... | Cascades the deletion of the process definition to the process instances.
Skips the custom listeners if the flag was set to true.
@param processDefinitionId the process definition id
@param skipCustomListeners true if the custom listeners should be skipped at process instance deletion
@param skipIoMappings specifies w... | [
"Cascades",
"the",
"deletion",
"of",
"the",
"process",
"definition",
"to",
"the",
"process",
"instances",
".",
"Skips",
"the",
"custom",
"listeners",
"if",
"the",
"flag",
"was",
"set",
"to",
"true",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ProcessDefinitionManager.java#L238-L241 |
apache/incubator-druid | core/src/main/java/org/apache/druid/java/util/metrics/Monitors.java | Monitors.createCompoundJvmMonitor | public static Monitor createCompoundJvmMonitor(Map<String, String[]> dimensions, String feed) {
"""
Creates a JVM monitor, configured with the given dimensions, that gathers all currently available JVM-wide
monitors: {@link JvmMonitor}, {@link JvmCpuMonitor} and {@link JvmThreadsMonitor} (this list may
change in... | java | public static Monitor createCompoundJvmMonitor(Map<String, String[]> dimensions, String feed)
{
// This list doesn't include SysMonitor because it should probably be run only in one JVM, if several JVMs are
// running on the same instance, so most of the time SysMonitor should be configured/set up differently... | [
"public",
"static",
"Monitor",
"createCompoundJvmMonitor",
"(",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"dimensions",
",",
"String",
"feed",
")",
"{",
"// This list doesn't include SysMonitor because it should probably be run only in one JVM, if several JVMs are",
... | Creates a JVM monitor, configured with the given dimensions, that gathers all currently available JVM-wide
monitors: {@link JvmMonitor}, {@link JvmCpuMonitor} and {@link JvmThreadsMonitor} (this list may
change in any future release of this library, including a minor release).
@param dimensions common dimensions to co... | [
"Creates",
"a",
"JVM",
"monitor",
"configured",
"with",
"the",
"given",
"dimensions",
"that",
"gathers",
"all",
"currently",
"available",
"JVM",
"-",
"wide",
"monitors",
":",
"{",
"@link",
"JvmMonitor",
"}",
"{",
"@link",
"JvmCpuMonitor",
"}",
"and",
"{",
"@... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/java/util/metrics/Monitors.java#L51-L61 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/multitenant/Node.java | Node.freeTopology | public void freeTopology(String topId, Cluster cluster) {
"""
Frees all the slots for a topology.
@param topId the topology to free slots for
@param cluster the cluster to update
"""
Set<WorkerSlot> slots = _topIdToUsedSlots.get(topId);
if (slots == null || slots.isEmpty())
re... | java | public void freeTopology(String topId, Cluster cluster) {
Set<WorkerSlot> slots = _topIdToUsedSlots.get(topId);
if (slots == null || slots.isEmpty())
return;
for (WorkerSlot ws : slots) {
cluster.freeSlot(ws);
if (_isAlive) {
_freeSlots.add(ws)... | [
"public",
"void",
"freeTopology",
"(",
"String",
"topId",
",",
"Cluster",
"cluster",
")",
"{",
"Set",
"<",
"WorkerSlot",
">",
"slots",
"=",
"_topIdToUsedSlots",
".",
"get",
"(",
"topId",
")",
";",
"if",
"(",
"slots",
"==",
"null",
"||",
"slots",
".",
"... | Frees all the slots for a topology.
@param topId the topology to free slots for
@param cluster the cluster to update | [
"Frees",
"all",
"the",
"slots",
"for",
"a",
"topology",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/multitenant/Node.java#L204-L215 |
amzn/ion-java | src/com/amazon/ion/impl/_Private_IonTextAppender.java | _Private_IonTextAppender.printSymbol | public final void printSymbol(CharSequence text)
throws IOException {
"""
Print an Ion Symbol type. This method will check if symbol needs quoting
@param text
@throws IOException
"""
if (text == null)
{
appendAscii("null.symbol");
}
else if (symbolNeedsQuot... | java | public final void printSymbol(CharSequence text)
throws IOException
{
if (text == null)
{
appendAscii("null.symbol");
}
else if (symbolNeedsQuoting(text, true)) {
appendAscii('\'');
printCodePoints(text, SYMBOL_ESCAPE_CODES);
ap... | [
"public",
"final",
"void",
"printSymbol",
"(",
"CharSequence",
"text",
")",
"throws",
"IOException",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"appendAscii",
"(",
"\"null.symbol\"",
")",
";",
"}",
"else",
"if",
"(",
"symbolNeedsQuoting",
"(",
"text",
... | Print an Ion Symbol type. This method will check if symbol needs quoting
@param text
@throws IOException | [
"Print",
"an",
"Ion",
"Symbol",
"type",
".",
"This",
"method",
"will",
"check",
"if",
"symbol",
"needs",
"quoting"
] | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/_Private_IonTextAppender.java#L535-L551 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/ShapeFittingOps.java | ShapeFittingOps.fitEllipse_F64 | public static FitData<EllipseRotated_F64> fitEllipse_F64( List<Point2D_F64> points, int iterations ,
boolean computeError ,
FitData<EllipseRotated_F64> outputStorage ) {
"""
Computes the best fit ellipse based on minimizing Euclidean distance. An estimate is initially provided
u... | java | public static FitData<EllipseRotated_F64> fitEllipse_F64( List<Point2D_F64> points, int iterations ,
boolean computeError ,
FitData<EllipseRotated_F64> outputStorage ) {
if( outputStorage == null ) {
outputStorage = new FitData<>(new EllipseRotated_F64());
}
// Compute the o... | [
"public",
"static",
"FitData",
"<",
"EllipseRotated_F64",
">",
"fitEllipse_F64",
"(",
"List",
"<",
"Point2D_F64",
">",
"points",
",",
"int",
"iterations",
",",
"boolean",
"computeError",
",",
"FitData",
"<",
"EllipseRotated_F64",
">",
"outputStorage",
")",
"{",
... | Computes the best fit ellipse based on minimizing Euclidean distance. An estimate is initially provided
using algebraic algorithm which is then refined using non-linear optimization. The amount of non-linear
optimization can be controlled using 'iterations' parameter. Will work with partial and complete contours
of ... | [
"Computes",
"the",
"best",
"fit",
"ellipse",
"based",
"on",
"minimizing",
"Euclidean",
"distance",
".",
"An",
"estimate",
"is",
"initially",
"provided",
"using",
"algebraic",
"algorithm",
"which",
"is",
"then",
"refined",
"using",
"non",
"-",
"linear",
"optimiza... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ShapeFittingOps.java#L104-L148 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java | StringIterate.rejectCodePoint | public static String rejectCodePoint(String string, CodePointPredicate predicate) {
"""
@return a new string excluding all of the code points that return true for the specified {@code predicate}.
@since 7.0
"""
int size = string.length();
StringBuilder buffer = new StringBuilder(string.lengt... | java | public static String rejectCodePoint(String string, CodePointPredicate predicate)
{
int size = string.length();
StringBuilder buffer = new StringBuilder(string.length());
for (int i = 0; i < size; )
{
int codePoint = string.codePointAt(i);
if (!predicate.accep... | [
"public",
"static",
"String",
"rejectCodePoint",
"(",
"String",
"string",
",",
"CodePointPredicate",
"predicate",
")",
"{",
"int",
"size",
"=",
"string",
".",
"length",
"(",
")",
";",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
"string",
".",
... | @return a new string excluding all of the code points that return true for the specified {@code predicate}.
@since 7.0 | [
"@return",
"a",
"new",
"string",
"excluding",
"all",
"of",
"the",
"code",
"points",
"that",
"return",
"true",
"for",
"the",
"specified",
"{",
"@code",
"predicate",
"}",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L1075-L1089 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/PathBuilder.java | PathBuilder.get | @SuppressWarnings("unchecked")
public <A extends Number & Comparable<?>> NumberPath<A> get(NumberPath<A> path) {
"""
Create a new Number typed path
@param <A>
@param path existing path
@return property path
"""
NumberPath<A> newPath = getNumber(toString(path), (Class<A>) path.getType());
... | java | @SuppressWarnings("unchecked")
public <A extends Number & Comparable<?>> NumberPath<A> get(NumberPath<A> path) {
NumberPath<A> newPath = getNumber(toString(path), (Class<A>) path.getType());
return addMetadataOf(newPath, path);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"A",
"extends",
"Number",
"&",
"Comparable",
"<",
"?",
">",
">",
"NumberPath",
"<",
"A",
">",
"get",
"(",
"NumberPath",
"<",
"A",
">",
"path",
")",
"{",
"NumberPath",
"<",
"A",
">",
"... | Create a new Number typed path
@param <A>
@param path existing path
@return property path | [
"Create",
"a",
"new",
"Number",
"typed",
"path"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/PathBuilder.java#L398-L402 |
Jasig/uPortal | uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java | AuthorizationImpl.getPrincipal | @Override
public IAuthorizationPrincipal getPrincipal(IPermission permission)
throws AuthorizationException {
"""
Returns <code>IAuthorizationPrincipal</code> associated with the <code>IPermission</code>.
@return IAuthorizationPrincipal
@param permission IPermission
"""
String princ... | java | @Override
public IAuthorizationPrincipal getPrincipal(IPermission permission)
throws AuthorizationException {
String principalString = permission.getPrincipal();
int idx = principalString.indexOf(PRINCIPAL_SEPARATOR);
Integer typeId = Integer.valueOf(principalString.substring(0, ... | [
"@",
"Override",
"public",
"IAuthorizationPrincipal",
"getPrincipal",
"(",
"IPermission",
"permission",
")",
"throws",
"AuthorizationException",
"{",
"String",
"principalString",
"=",
"permission",
".",
"getPrincipal",
"(",
")",
";",
"int",
"idx",
"=",
"principalStrin... | Returns <code>IAuthorizationPrincipal</code> associated with the <code>IPermission</code>.
@return IAuthorizationPrincipal
@param permission IPermission | [
"Returns",
"<code",
">",
"IAuthorizationPrincipal<",
"/",
"code",
">",
"associated",
"with",
"the",
"<code",
">",
"IPermission<",
"/",
"code",
">",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java#L817-L826 |
wcm-io/wcm-io-tooling | maven/plugins/json-dialog-conversion-plugin/src/main/java/io/wcm/maven/plugins/jsondlgcnv/DialogConverter.java | DialogConverter.addCommonAttrMappings | private void addCommonAttrMappings(JSONObject root, JSONObject node) throws JSONException {
"""
Adds property mappings on a replacement node for Granite common attributes.
@param root the root node
@param node the replacement node
@throws JSONException
"""
for (String property : GRANITE_COMMON_ATTR_PROP... | java | private void addCommonAttrMappings(JSONObject root, JSONObject node) throws JSONException {
for (String property : GRANITE_COMMON_ATTR_PROPERTIES) {
String[] mapping = { "${./" + property + "}", "${\'./granite:" + property + "\'}" };
mapProperty(root, node, "granite:" + property, mapping);
}
if... | [
"private",
"void",
"addCommonAttrMappings",
"(",
"JSONObject",
"root",
",",
"JSONObject",
"node",
")",
"throws",
"JSONException",
"{",
"for",
"(",
"String",
"property",
":",
"GRANITE_COMMON_ATTR_PROPERTIES",
")",
"{",
"String",
"[",
"]",
"mapping",
"=",
"{",
"\"... | Adds property mappings on a replacement node for Granite common attributes.
@param root the root node
@param node the replacement node
@throws JSONException | [
"Adds",
"property",
"mappings",
"on",
"a",
"replacement",
"node",
"for",
"Granite",
"common",
"attributes",
"."
] | train | https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/maven/plugins/json-dialog-conversion-plugin/src/main/java/io/wcm/maven/plugins/jsondlgcnv/DialogConverter.java#L370-L401 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/less/LessModuleBuilder.java | LessModuleBuilder._inlineImports | protected String _inlineImports(HttpServletRequest req, String css, IResource res, String path) throws IOException {
"""
Called by our <code>postcss</code> method to inline imports not processed by the LESS compiler
(i.e. CSS imports) <b>after</b> the LESS compiler has processed the input.
@param req
The requ... | java | protected String _inlineImports(HttpServletRequest req, String css, IResource res, String path) throws IOException {
return super.inlineImports(req, css, res, path);
} | [
"protected",
"String",
"_inlineImports",
"(",
"HttpServletRequest",
"req",
",",
"String",
"css",
",",
"IResource",
"res",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"return",
"super",
".",
"inlineImports",
"(",
"req",
",",
"css",
",",
"res",
"... | Called by our <code>postcss</code> method to inline imports not processed by the LESS compiler
(i.e. CSS imports) <b>after</b> the LESS compiler has processed the input.
@param req
The request associated with the call.
@param css
The current CSS containing @import statements to be
processed
@param res
The resourc... | [
"Called",
"by",
"our",
"<code",
">",
"postcss<",
"/",
"code",
">",
"method",
"to",
"inline",
"imports",
"not",
"processed",
"by",
"the",
"LESS",
"compiler",
"(",
"i",
".",
"e",
".",
"CSS",
"imports",
")",
"<b",
">",
"after<",
"/",
"b",
">",
"the",
... | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/less/LessModuleBuilder.java#L233-L235 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/api/Database.java | Database.findByIndex | @Deprecated
public <T> List<T> findByIndex(String selectorJson, Class<T> classOfT) {
"""
Find documents using an index
@param selectorJson String representation of a JSON object describing criteria used to
select documents. For example:
{@code "{ \"selector\": {<your data here>} }"}.
@param classOfT ... | java | @Deprecated
public <T> List<T> findByIndex(String selectorJson, Class<T> classOfT) {
return findByIndex(selectorJson, classOfT, new FindByIndexOptions());
} | [
"@",
"Deprecated",
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"findByIndex",
"(",
"String",
"selectorJson",
",",
"Class",
"<",
"T",
">",
"classOfT",
")",
"{",
"return",
"findByIndex",
"(",
"selectorJson",
",",
"classOfT",
",",
"new",
"FindByIndexOptio... | Find documents using an index
@param selectorJson String representation of a JSON object describing criteria used to
select documents. For example:
{@code "{ \"selector\": {<your data here>} }"}.
@param classOfT The class of Java objects to be returned
@param <T> the type of the Java object to be returned... | [
"Find",
"documents",
"using",
"an",
"index"
] | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/api/Database.java#L419-L422 |
aws/aws-sdk-java | aws-java-sdk-costexplorer/src/main/java/com/amazonaws/services/costexplorer/model/ReservationUtilizationGroup.java | ReservationUtilizationGroup.withAttributes | public ReservationUtilizationGroup withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
The attributes for this group of reservations.
</p>
@param attributes
The attributes for this group of reservations.
@return Returns a reference to this object so that method calls can be chained together.
... | java | public ReservationUtilizationGroup withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"ReservationUtilizationGroup",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The attributes for this group of reservations.
</p>
@param attributes
The attributes for this group of reservations.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"attributes",
"for",
"this",
"group",
"of",
"reservations",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-costexplorer/src/main/java/com/amazonaws/services/costexplorer/model/ReservationUtilizationGroup.java#L171-L174 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromText.java | ST_GeomFromText.toGeometry | public static Geometry toGeometry(String wkt, int srid) throws SQLException {
"""
Convert well known text parameter into a Geometry
@param wkt Well known text
@param srid Geometry SRID
@return Geometry instance
@throws SQLException If wkt is invalid
"""
if(wkt == null) {
return null;
... | java | public static Geometry toGeometry(String wkt, int srid) throws SQLException {
if(wkt == null) {
return null;
}
try {
WKTReader wktReaderSRID = new WKTReader(new GeometryFactory(new PrecisionModel(),srid));
return wktReaderSRID.read(wkt);
} catch (Parse... | [
"public",
"static",
"Geometry",
"toGeometry",
"(",
"String",
"wkt",
",",
"int",
"srid",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"wkt",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"WKTReader",
"wktReaderSRID",
"=",
"new",
"WKTRe... | Convert well known text parameter into a Geometry
@param wkt Well known text
@param srid Geometry SRID
@return Geometry instance
@throws SQLException If wkt is invalid | [
"Convert",
"well",
"known",
"text",
"parameter",
"into",
"a",
"Geometry"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromText.java#L76-L86 |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.getProjectedIsoDirection | public static int getProjectedIsoDirection (int ax, int ay, int bx, int by) {
"""
Given two points in screen coordinates, return the isometrically
projected compass direction that point B lies in from point A.
@param ax the x-position of point A.
@param ay the y-position of point A.
@param bx the x-position ... | java | public static int getProjectedIsoDirection (int ax, int ay, int bx, int by)
{
return toIsoDirection(DirectionUtil.getDirection(ax, ay, bx, by));
} | [
"public",
"static",
"int",
"getProjectedIsoDirection",
"(",
"int",
"ax",
",",
"int",
"ay",
",",
"int",
"bx",
",",
"int",
"by",
")",
"{",
"return",
"toIsoDirection",
"(",
"DirectionUtil",
".",
"getDirection",
"(",
"ax",
",",
"ay",
",",
"bx",
",",
"by",
... | Given two points in screen coordinates, return the isometrically
projected compass direction that point B lies in from point A.
@param ax the x-position of point A.
@param ay the y-position of point A.
@param bx the x-position of point B.
@param by the y-position of point B.
@return the direction specified as one of ... | [
"Given",
"two",
"points",
"in",
"screen",
"coordinates",
"return",
"the",
"isometrically",
"projected",
"compass",
"direction",
"that",
"point",
"B",
"lies",
"in",
"from",
"point",
"A",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L149-L152 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java | SqlDateTimeUtils.timestampCeil | public static long timestampCeil(TimeUnitRange range, long ts, TimeZone tz) {
"""
Keep the algorithm consistent with Calcite DateTimeUtils.julianDateFloor, but here
we take time zone into account.
"""
// assume that we are at UTC timezone, just for algorithm performance
long offset = tz.getOffset(ts);
l... | java | public static long timestampCeil(TimeUnitRange range, long ts, TimeZone tz) {
// assume that we are at UTC timezone, just for algorithm performance
long offset = tz.getOffset(ts);
long utcTs = ts + offset;
switch (range) {
case HOUR:
return ceil(utcTs, MILLIS_PER_HOUR) - offset;
case DAY:
return ... | [
"public",
"static",
"long",
"timestampCeil",
"(",
"TimeUnitRange",
"range",
",",
"long",
"ts",
",",
"TimeZone",
"tz",
")",
"{",
"// assume that we are at UTC timezone, just for algorithm performance",
"long",
"offset",
"=",
"tz",
".",
"getOffset",
"(",
"ts",
")",
";... | Keep the algorithm consistent with Calcite DateTimeUtils.julianDateFloor, but here
we take time zone into account. | [
"Keep",
"the",
"algorithm",
"consistent",
"with",
"Calcite",
"DateTimeUtils",
".",
"julianDateFloor",
"but",
"here",
"we",
"take",
"time",
"zone",
"into",
"account",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java#L627-L647 |
tvesalainen/lpg | src/main/java/org/vesalainen/parser/util/Input.java | Input.getInput | protected static InputReader getInput(InputSource input, int size, Charset cs, Set<ParserFeature> fea) throws IOException {
"""
Creates an InputReader
@param input
@param size Ringbuffer size
@return
@throws IOException
"""
EnumSet<ParserFeature> features = EnumSet.of(UseInclude, UsePushback, UseMo... | java | protected static InputReader getInput(InputSource input, int size, Charset cs, Set<ParserFeature> fea) throws IOException
{
EnumSet<ParserFeature> features = EnumSet.of(UseInclude, UsePushback, UseModifiableCharset);
InputReader inputReader = null;
Reader reader = input.getCharacterStream();... | [
"protected",
"static",
"InputReader",
"getInput",
"(",
"InputSource",
"input",
",",
"int",
"size",
",",
"Charset",
"cs",
",",
"Set",
"<",
"ParserFeature",
">",
"fea",
")",
"throws",
"IOException",
"{",
"EnumSet",
"<",
"ParserFeature",
">",
"features",
"=",
"... | Creates an InputReader
@param input
@param size Ringbuffer size
@return
@throws IOException | [
"Creates",
"an",
"InputReader"
] | train | https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/parser/util/Input.java#L448-L495 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/QueueFile.java | QueueFile.writeHeader | private void writeHeader(int fileLength, int elementCount, int firstPosition, int lastPosition)
throws IOException {
"""
Writes header atomically. The arguments contain the updated values. The class member fields
should not have changed yet. This only updates the state in the file. It's up to the caller to
... | java | private void writeHeader(int fileLength, int elementCount, int firstPosition, int lastPosition)
throws IOException {
writeInt(buffer, 0, fileLength);
writeInt(buffer, 4, elementCount);
writeInt(buffer, 8, firstPosition);
writeInt(buffer, 12, lastPosition);
raf.seek(0);
raf.write(buffer);
... | [
"private",
"void",
"writeHeader",
"(",
"int",
"fileLength",
",",
"int",
"elementCount",
",",
"int",
"firstPosition",
",",
"int",
"lastPosition",
")",
"throws",
"IOException",
"{",
"writeInt",
"(",
"buffer",
",",
"0",
",",
"fileLength",
")",
";",
"writeInt",
... | Writes header atomically. The arguments contain the updated values. The class member fields
should not have changed yet. This only updates the state in the file. It's up to the caller to
update the class member variables *after* this call succeeds. Assumes segment writes are atomic
in the underlying file system. | [
"Writes",
"header",
"atomically",
".",
"The",
"arguments",
"contain",
"the",
"updated",
"values",
".",
"The",
"class",
"member",
"fields",
"should",
"not",
"have",
"changed",
"yet",
".",
"This",
"only",
"updates",
"the",
"state",
"in",
"the",
"file",
".",
... | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/QueueFile.java#L177-L185 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.divClass | public static String divClass(String clazz, String... content) {
"""
Build a HTML DIV with given CSS class for a string.
Given content does <b>not</b> consists of HTML snippets and
as such is being prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param clazz class for div element
@param content content... | java | public static String divClass(String clazz, String... content) {
return tagClass(Html.Tag.DIV, clazz, content);
} | [
"public",
"static",
"String",
"divClass",
"(",
"String",
"clazz",
",",
"String",
"...",
"content",
")",
"{",
"return",
"tagClass",
"(",
"Html",
".",
"Tag",
".",
"DIV",
",",
"clazz",
",",
"content",
")",
";",
"}"
] | Build a HTML DIV with given CSS class for a string.
Given content does <b>not</b> consists of HTML snippets and
as such is being prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param clazz class for div element
@param content content string
@return HTML DIV element as string | [
"Build",
"a",
"HTML",
"DIV",
"with",
"given",
"CSS",
"class",
"for",
"a",
"string",
".",
"Given",
"content",
"does",
"<b",
">",
"not<",
"/",
"b",
">",
"consists",
"of",
"HTML",
"snippets",
"and",
"as",
"such",
"is",
"being",
"prepared",
"with",
"{",
... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L251-L253 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/search/util/HeapList.java | HeapList.AddEx | public T AddEx(T value) {
"""
/ If no object was thrown (heap was not yes populated) return null
"""
if (m_Count < m_Capacity) {
m_Array[++m_Count] = value;
UpHeap();
return null;
}
else if (m_Capacity == 0) return value;
else if (great... | java | public T AddEx(T value) {
if (m_Count < m_Capacity) {
m_Array[++m_Count] = value;
UpHeap();
return null;
}
else if (m_Capacity == 0) return value;
else if (greaterThan(m_Array[1], value)) {
T retVal = m_Array[1];
m_Arra... | [
"public",
"T",
"AddEx",
"(",
"T",
"value",
")",
"{",
"if",
"(",
"m_Count",
"<",
"m_Capacity",
")",
"{",
"m_Array",
"[",
"++",
"m_Count",
"]",
"=",
"value",
";",
"UpHeap",
"(",
")",
";",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"m_Capacity",
... | / If no object was thrown (heap was not yes populated) return null | [
"/",
"If",
"no",
"object",
"was",
"thrown",
"(",
"heap",
"was",
"not",
"yes",
"populated",
")",
"return",
"null"
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/search/util/HeapList.java#L95-L109 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/query/planner/opt/TablePlanner.java | TablePlanner.makeProductPlan | public Plan makeProductPlan(Plan trunk) {
"""
Constructs a product plan of the specified trunk and this table.
<p>
The select predicate applicable to this table is pushed down below the
product.
</p>
@param trunk
the specified trunk of join
@return a product plan of the trunk and this table
"""
P... | java | public Plan makeProductPlan(Plan trunk) {
Plan p = makeSelectPlan();
return new MultiBufferProductPlan(trunk, p, tx);
} | [
"public",
"Plan",
"makeProductPlan",
"(",
"Plan",
"trunk",
")",
"{",
"Plan",
"p",
"=",
"makeSelectPlan",
"(",
")",
";",
"return",
"new",
"MultiBufferProductPlan",
"(",
"trunk",
",",
"p",
",",
"tx",
")",
";",
"}"
] | Constructs a product plan of the specified trunk and this table.
<p>
The select predicate applicable to this table is pushed down below the
product.
</p>
@param trunk
the specified trunk of join
@return a product plan of the trunk and this table | [
"Constructs",
"a",
"product",
"plan",
"of",
"the",
"specified",
"trunk",
"and",
"this",
"table",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/query/planner/opt/TablePlanner.java#L138-L141 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java | GeneratedDUserDaoImpl.queryByUpdatedBy | public Iterable<DUser> queryByUpdatedBy(java.lang.String updatedBy) {
"""
query-by method for field updatedBy
@param updatedBy the specified attribute
@return an Iterable of DUsers for the specified updatedBy
"""
return queryByField(null, DUserMapper.Field.UPDATEDBY.getFieldName(), updatedBy);
} | java | public Iterable<DUser> queryByUpdatedBy(java.lang.String updatedBy) {
return queryByField(null, DUserMapper.Field.UPDATEDBY.getFieldName(), updatedBy);
} | [
"public",
"Iterable",
"<",
"DUser",
">",
"queryByUpdatedBy",
"(",
"java",
".",
"lang",
".",
"String",
"updatedBy",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DUserMapper",
".",
"Field",
".",
"UPDATEDBY",
".",
"getFieldName",
"(",
")",
",",
"upd... | query-by method for field updatedBy
@param updatedBy the specified attribute
@return an Iterable of DUsers for the specified updatedBy | [
"query",
"-",
"by",
"method",
"for",
"field",
"updatedBy"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java#L259-L261 |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/user/TileDao.java | TileDao.queryForTilesInRow | public TileResultSet queryForTilesInRow(long row, long zoomLevel) {
"""
Query for Tiles at a zoom level and row
@param row
row
@param zoomLevel
zoom level
@return tile result set
"""
Map<String, Object> fieldValues = new HashMap<String, Object>();
fieldValues.put(TileTable.COLUMN_TILE_ROW, row);
... | java | public TileResultSet queryForTilesInRow(long row, long zoomLevel) {
Map<String, Object> fieldValues = new HashMap<String, Object>();
fieldValues.put(TileTable.COLUMN_TILE_ROW, row);
fieldValues.put(TileTable.COLUMN_ZOOM_LEVEL, zoomLevel);
return queryForFieldValues(fieldValues);
} | [
"public",
"TileResultSet",
"queryForTilesInRow",
"(",
"long",
"row",
",",
"long",
"zoomLevel",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"fieldValues",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"fieldValues",
".",
... | Query for Tiles at a zoom level and row
@param row
row
@param zoomLevel
zoom level
@return tile result set | [
"Query",
"for",
"Tiles",
"at",
"a",
"zoom",
"level",
"and",
"row"
] | train | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/user/TileDao.java#L342-L349 |
infinispan/infinispan | hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/InvalidationCacheAccessDelegate.java | InvalidationCacheAccessDelegate.get | @Override
@SuppressWarnings("UnusedParameters")
public Object get(Object session, Object key, long txTimestamp) throws CacheException {
"""
Attempt to retrieve an object from the cache.
@param session
@param key The key of the item to be retrieved
@param txTimestamp a timestamp prior to the transaction st... | java | @Override
@SuppressWarnings("UnusedParameters")
public Object get(Object session, Object key, long txTimestamp) throws CacheException {
if ( !region.checkValid() ) {
return null;
}
final Object val = cache.get( key );
if (val == null && session != null) {
putValidator.registerPendingPut(session, key, tx... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"UnusedParameters\"",
")",
"public",
"Object",
"get",
"(",
"Object",
"session",
",",
"Object",
"key",
",",
"long",
"txTimestamp",
")",
"throws",
"CacheException",
"{",
"if",
"(",
"!",
"region",
".",
"checkValid"... | Attempt to retrieve an object from the cache.
@param session
@param key The key of the item to be retrieved
@param txTimestamp a timestamp prior to the transaction start time
@return the cached object or <tt>null</tt>
@throws CacheException if the cache retrieval failed | [
"Attempt",
"to",
"retrieve",
"an",
"object",
"from",
"the",
"cache",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/InvalidationCacheAccessDelegate.java#L54-L65 |
micronaut-projects/micronaut-core | cli/src/main/groovy/io/micronaut/cli/console/logging/MicronautConsole.java | MicronautConsole.showPrompt | private String showPrompt(String prompt) {
"""
Shows the prompt to request user input.
@param prompt The prompt to use
@return The user input prompt
"""
verifySystemOut();
cursorMove = 0;
if (!userInputActive) {
return readLine(prompt, false);
}
out.prin... | java | private String showPrompt(String prompt) {
verifySystemOut();
cursorMove = 0;
if (!userInputActive) {
return readLine(prompt, false);
}
out.print(prompt);
out.flush();
return null;
} | [
"private",
"String",
"showPrompt",
"(",
"String",
"prompt",
")",
"{",
"verifySystemOut",
"(",
")",
";",
"cursorMove",
"=",
"0",
";",
"if",
"(",
"!",
"userInputActive",
")",
"{",
"return",
"readLine",
"(",
"prompt",
",",
"false",
")",
";",
"}",
"out",
"... | Shows the prompt to request user input.
@param prompt The prompt to use
@return The user input prompt | [
"Shows",
"the",
"prompt",
"to",
"request",
"user",
"input",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/console/logging/MicronautConsole.java#L994-L1004 |
sebastiangraf/treetank | interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/util/RestXPathProcessor.java | RestXPathProcessor.doXPathRes | private void doXPathRes(final String resource, final Long revision, final OutputStream output,
final boolean nodeid, final String xpath) throws TTException {
"""
This method performs an XPath evaluation and writes it to a given output
stream.
@param resource
The existing resource.
@param revision
Th... | java | private void doXPathRes(final String resource, final Long revision, final OutputStream output,
final boolean nodeid, final String xpath) throws TTException {
// Storage connection to treetank
ISession session = null;
INodeReadTrx rtx = null;
try {
if (mDatabase.exists... | [
"private",
"void",
"doXPathRes",
"(",
"final",
"String",
"resource",
",",
"final",
"Long",
"revision",
",",
"final",
"OutputStream",
"output",
",",
"final",
"boolean",
"nodeid",
",",
"final",
"String",
"xpath",
")",
"throws",
"TTException",
"{",
"// Storage conn... | This method performs an XPath evaluation and writes it to a given output
stream.
@param resource
The existing resource.
@param revision
The revision of the requested document.
@param output
The output stream where the results are written.
@param nodeid
<code>true</code> if node id's have to be delivered. <code>false</... | [
"This",
"method",
"performs",
"an",
"XPath",
"evaluation",
"and",
"writes",
"it",
"to",
"a",
"given",
"output",
"stream",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/util/RestXPathProcessor.java#L216-L242 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDOAuth2UserDaoImpl.java | GeneratedDOAuth2UserDaoImpl.queryByProfileLink | public Iterable<DOAuth2User> queryByProfileLink(java.lang.String profileLink) {
"""
query-by method for field profileLink
@param profileLink the specified attribute
@return an Iterable of DOAuth2Users for the specified profileLink
"""
return queryByField(null, DOAuth2UserMapper.Field.PROFILELINK.getField... | java | public Iterable<DOAuth2User> queryByProfileLink(java.lang.String profileLink) {
return queryByField(null, DOAuth2UserMapper.Field.PROFILELINK.getFieldName(), profileLink);
} | [
"public",
"Iterable",
"<",
"DOAuth2User",
">",
"queryByProfileLink",
"(",
"java",
".",
"lang",
".",
"String",
"profileLink",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DOAuth2UserMapper",
".",
"Field",
".",
"PROFILELINK",
".",
"getFieldName",
"(",
... | query-by method for field profileLink
@param profileLink the specified attribute
@return an Iterable of DOAuth2Users for the specified profileLink | [
"query",
"-",
"by",
"method",
"for",
"field",
"profileLink"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDOAuth2UserDaoImpl.java#L106-L108 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.setInboundConnectionInfo | public void setInboundConnectionInfo(Map<String, Object> connectionInfo) {
"""
Set the inbound connection info on this context to the input value.
@param connectionInfo
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setInboundConnectionInfo");
... | java | public void setInboundConnectionInfo(Map<String, Object> connectionInfo) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setInboundConnectionInfo");
this.inboundConnectionInfo = connectionInfo;
} | [
"public",
"void",
"setInboundConnectionInfo",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"connectionInfo",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
... | Set the inbound connection info on this context to the input value.
@param connectionInfo | [
"Set",
"the",
"inbound",
"connection",
"info",
"on",
"this",
"context",
"to",
"the",
"input",
"value",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L180-L184 |
febit/wit | wit-core/src/main/java/org/febit/wit_shaded/asm/ClassWriter.java | ClassWriter.newField | public int newField(
final String owner,
final String name,
final String desc) {
"""
Adds a field reference to the constant pool of the class being build. Does nothing if the constant pool already
contains a similar item.
<i>This method is intended for {@link Attribute} sub cl... | java | public int newField(
final String owner,
final String name,
final String desc) {
Item result = get(key3.set(FIELD, owner, name, desc));
if (result == null) {
put122(FIELD, newClass(owner), newNameType(name, desc));
result = new Item(poolIndex++... | [
"public",
"int",
"newField",
"(",
"final",
"String",
"owner",
",",
"final",
"String",
"name",
",",
"final",
"String",
"desc",
")",
"{",
"Item",
"result",
"=",
"get",
"(",
"key3",
".",
"set",
"(",
"FIELD",
",",
"owner",
",",
"name",
",",
"desc",
")",
... | Adds a field reference to the constant pool of the class being build. Does nothing if the constant pool already
contains a similar item.
<i>This method is intended for {@link Attribute} sub classes, and is normally not needed by class generators or
adapters.</i>
@param owner the internal name of the field's owner clas... | [
"Adds",
"a",
"field",
"reference",
"to",
"the",
"constant",
"pool",
"of",
"the",
"class",
"being",
"build",
".",
"Does",
"nothing",
"if",
"the",
"constant",
"pool",
"already",
"contains",
"a",
"similar",
"item",
".",
"<i",
">",
"This",
"method",
"is",
"i... | train | https://github.com/febit/wit/blob/89ee29efbc5633b79c30c3c7b953c9f4130575af/wit-core/src/main/java/org/febit/wit_shaded/asm/ClassWriter.java#L570-L581 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/GosuObjectUtil.java | GosuObjectUtil.max | public static Object max(Comparable c1, Comparable c2) {
"""
Null safe comparison of Comparables.
@param c1 the first comparable, may be null
@param c2 the second comparable, may be null
@return <ul>
<li>If both objects are non-null and unequal, the greater object.
<li>If both objects are non-null and equal... | java | public static Object max(Comparable c1, Comparable c2) {
if (c1 != null && c2 != null) {
return c1.compareTo(c2) >= 0 ? c1 : c2;
} else {
return c1 != null ? c1 : c2;
}
} | [
"public",
"static",
"Object",
"max",
"(",
"Comparable",
"c1",
",",
"Comparable",
"c2",
")",
"{",
"if",
"(",
"c1",
"!=",
"null",
"&&",
"c2",
"!=",
"null",
")",
"{",
"return",
"c1",
".",
"compareTo",
"(",
"c2",
")",
">=",
"0",
"?",
"c1",
":",
"c2",... | Null safe comparison of Comparables.
@param c1 the first comparable, may be null
@param c2 the second comparable, may be null
@return <ul>
<li>If both objects are non-null and unequal, the greater object.
<li>If both objects are non-null and equal, c1.
<li>If one of the comparables is null, the non-null object.
<li>If... | [
"Null",
"safe",
"comparison",
"of",
"Comparables",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuObjectUtil.java#L280-L286 |
grpc/grpc-java | examples/src/main/java/io/grpc/examples/errorhandling/ErrorHandlingClient.java | ErrorHandlingClient.advancedAsyncCall | void advancedAsyncCall() {
"""
This is more advanced and does not make use of the stub. You should not normally need to do
this, but here is how you would.
"""
ClientCall<HelloRequest, HelloReply> call =
channel.newCall(GreeterGrpc.getSayHelloMethod(), CallOptions.DEFAULT);
final CountDownLa... | java | void advancedAsyncCall() {
ClientCall<HelloRequest, HelloReply> call =
channel.newCall(GreeterGrpc.getSayHelloMethod(), CallOptions.DEFAULT);
final CountDownLatch latch = new CountDownLatch(1);
call.start(new ClientCall.Listener<HelloReply>() {
@Override
public void onClose(Status sta... | [
"void",
"advancedAsyncCall",
"(",
")",
"{",
"ClientCall",
"<",
"HelloRequest",
",",
"HelloReply",
">",
"call",
"=",
"channel",
".",
"newCall",
"(",
"GreeterGrpc",
".",
"getSayHelloMethod",
"(",
")",
",",
"CallOptions",
".",
"DEFAULT",
")",
";",
"final",
"Cou... | This is more advanced and does not make use of the stub. You should not normally need to do
this, but here is how you would. | [
"This",
"is",
"more",
"advanced",
"and",
"does",
"not",
"make",
"use",
"of",
"the",
"stub",
".",
"You",
"should",
"not",
"normally",
"need",
"to",
"do",
"this",
"but",
"here",
"is",
"how",
"you",
"would",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/examples/src/main/java/io/grpc/examples/errorhandling/ErrorHandlingClient.java#L178-L201 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java | ContentSpecProcessor.processAssignedWriter | protected void processAssignedWriter(final TagProvider tagProvider, final ITopicNode topicNode, final TopicWrapper topic) {
"""
Processes a Spec Topic and adds the assigned writer for the topic it represents.
@param tagProvider
@param topicNode The topic node object that contains the assigned writer.
@param... | java | protected void processAssignedWriter(final TagProvider tagProvider, final ITopicNode topicNode, final TopicWrapper topic) {
LOG.debug("Processing assigned writer");
// See if a new tag collection needs to be created
if (topic.getTags() == null) {
topic.setTags(tagProvider.newTagColl... | [
"protected",
"void",
"processAssignedWriter",
"(",
"final",
"TagProvider",
"tagProvider",
",",
"final",
"ITopicNode",
"topicNode",
",",
"final",
"TopicWrapper",
"topic",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Processing assigned writer\"",
")",
";",
"// See if a new t... | Processes a Spec Topic and adds the assigned writer for the topic it represents.
@param tagProvider
@param topicNode The topic node object that contains the assigned writer.
@param topic The topic entity to be updated.
@return True if anything in the topic entity was changed, otherwise false. | [
"Processes",
"a",
"Spec",
"Topic",
"and",
"adds",
"the",
"assigned",
"writer",
"for",
"the",
"topic",
"it",
"represents",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java#L936-L950 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.assertTrue | public static void assertTrue(boolean expression, String messageFormat, Object... args) {
"""
Assertion which generate an exception if expression is not true.
@param expression
the expression
@param messageFormat
the message format
@param args
the args
"""
if (!expression)
throw (new KriptonProces... | java | public static void assertTrue(boolean expression, String messageFormat, Object... args) {
if (!expression)
throw (new KriptonProcessorException(String.format(messageFormat, args)));
} | [
"public",
"static",
"void",
"assertTrue",
"(",
"boolean",
"expression",
",",
"String",
"messageFormat",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"throw",
"(",
"new",
"KriptonProcessorException",
"(",
"String",
".",
"format",
... | Assertion which generate an exception if expression is not true.
@param expression
the expression
@param messageFormat
the message format
@param args
the args | [
"Assertion",
"which",
"generate",
"an",
"exception",
"if",
"expression",
"is",
"not",
"true",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L69-L73 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/tx/narayana/SecurityActions.java | SecurityActions.createSubject | static Subject createSubject(final SubjectFactory subjectFactory, final String domain) {
"""
Get a Subject instance
@param subjectFactory The subject factory
@param domain The domain
@return The instance
"""
if (System.getSecurityManager() == null)
return subjectFactory.createSubject(domain);... | java | static Subject createSubject(final SubjectFactory subjectFactory, final String domain)
{
if (System.getSecurityManager() == null)
return subjectFactory.createSubject(domain);
return AccessController.doPrivileged(new PrivilegedAction<Subject>()
{
public Subject run()
{
... | [
"static",
"Subject",
"createSubject",
"(",
"final",
"SubjectFactory",
"subjectFactory",
",",
"final",
"String",
"domain",
")",
"{",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"==",
"null",
")",
"return",
"subjectFactory",
".",
"createSubject",
"("... | Get a Subject instance
@param subjectFactory The subject factory
@param domain The domain
@return The instance | [
"Get",
"a",
"Subject",
"instance"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/tx/narayana/SecurityActions.java#L112-L124 |
wisdom-framework/wisdom | core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java | CryptoServiceSingleton.generateAESKey | private SecretKey generateAESKey(String privateKey, String salt) {
"""
Generate the AES key from the salt and the private key.
@param salt the salt (hexadecimal)
@param privateKey the private key
@return the generated key.
"""
try {
byte[] raw = decodeHex(salt);
KeySp... | java | private SecretKey generateAESKey(String privateKey, String salt) {
try {
byte[] raw = decodeHex(salt);
KeySpec spec = new PBEKeySpec(privateKey.toCharArray(), raw, iterationCount, keySize);
SecretKeyFactory factory = SecretKeyFactory.getInstance(PBKDF_2_WITH_HMAC_SHA_1);
... | [
"private",
"SecretKey",
"generateAESKey",
"(",
"String",
"privateKey",
",",
"String",
"salt",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"raw",
"=",
"decodeHex",
"(",
"salt",
")",
";",
"KeySpec",
"spec",
"=",
"new",
"PBEKeySpec",
"(",
"privateKey",
".",
"to... | Generate the AES key from the salt and the private key.
@param salt the salt (hexadecimal)
@param privateKey the private key
@return the generated key. | [
"Generate",
"the",
"AES",
"key",
"from",
"the",
"salt",
"and",
"the",
"private",
"key",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java#L99-L108 |
cloudinary/cloudinary_java | cloudinary-core/src/main/java/com/cloudinary/Api.java | Api.createStreamingProfile | public ApiResponse createStreamingProfile(String name, String displayName, List<Map> representations, Map options) throws Exception {
"""
Create a new streaming profile
@param name the of the profile
@param displayName the display name of the profile
@param representations a collection of Maps ... | java | public ApiResponse createStreamingProfile(String name, String displayName, List<Map> representations, Map options) throws Exception {
if (options == null)
options = ObjectUtils.emptyMap();
List<Map> serializedRepresentations = new ArrayList<Map>(representations.size());
for (Map t : ... | [
"public",
"ApiResponse",
"createStreamingProfile",
"(",
"String",
"name",
",",
"String",
"displayName",
",",
"List",
"<",
"Map",
">",
"representations",
",",
"Map",
"options",
")",
"throws",
"Exception",
"{",
"if",
"(",
"options",
"==",
"null",
")",
"options",... | Create a new streaming profile
@param name the of the profile
@param displayName the display name of the profile
@param representations a collection of Maps with a transformation key
@param options additional options
@return the new streaming profile
@throws Exception an exception | [
"Create",
"a",
"new",
"streaming",
"profile"
] | train | https://github.com/cloudinary/cloudinary_java/blob/58ee1823180da2dea6a2eb7e5cf00d5a760f8aef/cloudinary-core/src/main/java/com/cloudinary/Api.java#L347-L364 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/preferences/ExtraLanguagePreferenceAccess.java | ExtraLanguagePreferenceAccess.getPrefixedKey | public static String getPrefixedKey(String preferenceContainerID, String preferenceName) {
"""
Create a preference key.
@param preferenceContainerID the identifier of the generator's preference container.
@param preferenceName the name of the preference.
@return the key.
"""
return getXtextKey(getProper... | java | public static String getPrefixedKey(String preferenceContainerID, String preferenceName) {
return getXtextKey(getPropertyPrefix(preferenceContainerID), preferenceName);
} | [
"public",
"static",
"String",
"getPrefixedKey",
"(",
"String",
"preferenceContainerID",
",",
"String",
"preferenceName",
")",
"{",
"return",
"getXtextKey",
"(",
"getPropertyPrefix",
"(",
"preferenceContainerID",
")",
",",
"preferenceName",
")",
";",
"}"
] | Create a preference key.
@param preferenceContainerID the identifier of the generator's preference container.
@param preferenceName the name of the preference.
@return the key. | [
"Create",
"a",
"preference",
"key",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/preferences/ExtraLanguagePreferenceAccess.java#L111-L113 |
mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.validateSql | public void validateSql(String sql, CancellationSignal cancellationSignal) {
"""
Verifies that a SQL SELECT statement is valid by compiling it.
If the SQL statement is not valid, this method will throw a {@link SQLiteException}.
@param sql SQL to be validated
@param cancellationSignal A signal to cancel the o... | java | public void validateSql(String sql, CancellationSignal cancellationSignal) {
getThreadSession().prepare(sql,
getThreadDefaultConnectionFlags(/* readOnly =*/ true), cancellationSignal, null);
} | [
"public",
"void",
"validateSql",
"(",
"String",
"sql",
",",
"CancellationSignal",
"cancellationSignal",
")",
"{",
"getThreadSession",
"(",
")",
".",
"prepare",
"(",
"sql",
",",
"getThreadDefaultConnectionFlags",
"(",
"/* readOnly =*/",
"true",
")",
",",
"cancellatio... | Verifies that a SQL SELECT statement is valid by compiling it.
If the SQL statement is not valid, this method will throw a {@link SQLiteException}.
@param sql SQL to be validated
@param cancellationSignal A signal to cancel the operation in progress, or null if none.
If the operation is canceled, then {@link Operation... | [
"Verifies",
"that",
"a",
"SQL",
"SELECT",
"statement",
"is",
"valid",
"by",
"compiling",
"it",
".",
"If",
"the",
"SQL",
"statement",
"is",
"not",
"valid",
"this",
"method",
"will",
"throw",
"a",
"{",
"@link",
"SQLiteException",
"}",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L1700-L1703 |
centic9/commons-dost | src/main/java/org/dstadler/commons/http/HttpClientWrapper.java | HttpClientWrapper.retrieveData | public static String retrieveData(String url, String user, String password, int timeoutMs) throws IOException {
"""
Small helper method to simply query the URL without password and
return the resulting data.
@param url The URL to query data from.
@param user The username to send
@param password The password ... | java | public static String retrieveData(String url, String user, String password, int timeoutMs) throws IOException {
try (HttpClientWrapper wrapper = new HttpClientWrapper(user, password, timeoutMs)) {
return wrapper.simpleGet(url);
}
} | [
"public",
"static",
"String",
"retrieveData",
"(",
"String",
"url",
",",
"String",
"user",
",",
"String",
"password",
",",
"int",
"timeoutMs",
")",
"throws",
"IOException",
"{",
"try",
"(",
"HttpClientWrapper",
"wrapper",
"=",
"new",
"HttpClientWrapper",
"(",
... | Small helper method to simply query the URL without password and
return the resulting data.
@param url The URL to query data from.
@param user The username to send
@param password The password to send
@param timeoutMs How long in milliseconds to wait for the request
@return The resulting data read from the URL
@throws... | [
"Small",
"helper",
"method",
"to",
"simply",
"query",
"the",
"URL",
"without",
"password",
"and",
"return",
"the",
"resulting",
"data",
"."
] | train | https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/http/HttpClientWrapper.java#L336-L340 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/UnsynchronizedOverridesSynchronized.java | UnsynchronizedOverridesSynchronized.ignore | private static boolean ignore(MethodTree method, VisitorState state) {
"""
Don't flag methods that are empty or trivially delegate to a super-implementation.
"""
return firstNonNull(
new TreeScanner<Boolean, Void>() {
@Override
public Boolean visitBlock(BlockTree tree, Void unus... | java | private static boolean ignore(MethodTree method, VisitorState state) {
return firstNonNull(
new TreeScanner<Boolean, Void>() {
@Override
public Boolean visitBlock(BlockTree tree, Void unused) {
switch (tree.getStatements().size()) {
case 0:
retur... | [
"private",
"static",
"boolean",
"ignore",
"(",
"MethodTree",
"method",
",",
"VisitorState",
"state",
")",
"{",
"return",
"firstNonNull",
"(",
"new",
"TreeScanner",
"<",
"Boolean",
",",
"Void",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Boolean",
"visitB... | Don't flag methods that are empty or trivially delegate to a super-implementation. | [
"Don",
"t",
"flag",
"methods",
"that",
"are",
"empty",
"or",
"trivially",
"delegate",
"to",
"a",
"super",
"-",
"implementation",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/UnsynchronizedOverridesSynchronized.java#L88-L136 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.wrapDriverInProfilingProxy | private Object wrapDriverInProfilingProxy(Object newDriverInstance) {
"""
Wraps a driver object with a dynamic proxy that counts method calls and their durations.<p>
@param newDriverInstance the driver instance to wrap
@return the proxy
"""
Class<?> cls = getDriverInterfaceForProxy(newDriverInstan... | java | private Object wrapDriverInProfilingProxy(Object newDriverInstance) {
Class<?> cls = getDriverInterfaceForProxy(newDriverInstance);
if (cls == null) {
return newDriverInstance;
}
return Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
... | [
"private",
"Object",
"wrapDriverInProfilingProxy",
"(",
"Object",
"newDriverInstance",
")",
"{",
"Class",
"<",
"?",
">",
"cls",
"=",
"getDriverInterfaceForProxy",
"(",
"newDriverInstance",
")",
";",
"if",
"(",
"cls",
"==",
"null",
")",
"{",
"return",
"newDriverI... | Wraps a driver object with a dynamic proxy that counts method calls and their durations.<p>
@param newDriverInstance the driver instance to wrap
@return the proxy | [
"Wraps",
"a",
"driver",
"object",
"with",
"a",
"dynamic",
"proxy",
"that",
"counts",
"method",
"calls",
"and",
"their",
"durations",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L11984-L11994 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/wsspi/connmgmt/ConnectionType.java | ConnectionType.setVCConnectionType | public static void setVCConnectionType(VirtualConnection vc, ConnectionType connType) {
"""
Set the connection type on the virtual connection. This will overlay
any preset value.
@param vc
VirtualConnection containing simple state for this connection
@param connType
ConnectionType for the VirtualConnection
... | java | public static void setVCConnectionType(VirtualConnection vc, ConnectionType connType) {
if (vc == null || connType == null) {
return;
}
Map<Object, Object> map = vc.getStateMap();
// Internal connections are both inbound and outbound (they're connections
// to ourse... | [
"public",
"static",
"void",
"setVCConnectionType",
"(",
"VirtualConnection",
"vc",
",",
"ConnectionType",
"connType",
")",
"{",
"if",
"(",
"vc",
"==",
"null",
"||",
"connType",
"==",
"null",
")",
"{",
"return",
";",
"}",
"Map",
"<",
"Object",
",",
"Object"... | Set the connection type on the virtual connection. This will overlay
any preset value.
@param vc
VirtualConnection containing simple state for this connection
@param connType
ConnectionType for the VirtualConnection | [
"Set",
"the",
"connection",
"type",
"on",
"the",
"virtual",
"connection",
".",
"This",
"will",
"overlay",
"any",
"preset",
"value",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/wsspi/connmgmt/ConnectionType.java#L50-L69 |
kejunxia/AndroidMvc | library/android-mvc-core/src/main/java/com/shipdream/lib/android/mvc/Controller.java | Controller.runTask | protected <RESULT> Task.Monitor<RESULT> runTask(final Task<RESULT> task) {
"""
Run a task on threads supplied by injected {@link ExecutorService} without a callback. By
default it runs tasks on separate threads by {@link ExecutorService} injected from AndroidMvc
framework. A simple {@link ExecutorService} that r... | java | protected <RESULT> Task.Monitor<RESULT> runTask(final Task<RESULT> task) {
return runTask(executorService, task, null);
} | [
"protected",
"<",
"RESULT",
">",
"Task",
".",
"Monitor",
"<",
"RESULT",
">",
"runTask",
"(",
"final",
"Task",
"<",
"RESULT",
">",
"task",
")",
"{",
"return",
"runTask",
"(",
"executorService",
",",
"task",
",",
"null",
")",
";",
"}"
] | Run a task on threads supplied by injected {@link ExecutorService} without a callback. By
default it runs tasks on separate threads by {@link ExecutorService} injected from AndroidMvc
framework. A simple {@link ExecutorService} that runs tasks on the same thread in test cases
to make the test easier.
<p><b>
User the p... | [
"Run",
"a",
"task",
"on",
"threads",
"supplied",
"by",
"injected",
"{",
"@link",
"ExecutorService",
"}",
"without",
"a",
"callback",
".",
"By",
"default",
"it",
"runs",
"tasks",
"on",
"separate",
"threads",
"by",
"{",
"@link",
"ExecutorService",
"}",
"inject... | train | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/android-mvc-core/src/main/java/com/shipdream/lib/android/mvc/Controller.java#L158-L160 |
zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.readResponseBody | protected void readResponseBody(HttpState state, HttpConnection conn)
throws IOException, HttpException {
"""
Read the response body from the given {@link HttpConnection}.
<p>
The current implementation wraps the socket level stream with
an appropriate stream for the type of response (chunked, content-len... | java | protected void readResponseBody(HttpState state, HttpConnection conn)
throws IOException, HttpException {
LOG.trace(
"enter HttpMethodBase.readResponseBody(HttpState, HttpConnection)");
// assume we are not done with the connection if we get a stream
InputStream stream = readRes... | [
"protected",
"void",
"readResponseBody",
"(",
"HttpState",
"state",
",",
"HttpConnection",
"conn",
")",
"throws",
"IOException",
",",
"HttpException",
"{",
"LOG",
".",
"trace",
"(",
"\"enter HttpMethodBase.readResponseBody(HttpState, HttpConnection)\"",
")",
";",
"// assu... | Read the response body from the given {@link HttpConnection}.
<p>
The current implementation wraps the socket level stream with
an appropriate stream for the type of response (chunked, content-length,
or auto-close). If there is no response body, the connection associated
with the request will be returned to the conn... | [
"Read",
"the",
"response",
"body",
"from",
"the",
"given",
"{",
"@link",
"HttpConnection",
"}",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L1913-L1927 |
infinispan/infinispan | lock/src/main/java/org/infinispan/lock/impl/lock/RequestExpirationScheduler.java | RequestExpirationScheduler.scheduleForCompletion | public void scheduleForCompletion(String requestId, CompletableFuture<Boolean> request, long time, TimeUnit unit) {
"""
Schedules a request for completion
@param requestId, the unique identifier if the request
@param request, the request
@param time, time expressed in long
@param unit, {@link Tim... | java | public void scheduleForCompletion(String requestId, CompletableFuture<Boolean> request, long time, TimeUnit unit) {
if (request.isDone()) {
if (trace) {
log.tracef("Request[%s] is not scheduled because is already done", requestId);
}
return;
}
if (scheduledReque... | [
"public",
"void",
"scheduleForCompletion",
"(",
"String",
"requestId",
",",
"CompletableFuture",
"<",
"Boolean",
">",
"request",
",",
"long",
"time",
",",
"TimeUnit",
"unit",
")",
"{",
"if",
"(",
"request",
".",
"isDone",
"(",
")",
")",
"{",
"if",
"(",
"... | Schedules a request for completion
@param requestId, the unique identifier if the request
@param request, the request
@param time, time expressed in long
@param unit, {@link TimeUnit} | [
"Schedules",
"a",
"request",
"for",
"completion"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lock/src/main/java/org/infinispan/lock/impl/lock/RequestExpirationScheduler.java#L58-L82 |
alkacon/opencms-core | src-setup/org/opencms/setup/db/update6to7/postgresql/CmsUpdateDBAlterTables.java | CmsUpdateDBAlterTables.initReplacer | private void initReplacer(Map<String, String> replacer, String tableName, String fieldName) {
"""
Initializes the replacer.<p>
@param replacer the replacer
@param tableName the table name
@param fieldName the field name
"""
replacer.clear();
replacer.put(REPLACEMENT_TABLENAME, tableName);... | java | private void initReplacer(Map<String, String> replacer, String tableName, String fieldName) {
replacer.clear();
replacer.put(REPLACEMENT_TABLENAME, tableName);
replacer.put(REPLACEMENT_FIELD_NAME, fieldName);
} | [
"private",
"void",
"initReplacer",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"replacer",
",",
"String",
"tableName",
",",
"String",
"fieldName",
")",
"{",
"replacer",
".",
"clear",
"(",
")",
";",
"replacer",
".",
"put",
"(",
"REPLACEMENT_TABLENAME",
"... | Initializes the replacer.<p>
@param replacer the replacer
@param tableName the table name
@param fieldName the field name | [
"Initializes",
"the",
"replacer",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/db/update6to7/postgresql/CmsUpdateDBAlterTables.java#L178-L183 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DPathUtils.java | DPathUtils.getValue | public static <T> T getValue(JsonNode node, String dPath, Class<T> clazz) {
"""
Extract a value from the target {@link JsonNode} using DPath expression (generic
version).
@param node
@param dPath
@param clazz
@return
@since 0.6.2
"""
if (clazz == null) {
throw new NullPointerExcepti... | java | public static <T> T getValue(JsonNode node, String dPath, Class<T> clazz) {
if (clazz == null) {
throw new NullPointerException("Class parameter is null!");
}
JsonNode temp = getValue(node, dPath);
return ValueUtils.convertValue(temp, clazz);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getValue",
"(",
"JsonNode",
"node",
",",
"String",
"dPath",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"clazz",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Class param... | Extract a value from the target {@link JsonNode} using DPath expression (generic
version).
@param node
@param dPath
@param clazz
@return
@since 0.6.2 | [
"Extract",
"a",
"value",
"from",
"the",
"target",
"{",
"@link",
"JsonNode",
"}",
"using",
"DPath",
"expression",
"(",
"generic",
"version",
")",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DPathUtils.java#L462-L468 |
buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java | AbstractInstanceManager.getInstance | private <T> T getInstance(DatastoreType datastoreType, TransactionalCache.Mode cacheMode) {
"""
Return the proxy instance which corresponds to the given datastore type.
@param datastoreType
The datastore type.
@param <T>
The instance type.
@return The instance.
"""
DatastoreId id = getDatastoreI... | java | private <T> T getInstance(DatastoreType datastoreType, TransactionalCache.Mode cacheMode) {
DatastoreId id = getDatastoreId(datastoreType);
Object instance = cache.get(id, cacheMode);
if (instance == null) {
DynamicType<?> types = getTypes(datastoreType);
instance = newIn... | [
"private",
"<",
"T",
">",
"T",
"getInstance",
"(",
"DatastoreType",
"datastoreType",
",",
"TransactionalCache",
".",
"Mode",
"cacheMode",
")",
"{",
"DatastoreId",
"id",
"=",
"getDatastoreId",
"(",
"datastoreType",
")",
";",
"Object",
"instance",
"=",
"cache",
... | Return the proxy instance which corresponds to the given datastore type.
@param datastoreType
The datastore type.
@param <T>
The instance type.
@return The instance. | [
"Return",
"the",
"proxy",
"instance",
"which",
"corresponds",
"to",
"the",
"given",
"datastore",
"type",
"."
] | train | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java#L89-L100 |
alkacon/opencms-core | src/org/opencms/webdav/CmsWebdavServlet.java | CmsWebdavServlet.doProppatch | protected void doProppatch(HttpServletRequest req, HttpServletResponse resp) {
"""
Process a PROPPATCH WebDAV request for the specified resource.<p>
Not implemented yet.<p>
@param req the servlet request we are processing
@param resp the servlet response we are creating
"""
// Check if Webdav i... | java | protected void doProppatch(HttpServletRequest req, HttpServletResponse resp) {
// Check if Webdav is read only
if (m_readOnly) {
resp.setStatus(CmsWebdavStatus.SC_FORBIDDEN);
if (LOG.isDebugEnabled()) {
LOG.debug(Messages.get().getBundle().key(Messages.LOG_WEBD... | [
"protected",
"void",
"doProppatch",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"resp",
")",
"{",
"// Check if Webdav is read only",
"if",
"(",
"m_readOnly",
")",
"{",
"resp",
".",
"setStatus",
"(",
"CmsWebdavStatus",
".",
"SC_FORBIDDEN",
")",
";",... | Process a PROPPATCH WebDAV request for the specified resource.<p>
Not implemented yet.<p>
@param req the servlet request we are processing
@param resp the servlet response we are creating | [
"Process",
"a",
"PROPPATCH",
"WebDAV",
"request",
"for",
"the",
"specified",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/webdav/CmsWebdavServlet.java#L1973-L2000 |
CloudSlang/cs-actions | cs-powershell/src/main/java/io/cloudslang/content/services/WSManRemoteShellService.java | WSManRemoteShellService.deleteShell | private void deleteShell(HttpClientService csHttpClient, HttpClientInputs httpClientInputs, String shellId, WSManRequestInputs wsManRequestInputs)
throws RuntimeException, IOException, URISyntaxException, TransformerException, XPathExpressionException, SAXException, ParserConfigurationException {
"""
D... | java | private void deleteShell(HttpClientService csHttpClient, HttpClientInputs httpClientInputs, String shellId, WSManRequestInputs wsManRequestInputs)
throws RuntimeException, IOException, URISyntaxException, TransformerException, XPathExpressionException, SAXException, ParserConfigurationException {
St... | [
"private",
"void",
"deleteShell",
"(",
"HttpClientService",
"csHttpClient",
",",
"HttpClientInputs",
"httpClientInputs",
",",
"String",
"shellId",
",",
"WSManRequestInputs",
"wsManRequestInputs",
")",
"throws",
"RuntimeException",
",",
"IOException",
",",
"URISyntaxExceptio... | Deletes the remote shell.
@param csHttpClient
@param httpClientInputs
@param shellId
@param wsManRequestInputs
@throws RuntimeException
@throws IOException
@throws URISyntaxException
@throws TransformerException
@throws XPathExpressionException
@throws SAXException
@throws ParserConfigurationException | [
"Deletes",
"the",
"remote",
"shell",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-powershell/src/main/java/io/cloudslang/content/services/WSManRemoteShellService.java#L319-L331 |
youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/clienthandler/ClientEventHandler.java | ClientEventHandler.responseClient | private void responseClient(RequestResponseClass clazz, Object listener, User user) {
"""
Response information to client
@param clazz structure of listener class
@param listener listener object
@param user smartfox user
"""
if(!clazz.isResponseToClient()) return;
String command = clazz.getResponseComm... | java | private void responseClient(RequestResponseClass clazz, Object listener, User user) {
if(!clazz.isResponseToClient()) return;
String command = clazz.getResponseCommand();
ISFSObject params = (ISFSObject) new ParamTransformer(context)
.transform(listener).getObject();
send(command, params, user);
} | [
"private",
"void",
"responseClient",
"(",
"RequestResponseClass",
"clazz",
",",
"Object",
"listener",
",",
"User",
"user",
")",
"{",
"if",
"(",
"!",
"clazz",
".",
"isResponseToClient",
"(",
")",
")",
"return",
";",
"String",
"command",
"=",
"clazz",
".",
"... | Response information to client
@param clazz structure of listener class
@param listener listener object
@param user smartfox user | [
"Response",
"information",
"to",
"client"
] | train | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/clienthandler/ClientEventHandler.java#L146-L152 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.div | public static BigDecimal div(BigDecimal v1, BigDecimal v2, int scale, RoundingMode roundingMode) {
"""
提供(相对)精确的除法运算,当发生除不尽的情况时,由scale指定精确度
@param v1 被除数
@param v2 除数
@param scale 精确度,如果为负值,取绝对值
@param roundingMode 保留小数的模式 {@link RoundingMode}
@return 两个参数的商
@since 3.0.9
"""
Assert.notNull(v2, "Divi... | java | public static BigDecimal div(BigDecimal v1, BigDecimal v2, int scale, RoundingMode roundingMode) {
Assert.notNull(v2, "Divisor must be not null !");
if (null == v1) {
return BigDecimal.ZERO;
}
if (scale < 0) {
scale = -scale;
}
return v1.divide(v2, scale, roundingMode);
} | [
"public",
"static",
"BigDecimal",
"div",
"(",
"BigDecimal",
"v1",
",",
"BigDecimal",
"v2",
",",
"int",
"scale",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"Assert",
".",
"notNull",
"(",
"v2",
",",
"\"Divisor must be not null !\"",
")",
";",
"if",
"(",
"n... | 提供(相对)精确的除法运算,当发生除不尽的情况时,由scale指定精确度
@param v1 被除数
@param v2 除数
@param scale 精确度,如果为负值,取绝对值
@param roundingMode 保留小数的模式 {@link RoundingMode}
@return 两个参数的商
@since 3.0.9 | [
"提供",
"(",
"相对",
")",
"精确的除法运算",
"当发生除不尽的情况时",
"由scale指定精确度"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L741-L750 |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.formatKeyPair | public static String formatKeyPair(Map<String, Object> keyPairs) {
"""
From an object map passed in, building a key value set, properly html
formatted for used in reporting
@param keyPairs - the key value set
@return String: an html formatting string
"""
if (keyPairs == null) {
return ... | java | public static String formatKeyPair(Map<String, Object> keyPairs) {
if (keyPairs == null) {
return "";
}
StringBuilder stringBuilder = new StringBuilder();
for (Map.Entry<String, Object> entry : keyPairs.entrySet()) {
stringBuilder.append(DIV);
stringBu... | [
"public",
"static",
"String",
"formatKeyPair",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"keyPairs",
")",
"{",
"if",
"(",
"keyPairs",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"stringBuilder",
"=",
"new",
"StringBuilder",
"(... | From an object map passed in, building a key value set, properly html
formatted for used in reporting
@param keyPairs - the key value set
@return String: an html formatting string | [
"From",
"an",
"object",
"map",
"passed",
"in",
"building",
"a",
"key",
"value",
"set",
"properly",
"html",
"formatted",
"for",
"used",
"in",
"reporting"
] | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L875-L888 |
getsentry/sentry-java | sentry-log4j2/src/main/java/io/sentry/log4j2/SentryAppender.java | SentryAppender.createAppender | @PluginFactory
@SuppressWarnings("checkstyle:parameternumber")
public static SentryAppender createAppender(@PluginAttribute("name") final String name,
@PluginElement("filter") final Filter filter) {
"""
Create a Sentry Appender.
@param name ... | java | @PluginFactory
@SuppressWarnings("checkstyle:parameternumber")
public static SentryAppender createAppender(@PluginAttribute("name") final String name,
@PluginElement("filter") final Filter filter) {
if (name == null) {
LOGGER.error("No name pr... | [
"@",
"PluginFactory",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:parameternumber\"",
")",
"public",
"static",
"SentryAppender",
"createAppender",
"(",
"@",
"PluginAttribute",
"(",
"\"name\"",
")",
"final",
"String",
"name",
",",
"@",
"PluginElement",
"(",
"\"filter\"... | Create a Sentry Appender.
@param name The name of the Appender.
@param filter The filter, if any, to use.
@return The SentryAppender. | [
"Create",
"a",
"Sentry",
"Appender",
"."
] | train | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry-log4j2/src/main/java/io/sentry/log4j2/SentryAppender.java#L75-L85 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spy3rd | public static <T1, T2, T3> TriPredicate<T1, T2, T3> spy3rd(TriPredicate<T1, T2, T3> predicate, Box<T3> param3) {
"""
Proxies a ternary predicate spying for third parameter.
@param <T1> the predicate first parameter type
@param <T2> the predicate second parameter type
@param <T3> the predicate third parameter ... | java | public static <T1, T2, T3> TriPredicate<T1, T2, T3> spy3rd(TriPredicate<T1, T2, T3> predicate, Box<T3> param3) {
return spy(predicate, Box.<Boolean>empty(), Box.<T1>empty(), Box.<T2>empty(), param3);
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
">",
"TriPredicate",
"<",
"T1",
",",
"T2",
",",
"T3",
">",
"spy3rd",
"(",
"TriPredicate",
"<",
"T1",
",",
"T2",
",",
"T3",
">",
"predicate",
",",
"Box",
"<",
"T3",
">",
"param3",
")",
"{",
"r... | Proxies a ternary predicate spying for third parameter.
@param <T1> the predicate first parameter type
@param <T2> the predicate second parameter type
@param <T3> the predicate third parameter type
@param predicate the predicate that will be spied
@param param3 a box that will be containing the third spied parameter
@... | [
"Proxies",
"a",
"ternary",
"predicate",
"spying",
"for",
"third",
"parameter",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L443-L445 |
googlegenomics/utils-java | src/main/java/com/google/cloud/genomics/utils/GenomicsFactory.java | GenomicsFactory.fromServiceAccount | public <T extends AbstractGoogleJsonClient.Builder> T fromServiceAccount(T builder,
String serviceAccountId, File p12File) throws GeneralSecurityException, IOException {
"""
Prepare an AbstractGoogleJsonClient.Builder with the given service account ID
and private key {@link File}.
@param builder The buil... | java | public <T extends AbstractGoogleJsonClient.Builder> T fromServiceAccount(T builder,
String serviceAccountId, File p12File) throws GeneralSecurityException, IOException {
Preconditions.checkNotNull(builder);
GoogleCredential creds = new GoogleCredential.Builder()
.setTransport(httpTransport)
... | [
"public",
"<",
"T",
"extends",
"AbstractGoogleJsonClient",
".",
"Builder",
">",
"T",
"fromServiceAccount",
"(",
"T",
"builder",
",",
"String",
"serviceAccountId",
",",
"File",
"p12File",
")",
"throws",
"GeneralSecurityException",
",",
"IOException",
"{",
"Preconditi... | Prepare an AbstractGoogleJsonClient.Builder with the given service account ID
and private key {@link File}.
@param builder The builder to be prepared.
@param serviceAccountId The service account ID (typically an email address)
@param p12File The file on disk containing the private key
@return The passed in builder, fo... | [
"Prepare",
"an",
"AbstractGoogleJsonClient",
".",
"Builder",
"with",
"the",
"given",
"service",
"account",
"ID",
"and",
"private",
"key",
"{",
"@link",
"File",
"}",
"."
] | train | https://github.com/googlegenomics/utils-java/blob/7205d5b4e4f61fc6b93acb4bdd76b93df5b5f612/src/main/java/com/google/cloud/genomics/utils/GenomicsFactory.java#L458-L470 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.translationRotateTowards | public Matrix4f translationRotateTowards(float posX, float posY, float posZ, float dirX, float dirY, float dirZ, float upX, float upY, float upZ) {
"""
Set this matrix to a model transformation for a right-handed coordinate system,
that translates to the given <code>(posX, posY, posZ)</code> and aligns the local ... | java | public Matrix4f translationRotateTowards(float posX, float posY, float posZ, float dirX, float dirY, float dirZ, float upX, float upY, float upZ) {
// Normalize direction
float invDirLength = 1.0f / (float) Math.sqrt(dirX * dirX + dirY * dirY + dirZ * dirZ);
float ndirX = dirX * invDirLength;
... | [
"public",
"Matrix4f",
"translationRotateTowards",
"(",
"float",
"posX",
",",
"float",
"posY",
",",
"float",
"posZ",
",",
"float",
"dirX",
",",
"float",
"dirY",
",",
"float",
"dirZ",
",",
"float",
"upX",
",",
"float",
"upY",
",",
"float",
"upZ",
")",
"{",... | Set this matrix to a model transformation for a right-handed coordinate system,
that translates to the given <code>(posX, posY, posZ)</code> and aligns the local <code>-z</code>
axis with <code>(dirX, dirY, dirZ)</code>.
<p>
This method is equivalent to calling: <code>translation(posX, posY, posZ).rotateTowards(dirX, d... | [
"Set",
"this",
"matrix",
"to",
"a",
"model",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"that",
"translates",
"to",
"the",
"given",
"<code",
">",
"(",
"posX",
"posY",
"posZ",
")",
"<",
"/",
"code",
">",
"and",
"aligns",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L14423-L14461 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaTaskLauncher.java | CoronaTaskLauncher.launchTask | public void launchTask(Task task, String trackerName, InetAddress addr) {
"""
Enqueue a launch task action.
@param task The task to launch.
@param trackerName The name of the tracker to send the task to.
@param addr The address of the tracker to send the task to.
"""
CoronaSessionInfo info = new CoronaS... | java | public void launchTask(Task task, String trackerName, InetAddress addr) {
CoronaSessionInfo info = new CoronaSessionInfo(
coronaJT.getSessionId(), coronaJT.getJobTrackerAddress(),
coronaJT.getSecondaryTrackerAddress());
LaunchTaskAction action = new LaunchTaskAction(task, info);
String descripti... | [
"public",
"void",
"launchTask",
"(",
"Task",
"task",
",",
"String",
"trackerName",
",",
"InetAddress",
"addr",
")",
"{",
"CoronaSessionInfo",
"info",
"=",
"new",
"CoronaSessionInfo",
"(",
"coronaJT",
".",
"getSessionId",
"(",
")",
",",
"coronaJT",
".",
"getJob... | Enqueue a launch task action.
@param task The task to launch.
@param trackerName The name of the tracker to send the task to.
@param addr The address of the tracker to send the task to. | [
"Enqueue",
"a",
"launch",
"task",
"action",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaTaskLauncher.java#L154-L165 |
JetBrains/xodus | environment/src/main/java/jetbrains/exodus/tree/btree/BTreeBalancePolicy.java | BTreeBalancePolicy.needMerge | public boolean needMerge(@NotNull final BasePage left, @NotNull final BasePage right) {
"""
Is invoked on the leaf deletion only.
@param left left page.
@param right right page.
@return true if the left page ought to be merged with the right one.
"""
final int leftSize = left.getSize();
f... | java | public boolean needMerge(@NotNull final BasePage left, @NotNull final BasePage right) {
final int leftSize = left.getSize();
final int rightSize = right.getSize();
return leftSize == 0 || rightSize == 0 ||
leftSize + rightSize <= (((isDupTree(left) ? getDupPageMaxSize() : getPageMaxS... | [
"public",
"boolean",
"needMerge",
"(",
"@",
"NotNull",
"final",
"BasePage",
"left",
",",
"@",
"NotNull",
"final",
"BasePage",
"right",
")",
"{",
"final",
"int",
"leftSize",
"=",
"left",
".",
"getSize",
"(",
")",
";",
"final",
"int",
"rightSize",
"=",
"ri... | Is invoked on the leaf deletion only.
@param left left page.
@param right right page.
@return true if the left page ought to be merged with the right one. | [
"Is",
"invoked",
"on",
"the",
"leaf",
"deletion",
"only",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/tree/btree/BTreeBalancePolicy.java#L70-L75 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java | EvaluationUtils.matthewsCorrelation | public static double matthewsCorrelation(long tp, long fp, long fn, long tn) {
"""
Calculate the binary Matthews correlation coefficient from counts
@param tp True positive count
@param fp False positive counts
@param fn False negative counts
@param tn True negative count
@return Matthews correlation coeffi... | java | public static double matthewsCorrelation(long tp, long fp, long fn, long tn) {
double numerator = ((double) tp) * tn - ((double) fp) * fn;
double denominator = Math.sqrt(((double) tp + fp) * (tp + fn) * (tn + fp) * (tn + fn));
return numerator / denominator;
} | [
"public",
"static",
"double",
"matthewsCorrelation",
"(",
"long",
"tp",
",",
"long",
"fp",
",",
"long",
"fn",
",",
"long",
"tn",
")",
"{",
"double",
"numerator",
"=",
"(",
"(",
"double",
")",
"tp",
")",
"*",
"tn",
"-",
"(",
"(",
"double",
")",
"fp"... | Calculate the binary Matthews correlation coefficient from counts
@param tp True positive count
@param fp False positive counts
@param fn False negative counts
@param tn True negative count
@return Matthews correlation coefficient | [
"Calculate",
"the",
"binary",
"Matthews",
"correlation",
"coefficient",
"from",
"counts"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java#L153-L157 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/preview/CmsCroppingParamBean.java | CmsCroppingParamBean.getRestrictedSizeScaleParam | public String getRestrictedSizeScaleParam(int maxHeight, int maxWidth) {
"""
Returns the scale parameter to this bean for a restricted maximum target size.<p>
@param maxHeight the max height
@param maxWidth the max width
@return the scale parameter
"""
String result = toString();
if (Cm... | java | public String getRestrictedSizeScaleParam(int maxHeight, int maxWidth) {
String result = toString();
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(result)) {
return getRestrictedSizeParam(maxHeight, maxWidth).toString();
}
if ((getOrgWidth() < maxWidth) && (getOrgHeight() < m... | [
"public",
"String",
"getRestrictedSizeScaleParam",
"(",
"int",
"maxHeight",
",",
"int",
"maxWidth",
")",
"{",
"String",
"result",
"=",
"toString",
"(",
")",
";",
"if",
"(",
"CmsStringUtil",
".",
"isNotEmptyOrWhitespaceOnly",
"(",
"result",
")",
")",
"{",
"retu... | Returns the scale parameter to this bean for a restricted maximum target size.<p>
@param maxHeight the max height
@param maxWidth the max width
@return the scale parameter | [
"Returns",
"the",
"scale",
"parameter",
"to",
"this",
"bean",
"for",
"a",
"restricted",
"maximum",
"target",
"size",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/CmsCroppingParamBean.java#L363-L376 |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/contents/Contents.java | Contents.exportXML | public void exportXML(String name, boolean skipBinary, boolean noRecurse) {
"""
Exports contents to the given file.
@param name the name of the file.
@param skipBinary
@param noRecurse
"""
console.jcrService().export(repository, workspace(), path(), name, true, true, new AsyncCallback<Object>() {
... | java | public void exportXML(String name, boolean skipBinary, boolean noRecurse) {
console.jcrService().export(repository, workspace(), path(), name, true, true, new AsyncCallback<Object>() {
@Override
public void onFailure(Throwable caught) {
SC.say(caught.getMessage());
... | [
"public",
"void",
"exportXML",
"(",
"String",
"name",
",",
"boolean",
"skipBinary",
",",
"boolean",
"noRecurse",
")",
"{",
"console",
".",
"jcrService",
"(",
")",
".",
"export",
"(",
"repository",
",",
"workspace",
"(",
")",
",",
"path",
"(",
")",
",",
... | Exports contents to the given file.
@param name the name of the file.
@param skipBinary
@param noRecurse | [
"Exports",
"contents",
"to",
"the",
"given",
"file",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/contents/Contents.java#L349-L361 |
ontop/ontop | core/obda/src/main/java/it/unibz/inf/ontop/spec/ontology/impl/OntologyBuilderImpl.java | OntologyBuilderImpl.addSubPropertyOfAxiom | @Override
public void addSubPropertyOfAxiom(DataPropertyExpression dpe1, DataPropertyExpression dpe2) throws InconsistentOntologyException {
"""
Normalizes and adds a data subproperty axiom
<p>
SubDataPropertyOf := 'SubDataPropertyOf' '(' axiomAnnotations
subDataPropertyExpression superDataPropertyExpressio... | java | @Override
public void addSubPropertyOfAxiom(DataPropertyExpression dpe1, DataPropertyExpression dpe2) throws InconsistentOntologyException {
checkSignature(dpe1);
checkSignature(dpe2);
dataPropertyAxioms.addInclusion(dpe1, dpe2);
} | [
"@",
"Override",
"public",
"void",
"addSubPropertyOfAxiom",
"(",
"DataPropertyExpression",
"dpe1",
",",
"DataPropertyExpression",
"dpe2",
")",
"throws",
"InconsistentOntologyException",
"{",
"checkSignature",
"(",
"dpe1",
")",
";",
"checkSignature",
"(",
"dpe2",
")",
... | Normalizes and adds a data subproperty axiom
<p>
SubDataPropertyOf := 'SubDataPropertyOf' '(' axiomAnnotations
subDataPropertyExpression superDataPropertyExpression ')'<br>
subDataPropertyExpression := DataPropertyExpression<br>
superDataPropertyExpression := DataPropertyExpression
<p>
implements rule [D1]:<br>
- ignor... | [
"Normalizes",
"and",
"adds",
"a",
"data",
"subproperty",
"axiom",
"<p",
">",
"SubDataPropertyOf",
":",
"=",
"SubDataPropertyOf",
"(",
"axiomAnnotations",
"subDataPropertyExpression",
"superDataPropertyExpression",
")",
"<br",
">",
"subDataPropertyExpression",
":",
"=",
... | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/obda/src/main/java/it/unibz/inf/ontop/spec/ontology/impl/OntologyBuilderImpl.java#L293-L298 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getMaps | public Future<MapDataOverview> getMaps(String version, String locale) {
"""
<p>
Retrieve map information
</p>
This method does not count towards the rate limit
@param version The data dragon version.
@param locale The locale information.
@return The list of all available maps.
@see <a href="https://deve... | java | public Future<MapDataOverview> getMaps(String version, String locale) {
return new DummyFuture<>(handler.getMaps(version, locale));
} | [
"public",
"Future",
"<",
"MapDataOverview",
">",
"getMaps",
"(",
"String",
"version",
",",
"String",
"locale",
")",
"{",
"return",
"new",
"DummyFuture",
"<>",
"(",
"handler",
".",
"getMaps",
"(",
"version",
",",
"locale",
")",
")",
";",
"}"
] | <p>
Retrieve map information
</p>
This method does not count towards the rate limit
@param version The data dragon version.
@param locale The locale information.
@return The list of all available maps.
@see <a href="https://developer.riotgames.com/api/methods#!/931">The official api documentation</a> | [
"<p",
">",
"Retrieve",
"map",
"information",
"<",
"/",
"p",
">",
"This",
"method",
"does",
"not",
"count",
"towards",
"the",
"rate",
"limit"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L867-L869 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/ModuleAssets.java | ModuleAssets.fetchAll | public CMAArray<CMAAsset> fetchAll(Map<String, String> map) {
"""
Fetch all Assets matching a query using configured space id and environment id.
<p>
This fetch uses the default parameter defined in {@link DefaultQueryParameter#FETCH}
@param map the query to narrow down the results.
@return matching assets.
... | java | public CMAArray<CMAAsset> fetchAll(Map<String, String> map) {
return fetchAll(spaceId, environmentId, map);
} | [
"public",
"CMAArray",
"<",
"CMAAsset",
">",
"fetchAll",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"map",
")",
"{",
"return",
"fetchAll",
"(",
"spaceId",
",",
"environmentId",
",",
"map",
")",
";",
"}"
] | Fetch all Assets matching a query using configured space id and environment id.
<p>
This fetch uses the default parameter defined in {@link DefaultQueryParameter#FETCH}
@param map the query to narrow down the results.
@return matching assets.
@throws IllegalArgumentException if configured space id is null.
@throws Ill... | [
"Fetch",
"all",
"Assets",
"matching",
"a",
"query",
"using",
"configured",
"space",
"id",
"and",
"environment",
"id",
".",
"<p",
">",
"This",
"fetch",
"uses",
"the",
"default",
"parameter",
"defined",
"in",
"{",
"@link",
"DefaultQueryParameter#FETCH",
"}"
] | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/ModuleAssets.java#L179-L181 |
jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java | ProtobufIDLProxy.generateProtobufDefinedForField | private static void generateProtobufDefinedForField(StringBuilder code, FieldElement field, Set<String> enumNames) {
"""
to generate @Protobuf defined code for target field.
@param code the code
@param field the field
@param enumNames the enum names
"""
code.append("@").append(Protobuf.class.getS... | java | private static void generateProtobufDefinedForField(StringBuilder code, FieldElement field, Set<String> enumNames) {
code.append("@").append(Protobuf.class.getSimpleName()).append("(");
String fieldType = fieldTypeMapping.get(getTypeName(field));
if (fieldType == null) {
if (en... | [
"private",
"static",
"void",
"generateProtobufDefinedForField",
"(",
"StringBuilder",
"code",
",",
"FieldElement",
"field",
",",
"Set",
"<",
"String",
">",
"enumNames",
")",
"{",
"code",
".",
"append",
"(",
"\"@\"",
")",
".",
"append",
"(",
"Protobuf",
".",
... | to generate @Protobuf defined code for target field.
@param code the code
@param field the field
@param enumNames the enum names | [
"to",
"generate",
"@Protobuf",
"defined",
"code",
"for",
"target",
"field",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java#L1397-L1423 |
mapsforge/mapsforge | mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java | MapFile.readPoiData | @Override
public MapReadResult readPoiData(Tile upperLeft, Tile lowerRight) {
"""
Reads POI data for an area defined by the tile in the upper left and the tile in
the lower right corner.
This implementation takes the data storage of a MapFile into account for greater efficiency.
@param upperLeft tile tha... | java | @Override
public MapReadResult readPoiData(Tile upperLeft, Tile lowerRight) {
return readMapData(upperLeft, lowerRight, Selector.POIS);
} | [
"@",
"Override",
"public",
"MapReadResult",
"readPoiData",
"(",
"Tile",
"upperLeft",
",",
"Tile",
"lowerRight",
")",
"{",
"return",
"readMapData",
"(",
"upperLeft",
",",
"lowerRight",
",",
"Selector",
".",
"POIS",
")",
";",
"}"
] | Reads POI data for an area defined by the tile in the upper left and the tile in
the lower right corner.
This implementation takes the data storage of a MapFile into account for greater efficiency.
@param upperLeft tile that defines the upper left corner of the requested area.
@param lowerRight tile that defines the ... | [
"Reads",
"POI",
"data",
"for",
"an",
"area",
"defined",
"by",
"the",
"tile",
"in",
"the",
"upper",
"left",
"and",
"the",
"tile",
"in",
"the",
"lower",
"right",
"corner",
".",
"This",
"implementation",
"takes",
"the",
"data",
"storage",
"of",
"a",
"MapFil... | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java#L951-L954 |
phax/ph-oton | ph-oton-security/src/main/java/com/helger/photon/security/user/UserManager.java | UserManager.areUserIDAndPasswordValid | public boolean areUserIDAndPasswordValid (@Nullable final String sUserID, @Nullable final String sPlainTextPassword) {
"""
Check if the passed combination of user ID and password matches.
@param sUserID
The ID of the user
@param sPlainTextPassword
The plan text password to validate.
@return <code>true</code... | java | public boolean areUserIDAndPasswordValid (@Nullable final String sUserID, @Nullable final String sPlainTextPassword)
{
// No password is not allowed
if (sPlainTextPassword == null)
return false;
// Is there such a user?
final IUser aUser = getOfID (sUserID);
if (aUser == null)
return ... | [
"public",
"boolean",
"areUserIDAndPasswordValid",
"(",
"@",
"Nullable",
"final",
"String",
"sUserID",
",",
"@",
"Nullable",
"final",
"String",
"sPlainTextPassword",
")",
"{",
"// No password is not allowed",
"if",
"(",
"sPlainTextPassword",
"==",
"null",
")",
"return"... | Check if the passed combination of user ID and password matches.
@param sUserID
The ID of the user
@param sPlainTextPassword
The plan text password to validate.
@return <code>true</code> if the password hash matches the stored hash for
the specified user, <code>false</code> otherwise. | [
"Check",
"if",
"the",
"passed",
"combination",
"of",
"user",
"ID",
"and",
"password",
"matches",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-security/src/main/java/com/helger/photon/security/user/UserManager.java#L749-L767 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_monitor_misc.java | xen_health_monitor_misc.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
xen_health_monitor_misc_responses result = (xen_health_monitor_misc_res... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_health_monitor_misc_responses result = (xen_health_monitor_misc_responses) service.get_payload_formatter().string_to_resource(xen_health_monitor_misc_responses.class, response);
if(result.errorcode !... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"xen_health_monitor_misc_responses",
"result",
"=",
"(",
"xen_health_monitor_misc_responses",
")",
"service",
".... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_monitor_misc.java#L173-L190 |
datacleaner/AnalyzerBeans | core/src/main/java/org/eobjects/analyzer/lifecycle/LifeCycleHelper.java | LifeCycleHelper.assignProvidedProperties | public void assignProvidedProperties(ComponentDescriptor<?> descriptor, Object component) {
"""
Assigns/injects {@link Provided} property values to a component.
@param descriptor
@param component
"""
AssignProvidedCallback callback = new AssignProvidedCallback(_injectionManager);
callback.o... | java | public void assignProvidedProperties(ComponentDescriptor<?> descriptor, Object component) {
AssignProvidedCallback callback = new AssignProvidedCallback(_injectionManager);
callback.onEvent(component, descriptor);
} | [
"public",
"void",
"assignProvidedProperties",
"(",
"ComponentDescriptor",
"<",
"?",
">",
"descriptor",
",",
"Object",
"component",
")",
"{",
"AssignProvidedCallback",
"callback",
"=",
"new",
"AssignProvidedCallback",
"(",
"_injectionManager",
")",
";",
"callback",
"."... | Assigns/injects {@link Provided} property values to a component.
@param descriptor
@param component | [
"Assigns",
"/",
"injects",
"{",
"@link",
"Provided",
"}",
"property",
"values",
"to",
"a",
"component",
"."
] | train | https://github.com/datacleaner/AnalyzerBeans/blob/f82dae080d80d2a647b706a5fb22b3ea250613b3/core/src/main/java/org/eobjects/analyzer/lifecycle/LifeCycleHelper.java#L134-L137 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getRune | public Future<Item> getRune(int id, ItemData data, String version, String locale) {
"""
<p>
Retrieve a specific runes
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param id The id of the runes
@param data Additional information to retrieve
@param version Data dra... | java | public Future<Item> getRune(int id, ItemData data, String version, String locale) {
return new DummyFuture<>(handler.getRune(id, data, version, locale));
} | [
"public",
"Future",
"<",
"Item",
">",
"getRune",
"(",
"int",
"id",
",",
"ItemData",
"data",
",",
"String",
"version",
",",
"String",
"locale",
")",
"{",
"return",
"new",
"DummyFuture",
"<>",
"(",
"handler",
".",
"getRune",
"(",
"id",
",",
"data",
",",
... | <p>
Retrieve a specific runes
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param id The id of the runes
@param data Additional information to retrieve
@param version Data dragon version for returned data
@param locale Locale code for returned data
@return The runes
@see <a... | [
"<p",
">",
"Retrieve",
"a",
"specific",
"runes",
"<",
"/",
"p",
">",
"This",
"method",
"does",
"not",
"count",
"towards",
"the",
"rate",
"limit",
"and",
"is",
"not",
"affected",
"by",
"the",
"throttle"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L700-L702 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java | HtmlTree.TABLE | public static HtmlTree TABLE(HtmlStyle styleClass, int border, int cellPadding,
int cellSpacing, String summary, Content body) {
"""
Generates a Table tag with style class, border, cell padding,
cellspacing and summary attributes and some content.
@param styleClass style of the table
@param border... | java | public static HtmlTree TABLE(HtmlStyle styleClass, int border, int cellPadding,
int cellSpacing, String summary, Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.TABLE, nullCheck(body));
if (styleClass != null)
htmltree.addStyle(styleClass);
htmltree.addAttr(HtmlA... | [
"public",
"static",
"HtmlTree",
"TABLE",
"(",
"HtmlStyle",
"styleClass",
",",
"int",
"border",
",",
"int",
"cellPadding",
",",
"int",
"cellSpacing",
",",
"String",
"summary",
",",
"Content",
"body",
")",
"{",
"HtmlTree",
"htmltree",
"=",
"new",
"HtmlTree",
"... | Generates a Table tag with style class, border, cell padding,
cellspacing and summary attributes and some content.
@param styleClass style of the table
@param border border for the table
@param cellPadding cell padding for the table
@param cellSpacing cell spacing for the table
@param summary summary for the table
@pa... | [
"Generates",
"a",
"Table",
"tag",
"with",
"style",
"class",
"border",
"cell",
"padding",
"cellspacing",
"and",
"summary",
"attributes",
"and",
"some",
"content",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java#L638-L648 |
wildfly/wildfly-core | launcher/src/main/java/org/wildfly/core/launcher/StandaloneCommandBuilder.java | StandaloneCommandBuilder.addSecurityProperty | public StandaloneCommandBuilder addSecurityProperty(final String key, final String value) {
"""
Adds a security property to be passed to the server.
@param key the property key
@param value the property value
@return the builder
"""
securityProperties.put(key, value);
return this;
... | java | public StandaloneCommandBuilder addSecurityProperty(final String key, final String value) {
securityProperties.put(key, value);
return this;
} | [
"public",
"StandaloneCommandBuilder",
"addSecurityProperty",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"securityProperties",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a security property to be passed to the server.
@param key the property key
@param value the property value
@return the builder | [
"Adds",
"a",
"security",
"property",
"to",
"be",
"passed",
"to",
"the",
"server",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/StandaloneCommandBuilder.java#L390-L393 |
DependencyWatcher/agent | src/main/java/com/dependencywatcher/collector/DataArchiver.java | DataArchiver.add | public void add(String file, String contents) throws IOException {
"""
Create new file in the data archive
@param file File name
@param contents File contents
@throws IOException
"""
FileUtils.writeStringToFile(tempDir.resolve(file).toFile(), contents);
} | java | public void add(String file, String contents) throws IOException {
FileUtils.writeStringToFile(tempDir.resolve(file).toFile(), contents);
} | [
"public",
"void",
"add",
"(",
"String",
"file",
",",
"String",
"contents",
")",
"throws",
"IOException",
"{",
"FileUtils",
".",
"writeStringToFile",
"(",
"tempDir",
".",
"resolve",
"(",
"file",
")",
".",
"toFile",
"(",
")",
",",
"contents",
")",
";",
"}"... | Create new file in the data archive
@param file File name
@param contents File contents
@throws IOException | [
"Create",
"new",
"file",
"in",
"the",
"data",
"archive"
] | train | https://github.com/DependencyWatcher/agent/blob/6a082650275f9555993f5607d1f0bbe7aceceee1/src/main/java/com/dependencywatcher/collector/DataArchiver.java#L56-L58 |
aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/http/Includer.java | Includer.sendError | public static void sendError(HttpServletRequest request, HttpServletResponse response, int status, String message) throws IOException {
"""
Sends an error. When not in an included page, calls sendError directly.
When inside of an include will set request attribute so outermost include can call sendError.
"""... | java | public static void sendError(HttpServletRequest request, HttpServletResponse response, int status, String message) throws IOException {
if(request.getAttribute(IS_INCLUDED_REQUEST_ATTRIBUTE_NAME) == null) {
// Not included, sendError directly
if(message == null) {
response.sendError(status);
} else {
... | [
"public",
"static",
"void",
"sendError",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"int",
"status",
",",
"String",
"message",
")",
"throws",
"IOException",
"{",
"if",
"(",
"request",
".",
"getAttribute",
"(",
"IS_INCLUDED_R... | Sends an error. When not in an included page, calls sendError directly.
When inside of an include will set request attribute so outermost include can call sendError. | [
"Sends",
"an",
"error",
".",
"When",
"not",
"in",
"an",
"included",
"page",
"calls",
"sendError",
"directly",
".",
"When",
"inside",
"of",
"an",
"include",
"will",
"set",
"request",
"attribute",
"so",
"outermost",
"include",
"can",
"call",
"sendError",
"."
] | train | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/Includer.java#L141-L154 |
Tristan971/EasyFXML | easyfxml/src/main/java/moe/tristan/easyfxml/util/Nodes.java | Nodes.centerNode | public static void centerNode(final Node node, final Double marginSize) {
"""
Centers a node that is inside an enclosing {@link AnchorPane}.
@param node The node to center
@param marginSize The margins to keep on the sides
"""
AnchorPane.setTopAnchor(node, marginSize);
AnchorPane.setB... | java | public static void centerNode(final Node node, final Double marginSize) {
AnchorPane.setTopAnchor(node, marginSize);
AnchorPane.setBottomAnchor(node, marginSize);
AnchorPane.setLeftAnchor(node, marginSize);
AnchorPane.setRightAnchor(node, marginSize);
} | [
"public",
"static",
"void",
"centerNode",
"(",
"final",
"Node",
"node",
",",
"final",
"Double",
"marginSize",
")",
"{",
"AnchorPane",
".",
"setTopAnchor",
"(",
"node",
",",
"marginSize",
")",
";",
"AnchorPane",
".",
"setBottomAnchor",
"(",
"node",
",",
"marg... | Centers a node that is inside an enclosing {@link AnchorPane}.
@param node The node to center
@param marginSize The margins to keep on the sides | [
"Centers",
"a",
"node",
"that",
"is",
"inside",
"an",
"enclosing",
"{",
"@link",
"AnchorPane",
"}",
"."
] | train | https://github.com/Tristan971/EasyFXML/blob/f82cad1d54e62903ca5e4a250279ad315b028aef/easyfxml/src/main/java/moe/tristan/easyfxml/util/Nodes.java#L21-L26 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java | WorkflowsInner.listCallbackUrl | public WorkflowTriggerCallbackUrlInner listCallbackUrl(String resourceGroupName, String workflowName, GetCallbackUrlParameters listCallbackUrl) {
"""
Get the workflow callback Url.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param listCallbackUrl Which callback ur... | java | public WorkflowTriggerCallbackUrlInner listCallbackUrl(String resourceGroupName, String workflowName, GetCallbackUrlParameters listCallbackUrl) {
return listCallbackUrlWithServiceResponseAsync(resourceGroupName, workflowName, listCallbackUrl).toBlocking().single().body();
} | [
"public",
"WorkflowTriggerCallbackUrlInner",
"listCallbackUrl",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
",",
"GetCallbackUrlParameters",
"listCallbackUrl",
")",
"{",
"return",
"listCallbackUrlWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"... | Get the workflow callback Url.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param listCallbackUrl Which callback url to list.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws... | [
"Get",
"the",
"workflow",
"callback",
"Url",
"."
] | 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/WorkflowsInner.java#L1313-L1315 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRelPersistenceImpl.java | CommerceDiscountRelPersistenceImpl.findByCN_CPK | @Override
public List<CommerceDiscountRel> findByCN_CPK(long classNameId,
long classPK, int start, int end) {
"""
Returns a range of all the commerce discount rels where classNameId = ? and classPK = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <cod... | java | @Override
public List<CommerceDiscountRel> findByCN_CPK(long classNameId,
long classPK, int start, int end) {
return findByCN_CPK(classNameId, classPK, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceDiscountRel",
">",
"findByCN_CPK",
"(",
"long",
"classNameId",
",",
"long",
"classPK",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCN_CPK",
"(",
"classNameId",
",",
"classPK",
",",
"star... | Returns a range of all the commerce discount rels where classNameId = ? and classPK = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to ... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"discount",
"rels",
"where",
"classNameId",
"=",
"?",
";",
"and",
"classPK",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRelPersistenceImpl.java#L1225-L1229 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/DistributerMap.java | DistributerMap.toRemote | public String toRemote(final String host, final File localFile) {
"""
Converts the local file name to the remote name for the same file.
@param host
host
@param localFile
local file
@return remote name for local file, null if unknown.
"""
if (this.remoteName != null && (this.hosts == null || this.ho... | java | public String toRemote(final String host, final File localFile) {
if (this.remoteName != null && (this.hosts == null || this.hosts.contains(host))) {
try {
final String canonical = localFile.getCanonicalPath();
if (canonical.startsWith(this.canonicalPath) && isActive()) {
return th... | [
"public",
"String",
"toRemote",
"(",
"final",
"String",
"host",
",",
"final",
"File",
"localFile",
")",
"{",
"if",
"(",
"this",
".",
"remoteName",
"!=",
"null",
"&&",
"(",
"this",
".",
"hosts",
"==",
"null",
"||",
"this",
".",
"hosts",
".",
"contains",... | Converts the local file name to the remote name for the same file.
@param host
host
@param localFile
local file
@return remote name for local file, null if unknown. | [
"Converts",
"the",
"local",
"file",
"name",
"to",
"the",
"remote",
"name",
"for",
"the",
"same",
"file",
"."
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/DistributerMap.java#L210-L223 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java | SourceLineAnnotation.forEntireMethod | public static SourceLineAnnotation forEntireMethod(JavaClass javaClass, @CheckForNull Method method) {
"""
Create a SourceLineAnnotation covering an entire method.
@param javaClass
JavaClass containing the method
@param method
the method
@return a SourceLineAnnotation for the entire method
"""
S... | java | public static SourceLineAnnotation forEntireMethod(JavaClass javaClass, @CheckForNull Method method) {
String sourceFile = javaClass.getSourceFileName();
if (method == null) {
return createUnknown(javaClass.getClassName(), sourceFile);
}
Code code = method.getCode();
... | [
"public",
"static",
"SourceLineAnnotation",
"forEntireMethod",
"(",
"JavaClass",
"javaClass",
",",
"@",
"CheckForNull",
"Method",
"method",
")",
"{",
"String",
"sourceFile",
"=",
"javaClass",
".",
"getSourceFileName",
"(",
")",
";",
"if",
"(",
"method",
"==",
"n... | Create a SourceLineAnnotation covering an entire method.
@param javaClass
JavaClass containing the method
@param method
the method
@return a SourceLineAnnotation for the entire method | [
"Create",
"a",
"SourceLineAnnotation",
"covering",
"an",
"entire",
"method",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java#L281-L293 |
undertow-io/undertow | core/src/main/java/io/undertow/Handlers.java | Handlers.virtualHost | public static NameVirtualHostHandler virtualHost(final HttpHandler hostHandler, String... hostnames) {
"""
Creates a new virtual host handler that uses the provided handler as the root handler for the given hostnames.
@param hostHandler The host handler
@param hostnames The host names
@return A new virtual ... | java | public static NameVirtualHostHandler virtualHost(final HttpHandler hostHandler, String... hostnames) {
NameVirtualHostHandler handler = new NameVirtualHostHandler();
for (String host : hostnames) {
handler.addHost(host, hostHandler);
}
return handler;
} | [
"public",
"static",
"NameVirtualHostHandler",
"virtualHost",
"(",
"final",
"HttpHandler",
"hostHandler",
",",
"String",
"...",
"hostnames",
")",
"{",
"NameVirtualHostHandler",
"handler",
"=",
"new",
"NameVirtualHostHandler",
"(",
")",
";",
"for",
"(",
"String",
"hos... | Creates a new virtual host handler that uses the provided handler as the root handler for the given hostnames.
@param hostHandler The host handler
@param hostnames The host names
@return A new virtual host handler | [
"Creates",
"a",
"new",
"virtual",
"host",
"handler",
"that",
"uses",
"the",
"provided",
"handler",
"as",
"the",
"root",
"handler",
"for",
"the",
"given",
"hostnames",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/Handlers.java#L151-L157 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/annotation/AnnotationValue.java | AnnotationValue.getRequiredValue | public @Nonnull final <T> T getRequiredValue(String member, Class<T> type) {
"""
Get the value of the {@code value} member of the annotation.
@param member The member
@param type The type
@param <T> The type
@throws IllegalStateException If no member is available that conforms to the given name and type
@re... | java | public @Nonnull final <T> T getRequiredValue(String member, Class<T> type) {
return get(member, ConversionContext.of(type)).orElseThrow(() -> new IllegalStateException("No value available for annotation member @" + annotationName + "[" + member + "] of type: " + type));
} | [
"public",
"@",
"Nonnull",
"final",
"<",
"T",
">",
"T",
"getRequiredValue",
"(",
"String",
"member",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"get",
"(",
"member",
",",
"ConversionContext",
".",
"of",
"(",
"type",
")",
")",
".",
"orEls... | Get the value of the {@code value} member of the annotation.
@param member The member
@param type The type
@param <T> The type
@throws IllegalStateException If no member is available that conforms to the given name and type
@return The result | [
"Get",
"the",
"value",
"of",
"the",
"{",
"@code",
"value",
"}",
"member",
"of",
"the",
"annotation",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/annotation/AnnotationValue.java#L223-L225 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/br/br_configuresyslog.java | br_configuresyslog.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
br_configuresyslog_responses result = (br_configuresyslog_responses) se... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
br_configuresyslog_responses result = (br_configuresyslog_responses) service.get_payload_formatter().string_to_resource(br_configuresyslog_responses.class, response);
if(result.errorcode != 0)
{
i... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"br_configuresyslog_responses",
"result",
"=",
"(",
"br_configuresyslog_responses",
")",
"service",
".",
"get_... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/br/br_configuresyslog.java#L178-L195 |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/voice/VoiceClient.java | VoiceClient.startTalk | public TalkResponse startTalk(String uuid, String text) throws IOException, NexmoClientException {
"""
Send a synthesized speech message to an ongoing call.
<p>
The message will only play once, spoken with the default voice of Kimberly.
@param uuid The UUID of the call, obtained from the object returned by {@... | java | public TalkResponse startTalk(String uuid, String text) throws IOException, NexmoClientException {
return talk.put(new TalkRequest(uuid, text));
} | [
"public",
"TalkResponse",
"startTalk",
"(",
"String",
"uuid",
",",
"String",
"text",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"talk",
".",
"put",
"(",
"new",
"TalkRequest",
"(",
"uuid",
",",
"text",
")",
")",
";",
"}"
] | Send a synthesized speech message to an ongoing call.
<p>
The message will only play once, spoken with the default voice of Kimberly.
@param uuid The UUID of the call, obtained from the object returned by {@link #createCall(Call)}. This value can
be obtained with {@link CallEvent#getUuid()}
@param text The message to ... | [
"Send",
"a",
"synthesized",
"speech",
"message",
"to",
"an",
"ongoing",
"call",
".",
"<p",
">",
"The",
"message",
"will",
"only",
"play",
"once",
"spoken",
"with",
"the",
"default",
"voice",
"of",
"Kimberly",
"."
] | train | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/voice/VoiceClient.java#L255-L257 |
upwork/java-upwork | src/com/Upwork/api/Routers/Messages.java | Messages.updateRoomMetadata | public JSONObject updateRoomMetadata(String company, String roomId, HashMap<String, String> params) throws JSONException {
"""
Update the metadata of a room
@param company Company ID
@param roomId Room ID
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject}
"... | java | public JSONObject updateRoomMetadata(String company, String roomId, HashMap<String, String> params) throws JSONException {
return oClient.put("/messages/v3/" + company + "/rooms/" + roomId, params);
} | [
"public",
"JSONObject",
"updateRoomMetadata",
"(",
"String",
"company",
",",
"String",
"roomId",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"put",
"(",
"\"/messages/v3/\"",
"+",
"... | Update the metadata of a room
@param company Company ID
@param roomId Room ID
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Update",
"the",
"metadata",
"of",
"a",
"room"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Messages.java#L153-L155 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.