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 |
|---|---|---|---|---|---|---|---|---|---|---|
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/utils/URBridgeEntity.java | URBridgeEntity.getSecurityName | public String getSecurityName(boolean setAttr) throws Exception {
"""
Returns the securityName of a user or a group.
@param setAttr a boolean indicating whether to actually set the attribute
in the entity or just perform a lookup.
@return the user or group's securityName.
@throws Exception identifier values ... | java | public String getSecurityName(boolean setAttr) throws Exception {
String securityName = null;
if (entity.getIdentifier().isSet(securityNameProp)) {
securityName = (String) entity.getIdentifier().get(securityNameProp);
}
// Neither identifier is set.
if (securityName ... | [
"public",
"String",
"getSecurityName",
"(",
"boolean",
"setAttr",
")",
"throws",
"Exception",
"{",
"String",
"securityName",
"=",
"null",
";",
"if",
"(",
"entity",
".",
"getIdentifier",
"(",
")",
".",
"isSet",
"(",
"securityNameProp",
")",
")",
"{",
"securit... | Returns the securityName of a user or a group.
@param setAttr a boolean indicating whether to actually set the attribute
in the entity or just perform a lookup.
@return the user or group's securityName.
@throws Exception identifier values are missing or the underlying
registry threw an error. | [
"Returns",
"the",
"securityName",
"of",
"a",
"user",
"or",
"a",
"group",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/utils/URBridgeEntity.java#L161-L186 |
google/error-prone | check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java | SuggestedFixes.addModifiers | public static Optional<SuggestedFix> addModifiers(
Tree tree, VisitorState state, Modifier... modifiers) {
"""
Adds modifiers to the given class, method, or field declaration.
"""
ModifiersTree originalModifiers = getModifiers(tree);
if (originalModifiers == null) {
return Optional.empty();... | java | public static Optional<SuggestedFix> addModifiers(
Tree tree, VisitorState state, Modifier... modifiers) {
ModifiersTree originalModifiers = getModifiers(tree);
if (originalModifiers == null) {
return Optional.empty();
}
return addModifiers(tree, originalModifiers, state, new TreeSet<>(Array... | [
"public",
"static",
"Optional",
"<",
"SuggestedFix",
">",
"addModifiers",
"(",
"Tree",
"tree",
",",
"VisitorState",
"state",
",",
"Modifier",
"...",
"modifiers",
")",
"{",
"ModifiersTree",
"originalModifiers",
"=",
"getModifiers",
"(",
"tree",
")",
";",
"if",
... | Adds modifiers to the given class, method, or field declaration. | [
"Adds",
"modifiers",
"to",
"the",
"given",
"class",
"method",
"or",
"field",
"declaration",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java#L157-L164 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/KeysAndAttributes.java | KeysAndAttributes.setKeys | public void setKeys(java.util.Collection<java.util.Map<String, AttributeValue>> keys) {
"""
<p>
The primary key attribute values that define the items and the attributes associated with the items.
</p>
@param keys
The primary key attribute values that define the items and the attributes associated with the i... | java | public void setKeys(java.util.Collection<java.util.Map<String, AttributeValue>> keys) {
if (keys == null) {
this.keys = null;
return;
}
this.keys = new java.util.ArrayList<java.util.Map<String, AttributeValue>>(keys);
} | [
"public",
"void",
"setKeys",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
">",
"keys",
")",
"{",
"if",
"(",
"keys",
"==",
"null",
")",
"{",
"this",
".",
"keys",
"=",
... | <p>
The primary key attribute values that define the items and the attributes associated with the items.
</p>
@param keys
The primary key attribute values that define the items and the attributes associated with the items. | [
"<p",
">",
"The",
"primary",
"key",
"attribute",
"values",
"that",
"define",
"the",
"items",
"and",
"the",
"attributes",
"associated",
"with",
"the",
"items",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/KeysAndAttributes.java#L166-L173 |
katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/PELoader.java | PELoader.loadMSDOSHeader | private MSDOSHeader loadMSDOSHeader(RandomAccessFile raf, long peSigOffset)
throws IOException {
"""
Loads the MSDOS header.
@param raf
the random access file instance
@return msdos header
@throws IOException
if unable to read header
"""
byte[] headerbytes = loadBytesSafely(0,
... | java | private MSDOSHeader loadMSDOSHeader(RandomAccessFile raf, long peSigOffset)
throws IOException {
byte[] headerbytes = loadBytesSafely(0,
MSDOSHeader.FORMATTED_HEADER_SIZE, raf);
return MSDOSHeader.newInstance(headerbytes, peSigOffset);
} | [
"private",
"MSDOSHeader",
"loadMSDOSHeader",
"(",
"RandomAccessFile",
"raf",
",",
"long",
"peSigOffset",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"headerbytes",
"=",
"loadBytesSafely",
"(",
"0",
",",
"MSDOSHeader",
".",
"FORMATTED_HEADER_SIZE",
",",
"r... | Loads the MSDOS header.
@param raf
the random access file instance
@return msdos header
@throws IOException
if unable to read header | [
"Loads",
"the",
"MSDOS",
"header",
"."
] | train | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/PELoader.java#L187-L192 |
beangle/beangle3 | commons/model/src/main/java/org/beangle/commons/entity/util/EntityUtils.java | EntityUtils.extractIdSeq | public static <T extends Entity<?>> String extractIdSeq(Collection<T> entities) {
"""
<p>
extractIdSeq.
</p>
@param entities a {@link java.util.Collection} object.
@param <T> a T object.
@return a {@link java.lang.String} object.
"""
if (null == entities || entities.isEmpty()) { return ""; }
Str... | java | public static <T extends Entity<?>> String extractIdSeq(Collection<T> entities) {
if (null == entities || entities.isEmpty()) { return ""; }
StringBuilder idBuf = new StringBuilder(",");
for (Iterator<T> iter = entities.iterator(); iter.hasNext();) {
T element = iter.next();
try {
idBuf.... | [
"public",
"static",
"<",
"T",
"extends",
"Entity",
"<",
"?",
">",
">",
"String",
"extractIdSeq",
"(",
"Collection",
"<",
"T",
">",
"entities",
")",
"{",
"if",
"(",
"null",
"==",
"entities",
"||",
"entities",
".",
"isEmpty",
"(",
")",
")",
"{",
"retur... | <p>
extractIdSeq.
</p>
@param entities a {@link java.util.Collection} object.
@param <T> a T object.
@return a {@link java.lang.String} object. | [
"<p",
">",
"extractIdSeq",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/model/src/main/java/org/beangle/commons/entity/util/EntityUtils.java#L132-L145 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/chrono/BritishCutoverDate.java | BritishCutoverDate.ofYearDay | static BritishCutoverDate ofYearDay(int prolepticYear, int dayOfYear) {
"""
Obtains a {@code BritishCutoverDate} representing a date in the British Cutover calendar
system from the proleptic-year and day-of-year fields.
<p>
This returns a {@code BritishCutoverDate} with the specified fields.
The day must be va... | java | static BritishCutoverDate ofYearDay(int prolepticYear, int dayOfYear) {
if (prolepticYear < CUTOVER_YEAR || (prolepticYear == CUTOVER_YEAR && dayOfYear <= 246)) {
JulianDate julian = JulianDate.ofYearDay(prolepticYear, dayOfYear);
return new BritishCutoverDate(julian);
} else if ... | [
"static",
"BritishCutoverDate",
"ofYearDay",
"(",
"int",
"prolepticYear",
",",
"int",
"dayOfYear",
")",
"{",
"if",
"(",
"prolepticYear",
"<",
"CUTOVER_YEAR",
"||",
"(",
"prolepticYear",
"==",
"CUTOVER_YEAR",
"&&",
"dayOfYear",
"<=",
"246",
")",
")",
"{",
"Juli... | Obtains a {@code BritishCutoverDate} representing a date in the British Cutover calendar
system from the proleptic-year and day-of-year fields.
<p>
This returns a {@code BritishCutoverDate} with the specified fields.
The day must be valid for the year, otherwise an exception will be thrown.
@param prolepticYear the B... | [
"Obtains",
"a",
"{",
"@code",
"BritishCutoverDate",
"}",
"representing",
"a",
"date",
"in",
"the",
"British",
"Cutover",
"calendar",
"system",
"from",
"the",
"proleptic",
"-",
"year",
"and",
"day",
"-",
"of",
"-",
"year",
"fields",
".",
"<p",
">",
"This",
... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/BritishCutoverDate.java#L194-L205 |
biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/SequenceScalePanel.java | SequenceScalePanel.drawSequence | protected int drawSequence(Graphics2D g2D, int y) {
"""
draw the Amino acid sequence
@param g2D
@param y .. height of line to draw the sequence onto
@return the new y value
"""
//g2D.drawString(panelName,10,10);
g2D.setColor(SEQUENCE_COLOR);
int aminosize = Math.round(1*scale);
if ( aminosize < ... | java | protected int drawSequence(Graphics2D g2D, int y){
//g2D.drawString(panelName,10,10);
g2D.setColor(SEQUENCE_COLOR);
int aminosize = Math.round(1*scale);
if ( aminosize < 1)
aminosize = 1;
// only draw within the ranges of the Clip
Rectangle drawHere = g2D.getClipBounds();
int startpos = coordManager... | [
"protected",
"int",
"drawSequence",
"(",
"Graphics2D",
"g2D",
",",
"int",
"y",
")",
"{",
"//g2D.drawString(panelName,10,10);",
"g2D",
".",
"setColor",
"(",
"SEQUENCE_COLOR",
")",
";",
"int",
"aminosize",
"=",
"Math",
".",
"round",
"(",
"1",
"*",
"scale",
")"... | draw the Amino acid sequence
@param g2D
@param y .. height of line to draw the sequence onto
@return the new y value | [
"draw",
"the",
"Amino",
"acid",
"sequence"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/SequenceScalePanel.java#L422-L477 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Messager.java | Messager.printNotice | public void printNotice(SourcePosition pos, String msg) {
"""
Print a message.
Part of DocErrorReporter.
@param pos the position where the error occurs
@param msg message to print
"""
if (diagListener != null) {
report(DiagnosticType.NOTE, pos, msg);
return;
}
... | java | public void printNotice(SourcePosition pos, String msg) {
if (diagListener != null) {
report(DiagnosticType.NOTE, pos, msg);
return;
}
PrintWriter noticeWriter = getWriter(WriterKind.NOTICE);
if (pos == null)
noticeWriter.println(msg);
else
... | [
"public",
"void",
"printNotice",
"(",
"SourcePosition",
"pos",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"diagListener",
"!=",
"null",
")",
"{",
"report",
"(",
"DiagnosticType",
".",
"NOTE",
",",
"pos",
",",
"msg",
")",
";",
"return",
";",
"}",
"Print... | Print a message.
Part of DocErrorReporter.
@param pos the position where the error occurs
@param msg message to print | [
"Print",
"a",
"message",
".",
"Part",
"of",
"DocErrorReporter",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Messager.java#L226-L238 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.license_worklight_new_duration_POST | public OvhOrder license_worklight_new_duration_POST(String duration, String ip, Boolean lessThan1000Users, OvhWorkLightVersionEnum version) throws IOException {
"""
Create order
REST: POST /order/license/worklight/new/{duration}
@param version [required] This license version
@param ip [required] Ip on which t... | java | public OvhOrder license_worklight_new_duration_POST(String duration, String ip, Boolean lessThan1000Users, OvhWorkLightVersionEnum version) throws IOException {
String qPath = "/order/license/worklight/new/{duration}";
StringBuilder sb = path(qPath, duration);
HashMap<String, Object>o = new HashMap<String, Object... | [
"public",
"OvhOrder",
"license_worklight_new_duration_POST",
"(",
"String",
"duration",
",",
"String",
"ip",
",",
"Boolean",
"lessThan1000Users",
",",
"OvhWorkLightVersionEnum",
"version",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/license/workli... | Create order
REST: POST /order/license/worklight/new/{duration}
@param version [required] This license version
@param ip [required] Ip on which this license would be installed (for dedicated your main server Ip)
@param lessThan1000Users [required] Does your company have less than 1000 potential users
@param duration [... | [
"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#L1578-L1587 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/security/UserGroupInformation.java | UserGroupInformation.doAs | public <T> T doAs(PrivilegedExceptionAction<T> action
) throws IOException, InterruptedException {
"""
Run the given action as the user, potentially throwing an exception.
@param <T> the return type of the run method
@param action the method to execute
@return the value from the run method
@throws IOExceptio... | java | public <T> T doAs(PrivilegedExceptionAction<T> action
) throws IOException, InterruptedException {
try {
return Subject.doAs(null, action);
} catch (PrivilegedActionException pae) {
Throwable cause = pae.getCause();
LOG.error("PriviledgedActionException as:"+this+" cause:"+cause);
if (... | [
"public",
"<",
"T",
">",
"T",
"doAs",
"(",
"PrivilegedExceptionAction",
"<",
"T",
">",
"action",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"try",
"{",
"return",
"Subject",
".",
"doAs",
"(",
"null",
",",
"action",
")",
";",
"}",
"cat... | Run the given action as the user, potentially throwing an exception.
@param <T> the return type of the run method
@param action the method to execute
@return the value from the run method
@throws IOException if the action throws an IOException
@throws Error if the action throws an Error
@throws RuntimeException if the ... | [
"Run",
"the",
"given",
"action",
"as",
"the",
"user",
"potentially",
"throwing",
"an",
"exception",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/security/UserGroupInformation.java#L177-L196 |
Multifarious/MacroManager | src/main/java/com/fasterxml/mama/listeners/HandoffResultsListener.java | HandoffResultsListener.finishHandoff | public void finishHandoff(final String workUnit) throws InterruptedException {
"""
Completes the process of handing off a work unit from one node to the current one.
Attempts to establish a final claim to the node handed off to me in ZooKeeper, and
repeats execution of the task every two seconds until it is comp... | java | public void finishHandoff(final String workUnit) throws InterruptedException
{
String unitId = cluster.workUnitMap.get(workUnit);
LOG.info("Handoff of {} to me acknowledged. Deleting claim ZNode for {} and waiting for {} to shutdown work.",
workUnit, workUnit,
((unitI... | [
"public",
"void",
"finishHandoff",
"(",
"final",
"String",
"workUnit",
")",
"throws",
"InterruptedException",
"{",
"String",
"unitId",
"=",
"cluster",
".",
"workUnitMap",
".",
"get",
"(",
"workUnit",
")",
";",
"LOG",
".",
"info",
"(",
"\"Handoff of {} to me ackn... | Completes the process of handing off a work unit from one node to the current one.
Attempts to establish a final claim to the node handed off to me in ZooKeeper, and
repeats execution of the task every two seconds until it is complete. | [
"Completes",
"the",
"process",
"of",
"handing",
"off",
"a",
"work",
"unit",
"from",
"one",
"node",
"to",
"the",
"current",
"one",
".",
"Attempts",
"to",
"establish",
"a",
"final",
"claim",
"to",
"the",
"node",
"handed",
"off",
"to",
"me",
"in",
"ZooKeepe... | train | https://github.com/Multifarious/MacroManager/blob/559785839981f460aaeba3c3fddff7fb667d9581/src/main/java/com/fasterxml/mama/listeners/HandoffResultsListener.java#L102-L123 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java | DeprecatedListWriter.addAnchor | private void addAnchor(DeprecatedAPIListBuilder builder, int type, Content htmlTree) {
"""
Add the anchor.
@param builder the deprecated list builder
@param type the type of list being documented
@param htmlTree the content tree to which the anchor will be added
"""
if (builder.hasDocumentation(ty... | java | private void addAnchor(DeprecatedAPIListBuilder builder, int type, Content htmlTree) {
if (builder.hasDocumentation(type)) {
htmlTree.addContent(getMarkerAnchor(ANCHORS[type]));
}
} | [
"private",
"void",
"addAnchor",
"(",
"DeprecatedAPIListBuilder",
"builder",
",",
"int",
"type",
",",
"Content",
"htmlTree",
")",
"{",
"if",
"(",
"builder",
".",
"hasDocumentation",
"(",
"type",
")",
")",
"{",
"htmlTree",
".",
"addContent",
"(",
"getMarkerAncho... | Add the anchor.
@param builder the deprecated list builder
@param type the type of list being documented
@param htmlTree the content tree to which the anchor will be added | [
"Add",
"the",
"anchor",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java#L233-L237 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java | UnicodeSet.applyPattern | public final UnicodeSet applyPattern(String pattern) {
"""
Modifies this set to represent the set specified by the given pattern.
See the class description for the syntax of the pattern language.
Whitespace is ignored.
@param pattern a string specifying what characters are in the set
@exception java.lang.Illeg... | java | public final UnicodeSet applyPattern(String pattern) {
checkFrozen();
return applyPattern(pattern, null, null, IGNORE_SPACE);
} | [
"public",
"final",
"UnicodeSet",
"applyPattern",
"(",
"String",
"pattern",
")",
"{",
"checkFrozen",
"(",
")",
";",
"return",
"applyPattern",
"(",
"pattern",
",",
"null",
",",
"null",
",",
"IGNORE_SPACE",
")",
";",
"}"
] | Modifies this set to represent the set specified by the given pattern.
See the class description for the syntax of the pattern language.
Whitespace is ignored.
@param pattern a string specifying what characters are in the set
@exception java.lang.IllegalArgumentException if the pattern
contains a syntax error. | [
"Modifies",
"this",
"set",
"to",
"represent",
"the",
"set",
"specified",
"by",
"the",
"given",
"pattern",
".",
"See",
"the",
"class",
"description",
"for",
"the",
"syntax",
"of",
"the",
"pattern",
"language",
".",
"Whitespace",
"is",
"ignored",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java#L544-L547 |
aws/aws-sdk-java | aws-java-sdk-codepipeline/src/main/java/com/amazonaws/services/codepipeline/model/PipelineDeclaration.java | PipelineDeclaration.withArtifactStores | public PipelineDeclaration withArtifactStores(java.util.Map<String, ArtifactStore> artifactStores) {
"""
<p>
A mapping of artifactStore objects and their corresponding regions. There must be an artifact store for the
pipeline region and for each cross-region action within the pipeline. You can only use either ar... | java | public PipelineDeclaration withArtifactStores(java.util.Map<String, ArtifactStore> artifactStores) {
setArtifactStores(artifactStores);
return this;
} | [
"public",
"PipelineDeclaration",
"withArtifactStores",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"ArtifactStore",
">",
"artifactStores",
")",
"{",
"setArtifactStores",
"(",
"artifactStores",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A mapping of artifactStore objects and their corresponding regions. There must be an artifact store for the
pipeline region and for each cross-region action within the pipeline. You can only use either artifactStore or
artifactStores, not both.
</p>
<p>
If you create a cross-region action in your pipeline, you must... | [
"<p",
">",
"A",
"mapping",
"of",
"artifactStore",
"objects",
"and",
"their",
"corresponding",
"regions",
".",
"There",
"must",
"be",
"an",
"artifact",
"store",
"for",
"the",
"pipeline",
"region",
"and",
"for",
"each",
"cross",
"-",
"region",
"action",
"withi... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codepipeline/src/main/java/com/amazonaws/services/codepipeline/model/PipelineDeclaration.java#L263-L266 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Reverse3DLine.java | ST_Reverse3DLine.reverse3D | private static LineString reverse3D(LineString lineString, String order) {
"""
Reverses a LineString according to the z value. The z of the first point
must be lower than the z of the end point.
@param lineString
@return
"""
CoordinateSequence seq = lineString.getCoordinateSequence();
doub... | java | private static LineString reverse3D(LineString lineString, String order) {
CoordinateSequence seq = lineString.getCoordinateSequence();
double startZ = seq.getCoordinate(0).z;
double endZ = seq.getCoordinate(seq.size() - 1).z;
if (order.equalsIgnoreCase("desc")) {
if (!Double... | [
"private",
"static",
"LineString",
"reverse3D",
"(",
"LineString",
"lineString",
",",
"String",
"order",
")",
"{",
"CoordinateSequence",
"seq",
"=",
"lineString",
".",
"getCoordinateSequence",
"(",
")",
";",
"double",
"startZ",
"=",
"seq",
".",
"getCoordinate",
... | Reverses a LineString according to the z value. The z of the first point
must be lower than the z of the end point.
@param lineString
@return | [
"Reverses",
"a",
"LineString",
"according",
"to",
"the",
"z",
"value",
".",
"The",
"z",
"of",
"the",
"first",
"point",
"must",
"be",
"lower",
"than",
"the",
"z",
"of",
"the",
"end",
"point",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Reverse3DLine.java#L87-L106 |
js-lib-com/commons | src/main/java/js/util/Strings.java | Strings.injectProperties | public static String injectProperties(final String string) throws BugError {
"""
Inject system properties into text with variables. Given text uses standard variable notation
<code>${variable-name}</code> , as known from, for example, Ant or Log4j configuration. This method replace found
variable with system pro... | java | public static String injectProperties(final String string) throws BugError
{
return Strings.replaceAll(string, VARIABLE_PATTERN, new Handler<String, String>()
{
@Override
public String handle(String variableName)
{
String property = System.getProperty(variableName);
i... | [
"public",
"static",
"String",
"injectProperties",
"(",
"final",
"String",
"string",
")",
"throws",
"BugError",
"{",
"return",
"Strings",
".",
"replaceAll",
"(",
"string",
",",
"VARIABLE_PATTERN",
",",
"new",
"Handler",
"<",
"String",
",",
"String",
">",
"(",
... | Inject system properties into text with variables. Given text uses standard variable notation
<code>${variable-name}</code> , as known from, for example, Ant or Log4j configuration. This method replace found
variable with system property using <code>variable-name</code> as property key. It is a logic flaw if system
pro... | [
"Inject",
"system",
"properties",
"into",
"text",
"with",
"variables",
".",
"Given",
"text",
"uses",
"standard",
"variable",
"notation",
"<code",
">",
"$",
"{",
"variable",
"-",
"name",
"}",
"<",
"/",
"code",
">",
"as",
"known",
"from",
"for",
"example",
... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Strings.java#L1209-L1223 |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/util/Jsr250Utils.java | Jsr250Utils.postConstructQuietly | public static void postConstructQuietly(Object obj, Logger log) {
"""
Calls postConstruct with the same arguments, logging any exceptions that are thrown at the level warn.
"""
try {
postConstruct(obj, log);
}
catch( Throwable t ) {
log.warn("Could not @PostConstruct object", t);
}
... | java | public static void postConstructQuietly(Object obj, Logger log) {
try {
postConstruct(obj, log);
}
catch( Throwable t ) {
log.warn("Could not @PostConstruct object", t);
}
} | [
"public",
"static",
"void",
"postConstructQuietly",
"(",
"Object",
"obj",
",",
"Logger",
"log",
")",
"{",
"try",
"{",
"postConstruct",
"(",
"obj",
",",
"log",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"log",
".",
"warn",
"(",
"\"Could no... | Calls postConstruct with the same arguments, logging any exceptions that are thrown at the level warn. | [
"Calls",
"postConstruct",
"with",
"the",
"same",
"arguments",
"logging",
"any",
"exceptions",
"that",
"are",
"thrown",
"at",
"the",
"level",
"warn",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/util/Jsr250Utils.java#L70-L77 |
javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/table/MBasicTable.java | MBasicTable.getTextAt | public String getTextAt(final int row, final int column) {
"""
Renvoie le texte affiché à la position demandée.
@return String
@param row
int
@param column
int
"""
final Object value = getValueAt(row, column);
String text = "";
if (value != null) {
final TableCellRenderer renderer = getCe... | java | public String getTextAt(final int row, final int column) {
final Object value = getValueAt(row, column);
String text = "";
if (value != null) {
final TableCellRenderer renderer = getCellRenderer(row, column);
final Component rendererComponent = renderer.getTableCellRendererComponent(this, value,
... | [
"public",
"String",
"getTextAt",
"(",
"final",
"int",
"row",
",",
"final",
"int",
"column",
")",
"{",
"final",
"Object",
"value",
"=",
"getValueAt",
"(",
"row",
",",
"column",
")",
";",
"String",
"text",
"=",
"\"\"",
";",
"if",
"(",
"value",
"!=",
"n... | Renvoie le texte affiché à la position demandée.
@return String
@param row
int
@param column
int | [
"Renvoie",
"le",
"texte",
"affiché",
"à",
"la",
"position",
"demandée",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/table/MBasicTable.java#L272-L294 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.getAt | @SuppressWarnings("unchecked")
public static List<Integer> getAt(int[] array, Collection indices) {
"""
Support the subscript operator with a collection for an int array
@param array an int array
@param indices a collection of indices for the items to retrieve
@return list of the ints at the given indices... | java | @SuppressWarnings("unchecked")
public static List<Integer> getAt(int[] array, Collection indices) {
return primitiveArrayGet(array, indices);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"List",
"<",
"Integer",
">",
"getAt",
"(",
"int",
"[",
"]",
"array",
",",
"Collection",
"indices",
")",
"{",
"return",
"primitiveArrayGet",
"(",
"array",
",",
"indices",
")",
";",
"}"
... | Support the subscript operator with a collection for an int array
@param array an int array
@param indices a collection of indices for the items to retrieve
@return list of the ints at the given indices
@since 1.0 | [
"Support",
"the",
"subscript",
"operator",
"with",
"a",
"collection",
"for",
"an",
"int",
"array"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L13977-L13980 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataAllValuesFromImpl_CustomFieldSerializer.java | OWLDataAllValuesFromImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDataAllValuesFromImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gw... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDataAllValuesFromImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLDataAllValuesFromImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataAllValuesFromImpl_CustomFieldSerializer.java#L73-L76 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementBase.java | ElementBase.notifyParent | public void notifyParent(String eventName, Object eventData, boolean recurse) {
"""
Allows a child element to notify its parent of an event of interest.
@param eventName Name of the event.
@param eventData Data associated with the event.
@param recurse If true, recurse up the parent chain.
"""
Ele... | java | public void notifyParent(String eventName, Object eventData, boolean recurse) {
ElementBase ele = parent;
while (ele != null) {
recurse &= ele.parentListeners.notify(this, eventName, eventData);
ele = recurse ? ele.parent : null;
}
} | [
"public",
"void",
"notifyParent",
"(",
"String",
"eventName",
",",
"Object",
"eventData",
",",
"boolean",
"recurse",
")",
"{",
"ElementBase",
"ele",
"=",
"parent",
";",
"while",
"(",
"ele",
"!=",
"null",
")",
"{",
"recurse",
"&=",
"ele",
".",
"parentListen... | Allows a child element to notify its parent of an event of interest.
@param eventName Name of the event.
@param eventData Data associated with the event.
@param recurse If true, recurse up the parent chain. | [
"Allows",
"a",
"child",
"element",
"to",
"notify",
"its",
"parent",
"of",
"an",
"event",
"of",
"interest",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementBase.java#L985-L992 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.context/src/com/ibm/ws/security/context/internal/SecurityContextImpl.java | SecurityContextImpl.getWSPrincipal | protected WSPrincipal getWSPrincipal(Subject subject) throws IOException {
"""
Get the WSPrincipal from the subject
@param subject
@return the WSPrincipal of the subject
@throws IOException if there is more than one WSPrincipal in the subject
"""
WSPrincipal wsPrincipal = null;
Set<WSPrinc... | java | protected WSPrincipal getWSPrincipal(Subject subject) throws IOException {
WSPrincipal wsPrincipal = null;
Set<WSPrincipal> principals = (subject != null) ? subject.getPrincipals(WSPrincipal.class) : null;
if (principals != null && !principals.isEmpty()) {
if (principals.size() > 1) ... | [
"protected",
"WSPrincipal",
"getWSPrincipal",
"(",
"Subject",
"subject",
")",
"throws",
"IOException",
"{",
"WSPrincipal",
"wsPrincipal",
"=",
"null",
";",
"Set",
"<",
"WSPrincipal",
">",
"principals",
"=",
"(",
"subject",
"!=",
"null",
")",
"?",
"subject",
".... | Get the WSPrincipal from the subject
@param subject
@return the WSPrincipal of the subject
@throws IOException if there is more than one WSPrincipal in the subject | [
"Get",
"the",
"WSPrincipal",
"from",
"the",
"subject"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.context/src/com/ibm/ws/security/context/internal/SecurityContextImpl.java#L391-L410 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/util/TransparentReplicaGetHelper.java | TransparentReplicaGetHelper.getFirstPrimaryOrReplica | @InterfaceStability.Experimental
@InterfaceAudience.Public
public static <D extends Document<?>> Single<D> getFirstPrimaryOrReplica(final String id,
final Class<D> target, final Bucket bucket) {
"""
Asynchronously fetch the document from the primary and if that operations fails try
all the replica... | java | @InterfaceStability.Experimental
@InterfaceAudience.Public
public static <D extends Document<?>> Single<D> getFirstPrimaryOrReplica(final String id,
final Class<D> target, final Bucket bucket) {
return getFirstPrimaryOrReplica(id, target, bucket, bucket.environment().kvTimeout());
} | [
"@",
"InterfaceStability",
".",
"Experimental",
"@",
"InterfaceAudience",
".",
"Public",
"public",
"static",
"<",
"D",
"extends",
"Document",
"<",
"?",
">",
">",
"Single",
"<",
"D",
">",
"getFirstPrimaryOrReplica",
"(",
"final",
"String",
"id",
",",
"final",
... | Asynchronously fetch the document from the primary and if that operations fails try
all the replicas and return the first document that comes back from them (using the
environments KV timeout for both primary and replica).
@param id the document ID to fetch.
@param target the custom document type to use.
@param bucket... | [
"Asynchronously",
"fetch",
"the",
"document",
"from",
"the",
"primary",
"and",
"if",
"that",
"operations",
"fails",
"try",
"all",
"the",
"replicas",
"and",
"return",
"the",
"first",
"document",
"that",
"comes",
"back",
"from",
"them",
"(",
"using",
"the",
"e... | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/util/TransparentReplicaGetHelper.java#L104-L109 |
apache/incubator-atlas | graphdb/titan1/src/main/java/org/apache/atlas/repository/graphdb/titan1/graphson/AtlasGraphSONUtility.java | AtlasGraphSONUtility.jsonFromElement | public static JSONObject jsonFromElement(final AtlasElement element, final Set<String> propertyKeys,
final AtlasGraphSONMode mode)
throws JSONException {
"""
Creates a Jettison JSONObject from a graph element.
@param element
the graph element to convert to J... | java | public static JSONObject jsonFromElement(final AtlasElement element, final Set<String> propertyKeys,
final AtlasGraphSONMode mode)
throws JSONException {
final AtlasGraphSONUtility graphson = element instanceof AtlasEdge
? new AtlasGraphSONUt... | [
"public",
"static",
"JSONObject",
"jsonFromElement",
"(",
"final",
"AtlasElement",
"element",
",",
"final",
"Set",
"<",
"String",
">",
"propertyKeys",
",",
"final",
"AtlasGraphSONMode",
"mode",
")",
"throws",
"JSONException",
"{",
"final",
"AtlasGraphSONUtility",
"g... | Creates a Jettison JSONObject from a graph element.
@param element
the graph element to convert to JSON.
@param propertyKeys
The property getPropertyKeys() at the root of the element to
serialize. If null, then all getPropertyKeys() are serialized.
@param mode
the type of GraphSON to be generated. | [
"Creates",
"a",
"Jettison",
"JSONObject",
"from",
"a",
"graph",
"element",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/graphdb/titan1/src/main/java/org/apache/atlas/repository/graphdb/titan1/graphson/AtlasGraphSONUtility.java#L189-L197 |
mlhartme/mork | src/main/java/net/oneandone/mork/classfile/ClassRef.java | ClassRef.writeClasses | public static void writeClasses(ObjectOutput out, Class<?>[] types)
throws java.io.IOException {
"""
Writes an array of Class objects.
@param out target to write to
@param types Classes to be written
"""
int i;
if (types.length > Byte.MAX_VALUE) {
throw new Runt... | java | public static void writeClasses(ObjectOutput out, Class<?>[] types)
throws java.io.IOException {
int i;
if (types.length > Byte.MAX_VALUE) {
throw new RuntimeException("to many dimensions");
}
out.writeByte((byte) types.length);
for (i = 0; i < types.leng... | [
"public",
"static",
"void",
"writeClasses",
"(",
"ObjectOutput",
"out",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"types",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
"{",
"int",
"i",
";",
"if",
"(",
"types",
".",
"length",
">",
"Byte",
".",
... | Writes an array of Class objects.
@param out target to write to
@param types Classes to be written | [
"Writes",
"an",
"array",
"of",
"Class",
"objects",
"."
] | train | https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/classfile/ClassRef.java#L460-L471 |
julianhyde/sqlline | src/main/java/sqlline/SqlLine.java | SqlLine.isComment | boolean isComment(String line, boolean trim) {
"""
Test whether a line is a comment.
@param line the line to be tested
@return true if a comment
"""
final String trimmedLine = trim ? line.trim() : line;
for (String comment: getDialect().getSqlLineOneLineComments()) {
if (trimmedLine.startsWit... | java | boolean isComment(String line, boolean trim) {
final String trimmedLine = trim ? line.trim() : line;
for (String comment: getDialect().getSqlLineOneLineComments()) {
if (trimmedLine.startsWith(comment)) {
return true;
}
}
return false;
} | [
"boolean",
"isComment",
"(",
"String",
"line",
",",
"boolean",
"trim",
")",
"{",
"final",
"String",
"trimmedLine",
"=",
"trim",
"?",
"line",
".",
"trim",
"(",
")",
":",
"line",
";",
"for",
"(",
"String",
"comment",
":",
"getDialect",
"(",
")",
".",
"... | Test whether a line is a comment.
@param line the line to be tested
@return true if a comment | [
"Test",
"whether",
"a",
"line",
"is",
"a",
"comment",
"."
] | train | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLine.java#L766-L774 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/FieldDescriptorConstraints.java | FieldDescriptorConstraints.checkId | private void checkId(FieldDescriptorDef fieldDef, String checkLevel) throws ConstraintException {
"""
Checks the id value.
@param fieldDef The field descriptor
@param checkLevel The current check level (this constraint is checked in basic and strict)
@exception ConstraintException If the constraint has been v... | java | private void checkId(FieldDescriptorDef fieldDef, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
String id = fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_ID);
if ((id != null) && (id.length() > 0)... | [
"private",
"void",
"checkId",
"(",
"FieldDescriptorDef",
"fieldDef",
",",
"String",
"checkLevel",
")",
"throws",
"ConstraintException",
"{",
"if",
"(",
"CHECKLEVEL_NONE",
".",
"equals",
"(",
"checkLevel",
")",
")",
"{",
"return",
";",
"}",
"String",
"id",
"=",... | Checks the id value.
@param fieldDef The field descriptor
@param checkLevel The current check level (this constraint is checked in basic and strict)
@exception ConstraintException If the constraint has been violated | [
"Checks",
"the",
"id",
"value",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/FieldDescriptorConstraints.java#L365-L385 |
patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/builder/PerformanceProfiler.java | PerformanceProfiler.startTask | public void startTask(int id, String taskName) {
"""
Start a task. The id is needed to end the task
@param id
@param taskName
"""
if (isActivated) {
durations.add(new Duration(id, taskName, BenchmarkUtil.elapsedRealTimeNanos()));
}
} | java | public void startTask(int id, String taskName) {
if (isActivated) {
durations.add(new Duration(id, taskName, BenchmarkUtil.elapsedRealTimeNanos()));
}
} | [
"public",
"void",
"startTask",
"(",
"int",
"id",
",",
"String",
"taskName",
")",
"{",
"if",
"(",
"isActivated",
")",
"{",
"durations",
".",
"add",
"(",
"new",
"Duration",
"(",
"id",
",",
"taskName",
",",
"BenchmarkUtil",
".",
"elapsedRealTimeNanos",
"(",
... | Start a task. The id is needed to end the task
@param id
@param taskName | [
"Start",
"a",
"task",
".",
"The",
"id",
"is",
"needed",
"to",
"end",
"the",
"task"
] | train | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/builder/PerformanceProfiler.java#L43-L47 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java | JsonModelCoder.getList | public List<T> getList(String json, OnJsonObjectAddListener listener) throws IOException,
JsonFormatException {
"""
Attempts to parse the given data as {@link List} of objects.
Accepts {@link OnJsonObjectAddListener}; allows you to peek various intermittent instances as parsing goes.
@param json JSON-format... | java | public List<T> getList(String json, OnJsonObjectAddListener listener) throws IOException,
JsonFormatException {
JsonPullParser parser = JsonPullParser.newParser(json);
return getList(parser, listener);
} | [
"public",
"List",
"<",
"T",
">",
"getList",
"(",
"String",
"json",
",",
"OnJsonObjectAddListener",
"listener",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"JsonPullParser",
"parser",
"=",
"JsonPullParser",
".",
"newParser",
"(",
"json",
")",
"... | Attempts to parse the given data as {@link List} of objects.
Accepts {@link OnJsonObjectAddListener}; allows you to peek various intermittent instances as parsing goes.
@param json JSON-formatted data
@param listener {@link OnJsonObjectAddListener} to notify
@return {@link List} of objects
@throws IOException
@throws ... | [
"Attempts",
"to",
"parse",
"the",
"given",
"data",
"as",
"{",
"@link",
"List",
"}",
"of",
"objects",
".",
"Accepts",
"{",
"@link",
"OnJsonObjectAddListener",
"}",
";",
"allows",
"you",
"to",
"peek",
"various",
"intermittent",
"instances",
"as",
"parsing",
"g... | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java#L69-L73 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.zone_zoneName_record_GET | public ArrayList<Long> zone_zoneName_record_GET(String zoneName, OvhNamedResolutionFieldTypeEnum fieldType, String subDomain) throws IOException {
"""
Records of the zone
REST: GET /domain/zone/{zoneName}/record
@param subDomain [required] Filter the value of subDomain property (like)
@param fieldType [requir... | java | public ArrayList<Long> zone_zoneName_record_GET(String zoneName, OvhNamedResolutionFieldTypeEnum fieldType, String subDomain) throws IOException {
String qPath = "/domain/zone/{zoneName}/record";
StringBuilder sb = path(qPath, zoneName);
query(sb, "fieldType", fieldType);
query(sb, "subDomain", subDomain);
St... | [
"public",
"ArrayList",
"<",
"Long",
">",
"zone_zoneName_record_GET",
"(",
"String",
"zoneName",
",",
"OvhNamedResolutionFieldTypeEnum",
"fieldType",
",",
"String",
"subDomain",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/zone/{zoneName}/record\""... | Records of the zone
REST: GET /domain/zone/{zoneName}/record
@param subDomain [required] Filter the value of subDomain property (like)
@param fieldType [required] Filter the value of fieldType property (like)
@param zoneName [required] The internal name of your zone | [
"Records",
"of",
"the",
"zone"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L930-L937 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java | ChessboardCornerClusterToGrid.isRightHanded | static boolean isRightHanded( Node seed , int idxRow , int idxCol ) {
"""
Checks to see if the rows and columns for a coordinate system which is right handed
@param idxRow Index for moving up a row
@param idxCol index for moving up a column
"""
Node r = seed.edges[idxRow];
Node c = seed.edges[idxCol];
... | java | static boolean isRightHanded( Node seed , int idxRow , int idxCol ) {
Node r = seed.edges[idxRow];
Node c = seed.edges[idxCol];
double dirRow = Math.atan2(r.y-seed.y,r.x-seed.x);
double dirCol = Math.atan2(c.y-seed.y,c.x-seed.x);
return UtilAngle.distanceCW(dirRow,dirCol) < Math.PI;
} | [
"static",
"boolean",
"isRightHanded",
"(",
"Node",
"seed",
",",
"int",
"idxRow",
",",
"int",
"idxCol",
")",
"{",
"Node",
"r",
"=",
"seed",
".",
"edges",
"[",
"idxRow",
"]",
";",
"Node",
"c",
"=",
"seed",
".",
"edges",
"[",
"idxCol",
"]",
";",
"doub... | Checks to see if the rows and columns for a coordinate system which is right handed
@param idxRow Index for moving up a row
@param idxCol index for moving up a column | [
"Checks",
"to",
"see",
"if",
"the",
"rows",
"and",
"columns",
"for",
"a",
"coordinate",
"system",
"which",
"is",
"right",
"handed"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java#L244-L252 |
interedition/collatex | collatex-core/src/main/java/eu/interedition/collatex/suffixarray/DivSufSort.java | DivSufSort.trCopy | private void trCopy(int ISA, int first, int a, int b, int last, int depth) {
"""
sort suffixes of middle partition by using sorted order of suffixes of left and
right partition.
"""
int c, d, e;// ptr
int s, v;
v = b - 1;
for (c = first, d = a - 1; c <= d; ++c) {
s... | java | private void trCopy(int ISA, int first, int a, int b, int last, int depth) {
int c, d, e;// ptr
int s, v;
v = b - 1;
for (c = first, d = a - 1; c <= d; ++c) {
s = SA[c] - depth;
if ((0 <= s) && (SA[ISA + s] == v)) {
SA[++d] = s;
SA... | [
"private",
"void",
"trCopy",
"(",
"int",
"ISA",
",",
"int",
"first",
",",
"int",
"a",
",",
"int",
"b",
",",
"int",
"last",
",",
"int",
"depth",
")",
"{",
"int",
"c",
",",
"d",
",",
"e",
";",
"// ptr",
"int",
"s",
",",
"v",
";",
"v",
"=",
"b... | sort suffixes of middle partition by using sorted order of suffixes of left and
right partition. | [
"sort",
"suffixes",
"of",
"middle",
"partition",
"by",
"using",
"sorted",
"order",
"of",
"suffixes",
"of",
"left",
"and",
"right",
"partition",
"."
] | train | https://github.com/interedition/collatex/blob/76dd1fcc36047bc66a87d31142e72e98b5347821/collatex-core/src/main/java/eu/interedition/collatex/suffixarray/DivSufSort.java#L2080-L2099 |
astrapi69/jaulp-wicket | jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java | PackageResourceReferences.addJsFiles | public static void addJsFiles(final IHeaderResponse response, final Class<?> scope,
final String... jsFilenames) {
"""
Adds the given javascript files to the given response object in the given scope.
@param response
the {@link org.apache.wicket.markup.head.IHeaderResponse}
@param scope
The scope of the jav... | java | public static void addJsFiles(final IHeaderResponse response, final Class<?> scope,
final String... jsFilenames)
{
for (final String jsFilename : jsFilenames)
{
final HeaderItem item = JavaScriptHeaderItem
.forReference(new PackageResourceReference(scope, jsFilename));
response.render(item);
}
} | [
"public",
"static",
"void",
"addJsFiles",
"(",
"final",
"IHeaderResponse",
"response",
",",
"final",
"Class",
"<",
"?",
">",
"scope",
",",
"final",
"String",
"...",
"jsFilenames",
")",
"{",
"for",
"(",
"final",
"String",
"jsFilename",
":",
"jsFilenames",
")"... | Adds the given javascript files to the given response object in the given scope.
@param response
the {@link org.apache.wicket.markup.head.IHeaderResponse}
@param scope
The scope of the javascript files.
@param jsFilenames
The javascript file names. | [
"Adds",
"the",
"given",
"javascript",
"files",
"to",
"the",
"given",
"response",
"object",
"in",
"the",
"given",
"scope",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java#L80-L89 |
loldevs/riotapi | spectator/src/main/java/net/boreeas/riotapi/spectator/MappedDataCache.java | MappedDataCache.get | public V get(K k, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException {
"""
Retrieve the value associated with the given key, blocking as long as necessary up to the specified maximum.
@param k The key.
@param timeout The length of the timeout.
@param unit The time unit of the timeout.
@... | java | public V get(K k, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException {
await(k, timeout, unit);
return cache.get(k);
} | [
"public",
"V",
"get",
"(",
"K",
"k",
",",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
",",
"TimeoutException",
"{",
"await",
"(",
"k",
",",
"timeout",
",",
"unit",
")",
";",
"return",
"cache",
".",
"get",
"(",
"k"... | Retrieve the value associated with the given key, blocking as long as necessary up to the specified maximum.
@param k The key.
@param timeout The length of the timeout.
@param unit The time unit of the timeout.
@return The value associated with the key.
@throws InterruptedException
@throws TimeoutException | [
"Retrieve",
"the",
"value",
"associated",
"with",
"the",
"given",
"key",
"blocking",
"as",
"long",
"as",
"necessary",
"up",
"to",
"the",
"specified",
"maximum",
"."
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/spectator/src/main/java/net/boreeas/riotapi/spectator/MappedDataCache.java#L81-L85 |
ops4j/org.ops4j.pax.swissbox | pax-swissbox-tracker/src/main/java/org/ops4j/pax/swissbox/tracker/ServiceLookup.java | ServiceLookup.getServiceByFilter | public static Object getServiceByFilter( BundleContext bc, String ldapFilter, long timeout ) {
"""
Returns a service matching the given filter.
@param bc bundle context for accessing the OSGi registry
@param ldapFilter LDAP filter to be matched by the service. The class name must be part of the
filter.
@para... | java | public static Object getServiceByFilter( BundleContext bc, String ldapFilter, long timeout )
{
try
{
Filter filter = bc.createFilter( ldapFilter );
ServiceTracker tracker = new ServiceTracker( bc, filter, null );
tracker.open();
Object svc = tracker.wa... | [
"public",
"static",
"Object",
"getServiceByFilter",
"(",
"BundleContext",
"bc",
",",
"String",
"ldapFilter",
",",
"long",
"timeout",
")",
"{",
"try",
"{",
"Filter",
"filter",
"=",
"bc",
".",
"createFilter",
"(",
"ldapFilter",
")",
";",
"ServiceTracker",
"track... | Returns a service matching the given filter.
@param bc bundle context for accessing the OSGi registry
@param ldapFilter LDAP filter to be matched by the service. The class name must be part of the
filter.
@param timeout maximum wait period in milliseconds
@return matching service (not null)
@throws ServiceLookupExcept... | [
"Returns",
"a",
"service",
"matching",
"the",
"given",
"filter",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.swissbox/blob/00b0ee16cdbe8017984a4d7ba808b10d985c5b5c/pax-swissbox-tracker/src/main/java/org/ops4j/pax/swissbox/tracker/ServiceLookup.java#L328-L351 |
Impetus/Kundera | src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClient.java | OracleNoSQLClient.initializeEntity | private Object initializeEntity(Object key, EntityMetadata entityMetadata)
throws InstantiationException, IllegalAccessException {
"""
Initialize entity.
@param key
the key
@param entityMetadata
the entity metadata
@return the object
@throws InstantiationException
the instantiation exception
... | java | private Object initializeEntity(Object key, EntityMetadata entityMetadata)
throws InstantiationException, IllegalAccessException
{
Object entity = null;
entity = entityMetadata.getEntityClazz().newInstance();
if (key != null)
{
PropertyAccessorHelper.setId(ent... | [
"private",
"Object",
"initializeEntity",
"(",
"Object",
"key",
",",
"EntityMetadata",
"entityMetadata",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessException",
"{",
"Object",
"entity",
"=",
"null",
";",
"entity",
"=",
"entityMetadata",
".",
"getEntityC... | Initialize entity.
@param key
the key
@param entityMetadata
the entity metadata
@return the object
@throws InstantiationException
the instantiation exception
@throws IllegalAccessException
the illegal access exception | [
"Initialize",
"entity",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClient.java#L1402-L1412 |
finmath/finmath-lib | src/main/java/net/finmath/marketdata/model/bond/Bond.java | Bond.getYield | public double getYield(double bondPrice, AnalyticModel model) {
"""
Returns the yield value such that the sum of cash flows of the bond discounted with the yield curve
coincides with a given price.
@param bondPrice The target price as double.
@param model The model under which the product is valued.
@return ... | java | public double getYield(double bondPrice, AnalyticModel model) {
GoldenSectionSearch search = new GoldenSectionSearch(-2.0, 2.0);
while(search.getAccuracy() > 1E-11 && !search.isDone()) {
double x = search.getNextPoint();
double fx=getValueWithGivenYield(0.0,x,model);
double y = (bondPrice-fx)*(bondPrice-fx... | [
"public",
"double",
"getYield",
"(",
"double",
"bondPrice",
",",
"AnalyticModel",
"model",
")",
"{",
"GoldenSectionSearch",
"search",
"=",
"new",
"GoldenSectionSearch",
"(",
"-",
"2.0",
",",
"2.0",
")",
";",
"while",
"(",
"search",
".",
"getAccuracy",
"(",
"... | Returns the yield value such that the sum of cash flows of the bond discounted with the yield curve
coincides with a given price.
@param bondPrice The target price as double.
@param model The model under which the product is valued.
@return The optimal yield value. | [
"Returns",
"the",
"yield",
"value",
"such",
"that",
"the",
"sum",
"of",
"cash",
"flows",
"of",
"the",
"bond",
"discounted",
"with",
"the",
"yield",
"curve",
"coincides",
"with",
"a",
"given",
"price",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/model/bond/Bond.java#L290-L300 |
alipay/sofa-rpc | extension-impl/extension-common/src/main/java/com/alipay/sofa/rpc/config/ConfigUniqueNameGenerator.java | ConfigUniqueNameGenerator.getUniqueNameProtocol | public static String getUniqueNameProtocol(ProviderConfig providerConfig, String protocol) {
"""
唯一标识UniqueName的产生方法,主要用于外部服务发现等,格式为interface:version[:uniqueId]@protocol
@param providerConfig 服务端提供者配置
@param protocol 协议
@return 配置唯一名字
"""
if (StringUtils.isNotEmpty(protocol)) {
r... | java | public static String getUniqueNameProtocol(ProviderConfig providerConfig, String protocol) {
if (StringUtils.isNotEmpty(protocol)) {
return getUniqueName(providerConfig) + "@" + protocol;
} else {
return getUniqueName(providerConfig);
}
} | [
"public",
"static",
"String",
"getUniqueNameProtocol",
"(",
"ProviderConfig",
"providerConfig",
",",
"String",
"protocol",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"protocol",
")",
")",
"{",
"return",
"getUniqueName",
"(",
"providerConfig",
")",... | 唯一标识UniqueName的产生方法,主要用于外部服务发现等,格式为interface:version[:uniqueId]@protocol
@param providerConfig 服务端提供者配置
@param protocol 协议
@return 配置唯一名字 | [
"唯一标识UniqueName的产生方法,主要用于外部服务发现等,格式为interface",
":",
"version",
"[",
":",
"uniqueId",
"]",
"@protocol"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/extension-common/src/main/java/com/alipay/sofa/rpc/config/ConfigUniqueNameGenerator.java#L62-L68 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java | ComponentCollision.checkGroup | private void checkGroup(Entry<Point, Set<Collidable>> current) {
"""
Check elements in group.
@param current The elements in group.
"""
final Set<Collidable> elements = current.getValue();
for (final Collidable objectA : elements)
{
checkOthers(objectA, current);
... | java | private void checkGroup(Entry<Point, Set<Collidable>> current)
{
final Set<Collidable> elements = current.getValue();
for (final Collidable objectA : elements)
{
checkOthers(objectA, current);
}
} | [
"private",
"void",
"checkGroup",
"(",
"Entry",
"<",
"Point",
",",
"Set",
"<",
"Collidable",
">",
">",
"current",
")",
"{",
"final",
"Set",
"<",
"Collidable",
">",
"elements",
"=",
"current",
".",
"getValue",
"(",
")",
";",
"for",
"(",
"final",
"Collida... | Check elements in group.
@param current The elements in group. | [
"Check",
"elements",
"in",
"group",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java#L149-L156 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationResponseRequest.java | PutIntegrationResponseRequest.withResponseParameters | public PutIntegrationResponseRequest withResponseParameters(java.util.Map<String, String> responseParameters) {
"""
<p>
A key-value map specifying response parameters that are passed to the method response from the back end. The key
is a method response header parameter name and the mapped value is an integratio... | java | public PutIntegrationResponseRequest withResponseParameters(java.util.Map<String, String> responseParameters) {
setResponseParameters(responseParameters);
return this;
} | [
"public",
"PutIntegrationResponseRequest",
"withResponseParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"responseParameters",
")",
"{",
"setResponseParameters",
"(",
"responseParameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A key-value map specifying response parameters that are passed to the method response from the back end. The key
is a method response header parameter name and the mapped value is an integration response header value, a static
value enclosed within a pair of single quotes, or a JSON expression from the integration ... | [
"<p",
">",
"A",
"key",
"-",
"value",
"map",
"specifying",
"response",
"parameters",
"that",
"are",
"passed",
"to",
"the",
"method",
"response",
"from",
"the",
"back",
"end",
".",
"The",
"key",
"is",
"a",
"method",
"response",
"header",
"parameter",
"name",... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationResponseRequest.java#L389-L392 |
jurmous/etcd4j | src/main/java/mousio/etcd4j/security/SecurityContextBuilder.java | SecurityContextBuilder.forKeystoreAndTruststore | public static SslContext forKeystoreAndTruststore(String keystorePath, String keystorePassword, String truststorePath, String truststorePassword, String keyManagerAlgorithm)
throws SecurityContextException {
"""
Builds SslContext using protected keystore and truststores. Adequate for mutual TLS connect... | java | public static SslContext forKeystoreAndTruststore(String keystorePath, String keystorePassword, String truststorePath, String truststorePassword, String keyManagerAlgorithm)
throws SecurityContextException {
try {
return forKeystoreAndTruststore(new FileInputStream(keystorePath), keysto... | [
"public",
"static",
"SslContext",
"forKeystoreAndTruststore",
"(",
"String",
"keystorePath",
",",
"String",
"keystorePassword",
",",
"String",
"truststorePath",
",",
"String",
"truststorePassword",
",",
"String",
"keyManagerAlgorithm",
")",
"throws",
"SecurityContextExcepti... | Builds SslContext using protected keystore and truststores. Adequate for mutual TLS connections.
@param keystorePath Path for keystore file
@param keystorePassword Password for protected keystore file
@param truststorePath Path for truststore file
@param truststorePassword Password for protected truststore file
@param ... | [
"Builds",
"SslContext",
"using",
"protected",
"keystore",
"and",
"truststores",
".",
"Adequate",
"for",
"mutual",
"TLS",
"connections",
"."
] | train | https://github.com/jurmous/etcd4j/blob/ffb1d574cf85bbab025dd566ce250f1860bbcbc7/src/main/java/mousio/etcd4j/security/SecurityContextBuilder.java#L101-L109 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java | CmsSitemapController.getInheritedPropertyObject | public CmsClientProperty getInheritedPropertyObject(CmsClientSitemapEntry entry, String name) {
"""
Gets the property object which would be inherited by a sitemap entry.<p>
@param entry the sitemap entry
@param name the name of the property
@return the property object which would be inherited
"""
... | java | public CmsClientProperty getInheritedPropertyObject(CmsClientSitemapEntry entry, String name) {
CmsClientSitemapEntry currentEntry = entry;
while (currentEntry != null) {
currentEntry = getParentEntry(currentEntry);
if (currentEntry != null) {
CmsClientProperty f... | [
"public",
"CmsClientProperty",
"getInheritedPropertyObject",
"(",
"CmsClientSitemapEntry",
"entry",
",",
"String",
"name",
")",
"{",
"CmsClientSitemapEntry",
"currentEntry",
"=",
"entry",
";",
"while",
"(",
"currentEntry",
"!=",
"null",
")",
"{",
"currentEntry",
"=",
... | Gets the property object which would be inherited by a sitemap entry.<p>
@param entry the sitemap entry
@param name the name of the property
@return the property object which would be inherited | [
"Gets",
"the",
"property",
"object",
"which",
"would",
"be",
"inherited",
"by",
"a",
"sitemap",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java#L1192-L1215 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/util/PropertyValueNavigator.java | PropertyValueNavigator.getProperty | public Object getProperty(final Object obj, final String property) {
"""
プロパティの値を取得する。
@param obj 取得元となるオブジェクト。
@param property プロパティの式。
@return プロパティの値。
@throws IllegalArgumentException peropety is null or empty.
@throws PropertyAccessException 存在しないプロパティを指定した場合など。
@throws NullPointerException アクセスしようとしたプ... | java | public Object getProperty(final Object obj, final String property) {
ArgUtils.notEmpty(property, "property");
final PropertyPath path = parseProperty(property);
Object targetObj = obj;
for(Token token : path.getPathAsToken()) {
targetObj = accessProperty(targetObj,... | [
"public",
"Object",
"getProperty",
"(",
"final",
"Object",
"obj",
",",
"final",
"String",
"property",
")",
"{",
"ArgUtils",
".",
"notEmpty",
"(",
"property",
",",
"\"property\"",
")",
";",
"final",
"PropertyPath",
"path",
"=",
"parseProperty",
"(",
"property",... | プロパティの値を取得する。
@param obj 取得元となるオブジェクト。
@param property プロパティの式。
@return プロパティの値。
@throws IllegalArgumentException peropety is null or empty.
@throws PropertyAccessException 存在しないプロパティを指定した場合など。
@throws NullPointerException アクセスしようとしたプロパティがnullの場合。
ただし、オプション ignoreNull = falseのとき。
@throws IndexOutOfBoundsException リスト、... | [
"プロパティの値を取得する。"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/PropertyValueNavigator.java#L130-L146 |
ACINQ/bitcoin-lib | src/main/java/fr/acinq/Secp256k1Loader.java | Secp256k1Loader.loadNativeLibrary | private static boolean loadNativeLibrary(String path, String name) {
"""
Loads native library using the given path and name of the library.
@param path Path of the native library.
@param name Name of the native library.
@return True for successfully loading; false otherwise.
"""
File libPath = ne... | java | private static boolean loadNativeLibrary(String path, String name) {
File libPath = new File(path, name);
if(libPath.exists()) {
try {
System.load(new File(path, name).getAbsolutePath());
return true;
}
catch(UnsatisfiedLinkError e) {
... | [
"private",
"static",
"boolean",
"loadNativeLibrary",
"(",
"String",
"path",
",",
"String",
"name",
")",
"{",
"File",
"libPath",
"=",
"new",
"File",
"(",
"path",
",",
"name",
")",
";",
"if",
"(",
"libPath",
".",
"exists",
"(",
")",
")",
"{",
"try",
"{... | Loads native library using the given path and name of the library.
@param path Path of the native library.
@param name Name of the native library.
@return True for successfully loading; false otherwise. | [
"Loads",
"native",
"library",
"using",
"the",
"given",
"path",
"and",
"name",
"of",
"the",
"library",
"."
] | train | https://github.com/ACINQ/bitcoin-lib/blob/74a30b28b1001672359b19890ffa3d3951362d65/src/main/java/fr/acinq/Secp256k1Loader.java#L204-L222 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java | InodeLockList.downgradeLastInode | public void downgradeLastInode() {
"""
Downgrades the last inode from a write lock to a read lock. The read lock is acquired before
releasing the write lock.
"""
Preconditions.checkState(endsInInode());
Preconditions.checkState(!mEntries.isEmpty());
Preconditions.checkState(mLockMode == LockMode.W... | java | public void downgradeLastInode() {
Preconditions.checkState(endsInInode());
Preconditions.checkState(!mEntries.isEmpty());
Preconditions.checkState(mLockMode == LockMode.WRITE);
InodeEntry last = (InodeEntry) mEntries.get(mEntries.size() - 1);
LockResource lock = mInodeLockManager.lockInode(last.ge... | [
"public",
"void",
"downgradeLastInode",
"(",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"endsInInode",
"(",
")",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"!",
"mEntries",
".",
"isEmpty",
"(",
")",
")",
";",
"Preconditions",
".",
"checkState... | Downgrades the last inode from a write lock to a read lock. The read lock is acquired before
releasing the write lock. | [
"Downgrades",
"the",
"last",
"inode",
"from",
"a",
"write",
"lock",
"to",
"a",
"read",
"lock",
".",
"The",
"read",
"lock",
"is",
"acquired",
"before",
"releasing",
"the",
"write",
"lock",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java#L207-L217 |
infinispan/infinispan | spring/spring5/spring5-common/src/main/java/org/infinispan/spring/common/session/AbstractInfinispanSessionRepository.java | AbstractInfinispanSessionRepository.getSession | public MapSession getSession(String id, boolean updateTTL) {
"""
Returns session with optional parameter whether or not update time accessed.
@param id Session ID.
@param updateTTL <code>true</code> if time accessed needs to be updated.
@return Session or <code>null</code> if it doesn't exist.
"""
... | java | public MapSession getSession(String id, boolean updateTTL) {
return Optional.ofNullable(cache.get(id))
.map(v -> (MapSession) v.get())
.map(v -> updateTTL(v, updateTTL))
.orElse(null);
} | [
"public",
"MapSession",
"getSession",
"(",
"String",
"id",
",",
"boolean",
"updateTTL",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"cache",
".",
"get",
"(",
"id",
")",
")",
".",
"map",
"(",
"v",
"->",
"(",
"MapSession",
")",
"v",
".",
"g... | Returns session with optional parameter whether or not update time accessed.
@param id Session ID.
@param updateTTL <code>true</code> if time accessed needs to be updated.
@return Session or <code>null</code> if it doesn't exist. | [
"Returns",
"session",
"with",
"optional",
"parameter",
"whether",
"or",
"not",
"update",
"time",
"accessed",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/spring/spring5/spring5-common/src/main/java/org/infinispan/spring/common/session/AbstractInfinispanSessionRepository.java#L92-L97 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.updatePreview | private void updatePreview(TrackMetadataUpdate update, WaveformPreview preview) {
"""
We have obtained a waveform preview for a device, so store it and alert any listeners.
@param update the update which caused us to retrieve this waveform preview
@param preview the waveform preview which we retrieved
"""
... | java | private void updatePreview(TrackMetadataUpdate update, WaveformPreview preview) {
previewHotCache.put(DeckReference.getDeckReference(update.player, 0), preview); // Main deck
if (update.metadata.getCueList() != null) { // Update the cache with any hot cues in this track as well
for (CueLis... | [
"private",
"void",
"updatePreview",
"(",
"TrackMetadataUpdate",
"update",
",",
"WaveformPreview",
"preview",
")",
"{",
"previewHotCache",
".",
"put",
"(",
"DeckReference",
".",
"getDeckReference",
"(",
"update",
".",
"player",
",",
"0",
")",
",",
"preview",
")",... | We have obtained a waveform preview for a device, so store it and alert any listeners.
@param update the update which caused us to retrieve this waveform preview
@param preview the waveform preview which we retrieved | [
"We",
"have",
"obtained",
"a",
"waveform",
"preview",
"for",
"a",
"device",
"so",
"store",
"it",
"and",
"alert",
"any",
"listeners",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L283-L293 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/MultiPoint.java | MultiPoint.add | public void add(MultiVertexGeometry src, int srcFrom, int srcTo) {
"""
Appends points from another multipoint at the end of this multipoint.
@param src
The mulitpoint to append to this multipoint.
@param srcFrom
The start index in the source multipoint from which to start
appending points.
@param srcTo
Th... | java | public void add(MultiVertexGeometry src, int srcFrom, int srcTo) {
m_impl.add((MultiVertexGeometryImpl) src._getImpl(), srcFrom, srcTo);
} | [
"public",
"void",
"add",
"(",
"MultiVertexGeometry",
"src",
",",
"int",
"srcFrom",
",",
"int",
"srcTo",
")",
"{",
"m_impl",
".",
"add",
"(",
"(",
"MultiVertexGeometryImpl",
")",
"src",
".",
"_getImpl",
"(",
")",
",",
"srcFrom",
",",
"srcTo",
")",
";",
... | Appends points from another multipoint at the end of this multipoint.
@param src
The mulitpoint to append to this multipoint.
@param srcFrom
The start index in the source multipoint from which to start
appending points.
@param srcTo
The end index in the source multipoint right after the last
point to be appended. Use ... | [
"Appends",
"points",
"from",
"another",
"multipoint",
"at",
"the",
"end",
"of",
"this",
"multipoint",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/MultiPoint.java#L163-L165 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/PathMappingResult.java | PathMappingResult.of | public static PathMappingResult of(String path, @Nullable String query) {
"""
Creates a new instance with the specified {@code path} and {@code query}, without any path parameters.
"""
return of(path, query, ImmutableMap.of());
} | java | public static PathMappingResult of(String path, @Nullable String query) {
return of(path, query, ImmutableMap.of());
} | [
"public",
"static",
"PathMappingResult",
"of",
"(",
"String",
"path",
",",
"@",
"Nullable",
"String",
"query",
")",
"{",
"return",
"of",
"(",
"path",
",",
"query",
",",
"ImmutableMap",
".",
"of",
"(",
")",
")",
";",
"}"
] | Creates a new instance with the specified {@code path} and {@code query}, without any path parameters. | [
"Creates",
"a",
"new",
"instance",
"with",
"the",
"specified",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/PathMappingResult.java#L59-L61 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/streaming/DefaultConnectionFactory.java | DefaultConnectionFactory.createConnection | public Socket createConnection(InetAddress peer) throws IOException {
"""
Connect to peer and start exchanging message.
When connect attempt fails, this retries for maximum of MAX_CONNECT_ATTEMPTS times.
@param peer the peer to connect to.
@return the created socket.
@throws IOException when connection fai... | java | public Socket createConnection(InetAddress peer) throws IOException
{
int attempts = 0;
while (true)
{
try
{
Socket socket = OutboundTcpConnectionPool.newSocket(peer);
socket.setSoTimeout(DatabaseDescriptor.getStreamingSocketTimeout());... | [
"public",
"Socket",
"createConnection",
"(",
"InetAddress",
"peer",
")",
"throws",
"IOException",
"{",
"int",
"attempts",
"=",
"0",
";",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"Socket",
"socket",
"=",
"OutboundTcpConnectionPool",
".",
"newSocket",
"(",
... | Connect to peer and start exchanging message.
When connect attempt fails, this retries for maximum of MAX_CONNECT_ATTEMPTS times.
@param peer the peer to connect to.
@return the created socket.
@throws IOException when connection failed. | [
"Connect",
"to",
"peer",
"and",
"start",
"exchanging",
"message",
".",
"When",
"connect",
"attempt",
"fails",
"this",
"retries",
"for",
"maximum",
"of",
"MAX_CONNECT_ATTEMPTS",
"times",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/streaming/DefaultConnectionFactory.java#L45-L74 |
meltmedia/cadmium | cli/src/main/java/com/meltmedia/cadmium/cli/BranchCreator.java | BranchCreator.createNewBranches | public void createNewBranches(String basename, boolean empty, Logger log) throws Exception {
"""
Creates required cadmium branches using the given basename.
This will also create the source branch. The branches created will be as follows:
<ul>
<li><i>basename</i></li>
<li>cd-<i>basename</i></li>
<li>cfg-<i>ba... | java | public void createNewBranches(String basename, boolean empty, Logger log) throws Exception {
createNewBranch(null, basename, empty, log);
createNewBranch("cd", basename, empty, log);
createNewBranch("cfg", basename, empty, log);
} | [
"public",
"void",
"createNewBranches",
"(",
"String",
"basename",
",",
"boolean",
"empty",
",",
"Logger",
"log",
")",
"throws",
"Exception",
"{",
"createNewBranch",
"(",
"null",
",",
"basename",
",",
"empty",
",",
"log",
")",
";",
"createNewBranch",
"(",
"\"... | Creates required cadmium branches using the given basename.
This will also create the source branch. The branches created will be as follows:
<ul>
<li><i>basename</i></li>
<li>cd-<i>basename</i></li>
<li>cfg-<i>basename</i></li>
</ul>
@param basename The basename used for all branches that will be created.
@param empt... | [
"Creates",
"required",
"cadmium",
"branches",
"using",
"the",
"given",
"basename",
".",
"This",
"will",
"also",
"create",
"the",
"source",
"branch",
".",
"The",
"branches",
"created",
"will",
"be",
"as",
"follows",
":",
"<ul",
">",
"<li",
">",
"<i",
">",
... | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/cli/src/main/java/com/meltmedia/cadmium/cli/BranchCreator.java#L78-L82 |
haifengl/smile | math/src/main/java/smile/math/matrix/JMatrix.java | JMatrix.eltran | private static void eltran(DenseMatrix A, DenseMatrix V, int[] perm) {
"""
Accumulate the stabilized elementary similarity transformations used
in the reduction of a real nonsymmetric matrix to upper Hessenberg form by elmhes.
"""
int n = A.nrows();
for (int mp = n - 2; mp > 0; mp--) {
... | java | private static void eltran(DenseMatrix A, DenseMatrix V, int[] perm) {
int n = A.nrows();
for (int mp = n - 2; mp > 0; mp--) {
for (int k = mp + 1; k < n; k++) {
V.set(k, mp, A.get(k, mp - 1));
}
int i = perm[mp];
if (i != mp) {
... | [
"private",
"static",
"void",
"eltran",
"(",
"DenseMatrix",
"A",
",",
"DenseMatrix",
"V",
",",
"int",
"[",
"]",
"perm",
")",
"{",
"int",
"n",
"=",
"A",
".",
"nrows",
"(",
")",
";",
"for",
"(",
"int",
"mp",
"=",
"n",
"-",
"2",
";",
"mp",
">",
"... | Accumulate the stabilized elementary similarity transformations used
in the reduction of a real nonsymmetric matrix to upper Hessenberg form by elmhes. | [
"Accumulate",
"the",
"stabilized",
"elementary",
"similarity",
"transformations",
"used",
"in",
"the",
"reduction",
"of",
"a",
"real",
"nonsymmetric",
"matrix",
"to",
"upper",
"Hessenberg",
"form",
"by",
"elmhes",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/matrix/JMatrix.java#L1933-L1948 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/APIClient.java | APIClient.generateSecuredApiKey | public String generateSecuredApiKey(String privateApiKey, Query query, String userToken) throws NoSuchAlgorithmException, InvalidKeyException {
"""
Generate a secured and public API Key from a query and an
optional user token identifying the current user
@param privateApiKey your private API Key
@param query ... | java | public String generateSecuredApiKey(String privateApiKey, Query query, String userToken) throws NoSuchAlgorithmException, InvalidKeyException {
if (userToken != null && userToken.length() > 0) {
query.setUserToken(userToken);
}
String queryStr = query.getQueryString();
String key = hmac(privateApi... | [
"public",
"String",
"generateSecuredApiKey",
"(",
"String",
"privateApiKey",
",",
"Query",
"query",
",",
"String",
"userToken",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"if",
"(",
"userToken",
"!=",
"null",
"&&",
"userToken",
".",
... | Generate a secured and public API Key from a query and an
optional user token identifying the current user
@param privateApiKey your private API Key
@param query contains the parameter applied to the query (used as security)
@param userToken an optional token identifying the current user | [
"Generate",
"a",
"secured",
"and",
"public",
"API",
"Key",
"from",
"a",
"query",
"and",
"an",
"optional",
"user",
"token",
"identifying",
"the",
"current",
"user"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L1030-L1038 |
schallee/alib4j | core/src/main/java/net/darkmist/alib/res/PkgRes.java | PkgRes.getBytesFor | public static byte[] getBytesFor(String name, Object obj) {
"""
Get a resource as a byte array.
@param name The name of the resource
@return The contents of the resource as a byte array.
@throws NullPointerException if name or obj are null.
ResourceException if the resource cannot be found.
"""
if(obj ==... | java | public static byte[] getBytesFor(String name, Object obj)
{
if(obj == null)
throw new NullPointerException("obj is null");
return getBytesFor(name,obj.getClass());
} | [
"public",
"static",
"byte",
"[",
"]",
"getBytesFor",
"(",
"String",
"name",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"obj is null\"",
")",
";",
"return",
"getBytesFor",
"(",
"name",... | Get a resource as a byte array.
@param name The name of the resource
@return The contents of the resource as a byte array.
@throws NullPointerException if name or obj are null.
ResourceException if the resource cannot be found. | [
"Get",
"a",
"resource",
"as",
"a",
"byte",
"array",
"."
] | train | https://github.com/schallee/alib4j/blob/0e0718aee574bbb62268e1cf58e99286529ce529/core/src/main/java/net/darkmist/alib/res/PkgRes.java#L385-L390 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java | ArrayUtil.get | @SuppressWarnings("unchecked")
public static <T> T get(Object array, int index) {
"""
获取数组对象中指定index的值,支持负数,例如-1表示倒数第一个值<br>
如果数组下标越界,返回null
@param <T> 数组元素类型
@param array 数组对象
@param index 下标,支持负数
@return 值
@since 4.0.6
"""
if(null == array) {
return null;
}
if (index < 0) {
ind... | java | @SuppressWarnings("unchecked")
public static <T> T get(Object array, int index) {
if(null == array) {
return null;
}
if (index < 0) {
index += Array.getLength(array);
}
try {
return (T) Array.get(array, index);
} catch (ArrayIndexOutOfBoundsException e) {
return null;
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"get",
"(",
"Object",
"array",
",",
"int",
"index",
")",
"{",
"if",
"(",
"null",
"==",
"array",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"index",
"<... | 获取数组对象中指定index的值,支持负数,例如-1表示倒数第一个值<br>
如果数组下标越界,返回null
@param <T> 数组元素类型
@param array 数组对象
@param index 下标,支持负数
@return 值
@since 4.0.6 | [
"获取数组对象中指定index的值,支持负数,例如",
"-",
"1表示倒数第一个值<br",
">",
"如果数组下标越界,返回null"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L1810-L1824 |
m-m-m/util | gwt/src/main/java/net/sf/mmm/util/gwt/base/rebind/AbstractIncrementalGenerator.java | AbstractIncrementalGenerator.generateSourcePublicMethodDeclaration | protected final void generateSourcePublicMethodDeclaration(SourceWriter sourceWriter, JMethod method) {
"""
This method generates the source code for a public method declaration including the opening brace and indentation.
@param sourceWriter is the {@link SourceWriter}.
@param method is the {@link JMethod} to... | java | protected final void generateSourcePublicMethodDeclaration(SourceWriter sourceWriter, JMethod method) {
StringBuilder arguments = new StringBuilder();
for (JParameter parameter : method.getParameters()) {
if (arguments.length() > 0) {
arguments.append(", ");
}
arguments.append(paramet... | [
"protected",
"final",
"void",
"generateSourcePublicMethodDeclaration",
"(",
"SourceWriter",
"sourceWriter",
",",
"JMethod",
"method",
")",
"{",
"StringBuilder",
"arguments",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"JParameter",
"parameter",
":",
"met... | This method generates the source code for a public method declaration including the opening brace and indentation.
@param sourceWriter is the {@link SourceWriter}.
@param method is the {@link JMethod} to implement. | [
"This",
"method",
"generates",
"the",
"source",
"code",
"for",
"a",
"public",
"method",
"declaration",
"including",
"the",
"opening",
"brace",
"and",
"indentation",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/gwt/src/main/java/net/sf/mmm/util/gwt/base/rebind/AbstractIncrementalGenerator.java#L193-L206 |
cvut/JCOP | src/main/java/cz/cvut/felk/cig/jcop/result/render/JFreeChartRender.java | JFreeChartRender.setRangeAxis | public JFreeChartRender setRangeAxis(double lowerBound, double upperBound) {
"""
Sets bounds for range axis.
@param lowerBound lower range bound
@param upperBound upper range bound
@return itself (fluent interface)
"""
ValueAxis valueAxis = getPlot().getRangeAxis();
valueAxis.setUpperBound... | java | public JFreeChartRender setRangeAxis(double lowerBound, double upperBound) {
ValueAxis valueAxis = getPlot().getRangeAxis();
valueAxis.setUpperBound(upperBound);
valueAxis.setLowerBound(lowerBound);
return this;
} | [
"public",
"JFreeChartRender",
"setRangeAxis",
"(",
"double",
"lowerBound",
",",
"double",
"upperBound",
")",
"{",
"ValueAxis",
"valueAxis",
"=",
"getPlot",
"(",
")",
".",
"getRangeAxis",
"(",
")",
";",
"valueAxis",
".",
"setUpperBound",
"(",
"upperBound",
")",
... | Sets bounds for range axis.
@param lowerBound lower range bound
@param upperBound upper range bound
@return itself (fluent interface) | [
"Sets",
"bounds",
"for",
"range",
"axis",
"."
] | train | https://github.com/cvut/JCOP/blob/2ec18315a9a452e5f4e3d07cccfde0310adc465a/src/main/java/cz/cvut/felk/cig/jcop/result/render/JFreeChartRender.java#L273-L278 |
op4j/op4j-jodatime | src/main/java/org/op4j/jodatime/functions/FnJodaString.java | FnJodaString.baseDateTimeToStr | public static final Function<BaseDateTime, String> baseDateTimeToStr(final FormatType formatType, final String format) {
"""
<p>
It converts the input {@link BaseDateTime} into a {@link String} by means of the given pattern or style
(depending on the value of formatType parameter).
</p>
@param formatType the... | java | public static final Function<BaseDateTime, String> baseDateTimeToStr(final FormatType formatType, final String format) {
return new BaseDateTimeToStr(formatType, format);
} | [
"public",
"static",
"final",
"Function",
"<",
"BaseDateTime",
",",
"String",
">",
"baseDateTimeToStr",
"(",
"final",
"FormatType",
"formatType",
",",
"final",
"String",
"format",
")",
"{",
"return",
"new",
"BaseDateTimeToStr",
"(",
"formatType",
",",
"format",
"... | <p>
It converts the input {@link BaseDateTime} into a {@link String} by means of the given pattern or style
(depending on the value of formatType parameter).
</p>
@param formatType the format {@link FormatType}
@param format string with the format used for the output
@return the {@link String} created from the input a... | [
"<p",
">",
"It",
"converts",
"the",
"input",
"{",
"@link",
"BaseDateTime",
"}",
"into",
"a",
"{",
"@link",
"String",
"}",
"by",
"means",
"of",
"the",
"given",
"pattern",
"or",
"style",
"(",
"depending",
"on",
"the",
"value",
"of",
"formatType",
"paramete... | train | https://github.com/op4j/op4j-jodatime/blob/26e5b8cda8553fb3b5a4a64b3109dbbf5df21194/src/main/java/org/op4j/jodatime/functions/FnJodaString.java#L74-L76 |
alipay/sofa-rpc | core-impl/transport/src/main/java/com/alipay/sofa/rpc/transport/AbstractProxyClientTransport.java | AbstractProxyClientTransport.doInvokeSync | protected SofaResponse doInvokeSync(SofaRequest request, int timeoutMillis)
throws InvocationTargetException, IllegalAccessException {
"""
同步调用
@param request 请求对象
@param timeoutMillis 超时时间(毫秒)
@return 返回对象
@throws InvocationTargetException 反射调用异常
@since 5.2.0
"""
SofaResponse resp... | java | protected SofaResponse doInvokeSync(SofaRequest request, int timeoutMillis)
throws InvocationTargetException, IllegalAccessException {
SofaResponse response = new SofaResponse();
Method method = getMethod(request);
if (method == null) {
throw new SofaRpcException(RpcErrorType... | [
"protected",
"SofaResponse",
"doInvokeSync",
"(",
"SofaRequest",
"request",
",",
"int",
"timeoutMillis",
")",
"throws",
"InvocationTargetException",
",",
"IllegalAccessException",
"{",
"SofaResponse",
"response",
"=",
"new",
"SofaResponse",
"(",
")",
";",
"Method",
"m... | 同步调用
@param request 请求对象
@param timeoutMillis 超时时间(毫秒)
@return 返回对象
@throws InvocationTargetException 反射调用异常
@since 5.2.0 | [
"同步调用"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core-impl/transport/src/main/java/com/alipay/sofa/rpc/transport/AbstractProxyClientTransport.java#L192-L203 |
jenkinsci/email-ext-plugin | src/main/java/hudson/plugins/emailext/plugins/content/ScriptContent.java | ScriptContent.createEngine | private GroovyShell createEngine(ExtendedEmailPublisherDescriptor descriptor, Map<String, Object> variables, boolean secure)
throws IOException {
"""
Creates an engine (GroovyShell) to be used to execute Groovy code
@param variables user variables to be added to the Groovy context
@return a GroovyS... | java | private GroovyShell createEngine(ExtendedEmailPublisherDescriptor descriptor, Map<String, Object> variables, boolean secure)
throws IOException {
ClassLoader cl;
CompilerConfiguration cc;
if (secure) {
cl = GroovySandbox.createSecureClassLoader(Jenkins.getActiveInstance(... | [
"private",
"GroovyShell",
"createEngine",
"(",
"ExtendedEmailPublisherDescriptor",
"descriptor",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"variables",
",",
"boolean",
"secure",
")",
"throws",
"IOException",
"{",
"ClassLoader",
"cl",
";",
"CompilerConfiguration",... | Creates an engine (GroovyShell) to be used to execute Groovy code
@param variables user variables to be added to the Groovy context
@return a GroovyShell instance
@throws FileNotFoundException
@throws IOException | [
"Creates",
"an",
"engine",
"(",
"GroovyShell",
")",
"to",
"be",
"used",
"to",
"execute",
"Groovy",
"code"
] | train | https://github.com/jenkinsci/email-ext-plugin/blob/21fbd402665848a18205b26751424149e51e86e4/src/main/java/hudson/plugins/emailext/plugins/content/ScriptContent.java#L243-L268 |
stanfy/goro | goro/src/main/java/com/stanfy/enroscar/goro/GoroService.java | GoroService.taskIntent | public static <T extends Callable<?> & Parcelable> Intent taskIntent(final Context context,
final T task) {
"""
Create an intent that contains a task that should be scheduled
on a default queue.
@param context context instance
@param task ta... | java | public static <T extends Callable<?> & Parcelable> Intent taskIntent(final Context context,
final T task) {
return taskIntent(context, Goro.DEFAULT_QUEUE, task);
} | [
"public",
"static",
"<",
"T",
"extends",
"Callable",
"<",
"?",
">",
"&",
"Parcelable",
">",
"Intent",
"taskIntent",
"(",
"final",
"Context",
"context",
",",
"final",
"T",
"task",
")",
"{",
"return",
"taskIntent",
"(",
"context",
",",
"Goro",
".",
"DEFAUL... | Create an intent that contains a task that should be scheduled
on a default queue.
@param context context instance
@param task task instance
@param <T> task type
@see #taskIntent(android.content.Context, String, java.util.concurrent.Callable) | [
"Create",
"an",
"intent",
"that",
"contains",
"a",
"task",
"that",
"should",
"be",
"scheduled",
"on",
"a",
"default",
"queue",
"."
] | train | https://github.com/stanfy/goro/blob/6618e63a926833d61f492ec611ee77668d756820/goro/src/main/java/com/stanfy/enroscar/goro/GoroService.java#L197-L200 |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java | ReceiveMessageBuilder.validateNamespace | public T validateNamespace(String prefix, String namespaceUri) {
"""
Validates XML namespace with prefix and uri.
@param prefix
@param namespaceUri
@return
"""
xmlMessageValidationContext.getControlNamespaces().put(prefix, namespaceUri);
return self;
} | java | public T validateNamespace(String prefix, String namespaceUri) {
xmlMessageValidationContext.getControlNamespaces().put(prefix, namespaceUri);
return self;
} | [
"public",
"T",
"validateNamespace",
"(",
"String",
"prefix",
",",
"String",
"namespaceUri",
")",
"{",
"xmlMessageValidationContext",
".",
"getControlNamespaces",
"(",
")",
".",
"put",
"(",
"prefix",
",",
"namespaceUri",
")",
";",
"return",
"self",
";",
"}"
] | Validates XML namespace with prefix and uri.
@param prefix
@param namespaceUri
@return | [
"Validates",
"XML",
"namespace",
"with",
"prefix",
"and",
"uri",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L553-L556 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/Database.java | Database.withCurrentTransaction | private <T> T withCurrentTransaction(@NotNull SqlQuery query, @NotNull TransactionCallback<T> callback) {
"""
Executes the block of code within context of current transaction. If there's no transaction in progress
throws {@link NoActiveTransactionException} unless implicit transaction are allowed: in this case, s... | java | private <T> T withCurrentTransaction(@NotNull SqlQuery query, @NotNull TransactionCallback<T> callback) {
SqlQuery oldQuery = DebugContext.getCurrentQuery();
try {
DebugContext.setCurrentQuery(query);
if (allowImplicitTransactions) {
return withTransaction(callbac... | [
"private",
"<",
"T",
">",
"T",
"withCurrentTransaction",
"(",
"@",
"NotNull",
"SqlQuery",
"query",
",",
"@",
"NotNull",
"TransactionCallback",
"<",
"T",
">",
"callback",
")",
"{",
"SqlQuery",
"oldQuery",
"=",
"DebugContext",
".",
"getCurrentQuery",
"(",
")",
... | Executes the block of code within context of current transaction. If there's no transaction in progress
throws {@link NoActiveTransactionException} unless implicit transaction are allowed: in this case, starts a new
transaction.
@throws NoActiveTransactionException if there's no active transaction.
@see #setAllowImpli... | [
"Executes",
"the",
"block",
"of",
"code",
"within",
"context",
"of",
"current",
"transaction",
".",
"If",
"there",
"s",
"no",
"transaction",
"in",
"progress",
"throws",
"{",
"@link",
"NoActiveTransactionException",
"}",
"unless",
"implicit",
"transaction",
"are",
... | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L253-L265 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.joinWith | public static String joinWith(final String separator, final Object... objects) {
"""
<p>Joins the elements of the provided varargs into a
single String containing the provided elements.</p>
<p>No delimiter is added before or after the list.
{@code null} elements and separator are treated as empty Strings ("")... | java | public static String joinWith(final String separator, final Object... objects) {
if (objects == null) {
throw new IllegalArgumentException("Object varargs must not be null");
}
final String sanitizedSeparator = defaultString(separator, StringUtils.EMPTY);
final StringBuilde... | [
"public",
"static",
"String",
"joinWith",
"(",
"final",
"String",
"separator",
",",
"final",
"Object",
"...",
"objects",
")",
"{",
"if",
"(",
"objects",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Object varargs must not be null\"",... | <p>Joins the elements of the provided varargs into a
single String containing the provided elements.</p>
<p>No delimiter is added before or after the list.
{@code null} elements and separator are treated as empty Strings ("").</p>
<pre>
StringUtils.joinWith(",", {"a", "b"}) = "a,b"
StringUtils.joinWith(",", {"... | [
"<p",
">",
"Joins",
"the",
"elements",
"of",
"the",
"provided",
"varargs",
"into",
"a",
"single",
"String",
"containing",
"the",
"provided",
"elements",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L4748-L4768 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/MatrixFeatures_DDRM.java | MatrixFeatures_DDRM.isConstantVal | public static boolean isConstantVal(DMatrixRMaj mat , double val , double tol ) {
"""
Checks to see if every value in the matrix is the specified value.
@param mat The matrix being tested. Not modified.
@param val Checks to see if every element in the matrix has this value.
@param tol True if all the element... | java | public static boolean isConstantVal(DMatrixRMaj mat , double val , 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( !(Math.abs(mat.get(index++)-val) <= to... | [
"public",
"static",
"boolean",
"isConstantVal",
"(",
"DMatrixRMaj",
"mat",
",",
"double",
"val",
",",
"double",
"tol",
")",
"{",
"// see if the result is an identity matrix",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"... | Checks to see if every value in the matrix is the specified value.
@param mat The matrix being tested. Not modified.
@param val Checks to see if every element in the matrix has this value.
@param tol True if all the elements are within this tolerance.
@return true if the test passes. | [
"Checks",
"to",
"see",
"if",
"every",
"value",
"in",
"the",
"matrix",
"is",
"the",
"specified",
"value",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/MatrixFeatures_DDRM.java#L552-L565 |
JodaOrg/joda-time | src/main/java/org/joda/time/base/BasePartial.java | BasePartial.setValue | protected void setValue(int index, int value) {
"""
Sets the value of the field at the specified index.
<p>
In version 2.0 and later, this method copies the array into the original.
This is because the instance variable has been changed to be final to satisfy the Java Memory Model.
This only impacts subclasses... | java | protected void setValue(int index, int value) {
DateTimeField field = getField(index);
int[] values = field.set(this, index, iValues, value);
System.arraycopy(values, 0, iValues, 0, iValues.length);
} | [
"protected",
"void",
"setValue",
"(",
"int",
"index",
",",
"int",
"value",
")",
"{",
"DateTimeField",
"field",
"=",
"getField",
"(",
"index",
")",
";",
"int",
"[",
"]",
"values",
"=",
"field",
".",
"set",
"(",
"this",
",",
"index",
",",
"iValues",
",... | Sets the value of the field at the specified index.
<p>
In version 2.0 and later, this method copies the array into the original.
This is because the instance variable has been changed to be final to satisfy the Java Memory Model.
This only impacts subclasses that are mutable.
@param index the index
@param value the... | [
"Sets",
"the",
"value",
"of",
"the",
"field",
"at",
"the",
"specified",
"index",
".",
"<p",
">",
"In",
"version",
"2",
".",
"0",
"and",
"later",
"this",
"method",
"copies",
"the",
"array",
"into",
"the",
"original",
".",
"This",
"is",
"because",
"the",... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BasePartial.java#L264-L268 |
trellis-ldp/trellis | components/app/src/main/java/org/trellisldp/app/AbstractTrellisApplication.java | AbstractTrellisApplication.getLdpComponent | protected Object getLdpComponent(final T config, final boolean initialize) {
"""
Get the TrellisHttpResource matcher.
@param config the configuration
@param initialize true if the TrellisHttpResource object should be initialized; false otherwise
@return the LDP resource matcher
"""
final TrellisHt... | java | protected Object getLdpComponent(final T config, final boolean initialize) {
final TrellisHttpResource ldpResource = new TrellisHttpResource(getServiceBundler(), config.getBaseUrl());
if (initialize) {
ldpResource.initialize();
}
return ldpResource;
} | [
"protected",
"Object",
"getLdpComponent",
"(",
"final",
"T",
"config",
",",
"final",
"boolean",
"initialize",
")",
"{",
"final",
"TrellisHttpResource",
"ldpResource",
"=",
"new",
"TrellisHttpResource",
"(",
"getServiceBundler",
"(",
")",
",",
"config",
".",
"getBa... | Get the TrellisHttpResource matcher.
@param config the configuration
@param initialize true if the TrellisHttpResource object should be initialized; false otherwise
@return the LDP resource matcher | [
"Get",
"the",
"TrellisHttpResource",
"matcher",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/components/app/src/main/java/org/trellisldp/app/AbstractTrellisApplication.java#L84-L90 |
Jasig/uPortal | uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/provider/RDBMPermissionImpl.java | RDBMPermissionImpl.primUpdate | private int primUpdate(IPermission perm, PreparedStatement ps) throws Exception {
"""
Set the params on the PreparedStatement and execute the update.
@param perm org.apereo.portal.security.IPermission
@param ps java.sql.PreparedStatement - the PreparedStatement for updating a Permission row.
@return int - the... | java | private int primUpdate(IPermission perm, PreparedStatement ps) throws Exception {
java.sql.Timestamp ts = null;
// UPDATE COLUMNS:
ps.clearParameters();
// TYPE:
if (perm.getType() == null) {
ps.setNull(1, Types.VARCHAR);
} else {
ps.setString(1,... | [
"private",
"int",
"primUpdate",
"(",
"IPermission",
"perm",
",",
"PreparedStatement",
"ps",
")",
"throws",
"Exception",
"{",
"java",
".",
"sql",
".",
"Timestamp",
"ts",
"=",
"null",
";",
"// UPDATE COLUMNS:",
"ps",
".",
"clearParameters",
"(",
")",
";",
"// ... | Set the params on the PreparedStatement and execute the update.
@param perm org.apereo.portal.security.IPermission
@param ps java.sql.PreparedStatement - the PreparedStatement for updating a Permission row.
@return int - the return code from the PreparedStatement
@exception Exception | [
"Set",
"the",
"params",
"on",
"the",
"PreparedStatement",
"and",
"execute",
"the",
"update",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/provider/RDBMPermissionImpl.java#L554-L589 |
alrocar/POIProxy | es.alrocar.poiproxy/src/main/java/es/alrocar/poiproxy/proxy/POIProxy.java | POIProxy.getFeatures | public ArrayList<JTSFeature> getFeatures(String id, double lon, double lat, double distanceInMeters,
List<Param> optionalParams) throws Exception {
"""
This method is used to get the pois from a service and return a list of
{@link JTSFeature} document with the data retrieved given a longitude,
latitude and a ... | java | public ArrayList<JTSFeature> getFeatures(String id, double lon, double lat, double distanceInMeters,
List<Param> optionalParams) throws Exception {
DescribeService describeService = getDescribeServiceByID(id);
double[] bbox = Calculator.boundingCoordinates(lon, lat, distanceInMeters);
return getFeatures(id, ... | [
"public",
"ArrayList",
"<",
"JTSFeature",
">",
"getFeatures",
"(",
"String",
"id",
",",
"double",
"lon",
",",
"double",
"lat",
",",
"double",
"distanceInMeters",
",",
"List",
"<",
"Param",
">",
"optionalParams",
")",
"throws",
"Exception",
"{",
"DescribeServic... | This method is used to get the pois from a service and return a list of
{@link JTSFeature} document with the data retrieved given a longitude,
latitude and a radius in meters.
@param id
The id of the service
@param lon
The longitude
@param lat
The latitude
@param distanceInMeters
The distance in meters from the lon, l... | [
"This",
"method",
"is",
"used",
"to",
"get",
"the",
"pois",
"from",
"a",
"service",
"and",
"return",
"a",
"list",
"of",
"{",
"@link",
"JTSFeature",
"}",
"document",
"with",
"the",
"data",
"retrieved",
"given",
"a",
"longitude",
"latitude",
"and",
"a",
"r... | train | https://github.com/alrocar/POIProxy/blob/e1dabe738a862478b2580e90d5fc4209a2997868/es.alrocar.poiproxy/src/main/java/es/alrocar/poiproxy/proxy/POIProxy.java#L375-L382 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/repeater/RepeaterExampleWithStaticIDs.java | RepeaterExampleWithStaticIDs.addNewContact | private void addNewContact() {
"""
Adds a new contact to the list of contacts. The contact's name is obtained from {@link newNameField}.
"""
String name = newNameField.getText();
if (name != null && !"".equals(name)) {
List list = new ArrayList(repeater.getBeanList());
list.add(new ContactDetails(nam... | java | private void addNewContact() {
String name = newNameField.getText();
if (name != null && !"".equals(name)) {
List list = new ArrayList(repeater.getBeanList());
list.add(new ContactDetails(name, null, new String[0]));
repeater.setBeanList(list);
}
newNameField.setText("");
} | [
"private",
"void",
"addNewContact",
"(",
")",
"{",
"String",
"name",
"=",
"newNameField",
".",
"getText",
"(",
")",
";",
"if",
"(",
"name",
"!=",
"null",
"&&",
"!",
"\"\"",
".",
"equals",
"(",
"name",
")",
")",
"{",
"List",
"list",
"=",
"new",
"Arr... | Adds a new contact to the list of contacts. The contact's name is obtained from {@link newNameField}. | [
"Adds",
"a",
"new",
"contact",
"to",
"the",
"list",
"of",
"contacts",
".",
"The",
"contact",
"s",
"name",
"is",
"obtained",
"from",
"{"
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/repeater/RepeaterExampleWithStaticIDs.java#L198-L206 |
GCRC/nunaliit | nunaliit2-multimedia/src/main/java/ca/carleton/gcrc/olkit/multimedia/apachePDFBox/imageio/TIFFUtil.java | TIFFUtil.updateMetadata | static void updateMetadata(IIOMetadata metadata, BufferedImage image, int dpi)
throws IIOInvalidTreeException {
"""
Updates the given ImageIO metadata with Sun's custom TIFF tags, as described in
the <a href="https://svn.apache.org/repos/asf/xmlgraphics/commons/tags/commons-1_3_1/src/java/org/apache/x... | java | static void updateMetadata(IIOMetadata metadata, BufferedImage image, int dpi)
throws IIOInvalidTreeException
{
String metaDataFormat = metadata.getNativeMetadataFormatName();
if (metaDataFormat == null)
{
logger.debug("TIFF image writer doesn't support any data forma... | [
"static",
"void",
"updateMetadata",
"(",
"IIOMetadata",
"metadata",
",",
"BufferedImage",
"image",
",",
"int",
"dpi",
")",
"throws",
"IIOInvalidTreeException",
"{",
"String",
"metaDataFormat",
"=",
"metadata",
".",
"getNativeMetadataFormatName",
"(",
")",
";",
"if",... | Updates the given ImageIO metadata with Sun's custom TIFF tags, as described in
the <a href="https://svn.apache.org/repos/asf/xmlgraphics/commons/tags/commons-1_3_1/src/java/org/apache/xmlgraphics/image/writer/imageio/ImageIOTIFFImageWriter.java">org.apache.xmlgraphics.image.writer.imageio.ImageIOTIFFImageWriter
source... | [
"Updates",
"the",
"given",
"ImageIO",
"metadata",
"with",
"Sun",
"s",
"custom",
"TIFF",
"tags",
"as",
"described",
"in",
"the",
"<a",
"href",
"=",
"https",
":",
"//",
"svn",
".",
"apache",
".",
"org",
"/",
"repos",
"/",
"asf",
"/",
"xmlgraphics",
"/",
... | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-multimedia/src/main/java/ca/carleton/gcrc/olkit/multimedia/apachePDFBox/imageio/TIFFUtil.java#L77-L120 |
phax/ph-commons | ph-scopes/src/main/java/com/helger/scope/singleton/AbstractSingleton.java | AbstractSingleton.isSingletonInstantiated | public static final boolean isSingletonInstantiated (@Nullable final IScope aScope,
@Nonnull final Class <? extends AbstractSingleton> aClass) {
"""
Check if a singleton is already instantiated inside a scope
@param aScope
The scope to check. May be <code>... | java | public static final boolean isSingletonInstantiated (@Nullable final IScope aScope,
@Nonnull final Class <? extends AbstractSingleton> aClass)
{
return getSingletonIfInstantiated (aScope, aClass) != null;
} | [
"public",
"static",
"final",
"boolean",
"isSingletonInstantiated",
"(",
"@",
"Nullable",
"final",
"IScope",
"aScope",
",",
"@",
"Nonnull",
"final",
"Class",
"<",
"?",
"extends",
"AbstractSingleton",
">",
"aClass",
")",
"{",
"return",
"getSingletonIfInstantiated",
... | Check if a singleton is already instantiated inside a scope
@param aScope
The scope to check. May be <code>null</code> to avoid constructing a
scope.
@param aClass
The class to be checked. May not be <code>null</code>.
@return <code>true</code> if the singleton for the specified class is
already instantiated, <code>fa... | [
"Check",
"if",
"a",
"singleton",
"is",
"already",
"instantiated",
"inside",
"a",
"scope"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-scopes/src/main/java/com/helger/scope/singleton/AbstractSingleton.java#L447-L451 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/execution/ExecutionUtils.java | ExecutionUtils.getMessageLogLevel | public static String getMessageLogLevel(final int level, final String defLevel) {
"""
Get message loglevel string for the integer value
@param level integer level
@param defLevel default string to return if integer doesn't match
@return loglevel string, or the default value
"""
switch (level)... | java | public static String getMessageLogLevel(final int level, final String defLevel) {
switch (level) {
case (Constants.ERR_LEVEL):
return Constants.MSG_ERR;
case (Constants.DEBUG_LEVEL):
return Constants.MSG_DEBUG;
case (Constants.INFO_LEVEL):
... | [
"public",
"static",
"String",
"getMessageLogLevel",
"(",
"final",
"int",
"level",
",",
"final",
"String",
"defLevel",
")",
"{",
"switch",
"(",
"level",
")",
"{",
"case",
"(",
"Constants",
".",
"ERR_LEVEL",
")",
":",
"return",
"Constants",
".",
"MSG_ERR",
"... | Get message loglevel string for the integer value
@param level integer level
@param defLevel default string to return if integer doesn't match
@return loglevel string, or the default value | [
"Get",
"message",
"loglevel",
"string",
"for",
"the",
"integer",
"value"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/ExecutionUtils.java#L44-L59 |
oasp/oasp4j | modules/basic/src/main/java/io/oasp/module/basic/common/api/config/SimpleConfigProperties.java | SimpleConfigProperties.fromFlatMap | protected void fromFlatMap(Map<String, String> map) {
"""
@see SimpleConfigProperties#ofFlatMap(String, Map)
@param map the flat {@link Map} of the configuration values.
"""
for (Entry<String, String> entry : map.entrySet()) {
SimpleConfigProperties child;
child = (SimpleConfigProperties) g... | java | protected void fromFlatMap(Map<String, String> map) {
for (Entry<String, String> entry : map.entrySet()) {
SimpleConfigProperties child;
child = (SimpleConfigProperties) getChild(entry.getKey(), true);
child.value = entry.getValue();
}
} | [
"protected",
"void",
"fromFlatMap",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"map",
")",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"map",
".",
"entrySet",
"(",
")",
")",
"{",
"SimpleConfigProperties",
"child",
";"... | @see SimpleConfigProperties#ofFlatMap(String, Map)
@param map the flat {@link Map} of the configuration values. | [
"@see",
"SimpleConfigProperties#ofFlatMap",
"(",
"String",
"Map",
")"
] | train | https://github.com/oasp/oasp4j/blob/03f90132699fad95e52ec8efa54aa391f8d3c7e4/modules/basic/src/main/java/io/oasp/module/basic/common/api/config/SimpleConfigProperties.java#L257-L264 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.zone_zoneName_record_id_GET | public OvhRecord zone_zoneName_record_id_GET(String zoneName, Long id) throws IOException {
"""
Get this object properties
REST: GET /domain/zone/{zoneName}/record/{id}
@param zoneName [required] The internal name of your zone
@param id [required] Id of the object
"""
String qPath = "/domain/zone/{zoneN... | java | public OvhRecord zone_zoneName_record_id_GET(String zoneName, Long id) throws IOException {
String qPath = "/domain/zone/{zoneName}/record/{id}";
StringBuilder sb = path(qPath, zoneName, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhRecord.class);
} | [
"public",
"OvhRecord",
"zone_zoneName_record_id_GET",
"(",
"String",
"zoneName",
",",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/zone/{zoneName}/record/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"zon... | Get this object properties
REST: GET /domain/zone/{zoneName}/record/{id}
@param zoneName [required] The internal name of your zone
@param id [required] Id of the object | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L888-L893 |
Erudika/para | para-server/src/main/java/com/erudika/para/rest/RestUtils.java | RestUtils.returnObjectResponse | public static void returnObjectResponse(HttpServletResponse response, Object obj) {
"""
A generic JSON response returning an object. Status code is always {@code 200}.
@param response the response to write to
@param obj an object
"""
if (response == null) {
return;
}
PrintWriter out = null;
try {
... | java | public static void returnObjectResponse(HttpServletResponse response, Object obj) {
if (response == null) {
return;
}
PrintWriter out = null;
try {
response.setStatus(HttpServletResponse.SC_OK);
response.setContentType(MediaType.APPLICATION_JSON);
out = response.getWriter();
ParaObjectUtils.getJs... | [
"public",
"static",
"void",
"returnObjectResponse",
"(",
"HttpServletResponse",
"response",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"response",
"==",
"null",
")",
"{",
"return",
";",
"}",
"PrintWriter",
"out",
"=",
"null",
";",
"try",
"{",
"response",
"... | A generic JSON response returning an object. Status code is always {@code 200}.
@param response the response to write to
@param obj an object | [
"A",
"generic",
"JSON",
"response",
"returning",
"an",
"object",
".",
"Status",
"code",
"is",
"always",
"{"
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/rest/RestUtils.java#L967-L984 |
alkacon/opencms-core | src/org/opencms/staticexport/CmsStaticExportManager.java | CmsStaticExportManager.addRfsRule | public void addRfsRule(
String name,
String description,
String source,
String rfsPrefix,
String exportPath,
String exportWorkPath,
String exportBackups,
String useRelativeLinks) {
"""
Adds a new rfs rule to the configuration.<p>
@param name the na... | java | public void addRfsRule(
String name,
String description,
String source,
String rfsPrefix,
String exportPath,
String exportWorkPath,
String exportBackups,
String useRelativeLinks) {
if ((m_staticExportPathConfigured != null) && exportPath.equals(m_... | [
"public",
"void",
"addRfsRule",
"(",
"String",
"name",
",",
"String",
"description",
",",
"String",
"source",
",",
"String",
"rfsPrefix",
",",
"String",
"exportPath",
",",
"String",
"exportWorkPath",
",",
"String",
"exportBackups",
",",
"String",
"useRelativeLinks... | Adds a new rfs rule to the configuration.<p>
@param name the name of the rule
@param description the description for the rule
@param source the source regex
@param rfsPrefix the url prefix
@param exportPath the rfs export path
@param exportWorkPath the rfs export work path
@param exportBackups the number of backups
@p... | [
"Adds",
"a",
"new",
"rfs",
"rule",
"to",
"the",
"configuration",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsStaticExportManager.java#L416-L451 |
gallandarakhneorg/afc | advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/RoadPolyline.java | RoadPolyline.getEndPoint | @Pure
<CT extends RoadConnection> CT getEndPoint(Class<CT> connectionClass) {
"""
Replies the last connection point of this segment.
@param <CT> is the type of the connection to reply
@param connectionClass is the type of the connection to reply
@return the last point of <code>null</code>
"""
final Sta... | java | @Pure
<CT extends RoadConnection> CT getEndPoint(Class<CT> connectionClass) {
final StandardRoadConnection connection = this.lastConnection;
if (connection == null) {
return null;
}
if (connectionClass.isAssignableFrom(StandardRoadConnection.class)) {
return connectionClass.cast(connection);
}
if (co... | [
"@",
"Pure",
"<",
"CT",
"extends",
"RoadConnection",
">",
"CT",
"getEndPoint",
"(",
"Class",
"<",
"CT",
">",
"connectionClass",
")",
"{",
"final",
"StandardRoadConnection",
"connection",
"=",
"this",
".",
"lastConnection",
";",
"if",
"(",
"connection",
"==",
... | Replies the last connection point of this segment.
@param <CT> is the type of the connection to reply
@param connectionClass is the type of the connection to reply
@return the last point of <code>null</code> | [
"Replies",
"the",
"last",
"connection",
"point",
"of",
"this",
"segment",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/RoadPolyline.java#L269-L282 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/buffer/Buffer.java | Buffer.getVal | public Constant getVal(int offset, Type type) {
"""
Returns the value at the specified offset of this buffer's page. If an
integer was not stored at that location, the behavior of the method is
unpredictable.
@param offset
the byte offset of the page
@param type
the type of the value
@return the constan... | java | public Constant getVal(int offset, Type type) {
internalLock.readLock().lock();
try {
return contents.getVal(DATA_START_OFFSET + offset, type);
} finally {
internalLock.readLock().unlock();
}
} | [
"public",
"Constant",
"getVal",
"(",
"int",
"offset",
",",
"Type",
"type",
")",
"{",
"internalLock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"contents",
".",
"getVal",
"(",
"DATA_START_OFFSET",
"+",
"offset",
",",
"... | Returns the value at the specified offset of this buffer's page. If an
integer was not stored at that location, the behavior of the method is
unpredictable.
@param offset
the byte offset of the page
@param type
the type of the value
@return the constant value at that offset | [
"Returns",
"the",
"value",
"at",
"the",
"specified",
"offset",
"of",
"this",
"buffer",
"s",
"page",
".",
"If",
"an",
"integer",
"was",
"not",
"stored",
"at",
"that",
"location",
"the",
"behavior",
"of",
"the",
"method",
"is",
"unpredictable",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/buffer/Buffer.java#L87-L94 |
camunda/camunda-spin | dataformat-xml-dom/src/main/java/org/camunda/spin/impl/xml/dom/query/DomXPathNamespaceResolver.java | DomXPathNamespaceResolver.setNamespace | public void setNamespace(String prefix, String namespaceURI) {
"""
Maps a single prefix, uri pair as namespace.
@param prefix the prefix to use
@param namespaceURI the URI to use
@throws IllegalArgumentException if prefix or namespaceURI is null
"""
ensureNotNull("Prefix", prefix);
ensureNotNull("... | java | public void setNamespace(String prefix, String namespaceURI) {
ensureNotNull("Prefix", prefix);
ensureNotNull("Namespace URI", namespaceURI);
namespaces.put(prefix, namespaceURI);
} | [
"public",
"void",
"setNamespace",
"(",
"String",
"prefix",
",",
"String",
"namespaceURI",
")",
"{",
"ensureNotNull",
"(",
"\"Prefix\"",
",",
"prefix",
")",
";",
"ensureNotNull",
"(",
"\"Namespace URI\"",
",",
"namespaceURI",
")",
";",
"namespaces",
".",
"put",
... | Maps a single prefix, uri pair as namespace.
@param prefix the prefix to use
@param namespaceURI the URI to use
@throws IllegalArgumentException if prefix or namespaceURI is null | [
"Maps",
"a",
"single",
"prefix",
"uri",
"pair",
"as",
"namespace",
"."
] | train | https://github.com/camunda/camunda-spin/blob/cfe65161eb97fd5023a945cb97c47fbfe69e9fdd/dataformat-xml-dom/src/main/java/org/camunda/spin/impl/xml/dom/query/DomXPathNamespaceResolver.java#L144-L149 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/http/ApacheHTTPClient.java | ApacheHTTPClient.submitHTTPRequest | public HTTPResponse submitHTTPRequest(HTTPRequest httpRequest,HTTPClientConfiguration httpClientConfiguration,HTTPMethod httpMethod) {
"""
Submits the HTTP request and returns the HTTP response.
@param httpRequest
The HTTP request to send
@param httpClientConfiguration
HTTP client configuration
@param ... | java | public HTTPResponse submitHTTPRequest(HTTPRequest httpRequest,HTTPClientConfiguration httpClientConfiguration,HTTPMethod httpMethod)
{
//create HTTP client
HttpClient httpClient=this.createHttpClient();
//create URL
String url=this.createURL(httpRequest,httpClientConfigurati... | [
"public",
"HTTPResponse",
"submitHTTPRequest",
"(",
"HTTPRequest",
"httpRequest",
",",
"HTTPClientConfiguration",
"httpClientConfiguration",
",",
"HTTPMethod",
"httpMethod",
")",
"{",
"//create HTTP client",
"HttpClient",
"httpClient",
"=",
"this",
".",
"createHttpClient",
... | Submits the HTTP request and returns the HTTP response.
@param httpRequest
The HTTP request to send
@param httpClientConfiguration
HTTP client configuration
@param httpMethod
The HTTP method to use
@return The HTTP response | [
"Submits",
"the",
"HTTP",
"request",
"and",
"returns",
"the",
"HTTP",
"response",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/ApacheHTTPClient.java#L441-L504 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java | JobsInner.beginCreate | public JobInner beginCreate(String resourceGroupName, String workspaceName, String experimentName, String jobName, JobCreateParameters parameters) {
"""
Creates a Job in the given Experiment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the... | java | public JobInner beginCreate(String resourceGroupName, String workspaceName, String experimentName, String jobName, JobCreateParameters parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName, jobName, parameters).toBlocking().single().body();
} | [
"public",
"JobInner",
"beginCreate",
"(",
"String",
"resourceGroupName",
",",
"String",
"workspaceName",
",",
"String",
"experimentName",
",",
"String",
"jobName",
",",
"JobCreateParameters",
"parameters",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(",
... | Creates a Job in the given Experiment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 ... | [
"Creates",
"a",
"Job",
"in",
"the",
"given",
"Experiment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java#L493-L495 |
knowm/XChange | xchange-mercadobitcoin/src/main/java/org/knowm/xchange/mercadobitcoin/MercadoBitcoinAdapters.java | MercadoBitcoinAdapters.adaptOrderBook | public static OrderBook adaptOrderBook(
MercadoBitcoinOrderBook mercadoBitcoinOrderBook, CurrencyPair currencyPair) {
"""
Adapts a org.knowm.xchange.mercadobitcoin.dto.marketdata.OrderBook to a OrderBook Object
@param currencyPair (e.g. BTC/BRL or LTC/BRL)
@return The XChange OrderBook
"""
List<... | java | public static OrderBook adaptOrderBook(
MercadoBitcoinOrderBook mercadoBitcoinOrderBook, CurrencyPair currencyPair) {
List<LimitOrder> asks =
createOrders(currencyPair, OrderType.ASK, mercadoBitcoinOrderBook.getAsks());
List<LimitOrder> bids =
createOrders(currencyPair, OrderType.BID, mer... | [
"public",
"static",
"OrderBook",
"adaptOrderBook",
"(",
"MercadoBitcoinOrderBook",
"mercadoBitcoinOrderBook",
",",
"CurrencyPair",
"currencyPair",
")",
"{",
"List",
"<",
"LimitOrder",
">",
"asks",
"=",
"createOrders",
"(",
"currencyPair",
",",
"OrderType",
".",
"ASK",... | Adapts a org.knowm.xchange.mercadobitcoin.dto.marketdata.OrderBook to a OrderBook Object
@param currencyPair (e.g. BTC/BRL or LTC/BRL)
@return The XChange OrderBook | [
"Adapts",
"a",
"org",
".",
"knowm",
".",
"xchange",
".",
"mercadobitcoin",
".",
"dto",
".",
"marketdata",
".",
"OrderBook",
"to",
"a",
"OrderBook",
"Object"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-mercadobitcoin/src/main/java/org/knowm/xchange/mercadobitcoin/MercadoBitcoinAdapters.java#L51-L59 |
mikepenz/FastAdapter | app/src/main/java/com/mikepenz/fastadapter/app/SortActivity.java | SortActivity.makeItem | private SimpleItem makeItem(@IntRange(from = 0, to = 25) int position) {
"""
Build a simple item with one letter of the alphabet.
@param position The position of the letter in the alphabet.
@return The new item.
"""
SimpleItem result = new SimpleItem();
result.withName(ALPHABET[position]);... | java | private SimpleItem makeItem(@IntRange(from = 0, to = 25) int position) {
SimpleItem result = new SimpleItem();
result.withName(ALPHABET[position]);
position++;
String description = "The " + (position);
if (position == 1 || position == 21) {
description += "st";
... | [
"private",
"SimpleItem",
"makeItem",
"(",
"@",
"IntRange",
"(",
"from",
"=",
"0",
",",
"to",
"=",
"25",
")",
"int",
"position",
")",
"{",
"SimpleItem",
"result",
"=",
"new",
"SimpleItem",
"(",
")",
";",
"result",
".",
"withName",
"(",
"ALPHABET",
"[",
... | Build a simple item with one letter of the alphabet.
@param position The position of the letter in the alphabet.
@return The new item. | [
"Build",
"a",
"simple",
"item",
"with",
"one",
"letter",
"of",
"the",
"alphabet",
"."
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/app/src/main/java/com/mikepenz/fastadapter/app/SortActivity.java#L228-L248 |
raydac/java-comment-preprocessor | jcp/src/main/java/com/igormaznitsa/meta/common/exceptions/MetaErrorListeners.java | MetaErrorListeners.fireError | @Weight(Weight.Unit.VARIABLE)
public static void fireError(@Nonnull final String text, @Nonnull final Throwable error) {
"""
Send notifications to all listeners.
@param text message text
@param error error object
@since 1.0
"""
for (final MetaErrorListener p : ERROR_LISTENERS) {
p.onDetectedE... | java | @Weight(Weight.Unit.VARIABLE)
public static void fireError(@Nonnull final String text, @Nonnull final Throwable error) {
for (final MetaErrorListener p : ERROR_LISTENERS) {
p.onDetectedError(text, error);
}
} | [
"@",
"Weight",
"(",
"Weight",
".",
"Unit",
".",
"VARIABLE",
")",
"public",
"static",
"void",
"fireError",
"(",
"@",
"Nonnull",
"final",
"String",
"text",
",",
"@",
"Nonnull",
"final",
"Throwable",
"error",
")",
"{",
"for",
"(",
"final",
"MetaErrorListener"... | Send notifications to all listeners.
@param text message text
@param error error object
@since 1.0 | [
"Send",
"notifications",
"to",
"all",
"listeners",
"."
] | train | https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/meta/common/exceptions/MetaErrorListeners.java#L92-L97 |
google/closure-compiler | src/com/google/javascript/jscomp/AstFactory.java | AstFactory.createGetProps | private Node createGetProps(Node receiver, Iterable<String> propertyNames) {
"""
Creates a tree of nodes representing `receiver.name1.name2.etc`.
"""
Node result = receiver;
for (String propertyName : propertyNames) {
result = createGetProp(result, propertyName);
}
return result;
} | java | private Node createGetProps(Node receiver, Iterable<String> propertyNames) {
Node result = receiver;
for (String propertyName : propertyNames) {
result = createGetProp(result, propertyName);
}
return result;
} | [
"private",
"Node",
"createGetProps",
"(",
"Node",
"receiver",
",",
"Iterable",
"<",
"String",
">",
"propertyNames",
")",
"{",
"Node",
"result",
"=",
"receiver",
";",
"for",
"(",
"String",
"propertyName",
":",
"propertyNames",
")",
"{",
"result",
"=",
"create... | Creates a tree of nodes representing `receiver.name1.name2.etc`. | [
"Creates",
"a",
"tree",
"of",
"nodes",
"representing",
"receiver",
".",
"name1",
".",
"name2",
".",
"etc",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AstFactory.java#L407-L413 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.email_pro_service_account_duration_GET | public OvhOrder email_pro_service_account_duration_GET(String service, String duration, Long number) throws IOException {
"""
Get prices and contracts information
REST: GET /order/email/pro/{service}/account/{duration}
@param number [required] Number of Accounts to order
@param service [required] The internal... | java | public OvhOrder email_pro_service_account_duration_GET(String service, String duration, Long number) throws IOException {
String qPath = "/order/email/pro/{service}/account/{duration}";
StringBuilder sb = path(qPath, service, duration);
query(sb, "number", number);
String resp = exec(qPath, "GET", sb.toString()... | [
"public",
"OvhOrder",
"email_pro_service_account_duration_GET",
"(",
"String",
"service",
",",
"String",
"duration",
",",
"Long",
"number",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/email/pro/{service}/account/{duration}\"",
";",
"StringBuilder",
... | Get prices and contracts information
REST: GET /order/email/pro/{service}/account/{duration}
@param number [required] Number of Accounts to order
@param service [required] The internal name of your pro organization
@param duration [required] Duration | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L4046-L4052 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/temporal/ValueRange.java | ValueRange.checkValidValue | public long checkValidValue(long value, TemporalField field) {
"""
Checks that the specified value is valid.
<p>
This validates that the value is within the valid range of values.
The field is only used to improve the error message.
@param value the value to check
@param field the field being checked, may... | java | public long checkValidValue(long value, TemporalField field) {
if (isValidValue(value) == false) {
if (field != null) {
throw new DateTimeException("Invalid value for " + field + " (valid values " + this + "): " + value);
} else {
throw new DateTimeExcepti... | [
"public",
"long",
"checkValidValue",
"(",
"long",
"value",
",",
"TemporalField",
"field",
")",
"{",
"if",
"(",
"isValidValue",
"(",
"value",
")",
"==",
"false",
")",
"{",
"if",
"(",
"field",
"!=",
"null",
")",
"{",
"throw",
"new",
"DateTimeException",
"(... | Checks that the specified value is valid.
<p>
This validates that the value is within the valid range of values.
The field is only used to improve the error message.
@param value the value to check
@param field the field being checked, may be null
@return the value that was passed in
@see #isValidValue(long) | [
"Checks",
"that",
"the",
"specified",
"value",
"is",
"valid",
".",
"<p",
">",
"This",
"validates",
"that",
"the",
"value",
"is",
"within",
"the",
"valid",
"range",
"of",
"values",
".",
"The",
"field",
"is",
"only",
"used",
"to",
"improve",
"the",
"error"... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/temporal/ValueRange.java#L275-L284 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/core/ServerConfig.java | ServerConfig.setScalarParam | private static void setScalarParam(String name, Object value) throws ConfigurationException {
"""
Return false if given name is not a known scalar configuration parameter
"""
try {
Field field = config.getClass().getDeclaredField(name);
field.set(config, value);
} ca... | java | private static void setScalarParam(String name, Object value) throws ConfigurationException {
try {
Field field = config.getClass().getDeclaredField(name);
field.set(config, value);
} catch (SecurityException | NoSuchFieldException | IllegalAccessException e) {
t... | [
"private",
"static",
"void",
"setScalarParam",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"throws",
"ConfigurationException",
"{",
"try",
"{",
"Field",
"field",
"=",
"config",
".",
"getClass",
"(",
")",
".",
"getDeclaredField",
"(",
"name",
")",
";"... | Return false if given name is not a known scalar configuration parameter | [
"Return",
"false",
"if",
"given",
"name",
"is",
"not",
"a",
"known",
"scalar",
"configuration",
"parameter"
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/core/ServerConfig.java#L433-L442 |
steveash/jopenfst | src/main/java/com/github/steveash/jopenfst/semiring/UnionSemiring.java | UnionSemiring.makeForOrdering | public static <W, S extends GenericSemiring<W>> UnionSemiring<W, S> makeForOrdering(S weightSemiring,
Ordering<W> ordering,
MergeStrategy<W> merge) ... | java | public static <W, S extends GenericSemiring<W>> UnionSemiring<W, S> makeForOrdering(S weightSemiring,
Ordering<W> ordering,
MergeStrategy<W> merge) ... | [
"public",
"static",
"<",
"W",
",",
"S",
"extends",
"GenericSemiring",
"<",
"W",
">",
">",
"UnionSemiring",
"<",
"W",
",",
"S",
">",
"makeForOrdering",
"(",
"S",
"weightSemiring",
",",
"Ordering",
"<",
"W",
">",
"ordering",
",",
"MergeStrategy",
"<",
"W",... | Creates a new union semirng for the given underlying weight semiring and ordering
@param weightSemiring underlying weight semiring
@param ordering the ordering to govern elements in the union set; note that when ordering indicates that two
elements are equal, that is when the merge strategy will be called to mer... | [
"Creates",
"a",
"new",
"union",
"semirng",
"for",
"the",
"given",
"underlying",
"weight",
"semiring",
"and",
"ordering"
] | train | https://github.com/steveash/jopenfst/blob/4c675203015c1cfad2072556cb532b6edc73261d/src/main/java/com/github/steveash/jopenfst/semiring/UnionSemiring.java#L84-L88 |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/VectorPackingPropagator.java | VectorPackingPropagator.filterLoadSup | protected boolean filterLoadSup(int dim, int bin, int newLoadSup) throws ContradictionException {
"""
update sup(binLoad) and sumLoadSup accordingly
@param dim the dimension
@param bin the bin
@param newLoadSup the new lower bound value
@return if the upper bound has actually been updated
@thr... | java | protected boolean filterLoadSup(int dim, int bin, int newLoadSup) throws ContradictionException {
int delta = newLoadSup - loads[dim][bin].getUB();
if (delta >= 0) {
return false;
}
loads[dim][bin].updateUpperBound(newLoadSup, this);
if (sumISizes[dim] > sumLoad... | [
"protected",
"boolean",
"filterLoadSup",
"(",
"int",
"dim",
",",
"int",
"bin",
",",
"int",
"newLoadSup",
")",
"throws",
"ContradictionException",
"{",
"int",
"delta",
"=",
"newLoadSup",
"-",
"loads",
"[",
"dim",
"]",
"[",
"bin",
"]",
".",
"getUB",
"(",
"... | update sup(binLoad) and sumLoadSup accordingly
@param dim the dimension
@param bin the bin
@param newLoadSup the new lower bound value
@return if the upper bound has actually been updated
@throws ContradictionException if the domain of the bin load variable becomes empty | [
"update",
"sup",
"(",
"binLoad",
")",
"and",
"sumLoadSup",
"accordingly"
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/VectorPackingPropagator.java#L286-L296 |
taskadapter/redmine-java-api | src/main/java/com/taskadapter/redmineapi/AttachmentManager.java | AttachmentManager.uploadAttachment | public Attachment uploadAttachment(String fileName, String contentType,
InputStream content) throws RedmineException, IOException {
"""
Uploads an attachment.
@param fileName
file name of the attachment.
@param contentType
content type of the attachment.
@param content... | java | public Attachment uploadAttachment(String fileName, String contentType,
InputStream content) throws RedmineException, IOException {
return uploadAttachment(fileName, contentType, content, -1);
} | [
"public",
"Attachment",
"uploadAttachment",
"(",
"String",
"fileName",
",",
"String",
"contentType",
",",
"InputStream",
"content",
")",
"throws",
"RedmineException",
",",
"IOException",
"{",
"return",
"uploadAttachment",
"(",
"fileName",
",",
"contentType",
",",
"c... | Uploads an attachment.
@param fileName
file name of the attachment.
@param contentType
content type of the attachment.
@param content
attachment content stream.
@return attachment content.
@throws RedmineException if something goes wrong.
@throws IOException
if input cannot be read. This exception cannot be thrown yet... | [
"Uploads",
"an",
"attachment",
"."
] | train | https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/AttachmentManager.java#L126-L129 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/managers/GuildController.java | GuildController.transferOwnership | @CheckReturnValue
public AuditableRestAction<Void> transferOwnership(Member newOwner) {
"""
Transfers the Guild ownership to the specified {@link net.dv8tion.jda.core.entities.Member Member}
<br>Only available if the currently logged in account is the owner of this Guild
<p>Possible {@link net.dv8tion.jda.... | java | @CheckReturnValue
public AuditableRestAction<Void> transferOwnership(Member newOwner)
{
Checks.notNull(newOwner, "Member");
checkGuild(newOwner.getGuild(), "Member");
if (!getGuild().getOwner().equals(getGuild().getSelfMember()))
throw new PermissionException("The logged in a... | [
"@",
"CheckReturnValue",
"public",
"AuditableRestAction",
"<",
"Void",
">",
"transferOwnership",
"(",
"Member",
"newOwner",
")",
"{",
"Checks",
".",
"notNull",
"(",
"newOwner",
",",
"\"Member\"",
")",
";",
"checkGuild",
"(",
"newOwner",
".",
"getGuild",
"(",
"... | Transfers the Guild ownership to the specified {@link net.dv8tion.jda.core.entities.Member Member}
<br>Only available if the currently logged in account is the owner of this Guild
<p>Possible {@link net.dv8tion.jda.core.requests.ErrorResponse ErrorResponses} caused by
the returned {@link net.dv8tion.jda.core.requests.... | [
"Transfers",
"the",
"Guild",
"ownership",
"to",
"the",
"specified",
"{",
"@link",
"net",
".",
"dv8tion",
".",
"jda",
".",
"core",
".",
"entities",
".",
"Member",
"Member",
"}",
"<br",
">",
"Only",
"available",
"if",
"the",
"currently",
"logged",
"in",
"a... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/managers/GuildController.java#L1706-L1732 |
linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/AnnotationId.java | AnnotationId.addToMethod | public void addToMethod(DexMaker dexMaker, MethodId<?, ?> method) {
"""
Add this annotation to a method.
@param dexMaker DexMaker instance.
@param method Method to be added to.
"""
if (annotatedElement != ElementType.METHOD) {
throw new IllegalStateException("This annotation is not for ... | java | public void addToMethod(DexMaker dexMaker, MethodId<?, ?> method) {
if (annotatedElement != ElementType.METHOD) {
throw new IllegalStateException("This annotation is not for method");
}
if (!method.declaringType.equals(declaringType)) {
throw new IllegalArgumentException... | [
"public",
"void",
"addToMethod",
"(",
"DexMaker",
"dexMaker",
",",
"MethodId",
"<",
"?",
",",
"?",
">",
"method",
")",
"{",
"if",
"(",
"annotatedElement",
"!=",
"ElementType",
".",
"METHOD",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"This ann... | Add this annotation to a method.
@param dexMaker DexMaker instance.
@param method Method to be added to. | [
"Add",
"this",
"annotation",
"to",
"a",
"method",
"."
] | train | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/AnnotationId.java#L128-L162 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/user/UserDao.java | UserDao.selectByUuids | public List<UserDto> selectByUuids(DbSession session, Collection<String> uuids) {
"""
Select users by uuids, including disabled users. An empty list is returned
if list of uuids is empty, without any db round trips.
"""
return executeLargeInputs(uuids, mapper(session)::selectByUuids);
} | java | public List<UserDto> selectByUuids(DbSession session, Collection<String> uuids) {
return executeLargeInputs(uuids, mapper(session)::selectByUuids);
} | [
"public",
"List",
"<",
"UserDto",
">",
"selectByUuids",
"(",
"DbSession",
"session",
",",
"Collection",
"<",
"String",
">",
"uuids",
")",
"{",
"return",
"executeLargeInputs",
"(",
"uuids",
",",
"mapper",
"(",
"session",
")",
"::",
"selectByUuids",
")",
";",
... | Select users by uuids, including disabled users. An empty list is returned
if list of uuids is empty, without any db round trips. | [
"Select",
"users",
"by",
"uuids",
"including",
"disabled",
"users",
".",
"An",
"empty",
"list",
"is",
"returned",
"if",
"list",
"of",
"uuids",
"is",
"empty",
"without",
"any",
"db",
"round",
"trips",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/user/UserDao.java#L93-L95 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/api/API.java | API.getCallBackUrl | public String getCallBackUrl(ApiImplementor impl, String site) {
"""
Gets (and registers) a new callback URL for the given implementor and site.
@param impl the implementor that will handle the callback.
@param site the site that will call the callback.
@return the callback URL.
@since 2.0.0
@see #removeCal... | java | public String getCallBackUrl(ApiImplementor impl, String site) {
String url = site + CALL_BACK_URL + random.nextLong();
this.callBacks.put(url, impl);
logger.debug("Callback " + url + " registered for " + impl.getClass().getCanonicalName());
return url;
} | [
"public",
"String",
"getCallBackUrl",
"(",
"ApiImplementor",
"impl",
",",
"String",
"site",
")",
"{",
"String",
"url",
"=",
"site",
"+",
"CALL_BACK_URL",
"+",
"random",
".",
"nextLong",
"(",
")",
";",
"this",
".",
"callBacks",
".",
"put",
"(",
"url",
","... | Gets (and registers) a new callback URL for the given implementor and site.
@param impl the implementor that will handle the callback.
@param site the site that will call the callback.
@return the callback URL.
@since 2.0.0
@see #removeCallBackUrl(String)
@see #removeCallBackUrls(ApiImplementor)
@see #removeApiImpleme... | [
"Gets",
"(",
"and",
"registers",
")",
"a",
"new",
"callback",
"URL",
"for",
"the",
"given",
"implementor",
"and",
"site",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/api/API.java#L784-L789 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java | GVRPose.calcLocal | protected void calcLocal(Bone bone, int parentId) {
"""
Calculates the local translation and rotation for a bone.
Assumes WorldRot and WorldPos have been calculated for the bone.
"""
if (parentId < 0)
{
bone.LocalMatrix.set(bone.WorldMatrix);
return;
}
/*
* ... | java | protected void calcLocal(Bone bone, int parentId)
{
if (parentId < 0)
{
bone.LocalMatrix.set(bone.WorldMatrix);
return;
}
/*
* WorldMatrix = WorldMatrix(parent) * LocalMatrix
* LocalMatrix = INVERSE[ WorldMatrix(parent) ] * WorldMatrix
*/
getWorldMatri... | [
"protected",
"void",
"calcLocal",
"(",
"Bone",
"bone",
",",
"int",
"parentId",
")",
"{",
"if",
"(",
"parentId",
"<",
"0",
")",
"{",
"bone",
".",
"LocalMatrix",
".",
"set",
"(",
"bone",
".",
"WorldMatrix",
")",
";",
"return",
";",
"}",
"/*\n\t * WorldMa... | Calculates the local translation and rotation for a bone.
Assumes WorldRot and WorldPos have been calculated for the bone. | [
"Calculates",
"the",
"local",
"translation",
"and",
"rotation",
"for",
"a",
"bone",
".",
"Assumes",
"WorldRot",
"and",
"WorldPos",
"have",
"been",
"calculated",
"for",
"the",
"bone",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java#L957-L971 |
liferay/com-liferay-commerce | commerce-api/src/main/java/com/liferay/commerce/service/persistence/CPDAvailabilityEstimateUtil.java | CPDAvailabilityEstimateUtil.findByUUID_G | public static CPDAvailabilityEstimate findByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.exception.NoSuchCPDAvailabilityEstimateException {
"""
Returns the cpd availability estimate where uuid = ? and groupId = ? or throws a {@link NoSuchCPDAvailabilityEstimateException} if it could not ... | java | public static CPDAvailabilityEstimate findByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.exception.NoSuchCPDAvailabilityEstimateException {
return getPersistence().findByUUID_G(uuid, groupId);
} | [
"public",
"static",
"CPDAvailabilityEstimate",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"exception",
".",
"NoSuchCPDAvailabilityEstimateException",
"{",
"return",
"getPersistence",
"(",
... | Returns the cpd availability estimate where uuid = ? and groupId = ? or throws a {@link NoSuchCPDAvailabilityEstimateException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching cpd availability estimate
@throws NoSuchCPDAvailabilityEstimateException if a matching ... | [
"Returns",
"the",
"cpd",
"availability",
"estimate",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPDAvailabilityEstimateException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-api/src/main/java/com/liferay/commerce/service/persistence/CPDAvailabilityEstimateUtil.java#L284-L287 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/MapperFactory.java | MapperFactory.createMapper | private Mapper createMapper(ParameterizedType type) {
"""
Creates a {@link Mapper} for the given class/type.
@param type
the type
@return a {@link Mapper} for the given class/type.
"""
Type rawType = type.getRawType();
if (!(rawType instanceof Class)) {
// Don't see how this could ever happe... | java | private Mapper createMapper(ParameterizedType type) {
Type rawType = type.getRawType();
if (!(rawType instanceof Class)) {
// Don't see how this could ever happen, but just in case...
throw new IllegalArgumentException(
String.format("Raw type of ParameterizedType is not a class: %s", type... | [
"private",
"Mapper",
"createMapper",
"(",
"ParameterizedType",
"type",
")",
"{",
"Type",
"rawType",
"=",
"type",
".",
"getRawType",
"(",
")",
";",
"if",
"(",
"!",
"(",
"rawType",
"instanceof",
"Class",
")",
")",
"{",
"// Don't see how this could ever happen, but... | Creates a {@link Mapper} for the given class/type.
@param type
the type
@return a {@link Mapper} for the given class/type. | [
"Creates",
"a",
"{",
"@link",
"Mapper",
"}",
"for",
"the",
"given",
"class",
"/",
"type",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/MapperFactory.java#L230-L245 |
ixa-ehu/ixa-pipe-ml | src/main/java/eus/ixa/ixa/pipe/ml/tok/RuleBasedTokenizer.java | RuleBasedTokenizer.addTokens | private void addTokens(final Token curToken, final List<Token> tokens) {
"""
Add tokens if certain conditions are met.
@param curToken
the token to be added
@param tokens
the list of tokens
"""
if (curToken.tokenLength() != 0) {
if (this.unTokenizable) {
tokens.add(curToken);
} el... | java | private void addTokens(final Token curToken, final List<Token> tokens) {
if (curToken.tokenLength() != 0) {
if (this.unTokenizable) {
tokens.add(curToken);
} else if (!this.unTokenizable) {
if (!replacement.matcher(curToken.getTokenValue()).matches()) {
tokens.add(curToken);
... | [
"private",
"void",
"addTokens",
"(",
"final",
"Token",
"curToken",
",",
"final",
"List",
"<",
"Token",
">",
"tokens",
")",
"{",
"if",
"(",
"curToken",
".",
"tokenLength",
"(",
")",
"!=",
"0",
")",
"{",
"if",
"(",
"this",
".",
"unTokenizable",
")",
"{... | Add tokens if certain conditions are met.
@param curToken
the token to be added
@param tokens
the list of tokens | [
"Add",
"tokens",
"if",
"certain",
"conditions",
"are",
"met",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/tok/RuleBasedTokenizer.java#L420-L430 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.