repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/fit/MapColumnFixture.java | MapColumnFixture.translateFromTable | public static void translateFromTable(Map<String, Object> rowValues, String[][] translationTableWithHeader) {
"""
Adds new key/value pairs to rowValues based on table supplied. If value in first column is present,
and there is no value for key of second column, the value in second column is added, and vice versa.... | java | public static void translateFromTable(Map<String, Object> rowValues, String[][] translationTableWithHeader) {
translateFromTable(rowValues, translationTableWithHeader, 0, 1);
translateFromTable(rowValues, translationTableWithHeader, 1, 0);
} | [
"public",
"static",
"void",
"translateFromTable",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"rowValues",
",",
"String",
"[",
"]",
"[",
"]",
"translationTableWithHeader",
")",
"{",
"translateFromTable",
"(",
"rowValues",
",",
"translationTableWithHeader",
",",... | Adds new key/value pairs to rowValues based on table supplied. If value in first column is present,
and there is no value for key of second column, the value in second column is added, and vice versa.
The first row describes the key for each column's values.
@param rowValues row to add values to.
@param translationTabl... | [
"Adds",
"new",
"key",
"/",
"value",
"pairs",
"to",
"rowValues",
"based",
"on",
"table",
"supplied",
".",
"If",
"value",
"in",
"first",
"column",
"is",
"present",
"and",
"there",
"is",
"no",
"value",
"for",
"key",
"of",
"second",
"column",
"the",
"value",... | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/fit/MapColumnFixture.java#L50-L53 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getWvWUpgradeInfo | public void getWvWUpgradeInfo(int[] ids, Callback<List<WvWUpgrade>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on WvW upgrades API go <a href="https://wiki.guildwars2.com/wiki/API:2/wvw/upgrades">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} ... | java | public void getWvWUpgradeInfo(int[] ids, Callback<List<WvWUpgrade>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getWvWUpgradeInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | [
"public",
"void",
"getWvWUpgradeInfo",
"(",
"int",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"WvWUpgrade",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
... | For more info on WvW upgrades API go <a href="https://wiki.guildwars2.com/wiki/API:2/wvw/upgrades">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of WvW upgrade id
@param callback cal... | [
"For",
"more",
"info",
"on",
"WvW",
"upgrades",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"wvw",
"/",
"upgrades",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L2795-L2798 |
ziccardi/jnrpe | jnrpe-lib/src/main/java/it/jnrpe/commands/CommandInvoker.java | CommandInvoker.invoke | public ReturnValue invoke(final CommandDefinition cd, final String[] argsAry) {
"""
This method executes external commands (plugins) The methods also expands
the $ARG?$ macros.
@param cd
The command definition
@param argsAry
The arguments to pass to the command as configured in the
server configuration XML... | java | public ReturnValue invoke(final CommandDefinition cd, final String[] argsAry) {
String pluginName = cd.getPluginName();
try {
String[] commandLine = cd.getCommandLine();
if (acceptParams) {
for (int j = 0; j < commandLine.length; j++) {
for (... | [
"public",
"ReturnValue",
"invoke",
"(",
"final",
"CommandDefinition",
"cd",
",",
"final",
"String",
"[",
"]",
"argsAry",
")",
"{",
"String",
"pluginName",
"=",
"cd",
".",
"getPluginName",
"(",
")",
";",
"try",
"{",
"String",
"[",
"]",
"commandLine",
"=",
... | This method executes external commands (plugins) The methods also expands
the $ARG?$ macros.
@param cd
The command definition
@param argsAry
The arguments to pass to the command as configured in the
server configuration XML (with the $ARG?$ macros)
@return The result of the command | [
"This",
"method",
"executes",
"external",
"commands",
"(",
"plugins",
")",
"The",
"methods",
"also",
"expands",
"the",
"$ARG?$",
"macros",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-lib/src/main/java/it/jnrpe/commands/CommandInvoker.java#L125-L158 |
GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.validateObjectName | static String validateObjectName(String objectName, boolean allowEmptyObjectName) {
"""
Validate the given object name to make sure that it can be used
as a part of a file system path.
Note: this is not designed to duplicate the exact checks that GCS
would perform on the server side. We make some checks
that... | java | static String validateObjectName(String objectName, boolean allowEmptyObjectName) {
logger.atFine().log("validateObjectName('%s', %s)", objectName, allowEmptyObjectName);
if (isNullOrEmpty(objectName) || objectName.equals(PATH_DELIMITER)) {
if (allowEmptyObjectName) {
objectName = "";
} els... | [
"static",
"String",
"validateObjectName",
"(",
"String",
"objectName",
",",
"boolean",
"allowEmptyObjectName",
")",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"validateObjectName('%s', %s)\"",
",",
"objectName",
",",
"allowEmptyObjectName",
")",
";",... | Validate the given object name to make sure that it can be used
as a part of a file system path.
Note: this is not designed to duplicate the exact checks that GCS
would perform on the server side. We make some checks
that are relevant to using GCS as a file system.
@param objectName Object name to check.
@param allow... | [
"Validate",
"the",
"given",
"object",
"name",
"to",
"make",
"sure",
"that",
"it",
"can",
"be",
"used",
"as",
"a",
"part",
"of",
"a",
"file",
"system",
"path",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L1447-L1477 |
cdk/cdk | app/depict/src/main/java/org/openscience/cdk/depict/Dimensions.java | Dimensions.determineGrid | static Dimension determineGrid(int nElem) {
"""
Determine grid size (nrow, ncol) that could be used
for displaying a given number of elements.
@param nElem number of elements
@return grid dimensions (integers)
"""
switch (nElem) {
case 0:
return new Dimension(0, 0);
... | java | static Dimension determineGrid(int nElem) {
switch (nElem) {
case 0:
return new Dimension(0, 0);
case 1:
return new Dimension(1, 1);
case 2:
return new Dimension(2, 1);
case 3:
return new Dimension(3,... | [
"static",
"Dimension",
"determineGrid",
"(",
"int",
"nElem",
")",
"{",
"switch",
"(",
"nElem",
")",
"{",
"case",
"0",
":",
"return",
"new",
"Dimension",
"(",
"0",
",",
"0",
")",
";",
"case",
"1",
":",
"return",
"new",
"Dimension",
"(",
"1",
",",
"1... | Determine grid size (nrow, ncol) that could be used
for displaying a given number of elements.
@param nElem number of elements
@return grid dimensions (integers) | [
"Determine",
"grid",
"size",
"(",
"nrow",
"ncol",
")",
"that",
"could",
"be",
"used",
"for",
"displaying",
"a",
"given",
"number",
"of",
"elements",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Dimensions.java#L122-L150 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfStamper.java | PdfStamper.replacePage | public void replacePage(PdfReader r, int pageImported, int pageReplaced) {
"""
Replaces a page from this document with a page from other document. Only the content
is replaced not the fields and annotations. This method must be called before
getOverContent() or getUndercontent() are called for the same page.
@p... | java | public void replacePage(PdfReader r, int pageImported, int pageReplaced) {
stamper.replacePage(r, pageImported, pageReplaced);
} | [
"public",
"void",
"replacePage",
"(",
"PdfReader",
"r",
",",
"int",
"pageImported",
",",
"int",
"pageReplaced",
")",
"{",
"stamper",
".",
"replacePage",
"(",
"r",
",",
"pageImported",
",",
"pageReplaced",
")",
";",
"}"
] | Replaces a page from this document with a page from other document. Only the content
is replaced not the fields and annotations. This method must be called before
getOverContent() or getUndercontent() are called for the same page.
@param r the <CODE>PdfReader</CODE> from where the new page will be imported
@param pageI... | [
"Replaces",
"a",
"page",
"from",
"this",
"document",
"with",
"a",
"page",
"from",
"other",
"document",
".",
"Only",
"the",
"content",
"is",
"replaced",
"not",
"the",
"fields",
"and",
"annotations",
".",
"This",
"method",
"must",
"be",
"called",
"before",
"... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfStamper.java#L157-L159 |
rundeck/rundeck | rundeck-storage/rundeck-storage-filesys/src/main/java/org/rundeck/storage/data/file/DirectFilepathMapper.java | DirectFilepathMapper.withPath | private File withPath(Path path, File dir) {
"""
file for a given path in the specified subdir
@param path path
@param dir dir
@return file
"""
return new File(dir, path.getPath());
} | java | private File withPath(Path path, File dir) {
return new File(dir, path.getPath());
} | [
"private",
"File",
"withPath",
"(",
"Path",
"path",
",",
"File",
"dir",
")",
"{",
"return",
"new",
"File",
"(",
"dir",
",",
"path",
".",
"getPath",
"(",
")",
")",
";",
"}"
] | file for a given path in the specified subdir
@param path path
@param dir dir
@return file | [
"file",
"for",
"a",
"given",
"path",
"in",
"the",
"specified",
"subdir"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/rundeck-storage/rundeck-storage-filesys/src/main/java/org/rundeck/storage/data/file/DirectFilepathMapper.java#L48-L50 |
phax/ph-pdf-layout | src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java | PDPageContentStreamExt.setNonStrokingColor | public void setNonStrokingColor (final int c, final int m, final int y, final int k) throws IOException {
"""
Set the non-stroking color in the DeviceCMYK color space. Range is 0..255.
@param c
The cyan value.
@param m
The magenta value.
@param y
The yellow value.
@param k
The black value.
@throws IOExc... | java | public void setNonStrokingColor (final int c, final int m, final int y, final int k) throws IOException
{
if (_isOutside255Interval (c) ||
_isOutside255Interval (m) ||
_isOutside255Interval (y) ||
_isOutside255Interval (k))
{
throw new IllegalArgumentException ("Parameters must b... | [
"public",
"void",
"setNonStrokingColor",
"(",
"final",
"int",
"c",
",",
"final",
"int",
"m",
",",
"final",
"int",
"y",
",",
"final",
"int",
"k",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_isOutside255Interval",
"(",
"c",
")",
"||",
"_isOutside255Inter... | Set the non-stroking color in the DeviceCMYK color space. Range is 0..255.
@param c
The cyan value.
@param m
The magenta value.
@param y
The yellow value.
@param k
The black value.
@throws IOException
If an IO error occurs while writing to the stream.
@throws IllegalArgumentException
If the parameters are invalid. | [
"Set",
"the",
"non",
"-",
"stroking",
"color",
"in",
"the",
"DeviceCMYK",
"color",
"space",
".",
"Range",
"is",
"0",
"..",
"255",
"."
] | train | https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java#L980-L998 |
victims/victims-lib-java | src/main/java/com/redhat/victims/VictimsScanner.java | VictimsScanner.scanArtifact | private static void scanArtifact(Artifact artifact, VictimsOutputStream vos)
throws IOException {
"""
Scans a provided {@link Artifact} and writes the resulting
{@link VictimsRecord} to the provided {@link VictimsOutputStream}.
@param artifact
@param os
@throws IOException
"""
ArrayLi... | java | private static void scanArtifact(Artifact artifact, VictimsOutputStream vos)
throws IOException {
ArrayList<Artifact> embedded = artifact.embedded();
if (embedded != null) {
for (Artifact eartifact : artifact.embedded()) {
scanArtifact(eartifact, vos);
... | [
"private",
"static",
"void",
"scanArtifact",
"(",
"Artifact",
"artifact",
",",
"VictimsOutputStream",
"vos",
")",
"throws",
"IOException",
"{",
"ArrayList",
"<",
"Artifact",
">",
"embedded",
"=",
"artifact",
".",
"embedded",
"(",
")",
";",
"if",
"(",
"embedded... | Scans a provided {@link Artifact} and writes the resulting
{@link VictimsRecord} to the provided {@link VictimsOutputStream}.
@param artifact
@param os
@throws IOException | [
"Scans",
"a",
"provided",
"{",
"@link",
"Artifact",
"}",
"and",
"writes",
"the",
"resulting",
"{",
"@link",
"VictimsRecord",
"}",
"to",
"the",
"provided",
"{",
"@link",
"VictimsOutputStream",
"}",
"."
] | train | https://github.com/victims/victims-lib-java/blob/ccd0e2fcc409bb6cdfc5de411c3bb202c9095f8b/src/main/java/com/redhat/victims/VictimsScanner.java#L50-L60 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/ImplementationImpl.java | ImplementationImpl.newDList | public DList newDList() {
"""
Create a new <code>DList</code> object.
@return The new <code>DList</code> object.
@see DList
"""
if ((getCurrentDatabase() == null))
{
throw new DatabaseClosedException("Database is NULL, cannot create a DList with a null database.");
}
... | java | public DList newDList()
{
if ((getCurrentDatabase() == null))
{
throw new DatabaseClosedException("Database is NULL, cannot create a DList with a null database.");
}
return (DList) DListFactory.singleton.createCollectionOrMap(getCurrentPBKey());
} | [
"public",
"DList",
"newDList",
"(",
")",
"{",
"if",
"(",
"(",
"getCurrentDatabase",
"(",
")",
"==",
"null",
")",
")",
"{",
"throw",
"new",
"DatabaseClosedException",
"(",
"\"Database is NULL, cannot create a DList with a null database.\"",
")",
";",
"}",
"return",
... | Create a new <code>DList</code> object.
@return The new <code>DList</code> object.
@see DList | [
"Create",
"a",
"new",
"<code",
">",
"DList<",
"/",
"code",
">",
"object",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/ImplementationImpl.java#L211-L218 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.errorv | public void errorv(String format, Object... params) {
"""
Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting.
@param format the message format string
@param params the parameters
"""
doLog(Level.ERROR, FQCN, format, params, null);
} | java | public void errorv(String format, Object... params) {
doLog(Level.ERROR, FQCN, format, params, null);
} | [
"public",
"void",
"errorv",
"(",
"String",
"format",
",",
"Object",
"...",
"params",
")",
"{",
"doLog",
"(",
"Level",
".",
"ERROR",
",",
"FQCN",
",",
"format",
",",
"params",
",",
"null",
")",
";",
"}"
] | Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting.
@param format the message format string
@param params the parameters | [
"Issue",
"a",
"log",
"message",
"with",
"a",
"level",
"of",
"ERROR",
"using",
"{",
"@link",
"java",
".",
"text",
".",
"MessageFormat",
"}",
"-",
"style",
"formatting",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L1564-L1566 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/net/NetworkUtils.java | NetworkUtils.newSocketAddress | public static SocketAddress newSocketAddress(String host, int port) {
"""
Constructs a new instance of {@link SocketAddress} bound to the given {@link String host} and {@link Integer port}.
@param host {@link String} containing the name of the host to whichthe {@link SocketAddress} will be bound.
@param port {... | java | public static SocketAddress newSocketAddress(String host, int port) {
return Optional.ofNullable(host).map(hostname -> new InetSocketAddress(host, port))
.orElseGet(() -> new InetSocketAddress(port));
} | [
"public",
"static",
"SocketAddress",
"newSocketAddress",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"host",
")",
".",
"map",
"(",
"hostname",
"->",
"new",
"InetSocketAddress",
"(",
"host",
",",
"port",
... | Constructs a new instance of {@link SocketAddress} bound to the given {@link String host} and {@link Integer port}.
@param host {@link String} containing the name of the host to whichthe {@link SocketAddress} will be bound.
@param port {@link Integer} specifying the port number to which the {@link SocketAddress} will ... | [
"Constructs",
"a",
"new",
"instance",
"of",
"{",
"@link",
"SocketAddress",
"}",
"bound",
"to",
"the",
"given",
"{",
"@link",
"String",
"host",
"}",
"and",
"{",
"@link",
"Integer",
"port",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/net/NetworkUtils.java#L203-L206 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/ui/SeaGlassTableUI.java | SeaGlassTableUI.createCustomCellRendererPane | private CellRendererPane createCustomCellRendererPane() {
"""
Creates a custom {@link CellRendererPane} that sets the renderer
component to be non-opqaque if the associated row isn't selected. This
custom {@code CellRendererPane} is needed because a table UI delegate has
no prepare renderer like {@link JTable} ... | java | private CellRendererPane createCustomCellRendererPane() {
return new CellRendererPane() {
@Override
public void paintComponent(Graphics graphics, Component component, Container container, int x, int y, int w, int h,
boolean shouldValidate) {
int ro... | [
"private",
"CellRendererPane",
"createCustomCellRendererPane",
"(",
")",
"{",
"return",
"new",
"CellRendererPane",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"paintComponent",
"(",
"Graphics",
"graphics",
",",
"Component",
"component",
",",
"Container",
"cont... | Creates a custom {@link CellRendererPane} that sets the renderer
component to be non-opqaque if the associated row isn't selected. This
custom {@code CellRendererPane} is needed because a table UI delegate has
no prepare renderer like {@link JTable} has.
@return DOCUMENT ME! | [
"Creates",
"a",
"custom",
"{",
"@link",
"CellRendererPane",
"}",
"that",
"sets",
"the",
"renderer",
"component",
"to",
"be",
"non",
"-",
"opqaque",
"if",
"the",
"associated",
"row",
"isn",
"t",
"selected",
".",
"This",
"custom",
"{",
"@code",
"CellRendererPa... | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassTableUI.java#L1123-L1175 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/conversion/converters/IntegerConverter.java | IntegerConverter.canConvert | @Override
public boolean canConvert(Class<?> fromType, Class<?> toType) {
"""
Determines whether this {@link Converter} can convert {@link Object Objects}
{@link Class from type} {@link Class to type}.
@param fromType {@link Class type} to convert from.
@param toType {@link Class type} to convert to.
@retu... | java | @Override
public boolean canConvert(Class<?> fromType, Class<?> toType) {
return isAssignableTo(fromType, Number.class, String.class) && Integer.class.equals(toType);
} | [
"@",
"Override",
"public",
"boolean",
"canConvert",
"(",
"Class",
"<",
"?",
">",
"fromType",
",",
"Class",
"<",
"?",
">",
"toType",
")",
"{",
"return",
"isAssignableTo",
"(",
"fromType",
",",
"Number",
".",
"class",
",",
"String",
".",
"class",
")",
"&... | Determines whether this {@link Converter} can convert {@link Object Objects}
{@link Class from type} {@link Class to type}.
@param fromType {@link Class type} to convert from.
@param toType {@link Class type} to convert to.
@return a boolean indicating whether this {@link Converter} can convert {@link Object Objects}
... | [
"Determines",
"whether",
"this",
"{",
"@link",
"Converter",
"}",
"can",
"convert",
"{",
"@link",
"Object",
"Objects",
"}",
"{",
"@link",
"Class",
"from",
"type",
"}",
"{",
"@link",
"Class",
"to",
"type",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/conversion/converters/IntegerConverter.java#L49-L52 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/message/MessageBundleScriptCreator.java | MessageBundleScriptCreator.createScript | public Reader createScript(Charset charset, ResourceBundle bundle) {
"""
Loads the message resource bundles specified and uses a
BundleStringJasonifier to generate the properties.
@param charset
the charset
@param bundle
the bundle
@return the script
"""
Properties props = new Properties();
update... | java | public Reader createScript(Charset charset, ResourceBundle bundle) {
Properties props = new Properties();
updateProperties(bundle, props, charset);
return doCreateScript(props);
} | [
"public",
"Reader",
"createScript",
"(",
"Charset",
"charset",
",",
"ResourceBundle",
"bundle",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"updateProperties",
"(",
"bundle",
",",
"props",
",",
"charset",
")",
";",
"return",
"do... | Loads the message resource bundles specified and uses a
BundleStringJasonifier to generate the properties.
@param charset
the charset
@param bundle
the bundle
@return the script | [
"Loads",
"the",
"message",
"resource",
"bundles",
"specified",
"and",
"uses",
"a",
"BundleStringJasonifier",
"to",
"generate",
"the",
"properties",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/message/MessageBundleScriptCreator.java#L216-L221 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/factory/AbstractObjectFactory.java | AbstractObjectFactory.resolveCompatibleConstructor | @SuppressWarnings("unchecked")
protected Constructor resolveCompatibleConstructor(final Class<?> objectType, final Class<?>[] parameterTypes) {
"""
Resolves the matching constructor for the specified Class type who's actual public constructor argument types
are assignment compatible with the expected parameter ... | java | @SuppressWarnings("unchecked")
protected Constructor resolveCompatibleConstructor(final Class<?> objectType, final Class<?>[] parameterTypes) {
for (Constructor constructor : objectType.getConstructors()) {
Class[] constructorParameterTypes = constructor.getParameterTypes();
if (parameterTypes.length... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"Constructor",
"resolveCompatibleConstructor",
"(",
"final",
"Class",
"<",
"?",
">",
"objectType",
",",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
")",
"{",
"for",
"(",
"Constru... | Resolves the matching constructor for the specified Class type who's actual public constructor argument types
are assignment compatible with the expected parameter types.
@param objectType the Class from which the constructor is resolved.
@param parameterTypes the array of Class types determining the resolved construc... | [
"Resolves",
"the",
"matching",
"constructor",
"for",
"the",
"specified",
"Class",
"type",
"who",
"s",
"actual",
"public",
"constructor",
"argument",
"types",
"are",
"assignment",
"compatible",
"with",
"the",
"expected",
"parameter",
"types",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/factory/AbstractObjectFactory.java#L166-L185 |
osmdroid/osmdroid | osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java | SphericalUtil.polarTriangleArea | private static double polarTriangleArea(double tan1, double lng1, double tan2, double lng2) {
"""
Returns the signed area of a triangle which has North Pole as a vertex.
Formula derived from "Area of a spherical triangle given two edges and the included angle"
as per "Spherical Trigonometry" by Todhunter, page 7... | java | private static double polarTriangleArea(double tan1, double lng1, double tan2, double lng2) {
double deltaLng = lng1 - lng2;
double t = tan1 * tan2;
return 2 * atan2(t * sin(deltaLng), 1 + t * cos(deltaLng));
} | [
"private",
"static",
"double",
"polarTriangleArea",
"(",
"double",
"tan1",
",",
"double",
"lng1",
",",
"double",
"tan2",
",",
"double",
"lng2",
")",
"{",
"double",
"deltaLng",
"=",
"lng1",
"-",
"lng2",
";",
"double",
"t",
"=",
"tan1",
"*",
"tan2",
";",
... | Returns the signed area of a triangle which has North Pole as a vertex.
Formula derived from "Area of a spherical triangle given two edges and the included angle"
as per "Spherical Trigonometry" by Todhunter, page 71, section 103, point 2.
See http://books.google.com/books?id=3uBHAAAAIAAJ&pg=PA71
The arguments named "t... | [
"Returns",
"the",
"signed",
"area",
"of",
"a",
"triangle",
"which",
"has",
"North",
"Pole",
"as",
"a",
"vertex",
".",
"Formula",
"derived",
"from",
"Area",
"of",
"a",
"spherical",
"triangle",
"given",
"two",
"edges",
"and",
"the",
"included",
"angle",
"as"... | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java#L349-L353 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/matrix/CellMaskedMatrix.java | CellMaskedMatrix.getIndexFromMap | protected int getIndexFromMap(int[] maskMap, int index) {
"""
Returns the new index value for a given index from a given mapping.
Returns -1 if no mapping is found for the requested row.
"""
if (index < 0 || index >= maskMap.length)
throw new IndexOutOfBoundsException(
... | java | protected int getIndexFromMap(int[] maskMap, int index) {
if (index < 0 || index >= maskMap.length)
throw new IndexOutOfBoundsException(
"The given index is beyond the bounds of the matrix");
int newIndex = maskMap[index];
if (newIndex < 0 ||
maskMap =... | [
"protected",
"int",
"getIndexFromMap",
"(",
"int",
"[",
"]",
"maskMap",
",",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"maskMap",
".",
"length",
")",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"The given index is b... | Returns the new index value for a given index from a given mapping.
Returns -1 if no mapping is found for the requested row. | [
"Returns",
"the",
"new",
"index",
"value",
"for",
"a",
"given",
"index",
"from",
"a",
"given",
"mapping",
".",
"Returns",
"-",
"1",
"if",
"no",
"mapping",
"is",
"found",
"for",
"the",
"requested",
"row",
"."
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/CellMaskedMatrix.java#L95-L106 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/handler/file/FileAuditHandler.java | FileAuditHandler.hasDiskAccess | static boolean hasDiskAccess(final String path) {
"""
Checks for disk access.
@param path
the path
@return true, if successful
"""
try {
AccessController.checkPermission(new FilePermission(path, "read,write"));
return true;
} catch (AccessControlException e) {
return false;
}
} | java | static boolean hasDiskAccess(final String path) {
try {
AccessController.checkPermission(new FilePermission(path, "read,write"));
return true;
} catch (AccessControlException e) {
return false;
}
} | [
"static",
"boolean",
"hasDiskAccess",
"(",
"final",
"String",
"path",
")",
"{",
"try",
"{",
"AccessController",
".",
"checkPermission",
"(",
"new",
"FilePermission",
"(",
"path",
",",
"\"read,write\"",
")",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",... | Checks for disk access.
@param path
the path
@return true, if successful | [
"Checks",
"for",
"disk",
"access",
"."
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/handler/file/FileAuditHandler.java#L120-L127 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ModuleSummaryBuilder.java | ModuleSummaryBuilder.buildSummary | public void buildSummary(XMLNode node, Content moduleContentTree) throws DocletException {
"""
Build the module summary.
@param node the XML element that specifies which components to document
@param moduleContentTree the module content tree to which the summaries will
be added
@throws DocletException if the... | java | public void buildSummary(XMLNode node, Content moduleContentTree) throws DocletException {
Content summaryContentTree = moduleWriter.getSummaryHeader();
buildChildren(node, summaryContentTree);
moduleContentTree.addContent(moduleWriter.getSummaryTree(summaryContentTree));
} | [
"public",
"void",
"buildSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"moduleContentTree",
")",
"throws",
"DocletException",
"{",
"Content",
"summaryContentTree",
"=",
"moduleWriter",
".",
"getSummaryHeader",
"(",
")",
";",
"buildChildren",
"(",
"node",
",",
"... | Build the module summary.
@param node the XML element that specifies which components to document
@param moduleContentTree the module content tree to which the summaries will
be added
@throws DocletException if there is a problem while building the documentation | [
"Build",
"the",
"module",
"summary",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ModuleSummaryBuilder.java#L163-L167 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java | BasicBondGenerator.generateBondElement | public IRenderingElement generateBondElement(IBond bond, IBond.Order type, RendererModel model) {
"""
Generate a LineElement or an ElementGroup of LineElements for this bond.
This version should be used if you want to override the type - for
example, for ring double bonds.
@param bond the bond to generate for... | java | public IRenderingElement generateBondElement(IBond bond, IBond.Order type, RendererModel model) {
// More than 2 atoms per bond not supported by this module
if (bond.getAtomCount() > 2) return null;
// is object right? if not replace with a good one
Point2d point1 = bond.getBegin().getP... | [
"public",
"IRenderingElement",
"generateBondElement",
"(",
"IBond",
"bond",
",",
"IBond",
".",
"Order",
"type",
",",
"RendererModel",
"model",
")",
"{",
"// More than 2 atoms per bond not supported by this module",
"if",
"(",
"bond",
".",
"getAtomCount",
"(",
")",
">"... | Generate a LineElement or an ElementGroup of LineElements for this bond.
This version should be used if you want to override the type - for
example, for ring double bonds.
@param bond the bond to generate for
@param type the type of the bond - single, double, etc
@param model the renderer model
@return one or more ren... | [
"Generate",
"a",
"LineElement",
"or",
"an",
"ElementGroup",
"of",
"LineElements",
"for",
"this",
"bond",
".",
"This",
"version",
"should",
"be",
"used",
"if",
"you",
"want",
"to",
"override",
"the",
"type",
"-",
"for",
"example",
"for",
"ring",
"double",
"... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java#L309-L339 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/SettingsElement.java | SettingsElement.setViewSetting | public void setViewSetting(final String viewId, final String item, final String value) {
"""
Set a view setting
@param viewId the view id
@param item the item name
@param value the item value
"""
this.settings.setViewSetting(viewId, item, value);
} | java | public void setViewSetting(final String viewId, final String item, final String value) {
this.settings.setViewSetting(viewId, item, value);
} | [
"public",
"void",
"setViewSetting",
"(",
"final",
"String",
"viewId",
",",
"final",
"String",
"item",
",",
"final",
"String",
"value",
")",
"{",
"this",
".",
"settings",
".",
"setViewSetting",
"(",
"viewId",
",",
"item",
",",
"value",
")",
";",
"}"
] | Set a view setting
@param viewId the view id
@param item the item name
@param value the item value | [
"Set",
"a",
"view",
"setting"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/SettingsElement.java#L132-L134 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/FieldCriteria.java | FieldCriteria.buildEqualToCriteria | static FieldCriteria buildEqualToCriteria(Object anAttribute, Object aValue, UserAlias anAlias) {
"""
static FieldCriteria buildEqualToCriteria(Object anAttribute, Object aValue, String anAlias)
"""
return new FieldCriteria(anAttribute, aValue, EQUAL, anAlias);
} | java | static FieldCriteria buildEqualToCriteria(Object anAttribute, Object aValue, UserAlias anAlias)
{
return new FieldCriteria(anAttribute, aValue, EQUAL, anAlias);
} | [
"static",
"FieldCriteria",
"buildEqualToCriteria",
"(",
"Object",
"anAttribute",
",",
"Object",
"aValue",
",",
"UserAlias",
"anAlias",
")",
"{",
"return",
"new",
"FieldCriteria",
"(",
"anAttribute",
",",
"aValue",
",",
"EQUAL",
",",
"anAlias",
")",
";",
"}"
] | static FieldCriteria buildEqualToCriteria(Object anAttribute, Object aValue, String anAlias) | [
"static",
"FieldCriteria",
"buildEqualToCriteria",
"(",
"Object",
"anAttribute",
"Object",
"aValue",
"String",
"anAlias",
")"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/FieldCriteria.java#L28-L31 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java | UserAttrs.setShortAttribute | public static final void setShortAttribute(Path path, String attribute, short value, LinkOption... options) throws IOException {
"""
Set user-defined-attribute
@param path
@param attribute user:attribute name. user: can be omitted.. user: can be omitted.
@param value
@param options
@throws IOException
"""... | java | public static final void setShortAttribute(Path path, String attribute, short value, LinkOption... options) throws IOException
{
attribute = attribute.startsWith("user:") ? attribute : "user:"+attribute;
Files.setAttribute(path, attribute, Primitives.writeShort(value), options);
} | [
"public",
"static",
"final",
"void",
"setShortAttribute",
"(",
"Path",
"path",
",",
"String",
"attribute",
",",
"short",
"value",
",",
"LinkOption",
"...",
"options",
")",
"throws",
"IOException",
"{",
"attribute",
"=",
"attribute",
".",
"startsWith",
"(",
"\"... | Set user-defined-attribute
@param path
@param attribute user:attribute name. user: can be omitted.. user: can be omitted.
@param value
@param options
@throws IOException | [
"Set",
"user",
"-",
"defined",
"-",
"attribute"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java#L40-L44 |
wcm-io/wcm-io-tooling | commons/crx-packmgr-helper/src/main/java/io/wcm/tooling/commons/packmgr/PackageManagerHelper.java | PackageManagerHelper.executePackageManagerMethodHtmlOutputResponse | public void executePackageManagerMethodHtmlOutputResponse(CloseableHttpClient httpClient, HttpRequestBase method) {
"""
Execute CRX HTTP Package manager method and output HTML response.
@param httpClient Http client
@param method Get or Post method
"""
PackageManagerHtmlMessageCall call = new PackageMana... | java | public void executePackageManagerMethodHtmlOutputResponse(CloseableHttpClient httpClient, HttpRequestBase method) {
PackageManagerHtmlMessageCall call = new PackageManagerHtmlMessageCall(httpClient, method, log);
executeHttpCallWithRetry(call, 0);
} | [
"public",
"void",
"executePackageManagerMethodHtmlOutputResponse",
"(",
"CloseableHttpClient",
"httpClient",
",",
"HttpRequestBase",
"method",
")",
"{",
"PackageManagerHtmlMessageCall",
"call",
"=",
"new",
"PackageManagerHtmlMessageCall",
"(",
"httpClient",
",",
"method",
","... | Execute CRX HTTP Package manager method and output HTML response.
@param httpClient Http client
@param method Get or Post method | [
"Execute",
"CRX",
"HTTP",
"Package",
"manager",
"method",
"and",
"output",
"HTML",
"response",
"."
] | train | https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/commons/crx-packmgr-helper/src/main/java/io/wcm/tooling/commons/packmgr/PackageManagerHelper.java#L253-L256 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/jdbc/SnowflakeResultChunk.java | SnowflakeResultChunk.getCell | public final Object getCell(int rowIdx, int colIdx) {
"""
Creates a String object for the given cell
@param rowIdx zero based row
@param colIdx zero based column
@return String
"""
if (resultData != null)
{
return extractCell(resultData, rowIdx, colIdx);
}
return data.get(colCount * ... | java | public final Object getCell(int rowIdx, int colIdx)
{
if (resultData != null)
{
return extractCell(resultData, rowIdx, colIdx);
}
return data.get(colCount * rowIdx + colIdx);
} | [
"public",
"final",
"Object",
"getCell",
"(",
"int",
"rowIdx",
",",
"int",
"colIdx",
")",
"{",
"if",
"(",
"resultData",
"!=",
"null",
")",
"{",
"return",
"extractCell",
"(",
"resultData",
",",
"rowIdx",
",",
"colIdx",
")",
";",
"}",
"return",
"data",
".... | Creates a String object for the given cell
@param rowIdx zero based row
@param colIdx zero based column
@return String | [
"Creates",
"a",
"String",
"object",
"for",
"the",
"given",
"cell"
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/jdbc/SnowflakeResultChunk.java#L140-L147 |
unbescape/unbescape | src/main/java/org/unbescape/java/JavaEscape.java | JavaEscape.escapeJavaMinimal | public static void escapeJavaMinimal(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
"""
<p>
Perform a Java level 1 (only basic set) <strong>escape</strong> operation
on a <tt>char[]</tt> input.
</p>
<p>
<em>Level 1</em> me... | java | public static void escapeJavaMinimal(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
escapeJava(text, offset, len, writer, JavaEscapeLevel.LEVEL_1_BASIC_ESCAPE_SET);
} | [
"public",
"static",
"void",
"escapeJavaMinimal",
"(",
"final",
"char",
"[",
"]",
"text",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeJava",
"(",
"text",
",",
"offset... | <p>
Perform a Java level 1 (only basic set) <strong>escape</strong> operation
on a <tt>char[]</tt> input.
</p>
<p>
<em>Level 1</em> means this method will only escape the Java basic escape set:
</p>
<ul>
<li>The <em>Single Escape Characters</em>:
<tt>\b</tt> (<tt>U+0008</tt>),
<tt>\t</tt> (<tt>U+0009</tt>),
<tt... | [
"<p",
">",
"Perform",
"a",
"Java",
"level",
"1",
"(",
"only",
"basic",
"set",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"char",
"[]",
"<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/java/JavaEscape.java#L702-L705 |
OpenLiberty/open-liberty | dev/com.ibm.ws.config/src/com/ibm/ws/config/admin/internal/ExtendedConfigurationImpl.java | ExtendedConfigurationImpl.updateProperties | @Override
public void updateProperties(Dictionary<String, Object> properties) throws IOException {
"""
without other guards, separating updating the properties and sending configuration events
can result in missing and duplicate update events even if every update is eventually associated with an event.
""... | java | @Override
public void updateProperties(Dictionary<String, Object> properties) throws IOException {
lock.lock();
try {
doUpdateProperties(properties);
} finally {
lock.unlock();
}
} | [
"@",
"Override",
"public",
"void",
"updateProperties",
"(",
"Dictionary",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"throws",
"IOException",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"doUpdateProperties",
"(",
"properties",
")",
";",
... | without other guards, separating updating the properties and sending configuration events
can result in missing and duplicate update events even if every update is eventually associated with an event. | [
"without",
"other",
"guards",
"separating",
"updating",
"the",
"properties",
"and",
"sending",
"configuration",
"events",
"can",
"result",
"in",
"missing",
"and",
"duplicate",
"update",
"events",
"even",
"if",
"every",
"update",
"is",
"eventually",
"associated",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/admin/internal/ExtendedConfigurationImpl.java#L433-L441 |
jhalterman/failsafe | src/main/java/net/jodah/failsafe/ExecutionResult.java | ExecutionResult.withComplete | public ExecutionResult withComplete() {
"""
Returns a copy of the ExecutionResult with the value set to true, else this if nothing has changed.
"""
return this.complete ? this : new ExecutionResult(result, failure, nonResult, waitNanos, true, success, successAll);
} | java | public ExecutionResult withComplete() {
return this.complete ? this : new ExecutionResult(result, failure, nonResult, waitNanos, true, success, successAll);
} | [
"public",
"ExecutionResult",
"withComplete",
"(",
")",
"{",
"return",
"this",
".",
"complete",
"?",
"this",
":",
"new",
"ExecutionResult",
"(",
"result",
",",
"failure",
",",
"nonResult",
",",
"waitNanos",
",",
"true",
",",
"success",
",",
"successAll",
")",... | Returns a copy of the ExecutionResult with the value set to true, else this if nothing has changed. | [
"Returns",
"a",
"copy",
"of",
"the",
"ExecutionResult",
"with",
"the",
"value",
"set",
"to",
"true",
"else",
"this",
"if",
"nothing",
"has",
"changed",
"."
] | train | https://github.com/jhalterman/failsafe/blob/65fcd3a82f7b232d2ff59bc525a59d693dd8e223/src/main/java/net/jodah/failsafe/ExecutionResult.java#L110-L112 |
kmi/iserve | iserve-discovery-api/src/main/java/uk/ac/open/kmi/iserve/discovery/api/impl/AbstractMatcher.java | AbstractMatcher.listMatchesOfType | @Override
public Map<URI, MatchResult> listMatchesOfType(URI origin, MatchType type) {
"""
Obtains all the matching resources that have a precise MatchType with the URI of {@code origin}.
@param origin URI to match
@param type the MatchType we want to obtain
@return a Map containing indexed by the URI o... | java | @Override
public Map<URI, MatchResult> listMatchesOfType(URI origin, MatchType type) {
return listMatchesWithinRange(origin, type, type);
} | [
"@",
"Override",
"public",
"Map",
"<",
"URI",
",",
"MatchResult",
">",
"listMatchesOfType",
"(",
"URI",
"origin",
",",
"MatchType",
"type",
")",
"{",
"return",
"listMatchesWithinRange",
"(",
"origin",
",",
"type",
",",
"type",
")",
";",
"}"
] | Obtains all the matching resources that have a precise MatchType with the URI of {@code origin}.
@param origin URI to match
@param type the MatchType we want to obtain
@return a Map containing indexed by the URI of the matching resource and containing the particular {@code MatchResult}. If no
result is found the Map... | [
"Obtains",
"all",
"the",
"matching",
"resources",
"that",
"have",
"a",
"precise",
"MatchType",
"with",
"the",
"URI",
"of",
"{",
"@code",
"origin",
"}",
"."
] | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-discovery-api/src/main/java/uk/ac/open/kmi/iserve/discovery/api/impl/AbstractMatcher.java#L85-L88 |
teknux-org/jetty-bootstrap | jetty-bootstrap/src/main/java/org/teknux/jettybootstrap/JettyBootstrap.java | JettyBootstrap.addWarApp | public WebAppContext addWarApp(String war, String contextPath) throws JettyBootstrapException {
"""
Add a War application specifying the context path.
@param war
the path to a war file
@param contextPath
the path (base URL) to make the war available
@return WebAppContext
@throws JettyBootstrapException
on... | java | public WebAppContext addWarApp(String war, String contextPath) throws JettyBootstrapException {
WarAppJettyHandler warAppJettyHandler = new WarAppJettyHandler(getInitializedConfiguration());
warAppJettyHandler.setWar(war);
warAppJettyHandler.setContextPath(contextPath);
WebAppContext we... | [
"public",
"WebAppContext",
"addWarApp",
"(",
"String",
"war",
",",
"String",
"contextPath",
")",
"throws",
"JettyBootstrapException",
"{",
"WarAppJettyHandler",
"warAppJettyHandler",
"=",
"new",
"WarAppJettyHandler",
"(",
"getInitializedConfiguration",
"(",
")",
")",
";... | Add a War application specifying the context path.
@param war
the path to a war file
@param contextPath
the path (base URL) to make the war available
@return WebAppContext
@throws JettyBootstrapException
on failure | [
"Add",
"a",
"War",
"application",
"specifying",
"the",
"context",
"path",
"."
] | train | https://github.com/teknux-org/jetty-bootstrap/blob/c16e710b833084c650fce35aa8c1ccaf83cd93ef/jetty-bootstrap/src/main/java/org/teknux/jettybootstrap/JettyBootstrap.java#L248-L257 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/util/StreamUtil.java | StreamUtil.toUtf8StringOrHex | public static String toUtf8StringOrHex(ByteArrayOutputStream byteStream, int maxLen) {
"""
generate a String of UTF-8 characters (or hex-digits if byteStream isn't UTF-8 chars) from byteStream,
truncating to maxLen (with "..." added if the result is truncated)
@param byteStream the source of bytes to be converte... | java | public static String toUtf8StringOrHex(ByteArrayOutputStream byteStream, int maxLen) {
if (maxLen == -1) {
maxLen = Integer.MAX_VALUE;
}
String result;
try {
result = byteStream.toString("UTF-8");
} catch (Exception notUtf8) {
result = Hex.enc... | [
"public",
"static",
"String",
"toUtf8StringOrHex",
"(",
"ByteArrayOutputStream",
"byteStream",
",",
"int",
"maxLen",
")",
"{",
"if",
"(",
"maxLen",
"==",
"-",
"1",
")",
"{",
"maxLen",
"=",
"Integer",
".",
"MAX_VALUE",
";",
"}",
"String",
"result",
";",
"tr... | generate a String of UTF-8 characters (or hex-digits if byteStream isn't UTF-8 chars) from byteStream,
truncating to maxLen (with "..." added if the result is truncated)
@param byteStream the source of bytes to be converted to a UTF-8 String
@param maxLen the point at which to truncate the string (-1 means don't tr... | [
"generate",
"a",
"String",
"of",
"UTF",
"-",
"8",
"characters",
"(",
"or",
"hex",
"-",
"digits",
"if",
"byteStream",
"isn",
"t",
"UTF",
"-",
"8",
"chars",
")",
"from",
"byteStream",
"truncating",
"to",
"maxLen",
"(",
"with",
"...",
"added",
"if",
"the"... | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/util/StreamUtil.java#L130-L145 |
OpenLiberty/open-liberty | dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/VirtualHostMapper.java | VirtualHostMapper.addMapping | public void addMapping(String path, Object target) {
"""
method addMapping()
This method is wildcard aware. It searches for wildcard characters {*}
and normalizes the string so that it forms a valid regular expression
@param path
@param target
"""
vHostTable.put(normalize(path), target);
} | java | public void addMapping(String path, Object target) {
vHostTable.put(normalize(path), target);
} | [
"public",
"void",
"addMapping",
"(",
"String",
"path",
",",
"Object",
"target",
")",
"{",
"vHostTable",
".",
"put",
"(",
"normalize",
"(",
"path",
")",
",",
"target",
")",
";",
"}"
] | method addMapping()
This method is wildcard aware. It searches for wildcard characters {*}
and normalizes the string so that it forms a valid regular expression
@param path
@param target | [
"method",
"addMapping",
"()"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/VirtualHostMapper.java#L49-L51 |
arnaudroger/SimpleFlatMapper | sfm-map/src/main/java/org/simpleflatmapper/map/mapper/MapperBuilder.java | MapperBuilder.addMapping | public final B addMapping(String column, int index, final Object... properties) {
"""
add a new mapping to the specified property with the specified index, specified property definition and an undefined type.
@param column the property name
@param index the property index
@param propertie... | java | public final B addMapping(String column, int index, final Object... properties) {
return addMapping(key(column, index), properties);
} | [
"public",
"final",
"B",
"addMapping",
"(",
"String",
"column",
",",
"int",
"index",
",",
"final",
"Object",
"...",
"properties",
")",
"{",
"return",
"addMapping",
"(",
"key",
"(",
"column",
",",
"index",
")",
",",
"properties",
")",
";",
"}"
] | add a new mapping to the specified property with the specified index, specified property definition and an undefined type.
@param column the property name
@param index the property index
@param properties the property properties
@return the current builder | [
"add",
"a",
"new",
"mapping",
"to",
"the",
"specified",
"property",
"with",
"the",
"specified",
"index",
"specified",
"property",
"definition",
"and",
"an",
"undefined",
"type",
"."
] | train | https://github.com/arnaudroger/SimpleFlatMapper/blob/93435438c18f26c87963d5e0f3ebf0f264dcd8c2/sfm-map/src/main/java/org/simpleflatmapper/map/mapper/MapperBuilder.java#L123-L125 |
jenkinsci/jenkins | core/src/main/java/hudson/model/Executor.java | Executor.recordCauseOfInterruption | public void recordCauseOfInterruption(Run<?,?> build, TaskListener listener) {
"""
report cause of interruption and record it to the build, if available.
@since 1.425
"""
List<CauseOfInterruption> r;
// atomically get&clear causes.
lock.writeLock().lock();
try {
... | java | public void recordCauseOfInterruption(Run<?,?> build, TaskListener listener) {
List<CauseOfInterruption> r;
// atomically get&clear causes.
lock.writeLock().lock();
try {
if (causes.isEmpty()) return;
r = new ArrayList<>(causes);
causes.clear();
... | [
"public",
"void",
"recordCauseOfInterruption",
"(",
"Run",
"<",
"?",
",",
"?",
">",
"build",
",",
"TaskListener",
"listener",
")",
"{",
"List",
"<",
"CauseOfInterruption",
">",
"r",
";",
"// atomically get&clear causes.",
"lock",
".",
"writeLock",
"(",
")",
".... | report cause of interruption and record it to the build, if available.
@since 1.425 | [
"report",
"cause",
"of",
"interruption",
"and",
"record",
"it",
"to",
"the",
"build",
"if",
"available",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Executor.java#L267-L283 |
phax/ph-css | ph-css/src/main/java/com/helger/css/handler/CSSHandler.java | CSSHandler.readDeclarationListFromNode | @Nonnull
public static CSSDeclarationList readDeclarationListFromNode (@Nonnull final ECSSVersion eVersion,
@Nonnull final CSSNode aNode,
@Nonnull final ICSSInterpretErrorHandler aErrorHandl... | java | @Nonnull
public static CSSDeclarationList readDeclarationListFromNode (@Nonnull final ECSSVersion eVersion,
@Nonnull final CSSNode aNode,
@Nonnull final ICSSInterpretErrorHandler aErrorHandl... | [
"@",
"Nonnull",
"public",
"static",
"CSSDeclarationList",
"readDeclarationListFromNode",
"(",
"@",
"Nonnull",
"final",
"ECSSVersion",
"eVersion",
",",
"@",
"Nonnull",
"final",
"CSSNode",
"aNode",
",",
"@",
"Nonnull",
"final",
"ICSSInterpretErrorHandler",
"aErrorHandler"... | Create a {@link CSSDeclarationList} object from a parsed object.
@param eVersion
The CSS version to use. May not be <code>null</code>.
@param aNode
The parsed CSS object to read. May not be <code>null</code>.
@param aErrorHandler
The error handler to be used. May not be <code>null</code>.
@return Never <code>null</cod... | [
"Create",
"a",
"{",
"@link",
"CSSDeclarationList",
"}",
"object",
"from",
"a",
"parsed",
"object",
"."
] | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/handler/CSSHandler.java#L118-L130 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java | AmazonSQSMessagingClientWrapper.sendMessage | public SendMessageResult sendMessage(SendMessageRequest sendMessageRequest) throws JMSException {
"""
Calls <code>sendMessage</code> and wraps
<code>AmazonClientException</code>.
@param sendMessageRequest
Container for the necessary parameters to execute the
sendMessage service method on AmazonSQS.
@return ... | java | public SendMessageResult sendMessage(SendMessageRequest sendMessageRequest) throws JMSException {
try {
prepareRequest(sendMessageRequest);
return amazonSQSClient.sendMessage(sendMessageRequest);
} catch (AmazonClientException e) {
throw handleException(e, "sendMessag... | [
"public",
"SendMessageResult",
"sendMessage",
"(",
"SendMessageRequest",
"sendMessageRequest",
")",
"throws",
"JMSException",
"{",
"try",
"{",
"prepareRequest",
"(",
"sendMessageRequest",
")",
";",
"return",
"amazonSQSClient",
".",
"sendMessage",
"(",
"sendMessageRequest"... | Calls <code>sendMessage</code> and wraps
<code>AmazonClientException</code>.
@param sendMessageRequest
Container for the necessary parameters to execute the
sendMessage service method on AmazonSQS.
@return The response from the sendMessage service method, as returned by
AmazonSQS
@throws JMSException | [
"Calls",
"<code",
">",
"sendMessage<",
"/",
"code",
">",
"and",
"wraps",
"<code",
">",
"AmazonClientException<",
"/",
"code",
">",
"."
] | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java#L199-L206 |
iipc/openwayback-access-control | oracle/src/main/java/org/archive/accesscontrol/model/HibernateRuleDao.java | HibernateRuleDao.saveRule | public void saveRule(Rule rule, RuleChange change) {
"""
Save a rule and a change log entry in one go. (Uses a transaction).
@param rule
@param change
"""
rule.setLastModified(new Date());
Session session1 = getHibernateTemplate().getSessionFactory().openSession();
Transaction tx = ... | java | public void saveRule(Rule rule, RuleChange change) {
rule.setLastModified(new Date());
Session session1 = getHibernateTemplate().getSessionFactory().openSession();
Transaction tx = session1.beginTransaction();
session1.saveOrUpdate(rule);
session1.save(change);
tx.commi... | [
"public",
"void",
"saveRule",
"(",
"Rule",
"rule",
",",
"RuleChange",
"change",
")",
"{",
"rule",
".",
"setLastModified",
"(",
"new",
"Date",
"(",
")",
")",
";",
"Session",
"session1",
"=",
"getHibernateTemplate",
"(",
")",
".",
"getSessionFactory",
"(",
"... | Save a rule and a change log entry in one go. (Uses a transaction).
@param rule
@param change | [
"Save",
"a",
"rule",
"and",
"a",
"change",
"log",
"entry",
"in",
"one",
"go",
".",
"(",
"Uses",
"a",
"transaction",
")",
"."
] | train | https://github.com/iipc/openwayback-access-control/blob/4a0f70f200fd8d7b6e313624b7628656d834bf31/oracle/src/main/java/org/archive/accesscontrol/model/HibernateRuleDao.java#L133-L141 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/helpers/DateHelper.java | DateHelper.getCurrentUTC | public static String getCurrentUTC() {
"""
Gets the current UTC date and time in 'yyyy-MM-dd'T'HH:mm:ss.SSS'Z'' format.
@return Current UTC date and time.
"""
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ENGLISH);
sdf.setTimeZone(TimeZone.getTimeZone("UT... | java | public static String getCurrentUTC() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ENGLISH);
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
return sdf.format(Calendar.getInstance().getTime());
} | [
"public",
"static",
"String",
"getCurrentUTC",
"(",
")",
"{",
"SimpleDateFormat",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\"",
",",
"Locale",
".",
"ENGLISH",
")",
";",
"sdf",
".",
"setTimeZone",
"(",
"TimeZone",
".",
"getTimeZone... | Gets the current UTC date and time in 'yyyy-MM-dd'T'HH:mm:ss.SSS'Z'' format.
@return Current UTC date and time. | [
"Gets",
"the",
"current",
"UTC",
"date",
"and",
"time",
"in",
"yyyy",
"-",
"MM",
"-",
"dd",
"T",
"HH",
":",
"mm",
":",
"ss",
".",
"SSS",
"Z",
"format",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/helpers/DateHelper.java#L47-L51 |
alkacon/opencms-core | src/org/opencms/util/CmsStringUtil.java | CmsStringUtil.checkName | public static void checkName(String name, String constraints, String key, I_CmsMessageBundle bundle)
throws CmsIllegalArgumentException {
"""
Checks if a given name is composed only of the characters <code>a...z,A...Z,0...9</code>
and the provided <code>constraints</code>.<p>
If the check fails, an Excepti... | java | public static void checkName(String name, String constraints, String key, I_CmsMessageBundle bundle)
throws CmsIllegalArgumentException {
int l = name.length();
for (int i = 0; i < l; i++) {
char c = name.charAt(i);
if (((c < 'a') || (c > 'z'))
&& ((c < '0') ... | [
"public",
"static",
"void",
"checkName",
"(",
"String",
"name",
",",
"String",
"constraints",
",",
"String",
"key",
",",
"I_CmsMessageBundle",
"bundle",
")",
"throws",
"CmsIllegalArgumentException",
"{",
"int",
"l",
"=",
"name",
".",
"length",
"(",
")",
";",
... | Checks if a given name is composed only of the characters <code>a...z,A...Z,0...9</code>
and the provided <code>constraints</code>.<p>
If the check fails, an Exception is generated. The provided bundle and key is
used to generate the Exception. 4 parameters are passed to the Exception:<ol>
<li>The <code>name</code>
<l... | [
"Checks",
"if",
"a",
"given",
"name",
"is",
"composed",
"only",
"of",
"the",
"characters",
"<code",
">",
"a",
"...",
"z",
"A",
"...",
"Z",
"0",
"...",
"9<",
"/",
"code",
">",
"and",
"the",
"provided",
"<code",
">",
"constraints<",
"/",
"code",
">",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsStringUtil.java#L278-L293 |
gallandarakhneorg/afc | core/text/src/main/java/org/arakhne/afc/text/TextUtil.java | TextUtil.splitBracketsAsUUIDs | @Pure
@Inline(value = "textUtil.splitAsUUIDs(' {
"""
Split the given string according to brackets.
The brackets are used to delimit the groups
of characters.
<p>Examples:
<ul>
<li><code>splitBrackets("{a}{b}{cd}")</code> returns the array
<code>["a","b","cd"]</code></li>
<li><code>splitBrackets("abcd")</... | java | @Pure
@Inline(value = "textUtil.splitAsUUIDs('{', '}', $1)", imported = {TextUtil.class})
public static List<UUID> splitBracketsAsUUIDs(String str) {
return splitAsUUIDs('{', '}', str);
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"textUtil.splitAsUUIDs('{', '}', $1)\"",
",",
"imported",
"=",
"{",
"TextUtil",
".",
"class",
"}",
")",
"public",
"static",
"List",
"<",
"UUID",
">",
"splitBracketsAsUUIDs",
"(",
"String",
"str",
")",
"{",
"re... | Split the given string according to brackets.
The brackets are used to delimit the groups
of characters.
<p>Examples:
<ul>
<li><code>splitBrackets("{a}{b}{cd}")</code> returns the array
<code>["a","b","cd"]</code></li>
<li><code>splitBrackets("abcd")</code> returns the array
<code>["abcd"]</code></li>
<li><code>splitB... | [
"Split",
"the",
"given",
"string",
"according",
"to",
"brackets",
".",
"The",
"brackets",
"are",
"used",
"to",
"delimit",
"the",
"groups",
"of",
"characters",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/text/src/main/java/org/arakhne/afc/text/TextUtil.java#L793-L797 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java | CPDefinitionOptionValueRelPersistenceImpl.findByGroupId | @Override
public List<CPDefinitionOptionValueRel> findByGroupId(long groupId) {
"""
Returns all the cp definition option value rels where groupId = ?.
@param groupId the group ID
@return the matching cp definition option value rels
"""
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_P... | java | @Override
public List<CPDefinitionOptionValueRel> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionOptionValueRel",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
... | Returns all the cp definition option value rels where groupId = ?.
@param groupId the group ID
@return the matching cp definition option value rels | [
"Returns",
"all",
"the",
"cp",
"definition",
"option",
"value",
"rels",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java#L1537-L1540 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AccessAuditContext.java | AccessAuditContext.doAs | public static <T> T doAs(SecurityIdentity securityIdentity, InetAddress remoteAddress, PrivilegedExceptionAction<T> action)
throws java.security.PrivilegedActionException {
"""
Perform work with a new {@code AccessAuditContext} as a particular {@code SecurityIdentity}
@param securityIdentity the {@cod... | java | public static <T> T doAs(SecurityIdentity securityIdentity, InetAddress remoteAddress, PrivilegedExceptionAction<T> action)
throws java.security.PrivilegedActionException {
return doAs(false, securityIdentity, remoteAddress, action);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"doAs",
"(",
"SecurityIdentity",
"securityIdentity",
",",
"InetAddress",
"remoteAddress",
",",
"PrivilegedExceptionAction",
"<",
"T",
">",
"action",
")",
"throws",
"java",
".",
"security",
".",
"PrivilegedActionException",
"... | Perform work with a new {@code AccessAuditContext} as a particular {@code SecurityIdentity}
@param securityIdentity the {@code SecurityIdentity} that the specified {@code action} will run as. May be {@code null}
@param remoteAddress the remote address of the caller.
@param action the work to perform. Cannot be {@code n... | [
"Perform",
"work",
"with",
"a",
"new",
"{",
"@code",
"AccessAuditContext",
"}",
"as",
"a",
"particular",
"{",
"@code",
"SecurityIdentity",
"}",
"@param",
"securityIdentity",
"the",
"{",
"@code",
"SecurityIdentity",
"}",
"that",
"the",
"specified",
"{",
"@code",
... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AccessAuditContext.java#L223-L226 |
OpenTSDB/opentsdb | src/tsd/HttpJsonSerializer.java | HttpJsonSerializer.parseTSMetaV1 | public TSMeta parseTSMetaV1() {
"""
Parses a single TSMeta object
@throws JSONException if parsing failed
@throws BadRequestException if the content was missing or parsing failed
"""
final String json = query.getContent();
if (json == null || json.isEmpty()) {
throw new BadRequestException(Http... | java | public TSMeta parseTSMetaV1() {
final String json = query.getContent();
if (json == null || json.isEmpty()) {
throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
"Missing message content",
"Supply valid JSON formatted data in the body of your request");
}
try {
... | [
"public",
"TSMeta",
"parseTSMetaV1",
"(",
")",
"{",
"final",
"String",
"json",
"=",
"query",
".",
"getContent",
"(",
")",
";",
"if",
"(",
"json",
"==",
"null",
"||",
"json",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"BadRequestException",
"("... | Parses a single TSMeta object
@throws JSONException if parsing failed
@throws BadRequestException if the content was missing or parsing failed | [
"Parses",
"a",
"single",
"TSMeta",
"object"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L327-L339 |
Devskiller/jfairy | src/main/java/com/devskiller/jfairy/producer/BaseProducer.java | BaseProducer.randomElements | public <T> List<T> randomElements(List<T> elements, int count) {
"""
Creates new list being random subset of the passed list
@param <T> element generic type
@param elements list to process
@param count returned list size
@return sublist of the elements list
"""
if (elements.size() >= count) {
... | java | public <T> List<T> randomElements(List<T> elements, int count) {
if (elements.size() >= count) {
return extractRandomList(elements, count);
} else {
List<T> randomElements = new ArrayList<T>();
randomElements.addAll(extractRandomList(elements, count % elements.size()));
do {
randomElements.addAll(ex... | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"randomElements",
"(",
"List",
"<",
"T",
">",
"elements",
",",
"int",
"count",
")",
"{",
"if",
"(",
"elements",
".",
"size",
"(",
")",
">=",
"count",
")",
"{",
"return",
"extractRandomList",
"(",
"ele... | Creates new list being random subset of the passed list
@param <T> element generic type
@param elements list to process
@param count returned list size
@return sublist of the elements list | [
"Creates",
"new",
"list",
"being",
"random",
"subset",
"of",
"the",
"passed",
"list"
] | train | https://github.com/Devskiller/jfairy/blob/126d1c8b1545f725afd10f969b9d27005ac520b7/src/main/java/com/devskiller/jfairy/producer/BaseProducer.java#L68-L79 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/installation/InstallationManagerImpl.java | InstallationManagerImpl.getInstalledIdentities | @Override
public List<InstalledIdentity> getInstalledIdentities() throws PatchingException {
"""
This method will return a list of installed identities for which
the corresponding .conf file exists under .installation directory.
The list will also include the default identity even if the .conf
file has not ... | java | @Override
public List<InstalledIdentity> getInstalledIdentities() throws PatchingException {
List<InstalledIdentity> installedIdentities;
final File metadataDir = installedImage.getInstallationMetadata();
if(!metadataDir.exists()) {
installedIdentities = Collections.singletonLi... | [
"@",
"Override",
"public",
"List",
"<",
"InstalledIdentity",
">",
"getInstalledIdentities",
"(",
")",
"throws",
"PatchingException",
"{",
"List",
"<",
"InstalledIdentity",
">",
"installedIdentities",
";",
"final",
"File",
"metadataDir",
"=",
"installedImage",
".",
"... | This method will return a list of installed identities for which
the corresponding .conf file exists under .installation directory.
The list will also include the default identity even if the .conf
file has not been created for it. | [
"This",
"method",
"will",
"return",
"a",
"list",
"of",
"installed",
"identities",
"for",
"which",
"the",
"corresponding",
".",
"conf",
"file",
"exists",
"under",
".",
"installation",
"directory",
".",
"The",
"list",
"will",
"also",
"include",
"the",
"default",... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/installation/InstallationManagerImpl.java#L148-L188 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java | ProfilePackageFrameWriter.addClassListing | protected void addClassListing(Content contentTree, int profileValue) {
"""
Add class listing for all the classes in this package. Divide class
listing as per the class kind and generate separate listing for
Classes, Interfaces, Exceptions and Errors.
@param contentTree the content tree to which the listing w... | java | protected void addClassListing(Content contentTree, int profileValue) {
if (packageDoc.isIncluded()) {
addClassKindListing(packageDoc.interfaces(),
getResource("doclet.Interfaces"), contentTree, profileValue);
addClassKindListing(packageDoc.ordinaryClasses(),
... | [
"protected",
"void",
"addClassListing",
"(",
"Content",
"contentTree",
",",
"int",
"profileValue",
")",
"{",
"if",
"(",
"packageDoc",
".",
"isIncluded",
"(",
")",
")",
"{",
"addClassKindListing",
"(",
"packageDoc",
".",
"interfaces",
"(",
")",
",",
"getResourc... | Add class listing for all the classes in this package. Divide class
listing as per the class kind and generate separate listing for
Classes, Interfaces, Exceptions and Errors.
@param contentTree the content tree to which the listing will be added
@param profileValue the value of the profile being documented | [
"Add",
"class",
"listing",
"for",
"all",
"the",
"classes",
"in",
"this",
"package",
".",
"Divide",
"class",
"listing",
"as",
"per",
"the",
"class",
"kind",
"and",
"generate",
"separate",
"listing",
"for",
"Classes",
"Interfaces",
"Exceptions",
"and",
"Errors",... | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java#L130-L145 |
igniterealtime/jbosh | src/main/java/org/igniterealtime/jbosh/BOSHClient.java | BOSHClient.applySessionCreationRequest | private ComposableBody applySessionCreationRequest(
final long rid, final ComposableBody orig) throws BOSHException {
"""
Modifies the specified body message such that it becomes a new
BOSH session creation request.
@param rid request ID to use
@param orig original body to modify
@return modified... | java | private ComposableBody applySessionCreationRequest(
final long rid, final ComposableBody orig) throws BOSHException {
assertLocked();
Builder builder = orig.rebuild();
builder.setAttribute(Attributes.TO, cfg.getTo());
builder.setAttribute(Attributes.XML_LANG, cfg.get... | [
"private",
"ComposableBody",
"applySessionCreationRequest",
"(",
"final",
"long",
"rid",
",",
"final",
"ComposableBody",
"orig",
")",
"throws",
"BOSHException",
"{",
"assertLocked",
"(",
")",
";",
"Builder",
"builder",
"=",
"orig",
".",
"rebuild",
"(",
")",
";",... | Modifies the specified body message such that it becomes a new
BOSH session creation request.
@param rid request ID to use
@param orig original body to modify
@return modified message which acts as a session creation request | [
"Modifies",
"the",
"specified",
"body",
"message",
"such",
"that",
"it",
"becomes",
"a",
"new",
"BOSH",
"session",
"creation",
"request",
"."
] | train | https://github.com/igniterealtime/jbosh/blob/b43378f27e19b753b552b1e9666abc0476cdceff/src/main/java/org/igniterealtime/jbosh/BOSHClient.java#L844-L872 |
Talend/tesb-rt-se | locator-service/locator-rest-service/src/main/java/org/talend/esb/locator/service/rest/LocatorRestServiceImpl.java | LocatorRestServiceImpl.buildEndpoint | private W3CEndpointReference buildEndpoint(QName serviceName, String adress) {
"""
Build Endpoint Reference for giving service name and address
@param serviceName
@param adress
@return
"""
W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
// builder.serviceName(servi... | java | private W3CEndpointReference buildEndpoint(QName serviceName, String adress) {
W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
// builder.serviceName(serviceName);
builder.address(adress);
SLEndpoint endpoint = null;
try {
endpoint = locatorCl... | [
"private",
"W3CEndpointReference",
"buildEndpoint",
"(",
"QName",
"serviceName",
",",
"String",
"adress",
")",
"{",
"W3CEndpointReferenceBuilder",
"builder",
"=",
"new",
"W3CEndpointReferenceBuilder",
"(",
")",
";",
"// builder.serviceName(serviceName);",
"builder",
".",
... | Build Endpoint Reference for giving service name and address
@param serviceName
@param adress
@return | [
"Build",
"Endpoint",
"Reference",
"for",
"giving",
"service",
"name",
"and",
"address"
] | train | https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/locator-service/locator-rest-service/src/main/java/org/talend/esb/locator/service/rest/LocatorRestServiceImpl.java#L460-L489 |
gwtbootstrap3/gwtbootstrap3-extras | src/main/java/org/gwtbootstrap3/extras/typeahead/client/ui/Typeahead.java | Typeahead.onAutoCompleted | private void onAutoCompleted(final Event event, final Suggestion<T> suggestion) {
"""
Triggered when the query is autocompleted. Autocompleted means the query was changed to the hint.
@param event the event
@param suggestion the suggestion object
"""
TypeaheadAutoCompletedEvent.fire(this, suggesti... | java | private void onAutoCompleted(final Event event, final Suggestion<T> suggestion) {
TypeaheadAutoCompletedEvent.fire(this, suggestion, event);
} | [
"private",
"void",
"onAutoCompleted",
"(",
"final",
"Event",
"event",
",",
"final",
"Suggestion",
"<",
"T",
">",
"suggestion",
")",
"{",
"TypeaheadAutoCompletedEvent",
".",
"fire",
"(",
"this",
",",
"suggestion",
",",
"event",
")",
";",
"}"
] | Triggered when the query is autocompleted. Autocompleted means the query was changed to the hint.
@param event the event
@param suggestion the suggestion object | [
"Triggered",
"when",
"the",
"query",
"is",
"autocompleted",
".",
"Autocompleted",
"means",
"the",
"query",
"was",
"changed",
"to",
"the",
"hint",
"."
] | train | https://github.com/gwtbootstrap3/gwtbootstrap3-extras/blob/8e42aaffd2a082e9cb23a14c37a3c87b7cbdfa94/src/main/java/org/gwtbootstrap3/extras/typeahead/client/ui/Typeahead.java#L190-L192 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/mock/CommonsMock.java | Param.createConstant | @Nonnull
public static <T> Param createConstant (@Nonnull @Nonempty final String sParamName,
@Nonnull final Class <T> aParamClass,
@Nullable final T aDefault) {
"""
Create a {@link Param} with a constant default value.
@... | java | @Nonnull
public static <T> Param createConstant (@Nonnull @Nonempty final String sParamName,
@Nonnull final Class <T> aParamClass,
@Nullable final T aDefault)
{
return new Param (sParamName, aParamClass, () -> aDefault... | [
"@",
"Nonnull",
"public",
"static",
"<",
"T",
">",
"Param",
"createConstant",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sParamName",
",",
"@",
"Nonnull",
"final",
"Class",
"<",
"T",
">",
"aParamClass",
",",
"@",
"Nullable",
"final",
"T",
... | Create a {@link Param} with a constant default value.
@param sParamName
Parameter name. May neither be <code>null</code> nor empty.
@param aParamClass
The parameter class. May not be <code>null</code>.
@param aDefault
The constant default value to be used. May be <code>null</code>.
@return The {@link Param} object and... | [
"Create",
"a",
"{",
"@link",
"Param",
"}",
"with",
"a",
"constant",
"default",
"value",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mock/CommonsMock.java#L143-L149 |
lucee/Lucee | core/src/main/java/lucee/commons/io/res/type/cache/CacheResourceProvider.java | CacheResourceProvider.getCore | CacheResourceCore getCore(String path, String name) {
"""
returns core for this path if exists, otherwise return null
@param path
@return core or null
"""
Object obj = getCache().getValue(toKey(path, name), null);
if (obj instanceof CacheResourceCore) return (CacheResourceCore) obj;
return null;
} | java | CacheResourceCore getCore(String path, String name) {
Object obj = getCache().getValue(toKey(path, name), null);
if (obj instanceof CacheResourceCore) return (CacheResourceCore) obj;
return null;
} | [
"CacheResourceCore",
"getCore",
"(",
"String",
"path",
",",
"String",
"name",
")",
"{",
"Object",
"obj",
"=",
"getCache",
"(",
")",
".",
"getValue",
"(",
"toKey",
"(",
"path",
",",
"name",
")",
",",
"null",
")",
";",
"if",
"(",
"obj",
"instanceof",
"... | returns core for this path if exists, otherwise return null
@param path
@return core or null | [
"returns",
"core",
"for",
"this",
"path",
"if",
"exists",
"otherwise",
"return",
"null"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/type/cache/CacheResourceProvider.java#L107-L111 |
belaban/JGroups | src/org/jgroups/blocks/ReplicatedHashMap.java | ReplicatedHashMap.putAll | public void putAll(Map<? extends K,? extends V> m) {
"""
Copies all of the mappings from the specified map to this one. These
mappings replace any mappings that this map had for any of the keys
currently in the specified map.
@param m
mappings to be stored in this map
"""
try {
Method... | java | public void putAll(Map<? extends K,? extends V> m) {
try {
MethodCall call=new MethodCall(PUT_ALL, m);
disp.callRemoteMethods(null, call, call_options);
}
catch(Throwable t) {
throw new RuntimeException("putAll() failed", t);
}
} | [
"public",
"void",
"putAll",
"(",
"Map",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"m",
")",
"{",
"try",
"{",
"MethodCall",
"call",
"=",
"new",
"MethodCall",
"(",
"PUT_ALL",
",",
"m",
")",
";",
"disp",
".",
"callRemoteMethods",
"(",
"... | Copies all of the mappings from the specified map to this one. These
mappings replace any mappings that this map had for any of the keys
currently in the specified map.
@param m
mappings to be stored in this map | [
"Copies",
"all",
"of",
"the",
"mappings",
"from",
"the",
"specified",
"map",
"to",
"this",
"one",
".",
"These",
"mappings",
"replace",
"any",
"mappings",
"that",
"this",
"map",
"had",
"for",
"any",
"of",
"the",
"keys",
"currently",
"in",
"the",
"specified"... | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/blocks/ReplicatedHashMap.java#L255-L263 |
michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java | AbstractColorPickerPreference.formatColor | private CharSequence formatColor(final ColorFormat colorFormat, @ColorInt final int color) {
"""
Creates and returns a textual representation of a color, according to a specific format.
@param colorFormat
The format, which should be used to format the color, as a value of the enum {@link
ColorFormat}. The for... | java | private CharSequence formatColor(final ColorFormat colorFormat, @ColorInt final int color) {
Condition.INSTANCE.ensureNotNull(colorFormat, "The color format may not be null");
if (colorFormat == ColorFormat.RGB) {
return String.format(Locale.getDefault(), "R = %d, G = %d, B = %d", Color.red... | [
"private",
"CharSequence",
"formatColor",
"(",
"final",
"ColorFormat",
"colorFormat",
",",
"@",
"ColorInt",
"final",
"int",
"color",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"colorFormat",
",",
"\"The color format may not be null\"",
")",
"... | Creates and returns a textual representation of a color, according to a specific format.
@param colorFormat
The format, which should be used to format the color, as a value of the enum {@link
ColorFormat}. The format may not be null
@param color
The color, which should be formatted, as an {@link Integer} value
@return... | [
"Creates",
"and",
"returns",
"a",
"textual",
"representation",
"of",
"a",
"color",
"according",
"to",
"a",
"specific",
"format",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L481-L495 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java | JdbcCpoXaAdapter.retrieveBean | @Override
public <T> T retrieveBean(String name, T bean) throws CpoException {
"""
Retrieves the bean from the datasource. The assumption is that the bean exists in the datasource. If the retrieve
function defined for this beans returns more than one row, an exception will be thrown.
@param name DOCUMENT ME!... | java | @Override
public <T> T retrieveBean(String name, T bean) throws CpoException {
return getCurrentResource().retrieveBean(name, bean);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"retrieveBean",
"(",
"String",
"name",
",",
"T",
"bean",
")",
"throws",
"CpoException",
"{",
"return",
"getCurrentResource",
"(",
")",
".",
"retrieveBean",
"(",
"name",
",",
"bean",
")",
";",
"}"
] | Retrieves the bean from the datasource. The assumption is that the bean exists in the datasource. If the retrieve
function defined for this beans returns more than one row, an exception will be thrown.
@param name DOCUMENT ME!
@param bean This is an bean that has been defined within the metadata of the datasource. If ... | [
"Retrieves",
"the",
"bean",
"from",
"the",
"datasource",
".",
"The",
"assumption",
"is",
"that",
"the",
"bean",
"exists",
"in",
"the",
"datasource",
".",
"If",
"the",
"retrieve",
"function",
"defined",
"for",
"this",
"beans",
"returns",
"more",
"than",
"one"... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java#L1290-L1293 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/spring/boot/AbstractCasBanner.java | AbstractCasBanner.collectEnvironmentInfo | private String collectEnvironmentInfo(final Environment environment, final Class<?> sourceClass) {
"""
Collect environment info with
details on the java and os deployment
versions.
@param environment the environment
@param sourceClass the source class
@return environment info
"""
val properties ... | java | private String collectEnvironmentInfo(final Environment environment, final Class<?> sourceClass) {
val properties = System.getProperties();
if (properties.containsKey("CAS_BANNER_SKIP")) {
try (val formatter = new Formatter()) {
formatter.format("CAS Version: %s%n", CasVersio... | [
"private",
"String",
"collectEnvironmentInfo",
"(",
"final",
"Environment",
"environment",
",",
"final",
"Class",
"<",
"?",
">",
"sourceClass",
")",
"{",
"val",
"properties",
"=",
"System",
".",
"getProperties",
"(",
")",
";",
"if",
"(",
"properties",
".",
"... | Collect environment info with
details on the java and os deployment
versions.
@param environment the environment
@param sourceClass the source class
@return environment info | [
"Collect",
"environment",
"info",
"with",
"details",
"on",
"the",
"java",
"and",
"os",
"deployment",
"versions",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/spring/boot/AbstractCasBanner.java#L51-L73 |
ops4j/org.ops4j.pax.logging | pax-logging-log4j2/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java | ThrowableProxy.getExtendedStackTraceAsString | public String getExtendedStackTraceAsString(final List<String> ignorePackages, final String suffix) {
"""
Format the stack trace including packaging information.
@param ignorePackages List of packages to be ignored in the trace.
@param suffix
@return The formatted stack trace including packaging information.
... | java | public String getExtendedStackTraceAsString(final List<String> ignorePackages, final String suffix) {
return getExtendedStackTraceAsString(ignorePackages, PlainTextRenderer.getInstance(), suffix);
} | [
"public",
"String",
"getExtendedStackTraceAsString",
"(",
"final",
"List",
"<",
"String",
">",
"ignorePackages",
",",
"final",
"String",
"suffix",
")",
"{",
"return",
"getExtendedStackTraceAsString",
"(",
"ignorePackages",
",",
"PlainTextRenderer",
".",
"getInstance",
... | Format the stack trace including packaging information.
@param ignorePackages List of packages to be ignored in the trace.
@param suffix
@return The formatted stack trace including packaging information. | [
"Format",
"the",
"stack",
"trace",
"including",
"packaging",
"information",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-log4j2/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java#L473-L475 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection/src/com/ibm/ws/injectionengine/osgi/internal/IndirectJndiLookupObjectFactory.java | IndirectJndiLookupObjectFactory.resolveJNDIObject | @FFDCIgnore(NamingException.class)
private Object resolveJNDIObject(Object o, ServiceReference<?> ref, String[] objectClass, String bindingName, Hashtable<?, ?> envmt) throws Exception {
"""
Try to resolve an object obtained from the OSGi service registry similar
to how /com.ibm.ws.jndi/ implements the defaul... | java | @FFDCIgnore(NamingException.class)
private Object resolveJNDIObject(Object o, ServiceReference<?> ref, String[] objectClass, String bindingName, Hashtable<?, ?> envmt) throws Exception {
if ("jndi".equals(ref.getProperty("osgi.jndi.service.origin")) || contains(objectClass, Reference.class.getName())) {
... | [
"@",
"FFDCIgnore",
"(",
"NamingException",
".",
"class",
")",
"private",
"Object",
"resolveJNDIObject",
"(",
"Object",
"o",
",",
"ServiceReference",
"<",
"?",
">",
"ref",
",",
"String",
"[",
"]",
"objectClass",
",",
"String",
"bindingName",
",",
"Hashtable",
... | Try to resolve an object obtained from the OSGi service registry similar
to how /com.ibm.ws.jndi/ implements the default namespace.
@return the object instance, or null if an object could not be found | [
"Try",
"to",
"resolve",
"an",
"object",
"obtained",
"from",
"the",
"OSGi",
"service",
"registry",
"similar",
"to",
"how",
"/",
"com",
".",
"ibm",
".",
"ws",
".",
"jndi",
"/",
"implements",
"the",
"default",
"namespace",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection/src/com/ibm/ws/injectionengine/osgi/internal/IndirectJndiLookupObjectFactory.java#L306-L325 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java | JobOperations.disableJob | public void disableJob(String jobId, DisableJobOption disableJobOption) throws BatchErrorException, IOException {
"""
Disables the specified job. Disabled jobs do not run new tasks, but may be re-enabled later.
@param jobId The ID of the job.
@param disableJobOption Specifies what to do with running tasks asso... | java | public void disableJob(String jobId, DisableJobOption disableJobOption) throws BatchErrorException, IOException {
disableJob(jobId, disableJobOption, null);
} | [
"public",
"void",
"disableJob",
"(",
"String",
"jobId",
",",
"DisableJobOption",
"disableJobOption",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"disableJob",
"(",
"jobId",
",",
"disableJobOption",
",",
"null",
")",
";",
"}"
] | Disables the specified job. Disabled jobs do not run new tasks, but may be re-enabled later.
@param jobId The ID of the job.
@param disableJobOption Specifies what to do with running tasks associated with the job.
@throws BatchErrorException Exception thrown when an error response is received from the Batch service.
@... | [
"Disables",
"the",
"specified",
"job",
".",
"Disabled",
"jobs",
"do",
"not",
"run",
"new",
"tasks",
"but",
"may",
"be",
"re",
"-",
"enabled",
"later",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java#L426-L428 |
TestFX/Monocle | src/main/java/com/sun/glass/ui/monocle/TouchInput.java | TouchInput.postTouchEvent | private void postTouchEvent(TouchState state, int eventType) {
"""
Sends the same event type for all points in the given state
@param state The state for which to process all points
@param eventType The type of TouchEvent to send (e.g. TouchEvent.PRESSED)
"""
Window window = state.getWindow(false, ... | java | private void postTouchEvent(TouchState state, int eventType) {
Window window = state.getWindow(false, null);
View view = window == null ? null : window.getView();
if (view != null) {
switch (state.getPointCount()) {
case 0:
postNoPoints(view);
... | [
"private",
"void",
"postTouchEvent",
"(",
"TouchState",
"state",
",",
"int",
"eventType",
")",
"{",
"Window",
"window",
"=",
"state",
".",
"getWindow",
"(",
"false",
",",
"null",
")",
";",
"View",
"view",
"=",
"window",
"==",
"null",
"?",
"null",
":",
... | Sends the same event type for all points in the given state
@param state The state for which to process all points
@param eventType The type of TouchEvent to send (e.g. TouchEvent.PRESSED) | [
"Sends",
"the",
"same",
"event",
"type",
"for",
"all",
"points",
"in",
"the",
"given",
"state"
] | train | https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/TouchInput.java#L172-L200 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentItemPersistenceImpl.java | CommerceShipmentItemPersistenceImpl.findByCommerceShipment | @Override
public List<CommerceShipmentItem> findByCommerceShipment(
long commerceShipmentId, int start, int end) {
"""
Returns a range of all the commerce shipment items where commerceShipmentId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start... | java | @Override
public List<CommerceShipmentItem> findByCommerceShipment(
long commerceShipmentId, int start, int end) {
return findByCommerceShipment(commerceShipmentId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceShipmentItem",
">",
"findByCommerceShipment",
"(",
"long",
"commerceShipmentId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCommerceShipment",
"(",
"commerceShipmentId",
",",
"start",
",",
"e... | Returns a range of all the commerce shipment items where commerceShipmentId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first re... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"shipment",
"items",
"where",
"commerceShipmentId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentItemPersistenceImpl.java#L651-L655 |
Devskiller/jfairy | src/main/java/com/devskiller/jfairy/producer/util/ZhFairyUtil.java | ZhFairyUtil.getRandomNumStr | public static String getRandomNumStr(BaseProducer baseProducer, int max, int paddingSize) {
"""
Get random number from 1 to max in 0 leading string format.
@param baseProducer BaseProducer
@param max upper bound of number
@param paddingSize padding size
@return A number smaller than #max with #paddingS... | java | public static String getRandomNumStr(BaseProducer baseProducer, int max, int paddingSize) {
int rndNum = baseProducer.randomBetween(1, max);
String numStr = "" + rndNum;
while (numStr.length() < paddingSize) {
numStr = "0" + numStr;
}
return numStr;
} | [
"public",
"static",
"String",
"getRandomNumStr",
"(",
"BaseProducer",
"baseProducer",
",",
"int",
"max",
",",
"int",
"paddingSize",
")",
"{",
"int",
"rndNum",
"=",
"baseProducer",
".",
"randomBetween",
"(",
"1",
",",
"max",
")",
";",
"String",
"numStr",
"=",... | Get random number from 1 to max in 0 leading string format.
@param baseProducer BaseProducer
@param max upper bound of number
@param paddingSize padding size
@return A number smaller than #max with #paddingSize digits in string format | [
"Get",
"random",
"number",
"from",
"1",
"to",
"max",
"in",
"0",
"leading",
"string",
"format",
"."
] | train | https://github.com/Devskiller/jfairy/blob/126d1c8b1545f725afd10f969b9d27005ac520b7/src/main/java/com/devskiller/jfairy/producer/util/ZhFairyUtil.java#L71-L78 |
jcuda/jnvgraph | JNvgraphJava/src/main/java/jcuda/jnvgraph/JNvgraph.java | JNvgraph.nvgraphAllocateVertexData | public static int nvgraphAllocateVertexData(
nvgraphHandle handle,
nvgraphGraphDescr descrG,
long numsets,
Pointer settypes) {
"""
Allocate numsets vectors of size V reprensenting Vertex Data and attached them the graph.
settypes[i] is the type of vector #i, currently all Vertex... | java | public static int nvgraphAllocateVertexData(
nvgraphHandle handle,
nvgraphGraphDescr descrG,
long numsets,
Pointer settypes)
{
return checkResult(nvgraphAllocateVertexDataNative(handle, descrG, numsets, settypes));
} | [
"public",
"static",
"int",
"nvgraphAllocateVertexData",
"(",
"nvgraphHandle",
"handle",
",",
"nvgraphGraphDescr",
"descrG",
",",
"long",
"numsets",
",",
"Pointer",
"settypes",
")",
"{",
"return",
"checkResult",
"(",
"nvgraphAllocateVertexDataNative",
"(",
"handle",
",... | Allocate numsets vectors of size V reprensenting Vertex Data and attached them the graph.
settypes[i] is the type of vector #i, currently all Vertex and Edge data should have the same type | [
"Allocate",
"numsets",
"vectors",
"of",
"size",
"V",
"reprensenting",
"Vertex",
"Data",
"and",
"attached",
"them",
"the",
"graph",
".",
"settypes",
"[",
"i",
"]",
"is",
"the",
"type",
"of",
"vector",
"#i",
"currently",
"all",
"Vertex",
"and",
"Edge",
"data... | train | https://github.com/jcuda/jnvgraph/blob/2c6bd7c58edac181753bacf30af2cceeb1989a78/JNvgraphJava/src/main/java/jcuda/jnvgraph/JNvgraph.java#L239-L246 |
real-logic/agrona | agrona/src/main/java/org/agrona/concurrent/RecordBuffer.java | RecordBuffer.withRecord | public boolean withRecord(final int key, final RecordWriter writer) {
"""
High level and safe way of writing a record to the buffer.
@param key the key to associate the record with
@param writer the callback which is passed the record to write.
@return whether the write succeeded or not.
"""
fi... | java | public boolean withRecord(final int key, final RecordWriter writer)
{
final int claimedOffset = claimRecord(key);
if (claimedOffset == DID_NOT_CLAIM_RECORD)
{
return false;
}
try
{
writer.writeRecord(claimedOffset);
}
finally
... | [
"public",
"boolean",
"withRecord",
"(",
"final",
"int",
"key",
",",
"final",
"RecordWriter",
"writer",
")",
"{",
"final",
"int",
"claimedOffset",
"=",
"claimRecord",
"(",
"key",
")",
";",
"if",
"(",
"claimedOffset",
"==",
"DID_NOT_CLAIM_RECORD",
")",
"{",
"r... | High level and safe way of writing a record to the buffer.
@param key the key to associate the record with
@param writer the callback which is passed the record to write.
@return whether the write succeeded or not. | [
"High",
"level",
"and",
"safe",
"way",
"of",
"writing",
"a",
"record",
"to",
"the",
"buffer",
"."
] | train | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/concurrent/RecordBuffer.java#L194-L212 |
hal/core | ace/src/main/java/edu/ycp/cs/dh/acegwt/client/ace/AceEditor.java | AceEditor.addAnnotation | public void addAnnotation(final int row, final int column, final String text, final AceAnnotationType type) {
"""
Add an annotation to a the local <code>annotations</code> JsArray<AceAnnotation>, but does not set it on the editor
@param row to which the annotation should be added
@param column to which the ann... | java | public void addAnnotation(final int row, final int column, final String text, final AceAnnotationType type) {
annotations.push(AceAnnotation.create(row, column, text, type.getName()));
} | [
"public",
"void",
"addAnnotation",
"(",
"final",
"int",
"row",
",",
"final",
"int",
"column",
",",
"final",
"String",
"text",
",",
"final",
"AceAnnotationType",
"type",
")",
"{",
"annotations",
".",
"push",
"(",
"AceAnnotation",
".",
"create",
"(",
"row",
... | Add an annotation to a the local <code>annotations</code> JsArray<AceAnnotation>, but does not set it on the editor
@param row to which the annotation should be added
@param column to which the annotation applies
@param text to display as a tooltip with the annotation
@param type to be displayed (one of the values in ... | [
"Add",
"an",
"annotation",
"to",
"a",
"the",
"local",
"<code",
">",
"annotations<",
"/",
"code",
">",
"JsArray<AceAnnotation",
">",
"but",
"does",
"not",
"set",
"it",
"on",
"the",
"editor"
] | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/ace/src/main/java/edu/ycp/cs/dh/acegwt/client/ace/AceEditor.java#L376-L378 |
apache/reef | lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/client/YarnSubmissionHelper.java | YarnSubmissionHelper.setDriverResources | public YarnSubmissionHelper setDriverResources(final int memoryinMegabytes, final int numberOfCores) {
"""
Set the resources (memory and number of cores) for the Driver.
@param memoryinMegabytes memory to be allocated for the Driver, in MegaBytes.
@param numberOfCores Number of cores to allocate for the Driver... | java | public YarnSubmissionHelper setDriverResources(final int memoryinMegabytes, final int numberOfCores) {
applicationSubmissionContext.setResource(Resource.newInstance(getMemory(memoryinMegabytes), numberOfCores));
return this;
} | [
"public",
"YarnSubmissionHelper",
"setDriverResources",
"(",
"final",
"int",
"memoryinMegabytes",
",",
"final",
"int",
"numberOfCores",
")",
"{",
"applicationSubmissionContext",
".",
"setResource",
"(",
"Resource",
".",
"newInstance",
"(",
"getMemory",
"(",
"memoryinMeg... | Set the resources (memory and number of cores) for the Driver.
@param memoryinMegabytes memory to be allocated for the Driver, in MegaBytes.
@param numberOfCores Number of cores to allocate for the Driver.
@return this. | [
"Set",
"the",
"resources",
"(",
"memory",
"and",
"number",
"of",
"cores",
")",
"for",
"the",
"Driver",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/client/YarnSubmissionHelper.java#L150-L153 |
kiegroup/drools | drools-model/drools-constraint-parser/src/main/java/org/drools/constraint/parser/DrlConstraintParser.java | DrlConstraintParser.parseResource | public static Expression parseResource(final String path, Charset encoding) throws IOException {
"""
Parses the Java code contained in a resource and returns a
{@link Expression} that represents it.<br>
@param path path to a resource containing Java source code. As resource is accessed through a class loader, ... | java | public static Expression parseResource(final String path, Charset encoding) throws IOException {
return simplifiedParse(EXPRESSION, resourceProvider(path, encoding));
} | [
"public",
"static",
"Expression",
"parseResource",
"(",
"final",
"String",
"path",
",",
"Charset",
"encoding",
")",
"throws",
"IOException",
"{",
"return",
"simplifiedParse",
"(",
"EXPRESSION",
",",
"resourceProvider",
"(",
"path",
",",
"encoding",
")",
")",
";"... | Parses the Java code contained in a resource and returns a
{@link Expression} that represents it.<br>
@param path path to a resource containing Java source code. As resource is accessed through a class loader, a
leading "/" is not allowed in pathToResource
@param encoding encoding of the source code
@return Expression... | [
"Parses",
"the",
"Java",
"code",
"contained",
"in",
"a",
"resource",
"and",
"returns",
"a",
"{",
"@link",
"Expression",
"}",
"that",
"represents",
"it",
".",
"<br",
">"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-model/drools-constraint-parser/src/main/java/org/drools/constraint/parser/DrlConstraintParser.java#L212-L214 |
paypal/SeLion | client/src/main/java/com/paypal/selion/configuration/Config.java | Config.initConfig | public synchronized static void initConfig(Map<ConfigProperty, String> initialValues) {
"""
Initializes the configuration, reloading all data while adding the supplied <code>initialValues</code> to the
configuration.
@param initialValues
The initial set of values used to configure SeLion
"""
SeLio... | java | public synchronized static void initConfig(Map<ConfigProperty, String> initialValues) {
SeLionLogger.getLogger().entering(initialValues);
// only do this if the global config is not already initialized.
if (xmlConfig == null) {
xmlConfig = new XMLConfiguration();
// don'... | [
"public",
"synchronized",
"static",
"void",
"initConfig",
"(",
"Map",
"<",
"ConfigProperty",
",",
"String",
">",
"initialValues",
")",
"{",
"SeLionLogger",
".",
"getLogger",
"(",
")",
".",
"entering",
"(",
"initialValues",
")",
";",
"// only do this if the global ... | Initializes the configuration, reloading all data while adding the supplied <code>initialValues</code> to the
configuration.
@param initialValues
The initial set of values used to configure SeLion | [
"Initializes",
"the",
"configuration",
"reloading",
"all",
"data",
"while",
"adding",
"the",
"supplied",
"<code",
">",
"initialValues<",
"/",
"code",
">",
"to",
"the",
"configuration",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/configuration/Config.java#L228-L260 |
Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESClient.java | ESClient.addSortOrder | private void addSortOrder(SearchRequestBuilder builder, KunderaQuery query, EntityMetadata entityMetadata) {
"""
Adds the sort order.
@param builder
the builder
@param query
the query
@param entityMetadata
the entity metadata
"""
MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getAppl... | java | private void addSortOrder(SearchRequestBuilder builder, KunderaQuery query, EntityMetadata entityMetadata)
{
MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
.getMetamodel(entityMetadata.getPersistenceUnit());
List<OrderByItem> orderList = KunderaQu... | [
"private",
"void",
"addSortOrder",
"(",
"SearchRequestBuilder",
"builder",
",",
"KunderaQuery",
"query",
",",
"EntityMetadata",
"entityMetadata",
")",
"{",
"MetamodelImpl",
"metaModel",
"=",
"(",
"MetamodelImpl",
")",
"kunderaMetadata",
".",
"getApplicationMetadata",
"(... | Adds the sort order.
@param builder
the builder
@param query
the query
@param entityMetadata
the entity metadata | [
"Adds",
"the",
"sort",
"order",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESClient.java#L375-L394 |
dropwizard/dropwizard | dropwizard-json-logging/src/main/java/io/dropwizard/logging/json/layout/MapBuilder.java | MapBuilder.addMap | public MapBuilder addMap(String fieldName, boolean include, Supplier<Map<String, ?>> supplier) {
"""
Adds the map value to the provided map under the provided field name, if it should be
included. The supplier is only invoked if the field is to be included.
"""
if (include) {
Map<String, ?... | java | public MapBuilder addMap(String fieldName, boolean include, Supplier<Map<String, ?>> supplier) {
if (include) {
Map<String, ?> value = supplier.get();
if (value != null && !value.isEmpty()) {
map.put(getFieldName(fieldName), value);
}
}
return ... | [
"public",
"MapBuilder",
"addMap",
"(",
"String",
"fieldName",
",",
"boolean",
"include",
",",
"Supplier",
"<",
"Map",
"<",
"String",
",",
"?",
">",
">",
"supplier",
")",
"{",
"if",
"(",
"include",
")",
"{",
"Map",
"<",
"String",
",",
"?",
">",
"value... | Adds the map value to the provided map under the provided field name, if it should be
included. The supplier is only invoked if the field is to be included. | [
"Adds",
"the",
"map",
"value",
"to",
"the",
"provided",
"map",
"under",
"the",
"provided",
"field",
"name",
"if",
"it",
"should",
"be",
"included",
".",
"The",
"supplier",
"is",
"only",
"invoked",
"if",
"the",
"field",
"is",
"to",
"be",
"included",
"."
] | train | https://github.com/dropwizard/dropwizard/blob/7ee09a410476b9681e8072ab684788bb440877bd/dropwizard-json-logging/src/main/java/io/dropwizard/logging/json/layout/MapBuilder.java#L101-L109 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.forceCollectInvoice | public Invoice forceCollectInvoice(final String invoiceId) {
"""
Force collect an invoice
@param invoiceId String Recurly Invoice ID
"""
return doPUT(Invoices.INVOICES_RESOURCE + "/" + invoiceId + "/collect", null, Invoice.class);
} | java | public Invoice forceCollectInvoice(final String invoiceId) {
return doPUT(Invoices.INVOICES_RESOURCE + "/" + invoiceId + "/collect", null, Invoice.class);
} | [
"public",
"Invoice",
"forceCollectInvoice",
"(",
"final",
"String",
"invoiceId",
")",
"{",
"return",
"doPUT",
"(",
"Invoices",
".",
"INVOICES_RESOURCE",
"+",
"\"/\"",
"+",
"invoiceId",
"+",
"\"/collect\"",
",",
"null",
",",
"Invoice",
".",
"class",
")",
";",
... | Force collect an invoice
@param invoiceId String Recurly Invoice ID | [
"Force",
"collect",
"an",
"invoice"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1310-L1312 |
dottydingo/hyperion | client/src/main/java/com/dottydingo/hyperion/client/builder/query/QueryBuilder.java | QueryBuilder.ge | public QueryExpression ge(String propertyName,String value) {
"""
Create a greater than or equals expression
@param propertyName The propery name
@param value The value
@return The query expression
"""
return new SimpleQueryExpression(propertyName, ComparisonOperator.GREATER_THAN_OR_EQUAL,wrap(value... | java | public QueryExpression ge(String propertyName,String value)
{
return new SimpleQueryExpression(propertyName, ComparisonOperator.GREATER_THAN_OR_EQUAL,wrap(value));
} | [
"public",
"QueryExpression",
"ge",
"(",
"String",
"propertyName",
",",
"String",
"value",
")",
"{",
"return",
"new",
"SimpleQueryExpression",
"(",
"propertyName",
",",
"ComparisonOperator",
".",
"GREATER_THAN_OR_EQUAL",
",",
"wrap",
"(",
"value",
")",
")",
";",
... | Create a greater than or equals expression
@param propertyName The propery name
@param value The value
@return The query expression | [
"Create",
"a",
"greater",
"than",
"or",
"equals",
"expression"
] | train | https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/client/src/main/java/com/dottydingo/hyperion/client/builder/query/QueryBuilder.java#L268-L271 |
threerings/nenya | core/src/main/java/com/threerings/miso/tile/FringeConfiguration.java | FringeConfiguration.getFringe | public FringeTileSetRecord getFringe (int baseset, int hashValue) {
"""
Get a random FringeTileSetRecord from amongst the ones
listed for the specified base tileset.
"""
FringeRecord f = _frecs.get(baseset);
return f.tilesets.get(
hashValue % f.tilesets.size());
} | java | public FringeTileSetRecord getFringe (int baseset, int hashValue)
{
FringeRecord f = _frecs.get(baseset);
return f.tilesets.get(
hashValue % f.tilesets.size());
} | [
"public",
"FringeTileSetRecord",
"getFringe",
"(",
"int",
"baseset",
",",
"int",
"hashValue",
")",
"{",
"FringeRecord",
"f",
"=",
"_frecs",
".",
"get",
"(",
"baseset",
")",
";",
"return",
"f",
".",
"tilesets",
".",
"get",
"(",
"hashValue",
"%",
"f",
".",... | Get a random FringeTileSetRecord from amongst the ones
listed for the specified base tileset. | [
"Get",
"a",
"random",
"FringeTileSetRecord",
"from",
"amongst",
"the",
"ones",
"listed",
"for",
"the",
"specified",
"base",
"tileset",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/tile/FringeConfiguration.java#L146-L151 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/Resources.java | Resources.getPropertyFile | @Pure
public static URL getPropertyFile(ClassLoader classLoader, Class<?> classname, Locale locale) {
"""
Replies the URL of a property resource that is associated to the given class.
@param classLoader is the research scope. If <code>null</code>,
the class loader replied by {@link ClassLoaderFinder} is used.... | java | @Pure
public static URL getPropertyFile(ClassLoader classLoader, Class<?> classname, Locale locale) {
final StringBuilder name = new StringBuilder();
// Localized file
if (locale != null) {
final String country = locale.getCountry();
if (country != null && !country.isEmpty()) {
name.append(classname.g... | [
"@",
"Pure",
"public",
"static",
"URL",
"getPropertyFile",
"(",
"ClassLoader",
"classLoader",
",",
"Class",
"<",
"?",
">",
"classname",
",",
"Locale",
"locale",
")",
"{",
"final",
"StringBuilder",
"name",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"// Local... | Replies the URL of a property resource that is associated to the given class.
@param classLoader is the research scope. If <code>null</code>,
the class loader replied by {@link ClassLoaderFinder} is used.
@param classname is the class for which the property resource should be replied.
@param locale is the expected loc... | [
"Replies",
"the",
"URL",
"of",
"a",
"property",
"resource",
"that",
"is",
"associated",
"to",
"the",
"given",
"class",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/Resources.java#L350-L374 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_miniPabx_serviceName_hunting_agent_agentNumber_PUT | public void billingAccount_miniPabx_serviceName_hunting_agent_agentNumber_PUT(String billingAccount, String serviceName, String agentNumber, OvhEasyMiniPabxHuntingAgent body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/miniPabx/{serviceName}/hunting/agent/{agentNu... | java | public void billingAccount_miniPabx_serviceName_hunting_agent_agentNumber_PUT(String billingAccount, String serviceName, String agentNumber, OvhEasyMiniPabxHuntingAgent body) throws IOException {
String qPath = "/telephony/{billingAccount}/miniPabx/{serviceName}/hunting/agent/{agentNumber}";
StringBuilder sb = path... | [
"public",
"void",
"billingAccount_miniPabx_serviceName_hunting_agent_agentNumber_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"String",
"agentNumber",
",",
"OvhEasyMiniPabxHuntingAgent",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath"... | Alter this object properties
REST: PUT /telephony/{billingAccount}/miniPabx/{serviceName}/hunting/agent/{agentNumber}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param agentNumber [required] The phone number of the agent | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5255-L5259 |
lightbend/config | config/src/main/java/com/typesafe/config/parser/ConfigDocumentFactory.java | ConfigDocumentFactory.parseString | public static ConfigDocument parseString(String s, ConfigParseOptions options) {
"""
Parses a string which should be valid HOCON or JSON.
@param s string to parse
@param options parse options
@return the parsed configuration
"""
return Parseable.newString(s, options).parseConfigDocument();
} | java | public static ConfigDocument parseString(String s, ConfigParseOptions options) {
return Parseable.newString(s, options).parseConfigDocument();
} | [
"public",
"static",
"ConfigDocument",
"parseString",
"(",
"String",
"s",
",",
"ConfigParseOptions",
"options",
")",
"{",
"return",
"Parseable",
".",
"newString",
"(",
"s",
",",
"options",
")",
".",
"parseConfigDocument",
"(",
")",
";",
"}"
] | Parses a string which should be valid HOCON or JSON.
@param s string to parse
@param options parse options
@return the parsed configuration | [
"Parses",
"a",
"string",
"which",
"should",
"be",
"valid",
"HOCON",
"or",
"JSON",
"."
] | train | https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/parser/ConfigDocumentFactory.java#L79-L81 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java | HtmlTree.TH | public static HtmlTree TH(HtmlStyle styleClass, String scope, Content body) {
"""
Generates a TH tag with style class and scope attributes and some content.
@param styleClass style for the tag
@param scope scope of the tag
@param body content for the tag
@return an HtmlTree object for the TH tag
"""
... | java | public static HtmlTree TH(HtmlStyle styleClass, String scope, Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.TH, nullCheck(body));
if (styleClass != null)
htmltree.addStyle(styleClass);
htmltree.addAttr(HtmlAttr.SCOPE, nullCheck(scope));
return htmltree;
} | [
"public",
"static",
"HtmlTree",
"TH",
"(",
"HtmlStyle",
"styleClass",
",",
"String",
"scope",
",",
"Content",
"body",
")",
"{",
"HtmlTree",
"htmltree",
"=",
"new",
"HtmlTree",
"(",
"HtmlTag",
".",
"TH",
",",
"nullCheck",
"(",
"body",
")",
")",
";",
"if",... | Generates a TH tag with style class and scope attributes and some content.
@param styleClass style for the tag
@param scope scope of the tag
@param body content for the tag
@return an HtmlTree object for the TH tag | [
"Generates",
"a",
"TH",
"tag",
"with",
"style",
"class",
"and",
"scope",
"attributes",
"and",
"some",
"content",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java#L806-L812 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/convert/JsonConverter.java | JsonConverter.fromJson | public static <T> T fromJson(Class<T> type, String value)
throws JsonMappingException, JsonParseException, IOException {
"""
Converts JSON string into a value of type specified by Class type.
@param type the Class type for the data type into which 'value' is to be converted.
@param value the JSON string to... | java | public static <T> T fromJson(Class<T> type, String value)
throws JsonMappingException, JsonParseException, IOException {
if (value == null)
return null;
return _mapper.readValue(value, type);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"fromJson",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"value",
")",
"throws",
"JsonMappingException",
",",
"JsonParseException",
",",
"IOException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"... | Converts JSON string into a value of type specified by Class type.
@param type the Class type for the data type into which 'value' is to be converted.
@param value the JSON string to convert.
@return converted object value or null when value is null.
@throws JsonMappingException when conversion fails for mapping reas... | [
"Converts",
"JSON",
"string",
"into",
"a",
"value",
"of",
"type",
"specified",
"by",
"Class",
"type",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/convert/JsonConverter.java#L42-L47 |
j256/ormlite-core | src/main/java/com/j256/ormlite/table/TableUtils.java | TableUtils.dropTable | public static <T, ID> int dropTable(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig,
boolean ignoreErrors) throws SQLException {
"""
Issue the database statements to drop the table associated with a table configuration.
<p>
<b>WARNING:</b> This is [obviously] very destructive and is un... | java | public static <T, ID> int dropTable(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig,
boolean ignoreErrors) throws SQLException {
DatabaseType databaseType = connectionSource.getDatabaseType();
Dao<T, ID> dao = DaoManager.createDao(connectionSource, tableConfig);
if (dao instanceof BaseDao... | [
"public",
"static",
"<",
"T",
",",
"ID",
">",
"int",
"dropTable",
"(",
"ConnectionSource",
"connectionSource",
",",
"DatabaseTableConfig",
"<",
"T",
">",
"tableConfig",
",",
"boolean",
"ignoreErrors",
")",
"throws",
"SQLException",
"{",
"DatabaseType",
"databaseTy... | Issue the database statements to drop the table associated with a table configuration.
<p>
<b>WARNING:</b> This is [obviously] very destructive and is unrecoverable.
</p>
@param connectionSource
Associated connection source.
@param tableConfig
Hand or spring wired table configuration. If null then the class must have... | [
"Issue",
"the",
"database",
"statements",
"to",
"drop",
"the",
"table",
"associated",
"with",
"a",
"table",
"configuration",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/TableUtils.java#L211-L222 |
Falydoor/limesurvey-rc | src/main/java/com/github/falydoor/limesurveyrc/LimesurveyRC.java | LimesurveyRC.getQuestionsFromGroup | public Stream<LsQuestion> getQuestionsFromGroup(int surveyId, int groupId) throws LimesurveyRCException {
"""
Gets questions from a group.
The questions are ordered using the "question_order" field.
@param surveyId the survey id you want to get the questions
@param groupId the group id you want to get the qu... | java | public Stream<LsQuestion> getQuestionsFromGroup(int surveyId, int groupId) throws LimesurveyRCException {
LsApiBody.LsApiParams params = getParamsWithKey(surveyId);
params.setGroupId(groupId);
JsonElement result = callRC(new LsApiBody("list_questions", params));
List<LsQuestion> question... | [
"public",
"Stream",
"<",
"LsQuestion",
">",
"getQuestionsFromGroup",
"(",
"int",
"surveyId",
",",
"int",
"groupId",
")",
"throws",
"LimesurveyRCException",
"{",
"LsApiBody",
".",
"LsApiParams",
"params",
"=",
"getParamsWithKey",
"(",
"surveyId",
")",
";",
"params"... | Gets questions from a group.
The questions are ordered using the "question_order" field.
@param surveyId the survey id you want to get the questions
@param groupId the group id you want to get the questions
@return a stream of questions in an ordered order
@throws LimesurveyRCException the limesurvey rc exception | [
"Gets",
"questions",
"from",
"a",
"group",
".",
"The",
"questions",
"are",
"ordered",
"using",
"the",
"question_order",
"field",
"."
] | train | https://github.com/Falydoor/limesurvey-rc/blob/b8d573389086395e46a0bdeeddeef4d1c2c0a488/src/main/java/com/github/falydoor/limesurveyrc/LimesurveyRC.java#L272-L280 |
jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/util/StopWatch.java | StopWatch.formatThroughput | public String formatThroughput(int theNumOperations, TimeUnit theUnit) {
"""
Determine the current throughput per unit of time (specified in theUnit)
assuming that theNumOperations operations have happened.
<p>
For example, if this stopwatch has 2 seconds elapsed, and this method is
called for theNumOperations... | java | public String formatThroughput(int theNumOperations, TimeUnit theUnit) {
double throughput = getThroughput(theNumOperations, theUnit);
return new DecimalFormat("0.0").format(throughput);
} | [
"public",
"String",
"formatThroughput",
"(",
"int",
"theNumOperations",
",",
"TimeUnit",
"theUnit",
")",
"{",
"double",
"throughput",
"=",
"getThroughput",
"(",
"theNumOperations",
",",
"theUnit",
")",
";",
"return",
"new",
"DecimalFormat",
"(",
"\"0.0\"",
")",
... | Determine the current throughput per unit of time (specified in theUnit)
assuming that theNumOperations operations have happened.
<p>
For example, if this stopwatch has 2 seconds elapsed, and this method is
called for theNumOperations=30 and TimeUnit=SECONDS,
this method will return 15
</p>
@see #getThroughput(int, Ti... | [
"Determine",
"the",
"current",
"throughput",
"per",
"unit",
"of",
"time",
"(",
"specified",
"in",
"theUnit",
")",
"assuming",
"that",
"theNumOperations",
"operations",
"have",
"happened",
".",
"<p",
">",
"For",
"example",
"if",
"this",
"stopwatch",
"has",
"2",... | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/StopWatch.java#L168-L171 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java | JSONHelpers.optPointF | public static <P extends Enum<P>> PointF optPointF(final JSONObject json, P e) {
"""
Return the value mapped by enum if it exists and is a {@link JSONObject} by mapping "x" and
"y" members into a {@link PointF}.
@param json {@code JSONObject} to get data from
@param e {@link Enum} labeling the data to get
... | java | public static <P extends Enum<P>> PointF optPointF(final JSONObject json, P e) {
return optPointF(json, e, null);
} | [
"public",
"static",
"<",
"P",
"extends",
"Enum",
"<",
"P",
">",
">",
"PointF",
"optPointF",
"(",
"final",
"JSONObject",
"json",
",",
"P",
"e",
")",
"{",
"return",
"optPointF",
"(",
"json",
",",
"e",
",",
"null",
")",
";",
"}"
] | Return the value mapped by enum if it exists and is a {@link JSONObject} by mapping "x" and
"y" members into a {@link PointF}.
@param json {@code JSONObject} to get data from
@param e {@link Enum} labeling the data to get
@return An instance of {@code PointF} or {@code null} if there is no object mapping for
{@code... | [
"Return",
"the",
"value",
"mapped",
"by",
"enum",
"if",
"it",
"exists",
"and",
"is",
"a",
"{",
"@link",
"JSONObject",
"}",
"by",
"mapping",
"x",
"and",
"y",
"members",
"into",
"a",
"{",
"@link",
"PointF",
"}",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java#L563-L565 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.beginUpdateTags | public VirtualNetworkGatewayInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayName) {
"""
Updates a virtual network gateway tags.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@throws IllegalArgument... | java | public VirtualNetworkGatewayInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayName) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body();
} | [
"public",
"VirtualNetworkGatewayInner",
"beginUpdateTags",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
")",
"{",
"return",
"beginUpdateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkGatewayName",
")",
".",
"toBlo... | Updates a virtual network gateway tags.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws... | [
"Updates",
"a",
"virtual",
"network",
"gateway",
"tags",
"."
] | 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/VirtualNetworkGatewaysInner.java#L754-L756 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementBase.java | ElementBase.getChild | @SuppressWarnings("unchecked")
public <T extends ElementBase> T getChild(Class<T> clazz, ElementBase last) {
"""
Locates and returns a child that is an instance of the specified class. If none is found,
returns null.
@param <T> The type of child being sought.
@param clazz Class of the child being sought.
... | java | @SuppressWarnings("unchecked")
public <T extends ElementBase> T getChild(Class<T> clazz, ElementBase last) {
int i = last == null ? -1 : children.indexOf(last);
for (i++; i < children.size(); i++) {
if (clazz.isInstance(children.get(i))) {
return (T) children.get... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"ElementBase",
">",
"T",
"getChild",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"ElementBase",
"last",
")",
"{",
"int",
"i",
"=",
"last",
"==",
"null",
"?",
"-",
"1",
... | Locates and returns a child that is an instance of the specified class. If none is found,
returns null.
@param <T> The type of child being sought.
@param clazz Class of the child being sought.
@param last If specified, the search begins after this child. If null, the search begins with
the first child.
@return The req... | [
"Locates",
"and",
"returns",
"a",
"child",
"that",
"is",
"an",
"instance",
"of",
"the",
"specified",
"class",
".",
"If",
"none",
"is",
"found",
"returns",
"null",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementBase.java#L437-L448 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java | EvaluationBinary.scoreForMetric | public double scoreForMetric(Metric metric, int outputNum) {
"""
Calculate specific metric (see {@link Metric}) for a given label.
@param metric The Metric to calculate.
@param outputNum Class index to calculate.
@return Calculated metric.
"""
switch (metric){
case ACCURACY:
... | java | public double scoreForMetric(Metric metric, int outputNum){
switch (metric){
case ACCURACY:
return accuracy(outputNum);
case F1:
return f1(outputNum);
case PRECISION:
return precision(outputNum);
case RECALL:
... | [
"public",
"double",
"scoreForMetric",
"(",
"Metric",
"metric",
",",
"int",
"outputNum",
")",
"{",
"switch",
"(",
"metric",
")",
"{",
"case",
"ACCURACY",
":",
"return",
"accuracy",
"(",
"outputNum",
")",
";",
"case",
"F1",
":",
"return",
"f1",
"(",
"outpu... | Calculate specific metric (see {@link Metric}) for a given label.
@param metric The Metric to calculate.
@param outputNum Class index to calculate.
@return Calculated metric. | [
"Calculate",
"specific",
"metric",
"(",
"see",
"{",
"@link",
"Metric",
"}",
")",
"for",
"a",
"given",
"label",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java#L640-L659 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SheetCrossSheetReferenceResourcesImpl.java | SheetCrossSheetReferenceResourcesImpl.createCrossSheetReference | public CrossSheetReference createCrossSheetReference(long sheetId, CrossSheetReference crossSheetReference) throws SmartsheetException {
"""
<p>Create a cross sheet reference in the given sheet.</p>
<p>It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/crosssheetreferences</p>
@pa... | java | public CrossSheetReference createCrossSheetReference(long sheetId, CrossSheetReference crossSheetReference) throws SmartsheetException
{
return this.createResource("sheets/" + sheetId + "/crosssheetreferences", CrossSheetReference.class, crossSheetReference);
} | [
"public",
"CrossSheetReference",
"createCrossSheetReference",
"(",
"long",
"sheetId",
",",
"CrossSheetReference",
"crossSheetReference",
")",
"throws",
"SmartsheetException",
"{",
"return",
"this",
".",
"createResource",
"(",
"\"sheets/\"",
"+",
"sheetId",
"+",
"\"/crosss... | <p>Create a cross sheet reference in the given sheet.</p>
<p>It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/crosssheetreferences</p>
@param sheetId the sheet id
@param crossSheetReference the cross sheet reference to create
@return the created cross sheet reference
@throws IllegalArgum... | [
"<p",
">",
"Create",
"a",
"cross",
"sheet",
"reference",
"in",
"the",
"given",
"sheet",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SheetCrossSheetReferenceResourcesImpl.java#L109-L112 |
code4everything/util | src/main/java/com/zhazhapan/util/DateUtils.java | DateUtils.addDay | public static Date addDay(String date, int amount) throws ParseException {
"""
添加日期
@param date 日期
@param amount 数量
@return 添加后的日期
@throws ParseException 异常
"""
return add(date, Calendar.DATE, amount);
} | java | public static Date addDay(String date, int amount) throws ParseException {
return add(date, Calendar.DATE, amount);
} | [
"public",
"static",
"Date",
"addDay",
"(",
"String",
"date",
",",
"int",
"amount",
")",
"throws",
"ParseException",
"{",
"return",
"add",
"(",
"date",
",",
"Calendar",
".",
"DATE",
",",
"amount",
")",
";",
"}"
] | 添加日期
@param date 日期
@param amount 数量
@return 添加后的日期
@throws ParseException 异常 | [
"添加日期"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/DateUtils.java#L425-L427 |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/client/multibindings/GinMapBinder.java | GinMapBinder.newMapBinder | public static <K, V> GinMapBinder<K, V> newMapBinder(
GinBinder binder, Class<K> keyType, Class<V> valueType) {
"""
Returns a new mapbinder that collects entries of {@code keyType}/{@code valueType} in a
{@link Map} that is itself bound with no binding annotation.
"""
return newMapBinder(binder, Typ... | java | public static <K, V> GinMapBinder<K, V> newMapBinder(
GinBinder binder, Class<K> keyType, Class<V> valueType) {
return newMapBinder(binder, TypeLiteral.get(keyType), TypeLiteral.get(valueType));
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"GinMapBinder",
"<",
"K",
",",
"V",
">",
"newMapBinder",
"(",
"GinBinder",
"binder",
",",
"Class",
"<",
"K",
">",
"keyType",
",",
"Class",
"<",
"V",
">",
"valueType",
")",
"{",
"return",
"newMapBinder",
"(... | Returns a new mapbinder that collects entries of {@code keyType}/{@code valueType} in a
{@link Map} that is itself bound with no binding annotation. | [
"Returns",
"a",
"new",
"mapbinder",
"that",
"collects",
"entries",
"of",
"{"
] | train | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/client/multibindings/GinMapBinder.java#L102-L105 |
Axway/Grapes | utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java | GrapesClient.addLicense | public void addLicense(final String gavc, final String licenseId, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
"""
Add a license to an artifact
@param gavc
@param licenseId
@throws GrapesCommunicationException
@throws javax.naming.AuthenticationExce... | java | public void addLicense(final String gavc, final String licenseId, final String user, final String password) throws GrapesCommunicationException, AuthenticationException{
final Client client = getClient(user, password);
final WebResource resource = client.resource(serverURL).path(RequestUtils.getArtifact... | [
"public",
"void",
"addLicense",
"(",
"final",
"String",
"gavc",
",",
"final",
"String",
"licenseId",
",",
"final",
"String",
"user",
",",
"final",
"String",
"password",
")",
"throws",
"GrapesCommunicationException",
",",
"AuthenticationException",
"{",
"final",
"C... | Add a license to an artifact
@param gavc
@param licenseId
@throws GrapesCommunicationException
@throws javax.naming.AuthenticationException | [
"Add",
"a",
"license",
"to",
"an",
"artifact"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java#L644-L657 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/client/gui/element/position/Positions.java | Positions.bottomAligned | public static <T extends ISized & IChild<U>, U extends ISized> IntSupplier bottomAligned(T owner, int spacing) {
"""
Positions the owner to the bottom inside its parent.<br>
Respects the parent padding.
@param <T> the generic type
@param <U> the generic type
@param spacing the spacing
@return the int suppli... | java | public static <T extends ISized & IChild<U>, U extends ISized> IntSupplier bottomAligned(T owner, int spacing)
{
return () -> {
U parent = owner.getParent();
if (owner.getParent() == null)
return 0;
return parent.size().height() - owner.size().height() - Padding.of(parent).bottom() - spacing;
};
} | [
"public",
"static",
"<",
"T",
"extends",
"ISized",
"&",
"IChild",
"<",
"U",
">",
",",
"U",
"extends",
"ISized",
">",
"IntSupplier",
"bottomAligned",
"(",
"T",
"owner",
",",
"int",
"spacing",
")",
"{",
"return",
"(",
")",
"->",
"{",
"U",
"parent",
"="... | Positions the owner to the bottom inside its parent.<br>
Respects the parent padding.
@param <T> the generic type
@param <U> the generic type
@param spacing the spacing
@return the int supplier | [
"Positions",
"the",
"owner",
"to",
"the",
"bottom",
"inside",
"its",
"parent",
".",
"<br",
">",
"Respects",
"the",
"parent",
"padding",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/client/gui/element/position/Positions.java#L122-L132 |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.scanAsync | public void scanAsync(final ExecutorService executorService, final int numParallelTasks,
final ScanResultProcessor scanResultProcessor, final FailureHandler failureHandler) {
"""
Asynchronously scans the classpath, calling a {@link ScanResultProcessor} callback on success or a
{@link FailureHandler} c... | java | public void scanAsync(final ExecutorService executorService, final int numParallelTasks,
final ScanResultProcessor scanResultProcessor, final FailureHandler failureHandler) {
if (scanResultProcessor == null) {
// If scanResultProcessor is null, the scan won't do anything after completion... | [
"public",
"void",
"scanAsync",
"(",
"final",
"ExecutorService",
"executorService",
",",
"final",
"int",
"numParallelTasks",
",",
"final",
"ScanResultProcessor",
"scanResultProcessor",
",",
"final",
"FailureHandler",
"failureHandler",
")",
"{",
"if",
"(",
"scanResultProc... | Asynchronously scans the classpath, calling a {@link ScanResultProcessor} callback on success or a
{@link FailureHandler} callback on failure.
@param executorService
A custom {@link ExecutorService} to use for scheduling worker tasks.
@param numParallelTasks
The number of parallel tasks to break the work into during t... | [
"Asynchronously",
"scans",
"the",
"classpath",
"calling",
"a",
"{",
"@link",
"ScanResultProcessor",
"}",
"callback",
"on",
"success",
"or",
"a",
"{",
"@link",
"FailureHandler",
"}",
"callback",
"on",
"failure",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L1080-L1106 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/implementation/InvocationHandlerAdapter.java | InvocationHandlerAdapter.toField | public static InvocationHandlerAdapter toField(String name) {
"""
Creates an implementation for any {@link java.lang.reflect.InvocationHandler} that delegates
all method interceptions to a field with the given name. This field has to be of a subtype of invocation
handler and needs to be set before any invocation... | java | public static InvocationHandlerAdapter toField(String name) {
return toField(name, FieldLocator.ForClassHierarchy.Factory.INSTANCE);
} | [
"public",
"static",
"InvocationHandlerAdapter",
"toField",
"(",
"String",
"name",
")",
"{",
"return",
"toField",
"(",
"name",
",",
"FieldLocator",
".",
"ForClassHierarchy",
".",
"Factory",
".",
"INSTANCE",
")",
";",
"}"
] | Creates an implementation for any {@link java.lang.reflect.InvocationHandler} that delegates
all method interceptions to a field with the given name. This field has to be of a subtype of invocation
handler and needs to be set before any invocations are intercepted. Otherwise, a {@link java.lang.NullPointerException}
wi... | [
"Creates",
"an",
"implementation",
"for",
"any",
"{",
"@link",
"java",
".",
"lang",
".",
"reflect",
".",
"InvocationHandler",
"}",
"that",
"delegates",
"all",
"method",
"interceptions",
"to",
"a",
"field",
"with",
"the",
"given",
"name",
".",
"This",
"field"... | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/InvocationHandlerAdapter.java#L147-L149 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/rule/ItemRule.java | ItemRule.setValue | public void setValue(Map<String, Token[]> tokensMap) {
"""
Sets a value to this Map type item.
@param tokensMap the tokens map
"""
if (type == null) {
type = ItemType.MAP;
}
if (!isMappableType()) {
throw new IllegalArgumentException("The type of this item mus... | java | public void setValue(Map<String, Token[]> tokensMap) {
if (type == null) {
type = ItemType.MAP;
}
if (!isMappableType()) {
throw new IllegalArgumentException("The type of this item must be 'map' or 'properties'");
}
this.tokensMap = tokensMap;
} | [
"public",
"void",
"setValue",
"(",
"Map",
"<",
"String",
",",
"Token",
"[",
"]",
">",
"tokensMap",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"type",
"=",
"ItemType",
".",
"MAP",
";",
"}",
"if",
"(",
"!",
"isMappableType",
"(",
")",
")"... | Sets a value to this Map type item.
@param tokensMap the tokens map | [
"Sets",
"a",
"value",
"to",
"this",
"Map",
"type",
"item",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/rule/ItemRule.java#L268-L276 |
WiQuery/wiquery | wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/datepicker/DateOption.java | DateOption.setParam | private void setParam(Short shortParam, String literalParam, Date dateParam) {
"""
Method setting the right parameter
@param shortParam
Short parameter
@param literalParam
literal parameter
@param dateParam
short parameter
"""
this.shortParam = shortParam;
this.literalParam = literalParam;
this.d... | java | private void setParam(Short shortParam, String literalParam, Date dateParam)
{
this.shortParam = shortParam;
this.literalParam = literalParam;
this.dateParam = dateParam;
} | [
"private",
"void",
"setParam",
"(",
"Short",
"shortParam",
",",
"String",
"literalParam",
",",
"Date",
"dateParam",
")",
"{",
"this",
".",
"shortParam",
"=",
"shortParam",
";",
"this",
".",
"literalParam",
"=",
"literalParam",
";",
"this",
".",
"dateParam",
... | Method setting the right parameter
@param shortParam
Short parameter
@param literalParam
literal parameter
@param dateParam
short parameter | [
"Method",
"setting",
"the",
"right",
"parameter"
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/datepicker/DateOption.java#L198-L203 |
apache/incubator-heron | heron/metricsmgr/src/java/org/apache/heron/metricsmgr/sink/AbstractWebSink.java | AbstractWebSink.startHttpServer | protected void startHttpServer(String path, int port) {
"""
Start a http server on supplied port that will serve the metrics, as json,
on the specified path.
@param path
@param port
"""
try {
httpServer = HttpServer.create(new InetSocketAddress(port), 0);
httpServer.createContext(path, htt... | java | protected void startHttpServer(String path, int port) {
try {
httpServer = HttpServer.create(new InetSocketAddress(port), 0);
httpServer.createContext(path, httpExchange -> {
byte[] response = generateResponse();
httpExchange.sendResponseHeaders(HTTP_STATUS_OK, response.length);
... | [
"protected",
"void",
"startHttpServer",
"(",
"String",
"path",
",",
"int",
"port",
")",
"{",
"try",
"{",
"httpServer",
"=",
"HttpServer",
".",
"create",
"(",
"new",
"InetSocketAddress",
"(",
"port",
")",
",",
"0",
")",
";",
"httpServer",
".",
"createContex... | Start a http server on supplied port that will serve the metrics, as json,
on the specified path.
@param path
@param port | [
"Start",
"a",
"http",
"server",
"on",
"supplied",
"port",
"that",
"will",
"serve",
"the",
"metrics",
"as",
"json",
"on",
"the",
"specified",
"path",
"."
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/metricsmgr/src/java/org/apache/heron/metricsmgr/sink/AbstractWebSink.java#L129-L145 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/PCAResult.java | PCAResult.processDecomposition | private static EigenPair[] processDecomposition(EigenvalueDecomposition evd) {
"""
Convert an eigenvalue decomposition into EigenPair objects.
@param evd Eigenvalue decomposition
@return Eigenpairs
"""
double[] eigenvalues = evd.getRealEigenvalues();
double[][] eigenvectors = evd.getV();
Eigen... | java | private static EigenPair[] processDecomposition(EigenvalueDecomposition evd) {
double[] eigenvalues = evd.getRealEigenvalues();
double[][] eigenvectors = evd.getV();
EigenPair[] eigenPairs = new EigenPair[eigenvalues.length];
for(int i = 0; i < eigenvalues.length; i++) {
double e = Math.abs(eigen... | [
"private",
"static",
"EigenPair",
"[",
"]",
"processDecomposition",
"(",
"EigenvalueDecomposition",
"evd",
")",
"{",
"double",
"[",
"]",
"eigenvalues",
"=",
"evd",
".",
"getRealEigenvalues",
"(",
")",
";",
"double",
"[",
"]",
"[",
"]",
"eigenvectors",
"=",
"... | Convert an eigenvalue decomposition into EigenPair objects.
@param evd Eigenvalue decomposition
@return Eigenpairs | [
"Convert",
"an",
"eigenvalue",
"decomposition",
"into",
"EigenPair",
"objects",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/PCAResult.java#L85-L97 |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/config/internal/MultivalueProperty.java | MultivalueProperty.processRecords | private static void processRecords(List<String> result, List<CSVRecord> records, Function<String, String> valueProcessor) {
"""
In most cases we expect a single record. <br>Having multiple records means the input value was splitted over multiple lines (this is common in Maven).
For example:
<pre>
<sonar.excl... | java | private static void processRecords(List<String> result, List<CSVRecord> records, Function<String, String> valueProcessor) {
for (CSVRecord csvRecord : records) {
Iterator<String> it = csvRecord.iterator();
if (!result.isEmpty()) {
String next = it.next();
if (!next.isEmpty()) {
... | [
"private",
"static",
"void",
"processRecords",
"(",
"List",
"<",
"String",
">",
"result",
",",
"List",
"<",
"CSVRecord",
">",
"records",
",",
"Function",
"<",
"String",
",",
"String",
">",
"valueProcessor",
")",
"{",
"for",
"(",
"CSVRecord",
"csvRecord",
"... | In most cases we expect a single record. <br>Having multiple records means the input value was splitted over multiple lines (this is common in Maven).
For example:
<pre>
<sonar.exclusions>
src/foo,
src/bar,
src/biz
<sonar.exclusions>
</pre>
In this case records will be merged to form a single list of items.... | [
"In",
"most",
"cases",
"we",
"expect",
"a",
"single",
"record",
".",
"<br",
">",
"Having",
"multiple",
"records",
"means",
"the",
"input",
"value",
"was",
"splitted",
"over",
"multiple",
"lines",
"(",
"this",
"is",
"common",
"in",
"Maven",
")",
".",
"For... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/config/internal/MultivalueProperty.java#L84-L104 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/Normalizer.java | Normalizer.isNormalized | public static boolean isNormalized(CharSequence src, Form form) {
"""
Check whether the given character sequence <code>src</code> is normalized
according to the normalization method <code>form</code>.
@param src character sequence to check
@param form normalization form to check against
@return true if norma... | java | public static boolean isNormalized(CharSequence src, Form form) {
return normalize(src, form).equals(src);
} | [
"public",
"static",
"boolean",
"isNormalized",
"(",
"CharSequence",
"src",
",",
"Form",
"form",
")",
"{",
"return",
"normalize",
"(",
"src",
",",
"form",
")",
".",
"equals",
"(",
"src",
")",
";",
"}"
] | Check whether the given character sequence <code>src</code> is normalized
according to the normalization method <code>form</code>.
@param src character sequence to check
@param form normalization form to check against
@return true if normalized according to <code>form</code> | [
"Check",
"whether",
"the",
"given",
"character",
"sequence",
"<code",
">",
"src<",
"/",
"code",
">",
"is",
"normalized",
"according",
"to",
"the",
"normalization",
"method",
"<code",
">",
"form<",
"/",
"code",
">",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/Normalizer.java#L63-L65 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/AssetsInner.java | AssetsInner.updateAsync | public Observable<AssetInner> updateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) {
"""
Update an Asset.
Updates an existing Asset in the Media Services account.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param account... | java | public Observable<AssetInner> updateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) {
return updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).map(new Func1<ServiceResponse<AssetInner>, AssetInner>() {
@Override
... | [
"public",
"Observable",
"<",
"AssetInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"assetName",
",",
"AssetInner",
"parameters",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Update an Asset.
Updates an existing Asset in the Media Services account.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param assetName The Asset name.
@param parameters The request parameters
@throws IllegalArgumentException... | [
"Update",
"an",
"Asset",
".",
"Updates",
"an",
"existing",
"Asset",
"in",
"the",
"Media",
"Services",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/AssetsInner.java#L713-L720 |
phax/ph-commons | ph-json/src/main/java/com/helger/json/serialize/JsonReader.java | JsonReader.parseJson | @Nonnull
public static ESuccess parseJson (@Nonnull @WillClose final Reader aReader,
@Nonnull final IJsonParserHandler aParserHandler,
@Nullable final IJsonParserCustomizeCallback aCustomizeCallback,
@Nullable ... | java | @Nonnull
public static ESuccess parseJson (@Nonnull @WillClose final Reader aReader,
@Nonnull final IJsonParserHandler aParserHandler,
@Nullable final IJsonParserCustomizeCallback aCustomizeCallback,
@Nullable ... | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"parseJson",
"(",
"@",
"Nonnull",
"@",
"WillClose",
"final",
"Reader",
"aReader",
",",
"@",
"Nonnull",
"final",
"IJsonParserHandler",
"aParserHandler",
",",
"@",
"Nullable",
"final",
"IJsonParserCustomizeCallback",
"aC... | Generic JSON parse method. Usually this is not to be called manually - call
this only when you know what you are doing :)
@param aReader
The reader to read from. Should be buffered. May not be
<code>null</code>.
@param aParserHandler
The parser handler. May not be <code>null</code>.
@param aCustomizeCallback
An option... | [
"Generic",
"JSON",
"parse",
"method",
".",
"Usually",
"this",
"is",
"not",
"to",
"be",
"called",
"manually",
"-",
"call",
"this",
"only",
"when",
"you",
"know",
"what",
"you",
"are",
"doing",
":",
")"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-json/src/main/java/com/helger/json/serialize/JsonReader.java#L137-L167 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.