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
jenkinsci/github-plugin
src/main/java/org/jenkinsci/plugins/github/webhook/WebhookManager.java
WebhookManager.createWebhook
protected Function<GHRepository, GHHook> createWebhook(final URL url, final Set<GHEvent> events) { """ @param url jenkins endpoint url @param events list of GH events jenkins interested in @return converter to create GH hook for given url with given events """ return new NullSafeFunction<GHRepos...
java
protected Function<GHRepository, GHHook> createWebhook(final URL url, final Set<GHEvent> events) { return new NullSafeFunction<GHRepository, GHHook>() { protected GHHook applyNullSafe(@Nonnull GHRepository repo) { try { final HashMap<String, String> config = new H...
[ "protected", "Function", "<", "GHRepository", ",", "GHHook", ">", "createWebhook", "(", "final", "URL", "url", ",", "final", "Set", "<", "GHEvent", ">", "events", ")", "{", "return", "new", "NullSafeFunction", "<", "GHRepository", ",", "GHHook", ">", "(", ...
@param url jenkins endpoint url @param events list of GH events jenkins interested in @return converter to create GH hook for given url with given events
[ "@param", "url", "jenkins", "endpoint", "url", "@param", "events", "list", "of", "GH", "events", "jenkins", "interested", "in" ]
train
https://github.com/jenkinsci/github-plugin/blob/4e05b9aeb488af5342c78f78aa3c55114e8d462a/src/main/java/org/jenkinsci/plugins/github/webhook/WebhookManager.java#L315-L335
alkacon/opencms-core
src/org/opencms/site/CmsSiteManagerImpl.java
CmsSiteManagerImpl.getSiteTitle
public String getSiteTitle(CmsObject cms, CmsResource resource) throws CmsException { """ Returns the site title.<p> @param cms the cms context @param resource the site root resource @return the title @throws CmsException in case reading the title property fails """ String title = cms.readPr...
java
public String getSiteTitle(CmsObject cms, CmsResource resource) throws CmsException { String title = cms.readPropertyObject(resource, CmsPropertyDefinition.PROPERTY_TITLE, false).getValue(); if (title == null) { title = resource.getRootPath(); } if (resource.getRootPath().eq...
[ "public", "String", "getSiteTitle", "(", "CmsObject", "cms", ",", "CmsResource", "resource", ")", "throws", "CmsException", "{", "String", "title", "=", "cms", ".", "readPropertyObject", "(", "resource", ",", "CmsPropertyDefinition", ".", "PROPERTY_TITLE", ",", "f...
Returns the site title.<p> @param cms the cms context @param resource the site root resource @return the title @throws CmsException in case reading the title property fails
[ "Returns", "the", "site", "title", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/CmsSiteManagerImpl.java#L992-L1002
Netflix/conductor
client/src/main/java/com/netflix/conductor/client/http/WorkflowClient.java
WorkflowClient.rerunWorkflow
public String rerunWorkflow(String workflowId, RerunWorkflowRequest rerunWorkflowRequest) { """ Reruns the workflow from a specific task @param workflowId the id of the workflow @param rerunWorkflowRequest the request containing the task to rerun from @return the id of the workflow """ P...
java
public String rerunWorkflow(String workflowId, RerunWorkflowRequest rerunWorkflowRequest) { Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "workflow id cannot be blank"); Preconditions.checkNotNull(rerunWorkflowRequest, "RerunWorkflowRequest cannot be null"); return postForEnti...
[ "public", "String", "rerunWorkflow", "(", "String", "workflowId", ",", "RerunWorkflowRequest", "rerunWorkflowRequest", ")", "{", "Preconditions", ".", "checkArgument", "(", "StringUtils", ".", "isNotBlank", "(", "workflowId", ")", ",", "\"workflow id cannot be blank\"", ...
Reruns the workflow from a specific task @param workflowId the id of the workflow @param rerunWorkflowRequest the request containing the task to rerun from @return the id of the workflow
[ "Reruns", "the", "workflow", "from", "a", "specific", "task" ]
train
https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/client/src/main/java/com/netflix/conductor/client/http/WorkflowClient.java#L278-L283
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java
MBTilesDb.fillMetadata
public void fillMetadata( float n, float s, float w, float e, String name, String format, int minZoom, int maxZoom ) throws Exception { """ Populate the metadata table. @param n nord bound. @param s south bound. @param w west bound. @param e east bound. @param name name of the dataset. @param f...
java
public void fillMetadata( float n, float s, float w, float e, String name, String format, int minZoom, int maxZoom ) throws Exception { // type = baselayer // version = 1.1 // descritpion = name String query = toMetadataQuery("name", name); database.executeInsertUpdat...
[ "public", "void", "fillMetadata", "(", "float", "n", ",", "float", "s", ",", "float", "w", ",", "float", "e", ",", "String", "name", ",", "String", "format", ",", "int", "minZoom", ",", "int", "maxZoom", ")", "throws", "Exception", "{", "// type = basela...
Populate the metadata table. @param n nord bound. @param s south bound. @param w west bound. @param e east bound. @param name name of the dataset. @param format format of the images. png or jpg. @param minZoom lowest zoomlevel. @param maxZoom highest zoomlevel. @throws Exception
[ "Populate", "the", "metadata", "table", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java#L169-L191
google/closure-templates
java/src/com/google/template/soy/jbcsrc/restricted/Expression.java
Expression.asCheap
public Expression asCheap() { """ Returns an equivalent expression where {@link #isCheap()} returns {@code true}. """ if (isCheap()) { return this; } return new Expression(resultType, features.plus(Feature.CHEAP)) { @Override protected void doGen(CodeBuilder adapter) { Exp...
java
public Expression asCheap() { if (isCheap()) { return this; } return new Expression(resultType, features.plus(Feature.CHEAP)) { @Override protected void doGen(CodeBuilder adapter) { Expression.this.gen(adapter); } }; }
[ "public", "Expression", "asCheap", "(", ")", "{", "if", "(", "isCheap", "(", ")", ")", "{", "return", "this", ";", "}", "return", "new", "Expression", "(", "resultType", ",", "features", ".", "plus", "(", "Feature", ".", "CHEAP", ")", ")", "{", "@", ...
Returns an equivalent expression where {@link #isCheap()} returns {@code true}.
[ "Returns", "an", "equivalent", "expression", "where", "{" ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/Expression.java#L299-L309
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/ProjectApi.java
ProjectApi.getSnippet
public Snippet getSnippet(Object projectIdOrPath, Integer snippetId) throws GitLabApiException { """ Get a single of project snippet. <pre><code>GET /projects/:id/snippets/:snippet_id</code></pre> @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project insta...
java
public Snippet getSnippet(Object projectIdOrPath, Integer snippetId) throws GitLabApiException { Response response = get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "snippets", snippetId); return (response.readEntity(Snippet.class)); }
[ "public", "Snippet", "getSnippet", "(", "Object", "projectIdOrPath", ",", "Integer", "snippetId", ")", "throws", "GitLabApiException", "{", "Response", "response", "=", "get", "(", "Response", ".", "Status", ".", "OK", ",", "null", ",", "\"projects\"", ",", "g...
Get a single of project snippet. <pre><code>GET /projects/:id/snippets/:snippet_id</code></pre> @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required @param snippetId the ID of the project's snippet @return the specified project Snippet @throws G...
[ "Get", "a", "single", "of", "project", "snippet", "." ]
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L1946-L1949
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/accounts/CardUrl.java
CardUrl.updateAccountCardUrl
public static MozuUrl updateAccountCardUrl(Integer accountId, String cardId, String responseFields) { """ Get Resource Url for UpdateAccountCard @param accountId Unique identifier of the customer account. @param cardId Unique identifier of the card associated with the customer account billing contact. @param re...
java
public static MozuUrl updateAccountCardUrl(Integer accountId, String cardId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/cards/{cardId}?responseFields={responseFields}"); formatter.formatUrl("accountId", accountId); formatter.formatUrl("card...
[ "public", "static", "MozuUrl", "updateAccountCardUrl", "(", "Integer", "accountId", ",", "String", "cardId", ",", "String", "responseFields", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/customer/accounts/{accountId}/cards/{cardId...
Get Resource Url for UpdateAccountCard @param accountId Unique identifier of the customer account. @param cardId Unique identifier of the card associated with the customer account billing contact. @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a...
[ "Get", "Resource", "Url", "for", "UpdateAccountCard" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/accounts/CardUrl.java#L67-L74
jboss/jboss-el-api_spec
src/main/java/javax/el/Util.java
Util.findMethod
static Method findMethod(Class<?> clazz, String methodName, Class<?>[] paramTypes, Object[] paramValues) { """ /* This method duplicates code in org.apache.el.util.ReflectionUtil. When making changes keep the code in sync. """ if (clazz == null || methodName == null) { throw ...
java
static Method findMethod(Class<?> clazz, String methodName, Class<?>[] paramTypes, Object[] paramValues) { if (clazz == null || methodName == null) { throw new MethodNotFoundException( message(null, "util.method.notfound", clazz, methodName, param...
[ "static", "Method", "findMethod", "(", "Class", "<", "?", ">", "clazz", ",", "String", "methodName", ",", "Class", "<", "?", ">", "[", "]", "paramTypes", ",", "Object", "[", "]", "paramValues", ")", "{", "if", "(", "clazz", "==", "null", "||", "metho...
/* This method duplicates code in org.apache.el.util.ReflectionUtil. When making changes keep the code in sync.
[ "/", "*", "This", "method", "duplicates", "code", "in", "org", ".", "apache", ".", "el", ".", "util", ".", "ReflectionUtil", ".", "When", "making", "changes", "keep", "the", "code", "in", "sync", "." ]
train
https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/javax/el/Util.java#L186-L210
xmlet/XsdAsmFaster
src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmUtils.java
XsdAsmUtils.getAttributeRestrictions
static List<XsdRestriction> getAttributeRestrictions(XsdAttribute attribute) { """ Obtains the attribute restrictions. @param attribute The received {@link XsdAttribute}. @return The restrictions of the received {@link XsdAttribute}. """ try { return attribute.getAllRestrictions(); ...
java
static List<XsdRestriction> getAttributeRestrictions(XsdAttribute attribute) { try { return attribute.getAllRestrictions(); } catch (InvalidParameterException e){ throw new AsmException("The provided XSD file has contradictory restrictions.", e); } }
[ "static", "List", "<", "XsdRestriction", ">", "getAttributeRestrictions", "(", "XsdAttribute", "attribute", ")", "{", "try", "{", "return", "attribute", ".", "getAllRestrictions", "(", ")", ";", "}", "catch", "(", "InvalidParameterException", "e", ")", "{", "thr...
Obtains the attribute restrictions. @param attribute The received {@link XsdAttribute}. @return The restrictions of the received {@link XsdAttribute}.
[ "Obtains", "the", "attribute", "restrictions", "." ]
train
https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmUtils.java#L292-L298
upwork/java-upwork
src/com/Upwork/api/Routers/Hr/Clients/Offers.java
Offers.getList
public JSONObject getList(HashMap<String, String> params) throws JSONException { """ Get list of offers @param params Parameters @throws JSONException If error occurred @return {@link JSONObject} """ return oClient.get("/offers/v1/clients/offers", params); }
java
public JSONObject getList(HashMap<String, String> params) throws JSONException { return oClient.get("/offers/v1/clients/offers", params); }
[ "public", "JSONObject", "getList", "(", "HashMap", "<", "String", ",", "String", ">", "params", ")", "throws", "JSONException", "{", "return", "oClient", ".", "get", "(", "\"/offers/v1/clients/offers\"", ",", "params", ")", ";", "}" ]
Get list of offers @param params Parameters @throws JSONException If error occurred @return {@link JSONObject}
[ "Get", "list", "of", "offers" ]
train
https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Hr/Clients/Offers.java#L53-L55
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.createAppUser
public static BoxUser.Info createAppUser(BoxAPIConnection api, String name) { """ Provisions a new app user in an enterprise using Box Developer Edition. @param api the API connection to be used by the created user. @param name the name of the user. @return the created user's info. """ re...
java
public static BoxUser.Info createAppUser(BoxAPIConnection api, String name) { return createAppUser(api, name, new CreateUserParams()); }
[ "public", "static", "BoxUser", ".", "Info", "createAppUser", "(", "BoxAPIConnection", "api", ",", "String", "name", ")", "{", "return", "createAppUser", "(", "api", ",", "name", ",", "new", "CreateUserParams", "(", ")", ")", ";", "}" ]
Provisions a new app user in an enterprise using Box Developer Edition. @param api the API connection to be used by the created user. @param name the name of the user. @return the created user's info.
[ "Provisions", "a", "new", "app", "user", "in", "an", "enterprise", "using", "Box", "Developer", "Edition", "." ]
train
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L83-L85
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/common/logging/LogUtils.java
LogUtils.getL7dLogger
public static Logger getL7dLogger(Class<?> cls, String resourcename, String loggerName) { """ Get a Logger with an associated resource bundle. @param cls the Class to contain the Logger (to find resources) @param resourcename the resou...
java
public static Logger getL7dLogger(Class<?> cls, String resourcename, String loggerName) { return createLogger(cls, resourcename, loggerName); }
[ "public", "static", "Logger", "getL7dLogger", "(", "Class", "<", "?", ">", "cls", ",", "String", "resourcename", ",", "String", "loggerName", ")", "{", "return", "createLogger", "(", "cls", ",", "resourcename", ",", "loggerName", ")", ";", "}" ]
Get a Logger with an associated resource bundle. @param cls the Class to contain the Logger (to find resources) @param resourcename the resource name @param loggerName the full name for the logger @return an appropriate Logger
[ "Get", "a", "Logger", "with", "an", "associated", "resource", "bundle", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/common/logging/LogUtils.java#L228-L232
haraldk/TwelveMonkeys
sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/droplet/taglib/IncludeTag.java
IncludeTag.addParameter
public void addParameter(String pName, Object pValue) { """ Adds a parameter to the {@code PageContext.REQUEST_SCOPE} scope. If a parameter with the same name as {@code pName} already exists, then the old parameter is first placed in the {@code OldParameters} member variable. When this tag is finished, the old...
java
public void addParameter(String pName, Object pValue) { // Check that we haven't already saved this parameter if (!parameterNames.contains(pName)) { parameterNames.add(pName); // Now check if this parameter already exists in the page. Object obj = getRequest()....
[ "public", "void", "addParameter", "(", "String", "pName", ",", "Object", "pValue", ")", "{", "// Check that we haven't already saved this parameter\r", "if", "(", "!", "parameterNames", ".", "contains", "(", "pName", ")", ")", "{", "parameterNames", ".", "add", "(...
Adds a parameter to the {@code PageContext.REQUEST_SCOPE} scope. If a parameter with the same name as {@code pName} already exists, then the old parameter is first placed in the {@code OldParameters} member variable. When this tag is finished, the old value will be restored. @param pName The name of the new parameter...
[ "Adds", "a", "parameter", "to", "the", "{", "@code", "PageContext", ".", "REQUEST_SCOPE", "}", "scope", ".", "If", "a", "parameter", "with", "the", "same", "name", "as", "{", "@code", "pName", "}", "already", "exists", "then", "the", "old", "parameter", ...
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/droplet/taglib/IncludeTag.java#L86-L100
aws/aws-sdk-java
aws-java-sdk-simpledb/src/main/java/com/amazonaws/services/simpledb/util/SimpleDBUtils.java
SimpleDBUtils.encodeRealNumberRange
public static String encodeRealNumberRange(float number, int maxDigitsLeft, int maxDigitsRight, int offsetValue) { """ Encodes real float value into a string by offsetting and zero-padding number up to the specified number of digits. Use this encoding method if the data range set includes both positive and negat...
java
public static String encodeRealNumberRange(float number, int maxDigitsLeft, int maxDigitsRight, int offsetValue) { int shiftMultiplier = (int) Math.pow(10, maxDigitsRight); long shiftedNumber = (long) Math.round((double) number * shiftMultiplier); long shiftedOffset = offsetValue * shiftMultipli...
[ "public", "static", "String", "encodeRealNumberRange", "(", "float", "number", ",", "int", "maxDigitsLeft", ",", "int", "maxDigitsRight", ",", "int", "offsetValue", ")", "{", "int", "shiftMultiplier", "=", "(", "int", ")", "Math", ".", "pow", "(", "10", ",",...
Encodes real float value into a string by offsetting and zero-padding number up to the specified number of digits. Use this encoding method if the data range set includes both positive and negative values. @param number float to be encoded @param maxDigitsLeft maximum number of digits left of the decimal point in the ...
[ "Encodes", "real", "float", "value", "into", "a", "string", "by", "offsetting", "and", "zero", "-", "padding", "number", "up", "to", "the", "specified", "number", "of", "digits", ".", "Use", "this", "encoding", "method", "if", "the", "data", "range", "set"...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-simpledb/src/main/java/com/amazonaws/services/simpledb/util/SimpleDBUtils.java#L202-L229
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java
ArrayUtil.contains
public static <T> boolean contains(T[] array, T value) { """ 数组中是否包含元素 @param <T> 数组元素类型 @param array 数组 @param value 被检查的元素 @return 是否包含 """ return indexOf(array, value) > INDEX_NOT_FOUND; }
java
public static <T> boolean contains(T[] array, T value) { return indexOf(array, value) > INDEX_NOT_FOUND; }
[ "public", "static", "<", "T", ">", "boolean", "contains", "(", "T", "[", "]", "array", ",", "T", "value", ")", "{", "return", "indexOf", "(", "array", ",", "value", ")", ">", "INDEX_NOT_FOUND", ";", "}" ]
数组中是否包含元素 @param <T> 数组元素类型 @param array 数组 @param value 被检查的元素 @return 是否包含
[ "数组中是否包含元素" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L956-L958
apache/incubator-heron
heron/spi/src/java/org/apache/heron/spi/packing/Resource.java
Resource.subtractAbsolute
public Resource subtractAbsolute(Resource other) { """ Subtracts a given resource from the current resource. The results is never negative. """ double cpuDifference = this.getCpu() - other.getCpu(); double extraCpu = Math.max(0, cpuDifference); ByteAmount ramDifference = this.getRam().minus(other.g...
java
public Resource subtractAbsolute(Resource other) { double cpuDifference = this.getCpu() - other.getCpu(); double extraCpu = Math.max(0, cpuDifference); ByteAmount ramDifference = this.getRam().minus(other.getRam()); ByteAmount extraRam = ByteAmount.ZERO.max(ramDifference); ByteAmount diskDifference ...
[ "public", "Resource", "subtractAbsolute", "(", "Resource", "other", ")", "{", "double", "cpuDifference", "=", "this", ".", "getCpu", "(", ")", "-", "other", ".", "getCpu", "(", ")", ";", "double", "extraCpu", "=", "Math", ".", "max", "(", "0", ",", "cp...
Subtracts a given resource from the current resource. The results is never negative.
[ "Subtracts", "a", "given", "resource", "from", "the", "current", "resource", ".", "The", "results", "is", "never", "negative", "." ]
train
https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/spi/src/java/org/apache/heron/spi/packing/Resource.java#L80-L88
facebookarchive/hadoop-20
src/contrib/benchmark/src/java/org/apache/hadoop/mapred/SleepJobRunner.java
SleepJobRunner.calcStats
private static Stats calcStats(List<Double> nums) { """ Calculates mean, variance, standard deviation for a set of numbers @param nums the list of numbers to compute stats on @return aforementioned values in a Stats helper class """ double sum = 0.0, mean = 0.0, variance = 0.0, stdDev = 0.0; for (Dou...
java
private static Stats calcStats(List<Double> nums) { double sum = 0.0, mean = 0.0, variance = 0.0, stdDev = 0.0; for (Double d : nums) { sum += d.doubleValue(); } if (nums.size() > 0) { mean = sum / nums.size(); } sum = 0.0; for (Double d : nums) { sum += (d.doubleValue() -...
[ "private", "static", "Stats", "calcStats", "(", "List", "<", "Double", ">", "nums", ")", "{", "double", "sum", "=", "0.0", ",", "mean", "=", "0.0", ",", "variance", "=", "0.0", ",", "stdDev", "=", "0.0", ";", "for", "(", "Double", "d", ":", "nums",...
Calculates mean, variance, standard deviation for a set of numbers @param nums the list of numbers to compute stats on @return aforementioned values in a Stats helper class
[ "Calculates", "mean", "variance", "standard", "deviation", "for", "a", "set", "of", "numbers" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/benchmark/src/java/org/apache/hadoop/mapred/SleepJobRunner.java#L61-L80
orbisgis/h2gis
h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/FileEngine.java
FileEngine.getUniqueColumnName
public static String getUniqueColumnName(String base, List<Column> columns) { """ Compute unique column name among the other columns @param base Returned name if there is no duplicate @param columns Other existing columns @return Unique column name """ String cursor = base; int cpt = 2; ...
java
public static String getUniqueColumnName(String base, List<Column> columns) { String cursor = base; int cpt = 2; boolean findDuplicate= true; while(findDuplicate) { findDuplicate = false; for (Column column : columns) { if (column.getName().equalsI...
[ "public", "static", "String", "getUniqueColumnName", "(", "String", "base", ",", "List", "<", "Column", ">", "columns", ")", "{", "String", "cursor", "=", "base", ";", "int", "cpt", "=", "2", ";", "boolean", "findDuplicate", "=", "true", ";", "while", "(...
Compute unique column name among the other columns @param base Returned name if there is no duplicate @param columns Other existing columns @return Unique column name
[ "Compute", "unique", "column", "name", "among", "the", "other", "columns" ]
train
https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/FileEngine.java#L84-L101
Mangopay/mangopay2-java-sdk
src/main/java/com/mangopay/core/APIs/ApiBase.java
ApiBase.updateObject
protected <T extends Dto> T updateObject(Class<T> classOfT, String methodKey, T entity, String entityId, String secondEntityId) throws Exception { """ Saves the Dto instance. @param <T> Type on behalf of which the request is being called. @param classOfT Type on behalf of which the request...
java
protected <T extends Dto> T updateObject(Class<T> classOfT, String methodKey, T entity, String entityId, String secondEntityId) throws Exception { if (entity instanceof EntityBase) { String urlMethod; if (secondEntityId.length() > 0) { urlMethod = String.format(this.ge...
[ "protected", "<", "T", "extends", "Dto", ">", "T", "updateObject", "(", "Class", "<", "T", ">", "classOfT", ",", "String", "methodKey", ",", "T", "entity", ",", "String", "entityId", ",", "String", "secondEntityId", ")", "throws", "Exception", "{", "if", ...
Saves the Dto instance. @param <T> Type on behalf of which the request is being called. @param classOfT Type on behalf of which the request is being called. @param methodKey Relevant method key. @param entity Dto instance that is going to be sent. @param entityId Entit...
[ "Saves", "the", "Dto", "instance", "." ]
train
https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/APIs/ApiBase.java#L451-L470
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java
HttpChannelConfig.parsev0CookieDateRFC1123compat
private void parsev0CookieDateRFC1123compat(Map<?, ?> props) { """ Check the for the property v0CookieDateRFC1123compat @param props """ Object value = props.get(HttpConfigConstants.PROPNAME_V0_COOKIE_RFC1123_COMPAT); if (null != value) { this.v0CookieDateRFC1123compat = convert...
java
private void parsev0CookieDateRFC1123compat(Map<?, ?> props) { Object value = props.get(HttpConfigConstants.PROPNAME_V0_COOKIE_RFC1123_COMPAT); if (null != value) { this.v0CookieDateRFC1123compat = convertBoolean(value); } if (TraceComponent.isAnyTracingEnabled() && tc.isEv...
[ "private", "void", "parsev0CookieDateRFC1123compat", "(", "Map", "<", "?", ",", "?", ">", "props", ")", "{", "Object", "value", "=", "props", ".", "get", "(", "HttpConfigConstants", ".", "PROPNAME_V0_COOKIE_RFC1123_COMPAT", ")", ";", "if", "(", "null", "!=", ...
Check the for the property v0CookieDateRFC1123compat @param props
[ "Check", "the", "for", "the", "property", "v0CookieDateRFC1123compat" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L1211-L1221
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/CFEndPointImpl.java
CFEndPointImpl.assignPort
private void assignPort(String portString, String listenPortString) throws ChannelFrameworkException, NumberFormatException { """ Assign the value of port based on the parameters. If the first parameter is null, the second/backup will be used. @param portString @param listenPortString @throws ChannelFramewo...
java
private void assignPort(String portString, String listenPortString) throws ChannelFrameworkException, NumberFormatException { if (portString != null) { // Found a port string. Convert it to an int. port = Integer.parseInt(portString); if (TraceComponent.isAnyTracingEnabled() ...
[ "private", "void", "assignPort", "(", "String", "portString", ",", "String", "listenPortString", ")", "throws", "ChannelFrameworkException", ",", "NumberFormatException", "{", "if", "(", "portString", "!=", "null", ")", "{", "// Found a port string. Convert it to an int."...
Assign the value of port based on the parameters. If the first parameter is null, the second/backup will be used. @param portString @param listenPortString @throws ChannelFrameworkException @throws NumberFormatException - format of port string is not valid
[ "Assign", "the", "value", "of", "port", "based", "on", "the", "parameters", ".", "If", "the", "first", "parameter", "is", "null", "the", "second", "/", "backup", "will", "be", "used", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/CFEndPointImpl.java#L273-L293
alkacon/opencms-core
src/org/opencms/module/CmsModule.java
CmsModule.isEqual
private boolean isEqual(Object a, Object b) { """ Checks if two objects are either both null, or equal.<p> @param a the first object to check @param b the second object to check @return true if the two object are either both null, or equal """ if (a == null) { return (b == null); ...
java
private boolean isEqual(Object a, Object b) { if (a == null) { return (b == null); } if (b == null) { return false; } return a.equals(b); }
[ "private", "boolean", "isEqual", "(", "Object", "a", ",", "Object", "b", ")", "{", "if", "(", "a", "==", "null", ")", "{", "return", "(", "b", "==", "null", ")", ";", "}", "if", "(", "b", "==", "null", ")", "{", "return", "false", ";", "}", "...
Checks if two objects are either both null, or equal.<p> @param a the first object to check @param b the second object to check @return true if the two object are either both null, or equal
[ "Checks", "if", "two", "objects", "are", "either", "both", "null", "or", "equal", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/module/CmsModule.java#L1790-L1799
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java
ServletUtil.getClientIPByHeader
public static String getClientIPByHeader(HttpServletRequest request, String... headerNames) { """ 获取客户端IP <p> headerNames参数用于自定义检测的Header<br> 需要注意的是,使用此方法获取的客户IP地址必须在Http服务器(例如Nginx)中配置头信息,否则容易造成IP伪造。 </p> @param request 请求对象{@link HttpServletRequest} @param headerNames 自定义头,通常在Http服务器(例如Nginx)中配置 @retu...
java
public static String getClientIPByHeader(HttpServletRequest request, String... headerNames) { String ip; for (String header : headerNames) { ip = request.getHeader(header); if (false == isUnknow(ip)) { return getMultistageReverseProxyIp(ip); } } ip = request.getRemoteAddr(); return get...
[ "public", "static", "String", "getClientIPByHeader", "(", "HttpServletRequest", "request", ",", "String", "...", "headerNames", ")", "{", "String", "ip", ";", "for", "(", "String", "header", ":", "headerNames", ")", "{", "ip", "=", "request", ".", "getHeader",...
获取客户端IP <p> headerNames参数用于自定义检测的Header<br> 需要注意的是,使用此方法获取的客户IP地址必须在Http服务器(例如Nginx)中配置头信息,否则容易造成IP伪造。 </p> @param request 请求对象{@link HttpServletRequest} @param headerNames 自定义头,通常在Http服务器(例如Nginx)中配置 @return IP地址 @since 4.4.1
[ "获取客户端IP" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java#L222-L233
prestodb/presto
presto-spi/src/main/java/com/facebook/presto/spi/Page.java
Page.getSingleValuePage
public Page getSingleValuePage(int position) { """ Gets the values at the specified position as a single element page. The method creates independent copy of the data. """ Block[] singleValueBlocks = new Block[this.blocks.length]; for (int i = 0; i < this.blocks.length; i++) { sin...
java
public Page getSingleValuePage(int position) { Block[] singleValueBlocks = new Block[this.blocks.length]; for (int i = 0; i < this.blocks.length; i++) { singleValueBlocks[i] = this.blocks[i].getSingleValueBlock(position); } return new Page(1, singleValueBlocks); }
[ "public", "Page", "getSingleValuePage", "(", "int", "position", ")", "{", "Block", "[", "]", "singleValueBlocks", "=", "new", "Block", "[", "this", ".", "blocks", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", ...
Gets the values at the specified position as a single element page. The method creates independent copy of the data.
[ "Gets", "the", "values", "at", "the", "specified", "position", "as", "a", "single", "element", "page", ".", "The", "method", "creates", "independent", "copy", "of", "the", "data", "." ]
train
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-spi/src/main/java/com/facebook/presto/spi/Page.java#L110-L117
qiniu/java-sdk
src/main/java/com/qiniu/streaming/StreamingManager.java
StreamingManager.saveAs
public String saveAs(String streamKey, String fileName, long start, long end) throws QiniuException { """ * 从直播流数据中录制点播,该方法可以指定录制的时间段 @param streamKey 流名称 @param fileName 录制后保存的文件名 @param start 录制开始的时间戳,单位秒 @param end 录制结束的时间戳,单位秒 """ return saveAs(streamKey, fileName, start, end, null...
java
public String saveAs(String streamKey, String fileName, long start, long end) throws QiniuException { return saveAs(streamKey, fileName, start, end, null); }
[ "public", "String", "saveAs", "(", "String", "streamKey", ",", "String", "fileName", ",", "long", "start", ",", "long", "end", ")", "throws", "QiniuException", "{", "return", "saveAs", "(", "streamKey", ",", "fileName", ",", "start", ",", "end", ",", "null...
* 从直播流数据中录制点播,该方法可以指定录制的时间段 @param streamKey 流名称 @param fileName 录制后保存的文件名 @param start 录制开始的时间戳,单位秒 @param end 录制结束的时间戳,单位秒
[ "*", "从直播流数据中录制点播,该方法可以指定录制的时间段" ]
train
https://github.com/qiniu/java-sdk/blob/6c05f3fb718403a496c725b048e9241f80171499/src/main/java/com/qiniu/streaming/StreamingManager.java#L153-L155
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/fastzipfilereader/ZipFileSliceReader.java
ZipFileSliceReader.getLong
static long getLong(final byte[] arr, final long off) throws IOException { """ Get a long from a byte array. @param arr the byte array @param off the offset to start reading from @return the long @throws IOException if an I/O exception occurs. """ final int ioff = (int) off; if (ioff <...
java
static long getLong(final byte[] arr, final long off) throws IOException { final int ioff = (int) off; if (ioff < 0 || ioff > arr.length - 8) { throw new IndexOutOfBoundsException(); } return ((arr[ioff + 7] & 0xffL) << 56) // | ((arr[ioff + 6] & 0xffL) << 48)...
[ "static", "long", "getLong", "(", "final", "byte", "[", "]", "arr", ",", "final", "long", "off", ")", "throws", "IOException", "{", "final", "int", "ioff", "=", "(", "int", ")", "off", ";", "if", "(", "ioff", "<", "0", "||", "ioff", ">", "arr", "...
Get a long from a byte array. @param arr the byte array @param off the offset to start reading from @return the long @throws IOException if an I/O exception occurs.
[ "Get", "a", "long", "from", "a", "byte", "array", "." ]
train
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/fastzipfilereader/ZipFileSliceReader.java#L240-L253
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseBoundaryTimerEventDefinition
public void parseBoundaryTimerEventDefinition(Element timerEventDefinition, boolean interrupting, ActivityImpl boundaryActivity) { """ Parses a boundary timer event. The end-result will be that the given nested activity will get the appropriate {@link ActivityBehavior}. @param timerEventDefinition The XML ele...
java
public void parseBoundaryTimerEventDefinition(Element timerEventDefinition, boolean interrupting, ActivityImpl boundaryActivity) { boundaryActivity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.BOUNDARY_TIMER); TimerDeclarationImpl timerDeclaration = parseTimer(timerEventDefinition, boundaryActivity, T...
[ "public", "void", "parseBoundaryTimerEventDefinition", "(", "Element", "timerEventDefinition", ",", "boolean", "interrupting", ",", "ActivityImpl", "boundaryActivity", ")", "{", "boundaryActivity", ".", "getProperties", "(", ")", ".", "set", "(", "BpmnProperties", ".", ...
Parses a boundary timer event. The end-result will be that the given nested activity will get the appropriate {@link ActivityBehavior}. @param timerEventDefinition The XML element corresponding with the timer event details @param interrupting Indicates whether this timer is interrupting. @param boundaryActivity The ac...
[ "Parses", "a", "boundary", "timer", "event", ".", "The", "end", "-", "result", "will", "be", "that", "the", "given", "nested", "activity", "will", "get", "the", "appropriate", "{", "@link", "ActivityBehavior", "}", "." ]
train
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L3106-L3125
hudson3-plugins/warnings-plugin
src/main/java/hudson/plugins/warnings/parser/DoxygenParser.java
DoxygenParser.parsePriority
private Priority parsePriority(final String warningTypeString) { """ Returns the priority ordinal matching the specified warning type string. @param warningTypeString a string containing the warning type returned by a regular expression group matching it in the warnings output. @return the priority """ ...
java
private Priority parsePriority(final String warningTypeString) { if (StringUtils.equalsIgnoreCase(warningTypeString, "notice")) { return Priority.LOW; } else if (StringUtils.equalsIgnoreCase(warningTypeString, "warning")) { return Priority.NORMAL; } else i...
[ "private", "Priority", "parsePriority", "(", "final", "String", "warningTypeString", ")", "{", "if", "(", "StringUtils", ".", "equalsIgnoreCase", "(", "warningTypeString", ",", "\"notice\"", ")", ")", "{", "return", "Priority", ".", "LOW", ";", "}", "else", "i...
Returns the priority ordinal matching the specified warning type string. @param warningTypeString a string containing the warning type returned by a regular expression group matching it in the warnings output. @return the priority
[ "Returns", "the", "priority", "ordinal", "matching", "the", "specified", "warning", "type", "string", "." ]
train
https://github.com/hudson3-plugins/warnings-plugin/blob/462c9f3dffede9120173935567392b22520b0966/src/main/java/hudson/plugins/warnings/parser/DoxygenParser.java#L134-L148
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer/src/com/ibm/ws/ejbcontainer/osgi/internal/NameSpaceBinderImpl.java
NameSpaceBinderImpl.bindJavaApp
@Override public void bindJavaApp(String name, EJBBinding bindingObject) { """ Adds the EJB application binding to the java:app name space. @param name The lookup name. @param bindingObject The EJB binding information. """ String bindingName = buildJavaAppName(name); ejbJavaColonHelper....
java
@Override public void bindJavaApp(String name, EJBBinding bindingObject) { String bindingName = buildJavaAppName(name); ejbJavaColonHelper.addAppBinding(moduleMetaData, bindingName, bindingObject); }
[ "@", "Override", "public", "void", "bindJavaApp", "(", "String", "name", ",", "EJBBinding", "bindingObject", ")", "{", "String", "bindingName", "=", "buildJavaAppName", "(", "name", ")", ";", "ejbJavaColonHelper", ".", "addAppBinding", "(", "moduleMetaData", ",", ...
Adds the EJB application binding to the java:app name space. @param name The lookup name. @param bindingObject The EJB binding information.
[ "Adds", "the", "EJB", "application", "binding", "to", "the", "java", ":", "app", "name", "space", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer/src/com/ibm/ws/ejbcontainer/osgi/internal/NameSpaceBinderImpl.java#L96-L100
OpenBEL/openbel-framework
org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/AbstractJdbcDAO.java
AbstractJdbcDAO.getPreparedStatement
protected PreparedStatement getPreparedStatement(String sql) throws SQLException { """ Returns a {@link PreparedStatement} for the SQL statement in <tt>sql</tt>. @param sql {@link String}, the sql to prepare which can take certain placeholders:<ul> <il>? - paremeter substitution marker for the {@...
java
protected PreparedStatement getPreparedStatement(String sql) throws SQLException { // Inject the schema name into the SQL String replacedSQL = injectSchema(sql); return getPreparedStatement(replacedSQL, replacedSQL); }
[ "protected", "PreparedStatement", "getPreparedStatement", "(", "String", "sql", ")", "throws", "SQLException", "{", "// Inject the schema name into the SQL", "String", "replacedSQL", "=", "injectSchema", "(", "sql", ")", ";", "return", "getPreparedStatement", "(", "replac...
Returns a {@link PreparedStatement} for the SQL statement in <tt>sql</tt>. @param sql {@link String}, the sql to prepare which can take certain placeholders:<ul> <il>? - paremeter substitution marker for the {@link PreparedStatement}</li> <il>@ - schema name substitution marker defined</li></ul> @return {@link Prepare...
[ "Returns", "a", "{", "@link", "PreparedStatement", "}", "for", "the", "SQL", "statement", "in", "<tt", ">", "sql<", "/", "tt", ">", "." ]
train
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/AbstractJdbcDAO.java#L129-L134
aoindustries/aocode-public
src/main/java/com/aoindustries/io/LoggingProxy.java
LoggingProxy.log
private static void log(File logFile, long connectionId, char separator, String line) { """ Writes one line to the given file, synchronizes on the file object. """ synchronized(logFile) { try { try (Writer out = new FileWriter(logFile, true)) { out.write(Long.toString(connectionId)); out.wri...
java
private static void log(File logFile, long connectionId, char separator, String line) { synchronized(logFile) { try { try (Writer out = new FileWriter(logFile, true)) { out.write(Long.toString(connectionId)); out.write(separator); out.write(' '); out.write(line); out.write('\n'); }...
[ "private", "static", "void", "log", "(", "File", "logFile", ",", "long", "connectionId", ",", "char", "separator", ",", "String", "line", ")", "{", "synchronized", "(", "logFile", ")", "{", "try", "{", "try", "(", "Writer", "out", "=", "new", "FileWriter...
Writes one line to the given file, synchronizes on the file object.
[ "Writes", "one", "line", "to", "the", "given", "file", "synchronizes", "on", "the", "file", "object", "." ]
train
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/LoggingProxy.java#L52-L66
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/subnet/SubnetClient.java
SubnetClient.modifySubnetAttributes
public void modifySubnetAttributes(String subnetId, String name) { """ Modifying the special attribute to new value of the subnet owned by the user. @param subnetId The id of the subnet @param name The name of the subnet after modifying """ ModifySubnetAttributesRequest request = new ModifySubnetAttr...
java
public void modifySubnetAttributes(String subnetId, String name) { ModifySubnetAttributesRequest request = new ModifySubnetAttributesRequest(); modifySubnetAttributes(request.withName(name).withSubnetId(subnetId)); }
[ "public", "void", "modifySubnetAttributes", "(", "String", "subnetId", ",", "String", "name", ")", "{", "ModifySubnetAttributesRequest", "request", "=", "new", "ModifySubnetAttributesRequest", "(", ")", ";", "modifySubnetAttributes", "(", "request", ".", "withName", "...
Modifying the special attribute to new value of the subnet owned by the user. @param subnetId The id of the subnet @param name The name of the subnet after modifying
[ "Modifying", "the", "special", "attribute", "to", "new", "value", "of", "the", "subnet", "owned", "by", "the", "user", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/subnet/SubnetClient.java#L281-L284
CloudSlang/cs-actions
cs-xml/src/main/java/io/cloudslang/content/xml/utils/DocumentUtils.java
DocumentUtils.documentToString
public static String documentToString(Document xmlDocument) throws IOException { """ Returns a String representation for the XML Document. @param xmlDocument the XML Document @return String representation for the XML Document @throws IOException """ String encoding = (xmlDocument.getXmlEncoding() ...
java
public static String documentToString(Document xmlDocument) throws IOException { String encoding = (xmlDocument.getXmlEncoding() == null) ? "UTF-8" : xmlDocument.getXmlEncoding(); OutputFormat format = new OutputFormat(xmlDocument); format.setLineWidth(65); format.setIndenting(true); ...
[ "public", "static", "String", "documentToString", "(", "Document", "xmlDocument", ")", "throws", "IOException", "{", "String", "encoding", "=", "(", "xmlDocument", ".", "getXmlEncoding", "(", ")", "==", "null", ")", "?", "\"UTF-8\"", ":", "xmlDocument", ".", "...
Returns a String representation for the XML Document. @param xmlDocument the XML Document @return String representation for the XML Document @throws IOException
[ "Returns", "a", "String", "representation", "for", "the", "XML", "Document", "." ]
train
https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-xml/src/main/java/io/cloudslang/content/xml/utils/DocumentUtils.java#L38-L50
xmlunit/xmlunit
xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java
DefaultComparisonFormatter.appendText
protected void appendText(StringBuilder sb, Text aNode) { """ Formats a text or CDATA node for {@link #getShortString}. @param sb the builder to append to @param aNode the text or CDATA node @since XMLUnit 2.4.0 """ sb.append("<") .append(aNode.getParentNode().getNodeName()) ...
java
protected void appendText(StringBuilder sb, Text aNode) { sb.append("<") .append(aNode.getParentNode().getNodeName()) .append(" ...>"); if (aNode instanceof CDATASection) { sb.append("<![CDATA[") .append(aNode.getNodeValue()) .append("...
[ "protected", "void", "appendText", "(", "StringBuilder", "sb", ",", "Text", "aNode", ")", "{", "sb", ".", "append", "(", "\"<\"", ")", ".", "append", "(", "aNode", ".", "getParentNode", "(", ")", ".", "getNodeName", "(", ")", ")", ".", "append", "(", ...
Formats a text or CDATA node for {@link #getShortString}. @param sb the builder to append to @param aNode the text or CDATA node @since XMLUnit 2.4.0
[ "Formats", "a", "text", "or", "CDATA", "node", "for", "{", "@link", "#getShortString", "}", "." ]
train
https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java#L277-L293
vst/commons-math-extensions
src/main/java/com/vsthost/rnd/commons/math/ext/linear/EMatrixUtils.java
EMatrixUtils.getColumRange
public static RealMatrix getColumRange (RealMatrix matrix, int start, int end) { """ Returns the column range from the matrix as a new matrix. @param matrix The input matrix @param start The index of the column to start with (inclusive) @param end The index of the column to end with (inclusive) @return A new...
java
public static RealMatrix getColumRange (RealMatrix matrix, int start, int end) { return matrix.getSubMatrix(0, matrix.getRowDimension() - 1, start, end); }
[ "public", "static", "RealMatrix", "getColumRange", "(", "RealMatrix", "matrix", ",", "int", "start", ",", "int", "end", ")", "{", "return", "matrix", ".", "getSubMatrix", "(", "0", ",", "matrix", ".", "getRowDimension", "(", ")", "-", "1", ",", "start", ...
Returns the column range from the matrix as a new matrix. @param matrix The input matrix @param start The index of the column to start with (inclusive) @param end The index of the column to end with (inclusive) @return A new matrix with columns specified
[ "Returns", "the", "column", "range", "from", "the", "matrix", "as", "a", "new", "matrix", "." ]
train
https://github.com/vst/commons-math-extensions/blob/a11ee78ffe53ab7c016062be93c5af07aa8e1823/src/main/java/com/vsthost/rnd/commons/math/ext/linear/EMatrixUtils.java#L42-L44
JoeKerouac/utils
src/main/java/com/joe/utils/reflect/ReflectUtil.java
ReflectUtil.getFieldValue
public static <T extends Object> T getFieldValue(Object obj, String fieldName) { """ 获取指定对象中指定字段名对应的字段的值 @param obj 对象,如果要获取的字段是静态字段那么需要传入Class @param fieldName 字段名 @param <T> 字段类型 @return 指定对象中指定字段名对应字段的值 """ Assert.notNull(obj, "obj不能为空"); Assert.notNull(fieldName, "fieldNam...
java
public static <T extends Object> T getFieldValue(Object obj, String fieldName) { Assert.notNull(obj, "obj不能为空"); Assert.notNull(fieldName, "fieldName不能为空"); Field field; if (obj instanceof Class) { field = getField((Class) obj, fieldName); } else { field ...
[ "public", "static", "<", "T", "extends", "Object", ">", "T", "getFieldValue", "(", "Object", "obj", ",", "String", "fieldName", ")", "{", "Assert", ".", "notNull", "(", "obj", ",", "\"obj不能为空\");", "", "", "Assert", ".", "notNull", "(", "fieldName", ",",...
获取指定对象中指定字段名对应的字段的值 @param obj 对象,如果要获取的字段是静态字段那么需要传入Class @param fieldName 字段名 @param <T> 字段类型 @return 指定对象中指定字段名对应字段的值
[ "获取指定对象中指定字段名对应的字段的值" ]
train
https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/reflect/ReflectUtil.java#L302-L314
Bandwidth/java-bandwidth
src/main/java/com/bandwidth/sdk/model/Bridge.java
Bridge.get
public static Bridge get(final BandwidthClient client, final String id) throws Exception { """ Convenience method to return a bridge object given a client and an id @param client the client @param id the call id @return the Bridge @throws IOException unexpected error. """ assert(client != null); ...
java
public static Bridge get(final BandwidthClient client, final String id) throws Exception { assert(client != null); final String bridgesUri = client.getUserResourceInstanceUri(BandwidthConstants.BRIDGES_URI_PATH, id); final JSONObject jsonObject = toJSONObject(client.get(bridgesUri, null)); ...
[ "public", "static", "Bridge", "get", "(", "final", "BandwidthClient", "client", ",", "final", "String", "id", ")", "throws", "Exception", "{", "assert", "(", "client", "!=", "null", ")", ";", "final", "String", "bridgesUri", "=", "client", ".", "getUserResou...
Convenience method to return a bridge object given a client and an id @param client the client @param id the call id @return the Bridge @throws IOException unexpected error.
[ "Convenience", "method", "to", "return", "a", "bridge", "object", "given", "a", "client", "and", "an", "id" ]
train
https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Bridge.java#L44-L50
UrielCh/ovh-java-sdk
ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java
ApiOvhOrder.vps_serviceName_ip_duration_POST
public OvhOrder vps_serviceName_ip_duration_POST(String serviceName, String duration, OvhGeolocationEnum country, Long number) throws IOException { """ Create order REST: POST /order/vps/{serviceName}/ip/{duration} @param number [required] Number of IPs to order @param country [required] Choose a geolocation ...
java
public OvhOrder vps_serviceName_ip_duration_POST(String serviceName, String duration, OvhGeolocationEnum country, Long number) throws IOException { String qPath = "/order/vps/{serviceName}/ip/{duration}"; StringBuilder sb = path(qPath, serviceName, duration); HashMap<String, Object>o = new HashMap<String, Object>...
[ "public", "OvhOrder", "vps_serviceName_ip_duration_POST", "(", "String", "serviceName", ",", "String", "duration", ",", "OvhGeolocationEnum", "country", ",", "Long", "number", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/order/vps/{serviceName}/ip/{durat...
Create order REST: POST /order/vps/{serviceName}/ip/{duration} @param number [required] Number of IPs to order @param country [required] Choose a geolocation for your IP Address @param serviceName [required] The internal name of your VPS offer @param duration [required] Duration
[ "Create", "order" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L3436-L3444
bazaarvoice/emodb
web/src/main/java/com/bazaarvoice/emodb/web/ddl/CassandraThriftFacade.java
CassandraThriftFacade.forSeedsAndPort
public static CassandraThriftFacade forSeedsAndPort(String seeds, int defaultPort) { """ Note: <code>seeds</code> may be a single host or comma-delimited list. """ final String seed = seeds.contains(",") ? seeds.substring(0, seeds.indexOf(',')) : seeds; HostAndPort host = HostAndPort.fromString...
java
public static CassandraThriftFacade forSeedsAndPort(String seeds, int defaultPort) { final String seed = seeds.contains(",") ? seeds.substring(0, seeds.indexOf(',')) : seeds; HostAndPort host = HostAndPort.fromString(seed).withDefaultPort(defaultPort); return new CassandraThriftFacade(new TFrame...
[ "public", "static", "CassandraThriftFacade", "forSeedsAndPort", "(", "String", "seeds", ",", "int", "defaultPort", ")", "{", "final", "String", "seed", "=", "seeds", ".", "contains", "(", "\",\"", ")", "?", "seeds", ".", "substring", "(", "0", ",", "seeds", ...
Note: <code>seeds</code> may be a single host or comma-delimited list.
[ "Note", ":", "<code", ">", "seeds<", "/", "code", ">", "may", "be", "a", "single", "host", "or", "comma", "-", "delimited", "list", "." ]
train
https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/ddl/CassandraThriftFacade.java#L24-L28
hypfvieh/java-utils
src/main/java/com/github/hypfvieh/util/FileIoUtil.java
FileIoUtil.writeTextFile
public static boolean writeTextFile(String _fileName, String _fileContent, boolean _append) { """ Write String to file with the java default charset (usually UTF-8). Optionally appends the data to the file. @param _fileName the file to write @param _fileContent the content to write @param _append append cont...
java
public static boolean writeTextFile(String _fileName, String _fileContent, boolean _append) { return writeTextFile(_fileName, _fileContent, Charset.defaultCharset(), _append); }
[ "public", "static", "boolean", "writeTextFile", "(", "String", "_fileName", ",", "String", "_fileContent", ",", "boolean", "_append", ")", "{", "return", "writeTextFile", "(", "_fileName", ",", "_fileContent", ",", "Charset", ".", "defaultCharset", "(", ")", ","...
Write String to file with the java default charset (usually UTF-8). Optionally appends the data to the file. @param _fileName the file to write @param _fileContent the content to write @param _append append content to file, if false file will be overwritten if existing @return true on successful write, false otherwis...
[ "Write", "String", "to", "file", "with", "the", "java", "default", "charset", "(", "usually", "UTF", "-", "8", ")", ".", "Optionally", "appends", "the", "data", "to", "the", "file", "." ]
train
https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L463-L465
joniles/mpxj
src/main/java/net/sf/mpxj/mpx/LocaleData.java
LocaleData.getChar
public static final char getChar(Locale locale, String key) { """ Convenience method for retrieving a char resource. @param locale locale identifier @param key resource key @return resource value """ ResourceBundle bundle = ResourceBundle.getBundle(LocaleData.class.getName(), locale); return (...
java
public static final char getChar(Locale locale, String key) { ResourceBundle bundle = ResourceBundle.getBundle(LocaleData.class.getName(), locale); return (bundle.getString(key).charAt(0)); }
[ "public", "static", "final", "char", "getChar", "(", "Locale", "locale", ",", "String", "key", ")", "{", "ResourceBundle", "bundle", "=", "ResourceBundle", ".", "getBundle", "(", "LocaleData", ".", "class", ".", "getName", "(", ")", ",", "locale", ")", ";"...
Convenience method for retrieving a char resource. @param locale locale identifier @param key resource key @return resource value
[ "Convenience", "method", "for", "retrieving", "a", "char", "resource", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/LocaleData.java#L138-L142
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ManagedBeanHome.java
ManagedBeanHome.createLocalBusinessObject
@Override public Object createLocalBusinessObject(int interfaceIndex, ManagedObjectContext context) throws RemoteException, CreateException { """ Method to create a local business reference object. Override EJSHome to ensure to handle managed beans properly. Use the cre...
java
@Override public Object createLocalBusinessObject(int interfaceIndex, ManagedObjectContext context) throws RemoteException, CreateException { return createBusinessObject(null, false); }
[ "@", "Override", "public", "Object", "createLocalBusinessObject", "(", "int", "interfaceIndex", ",", "ManagedObjectContext", "context", ")", "throws", "RemoteException", ",", "CreateException", "{", "return", "createBusinessObject", "(", "null", ",", "false", ")", ";"...
Method to create a local business reference object. Override EJSHome to ensure to handle managed beans properly. Use the createBusinessObject method specific to managed beans.
[ "Method", "to", "create", "a", "local", "business", "reference", "object", ".", "Override", "EJSHome", "to", "ensure", "to", "handle", "managed", "beans", "properly", ".", "Use", "the", "createBusinessObject", "method", "specific", "to", "managed", "beans", "." ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ManagedBeanHome.java#L275-L281
jbundle/jbundle
thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/SyncRemoteTable.java
SyncRemoteTable.doMove
public Object doMove(int iRelPosition, int iRecordCount) throws DBException, RemoteException { """ Move the current position and read the record (optionally read several records). @param iRelPosition relative Position to read the next record. @param iRecordCount Records to read. @return If I read 1 record, this...
java
public Object doMove(int iRelPosition, int iRecordCount) throws DBException, RemoteException { synchronized(m_objSync) { return m_tableRemote.doMove(iRelPosition, iRecordCount); } }
[ "public", "Object", "doMove", "(", "int", "iRelPosition", ",", "int", "iRecordCount", ")", "throws", "DBException", ",", "RemoteException", "{", "synchronized", "(", "m_objSync", ")", "{", "return", "m_tableRemote", ".", "doMove", "(", "iRelPosition", ",", "iRec...
Move the current position and read the record (optionally read several records). @param iRelPosition relative Position to read the next record. @param iRecordCount Records to read. @return If I read 1 record, this is the record's data. @return If I read several records, this is a vector of the returned records. @return...
[ "Move", "the", "current", "position", "and", "read", "the", "record", "(", "optionally", "read", "several", "records", ")", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/SyncRemoteTable.java#L164-L170
ontop/ontop
mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/parser/impl/RAExpression.java
RAExpression.getJoinOnFilter
private static ImmutableList<Function> getJoinOnFilter(RAExpressionAttributes re1, RAExpressionAttributes re2, ImmutableSet<QuotedID> using, Te...
java
private static ImmutableList<Function> getJoinOnFilter(RAExpressionAttributes re1, RAExpressionAttributes re2, ImmutableSet<QuotedID> using, Te...
[ "private", "static", "ImmutableList", "<", "Function", ">", "getJoinOnFilter", "(", "RAExpressionAttributes", "re1", ",", "RAExpressionAttributes", "re2", ",", "ImmutableSet", "<", "QuotedID", ">", "using", ",", "TermFactory", "termFactory", ")", "{", "return", "usi...
internal implementation of JOIN USING and NATURAL JOIN @param re1 a {@link RAExpressionAttributes} @param re2 a {@link RAExpressionAttributes} @param using a {@link ImmutableSet}<{@link QuotedID}> @return a {@Link ImmutableList}<{@link Function}>
[ "internal", "implementation", "of", "JOIN", "USING", "and", "NATURAL", "JOIN" ]
train
https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/parser/impl/RAExpression.java#L150-L168
alkacon/opencms-core
src/org/opencms/loader/CmsJspLoader.java
CmsJspLoader.getReferencingStrongLinks
public void getReferencingStrongLinks(CmsObject cms, CmsResource resource, Set<String> referencingPaths) throws CmsException { """ Returns a set of root paths of files that are including the given resource using the 'link.strong' macro.<p> @param cms the current cms context @param resource the resource to ...
java
public void getReferencingStrongLinks(CmsObject cms, CmsResource resource, Set<String> referencingPaths) throws CmsException { CmsRelationFilter filter = CmsRelationFilter.SOURCES.filterType(CmsRelationType.JSP_STRONG); Iterator<CmsRelation> it = cms.getRelationsForResource(resource, filter).iterat...
[ "public", "void", "getReferencingStrongLinks", "(", "CmsObject", "cms", ",", "CmsResource", "resource", ",", "Set", "<", "String", ">", "referencingPaths", ")", "throws", "CmsException", "{", "CmsRelationFilter", "filter", "=", "CmsRelationFilter", ".", "SOURCES", "...
Returns a set of root paths of files that are including the given resource using the 'link.strong' macro.<p> @param cms the current cms context @param resource the resource to check @param referencingPaths the set of already referencing paths, also return parameter @throws CmsException if something goes wrong
[ "Returns", "a", "set", "of", "root", "paths", "of", "files", "that", "are", "including", "the", "given", "resource", "using", "the", "link", ".", "strong", "macro", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsJspLoader.java#L368-L390
googleapis/google-cloud-java
google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/ProfileServiceClient.java
ProfileServiceClient.createProfile
public final Profile createProfile(String parent, Profile profile) { """ Creates and returns a new profile. <p>Sample code: <pre><code> try (ProfileServiceClient profileServiceClient = ProfileServiceClient.create()) { TenantName parent = TenantName.of("[PROJECT]", "[TENANT]"); Profile profile = Profile.ne...
java
public final Profile createProfile(String parent, Profile profile) { CreateProfileRequest request = CreateProfileRequest.newBuilder().setParent(parent).setProfile(profile).build(); return createProfile(request); }
[ "public", "final", "Profile", "createProfile", "(", "String", "parent", ",", "Profile", "profile", ")", "{", "CreateProfileRequest", "request", "=", "CreateProfileRequest", ".", "newBuilder", "(", ")", ".", "setParent", "(", "parent", ")", ".", "setProfile", "("...
Creates and returns a new profile. <p>Sample code: <pre><code> try (ProfileServiceClient profileServiceClient = ProfileServiceClient.create()) { TenantName parent = TenantName.of("[PROJECT]", "[TENANT]"); Profile profile = Profile.newBuilder().build(); Profile response = profileServiceClient.createProfile(parent.toSt...
[ "Creates", "and", "returns", "a", "new", "profile", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/ProfileServiceClient.java#L349-L354
nmorel/gwt-jackson
gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/JsonDeserializer.java
JsonDeserializer.setBackReference
public void setBackReference( String referenceName, Object reference, T value, JsonDeserializationContext ctx ) { """ Set the back reference. @param referenceName name of the reference @param referenceName name of the reference @param referenceName name of the reference @param referenceName name of the refer...
java
public void setBackReference( String referenceName, Object reference, T value, JsonDeserializationContext ctx ) { throw new JsonDeserializationException( "Cannot set a back reference to the type managed by this deserializer" ); }
[ "public", "void", "setBackReference", "(", "String", "referenceName", ",", "Object", "reference", ",", "T", "value", ",", "JsonDeserializationContext", "ctx", ")", "{", "throw", "new", "JsonDeserializationException", "(", "\"Cannot set a back reference to the type managed b...
Set the back reference. @param referenceName name of the reference @param referenceName name of the reference @param referenceName name of the reference @param referenceName name of the reference @param referenceName name of the reference @param referenceName name of the reference @param reference reference to set @pa...
[ "Set", "the", "back", "reference", "." ]
train
https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/JsonDeserializer.java#L97-L99
VoltDB/voltdb
src/frontend/org/voltdb/PlannerStatsCollector.java
PlannerStatsCollector.populateColumnSchema
@Override protected void populateColumnSchema(ArrayList<VoltTable.ColumnInfo> columns) { """ Specifies the columns of statistics that are added by this class to the schema of a statistical results. @param columns List of columns that are in a stats row. """ super.populateColumnSchema(columns); ...
java
@Override protected void populateColumnSchema(ArrayList<VoltTable.ColumnInfo> columns) { super.populateColumnSchema(columns); columns.add(new ColumnInfo(VoltSystemProcedure.CNAME_SITE_ID, VoltSystemProcedure.CTYPE_ID)); columns.add(new ColumnInfo("PARTITION_ID", VoltType.INTEGER)); ...
[ "@", "Override", "protected", "void", "populateColumnSchema", "(", "ArrayList", "<", "VoltTable", ".", "ColumnInfo", ">", "columns", ")", "{", "super", ".", "populateColumnSchema", "(", "columns", ")", ";", "columns", ".", "add", "(", "new", "ColumnInfo", "(",...
Specifies the columns of statistics that are added by this class to the schema of a statistical results. @param columns List of columns that are in a stats row.
[ "Specifies", "the", "columns", "of", "statistics", "that", "are", "added", "by", "this", "class", "to", "the", "schema", "of", "a", "statistical", "results", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/PlannerStatsCollector.java#L311-L325
cdk/cdk
descriptor/fingerprint/src/main/java/org/openscience/cdk/fingerprint/MACCSFingerprinter.java
MACCSFingerprinter.createPattern
private Pattern createPattern(String smarts, IChemObjectBuilder builder) throws IOException { """ Create a pattern for the provided SMARTS - if the SMARTS is '?' a pattern is not created. @param smarts a smarts pattern @param builder chem object builder @return the pattern to match """ SmartsPat...
java
private Pattern createPattern(String smarts, IChemObjectBuilder builder) throws IOException { SmartsPattern ptrn = SmartsPattern.create(smarts, builder); ptrn.setPrepare(false); // avoid redoing aromaticity etc return ptrn; }
[ "private", "Pattern", "createPattern", "(", "String", "smarts", ",", "IChemObjectBuilder", "builder", ")", "throws", "IOException", "{", "SmartsPattern", "ptrn", "=", "SmartsPattern", ".", "create", "(", "smarts", ",", "builder", ")", ";", "ptrn", ".", "setPrepa...
Create a pattern for the provided SMARTS - if the SMARTS is '?' a pattern is not created. @param smarts a smarts pattern @param builder chem object builder @return the pattern to match
[ "Create", "a", "pattern", "for", "the", "provided", "SMARTS", "-", "if", "the", "SMARTS", "is", "?", "a", "pattern", "is", "not", "created", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/fingerprint/src/main/java/org/openscience/cdk/fingerprint/MACCSFingerprinter.java#L315-L319
docusign/docusign-java-client
src/main/java/com/docusign/esign/api/PowerFormsApi.java
PowerFormsApi.listPowerForms
public PowerFormsResponse listPowerForms(String accountId, PowerFormsApi.ListPowerFormsOptions options) throws ApiException { """ Returns the list of PowerForms available to the user. @param accountId The external account number (int) or account ID Guid. (required) @param options for modifying the method behav...
java
public PowerFormsResponse listPowerForms(String accountId, PowerFormsApi.ListPowerFormsOptions options) throws ApiException { Object localVarPostBody = "{}"; // verify the required parameter 'accountId' is set if (accountId == null) { throw new ApiException(400, "Missing the required paramete...
[ "public", "PowerFormsResponse", "listPowerForms", "(", "String", "accountId", ",", "PowerFormsApi", ".", "ListPowerFormsOptions", "options", ")", "throws", "ApiException", "{", "Object", "localVarPostBody", "=", "\"{}\"", ";", "// verify the required parameter 'accountId' is ...
Returns the list of PowerForms available to the user. @param accountId The external account number (int) or account ID Guid. (required) @param options for modifying the method behavior. @return PowerFormsResponse @throws ApiException if fails to make API call
[ "Returns", "the", "list", "of", "PowerForms", "available", "to", "the", "user", "." ]
train
https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/PowerFormsApi.java#L473-L512
OpenLiberty/open-liberty
dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/AbstractRepositoryClient.java
AbstractRepositoryClient.getAssets
@Override public Collection<Asset> getAssets(final Collection<ResourceType> types, final Collection<String> productIds, final Visibility visibility, final Collection<String> productVersions) throws IOException, RequestFailureException { """ This method will return all of ...
java
@Override public Collection<Asset> getAssets(final Collection<ResourceType> types, final Collection<String> productIds, final Visibility visibility, final Collection<String> productVersions) throws IOException, RequestFailureException { return getFilteredAssets(types, ...
[ "@", "Override", "public", "Collection", "<", "Asset", ">", "getAssets", "(", "final", "Collection", "<", "ResourceType", ">", "types", ",", "final", "Collection", "<", "String", ">", "productIds", ",", "final", "Visibility", "visibility", ",", "final", "Colle...
This method will return all of the assets matching specific filters in Massive. It will just return a summary of each asset and not include any {@link Attachment}s. @param types The types to look for or <code>null</code> will return all types @param productIds The product IDs to look for. Should not be <code>null</cod...
[ "This", "method", "will", "return", "all", "of", "the", "assets", "matching", "specific", "filters", "in", "Massive", ".", "It", "will", "just", "return", "a", "summary", "of", "each", "asset", "and", "not", "include", "any", "{", "@link", "Attachment", "}...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/AbstractRepositoryClient.java#L49-L53
infinispan/infinispan
core/src/main/java/org/infinispan/cache/impl/AbstractDelegatingCache.java
AbstractDelegatingCache.unwrapCache
public static <K, V> Cache<K, V> unwrapCache(Cache<K, V> cache) { """ Fully unwraps a given cache returning the base cache. Will unwrap all <b>AbstractDelegatingCache</b> wrappers. @param cache @param <K> @param <V> @return """ if (cache instanceof AbstractDelegatingCache) { return unwrapCa...
java
public static <K, V> Cache<K, V> unwrapCache(Cache<K, V> cache) { if (cache instanceof AbstractDelegatingCache) { return unwrapCache(((AbstractDelegatingCache<K, V>) cache).getDelegate()); } return cache; }
[ "public", "static", "<", "K", ",", "V", ">", "Cache", "<", "K", ",", "V", ">", "unwrapCache", "(", "Cache", "<", "K", ",", "V", ">", "cache", ")", "{", "if", "(", "cache", "instanceof", "AbstractDelegatingCache", ")", "{", "return", "unwrapCache", "(...
Fully unwraps a given cache returning the base cache. Will unwrap all <b>AbstractDelegatingCache</b> wrappers. @param cache @param <K> @param <V> @return
[ "Fully", "unwraps", "a", "given", "cache", "returning", "the", "base", "cache", ".", "Will", "unwrap", "all", "<b", ">", "AbstractDelegatingCache<", "/", "b", ">", "wrappers", "." ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/cache/impl/AbstractDelegatingCache.java#L634-L639
liyiorg/weixin-popular
src/main/java/weixin/popular/api/WxaAPI.java
WxaAPI.img_sec_check
public static BaseResult img_sec_check(String access_token,InputStream media) { """ <strong>图片检查</strong><br> 校验一张图片是否含有违法违规内容。<br> 应用场景举例:<br> 1)图片智能鉴黄:涉及拍照的工具类应用(如美拍,识图类应用)用户拍照上传检测;电商类商品上架图片检测;媒体类用户文章里的图片检测等;<br> 2)敏感人脸识别:用户头像;媒体类用户文章里的图片检测;社交类用户上传的图片检测等<br> <br> 频率限制:单个 appId 调用上限为 1000 次/分钟,100,000 次/天 ...
java
public static BaseResult img_sec_check(String access_token,InputStream media){ HttpPost httpPost = new HttpPost(BASE_URI + "/wxa/img_sec_check"); byte[] data = null; try { data = StreamUtils.copyToByteArray(media); } catch (IOException e) { logger.error("", e); } HttpEntity reqEntity = Multipa...
[ "public", "static", "BaseResult", "img_sec_check", "(", "String", "access_token", ",", "InputStream", "media", ")", "{", "HttpPost", "httpPost", "=", "new", "HttpPost", "(", "BASE_URI", "+", "\"/wxa/img_sec_check\"", ")", ";", "byte", "[", "]", "data", "=", "n...
<strong>图片检查</strong><br> 校验一张图片是否含有违法违规内容。<br> 应用场景举例:<br> 1)图片智能鉴黄:涉及拍照的工具类应用(如美拍,识图类应用)用户拍照上传检测;电商类商品上架图片检测;媒体类用户文章里的图片检测等;<br> 2)敏感人脸识别:用户头像;媒体类用户文章里的图片检测;社交类用户上传的图片检测等<br> <br> 频率限制:单个 appId 调用上限为 1000 次/分钟,100,000 次/天 @since 2.8.20 @param access_token access_token @param media 要检测的图片文件,格式支持PNG、JPEG、JPG、GIF,图片尺寸不超...
[ "<strong", ">", "图片检查<", "/", "strong", ">", "<br", ">", "校验一张图片是否含有违法违规内容。<br", ">", "应用场景举例:<br", ">", "1)图片智能鉴黄:涉及拍照的工具类应用", "(", "如美拍,识图类应用", ")", "用户拍照上传检测;电商类商品上架图片检测;媒体类用户文章里的图片检测等;<br", ">", "2)敏感人脸识别:用户头像;媒体类用户文章里的图片检测;社交类用户上传的图片检测等<br", ">", "<br", ">", "频率限制:单个...
train
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/WxaAPI.java#L565-L579
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java
TreeScanner.visitSwitch
@Override public R visitSwitch(SwitchTree node, P p) { """ {@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning """ R r = scan(node.getExpression(), p); r = scanAndReduce(node.getC...
java
@Override public R visitSwitch(SwitchTree node, P p) { R r = scan(node.getExpression(), p); r = scanAndReduce(node.getCases(), p, r); return r; }
[ "@", "Override", "public", "R", "visitSwitch", "(", "SwitchTree", "node", ",", "P", "p", ")", "{", "R", "r", "=", "scan", "(", "node", ".", "getExpression", "(", ")", ",", "p", ")", ";", "r", "=", "scanAndReduce", "(", "node", ".", "getCases", "(",...
{@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning
[ "{", "@inheritDoc", "}", "This", "implementation", "scans", "the", "children", "in", "left", "to", "right", "order", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java#L329-L334
Stratio/deep-spark
deep-cassandra/src/main/java/com/stratio/deep/cassandra/thrift/ThriftClient.java
ThriftClient.build
public static ThriftClient build(String host, int port, String keyspace) throws TException { """ Returns a new client for the specified host, setting the specified keyspace. @param host the Cassandra host address. @param port the Cassandra host RPC port. @param keyspace the name of the Cassandra keysp...
java
public static ThriftClient build(String host, int port, String keyspace) throws TException { TTransport transport = new TFramedTransport(new TSocket(host, port)); TProtocol protocol = new TBinaryProtocol(transport); ThriftClient client = new ThriftClient(protocol); transport.open(); ...
[ "public", "static", "ThriftClient", "build", "(", "String", "host", ",", "int", "port", ",", "String", "keyspace", ")", "throws", "TException", "{", "TTransport", "transport", "=", "new", "TFramedTransport", "(", "new", "TSocket", "(", "host", ",", "port", "...
Returns a new client for the specified host, setting the specified keyspace. @param host the Cassandra host address. @param port the Cassandra host RPC port. @param keyspace the name of the Cassandra keyspace to set. @return a new client for the specified host, setting the specified keyspace. @throws TExceptio...
[ "Returns", "a", "new", "client", "for", "the", "specified", "host", "setting", "the", "specified", "keyspace", "." ]
train
https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/thrift/ThriftClient.java#L53-L62
mgm-tp/jfunk
jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java
WebDriverTool.waitFor
public <V> V waitFor(final Function<? super WebDriver, V> function) { """ Repeatedly applies the current {@link WebDriver} instance to the specified function until one of the following occurs: <ol> <li>the function returns neither null nor false,</li> <li>the function throws an unignored exception,</li> <li>t...
java
public <V> V waitFor(final Function<? super WebDriver, V> function) { return newWebDriverWait().until(function); }
[ "public", "<", "V", ">", "V", "waitFor", "(", "final", "Function", "<", "?", "super", "WebDriver", ",", "V", ">", "function", ")", "{", "return", "newWebDriverWait", "(", ")", ".", "until", "(", "function", ")", ";", "}" ]
Repeatedly applies the current {@link WebDriver} instance to the specified function until one of the following occurs: <ol> <li>the function returns neither null nor false,</li> <li>the function throws an unignored exception,</li> <li>the timeout expires, <li>the current thread is interrupted</li> </ol> @param functio...
[ "Repeatedly", "applies", "the", "current", "{", "@link", "WebDriver", "}", "instance", "to", "the", "specified", "function", "until", "one", "of", "the", "following", "occurs", ":", "<ol", ">", "<li", ">", "the", "function", "returns", "neither", "null", "no...
train
https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java#L281-L283
RKumsher/utils
src/main/java/com/github/rkumsher/date/RandomDateUtils.java
RandomDateUtils.randomAfter
public static long randomAfter(TemporalField field, long after) { """ Returns a random valid value for the given {@link TemporalField} between <code> after</code> and <code>TemporalField.range().max()</code>. For example, <code> randomAfter({@link ChronoField#HOUR_OF_DAY}, 12)</code> will return a random value b...
java
public static long randomAfter(TemporalField field, long after) { Long min = field.range().getMinimum(); Long max = field.range().getMaximum(); checkArgument(after < max, "After must be before %s", max); checkArgument(after >= min, "After must be on or after %s", min); return randomLong(after + 1, M...
[ "public", "static", "long", "randomAfter", "(", "TemporalField", "field", ",", "long", "after", ")", "{", "Long", "min", "=", "field", ".", "range", "(", ")", ".", "getMinimum", "(", ")", ";", "Long", "max", "=", "field", ".", "range", "(", ")", ".",...
Returns a random valid value for the given {@link TemporalField} between <code> after</code> and <code>TemporalField.range().max()</code>. For example, <code> randomAfter({@link ChronoField#HOUR_OF_DAY}, 12)</code> will return a random value between 13-23. <p>Note: This will never return {@link Long#MAX_VALUE}. Even i...
[ "Returns", "a", "random", "valid", "value", "for", "the", "given", "{", "@link", "TemporalField", "}", "between", "<code", ">", "after<", "/", "code", ">", "and", "<code", ">", "TemporalField", ".", "range", "()", ".", "max", "()", "<", "/", "code", ">...
train
https://github.com/RKumsher/utils/blob/fcdb190569cd0288249bf4b46fd418f8c01d1caf/src/main/java/com/github/rkumsher/date/RandomDateUtils.java#L625-L631
goldmansachs/gs-collections
collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java
StringIterate.tokensToList
public static MutableList<String> tokensToList(String string, String separator) { """ Converts a string of tokens separated by the specified separator to a {@link MutableList}. """ MutableList<String> list = Lists.mutable.empty(); for (StringTokenizer stringTokenizer = new StringTokenizer(strin...
java
public static MutableList<String> tokensToList(String string, String separator) { MutableList<String> list = Lists.mutable.empty(); for (StringTokenizer stringTokenizer = new StringTokenizer(string, separator); stringTokenizer.hasMoreTokens(); ) { String token = stringTokenizer.n...
[ "public", "static", "MutableList", "<", "String", ">", "tokensToList", "(", "String", "string", ",", "String", "separator", ")", "{", "MutableList", "<", "String", ">", "list", "=", "Lists", ".", "mutable", ".", "empty", "(", ")", ";", "for", "(", "Strin...
Converts a string of tokens separated by the specified separator to a {@link MutableList}.
[ "Converts", "a", "string", "of", "tokens", "separated", "by", "the", "specified", "separator", "to", "a", "{" ]
train
https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L152-L161
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/ListAttributeDefinition.java
ListAttributeDefinition.parseAndAddParameterElement
@Deprecated public void parseAndAddParameterElement(final String value, final ModelNode operation, final XMLStreamReader reader) throws XMLStreamException { """ Creates a {@link ModelNode} using the given {@code value} after first validating the node against {@link #getElementValidator() this object's element...
java
@Deprecated public void parseAndAddParameterElement(final String value, final ModelNode operation, final XMLStreamReader reader) throws XMLStreamException { ModelNode paramVal = parse(value, reader); operation.get(getName()).add(paramVal); }
[ "@", "Deprecated", "public", "void", "parseAndAddParameterElement", "(", "final", "String", "value", ",", "final", "ModelNode", "operation", ",", "final", "XMLStreamReader", "reader", ")", "throws", "XMLStreamException", "{", "ModelNode", "paramVal", "=", "parse", "...
Creates a {@link ModelNode} using the given {@code value} after first validating the node against {@link #getElementValidator() this object's element validator}, and then stores it in the given {@code operation} model node as an element in a {@link ModelType#LIST} value in a key/value pair whose key is this attribute's...
[ "Creates", "a", "{", "@link", "ModelNode", "}", "using", "the", "given", "{", "@code", "value", "}", "after", "first", "validating", "the", "node", "against", "{", "@link", "#getElementValidator", "()", "this", "object", "s", "element", "validator", "}", "an...
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/ListAttributeDefinition.java#L115-L119
eobermuhlner/big-math
ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java
BigDecimalMath.acos
public static BigDecimal acos(BigDecimal x, MathContext mathContext) { """ Calculates the arc cosine (inverted cosine) of {@link BigDecimal} x. <p>See: <a href="http://en.wikipedia.org/wiki/Arccosine">Wikipedia: Arccosine</a></p> @param x the {@link BigDecimal} to calculate the arc cosine for @param mathCon...
java
public static BigDecimal acos(BigDecimal x, MathContext mathContext) { checkMathContext(mathContext); if (x.compareTo(ONE) > 0) { throw new ArithmeticException("Illegal acos(x) for x > 1: x = " + x); } if (x.compareTo(MINUS_ONE) < 0) { throw new ArithmeticException("Illegal acos(x) for x < -1: x = " + x);...
[ "public", "static", "BigDecimal", "acos", "(", "BigDecimal", "x", ",", "MathContext", "mathContext", ")", "{", "checkMathContext", "(", "mathContext", ")", ";", "if", "(", "x", ".", "compareTo", "(", "ONE", ")", ">", "0", ")", "{", "throw", "new", "Arith...
Calculates the arc cosine (inverted cosine) of {@link BigDecimal} x. <p>See: <a href="http://en.wikipedia.org/wiki/Arccosine">Wikipedia: Arccosine</a></p> @param x the {@link BigDecimal} to calculate the arc cosine for @param mathContext the {@link MathContext} used for the result @return the calculated arc sine {@li...
[ "Calculates", "the", "arc", "cosine", "(", "inverted", "cosine", ")", "of", "{", "@link", "BigDecimal", "}", "x", "." ]
train
https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java#L1388-L1401
line/centraldogma
server/src/main/java/com/linecorp/centraldogma/server/internal/api/HttpApiUtil.java
HttpApiUtil.newResponse
public static HttpResponse newResponse(RequestContext ctx, HttpStatus status, Throwable cause) { """ Returns a newly created {@link HttpResponse} with the specified {@link HttpStatus} and {@code cause}. """ requireNonNull(ctx, "ctx"); requireNonNull(status, "status"); requireNonNull(cau...
java
public static HttpResponse newResponse(RequestContext ctx, HttpStatus status, Throwable cause) { requireNonNull(ctx, "ctx"); requireNonNull(status, "status"); requireNonNull(cause, "cause"); return newResponse0(ctx, status, cause, null); }
[ "public", "static", "HttpResponse", "newResponse", "(", "RequestContext", "ctx", ",", "HttpStatus", "status", ",", "Throwable", "cause", ")", "{", "requireNonNull", "(", "ctx", ",", "\"ctx\"", ")", ";", "requireNonNull", "(", "status", ",", "\"status\"", ")", ...
Returns a newly created {@link HttpResponse} with the specified {@link HttpStatus} and {@code cause}.
[ "Returns", "a", "newly", "created", "{" ]
train
https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server/src/main/java/com/linecorp/centraldogma/server/internal/api/HttpApiUtil.java#L125-L130
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/layer/cache/FileSystemTileCache.java
FileSystemTileCache.storeData
private void storeData(Job key, TileBitmap bitmap) { """ stores the bitmap data on disk with filename key @param key filename @param bitmap tile image """ OutputStream outputStream = null; try { File file = getOutputFile(key); if (file == null) { /...
java
private void storeData(Job key, TileBitmap bitmap) { OutputStream outputStream = null; try { File file = getOutputFile(key); if (file == null) { // if the file cannot be written, silently return return; } outputStream = new ...
[ "private", "void", "storeData", "(", "Job", "key", ",", "TileBitmap", "bitmap", ")", "{", "OutputStream", "outputStream", "=", "null", ";", "try", "{", "File", "file", "=", "getOutputFile", "(", "key", ")", ";", "if", "(", "file", "==", "null", ")", "{...
stores the bitmap data on disk with filename key @param key filename @param bitmap tile image
[ "stores", "the", "bitmap", "data", "on", "disk", "with", "filename", "key" ]
train
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/cache/FileSystemTileCache.java#L387-L425
greenmail-mail-test/greenmail
greenmail-core/src/main/java/com/icegreen/greenmail/configuration/GreenMailConfiguration.java
GreenMailConfiguration.withUser
public GreenMailConfiguration withUser(final String login, final String password) { """ The given {@link com.icegreen.greenmail.user.GreenMailUser} will be created when servers will start. @param login User id and email address @param password Password of user that belongs to login name @return Modified confi...
java
public GreenMailConfiguration withUser(final String login, final String password) { return withUser(login, login, password); }
[ "public", "GreenMailConfiguration", "withUser", "(", "final", "String", "login", ",", "final", "String", "password", ")", "{", "return", "withUser", "(", "login", ",", "login", ",", "password", ")", ";", "}" ]
The given {@link com.icegreen.greenmail.user.GreenMailUser} will be created when servers will start. @param login User id and email address @param password Password of user that belongs to login name @return Modified configuration
[ "The", "given", "{", "@link", "com", ".", "icegreen", ".", "greenmail", ".", "user", ".", "GreenMailUser", "}", "will", "be", "created", "when", "servers", "will", "start", "." ]
train
https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/configuration/GreenMailConfiguration.java#L20-L22
fcrepo4/fcrepo4
fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACRolesProvider.java
WebACRolesProvider.dereferenceAgentGroups
private List<String> dereferenceAgentGroups(final Collection<String> agentGroups) { """ This maps a Collection of acl:agentGroup values to a List of agents. Any out-of-domain URIs are silently ignored. """ final FedoraSession internalSession = sessionFactory.getInternalSession(); final Identif...
java
private List<String> dereferenceAgentGroups(final Collection<String> agentGroups) { final FedoraSession internalSession = sessionFactory.getInternalSession(); final IdentifierConverter<Resource, FedoraResource> translator = new DefaultIdentifierTranslator(getJcrSession(internalSession));...
[ "private", "List", "<", "String", ">", "dereferenceAgentGroups", "(", "final", "Collection", "<", "String", ">", "agentGroups", ")", "{", "final", "FedoraSession", "internalSession", "=", "sessionFactory", ".", "getInternalSession", "(", ")", ";", "final", "Identi...
This maps a Collection of acl:agentGroup values to a List of agents. Any out-of-domain URIs are silently ignored.
[ "This", "maps", "a", "Collection", "of", "acl", ":", "agentGroup", "values", "to", "a", "List", "of", "agents", ".", "Any", "out", "-", "of", "-", "domain", "URIs", "are", "silently", "ignored", "." ]
train
https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACRolesProvider.java#L224-L253
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/DownsampleTransform.java
DownsampleTransform.downsamplerReducer
public static Double downsamplerReducer(List<Double> values, String reducerType) { """ Implements down sampling. @param values The values to down sample. @param reducerType The type of down sampling to perform. @return The down sampled result. @throws UnsupportedOperationException If an unk...
java
public static Double downsamplerReducer(List<Double> values, String reducerType) { List<Double> operands = new ArrayList<Double>(); for (Double value : values) { if (value == null) { operands.add(0.0); } else { operands.add(value); } } InternalReducerType type = InternalReducerType.fromString...
[ "public", "static", "Double", "downsamplerReducer", "(", "List", "<", "Double", ">", "values", ",", "String", "reducerType", ")", "{", "List", "<", "Double", ">", "operands", "=", "new", "ArrayList", "<", "Double", ">", "(", ")", ";", "for", "(", "Double...
Implements down sampling. @param values The values to down sample. @param reducerType The type of down sampling to perform. @return The down sampled result. @throws UnsupportedOperationException If an unknown down sampling type is specified.
[ "Implements", "down", "sampling", "." ]
train
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/DownsampleTransform.java#L76-L107
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java
XPathParser.parseQuantifiedExpr
private void parseQuantifiedExpr() throws TTXPathException { """ Parses the the rule QuantifiedExpr according to the following production rule: <p> [6] QuantifiedExpr ::= (<"some" "$"> | <"every" "$">) VarName "in" ExprSingle ("," "$" VarName "in" ExprSingle)* "satisfies" ExprSingle . </p> @throws TTXPathE...
java
private void parseQuantifiedExpr() throws TTXPathException { // identify quantifier type final boolean isSome = is("some", true); if (!isSome) { consume("every", true); } // count number of variables int varNo = 0; do { // parse variabl...
[ "private", "void", "parseQuantifiedExpr", "(", ")", "throws", "TTXPathException", "{", "// identify quantifier type", "final", "boolean", "isSome", "=", "is", "(", "\"some\"", ",", "true", ")", ";", "if", "(", "!", "isSome", ")", "{", "consume", "(", "\"every\...
Parses the the rule QuantifiedExpr according to the following production rule: <p> [6] QuantifiedExpr ::= (<"some" "$"> | <"every" "$">) VarName "in" ExprSingle ("," "$" VarName "in" ExprSingle)* "satisfies" ExprSingle . </p> @throws TTXPathException
[ "Parses", "the", "the", "rule", "QuantifiedExpr", "according", "to", "the", "following", "production", "rule", ":", "<p", ">", "[", "6", "]", "QuantifiedExpr", "::", "=", "(", "<", "some", "$", ">", "|", "<", "every", "$", ">", ")", "VarName", "in", ...
train
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java#L249-L280
zxing/zxing
javase/src/main/java/com/google/zxing/client/j2se/MatrixToImageWriter.java
MatrixToImageWriter.writeToPath
public static void writeToPath(BitMatrix matrix, String format, Path file, MatrixToImageConfig config) throws IOException { """ As {@link #writeToPath(BitMatrix, String, Path)}, but allows customization of the output. @param matrix {@link BitMatrix} to write @param format image format @param file file {...
java
public static void writeToPath(BitMatrix matrix, String format, Path file, MatrixToImageConfig config) throws IOException { BufferedImage image = toBufferedImage(matrix, config); if (!ImageIO.write(image, format, file.toFile())) { throw new IOException("Could not write an image of format " + format ...
[ "public", "static", "void", "writeToPath", "(", "BitMatrix", "matrix", ",", "String", "format", ",", "Path", "file", ",", "MatrixToImageConfig", "config", ")", "throws", "IOException", "{", "BufferedImage", "image", "=", "toBufferedImage", "(", "matrix", ",", "c...
As {@link #writeToPath(BitMatrix, String, Path)}, but allows customization of the output. @param matrix {@link BitMatrix} to write @param format image format @param file file {@link Path} to write image to @param config output configuration @throws IOException if writes to the file fail
[ "As", "{", "@link", "#writeToPath", "(", "BitMatrix", "String", "Path", ")", "}", "but", "allows", "customization", "of", "the", "output", "." ]
train
https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/javase/src/main/java/com/google/zxing/client/j2se/MatrixToImageWriter.java#L126-L132
Netflix/ribbon
ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/LoadBalancerContext.java
LoadBalancerContext.noteError
protected void noteError(ServerStats stats, ClientRequest request, Throwable e, long responseTime) { """ This is called after an error is thrown from the client to update related stats. """ if (stats == null) { return; } try { recordStats(stats, responseTime); R...
java
protected void noteError(ServerStats stats, ClientRequest request, Throwable e, long responseTime) { if (stats == null) { return; } try { recordStats(stats, responseTime); RetryHandler errorHandler = getRetryHandler(); if (errorHandler != null && e != null) { ...
[ "protected", "void", "noteError", "(", "ServerStats", "stats", ",", "ClientRequest", "request", ",", "Throwable", "e", ",", "long", "responseTime", ")", "{", "if", "(", "stats", "==", "null", ")", "{", "return", ";", "}", "try", "{", "recordStats", "(", ...
This is called after an error is thrown from the client to update related stats.
[ "This", "is", "called", "after", "an", "error", "is", "thrown", "from", "the", "client", "to", "update", "related", "stats", "." ]
train
https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/LoadBalancerContext.java#L293-L311
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/check/NameBasedCheck.java
NameBasedCheck.removeExtension
protected static String removeExtension(String str, String ext) { """ Removes extension (and preceding dot if present) from the given string. @param str String from which to remove [.]extension @param ext Extension to remove @return Original string if extension is not present, string without [.]extension o...
java
protected static String removeExtension(String str, String ext) { if (!str.endsWith(ext)) { return str; } int index = str.lastIndexOf(ext); index = index <= 0 ? 1 : index; str = str.substring(0, index - 1); return str; }
[ "protected", "static", "String", "removeExtension", "(", "String", "str", ",", "String", "ext", ")", "{", "if", "(", "!", "str", ".", "endsWith", "(", "ext", ")", ")", "{", "return", "str", ";", "}", "int", "index", "=", "str", ".", "lastIndexOf", "(...
Removes extension (and preceding dot if present) from the given string. @param str String from which to remove [.]extension @param ext Extension to remove @return Original string if extension is not present, string without [.]extension otherwise
[ "Removes", "extension", "(", "and", "preceding", "dot", "if", "present", ")", "from", "the", "given", "string", "." ]
train
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/check/NameBasedCheck.java#L66-L74
Azure/azure-sdk-for-java
sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java
DatabasesInner.resumeAsync
public Observable<DatabaseInner> resumeAsync(String resourceGroupName, String serverName, String databaseName) { """ Resumes a database. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param server...
java
public Observable<DatabaseInner> resumeAsync(String resourceGroupName, String serverName, String databaseName) { return resumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DatabaseInner>, DatabaseInner>() { @Override public DatabaseIn...
[ "public", "Observable", "<", "DatabaseInner", ">", "resumeAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "databaseName", ")", "{", "return", "resumeWithServiceResponseAsync", "(", "resourceGroupName", ",", "serverName", ",", "d...
Resumes a database. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param databaseName The name of the database to be resumed. @throws IllegalArgumentException thr...
[ "Resumes", "a", "database", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java#L1426-L1433
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/S3ProgressPublisher.java
S3ProgressPublisher.publishTransferPersistable
public static Future<?> publishTransferPersistable( final ProgressListener listener, final PersistableTransfer persistableTransfer) { """ Used to deliver a persistable transfer to the given s3 listener. @param listener only listener of type {@link S3ProgressListener} will be notified. ...
java
public static Future<?> publishTransferPersistable( final ProgressListener listener, final PersistableTransfer persistableTransfer) { if (persistableTransfer == null || !(listener instanceof S3ProgressListener)) { return null; } final S3ProgressListener s3list...
[ "public", "static", "Future", "<", "?", ">", "publishTransferPersistable", "(", "final", "ProgressListener", "listener", ",", "final", "PersistableTransfer", "persistableTransfer", ")", "{", "if", "(", "persistableTransfer", "==", "null", "||", "!", "(", "listener",...
Used to deliver a persistable transfer to the given s3 listener. @param listener only listener of type {@link S3ProgressListener} will be notified. @return the future of a submitted task; or null if the delivery is synchronous with no future task involved. Note a listener should never block, and therefore returning ...
[ "Used", "to", "deliver", "a", "persistable", "transfer", "to", "the", "given", "s3", "listener", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/S3ProgressPublisher.java#L40-L48
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobSchedulesInner.java
JobSchedulesInner.createAsync
public Observable<JobScheduleInner> createAsync(String resourceGroupName, String automationAccountName, UUID jobScheduleId, JobScheduleCreateParameters parameters) { """ Create a job schedule. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation acco...
java
public Observable<JobScheduleInner> createAsync(String resourceGroupName, String automationAccountName, UUID jobScheduleId, JobScheduleCreateParameters parameters) { return createWithServiceResponseAsync(resourceGroupName, automationAccountName, jobScheduleId, parameters).map(new Func1<ServiceResponse<JobSchedu...
[ "public", "Observable", "<", "JobScheduleInner", ">", "createAsync", "(", "String", "resourceGroupName", ",", "String", "automationAccountName", ",", "UUID", "jobScheduleId", ",", "JobScheduleCreateParameters", "parameters", ")", "{", "return", "createWithServiceResponseAsy...
Create a job schedule. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param jobScheduleId The job schedule name. @param parameters The parameters supplied to the create job schedule operation. @throws IllegalArgumentException thrown if parame...
[ "Create", "a", "job", "schedule", "." ]
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/JobSchedulesInner.java#L310-L317
apache/groovy
src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
StaticTypeCheckingVisitor.inferLoopElementType
public static ClassNode inferLoopElementType(final ClassNode collectionType) { """ Given a loop collection type, returns the inferred type of the loop element. Used, for example, to infer the element type of a (for e in list) loop. @param collectionType the type of the collection @return the inferred componen...
java
public static ClassNode inferLoopElementType(final ClassNode collectionType) { ClassNode componentType = collectionType.getComponentType(); if (componentType == null) { if (implementsInterfaceOrIsSubclassOf(collectionType, ITERABLE_TYPE)) { ClassNode intf = GenericsUtils.para...
[ "public", "static", "ClassNode", "inferLoopElementType", "(", "final", "ClassNode", "collectionType", ")", "{", "ClassNode", "componentType", "=", "collectionType", ".", "getComponentType", "(", ")", ";", "if", "(", "componentType", "==", "null", ")", "{", "if", ...
Given a loop collection type, returns the inferred type of the loop element. Used, for example, to infer the element type of a (for e in list) loop. @param collectionType the type of the collection @return the inferred component type
[ "Given", "a", "loop", "collection", "type", "returns", "the", "inferred", "type", "of", "the", "loop", "element", ".", "Used", "for", "example", "to", "infer", "the", "element", "type", "of", "a", "(", "for", "e", "in", "list", ")", "loop", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java#L2008-L2033
googleapis/google-http-java-client
google-http-client/src/main/java/com/google/api/client/json/JsonParser.java
JsonParser.parseAndClose
@Beta public final void parseAndClose(Object destination, CustomizeJsonParser customizeParser) throws IOException { """ {@link Beta} <br> Parse a JSON Object from the given JSON parser -- which is closed after parsing completes -- into the given destination object, optionally using the given parser custo...
java
@Beta public final void parseAndClose(Object destination, CustomizeJsonParser customizeParser) throws IOException { try { parse(destination, customizeParser); } finally { close(); } }
[ "@", "Beta", "public", "final", "void", "parseAndClose", "(", "Object", "destination", ",", "CustomizeJsonParser", "customizeParser", ")", "throws", "IOException", "{", "try", "{", "parse", "(", "destination", ",", "customizeParser", ")", ";", "}", "finally", "{...
{@link Beta} <br> Parse a JSON Object from the given JSON parser -- which is closed after parsing completes -- into the given destination object, optionally using the given parser customizer. <p>Before this method is called, the parser must either point to the start or end of a JSON object or to a field name. @param ...
[ "{", "@link", "Beta", "}", "<br", ">", "Parse", "a", "JSON", "Object", "from", "the", "given", "JSON", "parser", "--", "which", "is", "closed", "after", "parsing", "completes", "--", "into", "the", "given", "destination", "object", "optionally", "using", "...
train
https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#L274-L282
samskivert/samskivert
src/main/java/com/samskivert/velocity/DispatcherServlet.java
DispatcherServlet.instantiateLogic
protected Logic instantiateLogic (String path, String lclass) { """ Instantiates a logic instance with the supplied class name. May return null if no such class exists. """ try { Class<?> pcl = Class.forName(lclass); return (Logic)pcl.newInstance(); } catch (ClassNotFou...
java
protected Logic instantiateLogic (String path, String lclass) { try { Class<?> pcl = Class.forName(lclass); return (Logic)pcl.newInstance(); } catch (ClassNotFoundException cnfe) { // nothing interesting to report } catch (Throwable t) { log.warnin...
[ "protected", "Logic", "instantiateLogic", "(", "String", "path", ",", "String", "lclass", ")", "{", "try", "{", "Class", "<", "?", ">", "pcl", "=", "Class", ".", "forName", "(", "lclass", ")", ";", "return", "(", "Logic", ")", "pcl", ".", "newInstance"...
Instantiates a logic instance with the supplied class name. May return null if no such class exists.
[ "Instantiates", "a", "logic", "instance", "with", "the", "supplied", "class", "name", ".", "May", "return", "null", "if", "no", "such", "class", "exists", "." ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/DispatcherServlet.java#L597-L608
Azure/azure-sdk-for-java
sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionVaultsInner.java
BackupLongTermRetentionVaultsInner.createOrUpdate
public BackupLongTermRetentionVaultInner createOrUpdate(String resourceGroupName, String serverName, String recoveryServicesVaultResourceId) { """ Updates a server backup long term retention vault. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from...
java
public BackupLongTermRetentionVaultInner createOrUpdate(String resourceGroupName, String serverName, String recoveryServicesVaultResourceId) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, recoveryServicesVaultResourceId).toBlocking().last().body(); }
[ "public", "BackupLongTermRetentionVaultInner", "createOrUpdate", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "recoveryServicesVaultResourceId", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", "serv...
Updates a server backup long term retention vault. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param recoveryServicesVaultResourceId The azure recovery service...
[ "Updates", "a", "server", "backup", "long", "term", "retention", "vault", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionVaultsInner.java#L173-L175
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/DeployKeysApi.java
DeployKeysApi.getDeployKey
public DeployKey getDeployKey(Object projectIdOrPath, Integer keyId) throws GitLabApiException { """ Get a single deploy key for the specified project. <pre><code>GitLab Endpoint: GET /projects/:id/deploy_keys/:key_id</code></pre> @param projectIdOrPath the project in the form of an Integer(ID), String(path)...
java
public DeployKey getDeployKey(Object projectIdOrPath, Integer keyId) throws GitLabApiException { if (keyId == null) { throw new RuntimeException("keyId cannot be null"); } Response response = get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPa...
[ "public", "DeployKey", "getDeployKey", "(", "Object", "projectIdOrPath", ",", "Integer", "keyId", ")", "throws", "GitLabApiException", "{", "if", "(", "keyId", "==", "null", ")", "{", "throw", "new", "RuntimeException", "(", "\"keyId cannot be null\"", ")", ";", ...
Get a single deploy key for the specified project. <pre><code>GitLab Endpoint: GET /projects/:id/deploy_keys/:key_id</code></pre> @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance @param keyId the ID of the deploy key to delete @return the DeployKey instance for the s...
[ "Get", "a", "single", "deploy", "key", "for", "the", "specified", "project", "." ]
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/DeployKeysApi.java#L144-L153
UrielCh/ovh-java-sdk
ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java
ApiOvhMe.credit_balance_balanceName_movement_movementId_GET
public OvhMovement credit_balance_balanceName_movement_movementId_GET(String balanceName, Long movementId) throws IOException { """ Retrieve a specific movement for a credit balance REST: GET /me/credit/balance/{balanceName}/movement/{movementId} @param balanceName [required] Credit balance name @param moveme...
java
public OvhMovement credit_balance_balanceName_movement_movementId_GET(String balanceName, Long movementId) throws IOException { String qPath = "/me/credit/balance/{balanceName}/movement/{movementId}"; StringBuilder sb = path(qPath, balanceName, movementId); String resp = exec(qPath, "GET", sb.toString(), null); ...
[ "public", "OvhMovement", "credit_balance_balanceName_movement_movementId_GET", "(", "String", "balanceName", ",", "Long", "movementId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/me/credit/balance/{balanceName}/movement/{movementId}\"", ";", "StringBuilder", ...
Retrieve a specific movement for a credit balance REST: GET /me/credit/balance/{balanceName}/movement/{movementId} @param balanceName [required] Credit balance name @param movementId [required] Movement ID
[ "Retrieve", "a", "specific", "movement", "for", "a", "credit", "balance" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L884-L889
jhy/jsoup
src/main/java/org/jsoup/helper/DataUtil.java
DataUtil.load
public static Document load(InputStream in, String charsetName, String baseUri) throws IOException { """ Parses a Document from an input steam. @param in input stream to parse. You will need to close it. @param charsetName character set of input @param baseUri base URI of document, to resolve relative links aga...
java
public static Document load(InputStream in, String charsetName, String baseUri) throws IOException { return parseInputStream(in, charsetName, baseUri, Parser.htmlParser()); }
[ "public", "static", "Document", "load", "(", "InputStream", "in", ",", "String", "charsetName", ",", "String", "baseUri", ")", "throws", "IOException", "{", "return", "parseInputStream", "(", "in", ",", "charsetName", ",", "baseUri", ",", "Parser", ".", "htmlP...
Parses a Document from an input steam. @param in input stream to parse. You will need to close it. @param charsetName character set of input @param baseUri base URI of document, to resolve relative links against @return Document @throws IOException on IO error
[ "Parses", "a", "Document", "from", "an", "input", "steam", "." ]
train
https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/helper/DataUtil.java#L65-L67
dnsjava/dnsjava
org/xbill/DNS/Lookup.java
Lookup.setDefaultCache
public static synchronized void setDefaultCache(Cache cache, int dclass) { """ Sets the Cache to be used as the default for the specified class by future Lookups. @param cache The default cache for the specified class. @param dclass The class whose cache is being set. """ DClass.check(dclass); defaultCach...
java
public static synchronized void setDefaultCache(Cache cache, int dclass) { DClass.check(dclass); defaultCaches.put(Mnemonic.toInteger(dclass), cache); }
[ "public", "static", "synchronized", "void", "setDefaultCache", "(", "Cache", "cache", ",", "int", "dclass", ")", "{", "DClass", ".", "check", "(", "dclass", ")", ";", "defaultCaches", ".", "put", "(", "Mnemonic", ".", "toInteger", "(", "dclass", ")", ",", ...
Sets the Cache to be used as the default for the specified class by future Lookups. @param cache The default cache for the specified class. @param dclass The class whose cache is being set.
[ "Sets", "the", "Cache", "to", "be", "used", "as", "the", "default", "for", "the", "specified", "class", "by", "future", "Lookups", "." ]
train
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Lookup.java#L141-L145
kite-sdk/kite
kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/FileSystemUtil.java
FileSystemUtil.deleteParentDirectoriesIfEmpty
static boolean deleteParentDirectoriesIfEmpty(FileSystem fs, Path root, Path path) throws IOException { """ Deletes the empty parent directories of the specified path. The method catches and ignores FileNotFoundException as it is possible that multiple parallel Kite instances are importing into a directory under...
java
static boolean deleteParentDirectoriesIfEmpty(FileSystem fs, Path root, Path path) throws IOException { boolean deleted = false; try { for (Path current = path.getParent(); !current.equals(root) && !(current.getParent() == null); current = current.getParent()) { final FileSta...
[ "static", "boolean", "deleteParentDirectoriesIfEmpty", "(", "FileSystem", "fs", ",", "Path", "root", ",", "Path", "path", ")", "throws", "IOException", "{", "boolean", "deleted", "=", "false", ";", "try", "{", "for", "(", "Path", "current", "=", "path", ".",...
Deletes the empty parent directories of the specified path. The method catches and ignores FileNotFoundException as it is possible that multiple parallel Kite instances are importing into a directory under the same root directory and it can happen that a Kite instance founds an empty directory which needs to be deleted...
[ "Deletes", "the", "empty", "parent", "directories", "of", "the", "specified", "path", ".", "The", "method", "catches", "and", "ignores", "FileNotFoundException", "as", "it", "is", "possible", "that", "multiple", "parallel", "Kite", "instances", "are", "importing",...
train
https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/FileSystemUtil.java#L258-L278
looly/hutool
hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java
SqlConnRunner.find
public <T> T find(Connection conn, Collection<String> fields, Entity where, RsHandler<T> rsh) throws SQLException { """ 查询<br> 此方法不会关闭Connection @param <T> 结果对象类型 @param conn 数据库连接对象 @param fields 返回的字段列表,null则返回所有字段 @param where 条件实体类(包含表名) @param rsh 结果集处理对象 @return 结果对象 @throws SQLException SQL执行异常 ...
java
public <T> T find(Connection conn, Collection<String> fields, Entity where, RsHandler<T> rsh) throws SQLException { final Query query = new Query(SqlUtil.buildConditions(where), where.getTableName()); query.setFields(fields); return find(conn, query, rsh); }
[ "public", "<", "T", ">", "T", "find", "(", "Connection", "conn", ",", "Collection", "<", "String", ">", "fields", ",", "Entity", "where", ",", "RsHandler", "<", "T", ">", "rsh", ")", "throws", "SQLException", "{", "final", "Query", "query", "=", "new",...
查询<br> 此方法不会关闭Connection @param <T> 结果对象类型 @param conn 数据库连接对象 @param fields 返回的字段列表,null则返回所有字段 @param where 条件实体类(包含表名) @param rsh 结果集处理对象 @return 结果对象 @throws SQLException SQL执行异常
[ "查询<br", ">", "此方法不会关闭Connection" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java#L330-L334
xiancloud/xian
xian-core/src/main/java/info/xiancloud/core/util/CloneUtil.java
CloneUtil.cloneBean
public static <T> T cloneBean(T from, Class<T> beanClass) { """ clone a java bean. (We use fastjson.) @param from the bean you want to clone from. This must be a standard bean object. @param beanClass the bean type @param <T> the generic type. @return the cloned object. """ if (from =...
java
public static <T> T cloneBean(T from, Class<T> beanClass) { if (from == null || from instanceof Collection || from.getClass().isArray()) { throw new IllegalArgumentException("Only java bean class is allowed here."); } JSONObject jsonObject = (JSONObject) JSON.toJSON(from); re...
[ "public", "static", "<", "T", ">", "T", "cloneBean", "(", "T", "from", ",", "Class", "<", "T", ">", "beanClass", ")", "{", "if", "(", "from", "==", "null", "||", "from", "instanceof", "Collection", "||", "from", ".", "getClass", "(", ")", ".", "isA...
clone a java bean. (We use fastjson.) @param from the bean you want to clone from. This must be a standard bean object. @param beanClass the bean type @param <T> the generic type. @return the cloned object.
[ "clone", "a", "java", "bean", ".", "(", "We", "use", "fastjson", ".", ")" ]
train
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/util/CloneUtil.java#L23-L29
hawkular/hawkular-agent
hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/WebJBossASClient.java
WebJBossASClient.changeConnector
public void changeConnector(String connectorName, String attribName, String attribValue) throws Exception { """ Use this to modify an attribute for an existing connector. @param connectorName the existing connector whose attribute is to be changed @param attribName the attribute to get a new value @param attrib...
java
public void changeConnector(String connectorName, String attribName, String attribValue) throws Exception { final Address address = Address.root().add(SUBSYSTEM, SUBSYSTEM_WEB, CONNECTOR, connectorName); final ModelNode op = createWriteAttributeRequest(attribName, attribValue, address); final Mo...
[ "public", "void", "changeConnector", "(", "String", "connectorName", ",", "String", "attribName", ",", "String", "attribValue", ")", "throws", "Exception", "{", "final", "Address", "address", "=", "Address", ".", "root", "(", ")", ".", "add", "(", "SUBSYSTEM",...
Use this to modify an attribute for an existing connector. @param connectorName the existing connector whose attribute is to be changed @param attribName the attribute to get a new value @param attribValue the new value of the attribute @throws Exception if failed to change the attribute on the named connector
[ "Use", "this", "to", "modify", "an", "attribute", "for", "an", "existing", "connector", "." ]
train
https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/WebJBossASClient.java#L102-L110
andrehertwig/admintool
admin-tools-security/admin-tools-security-dbuser/src/main/java/de/chandre/admintool/security/dbuser/contoller/ATSecDBAbctractController.java
ATSecDBAbctractController.handleException
protected <E extends Throwable> Set<ATError> handleException(E e, Log logger, String key, String messageKey, String defaultMessagePrefix) { """ logging the error and creates {@link ATError} list output @param e @param logger @param key @param messageKey @param defaultMessagePrefix @return """ ret...
java
protected <E extends Throwable> Set<ATError> handleException(E e, Log logger, String key, String messageKey, String defaultMessagePrefix) { return handleException(e, logger, null, key, null, defaultMessagePrefix, new Object[] {}); }
[ "protected", "<", "E", "extends", "Throwable", ">", "Set", "<", "ATError", ">", "handleException", "(", "E", "e", ",", "Log", "logger", ",", "String", "key", ",", "String", "messageKey", ",", "String", "defaultMessagePrefix", ")", "{", "return", "handleExcep...
logging the error and creates {@link ATError} list output @param e @param logger @param key @param messageKey @param defaultMessagePrefix @return
[ "logging", "the", "error", "and", "creates", "{" ]
train
https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-security/admin-tools-security-dbuser/src/main/java/de/chandre/admintool/security/dbuser/contoller/ATSecDBAbctractController.java#L36-L39
phax/ph-oton
ph-oton-security/src/main/java/com/helger/photon/security/password/hash/PasswordHashCreatorManager.java
PasswordHashCreatorManager.createUserPasswordHash
@Nonnull public PasswordHash createUserPasswordHash (@Nonnull @Nonempty final String sAlgorithmName, @Nullable final IPasswordSalt aSalt, @Nonnull final String sPlainTextPassword) { """ Create the password hash from the p...
java
@Nonnull public PasswordHash createUserPasswordHash (@Nonnull @Nonempty final String sAlgorithmName, @Nullable final IPasswordSalt aSalt, @Nonnull final String sPlainTextPassword) { ValueEnforcer.notNull (sPlainTextPassw...
[ "@", "Nonnull", "public", "PasswordHash", "createUserPasswordHash", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sAlgorithmName", ",", "@", "Nullable", "final", "IPasswordSalt", "aSalt", ",", "@", "Nonnull", "final", "String", "sPlainTextPassword", ")",...
Create the password hash from the passed plain text password, using the default password hash creator. @param sAlgorithmName The password hash creator algorithm name to query. May neither be <code>null</code> nor empty. @param aSalt Optional salt to be used. This parameter is only <code>null</code> for backwards compa...
[ "Create", "the", "password", "hash", "from", "the", "passed", "plain", "text", "password", "using", "the", "default", "password", "hash", "creator", "." ]
train
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-security/src/main/java/com/helger/photon/security/password/hash/PasswordHashCreatorManager.java#L214-L228
google/truth
core/src/main/java/com/google/common/truth/AtomicLongMapSubject.java
AtomicLongMapSubject.containsEntry
@SuppressWarnings("unchecked") // worse case should be a ClassCastException /* * TODO(cpovirk): Consider requiring key to be a K here. But AtomicLongMapSubject isn't currently * parameterized, and if we're going to add a type parameter, I'd rather wait until after we * (hopefully) remove the other existing t...
java
@SuppressWarnings("unchecked") // worse case should be a ClassCastException /* * TODO(cpovirk): Consider requiring key to be a K here. But AtomicLongMapSubject isn't currently * parameterized, and if we're going to add a type parameter, I'd rather wait until after we * (hopefully) remove the other existing t...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "// worse case should be a ClassCastException", "/*\n * TODO(cpovirk): Consider requiring key to be a K here. But AtomicLongMapSubject isn't currently\n * parameterized, and if we're going to add a type parameter, I'd rather wait until after we\n ...
Fails if the {@link AtomicLongMap} does not contain the given entry.
[ "Fails", "if", "the", "{" ]
train
https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/AtomicLongMapSubject.java#L106-L118
klarna/HiveRunner
src/main/java/com/klarna/hiverunner/data/InsertIntoTable.java
InsertIntoTable.addRowsFrom
public InsertIntoTable addRowsFrom(File file, FileParser fileParser) { """ Adds all rows from the file specified, using the provided parser. @param file File to read the data from. @param fileParser Parser to be used to parse the file. @return {@code this} """ builder.addRowsFrom(file, fileParser); ...
java
public InsertIntoTable addRowsFrom(File file, FileParser fileParser) { builder.addRowsFrom(file, fileParser); return this; }
[ "public", "InsertIntoTable", "addRowsFrom", "(", "File", "file", ",", "FileParser", "fileParser", ")", "{", "builder", ".", "addRowsFrom", "(", "file", ",", "fileParser", ")", ";", "return", "this", ";", "}" ]
Adds all rows from the file specified, using the provided parser. @param file File to read the data from. @param fileParser Parser to be used to parse the file. @return {@code this}
[ "Adds", "all", "rows", "from", "the", "file", "specified", "using", "the", "provided", "parser", "." ]
train
https://github.com/klarna/HiveRunner/blob/c8899237db6122127f16e3d8a740c1f8657c2ae3/src/main/java/com/klarna/hiverunner/data/InsertIntoTable.java#L172-L175
codelibs/fess
src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java
FessMessages.addErrorsPropertyRequired
public FessMessages addErrorsPropertyRequired(String property, String arg0) { """ Add the created action message for the key 'errors.property_required' with parameters. <pre> message: {0} is required. </pre> @param property The property name for the message. (NotNull) @param arg0 The parameter arg0 for messag...
java
public FessMessages addErrorsPropertyRequired(String property, String arg0) { assertPropertyNotNull(property); add(property, new UserMessage(ERRORS_property_required, arg0)); return this; }
[ "public", "FessMessages", "addErrorsPropertyRequired", "(", "String", "property", ",", "String", "arg0", ")", "{", "assertPropertyNotNull", "(", "property", ")", ";", "add", "(", "property", ",", "new", "UserMessage", "(", "ERRORS_property_required", ",", "arg0", ...
Add the created action message for the key 'errors.property_required' with parameters. <pre> message: {0} is required. </pre> @param property The property name for the message. (NotNull) @param arg0 The parameter arg0 for message. (NotNull) @return this. (NotNull)
[ "Add", "the", "created", "action", "message", "for", "the", "key", "errors", ".", "property_required", "with", "parameters", ".", "<pre", ">", "message", ":", "{", "0", "}", "is", "required", ".", "<", "/", "pre", ">" ]
train
https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L2185-L2189
jbundle/jbundle
base/remote/src/main/java/org/jbundle/base/remote/db/Session.java
Session.setupRemoteSessionFilter
public final BaseMessageFilter setupRemoteSessionFilter(BaseMessageFilter messageFilter) throws RemoteException { """ Link the filter to this remote session. This is a special method that is needed because the remote link is passed as a remote reference to the session even though it is in the same JVM. What you ...
java
public final BaseMessageFilter setupRemoteSessionFilter(BaseMessageFilter messageFilter) throws RemoteException { boolean bThinClient = false; if (messageFilter instanceof ClientSessionMessageFilter) bThinClient = true; messageFilter = this.setupRemoteFilter(messageFilter); // C...
[ "public", "final", "BaseMessageFilter", "setupRemoteSessionFilter", "(", "BaseMessageFilter", "messageFilter", ")", "throws", "RemoteException", "{", "boolean", "bThinClient", "=", "false", ";", "if", "(", "messageFilter", "instanceof", "ClientSessionMessageFilter", ")", ...
Link the filter to this remote session. This is a special method that is needed because the remote link is passed as a remote reference to the session even though it is in the same JVM. What you need to do in your implementation is lookup the message filter and call messageFilter.linkRemoteSession(this); If you need to...
[ "Link", "the", "filter", "to", "this", "remote", "session", ".", "This", "is", "a", "special", "method", "that", "is", "needed", "because", "the", "remote", "link", "is", "passed", "as", "a", "remote", "reference", "to", "the", "session", "even", "though",...
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/db/Session.java#L154-L177
codegist/crest
core/src/main/java/org/codegist/crest/CRestBuilder.java
CRestBuilder.extractsEntityAuthParamsWith
public CRestBuilder extractsEntityAuthParamsWith(String entityContentType, EntityParamExtractor entityParamExtractor) { """ <p>Sets an entity parameters extractor for authenticated requests.</p> <p>When <b>CRest</b> is configured to authenticate requests, it uses an {@link org.codegist.crest.io.http.EntityParamEx...
java
public CRestBuilder extractsEntityAuthParamsWith(String entityContentType, EntityParamExtractor entityParamExtractor){ this.httpEntityParamExtrators.put(entityContentType, entityParamExtractor); return this; }
[ "public", "CRestBuilder", "extractsEntityAuthParamsWith", "(", "String", "entityContentType", ",", "EntityParamExtractor", "entityParamExtractor", ")", "{", "this", ".", "httpEntityParamExtrators", ".", "put", "(", "entityContentType", ",", "entityParamExtractor", ")", ";",...
<p>Sets an entity parameters extractor for authenticated requests.</p> <p>When <b>CRest</b> is configured to authenticate requests, it uses an {@link org.codegist.crest.io.http.EntityParamExtractor} to extract parameters from the request entity to include them in the authentication process.</p> <p>A common use case is ...
[ "<p", ">", "Sets", "an", "entity", "parameters", "extractor", "for", "authenticated", "requests", ".", "<", "/", "p", ">", "<p", ">", "When", "<b", ">", "CRest<", "/", "b", ">", "is", "configured", "to", "authenticate", "requests", "it", "uses", "an", ...
train
https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/core/src/main/java/org/codegist/crest/CRestBuilder.java#L677-L680
sarl/sarl
contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java
PyGenerator._generate
protected void _generate(SarlAnnotationType annotation, IExtraLanguageGeneratorContext context) { """ Generate the given object. @param annotation the annotation. @param context the context. """ final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(annotation); final PyAppendable ap...
java
protected void _generate(SarlAnnotationType annotation, IExtraLanguageGeneratorContext context) { final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(annotation); final PyAppendable appendable = createAppendable(jvmType, context); if (generateTypeDeclaration( this.qualifiedNameProvider.g...
[ "protected", "void", "_generate", "(", "SarlAnnotationType", "annotation", ",", "IExtraLanguageGeneratorContext", "context", ")", "{", "final", "JvmDeclaredType", "jvmType", "=", "getJvmModelAssociations", "(", ")", ".", "getInferredType", "(", "annotation", ")", ";", ...
Generate the given object. @param annotation the annotation. @param context the context.
[ "Generate", "the", "given", "object", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L725-L737
UrielCh/ovh-java-sdk
ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java
ApiOvhRouter.serviceName_network_ipNet_PUT
public void serviceName_network_ipNet_PUT(String serviceName, String ipNet, OvhNetwork body) throws IOException { """ Alter this object properties REST: PUT /router/{serviceName}/network/{ipNet} @param body [required] New object properties @param serviceName [required] The internal name of your Router offer ...
java
public void serviceName_network_ipNet_PUT(String serviceName, String ipNet, OvhNetwork body) throws IOException { String qPath = "/router/{serviceName}/network/{ipNet}"; StringBuilder sb = path(qPath, serviceName, ipNet); exec(qPath, "PUT", sb.toString(), body); }
[ "public", "void", "serviceName_network_ipNet_PUT", "(", "String", "serviceName", ",", "String", "ipNet", ",", "OvhNetwork", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/router/{serviceName}/network/{ipNet}\"", ";", "StringBuilder", "sb", "=", ...
Alter this object properties REST: PUT /router/{serviceName}/network/{ipNet} @param body [required] New object properties @param serviceName [required] The internal name of your Router offer @param ipNet [required] Gateway IP / CIDR Netmask
[ "Alter", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java#L289-L293
phoenixnap/springmvc-raml-plugin
src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/helpers/SchemaHelper.java
SchemaHelper.mapSchemaToPojo
public static ApiBodyMetadata mapSchemaToPojo(RamlRoot document, String schema, String basePackage, String name, String schemaLocation) { """ Maps a JSON Schema to a JCodeModel using JSONSchema2Pojo and encapsulates it along with some metadata into an {@link ApiBodyMetadata} object. @param document The Ram...
java
public static ApiBodyMetadata mapSchemaToPojo(RamlRoot document, String schema, String basePackage, String name, String schemaLocation) { String resolvedName = null; String schemaName = schema; // Check if we have the name of a schema or an actual schema String resolvedSchema = SchemaHelper.resolveSchema(sc...
[ "public", "static", "ApiBodyMetadata", "mapSchemaToPojo", "(", "RamlRoot", "document", ",", "String", "schema", ",", "String", "basePackage", ",", "String", "name", ",", "String", "schemaLocation", ")", "{", "String", "resolvedName", "=", "null", ";", "String", ...
Maps a JSON Schema to a JCodeModel using JSONSchema2Pojo and encapsulates it along with some metadata into an {@link ApiBodyMetadata} object. @param document The Raml document being parsed @param schema The Schema (full schema or schema name to be resolved) @param basePackage The base package for the classes we are ge...
[ "Maps", "a", "JSON", "Schema", "to", "a", "JCodeModel", "using", "JSONSchema2Pojo", "and", "encapsulates", "it", "along", "with", "some", "metadata", "into", "an", "{", "@link", "ApiBodyMetadata", "}", "object", "." ]
train
https://github.com/phoenixnap/springmvc-raml-plugin/blob/6387072317cd771eb7d6f30943f556ac20dd3c84/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/helpers/SchemaHelper.java#L304-L344
alkacon/opencms-core
src/org/opencms/util/CmsFileUtil.java
CmsFileUtil.formatResourceNames
public static String formatResourceNames(CmsRequestContext context, List<CmsResource> resources) { """ Returns a comma separated list of resource paths names, with the site root from the given OpenCms user context removed.<p> @param context the current users OpenCms context (optional, may be <code>null</code>)...
java
public static String formatResourceNames(CmsRequestContext context, List<CmsResource> resources) { if (resources == null) { return null; } StringBuffer result = new StringBuffer(128); Iterator<CmsResource> i = resources.iterator(); while (i.hasNext()) { C...
[ "public", "static", "String", "formatResourceNames", "(", "CmsRequestContext", "context", ",", "List", "<", "CmsResource", ">", "resources", ")", "{", "if", "(", "resources", "==", "null", ")", "{", "return", "null", ";", "}", "StringBuffer", "result", "=", ...
Returns a comma separated list of resource paths names, with the site root from the given OpenCms user context removed.<p> @param context the current users OpenCms context (optional, may be <code>null</code>) @param resources a List of <code>{@link CmsResource}</code> instances to get the names from @return a comma s...
[ "Returns", "a", "comma", "separated", "list", "of", "resource", "paths", "names", "with", "the", "site", "root", "from", "the", "given", "OpenCms", "user", "context", "removed", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsFileUtil.java#L263-L282
matthewhorridge/binaryowl
src/main/java/org/semanticweb/binaryowl/BinaryOWLMetadata.java
BinaryOWLMetadata.getIntAttribute
public Integer getIntAttribute(String name, Integer defaultValue) { """ Gets the int value of an attribute. @param name The name of the attribute. Not null. @param defaultValue The default value for the attribute. May be null. This value will be returned if this metadata object does not contain an int value ...
java
public Integer getIntAttribute(String name, Integer defaultValue) { return getValue(intAttributes, name, defaultValue); }
[ "public", "Integer", "getIntAttribute", "(", "String", "name", ",", "Integer", "defaultValue", ")", "{", "return", "getValue", "(", "intAttributes", ",", "name", ",", "defaultValue", ")", ";", "}" ]
Gets the int value of an attribute. @param name The name of the attribute. Not null. @param defaultValue The default value for the attribute. May be null. This value will be returned if this metadata object does not contain an int value for the specified attribute name. @return Either the int value of the attribute ...
[ "Gets", "the", "int", "value", "of", "an", "attribute", "." ]
train
https://github.com/matthewhorridge/binaryowl/blob/7fccfe804120f86b38ca855ddbb569a81a042257/src/main/java/org/semanticweb/binaryowl/BinaryOWLMetadata.java#L289-L291
powermock/powermock
powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java
WhiteboxImpl.setInternalState
public static void setInternalState(Object object, String fieldName, Object value) { """ Set the value of a field using reflection. This method will traverse the super class hierarchy until a field with name <tt>fieldName</tt> is found. @param object the object whose field to modify @param fieldName the n...
java
public static void setInternalState(Object object, String fieldName, Object value) { Field foundField = findFieldInHierarchy(object, fieldName); setField(object, value, foundField); }
[ "public", "static", "void", "setInternalState", "(", "Object", "object", ",", "String", "fieldName", ",", "Object", "value", ")", "{", "Field", "foundField", "=", "findFieldInHierarchy", "(", "object", ",", "fieldName", ")", ";", "setField", "(", "object", ","...
Set the value of a field using reflection. This method will traverse the super class hierarchy until a field with name <tt>fieldName</tt> is found. @param object the object whose field to modify @param fieldName the name of the field @param value the new value of the field
[ "Set", "the", "value", "of", "a", "field", "using", "reflection", ".", "This", "method", "will", "traverse", "the", "super", "class", "hierarchy", "until", "a", "field", "with", "name", "<tt", ">", "fieldName<", "/", "tt", ">", "is", "found", "." ]
train
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L302-L305
petergeneric/stdlib
stdlib/src/main/java/com/peterphi/std/crypto/CertificateChainUtil.java
CertificateChainUtil.verifyChain
public static void verifyChain(List<X509Certificate> chain) { """ Verifies that a certificate chain is valid @param chain a certificate chain with the root certificate first @throws IllegalArgumentException if the chain is invalid, null or empty """ if (chain == null || chain.isEmpty()) throw new ...
java
public static void verifyChain(List<X509Certificate> chain) { if (chain == null || chain.isEmpty()) throw new IllegalArgumentException("Must provide a chain that is non-null and non-empty"); for (int i = 0; i < chain.size(); i++) { final X509Certificate certificate = chain.get(i); final int issuerIndex...
[ "public", "static", "void", "verifyChain", "(", "List", "<", "X509Certificate", ">", "chain", ")", "{", "if", "(", "chain", "==", "null", "||", "chain", ".", "isEmpty", "(", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"Must provide a chain tha...
Verifies that a certificate chain is valid @param chain a certificate chain with the root certificate first @throws IllegalArgumentException if the chain is invalid, null or empty
[ "Verifies", "that", "a", "certificate", "chain", "is", "valid" ]
train
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/crypto/CertificateChainUtil.java#L328-L353
rampo/UpdateChecker
library/src/main/java/com/rampo/updatechecker/Comparator.java
Comparator.versionCompareNumerically
public static Integer versionCompareNumerically(String str1, String str2) { """ https://stackoverflow.com/questions/6701948/efficient-way-to-compare-version-strings-in-java <p/> Compares two version strings. <p/> Use this instead of String.compareTo() for a non-lexicographical comparison that works for versio...
java
public static Integer versionCompareNumerically(String str1, String str2) { String[] vals1 = str1.split("\\."); String[] vals2 = str2.split("\\."); int i = 0; // set index to first non-equal ordinal or length of shortest version string while (i < vals1.length && i < vals2.length ...
[ "public", "static", "Integer", "versionCompareNumerically", "(", "String", "str1", ",", "String", "str2", ")", "{", "String", "[", "]", "vals1", "=", "str1", ".", "split", "(", "\"\\\\.\"", ")", ";", "String", "[", "]", "vals2", "=", "str2", ".", "split"...
https://stackoverflow.com/questions/6701948/efficient-way-to-compare-version-strings-in-java <p/> Compares two version strings. <p/> Use this instead of String.compareTo() for a non-lexicographical comparison that works for version strings. e.g. "1.10".compareTo("1.6"). @param str1 a string of ordinal numbers separate...
[ "https", ":", "//", "stackoverflow", ".", "com", "/", "questions", "/", "6701948", "/", "efficient", "-", "way", "-", "to", "-", "compare", "-", "version", "-", "strings", "-", "in", "-", "java", "<p", "/", ">", "Compares", "two", "version", "strings",...
train
https://github.com/rampo/UpdateChecker/blob/738da234d46396b6396e15e7261f38b0cabf9913/library/src/main/java/com/rampo/updatechecker/Comparator.java#L55-L78
Netflix/zuul
zuul-core/src/main/java/com/netflix/zuul/FilterLoader.java
FilterLoader.getFilter
public ZuulFilter getFilter(String sCode, String sName) throws Exception { """ Given source and name will compile and store the filter if it detects that the filter code has changed or the filter doesn't exist. Otherwise it will return an instance of the requested ZuulFilter @param sCode source code @param sN...
java
public ZuulFilter getFilter(String sCode, String sName) throws Exception { if (filterCheck.get(sName) == null) { filterCheck.putIfAbsent(sName, sName); if (!sCode.equals(filterClassCode.get(sName))) { LOG.info("reloading code " + sName); filterRegistry.re...
[ "public", "ZuulFilter", "getFilter", "(", "String", "sCode", ",", "String", "sName", ")", "throws", "Exception", "{", "if", "(", "filterCheck", ".", "get", "(", "sName", ")", "==", "null", ")", "{", "filterCheck", ".", "putIfAbsent", "(", "sName", ",", "...
Given source and name will compile and store the filter if it detects that the filter code has changed or the filter doesn't exist. Otherwise it will return an instance of the requested ZuulFilter @param sCode source code @param sName name of the filter @return the IZuulFilter @throws IllegalAccessException @throws In...
[ "Given", "source", "and", "name", "will", "compile", "and", "store", "the", "filter", "if", "it", "detects", "that", "the", "filter", "code", "has", "changed", "or", "the", "filter", "doesn", "t", "exist", ".", "Otherwise", "it", "will", "return", "an", ...
train
https://github.com/Netflix/zuul/blob/01bc777cf05e3522d37c9ed902ae13eb38a19692/zuul-core/src/main/java/com/netflix/zuul/FilterLoader.java#L87-L105