repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 218 | func_name stringlengths 5 140 | whole_func_string stringlengths 79 3.99k | language stringclasses 1
value | func_code_string stringlengths 79 3.99k | func_code_tokens listlengths 20 624 | func_documentation_string stringlengths 61 1.96k | func_documentation_tokens listlengths 1 478 | split_name stringclasses 1
value | func_code_url stringlengths 107 339 |
|---|---|---|---|---|---|---|---|---|---|---|
Wadpam/guja | guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java | GeneratedDContactDaoImpl.queryByWebPage | public Iterable<DContact> queryByWebPage(Object parent, java.lang.String webPage) {
return queryByField(parent, DContactMapper.Field.WEBPAGE.getFieldName(), webPage);
} | java | public Iterable<DContact> queryByWebPage(Object parent, java.lang.String webPage) {
return queryByField(parent, DContactMapper.Field.WEBPAGE.getFieldName(), webPage);
} | [
"public",
"Iterable",
"<",
"DContact",
">",
"queryByWebPage",
"(",
"Object",
"parent",
",",
"java",
".",
"lang",
".",
"String",
"webPage",
")",
"{",
"return",
"queryByField",
"(",
"parent",
",",
"DContactMapper",
".",
"Field",
".",
"WEBPAGE",
".",
"getFieldN... | query-by method for field webPage
@param webPage the specified attribute
@return an Iterable of DContacts for the specified webPage | [
"query",
"-",
"by",
"method",
"for",
"field",
"webPage"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java#L313-L315 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/block/meta/MasterWorkerInfo.java | MasterWorkerInfo.updateToRemovedBlock | public void updateToRemovedBlock(boolean add, long blockId) {
if (add) {
if (mBlocks.contains(blockId)) {
mToRemoveBlocks.add(blockId);
}
} else {
mToRemoveBlocks.remove(blockId);
}
} | java | public void updateToRemovedBlock(boolean add, long blockId) {
if (add) {
if (mBlocks.contains(blockId)) {
mToRemoveBlocks.add(blockId);
}
} else {
mToRemoveBlocks.remove(blockId);
}
} | [
"public",
"void",
"updateToRemovedBlock",
"(",
"boolean",
"add",
",",
"long",
"blockId",
")",
"{",
"if",
"(",
"add",
")",
"{",
"if",
"(",
"mBlocks",
".",
"contains",
"(",
"blockId",
")",
")",
"{",
"mToRemoveBlocks",
".",
"add",
"(",
"blockId",
")",
";"... | Adds or removes a block from the to-be-removed blocks set of the worker.
@param add true if to add, to remove otherwise
@param blockId the id of the block to be added or removed | [
"Adds",
"or",
"removes",
"a",
"block",
"from",
"the",
"to",
"-",
"be",
"-",
"removed",
"blocks",
"set",
"of",
"the",
"worker",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/block/meta/MasterWorkerInfo.java#L397-L405 |
apache/spark | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java | UTF8String.indexOf | public int indexOf(UTF8String v, int start) {
if (v.numBytes() == 0) {
return 0;
}
// locate to the start position.
int i = 0; // position in byte
int c = 0; // position in character
while (i < numBytes && c < start) {
i += numBytesForFirstByte(getByte(i));
c += 1;
}
... | java | public int indexOf(UTF8String v, int start) {
if (v.numBytes() == 0) {
return 0;
}
// locate to the start position.
int i = 0; // position in byte
int c = 0; // position in character
while (i < numBytes && c < start) {
i += numBytesForFirstByte(getByte(i));
c += 1;
}
... | [
"public",
"int",
"indexOf",
"(",
"UTF8String",
"v",
",",
"int",
"start",
")",
"{",
"if",
"(",
"v",
".",
"numBytes",
"(",
")",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"// locate to the start position.",
"int",
"i",
"=",
"0",
";",
"// position in b... | Returns the position of the first occurrence of substr in
current string from the specified position (0-based index).
@param v the string to be searched
@param start the start position of the current string for searching
@return the position of the first occurrence of substr, if not found, -1 returned. | [
"Returns",
"the",
"position",
"of",
"the",
"first",
"occurrence",
"of",
"substr",
"in",
"current",
"string",
"from",
"the",
"specified",
"position",
"(",
"0",
"-",
"based",
"index",
")",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java#L710-L735 |
BigBadaboom/androidsvg | androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java | SVGAndroidRenderer.calculateViewBoxTransform | private Matrix calculateViewBoxTransform(Box viewPort, Box viewBox, PreserveAspectRatio positioning)
{
Matrix m = new Matrix();
if (positioning == null || positioning.getAlignment() == null)
return m;
float xScale = viewPort.width / viewBox.width;
float yScale = viewPort.... | java | private Matrix calculateViewBoxTransform(Box viewPort, Box viewBox, PreserveAspectRatio positioning)
{
Matrix m = new Matrix();
if (positioning == null || positioning.getAlignment() == null)
return m;
float xScale = viewPort.width / viewBox.width;
float yScale = viewPort.... | [
"private",
"Matrix",
"calculateViewBoxTransform",
"(",
"Box",
"viewPort",
",",
"Box",
"viewBox",
",",
"PreserveAspectRatio",
"positioning",
")",
"{",
"Matrix",
"m",
"=",
"new",
"Matrix",
"(",
")",
";",
"if",
"(",
"positioning",
"==",
"null",
"||",
"positioning... | /*
Calculate the transform required to fit the supplied viewBox into the current viewPort.
See spec section 7.8 for an explanation of how this works.
aspectRatioRule determines where the graphic is placed in the viewPort when aspect ration
is kept. xMin means left justified, xMid is centred, xMax is right justified e... | [
"/",
"*",
"Calculate",
"the",
"transform",
"required",
"to",
"fit",
"the",
"supplied",
"viewBox",
"into",
"the",
"current",
"viewPort",
".",
"See",
"spec",
"section",
"7",
".",
"8",
"for",
"an",
"explanation",
"of",
"how",
"this",
"works",
"."
] | train | https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java#L2025-L2091 |
Impetus/Kundera | src/kundera-kudu/src/main/java/com/impetus/client/kudu/KuduDBClient.java | KuduDBClient.onPersist | @Override
protected void onPersist(EntityMetadata entityMetadata, Object entity, Object id, List<RelationHolder> rlHolders)
{
KuduSession session = kuduClient.newSession();
KuduTable table = null;
try
{
table = kuduClient.openTable(entityMetadata.getTableName());
... | java | @Override
protected void onPersist(EntityMetadata entityMetadata, Object entity, Object id, List<RelationHolder> rlHolders)
{
KuduSession session = kuduClient.newSession();
KuduTable table = null;
try
{
table = kuduClient.openTable(entityMetadata.getTableName());
... | [
"@",
"Override",
"protected",
"void",
"onPersist",
"(",
"EntityMetadata",
"entityMetadata",
",",
"Object",
"entity",
",",
"Object",
"id",
",",
"List",
"<",
"RelationHolder",
">",
"rlHolders",
")",
"{",
"KuduSession",
"session",
"=",
"kuduClient",
".",
"newSessio... | On persist.
@param entityMetadata
the entity metadata
@param entity
the entity
@param id
the id
@param rlHolders
the rl holders | [
"On",
"persist",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-kudu/src/main/java/com/impetus/client/kudu/KuduDBClient.java#L611-L650 |
EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.CheckTransparencyMask | private void CheckTransparencyMask(IfdTags metadata, int n) {
// Samples per pixel
if (!metadata.containsTagId(TiffTags.getTagId("SamplesPerPixel"))) {
validation.addErrorLoc("Missing Samples Per Pixel", "IFD" + n);
} else {
long spp = metadata.get(TiffTags.getTagId("SamplesPerPixel")).getFirstN... | java | private void CheckTransparencyMask(IfdTags metadata, int n) {
// Samples per pixel
if (!metadata.containsTagId(TiffTags.getTagId("SamplesPerPixel"))) {
validation.addErrorLoc("Missing Samples Per Pixel", "IFD" + n);
} else {
long spp = metadata.get(TiffTags.getTagId("SamplesPerPixel")).getFirstN... | [
"private",
"void",
"CheckTransparencyMask",
"(",
"IfdTags",
"metadata",
",",
"int",
"n",
")",
"{",
"// Samples per pixel",
"if",
"(",
"!",
"metadata",
".",
"containsTagId",
"(",
"TiffTags",
".",
"getTagId",
"(",
"\"SamplesPerPixel\"",
")",
")",
")",
"{",
"vali... | Check transparency mask.
@param metadata the metadata
@param n the ifd number | [
"Check",
"transparency",
"mask",
"."
] | train | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L318-L338 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/RepositoryReaderImpl.java | RepositoryReaderImpl.getLogLists | @Override
public Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after, Date maxTime) {
return getLogLists(after, maxTime, (LogRecordFilter) null);
} | java | @Override
public Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after, Date maxTime) {
return getLogLists(after, maxTime, (LogRecordFilter) null);
} | [
"@",
"Override",
"public",
"Iterable",
"<",
"ServerInstanceLogRecordList",
">",
"getLogLists",
"(",
"RepositoryPointer",
"after",
",",
"Date",
"maxTime",
")",
"{",
"return",
"getLogLists",
"(",
"after",
",",
"maxTime",
",",
"(",
"LogRecordFilter",
")",
"null",
"... | returns log records from the binary repository that are after a given location and less than or equal to a given date
Callers would have to invoke {@link RepositoryLogRecord#getRepositoryPointer()} to obtain the RepositoryPointer of the last record read.
@param after RepositoryPointer of the last read log record.
@par... | [
"returns",
"log",
"records",
"from",
"the",
"binary",
"repository",
"that",
"are",
"after",
"a",
"given",
"location",
"and",
"less",
"than",
"or",
"equal",
"to",
"a",
"given",
"date",
"Callers",
"would",
"have",
"to",
"invoke",
"{",
"@link",
"RepositoryLogRe... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/RepositoryReaderImpl.java#L774-L777 |
VoltDB/voltdb | src/frontend/org/voltdb/compiler/StatementCompiler.java | StatementCompiler.addFunctionDependence | private static void addFunctionDependence(Function function, Procedure procedure, Statement catalogStmt) {
String funcDeps = function.getStmtdependers();
Set<String> stmtSet = new TreeSet<>();
for (String stmtName : funcDeps.split(",")) {
if (! stmtName.isEmpty()) {
s... | java | private static void addFunctionDependence(Function function, Procedure procedure, Statement catalogStmt) {
String funcDeps = function.getStmtdependers();
Set<String> stmtSet = new TreeSet<>();
for (String stmtName : funcDeps.split(",")) {
if (! stmtName.isEmpty()) {
s... | [
"private",
"static",
"void",
"addFunctionDependence",
"(",
"Function",
"function",
",",
"Procedure",
"procedure",
",",
"Statement",
"catalogStmt",
")",
"{",
"String",
"funcDeps",
"=",
"function",
".",
"getStmtdependers",
"(",
")",
";",
"Set",
"<",
"String",
">",... | Add a dependence to a function of a statement. The function's
dependence string is altered with this function.
@param function The function to add as dependee.
@param procedure The procedure of the statement.
@param catalogStmt The statement to add as depender. | [
"Add",
"a",
"dependence",
"to",
"a",
"function",
"of",
"a",
"statement",
".",
"The",
"function",
"s",
"dependence",
"string",
"is",
"altered",
"with",
"this",
"function",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/compiler/StatementCompiler.java#L386-L418 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/ArrayUtil.java | ArrayUtil.haveEqualSets | public static boolean haveEqualSets(int[] arra, int[] arrb, int count) {
if (ArrayUtil.haveEqualArrays(arra, arrb, count)) {
return true;
}
if (count > arra.length || count > arrb.length) {
return false;
}
if (count == 1) {
return arra[0] ==... | java | public static boolean haveEqualSets(int[] arra, int[] arrb, int count) {
if (ArrayUtil.haveEqualArrays(arra, arrb, count)) {
return true;
}
if (count > arra.length || count > arrb.length) {
return false;
}
if (count == 1) {
return arra[0] ==... | [
"public",
"static",
"boolean",
"haveEqualSets",
"(",
"int",
"[",
"]",
"arra",
",",
"int",
"[",
"]",
"arrb",
",",
"int",
"count",
")",
"{",
"if",
"(",
"ArrayUtil",
".",
"haveEqualArrays",
"(",
"arra",
",",
"arrb",
",",
"count",
")",
")",
"{",
"return"... | Returns true if the first count elements of arra and arrb are identical
sets of integers (not necessarily in the same order). | [
"Returns",
"true",
"if",
"the",
"first",
"count",
"elements",
"of",
"arra",
"and",
"arrb",
"are",
"identical",
"sets",
"of",
"integers",
"(",
"not",
"necessarily",
"in",
"the",
"same",
"order",
")",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/ArrayUtil.java#L343-L370 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/FindingReplacing.java | FindingReplacing.betns | public S betns(String left, String right) {
return betn(left, right).late();
} | java | public S betns(String left, String right) {
return betn(left, right).late();
} | [
"public",
"S",
"betns",
"(",
"String",
"left",
",",
"String",
"right",
")",
"{",
"return",
"betn",
"(",
"left",
",",
"right",
")",
".",
"late",
"(",
")",
";",
"}"
] | Sets the substrings in given left tag and right tag as the search string
<B>May multiple substring matched.</B>
@see Betner#between(String, String)
@param leftSameWithRight
@return | [
"Sets",
"the",
"substrings",
"in",
"given",
"left",
"tag",
"and",
"right",
"tag",
"as",
"the",
"search",
"string",
"<B",
">",
"May",
"multiple",
"substring",
"matched",
".",
"<",
"/",
"B",
">"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/FindingReplacing.java#L202-L204 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/compiler/JBBPCompilerUtils.java | JBBPCompilerUtils.findIndexForFieldPath | public static int findIndexForFieldPath(final String fieldPath, final List<JBBPNamedFieldInfo> namedFields) {
final String normalized = JBBPUtils.normalizeFieldNameOrPath(fieldPath);
int result = -1;
for (int i = namedFields.size() - 1; i >= 0; i--) {
final JBBPNamedFieldInfo f = namedFields.get(i);
... | java | public static int findIndexForFieldPath(final String fieldPath, final List<JBBPNamedFieldInfo> namedFields) {
final String normalized = JBBPUtils.normalizeFieldNameOrPath(fieldPath);
int result = -1;
for (int i = namedFields.size() - 1; i >= 0; i--) {
final JBBPNamedFieldInfo f = namedFields.get(i);
... | [
"public",
"static",
"int",
"findIndexForFieldPath",
"(",
"final",
"String",
"fieldPath",
",",
"final",
"List",
"<",
"JBBPNamedFieldInfo",
">",
"namedFields",
")",
"{",
"final",
"String",
"normalized",
"=",
"JBBPUtils",
".",
"normalizeFieldNameOrPath",
"(",
"fieldPat... | Find a named field info index in a list for its path.
@param fieldPath a field path, it must not be null.
@param namedFields a list contains named field info items.
@return the index of a field for the path if found one, -1 otherwise | [
"Find",
"a",
"named",
"field",
"info",
"index",
"in",
"a",
"list",
"for",
"its",
"path",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/compiler/JBBPCompilerUtils.java#L42-L53 |
ZenHarbinger/l2fprod-properties-editor | src/main/java/com/l2fprod/common/swing/StatusBar.java | StatusBar.setZones | public void setZones(String[] ids, Component[] zones, String[] constraints) {
removeAll();
idToZones.clear();
for (int i = 0, c = zones.length; i < c; i++) {
addZone(ids[i], zones[i], constraints[i]);
}
} | java | public void setZones(String[] ids, Component[] zones, String[] constraints) {
removeAll();
idToZones.clear();
for (int i = 0, c = zones.length; i < c; i++) {
addZone(ids[i], zones[i], constraints[i]);
}
} | [
"public",
"void",
"setZones",
"(",
"String",
"[",
"]",
"ids",
",",
"Component",
"[",
"]",
"zones",
",",
"String",
"[",
"]",
"constraints",
")",
"{",
"removeAll",
"(",
")",
";",
"idToZones",
".",
"clear",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
... | For example:
<code>
setZones(new String[]{"A","B"},
new JComponent[]{new JLabel(), new JLabel()},
new String[]{"33%","*"});
</code>
would construct a new status bar with two zones (two JLabels) named A and
B, the first zone A will occupy 33 percents of the overall size of the
status bar and B the left space.
@param ... | [
"For",
"example",
":"
] | train | https://github.com/ZenHarbinger/l2fprod-properties-editor/blob/d9b15c3f0b6ac1d9a2a9d315be073d2a4a419c32/src/main/java/com/l2fprod/common/swing/StatusBar.java#L113-L119 |
opsmatters/newrelic-api | src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java | HttpContext.applyHeaders | private void applyHeaders(Invocation.Builder builder, Map<String, Object> headers)
{
if(headers != null)
{
for (Map.Entry<String, Object> e : headers.entrySet())
{
builder.header(e.getKey(), e.getValue());
}
}
} | java | private void applyHeaders(Invocation.Builder builder, Map<String, Object> headers)
{
if(headers != null)
{
for (Map.Entry<String, Object> e : headers.entrySet())
{
builder.header(e.getKey(), e.getValue());
}
}
} | [
"private",
"void",
"applyHeaders",
"(",
"Invocation",
".",
"Builder",
"builder",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
")",
"{",
"if",
"(",
"headers",
"!=",
"null",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"O... | Add the given set of headers to the web target.
@param builder The invocation to add the headers to
@param headers The headers to add | [
"Add",
"the",
"given",
"set",
"of",
"headers",
"to",
"the",
"web",
"target",
"."
] | train | https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java#L573-L582 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java | ST_Drape.drapeMultiLineString | public static Geometry drapeMultiLineString(MultiLineString lines, Geometry triangles, STRtree sTRtree) {
GeometryFactory factory = lines.getFactory();
//Split the triangles in lines to perform all intersections
Geometry triangleLines = LinearComponentExtracter.getGeometry(triangles, tr... | java | public static Geometry drapeMultiLineString(MultiLineString lines, Geometry triangles, STRtree sTRtree) {
GeometryFactory factory = lines.getFactory();
//Split the triangles in lines to perform all intersections
Geometry triangleLines = LinearComponentExtracter.getGeometry(triangles, tr... | [
"public",
"static",
"Geometry",
"drapeMultiLineString",
"(",
"MultiLineString",
"lines",
",",
"Geometry",
"triangles",
",",
"STRtree",
"sTRtree",
")",
"{",
"GeometryFactory",
"factory",
"=",
"lines",
".",
"getFactory",
"(",
")",
";",
"//Split the triangles in lines to... | Drape a multilinestring to a set of triangles
@param lines
@param triangles
@param sTRtree
@return | [
"Drape",
"a",
"multilinestring",
"to",
"a",
"set",
"of",
"triangles"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java#L128-L141 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/BuildSettingWizardPage.java | BuildSettingWizardPage.updateStatus | private void updateStatus(Throwable event) {
Throwable cause = event;
while (cause != null
&& (!(cause instanceof CoreException))
&& cause.getCause() != null
&& cause.getCause() != cause) {
cause = cause.getCause();
}
if (cause instanceof CoreException) {
updateStatus(((CoreException) cause).g... | java | private void updateStatus(Throwable event) {
Throwable cause = event;
while (cause != null
&& (!(cause instanceof CoreException))
&& cause.getCause() != null
&& cause.getCause() != cause) {
cause = cause.getCause();
}
if (cause instanceof CoreException) {
updateStatus(((CoreException) cause).g... | [
"private",
"void",
"updateStatus",
"(",
"Throwable",
"event",
")",
"{",
"Throwable",
"cause",
"=",
"event",
";",
"while",
"(",
"cause",
"!=",
"null",
"&&",
"(",
"!",
"(",
"cause",
"instanceof",
"CoreException",
")",
")",
"&&",
"cause",
".",
"getCause",
"... | Update the status of this page according to the given exception.
@param event the exception. | [
"Update",
"the",
"status",
"of",
"this",
"page",
"according",
"to",
"the",
"given",
"exception",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/BuildSettingWizardPage.java#L193-L213 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/PrefHelper.java | PrefHelper.setInteger | public void setInteger(String key, int value) {
prefHelper_.prefsEditor_.putInt(key, value);
prefHelper_.prefsEditor_.apply();
} | java | public void setInteger(String key, int value) {
prefHelper_.prefsEditor_.putInt(key, value);
prefHelper_.prefsEditor_.apply();
} | [
"public",
"void",
"setInteger",
"(",
"String",
"key",
",",
"int",
"value",
")",
"{",
"prefHelper_",
".",
"prefsEditor_",
".",
"putInt",
"(",
"key",
",",
"value",
")",
";",
"prefHelper_",
".",
"prefsEditor_",
".",
"apply",
"(",
")",
";",
"}"
] | <p>Sets the value of the {@link String} key value supplied in preferences.</p>
@param key A {@link String} value containing the key to reference.
@param value An {@link Integer} value to set the preference record to. | [
"<p",
">",
"Sets",
"the",
"value",
"of",
"the",
"{",
"@link",
"String",
"}",
"key",
"value",
"supplied",
"in",
"preferences",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/PrefHelper.java#L970-L973 |
azkaban/azkaban | az-hdfs-viewer/src/main/java/azkaban/viewer/hdfs/ORCFileViewer.java | ORCFileViewer.getSchema | @Override
public String getSchema(FileSystem fs, Path path) {
String schema = null;
try {
Reader orcReader = OrcFile.createReader(fs, path);
schema = orcReader.getObjectInspector().getTypeName();
} catch (IOException e) {
logger
.warn("Cann... | java | @Override
public String getSchema(FileSystem fs, Path path) {
String schema = null;
try {
Reader orcReader = OrcFile.createReader(fs, path);
schema = orcReader.getObjectInspector().getTypeName();
} catch (IOException e) {
logger
.warn("Cann... | [
"@",
"Override",
"public",
"String",
"getSchema",
"(",
"FileSystem",
"fs",
",",
"Path",
"path",
")",
"{",
"String",
"schema",
"=",
"null",
";",
"try",
"{",
"Reader",
"orcReader",
"=",
"OrcFile",
".",
"createReader",
"(",
"fs",
",",
"path",
")",
";",
"s... | Get schema in same syntax as in hadoop --orcdump {@inheritDoc}
@see HdfsFileViewer#getSchema(org.apache.hadoop.fs.FileSystem,
org.apache.hadoop.fs.Path) | [
"Get",
"schema",
"in",
"same",
"syntax",
"as",
"in",
"hadoop",
"--",
"orcdump",
"{",
"@inheritDoc",
"}"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hdfs-viewer/src/main/java/azkaban/viewer/hdfs/ORCFileViewer.java#L139-L152 |
aspectran/aspectran | shell/src/main/java/com/aspectran/shell/command/option/HelpFormatter.java | HelpFormatter.appendOptionGroup | private void appendOptionGroup(StringBuilder sb, OptionGroup group) {
if (!group.isRequired()) {
sb.append(OPTIONAL_BRACKET_OPEN);
}
List<Option> optList = new ArrayList<>(group.getOptions());
if (optList.size() > 1 && getOptionComparator() != null) {
optList.sort... | java | private void appendOptionGroup(StringBuilder sb, OptionGroup group) {
if (!group.isRequired()) {
sb.append(OPTIONAL_BRACKET_OPEN);
}
List<Option> optList = new ArrayList<>(group.getOptions());
if (optList.size() > 1 && getOptionComparator() != null) {
optList.sort... | [
"private",
"void",
"appendOptionGroup",
"(",
"StringBuilder",
"sb",
",",
"OptionGroup",
"group",
")",
"{",
"if",
"(",
"!",
"group",
".",
"isRequired",
"(",
")",
")",
"{",
"sb",
".",
"append",
"(",
"OPTIONAL_BRACKET_OPEN",
")",
";",
"}",
"List",
"<",
"Opt... | Appends the usage clause for an OptionGroup to a StringBuilder.
The clause is wrapped in square brackets if the group is required.
The display of the options is handled by appendOption.
@param sb the StringBuilder to append to
@param group the group to append | [
"Appends",
"the",
"usage",
"clause",
"for",
"an",
"OptionGroup",
"to",
"a",
"StringBuilder",
".",
"The",
"clause",
"is",
"wrapped",
"in",
"square",
"brackets",
"if",
"the",
"group",
"is",
"required",
".",
"The",
"display",
"of",
"the",
"options",
"is",
"ha... | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/shell/src/main/java/com/aspectran/shell/command/option/HelpFormatter.java#L261-L280 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/managers/AccountManager.java | AccountManager.setPassword | @CheckReturnValue
public AccountManager setPassword(String newPassword, String currentPassword)
{
Checks.notNull(newPassword, "password");
Checks.check(newPassword.length() >= 6 && newPassword.length() <= 128, "Password must be between 2-128 characters long");
this.currentPassword = curr... | java | @CheckReturnValue
public AccountManager setPassword(String newPassword, String currentPassword)
{
Checks.notNull(newPassword, "password");
Checks.check(newPassword.length() >= 6 && newPassword.length() <= 128, "Password must be between 2-128 characters long");
this.currentPassword = curr... | [
"@",
"CheckReturnValue",
"public",
"AccountManager",
"setPassword",
"(",
"String",
"newPassword",
",",
"String",
"currentPassword",
")",
"{",
"Checks",
".",
"notNull",
"(",
"newPassword",
",",
"\"password\"",
")",
";",
"Checks",
".",
"check",
"(",
"newPassword",
... | Sets the password for the currently logged in client account.
<br>If the new password is equal to the current password this does nothing.
@param newPassword
The new password for the currently logged in account
@param currentPassword
The <b>valid</b> current password for the represented account
@throws net.dv8tion.j... | [
"Sets",
"the",
"password",
"for",
"the",
"currently",
"logged",
"in",
"client",
"account",
".",
"<br",
">",
"If",
"the",
"new",
"password",
"is",
"equal",
"to",
"the",
"current",
"password",
"this",
"does",
"nothing",
"."
] | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/managers/AccountManager.java#L304-L313 |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/kerneldiscovery/StandardKernelDiscoveryService.java | StandardKernelDiscoveryService.postConstruction | @Inject
void postConstruction(NetworkService networkService, ExecutorService executorService) {
this.network = networkService;
this.network.addListener(new NetworkStartListener(), executorService.getExecutorService());
} | java | @Inject
void postConstruction(NetworkService networkService, ExecutorService executorService) {
this.network = networkService;
this.network.addListener(new NetworkStartListener(), executorService.getExecutorService());
} | [
"@",
"Inject",
"void",
"postConstruction",
"(",
"NetworkService",
"networkService",
",",
"ExecutorService",
"executorService",
")",
"{",
"this",
".",
"network",
"=",
"networkService",
";",
"this",
".",
"network",
".",
"addListener",
"(",
"new",
"NetworkStartListener... | Do the post initialization.
@param networkService network service to be linked to.
@param executorService execution service to use. | [
"Do",
"the",
"post",
"initialization",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/kerneldiscovery/StandardKernelDiscoveryService.java#L85-L89 |
inkstand-io/scribble | scribble-file/src/main/java/io/inkstand/scribble/rules/builder/TemporaryFileBuilder.java | TemporaryFileBuilder.asZip | public ZipFileBuilder asZip() {
final ZipFileBuilder zfb = new ZipFileBuilder(folder, filename);
if(this.content != null) {
zfb.addResource(getContenFileName(), this.content);
}
return zfb;
} | java | public ZipFileBuilder asZip() {
final ZipFileBuilder zfb = new ZipFileBuilder(folder, filename);
if(this.content != null) {
zfb.addResource(getContenFileName(), this.content);
}
return zfb;
} | [
"public",
"ZipFileBuilder",
"asZip",
"(",
")",
"{",
"final",
"ZipFileBuilder",
"zfb",
"=",
"new",
"ZipFileBuilder",
"(",
"folder",
",",
"filename",
")",
";",
"if",
"(",
"this",
".",
"content",
"!=",
"null",
")",
"{",
"zfb",
".",
"addResource",
"(",
"getC... | Indicates the content for the file should be zipped. If only one content reference is provided, the zip
will only contain this file.
@return
the builder | [
"Indicates",
"the",
"content",
"for",
"the",
"file",
"should",
"be",
"zipped",
".",
"If",
"only",
"one",
"content",
"reference",
"is",
"provided",
"the",
"zip",
"will",
"only",
"contain",
"this",
"file",
"."
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-file/src/main/java/io/inkstand/scribble/rules/builder/TemporaryFileBuilder.java#L100-L106 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/utils/PermissionUtil.java | PermissionUtil.canInteract | public static boolean canInteract(Member issuer, Member target)
{
Checks.notNull(issuer, "Issuer Member");
Checks.notNull(target, "Target Member");
Guild guild = issuer.getGuild();
if (!guild.equals(target.getGuild()))
throw new IllegalArgumentException("Provided members... | java | public static boolean canInteract(Member issuer, Member target)
{
Checks.notNull(issuer, "Issuer Member");
Checks.notNull(target, "Target Member");
Guild guild = issuer.getGuild();
if (!guild.equals(target.getGuild()))
throw new IllegalArgumentException("Provided members... | [
"public",
"static",
"boolean",
"canInteract",
"(",
"Member",
"issuer",
",",
"Member",
"target",
")",
"{",
"Checks",
".",
"notNull",
"(",
"issuer",
",",
"\"Issuer Member\"",
")",
";",
"Checks",
".",
"notNull",
"(",
"target",
",",
"\"Target Member\"",
")",
";"... | Checks if one given Member can interact with a 2nd given Member - in a permission sense (kick/ban/modify perms).
This only checks the Role-Position and does not check the actual permission (kick/ban/manage_role/...)
@param issuer
The member that tries to interact with 2nd member
@param target
The member that is the ... | [
"Checks",
"if",
"one",
"given",
"Member",
"can",
"interact",
"with",
"a",
"2nd",
"given",
"Member",
"-",
"in",
"a",
"permission",
"sense",
"(",
"kick",
"/",
"ban",
"/",
"modify",
"perms",
")",
".",
"This",
"only",
"checks",
"the",
"Role",
"-",
"Positio... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/utils/PermissionUtil.java#L43-L58 |
datumbox/lpsolve | src/main/java/lpsolve/LpSolve.java | LpSolve.putAbortfunc | public void putAbortfunc(AbortListener listener, Object userhandle) throws LpSolveException {
abortListener = listener;
abortUserhandle = (listener != null) ? userhandle : null;
addLp(this);
registerAbortfunc();
} | java | public void putAbortfunc(AbortListener listener, Object userhandle) throws LpSolveException {
abortListener = listener;
abortUserhandle = (listener != null) ? userhandle : null;
addLp(this);
registerAbortfunc();
} | [
"public",
"void",
"putAbortfunc",
"(",
"AbortListener",
"listener",
",",
"Object",
"userhandle",
")",
"throws",
"LpSolveException",
"{",
"abortListener",
"=",
"listener",
";",
"abortUserhandle",
"=",
"(",
"listener",
"!=",
"null",
")",
"?",
"userhandle",
":",
"n... | Register an <code>AbortListener</code> for callback.
@param listener the listener that should be called by lp_solve
@param userhandle an arbitrary object that is passed to the listener on call | [
"Register",
"an",
"<code",
">",
"AbortListener<",
"/",
"code",
">",
"for",
"callback",
"."
] | train | https://github.com/datumbox/lpsolve/blob/201b3e99153d907bb99c189e5647bc71a3a1add6/src/main/java/lpsolve/LpSolve.java#L1595-L1600 |
devcon5io/common | cli/src/main/java/io/devcon5/cli/OptionInjector.java | OptionInjector.injectParameters | private void injectParameters(Object target, Map<String, Option> options) {
ClassStreams.selfAndSupertypes(target.getClass()).forEach(type -> {
for (Field f : type.getDeclaredFields()) {
Optional.ofNullable(f.getAnnotation(CliOption.class))
.ifPresent(opt -> p... | java | private void injectParameters(Object target, Map<String, Option> options) {
ClassStreams.selfAndSupertypes(target.getClass()).forEach(type -> {
for (Field f : type.getDeclaredFields()) {
Optional.ofNullable(f.getAnnotation(CliOption.class))
.ifPresent(opt -> p... | [
"private",
"void",
"injectParameters",
"(",
"Object",
"target",
",",
"Map",
"<",
"String",
",",
"Option",
">",
"options",
")",
"{",
"ClassStreams",
".",
"selfAndSupertypes",
"(",
"target",
".",
"getClass",
"(",
")",
")",
".",
"forEach",
"(",
"type",
"->",
... | Inject parameter values from the map of options.
@param target
the target instance to parse cli parameters
@param options
the map of options, mapping short option names to {@link org.apache.commons.cli.Option} instances | [
"Inject",
"parameter",
"values",
"from",
"the",
"map",
"of",
"options",
"."
] | train | https://github.com/devcon5io/common/blob/363688e0dc904d559682bf796bd6c836b4e0efc7/cli/src/main/java/io/devcon5/cli/OptionInjector.java#L141-L150 |
h2oai/h2o-3 | h2o-genmodel/src/main/java/hex/genmodel/ModelMojoReader.java | ModelMojoReader.readFrom | public static MojoModel readFrom(MojoReaderBackend reader, final boolean readModelDescriptor) throws IOException {
try {
Map<String, Object> info = parseModelInfo(reader);
if (! info.containsKey("algorithm"))
throw new IllegalStateException("Unable to find information about the model's algorithm... | java | public static MojoModel readFrom(MojoReaderBackend reader, final boolean readModelDescriptor) throws IOException {
try {
Map<String, Object> info = parseModelInfo(reader);
if (! info.containsKey("algorithm"))
throw new IllegalStateException("Unable to find information about the model's algorithm... | [
"public",
"static",
"MojoModel",
"readFrom",
"(",
"MojoReaderBackend",
"reader",
",",
"final",
"boolean",
"readModelDescriptor",
")",
"throws",
"IOException",
"{",
"try",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"info",
"=",
"parseModelInfo",
"(",
"reader"... | De-serializes a {@link MojoModel}, creating an instance of {@link MojoModel} useful for scoring
and model evaluation.
@param reader An instance of {@link MojoReaderBackend} to read from existing MOJO
@param readModelDescriptor If true,
@return De-serialized {@link MojoModel}
@throws IOException Whenever there is ... | [
"De",
"-",
"serializes",
"a",
"{",
"@link",
"MojoModel",
"}",
"creating",
"an",
"instance",
"of",
"{",
"@link",
"MojoModel",
"}",
"useful",
"for",
"scoring",
"and",
"model",
"evaluation",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/ModelMojoReader.java#L50-L65 |
alkacon/opencms-core | src/org/opencms/loader/CmsRedirectLoader.java | CmsRedirectLoader.getController | protected CmsFlexController getController(
CmsObject cms,
CmsResource resource,
HttpServletRequest req,
HttpServletResponse res,
boolean streaming,
boolean top) {
CmsFlexController controller = null;
if (top) {
// only check for existing contr... | java | protected CmsFlexController getController(
CmsObject cms,
CmsResource resource,
HttpServletRequest req,
HttpServletResponse res,
boolean streaming,
boolean top) {
CmsFlexController controller = null;
if (top) {
// only check for existing contr... | [
"protected",
"CmsFlexController",
"getController",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
",",
"boolean",
"streaming",
",",
"boolean",
"top",
")",
"{",
"CmsFlexController",
"control... | Delivers a Flex controller, either by creating a new one, or by re-using an existing one.<p>
@param cms the initial CmsObject to wrap in the controller
@param resource the resource requested
@param req the current request
@param res the current response
@param streaming indicates if the response is streaming
@param to... | [
"Delivers",
"a",
"Flex",
"controller",
"either",
"by",
"creating",
"a",
"new",
"one",
"or",
"by",
"re",
"-",
"using",
"an",
"existing",
"one",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsRedirectLoader.java#L209-L235 |
JodaOrg/joda-money | src/main/java/org/joda/money/Money.java | Money.ofMajor | public static Money ofMajor(CurrencyUnit currency, long amountMajor) {
return Money.of(currency, BigDecimal.valueOf(amountMajor), RoundingMode.UNNECESSARY);
} | java | public static Money ofMajor(CurrencyUnit currency, long amountMajor) {
return Money.of(currency, BigDecimal.valueOf(amountMajor), RoundingMode.UNNECESSARY);
} | [
"public",
"static",
"Money",
"ofMajor",
"(",
"CurrencyUnit",
"currency",
",",
"long",
"amountMajor",
")",
"{",
"return",
"Money",
".",
"of",
"(",
"currency",
",",
"BigDecimal",
".",
"valueOf",
"(",
"amountMajor",
")",
",",
"RoundingMode",
".",
"UNNECESSARY",
... | Obtains an instance of {@code Money} from an amount in major units.
<p>
This allows you to create an instance with a specific currency and amount.
The amount is a whole number only. Thus you can initialise the value
'USD 20', but not the value 'USD 20.32'.
For example, {@code ofMajor(USD, 25)} creates the instance {@co... | [
"Obtains",
"an",
"instance",
"of",
"{",
"@code",
"Money",
"}",
"from",
"an",
"amount",
"in",
"major",
"units",
".",
"<p",
">",
"This",
"allows",
"you",
"to",
"create",
"an",
"instance",
"with",
"a",
"specific",
"currency",
"and",
"amount",
".",
"The",
... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/Money.java#L162-L164 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/CertificatesInner.java | CertificatesInner.getAsync | public Observable<IntegrationAccountCertificateInner> getAsync(String resourceGroupName, String integrationAccountName, String certificateName) {
return getWithServiceResponseAsync(resourceGroupName, integrationAccountName, certificateName).map(new Func1<ServiceResponse<IntegrationAccountCertificateInner>, Inte... | java | public Observable<IntegrationAccountCertificateInner> getAsync(String resourceGroupName, String integrationAccountName, String certificateName) {
return getWithServiceResponseAsync(resourceGroupName, integrationAccountName, certificateName).map(new Func1<ServiceResponse<IntegrationAccountCertificateInner>, Inte... | [
"public",
"Observable",
"<",
"IntegrationAccountCertificateInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"integrationAccountName",
",",
"String",
"certificateName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",... | Gets an integration account certificate.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@param certificateName The integration account certificate name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the... | [
"Gets",
"an",
"integration",
"account",
"certificate",
"."
] | 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/CertificatesInner.java#L369-L376 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java | SyncMembersInner.beginCreateOrUpdateAsync | public Observable<SyncMemberInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName, SyncMemberInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, ... | java | public Observable<SyncMemberInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName, SyncMemberInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, ... | [
"public",
"Observable",
"<",
"SyncMemberInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"syncGroupName",
",",
"String",
"syncMemberName",
",",
"SyncMemberInner",
"par... | Creates or updates a sync member.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database on which the sync group is hosted.
@p... | [
"Creates",
"or",
"updates",
"a",
"sync",
"member",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java#L372-L379 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/RtfWriter2.java | RtfWriter2.importRtfDocument | public void importRtfDocument(InputStream documentSource, EventListener[] events ) throws IOException, DocumentException {
if(!this.open) {
throw new DocumentException("The document must be open to import RTF documents.");
}
RtfParser rtfImport = new RtfParser(this.document);
if(ev... | java | public void importRtfDocument(InputStream documentSource, EventListener[] events ) throws IOException, DocumentException {
if(!this.open) {
throw new DocumentException("The document must be open to import RTF documents.");
}
RtfParser rtfImport = new RtfParser(this.document);
if(ev... | [
"public",
"void",
"importRtfDocument",
"(",
"InputStream",
"documentSource",
",",
"EventListener",
"[",
"]",
"events",
")",
"throws",
"IOException",
",",
"DocumentException",
"{",
"if",
"(",
"!",
"this",
".",
"open",
")",
"{",
"throw",
"new",
"DocumentException"... | Adds the complete RTF document to the current RTF document being generated.
It will parse the font and color tables and correct the font and color references
so that the imported RTF document retains its formattings.
Uses new RtfParser object.
(author: Howard Shank)
@param documentSource The InputStream to read the R... | [
"Adds",
"the",
"complete",
"RTF",
"document",
"to",
"the",
"current",
"RTF",
"document",
"being",
"generated",
".",
"It",
"will",
"parse",
"the",
"font",
"and",
"color",
"tables",
"and",
"correct",
"the",
"font",
"and",
"color",
"references",
"so",
"that",
... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/RtfWriter2.java#L286-L297 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/message/StringFormatterMessageFactory.java | StringFormatterMessageFactory.newMessage | @Override
public Message newMessage(final String message, final Object... params) {
return new StringFormattedMessage(message, params);
} | java | @Override
public Message newMessage(final String message, final Object... params) {
return new StringFormattedMessage(message, params);
} | [
"@",
"Override",
"public",
"Message",
"newMessage",
"(",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"params",
")",
"{",
"return",
"new",
"StringFormattedMessage",
"(",
"message",
",",
"params",
")",
";",
"}"
] | Creates {@link StringFormattedMessage} instances.
@param message The message pattern.
@param params The parameters to the message.
@return The Message.
@see MessageFactory#newMessage(String, Object...) | [
"Creates",
"{",
"@link",
"StringFormattedMessage",
"}",
"instances",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/StringFormatterMessageFactory.java#L60-L63 |
jglobus/JGlobus | myproxy/src/main/java/org/globus/myproxy/MyProxy.java | MyProxy.get | public GSSCredential get(String username,
String passphrase,
int lifetime)
throws MyProxyException {
return get(null, username, passphrase, lifetime);
} | java | public GSSCredential get(String username,
String passphrase,
int lifetime)
throws MyProxyException {
return get(null, username, passphrase, lifetime);
} | [
"public",
"GSSCredential",
"get",
"(",
"String",
"username",
",",
"String",
"passphrase",
",",
"int",
"lifetime",
")",
"throws",
"MyProxyException",
"{",
"return",
"get",
"(",
"null",
",",
"username",
",",
"passphrase",
",",
"lifetime",
")",
";",
"}"
] | Retrieves delegated credentials from MyProxy server Anonymously
(without local credentials)
Notes: Performs simple verification of private/public keys of
the delegated credential. Should be improved later.
And only checks for RSA keys.
@param username
The username of the credentials to retrieve.
@param passphrase
T... | [
"Retrieves",
"delegated",
"credentials",
"from",
"MyProxy",
"server",
"Anonymously",
"(",
"without",
"local",
"credentials",
")"
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/myproxy/src/main/java/org/globus/myproxy/MyProxy.java#L897-L902 |
apache/groovy | subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java | DateTimeExtensions.isUptoEligible | private static boolean isUptoEligible(Temporal from, Temporal to) {
TemporalAmount amount = rightShift(from, to);
if (amount instanceof Period) {
return isNonnegative((Period) amount);
} else if (amount instanceof Duration) {
return isNonnegative((Duration) amount);
... | java | private static boolean isUptoEligible(Temporal from, Temporal to) {
TemporalAmount amount = rightShift(from, to);
if (amount instanceof Period) {
return isNonnegative((Period) amount);
} else if (amount instanceof Duration) {
return isNonnegative((Duration) amount);
... | [
"private",
"static",
"boolean",
"isUptoEligible",
"(",
"Temporal",
"from",
",",
"Temporal",
"to",
")",
"{",
"TemporalAmount",
"amount",
"=",
"rightShift",
"(",
"from",
",",
"to",
")",
";",
"if",
"(",
"amount",
"instanceof",
"Period",
")",
"{",
"return",
"i... | Returns true if the {@code from} can be iterated up to {@code to}. | [
"Returns",
"true",
"if",
"the",
"{"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java#L169-L179 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplace.java | CmsWorkplace.getWorkplaceExplorerLink | public static String getWorkplaceExplorerLink(final CmsObject cms, final String explorerRootPath) {
// split the root site:
String targetSiteRoot = OpenCms.getSiteManager().getSiteRoot(explorerRootPath);
if (targetSiteRoot == null) {
if (OpenCms.getSiteManager().startsWithShared(exp... | java | public static String getWorkplaceExplorerLink(final CmsObject cms, final String explorerRootPath) {
// split the root site:
String targetSiteRoot = OpenCms.getSiteManager().getSiteRoot(explorerRootPath);
if (targetSiteRoot == null) {
if (OpenCms.getSiteManager().startsWithShared(exp... | [
"public",
"static",
"String",
"getWorkplaceExplorerLink",
"(",
"final",
"CmsObject",
"cms",
",",
"final",
"String",
"explorerRootPath",
")",
"{",
"// split the root site:",
"String",
"targetSiteRoot",
"=",
"OpenCms",
".",
"getSiteManager",
"(",
")",
".",
"getSiteRoot"... | Creates a link for the OpenCms workplace that will reload the whole workplace, switch to the explorer view, the
site of the given explorerRootPath and show the folder given in the explorerRootPath.
<p>
@param cms
the cms object
@param explorerRootPath
a root relative folder link (has to end with '/').
@return a link... | [
"Creates",
"a",
"link",
"for",
"the",
"OpenCms",
"workplace",
"that",
"will",
"reload",
"the",
"whole",
"workplace",
"switch",
"to",
"the",
"explorer",
"view",
"the",
"site",
"of",
"the",
"given",
"explorerRootPath",
"and",
"show",
"the",
"folder",
"given",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L773-L814 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/xml/RaXmlGen.java | RaXmlGen.writeRequireConfigPropsXml | void writeRequireConfigPropsXml(List<ConfigPropType> props, Writer out, int indent) throws IOException
{
if (props == null || props.size() == 0)
return;
for (ConfigPropType prop : props)
{
if (prop.isRequired())
{
writeIndent(out, indent);
out.writ... | java | void writeRequireConfigPropsXml(List<ConfigPropType> props, Writer out, int indent) throws IOException
{
if (props == null || props.size() == 0)
return;
for (ConfigPropType prop : props)
{
if (prop.isRequired())
{
writeIndent(out, indent);
out.writ... | [
"void",
"writeRequireConfigPropsXml",
"(",
"List",
"<",
"ConfigPropType",
">",
"props",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"if",
"(",
"props",
"==",
"null",
"||",
"props",
".",
"size",
"(",
")",
"==",
"0",
")",... | Output required config props xml part
@param props config properties
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"required",
"config",
"props",
"xml",
"part"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/xml/RaXmlGen.java#L211-L233 |
infinispan/infinispan | counter/src/main/java/org/infinispan/counter/impl/weak/WeakCounterImpl.java | WeakCounterImpl.removeWeakCounter | public static void removeWeakCounter(Cache<WeakCounterKey, CounterValue> cache, CounterConfiguration configuration,
String counterName) {
ByteString counterNameByteString = ByteString.fromString(counterName);
for (int i = 0; i < configuration.concurrencyLevel(); ++i) {
cache.remove(new Wea... | java | public static void removeWeakCounter(Cache<WeakCounterKey, CounterValue> cache, CounterConfiguration configuration,
String counterName) {
ByteString counterNameByteString = ByteString.fromString(counterName);
for (int i = 0; i < configuration.concurrencyLevel(); ++i) {
cache.remove(new Wea... | [
"public",
"static",
"void",
"removeWeakCounter",
"(",
"Cache",
"<",
"WeakCounterKey",
",",
"CounterValue",
">",
"cache",
",",
"CounterConfiguration",
"configuration",
",",
"String",
"counterName",
")",
"{",
"ByteString",
"counterNameByteString",
"=",
"ByteString",
"."... | It removes a weak counter from the {@code cache}, identified by the {@code counterName}.
@param cache The {@link Cache} to remove the counter from.
@param configuration The counter's configuration.
@param counterName The counter's name. | [
"It",
"removes",
"a",
"weak",
"counter",
"from",
"the",
"{",
"@code",
"cache",
"}",
"identified",
"by",
"the",
"{",
"@code",
"counterName",
"}",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/counter/src/main/java/org/infinispan/counter/impl/weak/WeakCounterImpl.java#L113-L119 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WLinkRenderer.java | WLinkRenderer.paintAjaxTrigger | private void paintAjaxTrigger(final WLink link, final XmlStringBuilder xml) {
AjaxTarget[] actionTargets = link.getActionTargets();
// Start tag
xml.appendTagOpen("ui:ajaxtrigger");
xml.appendAttribute("triggerId", link.getId());
xml.appendClose();
if (actionTargets != null && actionTargets.length > 0) {
... | java | private void paintAjaxTrigger(final WLink link, final XmlStringBuilder xml) {
AjaxTarget[] actionTargets = link.getActionTargets();
// Start tag
xml.appendTagOpen("ui:ajaxtrigger");
xml.appendAttribute("triggerId", link.getId());
xml.appendClose();
if (actionTargets != null && actionTargets.length > 0) {
... | [
"private",
"void",
"paintAjaxTrigger",
"(",
"final",
"WLink",
"link",
",",
"final",
"XmlStringBuilder",
"xml",
")",
"{",
"AjaxTarget",
"[",
"]",
"actionTargets",
"=",
"link",
".",
"getActionTargets",
"(",
")",
";",
"// Start tag",
"xml",
".",
"appendTagOpen",
... | Paint the AJAX trigger if the link has an action.
@param link the link component being rendered
@param xml the XmlStringBuilder to paint to. | [
"Paint",
"the",
"AJAX",
"trigger",
"if",
"the",
"link",
"has",
"an",
"action",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WLinkRenderer.java#L130-L154 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.addEntity | public UUID addEntity(UUID appId, String versionId, AddEntityOptionalParameter addEntityOptionalParameter) {
return addEntityWithServiceResponseAsync(appId, versionId, addEntityOptionalParameter).toBlocking().single().body();
} | java | public UUID addEntity(UUID appId, String versionId, AddEntityOptionalParameter addEntityOptionalParameter) {
return addEntityWithServiceResponseAsync(appId, versionId, addEntityOptionalParameter).toBlocking().single().body();
} | [
"public",
"UUID",
"addEntity",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"AddEntityOptionalParameter",
"addEntityOptionalParameter",
")",
"{",
"return",
"addEntityWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"addEntityOptionalParameter",
")... | Adds an entity extractor to the application.
@param appId The application ID.
@param versionId The version ID.
@param addEntityOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorRespo... | [
"Adds",
"an",
"entity",
"extractor",
"to",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L932-L934 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableWriteItems.java | TableWriteItems.withHashOnlyKeysToDelete | public TableWriteItems withHashOnlyKeysToDelete(String hashKeyName,
Object... hashKeyValues) {
if (hashKeyName == null)
throw new IllegalArgumentException();
PrimaryKey[] primaryKeys = new PrimaryKey[hashKeyValues.length];
for (int i=0; i < hashKeyValues.length; i++)
... | java | public TableWriteItems withHashOnlyKeysToDelete(String hashKeyName,
Object... hashKeyValues) {
if (hashKeyName == null)
throw new IllegalArgumentException();
PrimaryKey[] primaryKeys = new PrimaryKey[hashKeyValues.length];
for (int i=0; i < hashKeyValues.length; i++)
... | [
"public",
"TableWriteItems",
"withHashOnlyKeysToDelete",
"(",
"String",
"hashKeyName",
",",
"Object",
"...",
"hashKeyValues",
")",
"{",
"if",
"(",
"hashKeyName",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"PrimaryKey",
"[",
"]",
... | Used to specify multiple hash-only primary keys to be deleted from the
current table.
@param hashKeyName
hash-only key name
@param hashKeyValues
a list of hash key values | [
"Used",
"to",
"specify",
"multiple",
"hash",
"-",
"only",
"primary",
"keys",
"to",
"be",
"deleted",
"from",
"the",
"current",
"table",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableWriteItems.java#L83-L91 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzleConnection.java | DrizzleConnection.setSavepoint | public Savepoint setSavepoint(final String name) throws SQLException {
final Savepoint drizzleSavepoint = new DrizzleSavepoint(name, savepointCount++);
try {
protocol.setSavepoint(drizzleSavepoint.toString());
} catch (QueryException e) {
throw SQLExceptionMapper.get(e);
... | java | public Savepoint setSavepoint(final String name) throws SQLException {
final Savepoint drizzleSavepoint = new DrizzleSavepoint(name, savepointCount++);
try {
protocol.setSavepoint(drizzleSavepoint.toString());
} catch (QueryException e) {
throw SQLExceptionMapper.get(e);
... | [
"public",
"Savepoint",
"setSavepoint",
"(",
"final",
"String",
"name",
")",
"throws",
"SQLException",
"{",
"final",
"Savepoint",
"drizzleSavepoint",
"=",
"new",
"DrizzleSavepoint",
"(",
"name",
",",
"savepointCount",
"++",
")",
";",
"try",
"{",
"protocol",
".",
... | Creates a savepoint with the given name in the current transaction and returns the new <code>Savepoint</code>
object that represents it.
<p/>
<p> if setSavepoint is invoked outside of an active transaction, a transaction will be started at this newly
created savepoint.
@param name a <code>String</code> containing the ... | [
"Creates",
"a",
"savepoint",
"with",
"the",
"given",
"name",
"in",
"the",
"current",
"transaction",
"and",
"returns",
"the",
"new",
"<code",
">",
"Savepoint<",
"/",
"code",
">",
"object",
"that",
"represents",
"it",
".",
"<p",
"/",
">",
"<p",
">",
"if",
... | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzleConnection.java#L616-L625 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java | HashCodeBuilder.reflectionHashCode | @GwtIncompatible("incompatible method")
public static int reflectionHashCode(final Object object, final Collection<String> excludeFields) {
return reflectionHashCode(object, ReflectionToStringBuilder.toNoNullStringArray(excludeFields));
} | java | @GwtIncompatible("incompatible method")
public static int reflectionHashCode(final Object object, final Collection<String> excludeFields) {
return reflectionHashCode(object, ReflectionToStringBuilder.toNoNullStringArray(excludeFields));
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"int",
"reflectionHashCode",
"(",
"final",
"Object",
"object",
",",
"final",
"Collection",
"<",
"String",
">",
"excludeFields",
")",
"{",
"return",
"reflectionHashCode",
"(",
"object",
... | <p>
Uses reflection to build a valid hash code from the fields of {@code object}.
</p>
<p>
This constructor uses two hard coded choices for the constants needed to build a hash code.
</p>
<p>
It uses <code>AccessibleObject.setAccessible</code> to gain access to private fields. This means that it will
throw a security... | [
"<p",
">",
"Uses",
"reflection",
"to",
"build",
"a",
"valid",
"hash",
"code",
"from",
"the",
"fields",
"of",
"{",
"@code",
"object",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java#L453-L456 |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/convolve/Kernel2D_S32.java | Kernel2D_S32.wrap | public static Kernel2D_S32 wrap(int data[], int width, int offset) {
if (width % 2 == 0 && width <= 0 && width * width > data.length)
throw new IllegalArgumentException("invalid width");
Kernel2D_S32 ret = new Kernel2D_S32();
ret.data = data;
ret.width = width;
ret.offset = offset;
return ret;
} | java | public static Kernel2D_S32 wrap(int data[], int width, int offset) {
if (width % 2 == 0 && width <= 0 && width * width > data.length)
throw new IllegalArgumentException("invalid width");
Kernel2D_S32 ret = new Kernel2D_S32();
ret.data = data;
ret.width = width;
ret.offset = offset;
return ret;
} | [
"public",
"static",
"Kernel2D_S32",
"wrap",
"(",
"int",
"data",
"[",
"]",
",",
"int",
"width",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"width",
"%",
"2",
"==",
"0",
"&&",
"width",
"<=",
"0",
"&&",
"width",
"*",
"width",
">",
"data",
".",
"leng... | Creates a kernel whose elements are the specified data array and has
the specified width.
@param data The array who will be the kernel's data. Reference is saved.
@param width The kernel's width.
@param offset Kernel origin's offset from element 0.
@return A new kernel. | [
"Creates",
"a",
"kernel",
"whose",
"elements",
"are",
"the",
"specified",
"data",
"array",
"and",
"has",
"the",
"specified",
"width",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/convolve/Kernel2D_S32.java#L87-L97 |
DataArt/CalculationEngine | calculation-engine/engine-converters/src/main/java/com/dataart/spreadsheetanalytics/engine/DataSetConverters.java | DataSetConverters.toXlsxFile | static OutputStream toXlsxFile(final IDataSet dataSet, final InputStream formatting) {
ByteArrayOutputStream xlsx = new ByteArrayOutputStream();
try { toWorkbook(dataSet, ConverterUtils.newWorkbook(formatting)).write(xlsx); }
catch (IOException e) { throw new CalculationEngineException(... | java | static OutputStream toXlsxFile(final IDataSet dataSet, final InputStream formatting) {
ByteArrayOutputStream xlsx = new ByteArrayOutputStream();
try { toWorkbook(dataSet, ConverterUtils.newWorkbook(formatting)).write(xlsx); }
catch (IOException e) { throw new CalculationEngineException(... | [
"static",
"OutputStream",
"toXlsxFile",
"(",
"final",
"IDataSet",
"dataSet",
",",
"final",
"InputStream",
"formatting",
")",
"{",
"ByteArrayOutputStream",
"xlsx",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"try",
"{",
"toWorkbook",
"(",
"dataSet",
",",
... | Converts {@link IDataSet} to {@link Workbook},
then writes this Workbook to new {@link ByteArrayOutputStream}.
Middle-state {@link Workbook} is created from @param formatting. | [
"Converts",
"{"
] | train | https://github.com/DataArt/CalculationEngine/blob/34ce1d9c1f9b57a502906b274311d28580b134e5/calculation-engine/engine-converters/src/main/java/com/dataart/spreadsheetanalytics/engine/DataSetConverters.java#L115-L122 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.pinholeToMatrix | public static DMatrixRMaj pinholeToMatrix(CameraPinhole param , DMatrixRMaj K )
{
return ImplPerspectiveOps_F64.pinholeToMatrix(param, K);
} | java | public static DMatrixRMaj pinholeToMatrix(CameraPinhole param , DMatrixRMaj K )
{
return ImplPerspectiveOps_F64.pinholeToMatrix(param, K);
} | [
"public",
"static",
"DMatrixRMaj",
"pinholeToMatrix",
"(",
"CameraPinhole",
"param",
",",
"DMatrixRMaj",
"K",
")",
"{",
"return",
"ImplPerspectiveOps_F64",
".",
"pinholeToMatrix",
"(",
"param",
",",
"K",
")",
";",
"}"
] | Given the intrinsic parameters create a calibration matrix
@param param Intrinsic parameters structure that is to be converted into a matrix
@param K Storage for calibration matrix, must be 3x3. If null then a new matrix is declared
@return Calibration matrix 3x3 | [
"Given",
"the",
"intrinsic",
"parameters",
"create",
"a",
"calibration",
"matrix"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L259-L262 |
samskivert/samskivert | src/main/java/com/samskivert/velocity/Application.java | Application.handleException | protected String handleException (HttpServletRequest req, Logic logic, Exception error)
{
log.warning(logic + " failed on: " + RequestUtils.reconstructURL(req), error);
return ExceptionMap.getMessage(error);
} | java | protected String handleException (HttpServletRequest req, Logic logic, Exception error)
{
log.warning(logic + " failed on: " + RequestUtils.reconstructURL(req), error);
return ExceptionMap.getMessage(error);
} | [
"protected",
"String",
"handleException",
"(",
"HttpServletRequest",
"req",
",",
"Logic",
"logic",
",",
"Exception",
"error",
")",
"{",
"log",
".",
"warning",
"(",
"logic",
"+",
"\" failed on: \"",
"+",
"RequestUtils",
".",
"reconstructURL",
"(",
"req",
")",
"... | If a generic exception propagates up from {@link Logic#invoke} and is not otherwise
converted into a friendly or redirect exception, the application will be required to provide
a generic error message to be inserted into the context and should take this opportunity to
log the exception.
<p><em>Note:</em> the string re... | [
"If",
"a",
"generic",
"exception",
"propagates",
"up",
"from",
"{",
"@link",
"Logic#invoke",
"}",
"and",
"is",
"not",
"otherwise",
"converted",
"into",
"a",
"friendly",
"or",
"redirect",
"exception",
"the",
"application",
"will",
"be",
"required",
"to",
"provi... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/Application.java#L200-L204 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ReportUtil.java | ReportUtil.isValidSqlWithMessage | public static String isValidSqlWithMessage(Connection con, String sql, List<QueryParameter> parameters) {
try {
QueryUtil qu = new QueryUtil(con, DialectUtil.getDialect(con));
Map<String, QueryParameter> params = new HashMap<String, QueryParameter>();
for (QueryParameter qp : parameters) {
params.pu... | java | public static String isValidSqlWithMessage(Connection con, String sql, List<QueryParameter> parameters) {
try {
QueryUtil qu = new QueryUtil(con, DialectUtil.getDialect(con));
Map<String, QueryParameter> params = new HashMap<String, QueryParameter>();
for (QueryParameter qp : parameters) {
params.pu... | [
"public",
"static",
"String",
"isValidSqlWithMessage",
"(",
"Connection",
"con",
",",
"String",
"sql",
",",
"List",
"<",
"QueryParameter",
">",
"parameters",
")",
"{",
"try",
"{",
"QueryUtil",
"qu",
"=",
"new",
"QueryUtil",
"(",
"con",
",",
"DialectUtil",
".... | Test if sql with parameters is valid
@param con database connection
@param sql sql
@return return message error if sql is not valid, null otherwise | [
"Test",
"if",
"sql",
"with",
"parameters",
"is",
"valid"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ReportUtil.java#L761-L774 |
facebook/fresco | drawee/src/main/java/com/facebook/drawee/drawable/RoundedCornersDrawable.java | RoundedCornersDrawable.setBorder | @Override
public void setBorder(int color, float width) {
mBorderColor = color;
mBorderWidth = width;
updatePath();
invalidateSelf();
} | java | @Override
public void setBorder(int color, float width) {
mBorderColor = color;
mBorderWidth = width;
updatePath();
invalidateSelf();
} | [
"@",
"Override",
"public",
"void",
"setBorder",
"(",
"int",
"color",
",",
"float",
"width",
")",
"{",
"mBorderColor",
"=",
"color",
";",
"mBorderWidth",
"=",
"width",
";",
"updatePath",
"(",
")",
";",
"invalidateSelf",
"(",
")",
";",
"}"
] | Sets the border
@param color of the border
@param width of the border | [
"Sets",
"the",
"border"
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/drawee/src/main/java/com/facebook/drawee/drawable/RoundedCornersDrawable.java#L155-L161 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.tryAndMatchAtIndent | private Token tryAndMatchAtIndent(boolean terminated, Indent indent, Token.Kind... kinds) {
int start = index;
Indent r = getIndent();
if (r != null && r.equivalent(indent)) {
Token t = tryAndMatch(terminated, kinds);
if (t != null) {
return r;
}
}
// backtrack in all failing cases.
index = sta... | java | private Token tryAndMatchAtIndent(boolean terminated, Indent indent, Token.Kind... kinds) {
int start = index;
Indent r = getIndent();
if (r != null && r.equivalent(indent)) {
Token t = tryAndMatch(terminated, kinds);
if (t != null) {
return r;
}
}
// backtrack in all failing cases.
index = sta... | [
"private",
"Token",
"tryAndMatchAtIndent",
"(",
"boolean",
"terminated",
",",
"Indent",
"indent",
",",
"Token",
".",
"Kind",
"...",
"kinds",
")",
"{",
"int",
"start",
"=",
"index",
";",
"Indent",
"r",
"=",
"getIndent",
"(",
")",
";",
"if",
"(",
"r",
"!... | Attempt to match a given token(s) at a given level of indent, whilst
ignoring any whitespace in between. Note that, in the case it fails to
match, then the index will be unchanged. This latter point is important,
otherwise we could accidentally gobble up some important indentation. If
more than one kind is provided the... | [
"Attempt",
"to",
"match",
"a",
"given",
"token",
"(",
"s",
")",
"at",
"a",
"given",
"level",
"of",
"indent",
"whilst",
"ignoring",
"any",
"whitespace",
"in",
"between",
".",
"Note",
"that",
"in",
"the",
"case",
"it",
"fails",
"to",
"match",
"then",
"th... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L4229-L4241 |
hexagonframework/spring-data-ebean | src/main/java/org/springframework/data/ebean/repository/query/ParameterBinder.java | ParameterBinder.bindAndPrepare | public EbeanQueryWrapper bindAndPrepare(EbeanQueryWrapper query) {
Assert.notNull(query, "query must not be null!");
return bindAndPrepare(query, parameters);
} | java | public EbeanQueryWrapper bindAndPrepare(EbeanQueryWrapper query) {
Assert.notNull(query, "query must not be null!");
return bindAndPrepare(query, parameters);
} | [
"public",
"EbeanQueryWrapper",
"bindAndPrepare",
"(",
"EbeanQueryWrapper",
"query",
")",
"{",
"Assert",
".",
"notNull",
"(",
"query",
",",
"\"query must not be null!\"",
")",
";",
"return",
"bindAndPrepare",
"(",
"query",
",",
"parameters",
")",
";",
"}"
] | Binds the parameters to the given query and applies special parameter types (e.g. pagination).
@param query must not be {@literal null}.
@return | [
"Binds",
"the",
"parameters",
"to",
"the",
"given",
"query",
"and",
"applies",
"special",
"parameter",
"types",
"(",
"e",
".",
"g",
".",
"pagination",
")",
"."
] | train | https://github.com/hexagonframework/spring-data-ebean/blob/dd11b97654982403b50dd1d5369cadad71fce410/src/main/java/org/springframework/data/ebean/repository/query/ParameterBinder.java#L75-L78 |
ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/BaseRequest.java | BaseRequest.updateProgressListener | protected void updateProgressListener(ProgressListener progressListener, Response response) {
InputStream responseStream = response.getResponseByteStream();
int bytesDownloaded = 0;
long totalBytesExpected = response.getContentLength();
// Reading 2 KiB at a time to be consistent with t... | java | protected void updateProgressListener(ProgressListener progressListener, Response response) {
InputStream responseStream = response.getResponseByteStream();
int bytesDownloaded = 0;
long totalBytesExpected = response.getContentLength();
// Reading 2 KiB at a time to be consistent with t... | [
"protected",
"void",
"updateProgressListener",
"(",
"ProgressListener",
"progressListener",
",",
"Response",
"response",
")",
"{",
"InputStream",
"responseStream",
"=",
"response",
".",
"getResponseByteStream",
"(",
")",
";",
"int",
"bytesDownloaded",
"=",
"0",
";",
... | As a download request progresses, periodically call the user's ProgressListener | [
"As",
"a",
"download",
"request",
"progresses",
"periodically",
"call",
"the",
"user",
"s",
"ProgressListener"
] | train | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/BaseRequest.java#L794-L832 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java | CassandraSchemaManager.handleCreate | private void handleCreate(TableInfo tableInfo, KsDef ksDef) throws Exception
{
if (containsCompositeKey(tableInfo))
{
validateCompoundKey(tableInfo);
// First drop existing column family.
dropTableUsingCql(tableInfo);
}
else
{
o... | java | private void handleCreate(TableInfo tableInfo, KsDef ksDef) throws Exception
{
if (containsCompositeKey(tableInfo))
{
validateCompoundKey(tableInfo);
// First drop existing column family.
dropTableUsingCql(tableInfo);
}
else
{
o... | [
"private",
"void",
"handleCreate",
"(",
"TableInfo",
"tableInfo",
",",
"KsDef",
"ksDef",
")",
"throws",
"Exception",
"{",
"if",
"(",
"containsCompositeKey",
"(",
"tableInfo",
")",
")",
"{",
"validateCompoundKey",
"(",
"tableInfo",
")",
";",
"// First drop existing... | Handle create.
@param tableInfo
the table info
@param ksDef
the ks def
@throws Exception
the exception | [
"Handle",
"create",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L601-L614 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/query/values/JcElement.java | JcElement.booleanProperty | public JcBoolean booleanProperty(String name) {
JcBoolean ret = new JcBoolean(name, this, OPERATOR.PropertyContainer.PROPERTY_ACCESS);
QueryRecorder.recordInvocationConditional(this, "booleanProperty", ret, QueryRecorder.literal(name));
return ret;
} | java | public JcBoolean booleanProperty(String name) {
JcBoolean ret = new JcBoolean(name, this, OPERATOR.PropertyContainer.PROPERTY_ACCESS);
QueryRecorder.recordInvocationConditional(this, "booleanProperty", ret, QueryRecorder.literal(name));
return ret;
} | [
"public",
"JcBoolean",
"booleanProperty",
"(",
"String",
"name",
")",
"{",
"JcBoolean",
"ret",
"=",
"new",
"JcBoolean",
"(",
"name",
",",
"this",
",",
"OPERATOR",
".",
"PropertyContainer",
".",
"PROPERTY_ACCESS",
")",
";",
"QueryRecorder",
".",
"recordInvocation... | <div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>access a named boolean property, return a <b>JcBoolean</b></i></div>
<br/> | [
"<div",
"color",
"=",
"red",
"style",
"=",
"font",
"-",
"size",
":",
"24px",
";",
"color",
":",
"red",
">",
"<b",
">",
"<i",
">",
"<u",
">",
"JCYPHER<",
"/",
"u",
">",
"<",
"/",
"i",
">",
"<",
"/",
"b",
">",
"<",
"/",
"div",
">",
"<div",
... | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/values/JcElement.java#L75-L79 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplaceMessages.java | CmsWorkplaceMessages.getResourceTypeDescription | public static String getResourceTypeDescription(CmsWorkplace wp, String name) {
// try to find the localized key
String key = OpenCms.getWorkplaceManager().getExplorerTypeSetting(name).getInfo();
return wp.keyDefault(key, name);
} | java | public static String getResourceTypeDescription(CmsWorkplace wp, String name) {
// try to find the localized key
String key = OpenCms.getWorkplaceManager().getExplorerTypeSetting(name).getInfo();
return wp.keyDefault(key, name);
} | [
"public",
"static",
"String",
"getResourceTypeDescription",
"(",
"CmsWorkplace",
"wp",
",",
"String",
"name",
")",
"{",
"// try to find the localized key",
"String",
"key",
"=",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
".",
"getExplorerTypeSetting",
"(",
"name... | Returns the description of the given resource type name.<p>
If this key is not found, the value of the name input will be returned.<p>
@param wp an instance of a {@link CmsWorkplace} to resolve the key name with
@param name the resource type name to generate the nice name for
@return the description of the given res... | [
"Returns",
"the",
"description",
"of",
"the",
"given",
"resource",
"type",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplaceMessages.java#L132-L137 |
k0shk0sh/PermissionHelper | permission/src/main/java/com/fastaccess/permission/base/activity/BasePermissionActivity.java | BasePermissionActivity.requestPermission | protected void requestPermission(final PermissionModel model) {
new AlertDialog.Builder(this)
.setTitle(model.getTitle())
.setMessage(model.getExplanationMessage())
.setPositiveButton("Request", new DialogInterface.OnClickListener() {
@Override... | java | protected void requestPermission(final PermissionModel model) {
new AlertDialog.Builder(this)
.setTitle(model.getTitle())
.setMessage(model.getExplanationMessage())
.setPositiveButton("Request", new DialogInterface.OnClickListener() {
@Override... | [
"protected",
"void",
"requestPermission",
"(",
"final",
"PermissionModel",
"model",
")",
"{",
"new",
"AlertDialog",
".",
"Builder",
"(",
"this",
")",
".",
"setTitle",
"(",
"model",
".",
"getTitle",
"(",
")",
")",
".",
"setMessage",
"(",
"model",
".",
"getE... | internal usage to show dialog with explanation you provided and a button to ask the user to request the permission | [
"internal",
"usage",
"to",
"show",
"dialog",
"with",
"explanation",
"you",
"provided",
"and",
"a",
"button",
"to",
"ask",
"the",
"user",
"to",
"request",
"the",
"permission"
] | train | https://github.com/k0shk0sh/PermissionHelper/blob/04edce2af49981d1dd321bcdfbe981a1000b29d7/permission/src/main/java/com/fastaccess/permission/base/activity/BasePermissionActivity.java#L257-L271 |
elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/datasource/bundle/BundleWriter.java | BundleWriter.flushBuffer | private void flushBuffer(ByteBuffer buffer, WritableByteChannel output) throws IOException {
buffer.flip();
output.write(buffer);
buffer.flip();
buffer.limit(buffer.capacity());
} | java | private void flushBuffer(ByteBuffer buffer, WritableByteChannel output) throws IOException {
buffer.flip();
output.write(buffer);
buffer.flip();
buffer.limit(buffer.capacity());
} | [
"private",
"void",
"flushBuffer",
"(",
"ByteBuffer",
"buffer",
",",
"WritableByteChannel",
"output",
")",
"throws",
"IOException",
"{",
"buffer",
".",
"flip",
"(",
")",
";",
"output",
".",
"write",
"(",
"buffer",
")",
";",
"buffer",
".",
"flip",
"(",
")",
... | Flush the current write buffer to disk.
@param buffer Buffer to write
@param output Output channel
@throws IOException on IO errors | [
"Flush",
"the",
"current",
"write",
"buffer",
"to",
"disk",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/datasource/bundle/BundleWriter.java#L126-L131 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/EntityDTO.java | EntityDTO.createDtoObject | public static <D extends EntityDTO, E extends JPAEntity> D createDtoObject(Class<D> clazz, E entity) {
D result = null;
try {
result = clazz.newInstance();
BeanUtils.copyProperties(result, entity);
// Now set IDs of JPA entity
result.setCreatedById(entit... | java | public static <D extends EntityDTO, E extends JPAEntity> D createDtoObject(Class<D> clazz, E entity) {
D result = null;
try {
result = clazz.newInstance();
BeanUtils.copyProperties(result, entity);
// Now set IDs of JPA entity
result.setCreatedById(entit... | [
"public",
"static",
"<",
"D",
"extends",
"EntityDTO",
",",
"E",
"extends",
"JPAEntity",
">",
"D",
"createDtoObject",
"(",
"Class",
"<",
"D",
">",
"clazz",
",",
"E",
"entity",
")",
"{",
"D",
"result",
"=",
"null",
";",
"try",
"{",
"result",
"=",
"claz... | Creates BaseDto object and copies properties from entity object.
@param <D> BaseDto object type.
@param <E> Entity type.
@param clazz BaseDto entity class.
@param entity entity object.
@return BaseDto object.
@throws WebApplicationException The exception with 500 status will be thrown. | [
"Creates",
"BaseDto",
"object",
"and",
"copies",
"properties",
"from",
"entity",
"object",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/EntityDTO.java#L72-L86 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeInferencePass.java | TypeInferencePass.process | @Override
public void process(Node externsRoot, Node jsRoot) {
Node externsAndJs = jsRoot.getParent();
checkState(externsAndJs != null);
checkState(externsRoot == null || externsAndJs.hasChild(externsRoot));
inferAllScopes(externsAndJs);
} | java | @Override
public void process(Node externsRoot, Node jsRoot) {
Node externsAndJs = jsRoot.getParent();
checkState(externsAndJs != null);
checkState(externsRoot == null || externsAndJs.hasChild(externsRoot));
inferAllScopes(externsAndJs);
} | [
"@",
"Override",
"public",
"void",
"process",
"(",
"Node",
"externsRoot",
",",
"Node",
"jsRoot",
")",
"{",
"Node",
"externsAndJs",
"=",
"jsRoot",
".",
"getParent",
"(",
")",
";",
"checkState",
"(",
"externsAndJs",
"!=",
"null",
")",
";",
"checkState",
"(",... | Main entry point for type inference when running over the whole tree.
@param externsRoot The root of the externs parse tree.
@param jsRoot The root of the input parse tree to be checked. | [
"Main",
"entry",
"point",
"for",
"type",
"inference",
"when",
"running",
"over",
"the",
"whole",
"tree",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeInferencePass.java#L61-L68 |
GerdHolz/TOVAL | src/de/invation/code/toval/validate/Validate.java | Validate.notNull | public static <O extends Object> void notNull(O o, String message) {
if(!validation) return;
notNull(message);
if(o == null)
throw new ParameterException(ErrorCode.NULLPOINTER, message);
} | java | public static <O extends Object> void notNull(O o, String message) {
if(!validation) return;
notNull(message);
if(o == null)
throw new ParameterException(ErrorCode.NULLPOINTER, message);
} | [
"public",
"static",
"<",
"O",
"extends",
"Object",
">",
"void",
"notNull",
"(",
"O",
"o",
",",
"String",
"message",
")",
"{",
"if",
"(",
"!",
"validation",
")",
"return",
";",
"notNull",
"(",
"message",
")",
";",
"if",
"(",
"o",
"==",
"null",
")",
... | Checks if the given object is <code>null</code>
@param o The object to validate.
@param message The error message to include in the Exception in case the validation fails.
@throws ParameterException if the given object is <code>null</code>. | [
"Checks",
"if",
"the",
"given",
"object",
"is",
"<code",
">",
"null<",
"/",
"code",
">"
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/validate/Validate.java#L42-L47 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java | SeaGlassLookAndFeel.defineSeparators | private void defineSeparators(UIDefaults d) {
String c = PAINTER_PREFIX + "SeparatorPainter";
d.put("Separator.contentMargins", new InsetsUIResource(0, 0, 0, 0));
d.put("Separator[Enabled].backgroundPainter", new LazyPainter(c, SeparatorPainter.Which.BACKGROUND_ENABLED));
} | java | private void defineSeparators(UIDefaults d) {
String c = PAINTER_PREFIX + "SeparatorPainter";
d.put("Separator.contentMargins", new InsetsUIResource(0, 0, 0, 0));
d.put("Separator[Enabled].backgroundPainter", new LazyPainter(c, SeparatorPainter.Which.BACKGROUND_ENABLED));
} | [
"private",
"void",
"defineSeparators",
"(",
"UIDefaults",
"d",
")",
"{",
"String",
"c",
"=",
"PAINTER_PREFIX",
"+",
"\"SeparatorPainter\"",
";",
"d",
".",
"put",
"(",
"\"Separator.contentMargins\"",
",",
"new",
"InsetsUIResource",
"(",
"0",
",",
"0",
",",
"0",... | Initialize the separator settings.
@param d the UI defaults map. | [
"Initialize",
"the",
"separator",
"settings",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java#L1771-L1775 |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java | ClustersInner.beginCreateOrUpdateAsync | public Observable<ClusterInner> beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1<ServiceResponse<ClusterInner>, ClusterInner>() {
@Override
... | java | public Observable<ClusterInner> beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1<ServiceResponse<ClusterInner>, ClusterInner>() {
@Override
... | [
"public",
"Observable",
"<",
"ClusterInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"ClusterInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",... | Create or update a Kusto cluster.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation.
@throws IllegalArgumentException thrown if parameters fail t... | [
"Create",
"or",
"update",
"a",
"Kusto",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java#L335-L342 |
grandstaish/paperparcel | paperparcel-compiler/src/main/java/paperparcel/Utils.java | Utils.paramAsMemberOf | private static TypeMirror paramAsMemberOf(
Types types, DeclaredType type, TypeParameterElement param) {
TypeMirror resolved = paramAsMemberOfImpl(types, type, param);
checkState(resolved != null, "Could not resolve parameter: " + param);
return resolved;
} | java | private static TypeMirror paramAsMemberOf(
Types types, DeclaredType type, TypeParameterElement param) {
TypeMirror resolved = paramAsMemberOfImpl(types, type, param);
checkState(resolved != null, "Could not resolve parameter: " + param);
return resolved;
} | [
"private",
"static",
"TypeMirror",
"paramAsMemberOf",
"(",
"Types",
"types",
",",
"DeclaredType",
"type",
",",
"TypeParameterElement",
"param",
")",
"{",
"TypeMirror",
"resolved",
"=",
"paramAsMemberOfImpl",
"(",
"types",
",",
"type",
",",
"param",
")",
";",
"ch... | A custom implementation for getting the resolved value of a {@link TypeParameterElement}
from a {@link DeclaredType}.
Usually this can be resolved using {@link Types#asMemberOf(DeclaredType, Element)}, but the
Jack compiler implementation currently does not work with {@link TypeParameterElement}s.
See https://code.goo... | [
"A",
"custom",
"implementation",
"for",
"getting",
"the",
"resolved",
"value",
"of",
"a",
"{",
"@link",
"TypeParameterElement",
"}",
"from",
"a",
"{",
"@link",
"DeclaredType",
"}",
"."
] | train | https://github.com/grandstaish/paperparcel/blob/917686ced81b335b6708d81d6cc0e3e496f7280d/paperparcel-compiler/src/main/java/paperparcel/Utils.java#L262-L267 |
alexvasilkov/GestureViews | sample/src/main/java/com/alexvasilkov/gestures/sample/demo/utils/RecyclerAdapterHelper.java | RecyclerAdapterHelper.notifyChanges | public static <T> void notifyChanges(RecyclerView.Adapter<?> adapter,
final List<T> oldList, final List<T> newList) {
DiffUtil.calculateDiff(new DiffUtil.Callback() {
@Override
public int getOldListSize() {
return oldList == null ? 0 : oldList.size();
... | java | public static <T> void notifyChanges(RecyclerView.Adapter<?> adapter,
final List<T> oldList, final List<T> newList) {
DiffUtil.calculateDiff(new DiffUtil.Callback() {
@Override
public int getOldListSize() {
return oldList == null ? 0 : oldList.size();
... | [
"public",
"static",
"<",
"T",
">",
"void",
"notifyChanges",
"(",
"RecyclerView",
".",
"Adapter",
"<",
"?",
">",
"adapter",
",",
"final",
"List",
"<",
"T",
">",
"oldList",
",",
"final",
"List",
"<",
"T",
">",
"newList",
")",
"{",
"DiffUtil",
".",
"cal... | Calls adapter's notify* methods when items are added / removed / moved / updated. | [
"Calls",
"adapter",
"s",
"notify",
"*",
"methods",
"when",
"items",
"are",
"added",
"/",
"removed",
"/",
"moved",
"/",
"updated",
"."
] | train | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/sample/src/main/java/com/alexvasilkov/gestures/sample/demo/utils/RecyclerAdapterHelper.java#L15-L39 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java | SphereUtil.bearingDegDeg | public static double bearingDegDeg(double latS, double lngS, double latE, double lngE) {
return rad2deg(bearingRad(deg2rad(latS), deg2rad(lngS), deg2rad(latE), deg2rad(lngE)));
} | java | public static double bearingDegDeg(double latS, double lngS, double latE, double lngE) {
return rad2deg(bearingRad(deg2rad(latS), deg2rad(lngS), deg2rad(latE), deg2rad(lngE)));
} | [
"public",
"static",
"double",
"bearingDegDeg",
"(",
"double",
"latS",
",",
"double",
"lngS",
",",
"double",
"latE",
",",
"double",
"lngE",
")",
"{",
"return",
"rad2deg",
"(",
"bearingRad",
"(",
"deg2rad",
"(",
"latS",
")",
",",
"deg2rad",
"(",
"lngS",
")... | Compute the bearing from start to end.
@param latS Start latitude, in degree
@param lngS Start longitude, in degree
@param latE End latitude, in degree
@param lngE End longitude, in degree
@return Bearing in degree | [
"Compute",
"the",
"bearing",
"from",
"start",
"to",
"end",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java#L865-L867 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java | SDNN.dotProductAttention | public SDVariable dotProductAttention(SDVariable queries, SDVariable keys, SDVariable values, SDVariable mask, boolean scaled){
return dotProductAttention(null, queries, keys, values, mask, scaled);
} | java | public SDVariable dotProductAttention(SDVariable queries, SDVariable keys, SDVariable values, SDVariable mask, boolean scaled){
return dotProductAttention(null, queries, keys, values, mask, scaled);
} | [
"public",
"SDVariable",
"dotProductAttention",
"(",
"SDVariable",
"queries",
",",
"SDVariable",
"keys",
",",
"SDVariable",
"values",
",",
"SDVariable",
"mask",
",",
"boolean",
"scaled",
")",
"{",
"return",
"dotProductAttention",
"(",
"null",
",",
"queries",
",",
... | This operation performs dot product attention on the given timeseries input with the given queries
@see #dotProductAttention(String, SDVariable, SDVariable, SDVariable, SDVariable, boolean, boolean) | [
"This",
"operation",
"performs",
"dot",
"product",
"attention",
"on",
"the",
"given",
"timeseries",
"input",
"with",
"the",
"given",
"queries"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java#L834-L836 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java | FacesImpl.detectWithStream | public List<DetectedFace> detectWithStream(byte[] image, DetectWithStreamOptionalParameter detectWithStreamOptionalParameter) {
return detectWithStreamWithServiceResponseAsync(image, detectWithStreamOptionalParameter).toBlocking().single().body();
} | java | public List<DetectedFace> detectWithStream(byte[] image, DetectWithStreamOptionalParameter detectWithStreamOptionalParameter) {
return detectWithStreamWithServiceResponseAsync(image, detectWithStreamOptionalParameter).toBlocking().single().body();
} | [
"public",
"List",
"<",
"DetectedFace",
">",
"detectWithStream",
"(",
"byte",
"[",
"]",
"image",
",",
"DetectWithStreamOptionalParameter",
"detectWithStreamOptionalParameter",
")",
"{",
"return",
"detectWithStreamWithServiceResponseAsync",
"(",
"image",
",",
"detectWithStrea... | Detect human faces in an image and returns face locations, and optionally with faceIds, landmarks, and attributes.
@param image An image stream.
@param detectWithStreamOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if paramete... | [
"Detect",
"human",
"faces",
"in",
"an",
"image",
"and",
"returns",
"face",
"locations",
"and",
"optionally",
"with",
"faceIds",
"landmarks",
"and",
"attributes",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java#L925-L927 |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java | EntityResource.getEntityListByType | public Response getEntityListByType(String entityType) {
try {
Preconditions.checkNotNull(entityType, "Entity type cannot be null");
if (LOG.isDebugEnabled()) {
LOG.debug("Fetching entity list for type={} ", entityType);
}
final List<String> enti... | java | public Response getEntityListByType(String entityType) {
try {
Preconditions.checkNotNull(entityType, "Entity type cannot be null");
if (LOG.isDebugEnabled()) {
LOG.debug("Fetching entity list for type={} ", entityType);
}
final List<String> enti... | [
"public",
"Response",
"getEntityListByType",
"(",
"String",
"entityType",
")",
"{",
"try",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"entityType",
",",
"\"Entity type cannot be null\"",
")",
";",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",... | Gets the list of entities for a given entity type.
@param entityType name of a type which is unique | [
"Gets",
"the",
"list",
"of",
"entities",
"for",
"a",
"given",
"entity",
"type",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java#L711-L741 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java | HttpConversionUtil.toFullHttpResponse | public static FullHttpResponse toFullHttpResponse(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc,
boolean validateHttpHeaders)
throws Http2Exception {
HttpResponseStatus status = parseStatus(http2Headers.status());
... | java | public static FullHttpResponse toFullHttpResponse(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc,
boolean validateHttpHeaders)
throws Http2Exception {
HttpResponseStatus status = parseStatus(http2Headers.status());
... | [
"public",
"static",
"FullHttpResponse",
"toFullHttpResponse",
"(",
"int",
"streamId",
",",
"Http2Headers",
"http2Headers",
",",
"ByteBufAllocator",
"alloc",
",",
"boolean",
"validateHttpHeaders",
")",
"throws",
"Http2Exception",
"{",
"HttpResponseStatus",
"status",
"=",
... | Create a new object to contain the response data
@param streamId The stream associated with the response
@param http2Headers The initial set of HTTP/2 headers to create the response with
@param alloc The {@link ByteBufAllocator} to use to generate the content of the message
@param validateHttpHeaders <ul>
<li>{@code t... | [
"Create",
"a",
"new",
"object",
"to",
"contain",
"the",
"response",
"data"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java#L213-L231 |
lucmoreau/ProvToolbox | prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java | ProvFactory.newEntity | public Entity newEntity(QualifiedName id, Collection<Attribute> attributes) {
Entity res = newEntity(id);
setAttributes(res, attributes);
return res;
} | java | public Entity newEntity(QualifiedName id, Collection<Attribute> attributes) {
Entity res = newEntity(id);
setAttributes(res, attributes);
return res;
} | [
"public",
"Entity",
"newEntity",
"(",
"QualifiedName",
"id",
",",
"Collection",
"<",
"Attribute",
">",
"attributes",
")",
"{",
"Entity",
"res",
"=",
"newEntity",
"(",
"id",
")",
";",
"setAttributes",
"(",
"res",
",",
"attributes",
")",
";",
"return",
"res"... | Creates a new {@link Entity} with provided identifier and attributes
@param id a {@link QualifiedName} for the entity
@param attributes a collection of {@link Attribute} for the entity
@return an object of type {@link Entity} | [
"Creates",
"a",
"new",
"{"
] | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java#L638-L642 |
json-path/JsonPath | json-path/src/main/java/com/jayway/jsonpath/JsonPath.java | JsonPath.put | public <T> T put(Object jsonObject, String key, Object value, Configuration configuration) {
notNull(jsonObject, "json can not be null");
notEmpty(key, "key can not be null or empty");
notNull(configuration, "configuration can not be null");
EvaluationContext evaluationContext = path.eva... | java | public <T> T put(Object jsonObject, String key, Object value, Configuration configuration) {
notNull(jsonObject, "json can not be null");
notEmpty(key, "key can not be null or empty");
notNull(configuration, "configuration can not be null");
EvaluationContext evaluationContext = path.eva... | [
"public",
"<",
"T",
">",
"T",
"put",
"(",
"Object",
"jsonObject",
",",
"String",
"key",
",",
"Object",
"value",
",",
"Configuration",
"configuration",
")",
"{",
"notNull",
"(",
"jsonObject",
",",
"\"json can not be null\"",
")",
";",
"notEmpty",
"(",
"key",
... | Adds or updates the Object this path points to in the provided jsonObject with a key with a value
@param jsonObject a json object
@param key the key to add or update
@param value the new value
@param configuration configuration to use
@param <T> expected return type
@return the updated jso... | [
"Adds",
"or",
"updates",
"the",
"Object",
"this",
"path",
"points",
"to",
"in",
"the",
"provided",
"jsonObject",
"with",
"a",
"key",
"with",
"a",
"value"
] | train | https://github.com/json-path/JsonPath/blob/5a09489c3252b74bbf81992aadb3073be59c04f9/json-path/src/main/java/com/jayway/jsonpath/JsonPath.java#L294-L303 |
rey5137/material | material/src/main/java/com/rey/material/app/DatePickerDialog.java | DatePickerDialog.dateRange | public DatePickerDialog dateRange(int minDay, int minMonth, int minYear, int maxDay, int maxMonth, int maxYear){
mDatePickerLayout.setDateRange(minDay, minMonth, minYear, maxDay, maxMonth, maxYear);
return this;
} | java | public DatePickerDialog dateRange(int minDay, int minMonth, int minYear, int maxDay, int maxMonth, int maxYear){
mDatePickerLayout.setDateRange(minDay, minMonth, minYear, maxDay, maxMonth, maxYear);
return this;
} | [
"public",
"DatePickerDialog",
"dateRange",
"(",
"int",
"minDay",
",",
"int",
"minMonth",
",",
"int",
"minYear",
",",
"int",
"maxDay",
",",
"int",
"maxMonth",
",",
"int",
"maxYear",
")",
"{",
"mDatePickerLayout",
".",
"setDateRange",
"(",
"minDay",
",",
"minM... | Set the range of selectable dates.
@param minDay The day value of minimum date.
@param minMonth The month value of minimum date.
@param minYear The year value of minimum date.
@param maxDay The day value of maximum date.
@param maxMonth The month value of maximum date.
@param maxYear The year value of maximum date.
@re... | [
"Set",
"the",
"range",
"of",
"selectable",
"dates",
"."
] | train | https://github.com/rey5137/material/blob/1bbcac2686a0023ef7720d3fe455bb116d115af8/material/src/main/java/com/rey/material/app/DatePickerDialog.java#L103-L106 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java | Settings.setArrayIfNotEmpty | public void setArrayIfNotEmpty(@NotNull final String key, @Nullable final List<String> value) {
if (null != value && !value.isEmpty()) {
setString(key, new Gson().toJson(value));
}
} | java | public void setArrayIfNotEmpty(@NotNull final String key, @Nullable final List<String> value) {
if (null != value && !value.isEmpty()) {
setString(key, new Gson().toJson(value));
}
} | [
"public",
"void",
"setArrayIfNotEmpty",
"(",
"@",
"NotNull",
"final",
"String",
"key",
",",
"@",
"Nullable",
"final",
"List",
"<",
"String",
">",
"value",
")",
"{",
"if",
"(",
"null",
"!=",
"value",
"&&",
"!",
"value",
".",
"isEmpty",
"(",
")",
")",
... | Sets a property value only if the array value is not null and not empty.
@param key the key for the property
@param value the value for the property | [
"Sets",
"a",
"property",
"value",
"only",
"if",
"the",
"array",
"value",
"is",
"not",
"null",
"and",
"not",
"empty",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java#L712-L716 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuModuleGetGlobal | public static int cuModuleGetGlobal(CUdeviceptr dptr, long bytes[], CUmodule hmod, String name)
{
return checkResult(cuModuleGetGlobalNative(dptr, bytes, hmod, name));
} | java | public static int cuModuleGetGlobal(CUdeviceptr dptr, long bytes[], CUmodule hmod, String name)
{
return checkResult(cuModuleGetGlobalNative(dptr, bytes, hmod, name));
} | [
"public",
"static",
"int",
"cuModuleGetGlobal",
"(",
"CUdeviceptr",
"dptr",
",",
"long",
"bytes",
"[",
"]",
",",
"CUmodule",
"hmod",
",",
"String",
"name",
")",
"{",
"return",
"checkResult",
"(",
"cuModuleGetGlobalNative",
"(",
"dptr",
",",
"bytes",
",",
"hm... | Returns a global pointer from a module.
<pre>
CUresult cuModuleGetGlobal (
CUdeviceptr* dptr,
size_t* bytes,
CUmodule hmod,
const char* name )
</pre>
<div>
<p>Returns a global pointer from a module.
Returns in <tt>*dptr</tt> and <tt>*bytes</tt> the base pointer and
size of the global of name <tt>name</tt> located in m... | [
"Returns",
"a",
"global",
"pointer",
"from",
"a",
"module",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L2636-L2639 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java | CommandGroup.createButtonBar | public JComponent createButtonBar(final ColumnSpec columnSpec, final RowSpec rowSpec, final Border border) {
final ButtonBarGroupContainerPopulator container = new ButtonBarGroupContainerPopulator();
container.setColumnSpec(columnSpec);
container.setRowSpec(rowSpec);
addCommandsToGroupContainer(container);
re... | java | public JComponent createButtonBar(final ColumnSpec columnSpec, final RowSpec rowSpec, final Border border) {
final ButtonBarGroupContainerPopulator container = new ButtonBarGroupContainerPopulator();
container.setColumnSpec(columnSpec);
container.setRowSpec(rowSpec);
addCommandsToGroupContainer(container);
re... | [
"public",
"JComponent",
"createButtonBar",
"(",
"final",
"ColumnSpec",
"columnSpec",
",",
"final",
"RowSpec",
"rowSpec",
",",
"final",
"Border",
"border",
")",
"{",
"final",
"ButtonBarGroupContainerPopulator",
"container",
"=",
"new",
"ButtonBarGroupContainerPopulator",
... | Create a button bar with buttons for all the commands in this.
@param columnSpec Custom columnSpec for each column containing a button,
can be <code>null</code>.
@param rowSpec Custom rowspec for the buttonbar, can be <code>null</code>.
@param border if null, then don't use a border
@return never null | [
"Create",
"a",
"button",
"bar",
"with",
"buttons",
"for",
"all",
"the",
"commands",
"in",
"this",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java#L472-L478 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/TextMessageBuilder.java | TextMessageBuilder.build | public FbBotMillResponse build(MessageEnvelope envelope) {
User recipient = getRecipient(envelope);
Message message = new TextMessage(messageText);
message.setQuickReplies(quickReplies);
return new FbBotMillMessageResponse(recipient, message);
} | java | public FbBotMillResponse build(MessageEnvelope envelope) {
User recipient = getRecipient(envelope);
Message message = new TextMessage(messageText);
message.setQuickReplies(quickReplies);
return new FbBotMillMessageResponse(recipient, message);
} | [
"public",
"FbBotMillResponse",
"build",
"(",
"MessageEnvelope",
"envelope",
")",
"{",
"User",
"recipient",
"=",
"getRecipient",
"(",
"envelope",
")",
";",
"Message",
"message",
"=",
"new",
"TextMessage",
"(",
"messageText",
")",
";",
"message",
".",
"setQuickRep... | {@inheritDoc} Returns a response containing a plain text message. | [
"{"
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/TextMessageBuilder.java#L142-L147 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/util/ImageHelper.java | ImageHelper.getScaledInstance | public static BufferedImage getScaledInstance(BufferedImage image, int targetWidth, int targetHeight) {
int type = (image.getTransparency() == Transparency.OPAQUE)
? BufferedImage.TYPE_INT_RGB : BufferedImage.TYPE_INT_ARGB;
BufferedImage tmp = new BufferedImage(targetWidth, targetHeig... | java | public static BufferedImage getScaledInstance(BufferedImage image, int targetWidth, int targetHeight) {
int type = (image.getTransparency() == Transparency.OPAQUE)
? BufferedImage.TYPE_INT_RGB : BufferedImage.TYPE_INT_ARGB;
BufferedImage tmp = new BufferedImage(targetWidth, targetHeig... | [
"public",
"static",
"BufferedImage",
"getScaledInstance",
"(",
"BufferedImage",
"image",
",",
"int",
"targetWidth",
",",
"int",
"targetHeight",
")",
"{",
"int",
"type",
"=",
"(",
"image",
".",
"getTransparency",
"(",
")",
"==",
"Transparency",
".",
"OPAQUE",
"... | Convenience method that returns a scaled instance of the provided
{@code BufferedImage}.
@param image the original image to be scaled
@param targetWidth the desired width of the scaled instance, in pixels
@param targetHeight the desired height of the scaled instance, in pixels
@return a scaled version of the original ... | [
"Convenience",
"method",
"that",
"returns",
"a",
"scaled",
"instance",
"of",
"the",
"provided",
"{",
"@code",
"BufferedImage",
"}",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageHelper.java#L39-L48 |
netty/netty | common/src/main/java/io/netty/util/internal/ThreadExecutorMap.java | ThreadExecutorMap.apply | public static ThreadFactory apply(final ThreadFactory threadFactory, final EventExecutor eventExecutor) {
ObjectUtil.checkNotNull(threadFactory, "command");
ObjectUtil.checkNotNull(eventExecutor, "eventExecutor");
return new ThreadFactory() {
@Override
public Thread newTh... | java | public static ThreadFactory apply(final ThreadFactory threadFactory, final EventExecutor eventExecutor) {
ObjectUtil.checkNotNull(threadFactory, "command");
ObjectUtil.checkNotNull(eventExecutor, "eventExecutor");
return new ThreadFactory() {
@Override
public Thread newTh... | [
"public",
"static",
"ThreadFactory",
"apply",
"(",
"final",
"ThreadFactory",
"threadFactory",
",",
"final",
"EventExecutor",
"eventExecutor",
")",
"{",
"ObjectUtil",
".",
"checkNotNull",
"(",
"threadFactory",
",",
"\"command\"",
")",
";",
"ObjectUtil",
".",
"checkNo... | Decorate the given {@link ThreadFactory} and ensure {@link #currentExecutor()} will return {@code eventExecutor}
when called from within the {@link Runnable} during execution. | [
"Decorate",
"the",
"given",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/ThreadExecutorMap.java#L86-L95 |
eobermuhlner/big-math | ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java | BigDecimalMath.atanh | public static BigDecimal atanh(BigDecimal x, MathContext mathContext) {
if (x.compareTo(BigDecimal.ONE) >= 0) {
throw new ArithmeticException("Illegal atanh(x) for x >= 1: x = " + x);
}
if (x.compareTo(MINUS_ONE) <= 0) {
throw new ArithmeticException("Illegal atanh(x) for... | java | public static BigDecimal atanh(BigDecimal x, MathContext mathContext) {
if (x.compareTo(BigDecimal.ONE) >= 0) {
throw new ArithmeticException("Illegal atanh(x) for x >= 1: x = " + x);
}
if (x.compareTo(MINUS_ONE) <= 0) {
throw new ArithmeticException("Illegal atanh(x) for... | [
"public",
"static",
"BigDecimal",
"atanh",
"(",
"BigDecimal",
"x",
",",
"MathContext",
"mathContext",
")",
"{",
"if",
"(",
"x",
".",
"compareTo",
"(",
"BigDecimal",
".",
"ONE",
")",
">=",
"0",
")",
"{",
"throw",
"new",
"ArithmeticException",
"(",
"\"Illega... | Calculates the arc hyperbolic tangens (inverse hyperbolic tangens) of {@link BigDecimal} x.
<p>See: <a href="https://en.wikipedia.org/wiki/Hyperbolic_function">Wikipedia: Hyperbolic function</a></p>
@param x the {@link BigDecimal} to calculate the arc hyperbolic tangens for
@param mathContext the {@link MathContext} ... | [
"Calculates",
"the",
"arc",
"hyperbolic",
"tangens",
"(",
"inverse",
"hyperbolic",
"tangens",
")",
"of",
"{",
"@link",
"BigDecimal",
"}",
"x",
"."
] | train | https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java#L1635-L1647 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java | NodeIndexer.createFulltextField | protected Fieldable createFulltextField(Reader value)
{
if (supportHighlighting)
{
return new TextFieldExtractor(FieldNames.FULLTEXT, value, true, true);
}
else
{
return new TextFieldExtractor(FieldNames.FULLTEXT, value, false, false);
}
} | java | protected Fieldable createFulltextField(Reader value)
{
if (supportHighlighting)
{
return new TextFieldExtractor(FieldNames.FULLTEXT, value, true, true);
}
else
{
return new TextFieldExtractor(FieldNames.FULLTEXT, value, false, false);
}
} | [
"protected",
"Fieldable",
"createFulltextField",
"(",
"Reader",
"value",
")",
"{",
"if",
"(",
"supportHighlighting",
")",
"{",
"return",
"new",
"TextFieldExtractor",
"(",
"FieldNames",
".",
"FULLTEXT",
",",
"value",
",",
"true",
",",
"true",
")",
";",
"}",
"... | Creates a fulltext field for the reader <code>value</code>.
@param value the reader value.
@return a lucene field. | [
"Creates",
"a",
"fulltext",
"field",
"for",
"the",
"reader",
"<code",
">",
"value<",
"/",
"code",
">",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java#L919-L929 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/B2BAccountUrl.java | B2BAccountUrl.getB2BAccountAttributeUrl | public static MozuUrl getB2BAccountAttributeUrl(Integer accountId, String attributeFQN, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/b2baccounts/{accountId}/attributes/{attributeFQN}?responseFields={responseFields}");
formatter.formatUrl("accountId", accountId);
form... | java | public static MozuUrl getB2BAccountAttributeUrl(Integer accountId, String attributeFQN, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/b2baccounts/{accountId}/attributes/{attributeFQN}?responseFields={responseFields}");
formatter.formatUrl("accountId", accountId);
form... | [
"public",
"static",
"MozuUrl",
"getB2BAccountAttributeUrl",
"(",
"Integer",
"accountId",
",",
"String",
"attributeFQN",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/customer/b2baccounts/{accountId}... | Get Resource Url for GetB2BAccountAttribute
@param accountId Unique identifier of the customer account.
@param attributeFQN Fully qualified name for an attribute.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter shoul... | [
"Get",
"Resource",
"Url",
"for",
"GetB2BAccountAttribute"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/B2BAccountUrl.java#L49-L56 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/CouchClient.java | CouchClient.revsDiff | public Map<String, MissingRevisions> revsDiff(Map<String, Set<String>> revisions) {
Misc.checkNotNull(revisions, "Input revisions");
URI uri = this.uriHelper.revsDiffUri();
String payload = JSONUtils.toJson(revisions);
HttpConnection connection = Http.POST(uri, "application/json");
... | java | public Map<String, MissingRevisions> revsDiff(Map<String, Set<String>> revisions) {
Misc.checkNotNull(revisions, "Input revisions");
URI uri = this.uriHelper.revsDiffUri();
String payload = JSONUtils.toJson(revisions);
HttpConnection connection = Http.POST(uri, "application/json");
... | [
"public",
"Map",
"<",
"String",
",",
"MissingRevisions",
">",
"revsDiff",
"(",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"revisions",
")",
"{",
"Misc",
".",
"checkNotNull",
"(",
"revisions",
",",
"\"Input revisions\"",
")",
";",
"URI",
"... | Returns the subset of given the documentId/revisions that are not stored in the database.
The input revisions is a map, whose key is document ID, and value is a list of revisions.
An example input could be (in JSON format):
{ "03ee06461a12f3c288bb865b22000170":
[
"1-b2e54331db828310f3c772d6e042ac9c",
"2-3a24009a9525b... | [
"Returns",
"the",
"subset",
"of",
"given",
"the",
"documentId",
"/",
"revisions",
"that",
"are",
"not",
"stored",
"in",
"the",
"database",
"."
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/CouchClient.java#L865-L873 |
FasterXML/jackson-jr | jr-objects/src/main/java/com/fasterxml/jackson/jr/type/TypeBindings.java | TypeBindings.withUnboundVariable | public TypeBindings withUnboundVariable(String name)
{
int len = (_unboundVariables == null) ? 0 : _unboundVariables.length;
String[] names = (len == 0)
? new String[1] : Arrays.copyOf(_unboundVariables, len+1);
names[len] = name;
return new TypeBindings(_names, _typ... | java | public TypeBindings withUnboundVariable(String name)
{
int len = (_unboundVariables == null) ? 0 : _unboundVariables.length;
String[] names = (len == 0)
? new String[1] : Arrays.copyOf(_unboundVariables, len+1);
names[len] = name;
return new TypeBindings(_names, _typ... | [
"public",
"TypeBindings",
"withUnboundVariable",
"(",
"String",
"name",
")",
"{",
"int",
"len",
"=",
"(",
"_unboundVariables",
"==",
"null",
")",
"?",
"0",
":",
"_unboundVariables",
".",
"length",
";",
"String",
"[",
"]",
"names",
"=",
"(",
"len",
"==",
... | Method for creating an instance that has same bindings as this object,
plus an indicator for additional type variable that may be unbound within
this context; this is needed to resolve recursive self-references. | [
"Method",
"for",
"creating",
"an",
"instance",
"that",
"has",
"same",
"bindings",
"as",
"this",
"object",
"plus",
"an",
"indicator",
"for",
"additional",
"type",
"variable",
"that",
"may",
"be",
"unbound",
"within",
"this",
"context",
";",
"this",
"is",
"nee... | train | https://github.com/FasterXML/jackson-jr/blob/62ca7a82bd90a9be77028e0b62364307d7532837/jr-objects/src/main/java/com/fasterxml/jackson/jr/type/TypeBindings.java#L78-L85 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.listModelsAsync | public Observable<List<ModelInfoResponse>> listModelsAsync(UUID appId, String versionId, ListModelsOptionalParameter listModelsOptionalParameter) {
return listModelsWithServiceResponseAsync(appId, versionId, listModelsOptionalParameter).map(new Func1<ServiceResponse<List<ModelInfoResponse>>, List<ModelInfoRespo... | java | public Observable<List<ModelInfoResponse>> listModelsAsync(UUID appId, String versionId, ListModelsOptionalParameter listModelsOptionalParameter) {
return listModelsWithServiceResponseAsync(appId, versionId, listModelsOptionalParameter).map(new Func1<ServiceResponse<List<ModelInfoResponse>>, List<ModelInfoRespo... | [
"public",
"Observable",
"<",
"List",
"<",
"ModelInfoResponse",
">",
">",
"listModelsAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"ListModelsOptionalParameter",
"listModelsOptionalParameter",
")",
"{",
"return",
"listModelsWithServiceResponseAsync",
"(",
... | Gets information about the application version models.
@param appId The application ID.
@param versionId The version ID.
@param listModelsOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return... | [
"Gets",
"information",
"about",
"the",
"application",
"version",
"models",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L2472-L2479 |
esigate/esigate | esigate-core/src/main/java/org/esigate/Driver.java | Driver.performRendering | private String performRendering(String pageUrl, DriverRequest originalRequest, CloseableHttpResponse response,
String body, Renderer[] renderers) throws IOException, HttpErrorPage {
// Start rendering
RenderEvent renderEvent = new RenderEvent(pageUrl, originalRequest, response);
// C... | java | private String performRendering(String pageUrl, DriverRequest originalRequest, CloseableHttpResponse response,
String body, Renderer[] renderers) throws IOException, HttpErrorPage {
// Start rendering
RenderEvent renderEvent = new RenderEvent(pageUrl, originalRequest, response);
// C... | [
"private",
"String",
"performRendering",
"(",
"String",
"pageUrl",
",",
"DriverRequest",
"originalRequest",
",",
"CloseableHttpResponse",
"response",
",",
"String",
"body",
",",
"Renderer",
"[",
"]",
"renderers",
")",
"throws",
"IOException",
",",
"HttpErrorPage",
"... | Performs rendering (apply a render list) on an http response body (as a String).
@param pageUrl
The remove url from which the body was retrieved.
@param originalRequest
The request received by esigate.
@param response
The Http Reponse.
@param body
The body of the Http Response which will be rendered.
@param renderers
... | [
"Performs",
"rendering",
"(",
"apply",
"a",
"render",
"list",
")",
"on",
"an",
"http",
"response",
"body",
"(",
"as",
"a",
"String",
")",
"."
] | train | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/Driver.java#L399-L418 |
aws/aws-sdk-java | aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/model/AddTagsToVaultRequest.java | AddTagsToVaultRequest.withTags | public AddTagsToVaultRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | java | public AddTagsToVaultRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"AddTagsToVaultRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The tags to add to the vault. Each tag is composed of a key and a value. The value can be an empty string.
</p>
@param tags
The tags to add to the vault. Each tag is composed of a key and a value. The value can be an empty string.
@return Returns a reference to this object so that method calls can be chained toget... | [
"<p",
">",
"The",
"tags",
"to",
"add",
"to",
"the",
"vault",
".",
"Each",
"tag",
"is",
"composed",
"of",
"a",
"key",
"and",
"a",
"value",
".",
"The",
"value",
"can",
"be",
"an",
"empty",
"string",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/model/AddTagsToVaultRequest.java#L184-L187 |
VoltDB/voltdb | src/frontend/org/voltdb/types/GeographyPointValue.java | GeographyPointValue.fromWKT | public static GeographyPointValue fromWKT(String param) {
if (param == null) {
throw new IllegalArgumentException("Null well known text argument to GeographyPointValue constructor.");
}
Matcher m = wktPattern.matcher(param);
if (m.find()) {
// Add 0.0 to avoid -0.... | java | public static GeographyPointValue fromWKT(String param) {
if (param == null) {
throw new IllegalArgumentException("Null well known text argument to GeographyPointValue constructor.");
}
Matcher m = wktPattern.matcher(param);
if (m.find()) {
// Add 0.0 to avoid -0.... | [
"public",
"static",
"GeographyPointValue",
"fromWKT",
"(",
"String",
"param",
")",
"{",
"if",
"(",
"param",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Null well known text argument to GeographyPointValue constructor.\"",
")",
";",
"}",
... | Create a GeographyPointValue from a well-known text string.
@param param A well-known text string.
@return A new instance of GeographyPointValue. | [
"Create",
"a",
"GeographyPointValue",
"from",
"a",
"well",
"-",
"known",
"text",
"string",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/types/GeographyPointValue.java#L91-L110 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/proxy/cglib/CglibLazyInitializer.java | CglibLazyInitializer.getProxyFactory | public static Class getProxyFactory(Class persistentClass, Class[] interfaces) throws PersistenceException
{
Enhancer e = new Enhancer();
e.setSuperclass(interfaces.length == 1 ? persistentClass : null);
e.setInterfaces(interfaces);
e.setCallbackTypes(new Class[] { InvocationHan... | java | public static Class getProxyFactory(Class persistentClass, Class[] interfaces) throws PersistenceException
{
Enhancer e = new Enhancer();
e.setSuperclass(interfaces.length == 1 ? persistentClass : null);
e.setInterfaces(interfaces);
e.setCallbackTypes(new Class[] { InvocationHan... | [
"public",
"static",
"Class",
"getProxyFactory",
"(",
"Class",
"persistentClass",
",",
"Class",
"[",
"]",
"interfaces",
")",
"throws",
"PersistenceException",
"{",
"Enhancer",
"e",
"=",
"new",
"Enhancer",
"(",
")",
";",
"e",
".",
"setSuperclass",
"(",
"interfac... | Gets the proxy factory.
@param persistentClass
the persistent class
@param interfaces
the interfaces
@return the proxy factory
@throws PersistenceException
the persistence exception | [
"Gets",
"the",
"proxy",
"factory",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/proxy/cglib/CglibLazyInitializer.java#L189-L199 |
jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java | StandardCache.createCache | public static <K, V> Cache<K, V> createCache(String cacheName) {
return createCache(cacheName, DEFAULT_TTL, DEFAULT_CLEANUP_INTERVAL/*, application, layer*/);
} | java | public static <K, V> Cache<K, V> createCache(String cacheName) {
return createCache(cacheName, DEFAULT_TTL, DEFAULT_CLEANUP_INTERVAL/*, application, layer*/);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Cache",
"<",
"K",
",",
"V",
">",
"createCache",
"(",
"String",
"cacheName",
")",
"{",
"return",
"createCache",
"(",
"cacheName",
",",
"DEFAULT_TTL",
",",
"DEFAULT_CLEANUP_INTERVAL",
"/*, application, layer*/",
")",... | Retrieves a cache from the current layer or creates it.
Only a root request will be able to embed the constructed cache in the
application.
@param cacheName cache service ID
@return | [
"Retrieves",
"a",
"cache",
"from",
"the",
"current",
"layer",
"or",
"creates",
"it",
".",
"Only",
"a",
"root",
"request",
"will",
"be",
"able",
"to",
"embed",
"the",
"constructed",
"cache",
"in",
"the",
"application",
"."
] | train | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java#L404-L406 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java | JavacFileManager.isValidFile | private boolean isValidFile(String s, Set<JavaFileObject.Kind> fileKinds) {
JavaFileObject.Kind kind = getKind(s);
return fileKinds.contains(kind);
} | java | private boolean isValidFile(String s, Set<JavaFileObject.Kind> fileKinds) {
JavaFileObject.Kind kind = getKind(s);
return fileKinds.contains(kind);
} | [
"private",
"boolean",
"isValidFile",
"(",
"String",
"s",
",",
"Set",
"<",
"JavaFileObject",
".",
"Kind",
">",
"fileKinds",
")",
"{",
"JavaFileObject",
".",
"Kind",
"kind",
"=",
"getKind",
"(",
"s",
")",
";",
"return",
"fileKinds",
".",
"contains",
"(",
"... | container is a directory, a zip file, or a non-existent path. | [
"container",
"is",
"a",
"directory",
"a",
"zip",
"file",
"or",
"a",
"non",
"-",
"existent",
"path",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java#L613-L616 |
BioPAX/Paxtools | sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/L3ToSBGNPDConverter.java | L3ToSBGNPDConverter.createProcessAndConnections | private void createProcessAndConnections(Conversion cnv, ConversionDirectionType direction)
{
assert cnv.getConversionDirection() == null ||
cnv.getConversionDirection().equals(direction) ||
cnv.getConversionDirection().equals(ConversionDirectionType.REVERSIBLE);
// create the process for the conversion in ... | java | private void createProcessAndConnections(Conversion cnv, ConversionDirectionType direction)
{
assert cnv.getConversionDirection() == null ||
cnv.getConversionDirection().equals(direction) ||
cnv.getConversionDirection().equals(ConversionDirectionType.REVERSIBLE);
// create the process for the conversion in ... | [
"private",
"void",
"createProcessAndConnections",
"(",
"Conversion",
"cnv",
",",
"ConversionDirectionType",
"direction",
")",
"{",
"assert",
"cnv",
".",
"getConversionDirection",
"(",
")",
"==",
"null",
"||",
"cnv",
".",
"getConversionDirection",
"(",
")",
".",
"e... | /*
Creates a representation for Conversion.
@param cnv the conversion
@param direction direction of the conversion to create | [
"/",
"*",
"Creates",
"a",
"representation",
"for",
"Conversion",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/L3ToSBGNPDConverter.java#L924-L965 |
sockeqwe/AdapterDelegates | library/src/main/java/com/hannesdorfmann/adapterdelegates4/AdapterDelegatesManager.java | AdapterDelegatesManager.getItemViewType | public int getItemViewType(@NonNull T items, int position) {
if (items == null) {
throw new NullPointerException("Items datasource is null!");
}
int delegatesCount = delegates.size();
for (int i = 0; i < delegatesCount; i++) {
AdapterDelegate<T> delegate = deleg... | java | public int getItemViewType(@NonNull T items, int position) {
if (items == null) {
throw new NullPointerException("Items datasource is null!");
}
int delegatesCount = delegates.size();
for (int i = 0; i < delegatesCount; i++) {
AdapterDelegate<T> delegate = deleg... | [
"public",
"int",
"getItemViewType",
"(",
"@",
"NonNull",
"T",
"items",
",",
"int",
"position",
")",
"{",
"if",
"(",
"items",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Items datasource is null!\"",
")",
";",
"}",
"int",
"delegate... | Must be called from {@link RecyclerView.Adapter#getItemViewType(int)}. Internally it scans all
the registered {@link AdapterDelegate} and picks the right one to return the ViewType integer.
@param items Adapter's data source
@param position the position in adapters data source
@return the ViewType (integer). Return... | [
"Must",
"be",
"called",
"from",
"{",
"@link",
"RecyclerView",
".",
"Adapter#getItemViewType",
"(",
"int",
")",
"}",
".",
"Internally",
"it",
"scans",
"all",
"the",
"registered",
"{",
"@link",
"AdapterDelegate",
"}",
"and",
"picks",
"the",
"right",
"one",
"to... | train | https://github.com/sockeqwe/AdapterDelegates/blob/d18dc609415e5d17a3354bddf4bae62440e017af/library/src/main/java/com/hannesdorfmann/adapterdelegates4/AdapterDelegatesManager.java#L214-L234 |
roboconf/roboconf-platform | core/roboconf-agent-monitoring/src/main/java/net/roboconf/agent/monitoring/internal/nagios/LiveStatusClient.java | LiveStatusClient.queryLivestatus | public String queryLivestatus( String nagiosQuery ) throws UnknownHostException, IOException {
Socket liveStatusSocket = null;
try {
this.logger.fine( "About to open a connection through Live Status..." );
liveStatusSocket = new Socket( this.host, this.port );
this.logger.fine( "A connection was establish... | java | public String queryLivestatus( String nagiosQuery ) throws UnknownHostException, IOException {
Socket liveStatusSocket = null;
try {
this.logger.fine( "About to open a connection through Live Status..." );
liveStatusSocket = new Socket( this.host, this.port );
this.logger.fine( "A connection was establish... | [
"public",
"String",
"queryLivestatus",
"(",
"String",
"nagiosQuery",
")",
"throws",
"UnknownHostException",
",",
"IOException",
"{",
"Socket",
"liveStatusSocket",
"=",
"null",
";",
"try",
"{",
"this",
".",
"logger",
".",
"fine",
"(",
"\"About to open a connection th... | Queries a live status server.
@param nagiosQuery the query to pass through a socket (not null)
@return the response
@throws UnknownHostException
@throws IOException | [
"Queries",
"a",
"live",
"status",
"server",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-agent-monitoring/src/main/java/net/roboconf/agent/monitoring/internal/nagios/LiveStatusClient.java#L73-L101 |
glyptodon/guacamole-client | extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/usergroup/ModeledUserGroup.java | ModeledUserGroup.putRestrictedAttributes | private void putRestrictedAttributes(Map<String, String> attributes) {
// Set disabled attribute
attributes.put(DISABLED_ATTRIBUTE_NAME, getModel().isDisabled() ? "true" : null);
} | java | private void putRestrictedAttributes(Map<String, String> attributes) {
// Set disabled attribute
attributes.put(DISABLED_ATTRIBUTE_NAME, getModel().isDisabled() ? "true" : null);
} | [
"private",
"void",
"putRestrictedAttributes",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"// Set disabled attribute",
"attributes",
".",
"put",
"(",
"DISABLED_ATTRIBUTE_NAME",
",",
"getModel",
"(",
")",
".",
"isDisabled",
"(",
")",
"?... | Stores all restricted (privileged) attributes within the given Map,
pulling the values of those attributes from the underlying user group
model. If no value is yet defined for an attribute, that attribute will
be set to null.
@param attributes
The Map to store all restricted attributes within. | [
"Stores",
"all",
"restricted",
"(",
"privileged",
")",
"attributes",
"within",
"the",
"given",
"Map",
"pulling",
"the",
"values",
"of",
"those",
"attributes",
"from",
"the",
"underlying",
"user",
"group",
"model",
".",
"If",
"no",
"value",
"is",
"yet",
"defi... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/usergroup/ModeledUserGroup.java#L134-L139 |
square/pollexor | src/main/java/com/squareup/pollexor/ThumborUrlBuilder.java | ThumborUrlBuilder.roundCorner | public static String roundCorner(int radiusInner, int radiusOuter, int color) {
if (radiusInner < 1) {
throw new IllegalArgumentException("Radius must be greater than zero.");
}
if (radiusOuter < 0) {
throw new IllegalArgumentException("Outer radius must be greater than or equal to zero.");
... | java | public static String roundCorner(int radiusInner, int radiusOuter, int color) {
if (radiusInner < 1) {
throw new IllegalArgumentException("Radius must be greater than zero.");
}
if (radiusOuter < 0) {
throw new IllegalArgumentException("Outer radius must be greater than or equal to zero.");
... | [
"public",
"static",
"String",
"roundCorner",
"(",
"int",
"radiusInner",
",",
"int",
"radiusOuter",
",",
"int",
"color",
")",
"{",
"if",
"(",
"radiusInner",
"<",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Radius must be greater than zero.\""... | This filter adds rounded corners to the image using the specified color as the background.
@param radiusInner amount of pixels to use as radius.
@param radiusOuter specifies the second value for the ellipse used for the radius. Use 0 for
no value.
@param color fill color for clipped region. | [
"This",
"filter",
"adds",
"rounded",
"corners",
"to",
"the",
"image",
"using",
"the",
"specified",
"color",
"as",
"the",
"background",
"."
] | train | https://github.com/square/pollexor/blob/b72430d2799f617f7fcbb2d3ceb27810c9c6d38f/src/main/java/com/squareup/pollexor/ThumborUrlBuilder.java#L601-L620 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFiltersInner.java | RouteFiltersInner.beginUpdateAsync | public Observable<RouteFilterInner> beginUpdateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1<ServiceResponse<RouteFilterInner>, RouteFilterInner... | java | public Observable<RouteFilterInner> beginUpdateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1<ServiceResponse<RouteFilterInner>, RouteFilterInner... | [
"public",
"Observable",
"<",
"RouteFilterInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"routeFilterName",
",",
"PatchRouteFilter",
"routeFilterParameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName... | Updates a route filter in a specified resource group.
@param resourceGroupName The name of the resource group.
@param routeFilterName The name of the route filter.
@param routeFilterParameters Parameters supplied to the update route filter operation.
@throws IllegalArgumentException thrown if parameters fail the valid... | [
"Updates",
"a",
"route",
"filter",
"in",
"a",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFiltersInner.java#L713-L720 |
mediathekview/MServer | src/main/java/mServer/tool/MserverDatumZeit.java | MserverDatumZeit.formatDate | public static String formatDate(String dateValue, FastDateFormat sdf) {
try {
return FDF_OUT_DAY.format(sdf.parse(dateValue));
} catch (ParseException ex) {
LOG.debug(String.format("Fehler beim Parsen des Datums %s: %s", dateValue, ex.getMessage()));
}
re... | java | public static String formatDate(String dateValue, FastDateFormat sdf) {
try {
return FDF_OUT_DAY.format(sdf.parse(dateValue));
} catch (ParseException ex) {
LOG.debug(String.format("Fehler beim Parsen des Datums %s: %s", dateValue, ex.getMessage()));
}
re... | [
"public",
"static",
"String",
"formatDate",
"(",
"String",
"dateValue",
",",
"FastDateFormat",
"sdf",
")",
"{",
"try",
"{",
"return",
"FDF_OUT_DAY",
".",
"format",
"(",
"sdf",
".",
"parse",
"(",
"dateValue",
")",
")",
";",
"}",
"catch",
"(",
"ParseExceptio... | formats a date/datetime string to the date format used in DatenFilm
@param dateValue the date/datetime value
@param sdf the format of dateValue
@return the formatted date string | [
"formats",
"a",
"date",
"/",
"datetime",
"string",
"to",
"the",
"date",
"format",
"used",
"in",
"DatenFilm"
] | train | https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/tool/MserverDatumZeit.java#L82-L90 |
gallandarakhneorg/afc | advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/primitive/RoadNetworkConstants.java | RoadNetworkConstants.getSystemDefault | @Pure
public static String getSystemDefault(TrafficDirection direction, int valueIndex) {
// Values from the IGN-BDCarto standard
switch (direction) {
case DOUBLE_WAY:
switch (valueIndex) {
case 0:
return DEFAULT_DOUBLE_WAY_TRAFFIC_DIRECTION_0;
case 1:
return DEFAULT_DOUBLE_WAY_TRAFFIC_DIRECTION... | java | @Pure
public static String getSystemDefault(TrafficDirection direction, int valueIndex) {
// Values from the IGN-BDCarto standard
switch (direction) {
case DOUBLE_WAY:
switch (valueIndex) {
case 0:
return DEFAULT_DOUBLE_WAY_TRAFFIC_DIRECTION_0;
case 1:
return DEFAULT_DOUBLE_WAY_TRAFFIC_DIRECTION... | [
"@",
"Pure",
"public",
"static",
"String",
"getSystemDefault",
"(",
"TrafficDirection",
"direction",
",",
"int",
"valueIndex",
")",
"{",
"// Values from the IGN-BDCarto standard",
"switch",
"(",
"direction",
")",
"{",
"case",
"DOUBLE_WAY",
":",
"switch",
"(",
"value... | Replies the system default string-value for the traffic direction, at the
given index in the list of system default values.
@param direction is the direction for which the string value should be replied
@param valueIndex is the position of the string-value.
@return the string-value at the given position, never <code>n... | [
"Replies",
"the",
"system",
"default",
"string",
"-",
"value",
"for",
"the",
"traffic",
"direction",
"at",
"the",
"given",
"index",
"in",
"the",
"list",
"of",
"system",
"default",
"values",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/primitive/RoadNetworkConstants.java#L441-L484 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/file/PathOperations.java | PathOperations.renameFile | @Nonnull
public static FileIOError renameFile (@Nonnull final Path aSourceFile, @Nonnull final Path aTargetFile)
{
ValueEnforcer.notNull (aSourceFile, "SourceFile");
ValueEnforcer.notNull (aTargetFile, "TargetFile");
final Path aRealSourceFile = _getUnifiedPath (aSourceFile);
final Path aRealTarget... | java | @Nonnull
public static FileIOError renameFile (@Nonnull final Path aSourceFile, @Nonnull final Path aTargetFile)
{
ValueEnforcer.notNull (aSourceFile, "SourceFile");
ValueEnforcer.notNull (aTargetFile, "TargetFile");
final Path aRealSourceFile = _getUnifiedPath (aSourceFile);
final Path aRealTarget... | [
"@",
"Nonnull",
"public",
"static",
"FileIOError",
"renameFile",
"(",
"@",
"Nonnull",
"final",
"Path",
"aSourceFile",
",",
"@",
"Nonnull",
"final",
"Path",
"aTargetFile",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aSourceFile",
",",
"\"SourceFile\"",
")",
... | Rename a file.
@param aSourceFile
The original file name. May not be <code>null</code>.
@param aTargetFile
The destination file name. May not be <code>null</code>.
@return A non-<code>null</code> error code. | [
"Rename",
"a",
"file",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/file/PathOperations.java#L430-L465 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/io/DataIO.java | DataIO.createTableModel | public static TableModel createTableModel(final CSTable src) {
final List<String[]> rows = new ArrayList<String[]>();
for (String[] row : src.rows()) {
rows.add(row);
}
return new TableModel() {
@Override
public int getColumnCount() {
... | java | public static TableModel createTableModel(final CSTable src) {
final List<String[]> rows = new ArrayList<String[]>();
for (String[] row : src.rows()) {
rows.add(row);
}
return new TableModel() {
@Override
public int getColumnCount() {
... | [
"public",
"static",
"TableModel",
"createTableModel",
"(",
"final",
"CSTable",
"src",
")",
"{",
"final",
"List",
"<",
"String",
"[",
"]",
">",
"rows",
"=",
"new",
"ArrayList",
"<",
"String",
"[",
"]",
">",
"(",
")",
";",
"for",
"(",
"String",
"[",
"]... | Create a r/o data tablemodel
@param src
@return a table model to the CSTable | [
"Create",
"a",
"r",
"/",
"o",
"data",
"tablemodel"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L497-L548 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/lang/Loader.java | Loader.loadClass | @SuppressWarnings("rawtypes")
public static Class loadClass(Class loaderClass, String name) throws ClassNotFoundException {
if (loaderClass != null && loaderClass.getClassLoader() != null)
return loaderClass.getClassLoader().loadClass(name);
return loadClass(name);
} | java | @SuppressWarnings("rawtypes")
public static Class loadClass(Class loaderClass, String name) throws ClassNotFoundException {
if (loaderClass != null && loaderClass.getClassLoader() != null)
return loaderClass.getClassLoader().loadClass(name);
return loadClass(name);
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"Class",
"loadClass",
"(",
"Class",
"loaderClass",
",",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"loaderClass",
"!=",
"null",
"&&",
"loaderClass",
".",
"getC... | Load a class. Load a class from the same classloader as the passed
<code>loadClass</code>, or if none then use {@link #loadClass(String)}
@param loaderClass a similar class, belong in the same classloader of the desired
class to load
@param name the name of the new class to load
@return Class
@throws ClassNotFo... | [
"Load",
"a",
"class",
".",
"Load",
"a",
"class",
"from",
"the",
"same",
"classloader",
"as",
"the",
"passed",
"<code",
">",
"loadClass<",
"/",
"code",
">",
"or",
"if",
"none",
"then",
"use",
"{",
"@link",
"#loadClass",
"(",
"String",
")",
"}"
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/lang/Loader.java#L76-L81 |
FilteredPush/event_date_qc | src/main/java/org/filteredpush/qc/date/DateUtils.java | DateUtils.eventsAreSameInterval | public static Boolean eventsAreSameInterval(String eventDate, String secondEventDate) {
boolean result = false;
try {
Interval interval = null;
Interval secondInterval = null;
interval = DateUtils.extractDateInterval(eventDate);
secondInterval = DateUtils.extractDateInterval(secondEven... | java | public static Boolean eventsAreSameInterval(String eventDate, String secondEventDate) {
boolean result = false;
try {
Interval interval = null;
Interval secondInterval = null;
interval = DateUtils.extractDateInterval(eventDate);
secondInterval = DateUtils.extractDateInterval(secondEven... | [
"public",
"static",
"Boolean",
"eventsAreSameInterval",
"(",
"String",
"eventDate",
",",
"String",
"secondEventDate",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"try",
"{",
"Interval",
"interval",
"=",
"null",
";",
"Interval",
"secondInterval",
"=",
"null... | Compare two strings that should represent event dates (ingoring time, if not a date range)
@param eventDate to compare with second event date
@param secondEventDate to compare with
@return true if the two provided event dates represent the same interval. | [
"Compare",
"two",
"strings",
"that",
"should",
"represent",
"event",
"dates",
"(",
"ingoring",
"time",
"if",
"not",
"a",
"date",
"range",
")"
] | train | https://github.com/FilteredPush/event_date_qc/blob/52957a71b94b00b767e37924f976e2c7e8868ff3/src/main/java/org/filteredpush/qc/date/DateUtils.java#L2608-L2625 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.