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 |
|---|---|---|---|---|---|---|---|---|---|---|
airomem/airomem | airomem-chatsample/airomem-chatsample-web/src/main/java/pl/setblack/chatsample/servlet/ChatServlet.java | ChatServlet.processRequest | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
"""
Processes requests for both HTTP <code>GET</code> and <code>POST</code>
methods.
@param request servlet request
@param response servlet response
@throws ServletExcept... | java | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
if (!request.getServletPath().endsWith("insecure")) {
response.addHeader("Content-Security-Policy", b... | [
"protected",
"void",
"processRequest",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"response",
".",
"setContentType",
"(",
"\"text/html;charset=UTF-8\"",
")",
";",
"if",
"(",
... | Processes requests for both HTTP <code>GET</code> and <code>POST</code>
methods.
@param request servlet request
@param response servlet response
@throws ServletException if a servlet-specific error occurs
@throws IOException if an I/O error occurs | [
"Processes",
"requests",
"for",
"both",
"HTTP",
"<code",
">",
"GET<",
"/",
"code",
">",
"and",
"<code",
">",
"POST<",
"/",
"code",
">",
"methods",
"."
] | train | https://github.com/airomem/airomem/blob/281ce18ff64836fccfb0edab18b8d677f1101a32/airomem-chatsample/airomem-chatsample-web/src/main/java/pl/setblack/chatsample/servlet/ChatServlet.java#L30-L37 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/CLARA.java | CLARA.assignRemainingToNearestCluster | static double assignRemainingToNearestCluster(ArrayDBIDs means, DBIDs ids, DBIDs rids, WritableIntegerDataStore assignment, DistanceQuery<?> distQ) {
"""
Returns a list of clusters. The k<sup>th</sup> cluster contains the ids of
those FeatureVectors, that are nearest to the k<sup>th</sup> mean.
@param means Ob... | java | static double assignRemainingToNearestCluster(ArrayDBIDs means, DBIDs ids, DBIDs rids, WritableIntegerDataStore assignment, DistanceQuery<?> distQ) {
rids = DBIDUtil.ensureSet(rids); // Ensure we have fast contains
double distsum = 0.;
DBIDArrayIter miter = means.iter();
for(DBIDIter iditer = distQ.getR... | [
"static",
"double",
"assignRemainingToNearestCluster",
"(",
"ArrayDBIDs",
"means",
",",
"DBIDs",
"ids",
",",
"DBIDs",
"rids",
",",
"WritableIntegerDataStore",
"assignment",
",",
"DistanceQuery",
"<",
"?",
">",
"distQ",
")",
"{",
"rids",
"=",
"DBIDUtil",
".",
"en... | Returns a list of clusters. The k<sup>th</sup> cluster contains the ids of
those FeatureVectors, that are nearest to the k<sup>th</sup> mean.
@param means Object centroids
@param ids Object ids
@param rids Sample that was already assigned
@param assignment cluster assignment
@param distQ distance query
@return Sum of ... | [
"Returns",
"a",
"list",
"of",
"clusters",
".",
"The",
"k<sup",
">",
"th<",
"/",
"sup",
">",
"cluster",
"contains",
"the",
"ids",
"of",
"those",
"FeatureVectors",
"that",
"are",
"nearest",
"to",
"the",
"k<sup",
">",
"th<",
"/",
"sup",
">",
"mean",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/CLARA.java#L235-L257 |
jenkinsci/jenkins | core/src/main/java/hudson/model/Fingerprint.java | Fingerprint.getSortedFacets | public @Nonnull Collection<FingerprintFacet> getSortedFacets() {
"""
Sorts {@link FingerprintFacet}s by their timestamps.
@return Sorted list of {@link FingerprintFacet}s
"""
List<FingerprintFacet> r = new ArrayList<>(getFacets());
r.sort(new Comparator<FingerprintFacet>() {
public... | java | public @Nonnull Collection<FingerprintFacet> getSortedFacets() {
List<FingerprintFacet> r = new ArrayList<>(getFacets());
r.sort(new Comparator<FingerprintFacet>() {
public int compare(FingerprintFacet o1, FingerprintFacet o2) {
long a = o1.getTimestamp();
lon... | [
"public",
"@",
"Nonnull",
"Collection",
"<",
"FingerprintFacet",
">",
"getSortedFacets",
"(",
")",
"{",
"List",
"<",
"FingerprintFacet",
">",
"r",
"=",
"new",
"ArrayList",
"<>",
"(",
"getFacets",
"(",
")",
")",
";",
"r",
".",
"sort",
"(",
"new",
"Compara... | Sorts {@link FingerprintFacet}s by their timestamps.
@return Sorted list of {@link FingerprintFacet}s | [
"Sorts",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Fingerprint.java#L1201-L1213 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionValuePersistenceImpl.java | CPOptionValuePersistenceImpl.findByGroupId | @Override
public List<CPOptionValue> findByGroupId(long groupId) {
"""
Returns all the cp option values where groupId = ?.
@param groupId the group ID
@return the matching cp option values
"""
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPOptionValue> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPOptionValue",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp option values where groupId = ?.
@param groupId the group ID
@return the matching cp option values | [
"Returns",
"all",
"the",
"cp",
"option",
"values",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionValuePersistenceImpl.java#L1511-L1514 |
lipangit/JiaoZiVideoPlayer | jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java | JZUtils.clearSavedProgress | public static void clearSavedProgress(Context context, Object url) {
"""
if url == null, clear all progress
@param context context
@param url if url!=null clear this url progress
"""
if (url == null) {
SharedPreferences spn = context.getSharedPreferences("JZVD_PROGRESS",
... | java | public static void clearSavedProgress(Context context, Object url) {
if (url == null) {
SharedPreferences spn = context.getSharedPreferences("JZVD_PROGRESS",
Context.MODE_PRIVATE);
spn.edit().clear().apply();
} else {
SharedPreferences spn = contex... | [
"public",
"static",
"void",
"clearSavedProgress",
"(",
"Context",
"context",
",",
"Object",
"url",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"SharedPreferences",
"spn",
"=",
"context",
".",
"getSharedPreferences",
"(",
"\"JZVD_PROGRESS\"",
",",
"Cont... | if url == null, clear all progress
@param context context
@param url if url!=null clear this url progress | [
"if",
"url",
"==",
"null",
"clear",
"all",
"progress"
] | train | https://github.com/lipangit/JiaoZiVideoPlayer/blob/52c7370c131173b5ac77051029f0bd62fcf883f9/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java#L141-L151 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_DELETE | public void billingAccount_DELETE(String billingAccount, String details, OvhTerminationReasonEnum reason) throws IOException {
"""
Ask for a billing account termination.
REST: DELETE /telephony/{billingAccount}
@param details [required] Termination reason details
@param reason [required] Termination reason
@... | java | public void billingAccount_DELETE(String billingAccount, String details, OvhTerminationReasonEnum reason) throws IOException {
String qPath = "/telephony/{billingAccount}";
StringBuilder sb = path(qPath, billingAccount);
query(sb, "details", details);
query(sb, "reason", reason);
exec(qPath, "DELETE", sb.toSt... | [
"public",
"void",
"billingAccount_DELETE",
"(",
"String",
"billingAccount",
",",
"String",
"details",
",",
"OvhTerminationReasonEnum",
"reason",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}\"",
";",
"StringBuilder",
"sb",
"="... | Ask for a billing account termination.
REST: DELETE /telephony/{billingAccount}
@param details [required] Termination reason details
@param reason [required] Termination reason
@param billingAccount [required] The name of your billingAccount | [
"Ask",
"for",
"a",
"billing",
"account",
"termination",
"."
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L3689-L3695 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.selectCheckbox | protected void selectCheckbox(PageElement element, boolean checked, Object... args) throws TechnicalException, FailureException {
"""
Checks a checkbox type element.
@param element
Target page element
@param checked
Final checkbox value
@param args
list of arguments to format the found selector with
@thro... | java | protected void selectCheckbox(PageElement element, boolean checked, Object... args) throws TechnicalException, FailureException {
try {
final WebElement webElement = Context.waitUntil(ExpectedConditions.elementToBeClickable(Utilities.getLocator(element, args)));
if (webElement.isSelec... | [
"protected",
"void",
"selectCheckbox",
"(",
"PageElement",
"element",
",",
"boolean",
"checked",
",",
"Object",
"...",
"args",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"try",
"{",
"final",
"WebElement",
"webElement",
"=",
"Context",
".",
... | Checks a checkbox type element.
@param element
Target page element
@param checked
Final checkbox value
@param args
list of arguments to format the found selector with
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
Failure with {@value com.github.noraui... | [
"Checks",
"a",
"checkbox",
"type",
"element",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L712-L722 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.setDate | public <T extends Model> T setDate(String attributeName, Object value) {
"""
Sets attribute value as <code>java.sql.Date</code>.
If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class
<code>java.sql.Date</code>, given the value is an instance of <code>S</cod... | java | public <T extends Model> T setDate(String attributeName, Object value) {
Converter<Object, java.sql.Date> converter = modelRegistryLocal.converterForValue(
attributeName, value, java.sql.Date.class);
return setRaw(attributeName, converter != null ? converter.convert(value) : Convert.toSq... | [
"public",
"<",
"T",
"extends",
"Model",
">",
"T",
"setDate",
"(",
"String",
"attributeName",
",",
"Object",
"value",
")",
"{",
"Converter",
"<",
"Object",
",",
"java",
".",
"sql",
".",
"Date",
">",
"converter",
"=",
"modelRegistryLocal",
".",
"converterFor... | Sets attribute value as <code>java.sql.Date</code>.
If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class
<code>java.sql.Date</code>, given the value is an instance of <code>S</code>, then it will be used,
otherwise performs a conversion using {@link Convert#toSql... | [
"Sets",
"attribute",
"value",
"as",
"<code",
">",
"java",
".",
"sql",
".",
"Date<",
"/",
"code",
">",
".",
"If",
"there",
"is",
"a",
"{",
"@link",
"Converter",
"}",
"registered",
"for",
"the",
"attribute",
"that",
"converts",
"from",
"Class",
"<code",
... | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L298-L302 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableClusterUtilities.java | BigtableClusterUtilities.forInstance | public static BigtableClusterUtilities forInstance(String projectId, String instanceId)
throws IOException, GeneralSecurityException {
"""
Creates a {@link BigtableClusterUtilities} for a projectId and an instanceId.
@param projectId
@param instanceId
@return a {@link BigtableClusterUtilities} for a s... | java | public static BigtableClusterUtilities forInstance(String projectId, String instanceId)
throws IOException, GeneralSecurityException {
return new BigtableClusterUtilities(
BigtableOptions.builder().setProjectId(projectId).setInstanceId(instanceId).build());
} | [
"public",
"static",
"BigtableClusterUtilities",
"forInstance",
"(",
"String",
"projectId",
",",
"String",
"instanceId",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"return",
"new",
"BigtableClusterUtilities",
"(",
"BigtableOptions",
".",
"builder",... | Creates a {@link BigtableClusterUtilities} for a projectId and an instanceId.
@param projectId
@param instanceId
@return a {@link BigtableClusterUtilities} for a specific projectId/instanceId.
@throws GeneralSecurityException if ssl configuration fails
@throws IOException if some aspect of the connection fails. | [
"Creates",
"a",
"{",
"@link",
"BigtableClusterUtilities",
"}",
"for",
"a",
"projectId",
"and",
"an",
"instanceId",
"."
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableClusterUtilities.java#L51-L55 |
apereo/cas | support/cas-server-support-pm-webflow/src/main/java/org/apereo/cas/pm/web/flow/PasswordManagementWebflowUtils.java | PasswordManagementWebflowUtils.putPasswordResetSecurityQuestions | public void putPasswordResetSecurityQuestions(final RequestContext requestContext, final List<String> value) {
"""
Put password reset security questions.
@param requestContext the request context
@param value the value
"""
val flowScope = requestContext.getFlowScope();
flowScope.pu... | java | public void putPasswordResetSecurityQuestions(final RequestContext requestContext, final List<String> value) {
val flowScope = requestContext.getFlowScope();
flowScope.put("questions", value);
} | [
"public",
"void",
"putPasswordResetSecurityQuestions",
"(",
"final",
"RequestContext",
"requestContext",
",",
"final",
"List",
"<",
"String",
">",
"value",
")",
"{",
"val",
"flowScope",
"=",
"requestContext",
".",
"getFlowScope",
"(",
")",
";",
"flowScope",
".",
... | Put password reset security questions.
@param requestContext the request context
@param value the value | [
"Put",
"password",
"reset",
"security",
"questions",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-pm-webflow/src/main/java/org/apereo/cas/pm/web/flow/PasswordManagementWebflowUtils.java#L46-L49 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheSetUtil.java | CacheSetUtil.values | public static <T> Single<Set<T>> values(String key, Class<T> vClazz) {
"""
retrial the cached set
@param key key
@param vClazz value class
@param <T> generic type
@return the value set
"""
return values(CacheService.CACHE_CONFIG_BEAN, key, vClazz);
} | java | public static <T> Single<Set<T>> values(String key, Class<T> vClazz) {
return values(CacheService.CACHE_CONFIG_BEAN, key, vClazz);
} | [
"public",
"static",
"<",
"T",
">",
"Single",
"<",
"Set",
"<",
"T",
">",
">",
"values",
"(",
"String",
"key",
",",
"Class",
"<",
"T",
">",
"vClazz",
")",
"{",
"return",
"values",
"(",
"CacheService",
".",
"CACHE_CONFIG_BEAN",
",",
"key",
",",
"vClazz"... | retrial the cached set
@param key key
@param vClazz value class
@param <T> generic type
@return the value set | [
"retrial",
"the",
"cached",
"set"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheSetUtil.java#L144-L146 |
ben-manes/caffeine | jcache/src/main/java/com/github/benmanes/caffeine/jcache/CacheProxy.java | CacheProxy.publishToCacheWriter | private <T> void publishToCacheWriter(Consumer<T> action, Supplier<T> data) {
"""
Performs the action with the cache writer if write-through is enabled.
"""
if (!configuration.isWriteThrough()) {
return;
}
try {
action.accept(data.get());
} catch (CacheWriterException e) {
thr... | java | private <T> void publishToCacheWriter(Consumer<T> action, Supplier<T> data) {
if (!configuration.isWriteThrough()) {
return;
}
try {
action.accept(data.get());
} catch (CacheWriterException e) {
throw e;
} catch (RuntimeException e) {
throw new CacheWriterException("Exception... | [
"private",
"<",
"T",
">",
"void",
"publishToCacheWriter",
"(",
"Consumer",
"<",
"T",
">",
"action",
",",
"Supplier",
"<",
"T",
">",
"data",
")",
"{",
"if",
"(",
"!",
"configuration",
".",
"isWriteThrough",
"(",
")",
")",
"{",
"return",
";",
"}",
"try... | Performs the action with the cache writer if write-through is enabled. | [
"Performs",
"the",
"action",
"with",
"the",
"cache",
"writer",
"if",
"write",
"-",
"through",
"is",
"enabled",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/jcache/src/main/java/com/github/benmanes/caffeine/jcache/CacheProxy.java#L994-L1005 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateZipCode | public static <T extends CharSequence> T validateZipCode(T value, String errorMsg) throws ValidateException {
"""
验证是否为邮政编码(中国)
@param <T> 字符串类型
@param value 表单值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
"""
if (false == isZipCode(value)) {
throw new ValidateException(e... | java | public static <T extends CharSequence> T validateZipCode(T value, String errorMsg) throws ValidateException {
if (false == isZipCode(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validateZipCode",
"(",
"T",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isZipCode",
"(",
"value",
")",
")",
"{",
"throw",
"new",... | 验证是否为邮政编码(中国)
@param <T> 字符串类型
@param value 表单值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常 | [
"验证是否为邮政编码(中国)"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L625-L630 |
SpartaTech/sparta-spring-web-utils | src/main/java/org/sparta/springwebutils/util/ExternalEntryPointHelper.java | ExternalEntryPointHelper.getInternalEntryPointParametersRecursively | public static List<EntryPointParameter> getInternalEntryPointParametersRecursively(Class<?> parameterType, Set<Class<?>> typeBlacklist, Set<String> nameBlacklist, int maxDeepLevel) {
"""
Deeply finds all the attributes of the supplied class
@param parameterType Type of parameter
@param typeBlacklist blackList ... | java | public static List<EntryPointParameter> getInternalEntryPointParametersRecursively(Class<?> parameterType, Set<Class<?>> typeBlacklist, Set<String> nameBlacklist, int maxDeepLevel) {
return getInternalEntryPointParametersRecursively(parameterType, typeBlacklist, nameBlacklist, null, 1, maxDeepLevel);
} | [
"public",
"static",
"List",
"<",
"EntryPointParameter",
">",
"getInternalEntryPointParametersRecursively",
"(",
"Class",
"<",
"?",
">",
"parameterType",
",",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"typeBlacklist",
",",
"Set",
"<",
"String",
">",
"nameBlacklist... | Deeply finds all the attributes of the supplied class
@param parameterType Type of parameter
@param typeBlacklist blackList by type
@param nameBlacklist blackList by name
@param maxDeepLevel How deep should algorithm go in the object
@return List | [
"Deeply",
"finds",
"all",
"the",
"attributes",
"of",
"the",
"supplied",
"class"
] | train | https://github.com/SpartaTech/sparta-spring-web-utils/blob/f5382474d46a6048d58707fc64e7936277e8b2ce/src/main/java/org/sparta/springwebutils/util/ExternalEntryPointHelper.java#L53-L55 |
alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/utils/GravityUtils.java | GravityUtils.getImagePosition | public static void getImagePosition(State state, Settings settings, Rect out) {
"""
Calculates image position (scaled and rotated) within viewport area with gravity applied.
@param state Image state
@param settings Image settings
@param out Output rectangle
"""
state.get(tmpMatrix);
getIma... | java | public static void getImagePosition(State state, Settings settings, Rect out) {
state.get(tmpMatrix);
getImagePosition(tmpMatrix, settings, out);
} | [
"public",
"static",
"void",
"getImagePosition",
"(",
"State",
"state",
",",
"Settings",
"settings",
",",
"Rect",
"out",
")",
"{",
"state",
".",
"get",
"(",
"tmpMatrix",
")",
";",
"getImagePosition",
"(",
"tmpMatrix",
",",
"settings",
",",
"out",
")",
";",
... | Calculates image position (scaled and rotated) within viewport area with gravity applied.
@param state Image state
@param settings Image settings
@param out Output rectangle | [
"Calculates",
"image",
"position",
"(",
"scaled",
"and",
"rotated",
")",
"within",
"viewport",
"area",
"with",
"gravity",
"applied",
"."
] | train | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/utils/GravityUtils.java#L30-L33 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java | UTF16.countCodePoint | public static int countCodePoint(String source) {
"""
Number of codepoints in a UTF16 String
@param source UTF16 string
@return number of codepoint in string
"""
if (source == null || source.length() == 0) {
return 0;
}
return findCodePointOffset(source, source.length())... | java | public static int countCodePoint(String source) {
if (source == null || source.length() == 0) {
return 0;
}
return findCodePointOffset(source, source.length());
} | [
"public",
"static",
"int",
"countCodePoint",
"(",
"String",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
"||",
"source",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"return",
"findCodePointOffset",
"(",
"source",
",... | Number of codepoints in a UTF16 String
@param source UTF16 string
@return number of codepoint in string | [
"Number",
"of",
"codepoints",
"in",
"a",
"UTF16",
"String"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L1038-L1043 |
Azure/azure-sdk-for-java | privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesInner.java | PrivateZonesInner.beginUpdateAsync | public Observable<PrivateZoneInner> beginUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch) {
"""
Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone.
@param resourceGroupName The name of the resource group.
@p... | java | public Observable<PrivateZoneInner> beginUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch).map(new Func1<ServiceResponse<PrivateZoneInner>, PrivateZoneIn... | [
"public",
"Observable",
"<",
"PrivateZoneInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"privateZoneName",
",",
"PrivateZoneInner",
"parameters",
",",
"String",
"ifMatch",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",... | Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone.
@param resourceGroupName The name of the resource group.
@param privateZoneName The name of the Private DNS zone (without a terminating dot).
@param parameters Parameters supplied to the Update operation.
@param ifMatch T... | [
"Updates",
"a",
"Private",
"DNS",
"zone",
".",
"Does",
"not",
"modify",
"virtual",
"network",
"links",
"or",
"DNS",
"records",
"within",
"the",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesInner.java#L757-L764 |
apptik/jus | benchmark/src/perf/java/com/android/volley/toolbox/HurlStack.java | HurlStack.hasResponseBody | private static boolean hasResponseBody(int requestMethod, int responseCode) {
"""
Checks if a response message contains a body.
@see <a href="https://tools.ietf.org/html/rfc7230#section-3.3">RFC 7230 section 3.3</a>
@param requestMethod request method
@param responseCode response status code
@return whether th... | java | private static boolean hasResponseBody(int requestMethod, int responseCode) {
return requestMethod != Request.Method.HEAD
&& !(HttpStatus.SC_CONTINUE <= responseCode && responseCode < HttpStatus.SC_OK)
&& responseCode != HttpStatus.SC_NO_CONTENT
&& responseCode != HttpStatus.... | [
"private",
"static",
"boolean",
"hasResponseBody",
"(",
"int",
"requestMethod",
",",
"int",
"responseCode",
")",
"{",
"return",
"requestMethod",
"!=",
"Request",
".",
"Method",
".",
"HEAD",
"&&",
"!",
"(",
"HttpStatus",
".",
"SC_CONTINUE",
"<=",
"responseCode",
... | Checks if a response message contains a body.
@see <a href="https://tools.ietf.org/html/rfc7230#section-3.3">RFC 7230 section 3.3</a>
@param requestMethod request method
@param responseCode response status code
@return whether the response has a body | [
"Checks",
"if",
"a",
"response",
"message",
"contains",
"a",
"body",
"."
] | train | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/benchmark/src/perf/java/com/android/volley/toolbox/HurlStack.java#L138-L143 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java | Hdf5Archive.readDataSet | public INDArray readDataSet(String datasetName, String... groups) throws UnsupportedKerasConfigurationException {
"""
Read data set as ND4J array from group path.
@param datasetName Name of data set
@param groups Array of zero or more ancestor groups from root to parent.
@return INDArray of HDF5 group da... | java | public INDArray readDataSet(String datasetName, String... groups) throws UnsupportedKerasConfigurationException {
synchronized (Hdf5Archive.LOCK_OBJECT) {
if (groups.length == 0)
return readDataSet(this.file, datasetName);
Group[] groupArray = openGroups(groups);
... | [
"public",
"INDArray",
"readDataSet",
"(",
"String",
"datasetName",
",",
"String",
"...",
"groups",
")",
"throws",
"UnsupportedKerasConfigurationException",
"{",
"synchronized",
"(",
"Hdf5Archive",
".",
"LOCK_OBJECT",
")",
"{",
"if",
"(",
"groups",
".",
"length",
"... | Read data set as ND4J array from group path.
@param datasetName Name of data set
@param groups Array of zero or more ancestor groups from root to parent.
@return INDArray of HDF5 group data
@throws UnsupportedKerasConfigurationException Unsupported Keras config | [
"Read",
"data",
"set",
"as",
"ND4J",
"array",
"from",
"group",
"path",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java#L107-L116 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldRegionTracker.java | TldRegionTracker.declareDataStructures | protected void declareDataStructures(PyramidDiscrete<I> image) {
"""
Declares internal data structures based on the input image pyramid
"""
numPyramidLayers = image.getNumLayers();
previousDerivX = (D[])Array.newInstance(derivType,image.getNumLayers());
previousDerivY = (D[])Array.newInstance(derivType,... | java | protected void declareDataStructures(PyramidDiscrete<I> image) {
numPyramidLayers = image.getNumLayers();
previousDerivX = (D[])Array.newInstance(derivType,image.getNumLayers());
previousDerivY = (D[])Array.newInstance(derivType,image.getNumLayers());
currentDerivX = (D[])Array.newInstance(derivType,image.getN... | [
"protected",
"void",
"declareDataStructures",
"(",
"PyramidDiscrete",
"<",
"I",
">",
"image",
")",
"{",
"numPyramidLayers",
"=",
"image",
".",
"getNumLayers",
"(",
")",
";",
"previousDerivX",
"=",
"(",
"D",
"[",
"]",
")",
"Array",
".",
"newInstance",
"(",
... | Declares internal data structures based on the input image pyramid | [
"Declares",
"internal",
"data",
"structures",
"based",
"on",
"the",
"input",
"image",
"pyramid"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldRegionTracker.java#L140-L167 |
banq/jdonframework | JdonAccessory/jdon-struts1x/src/main/java/com/jdon/servicelocator/ejb/ServiceLocator.java | ServiceLocator.getRemoteHome | public EJBHome getRemoteHome(String jndiHomeName, Class className) throws ServiceLocatorException {
"""
will get the ejb Remote home factory. clients need to cast to the type of
EJBHome they desire
@return the EJB Home corresponding to the homeName
"""
EJBHome home = null;
try {
Object objref = i... | java | public EJBHome getRemoteHome(String jndiHomeName, Class className) throws ServiceLocatorException {
EJBHome home = null;
try {
Object objref = ic.lookup(jndiHomeName);
Object obj = PortableRemoteObject.narrow(objref, className);
home = (EJBHome) obj;
} catch (NamingException ne) {
throw new Ser... | [
"public",
"EJBHome",
"getRemoteHome",
"(",
"String",
"jndiHomeName",
",",
"Class",
"className",
")",
"throws",
"ServiceLocatorException",
"{",
"EJBHome",
"home",
"=",
"null",
";",
"try",
"{",
"Object",
"objref",
"=",
"ic",
".",
"lookup",
"(",
"jndiHomeName",
"... | will get the ejb Remote home factory. clients need to cast to the type of
EJBHome they desire
@return the EJB Home corresponding to the homeName | [
"will",
"get",
"the",
"ejb",
"Remote",
"home",
"factory",
".",
"clients",
"need",
"to",
"cast",
"to",
"the",
"type",
"of",
"EJBHome",
"they",
"desire"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-struts1x/src/main/java/com/jdon/servicelocator/ejb/ServiceLocator.java#L63-L75 |
google/closure-compiler | src/com/google/javascript/jscomp/JsIterables.java | JsIterables.getElementType | static final JSType getElementType(JSType iterableOrIterator, JSTypeRegistry typeRegistry) {
"""
Returns the given `Iterable`s element type.
<p>If the given type is not an `Iterator`, `Iterable`, `AsyncIterator`, or `AsyncIterable`,
returns the unknown type.
"""
TemplateTypeMap templateTypeMap =
... | java | static final JSType getElementType(JSType iterableOrIterator, JSTypeRegistry typeRegistry) {
TemplateTypeMap templateTypeMap =
iterableOrIterator
// Remember that `string` will box to a `Iterable`.
.autobox()
.getTemplateTypeMap();
if (templateTypeMap.hasTemplateKey(... | [
"static",
"final",
"JSType",
"getElementType",
"(",
"JSType",
"iterableOrIterator",
",",
"JSTypeRegistry",
"typeRegistry",
")",
"{",
"TemplateTypeMap",
"templateTypeMap",
"=",
"iterableOrIterator",
"// Remember that `string` will box to a `Iterable`.",
".",
"autobox",
"(",
")... | Returns the given `Iterable`s element type.
<p>If the given type is not an `Iterator`, `Iterable`, `AsyncIterator`, or `AsyncIterable`,
returns the unknown type. | [
"Returns",
"the",
"given",
"Iterable",
"s",
"element",
"type",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JsIterables.java#L43-L64 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.setOrtho2D | public Matrix4x3f setOrtho2D(float left, float right, float bottom, float top) {
"""
Set this matrix to be an orthographic projection transformation for a right-handed coordinate system.
<p>
This method is equivalent to calling {@link #setOrtho(float, float, float, float, float, float) setOrtho()} with
<code>zN... | java | public Matrix4x3f setOrtho2D(float left, float right, float bottom, float top) {
MemUtil.INSTANCE.identity(this);
m00 = 2.0f / (right - left);
m11 = 2.0f / (top - bottom);
m22 = -1.0f;
m30 = -(right + left) / (right - left);
m31 = -(top + bottom) / (top - bottom);
... | [
"public",
"Matrix4x3f",
"setOrtho2D",
"(",
"float",
"left",
",",
"float",
"right",
",",
"float",
"bottom",
",",
"float",
"top",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"identity",
"(",
"this",
")",
";",
"m00",
"=",
"2.0f",
"/",
"(",
"right",
"-",
... | Set this matrix to be an orthographic projection transformation for a right-handed coordinate system.
<p>
This method is equivalent to calling {@link #setOrtho(float, float, float, float, float, float) setOrtho()} with
<code>zNear=-1</code> and <code>zFar=+1</code>.
<p>
In order to apply the orthographic projection to ... | [
"Set",
"this",
"matrix",
"to",
"be",
"an",
"orthographic",
"projection",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
".",
"<p",
">",
"This",
"method",
"is",
"equivalent",
"to",
"calling",
"{",
"@link",
"#setOrtho",
"(",
"flo... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L5857-L5866 |
leadware/jpersistence-tools | jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/validator/jsr303ext/engine/JSR303ValidatorEngine.java | JSR303ValidatorEngine.validate | public <T> void validate(T entity) {
"""
Methode permettant de valider un onjet
@param entity Entité valider
@param <T> Type de l'entite
"""
// Obtention de l'ensemble des violations
Set<ConstraintViolation<T>> constraintViolations = validator.validate(entity);
// Si l'ensemble est vide
... | java | public <T> void validate(T entity) {
// Obtention de l'ensemble des violations
Set<ConstraintViolation<T>> constraintViolations = validator.validate(entity);
// Si l'ensemble est vide
if(constraintViolations == null || constraintViolations.size() == 0) return;
// Obtention de la première violat... | [
"public",
"<",
"T",
">",
"void",
"validate",
"(",
"T",
"entity",
")",
"{",
"// Obtention de l'ensemble des violations\r",
"Set",
"<",
"ConstraintViolation",
"<",
"T",
">>",
"constraintViolations",
"=",
"validator",
".",
"validate",
"(",
"entity",
")",
";",
"// S... | Methode permettant de valider un onjet
@param entity Entité valider
@param <T> Type de l'entite | [
"Methode",
"permettant",
"de",
"valider",
"un",
"onjet"
] | train | https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/validator/jsr303ext/engine/JSR303ValidatorEngine.java#L115-L143 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java | MassToFormulaTool.returnOrdered | private IMolecularFormulaSet returnOrdered(double mass, IMolecularFormulaSet formulaSet) {
"""
Return all molecular formulas but ordered according the tolerance difference between masses.
@param mass The mass to analyze
@param formulaSet The IMolecularFormulaSet to order
@return The IMol... | java | private IMolecularFormulaSet returnOrdered(double mass, IMolecularFormulaSet formulaSet) {
IMolecularFormulaSet solutions_new = null;
if (formulaSet.size() != 0) {
double valueMin = 100;
int i_final = 0;
solutions_new = formulaSet.getBuilder().newInstance(IMolecular... | [
"private",
"IMolecularFormulaSet",
"returnOrdered",
"(",
"double",
"mass",
",",
"IMolecularFormulaSet",
"formulaSet",
")",
"{",
"IMolecularFormulaSet",
"solutions_new",
"=",
"null",
";",
"if",
"(",
"formulaSet",
".",
"size",
"(",
")",
"!=",
"0",
")",
"{",
"doubl... | Return all molecular formulas but ordered according the tolerance difference between masses.
@param mass The mass to analyze
@param formulaSet The IMolecularFormulaSet to order
@return The IMolecularFormulaSet ordered | [
"Return",
"all",
"molecular",
"formulas",
"but",
"ordered",
"according",
"the",
"tolerance",
"difference",
"between",
"masses",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java#L545-L573 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.deleteResource | public void deleteResource(CmsResource res, CmsResourceDeleteMode deletePreserveSiblings) throws CmsException {
"""
Deletes a resource.<p>
The <code>siblingMode</code> parameter controls how to handle siblings
during the delete operation.<br>
Possible values for this parameter are: <br>
<ul>
<li><code>{@lin... | java | public void deleteResource(CmsResource res, CmsResourceDeleteMode deletePreserveSiblings) throws CmsException {
getResourceType(res).deleteResource(this, m_securityManager, res, deletePreserveSiblings);
} | [
"public",
"void",
"deleteResource",
"(",
"CmsResource",
"res",
",",
"CmsResourceDeleteMode",
"deletePreserveSiblings",
")",
"throws",
"CmsException",
"{",
"getResourceType",
"(",
"res",
")",
".",
"deleteResource",
"(",
"this",
",",
"m_securityManager",
",",
"res",
"... | Deletes a resource.<p>
The <code>siblingMode</code> parameter controls how to handle siblings
during the delete operation.<br>
Possible values for this parameter are: <br>
<ul>
<li><code>{@link CmsResource#DELETE_REMOVE_SIBLINGS}</code></li>
<li><code>{@link CmsResource#DELETE_PRESERVE_SIBLINGS}</code></li>
</ul><p>
... | [
"Deletes",
"a",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1042-L1045 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/proxy/transport/AjaxProxyTask.java | AjaxProxyTask.doProcess | public void doProcess(BasicServlet servlet, HttpServletRequest req, HttpServletResponse res, PrintWriter out)
throws ServletException, IOException {
"""
Process an HTML get or post.
@exception ServletException From inherited class.
@exception IOException From inherited class.
"""
super.doPro... | java | public void doProcess(BasicServlet servlet, HttpServletRequest req, HttpServletResponse res, PrintWriter out)
throws ServletException, IOException
{
super.doProcess(servlet, req, res, out);
} | [
"public",
"void",
"doProcess",
"(",
"BasicServlet",
"servlet",
",",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
",",
"PrintWriter",
"out",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"super",
".",
"doProcess",
"(",
"servlet",
",... | Process an HTML get or post.
@exception ServletException From inherited class.
@exception IOException From inherited class. | [
"Process",
"an",
"HTML",
"get",
"or",
"post",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/proxy/transport/AjaxProxyTask.java#L297-L301 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/style/TableCellStyleBuilder.java | TableCellStyleBuilder.borderBottom | public TableCellStyleBuilder borderBottom(final Length size, final Color borderColor,
final BorderAttribute.Style style) {
"""
Add a border style for the bottom border of this cell.
@param size the size of the line
@param borderColor the color to be used in ... | java | public TableCellStyleBuilder borderBottom(final Length size, final Color borderColor,
final BorderAttribute.Style style) {
final BorderAttribute bs = new BorderAttribute(size, borderColor, style);
this.bordersBuilder.bottom(bs);
return this;
} | [
"public",
"TableCellStyleBuilder",
"borderBottom",
"(",
"final",
"Length",
"size",
",",
"final",
"Color",
"borderColor",
",",
"final",
"BorderAttribute",
".",
"Style",
"style",
")",
"{",
"final",
"BorderAttribute",
"bs",
"=",
"new",
"BorderAttribute",
"(",
"size",... | Add a border style for the bottom border of this cell.
@param size the size of the line
@param borderColor the color to be used in format #rrggbb e.g. '#ff0000' for a red border
@param style the style of the border line, either BorderAttribute.BORDER_SOLID or BorderAttribute.BORDER_DOUBLE
@return this for... | [
"Add",
"a",
"border",
"style",
"for",
"the",
"bottom",
"border",
"of",
"this",
"cell",
"."
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/style/TableCellStyleBuilder.java#L113-L118 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/access/DescribeRepositoryServlet.java | DescribeRepositoryServlet.doGet | @Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
"""
<p>
Process Fedora Access Request. Parse and validate the servlet input
parameters and then execute the specified request.
</p>
@param request
The servlet request.... | java | @Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
boolean xml = false;
logger.debug("Got request: {}?{}", request.getRequestURL(),
request.getQueryString());
// Check for xml parameter.
... | [
"@",
"Override",
"public",
"void",
"doGet",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"boolean",
"xml",
"=",
"false",
";",
"logger",
".",
"debug",
"(",
"\"Got request: ... | <p>
Process Fedora Access Request. Parse and validate the servlet input
parameters and then execute the specified request.
</p>
@param request
The servlet request.
@param response
servlet The servlet response.
@throws ServletException
If an error occurs that effects the servlet's basic operation.
@throws IOException
I... | [
"<p",
">",
"Process",
"Fedora",
"Access",
"Request",
".",
"Parse",
"and",
"validate",
"the",
"servlet",
"input",
"parameters",
"and",
"then",
"execute",
"the",
"specified",
"request",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/access/DescribeRepositoryServlet.java#L96-L130 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/memento/MementoUtils.java | MementoUtils.addOrigHeader | public static void addOrigHeader(HttpServletResponse response, String url) {
"""
Add {@code Link} header with just {@code original} relation link
{@code url}.
@param response
@param url
"""
response.setHeader(LINK, makeLink(url, ORIGINAL));
} | java | public static void addOrigHeader(HttpServletResponse response, String url) {
response.setHeader(LINK, makeLink(url, ORIGINAL));
} | [
"public",
"static",
"void",
"addOrigHeader",
"(",
"HttpServletResponse",
"response",
",",
"String",
"url",
")",
"{",
"response",
".",
"setHeader",
"(",
"LINK",
",",
"makeLink",
"(",
"url",
",",
"ORIGINAL",
")",
")",
";",
"}"
] | Add {@code Link} header with just {@code original} relation link
{@code url}.
@param response
@param url | [
"Add",
"{"
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/memento/MementoUtils.java#L236-L238 |
alkacon/opencms-core | src/org/opencms/synchronize/CmsSynchronize.java | CmsSynchronize.writeSyncList | private void writeSyncList() throws CmsException {
"""
Writes the synchronization list of the current sync process to the
server file system. <p>
The file can be found in the synchronization folder
@throws CmsException if something goes wrong
"""
// the sync list file in the server file system
... | java | private void writeSyncList() throws CmsException {
// the sync list file in the server file system
File syncListFile;
syncListFile = new File(m_destinationPathInRfs, SYNCLIST_FILENAME);
// prepare the streams to write the data
FileOutputStream fOut = null;
PrintWriter p... | [
"private",
"void",
"writeSyncList",
"(",
")",
"throws",
"CmsException",
"{",
"// the sync list file in the server file system",
"File",
"syncListFile",
";",
"syncListFile",
"=",
"new",
"File",
"(",
"m_destinationPathInRfs",
",",
"SYNCLIST_FILENAME",
")",
";",
"// prepare ... | Writes the synchronization list of the current sync process to the
server file system. <p>
The file can be found in the synchronization folder
@throws CmsException if something goes wrong | [
"Writes",
"the",
"synchronization",
"list",
"of",
"the",
"current",
"sync",
"process",
"to",
"the",
"server",
"file",
"system",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/synchronize/CmsSynchronize.java#L1054-L1094 |
alkacon/opencms-core | src/org/opencms/file/collectors/A_CmsResourceCollector.java | A_CmsResourceCollector.shrinkToFit | protected List<CmsResource> shrinkToFit(List<CmsResource> result, int maxSize, int explicitNumResults) {
"""
Shrinks a List to fit a maximum size.<p>
@param result a List
@param maxSize the maximum size of the List
@param explicitNumResults the value of the numResults parameter given to the getResults method ... | java | protected List<CmsResource> shrinkToFit(List<CmsResource> result, int maxSize, int explicitNumResults) {
return shrinkToFit(result, explicitNumResults > 0 ? explicitNumResults : maxSize);
} | [
"protected",
"List",
"<",
"CmsResource",
">",
"shrinkToFit",
"(",
"List",
"<",
"CmsResource",
">",
"result",
",",
"int",
"maxSize",
",",
"int",
"explicitNumResults",
")",
"{",
"return",
"shrinkToFit",
"(",
"result",
",",
"explicitNumResults",
">",
"0",
"?",
... | Shrinks a List to fit a maximum size.<p>
@param result a List
@param maxSize the maximum size of the List
@param explicitNumResults the value of the numResults parameter given to the getResults method (this overrides maxSize if it is positive)
@return the reduced list | [
"Shrinks",
"a",
"List",
"to",
"fit",
"a",
"maximum",
"size",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/collectors/A_CmsResourceCollector.java#L430-L433 |
square/jna-gmp | jnagmp/src/main/java/com/squareup/jnagmp/Gmp.java | Gmp.getPeer | private mpz_t getPeer(BigInteger value, mpz_t sharedPeer) {
"""
If {@code value} is a {@link GmpInteger}, return its peer. Otherwise, import {@code value} into
{@code sharedPeer} and return {@code sharedPeer}.
"""
if (value instanceof GmpInteger) {
return ((GmpInteger) value).getPeer();
}
mp... | java | private mpz_t getPeer(BigInteger value, mpz_t sharedPeer) {
if (value instanceof GmpInteger) {
return ((GmpInteger) value).getPeer();
}
mpzImport(sharedPeer, value.signum(), value.abs().toByteArray());
return sharedPeer;
} | [
"private",
"mpz_t",
"getPeer",
"(",
"BigInteger",
"value",
",",
"mpz_t",
"sharedPeer",
")",
"{",
"if",
"(",
"value",
"instanceof",
"GmpInteger",
")",
"{",
"return",
"(",
"(",
"GmpInteger",
")",
"value",
")",
".",
"getPeer",
"(",
")",
";",
"}",
"mpzImport... | If {@code value} is a {@link GmpInteger}, return its peer. Otherwise, import {@code value} into
{@code sharedPeer} and return {@code sharedPeer}. | [
"If",
"{"
] | train | https://github.com/square/jna-gmp/blob/192d26d97d6773bc3c68ccfa97450f4257d54838/jnagmp/src/main/java/com/squareup/jnagmp/Gmp.java#L335-L341 |
liferay/com-liferay-commerce | commerce-user-segment-api/src/main/java/com/liferay/commerce/user/segment/service/persistence/CommerceUserSegmentEntryUtil.java | CommerceUserSegmentEntryUtil.removeByG_K | public static CommerceUserSegmentEntry removeByG_K(long groupId, String key)
throws com.liferay.commerce.user.segment.exception.NoSuchUserSegmentEntryException {
"""
Removes the commerce user segment entry where groupId = ? and key = ? from the database.
@param groupId the group ID
@param key the key... | java | public static CommerceUserSegmentEntry removeByG_K(long groupId, String key)
throws com.liferay.commerce.user.segment.exception.NoSuchUserSegmentEntryException {
return getPersistence().removeByG_K(groupId, key);
} | [
"public",
"static",
"CommerceUserSegmentEntry",
"removeByG_K",
"(",
"long",
"groupId",
",",
"String",
"key",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"user",
".",
"segment",
".",
"exception",
".",
"NoSuchUserSegmentEntryException",
"{",
"return"... | Removes the commerce user segment entry where groupId = ? and key = ? from the database.
@param groupId the group ID
@param key the key
@return the commerce user segment entry that was removed | [
"Removes",
"the",
"commerce",
"user",
"segment",
"entry",
"where",
"groupId",
"=",
"?",
";",
"and",
"key",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-user-segment-api/src/main/java/com/liferay/commerce/user/segment/service/persistence/CommerceUserSegmentEntryUtil.java#L397-L400 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/metadata/WebServiceRefInfo.java | WebServiceRefInfo.addWebServiceFeatureInfo | public void addWebServiceFeatureInfo(String seiName, WebServiceFeatureInfo featureInfo) {
"""
Add a feature info to the PortComponentRefInfo, if the target one does not exist, a new one with
that port component interface will be created
@param seiName port component interface name
@param featureInfo feature i... | java | public void addWebServiceFeatureInfo(String seiName, WebServiceFeatureInfo featureInfo) {
PortComponentRefInfo portComponentRefInfo = seiNamePortComponentRefInfoMap.get(seiName);
if (portComponentRefInfo == null) {
portComponentRefInfo = new PortComponentRefInfo(seiName);
seiName... | [
"public",
"void",
"addWebServiceFeatureInfo",
"(",
"String",
"seiName",
",",
"WebServiceFeatureInfo",
"featureInfo",
")",
"{",
"PortComponentRefInfo",
"portComponentRefInfo",
"=",
"seiNamePortComponentRefInfoMap",
".",
"get",
"(",
"seiName",
")",
";",
"if",
"(",
"portCo... | Add a feature info to the PortComponentRefInfo, if the target one does not exist, a new one with
that port component interface will be created
@param seiName port component interface name
@param featureInfo feature info of the target port | [
"Add",
"a",
"feature",
"info",
"to",
"the",
"PortComponentRefInfo",
"if",
"the",
"target",
"one",
"does",
"not",
"exist",
"a",
"new",
"one",
"with",
"that",
"port",
"component",
"interface",
"will",
"be",
"created"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/metadata/WebServiceRefInfo.java#L197-L204 |
before/quality-check | modules/quality-immutable-object/src/main/java/net/sf/qualitycheck/immutableobject/util/MethodUtil.java | MethodUtil.determineAccessorName | public static String determineAccessorName(@Nonnull final AccessorPrefix prefix, @Nonnull final String fieldName) {
"""
Determines the accessor method name based on a field name.
@param fieldName
a field name
@return the resulting method name
"""
Check.notNull(prefix, "prefix");
Check.notEmpty(fieldNa... | java | public static String determineAccessorName(@Nonnull final AccessorPrefix prefix, @Nonnull final String fieldName) {
Check.notNull(prefix, "prefix");
Check.notEmpty(fieldName, "fieldName");
final Matcher m = PATTERN.matcher(fieldName);
Check.stateIsTrue(m.find(), "passed field name '%s' is not applicable", field... | [
"public",
"static",
"String",
"determineAccessorName",
"(",
"@",
"Nonnull",
"final",
"AccessorPrefix",
"prefix",
",",
"@",
"Nonnull",
"final",
"String",
"fieldName",
")",
"{",
"Check",
".",
"notNull",
"(",
"prefix",
",",
"\"prefix\"",
")",
";",
"Check",
".",
... | Determines the accessor method name based on a field name.
@param fieldName
a field name
@return the resulting method name | [
"Determines",
"the",
"accessor",
"method",
"name",
"based",
"on",
"a",
"field",
"name",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-immutable-object/src/main/java/net/sf/qualitycheck/immutableobject/util/MethodUtil.java#L41-L48 |
fuzzylite/jfuzzylite | jfuzzylite/src/main/java/com/fuzzylite/Op.java | Op.isEq | public static boolean isEq(double a, double b) {
"""
Returns whether `a` is equal to `b` at the default tolerance
@param a
@param b
@return whether `a` is equal to `b` at the default tolerance
"""
return a == b || Math.abs(a - b) < FuzzyLite.macheps || (Double.isNaN(a) && Double.isNaN(b));
} | java | public static boolean isEq(double a, double b) {
return a == b || Math.abs(a - b) < FuzzyLite.macheps || (Double.isNaN(a) && Double.isNaN(b));
} | [
"public",
"static",
"boolean",
"isEq",
"(",
"double",
"a",
",",
"double",
"b",
")",
"{",
"return",
"a",
"==",
"b",
"||",
"Math",
".",
"abs",
"(",
"a",
"-",
"b",
")",
"<",
"FuzzyLite",
".",
"macheps",
"||",
"(",
"Double",
".",
"isNaN",
"(",
"a",
... | Returns whether `a` is equal to `b` at the default tolerance
@param a
@param b
@return whether `a` is equal to `b` at the default tolerance | [
"Returns",
"whether",
"a",
"is",
"equal",
"to",
"b",
"at",
"the",
"default",
"tolerance"
] | train | https://github.com/fuzzylite/jfuzzylite/blob/583ac1928f39512af75de80d560e67448039595a/jfuzzylite/src/main/java/com/fuzzylite/Op.java#L146-L148 |
RestComm/media-core | spi/src/main/java/org/restcomm/media/core/spi/format/FormatFactory.java | FormatFactory.createAudioFormat | public static AudioFormat createAudioFormat(String name, int sampleRate) {
"""
Creates new format descriptor
@param name the encoding
@param sampleRate sample rate value in Hertz
"""
AudioFormat fmt = createAudioFormat(new EncodingName(name));
fmt.setSampleRate(sampleRate);
return f... | java | public static AudioFormat createAudioFormat(String name, int sampleRate) {
AudioFormat fmt = createAudioFormat(new EncodingName(name));
fmt.setSampleRate(sampleRate);
return fmt;
} | [
"public",
"static",
"AudioFormat",
"createAudioFormat",
"(",
"String",
"name",
",",
"int",
"sampleRate",
")",
"{",
"AudioFormat",
"fmt",
"=",
"createAudioFormat",
"(",
"new",
"EncodingName",
"(",
"name",
")",
")",
";",
"fmt",
".",
"setSampleRate",
"(",
"sample... | Creates new format descriptor
@param name the encoding
@param sampleRate sample rate value in Hertz | [
"Creates",
"new",
"format",
"descriptor"
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/format/FormatFactory.java#L89-L93 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.mapToByte | public static <T, E extends Exception> ByteList mapToByte(final T[] a, final int fromIndex, final int toIndex, final Try.ToByteFunction<? super T, E> func)
throws E {
"""
Mostly it's designed for one-step operation to complete the operation in one step.
<code>java.util.stream.Stream</code> is preferr... | java | public static <T, E extends Exception> ByteList mapToByte(final T[] a, final int fromIndex, final int toIndex, final Try.ToByteFunction<? super T, E> func)
throws E {
checkFromToIndex(fromIndex, toIndex, len(a));
N.checkArgNotNull(func);
if (N.isNullOrEmpty(a)) {
r... | [
"public",
"static",
"<",
"T",
",",
"E",
"extends",
"Exception",
">",
"ByteList",
"mapToByte",
"(",
"final",
"T",
"[",
"]",
"a",
",",
"final",
"int",
"fromIndex",
",",
"final",
"int",
"toIndex",
",",
"final",
"Try",
".",
"ToByteFunction",
"<",
"?",
"sup... | Mostly it's designed for one-step operation to complete the operation in one step.
<code>java.util.stream.Stream</code> is preferred for multiple phases operation.
@param a
@param fromIndex
@param toIndex
@param func
@return | [
"Mostly",
"it",
"s",
"designed",
"for",
"one",
"-",
"step",
"operation",
"to",
"complete",
"the",
"operation",
"in",
"one",
"step",
".",
"<code",
">",
"java",
".",
"util",
".",
"stream",
".",
"Stream<",
"/",
"code",
">",
"is",
"preferred",
"for",
"mult... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L14695-L14711 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/CatalogUtil.java | CatalogUtil.extractPassword | private static String extractPassword(String password, ClientAuthScheme scheme) {
"""
Read a hashed password from password.
SHA* hash it once to match what we will get from the wire protocol
and then hex encode it
"""
MessageDigest md = null;
try {
md = MessageDigest.getInstance(C... | java | private static String extractPassword(String password, ClientAuthScheme scheme) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance(ClientAuthScheme.getDigestScheme(scheme));
} catch (final NoSuchAlgorithmException e) {
hostLog.l7dlog(Level.FATAL, LogKeys.comp... | [
"private",
"static",
"String",
"extractPassword",
"(",
"String",
"password",
",",
"ClientAuthScheme",
"scheme",
")",
"{",
"MessageDigest",
"md",
"=",
"null",
";",
"try",
"{",
"md",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"ClientAuthScheme",
".",
"getDiges... | Read a hashed password from password.
SHA* hash it once to match what we will get from the wire protocol
and then hex encode it | [
"Read",
"a",
"hashed",
"password",
"from",
"password",
".",
"SHA",
"*",
"hash",
"it",
"once",
"to",
"match",
"what",
"we",
"will",
"get",
"from",
"the",
"wire",
"protocol",
"and",
"then",
"hex",
"encode",
"it"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/CatalogUtil.java#L2466-L2476 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.xdsl_setting_POST | public void xdsl_setting_POST(Boolean resellerFastModemShipping, Boolean resellerModemBasicConfig) throws IOException {
"""
Change xdsl settings linked to the nichandle
REST: POST /me/xdsl/setting
@param resellerModemBasicConfig [required] Let the modem with vendor configuration. It prevent to apply the config... | java | public void xdsl_setting_POST(Boolean resellerFastModemShipping, Boolean resellerModemBasicConfig) throws IOException {
String qPath = "/me/xdsl/setting";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "resellerFastModemShipping", resellerFastModemShipping);... | [
"public",
"void",
"xdsl_setting_POST",
"(",
"Boolean",
"resellerFastModemShipping",
",",
"Boolean",
"resellerModemBasicConfig",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/xdsl/setting\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")... | Change xdsl settings linked to the nichandle
REST: POST /me/xdsl/setting
@param resellerModemBasicConfig [required] Let the modem with vendor configuration. It prevent to apply the config managed by ovh manager
@param resellerFastModemShipping [required] Send the modem as soon as possible, do not wait the xdsl line to... | [
"Change",
"xdsl",
"settings",
"linked",
"to",
"the",
"nichandle"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2181-L2188 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java | ObjectArrayList.addAllOfFromTo | public void addAllOfFromTo(ObjectArrayList other, int from, int to) {
"""
Appends the part of the specified list between <code>from</code> (inclusive) and <code>to</code> (inclusive) to the receiver.
@param other the list to be added to the receiver.
@param from the index of the first element to be appended (i... | java | public void addAllOfFromTo(ObjectArrayList other, int from, int to) {
beforeInsertAllOfFromTo(size, other, from, to);
} | [
"public",
"void",
"addAllOfFromTo",
"(",
"ObjectArrayList",
"other",
",",
"int",
"from",
",",
"int",
"to",
")",
"{",
"beforeInsertAllOfFromTo",
"(",
"size",
",",
"other",
",",
"from",
",",
"to",
")",
";",
"}"
] | Appends the part of the specified list between <code>from</code> (inclusive) and <code>to</code> (inclusive) to the receiver.
@param other the list to be added to the receiver.
@param from the index of the first element to be appended (inclusive).
@param to the index of the last element to be appended (inclusive).
@ex... | [
"Appends",
"the",
"part",
"of",
"the",
"specified",
"list",
"between",
"<code",
">",
"from<",
"/",
"code",
">",
"(",
"inclusive",
")",
"and",
"<code",
">",
"to<",
"/",
"code",
">",
"(",
"inclusive",
")",
"to",
"the",
"receiver",
"."
] | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java#L73-L75 |
Impetus/Kundera | src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClient.java | MongoDBClient.createIndex | public void createIndex(String collectionName, List<String> columnList, int order) {
"""
Creates the index.
@param collectionName
the collection name
@param columnList
the column list
@param order
the order
"""
DBCollection coll = mongoDb.getCollection(collectionName);
List<DBObject> i... | java | public void createIndex(String collectionName, List<String> columnList, int order)
{
DBCollection coll = mongoDb.getCollection(collectionName);
List<DBObject> indexes = coll.getIndexInfo(); // List of all current
// indexes on collection
Set<String> indexNames = new HashSet<String>(... | [
"public",
"void",
"createIndex",
"(",
"String",
"collectionName",
",",
"List",
"<",
"String",
">",
"columnList",
",",
"int",
"order",
")",
"{",
"DBCollection",
"coll",
"=",
"mongoDb",
".",
"getCollection",
"(",
"collectionName",
")",
";",
"List",
"<",
"DBObj... | Creates the index.
@param collectionName
the collection name
@param columnList
the column list
@param order
the order | [
"Creates",
"the",
"index",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClient.java#L975-L1000 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/interproc/ParameterProperty.java | ParameterProperty.setParamWithProperty | public void setParamWithProperty(int param, boolean hasProperty) {
"""
Set whether or not a parameter might be non-null.
@param param
the parameter index
@param hasProperty
true if the parameter might be non-null, false otherwise
"""
if (param < 0 || param > 31) {
return;
}
... | java | public void setParamWithProperty(int param, boolean hasProperty) {
if (param < 0 || param > 31) {
return;
}
if (hasProperty) {
bits |= (1 << param);
} else {
bits &= ~(1 << param);
}
} | [
"public",
"void",
"setParamWithProperty",
"(",
"int",
"param",
",",
"boolean",
"hasProperty",
")",
"{",
"if",
"(",
"param",
"<",
"0",
"||",
"param",
">",
"31",
")",
"{",
"return",
";",
"}",
"if",
"(",
"hasProperty",
")",
"{",
"bits",
"|=",
"(",
"1",
... | Set whether or not a parameter might be non-null.
@param param
the parameter index
@param hasProperty
true if the parameter might be non-null, false otherwise | [
"Set",
"whether",
"or",
"not",
"a",
"parameter",
"might",
"be",
"non",
"-",
"null",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/interproc/ParameterProperty.java#L129-L138 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java | DataService.sendEmail | @SuppressWarnings("unchecked")
public <T extends IEntity> T sendEmail(T entity, String email) throws FMSException {
"""
Send entity via email using specified address
@param entity
@param email
@param <T>
@return
@throws FMSException
"""
if(!isAvailableToEmail(entity)) {
throw new F... | java | @SuppressWarnings("unchecked")
public <T extends IEntity> T sendEmail(T entity, String email) throws FMSException {
if(!isAvailableToEmail(entity)) {
throw new FMSException("Following entity: " + entity.getClass().getSimpleName() + " cannot be send as email" );
}
IntuitMessage in... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"IEntity",
">",
"T",
"sendEmail",
"(",
"T",
"entity",
",",
"String",
"email",
")",
"throws",
"FMSException",
"{",
"if",
"(",
"!",
"isAvailableToEmail",
"(",
"entity",
")",
"... | Send entity via email using specified address
@param entity
@param email
@param <T>
@return
@throws FMSException | [
"Send",
"entity",
"via",
"email",
"using",
"specified",
"address"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java#L560-L571 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/Label.java | Label.getBounds | protected TerminalSize getBounds(String[] lines, TerminalSize currentBounds) {
"""
Returns the area, in terminal columns and rows, required to fully draw the lines passed in.
@param lines Lines to measure the size of
@param currentBounds Optional (can pass {@code null}) terminal size to use for storing the outpu... | java | protected TerminalSize getBounds(String[] lines, TerminalSize currentBounds) {
if(currentBounds == null) {
currentBounds = TerminalSize.ZERO;
}
currentBounds = currentBounds.withRows(lines.length);
if(labelWidth == null || labelWidth == 0) {
int preferredWidth = 0... | [
"protected",
"TerminalSize",
"getBounds",
"(",
"String",
"[",
"]",
"lines",
",",
"TerminalSize",
"currentBounds",
")",
"{",
"if",
"(",
"currentBounds",
"==",
"null",
")",
"{",
"currentBounds",
"=",
"TerminalSize",
".",
"ZERO",
";",
"}",
"currentBounds",
"=",
... | Returns the area, in terminal columns and rows, required to fully draw the lines passed in.
@param lines Lines to measure the size of
@param currentBounds Optional (can pass {@code null}) terminal size to use for storing the output values. If the
method is called many times and always returning the same value, passing ... | [
"Returns",
"the",
"area",
"in",
"terminal",
"columns",
"and",
"rows",
"required",
"to",
"fully",
"draw",
"the",
"lines",
"passed",
"in",
"."
] | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/Label.java#L110-L130 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/parsers/URLParser.java | URLParser.joinURL | public static String joinURL(Map<URLParts, String> urlParts) {
"""
This method can be used to build a URL from its parts.
@param urlParts
@return
"""
try {
URI uri = new URI(urlParts.get(URLParts.PROTOCOL), urlParts.get(URLParts.AUTHORITY), urlParts.get(URLParts.PATH), urlParts.get(URLP... | java | public static String joinURL(Map<URLParts, String> urlParts) {
try {
URI uri = new URI(urlParts.get(URLParts.PROTOCOL), urlParts.get(URLParts.AUTHORITY), urlParts.get(URLParts.PATH), urlParts.get(URLParts.QUERY), urlParts.get(URLParts.REF));
return uri.toString();
}
catc... | [
"public",
"static",
"String",
"joinURL",
"(",
"Map",
"<",
"URLParts",
",",
"String",
">",
"urlParts",
")",
"{",
"try",
"{",
"URI",
"uri",
"=",
"new",
"URI",
"(",
"urlParts",
".",
"get",
"(",
"URLParts",
".",
"PROTOCOL",
")",
",",
"urlParts",
".",
"ge... | This method can be used to build a URL from its parts.
@param urlParts
@return | [
"This",
"method",
"can",
"be",
"used",
"to",
"build",
"a",
"URL",
"from",
"its",
"parts",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/parsers/URLParser.java#L205-L213 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.scrollListToLine | public void scrollListToLine(int index, int line) {
"""
Scroll a AbsListView matching the specified index to the specified line.
@param index the index of the {@link AbsListView} to scroll
@param line the line to scroll to
"""
if(config.commandLogging){
Log.d(config.commandLoggingTag, "scrollListToLin... | java | public void scrollListToLine(int index, int line){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "scrollListToLine("+index+", "+line+")");
}
scroller.scrollListToLine(waiter.waitForAndGetView(index, AbsListView.class), line);
} | [
"public",
"void",
"scrollListToLine",
"(",
"int",
"index",
",",
"int",
"line",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"scrollListToLine(\"",
"+",
"index",
"+",
"\", \... | Scroll a AbsListView matching the specified index to the specified line.
@param index the index of the {@link AbsListView} to scroll
@param line the line to scroll to | [
"Scroll",
"a",
"AbsListView",
"matching",
"the",
"specified",
"index",
"to",
"the",
"specified",
"line",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L2201-L2207 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.contentEquals | public static boolean contentEquals(Reader input1, Reader input2) throws IORuntimeException {
"""
对比两个Reader的内容是否一致<br>
内部会转换流为 {@link BufferedInputStream}
@param input1 第一个reader
@param input2 第二个reader
@return 两个流的内容一致返回true,否则false
@throws IORuntimeException IO异常
@since 4.0.6
"""
input1 = getRead... | java | public static boolean contentEquals(Reader input1, Reader input2) throws IORuntimeException {
input1 = getReader(input1);
input2 = getReader(input2);
try {
int ch = input1.read();
while (EOF != ch) {
int ch2 = input2.read();
if (ch != ch2) {
return false;
}
ch = input1.read(... | [
"public",
"static",
"boolean",
"contentEquals",
"(",
"Reader",
"input1",
",",
"Reader",
"input2",
")",
"throws",
"IORuntimeException",
"{",
"input1",
"=",
"getReader",
"(",
"input1",
")",
";",
"input2",
"=",
"getReader",
"(",
"input2",
")",
";",
"try",
"{",
... | 对比两个Reader的内容是否一致<br>
内部会转换流为 {@link BufferedInputStream}
@param input1 第一个reader
@param input2 第二个reader
@return 两个流的内容一致返回true,否则false
@throws IORuntimeException IO异常
@since 4.0.6 | [
"对比两个Reader的内容是否一致<br",
">",
"内部会转换流为",
"{",
"@link",
"BufferedInputStream",
"}"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L1057-L1076 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/task/HiveConverterUtils.java | HiveConverterUtils.createStagingDirectory | public static void createStagingDirectory(FileSystem fs, String destination, HiveProcessingEntity conversionEntity,
WorkUnitState workUnit) {
"""
Creates a staging directory with the permission as in source directory.
@param fs filesystem object
@param destination staging directory location
@param convers... | java | public static void createStagingDirectory(FileSystem fs, String destination, HiveProcessingEntity conversionEntity,
WorkUnitState workUnit) {
/*
* Create staging data location with the same permissions as source data location
*
* Note that hive can also automatically create the non-existing dir... | [
"public",
"static",
"void",
"createStagingDirectory",
"(",
"FileSystem",
"fs",
",",
"String",
"destination",
",",
"HiveProcessingEntity",
"conversionEntity",
",",
"WorkUnitState",
"workUnit",
")",
"{",
"/*\n * Create staging data location with the same permissions as source d... | Creates a staging directory with the permission as in source directory.
@param fs filesystem object
@param destination staging directory location
@param conversionEntity conversion entity used to get source directory permissions
@param workUnit workunit | [
"Creates",
"a",
"staging",
"directory",
"with",
"the",
"permission",
"as",
"in",
"source",
"directory",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/task/HiveConverterUtils.java#L294-L333 |
alkacon/opencms-core | src/org/opencms/util/CmsHtml2TextConverter.java | CmsHtml2TextConverter.html2text | public static String html2text(String html, String encoding) throws Exception {
"""
Extracts the text from the given html content, assuming the given html encoding.<p>
@param html the content to extract the plain text from
@param encoding the encoding to use
@return the text extracted from the given html co... | java | public static String html2text(String html, String encoding) throws Exception {
// create the converter instance
CmsHtml2TextConverter visitor = new CmsHtml2TextConverter();
return visitor.process(html, encoding);
} | [
"public",
"static",
"String",
"html2text",
"(",
"String",
"html",
",",
"String",
"encoding",
")",
"throws",
"Exception",
"{",
"// create the converter instance",
"CmsHtml2TextConverter",
"visitor",
"=",
"new",
"CmsHtml2TextConverter",
"(",
")",
";",
"return",
"visitor... | Extracts the text from the given html content, assuming the given html encoding.<p>
@param html the content to extract the plain text from
@param encoding the encoding to use
@return the text extracted from the given html content
@throws Exception if something goes wrong | [
"Extracts",
"the",
"text",
"from",
"the",
"given",
"html",
"content",
"assuming",
"the",
"given",
"html",
"encoding",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsHtml2TextConverter.java#L62-L67 |
jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/mvc/IndentedConfigReaderMapping.java | IndentedConfigReaderMapping.reportError | private static void reportError(List messages, String fileName, int lineNr, String line, String errorMessage) {
"""
Adds a message to the list.
@param fileName
@param lineNr
@param line
@param errorMessage
"""
messages.add(new Date() + " ERROR in \"" + fileName + "\" at line " + lineNr + ':');
messag... | java | private static void reportError(List messages, String fileName, int lineNr, String line, String errorMessage) {
messages.add(new Date() + " ERROR in \"" + fileName + "\" at line " + lineNr + ':');
messages.add(errorMessage);
} | [
"private",
"static",
"void",
"reportError",
"(",
"List",
"messages",
",",
"String",
"fileName",
",",
"int",
"lineNr",
",",
"String",
"line",
",",
"String",
"errorMessage",
")",
"{",
"messages",
".",
"add",
"(",
"new",
"Date",
"(",
")",
"+",
"\" ERROR in \\... | Adds a message to the list.
@param fileName
@param lineNr
@param line
@param errorMessage | [
"Adds",
"a",
"message",
"to",
"the",
"list",
"."
] | train | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/mvc/IndentedConfigReaderMapping.java#L148-L151 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.taskShouldExecute | private boolean taskShouldExecute(Task task, TaskRecord taskRecord) {
"""
and (2) enough time has passed since its last execution that it's time to run.
"""
String taskID = taskRecord.getTaskID();
if (taskRecord.getStatus() == TaskStatus.NEVER_EXECUTED) {
m_logger.debug("Task '{}' h... | java | private boolean taskShouldExecute(Task task, TaskRecord taskRecord) {
String taskID = taskRecord.getTaskID();
if (taskRecord.getStatus() == TaskStatus.NEVER_EXECUTED) {
m_logger.debug("Task '{}' has never executed", taskID);
return true;
}
if (taskRecord.getStatus... | [
"private",
"boolean",
"taskShouldExecute",
"(",
"Task",
"task",
",",
"TaskRecord",
"taskRecord",
")",
"{",
"String",
"taskID",
"=",
"taskRecord",
".",
"getTaskID",
"(",
")",
";",
"if",
"(",
"taskRecord",
".",
"getStatus",
"(",
")",
"==",
"TaskStatus",
".",
... | and (2) enough time has passed since its last execution that it's time to run. | [
"and",
"(",
"2",
")",
"enough",
"time",
"has",
"passed",
"since",
"its",
"last",
"execution",
"that",
"it",
"s",
"time",
"to",
"run",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L364-L388 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/Logger.java | Logger.writeToLog | public synchronized void writeToLog(Session session, String statement) {
"""
Records a Log entry for the specified SQL statement, on behalf of
the specified Session object.
@param session the Session object for which to record the Log
entry
@param statement the SQL statement to Log
@throws HsqlException ... | java | public synchronized void writeToLog(Session session, String statement) {
if (logStatements && log != null) {
log.writeStatement(session, statement);
}
} | [
"public",
"synchronized",
"void",
"writeToLog",
"(",
"Session",
"session",
",",
"String",
"statement",
")",
"{",
"if",
"(",
"logStatements",
"&&",
"log",
"!=",
"null",
")",
"{",
"log",
".",
"writeStatement",
"(",
"session",
",",
"statement",
")",
";",
"}",... | Records a Log entry for the specified SQL statement, on behalf of
the specified Session object.
@param session the Session object for which to record the Log
entry
@param statement the SQL statement to Log
@throws HsqlException if there is a problem recording the entry | [
"Records",
"a",
"Log",
"entry",
"for",
"the",
"specified",
"SQL",
"statement",
"on",
"behalf",
"of",
"the",
"specified",
"Session",
"object",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/Logger.java#L264-L269 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java | CollectionExtensions.removeAll | public static <T> boolean removeAll(Collection<T> collection, Iterable<? extends T> elements) {
"""
Removes all of the specified elements from the specified collection.
@param collection
the collection from which the {@code elements} are to be removed. May not be <code>null</code>.
@param elements
the elemen... | java | public static <T> boolean removeAll(Collection<T> collection, Iterable<? extends T> elements) {
return Iterables.removeAll(collection, newHashSet(elements));
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"removeAll",
"(",
"Collection",
"<",
"T",
">",
"collection",
",",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"elements",
")",
"{",
"return",
"Iterables",
".",
"removeAll",
"(",
"collection",
",",
"newHashSet",
... | Removes all of the specified elements from the specified collection.
@param collection
the collection from which the {@code elements} are to be removed. May not be <code>null</code>.
@param elements
the elements to remove from the {@code collection}. May not be <code>null</code> but may contain
<code>null</code> entri... | [
"Removes",
"all",
"of",
"the",
"specified",
"elements",
"from",
"the",
"specified",
"collection",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java#L316-L318 |
GoogleCloudPlatform/appengine-gcs-client | java/src/main/java/com/google/appengine/tools/cloudstorage/oauth/URLFetchUtils.java | URLFetchUtils.getSingleHeader | static String getSingleHeader(HTTPResponse resp, String headerName) {
"""
Checks that exactly one header named {@code headerName} is present and returns its value.
"""
return Iterables.getOnlyElement(getHeaders(resp, headerName)).getValue();
} | java | static String getSingleHeader(HTTPResponse resp, String headerName) {
return Iterables.getOnlyElement(getHeaders(resp, headerName)).getValue();
} | [
"static",
"String",
"getSingleHeader",
"(",
"HTTPResponse",
"resp",
",",
"String",
"headerName",
")",
"{",
"return",
"Iterables",
".",
"getOnlyElement",
"(",
"getHeaders",
"(",
"resp",
",",
"headerName",
")",
")",
".",
"getValue",
"(",
")",
";",
"}"
] | Checks that exactly one header named {@code headerName} is present and returns its value. | [
"Checks",
"that",
"exactly",
"one",
"header",
"named",
"{"
] | train | https://github.com/GoogleCloudPlatform/appengine-gcs-client/blob/d11078331ecd915d753c886e96a80133599f3f98/java/src/main/java/com/google/appengine/tools/cloudstorage/oauth/URLFetchUtils.java#L180-L182 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMessageFactoryImpl.java | JsMessageFactoryImpl.getClassName | private final static String getClassName(byte[] buffer, int offset, int length) {
"""
Extract the class name from the buffer containing the (first part of) a restored value.
@param buffer The buffer
@param offset The offset of the classname's encoded bytes in the buffer
@param length The length of th... | java | private final static String getClassName(byte[] buffer, int offset, int length) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getClassName", new Object[]{offset, length});
// If the classname has a length of 0 then we've been given rubbish so pack it in now
if (length ... | [
"private",
"final",
"static",
"String",
"getClassName",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
... | Extract the class name from the buffer containing the (first part of) a restored value.
@param buffer The buffer
@param offset The offset of the classname's encoded bytes in the buffer
@param length The length of the classname's encoded bytes
@return String The class name of the message to restore
@exceptio... | [
"Extract",
"the",
"class",
"name",
"from",
"the",
"buffer",
"containing",
"the",
"(",
"first",
"part",
"of",
")",
"a",
"restored",
"value",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMessageFactoryImpl.java#L528-L548 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/Compiler.java | Compiler.compileUnary | private Expression compileUnary(UnaryOperation unary, int opPos)
throws TransformerException {
"""
Bottle-neck compilation of a unary operation.
@param unary The parent unary operation.
@param opPos The position in the op map of the parent operation.
@return The unary argument.
@throws Transfor... | java | private Expression compileUnary(UnaryOperation unary, int opPos)
throws TransformerException
{
int rightPos = getFirstChildPos(opPos);
unary.setRight(compile(rightPos));
return unary;
} | [
"private",
"Expression",
"compileUnary",
"(",
"UnaryOperation",
"unary",
",",
"int",
"opPos",
")",
"throws",
"TransformerException",
"{",
"int",
"rightPos",
"=",
"getFirstChildPos",
"(",
"opPos",
")",
";",
"unary",
".",
"setRight",
"(",
"compile",
"(",
"rightPos... | Bottle-neck compilation of a unary operation.
@param unary The parent unary operation.
@param opPos The position in the op map of the parent operation.
@return The unary argument.
@throws TransformerException if syntax or other error occurs. | [
"Bottle",
"-",
"neck",
"compilation",
"of",
"a",
"unary",
"operation",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/Compiler.java#L231-L240 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/escape/CharEscaperBuilder.java | CharEscaperBuilder.addEscape | @CanIgnoreReturnValue
public CharEscaperBuilder addEscape(char c, String r) {
"""
Add a new mapping from an index to an object to the escaping.
"""
map.put(c, checkNotNull(r));
if (c > max) {
max = c;
}
return this;
} | java | @CanIgnoreReturnValue
public CharEscaperBuilder addEscape(char c, String r) {
map.put(c, checkNotNull(r));
if (c > max) {
max = c;
}
return this;
} | [
"@",
"CanIgnoreReturnValue",
"public",
"CharEscaperBuilder",
"addEscape",
"(",
"char",
"c",
",",
"String",
"r",
")",
"{",
"map",
".",
"put",
"(",
"c",
",",
"checkNotNull",
"(",
"r",
")",
")",
";",
"if",
"(",
"c",
">",
"max",
")",
"{",
"max",
"=",
"... | Add a new mapping from an index to an object to the escaping. | [
"Add",
"a",
"new",
"mapping",
"from",
"an",
"index",
"to",
"an",
"object",
"to",
"the",
"escaping",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/escape/CharEscaperBuilder.java#L88-L95 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java | PropertyListSerialization.serializeReal | private static void serializeReal(final Number real, final ContentHandler handler) throws SAXException {
"""
Serialize a Number as a real element.
@param real
number to serialize.
@param handler
destination of serialization events.
@throws SAXException
if exception during serialization.
"""
seriali... | java | private static void serializeReal(final Number real, final ContentHandler handler) throws SAXException {
serializeElement("real", String.valueOf(real.doubleValue()), handler);
} | [
"private",
"static",
"void",
"serializeReal",
"(",
"final",
"Number",
"real",
",",
"final",
"ContentHandler",
"handler",
")",
"throws",
"SAXException",
"{",
"serializeElement",
"(",
"\"real\"",
",",
"String",
".",
"valueOf",
"(",
"real",
".",
"doubleValue",
"(",... | Serialize a Number as a real element.
@param real
number to serialize.
@param handler
destination of serialization events.
@throws SAXException
if exception during serialization. | [
"Serialize",
"a",
"Number",
"as",
"a",
"real",
"element",
"."
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java#L224-L226 |
ixa-ehu/ixa-pipe-ml | src/main/java/eus/ixa/ixa/pipe/ml/features/TokenClassFeatureGenerator.java | TokenClassFeatureGenerator.processRangeOptions | private void processRangeOptions(final Map<String, String> properties) {
"""
Process the options of which type of features are to be generated.
@param properties
the properties map
"""
final String featuresRange = properties.get("range");
final String[] rangeArray = Flags
.processTokenClass... | java | private void processRangeOptions(final Map<String, String> properties) {
final String featuresRange = properties.get("range");
final String[] rangeArray = Flags
.processTokenClassFeaturesRange(featuresRange);
if (rangeArray[0].equalsIgnoreCase("lower")) {
this.isLower = true;
}
if (ran... | [
"private",
"void",
"processRangeOptions",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
")",
"{",
"final",
"String",
"featuresRange",
"=",
"properties",
".",
"get",
"(",
"\"range\"",
")",
";",
"final",
"String",
"[",
"]",
"rangeArray"... | Process the options of which type of features are to be generated.
@param properties
the properties map | [
"Process",
"the",
"options",
"of",
"which",
"type",
"of",
"features",
"are",
"to",
"be",
"generated",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/features/TokenClassFeatureGenerator.java#L139-L149 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLFunctionalDataPropertyAxiomImpl_CustomFieldSerializer.java | OWLFunctionalDataPropertyAxiomImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLFunctionalDataPropertyAxiomImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLFunctionalDataPropertyAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLFunctionalDataPropertyAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
... | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLFunctionalDataPropertyAxiomImpl_CustomFieldSerializer.java#L75-L78 |
Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/entity/CassandraCell.java | CassandraCell.create | public static <E extends IDeepType> Cell create(E e, Field field) {
"""
Constructs a Cell from a {@link com.stratio.deep.commons.annotations.DeepField} property.
@param e instance of the testentity whose field is going to generate a Cell.
@param field field that will generate the Cell.
@param <E> a subc... | java | public static <E extends IDeepType> Cell create(E e, Field field) {
return new CassandraCell(e, field);
} | [
"public",
"static",
"<",
"E",
"extends",
"IDeepType",
">",
"Cell",
"create",
"(",
"E",
"e",
",",
"Field",
"field",
")",
"{",
"return",
"new",
"CassandraCell",
"(",
"e",
",",
"field",
")",
";",
"}"
] | Constructs a Cell from a {@link com.stratio.deep.commons.annotations.DeepField} property.
@param e instance of the testentity whose field is going to generate a Cell.
@param field field that will generate the Cell.
@param <E> a subclass of IDeepType.
@return an instance of a Cell object for the provided paramete... | [
"Constructs",
"a",
"Cell",
"from",
"a",
"{",
"@link",
"com",
".",
"stratio",
".",
"deep",
".",
"commons",
".",
"annotations",
".",
"DeepField",
"}",
"property",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/entity/CassandraCell.java#L123-L125 |
fedups/com.obdobion.argument | src/main/java/com/obdobion/argument/variables/VariableAssigner.java | VariableAssigner.assignList | private static void assignList(final Field field, final ICmdLineArg<?> arg, final Object target)
throws IllegalAccessException {
"""
This value may not be appropriate for the list. But since this is at
runtime we can't make use of the generics definition they may have
provided on the field. If the va... | java | private static void assignList(final Field field, final ICmdLineArg<?> arg, final Object target)
throws IllegalAccessException
{
@SuppressWarnings("unchecked")
Collection<Object> alist = (Collection<Object>) field.get(target);
if (alist == null)
{
alist = new... | [
"private",
"static",
"void",
"assignList",
"(",
"final",
"Field",
"field",
",",
"final",
"ICmdLineArg",
"<",
"?",
">",
"arg",
",",
"final",
"Object",
"target",
")",
"throws",
"IllegalAccessException",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"C... | This value may not be appropriate for the list. But since this is at
runtime we can't make use of the generics definition they may have
provided on the field. If the value is not what they expect then they
need to provide a --factory set of methods. | [
"This",
"value",
"may",
"not",
"be",
"appropriate",
"for",
"the",
"list",
".",
"But",
"since",
"this",
"is",
"at",
"runtime",
"we",
"can",
"t",
"make",
"use",
"of",
"the",
"generics",
"definition",
"they",
"may",
"have",
"provided",
"on",
"the",
"field",... | train | https://github.com/fedups/com.obdobion.argument/blob/9679aebbeedaef4e592227842fa0e91410708a67/src/main/java/com/obdobion/argument/variables/VariableAssigner.java#L54-L67 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/time/SchedulingSupport.java | SchedulingSupport.getNextIntervalStart | public static long getNextIntervalStart(long time, int intervalInMinutes, int offsetInMinutes) {
"""
Determines the exact time the next interval starts based on a time within the current interval.
@param time time in millis
@param intervalInMinutes
@param offsetInMinutes
@return the exact time in millisecond... | java | public static long getNextIntervalStart(long time, int intervalInMinutes, int offsetInMinutes) {
long interval = MINUTE_IN_MS * intervalInMinutes;
return getPreviousIntervalStart(time, intervalInMinutes, offsetInMinutes) + interval;
} | [
"public",
"static",
"long",
"getNextIntervalStart",
"(",
"long",
"time",
",",
"int",
"intervalInMinutes",
",",
"int",
"offsetInMinutes",
")",
"{",
"long",
"interval",
"=",
"MINUTE_IN_MS",
"*",
"intervalInMinutes",
";",
"return",
"getPreviousIntervalStart",
"(",
"tim... | Determines the exact time the next interval starts based on a time within the current interval.
@param time time in millis
@param intervalInMinutes
@param offsetInMinutes
@return the exact time in milliseconds the interval begins local time | [
"Determines",
"the",
"exact",
"time",
"the",
"next",
"interval",
"starts",
"based",
"on",
"a",
"time",
"within",
"the",
"current",
"interval",
".",
"@param",
"time",
"time",
"in",
"millis",
"@param",
"intervalInMinutes",
"@param",
"offsetInMinutes"
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/time/SchedulingSupport.java#L112-L115 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaasqueue/src/main/java/net/minidev/ovh/api/ApiOvhDbaasqueue.java | ApiOvhDbaasqueue.serviceName_topic_topicId_GET | public OvhTopic serviceName_topic_topicId_GET(String serviceName, String topicId) throws IOException {
"""
Get a topic
REST: GET /dbaas/queue/{serviceName}/topic/{topicId}
@param serviceName [required] Application ID
@param topicId [required] Topic ID
API beta
"""
String qPath = "/dbaas/queue/{servic... | java | public OvhTopic serviceName_topic_topicId_GET(String serviceName, String topicId) throws IOException {
String qPath = "/dbaas/queue/{serviceName}/topic/{topicId}";
StringBuilder sb = path(qPath, serviceName, topicId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhTopic.class);... | [
"public",
"OvhTopic",
"serviceName_topic_topicId_GET",
"(",
"String",
"serviceName",
",",
"String",
"topicId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/queue/{serviceName}/topic/{topicId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPa... | Get a topic
REST: GET /dbaas/queue/{serviceName}/topic/{topicId}
@param serviceName [required] Application ID
@param topicId [required] Topic ID
API beta | [
"Get",
"a",
"topic"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaasqueue/src/main/java/net/minidev/ovh/api/ApiOvhDbaasqueue.java#L242-L247 |
openbaton/openbaton-client | sdk/src/main/java/org/openbaton/sdk/api/util/RestUtils.java | RestUtils.checkStatus | public static void checkStatus(CloseableHttpResponse httpResponse, final int httpStatus)
throws SDKException {
"""
Check whether a json repsonse has the right http status. If not, an SDKException is thrown.
@param httpResponse the http response
@param httpStatus the (desired) http status of the repsonse
... | java | public static void checkStatus(CloseableHttpResponse httpResponse, final int httpStatus)
throws SDKException {
if (httpResponse.getStatusLine().getStatusCode() != httpStatus) {
log.error(
"Status expected: "
+ httpStatus
+ " obtained: "
+ httpResponse... | [
"public",
"static",
"void",
"checkStatus",
"(",
"CloseableHttpResponse",
"httpResponse",
",",
"final",
"int",
"httpStatus",
")",
"throws",
"SDKException",
"{",
"if",
"(",
"httpResponse",
".",
"getStatusLine",
"(",
")",
".",
"getStatusCode",
"(",
")",
"!=",
"http... | Check whether a json repsonse has the right http status. If not, an SDKException is thrown.
@param httpResponse the http response
@param httpStatus the (desired) http status of the repsonse
@throws SDKException if the request fails | [
"Check",
"whether",
"a",
"json",
"repsonse",
"has",
"the",
"right",
"http",
"status",
".",
"If",
"not",
"an",
"SDKException",
"is",
"thrown",
"."
] | train | https://github.com/openbaton/openbaton-client/blob/6ca6dd6b62a23940d312213d6fa489d5b636061a/sdk/src/main/java/org/openbaton/sdk/api/util/RestUtils.java#L20-L46 |
protostuff/protostuff | protostuff-msgpack/src/main/java/io/protostuff/MsgpackIOUtil.java | MsgpackIOUtil.writeListTo | public static <T> void writeListTo(MessagePacker packer, List<T> messages,
Schema<T> schema, boolean numeric) throws IOException {
"""
Serializes the {@code messages} into the generator using the given schema.
"""
MsgpackGenerator generator = new MsgpackGenerator(numeric);
MsgpackOu... | java | public static <T> void writeListTo(MessagePacker packer, List<T> messages,
Schema<T> schema, boolean numeric) throws IOException
{
MsgpackGenerator generator = new MsgpackGenerator(numeric);
MsgpackOutput output = new MsgpackOutput(generator, schema);
for (T m : messages)
... | [
"public",
"static",
"<",
"T",
">",
"void",
"writeListTo",
"(",
"MessagePacker",
"packer",
",",
"List",
"<",
"T",
">",
"messages",
",",
"Schema",
"<",
"T",
">",
"schema",
",",
"boolean",
"numeric",
")",
"throws",
"IOException",
"{",
"MsgpackGenerator",
"gen... | Serializes the {@code messages} into the generator using the given schema. | [
"Serializes",
"the",
"{"
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-msgpack/src/main/java/io/protostuff/MsgpackIOUtil.java#L292-L305 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/FormatUtils.java | FormatUtils.appendUnpaddedInteger | public static void appendUnpaddedInteger(Appendable appendable, long value) throws IOException {
"""
Converts an integer to a string, and appends it to the given appendable.
<p>This method is optimized for converting small values to strings.
@param appendable receives integer converted to a string
@param va... | java | public static void appendUnpaddedInteger(Appendable appendable, long value) throws IOException {
int intValue = (int)value;
if (intValue == value) {
appendUnpaddedInteger(appendable, intValue);
} else {
appendable.append(Long.toString(value));
}
} | [
"public",
"static",
"void",
"appendUnpaddedInteger",
"(",
"Appendable",
"appendable",
",",
"long",
"value",
")",
"throws",
"IOException",
"{",
"int",
"intValue",
"=",
"(",
"int",
")",
"value",
";",
"if",
"(",
"intValue",
"==",
"value",
")",
"{",
"appendUnpad... | Converts an integer to a string, and appends it to the given appendable.
<p>This method is optimized for converting small values to strings.
@param appendable receives integer converted to a string
@param value value to convert to a string | [
"Converts",
"an",
"integer",
"to",
"a",
"string",
"and",
"appends",
"it",
"to",
"the",
"given",
"appendable",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/FormatUtils.java#L339-L346 |
alipay/sofa-rpc | core-impl/client/src/main/java/com/alipay/sofa/rpc/client/AllConnectConnectionHolder.java | AllConnectConnectionHolder.doubleCheck | protected boolean doubleCheck(String interfaceId, ProviderInfo providerInfo, ClientTransport transport) {
"""
两次验证检查ClientTransport是否存活
@param interfaceId 接口
@param transport ClientTransport对象
@return 是否存活
"""
if (transport.isAvailable()) {
try { // 睡一下下 防止被连上又被服务端踢下线
... | java | protected boolean doubleCheck(String interfaceId, ProviderInfo providerInfo, ClientTransport transport) {
if (transport.isAvailable()) {
try { // 睡一下下 防止被连上又被服务端踢下线
Thread.sleep(100);
} catch (InterruptedException e) {
// ignore
}
i... | [
"protected",
"boolean",
"doubleCheck",
"(",
"String",
"interfaceId",
",",
"ProviderInfo",
"providerInfo",
",",
"ClientTransport",
"transport",
")",
"{",
"if",
"(",
"transport",
".",
"isAvailable",
"(",
")",
")",
"{",
"try",
"{",
"// 睡一下下 防止被连上又被服务端踢下线",
"Thread",
... | 两次验证检查ClientTransport是否存活
@param interfaceId 接口
@param transport ClientTransport对象
@return 是否存活 | [
"两次验证检查ClientTransport是否存活"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core-impl/client/src/main/java/com/alipay/sofa/rpc/client/AllConnectConnectionHolder.java#L762-L785 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java | ClientService.updateActive | public void updateActive(int profileId, String clientUUID, Boolean active) throws Exception {
"""
disables the current active id, enables the new one selected
@param profileId profile ID of the client
@param clientUUID UUID of the client
@param active true to make client active, false to make client inactive
... | java | public void updateActive(int profileId, String clientUUID, Boolean active) throws Exception {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_CLIENT +
... | [
"public",
"void",
"updateActive",
"(",
"int",
"profileId",
",",
"String",
"clientUUID",
",",
"Boolean",
"active",
")",
"throws",
"Exception",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"sqlService",
"... | disables the current active id, enables the new one selected
@param profileId profile ID of the client
@param clientUUID UUID of the client
@param active true to make client active, false to make client inactive
@throws Exception exception | [
"disables",
"the",
"current",
"active",
"id",
"enables",
"the",
"new",
"one",
"selected"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java#L580-L603 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/QueryParserBase.java | QueryParserBase.appendDefaultOperator | protected void appendDefaultOperator(SolrQuery solrQuery, @Nullable Operator defaultOperator) {
"""
Set {@code q.op} parameter for {@link SolrQuery}
@param solrQuery
@param defaultOperator
"""
if (defaultOperator != null && !Query.Operator.NONE.equals(defaultOperator)) {
solrQuery.set("q.op", defaultO... | java | protected void appendDefaultOperator(SolrQuery solrQuery, @Nullable Operator defaultOperator) {
if (defaultOperator != null && !Query.Operator.NONE.equals(defaultOperator)) {
solrQuery.set("q.op", defaultOperator.asQueryStringRepresentation());
}
} | [
"protected",
"void",
"appendDefaultOperator",
"(",
"SolrQuery",
"solrQuery",
",",
"@",
"Nullable",
"Operator",
"defaultOperator",
")",
"{",
"if",
"(",
"defaultOperator",
"!=",
"null",
"&&",
"!",
"Query",
".",
"Operator",
".",
"NONE",
".",
"equals",
"(",
"defau... | Set {@code q.op} parameter for {@link SolrQuery}
@param solrQuery
@param defaultOperator | [
"Set",
"{",
"@code",
"q",
".",
"op",
"}",
"parameter",
"for",
"{",
"@link",
"SolrQuery",
"}"
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/QueryParserBase.java#L463-L467 |
Chorus-bdd/Chorus | extensions/chorus-sql/src/main/java/org/chorusbdd/chorus/sql/manager/DefaultSqlManager.java | DefaultSqlManager.executeJdbcStatements | private void executeJdbcStatements(Connection connection, String configName, String statements, String description) {
"""
Execute one or more SQL statements
@param statements, a String which may contain one or more semi-colon-delimited SQL statements
"""
Statement stmt = createStatement(configName, ... | java | private void executeJdbcStatements(Connection connection, String configName, String statements, String description) {
Statement stmt = createStatement(configName, connection);
try {
log.debug("Executing statement [" + description + "]");
List<String> stmtsToExecute =... | [
"private",
"void",
"executeJdbcStatements",
"(",
"Connection",
"connection",
",",
"String",
"configName",
",",
"String",
"statements",
",",
"String",
"description",
")",
"{",
"Statement",
"stmt",
"=",
"createStatement",
"(",
"configName",
",",
"connection",
")",
"... | Execute one or more SQL statements
@param statements, a String which may contain one or more semi-colon-delimited SQL statements | [
"Execute",
"one",
"or",
"more",
"SQL",
"statements"
] | train | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/extensions/chorus-sql/src/main/java/org/chorusbdd/chorus/sql/manager/DefaultSqlManager.java#L148-L173 |
alkacon/opencms-core | src/org/opencms/util/CmsDataTypeUtil.java | CmsDataTypeUtil.dataImport | public static Object dataImport(String value, String type) throws ClassNotFoundException, IOException {
"""
Returns the import data object.<p>
@param value the exported value
@param type the expected data type
@return the import data object
@throws ClassNotFoundException if something goes wrong
@throws ... | java | public static Object dataImport(String value, String type) throws ClassNotFoundException, IOException {
Class<?> clazz = Class.forName(type);
if (CmsDataTypeUtil.isParseable(clazz)) {
return CmsDataTypeUtil.parse(value, clazz);
}
byte[] data = Base64.decodeBase64(value.getBy... | [
"public",
"static",
"Object",
"dataImport",
"(",
"String",
"value",
",",
"String",
"type",
")",
"throws",
"ClassNotFoundException",
",",
"IOException",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"Class",
".",
"forName",
"(",
"type",
")",
";",
"if",
"(",
... | Returns the import data object.<p>
@param value the exported value
@param type the expected data type
@return the import data object
@throws ClassNotFoundException if something goes wrong
@throws IOException if something goes wrong | [
"Returns",
"the",
"import",
"data",
"object",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsDataTypeUtil.java#L120-L128 |
epam/parso | src/main/java/com/epam/parso/DataWriterUtil.java | DataWriterUtil.convertPercentElementToString | private static String convertPercentElementToString(Object value, DecimalFormat decimalFormat) {
"""
The function to convert a percent element into a string.
@param value the input numeric value to convert.
@param decimalFormat the formatter to convert percentage element into string.
@return the strin... | java | private static String convertPercentElementToString(Object value, DecimalFormat decimalFormat) {
Double doubleValue = value instanceof Long ? ((Long) value).doubleValue() : (Double) value;
return decimalFormat.format(doubleValue);
} | [
"private",
"static",
"String",
"convertPercentElementToString",
"(",
"Object",
"value",
",",
"DecimalFormat",
"decimalFormat",
")",
"{",
"Double",
"doubleValue",
"=",
"value",
"instanceof",
"Long",
"?",
"(",
"(",
"Long",
")",
"value",
")",
".",
"doubleValue",
"(... | The function to convert a percent element into a string.
@param value the input numeric value to convert.
@param decimalFormat the formatter to convert percentage element into string.
@return the string with the text presentation of the input numeric value. | [
"The",
"function",
"to",
"convert",
"a",
"percent",
"element",
"into",
"a",
"string",
"."
] | train | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/DataWriterUtil.java#L308-L311 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.listDiagnosticsAsync | public Observable<List<HostingEnvironmentDiagnosticsInner>> listDiagnosticsAsync(String resourceGroupName, String name) {
"""
Get diagnostic information for an App Service Environment.
Get diagnostic information for an App Service Environment.
@param resourceGroupName Name of the resource group to which the re... | java | public Observable<List<HostingEnvironmentDiagnosticsInner>> listDiagnosticsAsync(String resourceGroupName, String name) {
return listDiagnosticsWithServiceResponseAsync(resourceGroupName, name).map(new Func1<ServiceResponse<List<HostingEnvironmentDiagnosticsInner>>, List<HostingEnvironmentDiagnosticsInner>>() {... | [
"public",
"Observable",
"<",
"List",
"<",
"HostingEnvironmentDiagnosticsInner",
">",
">",
"listDiagnosticsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
")",
"{",
"return",
"listDiagnosticsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name... | Get diagnostic information for an App Service Environment.
Get diagnostic information for an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@throws IllegalArgumentException thrown if parameters fail the valida... | [
"Get",
"diagnostic",
"information",
"for",
"an",
"App",
"Service",
"Environment",
".",
"Get",
"diagnostic",
"information",
"for",
"an",
"App",
"Service",
"Environment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L1543-L1550 |
xiancloud/xian | xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/RuntimeContainerProperties.java | RuntimeContainerProperties.getProperty | public static String getProperty(String key, String defaultValue) {
"""
Lookup property from ({@link System#getenv(String)} and {@link System#getProperty(String)} as fallback.
@param key the property key
@param defaultValue the default value
@return the property value.
"""
String env = System.gete... | java | public static String getProperty(String key, String defaultValue) {
String env = System.getenv(key);
if (env != null && !"".equals(env)) {
return env;
}
return System.getProperty(key, defaultValue);
} | [
"public",
"static",
"String",
"getProperty",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"String",
"env",
"=",
"System",
".",
"getenv",
"(",
"key",
")",
";",
"if",
"(",
"env",
"!=",
"null",
"&&",
"!",
"\"\"",
".",
"equals",
"(",
"e... | Lookup property from ({@link System#getenv(String)} and {@link System#getProperty(String)} as fallback.
@param key the property key
@param defaultValue the default value
@return the property value. | [
"Lookup",
"property",
"from",
"(",
"{",
"@link",
"System#getenv",
"(",
"String",
")",
"}",
"and",
"{",
"@link",
"System#getProperty",
"(",
"String",
")",
"}",
"as",
"fallback",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/RuntimeContainerProperties.java#L54-L60 |
Prototik/HoloEverywhere | library/src/org/holoeverywhere/ThemeManager.java | ThemeManager.cloneTheme | public static void cloneTheme(Intent sourceIntent, Intent intent) {
"""
Synonym for {@link #cloneTheme(Intent, Intent, boolean)} with third arg -
false
@see #cloneTheme(Intent, Intent, boolean)
"""
ThemeManager.cloneTheme(sourceIntent, intent, false);
} | java | public static void cloneTheme(Intent sourceIntent, Intent intent) {
ThemeManager.cloneTheme(sourceIntent, intent, false);
} | [
"public",
"static",
"void",
"cloneTheme",
"(",
"Intent",
"sourceIntent",
",",
"Intent",
"intent",
")",
"{",
"ThemeManager",
".",
"cloneTheme",
"(",
"sourceIntent",
",",
"intent",
",",
"false",
")",
";",
"}"
] | Synonym for {@link #cloneTheme(Intent, Intent, boolean)} with third arg -
false
@see #cloneTheme(Intent, Intent, boolean) | [
"Synonym",
"for",
"{",
"@link",
"#cloneTheme",
"(",
"Intent",
"Intent",
"boolean",
")",
"}",
"with",
"third",
"arg",
"-",
"false"
] | train | https://github.com/Prototik/HoloEverywhere/blob/b870abb5ab009a5a6dbab3fb855ec2854e35e125/library/src/org/holoeverywhere/ThemeManager.java#L249-L251 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/SpaceGroup.java | SpaceGroup.areInSameAxis | public boolean areInSameAxis(int tId1, int tId2) {
"""
Returns true if both given transform ids belong to the same crystallographic axis (a, b or c)
For two non-rotation transformations (i.e. identity operators) it returns true
@param tId1
@param tId2
@return
"""
if (tId1==tId2) return true;
if (axisA... | java | public boolean areInSameAxis(int tId1, int tId2) {
if (tId1==tId2) return true;
if (axisAngles== null) calcRotAxesAndAngles();
if (getAxisFoldType(tId1)==1 && getAxisFoldType(tId2)==1) return true;
// we can't deal yet with improper rotations: we return false whenever either of them is improper
if (getAxis... | [
"public",
"boolean",
"areInSameAxis",
"(",
"int",
"tId1",
",",
"int",
"tId2",
")",
"{",
"if",
"(",
"tId1",
"==",
"tId2",
")",
"return",
"true",
";",
"if",
"(",
"axisAngles",
"==",
"null",
")",
"calcRotAxesAndAngles",
"(",
")",
";",
"if",
"(",
"getAxisF... | Returns true if both given transform ids belong to the same crystallographic axis (a, b or c)
For two non-rotation transformations (i.e. identity operators) it returns true
@param tId1
@param tId2
@return | [
"Returns",
"true",
"if",
"both",
"given",
"transform",
"ids",
"belong",
"to",
"the",
"same",
"crystallographic",
"axis",
"(",
"a",
"b",
"or",
"c",
")",
"For",
"two",
"non",
"-",
"rotation",
"transformations",
"(",
"i",
".",
"e",
".",
"identity",
"operato... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/SpaceGroup.java#L326-L344 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDateTime.java | LocalDateTime.withMinute | public LocalDateTime withMinute(int minute) {
"""
Returns a copy of this {@code LocalDateTime} with the minute-of-hour altered.
<p>
This instance is immutable and unaffected by this method call.
@param minute the minute-of-hour to set in the result, from 0 to 59
@return a {@code LocalDateTime} based on this... | java | public LocalDateTime withMinute(int minute) {
LocalTime newTime = time.withMinute(minute);
return with(date, newTime);
} | [
"public",
"LocalDateTime",
"withMinute",
"(",
"int",
"minute",
")",
"{",
"LocalTime",
"newTime",
"=",
"time",
".",
"withMinute",
"(",
"minute",
")",
";",
"return",
"with",
"(",
"date",
",",
"newTime",
")",
";",
"}"
] | Returns a copy of this {@code LocalDateTime} with the minute-of-hour altered.
<p>
This instance is immutable and unaffected by this method call.
@param minute the minute-of-hour to set in the result, from 0 to 59
@return a {@code LocalDateTime} based on this date-time with the requested minute, not null
@throws DateT... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"LocalDateTime",
"}",
"with",
"the",
"minute",
"-",
"of",
"-",
"hour",
"altered",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDateTime.java#L1060-L1063 |
apache/reef | lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/client/YarnSubmissionHelper.java | YarnSubmissionHelper.addLocalResource | public YarnSubmissionHelper addLocalResource(final String resourceName, final LocalResource resource) {
"""
Add a file to be localized on the driver.
@param resourceName
@param resource
@return
"""
resources.put(resourceName, resource);
return this;
} | java | public YarnSubmissionHelper addLocalResource(final String resourceName, final LocalResource resource) {
resources.put(resourceName, resource);
return this;
} | [
"public",
"YarnSubmissionHelper",
"addLocalResource",
"(",
"final",
"String",
"resourceName",
",",
"final",
"LocalResource",
"resource",
")",
"{",
"resources",
".",
"put",
"(",
"resourceName",
",",
"resource",
")",
";",
"return",
"this",
";",
"}"
] | Add a file to be localized on the driver.
@param resourceName
@param resource
@return | [
"Add",
"a",
"file",
"to",
"be",
"localized",
"on",
"the",
"driver",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/client/YarnSubmissionHelper.java#L161-L164 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.mixin | public static void mixin(MetaClass self, Class categoryClass) {
"""
Extend class globally with category methods.
@param self any Class
@param categoryClass a category class to use
@since 1.6.0
"""
mixin(self, Collections.singletonList(categoryClass));
} | java | public static void mixin(MetaClass self, Class categoryClass) {
mixin(self, Collections.singletonList(categoryClass));
} | [
"public",
"static",
"void",
"mixin",
"(",
"MetaClass",
"self",
",",
"Class",
"categoryClass",
")",
"{",
"mixin",
"(",
"self",
",",
"Collections",
".",
"singletonList",
"(",
"categoryClass",
")",
")",
";",
"}"
] | Extend class globally with category methods.
@param self any Class
@param categoryClass a category class to use
@since 1.6.0 | [
"Extend",
"class",
"globally",
"with",
"category",
"methods",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L611-L613 |
undertow-io/undertow | core/src/main/java/io/undertow/server/handlers/sse/ServerSentEventConnection.java | ServerSentEventConnection.sendRetry | public synchronized void sendRetry(long retry, EventCallback callback) {
"""
Sends the 'retry' message to the client, instructing it how long to wait before attempting a reconnect.
@param retry The retry time in milliseconds
@param callback The callback that is notified on success or failure
"""
i... | java | public synchronized void sendRetry(long retry, EventCallback callback) {
if (open == 0 || shutdown) {
if (callback != null) {
callback.failed(this, null, null, null, new ClosedChannelException());
}
return;
}
queue.add(new SSEData(retry, callb... | [
"public",
"synchronized",
"void",
"sendRetry",
"(",
"long",
"retry",
",",
"EventCallback",
"callback",
")",
"{",
"if",
"(",
"open",
"==",
"0",
"||",
"shutdown",
")",
"{",
"if",
"(",
"callback",
"!=",
"null",
")",
"{",
"callback",
".",
"failed",
"(",
"t... | Sends the 'retry' message to the client, instructing it how long to wait before attempting a reconnect.
@param retry The retry time in milliseconds
@param callback The callback that is notified on success or failure | [
"Sends",
"the",
"retry",
"message",
"to",
"the",
"client",
"instructing",
"it",
"how",
"long",
"to",
"wait",
"before",
"attempting",
"a",
"reconnect",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/sse/ServerSentEventConnection.java#L213-L233 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ScientificNumberFormatter.java | ScientificNumberFormatter.getMarkupInstance | public static ScientificNumberFormatter getMarkupInstance(
DecimalFormat df,
String beginMarkup,
String endMarkup) {
"""
Gets a ScientificNumberFormatter instance that uses
markup for exponents.
@param df The DecimalFormat must be configured for scientific
notation. Caller... | java | public static ScientificNumberFormatter getMarkupInstance(
DecimalFormat df,
String beginMarkup,
String endMarkup) {
return getInstance(
df, new MarkupStyle(beginMarkup, endMarkup));
} | [
"public",
"static",
"ScientificNumberFormatter",
"getMarkupInstance",
"(",
"DecimalFormat",
"df",
",",
"String",
"beginMarkup",
",",
"String",
"endMarkup",
")",
"{",
"return",
"getInstance",
"(",
"df",
",",
"new",
"MarkupStyle",
"(",
"beginMarkup",
",",
"endMarkup",... | Gets a ScientificNumberFormatter instance that uses
markup for exponents.
@param df The DecimalFormat must be configured for scientific
notation. Caller may safely change df after this call as this method
clones it when creating the ScientificNumberFormatter.
@param beginMarkup the markup to start superscript e.g {@cod... | [
"Gets",
"a",
"ScientificNumberFormatter",
"instance",
"that",
"uses",
"markup",
"for",
"exponents",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ScientificNumberFormatter.java#L92-L98 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMenuItemGroupRenderer.java | WMenuItemGroupRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given WMenuItemGroup.
@param component the WMenuItemGroup to paint.
@param renderContext the RenderContext to paint to.
"""
WMenuItemGroup group = (WMenuItemGroup) component;
XmlStringB... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WMenuItemGroup group = (WMenuItemGroup) component;
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("ui:menugroup");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttrib... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WMenuItemGroup",
"group",
"=",
"(",
"WMenuItemGroup",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"r... | Paints the given WMenuItemGroup.
@param component the WMenuItemGroup to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WMenuItemGroup",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMenuItemGroupRenderer.java#L22-L36 |
bmwcarit/joynr | java/messaging/bounceproxy/bounceproxy-controller/src/main/java/io/joynr/messaging/bounceproxy/controller/RemoteBounceProxyFacade.java | RemoteBounceProxyFacade.createChannel | public URI createChannel(ControlledBounceProxyInformation bpInfo,
String ccid,
String trackingId) throws JoynrProtocolException {
"""
Creates a channel on the remote bounce proxy.
@param bpInfo information for a bounce proxy, including the cluster the
b... | java | public URI createChannel(ControlledBounceProxyInformation bpInfo,
String ccid,
String trackingId) throws JoynrProtocolException {
try {
// Try to create a channel on a bounce proxy with maximum number of
// retries.
r... | [
"public",
"URI",
"createChannel",
"(",
"ControlledBounceProxyInformation",
"bpInfo",
",",
"String",
"ccid",
",",
"String",
"trackingId",
")",
"throws",
"JoynrProtocolException",
"{",
"try",
"{",
"// Try to create a channel on a bounce proxy with maximum number of",
"// retries.... | Creates a channel on the remote bounce proxy.
@param bpInfo information for a bounce proxy, including the cluster the
bounce proxy is running on
@param ccid the channel id
@param trackingId the tracking id
@return URI representing the channel
@throws JoynrProtocolException
if the bounce proxy rejects channel creation | [
"Creates",
"a",
"channel",
"on",
"the",
"remote",
"bounce",
"proxy",
"."
] | train | https://github.com/bmwcarit/joynr/blob/b7a92bad1cf2f093de080facd2c803560f4c6c26/java/messaging/bounceproxy/bounceproxy-controller/src/main/java/io/joynr/messaging/bounceproxy/controller/RemoteBounceProxyFacade.java#L78-L98 |
dihedron/dihedron-commons | src/main/java/org/dihedron/patterns/activities/engine/ParallelEngine.java | ParallelEngine.setWaitMode | public ParallelEngine setWaitMode(WaitMode mode, long timeout, TimeUnit unit) {
"""
Sets the wait mode, the number of units and their scale before the wait
for the background activities times out.
@param mode
the wait mode: whether it should wait for all background activities to
complete or it will exit as s... | java | public ParallelEngine setWaitMode(WaitMode mode, long timeout, TimeUnit unit) {
this.mode = mode;
this.timeout = timeout;
this.unit = unit;
return this;
} | [
"public",
"ParallelEngine",
"setWaitMode",
"(",
"WaitMode",
"mode",
",",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"this",
".",
"mode",
"=",
"mode",
";",
"this",
".",
"timeout",
"=",
"timeout",
";",
"this",
".",
"unit",
"=",
"unit",
";",
"r... | Sets the wait mode, the number of units and their scale before the wait
for the background activities times out.
@param mode
the wait mode: whether it should wait for all background activities to
complete or it will exit as soon as one of them is complete.
@param timeout
the number of time units (milliseconds, seconds... | [
"Sets",
"the",
"wait",
"mode",
"the",
"number",
"of",
"units",
"and",
"their",
"scale",
"before",
"the",
"wait",
"for",
"the",
"background",
"activities",
"times",
"out",
"."
] | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/patterns/activities/engine/ParallelEngine.java#L75-L80 |
voldemort/voldemort | src/java/voldemort/utils/JmxUtils.java | JmxUtils.createObjectName | public static ObjectName createObjectName(String domain, String type) {
"""
Create a JMX ObjectName
@param domain The domain of the object
@param type The type of the object
@return An ObjectName representing the name
"""
try {
return new ObjectName(domain + ":type=" + type);
}... | java | public static ObjectName createObjectName(String domain, String type) {
try {
return new ObjectName(domain + ":type=" + type);
} catch(MalformedObjectNameException e) {
throw new VoldemortException(e);
}
} | [
"public",
"static",
"ObjectName",
"createObjectName",
"(",
"String",
"domain",
",",
"String",
"type",
")",
"{",
"try",
"{",
"return",
"new",
"ObjectName",
"(",
"domain",
"+",
"\":type=\"",
"+",
"type",
")",
";",
"}",
"catch",
"(",
"MalformedObjectNameException... | Create a JMX ObjectName
@param domain The domain of the object
@param type The type of the object
@return An ObjectName representing the name | [
"Create",
"a",
"JMX",
"ObjectName"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/JmxUtils.java#L238-L244 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/EigenValueDecomposition.java | EigenValueDecomposition.rowOpTransform | private static void rowOpTransform(Matrix M, int low, int high, int n, double q, double p) {
"""
Updates the rows of the matrix M such that
<br>
M[n-1][j] = q * M[n-1][j] + p * M[n][j] <br>
simultaneously altering <br>
M[n][j] = q * M[n][j] - p * M[n-1][j] <br>
as if M[n-1][j] had not been altered
@param M... | java | private static void rowOpTransform(Matrix M, int low, int high, int n, double q, double p)
{
double z;
for (int j = low; j <= high; j++)
{
z = M.get(n-1, j);
M.set(n - 1, j, q * z + p * M.get(n, j));
M.set(n, j, q * M.get(n, j) - p * z);
}
... | [
"private",
"static",
"void",
"rowOpTransform",
"(",
"Matrix",
"M",
",",
"int",
"low",
",",
"int",
"high",
",",
"int",
"n",
",",
"double",
"q",
",",
"double",
"p",
")",
"{",
"double",
"z",
";",
"for",
"(",
"int",
"j",
"=",
"low",
";",
"j",
"<=",
... | Updates the rows of the matrix M such that
<br>
M[n-1][j] = q * M[n-1][j] + p * M[n][j] <br>
simultaneously altering <br>
M[n][j] = q * M[n][j] - p * M[n-1][j] <br>
as if M[n-1][j] had not been altered
@param M the matrix to alter
@param low the starting row (inclusive)
@param high the ending row (inclusive)
@param n ... | [
"Updates",
"the",
"rows",
"of",
"the",
"matrix",
"M",
"such",
"that",
"<br",
">",
"M",
"[",
"n",
"-",
"1",
"]",
"[",
"j",
"]",
"=",
"q",
"*",
"M",
"[",
"n",
"-",
"1",
"]",
"[",
"j",
"]",
"+",
"p",
"*",
"M",
"[",
"n",
"]",
"[",
"j",
"]... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/EigenValueDecomposition.java#L806-L815 |
nuun-io/kernel | core/src/main/java/io/nuun/kernel/core/internal/DependenciesAsserter.java | DependenciesAsserter.assertDependencies | void assertDependencies(final Plugin plugin) {
"""
Verifies that the plugin dependencies are present in the plugin list.
The list should contains both dependent and required plugins.
@param plugin the plugin to check
"""
Collection<Class<?>> expectedDependencies = new ArrayList<>();
Collec... | java | void assertDependencies(final Plugin plugin)
{
Collection<Class<?>> expectedDependencies = new ArrayList<>();
Collection<Class<?>> requiredPlugins = plugin.requiredPlugins();
if (requiredPlugins != null)
{
expectedDependencies.addAll(requiredPlugins);
}
... | [
"void",
"assertDependencies",
"(",
"final",
"Plugin",
"plugin",
")",
"{",
"Collection",
"<",
"Class",
"<",
"?",
">",
">",
"expectedDependencies",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Collection",
"<",
"Class",
"<",
"?",
">",
">",
"requiredPlugins... | Verifies that the plugin dependencies are present in the plugin list.
The list should contains both dependent and required plugins.
@param plugin the plugin to check | [
"Verifies",
"that",
"the",
"plugin",
"dependencies",
"are",
"present",
"in",
"the",
"plugin",
"list",
".",
"The",
"list",
"should",
"contains",
"both",
"dependent",
"and",
"required",
"plugins",
"."
] | train | https://github.com/nuun-io/kernel/blob/116a7664fe2a9323e280574803d273699a333732/core/src/main/java/io/nuun/kernel/core/internal/DependenciesAsserter.java#L42-L67 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/LocalMapStatsProvider.java | LocalMapStatsProvider.waitForReplicaAddress | private Address waitForReplicaAddress(int replica, IPartition partition, int backupCount) {
"""
Waits partition table update to get replica address if current replica address is null.
"""
int tryCount = RETRY_COUNT;
Address replicaAddress = null;
while (replicaAddress == null && partiti... | java | private Address waitForReplicaAddress(int replica, IPartition partition, int backupCount) {
int tryCount = RETRY_COUNT;
Address replicaAddress = null;
while (replicaAddress == null && partitionService.getMaxAllowedBackupCount() >= backupCount && tryCount-- > 0) {
sleep();
... | [
"private",
"Address",
"waitForReplicaAddress",
"(",
"int",
"replica",
",",
"IPartition",
"partition",
",",
"int",
"backupCount",
")",
"{",
"int",
"tryCount",
"=",
"RETRY_COUNT",
";",
"Address",
"replicaAddress",
"=",
"null",
";",
"while",
"(",
"replicaAddress",
... | Waits partition table update to get replica address if current replica address is null. | [
"Waits",
"partition",
"table",
"update",
"to",
"get",
"replica",
"address",
"if",
"current",
"replica",
"address",
"is",
"null",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/LocalMapStatsProvider.java#L287-L295 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updateIntentWithServiceResponseAsync | public Observable<ServiceResponse<OperationStatus>> updateIntentWithServiceResponseAsync(UUID appId, String versionId, UUID intentId, UpdateIntentOptionalParameter updateIntentOptionalParameter) {
"""
Updates the name of an intent classifier.
@param appId The application ID.
@param versionId The version ID.
@... | java | public Observable<ServiceResponse<OperationStatus>> updateIntentWithServiceResponseAsync(UUID appId, String versionId, UUID intentId, UpdateIntentOptionalParameter updateIntentOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoin... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"OperationStatus",
">",
">",
"updateIntentWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"intentId",
",",
"UpdateIntentOptionalParameter",
"updateIntentOptionalParameter",
")",
... | Updates the name of an intent classifier.
@param appId The application ID.
@param versionId The version ID.
@param intentId The intent classifier ID.
@param updateIntentOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if paramet... | [
"Updates",
"the",
"name",
"of",
"an",
"intent",
"classifier",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L2959-L2975 |
mscharhag/oleaster | oleaster-matcher/src/main/java/com/mscharhag/oleaster/matcher/matchers/FloatingPointNumberMatcher.java | FloatingPointNumberMatcher.toBeBetween | public void toBeBetween(double lower, double upper) {
"""
Checks if the stored value is between a lower and an upper bound.
<p>This method throws an {@code AssertionError} if:
<ul>
<li>the stored value is smaller than the lower bound</li>
<li>the stored value is greater than the upper bound</li>
</ul>
<p>It ... | java | public void toBeBetween(double lower, double upper) {
Arguments.ensureTrue(lower < upper, "upper has to be greater than lower");
boolean isBetween = this.value >= lower && this.value <= upper;
Expectations.expectTrue(isBetween, "Expected %s to be between %s and %s", this.value, lower, upper);
} | [
"public",
"void",
"toBeBetween",
"(",
"double",
"lower",
",",
"double",
"upper",
")",
"{",
"Arguments",
".",
"ensureTrue",
"(",
"lower",
"<",
"upper",
",",
"\"upper has to be greater than lower\"",
")",
";",
"boolean",
"isBetween",
"=",
"this",
".",
"value",
"... | Checks if the stored value is between a lower and an upper bound.
<p>This method throws an {@code AssertionError} if:
<ul>
<li>the stored value is smaller than the lower bound</li>
<li>the stored value is greater than the upper bound</li>
</ul>
<p>It is ok if the stored value is equal to the lower or the upper bound
@p... | [
"Checks",
"if",
"the",
"stored",
"value",
"is",
"between",
"a",
"lower",
"and",
"an",
"upper",
"bound",
".",
"<p",
">",
"This",
"method",
"throws",
"an",
"{"
] | train | https://github.com/mscharhag/oleaster/blob/ce8c6fe2346cd0c0cf5f641417ff85019d1d09ac/oleaster-matcher/src/main/java/com/mscharhag/oleaster/matcher/matchers/FloatingPointNumberMatcher.java#L110-L114 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/permission/UserPermissionDao.java | UserPermissionDao.countUsersByProjectPermission | public List<CountPerProjectPermission> countUsersByProjectPermission(DbSession dbSession, Collection<Long> projectIds) {
"""
Count the number of users per permission for a given list of projects
@param projectIds a non-null list of project ids to filter on. If empty then an empty list is returned.
"""
r... | java | public List<CountPerProjectPermission> countUsersByProjectPermission(DbSession dbSession, Collection<Long> projectIds) {
return executeLargeInputs(projectIds, mapper(dbSession)::countUsersByProjectPermission);
} | [
"public",
"List",
"<",
"CountPerProjectPermission",
">",
"countUsersByProjectPermission",
"(",
"DbSession",
"dbSession",
",",
"Collection",
"<",
"Long",
">",
"projectIds",
")",
"{",
"return",
"executeLargeInputs",
"(",
"projectIds",
",",
"mapper",
"(",
"dbSession",
... | Count the number of users per permission for a given list of projects
@param projectIds a non-null list of project ids to filter on. If empty then an empty list is returned. | [
"Count",
"the",
"number",
"of",
"users",
"per",
"permission",
"for",
"a",
"given",
"list",
"of",
"projects"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/permission/UserPermissionDao.java#L71-L73 |
astrapi69/jaulp-wicket | jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/ajax/modal/ModalDialogFragmentPanel.java | ModalDialogFragmentPanel.newOpenModalLink | protected MarkupContainer newOpenModalLink(final String id, final IModel<T> model) {
"""
Factory method for creating a new {@link Component} to open the {@link ModalWindow}. This
method is invoked in the constructor from the derived classes and can be overridden so users
can provide their own version of a new {@... | java | protected MarkupContainer newOpenModalLink(final String id, final IModel<T> model)
{
return new AjaxLink<Void>(id)
{
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
public void onClick(final AjaxRequestTarg... | [
"protected",
"MarkupContainer",
"newOpenModalLink",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"T",
">",
"model",
")",
"{",
"return",
"new",
"AjaxLink",
"<",
"Void",
">",
"(",
"id",
")",
"{",
"/** The Constant serialVersionUID. */",
"private",
... | Factory method for creating a new {@link Component} to open the {@link ModalWindow}. This
method is invoked in the constructor from the derived classes and can be overridden so users
can provide their own version of a new {@link Component} to open the {@link ModalWindow}.
@param id
the wicket id
@param model
the model... | [
"Factory",
"method",
"for",
"creating",
"a",
"new",
"{",
"@link",
"Component",
"}",
"to",
"open",
"the",
"{",
"@link",
"ModalWindow",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can"... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/ajax/modal/ModalDialogFragmentPanel.java#L141-L158 |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.sizeOfBitString | public static int sizeOfBitString(BitSet value, int nbits) {
"""
Size of an ASN.1 BIT STRING.
@param value
the BIT STRING value
@param nbits
the number of bits in the bit string
@return the size of the encoded data
"""
return DerUtils.sizeOf(ASN1_BIT_STRING_TAG_NUM, (int) Math.ceil(nbits / 8.0d)... | java | public static int sizeOfBitString(BitSet value, int nbits) {
return DerUtils.sizeOf(ASN1_BIT_STRING_TAG_NUM, (int) Math.ceil(nbits / 8.0d) + 1); // +1 for padding
} | [
"public",
"static",
"int",
"sizeOfBitString",
"(",
"BitSet",
"value",
",",
"int",
"nbits",
")",
"{",
"return",
"DerUtils",
".",
"sizeOf",
"(",
"ASN1_BIT_STRING_TAG_NUM",
",",
"(",
"int",
")",
"Math",
".",
"ceil",
"(",
"nbits",
"/",
"8.0d",
")",
"+",
"1",... | Size of an ASN.1 BIT STRING.
@param value
the BIT STRING value
@param nbits
the number of bits in the bit string
@return the size of the encoded data | [
"Size",
"of",
"an",
"ASN",
".",
"1",
"BIT",
"STRING",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L393-L395 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGraph.java | ExecutionGraph.createInitialGroupEdges | private void createInitialGroupEdges(final HashMap<AbstractJobVertex, ExecutionVertex> vertexMap)
throws GraphConversionException {
"""
Creates the initial edges between the group vertices
@param vertexMap
the temporary vertex map
@throws GraphConversionException
if the initial wiring cannot be created
... | java | private void createInitialGroupEdges(final HashMap<AbstractJobVertex, ExecutionVertex> vertexMap)
throws GraphConversionException {
Iterator<Map.Entry<AbstractJobVertex, ExecutionVertex>> it = vertexMap.entrySet().iterator();
while (it.hasNext()) {
final Map.Entry<AbstractJobVertex, ExecutionVertex> entry ... | [
"private",
"void",
"createInitialGroupEdges",
"(",
"final",
"HashMap",
"<",
"AbstractJobVertex",
",",
"ExecutionVertex",
">",
"vertexMap",
")",
"throws",
"GraphConversionException",
"{",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"AbstractJobVertex",
",",
"ExecutionVe... | Creates the initial edges between the group vertices
@param vertexMap
the temporary vertex map
@throws GraphConversionException
if the initial wiring cannot be created | [
"Creates",
"the",
"initial",
"edges",
"between",
"the",
"group",
"vertices"
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGraph.java#L390-L440 |
knowm/Yank | src/main/java/org/knowm/yank/YankPoolManager.java | YankPoolManager.createPool | private void createPool(String poolName, Properties connectionPoolProperties) {
"""
Creates a Hikari connection pool and puts it in the pools map.
@param poolName
@param connectionPoolProperties
"""
releaseConnectionPool(poolName);
// DBUtils execute methods require autoCommit to be true.
con... | java | private void createPool(String poolName, Properties connectionPoolProperties) {
releaseConnectionPool(poolName);
// DBUtils execute methods require autoCommit to be true.
connectionPoolProperties.put("autoCommit", true);
HikariConfig config = new HikariConfig(connectionPoolProperties);
config.set... | [
"private",
"void",
"createPool",
"(",
"String",
"poolName",
",",
"Properties",
"connectionPoolProperties",
")",
"{",
"releaseConnectionPool",
"(",
"poolName",
")",
";",
"// DBUtils execute methods require autoCommit to be true.",
"connectionPoolProperties",
".",
"put",
"(",
... | Creates a Hikari connection pool and puts it in the pools map.
@param poolName
@param connectionPoolProperties | [
"Creates",
"a",
"Hikari",
"connection",
"pool",
"and",
"puts",
"it",
"in",
"the",
"pools",
"map",
"."
] | train | https://github.com/knowm/Yank/blob/b2071dcd94da99db6904355f9557456b8b292a6b/src/main/java/org/knowm/yank/YankPoolManager.java#L76-L88 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobSchedulesImpl.java | JobSchedulesImpl.patchAsync | public Observable<Void> patchAsync(String jobScheduleId, JobSchedulePatchParameter jobSchedulePatchParameter, JobSchedulePatchOptions jobSchedulePatchOptions) {
"""
Updates the properties of the specified job schedule.
This replaces only the job schedule properties specified in the request. For example, if the sc... | java | public Observable<Void> patchAsync(String jobScheduleId, JobSchedulePatchParameter jobSchedulePatchParameter, JobSchedulePatchOptions jobSchedulePatchOptions) {
return patchWithServiceResponseAsync(jobScheduleId, jobSchedulePatchParameter, jobSchedulePatchOptions).map(new Func1<ServiceResponseWithHeaders<Void, ... | [
"public",
"Observable",
"<",
"Void",
">",
"patchAsync",
"(",
"String",
"jobScheduleId",
",",
"JobSchedulePatchParameter",
"jobSchedulePatchParameter",
",",
"JobSchedulePatchOptions",
"jobSchedulePatchOptions",
")",
"{",
"return",
"patchWithServiceResponseAsync",
"(",
"jobSche... | Updates the properties of the specified job schedule.
This replaces only the job schedule properties specified in the request. For example, if the schedule property is not specified with this request, then the Batch service will keep the existing schedule. Changes to a job schedule only impact jobs created by the sched... | [
"Updates",
"the",
"properties",
"of",
"the",
"specified",
"job",
"schedule",
".",
"This",
"replaces",
"only",
"the",
"job",
"schedule",
"properties",
"specified",
"in",
"the",
"request",
".",
"For",
"example",
"if",
"the",
"schedule",
"property",
"is",
"not",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobSchedulesImpl.java#L971-L978 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSet.java | NodeSet.removeElement | public boolean removeElement(Node s) {
"""
Removes the first occurrence of the argument from this vector.
If the object is found in this vector, each component in the vector
with an index greater or equal to the object's index is shifted
downward to have an index one smaller than the value it had
previously.
... | java | public boolean removeElement(Node s)
{
if (!m_mutable)
throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
if (null == m_map)
return false;
for (int i = 0; i < m_firstFree; i++)
{
Node node... | [
"public",
"boolean",
"removeElement",
"(",
"Node",
"s",
")",
"{",
"if",
"(",
"!",
"m_mutable",
")",
"throw",
"new",
"RuntimeException",
"(",
"XSLMessages",
".",
"createXPATHMessage",
"(",
"XPATHErrorResources",
".",
"ER_NODESET_NOT_MUTABLE",
",",
"null",
")",
")... | Removes the first occurrence of the argument from this vector.
If the object is found in this vector, each component in the vector
with an index greater or equal to the object's index is shifted
downward to have an index one smaller than the value it had
previously.
@param s Node to remove from the list
@return True ... | [
"Removes",
"the",
"first",
"occurrence",
"of",
"the",
"argument",
"from",
"this",
"vector",
".",
"If",
"the",
"object",
"is",
"found",
"in",
"this",
"vector",
"each",
"component",
"in",
"the",
"vector",
"with",
"an",
"index",
"greater",
"or",
"equal",
"to"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSet.java#L1195-L1220 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.