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 |
|---|---|---|---|---|---|---|---|---|---|---|
roboconf/roboconf-platform | miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/ApplicationWsDelegate.java | ApplicationWsDelegate.removeInstance | public void removeInstance( String applicationName, String instancePath ) {
"""
Removes an instance.
@param applicationName the application name
@param instancePath the path of the instance to remove
"""
this.logger.finer( String.format( "Removing instance \"%s\" from application \"%s\"...",
insta... | java | public void removeInstance( String applicationName, String instancePath ) {
this.logger.finer( String.format( "Removing instance \"%s\" from application \"%s\"...",
instancePath, applicationName ) );
WebResource path = this.resource
.path( UrlConstants.APP )
.path( applicationName )
.path( "instanc... | [
"public",
"void",
"removeInstance",
"(",
"String",
"applicationName",
",",
"String",
"instancePath",
")",
"{",
"this",
".",
"logger",
".",
"finer",
"(",
"String",
".",
"format",
"(",
"\"Removing instance \\\"%s\\\" from application \\\"%s\\\"...\"",
",",
"instancePath",... | Removes an instance.
@param applicationName the application name
@param instancePath the path of the instance to remove | [
"Removes",
"an",
"instance",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/ApplicationWsDelegate.java#L258-L271 |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/HttpSupport.java | HttpSupport.sendFile | protected HttpBuilder sendFile(File file, boolean delete) throws FileNotFoundException {
"""
Convenience method for downloading files. This method will force the browser to find a handler(external program)
for this file (content type) and will provide a name of file to the browser. This method sets an HTTP heade... | java | protected HttpBuilder sendFile(File file, boolean delete) throws FileNotFoundException {
try{
FileResponse resp = new FileResponse(file, delete);
RequestContext.setControllerResponse(resp);
HttpBuilder builder = new HttpBuilder(resp);
builder.header("Content-Dispo... | [
"protected",
"HttpBuilder",
"sendFile",
"(",
"File",
"file",
",",
"boolean",
"delete",
")",
"throws",
"FileNotFoundException",
"{",
"try",
"{",
"FileResponse",
"resp",
"=",
"new",
"FileResponse",
"(",
"file",
",",
"delete",
")",
";",
"RequestContext",
".",
"se... | Convenience method for downloading files. This method will force the browser to find a handler(external program)
for this file (content type) and will provide a name of file to the browser. This method sets an HTTP header
"Content-Disposition" based on a file name.
@param file file to download.
@param delete true to ... | [
"Convenience",
"method",
"for",
"downloading",
"files",
".",
"This",
"method",
"will",
"force",
"the",
"browser",
"to",
"find",
"a",
"handler",
"(",
"external",
"program",
")",
"for",
"this",
"file",
"(",
"content",
"type",
")",
"and",
"will",
"provide",
"... | train | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/HttpSupport.java#L520-L530 |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java | OrganizationResourceImpl.parseDate | private static DateTime parseDate(String dateStr, DateTime defaultDate, boolean floor) {
"""
Parses a query param representing a date into an actual date object.
"""
if ("now".equals(dateStr)) { //$NON-NLS-1$
return new DateTime();
}
if (dateStr.length() == 10) {
... | java | private static DateTime parseDate(String dateStr, DateTime defaultDate, boolean floor) {
if ("now".equals(dateStr)) { //$NON-NLS-1$
return new DateTime();
}
if (dateStr.length() == 10) {
DateTime parsed = ISODateTimeFormat.date().withZone(DateTimeZone.UTC).parseDateTime(d... | [
"private",
"static",
"DateTime",
"parseDate",
"(",
"String",
"dateStr",
",",
"DateTime",
"defaultDate",
",",
"boolean",
"floor",
")",
"{",
"if",
"(",
"\"now\"",
".",
"equals",
"(",
"dateStr",
")",
")",
"{",
"//$NON-NLS-1$",
"return",
"new",
"DateTime",
"(",
... | Parses a query param representing a date into an actual date object. | [
"Parses",
"a",
"query",
"param",
"representing",
"a",
"date",
"into",
"an",
"actual",
"date",
"object",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java#L3669-L3689 |
wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/host/controller/HostControllerEnvironment.java | HostControllerEnvironment.getFileFromProperty | private File getFileFromProperty(final String name) {
"""
Get a File from configuration.
@param name the name of the property
@return the CanonicalFile form for the given name.
"""
String value = hostSystemProperties.get(name);
File result = (value != null) ? new File(value) : null;
/... | java | private File getFileFromProperty(final String name) {
String value = hostSystemProperties.get(name);
File result = (value != null) ? new File(value) : null;
// AS7-1752 see if a non-existent relative path exists relative to the home dir
if (result != null && homeDir != null && !result.ex... | [
"private",
"File",
"getFileFromProperty",
"(",
"final",
"String",
"name",
")",
"{",
"String",
"value",
"=",
"hostSystemProperties",
".",
"get",
"(",
"name",
")",
";",
"File",
"result",
"=",
"(",
"value",
"!=",
"null",
")",
"?",
"new",
"File",
"(",
"value... | Get a File from configuration.
@param name the name of the property
@return the CanonicalFile form for the given name. | [
"Get",
"a",
"File",
"from",
"configuration",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/HostControllerEnvironment.java#L839-L850 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.copyImage | public static BufferedImage copyImage(Image img, int imageType) {
"""
将已有Image复制新的一份出来
@param img {@link Image}
@param imageType {@link BufferedImage}中的常量,图像类型,例如黑白等
@return {@link BufferedImage}
@see BufferedImage#TYPE_INT_RGB
@see BufferedImage#TYPE_INT_ARGB
@see BufferedImage#TYPE_INT_ARGB_PRE
@see Buf... | java | public static BufferedImage copyImage(Image img, int imageType) {
final BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), imageType);
final Graphics2D bGr = bimage.createGraphics();
bGr.drawImage(img, 0, 0, null);
bGr.dispose();
return bimage;
} | [
"public",
"static",
"BufferedImage",
"copyImage",
"(",
"Image",
"img",
",",
"int",
"imageType",
")",
"{",
"final",
"BufferedImage",
"bimage",
"=",
"new",
"BufferedImage",
"(",
"img",
".",
"getWidth",
"(",
"null",
")",
",",
"img",
".",
"getHeight",
"(",
"nu... | 将已有Image复制新的一份出来
@param img {@link Image}
@param imageType {@link BufferedImage}中的常量,图像类型,例如黑白等
@return {@link BufferedImage}
@see BufferedImage#TYPE_INT_RGB
@see BufferedImage#TYPE_INT_ARGB
@see BufferedImage#TYPE_INT_ARGB_PRE
@see BufferedImage#TYPE_INT_BGR
@see BufferedImage#TYPE_3BYTE_BGR
@see BufferedImage#TYPE_4... | [
"将已有Image复制新的一份出来"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1213-L1220 |
eserating/siren4j | src/main/java/com/google/code/siren4j/util/ReflectionUtils.java | ReflectionUtils.getSetter | public static Method getSetter(Class<?> clazz, Field f) {
"""
Retrieve the setter for the specified class/field if it exists.
@param clazz
@param f
@return
"""
Method setter = null;
for (Method m : clazz.getMethods()) {
if (ReflectionUtils.isSetter(m) &&
... | java | public static Method getSetter(Class<?> clazz, Field f) {
Method setter = null;
for (Method m : clazz.getMethods()) {
if (ReflectionUtils.isSetter(m) &&
m.getName().equals(SETTER_PREFIX + StringUtils.capitalize(f.getName()))) {
setter = m;
... | [
"public",
"static",
"Method",
"getSetter",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Field",
"f",
")",
"{",
"Method",
"setter",
"=",
"null",
";",
"for",
"(",
"Method",
"m",
":",
"clazz",
".",
"getMethods",
"(",
")",
")",
"{",
"if",
"(",
"Reflecti... | Retrieve the setter for the specified class/field if it exists.
@param clazz
@param f
@return | [
"Retrieve",
"the",
"setter",
"for",
"the",
"specified",
"class",
"/",
"field",
"if",
"it",
"exists",
"."
] | train | https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/util/ReflectionUtils.java#L194-L204 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/BitcoinSerializer.java | BitcoinSerializer.makeAddressMessage | @Override
public AddressMessage makeAddressMessage(byte[] payloadBytes, int length) throws ProtocolException {
"""
Make an address message from the payload. Extension point for alternative
serialization format support.
"""
return new AddressMessage(params, payloadBytes, this, length);
} | java | @Override
public AddressMessage makeAddressMessage(byte[] payloadBytes, int length) throws ProtocolException {
return new AddressMessage(params, payloadBytes, this, length);
} | [
"@",
"Override",
"public",
"AddressMessage",
"makeAddressMessage",
"(",
"byte",
"[",
"]",
"payloadBytes",
",",
"int",
"length",
")",
"throws",
"ProtocolException",
"{",
"return",
"new",
"AddressMessage",
"(",
"params",
",",
"payloadBytes",
",",
"this",
",",
"len... | Make an address message from the payload. Extension point for alternative
serialization format support. | [
"Make",
"an",
"address",
"message",
"from",
"the",
"payload",
".",
"Extension",
"point",
"for",
"alternative",
"serialization",
"format",
"support",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/BitcoinSerializer.java#L254-L257 |
apereo/cas | support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/util/OidcAuthorizationRequestSupport.java | OidcAuthorizationRequestSupport.isCasAuthenticationOldForMaxAgeAuthorizationRequest | public static boolean isCasAuthenticationOldForMaxAgeAuthorizationRequest(final WebContext context,
final UserProfile profile) {
"""
Is cas authentication old for max age authorization request?
@param context the context
@param profi... | java | public static boolean isCasAuthenticationOldForMaxAgeAuthorizationRequest(final WebContext context,
final UserProfile profile) {
val authTime = profile.getAttribute(CasProtocolConstants.VALIDATION_CAS_MODEL_ATTRIBUTE_NAME_AUTHENTICAT... | [
"public",
"static",
"boolean",
"isCasAuthenticationOldForMaxAgeAuthorizationRequest",
"(",
"final",
"WebContext",
"context",
",",
"final",
"UserProfile",
"profile",
")",
"{",
"val",
"authTime",
"=",
"profile",
".",
"getAttribute",
"(",
"CasProtocolConstants",
".",
"VALI... | Is cas authentication old for max age authorization request?
@param context the context
@param profile the profile
@return true/false | [
"Is",
"cas",
"authentication",
"old",
"for",
"max",
"age",
"authorization",
"request?"
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/util/OidcAuthorizationRequestSupport.java#L173-L182 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.leftShift | public static File leftShift(File file, byte[] bytes) throws IOException {
"""
Write bytes to a File.
@param file a File
@param bytes the byte array to append to the end of the File
@return the original file
@throws IOException if an IOException occurs.
@since 1.5.0
"""
append(file, bytes);
... | java | public static File leftShift(File file, byte[] bytes) throws IOException {
append(file, bytes);
return file;
} | [
"public",
"static",
"File",
"leftShift",
"(",
"File",
"file",
",",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
"{",
"append",
"(",
"file",
",",
"bytes",
")",
";",
"return",
"file",
";",
"}"
] | Write bytes to a File.
@param file a File
@param bytes the byte array to append to the end of the File
@return the original file
@throws IOException if an IOException occurs.
@since 1.5.0 | [
"Write",
"bytes",
"to",
"a",
"File",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L807-L810 |
deeplearning4j/deeplearning4j | datavec/datavec-local/src/main/java/org/datavec/local/transforms/AnalyzeLocal.java | AnalyzeLocal.analyzeQuality | public static DataQualityAnalysis analyzeQuality(final Schema schema, final RecordReader data) {
"""
Analyze the data quality of data - provides a report on missing values, values that don't comply with schema, etc
@param schema Schema for data
@param data Data to analyze
@return DataQualityAnalysis object
... | java | public static DataQualityAnalysis analyzeQuality(final Schema schema, final RecordReader data) {
int nColumns = schema.numColumns();
List<QualityAnalysisState> states = null;
QualityAnalysisAddFunction addFn = new QualityAnalysisAddFunction(schema);
while(data.hasNext()){
sta... | [
"public",
"static",
"DataQualityAnalysis",
"analyzeQuality",
"(",
"final",
"Schema",
"schema",
",",
"final",
"RecordReader",
"data",
")",
"{",
"int",
"nColumns",
"=",
"schema",
".",
"numColumns",
"(",
")",
";",
"List",
"<",
"QualityAnalysisState",
">",
"states",... | Analyze the data quality of data - provides a report on missing values, values that don't comply with schema, etc
@param schema Schema for data
@param data Data to analyze
@return DataQualityAnalysis object | [
"Analyze",
"the",
"data",
"quality",
"of",
"data",
"-",
"provides",
"a",
"report",
"on",
"missing",
"values",
"values",
"that",
"don",
"t",
"comply",
"with",
"schema",
"etc"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-local/src/main/java/org/datavec/local/transforms/AnalyzeLocal.java#L120-L134 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/stat/ImageLocalNormalization.java | ImageLocalNormalization.zeroMeanStdOne | public void zeroMeanStdOne(Kernel1D kernel, T input , double maxPixelValue , double delta , T output ) {
"""
/*
<p>Normalizes the input image such that local weighted statics are a zero mean and with standard deviation
of 1. The image border is handled by truncating the kernel and renormalizing it so that it's ... | java | public void zeroMeanStdOne(Kernel1D kernel, T input , double maxPixelValue , double delta , T output ) {
// check preconditions and initialize data structures
initialize(input, output);
// avoid overflow issues by ensuring that the max pixel value is 1
T adjusted = ensureMaxValueOfOne(input, maxPixelValue);
... | [
"public",
"void",
"zeroMeanStdOne",
"(",
"Kernel1D",
"kernel",
",",
"T",
"input",
",",
"double",
"maxPixelValue",
",",
"double",
"delta",
",",
"T",
"output",
")",
"{",
"// check preconditions and initialize data structures",
"initialize",
"(",
"input",
",",
"output"... | /*
<p>Normalizes the input image such that local weighted statics are a zero mean and with standard deviation
of 1. The image border is handled by truncating the kernel and renormalizing it so that it's sum is
still one.</p>
<p>output[x,y] = (input[x,y]-mean[x,y])/(stdev[x,y] + delta)</p>
@param kernel Separable ker... | [
"/",
"*",
"<p",
">",
"Normalizes",
"the",
"input",
"image",
"such",
"that",
"local",
"weighted",
"statics",
"are",
"a",
"zero",
"mean",
"and",
"with",
"standard",
"deviation",
"of",
"1",
".",
"The",
"image",
"border",
"is",
"handled",
"by",
"truncating",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/stat/ImageLocalNormalization.java#L90-L117 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/db/QueryBuilder.java | QueryBuilder.getCachedQuery | public CachedInstanceQuery getCachedQuery(final String _key) {
"""
Get the constructed query.
@param _key key to the Query Cache
@return the query
"""
if (this.query == null) {
try {
this.query = new CachedInstanceQuery(_key, this.typeUUID)
... | java | public CachedInstanceQuery getCachedQuery(final String _key)
{
if (this.query == null) {
try {
this.query = new CachedInstanceQuery(_key, this.typeUUID)
.setIncludeChildTypes(isIncludeChildTypes())
.setCompanyDepende... | [
"public",
"CachedInstanceQuery",
"getCachedQuery",
"(",
"final",
"String",
"_key",
")",
"{",
"if",
"(",
"this",
".",
"query",
"==",
"null",
")",
"{",
"try",
"{",
"this",
".",
"query",
"=",
"new",
"CachedInstanceQuery",
"(",
"_key",
",",
"this",
".",
"typ... | Get the constructed query.
@param _key key to the Query Cache
@return the query | [
"Get",
"the",
"constructed",
"query",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/QueryBuilder.java#L989-L1002 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.standardDeviation | public SDVariable standardDeviation(String name, SDVariable x, boolean biasCorrected, int... dimensions) {
"""
Stardard deviation array reduction operation, optionally along specified dimensions
@param name Output variable name
@param x Input variable
@param biasCorrected If true: divide ... | java | public SDVariable standardDeviation(String name, SDVariable x, boolean biasCorrected, int... dimensions) {
return standardDeviation(name, x, biasCorrected, false, dimensions);
} | [
"public",
"SDVariable",
"standardDeviation",
"(",
"String",
"name",
",",
"SDVariable",
"x",
",",
"boolean",
"biasCorrected",
",",
"int",
"...",
"dimensions",
")",
"{",
"return",
"standardDeviation",
"(",
"name",
",",
"x",
",",
"biasCorrected",
",",
"false",
",... | Stardard deviation array reduction operation, optionally along specified dimensions
@param name Output variable name
@param x Input variable
@param biasCorrected If true: divide by (N-1) (i.e., sample stdev). If false: divide by N (population stdev)
@param dimensions Dimensions to reduce over. ... | [
"Stardard",
"deviation",
"array",
"reduction",
"operation",
"optionally",
"along",
"specified",
"dimensions"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L2581-L2583 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/face/AipFace.java | AipFace.search | public JSONObject search(String image, String imageType, String groupIdList, HashMap<String, String> options) {
"""
人脸搜索接口
@param image - 图片信息(**总数据大小应小于10M**),图片上传方式根据image_type来判断
@param imageType - 图片类型 **BASE64**:图片的base64值,base64编码后的图片数据,需urlencode,编码后的图片大小不超过2M;**URL**:图片的 URL地址( 可能由于网络等原因导致下载图片时间过长)**;F... | java | public JSONObject search(String image, String imageType, String groupIdList, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("image", image);
request.addBody("image_type", imageType);
requ... | [
"public",
"JSONObject",
"search",
"(",
"String",
"image",
",",
"String",
"imageType",
",",
"String",
"groupIdList",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"p... | 人脸搜索接口
@param image - 图片信息(**总数据大小应小于10M**),图片上传方式根据image_type来判断
@param imageType - 图片类型 **BASE64**:图片的base64值,base64编码后的图片数据,需urlencode,编码后的图片大小不超过2M;**URL**:图片的 URL地址( 可能由于网络等原因导致下载图片时间过长)**;FACE_TOKEN**: 人脸图片的唯一标识,调用人脸检测接口时,会为每个人脸图片赋予一个唯一的FACE_TOKEN,同一张图片多次检测得到的FACE_TOKEN是同一个
@param groupIdList - 从指定的group中进行查找 用逗... | [
"人脸搜索接口"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/face/AipFace.java#L77-L93 |
atomix/atomix | cluster/src/main/java/io/atomix/cluster/AtomixClusterBuilder.java | AtomixClusterBuilder.withAddress | @Deprecated
public AtomixClusterBuilder withAddress(String host, int port) {
"""
Sets the member host/port.
<p>
The constructed {@link AtomixCluster} will bind to the given host/port for intra-cluster communication. The
provided host should be visible to other nodes in the cluster.
@param host the host nam... | java | @Deprecated
public AtomixClusterBuilder withAddress(String host, int port) {
return withAddress(Address.from(host, port));
} | [
"@",
"Deprecated",
"public",
"AtomixClusterBuilder",
"withAddress",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"return",
"withAddress",
"(",
"Address",
".",
"from",
"(",
"host",
",",
"port",
")",
")",
";",
"}"
] | Sets the member host/port.
<p>
The constructed {@link AtomixCluster} will bind to the given host/port for intra-cluster communication. The
provided host should be visible to other nodes in the cluster.
@param host the host name
@param port the port number
@return the cluster builder
@throws io.atomix.utils.net.Malform... | [
"Sets",
"the",
"member",
"host",
"/",
"port",
".",
"<p",
">",
"The",
"constructed",
"{",
"@link",
"AtomixCluster",
"}",
"will",
"bind",
"to",
"the",
"given",
"host",
"/",
"port",
"for",
"intra",
"-",
"cluster",
"communication",
".",
"The",
"provided",
"h... | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/cluster/src/main/java/io/atomix/cluster/AtomixClusterBuilder.java#L160-L163 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java | SARLJvmModelInferrer.appendGeneratedAnnotation | protected void appendGeneratedAnnotation(JvmAnnotationTarget target, GenerationContext context, String sarlCode) {
"""
Add the @Generated annotation to the given target.
@param target the target of the annotation.
@param context the generation context.
@param sarlCode the code that is the cause of the generat... | java | protected void appendGeneratedAnnotation(JvmAnnotationTarget target, GenerationContext context, String sarlCode) {
final GeneratorConfig config = context.getGeneratorConfig();
if (config.isGenerateGeneratedAnnotation()) {
addAnnotationSafe(target, Generated.class, getClass().getName());
}
if (target instanc... | [
"protected",
"void",
"appendGeneratedAnnotation",
"(",
"JvmAnnotationTarget",
"target",
",",
"GenerationContext",
"context",
",",
"String",
"sarlCode",
")",
"{",
"final",
"GeneratorConfig",
"config",
"=",
"context",
".",
"getGeneratorConfig",
"(",
")",
";",
"if",
"(... | Add the @Generated annotation to the given target.
@param target the target of the annotation.
@param context the generation context.
@param sarlCode the code that is the cause of the generation. | [
"Add",
"the",
"@Generated",
"annotation",
"to",
"the",
"given",
"target",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java#L2486-L2499 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.getLearnedRoutes | public GatewayRouteListResultInner getLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName) {
"""
This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers.
@param resourceGroupName The name of the resource group.
@param virtu... | java | public GatewayRouteListResultInner getLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName) {
return getLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body();
} | [
"public",
"GatewayRouteListResultInner",
"getLearnedRoutes",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
")",
"{",
"return",
"getLearnedRoutesWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkGatewayName",
")",
".",
"to... | This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@throws IllegalArgumentException thrown if parameters fail the v... | [
"This",
"operation",
"retrieves",
"a",
"list",
"of",
"routes",
"the",
"virtual",
"network",
"gateway",
"has",
"learned",
"including",
"routes",
"learned",
"from",
"BGP",
"peers",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L2340-L2342 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.updateVnetGateway | public VnetGatewayInner updateVnetGateway(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) {
"""
Update a Virtual Network gateway.
Update a Virtual Network gateway.
@param resourceGroupName Name of the resource group to which the resource belongs.... | java | public VnetGatewayInner updateVnetGateway(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) {
return updateVnetGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope).toBlocking().single().body();
} | [
"public",
"VnetGatewayInner",
"updateVnetGateway",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"vnetName",
",",
"String",
"gatewayName",
",",
"VnetGatewayInner",
"connectionEnvelope",
")",
"{",
"return",
"updateVnetGatewayWithServiceResponseAsy... | Update a Virtual Network gateway.
Update a Virtual Network gateway.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@param vnetName Name of the Virtual Network.
@param gatewayName Name of the gateway. Only the 'primary' gateway is supported.
... | [
"Update",
"a",
"Virtual",
"Network",
"gateway",
".",
"Update",
"a",
"Virtual",
"Network",
"gateway",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L3279-L3281 |
stevespringett/Alpine | alpine/src/main/java/alpine/persistence/AlpineQueryManager.java | AlpineQueryManager.getConfigProperty | @SuppressWarnings("unchecked")
public ConfigProperty getConfigProperty(final String groupName, final String propertyName) {
"""
Returns a ConfigProperty with the specified groupName and propertyName.
@param groupName the group name of the config property
@param propertyName the name of the property
@return ... | java | @SuppressWarnings("unchecked")
public ConfigProperty getConfigProperty(final String groupName, final String propertyName) {
final Query query = pm.newQuery(ConfigProperty.class, "groupName == :groupName && propertyName == :propertyName");
final List<ConfigProperty> result = (List<ConfigProperty>) qu... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"ConfigProperty",
"getConfigProperty",
"(",
"final",
"String",
"groupName",
",",
"final",
"String",
"propertyName",
")",
"{",
"final",
"Query",
"query",
"=",
"pm",
".",
"newQuery",
"(",
"ConfigProperty"... | Returns a ConfigProperty with the specified groupName and propertyName.
@param groupName the group name of the config property
@param propertyName the name of the property
@return a ConfigProperty object
@since 1.3.0 | [
"Returns",
"a",
"ConfigProperty",
"with",
"the",
"specified",
"groupName",
"and",
"propertyName",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/persistence/AlpineQueryManager.java#L712-L717 |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/internal/io/SchemaTypeAdapter.java | SchemaTypeAdapter.readMap | private Schema readMap(JsonReader reader, Set<String> knownRecords) throws IOException {
"""
Constructs {@link Schema.Type#MAP MAP} type schema from the json input.
@param reader The {@link JsonReader} for streaming json input tokens.
@param knownRecords Set of record name already encountered during the readin... | java | private Schema readMap(JsonReader reader, Set<String> knownRecords) throws IOException {
return Schema.mapOf(readInnerSchema(reader, "keys", knownRecords),
readInnerSchema(reader, "values", knownRecords));
} | [
"private",
"Schema",
"readMap",
"(",
"JsonReader",
"reader",
",",
"Set",
"<",
"String",
">",
"knownRecords",
")",
"throws",
"IOException",
"{",
"return",
"Schema",
".",
"mapOf",
"(",
"readInnerSchema",
"(",
"reader",
",",
"\"keys\"",
",",
"knownRecords",
")",
... | Constructs {@link Schema.Type#MAP MAP} type schema from the json input.
@param reader The {@link JsonReader} for streaming json input tokens.
@param knownRecords Set of record name already encountered during the reading.
@return A {@link Schema} of type {@link Schema.Type#MAP MAP}.
@throws java.io.IOException When fai... | [
"Constructs",
"{",
"@link",
"Schema",
".",
"Type#MAP",
"MAP",
"}",
"type",
"schema",
"from",
"the",
"json",
"input",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/internal/io/SchemaTypeAdapter.java#L177-L180 |
jayantk/jklol | src/com/jayantkrish/jklol/tensor/AbstractTensorBase.java | AbstractTensorBase.mergeDimensions | public static final DimensionSpec mergeDimensions(int[] firstDimensionNums, int[] firstDimensionSizes,
int[] secondDimensionNums, int[] secondDimensionSizes) {
"""
Merges the given sets of dimensions, verifying that any dimensions in
both sets have the same size.
@param firstDimensionNums
@param firstDi... | java | public static final DimensionSpec mergeDimensions(int[] firstDimensionNums, int[] firstDimensionSizes,
int[] secondDimensionNums, int[] secondDimensionSizes) {
SortedSet<Integer> first = Sets.newTreeSet(Ints.asList(firstDimensionNums));
SortedSet<Integer> second = Sets.newTreeSet(Ints.asList(secondDimensi... | [
"public",
"static",
"final",
"DimensionSpec",
"mergeDimensions",
"(",
"int",
"[",
"]",
"firstDimensionNums",
",",
"int",
"[",
"]",
"firstDimensionSizes",
",",
"int",
"[",
"]",
"secondDimensionNums",
",",
"int",
"[",
"]",
"secondDimensionSizes",
")",
"{",
"Sorted... | Merges the given sets of dimensions, verifying that any dimensions in
both sets have the same size.
@param firstDimensionNums
@param firstDimensionSizes
@param secondDimensionNums
@param secondDimensionSizes
@return | [
"Merges",
"the",
"given",
"sets",
"of",
"dimensions",
"verifying",
"that",
"any",
"dimensions",
"in",
"both",
"sets",
"have",
"the",
"same",
"size",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/tensor/AbstractTensorBase.java#L94-L125 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/write/WriteFileExtensions.java | WriteFileExtensions.readSourceFileAndWriteDestFile | public static void readSourceFileAndWriteDestFile(final String srcfile, final String destFile)
throws IOException {
"""
Writes the source file with the best performance to the destination file.
@param srcfile
The source file.
@param destFile
The destination file.
@throws IOException
Signals that an I/O e... | java | public static void readSourceFileAndWriteDestFile(final String srcfile, final String destFile)
throws IOException
{
try (FileInputStream fis = new FileInputStream(srcfile);
FileOutputStream fos = new FileOutputStream(destFile);
BufferedInputStream bis = new BufferedInputStream(fis);
BufferedOutputStream b... | [
"public",
"static",
"void",
"readSourceFileAndWriteDestFile",
"(",
"final",
"String",
"srcfile",
",",
"final",
"String",
"destFile",
")",
"throws",
"IOException",
"{",
"try",
"(",
"FileInputStream",
"fis",
"=",
"new",
"FileInputStream",
"(",
"srcfile",
")",
";",
... | Writes the source file with the best performance to the destination file.
@param srcfile
The source file.
@param destFile
The destination file.
@throws IOException
Signals that an I/O exception has occurred. | [
"Writes",
"the",
"source",
"file",
"with",
"the",
"best",
"performance",
"to",
"the",
"destination",
"file",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/write/WriteFileExtensions.java#L389-L402 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.faulttolerance.cdi/src/com/ibm/ws/microprofile/faulttolerance/cdi/config/MethodFinder.java | MethodFinder.typesEquivalent | private static boolean typesEquivalent(Type typeToMatch, GenericArrayType type, ResolutionContext ctx) {
"""
Computes whether a type is equivalent to a GenericArrayType.
<p>
This method will check that {@code typeToMatch} is either a {@link GenericArrayType} or an array and then recursively compare the component... | java | private static boolean typesEquivalent(Type typeToMatch, GenericArrayType type, ResolutionContext ctx) {
if (typeToMatch instanceof GenericArrayType) {
GenericArrayType aGat = (GenericArrayType) typeToMatch;
return typesEquivalent(aGat.getGenericComponentType(),
... | [
"private",
"static",
"boolean",
"typesEquivalent",
"(",
"Type",
"typeToMatch",
",",
"GenericArrayType",
"type",
",",
"ResolutionContext",
"ctx",
")",
"{",
"if",
"(",
"typeToMatch",
"instanceof",
"GenericArrayType",
")",
"{",
"GenericArrayType",
"aGat",
"=",
"(",
"... | Computes whether a type is equivalent to a GenericArrayType.
<p>
This method will check that {@code typeToMatch} is either a {@link GenericArrayType} or an array and then recursively compare the component types of both arguments using
{@link #typesEquivalent(Type, Type, ResolutionContext)}.
@param typeToMatch the type... | [
"Computes",
"whether",
"a",
"type",
"is",
"equivalent",
"to",
"a",
"GenericArrayType",
".",
"<p",
">",
"This",
"method",
"will",
"check",
"that",
"{",
"@code",
"typeToMatch",
"}",
"is",
"either",
"a",
"{",
"@link",
"GenericArrayType",
"}",
"or",
"an",
"arr... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.faulttolerance.cdi/src/com/ibm/ws/microprofile/faulttolerance/cdi/config/MethodFinder.java#L235-L251 |
Impetus/Kundera | src/kundera-rdbms/src/main/java/com/impetus/client/rdbms/HibernateClient.java | HibernateClient.getFromClause | private String getFromClause(String schemaName, String tableName) {
"""
Gets the from clause.
@param schemaName
the schema name
@param tableName
the table name
@return the from clause
"""
String clause = tableName;
if (schemaName != null && !schemaName.isEmpty())
{
cl... | java | private String getFromClause(String schemaName, String tableName)
{
String clause = tableName;
if (schemaName != null && !schemaName.isEmpty())
{
clause = schemaName + "." + tableName;
}
return clause;
} | [
"private",
"String",
"getFromClause",
"(",
"String",
"schemaName",
",",
"String",
"tableName",
")",
"{",
"String",
"clause",
"=",
"tableName",
";",
"if",
"(",
"schemaName",
"!=",
"null",
"&&",
"!",
"schemaName",
".",
"isEmpty",
"(",
")",
")",
"{",
"clause"... | Gets the from clause.
@param schemaName
the schema name
@param tableName
the table name
@return the from clause | [
"Gets",
"the",
"from",
"clause",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-rdbms/src/main/java/com/impetus/client/rdbms/HibernateClient.java#L791-L799 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPChainer.java | AFPChainer.getRmsd | private static double getRmsd(int focusResn, int[] focusRes1, int[] focusRes2, AFPChain afpChain, Atom[] ca1, Atom[] ca2) {
"""
the the RMSD for the residues defined in the two arrays
@param focusResn
@param focusRes1
@param focusRes2
@return
"""
Atom[] tmp1 = new Atom[focusResn];
Atom[] tmp2 = ne... | java | private static double getRmsd(int focusResn, int[] focusRes1, int[] focusRes2, AFPChain afpChain, Atom[] ca1, Atom[] ca2){
Atom[] tmp1 = new Atom[focusResn];
Atom[] tmp2 = new Atom[focusResn];
for ( int i =0 ; i< focusResn;i++){
tmp1[i] = ca1[focusRes1[i]];
tmp2[i] = (Atom)ca2[focusRes2[i]].clone(... | [
"private",
"static",
"double",
"getRmsd",
"(",
"int",
"focusResn",
",",
"int",
"[",
"]",
"focusRes1",
",",
"int",
"[",
"]",
"focusRes2",
",",
"AFPChain",
"afpChain",
",",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2",
")",
"{",
"Atom",
"[",
... | the the RMSD for the residues defined in the two arrays
@param focusResn
@param focusRes1
@param focusRes2
@return | [
"the",
"the",
"RMSD",
"for",
"the",
"residues",
"defined",
"in",
"the",
"two",
"arrays"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPChainer.java#L666-L694 |
jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java | ShExGenerator.simpleElement | private String simpleElement(StructureDefinition sd, ElementDefinition ed, String typ) {
"""
Generate a type reference and optional value set definition
@param sd Containing StructureDefinition
@param ed Element being defined
@param typ Element type
@return Type definition
"""
String addldef = "";
... | java | private String simpleElement(StructureDefinition sd, ElementDefinition ed, String typ) {
String addldef = "";
ElementDefinition.ElementDefinitionBindingComponent binding = ed.getBinding();
if(binding.hasStrength() && binding.getStrength() == Enumerations.BindingStrength.REQUIRED && "code".equals(typ)) {
... | [
"private",
"String",
"simpleElement",
"(",
"StructureDefinition",
"sd",
",",
"ElementDefinition",
"ed",
",",
"String",
"typ",
")",
"{",
"String",
"addldef",
"=",
"\"\"",
";",
"ElementDefinition",
".",
"ElementDefinitionBindingComponent",
"binding",
"=",
"ed",
".",
... | Generate a type reference and optional value set definition
@param sd Containing StructureDefinition
@param ed Element being defined
@param typ Element type
@return Type definition | [
"Generate",
"a",
"type",
"reference",
"and",
"optional",
"value",
"set",
"definition"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L520-L535 |
greese/dasein-cloud-digitalocean | src/main/java/org/dasein/cloud/digitalocean/models/rest/DigitalOceanModelFactory.java | DigitalOceanModelFactory.checkAction | public static int checkAction(@Nonnull org.dasein.cloud.digitalocean.DigitalOcean provider, String actionUrl) throws CloudException, InternalException {
"""
Return HTTP status code for an action request sent via HEAD method
@param provider
@param actionUrl
@return status code
@throws InternalException
@throws... | java | public static int checkAction(@Nonnull org.dasein.cloud.digitalocean.DigitalOcean provider, String actionUrl) throws CloudException, InternalException {
if( logger.isTraceEnabled() ) {
logger.trace("ENTER - " + DigitalOceanModelFactory.class.getName() + ".checkAction(" + provider.getCloudName() + ")... | [
"public",
"static",
"int",
"checkAction",
"(",
"@",
"Nonnull",
"org",
".",
"dasein",
".",
"cloud",
".",
"digitalocean",
".",
"DigitalOcean",
"provider",
",",
"String",
"actionUrl",
")",
"throws",
"CloudException",
",",
"InternalException",
"{",
"if",
"(",
"log... | Return HTTP status code for an action request sent via HEAD method
@param provider
@param actionUrl
@return status code
@throws InternalException
@throws CloudException | [
"Return",
"HTTP",
"status",
"code",
"for",
"an",
"action",
"request",
"sent",
"via",
"HEAD",
"method"
] | train | https://github.com/greese/dasein-cloud-digitalocean/blob/09b74566b24d7f668379fca237524d4cc0335f77/src/main/java/org/dasein/cloud/digitalocean/models/rest/DigitalOceanModelFactory.java#L378-L392 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.getTypeArguments | public static List<TypeName> getTypeArguments(TypeElement element) {
"""
<p>
Retrieve parametrized type of element (from its parent).
</p>
@param element
the element
@return list of typemirror or empty list
"""
final List<TypeName> result = new ArrayList<>();
if (element.getKind() == ElementKind.CL... | java | public static List<TypeName> getTypeArguments(TypeElement element) {
final List<TypeName> result = new ArrayList<>();
if (element.getKind() == ElementKind.CLASS) {
if (element.getSuperclass() instanceof DeclaredType) {
result.addAll(convert(((DeclaredType) element.getSuperclass()).getTypeArguments()));
}... | [
"public",
"static",
"List",
"<",
"TypeName",
">",
"getTypeArguments",
"(",
"TypeElement",
"element",
")",
"{",
"final",
"List",
"<",
"TypeName",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"element",
".",
"getKind",
"(",
")",
... | <p>
Retrieve parametrized type of element (from its parent).
</p>
@param element
the element
@return list of typemirror or empty list | [
"<p",
">",
"Retrieve",
"parametrized",
"type",
"of",
"element",
"(",
"from",
"its",
"parent",
")",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L620-L646 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/windows/WindowsJNIFaxClientSpi.java | WindowsJNIFaxClientSpi.winSuspendFaxJob | private void winSuspendFaxJob(String serverName,int faxJobID) {
"""
This function will suspend an existing fax job.
@param serverName
The fax server name
@param faxJobID
The fax job ID
"""
synchronized(WindowsFaxClientSpiHelper.NATIVE_LOCK)
{
//pre native call
... | java | private void winSuspendFaxJob(String serverName,int faxJobID)
{
synchronized(WindowsFaxClientSpiHelper.NATIVE_LOCK)
{
//pre native call
this.preNativeCall();
//invoke native
WindowsJNIFaxClientSpi.suspendFaxJobNative(serverName,faxJobID);
... | [
"private",
"void",
"winSuspendFaxJob",
"(",
"String",
"serverName",
",",
"int",
"faxJobID",
")",
"{",
"synchronized",
"(",
"WindowsFaxClientSpiHelper",
".",
"NATIVE_LOCK",
")",
"{",
"//pre native call",
"this",
".",
"preNativeCall",
"(",
")",
";",
"//invoke native",... | This function will suspend an existing fax job.
@param serverName
The fax server name
@param faxJobID
The fax job ID | [
"This",
"function",
"will",
"suspend",
"an",
"existing",
"fax",
"job",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/windows/WindowsJNIFaxClientSpi.java#L288-L298 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsListItem.java | CmsListItem.initMoveHandle | public boolean initMoveHandle(CmsDNDHandler dndHandler, boolean addFirst) {
"""
Initializes the move handle with the given drag and drop handler and adds it to the list item widget.<p>
This method will not work for list items that don't have a list-item-widget.<p>
@param dndHandler the drag and drop handler
... | java | public boolean initMoveHandle(CmsDNDHandler dndHandler, boolean addFirst) {
if (m_moveHandle != null) {
return true;
}
if (m_listItemWidget == null) {
return false;
}
m_moveHandle = new MoveHandle(this);
if (addFirst) {
m_listItemWidge... | [
"public",
"boolean",
"initMoveHandle",
"(",
"CmsDNDHandler",
"dndHandler",
",",
"boolean",
"addFirst",
")",
"{",
"if",
"(",
"m_moveHandle",
"!=",
"null",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"m_listItemWidget",
"==",
"null",
")",
"{",
"return",
... | Initializes the move handle with the given drag and drop handler and adds it to the list item widget.<p>
This method will not work for list items that don't have a list-item-widget.<p>
@param dndHandler the drag and drop handler
@param addFirst if true, adds the move handle as first child
@return <code>true</code> ... | [
"Initializes",
"the",
"move",
"handle",
"with",
"the",
"given",
"drag",
"and",
"drop",
"handler",
"and",
"adds",
"it",
"to",
"the",
"list",
"item",
"widget",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsListItem.java#L444-L461 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/LocalMapStatsProvider.java | LocalMapStatsProvider.getReplicaAddress | private Address getReplicaAddress(int partitionId, int replicaNumber, int backupCount) {
"""
Gets replica address. Waits if necessary.
@see #waitForReplicaAddress
"""
IPartition partition = partitionService.getPartition(partitionId);
Address replicaAddress = partition.getReplicaAddress(repli... | java | private Address getReplicaAddress(int partitionId, int replicaNumber, int backupCount) {
IPartition partition = partitionService.getPartition(partitionId);
Address replicaAddress = partition.getReplicaAddress(replicaNumber);
if (replicaAddress == null) {
replicaAddress = waitForRepli... | [
"private",
"Address",
"getReplicaAddress",
"(",
"int",
"partitionId",
",",
"int",
"replicaNumber",
",",
"int",
"backupCount",
")",
"{",
"IPartition",
"partition",
"=",
"partitionService",
".",
"getPartition",
"(",
"partitionId",
")",
";",
"Address",
"replicaAddress"... | Gets replica address. Waits if necessary.
@see #waitForReplicaAddress | [
"Gets",
"replica",
"address",
".",
"Waits",
"if",
"necessary",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/LocalMapStatsProvider.java#L275-L282 |
apache/groovy | subprojects/groovy-servlet/src/main/java/groovy/servlet/TemplateServlet.java | TemplateServlet.getTemplate | protected Template getTemplate(File file) throws ServletException {
"""
Gets the template created by the underlying engine parsing the request.
<p>
This method looks up a simple (weak) hash map for an existing template
object that matches the source file. If the source file didn't change in
length and its la... | java | protected Template getTemplate(File file) throws ServletException {
String key = file.getAbsolutePath();
Template template = findCachedTemplate(key, file);
//
// Template not cached or the source file changed - compile new template!
//
if (template == null) {
... | [
"protected",
"Template",
"getTemplate",
"(",
"File",
"file",
")",
"throws",
"ServletException",
"{",
"String",
"key",
"=",
"file",
".",
"getAbsolutePath",
"(",
")",
";",
"Template",
"template",
"=",
"findCachedTemplate",
"(",
"key",
",",
"file",
")",
";",
"/... | Gets the template created by the underlying engine parsing the request.
<p>
This method looks up a simple (weak) hash map for an existing template
object that matches the source file. If the source file didn't change in
length and its last modified stamp hasn't changed compared to a precompiled
template object, this t... | [
"Gets",
"the",
"template",
"created",
"by",
"the",
"underlying",
"engine",
"parsing",
"the",
"request",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-servlet/src/main/java/groovy/servlet/TemplateServlet.java#L294-L310 |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/spoiler/element/SpoilerElement.java | SpoilerElement.addSpoiler | public static void addSpoiler(Message message, String lang, String hint) {
"""
Add a SpoilerElement with a hint in a certain language to a message.
@param message Message to add the Spoiler to.
@param lang language of the Spoiler hint.
@param hint hint.
"""
message.addExtension(new SpoilerElement(... | java | public static void addSpoiler(Message message, String lang, String hint) {
message.addExtension(new SpoilerElement(lang, hint));
} | [
"public",
"static",
"void",
"addSpoiler",
"(",
"Message",
"message",
",",
"String",
"lang",
",",
"String",
"hint",
")",
"{",
"message",
".",
"addExtension",
"(",
"new",
"SpoilerElement",
"(",
"lang",
",",
"hint",
")",
")",
";",
"}"
] | Add a SpoilerElement with a hint in a certain language to a message.
@param message Message to add the Spoiler to.
@param lang language of the Spoiler hint.
@param hint hint. | [
"Add",
"a",
"SpoilerElement",
"with",
"a",
"hint",
"in",
"a",
"certain",
"language",
"to",
"a",
"message",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/spoiler/element/SpoilerElement.java#L90-L92 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/overview/OverviewPlot.java | OverviewPlot.triggerSubplotSelectEvent | protected void triggerSubplotSelectEvent(PlotItem it) {
"""
When a subplot was selected, forward the event to listeners.
@param it PlotItem selected
"""
// forward event to all listeners.
for(ActionListener actionListener : actionListeners) {
actionListener.actionPerformed(new DetailViewSelect... | java | protected void triggerSubplotSelectEvent(PlotItem it) {
// forward event to all listeners.
for(ActionListener actionListener : actionListeners) {
actionListener.actionPerformed(new DetailViewSelectedEvent(this, ActionEvent.ACTION_PERFORMED, null, 0, it));
}
} | [
"protected",
"void",
"triggerSubplotSelectEvent",
"(",
"PlotItem",
"it",
")",
"{",
"// forward event to all listeners.",
"for",
"(",
"ActionListener",
"actionListener",
":",
"actionListeners",
")",
"{",
"actionListener",
".",
"actionPerformed",
"(",
"new",
"DetailViewSele... | When a subplot was selected, forward the event to listeners.
@param it PlotItem selected | [
"When",
"a",
"subplot",
"was",
"selected",
"forward",
"the",
"event",
"to",
"listeners",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/overview/OverviewPlot.java#L523-L528 |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/util/WarUtils.java | WarUtils.addFilter | public static void addFilter(Document doc, Element root) {
"""
Adds the shiro filter to a web.xml file.
@param doc The xml DOM document to create the new xml elements with.
@param root The xml Element node to add the filter to.
"""
Element filter = doc.createElement("filter");
Element filterName = do... | java | public static void addFilter(Document doc, Element root) {
Element filter = doc.createElement("filter");
Element filterName = doc.createElement("filter-name");
filterName.appendChild(doc.createTextNode("ShiroFilter"));
filter.appendChild(filterName);
Element filterClass = doc.createElement("filter-c... | [
"public",
"static",
"void",
"addFilter",
"(",
"Document",
"doc",
",",
"Element",
"root",
")",
"{",
"Element",
"filter",
"=",
"doc",
".",
"createElement",
"(",
"\"filter\"",
")",
";",
"Element",
"filterName",
"=",
"doc",
".",
"createElement",
"(",
"\"filter-n... | Adds the shiro filter to a web.xml file.
@param doc The xml DOM document to create the new xml elements with.
@param root The xml Element node to add the filter to. | [
"Adds",
"the",
"shiro",
"filter",
"to",
"a",
"web",
".",
"xml",
"file",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/util/WarUtils.java#L313-L324 |
ben-manes/caffeine | simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/linked/FrequentlyUsedPolicy.java | FrequentlyUsedPolicy.onHit | private void onHit(Node node) {
"""
Moves the entry to the next higher frequency list, creating it if necessary.
"""
policyStats.recordHit();
int newCount = node.freq.count + 1;
FrequencyNode freqN = (node.freq.next.count == newCount)
? node.freq.next
: new FrequencyNode(newCount, ... | java | private void onHit(Node node) {
policyStats.recordHit();
int newCount = node.freq.count + 1;
FrequencyNode freqN = (node.freq.next.count == newCount)
? node.freq.next
: new FrequencyNode(newCount, node.freq);
node.remove();
if (node.freq.isEmpty()) {
node.freq.remove();
}
... | [
"private",
"void",
"onHit",
"(",
"Node",
"node",
")",
"{",
"policyStats",
".",
"recordHit",
"(",
")",
";",
"int",
"newCount",
"=",
"node",
".",
"freq",
".",
"count",
"+",
"1",
";",
"FrequencyNode",
"freqN",
"=",
"(",
"node",
".",
"freq",
".",
"next",... | Moves the entry to the next higher frequency list, creating it if necessary. | [
"Moves",
"the",
"entry",
"to",
"the",
"next",
"higher",
"frequency",
"list",
"creating",
"it",
"if",
"necessary",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/linked/FrequentlyUsedPolicy.java#L87-L100 |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpHandler.java | RtcpHandler.rescheduleRtcp | private void rescheduleRtcp(TxTask task, long timestamp) {
"""
Re-schedules a previously scheduled event.
@param timestamp The time stamp (in milliseconds) of the rescheduled event
"""
// Cancel current execution of the task
this.reportTaskFuture.cancel(true);
// Re-schedule... | java | private void rescheduleRtcp(TxTask task, long timestamp) {
// Cancel current execution of the task
this.reportTaskFuture.cancel(true);
// Re-schedule task execution
long interval = resolveInterval(timestamp);
try {
this.reportTaskFuture = this.scheduler.sched... | [
"private",
"void",
"rescheduleRtcp",
"(",
"TxTask",
"task",
",",
"long",
"timestamp",
")",
"{",
"// Cancel current execution of the task",
"this",
".",
"reportTaskFuture",
".",
"cancel",
"(",
"true",
")",
";",
"// Re-schedule task execution",
"long",
"interval",
"=",
... | Re-schedules a previously scheduled event.
@param timestamp The time stamp (in milliseconds) of the rescheduled event | [
"Re",
"-",
"schedules",
"a",
"previously",
"scheduled",
"event",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpHandler.java#L255-L266 |
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainer.java | ZipFileContainer.isModified | private boolean isModified(ArtifactEntry entry, File file) {
"""
Tell if an entry is modified relative to a file. That is if
the last modified times are different.
File last update times are accurate to about a second. Allow
the last modified times to match if they are that close.
@param entry The entry ... | java | private boolean isModified(ArtifactEntry entry, File file) {
long fileLastModified = FileUtils.fileLastModified(file);
long entryLastModified = entry.getLastModified();
// File 100K entry 10K delta 90k true (entry is much older than the file)
// File 10k entry 100k delta 90k t... | [
"private",
"boolean",
"isModified",
"(",
"ArtifactEntry",
"entry",
",",
"File",
"file",
")",
"{",
"long",
"fileLastModified",
"=",
"FileUtils",
".",
"fileLastModified",
"(",
"file",
")",
";",
"long",
"entryLastModified",
"=",
"entry",
".",
"getLastModified",
"("... | Tell if an entry is modified relative to a file. That is if
the last modified times are different.
File last update times are accurate to about a second. Allow
the last modified times to match if they are that close.
@param entry The entry to test.
@param file The file to test.
@return True or false telling if the... | [
"Tell",
"if",
"an",
"entry",
"is",
"modified",
"relative",
"to",
"a",
"file",
".",
"That",
"is",
"if",
"the",
"last",
"modified",
"times",
"are",
"different",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainer.java#L1621-L1632 |
alkacon/opencms-core | src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBCmsUsers.java | CmsUpdateDBCmsUsers.addWebusersToGroup | protected void addWebusersToGroup(CmsSetupDb dbCon, CmsUUID id) throws SQLException {
"""
Adds all webusers to the new previously created webusers group.<p>
@param dbCon the db connection interface
@param id the id of the new webusers group
@throws SQLException if something goes wrong
"""
Strin... | java | protected void addWebusersToGroup(CmsSetupDb dbCon, CmsUUID id) throws SQLException {
String sql = readQuery(QUERY_ADD_WEBUSERS_TO_GROUP);
Map<String, String> replacements = new HashMap<String, String>();
replacements.put("${GROUP_ID}", id.toString());
dbCon.updateSqlStatement(sql, repl... | [
"protected",
"void",
"addWebusersToGroup",
"(",
"CmsSetupDb",
"dbCon",
",",
"CmsUUID",
"id",
")",
"throws",
"SQLException",
"{",
"String",
"sql",
"=",
"readQuery",
"(",
"QUERY_ADD_WEBUSERS_TO_GROUP",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"replaceme... | Adds all webusers to the new previously created webusers group.<p>
@param dbCon the db connection interface
@param id the id of the new webusers group
@throws SQLException if something goes wrong | [
"Adds",
"all",
"webusers",
"to",
"the",
"new",
"previously",
"created",
"webusers",
"group",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBCmsUsers.java#L243-L249 |
ecclesia/kipeto | kipeto-common/src/main/java/de/ecclesia/kipeto/common/util/Streams.java | Streams.copyStream | public static void copyStream(InputStream sourceStream, OutputStream destinationStream, boolean closeStreams)
throws IOException {
"""
Kopiert den Inhalt eines Datenstroms in einen anderen. Aus Geschwindigkeitsgründen werden die Ströme gebuffert.
Diese Funktion sollte verwendet werden, falls die Datenströme... | java | public static void copyStream(InputStream sourceStream, OutputStream destinationStream, boolean closeStreams)
throws IOException {
BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(destinationStream);
try {
copyBufferedStream(new BufferedInputStream(sourceStream), bufferedOutputStream, clos... | [
"public",
"static",
"void",
"copyStream",
"(",
"InputStream",
"sourceStream",
",",
"OutputStream",
"destinationStream",
",",
"boolean",
"closeStreams",
")",
"throws",
"IOException",
"{",
"BufferedOutputStream",
"bufferedOutputStream",
"=",
"new",
"BufferedOutputStream",
"... | Kopiert den Inhalt eines Datenstroms in einen anderen. Aus Geschwindigkeitsgründen werden die Ströme gebuffert.
Diese Funktion sollte verwendet werden, falls die Datenströme noch nicht Buffered*Stream implementieren.
@param sourceStream
Quelldatenstrom
@param destinationStream
Zieldatenstrom
@throws IOException | [
"Kopiert",
"den",
"Inhalt",
"eines",
"Datenstroms",
"in",
"einen",
"anderen",
".",
"Aus",
"Geschwindigkeitsgründen",
"werden",
"die",
"Ströme",
"gebuffert",
".",
"Diese",
"Funktion",
"sollte",
"verwendet",
"werden",
"falls",
"die",
"Datenströme",
"noch",
"nicht",... | train | https://github.com/ecclesia/kipeto/blob/ea39a10ae4eaa550f71a856ab2f2845270a64913/kipeto-common/src/main/java/de/ecclesia/kipeto/common/util/Streams.java#L71-L81 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/msg/MsgChecker.java | MsgChecker.checkDataInnerRules | public void checkDataInnerRules(ValidationData data, Object bodyObj) {
"""
Check data inner rules.
@param data the data
@param bodyObj the body obj
"""
data.getValidationRules().stream().filter(vr -> vr.isUse()).forEach(rule -> {
if (data.isListChild()) {
this.checkPo... | java | public void checkDataInnerRules(ValidationData data, Object bodyObj) {
data.getValidationRules().stream().filter(vr -> vr.isUse()).forEach(rule -> {
if (data.isListChild()) {
this.checkPointListChild(data, rule, bodyObj, rule.getStandardValue());
} else {
... | [
"public",
"void",
"checkDataInnerRules",
"(",
"ValidationData",
"data",
",",
"Object",
"bodyObj",
")",
"{",
"data",
".",
"getValidationRules",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"vr",
"->",
"vr",
".",
"isUse",
"(",
")",
")",
".",
"f... | Check data inner rules.
@param data the data
@param bodyObj the body obj | [
"Check",
"data",
"inner",
"rules",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/msg/MsgChecker.java#L105-L113 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/auth/OAuthActivity.java | OAuthActivity.createOAuthActivityIntent | public static Intent createOAuthActivityIntent(final Context context, final String clientId, final String clientSecret, String redirectUrl, boolean loginViaBoxApp) {
"""
Create intent to launch OAuthActivity. Notes about redirect url parameter: If you already set redirect url in <a
href="https://cloud.app.box.com... | java | public static Intent createOAuthActivityIntent(final Context context, final String clientId, final String clientSecret, String redirectUrl, boolean loginViaBoxApp) {
Intent intent = new Intent(context, OAuthActivity.class);
intent.putExtra(BoxConstants.KEY_CLIENT_ID, clientId);
intent.putExtra(B... | [
"public",
"static",
"Intent",
"createOAuthActivityIntent",
"(",
"final",
"Context",
"context",
",",
"final",
"String",
"clientId",
",",
"final",
"String",
"clientSecret",
",",
"String",
"redirectUrl",
",",
"boolean",
"loginViaBoxApp",
")",
"{",
"Intent",
"intent",
... | Create intent to launch OAuthActivity. Notes about redirect url parameter: If you already set redirect url in <a
href="https://cloud.app.box.com/developers/services">box dev console</a>, you should pass in the same redirect url or use null for redirect url. If you
didn't set it in box dev console, you should pass in a ... | [
"Create",
"intent",
"to",
"launch",
"OAuthActivity",
".",
"Notes",
"about",
"redirect",
"url",
"parameter",
":",
"If",
"you",
"already",
"set",
"redirect",
"url",
"in",
"<a",
"href",
"=",
"https",
":",
"//",
"cloud",
".",
"app",
".",
"box",
".",
"com",
... | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/auth/OAuthActivity.java#L519-L528 |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/Util.java | Util.checkLatLong | public static void checkLatLong(double lat, double lon) {
"""
Check lat lon are withing allowable range as per 1371-4.pdf. Note that
values of long=181, lat=91 have special meaning.
@param lat
@param lon
"""
checkArgument(lon <= 181.0, "longitude out of range " + lon);
checkArgument(lon > -180.0, "lon... | java | public static void checkLatLong(double lat, double lon) {
checkArgument(lon <= 181.0, "longitude out of range " + lon);
checkArgument(lon > -180.0, "longitude out of range " + lon);
checkArgument(lat <= 91.0, "latitude out of range " + lat);
checkArgument(lat > -90.0, "latitude out of range " + lat);
} | [
"public",
"static",
"void",
"checkLatLong",
"(",
"double",
"lat",
",",
"double",
"lon",
")",
"{",
"checkArgument",
"(",
"lon",
"<=",
"181.0",
",",
"\"longitude out of range \"",
"+",
"lon",
")",
";",
"checkArgument",
"(",
"lon",
">",
"-",
"180.0",
",",
"\"... | Check lat lon are withing allowable range as per 1371-4.pdf. Note that
values of long=181, lat=91 have special meaning.
@param lat
@param lon | [
"Check",
"lat",
"lon",
"are",
"withing",
"allowable",
"range",
"as",
"per",
"1371",
"-",
"4",
".",
"pdf",
".",
"Note",
"that",
"values",
"of",
"long",
"=",
"181",
"lat",
"=",
"91",
"have",
"special",
"meaning",
"."
] | train | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/Util.java#L197-L202 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/annotations/CitrusAnnotations.java | CitrusAnnotations.injectAll | public static final void injectAll(final Object target, final Citrus citrusFramework, final TestContext context) {
"""
Injects all supported components and endpoints to target object using annotations.
@param target
"""
injectCitrusFramework(target, citrusFramework);
injectEndpoints(target, co... | java | public static final void injectAll(final Object target, final Citrus citrusFramework, final TestContext context) {
injectCitrusFramework(target, citrusFramework);
injectEndpoints(target, context);
} | [
"public",
"static",
"final",
"void",
"injectAll",
"(",
"final",
"Object",
"target",
",",
"final",
"Citrus",
"citrusFramework",
",",
"final",
"TestContext",
"context",
")",
"{",
"injectCitrusFramework",
"(",
"target",
",",
"citrusFramework",
")",
";",
"injectEndpoi... | Injects all supported components and endpoints to target object using annotations.
@param target | [
"Injects",
"all",
"supported",
"components",
"and",
"endpoints",
"to",
"target",
"object",
"using",
"annotations",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/annotations/CitrusAnnotations.java#L68-L71 |
ansell/restlet-utils | src/main/java/com/github/ansell/restletutils/FixedRedirectCookieAuthenticator.java | FixedRedirectCookieAuthenticator.attemptRedirect | protected void attemptRedirect(final Request request, final Response response, final Form form) {
"""
Attempts to redirect the user's browser can be redirected to the URI provided in a query
parameter named by {@link #getRedirectQueryName()}.
Uses a configured fixed redirect URI or a default redirect URI if th... | java | protected void attemptRedirect(final Request request, final Response response, final Form form)
{
this.log.debug("redirectQueryName: {}", this.getRedirectQueryName());
this.log.debug("query: {}", request.getResourceRef().getQueryAsForm());
//this.log.info("form: {}", form);
... | [
"protected",
"void",
"attemptRedirect",
"(",
"final",
"Request",
"request",
",",
"final",
"Response",
"response",
",",
"final",
"Form",
"form",
")",
"{",
"this",
".",
"log",
".",
"debug",
"(",
"\"redirectQueryName: {}\"",
",",
"this",
".",
"getRedirectQueryName"... | Attempts to redirect the user's browser can be redirected to the URI provided in a query
parameter named by {@link #getRedirectQueryName()}.
Uses a configured fixed redirect URI or a default redirect URI if they are not setup.
@param request
The current request.
@param response
The current response.
@param form The q... | [
"Attempts",
"to",
"redirect",
"the",
"user",
"s",
"browser",
"can",
"be",
"redirected",
"to",
"the",
"URI",
"provided",
"in",
"a",
"query",
"parameter",
"named",
"by",
"{",
"@link",
"#getRedirectQueryName",
"()",
"}",
"."
] | train | https://github.com/ansell/restlet-utils/blob/6c39a3e91aa8295936af1dbfccd6ba27230c40a9/src/main/java/com/github/ansell/restletutils/FixedRedirectCookieAuthenticator.java#L188-L224 |
paylogic/java-fogbugz | src/main/java/org/paylogic/fogbugz/FogbugzManager.java | FogbugzManager.mapToFogbugzUrl | private String mapToFogbugzUrl(Map<String, String> params) throws UnsupportedEncodingException {
"""
Helper method to create API url from Map, with proper encoding.
@param params Map with parameters to encode.
@return String which represents API URL.
"""
String output = this.getFogbugzUrl();
... | java | private String mapToFogbugzUrl(Map<String, String> params) throws UnsupportedEncodingException {
String output = this.getFogbugzUrl();
for (String key : params.keySet()) {
String value = params.get(key);
if (!value.isEmpty()) {
output += "&" + URLEncoder.encode(ke... | [
"private",
"String",
"mapToFogbugzUrl",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"UnsupportedEncodingException",
"{",
"String",
"output",
"=",
"this",
".",
"getFogbugzUrl",
"(",
")",
";",
"for",
"(",
"String",
"key",
":",
"para... | Helper method to create API url from Map, with proper encoding.
@param params Map with parameters to encode.
@return String which represents API URL. | [
"Helper",
"method",
"to",
"create",
"API",
"url",
"from",
"Map",
"with",
"proper",
"encoding",
"."
] | train | https://github.com/paylogic/java-fogbugz/blob/75651d82b2476e9ba2a0805311e18ee36882c2df/src/main/java/org/paylogic/fogbugz/FogbugzManager.java#L92-L102 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/renderer/atom/writer/AtomWriter.java | AtomWriter.writeFeed | public void writeFeed(List<?> entities, String requestContextURL, Map<String, Object> meta)
throws ODataRenderException {
"""
<p> Write a list of entities (feed) to the XML stream. </p> <p> <b>Note:</b> Make sure {@link
AtomWriter#startDocument()} has been previously invoked to start the XML stream do... | java | public void writeFeed(List<?> entities, String requestContextURL, Map<String, Object> meta)
throws ODataRenderException {
writeStartFeed(requestContextURL, meta);
writeBodyFeed(entities);
writeEndFeed();
} | [
"public",
"void",
"writeFeed",
"(",
"List",
"<",
"?",
">",
"entities",
",",
"String",
"requestContextURL",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"meta",
")",
"throws",
"ODataRenderException",
"{",
"writeStartFeed",
"(",
"requestContextURL",
",",
"meta... | <p> Write a list of entities (feed) to the XML stream. </p> <p> <b>Note:</b> Make sure {@link
AtomWriter#startDocument()} has been previously invoked to start the XML stream document, and {@link
AtomWriter#endDocument()} is invoked after to end it. </p>
@param entities The list of entities to fill in the XML ... | [
"<p",
">",
"Write",
"a",
"list",
"of",
"entities",
"(",
"feed",
")",
"to",
"the",
"XML",
"stream",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"Note",
":",
"<",
"/",
"b",
">",
"Make",
"sure",
"{",
"@link",
"AtomWriter#startDocument",
"()",
"}"... | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/atom/writer/AtomWriter.java#L209-L214 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java | CmsXmlContentPropertyHelper.convertStringPropertyValue | protected static String convertStringPropertyValue(CmsObject cms, String propValue, String type, boolean toClient) {
"""
Converts a property value given as a string between server format and client format.<p>
@param cms the current CMS context
@param propValue the property value to convert
@param type the typ... | java | protected static String convertStringPropertyValue(CmsObject cms, String propValue, String type, boolean toClient) {
if (propValue == null) {
return null;
}
if (toClient) {
return CmsXmlContentPropertyHelper.getPropValuePaths(cms, type, propValue);
} else {
... | [
"protected",
"static",
"String",
"convertStringPropertyValue",
"(",
"CmsObject",
"cms",
",",
"String",
"propValue",
",",
"String",
"type",
",",
"boolean",
"toClient",
")",
"{",
"if",
"(",
"propValue",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",... | Converts a property value given as a string between server format and client format.<p>
@param cms the current CMS context
@param propValue the property value to convert
@param type the type of the property
@param toClient if true, convert to client format, else convert to server format
@return the converted property... | [
"Converts",
"a",
"property",
"value",
"given",
"as",
"a",
"string",
"between",
"server",
"format",
"and",
"client",
"format",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java#L890-L900 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.sshKey_POST | public void sshKey_POST(String key, String keyName) throws IOException {
"""
Add a new public SSH key
REST: POST /me/sshKey
@param key [required] ASCII encoded public SSH key to add
@param keyName [required] name of the new public SSH key
"""
String qPath = "/me/sshKey";
StringBuilder sb = path(qPath)... | java | public void sshKey_POST(String key, String keyName) throws IOException {
String qPath = "/me/sshKey";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "key", key);
addBody(o, "keyName", keyName);
exec(qPath, "POST", sb.toString(), o);
} | [
"public",
"void",
"sshKey_POST",
"(",
"String",
"key",
",",
"String",
"keyName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/sshKey\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"HashMap",
"<",
"String",
",",
"O... | Add a new public SSH key
REST: POST /me/sshKey
@param key [required] ASCII encoded public SSH key to add
@param keyName [required] name of the new public SSH key | [
"Add",
"a",
"new",
"public",
"SSH",
"key"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1277-L1284 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java | NodeIndexer.addMVPName | private void addMVPName(Document doc, InternalQName name) throws RepositoryException {
"""
Adds a {@link FieldNames#MVP} field to <code>doc</code> with the resolved
<code>name</code> using the internal search index namespace mapping.
@param doc the lucene document.
@param name the name of the multi-value pro... | java | private void addMVPName(Document doc, InternalQName name) throws RepositoryException
{
try
{
String propName = resolver.createJCRName(name).getAsString();
doc.add(new Field(FieldNames.MVP, propName, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS,
Field.TermVector.NO));
... | [
"private",
"void",
"addMVPName",
"(",
"Document",
"doc",
",",
"InternalQName",
"name",
")",
"throws",
"RepositoryException",
"{",
"try",
"{",
"String",
"propName",
"=",
"resolver",
".",
"createJCRName",
"(",
"name",
")",
".",
"getAsString",
"(",
")",
";",
"d... | Adds a {@link FieldNames#MVP} field to <code>doc</code> with the resolved
<code>name</code> using the internal search index namespace mapping.
@param doc the lucene document.
@param name the name of the multi-value property.
@throws RepositoryException | [
"Adds",
"a",
"{",
"@link",
"FieldNames#MVP",
"}",
"field",
"to",
"<code",
">",
"doc<",
"/",
"code",
">",
"with",
"the",
"resolved",
"<code",
">",
"name<",
"/",
"code",
">",
"using",
"the",
"internal",
"search",
"index",
"namespace",
"mapping",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java#L327-L343 |
james-hu/jabb-core | src/main/java/net/sf/jabb/web/action/VfsTreeAction.java | VfsTreeAction.populateTreeNodeData | protected JsTreeNodeData populateTreeNodeData(FileObject root, FileObject file) throws FileSystemException {
"""
Populate a node.
@param root Relative root directory.
@param file The file object.
@return The node data structure which presents the file.
@throws FileSystemException
"""
boolean noChild =... | java | protected JsTreeNodeData populateTreeNodeData(FileObject root, FileObject file) throws FileSystemException {
boolean noChild = true;
FileType type = file.getType();
if (type.equals(FileType.FOLDER) || type.equals(FileType.FILE_OR_FOLDER)){
noChild = file.getChildren().length == 0;
}
String relativePa... | [
"protected",
"JsTreeNodeData",
"populateTreeNodeData",
"(",
"FileObject",
"root",
",",
"FileObject",
"file",
")",
"throws",
"FileSystemException",
"{",
"boolean",
"noChild",
"=",
"true",
";",
"FileType",
"type",
"=",
"file",
".",
"getType",
"(",
")",
";",
"if",
... | Populate a node.
@param root Relative root directory.
@param file The file object.
@return The node data structure which presents the file.
@throws FileSystemException | [
"Populate",
"a",
"node",
"."
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/web/action/VfsTreeAction.java#L137-L145 |
xqbase/util | util/src/main/java/com/xqbase/util/Bytes.java | Bytes.setInt | public static void setInt(int n, byte[] b, int off, boolean littleEndian) {
"""
Store an <b>int</b> number into a byte array in a given byte order
"""
if (littleEndian) {
b[off] = (byte) n;
b[off + 1] = (byte) (n >>> 8);
b[off + 2] = (byte) (n >>> 16);
b[off + 3] = (byte) (n >>> 24);
} el... | java | public static void setInt(int n, byte[] b, int off, boolean littleEndian) {
if (littleEndian) {
b[off] = (byte) n;
b[off + 1] = (byte) (n >>> 8);
b[off + 2] = (byte) (n >>> 16);
b[off + 3] = (byte) (n >>> 24);
} else {
b[off] = (byte) (n >>> 24);
b[off + 1] = (byte) (n >>> 16);
b[off +... | [
"public",
"static",
"void",
"setInt",
"(",
"int",
"n",
",",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"boolean",
"littleEndian",
")",
"{",
"if",
"(",
"littleEndian",
")",
"{",
"b",
"[",
"off",
"]",
"=",
"(",
"byte",
")",
"n",
";",
"b",
"["... | Store an <b>int</b> number into a byte array in a given byte order | [
"Store",
"an",
"<b",
">",
"int<",
"/",
"b",
">",
"number",
"into",
"a",
"byte",
"array",
"in",
"a",
"given",
"byte",
"order"
] | train | https://github.com/xqbase/util/blob/e7b9167b6c701b9eec988a9d1e68446cef5ef420/util/src/main/java/com/xqbase/util/Bytes.java#L136-L148 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/cuDoubleComplex.java | cuDoubleComplex.cuCmul | public static cuDoubleComplex cuCmul (cuDoubleComplex x, cuDoubleComplex y) {
"""
Returns the product of the given complex numbers.<br />
<br />
Original comment:<br />
<br />
This implementation could suffer from intermediate overflow even though
the final result would be in range. However, various implement... | java | public static cuDoubleComplex cuCmul (cuDoubleComplex x, cuDoubleComplex y)
{
cuDoubleComplex prod;
prod = cuCmplx ((cuCreal(x) * cuCreal(y)) - (cuCimag(x) * cuCimag(y)),
(cuCreal(x) * cuCimag(y)) + (cuCimag(x) * cuCreal(y)));
return prod;
} | [
"public",
"static",
"cuDoubleComplex",
"cuCmul",
"(",
"cuDoubleComplex",
"x",
",",
"cuDoubleComplex",
"y",
")",
"{",
"cuDoubleComplex",
"prod",
";",
"prod",
"=",
"cuCmplx",
"(",
"(",
"cuCreal",
"(",
"x",
")",
"*",
"cuCreal",
"(",
"y",
")",
")",
"-",
"(",... | Returns the product of the given complex numbers.<br />
<br />
Original comment:<br />
<br />
This implementation could suffer from intermediate overflow even though
the final result would be in range. However, various implementations do
not guard against this (presumably to avoid losing performance), so we
don't do it... | [
"Returns",
"the",
"product",
"of",
"the",
"given",
"complex",
"numbers",
".",
"<br",
"/",
">",
"<br",
"/",
">",
"Original",
"comment",
":",
"<br",
"/",
">",
"<br",
"/",
">",
"This",
"implementation",
"could",
"suffer",
"from",
"intermediate",
"overflow",
... | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/cuDoubleComplex.java#L123-L129 |
datastax/java-driver | core/src/main/java/com/datastax/oss/driver/internal/core/util/ArrayUtils.java | ArrayUtils.shuffleHead | public static <ElementT> void shuffleHead(@NonNull ElementT[] elements, int n) {
"""
Shuffles the first n elements of the array in-place.
@param elements the array to shuffle.
@param n the number of elements to shuffle; must be {@code <= elements.length}.
@see <a
href="https://en.wikipedia.org/wiki/Fisher%E2... | java | public static <ElementT> void shuffleHead(@NonNull ElementT[] elements, int n) {
shuffleHead(elements, n, ThreadLocalRandom.current());
} | [
"public",
"static",
"<",
"ElementT",
">",
"void",
"shuffleHead",
"(",
"@",
"NonNull",
"ElementT",
"[",
"]",
"elements",
",",
"int",
"n",
")",
"{",
"shuffleHead",
"(",
"elements",
",",
"n",
",",
"ThreadLocalRandom",
".",
"current",
"(",
")",
")",
";",
"... | Shuffles the first n elements of the array in-place.
@param elements the array to shuffle.
@param n the number of elements to shuffle; must be {@code <= elements.length}.
@see <a
href="https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm">Modern
Fisher-Yates shuffle</a> | [
"Shuffles",
"the",
"first",
"n",
"elements",
"of",
"the",
"array",
"in",
"-",
"place",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/internal/core/util/ArrayUtils.java#L62-L64 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/MenuFlyoutExample.java | MenuFlyoutExample.createImageMenuItem | private WMenuItem createImageMenuItem(final String resource, final String desc,
final String cacheKey,
final WText selectedMenuText) {
"""
Creates an example menu item using an image.
@param resource the name of the image resource
@param desc the description for the image
@param cacheKey the cache key f... | java | private WMenuItem createImageMenuItem(final String resource, final String desc,
final String cacheKey,
final WText selectedMenuText) {
WImage image = new WImage(resource, desc);
image.setCacheKey(cacheKey);
WDecoratedLabel label = new WDecoratedLabel(image, new WText(desc), null);
WMenuItem menuItem = new... | [
"private",
"WMenuItem",
"createImageMenuItem",
"(",
"final",
"String",
"resource",
",",
"final",
"String",
"desc",
",",
"final",
"String",
"cacheKey",
",",
"final",
"WText",
"selectedMenuText",
")",
"{",
"WImage",
"image",
"=",
"new",
"WImage",
"(",
"resource",
... | Creates an example menu item using an image.
@param resource the name of the image resource
@param desc the description for the image
@param cacheKey the cache key for this image
@param selectedMenuText the WText to display the selected menu item.
@return a menu item using an image | [
"Creates",
"an",
"example",
"menu",
"item",
"using",
"an",
"image",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/MenuFlyoutExample.java#L158-L167 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SendUsersMessageResponse.java | SendUsersMessageResponse.setResult | public void setResult(java.util.Map<String, java.util.Map<String, EndpointMessageResult>> result) {
"""
An object that shows the endpoints that were messaged for each user. The object provides a list of user IDs. For
each user ID, it provides the endpoint IDs that were messaged. For each endpoint ID, it provides ... | java | public void setResult(java.util.Map<String, java.util.Map<String, EndpointMessageResult>> result) {
this.result = result;
} | [
"public",
"void",
"setResult",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"EndpointMessageResult",
">",
">",
"result",
")",
"{",
"this",
".",
"result",
"=",
"result",
";",
"}"
] | An object that shows the endpoints that were messaged for each user. The object provides a list of user IDs. For
each user ID, it provides the endpoint IDs that were messaged. For each endpoint ID, it provides an
EndpointMessageResult object.
@param result
An object that shows the endpoints that were messaged for each... | [
"An",
"object",
"that",
"shows",
"the",
"endpoints",
"that",
"were",
"messaged",
"for",
"each",
"user",
".",
"The",
"object",
"provides",
"a",
"list",
"of",
"user",
"IDs",
".",
"For",
"each",
"user",
"ID",
"it",
"provides",
"the",
"endpoint",
"IDs",
"tha... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SendUsersMessageResponse.java#L133-L135 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java | SVGPath.smoothCubicTo | public SVGPath smoothCubicTo(double c2x, double c2y, double x, double y) {
"""
Smooth Cubic Bezier line to the given coordinates.
@param c2x second control point x
@param c2y second control point y
@param x new coordinates
@param y new coordinates
@return path object, for compact syntax.
"""
return ... | java | public SVGPath smoothCubicTo(double c2x, double c2y, double x, double y) {
return append(PATH_SMOOTH_CUBIC_TO).append(c2x).append(c2y).append(x).append(y);
} | [
"public",
"SVGPath",
"smoothCubicTo",
"(",
"double",
"c2x",
",",
"double",
"c2y",
",",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"append",
"(",
"PATH_SMOOTH_CUBIC_TO",
")",
".",
"append",
"(",
"c2x",
")",
".",
"append",
"(",
"c2y",
")",
".... | Smooth Cubic Bezier line to the given coordinates.
@param c2x second control point x
@param c2y second control point y
@param x new coordinates
@param y new coordinates
@return path object, for compact syntax. | [
"Smooth",
"Cubic",
"Bezier",
"line",
"to",
"the",
"given",
"coordinates",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L409-L411 |
drewnoakes/metadata-extractor | Source/com/drew/imaging/ImageMetadataReader.java | ImageMetadataReader.readMetadata | @NotNull
public static Metadata readMetadata(@NotNull final InputStream inputStream, final long streamLength) throws ImageProcessingException, IOException {
"""
Reads metadata from an {@link InputStream} of known length.
@param inputStream a stream from which the file data may be read. The stream must be p... | java | @NotNull
public static Metadata readMetadata(@NotNull final InputStream inputStream, final long streamLength) throws ImageProcessingException, IOException
{
BufferedInputStream bufferedInputStream = inputStream instanceof BufferedInputStream
? (BufferedInputStream)inputStream
: n... | [
"@",
"NotNull",
"public",
"static",
"Metadata",
"readMetadata",
"(",
"@",
"NotNull",
"final",
"InputStream",
"inputStream",
",",
"final",
"long",
"streamLength",
")",
"throws",
"ImageProcessingException",
",",
"IOException",
"{",
"BufferedInputStream",
"bufferedInputStr... | Reads metadata from an {@link InputStream} of known length.
@param inputStream a stream from which the file data may be read. The stream must be positioned at the
beginning of the file's data.
@param streamLength the length of the stream, if known, otherwise -1.
@return a populated {@link Metadata} object containing ... | [
"Reads",
"metadata",
"from",
"an",
"{",
"@link",
"InputStream",
"}",
"of",
"known",
"length",
"."
] | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/imaging/ImageMetadataReader.java#L116-L130 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/utils/SmapGenerator.java | SmapGenerator.addSmap | public synchronized void addSmap(String smap, String stratumName) {
"""
Adds the given string as an embedded SMAP with the given stratum name.
@param smap the SMAP to embed
@param stratumName the name of the stratum output by the compilation
that produced the <tt>smap</tt> to be embedded
"""
embed... | java | public synchronized void addSmap(String smap, String stratumName) {
embedded.add("*O " + stratumName + "\n" + smap + "*C " + stratumName + "\n");
} | [
"public",
"synchronized",
"void",
"addSmap",
"(",
"String",
"smap",
",",
"String",
"stratumName",
")",
"{",
"embedded",
".",
"add",
"(",
"\"*O \"",
"+",
"stratumName",
"+",
"\"\\n\"",
"+",
"smap",
"+",
"\"*C \"",
"+",
"stratumName",
"+",
"\"\\n\"",
")",
";... | Adds the given string as an embedded SMAP with the given stratum name.
@param smap the SMAP to embed
@param stratumName the name of the stratum output by the compilation
that produced the <tt>smap</tt> to be embedded | [
"Adds",
"the",
"given",
"string",
"as",
"an",
"embedded",
"SMAP",
"with",
"the",
"given",
"stratum",
"name",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/utils/SmapGenerator.java#L82-L84 |
youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/serverhandler/BuddyEventHandler.java | BuddyEventHandler.notifyToHandlers | protected void notifyToHandlers(ApiZone zone, ApiBuddyImpl buddy) {
"""
Notify event to handlers (listeners)
@param zone api zone reference
@param buddy api buddy reference
"""
for(ServerHandlerClass handler : handlers) {
notifyToHandler(handler, zone, buddy);
}
} | java | protected void notifyToHandlers(ApiZone zone, ApiBuddyImpl buddy) {
for(ServerHandlerClass handler : handlers) {
notifyToHandler(handler, zone, buddy);
}
} | [
"protected",
"void",
"notifyToHandlers",
"(",
"ApiZone",
"zone",
",",
"ApiBuddyImpl",
"buddy",
")",
"{",
"for",
"(",
"ServerHandlerClass",
"handler",
":",
"handlers",
")",
"{",
"notifyToHandler",
"(",
"handler",
",",
"zone",
",",
"buddy",
")",
";",
"}",
"}"
... | Notify event to handlers (listeners)
@param zone api zone reference
@param buddy api buddy reference | [
"Notify",
"event",
"to",
"handlers",
"(",
"listeners",
")"
] | train | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/serverhandler/BuddyEventHandler.java#L60-L64 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/protocol/MasterProtocol.java | MasterProtocol.resetHostList | private static void resetHostList(Listener listener, Deque<HostAddress> loopAddresses) {
"""
Reinitialize loopAddresses with all hosts : all servers in randomize order without connected
host.
@param listener current listener
@param loopAddresses the list to reinitialize
"""
//if all servers have ... | java | private static void resetHostList(Listener listener, Deque<HostAddress> loopAddresses) {
//if all servers have been connected without result
//add back all servers
List<HostAddress> servers = new ArrayList<>();
servers.addAll(listener.getUrlParser().getHostAddresses());
Collections.shuffle(servers);... | [
"private",
"static",
"void",
"resetHostList",
"(",
"Listener",
"listener",
",",
"Deque",
"<",
"HostAddress",
">",
"loopAddresses",
")",
"{",
"//if all servers have been connected without result",
"//add back all servers",
"List",
"<",
"HostAddress",
">",
"servers",
"=",
... | Reinitialize loopAddresses with all hosts : all servers in randomize order without connected
host.
@param listener current listener
@param loopAddresses the list to reinitialize | [
"Reinitialize",
"loopAddresses",
"with",
"all",
"hosts",
":",
"all",
"servers",
"in",
"randomize",
"order",
"without",
"connected",
"host",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/MasterProtocol.java#L184-L193 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.isGeneral | public static boolean isGeneral(CharSequence value, int min, int max) {
"""
验证是否为给定长度范围的英文字母 、数字和下划线
@param value 值
@param min 最小长度,负数自动识别为0
@param max 最大长度,0或负数表示不限制最大长度
@return 是否为给定长度范围的英文字母 、数字和下划线
"""
String reg = "^\\w{" + min + "," + max + "}$";
if (min < 0) {
min = 0;
}
if (max <=... | java | public static boolean isGeneral(CharSequence value, int min, int max) {
String reg = "^\\w{" + min + "," + max + "}$";
if (min < 0) {
min = 0;
}
if (max <= 0) {
reg = "^\\w{" + min + ",}$";
}
return isMactchRegex(reg, value);
} | [
"public",
"static",
"boolean",
"isGeneral",
"(",
"CharSequence",
"value",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"String",
"reg",
"=",
"\"^\\\\w{\"",
"+",
"min",
"+",
"\",\"",
"+",
"max",
"+",
"\"}$\"",
";",
"if",
"(",
"min",
"<",
"0",
")",
... | 验证是否为给定长度范围的英文字母 、数字和下划线
@param value 值
@param min 最小长度,负数自动识别为0
@param max 最大长度,0或负数表示不限制最大长度
@return 是否为给定长度范围的英文字母 、数字和下划线 | [
"验证是否为给定长度范围的英文字母",
"、数字和下划线"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L373-L382 |
apache/incubator-gobblin | gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/store/hdfs/SimpleHadoopFilesystemConfigStore.java | SimpleHadoopFilesystemConfigStore.getChildren | @Override
public Collection<ConfigKeyPath> getChildren(ConfigKeyPath configKey, String version)
throws VersionDoesNotExistException {
"""
Retrieves all the children of the given {@link ConfigKeyPath} by doing a {@code ls} on the {@link Path} specified
by the {@link ConfigKeyPath}. If the {@link Path} desc... | java | @Override
public Collection<ConfigKeyPath> getChildren(ConfigKeyPath configKey, String version)
throws VersionDoesNotExistException {
Preconditions.checkNotNull(configKey, "configKey cannot be null!");
Preconditions.checkArgument(!Strings.isNullOrEmpty(version), "version cannot be null or empty!");
... | [
"@",
"Override",
"public",
"Collection",
"<",
"ConfigKeyPath",
">",
"getChildren",
"(",
"ConfigKeyPath",
"configKey",
",",
"String",
"version",
")",
"throws",
"VersionDoesNotExistException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"configKey",
",",
"\"configKe... | Retrieves all the children of the given {@link ConfigKeyPath} by doing a {@code ls} on the {@link Path} specified
by the {@link ConfigKeyPath}. If the {@link Path} described by the {@link ConfigKeyPath} does not exist, an empty
{@link Collection} is returned.
@param configKey the config key path whose children a... | [
"Retrieves",
"all",
"the",
"children",
"of",
"the",
"given",
"{",
"@link",
"ConfigKeyPath",
"}",
"by",
"doing",
"a",
"{",
"@code",
"ls",
"}",
"on",
"the",
"{",
"@link",
"Path",
"}",
"specified",
"by",
"the",
"{",
"@link",
"ConfigKeyPath",
"}",
".",
"If... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/store/hdfs/SimpleHadoopFilesystemConfigStore.java#L207-L230 |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.preSave | private void preSave(Group group, boolean isNew) throws Exception {
"""
Notifying listeners before group creation.
@param group
the group which is used in create operation
@param isNew
true, if we have a deal with new group, otherwise it is false
which mean update operation is in progress
@throws Exception... | java | private void preSave(Group group, boolean isNew) throws Exception
{
for (GroupEventListener listener : listeners)
{
listener.preSave(group, isNew);
}
} | [
"private",
"void",
"preSave",
"(",
"Group",
"group",
",",
"boolean",
"isNew",
")",
"throws",
"Exception",
"{",
"for",
"(",
"GroupEventListener",
"listener",
":",
"listeners",
")",
"{",
"listener",
".",
"preSave",
"(",
"group",
",",
"isNew",
")",
";",
"}",
... | Notifying listeners before group creation.
@param group
the group which is used in create operation
@param isNew
true, if we have a deal with new group, otherwise it is false
which mean update operation is in progress
@throws Exception
if any listener failed to handle the event | [
"Notifying",
"listeners",
"before",
"group",
"creation",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L553-L559 |
lets-blade/blade | src/main/java/com/blade/mvc/route/RouteMatcher.java | RouteMatcher.matchesPath | private boolean matchesPath(String routePath, String pathToMatch) {
"""
Matching path
@param routePath route path
@param pathToMatch match path
@return return match is success
"""
routePath = PathKit.VAR_REGEXP_PATTERN.matcher(routePath).replaceAll(PathKit.VAR_REPLACE);
return pathToMatc... | java | private boolean matchesPath(String routePath, String pathToMatch) {
routePath = PathKit.VAR_REGEXP_PATTERN.matcher(routePath).replaceAll(PathKit.VAR_REPLACE);
return pathToMatch.matches("(?i)" + routePath);
} | [
"private",
"boolean",
"matchesPath",
"(",
"String",
"routePath",
",",
"String",
"pathToMatch",
")",
"{",
"routePath",
"=",
"PathKit",
".",
"VAR_REGEXP_PATTERN",
".",
"matcher",
"(",
"routePath",
")",
".",
"replaceAll",
"(",
"PathKit",
".",
"VAR_REPLACE",
")",
... | Matching path
@param routePath route path
@param pathToMatch match path
@return return match is success | [
"Matching",
"path"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/mvc/route/RouteMatcher.java#L320-L323 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/DojoHttpTransport.java | DojoHttpTransport.endModules | protected String endModules(HttpServletRequest request, Object arg) {
"""
Handles the
{@link com.ibm.jaggr.core.transport.IHttpTransport.LayerContributionType#END_MODULES}
layer listener event.
<p>
See {@link #beginModules(HttpServletRequest, Object)}
@param request
the http request object
@param arg
the... | java | protected String endModules(HttpServletRequest request, Object arg) {
String result = ""; //$NON-NLS-1$
if (RequestUtil.isServerExpandedLayers(request) &&
request.getParameter(REQUESTEDMODULESCOUNT_REQPARAM) != null) { // it's a loader generated request
result = "});\r\n"; //$NON-NLS-1$
}
return re... | [
"protected",
"String",
"endModules",
"(",
"HttpServletRequest",
"request",
",",
"Object",
"arg",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"//$NON-NLS-1$\r",
"if",
"(",
"RequestUtil",
".",
"isServerExpandedLayers",
"(",
"request",
")",
"&&",
"request",
"."... | Handles the
{@link com.ibm.jaggr.core.transport.IHttpTransport.LayerContributionType#END_MODULES}
layer listener event.
<p>
See {@link #beginModules(HttpServletRequest, Object)}
@param request
the http request object
@param arg
the set of module names. The iteration order of the set is guaranteed to be
the same as th... | [
"Handles",
"the",
"{",
"@link",
"com",
".",
"ibm",
".",
"jaggr",
".",
"core",
".",
"transport",
".",
"IHttpTransport",
".",
"LayerContributionType#END_MODULES",
"}",
"layer",
"listener",
"event",
".",
"<p",
">",
"See",
"{",
"@link",
"#beginModules",
"(",
"Ht... | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/DojoHttpTransport.java#L390-L397 |
jfinal/jfinal | src/main/java/com/jfinal/captcha/CaptchaRender.java | CaptchaRender.validate | public static boolean validate(Controller controller, String userInputString) {
"""
校验用户输入的验证码是否正确
@param controller 控制器
@param userInputString 用户输入的字符串
@return 验证通过返回 true, 否则返回 false
"""
String captchaKey = controller.getCookie(captchaName);
if (validate(captchaKey, userInputString)) {
controlle... | java | public static boolean validate(Controller controller, String userInputString) {
String captchaKey = controller.getCookie(captchaName);
if (validate(captchaKey, userInputString)) {
controller.removeCookie(captchaName);
return true;
}
return false;
} | [
"public",
"static",
"boolean",
"validate",
"(",
"Controller",
"controller",
",",
"String",
"userInputString",
")",
"{",
"String",
"captchaKey",
"=",
"controller",
".",
"getCookie",
"(",
"captchaName",
")",
";",
"if",
"(",
"validate",
"(",
"captchaKey",
",",
"u... | 校验用户输入的验证码是否正确
@param controller 控制器
@param userInputString 用户输入的字符串
@return 验证通过返回 true, 否则返回 false | [
"校验用户输入的验证码是否正确"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/captcha/CaptchaRender.java#L218-L225 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/Validate.java | Validate.matchesPattern | public static void matchesPattern(final CharSequence input, final String pattern) {
"""
<p>Validate that the specified argument character sequence matches the specified regular
expression pattern; otherwise throwing an exception.</p>
<pre>Validate.matchesPattern("hi", "[a-z]*");</pre>
<p>The syntax of the p... | java | public static void matchesPattern(final CharSequence input, final String pattern) {
// TODO when breaking BC, consider returning input
if (input == null || !input.toString().matches(pattern)) {
throw new IllegalArgumentException(StringUtils.simpleFormat(DEFAULT_MATCHES_PATTERN_EX, input, pat... | [
"public",
"static",
"void",
"matchesPattern",
"(",
"final",
"CharSequence",
"input",
",",
"final",
"String",
"pattern",
")",
"{",
"// TODO when breaking BC, consider returning input",
"if",
"(",
"input",
"==",
"null",
"||",
"!",
"input",
".",
"toString",
"(",
")",... | <p>Validate that the specified argument character sequence matches the specified regular
expression pattern; otherwise throwing an exception.</p>
<pre>Validate.matchesPattern("hi", "[a-z]*");</pre>
<p>The syntax of the pattern is the one used in the {@link Pattern} class.</p>
@param input the character sequence to ... | [
"<p",
">",
"Validate",
"that",
"the",
"specified",
"argument",
"character",
"sequence",
"matches",
"the",
"specified",
"regular",
"expression",
"pattern",
";",
"otherwise",
"throwing",
"an",
"exception",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/Validate.java#L857-L862 |
haifengl/smile | core/src/main/java/smile/util/SmileUtils.java | SmileUtils.learnGaussianRadialBasis | public static GaussianRadialBasis[] learnGaussianRadialBasis(double[][] x, double[][] centers, int p) {
"""
Learns Gaussian RBF function and centers from data. The centers are
chosen as the centroids of K-Means. The standard deviation (i.e. width)
of Gaussian radial basis function is estimated by the p-nearest n... | java | public static GaussianRadialBasis[] learnGaussianRadialBasis(double[][] x, double[][] centers, int p) {
if (p < 1) {
throw new IllegalArgumentException("Invalid number of nearest neighbors: " + p);
}
int k = centers.length;
KMeans kmeans = new KMeans(x, k, 10);
... | [
"public",
"static",
"GaussianRadialBasis",
"[",
"]",
"learnGaussianRadialBasis",
"(",
"double",
"[",
"]",
"[",
"]",
"x",
",",
"double",
"[",
"]",
"[",
"]",
"centers",
",",
"int",
"p",
")",
"{",
"if",
"(",
"p",
"<",
"1",
")",
"{",
"throw",
"new",
"I... | Learns Gaussian RBF function and centers from data. The centers are
chosen as the centroids of K-Means. The standard deviation (i.e. width)
of Gaussian radial basis function is estimated by the p-nearest neighbors
(among centers, not all samples) heuristic. A suggested value for
p is 2.
@param x the training dataset.
@... | [
"Learns",
"Gaussian",
"RBF",
"function",
"and",
"centers",
"from",
"data",
".",
"The",
"centers",
"are",
"chosen",
"as",
"the",
"centroids",
"of",
"K",
"-",
"Means",
".",
"The",
"standard",
"deviation",
"(",
"i",
".",
"e",
".",
"width",
")",
"of",
"Gau... | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/util/SmileUtils.java#L111-L138 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Features.java | Features.checkTypeDepth | private void checkTypeDepth(Feature feature, Class<?> current) {
"""
Check annotated features parent recursively.
@param feature The main feature.
@param current The current parent.
"""
for (final Class<?> type : current.getInterfaces())
{
if (type.isAnnotationPresent(Feature... | java | private void checkTypeDepth(Feature feature, Class<?> current)
{
for (final Class<?> type : current.getInterfaces())
{
if (type.isAnnotationPresent(FeatureInterface.class))
{
final Feature old;
// CHECKSTYLE IGNORE LINE: InnerAssignment
... | [
"private",
"void",
"checkTypeDepth",
"(",
"Feature",
"feature",
",",
"Class",
"<",
"?",
">",
"current",
")",
"{",
"for",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
":",
"current",
".",
"getInterfaces",
"(",
")",
")",
"{",
"if",
"(",
"type",
".",
... | Check annotated features parent recursively.
@param feature The main feature.
@param current The current parent. | [
"Check",
"annotated",
"features",
"parent",
"recursively",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Features.java#L150-L175 |
structurizr/java | structurizr-core/src/com/structurizr/model/Model.java | Model.addPerson | @Nonnull
public Person addPerson(@Nonnull String name, @Nullable String description) {
"""
Creates a person (with an unspecified location) and adds it to the model.
@param name the name of the person (e.g. "Admin User" or "Bob the Business User")
@param description a short description of the person
... | java | @Nonnull
public Person addPerson(@Nonnull String name, @Nullable String description) {
return addPerson(Location.Unspecified, name, description);
} | [
"@",
"Nonnull",
"public",
"Person",
"addPerson",
"(",
"@",
"Nonnull",
"String",
"name",
",",
"@",
"Nullable",
"String",
"description",
")",
"{",
"return",
"addPerson",
"(",
"Location",
".",
"Unspecified",
",",
"name",
",",
"description",
")",
";",
"}"
] | Creates a person (with an unspecified location) and adds it to the model.
@param name the name of the person (e.g. "Admin User" or "Bob the Business User")
@param description a short description of the person
@return the Person instance created and added to the model (or null)
@throws IllegalArgumentException i... | [
"Creates",
"a",
"person",
"(",
"with",
"an",
"unspecified",
"location",
")",
"and",
"adds",
"it",
"to",
"the",
"model",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/Model.java#L95-L98 |
SeaCloudsEU/SeaCloudsPlatform | discoverer/src/main/java/eu/seaclouds/platform/discoverer/core/OfferingManager.java | OfferingManager.removeOffering | public boolean removeOffering(String offeringName) {
"""
Remove an offering
@param offeringName the name of the offering to remove
@return
"""
if(offeringName == null)
throw new NullPointerException("The parameter \"cloudOfferingId\" cannot be null.");
BasicDBObject query = new... | java | public boolean removeOffering(String offeringName) {
if(offeringName == null)
throw new NullPointerException("The parameter \"cloudOfferingId\" cannot be null.");
BasicDBObject query = new BasicDBObject("offering_name", offeringName);
Document removedOffering = this.offeringsCollect... | [
"public",
"boolean",
"removeOffering",
"(",
"String",
"offeringName",
")",
"{",
"if",
"(",
"offeringName",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"The parameter \\\"cloudOfferingId\\\" cannot be null.\"",
")",
";",
"BasicDBObject",
"query",
"=... | Remove an offering
@param offeringName the name of the offering to remove
@return | [
"Remove",
"an",
"offering"
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/discoverer/src/main/java/eu/seaclouds/platform/discoverer/core/OfferingManager.java#L78-L86 |
elastic/elasticsearch-hadoop | mr/src/main/java/org/elasticsearch/hadoop/mr/security/TokenUtil.java | TokenUtil.getEsAuthToken | private static EsToken getEsAuthToken(ClusterName clusterName, User user) {
"""
Get the authentication token of the user for the provided cluster name in its ES-Hadoop specific form.
@return null if the user does not have the token, otherwise the auth token for the cluster.
"""
return user.getEsToken(... | java | private static EsToken getEsAuthToken(ClusterName clusterName, User user) {
return user.getEsToken(clusterName.getName());
} | [
"private",
"static",
"EsToken",
"getEsAuthToken",
"(",
"ClusterName",
"clusterName",
",",
"User",
"user",
")",
"{",
"return",
"user",
".",
"getEsToken",
"(",
"clusterName",
".",
"getName",
"(",
")",
")",
";",
"}"
] | Get the authentication token of the user for the provided cluster name in its ES-Hadoop specific form.
@return null if the user does not have the token, otherwise the auth token for the cluster. | [
"Get",
"the",
"authentication",
"token",
"of",
"the",
"user",
"for",
"the",
"provided",
"cluster",
"name",
"in",
"its",
"ES",
"-",
"Hadoop",
"specific",
"form",
"."
] | train | https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/mr/security/TokenUtil.java#L213-L215 |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXMLEqual | public static void assertXMLEqual(String err, Document control,
Document test) {
"""
Assert that two XML documents are similar
@param err Message to be displayed on assertion failure
@param control XML to be compared against
@param test XML to be tested
"""
Diff... | java | public static void assertXMLEqual(String err, Document control,
Document test) {
Diff diff = new Diff(control, test);
assertXMLEqual(err, diff, true);
} | [
"public",
"static",
"void",
"assertXMLEqual",
"(",
"String",
"err",
",",
"Document",
"control",
",",
"Document",
"test",
")",
"{",
"Diff",
"diff",
"=",
"new",
"Diff",
"(",
"control",
",",
"test",
")",
";",
"assertXMLEqual",
"(",
"err",
",",
"diff",
",",
... | Assert that two XML documents are similar
@param err Message to be displayed on assertion failure
@param control XML to be compared against
@param test XML to be tested | [
"Assert",
"that",
"two",
"XML",
"documents",
"are",
"similar"
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L242-L246 |
cqframework/clinical_quality_language | Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java | ElmBaseVisitor.visitTupleElement | public T visitTupleElement(TupleElement elm, C context) {
"""
Visit a TupleElement. This method will be called for
every node in the tree that is a TupleElement.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result
"""
visitElement(elm.getValue()... | java | public T visitTupleElement(TupleElement elm, C context) {
visitElement(elm.getValue(), context);
return null;
} | [
"public",
"T",
"visitTupleElement",
"(",
"TupleElement",
"elm",
",",
"C",
"context",
")",
"{",
"visitElement",
"(",
"elm",
".",
"getValue",
"(",
")",
",",
"context",
")",
";",
"return",
"null",
";",
"}"
] | Visit a TupleElement. This method will be called for
every node in the tree that is a TupleElement.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result | [
"Visit",
"a",
"TupleElement",
".",
"This",
"method",
"will",
"be",
"called",
"for",
"every",
"node",
"in",
"the",
"tree",
"that",
"is",
"a",
"TupleElement",
"."
] | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java#L455-L458 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java | ZooKeeperUtils.createSubmittedJobGraphs | public static ZooKeeperSubmittedJobGraphStore createSubmittedJobGraphs(
CuratorFramework client,
Configuration configuration) throws Exception {
"""
Creates a {@link ZooKeeperSubmittedJobGraphStore} instance.
@param client The {@link CuratorFramework} ZooKeeper client to use
@param configuration {... | java | public static ZooKeeperSubmittedJobGraphStore createSubmittedJobGraphs(
CuratorFramework client,
Configuration configuration) throws Exception {
checkNotNull(configuration, "Configuration");
RetrievableStateStorageHelper<SubmittedJobGraph> stateStorage = createFileSystemStateStorage(configuration, "submitte... | [
"public",
"static",
"ZooKeeperSubmittedJobGraphStore",
"createSubmittedJobGraphs",
"(",
"CuratorFramework",
"client",
",",
"Configuration",
"configuration",
")",
"throws",
"Exception",
"{",
"checkNotNull",
"(",
"configuration",
",",
"\"Configuration\"",
")",
";",
"Retrievab... | Creates a {@link ZooKeeperSubmittedJobGraphStore} instance.
@param client The {@link CuratorFramework} ZooKeeper client to use
@param configuration {@link Configuration} object
@return {@link ZooKeeperSubmittedJobGraphStore} instance
@throws Exception if the submitted job graph store cannot be created | [
"Creates",
"a",
"{",
"@link",
"ZooKeeperSubmittedJobGraphStore",
"}",
"instance",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java#L237-L265 |
jenkinsci/jenkins | core/src/main/java/hudson/util/KeyedDataStorage.java | KeyedDataStorage.get | public @CheckForNull T get(String key) throws IOException {
"""
Finds the data object that matches the given key if available, or null
if not found.
@return Item with the specified {@code key}
@throws IOException Loading error
"""
return get(key,false,null);
} | java | public @CheckForNull T get(String key) throws IOException {
return get(key,false,null);
} | [
"public",
"@",
"CheckForNull",
"T",
"get",
"(",
"String",
"key",
")",
"throws",
"IOException",
"{",
"return",
"get",
"(",
"key",
",",
"false",
",",
"null",
")",
";",
"}"
] | Finds the data object that matches the given key if available, or null
if not found.
@return Item with the specified {@code key}
@throws IOException Loading error | [
"Finds",
"the",
"data",
"object",
"that",
"matches",
"the",
"given",
"key",
"if",
"available",
"or",
"null",
"if",
"not",
"found",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/KeyedDataStorage.java#L120-L122 |
dbracewell/mango | src/main/java/com/davidbracewell/io/Resources.java | Resources.temporaryDirectory | public static Resource temporaryDirectory() {
"""
Creates a new Resource that points to a temporary directory.
@return A resource which is a temporary directory on disk
"""
File tempDir = new File(SystemInfo.JAVA_IO_TMPDIR);
String baseName = System.currentTimeMillis() + "-";
for (int i = ... | java | public static Resource temporaryDirectory() {
File tempDir = new File(SystemInfo.JAVA_IO_TMPDIR);
String baseName = System.currentTimeMillis() + "-";
for (int i = 0; i < 1_000_000; i++) {
File tmp = new File(tempDir, baseName + i);
if (tmp.mkdir()) {
return new FileResour... | [
"public",
"static",
"Resource",
"temporaryDirectory",
"(",
")",
"{",
"File",
"tempDir",
"=",
"new",
"File",
"(",
"SystemInfo",
".",
"JAVA_IO_TMPDIR",
")",
";",
"String",
"baseName",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"\"-\"",
";",
"for",... | Creates a new Resource that points to a temporary directory.
@return A resource which is a temporary directory on disk | [
"Creates",
"a",
"new",
"Resource",
"that",
"points",
"to",
"a",
"temporary",
"directory",
"."
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/io/Resources.java#L240-L250 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/builder/standard/AbstractNumberProcessorBuilder.java | AbstractNumberProcessorBuilder.createFormatter | @SuppressWarnings("unchecked")
protected Optional<NumberFormatWrapper<N>> createFormatter(final FieldAccessor field, final Configuration config) {
"""
数値のフォーマッタを作成する。
<p>アノテーション{@link CsvNumberFormat}の値を元に作成します。</p>
@param field フィールド情報
@param config システム設定
@return アノテーション{@link CsvNumberFormat}が付与されていない場... | java | @SuppressWarnings("unchecked")
protected Optional<NumberFormatWrapper<N>> createFormatter(final FieldAccessor field, final Configuration config) {
final Optional<CsvNumberFormat> formatAnno = field.getAnnotation(CsvNumberFormat.class);
if(!formatAnno.isPresent()) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"Optional",
"<",
"NumberFormatWrapper",
"<",
"N",
">",
">",
"createFormatter",
"(",
"final",
"FieldAccessor",
"field",
",",
"final",
"Configuration",
"config",
")",
"{",
"final",
"Optional",
"<",
"... | 数値のフォーマッタを作成する。
<p>アノテーション{@link CsvNumberFormat}の値を元に作成します。</p>
@param field フィールド情報
@param config システム設定
@return アノテーション{@link CsvNumberFormat}が付与されていない場合は、空を返す。 | [
"数値のフォーマッタを作成する。",
"<p",
">",
"アノテーション",
"{"
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/builder/standard/AbstractNumberProcessorBuilder.java#L77-L108 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/util/JobStateToJsonConverter.java | JobStateToJsonConverter.convertAll | public void convertAll(String jobName, Writer writer) throws IOException {
"""
Convert all past {@link JobState}s of the given job.
@param jobName job name
@param writer {@link java.io.Writer} to write the json document
@throws IOException
"""
List<? extends JobState> jobStates = this.jobStateStore.ge... | java | public void convertAll(String jobName, Writer writer) throws IOException {
List<? extends JobState> jobStates = this.jobStateStore.getAll(jobName);
if (jobStates.isEmpty()) {
LOGGER.warn(String.format("No job state found for job with name %s", jobName));
return;
}
try (JsonWriter jsonWriter... | [
"public",
"void",
"convertAll",
"(",
"String",
"jobName",
",",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"List",
"<",
"?",
"extends",
"JobState",
">",
"jobStates",
"=",
"this",
".",
"jobStateStore",
".",
"getAll",
"(",
"jobName",
")",
";",
"if... | Convert all past {@link JobState}s of the given job.
@param jobName job name
@param writer {@link java.io.Writer} to write the json document
@throws IOException | [
"Convert",
"all",
"past",
"{",
"@link",
"JobState",
"}",
"s",
"of",
"the",
"given",
"job",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/util/JobStateToJsonConverter.java#L117-L128 |
chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java | CalligraphyUtils.pullFontPathFromTheme | static String pullFontPathFromTheme(Context context, int styleAttrId, int[] attributeId) {
"""
Last but not least, try to pull the Font Path from the Theme, which is defined.
@param context Activity Context
@param styleAttrId Theme style id
@param attributeId if -1 returns null.
@return null if no theme ... | java | static String pullFontPathFromTheme(Context context, int styleAttrId, int[] attributeId) {
if (styleAttrId == -1 || attributeId == null)
return null;
final Resources.Theme theme = context.getTheme();
final TypedValue value = new TypedValue();
theme.resolveAttribute(styleAtt... | [
"static",
"String",
"pullFontPathFromTheme",
"(",
"Context",
"context",
",",
"int",
"styleAttrId",
",",
"int",
"[",
"]",
"attributeId",
")",
"{",
"if",
"(",
"styleAttrId",
"==",
"-",
"1",
"||",
"attributeId",
"==",
"null",
")",
"return",
"null",
";",
"fina... | Last but not least, try to pull the Font Path from the Theme, which is defined.
@param context Activity Context
@param styleAttrId Theme style id
@param attributeId if -1 returns null.
@return null if no theme or attribute defined. | [
"Last",
"but",
"not",
"least",
"try",
"to",
"pull",
"the",
"Font",
"Path",
"from",
"the",
"Theme",
"which",
"is",
"defined",
"."
] | train | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java#L252-L270 |
brettonw/Bag | src/main/java/com/brettonw/bag/Serializer.java | Serializer.fromBagAsType | public static <WorkingType> WorkingType fromBagAsType (Bag bag, Class type) {
"""
Reconstitute the given BagObject representation back to the object it represents, using a
"best-effort" approach to matching the fields of the BagObject to the class being initialized.
@param bag The input data to reconstruct from,... | java | public static <WorkingType> WorkingType fromBagAsType (Bag bag, Class type) {
return (bag != null) ? (WorkingType) deserialize (type.getName (), bag) : null;
} | [
"public",
"static",
"<",
"WorkingType",
">",
"WorkingType",
"fromBagAsType",
"(",
"Bag",
"bag",
",",
"Class",
"type",
")",
"{",
"return",
"(",
"bag",
"!=",
"null",
")",
"?",
"(",
"WorkingType",
")",
"deserialize",
"(",
"type",
".",
"getName",
"(",
")",
... | Reconstitute the given BagObject representation back to the object it represents, using a
"best-effort" approach to matching the fields of the BagObject to the class being initialized.
@param bag The input data to reconstruct from, either a BagObject or BagArray
@param type the Class representing the type to reconstruc... | [
"Reconstitute",
"the",
"given",
"BagObject",
"representation",
"back",
"to",
"the",
"object",
"it",
"represents",
"using",
"a",
"best",
"-",
"effort",
"approach",
"to",
"matching",
"the",
"fields",
"of",
"the",
"BagObject",
"to",
"the",
"class",
"being",
"init... | train | https://github.com/brettonw/Bag/blob/25c0ff74893b6c9a2c61bf0f97189ab82e0b2f56/src/main/java/com/brettonw/bag/Serializer.java#L500-L502 |
phax/ph-oton | ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload/FineUploaderBasic.java | FineUploaderBasic.addParam | @Nonnull
public FineUploaderBasic addParam (@Nonnull @Nonempty final String sKey, @Nonnull final String sValue) {
"""
These parameters are sent with the request to the endpoint specified in the
action option.
@param sKey
Parameter name
@param sValue
Parameter value
@return this
"""
ValueEnforcer.... | java | @Nonnull
public FineUploaderBasic addParam (@Nonnull @Nonempty final String sKey, @Nonnull final String sValue)
{
ValueEnforcer.notEmpty (sKey, "Key");
ValueEnforcer.notNull (sValue, "Value");
m_aRequestParams.put (sKey, sValue);
return this;
} | [
"@",
"Nonnull",
"public",
"FineUploaderBasic",
"addParam",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sKey",
",",
"@",
"Nonnull",
"final",
"String",
"sValue",
")",
"{",
"ValueEnforcer",
".",
"notEmpty",
"(",
"sKey",
",",
"\"Key\"",
")",
";",
... | These parameters are sent with the request to the endpoint specified in the
action option.
@param sKey
Parameter name
@param sValue
Parameter value
@return this | [
"These",
"parameters",
"are",
"sent",
"with",
"the",
"request",
"to",
"the",
"endpoint",
"specified",
"in",
"the",
"action",
"option",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload/FineUploaderBasic.java#L199-L207 |
openbase/jul | communication/controller/src/main/java/org/openbase/jul/communication/controller/AbstractRemoteClient.java | AbstractRemoteClient.waitForData | @Override
public void waitForData(long timeout, TimeUnit timeUnit) throws CouldNotPerformException, InterruptedException {
"""
{@inheritDoc}
@param timeout {@inheritDoc}
@param timeUnit {@inheritDoc}
@throws CouldNotPerformException {@inheritDoc}
@throws java.lang.InterruptedException {@inheritD... | java | @Override
public void waitForData(long timeout, TimeUnit timeUnit) throws CouldNotPerformException, InterruptedException {
try {
if (isDataAvailable()) {
return;
}
long startTime = System.currentTimeMillis();
getDataFuture().get(timeout, timeUn... | [
"@",
"Override",
"public",
"void",
"waitForData",
"(",
"long",
"timeout",
",",
"TimeUnit",
"timeUnit",
")",
"throws",
"CouldNotPerformException",
",",
"InterruptedException",
"{",
"try",
"{",
"if",
"(",
"isDataAvailable",
"(",
")",
")",
"{",
"return",
";",
"}"... | {@inheritDoc}
@param timeout {@inheritDoc}
@param timeUnit {@inheritDoc}
@throws CouldNotPerformException {@inheritDoc}
@throws java.lang.InterruptedException {@inheritDoc} | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/communication/controller/src/main/java/org/openbase/jul/communication/controller/AbstractRemoteClient.java#L1201-L1220 |
cdapio/netty-http | src/main/java/io/cdap/http/internal/RequestRouter.java | RequestRouter.channelRead | @Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
"""
If the HttpRequest is valid and handled it will be sent upstream, if it cannot be invoked
the response will be written back immediately.
"""
try {
if (exceptionRaised.get()) {
return;
}
... | java | @Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
try {
if (exceptionRaised.get()) {
return;
}
if (!(msg instanceof HttpRequest)) {
// If there is no methodInfo, it means the request was already rejected.
// What we received here... | [
"@",
"Override",
"public",
"void",
"channelRead",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Object",
"msg",
")",
"throws",
"Exception",
"{",
"try",
"{",
"if",
"(",
"exceptionRaised",
".",
"get",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
... | If the HttpRequest is valid and handled it will be sent upstream, if it cannot be invoked
the response will be written back immediately. | [
"If",
"the",
"HttpRequest",
"is",
"valid",
"and",
"handled",
"it",
"will",
"be",
"sent",
"upstream",
"if",
"it",
"cannot",
"be",
"invoked",
"the",
"response",
"will",
"be",
"written",
"back",
"immediately",
"."
] | train | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/RequestRouter.java#L67-L108 |
waldheinz/fat32-lib | src/main/java/de/waldheinz/fs/fat/ShortNameGenerator.java | ShortNameGenerator.generateShortName | public ShortName generateShortName(String longFullName)
throws IllegalStateException {
"""
Generates a new unique 8.3 file name that is not already contained in
the set specified to the constructor.
@param longFullName the long file name to generate the short name for
@return the generated 8.3 fil... | java | public ShortName generateShortName(String longFullName)
throws IllegalStateException {
longFullName =
stripLeadingPeriods(longFullName).toUpperCase(Locale.ROOT);
final String longName;
final String longExt;
final int dotIdx = longFullName.las... | [
"public",
"ShortName",
"generateShortName",
"(",
"String",
"longFullName",
")",
"throws",
"IllegalStateException",
"{",
"longFullName",
"=",
"stripLeadingPeriods",
"(",
"longFullName",
")",
".",
"toUpperCase",
"(",
"Locale",
".",
"ROOT",
")",
";",
"final",
"String",... | Generates a new unique 8.3 file name that is not already contained in
the set specified to the constructor.
@param longFullName the long file name to generate the short name for
@return the generated 8.3 file name
@throws IllegalStateException if no unused short name could be found | [
"Generates",
"a",
"new",
"unique",
"8",
".",
"3",
"file",
"name",
"that",
"is",
"not",
"already",
"contained",
"in",
"the",
"set",
"specified",
"to",
"the",
"constructor",
"."
] | train | https://github.com/waldheinz/fat32-lib/blob/3d8f1a986339573576e02eb0b6ea49bfdc9cce26/src/main/java/de/waldheinz/fs/fat/ShortNameGenerator.java#L116-L171 |
broadinstitute/barclay | src/main/java/org/broadinstitute/barclay/argparser/TaggedArgumentParser.java | TaggedArgumentParser.populateArgumentTags | public static void populateArgumentTags(final TaggedArgument taggedArg, final String longArgName, final String tagString) {
"""
Parse a tag string and populate a TaggedArgument with values.
@param taggedArg TaggedArgument to receive tags
@param longArgName name of the argument being tagged
@param tagString ta... | java | public static void populateArgumentTags(final TaggedArgument taggedArg, final String longArgName, final String tagString) {
if (tagString == null) {
taggedArg.setTag(null);
taggedArg.setTagAttributes(Collections.emptyMap());
} else {
final ParsedArgument pa = ParsedAr... | [
"public",
"static",
"void",
"populateArgumentTags",
"(",
"final",
"TaggedArgument",
"taggedArg",
",",
"final",
"String",
"longArgName",
",",
"final",
"String",
"tagString",
")",
"{",
"if",
"(",
"tagString",
"==",
"null",
")",
"{",
"taggedArg",
".",
"setTag",
"... | Parse a tag string and populate a TaggedArgument with values.
@param taggedArg TaggedArgument to receive tags
@param longArgName name of the argument being tagged
@param tagString tag string (including logical name and attributes, no option name) | [
"Parse",
"a",
"tag",
"string",
"and",
"populate",
"a",
"TaggedArgument",
"with",
"values",
"."
] | train | https://github.com/broadinstitute/barclay/blob/7e56d725766b0da3baff23e79a31c3d01c3589c2/src/main/java/org/broadinstitute/barclay/argparser/TaggedArgumentParser.java#L231-L240 |
geomajas/geomajas-project-server | api/src/main/java/org/geomajas/layer/feature/attribute/ManyToOneAttribute.java | ManyToOneAttribute.setFloatAttribute | public void setFloatAttribute(String name, Float value) {
"""
Sets the specified float attribute to the specified value.
@param name name of the attribute
@param value value of the attribute
@since 1.9.0
"""
ensureValue();
Attribute attribute = new FloatAttribute(value);
attribute.setEditable(isEdit... | java | public void setFloatAttribute(String name, Float value) {
ensureValue();
Attribute attribute = new FloatAttribute(value);
attribute.setEditable(isEditable(name));
getValue().getAllAttributes().put(name, attribute);
} | [
"public",
"void",
"setFloatAttribute",
"(",
"String",
"name",
",",
"Float",
"value",
")",
"{",
"ensureValue",
"(",
")",
";",
"Attribute",
"attribute",
"=",
"new",
"FloatAttribute",
"(",
"value",
")",
";",
"attribute",
".",
"setEditable",
"(",
"isEditable",
"... | Sets the specified float attribute to the specified value.
@param name name of the attribute
@param value value of the attribute
@since 1.9.0 | [
"Sets",
"the",
"specified",
"float",
"attribute",
"to",
"the",
"specified",
"value",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/api/src/main/java/org/geomajas/layer/feature/attribute/ManyToOneAttribute.java#L174-L179 |
pavlospt/RxIAPv3 | androidiap/src/main/java/com/pavlospt/androidiap/utils/Security.java | Security.verifyPurchase | public static boolean verifyPurchase(String productId, String base64PublicKey, String signedData, String signature) {
"""
Verifies that the data was signed with the given signature, and returns
the verified purchase. The data is in JSON format and signed
with a private key.
@param productId the product Id used ... | java | public static boolean verifyPurchase(String productId, String base64PublicKey, String signedData, String signature) {
if (TextUtils.isEmpty(signedData) || TextUtils.isEmpty(base64PublicKey) ||
TextUtils.isEmpty(signature)) {
if(BuildConfig.DEBUG){
//handle test purch... | [
"public",
"static",
"boolean",
"verifyPurchase",
"(",
"String",
"productId",
",",
"String",
"base64PublicKey",
",",
"String",
"signedData",
",",
"String",
"signature",
")",
"{",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"signedData",
")",
"||",
"TextUtils",
... | Verifies that the data was signed with the given signature, and returns
the verified purchase. The data is in JSON format and signed
with a private key.
@param productId the product Id used for debug validation.
@param base64PublicKey the base64-encoded public key to use for verifying.
@param signedData the signed JSON... | [
"Verifies",
"that",
"the",
"data",
"was",
"signed",
"with",
"the",
"given",
"signature",
"and",
"returns",
"the",
"verified",
"purchase",
".",
"The",
"data",
"is",
"in",
"JSON",
"format",
"and",
"signed",
"with",
"a",
"private",
"key",
"."
] | train | https://github.com/pavlospt/RxIAPv3/blob/b7a02458ecc7529adaa25959822bd6d08cd3ebd0/androidiap/src/main/java/com/pavlospt/androidiap/utils/Security.java#L57-L73 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/globalfac/ConsecutiveSiblingsFactor.java | ConsecutiveSiblingsFactor.getLinkVar1Idx | public LinkVar getLinkVar1Idx(int parent, int child) {
"""
Get the link var corresponding to the specified parent and child position.
@param parent The parent word position (1-indexed), or 0 to indicate the wall node.
@param child The child word position (1-indexed).
@return The link variable.
"""
... | java | public LinkVar getLinkVar1Idx(int parent, int child) {
if (parent == 0) {
return rootVars[child-1];
} else {
return childVars[parent-1][child-1];
}
} | [
"public",
"LinkVar",
"getLinkVar1Idx",
"(",
"int",
"parent",
",",
"int",
"child",
")",
"{",
"if",
"(",
"parent",
"==",
"0",
")",
"{",
"return",
"rootVars",
"[",
"child",
"-",
"1",
"]",
";",
"}",
"else",
"{",
"return",
"childVars",
"[",
"parent",
"-",... | Get the link var corresponding to the specified parent and child position.
@param parent The parent word position (1-indexed), or 0 to indicate the wall node.
@param child The child word position (1-indexed).
@return The link variable. | [
"Get",
"the",
"link",
"var",
"corresponding",
"to",
"the",
"specified",
"parent",
"and",
"child",
"position",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/globalfac/ConsecutiveSiblingsFactor.java#L164-L170 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/ResponseHandler.java | ResponseHandler.bucketHasFastForwardMap | private static boolean bucketHasFastForwardMap(String bucketName, ClusterConfig clusterConfig) {
"""
Helper method to check if the current given bucket contains a fast forward map.
@param bucketName the name of the bucket.
@param clusterConfig the current cluster configuration.
@return true if it has a ffwd-m... | java | private static boolean bucketHasFastForwardMap(String bucketName, ClusterConfig clusterConfig) {
if (bucketName == null) {
return false;
}
BucketConfig bucketConfig = clusterConfig.bucketConfig(bucketName);
return bucketConfig != null && bucketConfig.hasFastForwardMap();
... | [
"private",
"static",
"boolean",
"bucketHasFastForwardMap",
"(",
"String",
"bucketName",
",",
"ClusterConfig",
"clusterConfig",
")",
"{",
"if",
"(",
"bucketName",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"BucketConfig",
"bucketConfig",
"=",
"clusterConf... | Helper method to check if the current given bucket contains a fast forward map.
@param bucketName the name of the bucket.
@param clusterConfig the current cluster configuration.
@return true if it has a ffwd-map, false otherwise. | [
"Helper",
"method",
"to",
"check",
"if",
"the",
"current",
"given",
"bucket",
"contains",
"a",
"fast",
"forward",
"map",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/ResponseHandler.java#L230-L236 |
Hygieia/Hygieia | collectors/misc/score/src/main/java/com/capitalone/dashboard/widget/WidgetScoreAbstract.java | WidgetScoreAbstract.processWidgetScore | @Override
public ScoreWeight processWidgetScore(Widget widget, ScoreComponentSettings paramSettings) {
"""
Process widget score
@param widget widget configuration from dashboard
@param paramSettings Score Settings for the widget
@return
"""
if (!Utils.isScoreEnabled(paramSettings)) {
return n... | java | @Override
public ScoreWeight processWidgetScore(Widget widget, ScoreComponentSettings paramSettings) {
if (!Utils.isScoreEnabled(paramSettings)) {
return null;
}
//1. Init scores
ScoreWeight scoreWidget = initWidgetScore(paramSettings);
if (null == widget) {
scoreWidget.setScore(par... | [
"@",
"Override",
"public",
"ScoreWeight",
"processWidgetScore",
"(",
"Widget",
"widget",
",",
"ScoreComponentSettings",
"paramSettings",
")",
"{",
"if",
"(",
"!",
"Utils",
".",
"isScoreEnabled",
"(",
"paramSettings",
")",
")",
"{",
"return",
"null",
";",
"}",
... | Process widget score
@param widget widget configuration from dashboard
@param paramSettings Score Settings for the widget
@return | [
"Process",
"widget",
"score"
] | train | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/misc/score/src/main/java/com/capitalone/dashboard/widget/WidgetScoreAbstract.java#L39-L80 |
alibaba/transmittable-thread-local | src/main/java/com/alibaba/ttl/TtlCallable.java | TtlCallable.get | @Nullable
public static <T> TtlCallable<T> get(@Nullable Callable<T> callable, boolean releaseTtlValueReferenceAfterCall) {
"""
Factory method, wrap input {@link Callable} to {@link TtlCallable}.
<p>
This method is idempotent.
@param callable input {@link Callable}
@param release... | java | @Nullable
public static <T> TtlCallable<T> get(@Nullable Callable<T> callable, boolean releaseTtlValueReferenceAfterCall) {
return get(callable, releaseTtlValueReferenceAfterCall, false);
} | [
"@",
"Nullable",
"public",
"static",
"<",
"T",
">",
"TtlCallable",
"<",
"T",
">",
"get",
"(",
"@",
"Nullable",
"Callable",
"<",
"T",
">",
"callable",
",",
"boolean",
"releaseTtlValueReferenceAfterCall",
")",
"{",
"return",
"get",
"(",
"callable",
",",
"rel... | Factory method, wrap input {@link Callable} to {@link TtlCallable}.
<p>
This method is idempotent.
@param callable input {@link Callable}
@param releaseTtlValueReferenceAfterCall release TTL value reference after run, avoid memory leak even if {@link TtlRunnable} is referred.
@return Wrapped {... | [
"Factory",
"method",
"wrap",
"input",
"{",
"@link",
"Callable",
"}",
"to",
"{",
"@link",
"TtlCallable",
"}",
".",
"<p",
">",
"This",
"method",
"is",
"idempotent",
"."
] | train | https://github.com/alibaba/transmittable-thread-local/blob/30b4d99cdb7064b4c1797d2e40bfa07adce8e7f9/src/main/java/com/alibaba/ttl/TtlCallable.java#L107-L110 |
aboutsip/pkts | pkts-sip/src/main/java/io/pkts/packet/sip/impl/SipMessageStreamBuilder.java | SipMessageStreamBuilder.onInit | private final State onInit(final Buffer buffer) {
"""
While in the INIT state, we are just consuming any empty space
before heading off to start parsing the initial line
@param b
@return
"""
try {
while (buffer.hasReadableBytes()) {
final byte b = buffer.peekByte();
... | java | private final State onInit(final Buffer buffer) {
try {
while (buffer.hasReadableBytes()) {
final byte b = buffer.peekByte();
if (b == SipParser.SP || b == SipParser.HTAB || b == SipParser.CR || b == SipParser.LF) {
buffer.readByte();
... | [
"private",
"final",
"State",
"onInit",
"(",
"final",
"Buffer",
"buffer",
")",
"{",
"try",
"{",
"while",
"(",
"buffer",
".",
"hasReadableBytes",
"(",
")",
")",
"{",
"final",
"byte",
"b",
"=",
"buffer",
".",
"peekByte",
"(",
")",
";",
"if",
"(",
"b",
... | While in the INIT state, we are just consuming any empty space
before heading off to start parsing the initial line
@param b
@return | [
"While",
"in",
"the",
"INIT",
"state",
"we",
"are",
"just",
"consuming",
"any",
"empty",
"space",
"before",
"heading",
"off",
"to",
"start",
"parsing",
"the",
"initial",
"line"
] | train | https://github.com/aboutsip/pkts/blob/0f06bb0dac76c812187829f580a8d476ca99a1a1/pkts-sip/src/main/java/io/pkts/packet/sip/impl/SipMessageStreamBuilder.java#L241-L257 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTree.java | WTree.processCheckExpandedCustomNodes | private void processCheckExpandedCustomNodes(final TreeItemIdNode node, final Set<String> expandedRows) {
"""
Iterate through nodes to check expanded nodes have their child nodes.
<p>
If a node is flagged as having children and has none, then load them from the tree model.
</p>
@param node the node to check
... | java | private void processCheckExpandedCustomNodes(final TreeItemIdNode node, final Set<String> expandedRows) {
// Node has no children
if (!node.hasChildren()) {
return;
}
// Check node is expanded
boolean expanded = getExpandMode() == WTree.ExpandMode.CLIENT || expandedRows.contains(node.getItemId());
if (!... | [
"private",
"void",
"processCheckExpandedCustomNodes",
"(",
"final",
"TreeItemIdNode",
"node",
",",
"final",
"Set",
"<",
"String",
">",
"expandedRows",
")",
"{",
"// Node has no children",
"if",
"(",
"!",
"node",
".",
"hasChildren",
"(",
")",
")",
"{",
"return",
... | Iterate through nodes to check expanded nodes have their child nodes.
<p>
If a node is flagged as having children and has none, then load them from the tree model.
</p>
@param node the node to check
@param expandedRows the expanded rows | [
"Iterate",
"through",
"nodes",
"to",
"check",
"expanded",
"nodes",
"have",
"their",
"child",
"nodes",
".",
"<p",
">",
"If",
"a",
"node",
"is",
"flagged",
"as",
"having",
"children",
"and",
"has",
"none",
"then",
"load",
"them",
"from",
"the",
"tree",
"mo... | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTree.java#L1254-L1275 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivision.java | AddressDivision.matchesWithMask | public boolean matchesWithMask(long lowerValue, long upperValue, long mask) {
"""
returns whether masking with the given mask results in a valid contiguous range for this segment,
and if it does, if it matches the range obtained when masking the given values with the same mask.
@param lowerValue
@param upperV... | java | public boolean matchesWithMask(long lowerValue, long upperValue, long mask) {
if(lowerValue == upperValue) {
return matchesWithMask(lowerValue, mask);
}
if(!isMultiple()) {
//we know lowerValue and upperValue are not the same, so impossible to match those two values with a single value
return false;
}
... | [
"public",
"boolean",
"matchesWithMask",
"(",
"long",
"lowerValue",
",",
"long",
"upperValue",
",",
"long",
"mask",
")",
"{",
"if",
"(",
"lowerValue",
"==",
"upperValue",
")",
"{",
"return",
"matchesWithMask",
"(",
"lowerValue",
",",
"mask",
")",
";",
"}",
... | returns whether masking with the given mask results in a valid contiguous range for this segment,
and if it does, if it matches the range obtained when masking the given values with the same mask.
@param lowerValue
@param upperValue
@param mask
@return | [
"returns",
"whether",
"masking",
"with",
"the",
"given",
"mask",
"results",
"in",
"a",
"valid",
"contiguous",
"range",
"for",
"this",
"segment",
"and",
"if",
"it",
"does",
"if",
"it",
"matches",
"the",
"range",
"obtained",
"when",
"masking",
"the",
"given",
... | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivision.java#L266-L280 |
alkacon/opencms-core | src/org/opencms/jsp/search/controller/CmsSearchControllerFacetField.java | CmsSearchControllerFacetField.addFacetOptions | protected void addFacetOptions(StringBuffer query, final boolean useLimit) {
"""
Adds the query parts for the facet options, except the filter parts.
@param query The query part that is extended with the facet options.
@param useLimit Flag, if the limit option should be set.
"""
// mincount
... | java | protected void addFacetOptions(StringBuffer query, final boolean useLimit) {
// mincount
if (m_config.getMinCount() != null) {
appendFacetOption(query, "mincount", m_config.getMinCount().toString());
}
// limit
if (useLimit && (m_config.getLimit() != null)) {
... | [
"protected",
"void",
"addFacetOptions",
"(",
"StringBuffer",
"query",
",",
"final",
"boolean",
"useLimit",
")",
"{",
"// mincount",
"if",
"(",
"m_config",
".",
"getMinCount",
"(",
")",
"!=",
"null",
")",
"{",
"appendFacetOption",
"(",
"query",
",",
"\"mincount... | Adds the query parts for the facet options, except the filter parts.
@param query The query part that is extended with the facet options.
@param useLimit Flag, if the limit option should be set. | [
"Adds",
"the",
"query",
"parts",
"for",
"the",
"facet",
"options",
"except",
"the",
"filter",
"parts",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/controller/CmsSearchControllerFacetField.java#L140-L158 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/AbstractTagLibrary.java | AbstractTagLibrary.addConverter | protected final void addConverter(String name, String converterId) {
"""
Add a ConvertHandler for the specified converterId
@see javax.faces.view.facelets.ConverterHandler
@see javax.faces.application.Application#createConverter(java.lang.String)
@param name
name to use, "foo" would be <my:foo />
@param ... | java | protected final void addConverter(String name, String converterId)
{
_factories.put(name, new ConverterHandlerFactory(converterId));
} | [
"protected",
"final",
"void",
"addConverter",
"(",
"String",
"name",
",",
"String",
"converterId",
")",
"{",
"_factories",
".",
"put",
"(",
"name",
",",
"new",
"ConverterHandlerFactory",
"(",
"converterId",
")",
")",
";",
"}"
] | Add a ConvertHandler for the specified converterId
@see javax.faces.view.facelets.ConverterHandler
@see javax.faces.application.Application#createConverter(java.lang.String)
@param name
name to use, "foo" would be <my:foo />
@param converterId
id to pass to Application instance | [
"Add",
"a",
"ConvertHandler",
"for",
"the",
"specified",
"converterId"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/AbstractTagLibrary.java#L197-L200 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/FieldsInner.java | FieldsInner.listByType | public List<TypeFieldInner> listByType(String resourceGroupName, String automationAccountName, String moduleName, String typeName) {
"""
Retrieve a list of fields of a given type identified by module name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the au... | java | public List<TypeFieldInner> listByType(String resourceGroupName, String automationAccountName, String moduleName, String typeName) {
return listByTypeWithServiceResponseAsync(resourceGroupName, automationAccountName, moduleName, typeName).toBlocking().single().body();
} | [
"public",
"List",
"<",
"TypeFieldInner",
">",
"listByType",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"moduleName",
",",
"String",
"typeName",
")",
"{",
"return",
"listByTypeWithServiceResponseAsync",
"(",
"resourceGroupN... | Retrieve a list of fields of a given type identified by module name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param moduleName The name of module.
@param typeName The name of type.
@throws IllegalArgumentException thrown if parameters f... | [
"Retrieve",
"a",
"list",
"of",
"fields",
"of",
"a",
"given",
"type",
"identified",
"by",
"module",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/FieldsInner.java#L73-L75 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagContainer.java | CmsJspTagContainer.getElementInfo | private String getElementInfo(CmsObject cms, CmsContainerElementBean elementBean, CmsContainerPageBean page)
throws Exception {
"""
Returns the serialized element data.<p>
@param cms the current cms context
@param elementBean the element to serialize
@param page the container page
@return the serialize... | java | private String getElementInfo(CmsObject cms, CmsContainerElementBean elementBean, CmsContainerPageBean page)
throws Exception {
return CmsContainerpageService.getSerializedElementInfo(
cms,
(HttpServletRequest)pageContext.getRequest(),
(HttpServletResponse)pageContext.ge... | [
"private",
"String",
"getElementInfo",
"(",
"CmsObject",
"cms",
",",
"CmsContainerElementBean",
"elementBean",
",",
"CmsContainerPageBean",
"page",
")",
"throws",
"Exception",
"{",
"return",
"CmsContainerpageService",
".",
"getSerializedElementInfo",
"(",
"cms",
",",
"(... | Returns the serialized element data.<p>
@param cms the current cms context
@param elementBean the element to serialize
@param page the container page
@return the serialized element data
@throws Exception if something goes wrong | [
"Returns",
"the",
"serialized",
"element",
"data",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagContainer.java#L1217-L1226 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.