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 |
|---|---|---|---|---|---|---|---|---|---|---|
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.create | @SuppressWarnings( {
"""
Constructs a Searcher, creating its {@link Searcher#searchable} and {@link Searcher#client} with the given parameters.
@param appId your Algolia Application ID.
@param apiKey a search-only API Key. (never use API keys that could modify your records! see https://www.algolia.com/d... | java | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public static Searcher create(@NonNull final String appId, @NonNull final String apiKey, @NonNull final String indexName) {
return create(new Client(appId, apiKey).getIndex(indexName), indexName);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"static",
"Searcher",
"create",
"(",
"@",
"NonNull",
"final",
"String",
"appId",
",",
"@",
"NonNull",
"final",
"String",
"apiKey",
",",
"@",
"... | Constructs a Searcher, creating its {@link Searcher#searchable} and {@link Searcher#client} with the given parameters.
@param appId your Algolia Application ID.
@param apiKey a search-only API Key. (never use API keys that could modify your records! see https://www.algolia.com/doc/guides/security/api-keys)
@par... | [
"Constructs",
"a",
"Searcher",
"creating",
"its",
"{",
"@link",
"Searcher#searchable",
"}",
"and",
"{",
"@link",
"Searcher#client",
"}",
"with",
"the",
"given",
"parameters",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L182-L185 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/RecountOnValidHandler.java | RecountOnValidHandler.init | public void init(Record record, Record recordSub, boolean bRestoreCurrentRecord) {
"""
Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()).
@param recordSub The sub-record.
"""
m_recordSub = recordSub;
m_bRestoreCurrentRecord = bRestoreCurrentRec... | java | public void init(Record record, Record recordSub, boolean bRestoreCurrentRecord)
{
m_recordSub = recordSub;
m_bRestoreCurrentRecord = bRestoreCurrentRecord;
super.init(record);
} | [
"public",
"void",
"init",
"(",
"Record",
"record",
",",
"Record",
"recordSub",
",",
"boolean",
"bRestoreCurrentRecord",
")",
"{",
"m_recordSub",
"=",
"recordSub",
";",
"m_bRestoreCurrentRecord",
"=",
"bRestoreCurrentRecord",
";",
"super",
".",
"init",
"(",
"record... | Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()).
@param recordSub The sub-record. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/RecountOnValidHandler.java#L65-L70 |
alamkanak/Android-Week-View | sample/src/main/java/com/alamkanak/weekview/sample/BaseActivity.java | BaseActivity.setupDateTimeInterpreter | private void setupDateTimeInterpreter(final boolean shortDate) {
"""
Set up a date time interpreter which will show short date values when in week view and long
date values otherwise.
@param shortDate True if the date values should be short.
"""
mWeekView.setDateTimeInterpreter(new DateTimeInterprete... | java | private void setupDateTimeInterpreter(final boolean shortDate) {
mWeekView.setDateTimeInterpreter(new DateTimeInterpreter() {
@Override
public String interpretDate(Calendar date) {
SimpleDateFormat weekdayNameFormat = new SimpleDateFormat("EEE", Locale.getDefault());
... | [
"private",
"void",
"setupDateTimeInterpreter",
"(",
"final",
"boolean",
"shortDate",
")",
"{",
"mWeekView",
".",
"setDateTimeInterpreter",
"(",
"new",
"DateTimeInterpreter",
"(",
")",
"{",
"@",
"Override",
"public",
"String",
"interpretDate",
"(",
"Calendar",
"date"... | Set up a date time interpreter which will show short date values when in week view and long
date values otherwise.
@param shortDate True if the date values should be short. | [
"Set",
"up",
"a",
"date",
"time",
"interpreter",
"which",
"will",
"show",
"short",
"date",
"values",
"when",
"in",
"week",
"view",
"and",
"long",
"date",
"values",
"otherwise",
"."
] | train | https://github.com/alamkanak/Android-Week-View/blob/dc3f97d65d44785d1a761b52b58527c86c4eee1b/sample/src/main/java/com/alamkanak/weekview/sample/BaseActivity.java#L121-L142 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatter.java | DateTimeFormatter.printTo | public void printTo(StringBuffer buf, ReadablePartial partial) {
"""
Prints a ReadablePartial.
<p>
Neither the override chronology nor the override zone are used
by this method.
@param buf the destination to format to, not null
@param partial partial to format
"""
try {
printTo((Ap... | java | public void printTo(StringBuffer buf, ReadablePartial partial) {
try {
printTo((Appendable) buf, partial);
} catch (IOException ex) {
// StringBuffer does not throw IOException
}
} | [
"public",
"void",
"printTo",
"(",
"StringBuffer",
"buf",
",",
"ReadablePartial",
"partial",
")",
"{",
"try",
"{",
"printTo",
"(",
"(",
"Appendable",
")",
"buf",
",",
"partial",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
")",
"{",
"// StringBuffer do... | Prints a ReadablePartial.
<p>
Neither the override chronology nor the override zone are used
by this method.
@param buf the destination to format to, not null
@param partial partial to format | [
"Prints",
"a",
"ReadablePartial",
".",
"<p",
">",
"Neither",
"the",
"override",
"chronology",
"nor",
"the",
"override",
"zone",
"are",
"used",
"by",
"this",
"method",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatter.java#L602-L608 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/util/calendar/CalendarUtils.java | CalendarUtils.floorDivide | public static final int floorDivide(int n, int d, int[] r) {
"""
Divides two integers and returns the floor of the quotient and
the modulus remainder. For example,
<code>floorDivide(-1,4)</code> returns <code>-1</code> with
<code>3</code> as its remainder, while <code>-1/4</code> is
<code>0</code> and <code>-... | java | public static final int floorDivide(int n, int d, int[] r) {
if (n >= 0) {
r[0] = n % d;
return n / d;
}
int q = ((n + 1) / d) - 1;
r[0] = n - (q * d);
return q;
} | [
"public",
"static",
"final",
"int",
"floorDivide",
"(",
"int",
"n",
",",
"int",
"d",
",",
"int",
"[",
"]",
"r",
")",
"{",
"if",
"(",
"n",
">=",
"0",
")",
"{",
"r",
"[",
"0",
"]",
"=",
"n",
"%",
"d",
";",
"return",
"n",
"/",
"d",
";",
"}",... | Divides two integers and returns the floor of the quotient and
the modulus remainder. For example,
<code>floorDivide(-1,4)</code> returns <code>-1</code> with
<code>3</code> as its remainder, while <code>-1/4</code> is
<code>0</code> and <code>-1%4</code> is <code>-1</code>.
@param n the numerator
@param d a divisor ... | [
"Divides",
"two",
"integers",
"and",
"returns",
"the",
"floor",
"of",
"the",
"quotient",
"and",
"the",
"modulus",
"remainder",
".",
"For",
"example",
"<code",
">",
"floorDivide",
"(",
"-",
"1",
"4",
")",
"<",
"/",
"code",
">",
"returns",
"<code",
">",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/util/calendar/CalendarUtils.java#L102-L110 |
jamesagnew/hapi-fhir | hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/FhirServerImpl.java | FhirServerImpl.unregisterOsgiProviders | @Override
public void unregisterOsgiProviders (Collection<Object> providers) throws FhirConfigurationException {
"""
Dynamically unregisters a list of providers with the RestfulServer
@param provider the providers to be unregistered
@throws FhirConfigurationException
"""
if (null == providers) {
thro... | java | @Override
public void unregisterOsgiProviders (Collection<Object> providers) throws FhirConfigurationException {
if (null == providers) {
throw new NullPointerException("FHIR Provider list cannot be null");
}
try {
for (Object provider : providers) {
log.trace("unregistered provider. class ["+provider.... | [
"@",
"Override",
"public",
"void",
"unregisterOsgiProviders",
"(",
"Collection",
"<",
"Object",
">",
"providers",
")",
"throws",
"FhirConfigurationException",
"{",
"if",
"(",
"null",
"==",
"providers",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"FHIR... | Dynamically unregisters a list of providers with the RestfulServer
@param provider the providers to be unregistered
@throws FhirConfigurationException | [
"Dynamically",
"unregisters",
"a",
"list",
"of",
"providers",
"with",
"the",
"RestfulServer"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/FhirServerImpl.java#L125-L140 |
pvanassen/ns-api | src/main/java/nl/pvanassen/ns/RequestBuilder.java | RequestBuilder.getPrijzen | public static ApiRequest<Prijzen> getPrijzen(String fromStation, String toStation) {
"""
Builds a request to get all fares for a ride between station from, to station to. See <a
href="http://www.ns.nl/api/api#api-documentatie-prijzen">prijzen</a>
@param fromStation Starting point of the trip
@param toStation ... | java | public static ApiRequest<Prijzen> getPrijzen(String fromStation, String toStation) {
return RequestBuilder.getPrijzen(fromStation, toStation, null, null);
} | [
"public",
"static",
"ApiRequest",
"<",
"Prijzen",
">",
"getPrijzen",
"(",
"String",
"fromStation",
",",
"String",
"toStation",
")",
"{",
"return",
"RequestBuilder",
".",
"getPrijzen",
"(",
"fromStation",
",",
"toStation",
",",
"null",
",",
"null",
")",
";",
... | Builds a request to get all fares for a ride between station from, to station to. See <a
href="http://www.ns.nl/api/api#api-documentatie-prijzen">prijzen</a>
@param fromStation Starting point of the trip
@param toStation End point of the trip
@return Request for getting the fares | [
"Builds",
"a",
"request",
"to",
"get",
"all",
"fares",
"for",
"a",
"ride",
"between",
"station",
"from",
"to",
"station",
"to",
".",
"See",
"<a",
"href",
"=",
"http",
":",
"//",
"www",
".",
"ns",
".",
"nl",
"/",
"api",
"/",
"api#api",
"-",
"documen... | train | https://github.com/pvanassen/ns-api/blob/e90e01028a0eb24006e4fddd4c85e7a25c4fe0ae/src/main/java/nl/pvanassen/ns/RequestBuilder.java#L96-L98 |
line/armeria | core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedBeanFactoryRegistry.java | AnnotatedBeanFactoryRegistry.register | static synchronized BeanFactoryId register(Class<?> clazz, Set<String> pathParams,
List<RequestObjectResolver> objectResolvers) {
"""
Returns a {@link BeanFactoryId} of the specified {@link Class} and {@code pathParams} for finding its
factory from the factory cache ... | java | static synchronized BeanFactoryId register(Class<?> clazz, Set<String> pathParams,
List<RequestObjectResolver> objectResolvers) {
final BeanFactoryId beanFactoryId = new BeanFactoryId(clazz, pathParams);
if (!factories.containsKey(beanFactoryId)) {
... | [
"static",
"synchronized",
"BeanFactoryId",
"register",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Set",
"<",
"String",
">",
"pathParams",
",",
"List",
"<",
"RequestObjectResolver",
">",
"objectResolvers",
")",
"{",
"final",
"BeanFactoryId",
"beanFactoryId",
"="... | Returns a {@link BeanFactoryId} of the specified {@link Class} and {@code pathParams} for finding its
factory from the factory cache later. | [
"Returns",
"a",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedBeanFactoryRegistry.java#L81-L94 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/validation/fieldvalidation/FieldFormatterRegistry.java | FieldFormatterRegistry.registerFormatter | public <T> void registerFormatter(final Class<T> requiredType, FieldFormatter<T> formatter) {
"""
クラスタイプを指定してフォーマッタを登録する。
@param <T> 処理対象のタイプ
@param requiredType クラスタイプ
@param formatter 登録対象のフォーマッタ
@throws IllegalArgumentException {@literal requiredType == null or formatter == null}
"""
ArgUtils.n... | java | public <T> void registerFormatter(final Class<T> requiredType, FieldFormatter<T> formatter) {
ArgUtils.notNull(requiredType, "requiredType");
ArgUtils.notNull(formatter, "formatter");
this.typeMap.put(requiredType, formatter);
} | [
"public",
"<",
"T",
">",
"void",
"registerFormatter",
"(",
"final",
"Class",
"<",
"T",
">",
"requiredType",
",",
"FieldFormatter",
"<",
"T",
">",
"formatter",
")",
"{",
"ArgUtils",
".",
"notNull",
"(",
"requiredType",
",",
"\"requiredType\"",
")",
";",
"Ar... | クラスタイプを指定してフォーマッタを登録する。
@param <T> 処理対象のタイプ
@param requiredType クラスタイプ
@param formatter 登録対象のフォーマッタ
@throws IllegalArgumentException {@literal requiredType == null or formatter == null} | [
"クラスタイプを指定してフォーマッタを登録する。"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/validation/fieldvalidation/FieldFormatterRegistry.java#L48-L54 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexController.java | CmsFlexController.setDateExpiresHeader | public static void setDateExpiresHeader(HttpServletResponse res, long dateExpires, long maxAge) {
"""
Sets the <code>Expires</code> date header for a given http request.<p>
Also sets the <code>cache-control: max-age</code> header to the time of the expiration.
A certain upper limit is imposed on the expiration... | java | public static void setDateExpiresHeader(HttpServletResponse res, long dateExpires, long maxAge) {
long now = System.currentTimeMillis();
if ((dateExpires > now) && (dateExpires != CmsResource.DATE_EXPIRED_DEFAULT)) {
// important: many caches (browsers or proxy) use the "Expires" header
... | [
"public",
"static",
"void",
"setDateExpiresHeader",
"(",
"HttpServletResponse",
"res",
",",
"long",
"dateExpires",
",",
"long",
"maxAge",
")",
"{",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"if",
"(",
"(",
"dateExpires",
">",
"no... | Sets the <code>Expires</code> date header for a given http request.<p>
Also sets the <code>cache-control: max-age</code> header to the time of the expiration.
A certain upper limit is imposed on the expiration date parameter to ensure the resources are
not cached to long in proxies. This can be controlled by the <code... | [
"Sets",
"the",
"<code",
">",
"Expires<",
"/",
"code",
">",
"date",
"header",
"for",
"a",
"given",
"http",
"request",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexController.java#L335-L361 |
alkacon/opencms-core | src/org/opencms/ui/CmsVaadinUtils.java | CmsVaadinUtils.visitDescendants | public static void visitDescendants(Component component, Predicate<Component> handler) {
"""
Visits all descendants of a given component (including the component itself) and applies a predicate
to each.<p>
If the predicate returns false for a component, no further descendants will be processed.<p>
@param co... | java | public static void visitDescendants(Component component, Predicate<Component> handler) {
List<Component> stack = Lists.newArrayList();
stack.add(component);
while (!stack.isEmpty()) {
Component currentComponent = stack.get(stack.size() - 1);
stack.remove(stack.size() - 1... | [
"public",
"static",
"void",
"visitDescendants",
"(",
"Component",
"component",
",",
"Predicate",
"<",
"Component",
">",
"handler",
")",
"{",
"List",
"<",
"Component",
">",
"stack",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"stack",
".",
"add",
"(",... | Visits all descendants of a given component (including the component itself) and applies a predicate
to each.<p>
If the predicate returns false for a component, no further descendants will be processed.<p>
@param component the component
@param handler the predicate | [
"Visits",
"all",
"descendants",
"of",
"a",
"given",
"component",
"(",
"including",
"the",
"component",
"itself",
")",
"and",
"applies",
"a",
"predicate",
"to",
"each",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsVaadinUtils.java#L1251-L1267 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/tuple/Triple.java | Triple.compareTo | @Override
public int compareTo(final Triple<L, M, R> other) {
"""
<p>Compares the triple based on the left element, followed by the middle element,
finally the right element.
The types must be {@code Comparable}.</p>
@param other the other triple, not null
@return negative if this is less, zero if equal... | java | @Override
public int compareTo(final Triple<L, M, R> other) {
return new CompareToBuilder().append(getLeft(), other.getLeft())
.append(getMiddle(), other.getMiddle())
.append(getRight(), other.getRight()).toComparison();
} | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"final",
"Triple",
"<",
"L",
",",
"M",
",",
"R",
">",
"other",
")",
"{",
"return",
"new",
"CompareToBuilder",
"(",
")",
".",
"append",
"(",
"getLeft",
"(",
")",
",",
"other",
".",
"getLeft",
"(",
... | <p>Compares the triple based on the left element, followed by the middle element,
finally the right element.
The types must be {@code Comparable}.</p>
@param other the other triple, not null
@return negative if this is less, zero if equal, positive if greater | [
"<p",
">",
"Compares",
"the",
"triple",
"based",
"on",
"the",
"left",
"element",
"followed",
"by",
"the",
"middle",
"element",
"finally",
"the",
"right",
"element",
".",
"The",
"types",
"must",
"be",
"{",
"@code",
"Comparable",
"}",
".",
"<",
"/",
"p",
... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/tuple/Triple.java#L96-L101 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.binary | public static void binary(ImageInputStream srcStream, ImageOutputStream destStream, String imageType) {
"""
彩色转为黑白黑白二值化图片<br>
此方法并不关闭流
@param srcStream 源图像流
@param destStream 目标图像流
@param imageType 图片格式(扩展名)
@since 4.0.5
"""
binary(read(srcStream), destStream, imageType);
} | java | public static void binary(ImageInputStream srcStream, ImageOutputStream destStream, String imageType) {
binary(read(srcStream), destStream, imageType);
} | [
"public",
"static",
"void",
"binary",
"(",
"ImageInputStream",
"srcStream",
",",
"ImageOutputStream",
"destStream",
",",
"String",
"imageType",
")",
"{",
"binary",
"(",
"read",
"(",
"srcStream",
")",
",",
"destStream",
",",
"imageType",
")",
";",
"}"
] | 彩色转为黑白黑白二值化图片<br>
此方法并不关闭流
@param srcStream 源图像流
@param destStream 目标图像流
@param imageType 图片格式(扩展名)
@since 4.0.5 | [
"彩色转为黑白黑白二值化图片<br",
">",
"此方法并不关闭流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L688-L690 |
deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/Atomic.java | Atomic.cas | public boolean cas(T expected, T newValue) {
"""
This method implements compare-and-swap
@param expected
@param newValue
@return true if value was swapped, false otherwise
"""
try {
lock.writeLock().lock();
if (Objects.equals(value, expected)) {
this.value ... | java | public boolean cas(T expected, T newValue) {
try {
lock.writeLock().lock();
if (Objects.equals(value, expected)) {
this.value = newValue;
return true;
} else
return false;
} finally {
lock.writeLock().unlock... | [
"public",
"boolean",
"cas",
"(",
"T",
"expected",
",",
"T",
"newValue",
")",
"{",
"try",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"if",
"(",
"Objects",
".",
"equals",
"(",
"value",
",",
"expected",
")",
")",
"{",
"this... | This method implements compare-and-swap
@param expected
@param newValue
@return true if value was swapped, false otherwise | [
"This",
"method",
"implements",
"compare",
"-",
"and",
"-",
"swap"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/Atomic.java#L76-L88 |
mgledi/DRUMS | src/main/java/com/unister/semweb/drums/util/KeyUtils.java | KeyUtils.compareKey | public static int compareKey(byte[] key1, byte[] key2) {
"""
Compares the two byte-arrays on the basis of unsigned bytes. The array will be compared by each element up to the
length of the smaller array. If all elements are equal and the array are not equal sized, the larger array is
seen as larger.
@param ke... | java | public static int compareKey(byte[] key1, byte[] key2) {
return compareKey(key1, key2, Math.min(key1.length, key2.length));
} | [
"public",
"static",
"int",
"compareKey",
"(",
"byte",
"[",
"]",
"key1",
",",
"byte",
"[",
"]",
"key2",
")",
"{",
"return",
"compareKey",
"(",
"key1",
",",
"key2",
",",
"Math",
".",
"min",
"(",
"key1",
".",
"length",
",",
"key2",
".",
"length",
")",... | Compares the two byte-arrays on the basis of unsigned bytes. The array will be compared by each element up to the
length of the smaller array. If all elements are equal and the array are not equal sized, the larger array is
seen as larger.
@param key1
@param key2
@return <0 if key1 < key2<br>
0 if key1 == key2<br>
>0... | [
"Compares",
"the",
"two",
"byte",
"-",
"arrays",
"on",
"the",
"basis",
"of",
"unsigned",
"bytes",
".",
"The",
"array",
"will",
"be",
"compared",
"by",
"each",
"element",
"up",
"to",
"the",
"length",
"of",
"the",
"smaller",
"array",
".",
"If",
"all",
"e... | train | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/util/KeyUtils.java#L88-L90 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/Minimap.java | Minimap.computeSheet | private void computeSheet(Map<TileRef, ColorRgba> colors, Integer sheet) {
"""
Compute the current sheet.
@param colors The colors data.
@param sheet The sheet number.
"""
final SpriteTiled tiles = map.getSheet(sheet);
final ImageBuffer tilesSurface = tiles.getSurface();
final in... | java | private void computeSheet(Map<TileRef, ColorRgba> colors, Integer sheet)
{
final SpriteTiled tiles = map.getSheet(sheet);
final ImageBuffer tilesSurface = tiles.getSurface();
final int tw = map.getTileWidth();
final int th = map.getTileHeight();
int number = 0;
... | [
"private",
"void",
"computeSheet",
"(",
"Map",
"<",
"TileRef",
",",
"ColorRgba",
">",
"colors",
",",
"Integer",
"sheet",
")",
"{",
"final",
"SpriteTiled",
"tiles",
"=",
"map",
".",
"getSheet",
"(",
"sheet",
")",
";",
"final",
"ImageBuffer",
"tilesSurface",
... | Compute the current sheet.
@param colors The colors data.
@param sheet The sheet number. | [
"Compute",
"the",
"current",
"sheet",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/Minimap.java#L162-L185 |
k3po/k3po | specification/socks5/src/main/java/org/kaazing/specification/socks5/internal/Functions.java | Functions.generateMIC | @Function
public static byte[] generateMIC(GSSContext context, MessageProp prop, byte[] message) {
"""
Generate a message integrity check for a given received message.
@param context GSSContext for which a connection has been established to the remote peer
@param prop the MessageProp used for exchanging mess... | java | @Function
public static byte[] generateMIC(GSSContext context, MessageProp prop, byte[] message) {
try {
// Ensure the default Quality-of-Protection is applied.
prop.setQOP(0);
byte[] initialToken = context.getMIC(message, 0, message.length, prop);
return ge... | [
"@",
"Function",
"public",
"static",
"byte",
"[",
"]",
"generateMIC",
"(",
"GSSContext",
"context",
",",
"MessageProp",
"prop",
",",
"byte",
"[",
"]",
"message",
")",
"{",
"try",
"{",
"// Ensure the default Quality-of-Protection is applied.",
"prop",
".",
"setQOP"... | Generate a message integrity check for a given received message.
@param context GSSContext for which a connection has been established to the remote peer
@param prop the MessageProp used for exchanging messages
@param message the bytes of the received message
@return the bytes of the message integrity check (like a che... | [
"Generate",
"a",
"message",
"integrity",
"check",
"for",
"a",
"given",
"received",
"message",
"."
] | train | https://github.com/k3po/k3po/blob/3ca4fd31ab4a397893aa640c62ada0e485c8bbd4/specification/socks5/src/main/java/org/kaazing/specification/socks5/internal/Functions.java#L242-L254 |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocal.java | ODataLocal.setRecord | public long setRecord(final long iPosition, final ORecordId iRid, final byte[] iContent) throws IOException {
"""
Set the record content in file.
@param iPosition
The previous record's offset
@param iContent
The content to write
@return The new record offset or the same received as parameter is the old spac... | java | public long setRecord(final long iPosition, final ORecordId iRid, final byte[] iContent) throws IOException {
acquireExclusiveLock();
try {
long[] pos = getRelativePosition(iPosition);
final OFile file = files[(int) pos[0]];
final int recordSize = file.readInt(pos[1]);
final in... | [
"public",
"long",
"setRecord",
"(",
"final",
"long",
"iPosition",
",",
"final",
"ORecordId",
"iRid",
",",
"final",
"byte",
"[",
"]",
"iContent",
")",
"throws",
"IOException",
"{",
"acquireExclusiveLock",
"(",
")",
";",
"try",
"{",
"long",
"[",
"]",
"pos",
... | Set the record content in file.
@param iPosition
The previous record's offset
@param iContent
The content to write
@return The new record offset or the same received as parameter is the old space was reused.
@throws IOException | [
"Set",
"the",
"record",
"content",
"in",
"file",
"."
] | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocal.java#L292-L333 |
bazaarvoice/jolt | jolt-core/src/main/java/com/bazaarvoice/jolt/utils/JoltUtils.java | JoltUtils.isBlankJson | public static boolean isBlankJson(final Object obj) {
"""
Given a json document checks if its jst blank doc, i.e. [] or {}
@param obj source
@return true if the json doc is [] or {}
"""
if (obj == null) {
return true;
}
if(obj instanceof Collection) {
return ... | java | public static boolean isBlankJson(final Object obj) {
if (obj == null) {
return true;
}
if(obj instanceof Collection) {
return (((Collection) obj).size() == 0);
}
if(obj instanceof Map) {
return (((Map) obj).size() == 0);
}
thro... | [
"public",
"static",
"boolean",
"isBlankJson",
"(",
"final",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"obj",
"instanceof",
"Collection",
")",
"{",
"return",
"(",
"(",
"(",
"Collection",
... | Given a json document checks if its jst blank doc, i.e. [] or {}
@param obj source
@return true if the json doc is [] or {} | [
"Given",
"a",
"json",
"document",
"checks",
"if",
"its",
"jst",
"blank",
"doc",
"i",
".",
"e",
".",
"[]",
"or",
"{}"
] | train | https://github.com/bazaarvoice/jolt/blob/4cf866a9f4222142da41b50dbcccce022a956bff/jolt-core/src/main/java/com/bazaarvoice/jolt/utils/JoltUtils.java#L287-L298 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java | BytecodeUtils.constantNull | public static Expression constantNull(Type type) {
"""
Returns an {@link Expression} with the given type that always returns null.
"""
checkArgument(
type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY,
"%s is not a reference type",
type);
return new Expression(type, F... | java | public static Expression constantNull(Type type) {
checkArgument(
type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY,
"%s is not a reference type",
type);
return new Expression(type, Feature.CHEAP) {
@Override
protected void doGen(CodeBuilder mv) {
mv.visit... | [
"public",
"static",
"Expression",
"constantNull",
"(",
"Type",
"type",
")",
"{",
"checkArgument",
"(",
"type",
".",
"getSort",
"(",
")",
"==",
"Type",
".",
"OBJECT",
"||",
"type",
".",
"getSort",
"(",
")",
"==",
"Type",
".",
"ARRAY",
",",
"\"%s is not a ... | Returns an {@link Expression} with the given type that always returns null. | [
"Returns",
"an",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java#L389-L400 |
mijecu25/dsa | src/main/java/com/mijecu25/dsa/algorithms/search/logarithmic/BinarySearch.java | BinarySearch.searchDescending | public static int searchDescending(short[] shortArray, short value) {
"""
Search for the value in the reverse sorted short array and return the index.
@param shortArray array that we are searching in.
@param value value that is being searched in the array.
@return the index where the value is found in the a... | java | public static int searchDescending(short[] shortArray, short value) {
int start = 0;
int end = shortArray.length - 1;
int middle = 0;
while(start <= end) {
middle = (start + end) >> 1;
if(value == shortArray[middle]) {
return mid... | [
"public",
"static",
"int",
"searchDescending",
"(",
"short",
"[",
"]",
"shortArray",
",",
"short",
"value",
")",
"{",
"int",
"start",
"=",
"0",
";",
"int",
"end",
"=",
"shortArray",
".",
"length",
"-",
"1",
";",
"int",
"middle",
"=",
"0",
";",
"while... | Search for the value in the reverse sorted short array and return the index.
@param shortArray array that we are searching in.
@param value value that is being searched in the array.
@return the index where the value is found in the array, else -1. | [
"Search",
"for",
"the",
"value",
"in",
"the",
"reverse",
"sorted",
"short",
"array",
"and",
"return",
"the",
"index",
"."
] | train | https://github.com/mijecu25/dsa/blob/a22971b746833e78a3939ae4de65e8f6bf2e3fd4/src/main/java/com/mijecu25/dsa/algorithms/search/logarithmic/BinarySearch.java#L505-L527 |
voldemort/voldemort | src/java/voldemort/versioning/VectorClock.java | VectorClock.incrementVersion | public void incrementVersion(int node, long time) {
"""
Increment the version info associated with the given node
@param node The node
"""
if(node < 0 || node > Short.MAX_VALUE)
throw new IllegalArgumentException(node
+ " is outside the acce... | java | public void incrementVersion(int node, long time) {
if(node < 0 || node > Short.MAX_VALUE)
throw new IllegalArgumentException(node
+ " is outside the acceptable range of node ids.");
this.timestamp = time;
Long version = versionMap.get... | [
"public",
"void",
"incrementVersion",
"(",
"int",
"node",
",",
"long",
"time",
")",
"{",
"if",
"(",
"node",
"<",
"0",
"||",
"node",
">",
"Short",
".",
"MAX_VALUE",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"node",
"+",
"\" is outside the acceptab... | Increment the version info associated with the given node
@param node The node | [
"Increment",
"the",
"version",
"info",
"associated",
"with",
"the",
"given",
"node"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/versioning/VectorClock.java#L205-L224 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseLongObj | @Nullable
public static Long parseLongObj (@Nullable final Object aObject) {
"""
Parse the given {@link Object} as {@link Long} with radix
{@value #DEFAULT_RADIX}.
@param aObject
The object to parse. May be <code>null</code>.
@return <code>null</code> if the object does not represent a valid value.
"""... | java | @Nullable
public static Long parseLongObj (@Nullable final Object aObject)
{
return parseLongObj (aObject, DEFAULT_RADIX, null);
} | [
"@",
"Nullable",
"public",
"static",
"Long",
"parseLongObj",
"(",
"@",
"Nullable",
"final",
"Object",
"aObject",
")",
"{",
"return",
"parseLongObj",
"(",
"aObject",
",",
"DEFAULT_RADIX",
",",
"null",
")",
";",
"}"
] | Parse the given {@link Object} as {@link Long} with radix
{@value #DEFAULT_RADIX}.
@param aObject
The object to parse. May be <code>null</code>.
@return <code>null</code> if the object does not represent a valid value. | [
"Parse",
"the",
"given",
"{",
"@link",
"Object",
"}",
"as",
"{",
"@link",
"Long",
"}",
"with",
"radix",
"{",
"@value",
"#DEFAULT_RADIX",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L1057-L1061 |
pravega/pravega | common/src/main/java/io/pravega/common/util/btree/BTreeIndex.java | BTreeIndex.locatePage | private CompletableFuture<PageWrapper> locatePage(ByteArraySegment key, PageCollection pageCollection, TimeoutTimer timer) {
"""
Locates the Leaf Page that contains or should contain the given Key.
@param key A ByteArraySegment that represents the Key to look up the Leaf Page for.
@param pageCollect... | java | private CompletableFuture<PageWrapper> locatePage(ByteArraySegment key, PageCollection pageCollection, TimeoutTimer timer) {
// Verify the sought key has the expected length.
Preconditions.checkArgument(key.getLength() == this.leafPageConfig.getKeyLength(), "Invalid key length.");
// Sanity che... | [
"private",
"CompletableFuture",
"<",
"PageWrapper",
">",
"locatePage",
"(",
"ByteArraySegment",
"key",
",",
"PageCollection",
"pageCollection",
",",
"TimeoutTimer",
"timer",
")",
"{",
"// Verify the sought key has the expected length.",
"Preconditions",
".",
"checkArgument",
... | Locates the Leaf Page that contains or should contain the given Key.
@param key A ByteArraySegment that represents the Key to look up the Leaf Page for.
@param pageCollection A PageCollection that contains already looked-up pages. Any newly looked up pages will be
inserted in this instance as well.
@param t... | [
"Locates",
"the",
"Leaf",
"Page",
"that",
"contains",
"or",
"should",
"contain",
"the",
"given",
"Key",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/BTreeIndex.java#L586-L602 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java | CacheProviderWrapper.internalInvalidateByDepId | @Override
public void internalInvalidateByDepId(Object id, int causeOfInvalidation, int source, boolean bFireIL) {
"""
This invalidates all entries in this Cache having a dependency
on this dependency id.
@param id dependency id.
@param causeOfInvalidation The cause of invalidation
@param source The sour... | java | @Override
public void internalInvalidateByDepId(Object id, int causeOfInvalidation, int source, boolean bFireIL) {
final String methodName = "internalInvalidateByDepId()";
if (tc.isDebugEnabled()) {
Tr.debug(tc, methodName + " cacheName=" + cacheName + " id=" + id);
}
thi... | [
"@",
"Override",
"public",
"void",
"internalInvalidateByDepId",
"(",
"Object",
"id",
",",
"int",
"causeOfInvalidation",
",",
"int",
"source",
",",
"boolean",
"bFireIL",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"internalInvalidateByDepId()\"",
";",
"if",
"... | This invalidates all entries in this Cache having a dependency
on this dependency id.
@param id dependency id.
@param causeOfInvalidation The cause of invalidation
@param source The source of invalidation (local or remote)
@param bFireIL True to fire invalidation event | [
"This",
"invalidates",
"all",
"entries",
"in",
"this",
"Cache",
"having",
"a",
"dependency",
"on",
"this",
"dependency",
"id",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java#L466-L474 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/LookasideCache.java | LookasideCache.addCache | void addCache(Path hdfsPath, Path localPath, long size) throws IOException {
"""
Adds an entry into the cache.
The size is the virtual size of this entry.
"""
localMetrics.numAdd++;
CacheEntry c = new CacheEntry(hdfsPath, localPath, size);
CacheEntry found = cacheMap.putIfAbsent(hdfsPath, c);
... | java | void addCache(Path hdfsPath, Path localPath, long size) throws IOException {
localMetrics.numAdd++;
CacheEntry c = new CacheEntry(hdfsPath, localPath, size);
CacheEntry found = cacheMap.putIfAbsent(hdfsPath, c);
if (found != null) {
// If entry was already in the cache, update its timestamp
... | [
"void",
"addCache",
"(",
"Path",
"hdfsPath",
",",
"Path",
"localPath",
",",
"long",
"size",
")",
"throws",
"IOException",
"{",
"localMetrics",
".",
"numAdd",
"++",
";",
"CacheEntry",
"c",
"=",
"new",
"CacheEntry",
"(",
"hdfsPath",
",",
"localPath",
",",
"s... | Adds an entry into the cache.
The size is the virtual size of this entry. | [
"Adds",
"an",
"entry",
"into",
"the",
"cache",
".",
"The",
"size",
"is",
"the",
"virtual",
"size",
"of",
"this",
"entry",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/LookasideCache.java#L199-L227 |
google/j2objc | translator/src/main/java/com/google/devtools/j2objc/util/ErrorUtil.java | ErrorUtil.fatalError | public static void fatalError(Throwable error, String path) {
"""
Report that an internal error happened when translating a specific source.
"""
StringWriter msg = new StringWriter();
PrintWriter writer = new PrintWriter(msg);
writer.println(String.format("internal error translating \"%s\"", path))... | java | public static void fatalError(Throwable error, String path) {
StringWriter msg = new StringWriter();
PrintWriter writer = new PrintWriter(msg);
writer.println(String.format("internal error translating \"%s\"", path));
error.printStackTrace(writer);
writer.flush();
error(msg.toString());
} | [
"public",
"static",
"void",
"fatalError",
"(",
"Throwable",
"error",
",",
"String",
"path",
")",
"{",
"StringWriter",
"msg",
"=",
"new",
"StringWriter",
"(",
")",
";",
"PrintWriter",
"writer",
"=",
"new",
"PrintWriter",
"(",
"msg",
")",
";",
"writer",
".",... | Report that an internal error happened when translating a specific source. | [
"Report",
"that",
"an",
"internal",
"error",
"happened",
"when",
"translating",
"a",
"specific",
"source",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/util/ErrorUtil.java#L161-L168 |
flow/caustic | lwjgl/src/main/java/com/flowpowered/caustic/lwjgl/LWJGLUtil.java | LWJGLUtil.deployNatives | public static boolean deployNatives(File directory) {
"""
Attempts to deploy the LWJGL native libraries into the given directory. The sub-directory "natives/PLATFORM_NAME" (where PLATFORM_NAME is the name of the platform) will be created inside, and
will contain the natives. The path to the natives property will ... | java | public static boolean deployNatives(File directory) {
final File nativesDir = new File(directory, getNativesDirectory());
nativesDir.mkdirs();
for (String nativeLib : getNativeLibraries()) {
final File nativeFile = new File(nativesDir, nativeLib);
if (!nativeFile.exists()... | [
"public",
"static",
"boolean",
"deployNatives",
"(",
"File",
"directory",
")",
"{",
"final",
"File",
"nativesDir",
"=",
"new",
"File",
"(",
"directory",
",",
"getNativesDirectory",
"(",
")",
")",
";",
"nativesDir",
".",
"mkdirs",
"(",
")",
";",
"for",
"(",... | Attempts to deploy the LWJGL native libraries into the given directory. The sub-directory "natives/PLATFORM_NAME" (where PLATFORM_NAME is the name of the platform) will be created inside, and
will contain the natives. The path to the natives property will be set, but the libraries not loaded. If any error is encountere... | [
"Attempts",
"to",
"deploy",
"the",
"LWJGL",
"native",
"libraries",
"into",
"the",
"given",
"directory",
".",
"The",
"sub",
"-",
"directory",
"natives",
"/",
"PLATFORM_NAME",
"(",
"where",
"PLATFORM_NAME",
"is",
"the",
"name",
"of",
"the",
"platform",
")",
"w... | train | https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/lwjgl/src/main/java/com/flowpowered/caustic/lwjgl/LWJGLUtil.java#L74-L92 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java | ServiceEndpointPoliciesInner.getByResourceGroupAsync | public Observable<ServiceEndpointPolicyInner> getByResourceGroupAsync(String resourceGroupName, String serviceEndpointPolicyName, String expand) {
"""
Gets the specified service Endpoint Policies in a specified resource group.
@param resourceGroupName The name of the resource group.
@param serviceEndpointPolic... | java | public Observable<ServiceEndpointPolicyInner> getByResourceGroupAsync(String resourceGroupName, String serviceEndpointPolicyName, String expand) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand).map(new Func1<ServiceResponse<ServiceEndpointPolicyInner>, Se... | [
"public",
"Observable",
"<",
"ServiceEndpointPolicyInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serviceEndpointPolicyName",
",",
"String",
"expand",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resource... | Gets the specified service Endpoint Policies in a specified resource group.
@param resourceGroupName The name of the resource group.
@param serviceEndpointPolicyName The name of the service endpoint policy.
@param expand Expands referenced resources.
@throws IllegalArgumentException thrown if parameters fail the valid... | [
"Gets",
"the",
"specified",
"service",
"Endpoint",
"Policies",
"in",
"a",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java#L383-L390 |
code4everything/util | src/main/java/com/zhazhapan/util/LoggerUtils.java | LoggerUtils.debug | public static void debug(Object object, String message, String... values) {
"""
调试
@param object 指定对象
@param message 消息
@param values 格式化参数
@since 1.0.8
"""
if (Checker.isNull(object)) {
debug(message, values);
} else {
debug(object.getClass(), message, values);
... | java | public static void debug(Object object, String message, String... values) {
if (Checker.isNull(object)) {
debug(message, values);
} else {
debug(object.getClass(), message, values);
}
} | [
"public",
"static",
"void",
"debug",
"(",
"Object",
"object",
",",
"String",
"message",
",",
"String",
"...",
"values",
")",
"{",
"if",
"(",
"Checker",
".",
"isNull",
"(",
"object",
")",
")",
"{",
"debug",
"(",
"message",
",",
"values",
")",
";",
"}"... | 调试
@param object 指定对象
@param message 消息
@param values 格式化参数
@since 1.0.8 | [
"调试"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/LoggerUtils.java#L202-L208 |
litsec/eidas-opensaml | opensaml3/src/main/java/se/litsec/eidas/opensaml/ext/RequestedAttributeTemplates.java | RequestedAttributeTemplates.DATE_OF_BIRTH | public static RequestedAttribute DATE_OF_BIRTH(Boolean isRequired, boolean includeFriendlyName) {
"""
Creates a {@code RequestedAttribute} object for the DateOfBirth attribute.
@param isRequired
flag to tell whether the attribute is required
@param includeFriendlyName
flag that tells whether the friendly nam... | java | public static RequestedAttribute DATE_OF_BIRTH(Boolean isRequired, boolean includeFriendlyName) {
return create(AttributeConstants.EIDAS_DATE_OF_BIRTH_ATTRIBUTE_NAME,
includeFriendlyName ? AttributeConstants.EIDAS_DATE_OF_BIRTH_ATTRIBUTE_FRIENDLY_NAME : null,
Attribute.URI_REFERENCE, isRequired);
} | [
"public",
"static",
"RequestedAttribute",
"DATE_OF_BIRTH",
"(",
"Boolean",
"isRequired",
",",
"boolean",
"includeFriendlyName",
")",
"{",
"return",
"create",
"(",
"AttributeConstants",
".",
"EIDAS_DATE_OF_BIRTH_ATTRIBUTE_NAME",
",",
"includeFriendlyName",
"?",
"AttributeCon... | Creates a {@code RequestedAttribute} object for the DateOfBirth attribute.
@param isRequired
flag to tell whether the attribute is required
@param includeFriendlyName
flag that tells whether the friendly name should be included
@return a {@code RequestedAttribute} object representing the DateOfBirth attribute | [
"Creates",
"a",
"{",
"@code",
"RequestedAttribute",
"}",
"object",
"for",
"the",
"DateOfBirth",
"attribute",
"."
] | train | https://github.com/litsec/eidas-opensaml/blob/522ba6dba433a9524cb8a02464cc3b087b47a2b7/opensaml3/src/main/java/se/litsec/eidas/opensaml/ext/RequestedAttributeTemplates.java#L86-L90 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Address.java | Address.fromKey | public static Address fromKey(final NetworkParameters params, final ECKey key, final ScriptType outputScriptType) {
"""
Construct an {@link Address} that represents the public part of the given {@link ECKey}.
@param params
network this address is valid for
@param key
only the public part is used
@param outp... | java | public static Address fromKey(final NetworkParameters params, final ECKey key, final ScriptType outputScriptType) {
if (outputScriptType == Script.ScriptType.P2PKH)
return LegacyAddress.fromKey(params, key);
else if (outputScriptType == Script.ScriptType.P2WPKH)
return SegwitAddr... | [
"public",
"static",
"Address",
"fromKey",
"(",
"final",
"NetworkParameters",
"params",
",",
"final",
"ECKey",
"key",
",",
"final",
"ScriptType",
"outputScriptType",
")",
"{",
"if",
"(",
"outputScriptType",
"==",
"Script",
".",
"ScriptType",
".",
"P2PKH",
")",
... | Construct an {@link Address} that represents the public part of the given {@link ECKey}.
@param params
network this address is valid for
@param key
only the public part is used
@param outputScriptType
script type the address should use
@return constructed address | [
"Construct",
"an",
"{",
"@link",
"Address",
"}",
"that",
"represents",
"the",
"public",
"part",
"of",
"the",
"given",
"{",
"@link",
"ECKey",
"}",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Address.java#L82-L89 |
magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/NodeAvailabilityCache.java | NodeAvailabilityCache.setNodeAvailable | @CheckForNull
@SuppressWarnings( "NP_BOOLEAN_RETURN_NULL" )
public Boolean setNodeAvailable( final K key, final boolean available ) {
"""
If the specified key is not already associated with a value or if it's
associated with a different value, associate it with the given value.
This is equivalent to
<... | java | @CheckForNull
@SuppressWarnings( "NP_BOOLEAN_RETURN_NULL" )
public Boolean setNodeAvailable( final K key, final boolean available ) {
final ManagedItem<Boolean> item = _map.get( key );
final Boolean availableObj = Boolean.valueOf( available );
if ( item == null || item._value != availabl... | [
"@",
"CheckForNull",
"@",
"SuppressWarnings",
"(",
"\"NP_BOOLEAN_RETURN_NULL\"",
")",
"public",
"Boolean",
"setNodeAvailable",
"(",
"final",
"K",
"key",
",",
"final",
"boolean",
"available",
")",
"{",
"final",
"ManagedItem",
"<",
"Boolean",
">",
"item",
"=",
"_m... | If the specified key is not already associated with a value or if it's
associated with a different value, associate it with the given value.
This is equivalent to
<pre>
<code> if (map.get(key) == null || !map.get(key).equals(value))
return map.put(key, value);
else
return map.get(key);
</code>
</pre>
except that the ... | [
"If",
"the",
"specified",
"key",
"is",
"not",
"already",
"associated",
"with",
"a",
"value",
"or",
"if",
"it",
"s",
"associated",
"with",
"a",
"different",
"value",
"associate",
"it",
"with",
"the",
"given",
"value",
".",
"This",
"is",
"equivalent",
"to"
] | train | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/NodeAvailabilityCache.java#L91-L105 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/domassign/DirectAnalyzer.java | DirectAnalyzer.getElementStyle | public NodeData getElementStyle(Element el, PseudoElementType pseudo, String media) {
"""
Computes the style of an element with an eventual pseudo element for the given media.
@param el The DOM element.
@param pseudo A pseudo element that should be used for style computation or <code>null</code> if no pseudo ele... | java | public NodeData getElementStyle(Element el, PseudoElementType pseudo, String media)
{
return getElementStyle(el, pseudo, new MediaSpec(media));
} | [
"public",
"NodeData",
"getElementStyle",
"(",
"Element",
"el",
",",
"PseudoElementType",
"pseudo",
",",
"String",
"media",
")",
"{",
"return",
"getElementStyle",
"(",
"el",
",",
"pseudo",
",",
"new",
"MediaSpec",
"(",
"media",
")",
")",
";",
"}"
] | Computes the style of an element with an eventual pseudo element for the given media.
@param el The DOM element.
@param pseudo A pseudo element that should be used for style computation or <code>null</code> if no pseudo element should be used (e.g. :after).
@param media Used media name (e.g. "screen" or "all")
@return ... | [
"Computes",
"the",
"style",
"of",
"an",
"element",
"with",
"an",
"eventual",
"pseudo",
"element",
"for",
"the",
"given",
"media",
"."
] | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/domassign/DirectAnalyzer.java#L70-L73 |
schallee/alib4j | servlet/src/main/java/net/darkmist/alib/servlet/SerializableRequestDispatcher.java | SerializableRequestDispatcher.readObject | private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
"""
Custom deserialization. This handles setting transient fields
through @{link #init()}.
"""
// this should set servlet...
in.defaultReadObject();
try
{
init();
}
catch(ServletException e)
{ // This c... | java | private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
// this should set servlet...
in.defaultReadObject();
try
{
init();
}
catch(ServletException e)
{ // This could happen if it is deserialized in
// a container where the name or path does not
// exist. I ca... | [
"private",
"void",
"readObject",
"(",
"ObjectInputStream",
"in",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"// this should set servlet...",
"in",
".",
"defaultReadObject",
"(",
")",
";",
"try",
"{",
"init",
"(",
")",
";",
"}",
"catch",
"(... | Custom deserialization. This handles setting transient fields
through @{link #init()}. | [
"Custom",
"deserialization",
".",
"This",
"handles",
"setting",
"transient",
"fields",
"through"
] | train | https://github.com/schallee/alib4j/blob/0e0718aee574bbb62268e1cf58e99286529ce529/servlet/src/main/java/net/darkmist/alib/servlet/SerializableRequestDispatcher.java#L102-L117 |
apereo/cas | support/cas-server-support-validation/src/main/java/org/apereo/cas/web/view/attributes/DefaultCas30ProtocolAttributesRenderer.java | DefaultCas30ProtocolAttributesRenderer.buildSingleAttributeDefinitionLine | protected String buildSingleAttributeDefinitionLine(final String attributeName, final Object value) {
"""
Build single attribute definition line.
@param attributeName the attribute name
@param value the value
@return the string
"""
return new StringBuilder()
.append("<cas:".con... | java | protected String buildSingleAttributeDefinitionLine(final String attributeName, final Object value) {
return new StringBuilder()
.append("<cas:".concat(attributeName).concat(">"))
.append(encodeAttributeValue(value))
.append("</cas:".concat(attributeName).concat(">"))
... | [
"protected",
"String",
"buildSingleAttributeDefinitionLine",
"(",
"final",
"String",
"attributeName",
",",
"final",
"Object",
"value",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
")",
".",
"append",
"(",
"\"<cas:\"",
".",
"concat",
"(",
"attributeName",
")",
... | Build single attribute definition line.
@param attributeName the attribute name
@param value the value
@return the string | [
"Build",
"single",
"attribute",
"definition",
"line",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-validation/src/main/java/org/apereo/cas/web/view/attributes/DefaultCas30ProtocolAttributesRenderer.java#L45-L51 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java | EventListenerSupport.addListener | public void addListener(final L listener, final boolean allowDuplicate) {
"""
Registers an event listener. Will not add a pre-existing listener
object to the list if <code>allowDuplicate</code> is false.
@param listener the event listener (may not be <code>null</code>).
@param allowDuplicate the flag for det... | java | public void addListener(final L listener, final boolean allowDuplicate) {
Validate.notNull(listener, "Listener object cannot be null.");
if (allowDuplicate) {
listeners.add(listener);
} else if (!listeners.contains(listener)) {
listeners.add(listener);
}
} | [
"public",
"void",
"addListener",
"(",
"final",
"L",
"listener",
",",
"final",
"boolean",
"allowDuplicate",
")",
"{",
"Validate",
".",
"notNull",
"(",
"listener",
",",
"\"Listener object cannot be null.\"",
")",
";",
"if",
"(",
"allowDuplicate",
")",
"{",
"listen... | Registers an event listener. Will not add a pre-existing listener
object to the list if <code>allowDuplicate</code> is false.
@param listener the event listener (may not be <code>null</code>).
@param allowDuplicate the flag for determining if duplicate listener
objects are allowed to be registered.
@throws NullPoint... | [
"Registers",
"an",
"event",
"listener",
".",
"Will",
"not",
"add",
"a",
"pre",
"-",
"existing",
"listener",
"object",
"to",
"the",
"list",
"if",
"<code",
">",
"allowDuplicate<",
"/",
"code",
">",
"is",
"false",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java#L199-L206 |
sarxos/webcam-capture | webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamUtils.java | WebcamUtils.getImageByteBuffer | public static final ByteBuffer getImageByteBuffer(Webcam webcam, String format) {
"""
Capture image as BYteBuffer.
@param webcam the webcam from which image should be obtained
@param format the file format
@return Byte buffer
"""
return ByteBuffer.wrap(getImageBytes(webcam, format));
} | java | public static final ByteBuffer getImageByteBuffer(Webcam webcam, String format) {
return ByteBuffer.wrap(getImageBytes(webcam, format));
} | [
"public",
"static",
"final",
"ByteBuffer",
"getImageByteBuffer",
"(",
"Webcam",
"webcam",
",",
"String",
"format",
")",
"{",
"return",
"ByteBuffer",
".",
"wrap",
"(",
"getImageBytes",
"(",
"webcam",
",",
"format",
")",
")",
";",
"}"
] | Capture image as BYteBuffer.
@param webcam the webcam from which image should be obtained
@param format the file format
@return Byte buffer | [
"Capture",
"image",
"as",
"BYteBuffer",
"."
] | train | https://github.com/sarxos/webcam-capture/blob/efbdae04f9ba48db9ec621e94a9bcd6f031882c8/webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamUtils.java#L65-L67 |
adyliu/jafka | src/main/java/io/jafka/consumer/StringConsumers.java | StringConsumers.buildConsumer | public static StringConsumers buildConsumer(Properties props, final String topic,//
final String groupId,//
final IMessageListener<String> listener,//
final int threads
) {... | java | public static StringConsumers buildConsumer(Properties props, final String topic,//
final String groupId,//
final IMessageListener<String> listener,//
final int threads
) {... | [
"public",
"static",
"StringConsumers",
"buildConsumer",
"(",
"Properties",
"props",
",",
"final",
"String",
"topic",
",",
"//",
"final",
"String",
"groupId",
",",
"//",
"final",
"IMessageListener",
"<",
"String",
">",
"listener",
",",
"//",
"final",
"int",
"th... | build a callback consumer
@param props consumer configuration
@param topic the topic to be watched
@param groupId grouping the consumer clients
@param listener message listener
@param threads threads of consumer per topic
@return the real consumer | [
"build",
"a",
"callback",
"consumer"
] | train | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/consumer/StringConsumers.java#L74-L84 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleCache.java | StyleCache.setStyle | public boolean setStyle(PolygonOptions polygonOptions, StyleRow style) {
"""
Set the style into the polygon options
@param polygonOptions polygon options
@param style style row
@return true if style was set into the polygon options
"""
return StyleUtils.setStyle(polygonOptions, style, den... | java | public boolean setStyle(PolygonOptions polygonOptions, StyleRow style) {
return StyleUtils.setStyle(polygonOptions, style, density);
} | [
"public",
"boolean",
"setStyle",
"(",
"PolygonOptions",
"polygonOptions",
",",
"StyleRow",
"style",
")",
"{",
"return",
"StyleUtils",
".",
"setStyle",
"(",
"polygonOptions",
",",
"style",
",",
"density",
")",
";",
"}"
] | Set the style into the polygon options
@param polygonOptions polygon options
@param style style row
@return true if style was set into the polygon options | [
"Set",
"the",
"style",
"into",
"the",
"polygon",
"options"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleCache.java#L334-L336 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/ArrayMap.java | ArrayMap.put | @Override
public final V put(K key, V value) {
"""
Sets the value for the given key, overriding any existing value.
@return previous value or {@code null} for none
"""
int index = getIndexOfKey(key);
if (index == -1) {
index = this.size;
}
return set(index, key, value);
} | java | @Override
public final V put(K key, V value) {
int index = getIndexOfKey(key);
if (index == -1) {
index = this.size;
}
return set(index, key, value);
} | [
"@",
"Override",
"public",
"final",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"int",
"index",
"=",
"getIndexOfKey",
"(",
"key",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"index",
"=",
"this",
".",
"size",
";",
"}",... | Sets the value for the given key, overriding any existing value.
@return previous value or {@code null} for none | [
"Sets",
"the",
"value",
"for",
"the",
"given",
"key",
"overriding",
"any",
"existing",
"value",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/ArrayMap.java#L198-L205 |
ggrandes/kvstore | src/main/java/org/javastack/kvstore/structures/btree/BplusTree.java | BplusTree.ceilingEntry | public synchronized TreeEntry<K, V> ceilingEntry(final K key) {
"""
Returns the least key greater than or equal to the given key, or null if there is no such key.
@param key the key
@return the Entry with least key greater than or equal to key, or null if there is no such key
"""
// Retorna la clave mas ... | java | public synchronized TreeEntry<K, V> ceilingEntry(final K key) {
// Retorna la clave mas cercana mayor o igual a la clave indicada
return getRoundEntry(key, true, true);
} | [
"public",
"synchronized",
"TreeEntry",
"<",
"K",
",",
"V",
">",
"ceilingEntry",
"(",
"final",
"K",
"key",
")",
"{",
"// Retorna la clave mas cercana mayor o igual a la clave indicada",
"return",
"getRoundEntry",
"(",
"key",
",",
"true",
",",
"true",
")",
";",
"}"
... | Returns the least key greater than or equal to the given key, or null if there is no such key.
@param key the key
@return the Entry with least key greater than or equal to key, or null if there is no such key | [
"Returns",
"the",
"least",
"key",
"greater",
"than",
"or",
"equal",
"to",
"the",
"given",
"key",
"or",
"null",
"if",
"there",
"is",
"no",
"such",
"key",
"."
] | train | https://github.com/ggrandes/kvstore/blob/c79277f79f4604e0fec8349a98519838e3de38f0/src/main/java/org/javastack/kvstore/structures/btree/BplusTree.java#L649-L652 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/FileFixture.java | FileFixture.createContainingValue | public String createContainingValue(String filename, String key) {
"""
Creates new file, containing value 'key'.
@param filename name of file to create.
@param key key whose value should be used to generate the file.
@return file created.
"""
Object data = value(key);
if (data == null) {
... | java | public String createContainingValue(String filename, String key) {
Object data = value(key);
if (data == null) {
throw new SlimFixtureException(false, "No value for key: " + key);
}
return createContaining(filename, data);
} | [
"public",
"String",
"createContainingValue",
"(",
"String",
"filename",
",",
"String",
"key",
")",
"{",
"Object",
"data",
"=",
"value",
"(",
"key",
")",
";",
"if",
"(",
"data",
"==",
"null",
")",
"{",
"throw",
"new",
"SlimFixtureException",
"(",
"false",
... | Creates new file, containing value 'key'.
@param filename name of file to create.
@param key key whose value should be used to generate the file.
@return file created. | [
"Creates",
"new",
"file",
"containing",
"value",
"key",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/FileFixture.java#L54-L60 |
logic-ng/LogicNG | src/main/java/org/logicng/io/readers/FormulaReader.java | FormulaReader.readPropositionalFormula | public static Formula readPropositionalFormula(final String fileName, final FormulaFactory f) throws IOException, ParserException {
"""
Reads a given file and returns the contained propositional formula.
@param fileName the file name
@param f the formula factory
@return the parsed formula
@throws IOExce... | java | public static Formula readPropositionalFormula(final String fileName, final FormulaFactory f) throws IOException, ParserException {
return read(new File(fileName), new PropositionalParser(f));
} | [
"public",
"static",
"Formula",
"readPropositionalFormula",
"(",
"final",
"String",
"fileName",
",",
"final",
"FormulaFactory",
"f",
")",
"throws",
"IOException",
",",
"ParserException",
"{",
"return",
"read",
"(",
"new",
"File",
"(",
"fileName",
")",
",",
"new",... | Reads a given file and returns the contained propositional formula.
@param fileName the file name
@param f the formula factory
@return the parsed formula
@throws IOException if there was a problem reading the file
@throws ParserException if there was a problem parsing the formula | [
"Reads",
"a",
"given",
"file",
"and",
"returns",
"the",
"contained",
"propositional",
"formula",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/io/readers/FormulaReader.java#L68-L70 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_resource_sw.java | xen_health_resource_sw.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
xen_health_resource_sw_responses result = (xen_health_resource_sw_respo... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_health_resource_sw_responses result = (xen_health_resource_sw_responses) service.get_payload_formatter().string_to_resource(xen_health_resource_sw_responses.class, response);
if(result.errorcode != 0... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"xen_health_resource_sw_responses",
"result",
"=",
"(",
"xen_health_resource_sw_responses",
")",
"service",
".",... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_resource_sw.java#L173-L190 |
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.updateCompositeEntity | public OperationStatus updateCompositeEntity(UUID appId, String versionId, UUID cEntityId, CompositeEntityModel compositeModelUpdateObject) {
"""
Updates the composite entity extractor.
@param appId The application ID.
@param versionId The version ID.
@param cEntityId The composite entity extractor ID.
@para... | java | public OperationStatus updateCompositeEntity(UUID appId, String versionId, UUID cEntityId, CompositeEntityModel compositeModelUpdateObject) {
return updateCompositeEntityWithServiceResponseAsync(appId, versionId, cEntityId, compositeModelUpdateObject).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"updateCompositeEntity",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"cEntityId",
",",
"CompositeEntityModel",
"compositeModelUpdateObject",
")",
"{",
"return",
"updateCompositeEntityWithServiceResponseAsync",
"(",
"appId",
",... | Updates the composite entity extractor.
@param appId The application ID.
@param versionId The version ID.
@param cEntityId The composite entity extractor ID.
@param compositeModelUpdateObject A model object containing the new entity extractor name and children.
@throws IllegalArgumentException thrown if parameters fai... | [
"Updates",
"the",
"composite",
"entity",
"extractor",
"."
] | 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#L4029-L4031 |
deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/base/Preconditions.java | Preconditions.checkState | public static void checkState(boolean b, String message, Object... args) {
"""
Check the specified boolean argument. Throws an IllegalStateException with the specified message if {@code b} is false.
Note that the message may specify argument locations using "%s" - for example,
{@code checkArgument(false, "Got %s... | java | public static void checkState(boolean b, String message, Object... args) {
if (!b) {
throwStateEx(message, args);
}
} | [
"public",
"static",
"void",
"checkState",
"(",
"boolean",
"b",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"b",
")",
"{",
"throwStateEx",
"(",
"message",
",",
"args",
")",
";",
"}",
"}"
] | Check the specified boolean argument. Throws an IllegalStateException with the specified message if {@code b} is false.
Note that the message may specify argument locations using "%s" - for example,
{@code checkArgument(false, "Got %s values, expected %s", 3, "more"} would throw an IllegalStateException
with the messag... | [
"Check",
"the",
"specified",
"boolean",
"argument",
".",
"Throws",
"an",
"IllegalStateException",
"with",
"the",
"specified",
"message",
"if",
"{",
"@code",
"b",
"}",
"is",
"false",
".",
"Note",
"that",
"the",
"message",
"may",
"specify",
"argument",
"location... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/base/Preconditions.java#L444-L448 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/ConditionalFunctions.java | ConditionalFunctions.ifNaNOrInf | public static Expression ifNaNOrInf(Expression expression1, Expression expression2, Expression... others) {
"""
Returned expression results in first non-MISSING, non-Inf, or non-NaN number.
Returns MISSING or NULL if a non-number input is encountered first.
"""
return build("IFNANORINF", expression1, ... | java | public static Expression ifNaNOrInf(Expression expression1, Expression expression2, Expression... others) {
return build("IFNANORINF", expression1, expression2, others);
} | [
"public",
"static",
"Expression",
"ifNaNOrInf",
"(",
"Expression",
"expression1",
",",
"Expression",
"expression2",
",",
"Expression",
"...",
"others",
")",
"{",
"return",
"build",
"(",
"\"IFNANORINF\"",
",",
"expression1",
",",
"expression2",
",",
"others",
")",
... | Returned expression results in first non-MISSING, non-Inf, or non-NaN number.
Returns MISSING or NULL if a non-number input is encountered first. | [
"Returned",
"expression",
"results",
"in",
"first",
"non",
"-",
"MISSING",
"non",
"-",
"Inf",
"or",
"non",
"-",
"NaN",
"number",
".",
"Returns",
"MISSING",
"or",
"NULL",
"if",
"a",
"non",
"-",
"number",
"input",
"is",
"encountered",
"first",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/ConditionalFunctions.java#L116-L118 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/reportv2/ReportClient.java | ReportClient.getGroupStatistic | public GroupStatListResult getGroupStatistic(String start, int duration)
throws APIConnectionException, APIRequestException {
"""
Get group statistic, time unit only supports DAY now.
@param start Format: yyyy-MM-dd
@param duration duration must between 0 and 60
@return {@link GroupStatListResult}
... | java | public GroupStatListResult getGroupStatistic(String start, int duration)
throws APIConnectionException, APIRequestException {
Preconditions.checkArgument(verifyDateFormat("DAY", start), "Illegal date format");
Preconditions.checkArgument(0 <= duration && duration <= 60, " 0 <= duration <= 60... | [
"public",
"GroupStatListResult",
"getGroupStatistic",
"(",
"String",
"start",
",",
"int",
"duration",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"verifyDateFormat",
"(",
"\"DAY\"",
",",
"start",
... | Get group statistic, time unit only supports DAY now.
@param start Format: yyyy-MM-dd
@param duration duration must between 0 and 60
@return {@link GroupStatListResult}
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Get",
"group",
"statistic",
"time",
"unit",
"only",
"supports",
"DAY",
"now",
"."
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/reportv2/ReportClient.java#L296-L303 |
TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocket.java | WebSocket.sendContinuation | public WebSocket sendContinuation(String payload, boolean fin) {
"""
Send a continuation frame to the server.
<p>
This method is an alias of {@link #sendFrame(WebSocketFrame)
sendFrame}{@code (WebSocketFrame.}{@link
WebSocketFrame#createContinuationFrame(String)
createContinuationFrame}{@code (payload).}{@l... | java | public WebSocket sendContinuation(String payload, boolean fin)
{
return sendFrame(WebSocketFrame.createContinuationFrame(payload).setFin(fin));
} | [
"public",
"WebSocket",
"sendContinuation",
"(",
"String",
"payload",
",",
"boolean",
"fin",
")",
"{",
"return",
"sendFrame",
"(",
"WebSocketFrame",
".",
"createContinuationFrame",
"(",
"payload",
")",
".",
"setFin",
"(",
"fin",
")",
")",
";",
"}"
] | Send a continuation frame to the server.
<p>
This method is an alias of {@link #sendFrame(WebSocketFrame)
sendFrame}{@code (WebSocketFrame.}{@link
WebSocketFrame#createContinuationFrame(String)
createContinuationFrame}{@code (payload).}{@link
WebSocketFrame#setFin(boolean) setFin}{@code (fin))}.
</p>
@param payload
T... | [
"Send",
"a",
"continuation",
"frame",
"to",
"the",
"server",
"."
] | train | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocket.java#L2859-L2862 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEnginesInner.java | BackupEnginesInner.getAsync | public Observable<Page<BackupEngineBaseResourceInner>> getAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) {
"""
The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers.
@param vaultName The name of ... | java | public Observable<Page<BackupEngineBaseResourceInner>> getAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) {
return getWithServiceResponseAsync(vaultName, resourceGroupName, filter, skipToken)
.map(new Func1<ServiceResponse<Page<BackupEngineB... | [
"public",
"Observable",
"<",
"Page",
"<",
"BackupEngineBaseResourceInner",
">",
">",
"getAsync",
"(",
"final",
"String",
"vaultName",
",",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"filter",
",",
"final",
"String",
"skipToken",
")",
"{",
"r... | The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers.
@param vaultName The name of the Recovery Services vault.
@param resourceGroupName The name of the resource group associated with the Recovery Services vault.
@param filter Use this filter to choose the spec... | [
"The",
"backup",
"management",
"servers",
"registered",
"to",
"a",
"Recovery",
"Services",
"vault",
".",
"This",
"returns",
"a",
"pageable",
"list",
"of",
"servers",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEnginesInner.java#L242-L250 |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/SourceLocator.java | SourceLocator.scanTo | @Private Location scanTo(int index) {
"""
Scans from {@code nextIndex} to {@code ind} and saves all indices of line break characters
into {@code lineBreakIndices} and adjusts the current column number as it goes. The location of
the character on {@code ind} is returned.
<p> After this method returns, {@code n... | java | @Private Location scanTo(int index) {
boolean eof = false;
if (index == source.length()) { // The eof has index size() + 1
eof = true;
index--;
}
int columnIndex = nextColumnIndex;
for (int i = nextIndex; i <= index; i++) {
char c = source.charAt(i);
if (c == LINE_BREAK) {
... | [
"@",
"Private",
"Location",
"scanTo",
"(",
"int",
"index",
")",
"{",
"boolean",
"eof",
"=",
"false",
";",
"if",
"(",
"index",
"==",
"source",
".",
"length",
"(",
")",
")",
"{",
"// The eof has index size() + 1",
"eof",
"=",
"true",
";",
"index",
"--",
... | Scans from {@code nextIndex} to {@code ind} and saves all indices of line break characters
into {@code lineBreakIndices} and adjusts the current column number as it goes. The location of
the character on {@code ind} is returned.
<p> After this method returns, {@code nextIndex} and {@code nextColumnIndex} will point to... | [
"Scans",
"from",
"{",
"@code",
"nextIndex",
"}",
"to",
"{",
"@code",
"ind",
"}",
"and",
"saves",
"all",
"indices",
"of",
"line",
"break",
"characters",
"into",
"{",
"@code",
"lineBreakIndices",
"}",
"and",
"adjusts",
"the",
"current",
"column",
"number",
"... | train | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/SourceLocator.java#L102-L123 |
nikolavp/approval | approval-core/src/main/java/com/github/approval/Pre.java | Pre.notNull | public static void notNull(@Nullable Object value, String name) {
"""
Verify that a value is not null.
@param value the value to verify
@param name the name of the value that will be used in the exception message.
"""
if (value == null) {
throw new IllegalArgumentException(name + " must... | java | public static void notNull(@Nullable Object value, String name) {
if (value == null) {
throw new IllegalArgumentException(name + " must not be null!");
}
} | [
"public",
"static",
"void",
"notNull",
"(",
"@",
"Nullable",
"Object",
"value",
",",
"String",
"name",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"name",
"+",
"\" must not be null!\"",
")",
";",
"... | Verify that a value is not null.
@param value the value to verify
@param name the name of the value that will be used in the exception message. | [
"Verify",
"that",
"a",
"value",
"is",
"not",
"null",
"."
] | train | https://github.com/nikolavp/approval/blob/5e32ecc3bc7f631e94a7049894fdd99a3aa5b1b8/approval-core/src/main/java/com/github/approval/Pre.java#L39-L43 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.callUninterruptibly | public static <T> T callUninterruptibly(final long timeoutInMillis, final Try.LongFunction<T, InterruptedException> cmd) {
"""
Note: Copied from Google Guava under Apache License v2.0
<br />
<br />
If a thread is interrupted during such a call, the call continues to block until the result is available or the
... | java | public static <T> T callUninterruptibly(final long timeoutInMillis, final Try.LongFunction<T, InterruptedException> cmd) {
N.checkArgNotNull(cmd);
boolean interrupted = false;
try {
long remainingMillis = timeoutInMillis;
final long sysMillis = System.currentTime... | [
"public",
"static",
"<",
"T",
">",
"T",
"callUninterruptibly",
"(",
"final",
"long",
"timeoutInMillis",
",",
"final",
"Try",
".",
"LongFunction",
"<",
"T",
",",
"InterruptedException",
">",
"cmd",
")",
"{",
"N",
".",
"checkArgNotNull",
"(",
"cmd",
")",
";"... | Note: Copied from Google Guava under Apache License v2.0
<br />
<br />
If a thread is interrupted during such a call, the call continues to block until the result is available or the
timeout elapses, and only then re-interrupts the thread.
@param timeoutInMillis
@param cmd
@return | [
"Note",
":",
"Copied",
"from",
"Google",
"Guava",
"under",
"Apache",
"License",
"v2",
".",
"0",
"<br",
"/",
">",
"<br",
"/",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L28069-L28092 |
bsblabs/embed-for-vaadin | com.bsb.common.vaadin.embed/src/main/java/com/bsb/common/vaadin/embed/EmbedVaadinConfig.java | EmbedVaadinConfig.buildUrl | static String buildUrl(int httpPort, String context) {
"""
Build a url for the specified port and context.
<p/>
If the <tt>httpPort</tt> is equal to {@link #PORT_AUTO}, the
returned url is not used as is because no http port has been
allocated yet.
@param httpPort the http port to use
@param context the co... | java | static String buildUrl(int httpPort, String context) {
final StringBuilder sb = new StringBuilder();
sb.append("http://localhost:");
if (httpPort == PORT_AUTO) {
sb.append("[auto]");
} else {
sb.append(httpPort);
}
sb.append(context);
retu... | [
"static",
"String",
"buildUrl",
"(",
"int",
"httpPort",
",",
"String",
"context",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"http://localhost:\"",
")",
";",
"if",
"(",
"httpPort",
"=="... | Build a url for the specified port and context.
<p/>
If the <tt>httpPort</tt> is equal to {@link #PORT_AUTO}, the
returned url is not used as is because no http port has been
allocated yet.
@param httpPort the http port to use
@param context the context of the url
@return a <tt>localhost</tt> url for the specified por... | [
"Build",
"a",
"url",
"for",
"the",
"specified",
"port",
"and",
"context",
".",
"<p",
"/",
">",
"If",
"the",
"<tt",
">",
"httpPort<",
"/",
"tt",
">",
"is",
"equal",
"to",
"{",
"@link",
"#PORT_AUTO",
"}",
"the",
"returned",
"url",
"is",
"not",
"used",
... | train | https://github.com/bsblabs/embed-for-vaadin/blob/f902e70def56ab54d287d2600f9c6eef9e66c225/com.bsb.common.vaadin.embed/src/main/java/com/bsb/common/vaadin/embed/EmbedVaadinConfig.java#L417-L428 |
LearnLib/learnlib | algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java | AbstractTTTLearner.refineHypothesisSingle | protected boolean refineHypothesisSingle(DefaultQuery<I, D> ceQuery) {
"""
Performs a single refinement of the hypothesis, i.e., without repeated counterexample evaluation. The parameter
and return value have the same significance as in {@link #refineHypothesis(DefaultQuery)}.
@param ceQuery
the counterexampl... | java | protected boolean refineHypothesisSingle(DefaultQuery<I, D> ceQuery) {
TTTState<I, D> state = getAnyState(ceQuery.getPrefix());
D out = computeHypothesisOutput(state, ceQuery.getSuffix());
if (Objects.equals(out, ceQuery.getOutput())) {
return false;
}
OutputInconsi... | [
"protected",
"boolean",
"refineHypothesisSingle",
"(",
"DefaultQuery",
"<",
"I",
",",
"D",
">",
"ceQuery",
")",
"{",
"TTTState",
"<",
"I",
",",
"D",
">",
"state",
"=",
"getAnyState",
"(",
"ceQuery",
".",
"getPrefix",
"(",
")",
")",
";",
"D",
"out",
"="... | Performs a single refinement of the hypothesis, i.e., without repeated counterexample evaluation. The parameter
and return value have the same significance as in {@link #refineHypothesis(DefaultQuery)}.
@param ceQuery
the counterexample (query) to be used for refinement
@return {@code true} if the hypothesis was refi... | [
"Performs",
"a",
"single",
"refinement",
"of",
"the",
"hypothesis",
"i",
".",
"e",
".",
"without",
"repeated",
"counterexample",
"evaluation",
".",
"The",
"parameter",
"and",
"return",
"value",
"have",
"the",
"same",
"significance",
"as",
"in",
"{",
"@link",
... | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java#L200-L223 |
googleads/googleads-java-lib | modules/ads_lib/src/main/java/com/google/api/ads/common/lib/auth/AuthorizationHeaderProvider.java | AuthorizationHeaderProvider.getOAuth2Header | private String getOAuth2Header(OAuth2Compatible oAuth2Compatible) throws OAuthException {
"""
Gets the OAuth2 header.
@throws OAuthException if the OAuth2 token could not be refreshed.
"""
if (adsLibConfiguration.isAutoRefreshOAuth2TokenEnabled()) {
try {
oAuth2Helper.refreshCredential(oAu... | java | private String getOAuth2Header(OAuth2Compatible oAuth2Compatible) throws OAuthException {
if (adsLibConfiguration.isAutoRefreshOAuth2TokenEnabled()) {
try {
oAuth2Helper.refreshCredential(oAuth2Compatible.getOAuth2Credential());
} catch (IOException e) {
throw new OAuthException("OAuth2 ... | [
"private",
"String",
"getOAuth2Header",
"(",
"OAuth2Compatible",
"oAuth2Compatible",
")",
"throws",
"OAuthException",
"{",
"if",
"(",
"adsLibConfiguration",
".",
"isAutoRefreshOAuth2TokenEnabled",
"(",
")",
")",
"{",
"try",
"{",
"oAuth2Helper",
".",
"refreshCredential",... | Gets the OAuth2 header.
@throws OAuthException if the OAuth2 token could not be refreshed. | [
"Gets",
"the",
"OAuth2",
"header",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/common/lib/auth/AuthorizationHeaderProvider.java#L86-L96 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/usergroups/ws/GroupWsRef.java | GroupWsRef.fromId | static GroupWsRef fromId(int id) {
"""
Creates a reference to a group by its id. Virtual groups "Anyone" can't be returned
as they can't be referenced by an id.
"""
checkArgument(id > -1, "Group id must be positive: %s", id);
return new GroupWsRef(id, null, null);
} | java | static GroupWsRef fromId(int id) {
checkArgument(id > -1, "Group id must be positive: %s", id);
return new GroupWsRef(id, null, null);
} | [
"static",
"GroupWsRef",
"fromId",
"(",
"int",
"id",
")",
"{",
"checkArgument",
"(",
"id",
">",
"-",
"1",
",",
"\"Group id must be positive: %s\"",
",",
"id",
")",
";",
"return",
"new",
"GroupWsRef",
"(",
"id",
",",
"null",
",",
"null",
")",
";",
"}"
] | Creates a reference to a group by its id. Virtual groups "Anyone" can't be returned
as they can't be referenced by an id. | [
"Creates",
"a",
"reference",
"to",
"a",
"group",
"by",
"its",
"id",
".",
"Virtual",
"groups",
"Anyone",
"can",
"t",
"be",
"returned",
"as",
"they",
"can",
"t",
"be",
"referenced",
"by",
"an",
"id",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/usergroups/ws/GroupWsRef.java#L98-L101 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/CredentialsInner.java | CredentialsInner.createOrUpdate | public CredentialInner createOrUpdate(String resourceGroupName, String automationAccountName, String credentialName, CredentialCreateOrUpdateParameters parameters) {
"""
Create a credential.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation accoun... | java | public CredentialInner createOrUpdate(String resourceGroupName, String automationAccountName, String credentialName, CredentialCreateOrUpdateParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, automationAccountName, credentialName, parameters).toBlocking().single().body();
... | [
"public",
"CredentialInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"credentialName",
",",
"CredentialCreateOrUpdateParameters",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"("... | Create a credential.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param credentialName The parameters supplied to the create or update credential operation.
@param parameters The parameters supplied to the create or update credential operat... | [
"Create",
"a",
"credential",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/CredentialsInner.java#L287-L289 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java | OjbTagsHandler.originalClass | public void originalClass(String template, Properties attributes) throws XDocletException {
"""
Processes the original class rather than the current class definition.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException if an error occur... | java | public void originalClass(String template, Properties attributes) throws XDocletException
{
pushCurrentClass(_curClassDef.getOriginalClass());
generate(template);
popCurrentClass();
} | [
"public",
"void",
"originalClass",
"(",
"String",
"template",
",",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"pushCurrentClass",
"(",
"_curClassDef",
".",
"getOriginalClass",
"(",
")",
")",
";",
"generate",
"(",
"template",
")",
";",
"p... | Processes the original class rather than the current class definition.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException if an error occurs
@doc.tag type="block" | [
"Processes",
"the",
"original",
"class",
"rather",
"than",
"the",
"current",
"class",
"definition",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L192-L197 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/AirlineBoardingPassTemplateBuilder.java | AirlineBoardingPassTemplateBuilder.addQuickReply | public AirlineBoardingPassTemplateBuilder addQuickReply(String title,
String payload) {
"""
Adds a {@link QuickReply} to the current object.
@param title
the quick reply button label. It can't be empty.
@param payload
the payload sent back when the button is pressed. It can't be
empty.
@return this buil... | java | public AirlineBoardingPassTemplateBuilder addQuickReply(String title,
String payload) {
this.messageBuilder.addQuickReply(title, payload);
return this;
} | [
"public",
"AirlineBoardingPassTemplateBuilder",
"addQuickReply",
"(",
"String",
"title",
",",
"String",
"payload",
")",
"{",
"this",
".",
"messageBuilder",
".",
"addQuickReply",
"(",
"title",
",",
"payload",
")",
";",
"return",
"this",
";",
"}"
] | Adds a {@link QuickReply} to the current object.
@param title
the quick reply button label. It can't be empty.
@param payload
the payload sent back when the button is pressed. It can't be
empty.
@return this builder.
@see <a href=
"https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replie... | [
"Adds",
"a",
"{",
"@link",
"QuickReply",
"}",
"to",
"the",
"current",
"object",
"."
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/AirlineBoardingPassTemplateBuilder.java#L140-L144 |
terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/http/HttpUtil.java | HttpUtil.getHeadersFromRequest | public static Header[] getHeadersFromRequest(HttpServletRequest request) {
"""
Extract headers from {@link HttpServletRequest}
@param request {@link HttpServletRequest} to extract headers from
@return Array with {@link Header}s
"""
List<Header> returnHeaderList = new ArrayList<>();
Enumerat... | java | public static Header[] getHeadersFromRequest(HttpServletRequest request) {
List<Header> returnHeaderList = new ArrayList<>();
Enumeration<String> headerNames = request.getHeaderNames();
while (headerNames.hasMoreElements()) {
String headerName = headerNames.nextElement();
... | [
"public",
"static",
"Header",
"[",
"]",
"getHeadersFromRequest",
"(",
"HttpServletRequest",
"request",
")",
"{",
"List",
"<",
"Header",
">",
"returnHeaderList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Enumeration",
"<",
"String",
">",
"headerNames",
"="... | Extract headers from {@link HttpServletRequest}
@param request {@link HttpServletRequest} to extract headers from
@return Array with {@link Header}s | [
"Extract",
"headers",
"from",
"{",
"@link",
"HttpServletRequest",
"}"
] | train | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/http/HttpUtil.java#L2001-L2037 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/PathMappingResult.java | PathMappingResult.of | public static PathMappingResult of(String path, @Nullable String query,
Map<String, String> rawPathParams, int score) {
"""
Creates a new instance with the specified {@code path}, {@code query}, the extracted path parameters
and the score.
"""
requireNonNull(path... | java | public static PathMappingResult of(String path, @Nullable String query,
Map<String, String> rawPathParams, int score) {
requireNonNull(path, "path");
requireNonNull(rawPathParams, "rawPathParams");
return new PathMappingResult(path, query, rawPathParams, sc... | [
"public",
"static",
"PathMappingResult",
"of",
"(",
"String",
"path",
",",
"@",
"Nullable",
"String",
"query",
",",
"Map",
"<",
"String",
",",
"String",
">",
"rawPathParams",
",",
"int",
"score",
")",
"{",
"requireNonNull",
"(",
"path",
",",
"\"path\"",
")... | Creates a new instance with the specified {@code path}, {@code query}, the extracted path parameters
and the score. | [
"Creates",
"a",
"new",
"instance",
"with",
"the",
"specified",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/PathMappingResult.java#L74-L79 |
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/utils/ContentSpecUtilities.java | ContentSpecUtilities.getContentSpecRevisionsById | public static RevisionList getContentSpecRevisionsById(final ContentSpecProvider contentSpecProvider, final Integer csId) {
"""
/*
Gets a list of Revision's from the CSProcessor database for a specific content spec
"""
final List<Revision> results = new ArrayList<Revision>();
final CollectionW... | java | public static RevisionList getContentSpecRevisionsById(final ContentSpecProvider contentSpecProvider, final Integer csId) {
final List<Revision> results = new ArrayList<Revision>();
final CollectionWrapper<ContentSpecWrapper> contentSpecRevisions = contentSpecProvider.getContentSpec(csId).getRevisions()... | [
"public",
"static",
"RevisionList",
"getContentSpecRevisionsById",
"(",
"final",
"ContentSpecProvider",
"contentSpecProvider",
",",
"final",
"Integer",
"csId",
")",
"{",
"final",
"List",
"<",
"Revision",
">",
"results",
"=",
"new",
"ArrayList",
"<",
"Revision",
">",... | /*
Gets a list of Revision's from the CSProcessor database for a specific content spec | [
"/",
"*",
"Gets",
"a",
"list",
"of",
"Revision",
"s",
"from",
"the",
"CSProcessor",
"database",
"for",
"a",
"specific",
"content",
"spec"
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/ContentSpecUtilities.java#L320-L340 |
citrusframework/citrus | modules/citrus-vertx/src/main/java/com/consol/citrus/vertx/endpoint/VertxSyncConsumer.java | VertxSyncConsumer.saveReplyDestination | public void saveReplyDestination(Message receivedMessage, TestContext context) {
"""
Store the reply address either straight forward or with a given
message correlation key.
@param receivedMessage
@param context
"""
if (receivedMessage.getHeader(CitrusVertxMessageHeaders.VERTX_REPLY_ADDRESS) != nu... | java | public void saveReplyDestination(Message receivedMessage, TestContext context) {
if (receivedMessage.getHeader(CitrusVertxMessageHeaders.VERTX_REPLY_ADDRESS) != null) {
String correlationKeyName = endpointConfiguration.getCorrelator().getCorrelationKeyName(getName());
String correlationK... | [
"public",
"void",
"saveReplyDestination",
"(",
"Message",
"receivedMessage",
",",
"TestContext",
"context",
")",
"{",
"if",
"(",
"receivedMessage",
".",
"getHeader",
"(",
"CitrusVertxMessageHeaders",
".",
"VERTX_REPLY_ADDRESS",
")",
"!=",
"null",
")",
"{",
"String",... | Store the reply address either straight forward or with a given
message correlation key.
@param receivedMessage
@param context | [
"Store",
"the",
"reply",
"address",
"either",
"straight",
"forward",
"or",
"with",
"a",
"given",
"message",
"correlation",
"key",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-vertx/src/main/java/com/consol/citrus/vertx/endpoint/VertxSyncConsumer.java#L97-L107 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java | PolicyStatesInner.summarizeForSubscriptionLevelPolicyAssignment | public SummarizeResultsInner summarizeForSubscriptionLevelPolicyAssignment(String subscriptionId, String policyAssignmentName, QueryOptions queryOptions) {
"""
Summarizes policy states for the subscription level policy assignment.
@param subscriptionId Microsoft Azure subscription ID.
@param policyAssignmentNa... | java | public SummarizeResultsInner summarizeForSubscriptionLevelPolicyAssignment(String subscriptionId, String policyAssignmentName, QueryOptions queryOptions) {
return summarizeForSubscriptionLevelPolicyAssignmentWithServiceResponseAsync(subscriptionId, policyAssignmentName, queryOptions).toBlocking().single().body(... | [
"public",
"SummarizeResultsInner",
"summarizeForSubscriptionLevelPolicyAssignment",
"(",
"String",
"subscriptionId",
",",
"String",
"policyAssignmentName",
",",
"QueryOptions",
"queryOptions",
")",
"{",
"return",
"summarizeForSubscriptionLevelPolicyAssignmentWithServiceResponseAsync",
... | Summarizes policy states for the subscription level policy assignment.
@param subscriptionId Microsoft Azure subscription ID.
@param policyAssignmentName Policy assignment name.
@param queryOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@throws... | [
"Summarizes",
"policy",
"states",
"for",
"the",
"subscription",
"level",
"policy",
"assignment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L2773-L2775 |
hawkular/hawkular-commons | hawkular-inventory-parent/hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/model/Resource.java | Resource.fromRaw | public static Resource fromRaw(RawResource r, Function<String, Optional<ResourceType>> rtLoader) {
"""
Converts {@link RawResource} into {@link Resource} using loader for {@link ResourceType}.
The children are not loaded.
@param r the resource to convert
@param rtLoader loader for {@link ResourceType}
@return ... | java | public static Resource fromRaw(RawResource r, Function<String, Optional<ResourceType>> rtLoader) {
return new Resource(r.getId(), r.getName(), r.getFeedId(), rtLoader.apply(r.getTypeId()).orElse(null),
r.getParentId(), r.getMetrics(), r.getProperties(), r.getConfig());
} | [
"public",
"static",
"Resource",
"fromRaw",
"(",
"RawResource",
"r",
",",
"Function",
"<",
"String",
",",
"Optional",
"<",
"ResourceType",
">",
">",
"rtLoader",
")",
"{",
"return",
"new",
"Resource",
"(",
"r",
".",
"getId",
"(",
")",
",",
"r",
".",
"get... | Converts {@link RawResource} into {@link Resource} using loader for {@link ResourceType}.
The children are not loaded.
@param r the resource to convert
@param rtLoader loader for {@link ResourceType}
@return the node without its subtree | [
"Converts",
"{"
] | train | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-inventory-parent/hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/model/Resource.java#L112-L115 |
derari/cthul | objects/src/main/java/org/cthul/objects/reflection/Signatures.java | Signatures.bestConstructor | public static <T> Constructor<T> bestConstructor(Constructor<T>[] constructors, Object[] args) throws AmbiguousConstructorMatchException {
"""
Selects the best constructor for the given arguments.
@param <T>
@param constructors
@param args
@return constructor, or {@code null}
@throws AmbiguousSignatureMatchEx... | java | public static <T> Constructor<T> bestConstructor(Constructor<T>[] constructors, Object[] args) throws AmbiguousConstructorMatchException {
return bestConstructor(constructors, collectArgTypes(args));
} | [
"public",
"static",
"<",
"T",
">",
"Constructor",
"<",
"T",
">",
"bestConstructor",
"(",
"Constructor",
"<",
"T",
">",
"[",
"]",
"constructors",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"AmbiguousConstructorMatchException",
"{",
"return",
"bestConstruct... | Selects the best constructor for the given arguments.
@param <T>
@param constructors
@param args
@return constructor, or {@code null}
@throws AmbiguousSignatureMatchException if multiple constructors match equally | [
"Selects",
"the",
"best",
"constructor",
"for",
"the",
"given",
"arguments",
"."
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L55-L57 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/FileServersInner.java | FileServersInner.getAsync | public Observable<FileServerInner> getAsync(String resourceGroupName, String workspaceName, String fileServerName) {
"""
Gets information about a File Server.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can o... | java | public Observable<FileServerInner> getAsync(String resourceGroupName, String workspaceName, String fileServerName) {
return getWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName).map(new Func1<ServiceResponse<FileServerInner>, FileServerInner>() {
@Override
public ... | [
"public",
"Observable",
"<",
"FileServerInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workspaceName",
",",
"String",
"fileServerName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"workspaceName",
",",
... | Gets information about a File Server.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 c... | [
"Gets",
"information",
"about",
"a",
"File",
"Server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/FileServersInner.java#L962-L969 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/object/TabularDataConverter.java | TabularDataConverter.convertTabularDataFromFullRepresentation | private TabularData convertTabularDataFromFullRepresentation(JSONObject pValue, TabularType pType) {
"""
Convert complex representation containing "indexNames" and "values"
"""
JSONAware jsonVal;
jsonVal = (JSONAware) pValue.get("values");
if (!(jsonVal instanceof JSONArray)) {
... | java | private TabularData convertTabularDataFromFullRepresentation(JSONObject pValue, TabularType pType) {
JSONAware jsonVal;
jsonVal = (JSONAware) pValue.get("values");
if (!(jsonVal instanceof JSONArray)) {
throw new IllegalArgumentException("Values for tabular data of type " +
... | [
"private",
"TabularData",
"convertTabularDataFromFullRepresentation",
"(",
"JSONObject",
"pValue",
",",
"TabularType",
"pType",
")",
"{",
"JSONAware",
"jsonVal",
";",
"jsonVal",
"=",
"(",
"JSONAware",
")",
"pValue",
".",
"get",
"(",
"\"values\"",
")",
";",
"if",
... | Convert complex representation containing "indexNames" and "values" | [
"Convert",
"complex",
"representation",
"containing",
"indexNames",
"and",
"values"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/object/TabularDataConverter.java#L159-L175 |
fuinorg/utils4swing | src/main/java/org/fuin/utils4swing/common/Utils4Swing.java | Utils4Swing.createShowAndPosition | public static JFrame createShowAndPosition(final String title, final Container content,
final boolean exitOnClose, final FramePositioner positioner) {
"""
Create a new resizeable frame with a panel as it's content pane and
position the frame.
@param title
Frame title.
@param content
Content.
@... | java | public static JFrame createShowAndPosition(final String title, final Container content,
final boolean exitOnClose, final FramePositioner positioner) {
return createShowAndPosition(title, content, exitOnClose, true, positioner);
} | [
"public",
"static",
"JFrame",
"createShowAndPosition",
"(",
"final",
"String",
"title",
",",
"final",
"Container",
"content",
",",
"final",
"boolean",
"exitOnClose",
",",
"final",
"FramePositioner",
"positioner",
")",
"{",
"return",
"createShowAndPosition",
"(",
"ti... | Create a new resizeable frame with a panel as it's content pane and
position the frame.
@param title
Frame title.
@param content
Content.
@param exitOnClose
Exit the program on closing the frame?
@param positioner
FramePositioner.
@return A visible frame at the preferred position. | [
"Create",
"a",
"new",
"resizeable",
"frame",
"with",
"a",
"panel",
"as",
"it",
"s",
"content",
"pane",
"and",
"position",
"the",
"frame",
"."
] | train | https://github.com/fuinorg/utils4swing/blob/560fb69eac182e3473de9679c3c15433e524ef6b/src/main/java/org/fuin/utils4swing/common/Utils4Swing.java#L66-L69 |
protostuff/protostuff | protostuff-core/src/main/java/io/protostuff/GraphIOUtil.java | GraphIOUtil.mergeDelimitedFrom | public static <T> int mergeDelimitedFrom(InputStream in, T message, Schema<T> schema)
throws IOException {
"""
Merges the {@code message} (delimited) from the {@link InputStream} using the given {@code schema}.
@return the size of the message
"""
final int size = in.read();
if (s... | java | public static <T> int mergeDelimitedFrom(InputStream in, T message, Schema<T> schema)
throws IOException
{
final int size = in.read();
if (size == -1)
throw ProtobufException.truncatedMessage();
final int len = size < 0x80 ? size : CodedInput.readRawVarint32(in, size... | [
"public",
"static",
"<",
"T",
">",
"int",
"mergeDelimitedFrom",
"(",
"InputStream",
"in",
",",
"T",
"message",
",",
"Schema",
"<",
"T",
">",
"schema",
")",
"throws",
"IOException",
"{",
"final",
"int",
"size",
"=",
"in",
".",
"read",
"(",
")",
";",
"... | Merges the {@code message} (delimited) from the {@link InputStream} using the given {@code schema}.
@return the size of the message | [
"Merges",
"the",
"{",
"@code",
"message",
"}",
"(",
"delimited",
")",
"from",
"the",
"{",
"@link",
"InputStream",
"}",
"using",
"the",
"given",
"{",
"@code",
"schema",
"}",
"."
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-core/src/main/java/io/protostuff/GraphIOUtil.java#L99-L142 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.deliverWaveformDetailUpdate | private void deliverWaveformDetailUpdate(final int player, final WaveformDetail detail) {
"""
Send a waveform detail update announcement to all registered listeners.
@param player the player whose waveform detail has changed
@param detail the new waveform detail, if any
"""
if (!getWaveformListener... | java | private void deliverWaveformDetailUpdate(final int player, final WaveformDetail detail) {
if (!getWaveformListeners().isEmpty()) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
final WaveformDetailUpdate update = new Wav... | [
"private",
"void",
"deliverWaveformDetailUpdate",
"(",
"final",
"int",
"player",
",",
"final",
"WaveformDetail",
"detail",
")",
"{",
"if",
"(",
"!",
"getWaveformListeners",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"SwingUtilities",
".",
"invokeLater",
"("... | Send a waveform detail update announcement to all registered listeners.
@param player the player whose waveform detail has changed
@param detail the new waveform detail, if any | [
"Send",
"a",
"waveform",
"detail",
"update",
"announcement",
"to",
"all",
"registered",
"listeners",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L697-L714 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/view/ActorToolbar.java | ActorToolbar.colorizeToolbar | public static void colorizeToolbar(Toolbar toolbarView, int toolbarIconsColor, Activity activity) {
"""
Use this method to colorize toolbar icons to the desired target color
@param toolbarView toolbar view being colored
@param toolbarIconsColor the target color of toolbar icons
@param activity ... | java | public static void colorizeToolbar(Toolbar toolbarView, int toolbarIconsColor, Activity activity) {
final PorterDuffColorFilter colorFilter
= new PorterDuffColorFilter(toolbarIconsColor, PorterDuff.Mode.SRC_IN);
for (int i = 0; i < toolbarView.getChildCount(); i++) {
final V... | [
"public",
"static",
"void",
"colorizeToolbar",
"(",
"Toolbar",
"toolbarView",
",",
"int",
"toolbarIconsColor",
",",
"Activity",
"activity",
")",
"{",
"final",
"PorterDuffColorFilter",
"colorFilter",
"=",
"new",
"PorterDuffColorFilter",
"(",
"toolbarIconsColor",
",",
"... | Use this method to colorize toolbar icons to the desired target color
@param toolbarView toolbar view being colored
@param toolbarIconsColor the target color of toolbar icons
@param activity reference to activity needed to register observers | [
"Use",
"this",
"method",
"to",
"colorize",
"toolbar",
"icons",
"to",
"the",
"desired",
"target",
"color"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/view/ActorToolbar.java#L64-L77 |
UrielCh/ovh-java-sdk | ovh-java-sdk-core/src/main/java/net/minidev/ovh/core/ApiOvhUtils.java | ApiOvhUtils.convertTo | public static <T> T convertTo(String in, TypeReference<T> mapTo) throws IOException {
"""
Convert JSON String to a POJO java
@param in
@param mapTo
@return POJO Object
@throws IOException
"""
try {
return mapper.readValue(in, mapTo);
} catch (Exception e) {
log.error("Can not convert:{} to {}", i... | java | public static <T> T convertTo(String in, TypeReference<T> mapTo) throws IOException {
try {
return mapper.readValue(in, mapTo);
} catch (Exception e) {
log.error("Can not convert:{} to {}", in, mapTo, e);
throw new OvhServiceException("local", "conversion Error to " + mapTo);
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"convertTo",
"(",
"String",
"in",
",",
"TypeReference",
"<",
"T",
">",
"mapTo",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"mapper",
".",
"readValue",
"(",
"in",
",",
"mapTo",
")",
";",
"}",
"catc... | Convert JSON String to a POJO java
@param in
@param mapTo
@return POJO Object
@throws IOException | [
"Convert",
"JSON",
"String",
"to",
"a",
"POJO",
"java"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-core/src/main/java/net/minidev/ovh/core/ApiOvhUtils.java#L41-L48 |
carewebframework/carewebframework-core | org.carewebframework.help-parent/org.carewebframework.help.javahelp/src/main/java/org/carewebframework/help/javahelp/HelpView.java | HelpView.initTopicTree | private void initTopicTree(HelpTopicNode htnParent, TreeNode ttnParent) {
"""
Duplicates JavaHelp topic tree into HelpTopicNode-based tree.
@param htnParent Current parent for HelpTopicNode-based tree.
@param ttnParent Current parent for JavaHelp TreeNode-based tree.
"""
for (int i = 0; i ... | java | private void initTopicTree(HelpTopicNode htnParent, TreeNode ttnParent) {
for (int i = 0; i < ttnParent.getChildCount(); i++) {
TreeNode ttnChild = ttnParent.getChildAt(i);
HelpTopic ht = getTopic(ttnChild);
HelpTopicNode htnChild = new HelpTopicNode(ht);
... | [
"private",
"void",
"initTopicTree",
"(",
"HelpTopicNode",
"htnParent",
",",
"TreeNode",
"ttnParent",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"ttnParent",
".",
"getChildCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"TreeNode",
"ttnChild",... | Duplicates JavaHelp topic tree into HelpTopicNode-based tree.
@param htnParent Current parent for HelpTopicNode-based tree.
@param ttnParent Current parent for JavaHelp TreeNode-based tree. | [
"Duplicates",
"JavaHelp",
"topic",
"tree",
"into",
"HelpTopicNode",
"-",
"based",
"tree",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.javahelp/src/main/java/org/carewebframework/help/javahelp/HelpView.java#L83-L93 |
Kickflip/kickflip-android-sdk | sdk/src/main/java/io/kickflip/sdk/av/Muxer.java | Muxer.writeSampleData | public void writeSampleData(MediaCodec encoder, int trackIndex, int bufferIndex, ByteBuffer encodedData, MediaCodec.BufferInfo bufferInfo) {
"""
Write the MediaCodec output buffer. This method <b>must</b>
be overridden by subclasses to release encodedData, transferring
ownership back to encoder, by calling encod... | java | public void writeSampleData(MediaCodec encoder, int trackIndex, int bufferIndex, ByteBuffer encodedData, MediaCodec.BufferInfo bufferInfo){
if ((bufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {
signalEndOfTrack();
}
} | [
"public",
"void",
"writeSampleData",
"(",
"MediaCodec",
"encoder",
",",
"int",
"trackIndex",
",",
"int",
"bufferIndex",
",",
"ByteBuffer",
"encodedData",
",",
"MediaCodec",
".",
"BufferInfo",
"bufferInfo",
")",
"{",
"if",
"(",
"(",
"bufferInfo",
".",
"flags",
... | Write the MediaCodec output buffer. This method <b>must</b>
be overridden by subclasses to release encodedData, transferring
ownership back to encoder, by calling encoder.releaseOutputBuffer(bufferIndex, false);
@param trackIndex
@param encodedData
@param bufferInfo | [
"Write",
"the",
"MediaCodec",
"output",
"buffer",
".",
"This",
"method",
"<b",
">",
"must<",
"/",
"b",
">",
"be",
"overridden",
"by",
"subclasses",
"to",
"release",
"encodedData",
"transferring",
"ownership",
"back",
"to",
"encoder",
"by",
"calling",
"encoder"... | train | https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/Muxer.java#L103-L107 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/runtime/JCuda.java | JCuda.cudaMallocArray | public static int cudaMallocArray(cudaArray array, cudaChannelFormatDesc desc, long width, long height, int flags) {
"""
Allocate an array on the device.
<pre>
cudaError_t cudaMallocArray (
cudaArray_t* array,
const cudaChannelFormatDesc* desc,
size_t width,
size_t height = 0,
unsigned int flags = 0 )
<... | java | public static int cudaMallocArray(cudaArray array, cudaChannelFormatDesc desc, long width, long height, int flags)
{
return checkResult(cudaMallocArrayNative(array, desc, width, height, flags));
} | [
"public",
"static",
"int",
"cudaMallocArray",
"(",
"cudaArray",
"array",
",",
"cudaChannelFormatDesc",
"desc",
",",
"long",
"width",
",",
"long",
"height",
",",
"int",
"flags",
")",
"{",
"return",
"checkResult",
"(",
"cudaMallocArrayNative",
"(",
"array",
",",
... | Allocate an array on the device.
<pre>
cudaError_t cudaMallocArray (
cudaArray_t* array,
const cudaChannelFormatDesc* desc,
size_t width,
size_t height = 0,
unsigned int flags = 0 )
</pre>
<div>
<p>Allocate an array on the device.
Allocates a CUDA array according to the cudaChannelFormatDesc structure
<tt>desc</tt> a... | [
"Allocate",
"an",
"array",
"on",
"the",
"device",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L4363-L4366 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/CoreMessageRenderer.java | CoreMessageRenderer.shouldBeRendered | protected boolean shouldBeRendered(FacesMessage message, UIMessagesBase uiMessagesBase) {
"""
Returns {@code true} if the provided message should be rendered in the provided base message component.
@param message Message to be checked for rendering.
@param uiMessagesBase Base message component message needs to... | java | protected boolean shouldBeRendered(FacesMessage message, UIMessagesBase uiMessagesBase) {
return (!message.isRendered() || uiMessagesBase.isRedisplay())
&& uiMessagesBase.getSeverity().contains(getSeverityName(message.getSeverity()));
} | [
"protected",
"boolean",
"shouldBeRendered",
"(",
"FacesMessage",
"message",
",",
"UIMessagesBase",
"uiMessagesBase",
")",
"{",
"return",
"(",
"!",
"message",
".",
"isRendered",
"(",
")",
"||",
"uiMessagesBase",
".",
"isRedisplay",
"(",
")",
")",
"&&",
"uiMessage... | Returns {@code true} if the provided message should be rendered in the provided base message component.
@param message Message to be checked for rendering.
@param uiMessagesBase Base message component message needs to be rendered in.
@return {@code true} if the provided message should be rendered in the provided base ... | [
"Returns",
"{",
"@code",
"true",
"}",
"if",
"the",
"provided",
"message",
"should",
"be",
"rendered",
"in",
"the",
"provided",
"base",
"message",
"component",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/CoreMessageRenderer.java#L39-L42 |
line/armeria | core/src/main/java/com/linecorp/armeria/common/metric/MoreMeters.java | MoreMeters.newTimer | public static Timer newTimer(MeterRegistry registry, String name, Iterable<Tag> tags) {
"""
Returns a newly-registered {@link Timer} configured by {@link #distributionStatisticConfig()}.
"""
requireNonNull(registry, "registry");
requireNonNull(name, "name");
requireNonNull(tags, "tags")... | java | public static Timer newTimer(MeterRegistry registry, String name, Iterable<Tag> tags) {
requireNonNull(registry, "registry");
requireNonNull(name, "name");
requireNonNull(tags, "tags");
final Duration maxExpectedValue =
Optional.ofNullable(distStatCfg.getMaximumExpectedV... | [
"public",
"static",
"Timer",
"newTimer",
"(",
"MeterRegistry",
"registry",
",",
"String",
"name",
",",
"Iterable",
"<",
"Tag",
">",
"tags",
")",
"{",
"requireNonNull",
"(",
"registry",
",",
"\"registry\"",
")",
";",
"requireNonNull",
"(",
"name",
",",
"\"nam... | Returns a newly-registered {@link Timer} configured by {@link #distributionStatisticConfig()}. | [
"Returns",
"a",
"newly",
"-",
"registered",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/metric/MoreMeters.java#L127-L148 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ScientificNumberFormatter.java | ScientificNumberFormatter.getMarkupInstance | public static ScientificNumberFormatter getMarkupInstance(
ULocale locale,
String beginMarkup,
String endMarkup) {
"""
Gets a ScientificNumberFormatter instance that uses
markup for exponents for this locale.
@param locale The locale
@param beginMarkup the markup to start ... | java | public static ScientificNumberFormatter getMarkupInstance(
ULocale locale,
String beginMarkup,
String endMarkup) {
return getInstanceForLocale(
locale, new MarkupStyle(beginMarkup, endMarkup));
} | [
"public",
"static",
"ScientificNumberFormatter",
"getMarkupInstance",
"(",
"ULocale",
"locale",
",",
"String",
"beginMarkup",
",",
"String",
"endMarkup",
")",
"{",
"return",
"getInstanceForLocale",
"(",
"locale",
",",
"new",
"MarkupStyle",
"(",
"beginMarkup",
",",
"... | Gets a ScientificNumberFormatter instance that uses
markup for exponents for this locale.
@param locale The locale
@param beginMarkup the markup to start superscript e.g {@code <sup>}
@param endMarkup the markup to end superscript e.g {@code </sup>}
@return The ScientificNumberFormatter instance. | [
"Gets",
"a",
"ScientificNumberFormatter",
"instance",
"that",
"uses",
"markup",
"for",
"exponents",
"for",
"this",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ScientificNumberFormatter.java#L74-L80 |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MapWithProtoValuesSubject.java | MapWithProtoValuesSubject.usingFloatToleranceForFieldsForValues | public MapWithProtoValuesFluentAssertion<M> usingFloatToleranceForFieldsForValues(
float tolerance, Iterable<Integer> fieldNumbers) {
"""
Compares float fields with these explicitly specified top-level field numbers using the
provided absolute tolerance.
@param tolerance A finite, non-negative tolerance.... | java | public MapWithProtoValuesFluentAssertion<M> usingFloatToleranceForFieldsForValues(
float tolerance, Iterable<Integer> fieldNumbers) {
return usingConfig(config.usingFloatToleranceForFields(tolerance, fieldNumbers));
} | [
"public",
"MapWithProtoValuesFluentAssertion",
"<",
"M",
">",
"usingFloatToleranceForFieldsForValues",
"(",
"float",
"tolerance",
",",
"Iterable",
"<",
"Integer",
">",
"fieldNumbers",
")",
"{",
"return",
"usingConfig",
"(",
"config",
".",
"usingFloatToleranceForFields",
... | Compares float fields with these explicitly specified top-level field numbers using the
provided absolute tolerance.
@param tolerance A finite, non-negative tolerance. | [
"Compares",
"float",
"fields",
"with",
"these",
"explicitly",
"specified",
"top",
"-",
"level",
"field",
"numbers",
"using",
"the",
"provided",
"absolute",
"tolerance",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MapWithProtoValuesSubject.java#L585-L588 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/support/ConnectionPoolSupport.java | ConnectionPoolSupport.createSoftReferenceObjectPool | public static <T extends StatefulConnection<?, ?>> SoftReferenceObjectPool<T> createSoftReferenceObjectPool(
Supplier<T> connectionSupplier) {
"""
Creates a new {@link SoftReferenceObjectPool} using the {@link Supplier}. Allocated instances are wrapped and must not be
returned with {@link ObjectPool#r... | java | public static <T extends StatefulConnection<?, ?>> SoftReferenceObjectPool<T> createSoftReferenceObjectPool(
Supplier<T> connectionSupplier) {
return createSoftReferenceObjectPool(connectionSupplier, true);
} | [
"public",
"static",
"<",
"T",
"extends",
"StatefulConnection",
"<",
"?",
",",
"?",
">",
">",
"SoftReferenceObjectPool",
"<",
"T",
">",
"createSoftReferenceObjectPool",
"(",
"Supplier",
"<",
"T",
">",
"connectionSupplier",
")",
"{",
"return",
"createSoftReferenceOb... | Creates a new {@link SoftReferenceObjectPool} using the {@link Supplier}. Allocated instances are wrapped and must not be
returned with {@link ObjectPool#returnObject(Object)}.
@param connectionSupplier must not be {@literal null}.
@param <T> connection type.
@return the connection pool. | [
"Creates",
"a",
"new",
"{",
"@link",
"SoftReferenceObjectPool",
"}",
"using",
"the",
"{",
"@link",
"Supplier",
"}",
".",
"Allocated",
"instances",
"are",
"wrapped",
"and",
"must",
"not",
"be",
"returned",
"with",
"{",
"@link",
"ObjectPool#returnObject",
"(",
"... | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/support/ConnectionPoolSupport.java#L149-L152 |
structr/structr | structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java | HtmlServlet.notFound | private Page notFound(final HttpServletResponse response, final SecurityContext securityContext) throws IOException, FrameworkException {
"""
Handle 404 Not Found
First, search the first page which handles the 404.
If none found, issue the container's 404 error.
@param response
@param securityContext
@p... | java | private Page notFound(final HttpServletResponse response, final SecurityContext securityContext) throws IOException, FrameworkException {
final List<Page> errorPages = StructrApp.getInstance(securityContext).nodeQuery(Page.class).and(StructrApp.key(Page.class, "showOnErrorCodes"), "404", false).getAsList();
for (... | [
"private",
"Page",
"notFound",
"(",
"final",
"HttpServletResponse",
"response",
",",
"final",
"SecurityContext",
"securityContext",
")",
"throws",
"IOException",
",",
"FrameworkException",
"{",
"final",
"List",
"<",
"Page",
">",
"errorPages",
"=",
"StructrApp",
".",... | Handle 404 Not Found
First, search the first page which handles the 404.
If none found, issue the container's 404 error.
@param response
@param securityContext
@param renderContext
@throws IOException
@throws FrameworkException | [
"Handle",
"404",
"Not",
"Found"
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java#L937-L954 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.patchAsync | public Observable<Void> patchAsync(String jobId, JobPatchParameter jobPatchParameter, JobPatchOptions jobPatchOptions) {
"""
Updates the properties of the specified job.
This replaces only the job properties specified in the request. For example, if the job has constraints, and a request does not specify the cons... | java | public Observable<Void> patchAsync(String jobId, JobPatchParameter jobPatchParameter, JobPatchOptions jobPatchOptions) {
return patchWithServiceResponseAsync(jobId, jobPatchParameter, jobPatchOptions).map(new Func1<ServiceResponseWithHeaders<Void, JobPatchHeaders>, Void>() {
@Override
pu... | [
"public",
"Observable",
"<",
"Void",
">",
"patchAsync",
"(",
"String",
"jobId",
",",
"JobPatchParameter",
"jobPatchParameter",
",",
"JobPatchOptions",
"jobPatchOptions",
")",
"{",
"return",
"patchWithServiceResponseAsync",
"(",
"jobId",
",",
"jobPatchParameter",
",",
... | Updates the properties of the specified job.
This replaces only the job properties specified in the request. For example, if the job has constraints, and a request does not specify the constraints element, then the job keeps the existing constraints.
@param jobId The ID of the job whose properties you want to update.
... | [
"Updates",
"the",
"properties",
"of",
"the",
"specified",
"job",
".",
"This",
"replaces",
"only",
"the",
"job",
"properties",
"specified",
"in",
"the",
"request",
".",
"For",
"example",
"if",
"the",
"job",
"has",
"constraints",
"and",
"a",
"request",
"does",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L961-L968 |
JoeKerouac/utils | src/main/java/com/joe/utils/common/DateUtil.java | DateUtil.getFormatDate | public static String getFormatDate(String format, Date date, String zoneId) {
"""
获取指定日期的指定格式的字符串,指定时区
@param format 日期格式
@param date 指定日期
@param zoneId 时区ID,例如GMT
@return 指定日期的指定格式的字符串
"""
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(format);
return dateTimeFormatt... | java | public static String getFormatDate(String format, Date date, String zoneId) {
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(format);
return dateTimeFormatter
.format(date.toInstant().atZone(ZoneId.of(zoneId)).toLocalDateTime());
} | [
"public",
"static",
"String",
"getFormatDate",
"(",
"String",
"format",
",",
"Date",
"date",
",",
"String",
"zoneId",
")",
"{",
"DateTimeFormatter",
"dateTimeFormatter",
"=",
"DateTimeFormatter",
".",
"ofPattern",
"(",
"format",
")",
";",
"return",
"dateTimeFormat... | 获取指定日期的指定格式的字符串,指定时区
@param format 日期格式
@param date 指定日期
@param zoneId 时区ID,例如GMT
@return 指定日期的指定格式的字符串 | [
"获取指定日期的指定格式的字符串,指定时区"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/DateUtil.java#L204-L208 |
OpenLiberty/open-liberty | dev/com.ibm.ws.app.manager.springboot/src/com/ibm/ws/app/manager/springboot/container/config/ConfigElementList.java | ConfigElementList.getBy | public E getBy(String attributeName, String attributeValue) {
"""
Returns the first element in this list with a matching attribute value.
@param attributeName the attribute for which to search (Example: jndiName)
@param attributeValue the value to match
@return the first element in this list with a matching a... | java | public E getBy(String attributeName, String attributeValue) {
String methodName = "get" + Character.toUpperCase(attributeName.charAt(0)) + attributeName.substring(1);
for (E element : this)
if (element != null)
try {
Object value = element.getClass().getMe... | [
"public",
"E",
"getBy",
"(",
"String",
"attributeName",
",",
"String",
"attributeValue",
")",
"{",
"String",
"methodName",
"=",
"\"get\"",
"+",
"Character",
".",
"toUpperCase",
"(",
"attributeName",
".",
"charAt",
"(",
"0",
")",
")",
"+",
"attributeName",
".... | Returns the first element in this list with a matching attribute value.
@param attributeName the attribute for which to search (Example: jndiName)
@param attributeValue the value to match
@return the first element in this list with a matching attribute name/value, or null of no such element is found | [
"Returns",
"the",
"first",
"element",
"in",
"this",
"list",
"with",
"a",
"matching",
"attribute",
"value",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.app.manager.springboot/src/com/ibm/ws/app/manager/springboot/container/config/ConfigElementList.java#L69-L80 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_localSeo_emailAvailability_GET | public OvhEmailAvailability serviceName_localSeo_emailAvailability_GET(String serviceName, String email) throws IOException {
"""
Check email availability for a local SEO order
REST: GET /hosting/web/{serviceName}/localSeo/emailAvailability
@param email [required] The email address to check
@param serviceName... | java | public OvhEmailAvailability serviceName_localSeo_emailAvailability_GET(String serviceName, String email) throws IOException {
String qPath = "/hosting/web/{serviceName}/localSeo/emailAvailability";
StringBuilder sb = path(qPath, serviceName);
query(sb, "email", email);
String resp = exec(qPath, "GET", sb.toStri... | [
"public",
"OvhEmailAvailability",
"serviceName_localSeo_emailAvailability_GET",
"(",
"String",
"serviceName",
",",
"String",
"email",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/{serviceName}/localSeo/emailAvailability\"",
";",
"StringBuilder",
"s... | Check email availability for a local SEO order
REST: GET /hosting/web/{serviceName}/localSeo/emailAvailability
@param email [required] The email address to check
@param serviceName [required] The internal name of your hosting | [
"Check",
"email",
"availability",
"for",
"a",
"local",
"SEO",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L865-L871 |
riversun/finbin | src/main/java/org/riversun/finbin/BinaryUtil.java | BinaryUtil.memcopy | public static void memcopy(byte[] dest, byte[] src, int copyToIndex) {
"""
Copy src bytes[] into dest bytes[]
@param dest
@param src
@param copyToIndex
"""
System.arraycopy(src, 0, dest, copyToIndex, src.length);
} | java | public static void memcopy(byte[] dest, byte[] src, int copyToIndex) {
System.arraycopy(src, 0, dest, copyToIndex, src.length);
} | [
"public",
"static",
"void",
"memcopy",
"(",
"byte",
"[",
"]",
"dest",
",",
"byte",
"[",
"]",
"src",
",",
"int",
"copyToIndex",
")",
"{",
"System",
".",
"arraycopy",
"(",
"src",
",",
"0",
",",
"dest",
",",
"copyToIndex",
",",
"src",
".",
"length",
"... | Copy src bytes[] into dest bytes[]
@param dest
@param src
@param copyToIndex | [
"Copy",
"src",
"bytes",
"[]",
"into",
"dest",
"bytes",
"[]"
] | train | https://github.com/riversun/finbin/blob/d1db86a0d2966dcf47087340bbd0727a9d508b3e/src/main/java/org/riversun/finbin/BinaryUtil.java#L65-L67 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/parse/dep/ParentsArray.java | ParentsArray.isAncestor | public static boolean isAncestor(int idx1, int idx2, int[] parents) {
"""
Checks whether idx1 is the ancestor of idx2. If idx1 is the parent of
idx2 this will return true, but if idx1 == idx2, it will return false.
@param idx1 The ancestor position.
@param idx2 The descendent position.
@param parents The par... | java | public static boolean isAncestor(int idx1, int idx2, int[] parents) {
int anc = parents[idx2];
while (anc != -1) {
if (anc == idx1) {
return true;
}
anc = parents[anc];
}
return false;
} | [
"public",
"static",
"boolean",
"isAncestor",
"(",
"int",
"idx1",
",",
"int",
"idx2",
",",
"int",
"[",
"]",
"parents",
")",
"{",
"int",
"anc",
"=",
"parents",
"[",
"idx2",
"]",
";",
"while",
"(",
"anc",
"!=",
"-",
"1",
")",
"{",
"if",
"(",
"anc",
... | Checks whether idx1 is the ancestor of idx2. If idx1 is the parent of
idx2 this will return true, but if idx1 == idx2, it will return false.
@param idx1 The ancestor position.
@param idx2 The descendent position.
@param parents The parents array.
@return Whether idx is the ancestor of idx2. | [
"Checks",
"whether",
"idx1",
"is",
"the",
"ancestor",
"of",
"idx2",
".",
"If",
"idx1",
"is",
"the",
"parent",
"of",
"idx2",
"this",
"will",
"return",
"true",
"but",
"if",
"idx1",
"==",
"idx2",
"it",
"will",
"return",
"false",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/parse/dep/ParentsArray.java#L219-L228 |
puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java | Jar.setAttribute | public final Jar setAttribute(String name, String value) {
"""
Sets an attribute in the main section of the manifest.
@param name the attribute's name
@param value the attribute's value
@return {@code this}
@throws IllegalStateException if entries have been added or the JAR has been written prior to calling... | java | public final Jar setAttribute(String name, String value) {
verifyNotSealed();
if (jos != null)
throw new IllegalStateException("Manifest cannot be modified after entries are added.");
getManifest().getMainAttributes().putValue(name, value);
return this;
} | [
"public",
"final",
"Jar",
"setAttribute",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"verifyNotSealed",
"(",
")",
";",
"if",
"(",
"jos",
"!=",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Manifest cannot be modified after entries are... | Sets an attribute in the main section of the manifest.
@param name the attribute's name
@param value the attribute's value
@return {@code this}
@throws IllegalStateException if entries have been added or the JAR has been written prior to calling this methods. | [
"Sets",
"an",
"attribute",
"in",
"the",
"main",
"section",
"of",
"the",
"manifest",
"."
] | train | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java#L135-L141 |
aws/aws-sdk-java | aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/ModifyInstanceAttributeRequest.java | ModifyInstanceAttributeRequest.getBlockDeviceMappings | public java.util.List<InstanceBlockDeviceMappingSpecification> getBlockDeviceMappings() {
"""
<p>
Modifies the <code>DeleteOnTermination</code> attribute for volumes that are currently attached. The volume must
be owned by the caller. If no value is specified for <code>DeleteOnTermination</code>, the default is
... | java | public java.util.List<InstanceBlockDeviceMappingSpecification> getBlockDeviceMappings() {
if (blockDeviceMappings == null) {
blockDeviceMappings = new com.amazonaws.internal.SdkInternalList<InstanceBlockDeviceMappingSpecification>();
}
return blockDeviceMappings;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"InstanceBlockDeviceMappingSpecification",
">",
"getBlockDeviceMappings",
"(",
")",
"{",
"if",
"(",
"blockDeviceMappings",
"==",
"null",
")",
"{",
"blockDeviceMappings",
"=",
"new",
"com",
".",
"amazonaws",
".",
"... | <p>
Modifies the <code>DeleteOnTermination</code> attribute for volumes that are currently attached. The volume must
be owned by the caller. If no value is specified for <code>DeleteOnTermination</code>, the default is
<code>true</code> and the volume is deleted when the instance is terminated.
</p>
<p>
To add instance... | [
"<p",
">",
"Modifies",
"the",
"<code",
">",
"DeleteOnTermination<",
"/",
"code",
">",
"attribute",
"for",
"volumes",
"that",
"are",
"currently",
"attached",
".",
"The",
"volume",
"must",
"be",
"owned",
"by",
"the",
"caller",
".",
"If",
"no",
"value",
"is",... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/ModifyInstanceAttributeRequest.java#L357-L362 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsUserTable.java | CmsUserTable.fillItem | protected void fillItem(Item item, CmsUser user) {
"""
Fills the container item for a user.<p>
@param item the item
@param user the user
"""
item.getItemProperty(TableProperty.Name).setValue(user.getSimpleName());
item.getItemProperty(TableProperty.FullName).setValue(user.getFullName());
... | java | protected void fillItem(Item item, CmsUser user) {
item.getItemProperty(TableProperty.Name).setValue(user.getSimpleName());
item.getItemProperty(TableProperty.FullName).setValue(user.getFullName());
item.getItemProperty(TableProperty.SystemName).setValue(user.getName());
boolean disable... | [
"protected",
"void",
"fillItem",
"(",
"Item",
"item",
",",
"CmsUser",
"user",
")",
"{",
"item",
".",
"getItemProperty",
"(",
"TableProperty",
".",
"Name",
")",
".",
"setValue",
"(",
"user",
".",
"getSimpleName",
"(",
")",
")",
";",
"item",
".",
"getItemP... | Fills the container item for a user.<p>
@param item the item
@param user the user | [
"Fills",
"the",
"container",
"item",
"for",
"a",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsUserTable.java#L1050-L1071 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java | UserAttrs.setLongAttribute | public static final void setLongAttribute(Path path, String attribute, long value, LinkOption... options) throws IOException {
"""
Set user-defined-attribute
@param path
@param attribute user:attribute name. user: can be omitted.
@param value
@param options
@throws IOException
"""
attribute = att... | java | public static final void setLongAttribute(Path path, String attribute, long value, LinkOption... options) throws IOException
{
attribute = attribute.startsWith("user:") ? attribute : "user:"+attribute;
Files.setAttribute(path, attribute, Primitives.writeLong(value), options);
} | [
"public",
"static",
"final",
"void",
"setLongAttribute",
"(",
"Path",
"path",
",",
"String",
"attribute",
",",
"long",
"value",
",",
"LinkOption",
"...",
"options",
")",
"throws",
"IOException",
"{",
"attribute",
"=",
"attribute",
".",
"startsWith",
"(",
"\"us... | Set user-defined-attribute
@param path
@param attribute user:attribute name. user: can be omitted.
@param value
@param options
@throws IOException | [
"Set",
"user",
"-",
"defined",
"-",
"attribute"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java#L66-L70 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/webhook/WebhookDeliveryDao.java | WebhookDeliveryDao.selectOrderedByCeTaskUuid | public List<WebhookDeliveryLiteDto> selectOrderedByCeTaskUuid(DbSession dbSession, String ceTaskUuid, int offset, int limit) {
"""
All the deliveries for the specified CE task. Results are ordered by descending date.
"""
return mapper(dbSession).selectOrderedByCeTaskUuid(ceTaskUuid, new RowBounds(offset, l... | java | public List<WebhookDeliveryLiteDto> selectOrderedByCeTaskUuid(DbSession dbSession, String ceTaskUuid, int offset, int limit) {
return mapper(dbSession).selectOrderedByCeTaskUuid(ceTaskUuid, new RowBounds(offset, limit));
} | [
"public",
"List",
"<",
"WebhookDeliveryLiteDto",
">",
"selectOrderedByCeTaskUuid",
"(",
"DbSession",
"dbSession",
",",
"String",
"ceTaskUuid",
",",
"int",
"offset",
",",
"int",
"limit",
")",
"{",
"return",
"mapper",
"(",
"dbSession",
")",
".",
"selectOrderedByCeTa... | All the deliveries for the specified CE task. Results are ordered by descending date. | [
"All",
"the",
"deliveries",
"for",
"the",
"specified",
"CE",
"task",
".",
"Results",
"are",
"ordered",
"by",
"descending",
"date",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/webhook/WebhookDeliveryDao.java#L67-L69 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/subdoc/AsyncMutateInBuilder.java | AsyncMutateInBuilder.arrayAppend | public <T> AsyncMutateInBuilder arrayAppend(String path, T value) {
"""
Append to an existing array, pushing the value to the back/last position in
the array.
@param path the path of the array.
@param value the value to insert at the back of the array.
"""
this.mutationSpecs.add(new MutationSpec(M... | java | public <T> AsyncMutateInBuilder arrayAppend(String path, T value) {
this.mutationSpecs.add(new MutationSpec(Mutation.ARRAY_PUSH_LAST, path, value));
return this;
} | [
"public",
"<",
"T",
">",
"AsyncMutateInBuilder",
"arrayAppend",
"(",
"String",
"path",
",",
"T",
"value",
")",
"{",
"this",
".",
"mutationSpecs",
".",
"add",
"(",
"new",
"MutationSpec",
"(",
"Mutation",
".",
"ARRAY_PUSH_LAST",
",",
"path",
",",
"value",
")... | Append to an existing array, pushing the value to the back/last position in
the array.
@param path the path of the array.
@param value the value to insert at the back of the array. | [
"Append",
"to",
"an",
"existing",
"array",
"pushing",
"the",
"value",
"to",
"the",
"back",
"/",
"last",
"position",
"in",
"the",
"array",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/subdoc/AsyncMutateInBuilder.java#L984-L987 |
gallandarakhneorg/afc | advanced/gis/gisroadinputoutput/src/main/java/org/arakhne/afc/gis/road/io/XMLRoadUtil.java | XMLRoadUtil.readRoadSegment | public static RoadSegment readRoadSegment(Element element, PathBuilder pathBuilder,
XMLResources resources) throws IOException {
"""
Read a road from the XML description.
@param element is the XML node to read.
@param pathBuilder is the tool to make paths absolute.
@param resources is the tool that permits... | java | public static RoadSegment readRoadSegment(Element element, PathBuilder pathBuilder,
XMLResources resources) throws IOException {
return readRoadPolyline(element, pathBuilder, resources);
} | [
"public",
"static",
"RoadSegment",
"readRoadSegment",
"(",
"Element",
"element",
",",
"PathBuilder",
"pathBuilder",
",",
"XMLResources",
"resources",
")",
"throws",
"IOException",
"{",
"return",
"readRoadPolyline",
"(",
"element",
",",
"pathBuilder",
",",
"resources",... | Read a road from the XML description.
@param element is the XML node to read.
@param pathBuilder is the tool to make paths absolute.
@param resources is the tool that permits to gather the resources.
@return the road.
@throws IOException in case of error. | [
"Read",
"a",
"road",
"from",
"the",
"XML",
"description",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisroadinputoutput/src/main/java/org/arakhne/afc/gis/road/io/XMLRoadUtil.java#L129-L132 |
JodaOrg/joda-time | src/main/java/org/joda/time/base/AbstractPartial.java | AbstractPartial.toDateTime | public DateTime toDateTime(ReadableInstant baseInstant) {
"""
Resolves this partial against another complete instant to create a new
full instant. The combination is performed using the chronology of the
specified instant.
<p>
For example, if this partial represents a time, then the result of this
method will... | java | public DateTime toDateTime(ReadableInstant baseInstant) {
Chronology chrono = DateTimeUtils.getInstantChronology(baseInstant);
long instantMillis = DateTimeUtils.getInstantMillis(baseInstant);
long resolved = chrono.set(this, instantMillis);
return new DateTime(resolved, chrono);
} | [
"public",
"DateTime",
"toDateTime",
"(",
"ReadableInstant",
"baseInstant",
")",
"{",
"Chronology",
"chrono",
"=",
"DateTimeUtils",
".",
"getInstantChronology",
"(",
"baseInstant",
")",
";",
"long",
"instantMillis",
"=",
"DateTimeUtils",
".",
"getInstantMillis",
"(",
... | Resolves this partial against another complete instant to create a new
full instant. The combination is performed using the chronology of the
specified instant.
<p>
For example, if this partial represents a time, then the result of this
method will be the datetime from the specified base instant plus the
time from this... | [
"Resolves",
"this",
"partial",
"against",
"another",
"complete",
"instant",
"to",
"create",
"a",
"new",
"full",
"instant",
".",
"The",
"combination",
"is",
"performed",
"using",
"the",
"chronology",
"of",
"the",
"specified",
"instant",
".",
"<p",
">",
"For",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/AbstractPartial.java#L239-L244 |
ops4j/org.ops4j.pax.wicket | service/src/main/java/org/ops4j/pax/wicket/internal/filter/FilterTrackerCustomizer.java | FilterTrackerCustomizer.createOsgiFilter | public org.osgi.framework.Filter createOsgiFilter()
throws IllegalArgumentException {
"""
<p>createOsgiFilter.</p>
@return a {@link org.osgi.framework.Filter} object.
@throws java.lang.IllegalArgumentException if any.
"""
org.osgi.framework.Filter filter;
try {
String fi... | java | public org.osgi.framework.Filter createOsgiFilter()
throws IllegalArgumentException {
org.osgi.framework.Filter filter;
try {
String filterString = String.format("(&(%s=%s)(%s=%s))", APPLICATION_NAME, applicationName,
OBJECTCLASS, FilterFactory.class.getName());
... | [
"public",
"org",
".",
"osgi",
".",
"framework",
".",
"Filter",
"createOsgiFilter",
"(",
")",
"throws",
"IllegalArgumentException",
"{",
"org",
".",
"osgi",
".",
"framework",
".",
"Filter",
"filter",
";",
"try",
"{",
"String",
"filterString",
"=",
"String",
"... | <p>createOsgiFilter.</p>
@return a {@link org.osgi.framework.Filter} object.
@throws java.lang.IllegalArgumentException if any. | [
"<p",
">",
"createOsgiFilter",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ops4j/org.ops4j.pax.wicket/blob/ef7cb4bdf918e9e61ec69789b9c690567616faa9/service/src/main/java/org/ops4j/pax/wicket/internal/filter/FilterTrackerCustomizer.java#L104-L117 |
threerings/nenya | tools/src/main/java/com/threerings/media/tile/tools/MapFileTileSetIDBroker.java | MapFileTileSetIDBroker.renameTileSet | protected boolean renameTileSet (String oldName, String newName) {
"""
Copies the ID from the old tileset to the new tileset which is
useful when a tileset is renamed. This is called by the {@link
RenameTileSet} utility.
"""
Integer tsid = _map.get(oldName);
if (tsid != null) {
_m... | java | protected boolean renameTileSet (String oldName, String newName)
{
Integer tsid = _map.get(oldName);
if (tsid != null) {
_map.put(newName, tsid);
// fudge our stored tileset ID so that we flush ourselves when
// the rename tool requests that we commit the changes
... | [
"protected",
"boolean",
"renameTileSet",
"(",
"String",
"oldName",
",",
"String",
"newName",
")",
"{",
"Integer",
"tsid",
"=",
"_map",
".",
"get",
"(",
"oldName",
")",
";",
"if",
"(",
"tsid",
"!=",
"null",
")",
"{",
"_map",
".",
"put",
"(",
"newName",
... | Copies the ID from the old tileset to the new tileset which is
useful when a tileset is renamed. This is called by the {@link
RenameTileSet} utility. | [
"Copies",
"the",
"ID",
"from",
"the",
"old",
"tileset",
"to",
"the",
"new",
"tileset",
"which",
"is",
"useful",
"when",
"a",
"tileset",
"is",
"renamed",
".",
"This",
"is",
"called",
"by",
"the",
"{"
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/media/tile/tools/MapFileTileSetIDBroker.java#L185-L198 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.