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 |
|---|---|---|---|---|---|---|---|---|---|---|
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java | PAbstractObject.getFloat | @Override
public final float getFloat(final String key) {
"""
Get a property as a float or throw an exception.
@param key the property name
"""
Float result = optFloat(key);
if (result == null) {
throw new ObjectMissingException(this, key);
}
return result;
... | java | @Override
public final float getFloat(final String key) {
Float result = optFloat(key);
if (result == null) {
throw new ObjectMissingException(this, key);
}
return result;
} | [
"@",
"Override",
"public",
"final",
"float",
"getFloat",
"(",
"final",
"String",
"key",
")",
"{",
"Float",
"result",
"=",
"optFloat",
"(",
"key",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"throw",
"new",
"ObjectMissingException",
"(",
"this"... | Get a property as a float or throw an exception.
@param key the property name | [
"Get",
"a",
"property",
"as",
"a",
"float",
"or",
"throw",
"an",
"exception",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java#L128-L135 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.openapi/src/com/ibm/ws/microprofile/openapi/impl/core/jackson/JAXBAnnotationsHelper.java | JAXBAnnotationsHelper.applyElement | private static void applyElement(Annotated member, Schema property) {
"""
Puts definitions for XML element.
@param member annotations provider
@param property property instance to be updated
"""
final XmlElementWrapper wrapper = member.getAnnotation(XmlElementWrapper.class);
if (wrapper != ... | java | private static void applyElement(Annotated member, Schema property) {
final XmlElementWrapper wrapper = member.getAnnotation(XmlElementWrapper.class);
if (wrapper != null) {
final XML xml = getXml(property);
xml.setWrapped(true);
// No need to set the xml name if the ... | [
"private",
"static",
"void",
"applyElement",
"(",
"Annotated",
"member",
",",
"Schema",
"property",
")",
"{",
"final",
"XmlElementWrapper",
"wrapper",
"=",
"member",
".",
"getAnnotation",
"(",
"XmlElementWrapper",
".",
"class",
")",
";",
"if",
"(",
"wrapper",
... | Puts definitions for XML element.
@param member annotations provider
@param property property instance to be updated | [
"Puts",
"definitions",
"for",
"XML",
"element",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.openapi/src/com/ibm/ws/microprofile/openapi/impl/core/jackson/JAXBAnnotationsHelper.java#L55-L70 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java | NetworkInterfacesInner.getEffectiveRouteTableAsync | public Observable<EffectiveRouteListResultInner> getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) {
"""
Gets all route tables applied to a network interface.
@param resourceGroupName The name of the resource group.
@param networkInterfaceName The name of the network interface.... | java | public Observable<EffectiveRouteListResultInner> getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) {
return getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1<ServiceResponse<EffectiveRouteListResultInner>, EffectiveRouteListRes... | [
"public",
"Observable",
"<",
"EffectiveRouteListResultInner",
">",
"getEffectiveRouteTableAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkInterfaceName",
")",
"{",
"return",
"getEffectiveRouteTableWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"net... | Gets all route tables applied to a network interface.
@param resourceGroupName The name of the resource group.
@param networkInterfaceName The name of the network interface.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Gets",
"all",
"route",
"tables",
"applied",
"to",
"a",
"network",
"interface",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java#L1217-L1224 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseLambdaConstant | private Expr parseLambdaConstant(EnclosingScope scope, boolean terminated) {
"""
Parse an address expression, which has the form:
<pre>
TermExpr::= ...
| '&' Identifier [ '(' Type (',' Type)* ')']
</pre>
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. decla... | java | private Expr parseLambdaConstant(EnclosingScope scope, boolean terminated) {
int start = index;
match(Ampersand);
Name name = parseName(scope);
Tuple<Type> parameters;
// Check whether or not parameters are supplied
if (tryAndMatch(terminated, LeftBrace) != null) {
// Yes, parameters are supplied!
Arr... | [
"private",
"Expr",
"parseLambdaConstant",
"(",
"EnclosingScope",
"scope",
",",
"boolean",
"terminated",
")",
"{",
"int",
"start",
"=",
"index",
";",
"match",
"(",
"Ampersand",
")",
";",
"Name",
"name",
"=",
"parseName",
"(",
"scope",
")",
";",
"Tuple",
"<"... | Parse an address expression, which has the form:
<pre>
TermExpr::= ...
| '&' Identifier [ '(' Type (',' Type)* ')']
</pre>
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@param terminated
This indicates that th... | [
"Parse",
"an",
"address",
"expression",
"which",
"has",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L3217-L3244 |
Chorus-bdd/Chorus | interpreter/chorus-pathscanner/src/main/java/org/chorusbdd/chorus/pathscanner/filter/ClassFilterDecorator.java | ClassFilterDecorator.decorateWithPackageNameFilters | public ClassFilter decorateWithPackageNameFilters(ClassFilter filterToDecorate, List<String> userSpecifiedPrefixes) {
"""
@return a ClassFilter chain to use when discovering Handler classes in the classpath
@param filterToDecorate this filter will be decorated with extra rules to check package names
@param use... | java | public ClassFilter decorateWithPackageNameFilters(ClassFilter filterToDecorate, List<String> userSpecifiedPrefixes) {
DenyAllPackageNames denyAllPackageNames = new DenyAllPackageNames(filterToDecorate);
//if user has specified package prefixes, restrict to those
ClassFilter packagePrefixFilter ... | [
"public",
"ClassFilter",
"decorateWithPackageNameFilters",
"(",
"ClassFilter",
"filterToDecorate",
",",
"List",
"<",
"String",
">",
"userSpecifiedPrefixes",
")",
"{",
"DenyAllPackageNames",
"denyAllPackageNames",
"=",
"new",
"DenyAllPackageNames",
"(",
"filterToDecorate",
"... | @return a ClassFilter chain to use when discovering Handler classes in the classpath
@param filterToDecorate this filter will be decorated with extra rules to check package names
@param userSpecifiedPrefixes any handler package prefixes specified by user | [
"@return",
"a",
"ClassFilter",
"chain",
"to",
"use",
"when",
"discovering",
"Handler",
"classes",
"in",
"the",
"classpath"
] | train | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-pathscanner/src/main/java/org/chorusbdd/chorus/pathscanner/filter/ClassFilterDecorator.java#L55-L63 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoImages.java | DaoImages.getImagesList | public static List<Image> getImagesList( IHMConnection connection ) throws Exception {
"""
Get the list of Images from the db.
@return list of notes.
@throws IOException if something goes wrong.
"""
List<Image> images = new ArrayList<Image>();
String sql = "select " + //
I... | java | public static List<Image> getImagesList( IHMConnection connection ) throws Exception {
List<Image> images = new ArrayList<Image>();
String sql = "select " + //
ImageTableFields.COLUMN_ID.getFieldName() + "," + //
ImageTableFields.COLUMN_LON.getFieldName() + "," + //
... | [
"public",
"static",
"List",
"<",
"Image",
">",
"getImagesList",
"(",
"IHMConnection",
"connection",
")",
"throws",
"Exception",
"{",
"List",
"<",
"Image",
">",
"images",
"=",
"new",
"ArrayList",
"<",
"Image",
">",
"(",
")",
";",
"String",
"sql",
"=",
"\"... | Get the list of Images from the db.
@return list of notes.
@throws IOException if something goes wrong. | [
"Get",
"the",
"list",
"of",
"Images",
"from",
"the",
"db",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoImages.java#L205-L238 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/http/MultiPartFaxJob2HTTPRequestConverter.java | MultiPartFaxJob2HTTPRequestConverter.addContentPart | protected final void addContentPart(List<ContentPart<?>> contentList,String key,String value) {
"""
This function adds a string content part
@param contentList
The content list with all the created parts
@param key
The parameter key
@param value
The parameter value
"""
if((key!=null)&&(va... | java | protected final void addContentPart(List<ContentPart<?>> contentList,String key,String value)
{
if((key!=null)&&(value!=null)&&(value.length()>0))
{
if(this.shouldAddContentPart(key))
{
contentList.add(new ContentPart<String>(key,value,ContentPartType.STRING))... | [
"protected",
"final",
"void",
"addContentPart",
"(",
"List",
"<",
"ContentPart",
"<",
"?",
">",
">",
"contentList",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"(",
"key",
"!=",
"null",
")",
"&&",
"(",
"value",
"!=",
"null",
")... | This function adds a string content part
@param contentList
The content list with all the created parts
@param key
The parameter key
@param value
The parameter value | [
"This",
"function",
"adds",
"a",
"string",
"content",
"part"
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/MultiPartFaxJob2HTTPRequestConverter.java#L492-L501 |
graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/shapes/BBox.java | BBox.parseBBoxString | public static BBox parseBBoxString(String objectAsString) {
"""
This method creates a BBox out of a string in format lon1,lon2,lat1,lat2
"""
String[] splittedObject = objectAsString.split(",");
if (splittedObject.length != 4)
throw new IllegalArgumentException("BBox should have 4 p... | java | public static BBox parseBBoxString(String objectAsString) {
String[] splittedObject = objectAsString.split(",");
if (splittedObject.length != 4)
throw new IllegalArgumentException("BBox should have 4 parts but was " + objectAsString);
double minLon = Double.parseDouble(splittedObje... | [
"public",
"static",
"BBox",
"parseBBoxString",
"(",
"String",
"objectAsString",
")",
"{",
"String",
"[",
"]",
"splittedObject",
"=",
"objectAsString",
".",
"split",
"(",
"\",\"",
")",
";",
"if",
"(",
"splittedObject",
".",
"length",
"!=",
"4",
")",
"throw",
... | This method creates a BBox out of a string in format lon1,lon2,lat1,lat2 | [
"This",
"method",
"creates",
"a",
"BBox",
"out",
"of",
"a",
"string",
"in",
"format",
"lon1",
"lon2",
"lat1",
"lat2"
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/shapes/BBox.java#L334-L347 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/face/AipFace.java | AipFace.videoSessioncode | public JSONObject videoSessioncode(HashMap<String, String> options) {
"""
语音校验码接口接口
@param options - 可选参数对象,key: value都为string类型
options - options列表:
appid 百度云创建应用时的唯一标识ID
@return JSONObject
"""
AipRequest request = new AipRequest();
preOperation(request);
if (options != null) {
... | java | public JSONObject videoSessioncode(HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
if (options != null) {
request.addBody(options);
}
request.setUri(FaceConsts.VIDEO_SESSIONCODE);
request.setBodyFormat(EBodyForm... | [
"public",
"JSONObject",
"videoSessioncode",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"if",
"(",
"options",
"!=",
"nul... | 语音校验码接口接口
@param options - 可选参数对象,key: value都为string类型
options - options列表:
appid 百度云创建应用时的唯一标识ID
@return JSONObject | [
"语音校验码接口接口"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/face/AipFace.java#L420-L430 |
Whiley/WhileyCompiler | src/main/java/wyil/interpreter/Interpreter.java | Interpreter.executeAssert | private Status executeAssert(Stmt.Assert stmt, CallStack frame, EnclosingScope scope) {
"""
Execute an assert or assume statement. In both cases, if the condition
evaluates to false an exception is thrown.
@param stmt
--- Assert statement.
@param frame
--- The current stack frame
@return
"""
//
che... | java | private Status executeAssert(Stmt.Assert stmt, CallStack frame, EnclosingScope scope) {
//
checkInvariants(frame,stmt.getCondition());
return Status.NEXT;
} | [
"private",
"Status",
"executeAssert",
"(",
"Stmt",
".",
"Assert",
"stmt",
",",
"CallStack",
"frame",
",",
"EnclosingScope",
"scope",
")",
"{",
"//",
"checkInvariants",
"(",
"frame",
",",
"stmt",
".",
"getCondition",
"(",
")",
")",
";",
"return",
"Status",
... | Execute an assert or assume statement. In both cases, if the condition
evaluates to false an exception is thrown.
@param stmt
--- Assert statement.
@param frame
--- The current stack frame
@return | [
"Execute",
"an",
"assert",
"or",
"assume",
"statement",
".",
"In",
"both",
"cases",
"if",
"the",
"condition",
"evaluates",
"to",
"false",
"an",
"exception",
"is",
"thrown",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/interpreter/Interpreter.java#L250-L254 |
real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/Ir.java | Ir.addMessage | public void addMessage(final long messageId, final List<Token> messageTokens) {
"""
Add a List of {@link Token}s for a given message id.
@param messageId to identify the list of tokens for the message.
@param messageTokens the List of {@link Token}s representing the message.
"""
Verify.notNull(... | java | public void addMessage(final long messageId, final List<Token> messageTokens)
{
Verify.notNull(messageTokens, "messageTokens");
captureTypes(messageTokens, 0, messageTokens.size() - 1);
updateComponentTokenCounts(messageTokens);
messagesByIdMap.put(messageId, new ArrayList<>(messag... | [
"public",
"void",
"addMessage",
"(",
"final",
"long",
"messageId",
",",
"final",
"List",
"<",
"Token",
">",
"messageTokens",
")",
"{",
"Verify",
".",
"notNull",
"(",
"messageTokens",
",",
"\"messageTokens\"",
")",
";",
"captureTypes",
"(",
"messageTokens",
","... | Add a List of {@link Token}s for a given message id.
@param messageId to identify the list of tokens for the message.
@param messageTokens the List of {@link Token}s representing the message. | [
"Add",
"a",
"List",
"of",
"{",
"@link",
"Token",
"}",
"s",
"for",
"a",
"given",
"message",
"id",
"."
] | train | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/Ir.java#L104-L112 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/BoardingPassBuilder.java | BoardingPassBuilder.addSecondaryField | public BoardingPassBuilder addSecondaryField(String label, String value) {
"""
Adds a secondary field for the current {@link BoardingPass} object. This
field is optional. There can be at most 5 secondary fields per boarding
pass.
@param label
the label for the additional field. It can't be empty.
@param val... | java | public BoardingPassBuilder addSecondaryField(String label, String value) {
Field field = new Field(label, value);
this.boardingPass.addSecondaryField(field);
return this;
} | [
"public",
"BoardingPassBuilder",
"addSecondaryField",
"(",
"String",
"label",
",",
"String",
"value",
")",
"{",
"Field",
"field",
"=",
"new",
"Field",
"(",
"label",
",",
"value",
")",
";",
"this",
".",
"boardingPass",
".",
"addSecondaryField",
"(",
"field",
... | Adds a secondary field for the current {@link BoardingPass} object. This
field is optional. There can be at most 5 secondary fields per boarding
pass.
@param label
the label for the additional field. It can't be empty.
@param value
the value for the additional field. It can't be empty.
@return this builder. | [
"Adds",
"a",
"secondary",
"field",
"for",
"the",
"current",
"{",
"@link",
"BoardingPass",
"}",
"object",
".",
"This",
"field",
"is",
"optional",
".",
"There",
"can",
"be",
"at",
"most",
"5",
"secondary",
"fields",
"per",
"boarding",
"pass",
"."
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/BoardingPassBuilder.java#L146-L150 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/ResourceHealthMetadatasInner.java | ResourceHealthMetadatasInner.getBySiteAsync | public Observable<ResourceHealthMetadataInner> getBySiteAsync(String resourceGroupName, String name) {
"""
Gets the category of ResourceHealthMetadata to use for the given site.
Gets the category of ResourceHealthMetadata to use for the given site.
@param resourceGroupName Name of the resource group to which t... | java | public Observable<ResourceHealthMetadataInner> getBySiteAsync(String resourceGroupName, String name) {
return getBySiteWithServiceResponseAsync(resourceGroupName, name).map(new Func1<ServiceResponse<ResourceHealthMetadataInner>, ResourceHealthMetadataInner>() {
@Override
public ResourceH... | [
"public",
"Observable",
"<",
"ResourceHealthMetadataInner",
">",
"getBySiteAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
")",
"{",
"return",
"getBySiteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
")",
".",
"map",
"(",
"new",
... | Gets the category of ResourceHealthMetadata to use for the given site.
Gets the category of ResourceHealthMetadata to use for the given site.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of web app
@throws IllegalArgumentException thrown if parameters fail the val... | [
"Gets",
"the",
"category",
"of",
"ResourceHealthMetadata",
"to",
"use",
"for",
"the",
"given",
"site",
".",
"Gets",
"the",
"category",
"of",
"ResourceHealthMetadata",
"to",
"use",
"for",
"the",
"given",
"site",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/ResourceHealthMetadatasInner.java#L501-L508 |
craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.build | public String build( final File directory) throws NoSuchAlgorithmException, IOException {
"""
Generates an RPM with a standard name consisting of the RPM package name, version, release,
and type in the given directory.
@param directory the destination directory for the new RPM file.
@return the name of the rp... | java | public String build( final File directory) throws NoSuchAlgorithmException, IOException {
final String rpm = format.getLead().getName() + "." + format.getLead().getArch().toString().toLowerCase() + ".rpm";
final File file = new File( directory, rpm);
if ( file.exists()) file.delete();
RandomAccessFile raFile = ... | [
"public",
"String",
"build",
"(",
"final",
"File",
"directory",
")",
"throws",
"NoSuchAlgorithmException",
",",
"IOException",
"{",
"final",
"String",
"rpm",
"=",
"format",
".",
"getLead",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\".\"",
"+",
"format",
".... | Generates an RPM with a standard name consisting of the RPM package name, version, release,
and type in the given directory.
@param directory the destination directory for the new RPM file.
@return the name of the rpm
@throws NoSuchAlgorithmException the algorithm isn't supported
@throws IOException there was an IO er... | [
"Generates",
"an",
"RPM",
"with",
"a",
"standard",
"name",
"consisting",
"of",
"the",
"RPM",
"package",
"name",
"version",
"release",
"and",
"type",
"in",
"the",
"given",
"directory",
"."
] | train | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L1233-L1241 |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java | ID3v2Tag.parseFrames | private void parseFrames(RandomAccessInputStream raf) throws FileNotFoundException, IOException, ID3v2FormatException {
"""
Read the frames from the file and create ID3v2Frame objects from the
data found.
@param raf the open file to read from
@exception FileNotFoundException if an error occurs
@exception IOE... | java | private void parseFrames(RandomAccessInputStream raf) throws FileNotFoundException, IOException, ID3v2FormatException
{
int offset = head.getHeaderSize();
int framesLength = head.getTagSize();
if (head.getExtendedHeader())
{
framesLength -= ext_head.getSize();
offset += ext_head.getSize();
}
raf.se... | [
"private",
"void",
"parseFrames",
"(",
"RandomAccessInputStream",
"raf",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
",",
"ID3v2FormatException",
"{",
"int",
"offset",
"=",
"head",
".",
"getHeaderSize",
"(",
")",
";",
"int",
"framesLength",
"=",
"h... | Read the frames from the file and create ID3v2Frame objects from the
data found.
@param raf the open file to read from
@exception FileNotFoundException if an error occurs
@exception IOException if an error occurs
@exception ID3v2FormatException if an error occurs | [
"Read",
"the",
"frames",
"from",
"the",
"file",
"and",
"create",
"ID3v2Frame",
"objects",
"from",
"the",
"data",
"found",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java#L103-L141 |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java | JSONObject.accumulate | public JSONObject accumulate(String name, Object value) throws JSONException {
"""
Appends {@code value} to the array already mapped to {@code name}. If this object
has no mapping for {@code name}, this inserts a new mapping. If the mapping exists
but its value is not an array, the existing and new values are in... | java | public JSONObject accumulate(String name, Object value) throws JSONException {
Object current = this.nameValuePairs.get(checkName(name));
if (current == null) {
return put(name, value);
}
// check in accumulate, since array.put(Object) doesn't do any checking
if (value instanceof Number) {
JSON.checkDo... | [
"public",
"JSONObject",
"accumulate",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"throws",
"JSONException",
"{",
"Object",
"current",
"=",
"this",
".",
"nameValuePairs",
".",
"get",
"(",
"checkName",
"(",
"name",
")",
")",
";",
"if",
"(",
"current... | Appends {@code value} to the array already mapped to {@code name}. If this object
has no mapping for {@code name}, this inserts a new mapping. If the mapping exists
but its value is not an array, the existing and new values are inserted in order
into a new array which is itself mapped to {@code name}. In aggregate, thi... | [
"Appends",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java#L304-L326 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.getSessionSourceInfo | public GetSessionSourceInfoResponse getSessionSourceInfo(String sessionId) {
"""
Get your live session source info by live session id.
@param sessionId Live session id.
@return Your live session source info
"""
checkStringNotEmpty(sessionId, "The parameter sessionId should NOT be null or empty stri... | java | public GetSessionSourceInfoResponse getSessionSourceInfo(String sessionId) {
checkStringNotEmpty(sessionId, "The parameter sessionId should NOT be null or empty string.");
GetSessionSourceInfoRequest request = new GetSessionSourceInfoRequest();
InternalRequest internalRequest = createRequest(Htt... | [
"public",
"GetSessionSourceInfoResponse",
"getSessionSourceInfo",
"(",
"String",
"sessionId",
")",
"{",
"checkStringNotEmpty",
"(",
"sessionId",
",",
"\"The parameter sessionId should NOT be null or empty string.\"",
")",
";",
"GetSessionSourceInfoRequest",
"request",
"=",
"new",... | Get your live session source info by live session id.
@param sessionId Live session id.
@return Your live session source info | [
"Get",
"your",
"live",
"session",
"source",
"info",
"by",
"live",
"session",
"id",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L1076-L1082 |
rometools/rome | rome-certiorem/src/main/java/com/rometools/certiorem/pub/Publisher.java | Publisher.sendUpdateNotification | public void sendUpdateNotification(final String topic, final SyndFeed feed) throws NotificationException {
"""
Sends a notification for a feed located at "topic". The feed MUST contain rel="hub".
@param topic URL for the feed
@param feed The feed itself
@throws NotificationException Any failure
"""
... | java | public void sendUpdateNotification(final String topic, final SyndFeed feed) throws NotificationException {
for (final SyndLink link : feed.getLinks()) {
if ("hub".equals(link.getRel())) {
sendUpdateNotification(link.getRel(), topic);
return;
}
}
... | [
"public",
"void",
"sendUpdateNotification",
"(",
"final",
"String",
"topic",
",",
"final",
"SyndFeed",
"feed",
")",
"throws",
"NotificationException",
"{",
"for",
"(",
"final",
"SyndLink",
"link",
":",
"feed",
".",
"getLinks",
"(",
")",
")",
"{",
"if",
"(",
... | Sends a notification for a feed located at "topic". The feed MUST contain rel="hub".
@param topic URL for the feed
@param feed The feed itself
@throws NotificationException Any failure | [
"Sends",
"a",
"notification",
"for",
"a",
"feed",
"located",
"at",
"topic",
".",
"The",
"feed",
"MUST",
"contain",
"rel",
"=",
"hub",
"."
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-certiorem/src/main/java/com/rometools/certiorem/pub/Publisher.java#L106-L115 |
elki-project/elki | elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskUpperTriangleMatrix.java | OnDiskUpperTriangleMatrix.computeOffset | private int computeOffset(int x, int y) {
"""
Compute the offset within the file.
@param x First coordinate
@param y Second coordinate
@return Linear offset
"""
if(y > x) {
return computeOffset(y, x);
}
return ((x * (x + 1)) >> 1) + y;
} | java | private int computeOffset(int x, int y) {
if(y > x) {
return computeOffset(y, x);
}
return ((x * (x + 1)) >> 1) + y;
} | [
"private",
"int",
"computeOffset",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"y",
">",
"x",
")",
"{",
"return",
"computeOffset",
"(",
"y",
",",
"x",
")",
";",
"}",
"return",
"(",
"(",
"x",
"*",
"(",
"x",
"+",
"1",
")",
")",
">>... | Compute the offset within the file.
@param x First coordinate
@param y Second coordinate
@return Linear offset | [
"Compute",
"the",
"offset",
"within",
"the",
"file",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskUpperTriangleMatrix.java#L132-L137 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxTrash.java | BoxTrash.restoreFile | public BoxFile.Info restoreFile(String fileID) {
"""
Restores a trashed file back to its original location.
@param fileID the ID of the trashed file.
@return info about the restored file.
"""
URL url = RESTORE_FILE_URL_TEMPLATE.build(this.api.getBaseURL(), fileID);
BoxAPIRequest reque... | java | public BoxFile.Info restoreFile(String fileID) {
URL url = RESTORE_FILE_URL_TEMPLATE.build(this.api.getBaseURL(), fileID);
BoxAPIRequest request = new BoxAPIRequest(this.api, url, "POST");
JsonObject requestJSON = new JsonObject()
.add("", "");
request.setBody(requestJSON... | [
"public",
"BoxFile",
".",
"Info",
"restoreFile",
"(",
"String",
"fileID",
")",
"{",
"URL",
"url",
"=",
"RESTORE_FILE_URL_TEMPLATE",
".",
"build",
"(",
"this",
".",
"api",
".",
"getBaseURL",
"(",
")",
",",
"fileID",
")",
";",
"BoxAPIRequest",
"request",
"="... | Restores a trashed file back to its original location.
@param fileID the ID of the trashed file.
@return info about the restored file. | [
"Restores",
"a",
"trashed",
"file",
"back",
"to",
"its",
"original",
"location",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L189-L200 |
jbundle/jbundle | thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageManager.java | BaseMessageManager.getMessageQueue | public MessageQueue getMessageQueue(String strQueueName, String strQueueType) {
"""
Get this Message Queue (or create one if this name doesn't exist).
Override this to supply the correct message queue if it hasn't already been built.
@param strQueueName The queue name to lookup.
@param strQueueType The queue ty... | java | public MessageQueue getMessageQueue(String strQueueName, String strQueueType)
{ // Look up the message Queue!
return (BaseMessageQueue)m_messageMap.get(strQueueName);
} | [
"public",
"MessageQueue",
"getMessageQueue",
"(",
"String",
"strQueueName",
",",
"String",
"strQueueType",
")",
"{",
"// Look up the message Queue!",
"return",
"(",
"BaseMessageQueue",
")",
"m_messageMap",
".",
"get",
"(",
"strQueueName",
")",
";",
"}"
] | Get this Message Queue (or create one if this name doesn't exist).
Override this to supply the correct message queue if it hasn't already been built.
@param strQueueName The queue name to lookup.
@param strQueueType The queue type if this queue needs to be created.
@return The message queue. | [
"Get",
"this",
"Message",
"Queue",
"(",
"or",
"create",
"one",
"if",
"this",
"name",
"doesn",
"t",
"exist",
")",
".",
"Override",
"this",
"to",
"supply",
"the",
"correct",
"message",
"queue",
"if",
"it",
"hasn",
"t",
"already",
"been",
"built",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageManager.java#L133-L136 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.getSiteDiagnosticCategory | public DiagnosticCategoryInner getSiteDiagnosticCategory(String resourceGroupName, String siteName, String diagnosticCategory) {
"""
Get Diagnostics Category.
Get Diagnostics Category.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnost... | java | public DiagnosticCategoryInner getSiteDiagnosticCategory(String resourceGroupName, String siteName, String diagnosticCategory) {
return getSiteDiagnosticCategoryWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory).toBlocking().single().body();
} | [
"public",
"DiagnosticCategoryInner",
"getSiteDiagnosticCategory",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"diagnosticCategory",
")",
"{",
"return",
"getSiteDiagnosticCategoryWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"siteNam... | Get Diagnostics Category.
Get Diagnostics Category.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticCategory Diagnostic Category
@throws IllegalArgumentException thrown if parameters fail the validation
@throws DefaultErrorResponseException ... | [
"Get",
"Diagnostics",
"Category",
".",
"Get",
"Diagnostics",
"Category",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L300-L302 |
h2oai/h2o-2 | src/main/java/water/Key.java | Key.make | static public Key make(String s, byte rf, byte systemType, H2ONode... replicas) {
"""
If the addresses are not specified, returns a key with no home information.
"""
return make(decodeKeyName(s),rf,systemType,replicas);
} | java | static public Key make(String s, byte rf, byte systemType, H2ONode... replicas) {
return make(decodeKeyName(s),rf,systemType,replicas);
} | [
"static",
"public",
"Key",
"make",
"(",
"String",
"s",
",",
"byte",
"rf",
",",
"byte",
"systemType",
",",
"H2ONode",
"...",
"replicas",
")",
"{",
"return",
"make",
"(",
"decodeKeyName",
"(",
"s",
")",
",",
"rf",
",",
"systemType",
",",
"replicas",
")",... | If the addresses are not specified, returns a key with no home information. | [
"If",
"the",
"addresses",
"are",
"not",
"specified",
"returns",
"a",
"key",
"with",
"no",
"home",
"information",
"."
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Key.java#L252-L254 |
brettonw/Bag | src/main/java/com/brettonw/bag/Bag.java | Bag.getLong | public Long getLong (String key, Supplier<Long> notFound) {
"""
Retrieve a mapped element and return it as a Long.
@param key A string value used to index the element.
@param notFound A function to create a new Long if the requested key was not found
@return The element as a Long, or notFound if the element i... | java | public Long getLong (String key, Supplier<Long> notFound) {
return getParsed (key, Long::new, notFound);
} | [
"public",
"Long",
"getLong",
"(",
"String",
"key",
",",
"Supplier",
"<",
"Long",
">",
"notFound",
")",
"{",
"return",
"getParsed",
"(",
"key",
",",
"Long",
"::",
"new",
",",
"notFound",
")",
";",
"}"
] | Retrieve a mapped element and return it as a Long.
@param key A string value used to index the element.
@param notFound A function to create a new Long if the requested key was not found
@return The element as a Long, or notFound if the element is not found. | [
"Retrieve",
"a",
"mapped",
"element",
"and",
"return",
"it",
"as",
"a",
"Long",
"."
] | train | https://github.com/brettonw/Bag/blob/25c0ff74893b6c9a2c61bf0f97189ab82e0b2f56/src/main/java/com/brettonw/bag/Bag.java#L187-L189 |
meraki-analytics/datapipelines-java | src/main/java/com/merakianalytics/datapipelines/SinkHandler.java | SinkHandler.putMany | public void putMany(final Iterable<A> items, final PipelineContext context) {
"""
Converts multiple data elements and provides them to the underlying {@link com.merakianalytics.datapipelines.sinks.DataSink}
@param items
the data to provide to the underlying {@link com.merakianalytics.datapipelines.sinks.DataSi... | java | public void putMany(final Iterable<A> items, final PipelineContext context) {
final Iterable<S> transforming = new TransformingIterable(items, context);
sink.putMany(storedType, transforming, context);
} | [
"public",
"void",
"putMany",
"(",
"final",
"Iterable",
"<",
"A",
">",
"items",
",",
"final",
"PipelineContext",
"context",
")",
"{",
"final",
"Iterable",
"<",
"S",
">",
"transforming",
"=",
"new",
"TransformingIterable",
"(",
"items",
",",
"context",
")",
... | Converts multiple data elements and provides them to the underlying {@link com.merakianalytics.datapipelines.sinks.DataSink}
@param items
the data to provide to the underlying {@link com.merakianalytics.datapipelines.sinks.DataSink}
@param context
information about the context of the request such as what {@link com.me... | [
"Converts",
"multiple",
"data",
"elements",
"and",
"provides",
"them",
"to",
"the",
"underlying",
"{",
"@link",
"com",
".",
"merakianalytics",
".",
"datapipelines",
".",
"sinks",
".",
"DataSink",
"}"
] | train | https://github.com/meraki-analytics/datapipelines-java/blob/376ff1e8e1f7c67f2f2a5521d2a66e91467e56b0/src/main/java/com/merakianalytics/datapipelines/SinkHandler.java#L105-L108 |
protegeproject/jpaul | src/main/java/jpaul/DataStructs/UnionFind.java | UnionFind.union | public E union(E e1, E e2) {
"""
Unifies the elements <code>e1</code> and <code>e2</code> and
returns the representative of the resulting equivalence class.
"""
Node<E> node1 = _get_or_create_root_set(e1);
Node<E> node2 = _get_or_create_root_set(e2);
return _link(node1, node2).element;
} | java | public E union(E e1, E e2) {
Node<E> node1 = _get_or_create_root_set(e1);
Node<E> node2 = _get_or_create_root_set(e2);
return _link(node1, node2).element;
} | [
"public",
"E",
"union",
"(",
"E",
"e1",
",",
"E",
"e2",
")",
"{",
"Node",
"<",
"E",
">",
"node1",
"=",
"_get_or_create_root_set",
"(",
"e1",
")",
";",
"Node",
"<",
"E",
">",
"node2",
"=",
"_get_or_create_root_set",
"(",
"e2",
")",
";",
"return",
"_... | Unifies the elements <code>e1</code> and <code>e2</code> and
returns the representative of the resulting equivalence class. | [
"Unifies",
"the",
"elements",
"<code",
">",
"e1<",
"/",
"code",
">",
"and",
"<code",
">",
"e2<",
"/",
"code",
">",
"and",
"returns",
"the",
"representative",
"of",
"the",
"resulting",
"equivalence",
"class",
"."
] | train | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/UnionFind.java#L51-L55 |
alkacon/opencms-core | src/org/opencms/workplace/tools/CmsTool.java | CmsTool.addToolGroup | public void addToolGroup(CmsToolGroup group, float position) {
"""
Adds a group at the given position.<p>
@param group the group
@param position the position
@see org.opencms.workplace.tools.CmsIdentifiableObjectContainer#addIdentifiableObject(String, Object, float)
"""
m_container.addIdentifia... | java | public void addToolGroup(CmsToolGroup group, float position) {
m_container.addIdentifiableObject(group.getName(), group, position);
} | [
"public",
"void",
"addToolGroup",
"(",
"CmsToolGroup",
"group",
",",
"float",
"position",
")",
"{",
"m_container",
".",
"addIdentifiableObject",
"(",
"group",
".",
"getName",
"(",
")",
",",
"group",
",",
"position",
")",
";",
"}"
] | Adds a group at the given position.<p>
@param group the group
@param position the position
@see org.opencms.workplace.tools.CmsIdentifiableObjectContainer#addIdentifiableObject(String, Object, float) | [
"Adds",
"a",
"group",
"at",
"the",
"given",
"position",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/tools/CmsTool.java#L92-L95 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java | PackageIndexWriter.addPackagesList | protected void addPackagesList(Collection<PackageElement> packages, Content tbody) {
"""
Adds list of packages in the index table. Generate link to each package.
@param packages Packages to which link is to be generated
@param tbody the documentation tree to which the list will be added
"""
boolean... | java | protected void addPackagesList(Collection<PackageElement> packages, Content tbody) {
boolean altColor = true;
for (PackageElement pkg : packages) {
if (!pkg.isUnnamed()) {
if (!(configuration.nodeprecated && utils.isDeprecated(pkg))) {
Content packageLinkC... | [
"protected",
"void",
"addPackagesList",
"(",
"Collection",
"<",
"PackageElement",
">",
"packages",
",",
"Content",
"tbody",
")",
"{",
"boolean",
"altColor",
"=",
"true",
";",
"for",
"(",
"PackageElement",
"pkg",
":",
"packages",
")",
"{",
"if",
"(",
"!",
"... | Adds list of packages in the index table. Generate link to each package.
@param packages Packages to which link is to be generated
@param tbody the documentation tree to which the list will be added | [
"Adds",
"list",
"of",
"packages",
"in",
"the",
"index",
"table",
".",
"Generate",
"link",
"to",
"each",
"package",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java#L151-L169 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.getFilesInFolder | public List<CmsResource> getFilesInFolder(String resourcename) throws CmsException {
"""
Returns all file resources contained in a folder.<p>
The result is filtered according to the rules of
the <code>{@link CmsResourceFilter#DEFAULT}</code> filter.<p>
@param resourcename the full current site relative path... | java | public List<CmsResource> getFilesInFolder(String resourcename) throws CmsException {
return getFilesInFolder(resourcename, CmsResourceFilter.DEFAULT);
} | [
"public",
"List",
"<",
"CmsResource",
">",
"getFilesInFolder",
"(",
"String",
"resourcename",
")",
"throws",
"CmsException",
"{",
"return",
"getFilesInFolder",
"(",
"resourcename",
",",
"CmsResourceFilter",
".",
"DEFAULT",
")",
";",
"}"
] | Returns all file resources contained in a folder.<p>
The result is filtered according to the rules of
the <code>{@link CmsResourceFilter#DEFAULT}</code> filter.<p>
@param resourcename the full current site relative path of the resource to return the child resources for
@return a list of all child files as <code>{@li... | [
"Returns",
"all",
"file",
"resources",
"contained",
"in",
"a",
"folder",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1420-L1423 |
EdwardRaff/JSAT | JSAT/src/jsat/io/LIBSVMLoader.java | LIBSVMLoader.loadC | public static ClassificationDataSet loadC(File file, double sparseRatio, int vectorLength) throws FileNotFoundException, IOException {
"""
Loads a new classification data set from a LIBSVM file, assuming the
label is a nominal target value
@param file the file to load
@param sparseRatio the fraction of non ze... | java | public static ClassificationDataSet loadC(File file, double sparseRatio, int vectorLength) throws FileNotFoundException, IOException
{
return loadC(new FileReader(file), sparseRatio, vectorLength);
} | [
"public",
"static",
"ClassificationDataSet",
"loadC",
"(",
"File",
"file",
",",
"double",
"sparseRatio",
",",
"int",
"vectorLength",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"return",
"loadC",
"(",
"new",
"FileReader",
"(",
"file",
")",
"... | Loads a new classification data set from a LIBSVM file, assuming the
label is a nominal target value
@param file the file to load
@param sparseRatio the fraction of non zero values to qualify a data
point as sparse
@param vectorLength the pre-determined length of each vector. If given a
negative value, the largest non... | [
"Loads",
"a",
"new",
"classification",
"data",
"set",
"from",
"a",
"LIBSVM",
"file",
"assuming",
"the",
"label",
"is",
"a",
"nominal",
"target",
"value"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/io/LIBSVMLoader.java#L199-L202 |
mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.setObjectIndex | public static Object setObjectIndex(Object obj, double dblIndex,
Object value, Context cx,
Scriptable scope) {
"""
A cheaper and less general version of the above for well-known argument
types.
"""
Scriptable sobj = toObje... | java | public static Object setObjectIndex(Object obj, double dblIndex,
Object value, Context cx,
Scriptable scope)
{
Scriptable sobj = toObjectOrNull(cx, obj, scope);
if (sobj == null) {
throw undefWriteError(obj, ... | [
"public",
"static",
"Object",
"setObjectIndex",
"(",
"Object",
"obj",
",",
"double",
"dblIndex",
",",
"Object",
"value",
",",
"Context",
"cx",
",",
"Scriptable",
"scope",
")",
"{",
"Scriptable",
"sobj",
"=",
"toObjectOrNull",
"(",
"cx",
",",
"obj",
",",
"s... | A cheaper and less general version of the above for well-known argument
types. | [
"A",
"cheaper",
"and",
"less",
"general",
"version",
"of",
"the",
"above",
"for",
"well",
"-",
"known",
"argument",
"types",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L1764-L1779 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapAdapter.java | LdapAdapter.getContextProperty | public static String getContextProperty(Root root, String propertyName) {
"""
return the customProperty from the root object of the input data graph
@param root
@param propertyName
@return
"""
String result = "";
List<Context> contexts = root.getContexts();
for (Context context : c... | java | public static String getContextProperty(Root root, String propertyName) {
String result = "";
List<Context> contexts = root.getContexts();
for (Context context : contexts) {
String key = context.getKey();
if (key != null && key.equals(propertyName)) {
resu... | [
"public",
"static",
"String",
"getContextProperty",
"(",
"Root",
"root",
",",
"String",
"propertyName",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"List",
"<",
"Context",
">",
"contexts",
"=",
"root",
".",
"getContexts",
"(",
")",
";",
"for",
"(",
"... | return the customProperty from the root object of the input data graph
@param root
@param propertyName
@return | [
"return",
"the",
"customProperty",
"from",
"the",
"root",
"object",
"of",
"the",
"input",
"data",
"graph"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapAdapter.java#L2678-L2689 |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/SqlExecutor.java | SqlExecutor.setParameters | @SuppressWarnings("unchecked")
protected void setParameters(PreparedStatement stmt, PropertyDesc[] propDescs, Object entity) throws SQLException {
"""
Sets parameters to the PreparedStatement.
@param stmt the prepared statement
@param propDescs the property descriptors
@param entity the entity
@throws... | java | @SuppressWarnings("unchecked")
protected void setParameters(PreparedStatement stmt, PropertyDesc[] propDescs, Object entity) throws SQLException {
for (int i = 0; i < propDescs.length; i++) {
PropertyDesc propertyDesc = propDescs[i];
if(propertyDesc == null /*|| propertyDesc.getV... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"void",
"setParameters",
"(",
"PreparedStatement",
"stmt",
",",
"PropertyDesc",
"[",
"]",
"propDescs",
",",
"Object",
"entity",
")",
"throws",
"SQLException",
"{",
"for",
"(",
"int",
"i",
"=",
"0... | Sets parameters to the PreparedStatement.
@param stmt the prepared statement
@param propDescs the property descriptors
@param entity the entity
@throws SQLException if something goes wrong | [
"Sets",
"parameters",
"to",
"the",
"PreparedStatement",
"."
] | train | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/SqlExecutor.java#L468-L487 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/FileUtils.java | FileUtils.osSensitiveEndsWith | public static boolean osSensitiveEndsWith( String str, String suffix ) {
"""
Tell whether a string ends with a particular suffix, with case sensitivity determined by the operating system.
@param str the String to test.
@param suffix the suffix to look for.
@return <code>true</code> when:
<ul>
<li><code>str<... | java | public static boolean osSensitiveEndsWith( String str, String suffix )
{
if ( OS_CASE_SENSITIVE )
{
return str.endsWith( suffix );
}
else
{
int strLen = str.length();
int suffixLen = suffix.length();
if ( strLen < s... | [
"public",
"static",
"boolean",
"osSensitiveEndsWith",
"(",
"String",
"str",
",",
"String",
"suffix",
")",
"{",
"if",
"(",
"OS_CASE_SENSITIVE",
")",
"{",
"return",
"str",
".",
"endsWith",
"(",
"suffix",
")",
";",
"}",
"else",
"{",
"int",
"strLen",
"=",
"s... | Tell whether a string ends with a particular suffix, with case sensitivity determined by the operating system.
@param str the String to test.
@param suffix the suffix to look for.
@return <code>true</code> when:
<ul>
<li><code>str</code> ends with <code>suffix</code>, or,</li>
<li>the operating system is not case-sens... | [
"Tell",
"whether",
"a",
"string",
"ends",
"with",
"a",
"particular",
"suffix",
"with",
"case",
"sensitivity",
"determined",
"by",
"the",
"operating",
"system",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/FileUtils.java#L141-L159 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/xa/PGXADataSource.java | PGXADataSource.getXAConnection | public XAConnection getXAConnection(String user, String password) throws SQLException {
"""
Gets a XA-enabled connection to the PostgreSQL database. The database is identified by the
DataSource properties serverName, databaseName, and portNumber. The user to connect as is
identified by the arguments user and pas... | java | public XAConnection getXAConnection(String user, String password) throws SQLException {
Connection con = super.getConnection(user, password);
return new PGXAConnection((BaseConnection) con);
} | [
"public",
"XAConnection",
"getXAConnection",
"(",
"String",
"user",
",",
"String",
"password",
")",
"throws",
"SQLException",
"{",
"Connection",
"con",
"=",
"super",
".",
"getConnection",
"(",
"user",
",",
"password",
")",
";",
"return",
"new",
"PGXAConnection",... | Gets a XA-enabled connection to the PostgreSQL database. The database is identified by the
DataSource properties serverName, databaseName, and portNumber. The user to connect as is
identified by the arguments user and password, which override the DataSource properties by the
same name.
@return A valid database connect... | [
"Gets",
"a",
"XA",
"-",
"enabled",
"connection",
"to",
"the",
"PostgreSQL",
"database",
".",
"The",
"database",
"is",
"identified",
"by",
"the",
"DataSource",
"properties",
"serverName",
"databaseName",
"and",
"portNumber",
".",
"The",
"user",
"to",
"connect",
... | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/xa/PGXADataSource.java#L45-L48 |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/DateParser.java | DateParser.formatRFC822 | public static String formatRFC822(final Date date, final Locale locale) {
"""
create a RFC822 representation of a date.
<p/>
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
<p/>
@param date Date to parse
@return the RFC822 represented by the given Date It returns ... | java | public static String formatRFC822(final Date date, final Locale locale) {
final SimpleDateFormat dateFormater = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss 'GMT'", locale);
dateFormater.setTimeZone(TimeZone.getTimeZone("GMT"));
return dateFormater.format(date);
} | [
"public",
"static",
"String",
"formatRFC822",
"(",
"final",
"Date",
"date",
",",
"final",
"Locale",
"locale",
")",
"{",
"final",
"SimpleDateFormat",
"dateFormater",
"=",
"new",
"SimpleDateFormat",
"(",
"\"EEE, dd MMM yyyy HH:mm:ss 'GMT'\"",
",",
"locale",
")",
";",
... | create a RFC822 representation of a date.
<p/>
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
<p/>
@param date Date to parse
@return the RFC822 represented by the given Date It returns <b>null</b> if it was not
possible to parse the date. | [
"create",
"a",
"RFC822",
"representation",
"of",
"a",
"date",
".",
"<p",
"/",
">",
"Refer",
"to",
"the",
"java",
".",
"text",
".",
"SimpleDateFormat",
"javadocs",
"for",
"details",
"on",
"the",
"format",
"of",
"each",
"element",
".",
"<p",
"/",
">"
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/DateParser.java#L251-L255 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java | SourceLineAnnotation.fromVisitedInstruction | public static SourceLineAnnotation fromVisitedInstruction(ClassContext classContext, Method method, Location loc) {
"""
Create from Method and Location in a visited class.
@param classContext
ClassContext of visited class
@param method
Method in visited class
@param loc
Location in visited class
@return S... | java | public static SourceLineAnnotation fromVisitedInstruction(ClassContext classContext, Method method, Location loc) {
return fromVisitedInstruction(classContext, method, loc.getHandle());
} | [
"public",
"static",
"SourceLineAnnotation",
"fromVisitedInstruction",
"(",
"ClassContext",
"classContext",
",",
"Method",
"method",
",",
"Location",
"loc",
")",
"{",
"return",
"fromVisitedInstruction",
"(",
"classContext",
",",
"method",
",",
"loc",
".",
"getHandle",
... | Create from Method and Location in a visited class.
@param classContext
ClassContext of visited class
@param method
Method in visited class
@param loc
Location in visited class
@return SourceLineAnnotation describing visited Location | [
"Create",
"from",
"Method",
"and",
"Location",
"in",
"a",
"visited",
"class",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java#L399-L401 |
resilience4j/resilience4j | resilience4j-ratelimiter/src/main/java/io/github/resilience4j/ratelimiter/internal/AtomicRateLimiter.java | AtomicRateLimiter.calculateNextState | private State calculateNextState(final long timeoutInNanos, final State activeState) {
"""
A side-effect-free function that can calculate next {@link State} from current.
It determines time duration that you should wait for permission and reserves it for you,
if you'll be able to wait long enough.
@param time... | java | private State calculateNextState(final long timeoutInNanos, final State activeState) {
long cyclePeriodInNanos = activeState.config.getLimitRefreshPeriodInNanos();
int permissionsPerCycle = activeState.config.getLimitForPeriod();
long currentNanos = currentNanoTime();
long currentCycle ... | [
"private",
"State",
"calculateNextState",
"(",
"final",
"long",
"timeoutInNanos",
",",
"final",
"State",
"activeState",
")",
"{",
"long",
"cyclePeriodInNanos",
"=",
"activeState",
".",
"config",
".",
"getLimitRefreshPeriodInNanos",
"(",
")",
";",
"int",
"permissions... | A side-effect-free function that can calculate next {@link State} from current.
It determines time duration that you should wait for permission and reserves it for you,
if you'll be able to wait long enough.
@param timeoutInNanos max time that caller can wait for permission in nanoseconds
@param activeState current... | [
"A",
"side",
"-",
"effect",
"-",
"free",
"function",
"that",
"can",
"calculate",
"next",
"{",
"@link",
"State",
"}",
"from",
"current",
".",
"It",
"determines",
"time",
"duration",
"that",
"you",
"should",
"wait",
"for",
"permission",
"and",
"reserves",
"i... | train | https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-ratelimiter/src/main/java/io/github/resilience4j/ratelimiter/internal/AtomicRateLimiter.java#L189-L209 |
haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/ProxyServlet.java | ProxyServlet.copyBodyFromClient | private void copyBodyFromClient(HttpServletRequest pRequest, HttpURLConnection pRemoteConnection) throws IOException {
"""
Copies the message body from the client (incomming
{@code HttpServletRequest}) to the remote server if the request method
is {@code POST} or <tt>PUT<tt>.
Otherwise this method does nothing.... | java | private void copyBodyFromClient(HttpServletRequest pRequest, HttpURLConnection pRemoteConnection) throws IOException {
// If this is a POST or PUT, copy message body from client remote server
if (!("POST".equals(pRequest.getMethod()) || "PUT".equals(pRequest.getMethod()))) {
return;
... | [
"private",
"void",
"copyBodyFromClient",
"(",
"HttpServletRequest",
"pRequest",
",",
"HttpURLConnection",
"pRemoteConnection",
")",
"throws",
"IOException",
"{",
"// If this is a POST or PUT, copy message body from client remote server\r",
"if",
"(",
"!",
"(",
"\"POST\"",
".",
... | Copies the message body from the client (incomming
{@code HttpServletRequest}) to the remote server if the request method
is {@code POST} or <tt>PUT<tt>.
Otherwise this method does nothing.
@param pRequest
@param pRemoteConnection
@throws java.io.IOException | [
"Copies",
"the",
"message",
"body",
"from",
"the",
"client",
"(",
"incomming",
"{",
"@code",
"HttpServletRequest",
"}",
")",
"to",
"the",
"remote",
"server",
"if",
"the",
"request",
"method",
"is",
"{",
"@code",
"POST",
"}",
"or",
"<tt",
">",
"PUT<tt",
"... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ProxyServlet.java#L278-L313 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/attributedefinition/attributes/AttributeVocabularyValueUrl.java | AttributeVocabularyValueUrl.updateAttributeVocabularyValueUrl | public static MozuUrl updateAttributeVocabularyValueUrl(String attributeFQN, String responseFields, String value) {
"""
Get Resource Url for UpdateAttributeVocabularyValue
@param attributeFQN Fully qualified name for an attribute.
@param responseFields Filtering syntax appended to an API call to increase or decr... | java | public static MozuUrl updateAttributeVocabularyValueUrl(String attributeFQN, String responseFields, String value)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}/VocabularyValues/{value}?responseFields={responseFields}");
formatter.formatUrl... | [
"public",
"static",
"MozuUrl",
"updateAttributeVocabularyValueUrl",
"(",
"String",
"attributeFQN",
",",
"String",
"responseFields",
",",
"String",
"value",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/attributedefini... | Get Resource Url for UpdateAttributeVocabularyValue
@param attributeFQN Fully qualified name for an attribute.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to updat... | [
"Get",
"Resource",
"Url",
"for",
"UpdateAttributeVocabularyValue"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/attributedefinition/attributes/AttributeVocabularyValueUrl.java#L157-L164 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.fromParallelCollection | public <OUT> DataStreamSource<OUT> fromParallelCollection(SplittableIterator<OUT> iterator, TypeInformation<OUT>
typeInfo) {
"""
Creates a new data stream that contains elements in the iterator. The iterator is splittable,
allowing the framework to create a parallel data stream source that returns the elements... | java | public <OUT> DataStreamSource<OUT> fromParallelCollection(SplittableIterator<OUT> iterator, TypeInformation<OUT>
typeInfo) {
return fromParallelCollection(iterator, typeInfo, "Parallel Collection Source");
} | [
"public",
"<",
"OUT",
">",
"DataStreamSource",
"<",
"OUT",
">",
"fromParallelCollection",
"(",
"SplittableIterator",
"<",
"OUT",
">",
"iterator",
",",
"TypeInformation",
"<",
"OUT",
">",
"typeInfo",
")",
"{",
"return",
"fromParallelCollection",
"(",
"iterator",
... | Creates a new data stream that contains elements in the iterator. The iterator is splittable,
allowing the framework to create a parallel data stream source that returns the elements in
the iterator.
<p>Because the iterator will remain unmodified until the actual execution happens, the type
of data returned by the ite... | [
"Creates",
"a",
"new",
"data",
"stream",
"that",
"contains",
"elements",
"in",
"the",
"iterator",
".",
"The",
"iterator",
"is",
"splittable",
"allowing",
"the",
"framework",
"to",
"create",
"a",
"parallel",
"data",
"stream",
"source",
"that",
"returns",
"the",... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L912-L915 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java | GaliosFieldTableOps.polyAddScaleB | public void polyAddScaleB(GrowQueue_I8 polyA , GrowQueue_I8 polyB , int scaleB , GrowQueue_I8 output ) {
"""
Adds two polynomials together while scaling the second.
<p>Coefficients for largest powers are first, e.g. 2*x**3 + 8*x**2+1 = [2,8,0,1]</p>
@param polyA (Input) First polynomial
@param polyB (Input)... | java | public void polyAddScaleB(GrowQueue_I8 polyA , GrowQueue_I8 polyB , int scaleB , GrowQueue_I8 output ) {
output.resize(Math.max(polyA.size,polyB.size));
// compute offset that would align the smaller polynomial with the larger polynomial
int offsetA = Math.max(0,polyB.size-polyA.size);
int offsetB = Math.max(0... | [
"public",
"void",
"polyAddScaleB",
"(",
"GrowQueue_I8",
"polyA",
",",
"GrowQueue_I8",
"polyB",
",",
"int",
"scaleB",
",",
"GrowQueue_I8",
"output",
")",
"{",
"output",
".",
"resize",
"(",
"Math",
".",
"max",
"(",
"polyA",
".",
"size",
",",
"polyB",
".",
... | Adds two polynomials together while scaling the second.
<p>Coefficients for largest powers are first, e.g. 2*x**3 + 8*x**2+1 = [2,8,0,1]</p>
@param polyA (Input) First polynomial
@param polyB (Input) Second polynomial
@param scaleB (Input) Scale factor applied to polyB
@param output (Output) Results of addition | [
"Adds",
"two",
"polynomials",
"together",
"while",
"scaling",
"the",
"second",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java#L201-L218 |
robinst/autolink-java | src/main/java/org/nibor/autolink/Autolink.java | Autolink.renderLinks | @Deprecated
public static String renderLinks(CharSequence input, Iterable<LinkSpan> links, LinkRenderer linkRenderer) {
"""
Render the supplied links from the supplied input text using a renderer. The parts of the text outside of links
are added to the result without processing.
@param input the input text... | java | @Deprecated
public static String renderLinks(CharSequence input, Iterable<LinkSpan> links, LinkRenderer linkRenderer) {
if (input == null) {
throw new NullPointerException("input must not be null");
}
if (links == null) {
throw new NullPointerException("links must not... | [
"@",
"Deprecated",
"public",
"static",
"String",
"renderLinks",
"(",
"CharSequence",
"input",
",",
"Iterable",
"<",
"LinkSpan",
">",
"links",
",",
"LinkRenderer",
"linkRenderer",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPoin... | Render the supplied links from the supplied input text using a renderer. The parts of the text outside of links
are added to the result without processing.
@param input the input text, must not be null
@param links the links to render, see {@link LinkExtractor} to extract them
@param linkRenderer the link rendering im... | [
"Render",
"the",
"supplied",
"links",
"from",
"the",
"supplied",
"input",
"text",
"using",
"a",
"renderer",
".",
"The",
"parts",
"of",
"the",
"text",
"outside",
"of",
"links",
"are",
"added",
"to",
"the",
"result",
"without",
"processing",
"."
] | train | https://github.com/robinst/autolink-java/blob/9b01c2620d450cd51942f4d092e4e7153980c6d8/src/main/java/org/nibor/autolink/Autolink.java#L18-L40 |
apache/flink | flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java | CliFrontend.runClusterAction | private <T> void runClusterAction(CustomCommandLine<T> activeCommandLine, CommandLine commandLine, ClusterAction<T> clusterAction) throws FlinkException {
"""
Retrieves the {@link ClusterClient} from the given {@link CustomCommandLine} and runs the given
{@link ClusterAction} against it.
@param activeCommandLi... | java | private <T> void runClusterAction(CustomCommandLine<T> activeCommandLine, CommandLine commandLine, ClusterAction<T> clusterAction) throws FlinkException {
final ClusterDescriptor<T> clusterDescriptor = activeCommandLine.createClusterDescriptor(commandLine);
final T clusterId = activeCommandLine.getClusterId(comman... | [
"private",
"<",
"T",
">",
"void",
"runClusterAction",
"(",
"CustomCommandLine",
"<",
"T",
">",
"activeCommandLine",
",",
"CommandLine",
"commandLine",
",",
"ClusterAction",
"<",
"T",
">",
"clusterAction",
")",
"throws",
"FlinkException",
"{",
"final",
"ClusterDesc... | Retrieves the {@link ClusterClient} from the given {@link CustomCommandLine} and runs the given
{@link ClusterAction} against it.
@param activeCommandLine to create the {@link ClusterDescriptor} from
@param commandLine containing the parsed command line options
@param clusterAction the cluster action to run against th... | [
"Retrieves",
"the",
"{",
"@link",
"ClusterClient",
"}",
"from",
"the",
"given",
"{",
"@link",
"CustomCommandLine",
"}",
"and",
"runs",
"the",
"given",
"{",
"@link",
"ClusterAction",
"}",
"against",
"it",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java#L905-L934 |
alkacon/opencms-core | src/org/opencms/ade/sitemap/CmsVfsSitemapService.java | CmsVfsSitemapService.ensureLockAndGetInfo | protected LockInfo ensureLockAndGetInfo(CmsResource resource) throws CmsException {
"""
Locks the given resource with a temporary, if not already locked by the current user.
Will throw an exception if the resource could not be locked for the current user.<p>
@param resource the resource to lock
@return the ... | java | protected LockInfo ensureLockAndGetInfo(CmsResource resource) throws CmsException {
CmsObject cms = getCmsObject();
boolean justLocked = false;
List<CmsResource> blockingResources = cms.getBlockingLockedResources(resource);
if ((blockingResources != null) && !blockingResources.isEmpty()... | [
"protected",
"LockInfo",
"ensureLockAndGetInfo",
"(",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"CmsObject",
"cms",
"=",
"getCmsObject",
"(",
")",
";",
"boolean",
"justLocked",
"=",
"false",
";",
"List",
"<",
"CmsResource",
">",
"blockingResou... | Locks the given resource with a temporary, if not already locked by the current user.
Will throw an exception if the resource could not be locked for the current user.<p>
@param resource the resource to lock
@return the assigned lock
@throws CmsException if the resource could not be locked | [
"Locks",
"the",
"given",
"resource",
"with",
"a",
"temporary",
"if",
"not",
"already",
"locked",
"by",
"the",
"current",
"user",
".",
"Will",
"throw",
"an",
"exception",
"if",
"the",
"resource",
"could",
"not",
"be",
"locked",
"for",
"the",
"current",
"use... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/sitemap/CmsVfsSitemapService.java#L1199-L1222 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbChanges.java | TmdbChanges.getChangeList | public ResultList<ChangeListItem> getChangeList(MethodBase method, Integer page, String startDate, String endDate) throws MovieDbException {
"""
Get a list of Media IDs that have been edited.
You can then use the movie/TV/person changes API to get the actual data that has been changed.
@param method The meth... | java | public ResultList<ChangeListItem> getChangeList(MethodBase method, Integer page, String startDate, String endDate) throws MovieDbException {
TmdbParameters params = new TmdbParameters();
params.add(Param.PAGE, page);
params.add(Param.START_DATE, startDate);
params.add(Param.END_DATE, end... | [
"public",
"ResultList",
"<",
"ChangeListItem",
">",
"getChangeList",
"(",
"MethodBase",
"method",
",",
"Integer",
"page",
",",
"String",
"startDate",
",",
"String",
"endDate",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"params",
"=",
"new",
"TmdbPar... | Get a list of Media IDs that have been edited.
You can then use the movie/TV/person changes API to get the actual data that has been changed.
@param method The method base to get
@param page
@param startDate the start date of the changes, optional
@param endDate the end date of the changes, optional
@return List of c... | [
"Get",
"a",
"list",
"of",
"Media",
"IDs",
"that",
"have",
"been",
"edited",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbChanges.java#L63-L72 |
Erudika/para | para-server/src/main/java/com/erudika/para/rest/RestUtils.java | RestUtils.getDeleteResponse | public static Response getDeleteResponse(App app, ParaObject content) {
"""
Delete response as JSON.
@param content the object to delete
@param app the current App object
@return a status code 200 or 400
"""
try (final Metrics.Context context = Metrics.time(app == null ? null : app.getAppid(),
RestUti... | java | public static Response getDeleteResponse(App app, ParaObject content) {
try (final Metrics.Context context = Metrics.time(app == null ? null : app.getAppid(),
RestUtils.class, "crud", "delete")) {
if (app != null && content != null && content.getId() != null && content.getAppid() != null) {
if (checkImplic... | [
"public",
"static",
"Response",
"getDeleteResponse",
"(",
"App",
"app",
",",
"ParaObject",
"content",
")",
"{",
"try",
"(",
"final",
"Metrics",
".",
"Context",
"context",
"=",
"Metrics",
".",
"time",
"(",
"app",
"==",
"null",
"?",
"null",
":",
"app",
"."... | Delete response as JSON.
@param content the object to delete
@param app the current App object
@return a status code 200 or 400 | [
"Delete",
"response",
"as",
"JSON",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/rest/RestUtils.java#L459-L472 |
google/auto | value/src/main/java/com/google/auto/value/processor/AutoValueOrOneOfProcessor.java | AutoValueOrOneOfProcessor.generatedClassName | static String generatedClassName(TypeElement type, String prefix) {
"""
Returns the name of the generated {@code @AutoValue} or {@code @AutoOneOf} class, for example
{@code AutoOneOf_TaskResult} or {@code $$AutoValue_SimpleMethod}.
@param type the name of the type bearing the {@code @AutoValue} or {@code @Auto... | java | static String generatedClassName(TypeElement type, String prefix) {
String name = type.getSimpleName().toString();
while (type.getEnclosingElement() instanceof TypeElement) {
type = (TypeElement) type.getEnclosingElement();
name = type.getSimpleName() + "_" + name;
}
String pkg = TypeSimplif... | [
"static",
"String",
"generatedClassName",
"(",
"TypeElement",
"type",
",",
"String",
"prefix",
")",
"{",
"String",
"name",
"=",
"type",
".",
"getSimpleName",
"(",
")",
".",
"toString",
"(",
")",
";",
"while",
"(",
"type",
".",
"getEnclosingElement",
"(",
"... | Returns the name of the generated {@code @AutoValue} or {@code @AutoOneOf} class, for example
{@code AutoOneOf_TaskResult} or {@code $$AutoValue_SimpleMethod}.
@param type the name of the type bearing the {@code @AutoValue} or {@code @AutoOneOf}
annotation.
@param prefix the prefix to use in the generated class. This ... | [
"Returns",
"the",
"name",
"of",
"the",
"generated",
"{",
"@code",
"@AutoValue",
"}",
"or",
"{",
"@code",
"@AutoOneOf",
"}",
"class",
"for",
"example",
"{",
"@code",
"AutoOneOf_TaskResult",
"}",
"or",
"{",
"@code",
"$$AutoValue_SimpleMethod",
"}",
"."
] | train | https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/value/src/main/java/com/google/auto/value/processor/AutoValueOrOneOfProcessor.java#L445-L454 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/deps/ModuleDeps.java | ModuleDeps.simplify | public ModuleDeps simplify(Map<?, ?> formulaCache) {
"""
Simplifies the boolean formulas for each contained {@link ModuleDepInfo}
@param formulaCache
the formula cache
@return this object
"""
for (ModuleDepInfo info : values()) {
info.simplify(formulaCache);
}
return this;
} | java | public ModuleDeps simplify(Map<?, ?> formulaCache) {
for (ModuleDepInfo info : values()) {
info.simplify(formulaCache);
}
return this;
} | [
"public",
"ModuleDeps",
"simplify",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"formulaCache",
")",
"{",
"for",
"(",
"ModuleDepInfo",
"info",
":",
"values",
"(",
")",
")",
"{",
"info",
".",
"simplify",
"(",
"formulaCache",
")",
";",
"}",
"return",
"this",
... | Simplifies the boolean formulas for each contained {@link ModuleDepInfo}
@param formulaCache
the formula cache
@return this object | [
"Simplifies",
"the",
"boolean",
"formulas",
"for",
"each",
"contained",
"{",
"@link",
"ModuleDepInfo",
"}"
] | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/deps/ModuleDeps.java#L268-L273 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.clickOnScreen | public void clickOnScreen(float x, float y) {
"""
Clicks the specified coordinates.
@param x the x coordinate
@param y the y coordinate
"""
if(config.commandLogging){
Log.d(config.commandLoggingTag, "clickOnScreen("+x+", "+y+")");
}
sleeper.sleep();
clicker.clickOnScreen(x, y, null);
} | java | public void clickOnScreen(float x, float y) {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "clickOnScreen("+x+", "+y+")");
}
sleeper.sleep();
clicker.clickOnScreen(x, y, null);
} | [
"public",
"void",
"clickOnScreen",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"clickOnScreen(\"",
"+",
"x",
"+",
"\", \"",
"+",
... | Clicks the specified coordinates.
@param x the x coordinate
@param y the y coordinate | [
"Clicks",
"the",
"specified",
"coordinates",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L1134-L1141 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java | FSDirectory.unprotectedConcat | public void unprotectedConcat(String target, String [] srcs, long now)
throws IOException {
"""
Concat all the blocks from srcs to trg and delete the srcs files
@param target target file to move the blocks to
@param srcs list of file to move the blocks from
Must be public because also called from EditLogs
... | java | public void unprotectedConcat(String target, String [] srcs, long now)
throws IOException {
if (NameNode.stateChangeLog.isDebugEnabled()) {
NameNode.stateChangeLog.debug("DIR* FSNamesystem.concat to "+target);
}
// do the move
INode [] trgINodes = getExistingPathINodes(target);
INodeFil... | [
"public",
"void",
"unprotectedConcat",
"(",
"String",
"target",
",",
"String",
"[",
"]",
"srcs",
",",
"long",
"now",
")",
"throws",
"IOException",
"{",
"if",
"(",
"NameNode",
".",
"stateChangeLog",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"NameNode",
"."... | Concat all the blocks from srcs to trg and delete the srcs files
@param target target file to move the blocks to
@param srcs list of file to move the blocks from
Must be public because also called from EditLogs
NOTE: - it does not update quota (not needed for concat) | [
"Concat",
"all",
"the",
"blocks",
"from",
"srcs",
"to",
"trg",
"and",
"delete",
"the",
"srcs",
"files"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1299-L1341 |
strator-dev/greenpepper | greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java | ConfluenceGreenPepper.savePreviousImplementedVersion | public void savePreviousImplementedVersion(Page page, Integer version) {
"""
Saves the sprecified version as the Previous implemented version
@param page a {@link com.atlassian.confluence.pages.Page} object.
@param version a {@link java.lang.Integer} object.
"""
String value = version != null ? Str... | java | public void savePreviousImplementedVersion(Page page, Integer version) {
String value = version != null ? String.valueOf(version) : null;
ContentEntityObject entityObject = getContentEntityManager().getById(page.getId());
getContentPropertyManager().setStringProperty(entityObject, PREVIOUS_IMPLE... | [
"public",
"void",
"savePreviousImplementedVersion",
"(",
"Page",
"page",
",",
"Integer",
"version",
")",
"{",
"String",
"value",
"=",
"version",
"!=",
"null",
"?",
"String",
".",
"valueOf",
"(",
"version",
")",
":",
"null",
";",
"ContentEntityObject",
"entityO... | Saves the sprecified version as the Previous implemented version
@param page a {@link com.atlassian.confluence.pages.Page} object.
@param version a {@link java.lang.Integer} object. | [
"Saves",
"the",
"sprecified",
"version",
"as",
"the",
"Previous",
"implemented",
"version"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java#L576-L580 |
overturetool/overture | ide/debug/src/main/java/org/overture/ide/debug/utils/CharOperation.java | CharOperation.prefixEquals | public static final boolean prefixEquals(char[] prefix, char[] name) {
"""
Answers true if the given name starts with the given prefix, false otherwise. The comparison is case sensitive. <br>
<br>
For example:
<ol>
<li>
<pre>
prefix = { 'a' , 'b' }
name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
result => tr... | java | public static final boolean prefixEquals(char[] prefix, char[] name)
{
int max = prefix.length;
if (name.length < max)
{
return false;
}
for (int i = max; --i >= 0;)
{
// assumes the prefix is not larger than the name
if (prefix[i] != name[i])
{
return false;
}
}
return true;
} | [
"public",
"static",
"final",
"boolean",
"prefixEquals",
"(",
"char",
"[",
"]",
"prefix",
",",
"char",
"[",
"]",
"name",
")",
"{",
"int",
"max",
"=",
"prefix",
".",
"length",
";",
"if",
"(",
"name",
".",
"length",
"<",
"max",
")",
"{",
"return",
"fa... | Answers true if the given name starts with the given prefix, false otherwise. The comparison is case sensitive. <br>
<br>
For example:
<ol>
<li>
<pre>
prefix = { 'a' , 'b' }
name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
result => true
</pre>
</li>
<li>
<pre>
prefix = { 'a' , 'c' }
name = { 'a' , 'b', 'b', 'a', 'b', 'a... | [
"Answers",
"true",
"if",
"the",
"given",
"name",
"starts",
"with",
"the",
"given",
"prefix",
"false",
"otherwise",
".",
"The",
"comparison",
"is",
"case",
"sensitive",
".",
"<br",
">",
"<br",
">",
"For",
"example",
":",
"<ol",
">",
"<li",
">"
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/debug/src/main/java/org/overture/ide/debug/utils/CharOperation.java#L3151-L3168 |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/utils/ManifestUtils.java | ManifestUtils.getPropertyValues | public static List<String> getPropertyValues(ClassLoader classloader, String key) {
"""
Search for a property in all the manifests found in the classloader
@return the values, an empty list if the property is not found.
"""
List<String> values = new ArrayList<>();
try {
Enumeration<URL> resour... | java | public static List<String> getPropertyValues(ClassLoader classloader, String key) {
List<String> values = new ArrayList<>();
try {
Enumeration<URL> resources = classloader.getResources("META-INF/MANIFEST.MF");
while (resources.hasMoreElements()) {
Manifest manifest = new Manifest(resources.n... | [
"public",
"static",
"List",
"<",
"String",
">",
"getPropertyValues",
"(",
"ClassLoader",
"classloader",
",",
"String",
"key",
")",
"{",
"List",
"<",
"String",
">",
"values",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"{",
"Enumeration",
"<",
"U... | Search for a property in all the manifests found in the classloader
@return the values, an empty list if the property is not found. | [
"Search",
"for",
"a",
"property",
"in",
"all",
"the",
"manifests",
"found",
"in",
"the",
"classloader"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ManifestUtils.java#L43-L59 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java | ST_Split.splitLineWithPoint | private static MultiLineString splitLineWithPoint(LineString line, Point pointToSplit, double tolerance) {
"""
Split a linestring with a point The point must be on the linestring
@param line
@param pointToSplit
@return
"""
return FACTORY.createMultiLineString(splitLineStringWithPoint(line, pointTo... | java | private static MultiLineString splitLineWithPoint(LineString line, Point pointToSplit, double tolerance) {
return FACTORY.createMultiLineString(splitLineStringWithPoint(line, pointToSplit, tolerance));
} | [
"private",
"static",
"MultiLineString",
"splitLineWithPoint",
"(",
"LineString",
"line",
",",
"Point",
"pointToSplit",
",",
"double",
"tolerance",
")",
"{",
"return",
"FACTORY",
".",
"createMultiLineString",
"(",
"splitLineStringWithPoint",
"(",
"line",
",",
"pointToS... | Split a linestring with a point The point must be on the linestring
@param line
@param pointToSplit
@return | [
"Split",
"a",
"linestring",
"with",
"a",
"point",
"The",
"point",
"must",
"be",
"on",
"the",
"linestring"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java#L138-L140 |
canoo/dolphin-platform | platform/dolphin-platform-core/src/main/java/com/canoo/dp/impl/platform/core/commons/lang/TypeUtils.java | TypeUtils.getTypeArguments | private static Map<TypeVariable<?>, Type> getTypeArguments(final ParameterizedType type) {
"""
<p>Retrieves all the type arguments for this parameterized type
including owner hierarchy arguments such as
{@code Outer<K,V>.Inner<T>.DeepInner<E>} .
The arguments are returned in a
{@link Map} specifying the argume... | java | private static Map<TypeVariable<?>, Type> getTypeArguments(final ParameterizedType type) {
return getTypeArguments(type, getRawType(type), null);
} | [
"private",
"static",
"Map",
"<",
"TypeVariable",
"<",
"?",
">",
",",
"Type",
">",
"getTypeArguments",
"(",
"final",
"ParameterizedType",
"type",
")",
"{",
"return",
"getTypeArguments",
"(",
"type",
",",
"getRawType",
"(",
"type",
")",
",",
"null",
")",
";"... | <p>Retrieves all the type arguments for this parameterized type
including owner hierarchy arguments such as
{@code Outer<K,V>.Inner<T>.DeepInner<E>} .
The arguments are returned in a
{@link Map} specifying the argument type for each {@link TypeVariable}.
</p>
@param type specifies the subject parameterized type from w... | [
"<p",
">",
"Retrieves",
"all",
"the",
"type",
"arguments",
"for",
"this",
"parameterized",
"type",
"including",
"owner",
"hierarchy",
"arguments",
"such",
"as",
"{",
"@code",
"Outer<K",
"V",
">",
".",
"Inner<T",
">",
".",
"DeepInner<E",
">",
"}",
".",
"The... | train | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-core/src/main/java/com/canoo/dp/impl/platform/core/commons/lang/TypeUtils.java#L680-L682 |
craterdog/java-general-utilities | src/main/java/craterdog/utils/ByteUtils.java | ByteUtils.bytesToShort | static public short bytesToShort(byte[] buffer, int index) {
"""
This function converts the bytes in a byte array at the specified index to its
corresponding short value.
@param buffer The byte array containing the short.
@param index The index for the first byte in the byte array.
@return The corresponding ... | java | static public short bytesToShort(byte[] buffer, int index) {
int length = 2;
short integer = 0;
for (int i = 0; i < length; i++) {
integer |= ((buffer[index + length - i - 1] & 0xFF) << (i * 8));
}
return integer;
} | [
"static",
"public",
"short",
"bytesToShort",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
")",
"{",
"int",
"length",
"=",
"2",
";",
"short",
"integer",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
... | This function converts the bytes in a byte array at the specified index to its
corresponding short value.
@param buffer The byte array containing the short.
@param index The index for the first byte in the byte array.
@return The corresponding short value. | [
"This",
"function",
"converts",
"the",
"bytes",
"in",
"a",
"byte",
"array",
"at",
"the",
"specified",
"index",
"to",
"its",
"corresponding",
"short",
"value",
"."
] | train | https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L156-L163 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java | PublicIPAddressesInner.getVirtualMachineScaleSetPublicIPAddress | public PublicIPAddressInner getVirtualMachineScaleSetPublicIPAddress(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand) {
"""
Get the specified public IP address in a virtual ma... | java | public PublicIPAddressInner getVirtualMachineScaleSetPublicIPAddress(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand) {
return getVirtualMachineScaleSetPublicIPAddressWithS... | [
"public",
"PublicIPAddressInner",
"getVirtualMachineScaleSetPublicIPAddress",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualMachineScaleSetName",
",",
"String",
"virtualmachineIndex",
",",
"String",
"networkInterfaceName",
",",
"String",
"ipConfigurationName",
",",
... | Get the specified public IP address in a virtual machine scale set.
@param resourceGroupName The name of the resource group.
@param virtualMachineScaleSetName The name of the virtual machine scale set.
@param virtualmachineIndex The virtual machine index.
@param networkInterfaceName The name of the network interface.
... | [
"Get",
"the",
"specified",
"public",
"IP",
"address",
"in",
"a",
"virtual",
"machine",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java#L1540-L1542 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/ProxyUtil.java | ProxyUtil.createClientProxy | @SuppressWarnings("WeakerAccess")
public static <T> T createClientProxy(ClassLoader classLoader, Class<T> proxyInterface, final JsonRpcClient client, Socket socket) throws IOException {
"""
Creates a {@link Proxy} of the given {@code proxyInterface}
that uses the given {@link JsonRpcClient}.
@param <T> ... | java | @SuppressWarnings("WeakerAccess")
public static <T> T createClientProxy(ClassLoader classLoader, Class<T> proxyInterface, final JsonRpcClient client, Socket socket) throws IOException {
return createClientProxy(classLoader, proxyInterface, client, socket.getInputStream(), socket.getOutputStream());
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"createClientProxy",
"(",
"ClassLoader",
"classLoader",
",",
"Class",
"<",
"T",
">",
"proxyInterface",
",",
"final",
"JsonRpcClient",
"client",
",",
"Socket",
"socket"... | Creates a {@link Proxy} of the given {@code proxyInterface}
that uses the given {@link JsonRpcClient}.
@param <T> the proxy type
@param classLoader the {@link ClassLoader}
@param proxyInterface the interface to proxy
@param client the {@link JsonRpcClient}
@param socket the {@link Socket}... | [
"Creates",
"a",
"{",
"@link",
"Proxy",
"}",
"of",
"the",
"given",
"{",
"@code",
"proxyInterface",
"}",
"that",
"uses",
"the",
"given",
"{",
"@link",
"JsonRpcClient",
"}",
"."
] | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/ProxyUtil.java#L129-L132 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/fit/SoapCallMapColumnFixture.java | SoapCallMapColumnFixture.registerNs | protected static void registerNs(String prefix, String url) {
"""
Registers a namespace in the environment, so the prefix can be used in
XPath expressions.
@param prefix prefix to be used in XPath expressions.
@param url namespace URI the prefix should map to.
"""
Environment.getInstance().registerN... | java | protected static void registerNs(String prefix, String url) {
Environment.getInstance().registerNamespace(prefix, url);
} | [
"protected",
"static",
"void",
"registerNs",
"(",
"String",
"prefix",
",",
"String",
"url",
")",
"{",
"Environment",
".",
"getInstance",
"(",
")",
".",
"registerNamespace",
"(",
"prefix",
",",
"url",
")",
";",
"}"
] | Registers a namespace in the environment, so the prefix can be used in
XPath expressions.
@param prefix prefix to be used in XPath expressions.
@param url namespace URI the prefix should map to. | [
"Registers",
"a",
"namespace",
"in",
"the",
"environment",
"so",
"the",
"prefix",
"can",
"be",
"used",
"in",
"XPath",
"expressions",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/fit/SoapCallMapColumnFixture.java#L21-L23 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java | VirtualNetworkTapsInner.beginUpdateTagsAsync | public Observable<VirtualNetworkTapInner> beginUpdateTagsAsync(String resourceGroupName, String tapName) {
"""
Updates an VirtualNetworkTap tags.
@param resourceGroupName The name of the resource group.
@param tapName The name of the tap.
@throws IllegalArgumentException thrown if parameters fail the validati... | java | public Observable<VirtualNetworkTapInner> beginUpdateTagsAsync(String resourceGroupName, String tapName) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, tapName).map(new Func1<ServiceResponse<VirtualNetworkTapInner>, VirtualNetworkTapInner>() {
@Override
public Virtua... | [
"public",
"Observable",
"<",
"VirtualNetworkTapInner",
">",
"beginUpdateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"tapName",
")",
"{",
"return",
"beginUpdateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"tapName",
")",
".",
"map",
"(... | Updates an VirtualNetworkTap tags.
@param resourceGroupName The name of the resource group.
@param tapName The name of the tap.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the VirtualNetworkTapInner object | [
"Updates",
"an",
"VirtualNetworkTap",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java#L697-L704 |
asterisk-java/asterisk-java | src/main/java/org/asteriskjava/util/DateUtil.java | DateUtil.parseDateTime | public static Date parseDateTime(String s, TimeZone tz) {
"""
Converts a date in the form of "yy-MM-dd HH:mm:ss" to a Date object using
the given time zone.
@param s date string in the form of "yy-MM-dd HH:mm:ss"
@param tz the timezone to use or <code>null</code> for the default time
zone.
@return the corre... | java | public static Date parseDateTime(String s, TimeZone tz)
{
DateFormat df;
if (s == null)
{
return null;
}
df = new SimpleDateFormat(DATE_TIME_PATTERN);
if (tz != null)
{
df.setTimeZone(tz);
}
try
{
r... | [
"public",
"static",
"Date",
"parseDateTime",
"(",
"String",
"s",
",",
"TimeZone",
"tz",
")",
"{",
"DateFormat",
"df",
";",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"df",
"=",
"new",
"SimpleDateFormat",
"(",
"DATE_TIME_PATTERN",... | Converts a date in the form of "yy-MM-dd HH:mm:ss" to a Date object using
the given time zone.
@param s date string in the form of "yy-MM-dd HH:mm:ss"
@param tz the timezone to use or <code>null</code> for the default time
zone.
@return the corresponding Java date object or <code>null</code> if it is
not parsable. | [
"Converts",
"a",
"date",
"in",
"the",
"form",
"of",
"yy",
"-",
"MM",
"-",
"dd",
"HH",
":",
"mm",
":",
"ss",
"to",
"a",
"Date",
"object",
"using",
"the",
"given",
"time",
"zone",
"."
] | train | https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/util/DateUtil.java#L95-L117 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.loadBalancing_serviceName_probeIp_GET | public ArrayList<String> loadBalancing_serviceName_probeIp_GET(String serviceName, OvhLoadBalancingZoneEnum zone) throws IOException {
"""
Ip subnet used to send probes to your backends
REST: GET /ip/loadBalancing/{serviceName}/probeIp
@param zone [required] one of your ip loadbalancing's zone
@param serviceN... | java | public ArrayList<String> loadBalancing_serviceName_probeIp_GET(String serviceName, OvhLoadBalancingZoneEnum zone) throws IOException {
String qPath = "/ip/loadBalancing/{serviceName}/probeIp";
StringBuilder sb = path(qPath, serviceName);
query(sb, "zone", zone);
String resp = exec(qPath, "GET", sb.toString(), n... | [
"public",
"ArrayList",
"<",
"String",
">",
"loadBalancing_serviceName_probeIp_GET",
"(",
"String",
"serviceName",
",",
"OvhLoadBalancingZoneEnum",
"zone",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/loadBalancing/{serviceName}/probeIp\"",
";",
"StringB... | Ip subnet used to send probes to your backends
REST: GET /ip/loadBalancing/{serviceName}/probeIp
@param zone [required] one of your ip loadbalancing's zone
@param serviceName [required] The internal name of your IP load balancing | [
"Ip",
"subnet",
"used",
"to",
"send",
"probes",
"to",
"your",
"backends"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L1584-L1590 |
perwendel/spark | src/main/java/spark/Request.java | Request.queryParamOrDefault | public String queryParamOrDefault(String queryParam, String defaultValue) {
"""
Gets the query param, or returns default value
@param queryParam the query parameter
@param defaultValue the default value
@return the value of the provided queryParam, or default if value is null
Example: query parameter 'id' ... | java | public String queryParamOrDefault(String queryParam, String defaultValue) {
String value = queryParams(queryParam);
return value != null ? value : defaultValue;
} | [
"public",
"String",
"queryParamOrDefault",
"(",
"String",
"queryParam",
",",
"String",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"queryParams",
"(",
"queryParam",
")",
";",
"return",
"value",
"!=",
"null",
"?",
"value",
":",
"defaultValue",
";",
"}"
] | Gets the query param, or returns default value
@param queryParam the query parameter
@param defaultValue the default value
@return the value of the provided queryParam, or default if value is null
Example: query parameter 'id' from the following request URI: /hello?id=foo | [
"Gets",
"the",
"query",
"param",
"or",
"returns",
"default",
"value"
] | train | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Request.java#L303-L306 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java | AbstractDirector.fireProgressEvent | void fireProgressEvent(int state, int progress, String message) {
"""
Creates a Progress event message.
@param state the state integer
@param progress the progress integer
@param message the message to be displayed
"""
try {
fireProgressEvent(state, progress, message, false);
}... | java | void fireProgressEvent(int state, int progress, String message) {
try {
fireProgressEvent(state, progress, message, false);
} catch (InstallException e) {
}
} | [
"void",
"fireProgressEvent",
"(",
"int",
"state",
",",
"int",
"progress",
",",
"String",
"message",
")",
"{",
"try",
"{",
"fireProgressEvent",
"(",
"state",
",",
"progress",
",",
"message",
",",
"false",
")",
";",
"}",
"catch",
"(",
"InstallException",
"e"... | Creates a Progress event message.
@param state the state integer
@param progress the progress integer
@param message the message to be displayed | [
"Creates",
"a",
"Progress",
"event",
"message",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java#L58-L63 |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java | EventHubConnectionsInner.createOrUpdateAsync | public Observable<EventHubConnectionInner> createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionInner parameters) {
"""
Creates or updates a Event Hub connection.
@param resourceGroupName The name of the resource group containing... | java | public Observable<EventHubConnectionInner> createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionNam... | [
"public",
"Observable",
"<",
"EventHubConnectionInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"databaseName",
",",
"String",
"eventHubConnectionName",
",",
"EventHubConnectionInner",
"parameters",
")",
... | Creates or updates a Event Hub connection.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param databaseName The name of the database in the Kusto cluster.
@param eventHubConnectionName The name of the event hub connection.
@para... | [
"Creates",
"or",
"updates",
"a",
"Event",
"Hub",
"connection",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java#L444-L451 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.maxRows | public static DMatrixRMaj maxRows(DMatrixRMaj input , DMatrixRMaj output ) {
"""
<p>
Finds the element with the maximum value along each row in the input matrix and returns the results in a vector:<br>
<br>
b<sub>j</sub> = max(i=1:n ; a<sub>ji</sub>)
</p>
@param input Input matrix
@param output Optional st... | java | public static DMatrixRMaj maxRows(DMatrixRMaj input , DMatrixRMaj output ) {
if( output == null ) {
output = new DMatrixRMaj(input.numRows,1);
} else {
output.reshape(input.numRows,1);
}
for( int row = 0; row < input.numRows; row++ ) {
double max = -D... | [
"public",
"static",
"DMatrixRMaj",
"maxRows",
"(",
"DMatrixRMaj",
"input",
",",
"DMatrixRMaj",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"{",
"output",
"=",
"new",
"DMatrixRMaj",
"(",
"input",
".",
"numRows",
",",
"1",
")",
";",
"}",
... | <p>
Finds the element with the maximum value along each row in the input matrix and returns the results in a vector:<br>
<br>
b<sub>j</sub> = max(i=1:n ; a<sub>ji</sub>)
</p>
@param input Input matrix
@param output Optional storage for output. Reshaped into a column. Modified.
@return Vector containing the sum of eac... | [
"<p",
">",
"Finds",
"the",
"element",
"with",
"the",
"maximum",
"value",
"along",
"each",
"row",
"in",
"the",
"input",
"matrix",
"and",
"returns",
"the",
"results",
"in",
"a",
"vector",
":",
"<br",
">",
"<br",
">",
"b<sub",
">",
"j<",
"/",
"sub",
">"... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L1926-L1946 |
nextreports/nextreports-server | src/ro/nextreports/server/web/analysis/util/DatabaseUtil.java | DatabaseUtil.removeGroupColumns | public static void removeGroupColumns(List<String> selectColumns, List<String> groups) {
"""
Group by columns must be removed if the columns from select sql are deleted
"""
List<String> removedGroups = new ArrayList<String>();
for (String group : groups) {
if (!containsColumnByAlias(selectColumns,... | java | public static void removeGroupColumns(List<String> selectColumns, List<String> groups) {
List<String> removedGroups = new ArrayList<String>();
for (String group : groups) {
if (!containsColumnByAlias(selectColumns, group)) {
removedGroups.add(group);
}
}
groups.removeAll(removedGroups);
} | [
"public",
"static",
"void",
"removeGroupColumns",
"(",
"List",
"<",
"String",
">",
"selectColumns",
",",
"List",
"<",
"String",
">",
"groups",
")",
"{",
"List",
"<",
"String",
">",
"removedGroups",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
"... | Group by columns must be removed if the columns from select sql are deleted | [
"Group",
"by",
"columns",
"must",
"be",
"removed",
"if",
"the",
"columns",
"from",
"select",
"sql",
"are",
"deleted"
] | train | https://github.com/nextreports/nextreports-server/blob/cfce12f5c6d52cb6a739388d50142c6e2e07c55e/src/ro/nextreports/server/web/analysis/util/DatabaseUtil.java#L203-L211 |
vatbub/common | view/core/src/main/java/com/github/vatbub/common/view/core/CustomGroup.java | CustomGroup.getRectangleByCoordinatesPreferBack | public Rectangle getRectangleByCoordinatesPreferBack(double x, double y) {
"""
Gets the rectangle at the specified coordinates if there is one. The coordinates may even point in the middle of a rectangle to be found. Searches from the background to the foreground which means that rectangles behind other rectangles... | java | public Rectangle getRectangleByCoordinatesPreferBack(double x, double y) {
for (Node node : this.getChildren()) {
if (node instanceof Rectangle) {
Rectangle rectangle = (Rectangle) node;
if (x >= rectangle.getX() && x <= (rectangle.getX() + rectangle.getWidth()) && y ... | [
"public",
"Rectangle",
"getRectangleByCoordinatesPreferBack",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"for",
"(",
"Node",
"node",
":",
"this",
".",
"getChildren",
"(",
")",
")",
"{",
"if",
"(",
"node",
"instanceof",
"Rectangle",
")",
"{",
"Rectan... | Gets the rectangle at the specified coordinates if there is one. The coordinates may even point in the middle of a rectangle to be found. Searches from the background to the foreground which means that rectangles behind other rectangles will be preferred.
<br>
<b>Only finds Rectangles, no other shapes</b>
@param x The... | [
"Gets",
"the",
"rectangle",
"at",
"the",
"specified",
"coordinates",
"if",
"there",
"is",
"one",
".",
"The",
"coordinates",
"may",
"even",
"point",
"in",
"the",
"middle",
"of",
"a",
"rectangle",
"to",
"be",
"found",
".",
"Searches",
"from",
"the",
"backgro... | train | https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/view/core/src/main/java/com/github/vatbub/common/view/core/CustomGroup.java#L55-L68 |
threerings/narya | core/src/main/java/com/threerings/presents/dobj/DObject.java | DObject.requestEntryAdd | protected <T extends DSet.Entry> void requestEntryAdd (String name, DSet<T> set, T entry) {
"""
Calls by derived instances when a set adder method was called.
"""
// if we're on the authoritative server, we update the set immediately
boolean applyImmediately = isAuthoritative();
if (app... | java | protected <T extends DSet.Entry> void requestEntryAdd (String name, DSet<T> set, T entry)
{
// if we're on the authoritative server, we update the set immediately
boolean applyImmediately = isAuthoritative();
if (applyImmediately) {
set.add(entry);
}
// dispatch a... | [
"protected",
"<",
"T",
"extends",
"DSet",
".",
"Entry",
">",
"void",
"requestEntryAdd",
"(",
"String",
"name",
",",
"DSet",
"<",
"T",
">",
"set",
",",
"T",
"entry",
")",
"{",
"// if we're on the authoritative server, we update the set immediately",
"boolean",
"app... | Calls by derived instances when a set adder method was called. | [
"Calls",
"by",
"derived",
"instances",
"when",
"a",
"set",
"adder",
"method",
"was",
"called",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L890-L899 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/symmetric/SymmetricCrypto.java | SymmetricCrypto.init | public SymmetricCrypto init(String algorithm, SecretKey key) {
"""
初始化
@param algorithm 算法
@param key 密钥,如果为<code>null</code>自动生成一个key
@return {@link SymmetricCrypto}
"""
this.secretKey = key;
if (algorithm.startsWith("PBE")) {
// 对于PBE算法使用随机数加盐
this.params = new PBEParameterSpec(RandomUtil.... | java | public SymmetricCrypto init(String algorithm, SecretKey key) {
this.secretKey = key;
if (algorithm.startsWith("PBE")) {
// 对于PBE算法使用随机数加盐
this.params = new PBEParameterSpec(RandomUtil.randomBytes(8), 100);
}
this.cipher = SecureUtil.createCipher(algorithm);
return this;
} | [
"public",
"SymmetricCrypto",
"init",
"(",
"String",
"algorithm",
",",
"SecretKey",
"key",
")",
"{",
"this",
".",
"secretKey",
"=",
"key",
";",
"if",
"(",
"algorithm",
".",
"startsWith",
"(",
"\"PBE\"",
")",
")",
"{",
"// 对于PBE算法使用随机数加盐\r",
"this",
".",
"pa... | 初始化
@param algorithm 算法
@param key 密钥,如果为<code>null</code>自动生成一个key
@return {@link SymmetricCrypto} | [
"初始化"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/symmetric/SymmetricCrypto.java#L127-L135 |
steveash/jopenfst | src/main/java/com/github/steveash/jopenfst/operations/Compose.java | Compose.composeWithPrecomputed | public static MutableFst composeWithPrecomputed(MutableFst fst1, PrecomputedComposeFst fst2, boolean useSorted, boolean trimOutput) {
"""
Executes a compose of fst1 o fst2, with fst2 being a precomputed/preprocessed fst (for performance reasons)
@param fst1 outer fst
@param fst2 inner fst
@param useSorted if tr... | java | public static MutableFst composeWithPrecomputed(MutableFst fst1, PrecomputedComposeFst fst2, boolean useSorted, boolean trimOutput) {
fst1.throwIfInvalid();
if (useSorted) {
if (fst1.getOutputSymbols() != fst2.getFstInputSymbolsAsFrozen() &&
fst1.getOutputSymbols() != fst2.getFst().getInputSymbo... | [
"public",
"static",
"MutableFst",
"composeWithPrecomputed",
"(",
"MutableFst",
"fst1",
",",
"PrecomputedComposeFst",
"fst2",
",",
"boolean",
"useSorted",
",",
"boolean",
"trimOutput",
")",
"{",
"fst1",
".",
"throwIfInvalid",
"(",
")",
";",
"if",
"(",
"useSorted",
... | Executes a compose of fst1 o fst2, with fst2 being a precomputed/preprocessed fst (for performance reasons)
@param fst1 outer fst
@param fst2 inner fst
@param useSorted if true, then performance will be faster; NOTE fst1 must be sorted by OUTPUT labels
@param trimOutput if true, then output will be trimmed before retur... | [
"Executes",
"a",
"compose",
"of",
"fst1",
"o",
"fst2",
"with",
"fst2",
"being",
"a",
"precomputed",
"/",
"preprocessed",
"fst",
"(",
"for",
"performance",
"reasons",
")"
] | train | https://github.com/steveash/jopenfst/blob/4c675203015c1cfad2072556cb532b6edc73261d/src/main/java/com/github/steveash/jopenfst/operations/Compose.java#L95-L121 |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/BaasDocument.java | BaasDocument.fetchAll | public static RequestToken fetchAll(String collection, BaasQuery.Criteria filter, int flags, BaasHandler<List<BaasDocument>> handler) {
"""
Asynchronously retrieves the list of documents readable to the user
in <code>collection</code>
@param collection the collection to retrieve not <code>null</code>
@param f... | java | public static RequestToken fetchAll(String collection, BaasQuery.Criteria filter, int flags, BaasHandler<List<BaasDocument>> handler) {
BaasBox box = BaasBox.getDefaultChecked();
if (collection == null) throw new IllegalArgumentException("collection cannot be null");
Fetch f = new Fetch(box, col... | [
"public",
"static",
"RequestToken",
"fetchAll",
"(",
"String",
"collection",
",",
"BaasQuery",
".",
"Criteria",
"filter",
",",
"int",
"flags",
",",
"BaasHandler",
"<",
"List",
"<",
"BaasDocument",
">",
">",
"handler",
")",
"{",
"BaasBox",
"box",
"=",
"BaasBo... | Asynchronously retrieves the list of documents readable to the user
in <code>collection</code>
@param collection the collection to retrieve not <code>null</code>
@param flags {@link RequestOptions}
@param handler a callback to be invoked with the result of the request
@return a {@link com.baasbox.android.RequestTok... | [
"Asynchronously",
"retrieves",
"the",
"list",
"of",
"documents",
"readable",
"to",
"the",
"user",
"in",
"<code",
">",
"collection<",
"/",
"code",
">"
] | train | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasDocument.java#L258-L263 |
entrusc/xdata | src/main/java/com/moebiusgames/xdata/DataNode.java | DataNode.setObjectList | public <T> void setObjectList(ListDataKey<T> key, List<T> objects) {
"""
stores a list of objects for a given key
@param <T>
@param key a list data key (where isList is set to true)
@param objects
"""
if (key == null) {
throw new IllegalArgumentException("key must not be null");
... | java | public <T> void setObjectList(ListDataKey<T> key, List<T> objects) {
if (key == null) {
throw new IllegalArgumentException("key must not be null");
}
if (objects == null && !key.allowNull()) {
throw new IllegalArgumentException("list key \"" + key.getName() + "\" disallow... | [
"public",
"<",
"T",
">",
"void",
"setObjectList",
"(",
"ListDataKey",
"<",
"T",
">",
"key",
",",
"List",
"<",
"T",
">",
"objects",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"key must not be nul... | stores a list of objects for a given key
@param <T>
@param key a list data key (where isList is set to true)
@param objects | [
"stores",
"a",
"list",
"of",
"objects",
"for",
"a",
"given",
"key"
] | train | https://github.com/entrusc/xdata/blob/44ba4c59fd639c99b89fc8995ba83fe89ca4239d/src/main/java/com/moebiusgames/xdata/DataNode.java#L130-L138 |
chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java | CalligraphyUtils.applyTypefaceSpan | public static CharSequence applyTypefaceSpan(CharSequence s, Typeface typeface) {
"""
Applies a custom typeface span to the text.
@param s text to apply it too.
@param typeface typeface to apply.
@return Either the passed in Object or new Spannable with the typeface span applied.
"""
if (s ... | java | public static CharSequence applyTypefaceSpan(CharSequence s, Typeface typeface) {
if (s != null && s.length() > 0) {
if (!(s instanceof Spannable)) {
s = new SpannableString(s);
}
((Spannable) s).setSpan(TypefaceUtils.getSpan(typeface), 0, s.length(), Spanned.... | [
"public",
"static",
"CharSequence",
"applyTypefaceSpan",
"(",
"CharSequence",
"s",
",",
"Typeface",
"typeface",
")",
"{",
"if",
"(",
"s",
"!=",
"null",
"&&",
"s",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"if",
"(",
"!",
"(",
"s",
"instanceof",
"S... | Applies a custom typeface span to the text.
@param s text to apply it too.
@param typeface typeface to apply.
@return Either the passed in Object or new Spannable with the typeface span applied. | [
"Applies",
"a",
"custom",
"typeface",
"span",
"to",
"the",
"text",
"."
] | train | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java#L34-L42 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/Transformation2D.java | Transformation2D.setFlipY | public void setFlipY(double y0, double y1) {
"""
Sets the transformation to be a flip around the Y axis. Flips the Y
coordinates so that the y0 becomes y1 and vice verse.
@param y0
The Y coordinate to flip.
@param y1
The Y coordinate to flip to.
"""
xx = 1;
xy = 0;
xd = 0;
yx = 0;
yy = -1;
y... | java | public void setFlipY(double y0, double y1) {
xx = 1;
xy = 0;
xd = 0;
yx = 0;
yy = -1;
yd = y0 + y1;
} | [
"public",
"void",
"setFlipY",
"(",
"double",
"y0",
",",
"double",
"y1",
")",
"{",
"xx",
"=",
"1",
";",
"xy",
"=",
"0",
";",
"xd",
"=",
"0",
";",
"yx",
"=",
"0",
";",
"yy",
"=",
"-",
"1",
";",
"yd",
"=",
"y0",
"+",
"y1",
";",
"}"
] | Sets the transformation to be a flip around the Y axis. Flips the Y
coordinates so that the y0 becomes y1 and vice verse.
@param y0
The Y coordinate to flip.
@param y1
The Y coordinate to flip to. | [
"Sets",
"the",
"transformation",
"to",
"be",
"a",
"flip",
"around",
"the",
"Y",
"axis",
".",
"Flips",
"the",
"Y",
"coordinates",
"so",
"that",
"the",
"y0",
"becomes",
"y1",
"and",
"vice",
"verse",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/Transformation2D.java#L641-L648 |
Impetus/Kundera | src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java | HBaseDataHandler.writeHbaseRowInATable | private void writeHbaseRowInATable(String tableName, HBaseRow hbaseRow) throws IOException {
"""
Write hbase row in a table.
@param tableName
the table name
@param hbaseRow
the hbase row
@throws IOException
Signals that an I/O exception has occurred.
"""
Table hTable = gethTable(tableName);
... | java | private void writeHbaseRowInATable(String tableName, HBaseRow hbaseRow) throws IOException
{
Table hTable = gethTable(tableName);
((HBaseWriter) hbaseWriter).writeRow(hTable, hbaseRow);
hTable.close();
} | [
"private",
"void",
"writeHbaseRowInATable",
"(",
"String",
"tableName",
",",
"HBaseRow",
"hbaseRow",
")",
"throws",
"IOException",
"{",
"Table",
"hTable",
"=",
"gethTable",
"(",
"tableName",
")",
";",
"(",
"(",
"HBaseWriter",
")",
"hbaseWriter",
")",
".",
"wri... | Write hbase row in a table.
@param tableName
the table name
@param hbaseRow
the hbase row
@throws IOException
Signals that an I/O exception has occurred. | [
"Write",
"hbase",
"row",
"in",
"a",
"table",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java#L316-L321 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java | FileWriter.write | public File write(byte[] data, int off, int len) throws IORuntimeException {
"""
写入数据到文件
@param data 数据
@param off 数据开始位置
@param len 数据长度
@return 目标文件
@throws IORuntimeException IO异常
"""
return write(data, off, len, false);
} | java | public File write(byte[] data, int off, int len) throws IORuntimeException {
return write(data, off, len, false);
} | [
"public",
"File",
"write",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IORuntimeException",
"{",
"return",
"write",
"(",
"data",
",",
"off",
",",
"len",
",",
"false",
")",
";",
"}"
] | 写入数据到文件
@param data 数据
@param off 数据开始位置
@param len 数据长度
@return 目标文件
@throws IORuntimeException IO异常 | [
"写入数据到文件"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java#L260-L262 |
uniform-java/uniform | src/main/java/net/uniform/impl/ElementWithOptions.java | ElementWithOptions.setOptions | public ElementWithOptions setOptions(LinkedHashMap<String, String> options) {
"""
Replaces all options of this element.
@param options Options to use. {@link LinkedHashMap} to keep options original ordering.
@return This element
"""
this.optionGroups.clear();
for (Map.Entry<String, String... | java | public ElementWithOptions setOptions(LinkedHashMap<String, String> options) {
this.optionGroups.clear();
for (Map.Entry<String, String> entry : options.entrySet()) {
this.addOption(entry.getKey(), entry.getValue());
}
return this;
} | [
"public",
"ElementWithOptions",
"setOptions",
"(",
"LinkedHashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"this",
".",
"optionGroups",
".",
"clear",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"ent... | Replaces all options of this element.
@param options Options to use. {@link LinkedHashMap} to keep options original ordering.
@return This element | [
"Replaces",
"all",
"options",
"of",
"this",
"element",
"."
] | train | https://github.com/uniform-java/uniform/blob/0b84f0db562253165bc06c69f631e464dca0cb48/src/main/java/net/uniform/impl/ElementWithOptions.java#L283-L290 |
ecclesia/kipeto | kipeto-core/src/main/java/de/ecclesia/kipeto/blueprint/DirectoryItem.java | DirectoryItem.fromStream | public static DirectoryItem fromStream(DataInputStream dataInputStream) throws IOException {
"""
Deserialisiert ein DirectoryItem aus einem übergebenen InputStream.
@param dataInputStream
Quelle der Deserialisierung
@return DirectoryItem
@throws IOException
"""
// Über die Version kann gesteuert werden... | java | public static DirectoryItem fromStream(DataInputStream dataInputStream) throws IOException {
// Über die Version kann gesteuert werden, wieviele Felder gelesen
// werden. Das ist aus Gründen der Abwärtskompatibilität notwendig.
// Neue Felder dürfen nur am Ende hinzugefügt werden. Die Version
// muss dann herau... | [
"public",
"static",
"DirectoryItem",
"fromStream",
"(",
"DataInputStream",
"dataInputStream",
")",
"throws",
"IOException",
"{",
"// Über die Version kann gesteuert werden, wieviele Felder gelesen",
"// werden. Das ist aus Gründen der Abwärtskompatibilität notwendig.",
"// Neue Felder dürf... | Deserialisiert ein DirectoryItem aus einem übergebenen InputStream.
@param dataInputStream
Quelle der Deserialisierung
@return DirectoryItem
@throws IOException | [
"Deserialisiert",
"ein",
"DirectoryItem",
"aus",
"einem",
"übergebenen",
"InputStream",
"."
] | train | https://github.com/ecclesia/kipeto/blob/ea39a10ae4eaa550f71a856ab2f2845270a64913/kipeto-core/src/main/java/de/ecclesia/kipeto/blueprint/DirectoryItem.java#L98-L114 |
tvesalainen/util | util/src/main/java/org/vesalainen/bean/BeanHelper.java | BeanHelper.hasProperty | public static final boolean hasProperty(Object bean, String property) {
"""
Return true if property exists.
@param bean
@param property
@return
"""
try
{
return (boolean) doFor(
bean,
property,
null,
(Object... | java | public static final boolean hasProperty(Object bean, String property)
{
try
{
return (boolean) doFor(
bean,
property,
null,
(Object a, int i)->{return true;},
(List l, int i)->{return true;},
... | [
"public",
"static",
"final",
"boolean",
"hasProperty",
"(",
"Object",
"bean",
",",
"String",
"property",
")",
"{",
"try",
"{",
"return",
"(",
"boolean",
")",
"doFor",
"(",
"bean",
",",
"property",
",",
"null",
",",
"(",
"Object",
"a",
",",
"int",
"i",
... | Return true if property exists.
@param bean
@param property
@return | [
"Return",
"true",
"if",
"property",
"exists",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/bean/BeanHelper.java#L355-L372 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/YearQuarter.java | YearQuarter.withQuarter | public YearQuarter withQuarter(int quarter) {
"""
Returns a copy of this {@code YearQuarter} with the quarter-of-year altered.
<p>
This instance is immutable and unaffected by this method call.
@param quarter the quarter-of-year to set in the returned year-quarter, from 1 to 4
@return a {@code YearQuarter} ... | java | public YearQuarter withQuarter(int quarter) {
QUARTER_OF_YEAR.range().checkValidValue(quarter, QUARTER_OF_YEAR);
return with(year, Quarter.of(quarter));
} | [
"public",
"YearQuarter",
"withQuarter",
"(",
"int",
"quarter",
")",
"{",
"QUARTER_OF_YEAR",
".",
"range",
"(",
")",
".",
"checkValidValue",
"(",
"quarter",
",",
"QUARTER_OF_YEAR",
")",
";",
"return",
"with",
"(",
"year",
",",
"Quarter",
".",
"of",
"(",
"qu... | Returns a copy of this {@code YearQuarter} with the quarter-of-year altered.
<p>
This instance is immutable and unaffected by this method call.
@param quarter the quarter-of-year to set in the returned year-quarter, from 1 to 4
@return a {@code YearQuarter} based on this year-quarter with the requested quarter, not n... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"YearQuarter",
"}",
"with",
"the",
"quarter",
"-",
"of",
"-",
"year",
"altered",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/YearQuarter.java#L734-L737 |
VoltDB/voltdb | third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java | HelpFormatter.printHelp | public void printHelp(String cmdLineSyntax, Options options) {
"""
Print the help for <code>options</code> with the specified
command line syntax. This method prints help information to
System.out.
@param cmdLineSyntax the syntax for this application
@param options the Options instance
"""
print... | java | public void printHelp(String cmdLineSyntax, Options options)
{
printHelp(getWidth(), cmdLineSyntax, null, options, null, false);
} | [
"public",
"void",
"printHelp",
"(",
"String",
"cmdLineSyntax",
",",
"Options",
"options",
")",
"{",
"printHelp",
"(",
"getWidth",
"(",
")",
",",
"cmdLineSyntax",
",",
"null",
",",
"options",
",",
"null",
",",
"false",
")",
";",
"}"
] | Print the help for <code>options</code> with the specified
command line syntax. This method prints help information to
System.out.
@param cmdLineSyntax the syntax for this application
@param options the Options instance | [
"Print",
"the",
"help",
"for",
"<code",
">",
"options<",
"/",
"code",
">",
"with",
"the",
"specified",
"command",
"line",
"syntax",
".",
"This",
"method",
"prints",
"help",
"information",
"to",
"System",
".",
"out",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java#L406-L409 |
GoogleCloudPlatform/appengine-plugins-core | src/main/java/com/google/cloud/tools/appengine/operations/Deployment.java | Deployment.deployConfig | @VisibleForTesting
void deployConfig(String filename, DeployProjectConfigurationConfiguration configuration)
throws AppEngineException {
"""
Common configuration deployment function.
@param filename Yaml file that we want to deploy (cron.yaml, dos.yaml, etc)
@param configuration Deployment configuratio... | java | @VisibleForTesting
void deployConfig(String filename, DeployProjectConfigurationConfiguration configuration)
throws AppEngineException {
Preconditions.checkNotNull(configuration);
Preconditions.checkNotNull(configuration.getAppEngineDirectory());
Path deployable = configuration.getAppEngineDirector... | [
"@",
"VisibleForTesting",
"void",
"deployConfig",
"(",
"String",
"filename",
",",
"DeployProjectConfigurationConfiguration",
"configuration",
")",
"throws",
"AppEngineException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"configuration",
")",
";",
"Preconditions",
"... | Common configuration deployment function.
@param filename Yaml file that we want to deploy (cron.yaml, dos.yaml, etc)
@param configuration Deployment configuration | [
"Common",
"configuration",
"deployment",
"function",
"."
] | train | https://github.com/GoogleCloudPlatform/appengine-plugins-core/blob/d22e9fa1103522409ab6fdfbf68c4a5a0bc5b97d/src/main/java/com/google/cloud/tools/appengine/operations/Deployment.java#L126-L148 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java | QrCodeDecoderBits.updateModeLogic | private QrCode.Mode updateModeLogic( QrCode.Mode current , QrCode.Mode candidate ) {
"""
If only one mode then that mode is used. If more than one mode is used then set to multiple
"""
if( current == candidate )
return current;
else if( current == QrCode.Mode.UNKNOWN ) {
return candidate;
} else {
... | java | private QrCode.Mode updateModeLogic( QrCode.Mode current , QrCode.Mode candidate )
{
if( current == candidate )
return current;
else if( current == QrCode.Mode.UNKNOWN ) {
return candidate;
} else {
return QrCode.Mode.MIXED;
}
} | [
"private",
"QrCode",
".",
"Mode",
"updateModeLogic",
"(",
"QrCode",
".",
"Mode",
"current",
",",
"QrCode",
".",
"Mode",
"candidate",
")",
"{",
"if",
"(",
"current",
"==",
"candidate",
")",
"return",
"current",
";",
"else",
"if",
"(",
"current",
"==",
"Qr... | If only one mode then that mode is used. If more than one mode is used then set to multiple | [
"If",
"only",
"one",
"mode",
"then",
"that",
"mode",
"is",
"used",
".",
"If",
"more",
"than",
"one",
"mode",
"is",
"used",
"then",
"set",
"to",
"multiple"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java#L188-L197 |
infinispan/infinispan | core/src/main/java/org/infinispan/io/GridFile.java | GridFile.isChildOf | protected static boolean isChildOf(String parent, String child) {
"""
Verifies whether child is a child (dir or file) of parent
@param parent
@param child
@return True if child is a child, false otherwise
"""
if (parent == null || child == null)
return false;
if (!child.startsWith((pa... | java | protected static boolean isChildOf(String parent, String child) {
if (parent == null || child == null)
return false;
if (!child.startsWith((parent.endsWith(SEPARATOR) ? parent : parent + SEPARATOR)))
return false;
if (child.length() <= parent.length())
return false;
in... | [
"protected",
"static",
"boolean",
"isChildOf",
"(",
"String",
"parent",
",",
"String",
"child",
")",
"{",
"if",
"(",
"parent",
"==",
"null",
"||",
"child",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"!",
"child",
".",
"startsWith",
"(",
"(",... | Verifies whether child is a child (dir or file) of parent
@param parent
@param child
@return True if child is a child, false otherwise | [
"Verifies",
"whether",
"child",
"is",
"a",
"child",
"(",
"dir",
"or",
"file",
")",
"of",
"parent"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/io/GridFile.java#L351-L363 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/TransactionImpl.java | TransactionImpl.afterLoading | public void afterLoading(CollectionProxyDefaultImpl colProxy) {
"""
Remove colProxy from list of pending collections and
register its contents with the transaction.
"""
if (log.isDebugEnabled()) log.debug("loading a proxied collection a collection: " + colProxy);
Collection data = colProxy.g... | java | public void afterLoading(CollectionProxyDefaultImpl colProxy)
{
if (log.isDebugEnabled()) log.debug("loading a proxied collection a collection: " + colProxy);
Collection data = colProxy.getData();
for (Iterator iterator = data.iterator(); iterator.hasNext();)
{
Obje... | [
"public",
"void",
"afterLoading",
"(",
"CollectionProxyDefaultImpl",
"colProxy",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"log",
".",
"debug",
"(",
"\"loading a proxied collection a collection: \"",
"+",
"colProxy",
")",
";",
"Collection",
... | Remove colProxy from list of pending collections and
register its contents with the transaction. | [
"Remove",
"colProxy",
"from",
"list",
"of",
"pending",
"collections",
"and",
"register",
"its",
"contents",
"with",
"the",
"transaction",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/TransactionImpl.java#L1259-L1282 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/remote/http/dialect/impl/HttpNeo4jSequenceGenerator.java | HttpNeo4jSequenceGenerator.addUniqueConstraintForTableBasedSequence | private void addUniqueConstraintForTableBasedSequence(Statements statements, IdSourceKeyMetadata generatorKeyMetadata) {
"""
Adds a unique constraint to make sure that each node of the same "sequence table" is unique.
"""
Statement statement = createUniqueConstraintStatement( generatorKeyMetadata.getKeyColum... | java | private void addUniqueConstraintForTableBasedSequence(Statements statements, IdSourceKeyMetadata generatorKeyMetadata) {
Statement statement = createUniqueConstraintStatement( generatorKeyMetadata.getKeyColumnName(), generatorKeyMetadata.getName() );
statements.addStatement( statement );
} | [
"private",
"void",
"addUniqueConstraintForTableBasedSequence",
"(",
"Statements",
"statements",
",",
"IdSourceKeyMetadata",
"generatorKeyMetadata",
")",
"{",
"Statement",
"statement",
"=",
"createUniqueConstraintStatement",
"(",
"generatorKeyMetadata",
".",
"getKeyColumnName",
... | Adds a unique constraint to make sure that each node of the same "sequence table" is unique. | [
"Adds",
"a",
"unique",
"constraint",
"to",
"make",
"sure",
"that",
"each",
"node",
"of",
"the",
"same",
"sequence",
"table",
"is",
"unique",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/remote/http/dialect/impl/HttpNeo4jSequenceGenerator.java#L101-L104 |
jalkanen/speed4j | src/main/java/com/ecyrd/speed4j/StopWatchFactory.java | StopWatchFactory.getStopWatch | public StopWatch getStopWatch( String tag, String message ) {
"""
Returns a StopWatch for the given tag and given message.
@param tag Tag which identifies this StopWatch.
@param message A free-form message.
@return A new StopWatch.
"""
return new LoggingStopWatch( m_log, tag, message );
} | java | public StopWatch getStopWatch( String tag, String message )
{
return new LoggingStopWatch( m_log, tag, message );
} | [
"public",
"StopWatch",
"getStopWatch",
"(",
"String",
"tag",
",",
"String",
"message",
")",
"{",
"return",
"new",
"LoggingStopWatch",
"(",
"m_log",
",",
"tag",
",",
"message",
")",
";",
"}"
] | Returns a StopWatch for the given tag and given message.
@param tag Tag which identifies this StopWatch.
@param message A free-form message.
@return A new StopWatch. | [
"Returns",
"a",
"StopWatch",
"for",
"the",
"given",
"tag",
"and",
"given",
"message",
"."
] | train | https://github.com/jalkanen/speed4j/blob/1d2db9c9b9def869c25fedb9bbd7cf95c39023bd/src/main/java/com/ecyrd/speed4j/StopWatchFactory.java#L247-L250 |
vkostyukov/la4j | src/main/java/org/la4j/Matrix.java | Matrix.columnMajorIterator | public ColumnMajorMatrixIterator columnMajorIterator() {
"""
Returns a column-major matrix iterator.
@return a column-major matrix iterator.
"""
return new ColumnMajorMatrixIterator(rows, columns) {
private long limit = (long) rows * columns;
private int i = -1;
... | java | public ColumnMajorMatrixIterator columnMajorIterator() {
return new ColumnMajorMatrixIterator(rows, columns) {
private long limit = (long) rows * columns;
private int i = -1;
@Override
public int rowIndex() {
return i - columnIndex() * rows;
... | [
"public",
"ColumnMajorMatrixIterator",
"columnMajorIterator",
"(",
")",
"{",
"return",
"new",
"ColumnMajorMatrixIterator",
"(",
"rows",
",",
"columns",
")",
"{",
"private",
"long",
"limit",
"=",
"(",
"long",
")",
"rows",
"*",
"columns",
";",
"private",
"int",
... | Returns a column-major matrix iterator.
@return a column-major matrix iterator. | [
"Returns",
"a",
"column",
"-",
"major",
"matrix",
"iterator",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrix.java#L1938-L1977 |
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/utils/ContentSpecUtilities.java | ContentSpecUtilities.getTopicTitleWithConditions | public static String getTopicTitleWithConditions(final ITopicNode specTopic, final BaseTopicWrapper<?> topic) {
"""
Gets a Topics title with conditional statements applied
@param specTopic The TopicNode of the topic to get the title for.
@param topic The actual topic to get the non-processed title from.
@... | java | public static String getTopicTitleWithConditions(final ITopicNode specTopic, final BaseTopicWrapper<?> topic) {
final String condition = specTopic.getConditionStatement(true);
if (condition != null && topic.getTitle() != null && topic.getTitle().contains("condition")) {
try {
... | [
"public",
"static",
"String",
"getTopicTitleWithConditions",
"(",
"final",
"ITopicNode",
"specTopic",
",",
"final",
"BaseTopicWrapper",
"<",
"?",
">",
"topic",
")",
"{",
"final",
"String",
"condition",
"=",
"specTopic",
".",
"getConditionStatement",
"(",
"true",
"... | Gets a Topics title with conditional statements applied
@param specTopic The TopicNode of the topic to get the title for.
@param topic The actual topic to get the non-processed title from.
@return The processed title that has the conditions applied. | [
"Gets",
"a",
"Topics",
"title",
"with",
"conditional",
"statements",
"applied"
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/ContentSpecUtilities.java#L699-L718 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryDetector.java | QuatSymmetryDetector.calcLocalSymmetries | public static List<QuatSymmetryResults> calcLocalSymmetries(
Structure structure, QuatSymmetryParameters symmParams,
SubunitClustererParameters clusterParams) {
"""
Returns a List of LOCAL symmetry results. This means that a subset of the
{@link SubunitCluster} is left out of the symmetry calculation. Each
... | java | public static List<QuatSymmetryResults> calcLocalSymmetries(
Structure structure, QuatSymmetryParameters symmParams,
SubunitClustererParameters clusterParams) {
Stoichiometry composition = SubunitClusterer.cluster(structure, clusterParams);
return calcLocalSymmetries(composition, symmParams);
} | [
"public",
"static",
"List",
"<",
"QuatSymmetryResults",
">",
"calcLocalSymmetries",
"(",
"Structure",
"structure",
",",
"QuatSymmetryParameters",
"symmParams",
",",
"SubunitClustererParameters",
"clusterParams",
")",
"{",
"Stoichiometry",
"composition",
"=",
"SubunitCluster... | Returns a List of LOCAL symmetry results. This means that a subset of the
{@link SubunitCluster} is left out of the symmetry calculation. Each
element of the List is one possible LOCAL symmetry result.
<p>
Determine local symmetry if global structure is: (1) asymmetric, C1; (2)
heteromeric (belongs to more than 1 subun... | [
"Returns",
"a",
"List",
"of",
"LOCAL",
"symmetry",
"results",
".",
"This",
"means",
"that",
"a",
"subset",
"of",
"the",
"{",
"@link",
"SubunitCluster",
"}",
"is",
"left",
"out",
"of",
"the",
"symmetry",
"calculation",
".",
"Each",
"element",
"of",
"the",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryDetector.java#L149-L155 |
jhy/jsoup | src/main/java/org/jsoup/parser/CharacterReader.java | CharacterReader.cacheString | private static String cacheString(final char[] charBuf, final String[] stringCache, final int start, final int count) {
"""
Caches short strings, as a flywheel pattern, to reduce GC load. Just for this doc, to prevent leaks.
<p />
Simplistic, and on hash collisions just falls back to creating a new string, vs a ... | java | private static String cacheString(final char[] charBuf, final String[] stringCache, final int start, final int count) {
// limit (no cache):
if (count > maxStringCacheLen)
return new String(charBuf, start, count);
if (count < 1)
return "";
// calculate hash:
... | [
"private",
"static",
"String",
"cacheString",
"(",
"final",
"char",
"[",
"]",
"charBuf",
",",
"final",
"String",
"[",
"]",
"stringCache",
",",
"final",
"int",
"start",
",",
"final",
"int",
"count",
")",
"{",
"// limit (no cache):",
"if",
"(",
"count",
">",... | Caches short strings, as a flywheel pattern, to reduce GC load. Just for this doc, to prevent leaks.
<p />
Simplistic, and on hash collisions just falls back to creating a new string, vs a full HashMap with Entry list.
That saves both having to create objects as hash keys, and running through the entry list, at the exp... | [
"Caches",
"short",
"strings",
"as",
"a",
"flywheel",
"pattern",
"to",
"reduce",
"GC",
"load",
".",
"Just",
"for",
"this",
"doc",
"to",
"prevent",
"leaks",
".",
"<p",
"/",
">",
"Simplistic",
"and",
"on",
"hash",
"collisions",
"just",
"falls",
"back",
"to"... | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/parser/CharacterReader.java#L463-L493 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/MediaApi.java | MediaApi.addContent | public ApiSuccessResponse addContent(String mediatype, String id, AddContentData addContentData) throws ApiException {
"""
Create the interaction in UCS database
Create the interaction in UCS database
@param mediatype media-type of interaction (required)
@param id id of the interaction (required)
@param addCon... | java | public ApiSuccessResponse addContent(String mediatype, String id, AddContentData addContentData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = addContentWithHttpInfo(mediatype, id, addContentData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"addContent",
"(",
"String",
"mediatype",
",",
"String",
"id",
",",
"AddContentData",
"addContentData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"addContentWithHttpInfo",
"(",
"medi... | Create the interaction in UCS database
Create the interaction in UCS database
@param mediatype media-type of interaction (required)
@param id id of the interaction (required)
@param addContentData (optional)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserializ... | [
"Create",
"the",
"interaction",
"in",
"UCS",
"database",
"Create",
"the",
"interaction",
"in",
"UCS",
"database"
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/MediaApi.java#L452-L455 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java | StringIterate.forEachTrimmedToken | public static void forEachTrimmedToken(String string, String separator, Procedure<String> procedure) {
"""
For each token in a {@code string} separated by the specified {@code separator}, execute the specified
{@link Procedure}.
"""
for (StringTokenizer stringTokenizer = new StringTokenizer(string, se... | java | public static void forEachTrimmedToken(String string, String separator, Procedure<String> procedure)
{
for (StringTokenizer stringTokenizer = new StringTokenizer(string, separator); stringTokenizer.hasMoreTokens(); )
{
String token = stringTokenizer.nextToken().trim();
proced... | [
"public",
"static",
"void",
"forEachTrimmedToken",
"(",
"String",
"string",
",",
"String",
"separator",
",",
"Procedure",
"<",
"String",
">",
"procedure",
")",
"{",
"for",
"(",
"StringTokenizer",
"stringTokenizer",
"=",
"new",
"StringTokenizer",
"(",
"string",
"... | For each token in a {@code string} separated by the specified {@code separator}, execute the specified
{@link Procedure}. | [
"For",
"each",
"token",
"in",
"a",
"{"
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L318-L325 |
wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/host/controller/jvm/JvmType.java | JvmType.createFromSystemProperty | public static JvmType createFromSystemProperty(boolean forLaunch) {
"""
Create a {@code JvmType} based on the location of the root dir of the JRE/JDK installation, as specified
by the system property {@code java.home}.
@param forLaunch {@code true} if the created object will be used for launching servers; {@code... | java | public static JvmType createFromSystemProperty(boolean forLaunch) {
final String javaHome = WildFlySecurityManager.getPropertyPrivileged(JAVA_HOME_SYS_PROP, null);
return createFromJavaHome(javaHome, forLaunch);
} | [
"public",
"static",
"JvmType",
"createFromSystemProperty",
"(",
"boolean",
"forLaunch",
")",
"{",
"final",
"String",
"javaHome",
"=",
"WildFlySecurityManager",
".",
"getPropertyPrivileged",
"(",
"JAVA_HOME_SYS_PROP",
",",
"null",
")",
";",
"return",
"createFromJavaHome"... | Create a {@code JvmType} based on the location of the root dir of the JRE/JDK installation, as specified
by the system property {@code java.home}.
@param forLaunch {@code true} if the created object will be used for launching servers; {@code false}
if it is simply a data holder. A value of {@code true} will disable
som... | [
"Create",
"a",
"{"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/jvm/JvmType.java#L162-L165 |
dadoonet/elasticsearch-beyonder | src/main/java/fr/pilato/elasticsearch/tools/index/IndexElasticsearchUpdater.java | IndexElasticsearchUpdater.createIndexWithSettingsInElasticsearch | private static void createIndexWithSettingsInElasticsearch(RestClient client, String index, String settings) throws Exception {
"""
Create a new index in Elasticsearch
@param client Elasticsearch client
@param index Index name
@param settings Settings if any, null if no specific settings
@throws Exception if t... | java | private static void createIndexWithSettingsInElasticsearch(RestClient client, String index, String settings) throws Exception {
logger.trace("createIndex([{}])", index);
assert client != null;
assert index != null;
Request request = new Request("PUT", "/" + index);
// If there are settings for this i... | [
"private",
"static",
"void",
"createIndexWithSettingsInElasticsearch",
"(",
"RestClient",
"client",
",",
"String",
"index",
",",
"String",
"settings",
")",
"throws",
"Exception",
"{",
"logger",
".",
"trace",
"(",
"\"createIndex([{}])\"",
",",
"index",
")",
";",
"a... | Create a new index in Elasticsearch
@param client Elasticsearch client
@param index Index name
@param settings Settings if any, null if no specific settings
@throws Exception if the elasticsearch API call is failing | [
"Create",
"a",
"new",
"index",
"in",
"Elasticsearch"
] | train | https://github.com/dadoonet/elasticsearch-beyonder/blob/275bf63432b97169a90a266e983143cca9ad7629/src/main/java/fr/pilato/elasticsearch/tools/index/IndexElasticsearchUpdater.java#L276-L297 |
google/closure-compiler | src/com/google/javascript/jscomp/VarCheck.java | VarCheck.createSynthesizedExternVar | static void createSynthesizedExternVar(AbstractCompiler compiler, String varName) {
"""
Create a new variable in a synthetic script. This will prevent
subsequent compiler passes from crashing.
"""
Node nameNode = IR.name(varName);
// Mark the variable as constant if it matches the coding convention
... | java | static void createSynthesizedExternVar(AbstractCompiler compiler, String varName) {
Node nameNode = IR.name(varName);
// Mark the variable as constant if it matches the coding convention
// for constant vars.
// NOTE(nicksantos): honestly, I'm not sure how much this matters.
// AFAIK, all people wh... | [
"static",
"void",
"createSynthesizedExternVar",
"(",
"AbstractCompiler",
"compiler",
",",
"String",
"varName",
")",
"{",
"Node",
"nameNode",
"=",
"IR",
".",
"name",
"(",
"varName",
")",
";",
"// Mark the variable as constant if it matches the coding convention",
"// for c... | Create a new variable in a synthetic script. This will prevent
subsequent compiler passes from crashing. | [
"Create",
"a",
"new",
"variable",
"in",
"a",
"synthetic",
"script",
".",
"This",
"will",
"prevent",
"subsequent",
"compiler",
"passes",
"from",
"crashing",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/VarCheck.java#L328-L344 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSetDTM.java | NodeSetDTM.removeElement | public boolean removeElement(int s) {
"""
Removes the first occurrence of the argument from this vector.
If the object is found in this vector, each component in the vector
with an index greater or equal to the object's index is shifted
downward to have an index one smaller than the value it had
previously.
... | java | public boolean removeElement(int s)
{
if (!m_mutable)
throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
return super.removeElement(s);
} | [
"public",
"boolean",
"removeElement",
"(",
"int",
"s",
")",
"{",
"if",
"(",
"!",
"m_mutable",
")",
"throw",
"new",
"RuntimeException",
"(",
"XSLMessages",
".",
"createXPATHMessage",
"(",
"XPATHErrorResources",
".",
"ER_NODESETDTM_NOT_MUTABLE",
",",
"null",
")",
... | Removes the first occurrence of the argument from this vector.
If the object is found in this vector, each component in the vector
with an index greater or equal to the object's index is shifted
downward to have an index one smaller than the value it had
previously.
@param s The node to be removed.
@return True if th... | [
"Removes",
"the",
"first",
"occurrence",
"of",
"the",
"argument",
"from",
"this",
"vector",
".",
"If",
"the",
"object",
"is",
"found",
"in",
"this",
"vector",
"each",
"component",
"in",
"the",
"vector",
"with",
"an",
"index",
"greater",
"or",
"equal",
"to"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSetDTM.java#L968-L975 |
nabedge/mixer2 | src/main/java/org/mixer2/xhtml/builder/TableBuilder.java | TableBuilder.addTr | public <T extends AbstractJaxb> TableBuilder addTr(List<Object> tdList)
throws TagTypeUnmatchException {
"""
add new tr having td tags that has content of each value of list.
@param tdList
@return
@throws TagTypeUnmatchException
"""
return addTr(tdList, null);
} | java | public <T extends AbstractJaxb> TableBuilder addTr(List<Object> tdList)
throws TagTypeUnmatchException {
return addTr(tdList, null);
} | [
"public",
"<",
"T",
"extends",
"AbstractJaxb",
">",
"TableBuilder",
"addTr",
"(",
"List",
"<",
"Object",
">",
"tdList",
")",
"throws",
"TagTypeUnmatchException",
"{",
"return",
"addTr",
"(",
"tdList",
",",
"null",
")",
";",
"}"
] | add new tr having td tags that has content of each value of list.
@param tdList
@return
@throws TagTypeUnmatchException | [
"add",
"new",
"tr",
"having",
"td",
"tags",
"that",
"has",
"content",
"of",
"each",
"value",
"of",
"list",
"."
] | train | https://github.com/nabedge/mixer2/blob/8c2db27cfcd65bf0b1e0242ef9362ebd8033777c/src/main/java/org/mixer2/xhtml/builder/TableBuilder.java#L372-L375 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.