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 |
|---|---|---|---|---|---|---|---|---|---|---|
osglworks/java-mvc | src/main/java/org/osgl/mvc/result/NotFound.java | NotFound.of | public static NotFound of(Throwable cause) {
"""
Returns a static NotFound instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the cause
@return ... | java | public static NotFound of(Throwable cause) {
if (_localizedErrorMsg()) {
return of(cause, defaultMessage(NOT_FOUND));
} else {
touchPayload().cause(cause);
return _INSTANCE;
}
} | [
"public",
"static",
"NotFound",
"of",
"(",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"_localizedErrorMsg",
"(",
")",
")",
"{",
"return",
"of",
"(",
"cause",
",",
"defaultMessage",
"(",
"NOT_FOUND",
")",
")",
";",
"}",
"else",
"{",
"touchPayload",
"(",
... | Returns a static NotFound instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the cause
@return a static NotFound instance as described above | [
"Returns",
"a",
"static",
"NotFound",
"instance",
"and",
"set",
"the",
"{",
"@link",
"#payload",
"}",
"thread",
"local",
"with",
"cause",
"specified",
"."
] | train | https://github.com/osglworks/java-mvc/blob/4d2b2ec40498ac6ee7040c0424377cbeacab124b/src/main/java/org/osgl/mvc/result/NotFound.java#L132-L139 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/IsNullValue.java | IsNullValue.noKaboomNonNullValue | public static IsNullValue noKaboomNonNullValue(@Nonnull Location ins) {
"""
Get the instance representing a value known to be non-null because a NPE
would have occurred if it were null.
"""
if (ins == null) {
throw new NullPointerException("ins cannot be null");
}
return ne... | java | public static IsNullValue noKaboomNonNullValue(@Nonnull Location ins) {
if (ins == null) {
throw new NullPointerException("ins cannot be null");
}
return new IsNullValue(NO_KABOOM_NN, ins);
} | [
"public",
"static",
"IsNullValue",
"noKaboomNonNullValue",
"(",
"@",
"Nonnull",
"Location",
"ins",
")",
"{",
"if",
"(",
"ins",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"ins cannot be null\"",
")",
";",
"}",
"return",
"new",
"IsNul... | Get the instance representing a value known to be non-null because a NPE
would have occurred if it were null. | [
"Get",
"the",
"instance",
"representing",
"a",
"value",
"known",
"to",
"be",
"non",
"-",
"null",
"because",
"a",
"NPE",
"would",
"have",
"occurred",
"if",
"it",
"were",
"null",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/IsNullValue.java#L330-L335 |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/binding/BindingFactory.java | BindingFactory.bindAnnotatedWithNameToInstance | protected Binding bindAnnotatedWithNameToInstance(TypeReference bind, String name, String to,
String functionName) {
"""
Bind a type annotated with a name of the given value.
@param bind the type to bind.
@param name the name to consider.
@param to the instance.
@param functionName the optional function n... | java | protected Binding bindAnnotatedWithNameToInstance(TypeReference bind, String name, String to,
String functionName) {
String tmpName = Strings.emptyIfNull(name);
if (tmpName.startsWith(REFERENCE_PREFIX)) {
tmpName = tmpName.substring(REFERENCE_PREFIX.length()).trim();
} else {
tmpName = "\"" + tmpName + "... | [
"protected",
"Binding",
"bindAnnotatedWithNameToInstance",
"(",
"TypeReference",
"bind",
",",
"String",
"name",
",",
"String",
"to",
",",
"String",
"functionName",
")",
"{",
"String",
"tmpName",
"=",
"Strings",
".",
"emptyIfNull",
"(",
"name",
")",
";",
"if",
... | Bind a type annotated with a name of the given value.
@param bind the type to bind.
@param name the name to consider.
@param to the instance.
@param functionName the optional function name.
@return the binding element. | [
"Bind",
"a",
"type",
"annotated",
"with",
"a",
"name",
"of",
"the",
"given",
"value",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/binding/BindingFactory.java#L191-L219 |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/DataTableExtensions.java | DataTableExtensions.convertDataTable | private RecordList convertDataTable(AbstractDataTable table, DataSchema schema) {
"""
covert a gwtDatatable to an internal RecordList
@param table
@param schema
@return
"""
return dataTableConversionUtility.convertDataTableToRecordList(schema, table);
} | java | private RecordList convertDataTable(AbstractDataTable table, DataSchema schema) {
return dataTableConversionUtility.convertDataTableToRecordList(schema, table);
} | [
"private",
"RecordList",
"convertDataTable",
"(",
"AbstractDataTable",
"table",
",",
"DataSchema",
"schema",
")",
"{",
"return",
"dataTableConversionUtility",
".",
"convertDataTableToRecordList",
"(",
"schema",
",",
"table",
")",
";",
"}"
] | covert a gwtDatatable to an internal RecordList
@param table
@param schema
@return | [
"covert",
"a",
"gwtDatatable",
"to",
"an",
"internal",
"RecordList"
] | train | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/DataTableExtensions.java#L122-L124 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/PippoSettings.java | PippoSettings.addInterpolationValue | protected void addInterpolationValue(String name, String value) {
"""
Add a value that may be interpolated.
@param name
@param value
"""
interpolationValues.put(String.format("${%s}", name), value);
interpolationValues.put(String.format("@{%s}", name), value);
} | java | protected void addInterpolationValue(String name, String value) {
interpolationValues.put(String.format("${%s}", name), value);
interpolationValues.put(String.format("@{%s}", name), value);
} | [
"protected",
"void",
"addInterpolationValue",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"interpolationValues",
".",
"put",
"(",
"String",
".",
"format",
"(",
"\"${%s}\"",
",",
"name",
")",
",",
"value",
")",
";",
"interpolationValues",
".",
"p... | Add a value that may be interpolated.
@param name
@param value | [
"Add",
"a",
"value",
"that",
"may",
"be",
"interpolated",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/PippoSettings.java#L385-L388 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/jdbc/cloud/storage/StageInfo.java | StageInfo.createStageInfo | public static StageInfo createStageInfo(String locationType, String location, Map credentials,
String region, String endPoint, String storageAccount)
throws IllegalArgumentException {
"""
/*
Creates a StageInfo object
Validates that the necessary Stage info arguments a... | java | public static StageInfo createStageInfo(String locationType, String location, Map credentials,
String region, String endPoint, String storageAccount)
throws IllegalArgumentException
{
StageType stageType;
// Ensure that all the required parameters are specified
... | [
"public",
"static",
"StageInfo",
"createStageInfo",
"(",
"String",
"locationType",
",",
"String",
"location",
",",
"Map",
"credentials",
",",
"String",
"region",
",",
"String",
"endPoint",
",",
"String",
"storageAccount",
")",
"throws",
"IllegalArgumentException",
"... | /*
Creates a StageInfo object
Validates that the necessary Stage info arguments are specified
@param locationType the type of stage, i.e. AZURE/S3
@param location The container/bucket
@param credentials Map of cloud provider credentials
@param region The geographic region where the stage is located (S3 only)
@param en... | [
"/",
"*",
"Creates",
"a",
"StageInfo",
"object",
"Validates",
"that",
"the",
"necessary",
"Stage",
"info",
"arguments",
"are",
"specified"
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/jdbc/cloud/storage/StageInfo.java#L38-L75 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/msg/ReadCommEventLogResponse.java | ReadCommEventLogResponse.setEvent | public void setEvent(int index, int event) {
"""
setEvent -- store an event number in the event log
@param index Event position
@param event Event ID
"""
if (events == null || index < 0 || index >= events.length) {
throw new IndexOutOfBoundsException("index = " + index + ", limit = " + (e... | java | public void setEvent(int index, int event) {
if (events == null || index < 0 || index >= events.length) {
throw new IndexOutOfBoundsException("index = " + index + ", limit = " + (events == null ? "null" : events.length));
}
events[index] = (byte)event;
} | [
"public",
"void",
"setEvent",
"(",
"int",
"index",
",",
"int",
"event",
")",
"{",
"if",
"(",
"events",
"==",
"null",
"||",
"index",
"<",
"0",
"||",
"index",
">=",
"events",
".",
"length",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"i... | setEvent -- store an event number in the event log
@param index Event position
@param event Event ID | [
"setEvent",
"--",
"store",
"an",
"event",
"number",
"in",
"the",
"event",
"log"
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/msg/ReadCommEventLogResponse.java#L149-L155 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/Hermes.java | Hermes.loadModel | public static <T> T loadModel(@NonNull Object lock, @NonNull Language language, @NonNull String configProperty, @NonNull String modelName, @NonNull Supplier<T> modelGetter, @NonNull Consumer<T> modelSetter) {
"""
<p>Common method for loading a model using java deserialization. The method uses the double-checked lo... | java | public static <T> T loadModel(@NonNull Object lock, @NonNull Language language, @NonNull String configProperty, @NonNull String modelName, @NonNull Supplier<T> modelGetter, @NonNull Consumer<T> modelSetter) {
if (modelGetter.get() == null) {
synchronized (lock) {
if (modelGetter.get() == null... | [
"public",
"static",
"<",
"T",
">",
"T",
"loadModel",
"(",
"@",
"NonNull",
"Object",
"lock",
",",
"@",
"NonNull",
"Language",
"language",
",",
"@",
"NonNull",
"String",
"configProperty",
",",
"@",
"NonNull",
"String",
"modelName",
",",
"@",
"NonNull",
"Supp... | <p>Common method for loading a model using java deserialization. The method uses the double-checked locking where
it synchronizes on the given <code>lock</code> object. The <code>modelGetter</code> is used to check if the model
is already loaded and the <code>modelSetter</code> is used to set the model. </p>
<p>The me... | [
"<p",
">",
"Common",
"method",
"for",
"loading",
"a",
"model",
"using",
"java",
"deserialization",
".",
"The",
"method",
"uses",
"the",
"double",
"-",
"checked",
"locking",
"where",
"it",
"synchronizes",
"on",
"the",
"given",
"<code",
">",
"lock<",
"/",
"c... | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/Hermes.java#L218-L241 |
windup/windup | graph/api/src/main/java/org/jboss/windup/graph/service/ArchiveService.java | ArchiveService.getChildFile | public FileModel getChildFile(ArchiveModel archiveModel, String filePath) {
"""
Finds the file at the provided path within the archive.
Eg, getChildFile(ArchiveModel, "/META-INF/MANIFEST.MF") will return a {@link FileModel} if a file named
/META-INF/MANIFEST.MF exists within the archive
@return Returns the ... | java | public FileModel getChildFile(ArchiveModel archiveModel, String filePath)
{
filePath = FilenameUtils.separatorsToUnix(filePath);
StringTokenizer stk = new StringTokenizer(filePath, "/");
FileModel currentFileModel = archiveModel;
while (stk.hasMoreTokens() && currentFileModel != nul... | [
"public",
"FileModel",
"getChildFile",
"(",
"ArchiveModel",
"archiveModel",
",",
"String",
"filePath",
")",
"{",
"filePath",
"=",
"FilenameUtils",
".",
"separatorsToUnix",
"(",
"filePath",
")",
";",
"StringTokenizer",
"stk",
"=",
"new",
"StringTokenizer",
"(",
"fi... | Finds the file at the provided path within the archive.
Eg, getChildFile(ArchiveModel, "/META-INF/MANIFEST.MF") will return a {@link FileModel} if a file named
/META-INF/MANIFEST.MF exists within the archive
@return Returns the located {@link FileModel} or null if no file with this path could be located | [
"Finds",
"the",
"file",
"at",
"the",
"provided",
"path",
"within",
"the",
"archive",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/graph/api/src/main/java/org/jboss/windup/graph/service/ArchiveService.java#L50-L63 |
Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/KDTree.java | KDTree.determineAssignments | protected void determineAssignments(KDTreeNode node, Instances centers,
int[] candidates, int[] assignments, double pc) throws Exception {
"""
Assigns instances to the current centers called candidates.
@param node The node to start assigning the instances from.
@param centers all the current centers.
@... | java | protected void determineAssignments(KDTreeNode node, Instances centers,
int[] candidates, int[] assignments, double pc) throws Exception {
// reduce number of owners for current hyper rectangle
int[] owners = refineOwners(node, centers, candidates);
// only one owner
if (owners.length == 1) {
... | [
"protected",
"void",
"determineAssignments",
"(",
"KDTreeNode",
"node",
",",
"Instances",
"centers",
",",
"int",
"[",
"]",
"candidates",
",",
"int",
"[",
"]",
"assignments",
",",
"double",
"pc",
")",
"throws",
"Exception",
"{",
"// reduce number of owners for curr... | Assigns instances to the current centers called candidates.
@param node The node to start assigning the instances from.
@param centers all the current centers.
@param candidates the current centers the method works on.
@param assignments the center index for each instance.
@param pc the threshold value for pruning.
@t... | [
"Assigns",
"instances",
"to",
"the",
"current",
"centers",
"called",
"candidates",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/KDTree.java#L722-L744 |
theHilikus/JRoboCom | jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java | World.move | public void move(Robot robot) {
"""
Changes the position of a robot to its current reference field
@param robot the robot
"""
if (!robotsPosition.containsKey(robot)) {
throw new IllegalArgumentException("Robot doesn't exist");
}
if (!robot.getData().isMobile()) {
throw new IllegalArgumentExcept... | java | public void move(Robot robot) {
if (!robotsPosition.containsKey(robot)) {
throw new IllegalArgumentException("Robot doesn't exist");
}
if (!robot.getData().isMobile()) {
throw new IllegalArgumentException("Robot can't move");
}
Point newPosition = getReferenceField(robot, 1);
if (!isOccupied(newPositio... | [
"public",
"void",
"move",
"(",
"Robot",
"robot",
")",
"{",
"if",
"(",
"!",
"robotsPosition",
".",
"containsKey",
"(",
"robot",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Robot doesn't exist\"",
")",
";",
"}",
"if",
"(",
"!",
"robot"... | Changes the position of a robot to its current reference field
@param robot the robot | [
"Changes",
"the",
"position",
"of",
"a",
"robot",
"to",
"its",
"current",
"reference",
"field"
] | train | https://github.com/theHilikus/JRoboCom/blob/0e31c1ecf1006e35f68c229ff66c37640effffac/jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java#L188-L203 |
cbeust/jcommander | src/main/java/com/beust/jcommander/DefaultUsageFormatter.java | DefaultUsageFormatter.appendCommands | public void appendCommands(StringBuilder out, int indentCount, int descriptionIndent, String indent) {
"""
Appends the details of all commands to the argument string builder, indenting every line with
<tt>indentCount</tt>-many <tt>indent</tt>. The commands are obtained from calling
{@link JCommander#getRawComman... | java | public void appendCommands(StringBuilder out, int indentCount, int descriptionIndent, String indent) {
out.append(indent + " Commands:\n");
// The magic value 3 is the number of spaces between the name of the option and its description
for (Map.Entry<JCommander.ProgramName, JCommander> command... | [
"public",
"void",
"appendCommands",
"(",
"StringBuilder",
"out",
",",
"int",
"indentCount",
",",
"int",
"descriptionIndent",
",",
"String",
"indent",
")",
"{",
"out",
".",
"append",
"(",
"indent",
"+",
"\" Commands:\\n\"",
")",
";",
"// The magic value 3 is the n... | Appends the details of all commands to the argument string builder, indenting every line with
<tt>indentCount</tt>-many <tt>indent</tt>. The commands are obtained from calling
{@link JCommander#getRawCommands()} and the commands are resolved using
{@link JCommander#findCommandByAlias(String)} on the underlying commande... | [
"Appends",
"the",
"details",
"of",
"all",
"commands",
"to",
"the",
"argument",
"string",
"builder",
"indenting",
"every",
"line",
"with",
"<tt",
">",
"indentCount<",
"/",
"tt",
">",
"-",
"many",
"<tt",
">",
"indent<",
"/",
"tt",
">",
".",
"The",
"command... | train | https://github.com/cbeust/jcommander/blob/85cb6f7217e15f62225185ffd97491f34b7b49bb/src/main/java/com/beust/jcommander/DefaultUsageFormatter.java#L246-L267 |
buschmais/jqa-core-framework | report/src/main/java/com/buschmais/jqassistant/core/report/api/LanguageHelper.java | LanguageHelper.getAnnotationValue | private static <T> T getAnnotationValue(Annotation annotation, String value, Class<T> expectedType) {
"""
Return a value from an annotation.
@param annotation
The annotation.
@param value
The value.
@param expectedType
The expected type.
@param <T>
The expected type.
@return The value.
"""
C... | java | private static <T> T getAnnotationValue(Annotation annotation, String value, Class<T> expectedType) {
Class<? extends Annotation> annotationType = annotation.annotationType();
Method valueMethod;
try {
valueMethod = annotationType.getDeclaredMethod(value);
} catch (NoSuchMeth... | [
"private",
"static",
"<",
"T",
">",
"T",
"getAnnotationValue",
"(",
"Annotation",
"annotation",
",",
"String",
"value",
",",
"Class",
"<",
"T",
">",
"expectedType",
")",
"{",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationType",
"=",
"annotation... | Return a value from an annotation.
@param annotation
The annotation.
@param value
The value.
@param expectedType
The expected type.
@param <T>
The expected type.
@return The value. | [
"Return",
"a",
"value",
"from",
"an",
"annotation",
"."
] | train | https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/report/src/main/java/com/buschmais/jqassistant/core/report/api/LanguageHelper.java#L56-L71 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/URLConnectionTools.java | URLConnectionTools.doPOST | public static InputStream doPOST(URL url, String data, int timeout) throws IOException {
"""
Do a POST to a URL and return the response stream for further processing elsewhere.
<p>
The caller is responsible to close the returned InputStream not to cause
resource leaks.
@param url the input URL to be read
@par... | java | public static InputStream doPOST(URL url, String data, int timeout) throws IOException
{
URLConnection conn = openURLConnection(url, timeout);
conn.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();
return conn.getInputStream();
} | [
"public",
"static",
"InputStream",
"doPOST",
"(",
"URL",
"url",
",",
"String",
"data",
",",
"int",
"timeout",
")",
"throws",
"IOException",
"{",
"URLConnection",
"conn",
"=",
"openURLConnection",
"(",
"url",
",",
"timeout",
")",
";",
"conn",
".",
"setDoOutpu... | Do a POST to a URL and return the response stream for further processing elsewhere.
<p>
The caller is responsible to close the returned InputStream not to cause
resource leaks.
@param url the input URL to be read
@param data the post data
@param timeout
@return an {@link InputStream} of response
@throws IOException due... | [
"Do",
"a",
"POST",
"to",
"a",
"URL",
"and",
"return",
"the",
"response",
"stream",
"for",
"further",
"processing",
"elsewhere",
".",
"<p",
">",
"The",
"caller",
"is",
"responsible",
"to",
"close",
"the",
"returned",
"InputStream",
"not",
"to",
"cause",
"re... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/URLConnectionTools.java#L171-L179 |
infinispan/infinispan | core/src/main/java/org/infinispan/configuration/parsing/ParseUtils.java | ParseUtils.unexpectedAttribute | public static XMLStreamException unexpectedAttribute(final XMLStreamReader reader, final int index) {
"""
Get an exception reporting an unexpected XML attribute.
@param reader the stream reader
@param index the attribute index
@return the exception
"""
return new XMLStreamException("Unexpected attri... | java | public static XMLStreamException unexpectedAttribute(final XMLStreamReader reader, final int index) {
return new XMLStreamException("Unexpected attribute '" + reader.getAttributeName(index) + "' encountered",
reader.getLocation());
} | [
"public",
"static",
"XMLStreamException",
"unexpectedAttribute",
"(",
"final",
"XMLStreamReader",
"reader",
",",
"final",
"int",
"index",
")",
"{",
"return",
"new",
"XMLStreamException",
"(",
"\"Unexpected attribute '\"",
"+",
"reader",
".",
"getAttributeName",
"(",
"... | Get an exception reporting an unexpected XML attribute.
@param reader the stream reader
@param index the attribute index
@return the exception | [
"Get",
"an",
"exception",
"reporting",
"an",
"unexpected",
"XML",
"attribute",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/configuration/parsing/ParseUtils.java#L55-L58 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getAddTaggedCommentRequest | public BoxRequestsFile.AddTaggedCommentToFile getAddTaggedCommentRequest(String fileId, String taggedMessage) {
"""
Gets a request for adding a comment with tags that mention users.
The server will notify mentioned users of the comment.
Tagged users must be collaborators of the parent folder.
Format for addin... | java | public BoxRequestsFile.AddTaggedCommentToFile getAddTaggedCommentRequest(String fileId, String taggedMessage) {
BoxRequestsFile.AddTaggedCommentToFile request = new BoxRequestsFile.AddTaggedCommentToFile(
fileId, taggedMessage, getCommentUrl(), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"AddTaggedCommentToFile",
"getAddTaggedCommentRequest",
"(",
"String",
"fileId",
",",
"String",
"taggedMessage",
")",
"{",
"BoxRequestsFile",
".",
"AddTaggedCommentToFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"AddTaggedCommentToF... | Gets a request for adding a comment with tags that mention users.
The server will notify mentioned users of the comment.
Tagged users must be collaborators of the parent folder.
Format for adding a tag @[userid:username], E.g. "Hello @[12345:Jane Doe]" will create a comment
'Hello Jane Doe', and notify Jane that she h... | [
"Gets",
"a",
"request",
"for",
"adding",
"a",
"comment",
"with",
"tags",
"that",
"mention",
"users",
".",
"The",
"server",
"will",
"notify",
"mentioned",
"users",
"of",
"the",
"comment",
"."
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L299-L303 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java | ColumnFamilyRecordReader.next | public boolean next(ByteBuffer key, SortedMap<ByteBuffer, Cell> value) throws IOException {
"""
and ColumnFamilyRecordReader don't support them, it should be fine for now.
"""
if (this.nextKeyValue())
{
key.clear();
key.put(this.getCurrentKey().duplicate());
... | java | public boolean next(ByteBuffer key, SortedMap<ByteBuffer, Cell> value) throws IOException
{
if (this.nextKeyValue())
{
key.clear();
key.put(this.getCurrentKey().duplicate());
key.flip();
value.clear();
value.putAll(this.getCurrentValue());... | [
"public",
"boolean",
"next",
"(",
"ByteBuffer",
"key",
",",
"SortedMap",
"<",
"ByteBuffer",
",",
"Cell",
">",
"value",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"nextKeyValue",
"(",
")",
")",
"{",
"key",
".",
"clear",
"(",
")",
";",
... | and ColumnFamilyRecordReader don't support them, it should be fine for now. | [
"and",
"ColumnFamilyRecordReader",
"don",
"t",
"support",
"them",
"it",
"should",
"be",
"fine",
"for",
"now",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java#L564-L578 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/Logger.java | Logger.getMessage | public String getMessage(final Marker aMarker, final String aMessage, final Object... aDetails) {
"""
Gets a message from the logger's backing resource bundle if what's passed in is a message key; if it's not then
what's passed in is, itself, returned. If what's passed in is the same thing as what's returned, any... | java | public String getMessage(final Marker aMarker, final String aMessage, final Object... aDetails) {
final String[] details = new String[aDetails.length];
final String message;
addMarker(aMarker);
for (int index = 0; index < details.length; index++) {
details[index] = updateMe... | [
"public",
"String",
"getMessage",
"(",
"final",
"Marker",
"aMarker",
",",
"final",
"String",
"aMessage",
",",
"final",
"Object",
"...",
"aDetails",
")",
"{",
"final",
"String",
"[",
"]",
"details",
"=",
"new",
"String",
"[",
"aDetails",
".",
"length",
"]",... | Gets a message from the logger's backing resource bundle if what's passed in is a message key; if it's not then
what's passed in is, itself, returned. If what's passed in is the same thing as what's returned, any additional
details passed in are ignored.
@param aMarker A marker than can affect logging behavior
@param ... | [
"Gets",
"a",
"message",
"from",
"the",
"logger",
"s",
"backing",
"resource",
"bundle",
"if",
"what",
"s",
"passed",
"in",
"is",
"a",
"message",
"key",
";",
"if",
"it",
"s",
"not",
"then",
"what",
"s",
"passed",
"in",
"is",
"itself",
"returned",
".",
... | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/Logger.java#L1164-L1185 |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationSingle.java | SelfCalibrationLinearRotationSingle.estimate | public boolean estimate(List<Homography2D_F64> viewsI_to_view0 , CameraPinhole calibration ) {
"""
Assumes that the camera parameter are constant
@param viewsI_to_view0 (Input) List of observed homographies. Modified so that determinant is one.
@param calibration (Output) found calibration
@return true if succe... | java | public boolean estimate(List<Homography2D_F64> viewsI_to_view0 , CameraPinhole calibration ) {
singular = false;
int N = viewsI_to_view0.size();
ensureDeterminantOfOne(viewsI_to_view0);
A.reshape(N*6,6);
for (int i = 0; i < N; i++) {
add(i,viewsI_to_view0.get(i),A);
}
// Compute the SVD for its nul... | [
"public",
"boolean",
"estimate",
"(",
"List",
"<",
"Homography2D_F64",
">",
"viewsI_to_view0",
",",
"CameraPinhole",
"calibration",
")",
"{",
"singular",
"=",
"false",
";",
"int",
"N",
"=",
"viewsI_to_view0",
".",
"size",
"(",
")",
";",
"ensureDeterminantOfOne",... | Assumes that the camera parameter are constant
@param viewsI_to_view0 (Input) List of observed homographies. Modified so that determinant is one.
@param calibration (Output) found calibration
@return true if successful | [
"Assumes",
"that",
"the",
"camera",
"parameter",
"are",
"constant"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationSingle.java#L70-L101 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/content/CmsPropertyDelete.java | CmsPropertyDelete.actionDeleteCascade | public void actionDeleteCascade() throws JspException {
"""
Deletes the property definition by cascading the properties on resources.<p>
@throws JspException if problems including sub-elements occur
"""
// save initialized instance of this class in request attribute for included sub-elements
... | java | public void actionDeleteCascade() throws JspException {
// save initialized instance of this class in request attribute for included sub-elements
getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
try {
// list of all resources containing this propertydefinition
... | [
"public",
"void",
"actionDeleteCascade",
"(",
")",
"throws",
"JspException",
"{",
"// save initialized instance of this class in request attribute for included sub-elements",
"getJsp",
"(",
")",
".",
"getRequest",
"(",
")",
".",
"setAttribute",
"(",
"SESSION_WORKPLACE_CLASS",
... | Deletes the property definition by cascading the properties on resources.<p>
@throws JspException if problems including sub-elements occur | [
"Deletes",
"the",
"property",
"definition",
"by",
"cascading",
"the",
"properties",
"on",
"resources",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/content/CmsPropertyDelete.java#L120-L183 |
guppy4j/libraries | static/src/main/java/org/guppy4j/Objects.java | Objects.castIfSameClass | public static <T> T castIfSameClass(Object o, Class<T> c) {
"""
Conditional casting, useful for typical equals() implementations
@param o The other object
@param c The class to check for
@param <T> The generic type of the target class
@return The object cast as a T, or null if o.getClass() is not c
"... | java | public static <T> T castIfSameClass(Object o, Class<T> c) {
return o != null && o.getClass() == c ? c.cast(o) : null;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"castIfSameClass",
"(",
"Object",
"o",
",",
"Class",
"<",
"T",
">",
"c",
")",
"{",
"return",
"o",
"!=",
"null",
"&&",
"o",
".",
"getClass",
"(",
")",
"==",
"c",
"?",
"c",
".",
"cast",
"(",
"o",
")",
":"... | Conditional casting, useful for typical equals() implementations
@param o The other object
@param c The class to check for
@param <T> The generic type of the target class
@return The object cast as a T, or null if o.getClass() is not c | [
"Conditional",
"casting",
"useful",
"for",
"typical",
"equals",
"()",
"implementations"
] | train | https://github.com/guppy4j/libraries/blob/5d7a0a7b3fe1ad5c907a5c232b8187727f51f474/static/src/main/java/org/guppy4j/Objects.java#L20-L22 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/TimingInfo.java | TimingInfo.durationMilliOf | public static double durationMilliOf(long startTimeNano, long endTimeNano) {
"""
Returns the duration in milliseconds as double, preserving the decimal
precision as necessary, for the given start and end time in nanoseconds.
"""
double micros = (double)TimeUnit.NANOSECONDS.toMicros(endTimeNano - start... | java | public static double durationMilliOf(long startTimeNano, long endTimeNano) {
double micros = (double)TimeUnit.NANOSECONDS.toMicros(endTimeNano - startTimeNano);
return micros / 1000.0; // convert microseconds to milliseconds in double rather than long, preserving the precision
} | [
"public",
"static",
"double",
"durationMilliOf",
"(",
"long",
"startTimeNano",
",",
"long",
"endTimeNano",
")",
"{",
"double",
"micros",
"=",
"(",
"double",
")",
"TimeUnit",
".",
"NANOSECONDS",
".",
"toMicros",
"(",
"endTimeNano",
"-",
"startTimeNano",
")",
";... | Returns the duration in milliseconds as double, preserving the decimal
precision as necessary, for the given start and end time in nanoseconds. | [
"Returns",
"the",
"duration",
"in",
"milliseconds",
"as",
"double",
"preserving",
"the",
"decimal",
"precision",
"as",
"necessary",
"for",
"the",
"given",
"start",
"and",
"end",
"time",
"in",
"nanoseconds",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/TimingInfo.java#L234-L237 |
apache/incubator-druid | sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java | Expressions.toQueryGranularity | @Nullable
public static Granularity toQueryGranularity(final DruidExpression expression, final ExprMacroTable macroTable) {
"""
Converts an expression to a Granularity, if possible. This is possible if, and only if, the expression
is a timestamp_floor function on the __time column with literal parameters for pe... | java | @Nullable
public static Granularity toQueryGranularity(final DruidExpression expression, final ExprMacroTable macroTable)
{
final TimestampFloorExprMacro.TimestampFloorExpr expr = asTimestampFloorExpr(expression, macroTable);
if (expr == null) {
return null;
}
final Expr arg = expr.getArg();... | [
"@",
"Nullable",
"public",
"static",
"Granularity",
"toQueryGranularity",
"(",
"final",
"DruidExpression",
"expression",
",",
"final",
"ExprMacroTable",
"macroTable",
")",
"{",
"final",
"TimestampFloorExprMacro",
".",
"TimestampFloorExpr",
"expr",
"=",
"asTimestampFloorEx... | Converts an expression to a Granularity, if possible. This is possible if, and only if, the expression
is a timestamp_floor function on the __time column with literal parameters for period, origin, and timeZone.
@return granularity or null if not possible | [
"Converts",
"an",
"expression",
"to",
"a",
"Granularity",
"if",
"possible",
".",
"This",
"is",
"possible",
"if",
"and",
"only",
"if",
"the",
"expression",
"is",
"a",
"timestamp_floor",
"function",
"on",
"the",
"__time",
"column",
"with",
"literal",
"parameters... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java#L573-L590 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/MutableArray.java | MutableArray.setBlob | @NonNull
@Override
public MutableArray setBlob(int index, Blob value) {
"""
Sets a Blob object at the given index.
@param index the index. This value must not exceed the bounds of the array.
@param value the Blob object
@return The self object
"""
return setValue(index, value);
} | java | @NonNull
@Override
public MutableArray setBlob(int index, Blob value) {
return setValue(index, value);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"MutableArray",
"setBlob",
"(",
"int",
"index",
",",
"Blob",
"value",
")",
"{",
"return",
"setValue",
"(",
"index",
",",
"value",
")",
";",
"}"
] | Sets a Blob object at the given index.
@param index the index. This value must not exceed the bounds of the array.
@param value the Blob object
@return The self object | [
"Sets",
"a",
"Blob",
"object",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L208-L212 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java | JvmTypesBuilder.setInitializer | public void setInitializer(/* @Nullable */ JvmField field, /* @Nullable */ Procedures.Procedure1<ITreeAppendable> strategy) {
"""
Attaches the given compile strategy to the given {@link JvmField} such that the compiler knows how to
initialize the {@link JvmField} when it is translated to Java source code.
@par... | java | public void setInitializer(/* @Nullable */ JvmField field, /* @Nullable */ Procedures.Procedure1<ITreeAppendable> strategy) {
if (field == null || strategy == null)
return;
removeExistingBody(field);
setCompilationStrategy(field, strategy);
} | [
"public",
"void",
"setInitializer",
"(",
"/* @Nullable */",
"JvmField",
"field",
",",
"/* @Nullable */",
"Procedures",
".",
"Procedure1",
"<",
"ITreeAppendable",
">",
"strategy",
")",
"{",
"if",
"(",
"field",
"==",
"null",
"||",
"strategy",
"==",
"null",
")",
... | Attaches the given compile strategy to the given {@link JvmField} such that the compiler knows how to
initialize the {@link JvmField} when it is translated to Java source code.
@param field the field to add the initializer to. If <code>null</code> this method does nothing.
@param strategy the compilation strategy. If ... | [
"Attaches",
"the",
"given",
"compile",
"strategy",
"to",
"the",
"given",
"{",
"@link",
"JvmField",
"}",
"such",
"that",
"the",
"compiler",
"knows",
"how",
"to",
"initialize",
"the",
"{",
"@link",
"JvmField",
"}",
"when",
"it",
"is",
"translated",
"to",
"Ja... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java#L1230-L1235 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository/src/com/ibm/ws/repository/resources/internal/RepositoryResourceImpl.java | RepositoryResourceImpl.getCRC | private static long getCRC(InputStream is) throws IOException {
"""
Get the CRC of a file from an InputStream
@param is The input stream to obtain the CRC from
@return a long representing the CRC value of the data read from the supplied input stream
@throws IOException
"""
CheckedInputStream check... | java | private static long getCRC(InputStream is) throws IOException {
CheckedInputStream check = new CheckedInputStream(is, new CRC32());
BufferedInputStream in = new BufferedInputStream(check);
while (in.read() != -1) {
// Read file in completely
}
long crc = check.getChec... | [
"private",
"static",
"long",
"getCRC",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"CheckedInputStream",
"check",
"=",
"new",
"CheckedInputStream",
"(",
"is",
",",
"new",
"CRC32",
"(",
")",
")",
";",
"BufferedInputStream",
"in",
"=",
"new",
... | Get the CRC of a file from an InputStream
@param is The input stream to obtain the CRC from
@return a long representing the CRC value of the data read from the supplied input stream
@throws IOException | [
"Get",
"the",
"CRC",
"of",
"a",
"file",
"from",
"an",
"InputStream"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/resources/internal/RepositoryResourceImpl.java#L1548-L1556 |
haraldk/TwelveMonkeys | common/common-io/src/main/java/com/twelvemonkeys/io/FilenameMaskFilter.java | FilenameMaskFilter.accept | public boolean accept(File pDir, String pName) {
"""
This method implements the {@code java.io.FilenameFilter} interface.
@param pDir the directory in which the file was found.
@param pName the name of the file.
@return {@code true} if the file {@code pName} should be included in the file
list; {@code false... | java | public boolean accept(File pDir, String pName) {
WildcardStringParser parser;
// Check each filename string mask whether the file is to be accepted
if (inclusion) { // Inclusion
for (String mask : filenameMasksForInclusion) {
parser = new WildcardStringParser(... | [
"public",
"boolean",
"accept",
"(",
"File",
"pDir",
",",
"String",
"pName",
")",
"{",
"WildcardStringParser",
"parser",
";",
"// Check each filename string mask whether the file is to be accepted\r",
"if",
"(",
"inclusion",
")",
"{",
"// Inclusion\r",
"for",
"(",
"Strin... | This method implements the {@code java.io.FilenameFilter} interface.
@param pDir the directory in which the file was found.
@param pName the name of the file.
@return {@code true} if the file {@code pName} should be included in the file
list; {@code false} otherwise. | [
"This",
"method",
"implements",
"the",
"{",
"@code",
"java",
".",
"io",
".",
"FilenameFilter",
"}",
"interface",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-io/src/main/java/com/twelvemonkeys/io/FilenameMaskFilter.java#L168-L203 |
LearnLib/automatalib | util/src/main/java/net/automatalib/util/minimizer/BlockMap.java | BlockMap.get | @SuppressWarnings("unchecked")
@Override
public V get(Block<?, ?> block) {
"""
Retrieves a value.
@param block
the block.
@return the associated value.
"""
return (V) storage[block.getId()];
} | java | @SuppressWarnings("unchecked")
@Override
public V get(Block<?, ?> block) {
return (V) storage[block.getId()];
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"V",
"get",
"(",
"Block",
"<",
"?",
",",
"?",
">",
"block",
")",
"{",
"return",
"(",
"V",
")",
"storage",
"[",
"block",
".",
"getId",
"(",
")",
"]",
";",
"}"
] | Retrieves a value.
@param block
the block.
@return the associated value. | [
"Retrieves",
"a",
"value",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/util/src/main/java/net/automatalib/util/minimizer/BlockMap.java#L56-L60 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/GeneralizedCounter.java | GeneralizedCounter.incrementCount | public void incrementCount(List<K> l, double count) {
"""
adds to count for the {@link #depth()}-dimensional key <code>l</code>.
"""
if (l.size() != depth) {
wrongDepth(); //throws exception
}
GeneralizedCounter<K> next = this;
Iterator<K> i = l.iterator();
K o = i.next();
... | java | public void incrementCount(List<K> l, double count) {
if (l.size() != depth) {
wrongDepth(); //throws exception
}
GeneralizedCounter<K> next = this;
Iterator<K> i = l.iterator();
K o = i.next();
while (i.hasNext()) {
next.addToTotal(count);
next = next.conditionalize... | [
"public",
"void",
"incrementCount",
"(",
"List",
"<",
"K",
">",
"l",
",",
"double",
"count",
")",
"{",
"if",
"(",
"l",
".",
"size",
"(",
")",
"!=",
"depth",
")",
"{",
"wrongDepth",
"(",
")",
";",
"//throws exception\r",
"}",
"GeneralizedCounter",
"<",
... | adds to count for the {@link #depth()}-dimensional key <code>l</code>. | [
"adds",
"to",
"count",
"for",
"the",
"{"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/GeneralizedCounter.java#L465-L479 |
drewnoakes/metadata-extractor | Source/com/drew/metadata/eps/EpsReader.java | EpsReader.extractXmpData | private static void extractXmpData(@NotNull final Metadata metadata, @NotNull SequentialReader reader) throws IOException {
"""
Extracts an XMP xpacket, and uses {@link XmpReader} to decode the resulting data.
"""
byte[] bytes = readUntil(reader, "<?xpacket end=\"w\"?>".getBytes());
String xmp ... | java | private static void extractXmpData(@NotNull final Metadata metadata, @NotNull SequentialReader reader) throws IOException
{
byte[] bytes = readUntil(reader, "<?xpacket end=\"w\"?>".getBytes());
String xmp = new String(bytes, Charsets.UTF_8);
new XmpReader().extract(xmp, metadata);
} | [
"private",
"static",
"void",
"extractXmpData",
"(",
"@",
"NotNull",
"final",
"Metadata",
"metadata",
",",
"@",
"NotNull",
"SequentialReader",
"reader",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"readUntil",
"(",
"reader",
",",
"\"<?xpa... | Extracts an XMP xpacket, and uses {@link XmpReader} to decode the resulting data. | [
"Extracts",
"an",
"XMP",
"xpacket",
"and",
"uses",
"{"
] | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/metadata/eps/EpsReader.java#L254-L259 |
bbottema/simple-java-mail | modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageHelper.java | MimeMessageHelper.setReplyTo | static void setReplyTo(final Email email, final Message message)
throws UnsupportedEncodingException, MessagingException {
"""
Fills the {@link Message} instance with reply-to address.
@param email The message in which the recipients are defined.
@param message The javax message that needs to be filled wi... | java | static void setReplyTo(final Email email, final Message message)
throws UnsupportedEncodingException, MessagingException {
final Recipient replyToRecipient = email.getReplyToRecipient();
if (replyToRecipient != null) {
final InternetAddress replyToAddress = new InternetAddress(replyToRecipient.getAddress(), r... | [
"static",
"void",
"setReplyTo",
"(",
"final",
"Email",
"email",
",",
"final",
"Message",
"message",
")",
"throws",
"UnsupportedEncodingException",
",",
"MessagingException",
"{",
"final",
"Recipient",
"replyToRecipient",
"=",
"email",
".",
"getReplyToRecipient",
"(",
... | Fills the {@link Message} instance with reply-to address.
@param email The message in which the recipients are defined.
@param message The javax message that needs to be filled with reply-to address.
@throws UnsupportedEncodingException See {@link InternetAddress#InternetAddress(String, String)}.
@throws MessagingEx... | [
"Fills",
"the",
"{",
"@link",
"Message",
"}",
"instance",
"with",
"reply",
"-",
"to",
"address",
"."
] | train | https://github.com/bbottema/simple-java-mail/blob/b03635328aeecd525e35eddfef8f5b9a184559d8/modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageHelper.java#L79-L87 |
spotify/scio | scio-bigquery/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/PatchedBigQueryTableRowIterator.java | PatchedBigQueryTableRowIterator.getTypedTableRow | private TableRow getTypedTableRow(List<TableFieldSchema> fields, Map<String, Object> rawRow) {
"""
Converts a row returned from the BigQuery JSON API as a {@code Map<String, Object>} into a
Java {@link TableRow} with nested {@link TableCell TableCells}. The {@code Object} values in
the cells are converted to Jav... | java | private TableRow getTypedTableRow(List<TableFieldSchema> fields, Map<String, Object> rawRow) {
// If rawRow is a TableRow, use it. If not, create a new one.
TableRow row;
List<? extends Map<String, Object>> cells;
if (rawRow instanceof TableRow) {
// Since rawRow is a TableRow it already has Table... | [
"private",
"TableRow",
"getTypedTableRow",
"(",
"List",
"<",
"TableFieldSchema",
">",
"fields",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"rawRow",
")",
"{",
"// If rawRow is a TableRow, use it. If not, create a new one.",
"TableRow",
"row",
";",
"List",
"<",
"... | Converts a row returned from the BigQuery JSON API as a {@code Map<String, Object>} into a
Java {@link TableRow} with nested {@link TableCell TableCells}. The {@code Object} values in
the cells are converted to Java types according to the provided field schemas.
<p>See {@link #getTypedCellValue(TableFieldSchema, Objec... | [
"Converts",
"a",
"row",
"returned",
"from",
"the",
"BigQuery",
"JSON",
"API",
"as",
"a",
"{",
"@code",
"Map<String",
"Object",
">",
"}",
"into",
"a",
"Java",
"{",
"@link",
"TableRow",
"}",
"with",
"nested",
"{",
"@link",
"TableCell",
"TableCells",
"}",
"... | train | https://github.com/spotify/scio/blob/ed9a44428251b0c6834aad231b463d8eda418471/scio-bigquery/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/PatchedBigQueryTableRowIterator.java#L271-L325 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/Response.java | Response.removeCookie | public Response removeCookie(String name) {
"""
Removes the specified cookie by name.
@param name
@return the response
"""
Cookie cookie = new Cookie(name, "");
cookie.setSecure(true);
cookie.setMaxAge(0);
addCookie(cookie);
return this;
} | java | public Response removeCookie(String name) {
Cookie cookie = new Cookie(name, "");
cookie.setSecure(true);
cookie.setMaxAge(0);
addCookie(cookie);
return this;
} | [
"public",
"Response",
"removeCookie",
"(",
"String",
"name",
")",
"{",
"Cookie",
"cookie",
"=",
"new",
"Cookie",
"(",
"name",
",",
"\"\"",
")",
";",
"cookie",
".",
"setSecure",
"(",
"true",
")",
";",
"cookie",
".",
"setMaxAge",
"(",
"0",
")",
";",
"a... | Removes the specified cookie by name.
@param name
@return the response | [
"Removes",
"the",
"specified",
"cookie",
"by",
"name",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/Response.java#L247-L254 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionSpecificationOptionValuePersistenceImpl.java | CPDefinitionSpecificationOptionValuePersistenceImpl.findByC_COC | @Override
public List<CPDefinitionSpecificationOptionValue> findByC_COC(
long CPDefinitionId, long CPOptionCategoryId, int start, int end) {
"""
Returns a range of all the cp definition specification option values where CPDefinitionId = ? and CPOptionCategoryId = ?.
<p>
Useful when paginating result... | java | @Override
public List<CPDefinitionSpecificationOptionValue> findByC_COC(
long CPDefinitionId, long CPOptionCategoryId, int start, int end) {
return findByC_COC(CPDefinitionId, CPOptionCategoryId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionSpecificationOptionValue",
">",
"findByC_COC",
"(",
"long",
"CPDefinitionId",
",",
"long",
"CPOptionCategoryId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByC_COC",
"(",
"CPDefinitionId",
... | Returns a range of all the cp definition specification option values where CPDefinitionId = ? and CPOptionCategoryId = ?.
<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... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"definition",
"specification",
"option",
"values",
"where",
"CPDefinitionId",
"=",
"?",
";",
"and",
"CPOptionCategoryId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionSpecificationOptionValuePersistenceImpl.java#L3689-L3693 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.extractPlaceHolders | private <L extends Collection<JQLPlaceHolder>> L extractPlaceHolders(final JQLContext jqlContext, String jql, final L result) {
"""
Extract place holders.
@param <L>
the generic type
@param jqlContext
the jql context
@param jql
the jql
@param result
the result
@return the l
"""
final One<Boolean> ... | java | private <L extends Collection<JQLPlaceHolder>> L extractPlaceHolders(final JQLContext jqlContext, String jql, final L result) {
final One<Boolean> valid = new One<>();
valid.value0 = false;
analyzeInternal(jqlContext, jql, new JqlBaseListener() {
@Override
public void enterBind_parameter(Bind_parameterCon... | [
"private",
"<",
"L",
"extends",
"Collection",
"<",
"JQLPlaceHolder",
">",
">",
"L",
"extractPlaceHolders",
"(",
"final",
"JQLContext",
"jqlContext",
",",
"String",
"jql",
",",
"final",
"L",
"result",
")",
"{",
"final",
"One",
"<",
"Boolean",
">",
"valid",
... | Extract place holders.
@param <L>
the generic type
@param jqlContext
the jql context
@param jql
the jql
@param result
the result
@return the l | [
"Extract",
"place",
"holders",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L876-L900 |
EsupPortail/esup-smsu-api | src/main/java/org/esupportail/smsuapi/services/sms/ackmanagement/AckManagerBusiness.java | AckManagerBusiness.putPhoneNumberInBlackList | private void putPhoneNumberInBlackList(final String phoneNumber, final Application application ) {
"""
Put a number in black list.
@param phoneNumber
@param application
"""
// if phone number is not already in the bl (it should not append) put the phone number
// put the phone number in the black list
... | java | private void putPhoneNumberInBlackList(final String phoneNumber, final Application application ) {
// if phone number is not already in the bl (it should not append) put the phone number
// put the phone number in the black list
if (daoService.isPhoneNumberInBlackList(phoneNumber)) return;
logger.de... | [
"private",
"void",
"putPhoneNumberInBlackList",
"(",
"final",
"String",
"phoneNumber",
",",
"final",
"Application",
"application",
")",
"{",
"// if phone number is not already in the bl (it should not append) put the phone number\r",
"// put the phone number in the black list\r",
"if",... | Put a number in black list.
@param phoneNumber
@param application | [
"Put",
"a",
"number",
"in",
"black",
"list",
"."
] | train | https://github.com/EsupPortail/esup-smsu-api/blob/7b6a4388065adfd84655dbc83f37080874953b20/src/main/java/org/esupportail/smsuapi/services/sms/ackmanagement/AckManagerBusiness.java#L69-L79 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Input.java | Input.getAxisName | public String getAxisName(int controller, int axis) {
"""
Get the name of the axis with the given index
@param controller The index of the controller to check
@param axis The index of the axis to read
@return The name of the specified axis
"""
return ((Controller) controllers.get(controller)).getAxisNa... | java | public String getAxisName(int controller, int axis) {
return ((Controller) controllers.get(controller)).getAxisName(axis);
} | [
"public",
"String",
"getAxisName",
"(",
"int",
"controller",
",",
"int",
"axis",
")",
"{",
"return",
"(",
"(",
"Controller",
")",
"controllers",
".",
"get",
"(",
"controller",
")",
")",
".",
"getAxisName",
"(",
"axis",
")",
";",
"}"
] | Get the name of the axis with the given index
@param controller The index of the controller to check
@param axis The index of the axis to read
@return The name of the specified axis | [
"Get",
"the",
"name",
"of",
"the",
"axis",
"with",
"the",
"given",
"index"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Input.java#L863-L865 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/util/HandlerRequestUtils.java | HandlerRequestUtils.getQueryParameter | public static <X, P extends MessageQueryParameter<X>, R extends RequestBody, M extends MessageParameters> X getQueryParameter(
final HandlerRequest<R, M> request,
final Class<P> queryParameterClass) throws RestHandlerException {
"""
Returns the value of a query parameter, or {@code null} if the query paramet... | java | public static <X, P extends MessageQueryParameter<X>, R extends RequestBody, M extends MessageParameters> X getQueryParameter(
final HandlerRequest<R, M> request,
final Class<P> queryParameterClass) throws RestHandlerException {
return getQueryParameter(request, queryParameterClass, null);
} | [
"public",
"static",
"<",
"X",
",",
"P",
"extends",
"MessageQueryParameter",
"<",
"X",
">",
",",
"R",
"extends",
"RequestBody",
",",
"M",
"extends",
"MessageParameters",
">",
"X",
"getQueryParameter",
"(",
"final",
"HandlerRequest",
"<",
"R",
",",
"M",
">",
... | Returns the value of a query parameter, or {@code null} if the query parameter is not set.
@throws RestHandlerException If the query parameter is repeated. | [
"Returns",
"the",
"value",
"of",
"a",
"query",
"parameter",
"or",
"{"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/util/HandlerRequestUtils.java#L43-L48 |
alamkanak/Android-Week-View | library/src/main/java/com/alamkanak/weekview/WeekViewUtil.java | WeekViewUtil.isSameDay | public static boolean isSameDay(Calendar dayOne, Calendar dayTwo) {
"""
Checks if two times are on the same day.
@param dayOne The first day.
@param dayTwo The second day.
@return Whether the times are on the same day.
"""
return dayOne.get(Calendar.YEAR) == dayTwo.get(Calendar.YEAR) && dayOne.get(C... | java | public static boolean isSameDay(Calendar dayOne, Calendar dayTwo) {
return dayOne.get(Calendar.YEAR) == dayTwo.get(Calendar.YEAR) && dayOne.get(Calendar.DAY_OF_YEAR) == dayTwo.get(Calendar.DAY_OF_YEAR);
} | [
"public",
"static",
"boolean",
"isSameDay",
"(",
"Calendar",
"dayOne",
",",
"Calendar",
"dayTwo",
")",
"{",
"return",
"dayOne",
".",
"get",
"(",
"Calendar",
".",
"YEAR",
")",
"==",
"dayTwo",
".",
"get",
"(",
"Calendar",
".",
"YEAR",
")",
"&&",
"dayOne",
... | Checks if two times are on the same day.
@param dayOne The first day.
@param dayTwo The second day.
@return Whether the times are on the same day. | [
"Checks",
"if",
"two",
"times",
"are",
"on",
"the",
"same",
"day",
"."
] | train | https://github.com/alamkanak/Android-Week-View/blob/dc3f97d65d44785d1a761b52b58527c86c4eee1b/library/src/main/java/com/alamkanak/weekview/WeekViewUtil.java#L23-L25 |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClientV2.java | AtlasClientV2.updateAtlasTypeDefs | public AtlasTypesDef updateAtlasTypeDefs(final AtlasTypesDef typesDef) throws AtlasServiceException {
"""
Bulk update API for all types, changes detected in the type definitions would be persisted
@param typesDef A composite object that captures all type definition changes
@return A composite object with lists... | java | public AtlasTypesDef updateAtlasTypeDefs(final AtlasTypesDef typesDef) throws AtlasServiceException {
return callAPI(UPDATE_ALL_TYPE_DEFS, AtlasTypesDef.class, AtlasType.toJson(typesDef));
} | [
"public",
"AtlasTypesDef",
"updateAtlasTypeDefs",
"(",
"final",
"AtlasTypesDef",
"typesDef",
")",
"throws",
"AtlasServiceException",
"{",
"return",
"callAPI",
"(",
"UPDATE_ALL_TYPE_DEFS",
",",
"AtlasTypesDef",
".",
"class",
",",
"AtlasType",
".",
"toJson",
"(",
"types... | Bulk update API for all types, changes detected in the type definitions would be persisted
@param typesDef A composite object that captures all type definition changes
@return A composite object with lists of type definitions that were updated | [
"Bulk",
"update",
"API",
"for",
"all",
"types",
"changes",
"detected",
"in",
"the",
"type",
"definitions",
"would",
"be",
"persisted"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClientV2.java#L271-L273 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.translateReturn | private Context translateReturn(WyilFile.Stmt.Return stmt, Context context) {
"""
Translate a return statement. If a return value is given, then this must
ensure that the post-condition of the enclosing function or method is met
@param stmt
@param wyalFile
"""
//
Tuple<WyilFile.Expr> returns = stmt.ge... | java | private Context translateReturn(WyilFile.Stmt.Return stmt, Context context) {
//
Tuple<WyilFile.Expr> returns = stmt.getReturns();
//
if (returns.size() > 0) {
// There is at least one return value. Therefore, we need to check
// any preconditions for those return expressions and, potentially,
// ensur... | [
"private",
"Context",
"translateReturn",
"(",
"WyilFile",
".",
"Stmt",
".",
"Return",
"stmt",
",",
"Context",
"context",
")",
"{",
"//",
"Tuple",
"<",
"WyilFile",
".",
"Expr",
">",
"returns",
"=",
"stmt",
".",
"getReturns",
"(",
")",
";",
"//",
"if",
"... | Translate a return statement. If a return value is given, then this must
ensure that the post-condition of the enclosing function or method is met
@param stmt
@param wyalFile | [
"Translate",
"a",
"return",
"statement",
".",
"If",
"a",
"return",
"value",
"is",
"given",
"then",
"this",
"must",
"ensure",
"that",
"the",
"post",
"-",
"condition",
"of",
"the",
"enclosing",
"function",
"or",
"method",
"is",
"met"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L880-L899 |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/model/BatchResponse.java | BatchResponse.setItems | public void setItems(java.util.Collection<java.util.Map<String,AttributeValue>> items) {
"""
Sets the value of the Items property for this object.
@param items The new value for the Items property for this object.
"""
if (items == null) {
this.items = null;
return;
}
... | java | public void setItems(java.util.Collection<java.util.Map<String,AttributeValue>> items) {
if (items == null) {
this.items = null;
return;
}
java.util.List<java.util.Map<String,AttributeValue>> itemsCopy = new java.util.ArrayList<java.util.Map<String,AttributeValue>>(items... | [
"public",
"void",
"setItems",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
">",
"items",
")",
"{",
"if",
"(",
"items",
"==",
"null",
")",
"{",
"this",
".",
"items",
"=... | Sets the value of the Items property for this object.
@param items The new value for the Items property for this object. | [
"Sets",
"the",
"value",
"of",
"the",
"Items",
"property",
"for",
"this",
"object",
"."
] | train | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/model/BatchResponse.java#L55-L64 |
super-csv/super-csv | super-csv-java8/src/main/java/org/supercsv/cellprocessor/time/AbstractTemporalAccessorFormattingProcessor.java | AbstractTemporalAccessorFormattingProcessor.execute | public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvCellProcessorException if value is null, not the correct type, or can't be formatted
"""
validateInputNotNull(value, context);
final Class<T> ourType = getType();
if( !(value.getClass().equals(ourTy... | java | public Object execute(final Object value, final CsvContext context) {
validateInputNotNull(value, context);
final Class<T> ourType = getType();
if( !(value.getClass().equals(ourType)) ) {
throw new SuperCsvCellProcessorException(ourType, value, context, this);
}
final TemporalAccessor timeType = ourType.ca... | [
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"validateInputNotNull",
"(",
"value",
",",
"context",
")",
";",
"final",
"Class",
"<",
"T",
">",
"ourType",
"=",
"getType",
"(",
")",
";",
"i... | {@inheritDoc}
@throws SuperCsvCellProcessorException if value is null, not the correct type, or can't be formatted | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv-java8/src/main/java/org/supercsv/cellprocessor/time/AbstractTemporalAccessorFormattingProcessor.java#L105-L123 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/MatrixFeatures_DDRM.java | MatrixFeatures_DDRM.isIdentity | public static boolean isIdentity(DMatrixRMaj mat , double tol ) {
"""
Checks to see if the provided matrix is within tolerance to an identity matrix.
@param mat Matrix being examined. Not modified.
@param tol Tolerance.
@return True if it is within tolerance to an identify matrix.
"""
// see if t... | java | public static boolean isIdentity(DMatrixRMaj mat , double tol )
{
// see if the result is an identity matrix
int index = 0;
for( int i = 0; i < mat.numRows; i++ ) {
for( int j = 0; j < mat.numCols; j++ ) {
if( i == j ) {
if( !(Math.abs(mat.get(... | [
"public",
"static",
"boolean",
"isIdentity",
"(",
"DMatrixRMaj",
"mat",
",",
"double",
"tol",
")",
"{",
"// see if the result is an identity matrix",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mat",
".",
"numRows",
";"... | Checks to see if the provided matrix is within tolerance to an identity matrix.
@param mat Matrix being examined. Not modified.
@param tol Tolerance.
@return True if it is within tolerance to an identify matrix. | [
"Checks",
"to",
"see",
"if",
"the",
"provided",
"matrix",
"is",
"within",
"tolerance",
"to",
"an",
"identity",
"matrix",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/MatrixFeatures_DDRM.java#L525-L542 |
WolfgangFahl/Mediawiki-Japi | src/main/java/com/bitplan/mediawiki/japi/SiteInfoImpl.java | SiteInfoImpl.initNameSpaces | protected void initNameSpaces(General general, List<Ns> namespaceList) {
"""
initialize the NameSpaces from the given namespaceList
@param general
@param namespaceList
"""
namespaces = new LinkedHashMap<String, Ns>();
namespacesById = new LinkedHashMap<Integer, Ns>();
namespacesByCanonicalName ... | java | protected void initNameSpaces(General general, List<Ns> namespaceList) {
namespaces = new LinkedHashMap<String, Ns>();
namespacesById = new LinkedHashMap<Integer, Ns>();
namespacesByCanonicalName = new LinkedHashMap<String, Ns>();
for (Ns namespace : namespaceList) {
String namespacename = namespa... | [
"protected",
"void",
"initNameSpaces",
"(",
"General",
"general",
",",
"List",
"<",
"Ns",
">",
"namespaceList",
")",
"{",
"namespaces",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"Ns",
">",
"(",
")",
";",
"namespacesById",
"=",
"new",
"LinkedHashMap",
... | initialize the NameSpaces from the given namespaceList
@param general
@param namespaceList | [
"initialize",
"the",
"NameSpaces",
"from",
"the",
"given",
"namespaceList"
] | train | https://github.com/WolfgangFahl/Mediawiki-Japi/blob/78d0177ebfe02eb05da5550839727861f1e888a5/src/main/java/com/bitplan/mediawiki/japi/SiteInfoImpl.java#L69-L89 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/util/ListUtil.java | ListUtil.listToArrayRemoveEmpty | public static Array listToArrayRemoveEmpty(String list, char delimiter) {
"""
casts a list to Array object remove Empty Elements
@param list list to cast
@param delimiter delimter of the list
@return Array Object
"""
int len = list.length();
ArrayImpl array = new ArrayImpl();
if (len == 0) return array... | java | public static Array listToArrayRemoveEmpty(String list, char delimiter) {
int len = list.length();
ArrayImpl array = new ArrayImpl();
if (len == 0) return array;
int last = 0;
for (int i = 0; i < len; i++) {
if (list.charAt(i) == delimiter) {
if (last < i) array.appendEL(list.substring(last, i));
last = ... | [
"public",
"static",
"Array",
"listToArrayRemoveEmpty",
"(",
"String",
"list",
",",
"char",
"delimiter",
")",
"{",
"int",
"len",
"=",
"list",
".",
"length",
"(",
")",
";",
"ArrayImpl",
"array",
"=",
"new",
"ArrayImpl",
"(",
")",
";",
"if",
"(",
"len",
"... | casts a list to Array object remove Empty Elements
@param list list to cast
@param delimiter delimter of the list
@return Array Object | [
"casts",
"a",
"list",
"to",
"Array",
"object",
"remove",
"Empty",
"Elements"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L247-L262 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPRead.java | SHPRead.readShape | public static void readShape(Connection connection, String fileName, String tableReference) throws IOException, SQLException {
"""
Copy data from Shape File into a new table in specified connection.
@param connection Active connection
@param tableReference [[catalog.]schema.]table reference
@param fileName File... | java | public static void readShape(Connection connection, String fileName, String tableReference) throws IOException, SQLException {
readShape(connection, fileName, tableReference, null);
} | [
"public",
"static",
"void",
"readShape",
"(",
"Connection",
"connection",
",",
"String",
"fileName",
",",
"String",
"tableReference",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"readShape",
"(",
"connection",
",",
"fileName",
",",
"tableReference",
",... | Copy data from Shape File into a new table in specified connection.
@param connection Active connection
@param tableReference [[catalog.]schema.]table reference
@param fileName File path of the SHP file or URI
@throws java.io.IOException
@throws java.sql.SQLException | [
"Copy",
"data",
"from",
"Shape",
"File",
"into",
"a",
"new",
"table",
"in",
"specified",
"connection",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPRead.java#L75-L77 |
ologolo/streamline-engine | src/org/daisy/streamline/engine/TaskRunner.java | TaskRunner.runTasks | public List<RunnerResult> runTasks(AnnotatedFile input, File output, List<InternalTask> tasks) throws IOException, TaskSystemException {
"""
Runs a list of tasks starting from the input file as input to the first task, the following tasks use the preceding result
as input. The final result is written to the outpu... | java | public List<RunnerResult> runTasks(AnnotatedFile input, File output, List<InternalTask> tasks) throws IOException, TaskSystemException {
Progress progress = new Progress();
logger.info(name + " started on " + progress.getStart());
int i = 0;
NumberFormat nf = NumberFormat.getPercentInstance();
//FIXME: implem... | [
"public",
"List",
"<",
"RunnerResult",
">",
"runTasks",
"(",
"AnnotatedFile",
"input",
",",
"File",
"output",
",",
"List",
"<",
"InternalTask",
">",
"tasks",
")",
"throws",
"IOException",
",",
"TaskSystemException",
"{",
"Progress",
"progress",
"=",
"new",
"Pr... | Runs a list of tasks starting from the input file as input to the first task, the following tasks use the preceding result
as input. The final result is written to the output.
@param input the input file
@param output the output file
@param tasks the list of tasks
@return returns a list of runner results
@throws IOExce... | [
"Runs",
"a",
"list",
"of",
"tasks",
"starting",
"from",
"the",
"input",
"file",
"as",
"input",
"to",
"the",
"first",
"task",
"the",
"following",
"tasks",
"use",
"the",
"preceding",
"result",
"as",
"input",
".",
"The",
"final",
"result",
"is",
"written",
... | train | https://github.com/ologolo/streamline-engine/blob/04b7adc85d84d91dc5f0eaaa401d2738f9401b17/src/org/daisy/streamline/engine/TaskRunner.java#L151-L185 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Base.java | Base.firstColumn | public static List firstColumn(String query, Object... params) {
"""
This method returns entire resultset as one list. Do not use it for large result sets.
Example:
<pre>
List ssns = Base.firstColumn("select ssn from people where first_name = ?", "John");
for(Object ssn: ssns)
System.out.println(ssn);
</pre>... | java | public static List firstColumn(String query, Object... params) {
return new DB(DB.DEFAULT_NAME).firstColumn(query, params);
} | [
"public",
"static",
"List",
"firstColumn",
"(",
"String",
"query",
",",
"Object",
"...",
"params",
")",
"{",
"return",
"new",
"DB",
"(",
"DB",
".",
"DEFAULT_NAME",
")",
".",
"firstColumn",
"(",
"query",
",",
"params",
")",
";",
"}"
] | This method returns entire resultset as one list. Do not use it for large result sets.
Example:
<pre>
List ssns = Base.firstColumn("select ssn from people where first_name = ?", "John");
for(Object ssn: ssns)
System.out.println(ssn);
</pre>
This methods expects a query which selects only one column from a table/view. ... | [
"This",
"method",
"returns",
"entire",
"resultset",
"as",
"one",
"list",
".",
"Do",
"not",
"use",
"it",
"for",
"large",
"result",
"sets",
".",
"Example",
":",
"<pre",
">",
"List",
"ssns",
"=",
"Base",
".",
"firstColumn",
"(",
"select",
"ssn",
"from",
"... | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Base.java#L215-L217 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/process/ProcessAdapter.java | ProcessAdapter.stopAndWait | public int stopAndWait(long timeout, TimeUnit unit) {
"""
Terminates this {@link Process} and wait until the given timeout for this {@link Process} to stop.
@param timeout long value to indicate the number of units in the timeout.
@param unit {@link TimeUnit} of the timeout (e.g. seconds).
@return the exit va... | java | public int stopAndWait(long timeout, TimeUnit unit) {
stop(timeout, unit);
return (waitFor(timeout, unit) ? exitValue() : safeExitValue());
} | [
"public",
"int",
"stopAndWait",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"stop",
"(",
"timeout",
",",
"unit",
")",
";",
"return",
"(",
"waitFor",
"(",
"timeout",
",",
"unit",
")",
"?",
"exitValue",
"(",
")",
":",
"safeExitValue",
"(",... | Terminates this {@link Process} and wait until the given timeout for this {@link Process} to stop.
@param timeout long value to indicate the number of units in the timeout.
@param unit {@link TimeUnit} of the timeout (e.g. seconds).
@return the exit value for this {@link Process} when if it stops, or {@literal -1} if ... | [
"Terminates",
"this",
"{",
"@link",
"Process",
"}",
"and",
"wait",
"until",
"the",
"given",
"timeout",
"for",
"this",
"{",
"@link",
"Process",
"}",
"to",
"stop",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/process/ProcessAdapter.java#L599-L602 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/misc/EncodingSupport.java | EncodingSupport.encodeBase64 | public static String encodeBase64(byte[] rawData, int lineLength) {
"""
Converts a chunk of data into base 64 encoding.
@param rawData
@param lineLength optional length of lines in return value
@return
"""
if (rawData == null) {
return "";
}
StringBuffer retval = new StringBuffer();
int i = 0;
... | java | public static String encodeBase64(byte[] rawData, int lineLength) {
if (rawData == null) {
return "";
}
StringBuffer retval = new StringBuffer();
int i = 0;
int n = 0;
for (; i < rawData.length - 2; i += 3) {
if (lineLength > 0 && i > 0 && i % lineLength == 0) {
retval.append("\n");
}
//n is... | [
"public",
"static",
"String",
"encodeBase64",
"(",
"byte",
"[",
"]",
"rawData",
",",
"int",
"lineLength",
")",
"{",
"if",
"(",
"rawData",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuffer",
"retval",
"=",
"new",
"StringBuffer",
"(",
")",
... | Converts a chunk of data into base 64 encoding.
@param rawData
@param lineLength optional length of lines in return value
@return | [
"Converts",
"a",
"chunk",
"of",
"data",
"into",
"base",
"64",
"encoding",
"."
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/misc/EncodingSupport.java#L51-L91 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/GeomUtil.java | GeomUtil.getLine | public Line getLine(Shape shape, float sx, float sy, int e) {
"""
Get a line between two points in a shape
@param shape The shape
@param sx The x coordinate of the start point
@param sy The y coordinate of the start point
@param e The index of the end point
@return The line between the two points
"""
... | java | public Line getLine(Shape shape, float sx, float sy, int e) {
float[] end = shape.getPoint(e);
Line line = new Line(sx,sy,end[0],end[1]);
return line;
} | [
"public",
"Line",
"getLine",
"(",
"Shape",
"shape",
",",
"float",
"sx",
",",
"float",
"sy",
",",
"int",
"e",
")",
"{",
"float",
"[",
"]",
"end",
"=",
"shape",
".",
"getPoint",
"(",
"e",
")",
";",
"Line",
"line",
"=",
"new",
"Line",
"(",
"sx",
"... | Get a line between two points in a shape
@param shape The shape
@param sx The x coordinate of the start point
@param sy The y coordinate of the start point
@param e The index of the end point
@return The line between the two points | [
"Get",
"a",
"line",
"between",
"two",
"points",
"in",
"a",
"shape"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/GeomUtil.java#L428-L433 |
dvasilen/Hive-XML-SerDe | src/main/java/com/ibm/spss/hive/serde2/xml/processor/AbstractXmlProcessor.java | AbstractXmlProcessor.getObjectValue | private Object getObjectValue(XmlNode node, String fieldName) {
"""
Returns the object value for the given VTD XML node and field name
@param node
the node
@param fieldName
the field name
@return the object value for the given VTD XML node and field name
"""
// we have to take into account the f... | java | private Object getObjectValue(XmlNode node, String fieldName) {
// we have to take into account the fact that fieldName will be in the lower case
if (node != null) {
String name = node.getName();
switch (node.getType()) {
case XmlNode.ATTRIBUTE_NODE:
... | [
"private",
"Object",
"getObjectValue",
"(",
"XmlNode",
"node",
",",
"String",
"fieldName",
")",
"{",
"// we have to take into account the fact that fieldName will be in the lower case",
"if",
"(",
"node",
"!=",
"null",
")",
"{",
"String",
"name",
"=",
"node",
".",
"ge... | Returns the object value for the given VTD XML node and field name
@param node
the node
@param fieldName
the field name
@return the object value for the given VTD XML node and field name | [
"Returns",
"the",
"object",
"value",
"for",
"the",
"given",
"VTD",
"XML",
"node",
"and",
"field",
"name"
] | train | https://github.com/dvasilen/Hive-XML-SerDe/blob/2a7a184b2cfaeb63008529a9851cd72edb8025d9/src/main/java/com/ibm/spss/hive/serde2/xml/processor/AbstractXmlProcessor.java#L79-L105 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Distribution.java | Distribution.goodTuringSmoothedCounter | public static <E> Distribution<E> goodTuringSmoothedCounter(Counter<E> counter, int numberOfKeys) {
"""
Creates a Good-Turing smoothed Distribution from the given counter.
@return a new Good-Turing smoothed Distribution.
"""
// gather count-counts
int[] countCounts = getCountCounts(counter);
... | java | public static <E> Distribution<E> goodTuringSmoothedCounter(Counter<E> counter, int numberOfKeys) {
// gather count-counts
int[] countCounts = getCountCounts(counter);
// if count-counts are unreliable, we shouldn't be using G-T
// revert to laplace
for (int i = 1; i <= 10; i++) {
if (... | [
"public",
"static",
"<",
"E",
">",
"Distribution",
"<",
"E",
">",
"goodTuringSmoothedCounter",
"(",
"Counter",
"<",
"E",
">",
"counter",
",",
"int",
"numberOfKeys",
")",
"{",
"// gather count-counts\r",
"int",
"[",
"]",
"countCounts",
"=",
"getCountCounts",
"(... | Creates a Good-Turing smoothed Distribution from the given counter.
@return a new Good-Turing smoothed Distribution. | [
"Creates",
"a",
"Good",
"-",
"Turing",
"smoothed",
"Distribution",
"from",
"the",
"given",
"counter",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Distribution.java#L333-L374 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/UtilColor.java | UtilColor.isOpaqueTransparentExclusive | public static boolean isOpaqueTransparentExclusive(int colorA, int colorB) {
"""
Check if colors transparency type are exclusive (one is {@link ColorRgba#OPAQUE} and the other
{@link ColorRgba#TRANSPARENT}).
@param colorA The first color.
@param colorB The second color.
@return <code>true</code> if exclusive... | java | public static boolean isOpaqueTransparentExclusive(int colorA, int colorB)
{
return colorA == ColorRgba.TRANSPARENT.getRgba() && colorB == ColorRgba.OPAQUE.getRgba()
|| colorA == ColorRgba.OPAQUE.getRgba() && colorB == ColorRgba.TRANSPARENT.getRgba();
} | [
"public",
"static",
"boolean",
"isOpaqueTransparentExclusive",
"(",
"int",
"colorA",
",",
"int",
"colorB",
")",
"{",
"return",
"colorA",
"==",
"ColorRgba",
".",
"TRANSPARENT",
".",
"getRgba",
"(",
")",
"&&",
"colorB",
"==",
"ColorRgba",
".",
"OPAQUE",
".",
"... | Check if colors transparency type are exclusive (one is {@link ColorRgba#OPAQUE} and the other
{@link ColorRgba#TRANSPARENT}).
@param colorA The first color.
@param colorB The second color.
@return <code>true</code> if exclusive, <code>false</code> else. | [
"Check",
"if",
"colors",
"transparency",
"type",
"are",
"exclusive",
"(",
"one",
"is",
"{",
"@link",
"ColorRgba#OPAQUE",
"}",
"and",
"the",
"other",
"{",
"@link",
"ColorRgba#TRANSPARENT",
"}",
")",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/UtilColor.java#L175-L179 |
jdereg/java-util | src/main/java/com/cedarsoftware/util/UrlUtilities.java | UrlUtilities.getContentFromUrl | @Deprecated
public static byte[] getContentFromUrl(URL url, Map inCookies, Map outCookies, Proxy proxy, boolean allowAllCerts) {
"""
Get content from the passed in URL. This code will open a connection to
the passed in server, fetch the requested content, and return it as a
byte[].
Anyone using the proxy... | java | @Deprecated
public static byte[] getContentFromUrl(URL url, Map inCookies, Map outCookies, Proxy proxy, boolean allowAllCerts)
{
return getContentFromUrl(url, inCookies, outCookies, allowAllCerts);
} | [
"@",
"Deprecated",
"public",
"static",
"byte",
"[",
"]",
"getContentFromUrl",
"(",
"URL",
"url",
",",
"Map",
"inCookies",
",",
"Map",
"outCookies",
",",
"Proxy",
"proxy",
",",
"boolean",
"allowAllCerts",
")",
"{",
"return",
"getContentFromUrl",
"(",
"url",
"... | Get content from the passed in URL. This code will open a connection to
the passed in server, fetch the requested content, and return it as a
byte[].
Anyone using the proxy calls such as this one should have that managed by the jvm with -D parameters:
http.proxyHost
http.proxyPort (default: 80)
http.nonProxyHosts (sh... | [
"Get",
"content",
"from",
"the",
"passed",
"in",
"URL",
".",
"This",
"code",
"will",
"open",
"a",
"connection",
"to",
"the",
"passed",
"in",
"server",
"fetch",
"the",
"requested",
"content",
"and",
"return",
"it",
"as",
"a",
"byte",
"[]",
"."
] | train | https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/UrlUtilities.java#L860-L864 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/visunproj/KeyVisualization.java | KeyVisualization.findDepth | private static <M extends Model> void findDepth(Hierarchy<Cluster<M>> hier, Cluster<M> cluster, int[] size) {
"""
Recursive depth computation.
@param hier Hierarchy
@param cluster Current cluster
@param size Counting array.
"""
if(hier.numChildren(cluster) > 0) {
for(It<Cluster<M>> iter = hier.i... | java | private static <M extends Model> void findDepth(Hierarchy<Cluster<M>> hier, Cluster<M> cluster, int[] size) {
if(hier.numChildren(cluster) > 0) {
for(It<Cluster<M>> iter = hier.iterChildren(cluster); iter.valid(); iter.advance()) {
findDepth(hier, iter.get(), size);
}
size[0] += 1; // Dept... | [
"private",
"static",
"<",
"M",
"extends",
"Model",
">",
"void",
"findDepth",
"(",
"Hierarchy",
"<",
"Cluster",
"<",
"M",
">",
">",
"hier",
",",
"Cluster",
"<",
"M",
">",
"cluster",
",",
"int",
"[",
"]",
"size",
")",
"{",
"if",
"(",
"hier",
".",
"... | Recursive depth computation.
@param hier Hierarchy
@param cluster Current cluster
@param size Counting array. | [
"Recursive",
"depth",
"computation",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/visunproj/KeyVisualization.java#L109-L119 |
aws/aws-sdk-java | aws-java-sdk-cloudhsmv2/src/main/java/com/amazonaws/services/cloudhsmv2/model/Cluster.java | Cluster.withSubnetMapping | public Cluster withSubnetMapping(java.util.Map<String, String> subnetMapping) {
"""
<p>
A map of the cluster's subnets and their corresponding Availability Zones.
</p>
@param subnetMapping
A map of the cluster's subnets and their corresponding Availability Zones.
@return Returns a reference to this object s... | java | public Cluster withSubnetMapping(java.util.Map<String, String> subnetMapping) {
setSubnetMapping(subnetMapping);
return this;
} | [
"public",
"Cluster",
"withSubnetMapping",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"subnetMapping",
")",
"{",
"setSubnetMapping",
"(",
"subnetMapping",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map of the cluster's subnets and their corresponding Availability Zones.
</p>
@param subnetMapping
A map of the cluster's subnets and their corresponding Availability Zones.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"map",
"of",
"the",
"cluster",
"s",
"subnets",
"and",
"their",
"corresponding",
"Availability",
"Zones",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudhsmv2/src/main/java/com/amazonaws/services/cloudhsmv2/model/Cluster.java#L620-L623 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java | EnumConstantBuilder.buildEnumConstantComments | public void buildEnumConstantComments(XMLNode node, Content enumConstantsTree) {
"""
Build the comments for the enum constant. Do nothing if
{@link Configuration#nocomment} is set to true.
@param node the XML element that specifies which components to document
@param enumConstantsTree the content tree to whi... | java | public void buildEnumConstantComments(XMLNode node, Content enumConstantsTree) {
if (!configuration.nocomment) {
writer.addComments(
(FieldDoc) enumConstants.get(currentEnumConstantsIndex),
enumConstantsTree);
}
} | [
"public",
"void",
"buildEnumConstantComments",
"(",
"XMLNode",
"node",
",",
"Content",
"enumConstantsTree",
")",
"{",
"if",
"(",
"!",
"configuration",
".",
"nocomment",
")",
"{",
"writer",
".",
"addComments",
"(",
"(",
"FieldDoc",
")",
"enumConstants",
".",
"g... | Build the comments for the enum constant. Do nothing if
{@link Configuration#nocomment} is set to true.
@param node the XML element that specifies which components to document
@param enumConstantsTree the content tree to which the documentation will be added | [
"Build",
"the",
"comments",
"for",
"the",
"enum",
"constant",
".",
"Do",
"nothing",
"if",
"{",
"@link",
"Configuration#nocomment",
"}",
"is",
"set",
"to",
"true",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java#L203-L209 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java | AbstractRadial.create_FOREGROUND_Image | protected BufferedImage create_FOREGROUND_Image(final int WIDTH, final boolean WITH_CENTER_KNOB, final ForegroundType TYPE, final BufferedImage IMAGE) {
"""
Returns the image of the selected (FG_TYPE1, FG_TYPE2, FG_TYPE3) glasseffect, the centered knob (if wanted)
@param WIDTH
@param WITH_CENTER_KNOB
@param TYP... | java | protected BufferedImage create_FOREGROUND_Image(final int WIDTH, final boolean WITH_CENTER_KNOB, final ForegroundType TYPE, final BufferedImage IMAGE) {
switch (getFrameType()) {
case ROUND:
return FOREGROUND_FACTORY.createRadialForeground(WIDTH, WITH_CENTER_KNOB, TYPE, IMAGE);
... | [
"protected",
"BufferedImage",
"create_FOREGROUND_Image",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"boolean",
"WITH_CENTER_KNOB",
",",
"final",
"ForegroundType",
"TYPE",
",",
"final",
"BufferedImage",
"IMAGE",
")",
"{",
"switch",
"(",
"getFrameType",
"(",
")",
"... | Returns the image of the selected (FG_TYPE1, FG_TYPE2, FG_TYPE3) glasseffect, the centered knob (if wanted)
@param WIDTH
@param WITH_CENTER_KNOB
@param TYPE
@param IMAGE
@return the foreground image that will be used | [
"Returns",
"the",
"image",
"of",
"the",
"selected",
"(",
"FG_TYPE1",
"FG_TYPE2",
"FG_TYPE3",
")",
"glasseffect",
"the",
"centered",
"knob",
"(",
"if",
"wanted",
")"
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java#L3070-L3079 |
google/closure-compiler | src/com/google/javascript/jscomp/ReplaceStrings.java | ReplaceStrings.replaceExpression | private Node replaceExpression(NodeTraversal t, Node expr, Node parent) {
"""
Replaces a string expression with a short encoded string expression.
@param t The traversal
@param expr The expression node
@param parent The expression node's parent
@return The replacement node (or the original expression if no r... | java | private Node replaceExpression(NodeTraversal t, Node expr, Node parent) {
Node replacement;
String key = null;
String replacementString;
switch (expr.getToken()) {
case STRING:
key = expr.getString();
replacementString = getReplacement(key);
replacement = IR.string(replacem... | [
"private",
"Node",
"replaceExpression",
"(",
"NodeTraversal",
"t",
",",
"Node",
"expr",
",",
"Node",
"parent",
")",
"{",
"Node",
"replacement",
";",
"String",
"key",
"=",
"null",
";",
"String",
"replacementString",
";",
"switch",
"(",
"expr",
".",
"getToken"... | Replaces a string expression with a short encoded string expression.
@param t The traversal
@param expr The expression node
@param parent The expression node's parent
@return The replacement node (or the original expression if no replacement is made) | [
"Replaces",
"a",
"string",
"expression",
"with",
"a",
"short",
"encoded",
"string",
"expression",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ReplaceStrings.java#L316-L355 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.vps_serviceName_plesk_duration_POST | public OvhOrder vps_serviceName_plesk_duration_POST(String serviceName, String duration, OvhPleskLicenseDomainNumberEnum domainNumber) throws IOException {
"""
Create order
REST: POST /order/vps/{serviceName}/plesk/{duration}
@param domainNumber [required] Domain number you want to order a licence for
@param ... | java | public OvhOrder vps_serviceName_plesk_duration_POST(String serviceName, String duration, OvhPleskLicenseDomainNumberEnum domainNumber) throws IOException {
String qPath = "/order/vps/{serviceName}/plesk/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
HashMap<String, Object>o = new HashMap<Stri... | [
"public",
"OvhOrder",
"vps_serviceName_plesk_duration_POST",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhPleskLicenseDomainNumberEnum",
"domainNumber",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/vps/{serviceName}/plesk/{duration}\... | Create order
REST: POST /order/vps/{serviceName}/plesk/{duration}
@param domainNumber [required] Domain number you want to order a licence for
@param serviceName [required] The internal name of your VPS offer
@param duration [required] Duration
@deprecated | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L3342-L3349 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.readDefaultFile | public CmsResource readDefaultFile(String resourceNameOrID, CmsResourceFilter filter)
throws CmsException, CmsSecurityException {
"""
Returns the default resource for the given folder.<p>
If the given resource name or id identifies a file, then this file is returned.<p>
Otherwise, in case of a folder:<br... | java | public CmsResource readDefaultFile(String resourceNameOrID, CmsResourceFilter filter)
throws CmsException, CmsSecurityException {
CmsResource resource;
if (CmsUUID.isValidUUID(resourceNameOrID)) {
resource = readResource(new CmsUUID(resourceNameOrID), filter);
} else {
... | [
"public",
"CmsResource",
"readDefaultFile",
"(",
"String",
"resourceNameOrID",
",",
"CmsResourceFilter",
"filter",
")",
"throws",
"CmsException",
",",
"CmsSecurityException",
"{",
"CmsResource",
"resource",
";",
"if",
"(",
"CmsUUID",
".",
"isValidUUID",
"(",
"resource... | Returns the default resource for the given folder.<p>
If the given resource name or id identifies a file, then this file is returned.<p>
Otherwise, in case of a folder:<br>
<ol>
<li>the {@link CmsPropertyDefinition#PROPERTY_DEFAULT_FILE} is checked, and
<li>if still no file could be found, the configured default file... | [
"Returns",
"the",
"default",
"resource",
"for",
"the",
"given",
"folder",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L2436-L2446 |
javagl/Common | src/main/java/de/javagl/common/collections/Maps.java | Maps.removeFromList | static <K, E> void removeFromList(Map<K, List<E>> map, K k, E e) {
"""
Removes the given element from the list that is stored under the
given key. If the list becomes empty, it is removed from the
map.
@param <K> The key type
@param <E> The element type
@param map The map
@param k The key
@param e The e... | java | static <K, E> void removeFromList(Map<K, List<E>> map, K k, E e)
{
List<E> list = map.get(k);
if (list != null)
{
list.remove(e);
if (list.isEmpty())
{
map.remove(k);
}
}
} | [
"static",
"<",
"K",
",",
"E",
">",
"void",
"removeFromList",
"(",
"Map",
"<",
"K",
",",
"List",
"<",
"E",
">",
">",
"map",
",",
"K",
"k",
",",
"E",
"e",
")",
"{",
"List",
"<",
"E",
">",
"list",
"=",
"map",
".",
"get",
"(",
"k",
")",
";",
... | Removes the given element from the list that is stored under the
given key. If the list becomes empty, it is removed from the
map.
@param <K> The key type
@param <E> The element type
@param map The map
@param k The key
@param e The element | [
"Removes",
"the",
"given",
"element",
"from",
"the",
"list",
"that",
"is",
"stored",
"under",
"the",
"given",
"key",
".",
"If",
"the",
"list",
"becomes",
"empty",
"it",
"is",
"removed",
"from",
"the",
"map",
"."
] | train | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/collections/Maps.java#L129-L140 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java | ExcelWriter.setColumnWidth | public ExcelWriter setColumnWidth(int columnIndex, int width) {
"""
设置列宽(单位为一个字符的宽度,例如传入width为10,表示10个字符的宽度)
@param columnIndex 列号(从0开始计数,-1表示所有列的默认宽度)
@param width 宽度(单位1~256个字符宽度)
@return this
@since 4.0.8
"""
if (columnIndex < 0) {
this.sheet.setDefaultColumnWidth(width);
} else {
this.s... | java | public ExcelWriter setColumnWidth(int columnIndex, int width) {
if (columnIndex < 0) {
this.sheet.setDefaultColumnWidth(width);
} else {
this.sheet.setColumnWidth(columnIndex, width * 256);
}
return this;
} | [
"public",
"ExcelWriter",
"setColumnWidth",
"(",
"int",
"columnIndex",
",",
"int",
"width",
")",
"{",
"if",
"(",
"columnIndex",
"<",
"0",
")",
"{",
"this",
".",
"sheet",
".",
"setDefaultColumnWidth",
"(",
"width",
")",
";",
"}",
"else",
"{",
"this",
".",
... | 设置列宽(单位为一个字符的宽度,例如传入width为10,表示10个字符的宽度)
@param columnIndex 列号(从0开始计数,-1表示所有列的默认宽度)
@param width 宽度(单位1~256个字符宽度)
@return this
@since 4.0.8 | [
"设置列宽(单位为一个字符的宽度,例如传入width为10,表示10个字符的宽度)"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java#L430-L437 |
andriusvelykis/reflow-maven-skin | reflow-velocity-tools/src/main/java/lt/velykis/maven/skins/reflow/HtmlTool.java | HtmlTool.addClass | public String addClass(String content, String selector, List<String> classNames, int amount) {
"""
Adds given class names to the elements in HTML.
@param content
HTML content to modify
@param selector
CSS selector for elements to add classes to
@param classNames
Names of classes to add to the selected elem... | java | public String addClass(String content, String selector, List<String> classNames, int amount) {
Element body = parseContent(content);
List<Element> elements = body.select(selector);
if (amount >= 0) {
// limit to the indicated amount
elements = elements.subList(0, Math.min(amount, elements.size()));
}
... | [
"public",
"String",
"addClass",
"(",
"String",
"content",
",",
"String",
"selector",
",",
"List",
"<",
"String",
">",
"classNames",
",",
"int",
"amount",
")",
"{",
"Element",
"body",
"=",
"parseContent",
"(",
"content",
")",
";",
"List",
"<",
"Element",
... | Adds given class names to the elements in HTML.
@param content
HTML content to modify
@param selector
CSS selector for elements to add classes to
@param classNames
Names of classes to add to the selected elements
@param amount
Maximum number of elements to modify
@return HTML content with modified elements. If no elem... | [
"Adds",
"given",
"class",
"names",
"to",
"the",
"elements",
"in",
"HTML",
"."
] | train | https://github.com/andriusvelykis/reflow-maven-skin/blob/01170ae1426a1adfe7cc9c199e77aaa2ecb37ef2/reflow-velocity-tools/src/main/java/lt/velykis/maven/skins/reflow/HtmlTool.java#L658-L681 |
j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OpenHelperManager.java | OpenHelperManager.getHelper | public static synchronized <T extends OrmLiteSqliteOpenHelper> T getHelper(Context context, Class<T> openHelperClass) {
"""
Create a static instance of our open helper from the helper class. This has a usage counter on it so make sure
all calls to this method have an associated call to {@link #releaseHelper()}. T... | java | public static synchronized <T extends OrmLiteSqliteOpenHelper> T getHelper(Context context, Class<T> openHelperClass) {
if (openHelperClass == null) {
throw new IllegalArgumentException("openHelperClass argument is null");
}
innerSetHelperClass(openHelperClass);
return loadHelper(context, openHelperClass);
... | [
"public",
"static",
"synchronized",
"<",
"T",
"extends",
"OrmLiteSqliteOpenHelper",
">",
"T",
"getHelper",
"(",
"Context",
"context",
",",
"Class",
"<",
"T",
">",
"openHelperClass",
")",
"{",
"if",
"(",
"openHelperClass",
"==",
"null",
")",
"{",
"throw",
"ne... | Create a static instance of our open helper from the helper class. This has a usage counter on it so make sure
all calls to this method have an associated call to {@link #releaseHelper()}. This should be called during an
onCreate() type of method when the application or service is starting. The caller should then keep ... | [
"Create",
"a",
"static",
"instance",
"of",
"our",
"open",
"helper",
"from",
"the",
"helper",
"class",
".",
"This",
"has",
"a",
"usage",
"counter",
"on",
"it",
"so",
"make",
"sure",
"all",
"calls",
"to",
"this",
"method",
"have",
"an",
"associated",
"call... | train | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OpenHelperManager.java#L73-L79 |
wigforss/Ka-Commons-Reflection | src/main/java/org/kasource/commons/util/FileUtils.java | FileUtils.copyFile | public static void copyFile(File in, File out) throws IOException {
"""
Copy file a file from one location to another.
@param in Source file
@param out Target file
@throws IOException if any error occurred.
"""
FileChannel inChannel = new
FileInputStream(in).getChannel();
FileChannel ... | java | public static void copyFile(File in, File out) throws IOException {
FileChannel inChannel = new
FileInputStream(in).getChannel();
FileChannel outChannel = new
FileOutputStream(out).getChannel();
try {
inChannel.transferTo(0, inChannel.size(), outChannel);
}
catch (IO... | [
"public",
"static",
"void",
"copyFile",
"(",
"File",
"in",
",",
"File",
"out",
")",
"throws",
"IOException",
"{",
"FileChannel",
"inChannel",
"=",
"new",
"FileInputStream",
"(",
"in",
")",
".",
"getChannel",
"(",
")",
";",
"FileChannel",
"outChannel",
"=",
... | Copy file a file from one location to another.
@param in Source file
@param out Target file
@throws IOException if any error occurred. | [
"Copy",
"file",
"a",
"file",
"from",
"one",
"location",
"to",
"another",
"."
] | train | https://github.com/wigforss/Ka-Commons-Reflection/blob/a80f7a164cd800089e4f4dd948ca6f0e7badcf33/src/main/java/org/kasource/commons/util/FileUtils.java#L30-L49 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jwt/src/com/ibm/ws/security/jwt/web/JwtEndpointServices.java | JwtEndpointServices.getJwtRequest | private JwtRequest getJwtRequest(HttpServletRequest request, HttpServletResponse response) throws IOException {
"""
Extracts the {@value WebConstants#JWT_REQUEST_ATTR} attribute from the
provided request. That particular attribute is supposed to be created and
set by the filter directing the request.
@param r... | java | private JwtRequest getJwtRequest(HttpServletRequest request, HttpServletResponse response) throws IOException {
JwtRequest jwtRequest = (JwtRequest) request.getAttribute(WebConstants.JWT_REQUEST_ATTR);
if (jwtRequest == null) {
String errorMsg = Tr.formatMessage(tc, "JWT_REQUEST_ATTRIBUTE_MISSING",
new Obje... | [
"private",
"JwtRequest",
"getJwtRequest",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"JwtRequest",
"jwtRequest",
"=",
"(",
"JwtRequest",
")",
"request",
".",
"getAttribute",
"(",
"WebConstants",
"."... | Extracts the {@value WebConstants#JWT_REQUEST_ATTR} attribute from the
provided request. That particular attribute is supposed to be created and
set by the filter directing the request.
@param request
@param response
@return
@throws IOException | [
"Extracts",
"the",
"{",
"@value",
"WebConstants#JWT_REQUEST_ATTR",
"}",
"attribute",
"from",
"the",
"provided",
"request",
".",
"That",
"particular",
"attribute",
"is",
"supposed",
"to",
"be",
"created",
"and",
"set",
"by",
"the",
"filter",
"directing",
"the",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jwt/src/com/ibm/ws/security/jwt/web/JwtEndpointServices.java#L117-L126 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/progress/MultiTaskProgress.java | MultiTaskProgress.createTaskProgress | public WorkProgress createTaskProgress(long amount, String text) {
"""
Create a sub-progress for the given amount of work (this amount is added to the total amount to be done).
"""
this.amount += amount;
SubWorkProgress task = new SubWorkProgress(this, amount, amount, text);
synchronized (tasks) {
... | java | public WorkProgress createTaskProgress(long amount, String text) {
this.amount += amount;
SubWorkProgress task = new SubWorkProgress(this, amount, amount, text);
synchronized (tasks) {
tasks.add(task);
if (jp != null) jp.addToJoinDoNotCancel(task.getSynch());
}
return task;
} | [
"public",
"WorkProgress",
"createTaskProgress",
"(",
"long",
"amount",
",",
"String",
"text",
")",
"{",
"this",
".",
"amount",
"+=",
"amount",
";",
"SubWorkProgress",
"task",
"=",
"new",
"SubWorkProgress",
"(",
"this",
",",
"amount",
",",
"amount",
",",
"tex... | Create a sub-progress for the given amount of work (this amount is added to the total amount to be done). | [
"Create",
"a",
"sub",
"-",
"progress",
"for",
"the",
"given",
"amount",
"of",
"work",
"(",
"this",
"amount",
"is",
"added",
"to",
"the",
"total",
"amount",
"to",
"be",
"done",
")",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/progress/MultiTaskProgress.java#L21-L29 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolutionException.java | RepositoryResolutionException.getMinimumVersionForMissingProduct | public String getMinimumVersionForMissingProduct(String productId, String version, String edition) {
"""
This will iterate through the products that couldn't be found as supplied by {@link #getMissingProducts()} and look for the minimum version that was searched for. It will
limit it to products that match the su... | java | public String getMinimumVersionForMissingProduct(String productId, String version, String edition) {
Collection<LibertyVersionRange> filteredRanges = filterVersionRanges(productId, edition);
Collection<LibertyVersion> minimumVersions = new HashSet<LibertyVersion>();
for (LibertyVersionRange rang... | [
"public",
"String",
"getMinimumVersionForMissingProduct",
"(",
"String",
"productId",
",",
"String",
"version",
",",
"String",
"edition",
")",
"{",
"Collection",
"<",
"LibertyVersionRange",
">",
"filteredRanges",
"=",
"filterVersionRanges",
"(",
"productId",
",",
"edi... | This will iterate through the products that couldn't be found as supplied by {@link #getMissingProducts()} and look for the minimum version that was searched for. It will
limit it to products that match the supplied <code>productId</code>, major, minor and micro <code>version</code>, and <code>edition</code>. Note that... | [
"This",
"will",
"iterate",
"through",
"the",
"products",
"that",
"couldn",
"t",
"be",
"found",
"as",
"supplied",
"by",
"{",
"@link",
"#getMissingProducts",
"()",
"}",
"and",
"look",
"for",
"the",
"minimum",
"version",
"that",
"was",
"searched",
"for",
".",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolutionException.java#L102-L116 |
alkacon/opencms-core | src/org/opencms/ade/detailpage/CmsDetailPageConfigurationWriter.java | CmsDetailPageConfigurationWriter.writeValue | private void writeValue(String type, CmsUUID id, int index) {
"""
Writes a single item of detail page information to the XML content.<p>
@param type the type which the detail page should render
@param id the page id of the detail page
@param index the position at which the detail page info should be added
... | java | private void writeValue(String type, CmsUUID id, int index) {
Locale locale = CmsLocaleManager.getLocale("en");
// todo: check actual locale.
m_document.addValue(m_cms, N_DETAIL_PAGE, locale, index);
String typePath = N_DETAIL_PAGE + "[" + (1 + index) + "]/" + N_TYPE;
I_CmsXmlCo... | [
"private",
"void",
"writeValue",
"(",
"String",
"type",
",",
"CmsUUID",
"id",
",",
"int",
"index",
")",
"{",
"Locale",
"locale",
"=",
"CmsLocaleManager",
".",
"getLocale",
"(",
"\"en\"",
")",
";",
"// todo: check actual locale.",
"m_document",
".",
"addValue",
... | Writes a single item of detail page information to the XML content.<p>
@param type the type which the detail page should render
@param id the page id of the detail page
@param index the position at which the detail page info should be added | [
"Writes",
"a",
"single",
"item",
"of",
"detail",
"page",
"information",
"to",
"the",
"XML",
"content",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/detailpage/CmsDetailPageConfigurationWriter.java#L187-L198 |
aws/aws-sdk-java | aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/model/DescribeExclusionsResult.java | DescribeExclusionsResult.withExclusions | public DescribeExclusionsResult withExclusions(java.util.Map<String, Exclusion> exclusions) {
"""
<p>
Information about the exclusions.
</p>
@param exclusions
Information about the exclusions.
@return Returns a reference to this object so that method calls can be chained together.
"""
setExclusi... | java | public DescribeExclusionsResult withExclusions(java.util.Map<String, Exclusion> exclusions) {
setExclusions(exclusions);
return this;
} | [
"public",
"DescribeExclusionsResult",
"withExclusions",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"Exclusion",
">",
"exclusions",
")",
"{",
"setExclusions",
"(",
"exclusions",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Information about the exclusions.
</p>
@param exclusions
Information about the exclusions.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Information",
"about",
"the",
"exclusions",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/model/DescribeExclusionsResult.java#L74-L77 |
Red5/red5-server-common | src/main/java/org/red5/server/net/servlet/ServletUtils.java | ServletUtils.copy | public static void copy(InputStream input, OutputStream output, int bufferSize) throws IOException {
"""
Copies information from the input stream to the output stream using the specified buffer size
@param input
input
@param bufferSize
buffer size
@param output
output
@throws java.io.IOException
on error... | java | public static void copy(InputStream input, OutputStream output, int bufferSize) throws IOException {
int availableBytes = input.available();
log.debug("copy - bufferSize: {} available: {}", bufferSize, availableBytes);
byte[] buf = null;
if (availableBytes > 0) {
if (ava... | [
"public",
"static",
"void",
"copy",
"(",
"InputStream",
"input",
",",
"OutputStream",
"output",
",",
"int",
"bufferSize",
")",
"throws",
"IOException",
"{",
"int",
"availableBytes",
"=",
"input",
".",
"available",
"(",
")",
";",
"log",
".",
"debug",
"(",
"... | Copies information from the input stream to the output stream using the specified buffer size
@param input
input
@param bufferSize
buffer size
@param output
output
@throws java.io.IOException
on error | [
"Copies",
"information",
"from",
"the",
"input",
"stream",
"to",
"the",
"output",
"stream",
"using",
"the",
"specified",
"buffer",
"size"
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/servlet/ServletUtils.java#L70-L98 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/metadata/ConnectionRepository.java | ConnectionRepository.addDescriptor | public JdbcConnectionDescriptor addDescriptor(String jcdAlias, DataSource dataSource, String username, String password) {
"""
Creates and adds a new connection descriptor for the given JDBC data source.
This method tries to guess the platform to be used, but it should be checked
afterwards nonetheless using the ... | java | public JdbcConnectionDescriptor addDescriptor(String jcdAlias, DataSource dataSource, String username, String password)
{
JdbcConnectionDescriptor jcd = new JdbcConnectionDescriptor();
jcd.setJcdAlias(jcdAlias);
jcd.setDataSource(dataSource);
if (username != null)
{
... | [
"public",
"JdbcConnectionDescriptor",
"addDescriptor",
"(",
"String",
"jcdAlias",
",",
"DataSource",
"dataSource",
",",
"String",
"username",
",",
"String",
"password",
")",
"{",
"JdbcConnectionDescriptor",
"jcd",
"=",
"new",
"JdbcConnectionDescriptor",
"(",
")",
";",... | Creates and adds a new connection descriptor for the given JDBC data source.
This method tries to guess the platform to be used, but it should be checked
afterwards nonetheless using the {@link JdbcConnectionDescriptor#getDbms()} method.
Note that the descriptor won't have a value for the driver because it is not possi... | [
"Creates",
"and",
"adds",
"a",
"new",
"connection",
"descriptor",
"for",
"the",
"given",
"JDBC",
"data",
"source",
".",
"This",
"method",
"tries",
"to",
"guess",
"the",
"platform",
"to",
"be",
"used",
"but",
"it",
"should",
"be",
"checked",
"afterwards",
"... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/ConnectionRepository.java#L199-L219 |
spring-projects/spring-boot | spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/util/ResourceUtils.java | ResourceUtils.getUrls | public static List<String> getUrls(String path, ClassLoader classLoader) {
"""
Return URLs from a given source path. Source paths can be simple file locations
(/some/file.java) or wildcard patterns (/some/**). Additionally the prefixes
"file:", "classpath:" and "classpath*:" can be used for specific path types.
... | java | public static List<String> getUrls(String path, ClassLoader classLoader) {
if (classLoader == null) {
classLoader = ClassUtils.getDefaultClassLoader();
}
path = StringUtils.cleanPath(path);
try {
return getUrlsFromWildcardPath(path, classLoader);
}
catch (Exception ex) {
throw new IllegalArgumentEx... | [
"public",
"static",
"List",
"<",
"String",
">",
"getUrls",
"(",
"String",
"path",
",",
"ClassLoader",
"classLoader",
")",
"{",
"if",
"(",
"classLoader",
"==",
"null",
")",
"{",
"classLoader",
"=",
"ClassUtils",
".",
"getDefaultClassLoader",
"(",
")",
";",
... | Return URLs from a given source path. Source paths can be simple file locations
(/some/file.java) or wildcard patterns (/some/**). Additionally the prefixes
"file:", "classpath:" and "classpath*:" can be used for specific path types.
@param path the source path
@param classLoader the class loader or {@code null} to use... | [
"Return",
"URLs",
"from",
"a",
"given",
"source",
"path",
".",
"Source",
"paths",
"can",
"be",
"simple",
"file",
"locations",
"(",
"/",
"some",
"/",
"file",
".",
"java",
")",
"or",
"wildcard",
"patterns",
"(",
"/",
"some",
"/",
"**",
")",
".",
"Addit... | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/util/ResourceUtils.java#L68-L80 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java | DefaultFeatureForm.getValue | @Api
public void getValue(String name, DoubleAttribute attribute) {
"""
Get a double value from the form, and place it in <code>attribute</code>.
@param name attribute name
@param attribute attribute to put value
@since 1.11.1
"""
attribute.setValue(toDouble(formWidget.getValue(name)));
} | java | @Api
public void getValue(String name, DoubleAttribute attribute) {
attribute.setValue(toDouble(formWidget.getValue(name)));
} | [
"@",
"Api",
"public",
"void",
"getValue",
"(",
"String",
"name",
",",
"DoubleAttribute",
"attribute",
")",
"{",
"attribute",
".",
"setValue",
"(",
"toDouble",
"(",
"formWidget",
".",
"getValue",
"(",
"name",
")",
")",
")",
";",
"}"
] | Get a double value from the form, and place it in <code>attribute</code>.
@param name attribute name
@param attribute attribute to put value
@since 1.11.1 | [
"Get",
"a",
"double",
"value",
"from",
"the",
"form",
"and",
"place",
"it",
"in",
"<code",
">",
"attribute<",
"/",
"code",
">",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java#L705-L708 |
wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/ServerEnvironment.java | ServerEnvironment.getFileFromPath | private File getFileFromPath(final String path) {
"""
Get a File from configuration.
@param path the file path
@return the CanonicalFile form for the given name.
"""
File result = (path != null) ? new File(path) : null;
// AS7-1752 see if a non-existent relative path exists relative to th... | java | private File getFileFromPath(final String path) {
File result = (path != null) ? new File(path) : null;
// AS7-1752 see if a non-existent relative path exists relative to the home dir
if (result != null && homeDir != null && !result.exists() && !result.isAbsolute()) {
File relative =... | [
"private",
"File",
"getFileFromPath",
"(",
"final",
"String",
"path",
")",
"{",
"File",
"result",
"=",
"(",
"path",
"!=",
"null",
")",
"?",
"new",
"File",
"(",
"path",
")",
":",
"null",
";",
"// AS7-1752 see if a non-existent relative path exists relative to the h... | Get a File from configuration.
@param path the file path
@return the CanonicalFile form for the given name. | [
"Get",
"a",
"File",
"from",
"configuration",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/ServerEnvironment.java#L1190-L1200 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/PluralRules.java | PluralRules.getKeywordStatus | public KeywordStatus getKeywordStatus(String keyword, int offset, Set<Double> explicits,
Output<Double> uniqueValue) {
"""
Find the status for the keyword, given a certain set of explicit values.
@param keyword
the particular keyword (call rules.getKeywords() to get the valid ones)
@param offset
... | java | public KeywordStatus getKeywordStatus(String keyword, int offset, Set<Double> explicits,
Output<Double> uniqueValue) {
return getKeywordStatus(keyword, offset, explicits, uniqueValue, SampleType.INTEGER);
} | [
"public",
"KeywordStatus",
"getKeywordStatus",
"(",
"String",
"keyword",
",",
"int",
"offset",
",",
"Set",
"<",
"Double",
">",
"explicits",
",",
"Output",
"<",
"Double",
">",
"uniqueValue",
")",
"{",
"return",
"getKeywordStatus",
"(",
"keyword",
",",
"offset",... | Find the status for the keyword, given a certain set of explicit values.
@param keyword
the particular keyword (call rules.getKeywords() to get the valid ones)
@param offset
the offset used, or 0.0d if not. Internally, the offset is subtracted from each explicit value before
checking against the keyword values.
@param... | [
"Find",
"the",
"status",
"for",
"the",
"keyword",
"given",
"a",
"certain",
"set",
"of",
"explicit",
"values",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/PluralRules.java#L2302-L2305 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpmib.java | snmpmib.get | public static snmpmib get(nitro_service service, options option) throws Exception {
"""
Use this API to fetch all the snmpmib resources that are configured on netscaler.
"""
snmpmib obj = new snmpmib();
snmpmib[] response = (snmpmib[])obj.get_resources(service,option);
return response[0];
} | java | public static snmpmib get(nitro_service service, options option) throws Exception{
snmpmib obj = new snmpmib();
snmpmib[] response = (snmpmib[])obj.get_resources(service,option);
return response[0];
} | [
"public",
"static",
"snmpmib",
"get",
"(",
"nitro_service",
"service",
",",
"options",
"option",
")",
"throws",
"Exception",
"{",
"snmpmib",
"obj",
"=",
"new",
"snmpmib",
"(",
")",
";",
"snmpmib",
"[",
"]",
"response",
"=",
"(",
"snmpmib",
"[",
"]",
")",... | Use this API to fetch all the snmpmib resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"all",
"the",
"snmpmib",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpmib.java#L248-L252 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/SOD.java | SOD.subspaceOutlierDegree | private double subspaceOutlierDegree(V queryObject, double[] center, long[] weightVector) {
"""
Compute SOD score.
@param queryObject Query object
@param center Center vector
@param weightVector Weight vector
@return sod score
"""
final int card = BitsUtil.cardinality(weightVector);
if(card == 0)... | java | private double subspaceOutlierDegree(V queryObject, double[] center, long[] weightVector) {
final int card = BitsUtil.cardinality(weightVector);
if(card == 0) {
return 0;
}
final SubspaceEuclideanDistanceFunction df = new SubspaceEuclideanDistanceFunction(weightVector);
return df.distance(quer... | [
"private",
"double",
"subspaceOutlierDegree",
"(",
"V",
"queryObject",
",",
"double",
"[",
"]",
"center",
",",
"long",
"[",
"]",
"weightVector",
")",
"{",
"final",
"int",
"card",
"=",
"BitsUtil",
".",
"cardinality",
"(",
"weightVector",
")",
";",
"if",
"("... | Compute SOD score.
@param queryObject Query object
@param center Center vector
@param weightVector Weight vector
@return sod score | [
"Compute",
"SOD",
"score",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/SOD.java#L251-L258 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.installationTemplate_templateName_PUT | public void installationTemplate_templateName_PUT(String templateName, OvhTemplates body) throws IOException {
"""
Alter this object properties
REST: PUT /me/installationTemplate/{templateName}
@param body [required] New object properties
@param templateName [required] This template name
"""
String qPat... | java | public void installationTemplate_templateName_PUT(String templateName, OvhTemplates body) throws IOException {
String qPath = "/me/installationTemplate/{templateName}";
StringBuilder sb = path(qPath, templateName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"installationTemplate_templateName_PUT",
"(",
"String",
"templateName",
",",
"OvhTemplates",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/installationTemplate/{templateName}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
... | Alter this object properties
REST: PUT /me/installationTemplate/{templateName}
@param body [required] New object properties
@param templateName [required] This template name | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L3452-L3456 |
structurizr/java | structurizr-core/src/com/structurizr/documentation/Arc42DocumentationTemplate.java | Arc42DocumentationTemplate.addQualityRequirementsSection | public Section addQualityRequirementsSection(SoftwareSystem softwareSystem, File... files) throws IOException {
"""
Adds a "Quality Requirements" section relating to a {@link SoftwareSystem} from one or more files.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@param ... | java | public Section addQualityRequirementsSection(SoftwareSystem softwareSystem, File... files) throws IOException {
return addSection(softwareSystem, "Quality Requirements", files);
} | [
"public",
"Section",
"addQualityRequirementsSection",
"(",
"SoftwareSystem",
"softwareSystem",
",",
"File",
"...",
"files",
")",
"throws",
"IOException",
"{",
"return",
"addSection",
"(",
"softwareSystem",
",",
"\"Quality Requirements\"",
",",
"files",
")",
";",
"}"
] | Adds a "Quality Requirements" section relating to a {@link SoftwareSystem} from one or more files.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@param files one or more File objects that point to the documentation content
@return a documentation ... | [
"Adds",
"a",
"Quality",
"Requirements",
"section",
"relating",
"to",
"a",
"{",
"@link",
"SoftwareSystem",
"}",
"from",
"one",
"or",
"more",
"files",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/documentation/Arc42DocumentationTemplate.java#L265-L267 |
GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/BigQueryHelper.java | BigQueryHelper.checkJobIdEquality | public void checkJobIdEquality(Job expected, Job actual) {
"""
Helper to check for non-null Job.getJobReference().getJobId() and quality of the getJobId()
between {@code expected} and {@code actual}, using Preconditions.checkState.
"""
Preconditions.checkState(actual.getJobReference() != null
&& a... | java | public void checkJobIdEquality(Job expected, Job actual) {
Preconditions.checkState(actual.getJobReference() != null
&& actual.getJobReference().getJobId() != null
&& expected.getJobReference() != null
&& expected.getJobReference().getJobId() != null
&& actual.getJobReference().getJo... | [
"public",
"void",
"checkJobIdEquality",
"(",
"Job",
"expected",
",",
"Job",
"actual",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"actual",
".",
"getJobReference",
"(",
")",
"!=",
"null",
"&&",
"actual",
".",
"getJobReference",
"(",
")",
".",
"getJobI... | Helper to check for non-null Job.getJobReference().getJobId() and quality of the getJobId()
between {@code expected} and {@code actual}, using Preconditions.checkState. | [
"Helper",
"to",
"check",
"for",
"non",
"-",
"null",
"Job",
".",
"getJobReference",
"()",
".",
"getJobId",
"()",
"and",
"quality",
"of",
"the",
"getJobId",
"()",
"between",
"{"
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/BigQueryHelper.java#L306-L314 |
evsinev/ber-tlv | src/main/java/com/payneteasy/tlv/BerTlvBuilder.java | BerTlvBuilder.addText | public BerTlvBuilder addText(BerTag aTag, String aText, Charset aCharset) {
"""
Add ASCII text
@param aTag tag
@param aText text
@return builder
"""
byte[] buffer = aText.getBytes(aCharset);
return addBytes(aTag, buffer, 0, buffer.length);
} | java | public BerTlvBuilder addText(BerTag aTag, String aText, Charset aCharset) {
byte[] buffer = aText.getBytes(aCharset);
return addBytes(aTag, buffer, 0, buffer.length);
} | [
"public",
"BerTlvBuilder",
"addText",
"(",
"BerTag",
"aTag",
",",
"String",
"aText",
",",
"Charset",
"aCharset",
")",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"aText",
".",
"getBytes",
"(",
"aCharset",
")",
";",
"return",
"addBytes",
"(",
"aTag",
",",
"buff... | Add ASCII text
@param aTag tag
@param aText text
@return builder | [
"Add",
"ASCII",
"text"
] | train | https://github.com/evsinev/ber-tlv/blob/82f980c7a8c1938c890a1e1b320ba383eac343f8/src/main/java/com/payneteasy/tlv/BerTlvBuilder.java#L218-L221 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/template/engine/beetl/BeetlUtil.java | BeetlUtil.render | public static String render(String path, String templateFileName, Map<String, Object> bindingMap) {
"""
渲染模板,如果为相对路径,则渲染ClassPath模板,否则渲染本地文件模板
@param path 路径
@param templateFileName 模板文件名
@param bindingMap 绑定参数
@return 渲染后的内容
@since 3.2.0
"""
if (FileUtil.isAbsolutePath(path)) {
return render(get... | java | public static String render(String path, String templateFileName, Map<String, Object> bindingMap) {
if (FileUtil.isAbsolutePath(path)) {
return render(getFileTemplate(path, templateFileName), bindingMap);
} else {
return render(getClassPathTemplate(path, templateFileName), bindingMap);
}
} | [
"public",
"static",
"String",
"render",
"(",
"String",
"path",
",",
"String",
"templateFileName",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"bindingMap",
")",
"{",
"if",
"(",
"FileUtil",
".",
"isAbsolutePath",
"(",
"path",
")",
")",
"{",
"return",
"... | 渲染模板,如果为相对路径,则渲染ClassPath模板,否则渲染本地文件模板
@param path 路径
@param templateFileName 模板文件名
@param bindingMap 绑定参数
@return 渲染后的内容
@since 3.2.0 | [
"渲染模板,如果为相对路径,则渲染ClassPath模板,否则渲染本地文件模板"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/beetl/BeetlUtil.java#L195-L201 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/crypto/HDKeyDerivation.java | HDKeyDerivation.deriveThisOrNextChildKey | public static DeterministicKey deriveThisOrNextChildKey(DeterministicKey parent, int childNumber) {
"""
Derives a key of the "extended" child number, ie. with the 0x80000000 bit specifying whether to use
hardened derivation or not. If derivation fails, tries a next child.
"""
int nAttempts = 0;
... | java | public static DeterministicKey deriveThisOrNextChildKey(DeterministicKey parent, int childNumber) {
int nAttempts = 0;
ChildNumber child = new ChildNumber(childNumber);
boolean isHardened = child.isHardened();
while (nAttempts < MAX_CHILD_DERIVATION_ATTEMPTS) {
try {
... | [
"public",
"static",
"DeterministicKey",
"deriveThisOrNextChildKey",
"(",
"DeterministicKey",
"parent",
",",
"int",
"childNumber",
")",
"{",
"int",
"nAttempts",
"=",
"0",
";",
"ChildNumber",
"child",
"=",
"new",
"ChildNumber",
"(",
"childNumber",
")",
";",
"boolean... | Derives a key of the "extended" child number, ie. with the 0x80000000 bit specifying whether to use
hardened derivation or not. If derivation fails, tries a next child. | [
"Derives",
"a",
"key",
"of",
"the",
"extended",
"child",
"number",
"ie",
".",
"with",
"the",
"0x80000000",
"bit",
"specifying",
"whether",
"to",
"use",
"hardened",
"derivation",
"or",
"not",
".",
"If",
"derivation",
"fails",
"tries",
"a",
"next",
"child",
... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/crypto/HDKeyDerivation.java#L121-L134 |
grpc/grpc-java | grpclb/src/main/java/io/grpc/grpclb/GrpclbState.java | GrpclbState.maybeUpdatePicker | private void maybeUpdatePicker(ConnectivityState state, RoundRobinPicker picker) {
"""
Update the given picker to the helper if it's different from the current one.
"""
// Discard the new picker if we are sure it won't make any difference, in order to save
// re-processing pending streams, and avoid un... | java | private void maybeUpdatePicker(ConnectivityState state, RoundRobinPicker picker) {
// Discard the new picker if we are sure it won't make any difference, in order to save
// re-processing pending streams, and avoid unnecessary resetting of the pointer in
// RoundRobinPicker.
if (picker.dropList.equals(c... | [
"private",
"void",
"maybeUpdatePicker",
"(",
"ConnectivityState",
"state",
",",
"RoundRobinPicker",
"picker",
")",
"{",
"// Discard the new picker if we are sure it won't make any difference, in order to save",
"// re-processing pending streams, and avoid unnecessary resetting of the pointer... | Update the given picker to the helper if it's different from the current one. | [
"Update",
"the",
"given",
"picker",
"to",
"the",
"helper",
"if",
"it",
"s",
"different",
"from",
"the",
"current",
"one",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/grpclb/src/main/java/io/grpc/grpclb/GrpclbState.java#L748-L760 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/sort/NormalizedKeySorter.java | NormalizedKeySorter.writeToOutput | @Override
public void writeToOutput(final ChannelWriterOutputView output) throws IOException {
"""
Writes the records in this buffer in their logical order to the given output.
@param output The output view to write the records to.
@throws IOException Thrown, if an I/O exception occurred writing to the output... | java | @Override
public void writeToOutput(final ChannelWriterOutputView output) throws IOException {
int recordsLeft = this.numRecords;
int currentMemSeg = 0;
while (recordsLeft > 0)
{
final MemorySegment currentIndexSegment = this.sortIndex.get(currentMemSeg++);
int offset = 0;
// check whether we have a f... | [
"@",
"Override",
"public",
"void",
"writeToOutput",
"(",
"final",
"ChannelWriterOutputView",
"output",
")",
"throws",
"IOException",
"{",
"int",
"recordsLeft",
"=",
"this",
".",
"numRecords",
";",
"int",
"currentMemSeg",
"=",
"0",
";",
"while",
"(",
"recordsLeft... | Writes the records in this buffer in their logical order to the given output.
@param output The output view to write the records to.
@throws IOException Thrown, if an I/O exception occurred writing to the output view. | [
"Writes",
"the",
"records",
"in",
"this",
"buffer",
"in",
"their",
"logical",
"order",
"to",
"the",
"given",
"output",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/sort/NormalizedKeySorter.java#L432-L460 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getRankedStats | public Future<RankedStats> getRankedStats(long summoner, Season season) {
"""
Get ranked stats for a player in a specific season
@param summoner The id of the summoner
@param season The season
@return Ranked stats
@see <a href=https://developer.riotgames.com/api/methods#!/622/1937>Official API documentation</a... | java | public Future<RankedStats> getRankedStats(long summoner, Season season) {
return new ApiFuture<>(() -> handler.getRankedStats(summoner, season));
} | [
"public",
"Future",
"<",
"RankedStats",
">",
"getRankedStats",
"(",
"long",
"summoner",
",",
"Season",
"season",
")",
"{",
"return",
"new",
"ApiFuture",
"<>",
"(",
"(",
")",
"->",
"handler",
".",
"getRankedStats",
"(",
"summoner",
",",
"season",
")",
")",
... | Get ranked stats for a player in a specific season
@param summoner The id of the summoner
@param season The season
@return Ranked stats
@see <a href=https://developer.riotgames.com/api/methods#!/622/1937>Official API documentation</a> | [
"Get",
"ranked",
"stats",
"for",
"a",
"player",
"in",
"a",
"specific",
"season"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L1055-L1057 |
qzagarese/hyaline-dto | hyaline-dto/src/main/java/org/hyalinedto/api/Hyaline.java | Hyaline.dtoFromScratch | public static <T> T dtoFromScratch(T entity, DTO dtoTemplate) throws HyalineException {
"""
It lets you create a new DTO from scratch. This means that any annotation
from JAXB, Jackson or whatever serialization framework you are using on
your entity T will be ignored. The only annotation-based configuration
tha... | java | public static <T> T dtoFromScratch(T entity, DTO dtoTemplate) throws HyalineException {
return dtoFromScratch(entity, dtoTemplate, "Hyaline$Proxy$" + System.currentTimeMillis());
} | [
"public",
"static",
"<",
"T",
">",
"T",
"dtoFromScratch",
"(",
"T",
"entity",
",",
"DTO",
"dtoTemplate",
")",
"throws",
"HyalineException",
"{",
"return",
"dtoFromScratch",
"(",
"entity",
",",
"dtoTemplate",
",",
"\"Hyaline$Proxy$\"",
"+",
"System",
".",
"curr... | It lets you create a new DTO from scratch. This means that any annotation
from JAXB, Jackson or whatever serialization framework you are using on
your entity T will be ignored. The only annotation-based configuration
that will be used is the one you are defining in this invocation.
@param <T>
the generic type
@param e... | [
"It",
"lets",
"you",
"create",
"a",
"new",
"DTO",
"from",
"scratch",
".",
"This",
"means",
"that",
"any",
"annotation",
"from",
"JAXB",
"Jackson",
"or",
"whatever",
"serialization",
"framework",
"you",
"are",
"using",
"on",
"your",
"entity",
"T",
"will",
"... | train | https://github.com/qzagarese/hyaline-dto/blob/3392de5b7f93cdb3a1c53aa977ee682c141df5f4/hyaline-dto/src/main/java/org/hyalinedto/api/Hyaline.java#L77-L79 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Input.java | Input.isControlDwn | private boolean isControlDwn(int index, int controllerIndex) {
"""
Check if a particular control is currently pressed
@param index The index of the control
@param controllerIndex The index of the control to which the control belongs
@return True if the control is pressed
"""
switch (index) {
case LE... | java | private boolean isControlDwn(int index, int controllerIndex) {
switch (index) {
case LEFT:
return isControllerLeft(controllerIndex);
case RIGHT:
return isControllerRight(controllerIndex);
case UP:
return isControllerUp(controllerIndex);
case DOWN:
return isControllerDown(controllerIndex);... | [
"private",
"boolean",
"isControlDwn",
"(",
"int",
"index",
",",
"int",
"controllerIndex",
")",
"{",
"switch",
"(",
"index",
")",
"{",
"case",
"LEFT",
":",
"return",
"isControllerLeft",
"(",
"controllerIndex",
")",
";",
"case",
"RIGHT",
":",
"return",
"isCont... | Check if a particular control is currently pressed
@param index The index of the control
@param controllerIndex The index of the control to which the control belongs
@return True if the control is pressed | [
"Check",
"if",
"a",
"particular",
"control",
"is",
"currently",
"pressed"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Input.java#L1476-L1493 |
j256/ormlite-core | src/main/java/com/j256/ormlite/misc/TransactionManager.java | TransactionManager.callInTransaction | public <T> T callInTransaction(final Callable<T> callable) throws SQLException {
"""
Execute the {@link Callable} class inside of a transaction. If the callable returns then the transaction is
committed. If the callable throws an exception then the transaction is rolled back and a {@link SQLException} is
thrown ... | java | public <T> T callInTransaction(final Callable<T> callable) throws SQLException {
return callInTransaction(connectionSource, callable);
} | [
"public",
"<",
"T",
">",
"T",
"callInTransaction",
"(",
"final",
"Callable",
"<",
"T",
">",
"callable",
")",
"throws",
"SQLException",
"{",
"return",
"callInTransaction",
"(",
"connectionSource",
",",
"callable",
")",
";",
"}"
] | Execute the {@link Callable} class inside of a transaction. If the callable returns then the transaction is
committed. If the callable throws an exception then the transaction is rolled back and a {@link SQLException} is
thrown by this method.
<p>
<b> NOTE: </b> If your callable block really doesn't have a return obje... | [
"Execute",
"the",
"{",
"@link",
"Callable",
"}",
"class",
"inside",
"of",
"a",
"transaction",
".",
"If",
"the",
"callable",
"returns",
"then",
"the",
"transaction",
"is",
"committed",
".",
"If",
"the",
"callable",
"throws",
"an",
"exception",
"then",
"the",
... | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/misc/TransactionManager.java#L128-L130 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/sifts/SiftsXMLParser.java | SiftsXMLParser.getTextValue | @SuppressWarnings("unused")
private String getTextValue(Element ele, String tagName) {
"""
I take a xml element and the tag name, look for the tag and get
the text content
i.e for <employee><name>John</name></employee> xml snippet if
the Element points to employee node and tagName is 'name' I will return John... | java | @SuppressWarnings("unused")
private String getTextValue(Element ele, String tagName) {
String textVal = null;
NodeList nl = ele.getElementsByTagName(tagName);
if(nl != null && nl.getLength() > 0) {
Element el = (Element)nl.item(0);
textVal = el.getFirstChild().getNodeValue();
}
return textVal;... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"private",
"String",
"getTextValue",
"(",
"Element",
"ele",
",",
"String",
"tagName",
")",
"{",
"String",
"textVal",
"=",
"null",
";",
"NodeList",
"nl",
"=",
"ele",
".",
"getElementsByTagName",
"(",
"tagName",
... | I take a xml element and the tag name, look for the tag and get
the text content
i.e for <employee><name>John</name></employee> xml snippet if
the Element points to employee node and tagName is 'name' I will return John | [
"I",
"take",
"a",
"xml",
"element",
"and",
"the",
"tag",
"name",
"look",
"for",
"the",
"tag",
"and",
"get",
"the",
"text",
"content",
"i",
".",
"e",
"for",
"<employee",
">",
"<name",
">",
"John<",
"/",
"name",
">",
"<",
"/",
"employee",
">",
"xml",... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/sifts/SiftsXMLParser.java#L259-L269 |
google/closure-compiler | src/com/google/javascript/jscomp/PeepholeMinimizeConditions.java | PeepholeMinimizeConditions.areMatchingExits | boolean areMatchingExits(Node nodeThis, Node nodeThat) {
"""
Check whether one exit can be replaced with another. Verify:
1) They are identical expressions
2) If an exception is possible that the statements, the original
and the potential replacement are in the same exception handler.
"""
return nodeThi... | java | boolean areMatchingExits(Node nodeThis, Node nodeThat) {
return nodeThis.isEquivalentTo(nodeThat)
&& (!isExceptionPossible(nodeThis)
|| getExceptionHandler(nodeThis) == getExceptionHandler(nodeThat));
} | [
"boolean",
"areMatchingExits",
"(",
"Node",
"nodeThis",
",",
"Node",
"nodeThat",
")",
"{",
"return",
"nodeThis",
".",
"isEquivalentTo",
"(",
"nodeThat",
")",
"&&",
"(",
"!",
"isExceptionPossible",
"(",
"nodeThis",
")",
"||",
"getExceptionHandler",
"(",
"nodeThis... | Check whether one exit can be replaced with another. Verify:
1) They are identical expressions
2) If an exception is possible that the statements, the original
and the potential replacement are in the same exception handler. | [
"Check",
"whether",
"one",
"exit",
"can",
"be",
"replaced",
"with",
"another",
".",
"Verify",
":",
"1",
")",
"They",
"are",
"identical",
"expressions",
"2",
")",
"If",
"an",
"exception",
"is",
"possible",
"that",
"the",
"statements",
"the",
"original",
"an... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/PeepholeMinimizeConditions.java#L383-L387 |
samskivert/samskivert | src/main/java/com/samskivert/util/ListUtil.java | ListUtil.clearRef | public static Object clearRef (Object[] list, Object element) {
"""
Clears out the first element that is referentially equal to the
supplied element (<code>list[idx] == element</code>).
@return the element that was removed or null if it was not found.
"""
return clear(REFERENCE_COMP, list, element)... | java | public static Object clearRef (Object[] list, Object element)
{
return clear(REFERENCE_COMP, list, element);
} | [
"public",
"static",
"Object",
"clearRef",
"(",
"Object",
"[",
"]",
"list",
",",
"Object",
"element",
")",
"{",
"return",
"clear",
"(",
"REFERENCE_COMP",
",",
"list",
",",
"element",
")",
";",
"}"
] | Clears out the first element that is referentially equal to the
supplied element (<code>list[idx] == element</code>).
@return the element that was removed or null if it was not found. | [
"Clears",
"out",
"the",
"first",
"element",
"that",
"is",
"referentially",
"equal",
"to",
"the",
"supplied",
"element",
"(",
"<code",
">",
"list",
"[",
"idx",
"]",
"==",
"element<",
"/",
"code",
">",
")",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ListUtil.java#L329-L332 |
jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/Entity.java | Entity.getList | public List<?> getList(PMContext ctx, EntityFilter filter) throws PMException {
"""
Returns a list of this entity instances with null from and count and with
the given filter
@param ctx The context
@param filter The filter
@return The list
@throws PMException
"""
return getList(ctx, filter, null... | java | public List<?> getList(PMContext ctx, EntityFilter filter) throws PMException {
return getList(ctx, filter, null, null, null);
} | [
"public",
"List",
"<",
"?",
">",
"getList",
"(",
"PMContext",
"ctx",
",",
"EntityFilter",
"filter",
")",
"throws",
"PMException",
"{",
"return",
"getList",
"(",
"ctx",
",",
"filter",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"}"
] | Returns a list of this entity instances with null from and count and with
the given filter
@param ctx The context
@param filter The filter
@return The list
@throws PMException | [
"Returns",
"a",
"list",
"of",
"this",
"entity",
"instances",
"with",
"null",
"from",
"and",
"count",
"and",
"with",
"the",
"given",
"filter"
] | train | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/Entity.java#L146-L148 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/cuComplex.java | cuComplex.cuCmplx | public static cuComplex cuCmplx (float r, float i) {
"""
Creates a new complex number consisting of the given real and
imaginary part.
@param r The real part of the complex number
@param i The imaginary part of the complex number
@return A complex number with the given real and imaginary part
"""
... | java | public static cuComplex cuCmplx (float r, float i)
{
cuComplex res = new cuComplex();
res.x = r;
res.y = i;
return res;
} | [
"public",
"static",
"cuComplex",
"cuCmplx",
"(",
"float",
"r",
",",
"float",
"i",
")",
"{",
"cuComplex",
"res",
"=",
"new",
"cuComplex",
"(",
")",
";",
"res",
".",
"x",
"=",
"r",
";",
"res",
".",
"y",
"=",
"i",
";",
"return",
"res",
";",
"}"
] | Creates a new complex number consisting of the given real and
imaginary part.
@param r The real part of the complex number
@param i The imaginary part of the complex number
@return A complex number with the given real and imaginary part | [
"Creates",
"a",
"new",
"complex",
"number",
"consisting",
"of",
"the",
"given",
"real",
"and",
"imaginary",
"part",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/cuComplex.java#L76-L82 |
GerdHolz/TOVAL | src/de/invation/code/toval/validate/Validate.java | Validate.minMax | public static void minMax(Integer min, Integer max) {
"""
Checks if the given parameters can be used as min/max bounds.
@param min The minimum value.
@param max The maximum value.
@throws ParameterException if the maximum is bigger than the minimum.
"""
if(!validation) return;
Validate.notNull(min);
V... | java | public static void minMax(Integer min, Integer max) {
if(!validation) return;
Validate.notNull(min);
Validate.notNull(max);
if(min > max)
throw new ParameterException(ErrorCode.RANGEVIOLATION, "Minumum is bigger than maximum.");
} | [
"public",
"static",
"void",
"minMax",
"(",
"Integer",
"min",
",",
"Integer",
"max",
")",
"{",
"if",
"(",
"!",
"validation",
")",
"return",
";",
"Validate",
".",
"notNull",
"(",
"min",
")",
";",
"Validate",
".",
"notNull",
"(",
"max",
")",
";",
"if",
... | Checks if the given parameters can be used as min/max bounds.
@param min The minimum value.
@param max The maximum value.
@throws ParameterException if the maximum is bigger than the minimum. | [
"Checks",
"if",
"the",
"given",
"parameters",
"can",
"be",
"used",
"as",
"min",
"/",
"max",
"bounds",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/validate/Validate.java#L196-L202 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java | Validator.expectExactMatch | public void expectExactMatch(String name, String anotherName) {
"""
Validates to fields to exactly (case-sensitive) match
@param name The field to check
@param anotherName The other field to check against
"""
expectExactMatch(name, anotherName, messages.get(Validation.EXACT_MATCH_KEY.name(), name, ... | java | public void expectExactMatch(String name, String anotherName) {
expectExactMatch(name, anotherName, messages.get(Validation.EXACT_MATCH_KEY.name(), name, anotherName));
} | [
"public",
"void",
"expectExactMatch",
"(",
"String",
"name",
",",
"String",
"anotherName",
")",
"{",
"expectExactMatch",
"(",
"name",
",",
"anotherName",
",",
"messages",
".",
"get",
"(",
"Validation",
".",
"EXACT_MATCH_KEY",
".",
"name",
"(",
")",
",",
"nam... | Validates to fields to exactly (case-sensitive) match
@param name The field to check
@param anotherName The other field to check against | [
"Validates",
"to",
"fields",
"to",
"exactly",
"(",
"case",
"-",
"sensitive",
")",
"match"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java#L171-L173 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.