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 |
|---|---|---|---|---|---|---|---|---|---|---|
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/list/Interval.java | Interval.evensFromTo | public static Interval evensFromTo(int from, int to) {
"""
Returns an Interval representing the even values from the value from to the value to.
"""
if (from % 2 != 0)
{
if (from < to)
{
from++;
}
else
{
... | java | public static Interval evensFromTo(int from, int to)
{
if (from % 2 != 0)
{
if (from < to)
{
from++;
}
else
{
from--;
}
}
if (to % 2 != 0)
{
if (to > from)
... | [
"public",
"static",
"Interval",
"evensFromTo",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"if",
"(",
"from",
"%",
"2",
"!=",
"0",
")",
"{",
"if",
"(",
"from",
"<",
"to",
")",
"{",
"from",
"++",
";",
"}",
"else",
"{",
"from",
"--",
";",
"... | Returns an Interval representing the even values from the value from to the value to. | [
"Returns",
"an",
"Interval",
"representing",
"the",
"even",
"values",
"from",
"the",
"value",
"from",
"to",
"the",
"value",
"to",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/list/Interval.java#L188-L213 |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/DateBuilder.java | DateBuilder.nextGivenMinuteDate | public static Date nextGivenMinuteDate (final Date date, final int minuteBase) {
"""
<p>
Returns a date that is rounded to the next even multiple of the given
minute.
</p>
<p>
For example an input date with a time of 08:13:54, and an input minute-base
of 5 would result in a date with the time of 08:15:00. Th... | java | public static Date nextGivenMinuteDate (final Date date, final int minuteBase)
{
if (minuteBase < 0 || minuteBase > 59)
{
throw new IllegalArgumentException ("minuteBase must be >=0 and <= 59");
}
final Calendar c = PDTFactory.createCalendar ();
c.setTime (date != null ? date : new Date ())... | [
"public",
"static",
"Date",
"nextGivenMinuteDate",
"(",
"final",
"Date",
"date",
",",
"final",
"int",
"minuteBase",
")",
"{",
"if",
"(",
"minuteBase",
"<",
"0",
"||",
"minuteBase",
">",
"59",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"minu... | <p>
Returns a date that is rounded to the next even multiple of the given
minute.
</p>
<p>
For example an input date with a time of 08:13:54, and an input minute-base
of 5 would result in a date with the time of 08:15:00. The same input date
with an input minute-base of 10 would result in a date with the time of
08:20:... | [
"<p",
">",
"Returns",
"a",
"date",
"that",
"is",
"rounded",
"to",
"the",
"next",
"even",
"multiple",
"of",
"the",
"given",
"minute",
".",
"<",
"/",
"p",
">",
"<p",
">",
"For",
"example",
"an",
"input",
"date",
"with",
"a",
"time",
"of",
"08",
":",
... | train | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/DateBuilder.java#L809-L848 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/bolt/AmBaseBolt.java | AmBaseBolt.emitWithOnlyAnchorAndGrouping | protected void emitWithOnlyAnchorAndGrouping(StreamMessage message, String groupingKey) {
"""
Use anchor function(child message failed. notify fail to parent message.), and not use this class's key history function.<br>
Send message to downstream component with grouping key.<br>
Use following situation.
<ol>
<... | java | protected void emitWithOnlyAnchorAndGrouping(StreamMessage message, String groupingKey)
{
getCollector().emit(this.getExecutingTuple(), new Values(groupingKey, message));
} | [
"protected",
"void",
"emitWithOnlyAnchorAndGrouping",
"(",
"StreamMessage",
"message",
",",
"String",
"groupingKey",
")",
"{",
"getCollector",
"(",
")",
".",
"emit",
"(",
"this",
".",
"getExecutingTuple",
"(",
")",
",",
"new",
"Values",
"(",
"groupingKey",
",",
... | Use anchor function(child message failed. notify fail to parent message.), and not use this class's key history function.<br>
Send message to downstream component with grouping key.<br>
Use following situation.
<ol>
<li>Not use this class's key history function.</li>
<li>Use storm's fault detect function.</li>
</ol>
@... | [
"Use",
"anchor",
"function",
"(",
"child",
"message",
"failed",
".",
"notify",
"fail",
"to",
"parent",
"message",
".",
")",
"and",
"not",
"use",
"this",
"class",
"s",
"key",
"history",
"function",
".",
"<br",
">",
"Send",
"message",
"to",
"downstream",
"... | train | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/bolt/AmBaseBolt.java#L688-L691 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/util/TreeUtil.java | TreeUtil.findNode | public static Treenode findNode(Treeview tree, String path, boolean create, MatchMode matchMode) {
"""
Returns the tree item associated with the specified \-delimited path.
@param tree Tree to search.
@param path \-delimited path to search.
@param create If true, tree nodes are created if they do not already ... | java | public static Treenode findNode(Treeview tree, String path, boolean create, MatchMode matchMode) {
return findNode(tree, path, create, Treenode.class, matchMode);
} | [
"public",
"static",
"Treenode",
"findNode",
"(",
"Treeview",
"tree",
",",
"String",
"path",
",",
"boolean",
"create",
",",
"MatchMode",
"matchMode",
")",
"{",
"return",
"findNode",
"(",
"tree",
",",
"path",
",",
"create",
",",
"Treenode",
".",
"class",
","... | Returns the tree item associated with the specified \-delimited path.
@param tree Tree to search.
@param path \-delimited path to search.
@param create If true, tree nodes are created if they do not already exist.
@param matchMode The match mode.
@return The tree item corresponding to the specified path, or null if no... | [
"Returns",
"the",
"tree",
"item",
"associated",
"with",
"the",
"specified",
"\\",
"-",
"delimited",
"path",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/util/TreeUtil.java#L120-L122 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/io/BaseEncoding.java | BaseEncoding.decodeChecked | final byte[] decodeChecked(CharSequence chars)
throws DecodingException {
"""
Decodes the specified character sequence, and returns the resulting {@code byte[]}. This is the
inverse operation to {@link #encode(byte[])}.
@throws DecodingException if the input is not a valid encoded string according to thi... | java | final byte[] decodeChecked(CharSequence chars)
throws DecodingException {
chars = padding().trimTrailingFrom(chars);
byte[] tmp = new byte[maxDecodedSize(chars.length())];
int len = decodeTo(tmp, chars);
return extract(tmp, len);
} | [
"final",
"byte",
"[",
"]",
"decodeChecked",
"(",
"CharSequence",
"chars",
")",
"throws",
"DecodingException",
"{",
"chars",
"=",
"padding",
"(",
")",
".",
"trimTrailingFrom",
"(",
"chars",
")",
";",
"byte",
"[",
"]",
"tmp",
"=",
"new",
"byte",
"[",
"maxD... | Decodes the specified character sequence, and returns the resulting {@code byte[]}. This is the
inverse operation to {@link #encode(byte[])}.
@throws DecodingException if the input is not a valid encoded string according to this
encoding. | [
"Decodes",
"the",
"specified",
"character",
"sequence",
"and",
"returns",
"the",
"resulting",
"{",
"@code",
"byte",
"[]",
"}",
".",
"This",
"is",
"the",
"inverse",
"operation",
"to",
"{",
"@link",
"#encode",
"(",
"byte",
"[]",
")",
"}",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/io/BaseEncoding.java#L224-L230 |
qspin/qtaste | kernel/src/main/java/com/qspin/qtaste/util/PropertiesHistory.java | PropertiesHistory.checkPropertyValueOrTransition | public void checkPropertyValueOrTransition(String propertyValueOrTransition, double maxTime)
throws QTasteDataException, QTasteTestFailException {
"""
Checks that a property reaches a given value or do a given values
transition within given time.
If found, remove old values from history.
@param prop... | java | public void checkPropertyValueOrTransition(String propertyValueOrTransition, double maxTime)
throws QTasteDataException, QTasteTestFailException {
long beginTime_ms = System.currentTimeMillis();
long maxTime_ms = Math.round(maxTime * 1000);
propertyValueOrTransition = propertyValueOrTr... | [
"public",
"void",
"checkPropertyValueOrTransition",
"(",
"String",
"propertyValueOrTransition",
",",
"double",
"maxTime",
")",
"throws",
"QTasteDataException",
",",
"QTasteTestFailException",
"{",
"long",
"beginTime_ms",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
... | Checks that a property reaches a given value or do a given values
transition within given time.
If found, remove old values from history.
@param propertyValueOrTransition the property value or transition to check (case insensitive)
<dl>
<dd>Format: "<code><i>property</i>:</code>[<code>[</code>]<code><i>expected_value<... | [
"Checks",
"that",
"a",
"property",
"reaches",
"a",
"given",
"value",
"or",
"do",
"a",
"given",
"values",
"transition",
"within",
"given",
"time",
".",
"If",
"found",
"remove",
"old",
"values",
"from",
"history",
"."
] | train | https://github.com/qspin/qtaste/blob/ba45d4d86eb29b92f157c6e98536dee2002ddfdc/kernel/src/main/java/com/qspin/qtaste/util/PropertiesHistory.java#L228-L258 |
loldevs/riotapi | spectator/src/main/java/net/boreeas/riotapi/spectator/MappedDataCache.java | MappedDataCache.put | public void put(K k, V v) {
"""
Caches the given mapping and releases all waiting locks.
@param k The key to store.
@param v The value to store.
"""
cache.put(k, v);
acquireLock(k).countDown();
} | java | public void put(K k, V v) {
cache.put(k, v);
acquireLock(k).countDown();
} | [
"public",
"void",
"put",
"(",
"K",
"k",
",",
"V",
"v",
")",
"{",
"cache",
".",
"put",
"(",
"k",
",",
"v",
")",
";",
"acquireLock",
"(",
"k",
")",
".",
"countDown",
"(",
")",
";",
"}"
] | Caches the given mapping and releases all waiting locks.
@param k The key to store.
@param v The value to store. | [
"Caches",
"the",
"given",
"mapping",
"and",
"releases",
"all",
"waiting",
"locks",
"."
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/spectator/src/main/java/net/boreeas/riotapi/spectator/MappedDataCache.java#L56-L59 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.lockedBy | public CmsUser lockedBy(CmsDbContext dbc, CmsResource resource) throws CmsException {
"""
Returns the user, who had locked the resource.<p>
A user can lock a resource, so he is the only one who can write this
resource. This methods checks, if a resource was locked.
@param dbc the current database context
@... | java | public CmsUser lockedBy(CmsDbContext dbc, CmsResource resource) throws CmsException {
return readUser(dbc, m_lockManager.getLock(dbc, resource).getEditionLock().getUserId());
} | [
"public",
"CmsUser",
"lockedBy",
"(",
"CmsDbContext",
"dbc",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"return",
"readUser",
"(",
"dbc",
",",
"m_lockManager",
".",
"getLock",
"(",
"dbc",
",",
"resource",
")",
".",
"getEditionLock",
"(... | Returns the user, who had locked the resource.<p>
A user can lock a resource, so he is the only one who can write this
resource. This methods checks, if a resource was locked.
@param dbc the current database context
@param resource the resource
@return the user, who had locked the resource
@throws CmsException will... | [
"Returns",
"the",
"user",
"who",
"had",
"locked",
"the",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L5380-L5383 |
etnetera/seb | src/main/java/cz/etnetera/seb/Seb.java | Seb.constructEvent | @SuppressWarnings("unchecked")
public synchronized <T extends SebEvent> T constructEvent(Class<T> eventCls, SebContext context) {
"""
Constructs a new instance of {@link SebEvent} subclass with given context
and local time.
@param eventCls
The event class to construct
@param context
The context to use
@re... | java | @SuppressWarnings("unchecked")
public synchronized <T extends SebEvent> T constructEvent(Class<T> eventCls, SebContext context) {
try {
return (T) eventCls.getConstructor().newInstance().with(context, LocalDateTime.now());
} catch (Exception e) {
throw new EventConstructException("Unable to construct event "... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"synchronized",
"<",
"T",
"extends",
"SebEvent",
">",
"T",
"constructEvent",
"(",
"Class",
"<",
"T",
">",
"eventCls",
",",
"SebContext",
"context",
")",
"{",
"try",
"{",
"return",
"(",
"T",
")",... | Constructs a new instance of {@link SebEvent} subclass with given context
and local time.
@param eventCls
The event class to construct
@param context
The context to use
@return The event instance | [
"Constructs",
"a",
"new",
"instance",
"of",
"{",
"@link",
"SebEvent",
"}",
"subclass",
"with",
"given",
"context",
"and",
"local",
"time",
"."
] | train | https://github.com/etnetera/seb/blob/6aed29c7726db12f440c60cfd253de229064ed04/src/main/java/cz/etnetera/seb/Seb.java#L677-L684 |
facebook/fresco | drawee/src/main/java/com/facebook/drawee/generic/GenericDraweeHierarchy.java | GenericDraweeHierarchy.setOverlayImage | public void setOverlayImage(int index, @Nullable Drawable drawable) {
"""
Sets a new overlay image at the specified index.
This method will throw if the given index is out of bounds.
@param drawable background image
"""
// Note that overlays are by definition top-most and therefore the last elements ... | java | public void setOverlayImage(int index, @Nullable Drawable drawable) {
// Note that overlays are by definition top-most and therefore the last elements in the array.
Preconditions.checkArgument(
index >= 0 && OVERLAY_IMAGES_INDEX + index < mFadeDrawable.getNumberOfLayers(),
"The given index does ... | [
"public",
"void",
"setOverlayImage",
"(",
"int",
"index",
",",
"@",
"Nullable",
"Drawable",
"drawable",
")",
"{",
"// Note that overlays are by definition top-most and therefore the last elements in the array.",
"Preconditions",
".",
"checkArgument",
"(",
"index",
">=",
"0",
... | Sets a new overlay image at the specified index.
This method will throw if the given index is out of bounds.
@param drawable background image | [
"Sets",
"a",
"new",
"overlay",
"image",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/drawee/src/main/java/com/facebook/drawee/generic/GenericDraweeHierarchy.java#L559-L565 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/MapHelper.java | MapHelper.sizeOfIn | public int sizeOfIn(String expr, Map<String, Object> map) {
"""
Determines size of either (Map or Collection) value in the map.
@param expr expression indicating which (possibly nested) value in the map to determine size of.
@param map map to find value in.
@return size of value.
@throws SlimFixtureException i... | java | public int sizeOfIn(String expr, Map<String, Object> map) {
int result;
Object val = getValue(map, expr);
if (val instanceof Map) {
result = ((Map) val).size();
} else if (val instanceof Collection) {
result = ((Collection) val).size();
} else {
... | [
"public",
"int",
"sizeOfIn",
"(",
"String",
"expr",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"int",
"result",
";",
"Object",
"val",
"=",
"getValue",
"(",
"map",
",",
"expr",
")",
";",
"if",
"(",
"val",
"instanceof",
"Map",
")... | Determines size of either (Map or Collection) value in the map.
@param expr expression indicating which (possibly nested) value in the map to determine size of.
@param map map to find value in.
@return size of value.
@throws SlimFixtureException if the value found is not a Map or Collection. | [
"Determines",
"size",
"of",
"either",
"(",
"Map",
"or",
"Collection",
")",
"value",
"in",
"the",
"map",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/MapHelper.java#L166-L177 |
liferay/com-liferay-commerce | commerce-tax-engine-fixed-service/src/main/java/com/liferay/commerce/tax/engine/fixed/service/persistence/impl/CommerceTaxFixedRatePersistenceImpl.java | CommerceTaxFixedRatePersistenceImpl.findAll | @Override
public List<CommerceTaxFixedRate> findAll(int start, int end) {
"""
Returns a range of all the commerce tax fixed rates.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the ... | java | @Override
public List<CommerceTaxFixedRate> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceTaxFixedRate",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce tax fixed rates.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <c... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"tax",
"fixed",
"rates",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-tax-engine-fixed-service/src/main/java/com/liferay/commerce/tax/engine/fixed/service/persistence/impl/CommerceTaxFixedRatePersistenceImpl.java#L1969-L1972 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsInfoButton.java | CmsInfoButton.replaceData | public void replaceData(Map<String, String> data) {
"""
Replaces current Map with new map.<p>
@param data to replace the old map
"""
removeClickListener(m_clickListener);
m_clickListener = getClickListener(getHtmlLines(data), m_additionalElements);
addClickListener(m_clickListener);... | java | public void replaceData(Map<String, String> data) {
removeClickListener(m_clickListener);
m_clickListener = getClickListener(getHtmlLines(data), m_additionalElements);
addClickListener(m_clickListener);
} | [
"public",
"void",
"replaceData",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"data",
")",
"{",
"removeClickListener",
"(",
"m_clickListener",
")",
";",
"m_clickListener",
"=",
"getClickListener",
"(",
"getHtmlLines",
"(",
"data",
")",
",",
"m_additionalElemen... | Replaces current Map with new map.<p>
@param data to replace the old map | [
"Replaces",
"current",
"Map",
"with",
"new",
"map",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsInfoButton.java#L191-L197 |
b3dgs/lionengine | lionengine-audio-wav/src/main/java/com/b3dgs/lionengine/audio/wav/WavImpl.java | WavImpl.updateVolume | private static void updateVolume(DataLine dataLine, int volume) {
"""
Update the sound volume.
@param dataLine Audio source data.
@param volume The audio playback volume value.
"""
if (dataLine.isControlSupported(Type.MASTER_GAIN))
{
final FloatControl gainControl = (FloatContro... | java | private static void updateVolume(DataLine dataLine, int volume)
{
if (dataLine.isControlSupported(Type.MASTER_GAIN))
{
final FloatControl gainControl = (FloatControl) dataLine.getControl(Type.MASTER_GAIN);
final double gain = UtilMath.clamp(volume / 100.0, 0.0, 100.0);
... | [
"private",
"static",
"void",
"updateVolume",
"(",
"DataLine",
"dataLine",
",",
"int",
"volume",
")",
"{",
"if",
"(",
"dataLine",
".",
"isControlSupported",
"(",
"Type",
".",
"MASTER_GAIN",
")",
")",
"{",
"final",
"FloatControl",
"gainControl",
"=",
"(",
"Flo... | Update the sound volume.
@param dataLine Audio source data.
@param volume The audio playback volume value. | [
"Update",
"the",
"sound",
"volume",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-audio-wav/src/main/java/com/b3dgs/lionengine/audio/wav/WavImpl.java#L159-L168 |
JodaOrg/joda-time | src/main/java/org/joda/time/DateTime.java | DateTime.withTime | public DateTime withTime(int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) {
"""
Returns a copy of this datetime with the specified time, retaining the date fields.
<p>
If the time is already the time passed in, then <code>this</code> is returned.
<p>
To set a single field use the proper... | java | public DateTime withTime(int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) {
Chronology chrono = getChronology();
long localInstant = chrono.withUTC().getDateTimeMillis(
getYear(), getMonthOfYear(), getDayOfMonth(), hourOfDay, minuteOfHour, secondOfMinute, millisOfSeco... | [
"public",
"DateTime",
"withTime",
"(",
"int",
"hourOfDay",
",",
"int",
"minuteOfHour",
",",
"int",
"secondOfMinute",
",",
"int",
"millisOfSecond",
")",
"{",
"Chronology",
"chrono",
"=",
"getChronology",
"(",
")",
";",
"long",
"localInstant",
"=",
"chrono",
"."... | Returns a copy of this datetime with the specified time, retaining the date fields.
<p>
If the time is already the time passed in, then <code>this</code> is returned.
<p>
To set a single field use the properties, for example:
<pre>
DateTime set = dt.hourOfDay().setCopy(6);
</pre>
<p>
If the new time is invalid due to t... | [
"Returns",
"a",
"copy",
"of",
"this",
"datetime",
"with",
"the",
"specified",
"time",
"retaining",
"the",
"date",
"fields",
".",
"<p",
">",
"If",
"the",
"time",
"is",
"already",
"the",
"time",
"passed",
"in",
"then",
"<code",
">",
"this<",
"/",
"code",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTime.java#L770-L775 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java | HttpPostRequestEncoder.addBodyFileUploads | public void addBodyFileUploads(String name, File[] file, String[] contentType, boolean[] isText)
throws ErrorDataEncoderException {
"""
Add a series of Files associated with one File parameter
@param name
the name of the parameter
@param file
the array of files
@param contentType
the array of c... | java | public void addBodyFileUploads(String name, File[] file, String[] contentType, boolean[] isText)
throws ErrorDataEncoderException {
if (file.length != contentType.length && file.length != isText.length) {
throw new IllegalArgumentException("Different array length");
}
for... | [
"public",
"void",
"addBodyFileUploads",
"(",
"String",
"name",
",",
"File",
"[",
"]",
"file",
",",
"String",
"[",
"]",
"contentType",
",",
"boolean",
"[",
"]",
"isText",
")",
"throws",
"ErrorDataEncoderException",
"{",
"if",
"(",
"file",
".",
"length",
"!=... | Add a series of Files associated with one File parameter
@param name
the name of the parameter
@param file
the array of files
@param contentType
the array of content Types associated with each file
@param isText
the array of isText attribute (False meaning binary mode) for each file
@throws IllegalArgumentException
al... | [
"Add",
"a",
"series",
"of",
"Files",
"associated",
"with",
"one",
"File",
"parameter"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java#L429-L437 |
apache/incubator-gobblin | gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanAjaxAPIClient.java | AzkabanAjaxAPIClient.getProjectId | public static String getProjectId(String sessionId, AzkabanProjectConfig azkabanProjectConfig) throws IOException {
"""
*
Get project.id for a Project Name.
@param sessionId Session Id.
@param azkabanProjectConfig Azkaban Project Config.
@return Project Id.
@throws IOException
"""
// Note: Every get c... | java | public static String getProjectId(String sessionId, AzkabanProjectConfig azkabanProjectConfig) throws IOException {
// Note: Every get call to Azkaban provides a projectId in response, so we have are using fetchProjectFlows call
// .. because it does not need any additional params other than project name
Ma... | [
"public",
"static",
"String",
"getProjectId",
"(",
"String",
"sessionId",
",",
"AzkabanProjectConfig",
"azkabanProjectConfig",
")",
"throws",
"IOException",
"{",
"// Note: Every get call to Azkaban provides a projectId in response, so we have are using fetchProjectFlows call",
"// .. b... | *
Get project.id for a Project Name.
@param sessionId Session Id.
@param azkabanProjectConfig Azkaban Project Config.
@return Project Id.
@throws IOException | [
"*",
"Get",
"project",
".",
"id",
"for",
"a",
"Project",
"Name",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanAjaxAPIClient.java#L102-L111 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/javascript/IdentitySourceMapGenerator.java | IdentitySourceMapGenerator.getEndPosition | private FilePosition getEndPosition(Node node) throws IOException {
"""
Returns a {@link FilePosition} for the end position of the input node
@param node
the node whose end position we are after. Note that the Closure
compiler provides node length information only if ide mode is
true.
@return the end posit... | java | private FilePosition getEndPosition(Node node) throws IOException {
int length = node.getLength();
int lineno = currentLine;
int charno = currentChar;
while (charno + length > lineLengths[lineno]) {
length -= (lineLengths[lineno]-charno);
lineno++;
charno = 0;
if (lineno >= lineLengths.lengt... | [
"private",
"FilePosition",
"getEndPosition",
"(",
"Node",
"node",
")",
"throws",
"IOException",
"{",
"int",
"length",
"=",
"node",
".",
"getLength",
"(",
")",
";",
"int",
"lineno",
"=",
"currentLine",
";",
"int",
"charno",
"=",
"currentChar",
";",
"while",
... | Returns a {@link FilePosition} for the end position of the input node
@param node
the node whose end position we are after. Note that the Closure
compiler provides node length information only if ide mode is
true.
@return the end position of the node
@throws IOException | [
"Returns",
"a",
"{",
"@link",
"FilePosition",
"}",
"for",
"the",
"end",
"position",
"of",
"the",
"input",
"node"
] | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/javascript/IdentitySourceMapGenerator.java#L135-L150 |
copper-engine/copper-engine | projects/copper-coreengine/src/main/java/org/copperengine/core/audit/BatchingAuditTrail.java | BatchingAuditTrail.asynchLog | public void asynchLog(final AuditTrailEvent e, final AuditTrailCallback cb) {
"""
returns immediately after queueing the log message
@param e
the AuditTrailEvent to be logged
@param cb
callback called when logging succeeded or failed.
"""
CommandCallback<BatchInsertIntoAutoTrail.Command> callback ... | java | public void asynchLog(final AuditTrailEvent e, final AuditTrailCallback cb) {
CommandCallback<BatchInsertIntoAutoTrail.Command> callback = new CommandCallback<BatchInsertIntoAutoTrail.Command>() {
@Override
public void commandCompleted() {
cb.done();
}
... | [
"public",
"void",
"asynchLog",
"(",
"final",
"AuditTrailEvent",
"e",
",",
"final",
"AuditTrailCallback",
"cb",
")",
"{",
"CommandCallback",
"<",
"BatchInsertIntoAutoTrail",
".",
"Command",
">",
"callback",
"=",
"new",
"CommandCallback",
"<",
"BatchInsertIntoAutoTrail"... | returns immediately after queueing the log message
@param e
the AuditTrailEvent to be logged
@param cb
callback called when logging succeeded or failed. | [
"returns",
"immediately",
"after",
"queueing",
"the",
"log",
"message"
] | train | https://github.com/copper-engine/copper-engine/blob/92acf748a1be3d2d49e86b04e180bd19b1745c15/projects/copper-coreengine/src/main/java/org/copperengine/core/audit/BatchingAuditTrail.java#L119-L132 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java | AutoMlClient.createDataset | public final Dataset createDataset(LocationName parent, Dataset dataset) {
"""
Creates a dataset.
<p>Sample code:
<pre><code>
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Dataset dataset = Dataset.newBuilder().build();
Dataset... | java | public final Dataset createDataset(LocationName parent, Dataset dataset) {
CreateDatasetRequest request =
CreateDatasetRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setDataset(dataset)
.build();
return createDataset(request);
} | [
"public",
"final",
"Dataset",
"createDataset",
"(",
"LocationName",
"parent",
",",
"Dataset",
"dataset",
")",
"{",
"CreateDatasetRequest",
"request",
"=",
"CreateDatasetRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
"==",
"null",
"?",
"n... | Creates a dataset.
<p>Sample code:
<pre><code>
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Dataset dataset = Dataset.newBuilder().build();
Dataset response = autoMlClient.createDataset(parent, dataset);
}
</code></pre>
@param parent The ... | [
"Creates",
"a",
"dataset",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java#L203-L211 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/classify/LinearClassifier.java | LinearClassifier.scoresOf | public Counter<L> scoresOf(Datum<L, F> example) {
"""
Construct a counter with keys the labels of the classifier and
values the score (unnormalized log probability) of each class.
"""
if(example instanceof RVFDatum<?, ?>)return scoresOfRVFDatum((RVFDatum<L,F>)example);
Collection<F> feats = example.... | java | public Counter<L> scoresOf(Datum<L, F> example) {
if(example instanceof RVFDatum<?, ?>)return scoresOfRVFDatum((RVFDatum<L,F>)example);
Collection<F> feats = example.asFeatures();
int[] features = new int[feats.size()];
int i = 0;
for (F f : feats) {
int index = featureIndex.indexOf(f);
... | [
"public",
"Counter",
"<",
"L",
">",
"scoresOf",
"(",
"Datum",
"<",
"L",
",",
"F",
">",
"example",
")",
"{",
"if",
"(",
"example",
"instanceof",
"RVFDatum",
"<",
"?",
",",
"?",
">",
")",
"return",
"scoresOfRVFDatum",
"(",
"(",
"RVFDatum",
"<",
"L",
... | Construct a counter with keys the labels of the classifier and
values the score (unnormalized log probability) of each class. | [
"Construct",
"a",
"counter",
"with",
"keys",
"the",
"labels",
"of",
"the",
"classifier",
"and",
"values",
"the",
"score",
"(",
"unnormalized",
"log",
"probability",
")",
"of",
"each",
"class",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/classify/LinearClassifier.java#L129-L149 |
datasift/datasift-java | src/main/java/com/datasift/client/managedsource/sources/GooglePlus.java | GooglePlus.addOAutToken | public GooglePlus addOAutToken(String oAuthAccessToken, String oAuthRefreshToken, String name, long expires) {
"""
/*
Adds an OAuth token to the managed source
@param oAuthAccessToken an oauth2 token
@param oAuthRefreshToken an oauth2 refresh token
@param name a human friendly name for this aut... | java | public GooglePlus addOAutToken(String oAuthAccessToken, String oAuthRefreshToken, String name, long expires) {
if (oAuthAccessToken == null || oAuthAccessToken.isEmpty() ||
oAuthRefreshToken == null || oAuthRefreshToken.isEmpty()) {
throw new IllegalArgumentException("A valid OAuth a... | [
"public",
"GooglePlus",
"addOAutToken",
"(",
"String",
"oAuthAccessToken",
",",
"String",
"oAuthRefreshToken",
",",
"String",
"name",
",",
"long",
"expires",
")",
"{",
"if",
"(",
"oAuthAccessToken",
"==",
"null",
"||",
"oAuthAccessToken",
".",
"isEmpty",
"(",
")... | /*
Adds an OAuth token to the managed source
@param oAuthAccessToken an oauth2 token
@param oAuthRefreshToken an oauth2 refresh token
@param name a human friendly name for this auth token
@param expires identity resource expiry date/time as a UTC timestamp, i.e. when the token expires
@return t... | [
"/",
"*",
"Adds",
"an",
"OAuth",
"token",
"to",
"the",
"managed",
"source"
] | train | https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/managedsource/sources/GooglePlus.java#L72-L81 |
landawn/AbacusUtil | src/com/landawn/abacus/util/ExceptionalStream.java | ExceptionalStream.distinctBy | public ExceptionalStream<T, E> distinctBy(final Try.Function<? super T, ?, ? extends E> keyMapper) {
"""
Distinct by the value mapped from <code>keyMapper</code>
@param keyMapper don't change value of the input parameter.
@return
"""
checkArgNotNull(keyMapper, "keyMapper");
final Set<Ob... | java | public ExceptionalStream<T, E> distinctBy(final Try.Function<? super T, ?, ? extends E> keyMapper) {
checkArgNotNull(keyMapper, "keyMapper");
final Set<Object> set = new HashSet<>();
return filter(new Try.Predicate<T, E>() {
@Override
public boolean test(T value)... | [
"public",
"ExceptionalStream",
"<",
"T",
",",
"E",
">",
"distinctBy",
"(",
"final",
"Try",
".",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
",",
"?",
"extends",
"E",
">",
"keyMapper",
")",
"{",
"checkArgNotNull",
"(",
"keyMapper",
",",
"\"keyMapper\"",... | Distinct by the value mapped from <code>keyMapper</code>
@param keyMapper don't change value of the input parameter.
@return | [
"Distinct",
"by",
"the",
"value",
"mapped",
"from",
"<code",
">",
"keyMapper<",
"/",
"code",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/ExceptionalStream.java#L1002-L1013 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.getUsedNotHiddenParametersMap | public static Map<String, QueryParameter> getUsedNotHiddenParametersMap(Report report) {
"""
Get used parameters map where the key is the parameter name and the value is the parameter
Not all the report parameters have to be used, some may only be defined for further usage.
The result will not contain the hidden... | java | public static Map<String, QueryParameter> getUsedNotHiddenParametersMap(Report report) {
return getUsedParametersMap(report, false, false);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"getUsedNotHiddenParametersMap",
"(",
"Report",
"report",
")",
"{",
"return",
"getUsedParametersMap",
"(",
"report",
",",
"false",
",",
"false",
")",
";",
"}"
] | Get used parameters map where the key is the parameter name and the value is the parameter
Not all the report parameters have to be used, some may only be defined for further usage.
The result will not contain the hidden parameters.
@param report next report object
@return used not-hidden parameters map | [
"Get",
"used",
"parameters",
"map",
"where",
"the",
"key",
"is",
"the",
"parameter",
"name",
"and",
"the",
"value",
"is",
"the",
"parameter",
"Not",
"all",
"the",
"report",
"parameters",
"have",
"to",
"be",
"used",
"some",
"may",
"only",
"be",
"defined",
... | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L655-L657 |
mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.putProperty | public static void putProperty(Scriptable obj, String name, Object value) {
"""
Puts a named property in an object or in an object in its prototype chain.
<p>
Searches for the named property in the prototype chain. If it is found,
the value of the property in <code>obj</code> is changed through a call
to {@lin... | java | public static void putProperty(Scriptable obj, String name, Object value)
{
Scriptable base = getBase(obj, name);
if (base == null)
base = obj;
base.put(name, obj, value);
} | [
"public",
"static",
"void",
"putProperty",
"(",
"Scriptable",
"obj",
",",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"Scriptable",
"base",
"=",
"getBase",
"(",
"obj",
",",
"name",
")",
";",
"if",
"(",
"base",
"==",
"null",
")",
"base",
"=",
... | Puts a named property in an object or in an object in its prototype chain.
<p>
Searches for the named property in the prototype chain. If it is found,
the value of the property in <code>obj</code> is changed through a call
to {@link Scriptable#put(String, Scriptable, Object)} on the
prototype passing <code>obj</code> a... | [
"Puts",
"a",
"named",
"property",
"in",
"an",
"object",
"or",
"in",
"an",
"object",
"in",
"its",
"prototype",
"chain",
".",
"<p",
">",
"Searches",
"for",
"the",
"named",
"property",
"in",
"the",
"prototype",
"chain",
".",
"If",
"it",
"is",
"found",
"th... | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2502-L2508 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/protocol/HdfsFileStatus.java | HdfsFileStatus.toFileStatus | public static FileStatus toFileStatus(HdfsFileStatus stat, String src) {
"""
Convert an HdfsFileStatus to a FileStatus
@param stat an HdfsFileStatus
@param src parent path in string representation
@return a FileStatus object
"""
if (stat == null) {
return null;
}
return new FileStatus(stat... | java | public static FileStatus toFileStatus(HdfsFileStatus stat, String src) {
if (stat == null) {
return null;
}
return new FileStatus(stat.getLen(), stat.isDir(), stat.getReplication(),
stat.getBlockSize(), stat.getModificationTime(),
stat.getAccessTime(),
stat.getPermission(), sta... | [
"public",
"static",
"FileStatus",
"toFileStatus",
"(",
"HdfsFileStatus",
"stat",
",",
"String",
"src",
")",
"{",
"if",
"(",
"stat",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"FileStatus",
"(",
"stat",
".",
"getLen",
"(",
")",
... | Convert an HdfsFileStatus to a FileStatus
@param stat an HdfsFileStatus
@param src parent path in string representation
@return a FileStatus object | [
"Convert",
"an",
"HdfsFileStatus",
"to",
"a",
"FileStatus"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/protocol/HdfsFileStatus.java#L112-L121 |
getsentry/sentry-java | sentry/src/main/java/io/sentry/marshaller/json/ExceptionInterfaceBinding.java | ExceptionInterfaceBinding.writeException | private void writeException(JsonGenerator generator, SentryException sentryException) throws IOException {
"""
Outputs an exception with its StackTrace on a JSon stream.
@param generator JSonGenerator.
@param sentryException Sentry exception with its associated {@link StackTraceInterface}.
@throws IOExc... | java | private void writeException(JsonGenerator generator, SentryException sentryException) throws IOException {
generator.writeStartObject();
generator.writeStringField(TYPE_PARAMETER, sentryException.getExceptionClassName());
generator.writeStringField(VALUE_PARAMETER, sentryException.getExceptionMe... | [
"private",
"void",
"writeException",
"(",
"JsonGenerator",
"generator",
",",
"SentryException",
"sentryException",
")",
"throws",
"IOException",
"{",
"generator",
".",
"writeStartObject",
"(",
")",
";",
"generator",
".",
"writeStringField",
"(",
"TYPE_PARAMETER",
",",... | Outputs an exception with its StackTrace on a JSon stream.
@param generator JSonGenerator.
@param sentryException Sentry exception with its associated {@link StackTraceInterface}.
@throws IOException | [
"Outputs",
"an",
"exception",
"with",
"its",
"StackTrace",
"on",
"a",
"JSon",
"stream",
"."
] | train | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/marshaller/json/ExceptionInterfaceBinding.java#L53-L61 |
thorntail/thorntail | arquillian/gradle-adapter/src/main/java/org/wildfly/swarm/arquillian/adapter/gradle/GradleDependencyAdapter.java | GradleDependencyAdapter.toArtifactSpec | private static ArtifactSpec toArtifactSpec(DependencyDescriptor desc, String scope) {
"""
Translate the given dependency descriptor to the an artifact specification while overriding the scope as well.
@param desc the dependency descriptor reference.
@param scope the scope that needs to be set on the result.
... | java | private static ArtifactSpec toArtifactSpec(DependencyDescriptor desc, String scope) {
return new ArtifactSpec(scope, desc.getGroup(), desc.getName(), desc.getVersion(), desc.getType(),
desc.getClassifier(), desc.getFile());
} | [
"private",
"static",
"ArtifactSpec",
"toArtifactSpec",
"(",
"DependencyDescriptor",
"desc",
",",
"String",
"scope",
")",
"{",
"return",
"new",
"ArtifactSpec",
"(",
"scope",
",",
"desc",
".",
"getGroup",
"(",
")",
",",
"desc",
".",
"getName",
"(",
")",
",",
... | Translate the given dependency descriptor to the an artifact specification while overriding the scope as well.
@param desc the dependency descriptor reference.
@param scope the scope that needs to be set on the result.
@return an artifact sepcification. | [
"Translate",
"the",
"given",
"dependency",
"descriptor",
"to",
"the",
"an",
"artifact",
"specification",
"while",
"overriding",
"the",
"scope",
"as",
"well",
"."
] | train | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/arquillian/gradle-adapter/src/main/java/org/wildfly/swarm/arquillian/adapter/gradle/GradleDependencyAdapter.java#L197-L200 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/rules/Rules.java | Rules.conditionsRule | public static Rule conditionsRule(final Condition condition, StateObj result) {
"""
Create a rule: predicate(conditions) => new state(results)
@param condition single condition
@param result result
@return rule
"""
HashSet<Condition> conditions = new HashSet<>();
conditions.add(condit... | java | public static Rule conditionsRule(final Condition condition, StateObj result) {
HashSet<Condition> conditions = new HashSet<>();
conditions.add(condition);
return conditionsRule(conditions, result);
} | [
"public",
"static",
"Rule",
"conditionsRule",
"(",
"final",
"Condition",
"condition",
",",
"StateObj",
"result",
")",
"{",
"HashSet",
"<",
"Condition",
">",
"conditions",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"conditions",
".",
"add",
"(",
"condition",... | Create a rule: predicate(conditions) => new state(results)
@param condition single condition
@param result result
@return rule | [
"Create",
"a",
"rule",
":",
"predicate",
"(",
"conditions",
")",
"=",
">",
"new",
"state",
"(",
"results",
")"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/rules/Rules.java#L110-L114 |
EdwardRaff/JSAT | JSAT/src/jsat/io/CSV.java | CSV.readR | public static RegressionDataSet readR(int numeric_target_column, Reader reader, int lines_to_skip, Set<Integer> cat_cols) throws IOException {
"""
Reads in a CSV dataset as a regression dataset.
@param numeric_target_column the column index (starting from zero) of the
feature that will be the target regression... | java | public static RegressionDataSet readR(int numeric_target_column, Reader reader, int lines_to_skip, Set<Integer> cat_cols) throws IOException
{
return readR(numeric_target_column, reader, DEFAULT_DELIMITER, lines_to_skip, DEFAULT_COMMENT, cat_cols);
} | [
"public",
"static",
"RegressionDataSet",
"readR",
"(",
"int",
"numeric_target_column",
",",
"Reader",
"reader",
",",
"int",
"lines_to_skip",
",",
"Set",
"<",
"Integer",
">",
"cat_cols",
")",
"throws",
"IOException",
"{",
"return",
"readR",
"(",
"numeric_target_col... | Reads in a CSV dataset as a regression dataset.
@param numeric_target_column the column index (starting from zero) of the
feature that will be the target regression value
@param reader the reader for the CSV content
@param lines_to_skip the number of lines to skip when reading in the CSV
(used to skip header informati... | [
"Reads",
"in",
"a",
"CSV",
"dataset",
"as",
"a",
"regression",
"dataset",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/io/CSV.java#L91-L94 |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.setBaselineDuration | public void setBaselineDuration(int baselineNumber, Duration value) {
"""
Set a baseline value.
@param baselineNumber baseline index (1-10)
@param value baseline value
"""
set(selectField(TaskFieldLists.BASELINE_DURATIONS, baselineNumber), value);
} | java | public void setBaselineDuration(int baselineNumber, Duration value)
{
set(selectField(TaskFieldLists.BASELINE_DURATIONS, baselineNumber), value);
} | [
"public",
"void",
"setBaselineDuration",
"(",
"int",
"baselineNumber",
",",
"Duration",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"TaskFieldLists",
".",
"BASELINE_DURATIONS",
",",
"baselineNumber",
")",
",",
"value",
")",
";",
"}"
] | Set a baseline value.
@param baselineNumber baseline index (1-10)
@param value baseline value | [
"Set",
"a",
"baseline",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L3991-L3994 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/filter/ProxyFilter.java | ProxyFilter.sessionClosed | @Override
public void sessionClosed(NextFilter nextFilter, IoSession session)
throws Exception {
"""
Event is stored in an {@link IoSessionEventQueue} for later delivery to the next filter
in the chain when the handshake would have succeed. This will prevent the rest of
the filter chain from bein... | java | @Override
public void sessionClosed(NextFilter nextFilter, IoSession session)
throws Exception {
ProxyIoSession proxyIoSession = (ProxyIoSession) session
.getAttribute(ProxyIoSession.PROXY_SESSION);
proxyIoSession.getEventQueue().enqueueEventIfNecessary(
n... | [
"@",
"Override",
"public",
"void",
"sessionClosed",
"(",
"NextFilter",
"nextFilter",
",",
"IoSession",
"session",
")",
"throws",
"Exception",
"{",
"ProxyIoSession",
"proxyIoSession",
"=",
"(",
"ProxyIoSession",
")",
"session",
".",
"getAttribute",
"(",
"ProxyIoSessi... | Event is stored in an {@link IoSessionEventQueue} for later delivery to the next filter
in the chain when the handshake would have succeed. This will prevent the rest of
the filter chain from being affected by this filter internals.
@param nextFilter the next filter in filter chain
@param session the session object | [
"Event",
"is",
"stored",
"in",
"an",
"{",
"@link",
"IoSessionEventQueue",
"}",
"for",
"later",
"delivery",
"to",
"the",
"next",
"filter",
"in",
"the",
"chain",
"when",
"the",
"handshake",
"would",
"have",
"succeed",
".",
"This",
"will",
"prevent",
"the",
"... | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/filter/ProxyFilter.java#L351-L359 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/javascript/RequireExpansionCompilerPass.java | RequireExpansionCompilerPass.createRequireExpansionPlaceHolderNode | private Node createRequireExpansionPlaceHolderNode(int index) {
"""
Creates a var reference node for the require expansion place holder variable with the given
index. The node will correspond to javascript source similar to
<code>_&&JAGGR_DEPS___[0][3]</code>, where 3 is the specified index.
<p>
The underscore... | java | private Node createRequireExpansionPlaceHolderNode(int index) {
String varName = JavaScriptModuleBuilder.EXPDEPS_VARNAME + getPadding(index);
Node nameNode = Node.newString(Token.NAME, varName);
nameNode.putProp(Node.ORIGINALNAME_PROP, varName);
return new Node(Token.GETELEM, new Node(Token.GETELEM, nameNod... | [
"private",
"Node",
"createRequireExpansionPlaceHolderNode",
"(",
"int",
"index",
")",
"{",
"String",
"varName",
"=",
"JavaScriptModuleBuilder",
".",
"EXPDEPS_VARNAME",
"+",
"getPadding",
"(",
"index",
")",
";",
"Node",
"nameNode",
"=",
"Node",
".",
"newString",
"(... | Creates a var reference node for the require expansion place holder variable with the given
index. The node will correspond to javascript source similar to
<code>_&&JAGGR_DEPS___[0][3]</code>, where 3 is the specified index.
<p>
The underscores preceding the first array index are of variable length for the purpose of
k... | [
"Creates",
"a",
"var",
"reference",
"node",
"for",
"the",
"require",
"expansion",
"place",
"holder",
"variable",
"with",
"the",
"given",
"index",
".",
"The",
"node",
"will",
"correspond",
"to",
"javascript",
"source",
"similar",
"to",
"<code",
">",
"_&&JAGGR_D... | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/javascript/RequireExpansionCompilerPass.java#L479-L484 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/mult/VectorVectorMult_DDRM.java | VectorVectorMult_DDRM.innerProdA | public static double innerProdA(DMatrixD1 x, DMatrixD1 A , DMatrixD1 y ) {
"""
<p>
return = x<sup>T</sup>*A*y
</p>
@param x A vector with n elements. Not modified.
@param A A matrix with n by m elements. Not modified.
@param y A vector with m elements. Not modified.
@return The results.
"""
... | java | public static double innerProdA(DMatrixD1 x, DMatrixD1 A , DMatrixD1 y )
{
int n = A.numRows;
int m = A.numCols;
if( x.getNumElements() != n )
throw new IllegalArgumentException("Unexpected number of elements in x");
if( y.getNumElements() != m )
throw new Il... | [
"public",
"static",
"double",
"innerProdA",
"(",
"DMatrixD1",
"x",
",",
"DMatrixD1",
"A",
",",
"DMatrixD1",
"y",
")",
"{",
"int",
"n",
"=",
"A",
".",
"numRows",
";",
"int",
"m",
"=",
"A",
".",
"numCols",
";",
"if",
"(",
"x",
".",
"getNumElements",
... | <p>
return = x<sup>T</sup>*A*y
</p>
@param x A vector with n elements. Not modified.
@param A A matrix with n by m elements. Not modified.
@param y A vector with m elements. Not modified.
@return The results. | [
"<p",
">",
"return",
"=",
"x<sup",
">",
"T<",
"/",
"sup",
">",
"*",
"A",
"*",
"y",
"<",
"/",
"p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/mult/VectorVectorMult_DDRM.java#L72-L95 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java | ModificationBuilderTarget.addFile | public T addFile(final String name, final List<String> path, final byte[] newHash, final boolean isDirectory) {
"""
Add a misc file.
@param name the file name
@param path the relative path
@param newHash the new hash of the added content
@param isDirectory whether the file is a directory or not
@return the ... | java | public T addFile(final String name, final List<String> path, final byte[] newHash, final boolean isDirectory) {
return addFile(name, path, newHash, isDirectory, null);
} | [
"public",
"T",
"addFile",
"(",
"final",
"String",
"name",
",",
"final",
"List",
"<",
"String",
">",
"path",
",",
"final",
"byte",
"[",
"]",
"newHash",
",",
"final",
"boolean",
"isDirectory",
")",
"{",
"return",
"addFile",
"(",
"name",
",",
"path",
",",... | Add a misc file.
@param name the file name
@param path the relative path
@param newHash the new hash of the added content
@param isDirectory whether the file is a directory or not
@return the builder | [
"Add",
"a",
"misc",
"file",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L116-L118 |
astrapi69/jaulp-wicket | jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/panels/save/SaveDialogPanel.java | SaveDialogPanel.newCancelButton | protected AjaxButton newCancelButton(final String id, final Form<?> form) {
"""
Factory method for creating a new cancel {@link AjaxButton}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a cancel {@link AjaxButton}.
@param id... | java | protected AjaxButton newCancelButton(final String id, final Form<?> form)
{
final AjaxButton cancelButton = new AjaxButton(id, form)
{
/**
* The serialVersionUID.
*/
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
protected void onSubmit(final AjaxR... | [
"protected",
"AjaxButton",
"newCancelButton",
"(",
"final",
"String",
"id",
",",
"final",
"Form",
"<",
"?",
">",
"form",
")",
"{",
"final",
"AjaxButton",
"cancelButton",
"=",
"new",
"AjaxButton",
"(",
"id",
",",
"form",
")",
"{",
"/**\n\t\t\t * The serialVersi... | Factory method for creating a new cancel {@link AjaxButton}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a cancel {@link AjaxButton}.
@param id
the id
@param form
the form
@return the new {@link AjaxButton} | [
"Factory",
"method",
"for",
"creating",
"a",
"new",
"cancel",
"{",
"@link",
"AjaxButton",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/panels/save/SaveDialogPanel.java#L123-L142 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java | Node.unsubscribe | public void unsubscribe(String jid, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Remove the specific subscription related to the specified JID.
@param jid The JID used to subscribe to the node
@param subscriptionId The id of the subscr... | java | public void unsubscribe(String jid, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
sendPubsubPacket(createPubsubPacket(Type.set, new UnsubscribeExtension(jid, getId(), subscriptionId)));
} | [
"public",
"void",
"unsubscribe",
"(",
"String",
"jid",
",",
"String",
"subscriptionId",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"sendPubsubPacket",
"(",
"createPubsubPacket",
"(",
"... | Remove the specific subscription related to the specified JID.
@param jid The JID used to subscribe to the node
@param subscriptionId The id of the subscription being removed
@throws XMPPErrorException
@throws NoResponseException
@throws NotConnectedException
@throws InterruptedException | [
"Remove",
"the",
"specific",
"subscription",
"related",
"to",
"the",
"specified",
"JID",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java#L450-L452 |
protostuff/protostuff | protostuff-api/src/main/java/io/protostuff/IntSerializer.java | IntSerializer.writeInt32LE | public static void writeInt32LE(final int value, final byte[] buffer, int offset) {
"""
Writes the 32-bit int into the buffer starting with the least significant byte.
"""
buffer[offset++] = (byte) ((value >>> 0) & 0xFF);
buffer[offset++] = (byte) ((value >>> 8) & 0xFF);
buffer[offse... | java | public static void writeInt32LE(final int value, final byte[] buffer, int offset)
{
buffer[offset++] = (byte) ((value >>> 0) & 0xFF);
buffer[offset++] = (byte) ((value >>> 8) & 0xFF);
buffer[offset++] = (byte) ((value >>> 16) & 0xFF);
buffer[offset] = (byte) ((value >>> 24) & 0x... | [
"public",
"static",
"void",
"writeInt32LE",
"(",
"final",
"int",
"value",
",",
"final",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
")",
"{",
"buffer",
"[",
"offset",
"++",
"]",
"=",
"(",
"byte",
")",
"(",
"(",
"value",
">>>",
"0",
")",
"&",
... | Writes the 32-bit int into the buffer starting with the least significant byte. | [
"Writes",
"the",
"32",
"-",
"bit",
"int",
"into",
"the",
"buffer",
"starting",
"with",
"the",
"least",
"significant",
"byte",
"."
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-api/src/main/java/io/protostuff/IntSerializer.java#L70-L76 |
3redronin/mu-server | src/main/java/io/muserver/rest/CORSConfig.java | CORSConfig.writeHeaders | public boolean writeHeaders(MuRequest request, MuResponse response, Set<Method> allowedMethods) {
"""
Adds CORS headers to the response, if neeeded.
@param request The request
@param response The response to add headers to
@param allowedMethods The methods
@return Returns true if any Access Cont... | java | public boolean writeHeaders(MuRequest request, MuResponse response, Set<Method> allowedMethods) {
boolean written = writeHeadersInternal(request, response, null);
if (written) {
response.headers().set(HeaderNames.ACCESS_CONTROL_ALLOW_METHODS, getAllowedString(allowedMethods));
}
... | [
"public",
"boolean",
"writeHeaders",
"(",
"MuRequest",
"request",
",",
"MuResponse",
"response",
",",
"Set",
"<",
"Method",
">",
"allowedMethods",
")",
"{",
"boolean",
"written",
"=",
"writeHeadersInternal",
"(",
"request",
",",
"response",
",",
"null",
")",
"... | Adds CORS headers to the response, if neeeded.
@param request The request
@param response The response to add headers to
@param allowedMethods The methods
@return Returns true if any Access Control headers were added; otherwise false. (Note: the <code>Vary: origin</code> header is always added. | [
"Adds",
"CORS",
"headers",
"to",
"the",
"response",
"if",
"neeeded",
"."
] | train | https://github.com/3redronin/mu-server/blob/51598606a3082a121fbd785348ee9770b40308e6/src/main/java/io/muserver/rest/CORSConfig.java#L48-L54 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/alignment/BamUtils.java | BamUtils.createCoverageWigFile | public static void createCoverageWigFile(Path bamPath, Path coveragePath, int span) throws IOException, AlignmentCoverageException {
"""
Utility to compute the coverage from a BAM file, and create a wig format file with the coverage values according
to a window size (i.e., span in wig format specification).
@p... | java | public static void createCoverageWigFile(Path bamPath, Path coveragePath, int span) throws IOException, AlignmentCoverageException {
SAMFileHeader fileHeader = BamUtils.getFileHeader(bamPath);
AlignmentOptions options = new AlignmentOptions();
options.setContained(false);
BamManager al... | [
"public",
"static",
"void",
"createCoverageWigFile",
"(",
"Path",
"bamPath",
",",
"Path",
"coveragePath",
",",
"int",
"span",
")",
"throws",
"IOException",
",",
"AlignmentCoverageException",
"{",
"SAMFileHeader",
"fileHeader",
"=",
"BamUtils",
".",
"getFileHeader",
... | Utility to compute the coverage from a BAM file, and create a wig format file with the coverage values according
to a window size (i.e., span in wig format specification).
@param bamPath BAM file
@param coveragePath Wig file name where to save coverage values
@param span Span (to group cove... | [
"Utility",
"to",
"compute",
"the",
"coverage",
"from",
"a",
"BAM",
"file",
"and",
"create",
"a",
"wig",
"format",
"file",
"with",
"the",
"coverage",
"values",
"according",
"to",
"a",
"window",
"size",
"(",
"i",
".",
"e",
".",
"span",
"in",
"wig",
"form... | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/alignment/BamUtils.java#L224-L244 |
apache/incubator-heron | heron/common/src/java/org/apache/heron/common/network/HeronServer.java | HeronServer.handlePacket | private void handlePacket(SelectableChannel channel, IncomingPacket incomingPacket) {
"""
Handle an incomingPacket and invoke either onRequest or
onMessage() to handle it
"""
String typeName = incomingPacket.unpackString();
REQID rid = incomingPacket.unpackREQID();
Message.Builder bldr = requestMa... | java | private void handlePacket(SelectableChannel channel, IncomingPacket incomingPacket) {
String typeName = incomingPacket.unpackString();
REQID rid = incomingPacket.unpackREQID();
Message.Builder bldr = requestMap.get(typeName);
boolean isRequest = false;
if (bldr != null) {
// This is a request
... | [
"private",
"void",
"handlePacket",
"(",
"SelectableChannel",
"channel",
",",
"IncomingPacket",
"incomingPacket",
")",
"{",
"String",
"typeName",
"=",
"incomingPacket",
".",
"unpackString",
"(",
")",
";",
"REQID",
"rid",
"=",
"incomingPacket",
".",
"unpackREQID",
"... | Handle an incomingPacket and invoke either onRequest or
onMessage() to handle it | [
"Handle",
"an",
"incomingPacket",
"and",
"invoke",
"either",
"onRequest",
"or",
"onMessage",
"()",
"to",
"handle",
"it"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/common/src/java/org/apache/heron/common/network/HeronServer.java#L192-L226 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/wallet/WalletProtobufSerializer.java | WalletProtobufSerializer.readWallet | public Wallet readWallet(NetworkParameters params, @Nullable WalletExtension[] extensions,
Protos.Wallet walletProto) throws UnreadableWalletException {
"""
<p>Loads wallet data from the given protocol buffer and inserts it into the given Wallet object. This is primarily
useful when y... | java | public Wallet readWallet(NetworkParameters params, @Nullable WalletExtension[] extensions,
Protos.Wallet walletProto) throws UnreadableWalletException {
return readWallet(params, extensions, walletProto, false);
} | [
"public",
"Wallet",
"readWallet",
"(",
"NetworkParameters",
"params",
",",
"@",
"Nullable",
"WalletExtension",
"[",
"]",
"extensions",
",",
"Protos",
".",
"Wallet",
"walletProto",
")",
"throws",
"UnreadableWalletException",
"{",
"return",
"readWallet",
"(",
"params"... | <p>Loads wallet data from the given protocol buffer and inserts it into the given Wallet object. This is primarily
useful when you wish to pre-register extension objects. Note that if loading fails the provided Wallet object
may be in an indeterminate state and should be thrown away.</p>
<p>A wallet can be unreadable ... | [
"<p",
">",
"Loads",
"wallet",
"data",
"from",
"the",
"given",
"protocol",
"buffer",
"and",
"inserts",
"it",
"into",
"the",
"given",
"Wallet",
"object",
".",
"This",
"is",
"primarily",
"useful",
"when",
"you",
"wish",
"to",
"pre",
"-",
"register",
"extensio... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/wallet/WalletProtobufSerializer.java#L467-L470 |
line/armeria | spring/boot-webflux-autoconfigure/src/main/java/com/linecorp/armeria/spring/web/reactive/ArmeriaClientAutoConfiguration.java | ArmeriaClientAutoConfiguration.clientHttpConnector | @Bean
public ClientHttpConnector clientHttpConnector(
List<ArmeriaClientConfigurator> customizer,
DataBufferFactoryWrapper<?> factoryWrapper) {
"""
Returns a {@link ClientHttpConnector} which is configured by a list of
{@link ArmeriaClientConfigurator}s.
"""
return new Arme... | java | @Bean
public ClientHttpConnector clientHttpConnector(
List<ArmeriaClientConfigurator> customizer,
DataBufferFactoryWrapper<?> factoryWrapper) {
return new ArmeriaClientHttpConnector(customizer, factoryWrapper);
} | [
"@",
"Bean",
"public",
"ClientHttpConnector",
"clientHttpConnector",
"(",
"List",
"<",
"ArmeriaClientConfigurator",
">",
"customizer",
",",
"DataBufferFactoryWrapper",
"<",
"?",
">",
"factoryWrapper",
")",
"{",
"return",
"new",
"ArmeriaClientHttpConnector",
"(",
"custom... | Returns a {@link ClientHttpConnector} which is configured by a list of
{@link ArmeriaClientConfigurator}s. | [
"Returns",
"a",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/spring/boot-webflux-autoconfigure/src/main/java/com/linecorp/armeria/spring/web/reactive/ArmeriaClientAutoConfiguration.java#L44-L49 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java | Whitebox.getInternalState | public static <T> T getInternalState(Object object, Class<T> fieldType) {
"""
Get the value of a field using reflection based on the fields type. This
method will traverse the super class hierarchy until the first field of
type <tt>fieldType</tt> is found. The value of this field will be
returned.
@param obj... | java | public static <T> T getInternalState(Object object, Class<T> fieldType) {
return WhiteboxImpl.getInternalState(object, fieldType);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getInternalState",
"(",
"Object",
"object",
",",
"Class",
"<",
"T",
">",
"fieldType",
")",
"{",
"return",
"WhiteboxImpl",
".",
"getInternalState",
"(",
"object",
",",
"fieldType",
")",
";",
"}"
] | Get the value of a field using reflection based on the fields type. This
method will traverse the super class hierarchy until the first field of
type <tt>fieldType</tt> is found. The value of this field will be
returned.
@param object
the object to modify
@param fieldType
the type of the field | [
"Get",
"the",
"value",
"of",
"a",
"field",
"using",
"reflection",
"based",
"on",
"the",
"fields",
"type",
".",
"This",
"method",
"will",
"traverse",
"the",
"super",
"class",
"hierarchy",
"until",
"the",
"first",
"field",
"of",
"type",
"<tt",
">",
"fieldTyp... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java#L346-L349 |
datastax/spark-cassandra-connector | spark-cassandra-connector/src/main/java/com/datastax/driver/core/MetadataHook.java | MetadataHook.newToken | public static Token newToken(Metadata metadata, ByteBuffer routingKey) {
"""
Builds a new {@link Token} from a partition key, according to the partitioner reported by the Cassandra nodes.
@param metadata the original driver's metadata.
@param routingKey the routing key of the bound pa... | java | public static Token newToken(Metadata metadata, ByteBuffer routingKey) {
return metadata.tokenFactory().hash(routingKey);
} | [
"public",
"static",
"Token",
"newToken",
"(",
"Metadata",
"metadata",
",",
"ByteBuffer",
"routingKey",
")",
"{",
"return",
"metadata",
".",
"tokenFactory",
"(",
")",
".",
"hash",
"(",
"routingKey",
")",
";",
"}"
] | Builds a new {@link Token} from a partition key, according to the partitioner reported by the Cassandra nodes.
@param metadata the original driver's metadata.
@param routingKey the routing key of the bound partition key
@return the token.
@throws IllegalStateException if the token factory was... | [
"Builds",
"a",
"new",
"{",
"@link",
"Token",
"}",
"from",
"a",
"partition",
"key",
"according",
"to",
"the",
"partitioner",
"reported",
"by",
"the",
"Cassandra",
"nodes",
"."
] | train | https://github.com/datastax/spark-cassandra-connector/blob/23c09965c34576e17b4315772eb78af399ec9df1/spark-cassandra-connector/src/main/java/com/datastax/driver/core/MetadataHook.java#L21-L23 |
fabric8io/fabric8-forge | fabric8-forge-rest-client/src/main/java/io/fabric8/forge/rest/client/ForgeClientHelpers.java | ForgeClientHelpers.tailLog | public static TailResults tailLog(String uri, TailResults previousResults, Function<String, Void> lineProcessor) throws IOException {
"""
Tails the log of the given URL such as a build log, processing all new lines since the last results
"""
URL logURL = new URL(uri);
try (InputStream inputStre... | java | public static TailResults tailLog(String uri, TailResults previousResults, Function<String, Void> lineProcessor) throws IOException {
URL logURL = new URL(uri);
try (InputStream inputStream = logURL.openStream()) {
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)... | [
"public",
"static",
"TailResults",
"tailLog",
"(",
"String",
"uri",
",",
"TailResults",
"previousResults",
",",
"Function",
"<",
"String",
",",
"Void",
">",
"lineProcessor",
")",
"throws",
"IOException",
"{",
"URL",
"logURL",
"=",
"new",
"URL",
"(",
"uri",
"... | Tails the log of the given URL such as a build log, processing all new lines since the last results | [
"Tails",
"the",
"log",
"of",
"the",
"given",
"URL",
"such",
"as",
"a",
"build",
"log",
"processing",
"all",
"new",
"lines",
"since",
"the",
"last",
"results"
] | train | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/fabric8-forge-rest-client/src/main/java/io/fabric8/forge/rest/client/ForgeClientHelpers.java#L139-L156 |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/journey/api/AnalyzedProducerCallsMapAO.java | AnalyzedProducerCallsMapAO.addProducerCall | public void addProducerCall(String producerId, long duration) {
"""
Adds a new producer call. The duration and the number of calls for each producer will be increased accordingly.
@param producerId id of the producer.
@param duration duration of the call.
"""
AnalyzedProducerCallsAO bean = beans.get(produc... | java | public void addProducerCall(String producerId, long duration){
AnalyzedProducerCallsAO bean = beans.get(producerId);
if (bean==null){
bean = new AnalyzedProducerCallsAO(producerId);
beans.put(producerId, bean);
}
bean.addCall(duration);
totalCalls++;
totalDuration+=duration;
} | [
"public",
"void",
"addProducerCall",
"(",
"String",
"producerId",
",",
"long",
"duration",
")",
"{",
"AnalyzedProducerCallsAO",
"bean",
"=",
"beans",
".",
"get",
"(",
"producerId",
")",
";",
"if",
"(",
"bean",
"==",
"null",
")",
"{",
"bean",
"=",
"new",
... | Adds a new producer call. The duration and the number of calls for each producer will be increased accordingly.
@param producerId id of the producer.
@param duration duration of the call. | [
"Adds",
"a",
"new",
"producer",
"call",
".",
"The",
"duration",
"and",
"the",
"number",
"of",
"calls",
"for",
"each",
"producer",
"will",
"be",
"increased",
"accordingly",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/journey/api/AnalyzedProducerCallsMapAO.java#L52-L62 |
Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/index/ESIndexer.java | ESIndexer.getSearchResponse | private SearchResponse getSearchResponse(KunderaQuery kunderaQuery, FilteredQueryBuilder queryBuilder,
QueryBuilder filter, ESQuery query, EntityMetadata m, int firstResult, int maxResults,
KunderaMetadata kunderaMetadata) {
"""
Gets the search response.
@param kunderaQuery
the kundera ... | java | private SearchResponse getSearchResponse(KunderaQuery kunderaQuery, FilteredQueryBuilder queryBuilder,
QueryBuilder filter, ESQuery query, EntityMetadata m, int firstResult, int maxResults,
KunderaMetadata kunderaMetadata)
{
SearchRequestBuilder builder = client.prepareSearch(m.getSc... | [
"private",
"SearchResponse",
"getSearchResponse",
"(",
"KunderaQuery",
"kunderaQuery",
",",
"FilteredQueryBuilder",
"queryBuilder",
",",
"QueryBuilder",
"filter",
",",
"ESQuery",
"query",
",",
"EntityMetadata",
"m",
",",
"int",
"firstResult",
",",
"int",
"maxResults",
... | Gets the search response.
@param kunderaQuery
the kundera query
@param queryBuilder
the query builder
@param filter
the filter
@param query
the query
@param m
the m
@param kunderaMetadata
@return the search response | [
"Gets",
"the",
"search",
"response",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/index/ESIndexer.java#L271-L313 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/optimize/listeners/CheckpointListener.java | CheckpointListener.loadCheckpointMLN | public static MultiLayerNetwork loadCheckpointMLN(File rootDir, Checkpoint checkpoint) {
"""
Load a MultiLayerNetwork for the given checkpoint that resides in the specified root directory
@param rootDir Root directory for the checkpoint
@param checkpoint Checkpoint model to load
@return The loaded model
... | java | public static MultiLayerNetwork loadCheckpointMLN(File rootDir, Checkpoint checkpoint) {
return loadCheckpointMLN(rootDir, checkpoint.getCheckpointNum());
} | [
"public",
"static",
"MultiLayerNetwork",
"loadCheckpointMLN",
"(",
"File",
"rootDir",
",",
"Checkpoint",
"checkpoint",
")",
"{",
"return",
"loadCheckpointMLN",
"(",
"rootDir",
",",
"checkpoint",
".",
"getCheckpointNum",
"(",
")",
")",
";",
"}"
] | Load a MultiLayerNetwork for the given checkpoint that resides in the specified root directory
@param rootDir Root directory for the checkpoint
@param checkpoint Checkpoint model to load
@return The loaded model | [
"Load",
"a",
"MultiLayerNetwork",
"for",
"the",
"given",
"checkpoint",
"that",
"resides",
"in",
"the",
"specified",
"root",
"directory"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/optimize/listeners/CheckpointListener.java#L454-L456 |
HsiangLeekwok/hlklib | hlklib/src/main/java/com/hlk/hlklib/lib/datetimepicker/TimeFragment.java | TimeFragment.fixTimePickerBug18982 | private void fixTimePickerBug18982() {
"""
Workaround for bug in Android TimePicker where the onTimeChanged() callback
is not invoked when the user toggles between AM/PM. But we need to be able
to detect this in order to dynamically update the tab title properly when
the user toggles between AM/PM.
<p>
Regist... | java | private void fixTimePickerBug18982() {
View amPmView = ((ViewGroup) mTimePicker.getChildAt(0)).getChildAt(3);
if (amPmView instanceof NumberPicker) {
((NumberPicker) amPmView).setOnValueChangedListener(new OnValueChangeListener() {
@Override
public void onVa... | [
"private",
"void",
"fixTimePickerBug18982",
"(",
")",
"{",
"View",
"amPmView",
"=",
"(",
"(",
"ViewGroup",
")",
"mTimePicker",
".",
"getChildAt",
"(",
"0",
")",
")",
".",
"getChildAt",
"(",
"3",
")",
";",
"if",
"(",
"amPmView",
"instanceof",
"NumberPicker"... | Workaround for bug in Android TimePicker where the onTimeChanged() callback
is not invoked when the user toggles between AM/PM. But we need to be able
to detect this in order to dynamically update the tab title properly when
the user toggles between AM/PM.
<p>
Registered as Issue 18982:
<p>
https://code.google.com/p/an... | [
"Workaround",
"for",
"bug",
"in",
"Android",
"TimePicker",
"where",
"the",
"onTimeChanged",
"()",
"callback",
"is",
"not",
"invoked",
"when",
"the",
"user",
"toggles",
"between",
"AM",
"/",
"PM",
".",
"But",
"we",
"need",
"to",
"be",
"able",
"to",
"detect"... | train | https://github.com/HsiangLeekwok/hlklib/blob/b122f6dcab7cec60c8e5455e0c31613d08bec6ad/hlklib/src/main/java/com/hlk/hlklib/lib/datetimepicker/TimeFragment.java#L157-L181 |
morimekta/utils | io-util/src/main/java/net/morimekta/util/Strings.java | Strings.commonPrefix | public static int commonPrefix(String text1, String text2) {
"""
Determine the common prefix of two strings
@param text1 First string.
@param text2 Second string.
@return The number of characters common to the start of each string.
"""
// Performance analysis: http://neil.fraser.name/news/2007/10/09... | java | public static int commonPrefix(String text1, String text2) {
// Performance analysis: http://neil.fraser.name/news/2007/10/09/
int n = Math.min(text1.length(), text2.length());
for (int i = 0; i < n; i++) {
if (text1.charAt(i) != text2.charAt(i)) {
return i;
... | [
"public",
"static",
"int",
"commonPrefix",
"(",
"String",
"text1",
",",
"String",
"text2",
")",
"{",
"// Performance analysis: http://neil.fraser.name/news/2007/10/09/",
"int",
"n",
"=",
"Math",
".",
"min",
"(",
"text1",
".",
"length",
"(",
")",
",",
"text2",
".... | Determine the common prefix of two strings
@param text1 First string.
@param text2 Second string.
@return The number of characters common to the start of each string. | [
"Determine",
"the",
"common",
"prefix",
"of",
"two",
"strings"
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/io-util/src/main/java/net/morimekta/util/Strings.java#L680-L689 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/MessageBuilder.java | MessageBuilder.appendCode | public MessageBuilder appendCode(String language, String code) {
"""
Appends code to the message.
@param language The language, e.g. "java".
@param code The code.
@return The current instance in order to chain call methods.
"""
delegate.appendCode(language, code);
return this;
} | java | public MessageBuilder appendCode(String language, String code) {
delegate.appendCode(language, code);
return this;
} | [
"public",
"MessageBuilder",
"appendCode",
"(",
"String",
"language",
",",
"String",
"code",
")",
"{",
"delegate",
".",
"appendCode",
"(",
"language",
",",
"code",
")",
";",
"return",
"this",
";",
"}"
] | Appends code to the message.
@param language The language, e.g. "java".
@param code The code.
@return The current instance in order to chain call methods. | [
"Appends",
"code",
"to",
"the",
"message",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/MessageBuilder.java#L53-L56 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_responder_account_GET | public OvhResponder domain_responder_account_GET(String domain, String account) throws IOException {
"""
Get this object properties
REST: GET /email/domain/{domain}/responder/{account}
@param domain [required] Name of your domain name
@param account [required] Name of account
"""
String qPath = "/email/... | java | public OvhResponder domain_responder_account_GET(String domain, String account) throws IOException {
String qPath = "/email/domain/{domain}/responder/{account}";
StringBuilder sb = path(qPath, domain, account);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhResponder.class);
} | [
"public",
"OvhResponder",
"domain_responder_account_GET",
"(",
"String",
"domain",
",",
"String",
"account",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/responder/{account}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath... | Get this object properties
REST: GET /email/domain/{domain}/responder/{account}
@param domain [required] Name of your domain name
@param account [required] Name of account | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L950-L955 |
eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/proposition/PropositionUtil.java | PropositionUtil.binarySearch | public static PrimitiveParameter binarySearch(
List<PrimitiveParameter> params, long timestamp) {
"""
Binary search for a primitive parameter by timestamp.
@param list
a <code>List</code> of <code>PrimitiveParameter</code>
objects all with the same paramId, cannot be <code>null</code>.
@param tst... | java | public static PrimitiveParameter binarySearch(
List<PrimitiveParameter> params, long timestamp) {
/*
* The conditions for using index versus iterator are grabbed from the
* JDK source code.
*/
if (params.size() < 5000 || params instanceof RandomAccess) {
... | [
"public",
"static",
"PrimitiveParameter",
"binarySearch",
"(",
"List",
"<",
"PrimitiveParameter",
">",
"params",
",",
"long",
"timestamp",
")",
"{",
"/*\n * The conditions for using index versus iterator are grabbed from the\n * JDK source code.\n */",
"if",
... | Binary search for a primitive parameter by timestamp.
@param list
a <code>List</code> of <code>PrimitiveParameter</code>
objects all with the same paramId, cannot be <code>null</code>.
@param tstamp
the timestamp we're interested in finding.
@return a <code>PrimitiveParameter</code>, or null if not found. | [
"Binary",
"search",
"for",
"a",
"primitive",
"parameter",
"by",
"timestamp",
"."
] | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/proposition/PropositionUtil.java#L440-L451 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/ExceptionUtil.java | ExceptionUtil.logException | public final static void logException(TraceComponent compTc, Throwable t, EJBMethodMetaData m, BeanO bean) {
"""
d408351 - added new signature with customizable TraceComponent
"""
//d408351 - only log recursive exceptions if they have not been logged before
if (hasBeenLogged(t)) {
r... | java | public final static void logException(TraceComponent compTc, Throwable t, EJBMethodMetaData m, BeanO bean) {
//d408351 - only log recursive exceptions if they have not been logged before
if (hasBeenLogged(t)) {
return;
}
BeanId beanId = null;
if (bean != null) {
... | [
"public",
"final",
"static",
"void",
"logException",
"(",
"TraceComponent",
"compTc",
",",
"Throwable",
"t",
",",
"EJBMethodMetaData",
"m",
",",
"BeanO",
"bean",
")",
"{",
"//d408351 - only log recursive exceptions if they have not been logged before",
"if",
"(",
"hasBeen... | d408351 - added new signature with customizable TraceComponent | [
"d408351",
"-",
"added",
"new",
"signature",
"with",
"customizable",
"TraceComponent"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/ExceptionUtil.java#L82-L109 |
threerings/nenya | core/src/main/java/com/threerings/openal/FileStream.java | FileStream.queueFile | public void queueFile (File file, boolean loop) {
"""
Adds a file to the queue of files to play.
@param loop if true, play this file in a loop if there's nothing else
on the queue
"""
try {
queueURL(file.toURI().toURL(), loop);
} catch (MalformedURLException e) {
log... | java | public void queueFile (File file, boolean loop)
{
try {
queueURL(file.toURI().toURL(), loop);
} catch (MalformedURLException e) {
log.warning("Invalid file url.", "file", file, e);
}
} | [
"public",
"void",
"queueFile",
"(",
"File",
"file",
",",
"boolean",
"loop",
")",
"{",
"try",
"{",
"queueURL",
"(",
"file",
".",
"toURI",
"(",
")",
".",
"toURL",
"(",
")",
",",
"loop",
")",
";",
"}",
"catch",
"(",
"MalformedURLException",
"e",
")",
... | Adds a file to the queue of files to play.
@param loop if true, play this file in a loop if there's nothing else
on the queue | [
"Adds",
"a",
"file",
"to",
"the",
"queue",
"of",
"files",
"to",
"play",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/FileStream.java#L52-L59 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/edge/EdgeIntensityPolygon.java | EdgeIntensityPolygon.checkIntensity | public boolean checkIntensity( boolean insideDark , double threshold ) {
"""
Checks the edge intensity against a threshold.
dark: outside-inside ≥ threshold
light: inside-outside ≥ threshold
@param insideDark is the inside of the polygon supposed to be dark or light?
@param threshold threshold for av... | java | public boolean checkIntensity( boolean insideDark , double threshold ) {
if( insideDark )
return averageOutside-averageInside >= threshold;
else
return averageInside-averageOutside >= threshold;
} | [
"public",
"boolean",
"checkIntensity",
"(",
"boolean",
"insideDark",
",",
"double",
"threshold",
")",
"{",
"if",
"(",
"insideDark",
")",
"return",
"averageOutside",
"-",
"averageInside",
">=",
"threshold",
";",
"else",
"return",
"averageInside",
"-",
"averageOutsi... | Checks the edge intensity against a threshold.
dark: outside-inside ≥ threshold
light: inside-outside ≥ threshold
@param insideDark is the inside of the polygon supposed to be dark or light?
@param threshold threshold for average difference
@return true if the edge intensity is significant enough | [
"Checks",
"the",
"edge",
"intensity",
"against",
"a",
"threshold",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/edge/EdgeIntensityPolygon.java#L158-L163 |
interedition/collatex | collatex-core/src/main/java/eu/interedition/collatex/suffixarray/QSufSort.java | QSufSort.select_sort_split | private void select_sort_split(int p, int n) {
"""
Quadratic sorting method to use for small subarrays. To be able to update group
numbers consistently, a variant of selection sorting is used.
"""
int pa, pb, pi, pn;
int f, v;
pa = p; /* pa is start of group being picked out. */
... | java | private void select_sort_split(int p, int n) {
int pa, pb, pi, pn;
int f, v;
pa = p; /* pa is start of group being picked out. */
pn = p + n - 1; /* pn is last position of subarray. */
while (pa < pn) {
for (pi = pb = pa + 1, f = KEY(pa); pi <= pn; ++pi)
... | [
"private",
"void",
"select_sort_split",
"(",
"int",
"p",
",",
"int",
"n",
")",
"{",
"int",
"pa",
",",
"pb",
",",
"pi",
",",
"pn",
";",
"int",
"f",
",",
"v",
";",
"pa",
"=",
"p",
";",
"/* pa is start of group being picked out. */",
"pn",
"=",
"p",
"+"... | Quadratic sorting method to use for small subarrays. To be able to update group
numbers consistently, a variant of selection sorting is used. | [
"Quadratic",
"sorting",
"method",
"to",
"use",
"for",
"small",
"subarrays",
".",
"To",
"be",
"able",
"to",
"update",
"group",
"numbers",
"consistently",
"a",
"variant",
"of",
"selection",
"sorting",
"is",
"used",
"."
] | train | https://github.com/interedition/collatex/blob/76dd1fcc36047bc66a87d31142e72e98b5347821/collatex-core/src/main/java/eu/interedition/collatex/suffixarray/QSufSort.java#L254-L277 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/PriorityUtility.java | PriorityUtility.getInstance | public static Priority getInstance(Locale locale, String priority) {
"""
This method takes the textual version of a priority
and returns an appropriate instance of this class. Note that unrecognised
values are treated as medium priority.
@param locale target locale
@param priority text version of the priorit... | java | public static Priority getInstance(Locale locale, String priority)
{
int index = DEFAULT_PRIORITY_INDEX;
if (priority != null)
{
String[] priorityTypes = LocaleData.getStringArray(locale, LocaleData.PRIORITY_TYPES);
for (int loop = 0; loop < priorityTypes.length; loop++)
... | [
"public",
"static",
"Priority",
"getInstance",
"(",
"Locale",
"locale",
",",
"String",
"priority",
")",
"{",
"int",
"index",
"=",
"DEFAULT_PRIORITY_INDEX",
";",
"if",
"(",
"priority",
"!=",
"null",
")",
"{",
"String",
"[",
"]",
"priorityTypes",
"=",
"LocaleD... | This method takes the textual version of a priority
and returns an appropriate instance of this class. Note that unrecognised
values are treated as medium priority.
@param locale target locale
@param priority text version of the priority
@return Priority class instance | [
"This",
"method",
"takes",
"the",
"textual",
"version",
"of",
"a",
"priority",
"and",
"returns",
"an",
"appropriate",
"instance",
"of",
"this",
"class",
".",
"Note",
"that",
"unrecognised",
"values",
"are",
"treated",
"as",
"medium",
"priority",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/PriorityUtility.java#L53-L71 |
fabric8io/fabric8-forge | addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/ConfigureEipPropertiesStep.java | ConfigureEipPropertiesStep.mandatoryAttributeValue | public static String mandatoryAttributeValue(Map<Object, Object> attributeMap, String name) {
"""
Returns the mandatory String value of the given name
@throws IllegalArgumentException if the value is not available in the given attribute map
"""
Object value = attributeMap.get(name);
if (valu... | java | public static String mandatoryAttributeValue(Map<Object, Object> attributeMap, String name) {
Object value = attributeMap.get(name);
if (value != null) {
String text = value.toString();
if (!Strings.isBlank(text)) {
return text;
}
}
thr... | [
"public",
"static",
"String",
"mandatoryAttributeValue",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"attributeMap",
",",
"String",
"name",
")",
"{",
"Object",
"value",
"=",
"attributeMap",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"value",
"!=",
... | Returns the mandatory String value of the given name
@throws IllegalArgumentException if the value is not available in the given attribute map | [
"Returns",
"the",
"mandatory",
"String",
"value",
"of",
"the",
"given",
"name"
] | train | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/ConfigureEipPropertiesStep.java#L319-L328 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/config/ConfigValidator.java | ConfigValidator.checkMapConfig | public static void checkMapConfig(MapConfig mapConfig, MergePolicyProvider mergePolicyProvider) {
"""
Validates the given {@link MapConfig}.
@param mapConfig the {@link MapConfig}
@param mergePolicyProvider the {@link MergePolicyProvider} to resolve merge policy classes
"""
checkNotNative... | java | public static void checkMapConfig(MapConfig mapConfig, MergePolicyProvider mergePolicyProvider) {
checkNotNativeWhenOpenSource(mapConfig.getInMemoryFormat());
checkMapMergePolicy(mapConfig, mergePolicyProvider);
logIgnoredConfig(mapConfig);
} | [
"public",
"static",
"void",
"checkMapConfig",
"(",
"MapConfig",
"mapConfig",
",",
"MergePolicyProvider",
"mergePolicyProvider",
")",
"{",
"checkNotNativeWhenOpenSource",
"(",
"mapConfig",
".",
"getInMemoryFormat",
"(",
")",
")",
";",
"checkMapMergePolicy",
"(",
"mapConf... | Validates the given {@link MapConfig}.
@param mapConfig the {@link MapConfig}
@param mergePolicyProvider the {@link MergePolicyProvider} to resolve merge policy classes | [
"Validates",
"the",
"given",
"{",
"@link",
"MapConfig",
"}",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/config/ConfigValidator.java#L105-L109 |
apache/flink | flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java | OrcBatchReader.schemaToTypeInfo | static TypeInformation schemaToTypeInfo(TypeDescription schema) {
"""
Converts an ORC schema to a Flink TypeInformation.
@param schema The ORC schema.
@return The TypeInformation that corresponds to the ORC schema.
"""
switch (schema.getCategory()) {
case BOOLEAN:
return BasicTypeInfo.BOOLEAN_TYPE... | java | static TypeInformation schemaToTypeInfo(TypeDescription schema) {
switch (schema.getCategory()) {
case BOOLEAN:
return BasicTypeInfo.BOOLEAN_TYPE_INFO;
case BYTE:
return BasicTypeInfo.BYTE_TYPE_INFO;
case SHORT:
return BasicTypeInfo.SHORT_TYPE_INFO;
case INT:
return BasicTypeInfo.INT_TYPE_... | [
"static",
"TypeInformation",
"schemaToTypeInfo",
"(",
"TypeDescription",
"schema",
")",
"{",
"switch",
"(",
"schema",
".",
"getCategory",
"(",
")",
")",
"{",
"case",
"BOOLEAN",
":",
"return",
"BasicTypeInfo",
".",
"BOOLEAN_TYPE_INFO",
";",
"case",
"BYTE",
":",
... | Converts an ORC schema to a Flink TypeInformation.
@param schema The ORC schema.
@return The TypeInformation that corresponds to the ORC schema. | [
"Converts",
"an",
"ORC",
"schema",
"to",
"a",
"Flink",
"TypeInformation",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java#L72-L124 |
wildfly-swarm-archive/ARCHIVE-wildfly-swarm | logging/api/src/main/java/org/wildfly/swarm/logging/LoggingFraction.java | LoggingFraction.consoleHandler | public LoggingFraction consoleHandler(Level level, String formatter) {
"""
Add a ConsoleHandler to the list of handlers for this logger.
@param level The logging level
@param formatter A pattern string for the console's formatter
@return This fraction
"""
consoleHandler(new ConsoleHandler(CONS... | java | public LoggingFraction consoleHandler(Level level, String formatter) {
consoleHandler(new ConsoleHandler(CONSOLE)
.level(level)
.namedFormatter(formatter));
return this;
} | [
"public",
"LoggingFraction",
"consoleHandler",
"(",
"Level",
"level",
",",
"String",
"formatter",
")",
"{",
"consoleHandler",
"(",
"new",
"ConsoleHandler",
"(",
"CONSOLE",
")",
".",
"level",
"(",
"level",
")",
".",
"namedFormatter",
"(",
"formatter",
")",
")",... | Add a ConsoleHandler to the list of handlers for this logger.
@param level The logging level
@param formatter A pattern string for the console's formatter
@return This fraction | [
"Add",
"a",
"ConsoleHandler",
"to",
"the",
"list",
"of",
"handlers",
"for",
"this",
"logger",
"."
] | train | https://github.com/wildfly-swarm-archive/ARCHIVE-wildfly-swarm/blob/28ef71bcfa743a7267666e0ed2919c37b356c09b/logging/api/src/main/java/org/wildfly/swarm/logging/LoggingFraction.java#L194-L199 |
alkacon/opencms-core | src/org/opencms/ui/dialogs/history/diff/CmsValueDiff.java | CmsValueDiff.buildWholeFileDiffView | private Component buildWholeFileDiffView(CmsObject cms, CmsFile file1, CmsFile file2) {
"""
Builds the diff view for the XML text.<p>
@param cms the CMS context
@param file1 the first file
@param file2 the second file
@return the diff view
"""
String encoding = "UTF-8";
try {
... | java | private Component buildWholeFileDiffView(CmsObject cms, CmsFile file1, CmsFile file2) {
String encoding = "UTF-8";
try {
CmsXmlContent content1 = CmsXmlContentFactory.unmarshal(cms, file1);
encoding = content1.getEncoding();
} catch (CmsException e) {
String ... | [
"private",
"Component",
"buildWholeFileDiffView",
"(",
"CmsObject",
"cms",
",",
"CmsFile",
"file1",
",",
"CmsFile",
"file2",
")",
"{",
"String",
"encoding",
"=",
"\"UTF-8\"",
";",
"try",
"{",
"CmsXmlContent",
"content1",
"=",
"CmsXmlContentFactory",
".",
"unmarsha... | Builds the diff view for the XML text.<p>
@param cms the CMS context
@param file1 the first file
@param file2 the second file
@return the diff view | [
"Builds",
"the",
"diff",
"view",
"for",
"the",
"XML",
"text",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/dialogs/history/diff/CmsValueDiff.java#L196-L213 |
mozilla/rhino | src/org/mozilla/javascript/Context.java | Context.newObject | public Scriptable newObject(Scriptable scope, String constructorName) {
"""
Create a new JavaScript object by executing the named constructor.
The call <code>newObject(scope, "Foo")</code> is equivalent to
evaluating "new Foo()".
@param scope the scope to search for the constructor and to evaluate against
... | java | public Scriptable newObject(Scriptable scope, String constructorName)
{
return newObject(scope, constructorName, ScriptRuntime.emptyArgs);
} | [
"public",
"Scriptable",
"newObject",
"(",
"Scriptable",
"scope",
",",
"String",
"constructorName",
")",
"{",
"return",
"newObject",
"(",
"scope",
",",
"constructorName",
",",
"ScriptRuntime",
".",
"emptyArgs",
")",
";",
"}"
] | Create a new JavaScript object by executing the named constructor.
The call <code>newObject(scope, "Foo")</code> is equivalent to
evaluating "new Foo()".
@param scope the scope to search for the constructor and to evaluate against
@param constructorName the name of the constructor to call
@return the new object | [
"Create",
"a",
"new",
"JavaScript",
"object",
"by",
"executing",
"the",
"named",
"constructor",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Context.java#L1656-L1659 |
jbundle/jbundle | main/screen/src/main/java/org/jbundle/main/user/screen/UserPreferenceScreen.java | UserPreferenceScreen.addToolbars | public ToolScreen addToolbars() {
"""
Add the toolbars that belong with this screen.
@return The new toolbar.
"""
return new MaintToolbar(null, this, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null)
{
public void setupMiddleSFields()
{
new SCannedBox... | java | public ToolScreen addToolbars()
{
return new MaintToolbar(null, this, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null)
{
public void setupMiddleSFields()
{
new SCannedBox(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST_BUTTON_WITH_GAP, ScreenConstants.S... | [
"public",
"ToolScreen",
"addToolbars",
"(",
")",
"{",
"return",
"new",
"MaintToolbar",
"(",
"null",
",",
"this",
",",
"null",
",",
"ScreenConstants",
".",
"DONT_DISPLAY_FIELD_DESC",
",",
"null",
")",
"{",
"public",
"void",
"setupMiddleSFields",
"(",
")",
"{",
... | Add the toolbars that belong with this screen.
@return The new toolbar. | [
"Add",
"the",
"toolbars",
"that",
"belong",
"with",
"this",
"screen",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/screen/src/main/java/org/jbundle/main/user/screen/UserPreferenceScreen.java#L104-L125 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/update/schema/program/AbstractSourceImporter.java | AbstractSourceImporter.updateDB | public void updateDB(final Instance _instance)
throws InstallationException {
"""
Stores the read source code in eFaps. This is done with a check in.
@param _instance instance (object id) of the source code object
in eFaps
@throws InstallationException if source code in eFaps could not
upda... | java | public void updateDB(final Instance _instance)
throws InstallationException
{
try {
final InputStream is = newCodeInputStream();
final Checkin checkin = new Checkin(_instance);
checkin.executeWithoutAccessCheck(getProgramName(), is, is.available());
} catc... | [
"public",
"void",
"updateDB",
"(",
"final",
"Instance",
"_instance",
")",
"throws",
"InstallationException",
"{",
"try",
"{",
"final",
"InputStream",
"is",
"=",
"newCodeInputStream",
"(",
")",
";",
"final",
"Checkin",
"checkin",
"=",
"new",
"Checkin",
"(",
"_i... | Stores the read source code in eFaps. This is done with a check in.
@param _instance instance (object id) of the source code object
in eFaps
@throws InstallationException if source code in eFaps could not
updated or the source code could not encoded | [
"Stores",
"the",
"read",
"source",
"code",
"in",
"eFaps",
".",
"This",
"is",
"done",
"with",
"a",
"check",
"in",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/update/schema/program/AbstractSourceImporter.java#L243-L257 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/hash/MurmurHash3Adaptor.java | MurmurHash3Adaptor.hashToLongs | public static long[] hashToLongs(final String datum, final long seed) {
"""
Hash a String and long seed.
@param datum the input String.
@param seed A long valued seed.
@return The 128-bit hash as a long[2].
"""
if ((datum == null) || datum.isEmpty()) {
return null;
}
final byte[] data = ... | java | public static long[] hashToLongs(final String datum, final long seed) {
if ((datum == null) || datum.isEmpty()) {
return null;
}
final byte[] data = datum.getBytes(UTF_8);
return hash(data, seed);
} | [
"public",
"static",
"long",
"[",
"]",
"hashToLongs",
"(",
"final",
"String",
"datum",
",",
"final",
"long",
"seed",
")",
"{",
"if",
"(",
"(",
"datum",
"==",
"null",
")",
"||",
"datum",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",... | Hash a String and long seed.
@param datum the input String.
@param seed A long valued seed.
@return The 128-bit hash as a long[2]. | [
"Hash",
"a",
"String",
"and",
"long",
"seed",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hash/MurmurHash3Adaptor.java#L221-L227 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.license_directadmin_new_duration_POST | public OvhOrder license_directadmin_new_duration_POST(String duration, String ip, OvhLicenseTypeEnum serviceType, OvhOrderableDirectAdminVersionEnum version) throws IOException {
"""
Create order
REST: POST /order/license/directadmin/new/{duration}
@param serviceType [required] # DEPRECATED # The kind of servi... | java | public OvhOrder license_directadmin_new_duration_POST(String duration, String ip, OvhLicenseTypeEnum serviceType, OvhOrderableDirectAdminVersionEnum version) throws IOException {
String qPath = "/order/license/directadmin/new/{duration}";
StringBuilder sb = path(qPath, duration);
HashMap<String, Object>o = new Ha... | [
"public",
"OvhOrder",
"license_directadmin_new_duration_POST",
"(",
"String",
"duration",
",",
"String",
"ip",
",",
"OvhLicenseTypeEnum",
"serviceType",
",",
"OvhOrderableDirectAdminVersionEnum",
"version",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/or... | Create order
REST: POST /order/license/directadmin/new/{duration}
@param serviceType [required] # DEPRECATED # The kind of service on which this license will be used # Will not be used, keeped only for compatibility #
@param version [required] This license version
@param ip [required] Ip on which this license would be... | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L1539-L1548 |
groovy/groovy-core | src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java | StaticTypeCheckingSupport.lastArgMatchesVarg | static int lastArgMatchesVarg(Parameter[] params, ClassNode... args) {
"""
Checks if the last argument matches the vararg type.
@param params
@param args
@return -1 if no match, 0 if the last argument is exactly the vararg type and 1 if of an assignable type
"""
if (!isVargs(params)) return -1;
... | java | static int lastArgMatchesVarg(Parameter[] params, ClassNode... args) {
if (!isVargs(params)) return -1;
// case length ==0 handled already
// we have now two cases,
// the argument is wrapped in the vargs array or
// the argument is an array that can be used for the vargs part di... | [
"static",
"int",
"lastArgMatchesVarg",
"(",
"Parameter",
"[",
"]",
"params",
",",
"ClassNode",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"isVargs",
"(",
"params",
")",
")",
"return",
"-",
"1",
";",
"// case length ==0 handled already",
"// we have now two cases,"... | Checks if the last argument matches the vararg type.
@param params
@param args
@return -1 if no match, 0 if the last argument is exactly the vararg type and 1 if of an assignable type | [
"Checks",
"if",
"the",
"last",
"argument",
"matches",
"the",
"vararg",
"type",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java#L295-L307 |
syphr42/prom | src/main/java/org/syphr/prom/PropertiesManager.java | PropertiesManager.referenceAt | public Reference referenceAt(T property, int position) {
"""
Retrieve the reference to another property from within the value of the
given property at the given position. If such a reference does not exist,
the result of this method will be <code>null</code>.
@param property
the property to search for the re... | java | public Reference referenceAt(T property, int position)
{
return getEvaluator().referenceAt(getRawProperty(property), position, getRetriever());
} | [
"public",
"Reference",
"referenceAt",
"(",
"T",
"property",
",",
"int",
"position",
")",
"{",
"return",
"getEvaluator",
"(",
")",
".",
"referenceAt",
"(",
"getRawProperty",
"(",
"property",
")",
",",
"position",
",",
"getRetriever",
"(",
")",
")",
";",
"}"... | Retrieve the reference to another property from within the value of the
given property at the given position. If such a reference does not exist,
the result of this method will be <code>null</code>.
@param property
the property to search for the requested reference
@param position
the position to check for a reference... | [
"Retrieve",
"the",
"reference",
"to",
"another",
"property",
"from",
"within",
"the",
"value",
"of",
"the",
"given",
"property",
"at",
"the",
"given",
"position",
".",
"If",
"such",
"a",
"reference",
"does",
"not",
"exist",
"the",
"result",
"of",
"this",
"... | train | https://github.com/syphr42/prom/blob/074d67c4ebb3afb0b163fcb0bc4826ee577ac803/src/main/java/org/syphr/prom/PropertiesManager.java#L728-L731 |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java | AuditUtils.contractBrokenToApi | public static AuditEntryBean contractBrokenToApi(ContractBean bean, ISecurityContext securityContext) {
"""
Creates an audit entry for the 'contract broken' event.
@param bean the bean
@param securityContext the security context
@return the audit entry
"""
AuditEntryBean entry = newEntry(bean.getApi... | java | public static AuditEntryBean contractBrokenToApi(ContractBean bean, ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(bean.getApi().getApi().getOrganization().getId(), AuditEntityType.Api, securityContext);
entry.setWhat(AuditEntryType.BreakContract);
entry.setEntityId(bean.get... | [
"public",
"static",
"AuditEntryBean",
"contractBrokenToApi",
"(",
"ContractBean",
"bean",
",",
"ISecurityContext",
"securityContext",
")",
"{",
"AuditEntryBean",
"entry",
"=",
"newEntry",
"(",
"bean",
".",
"getApi",
"(",
")",
".",
"getApi",
"(",
")",
".",
"getOr... | Creates an audit entry for the 'contract broken' event.
@param bean the bean
@param securityContext the security context
@return the audit entry | [
"Creates",
"an",
"audit",
"entry",
"for",
"the",
"contract",
"broken",
"event",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L474-L482 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/recovery/RecoveryHelper.java | RecoveryHelper.persistFile | public boolean persistFile(State state, CopyableFile file, Path path) throws IOException {
"""
Moves a copied path into a persistent location managed by gobblin-distcp. This method is used when an already
copied file cannot be successfully published. In future runs, instead of re-copying the file, distcp will use... | java | public boolean persistFile(State state, CopyableFile file, Path path) throws IOException {
if (!this.persistDir.isPresent()) {
return false;
}
String guid = computeGuid(state, file);
Path guidPath = new Path(this.persistDir.get(), guid);
if (!this.fs.exists(guidPath)) {
this.fs.mkdirs... | [
"public",
"boolean",
"persistFile",
"(",
"State",
"state",
",",
"CopyableFile",
"file",
",",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"this",
".",
"persistDir",
".",
"isPresent",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
... | Moves a copied path into a persistent location managed by gobblin-distcp. This method is used when an already
copied file cannot be successfully published. In future runs, instead of re-copying the file, distcp will use the
persisted file.
@param state {@link State} containing job information.
@param file {@link org.a... | [
"Moves",
"a",
"copied",
"path",
"into",
"a",
"persistent",
"location",
"managed",
"by",
"gobblin",
"-",
"distcp",
".",
"This",
"method",
"is",
"used",
"when",
"an",
"already",
"copied",
"file",
"cannot",
"be",
"successfully",
"published",
".",
"In",
"future"... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/recovery/RecoveryHelper.java#L88-L108 |
respoke/respoke-sdk-android | respokeSDK/src/main/java/com/digium/respokesdk/RespokeClient.java | RespokeClient.postConnectError | private void postConnectError(final ConnectCompletionListener completionListener, final String errorMessage) {
"""
A convenience method for posting errors to a ConnectCompletionListener
@param completionListener The listener to notify
@param errorMessage The human-readable error message that occurred
... | java | private void postConnectError(final ConnectCompletionListener completionListener, final String errorMessage) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
if (null != completionListener) {
completionListener.... | [
"private",
"void",
"postConnectError",
"(",
"final",
"ConnectCompletionListener",
"completionListener",
",",
"final",
"String",
"errorMessage",
")",
"{",
"new",
"Handler",
"(",
"Looper",
".",
"getMainLooper",
"(",
")",
")",
".",
"post",
"(",
"new",
"Runnable",
"... | A convenience method for posting errors to a ConnectCompletionListener
@param completionListener The listener to notify
@param errorMessage The human-readable error message that occurred | [
"A",
"convenience",
"method",
"for",
"posting",
"errors",
"to",
"a",
"ConnectCompletionListener"
] | train | https://github.com/respoke/respoke-sdk-android/blob/34a15f0558d29b1f1bc8481bbc5c505e855e05ef/respokeSDK/src/main/java/com/digium/respokesdk/RespokeClient.java#L1072-L1081 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalTime.java | LocalTime.withHour | public LocalTime withHour(int hour) {
"""
Returns a copy of this {@code LocalTime} with the hour-of-day altered.
<p>
This instance is immutable and unaffected by this method call.
@param hour the hour-of-day to set in the result, from 0 to 23
@return a {@code LocalTime} based on this time with the requested... | java | public LocalTime withHour(int hour) {
if (this.hour == hour) {
return this;
}
HOUR_OF_DAY.checkValidValue(hour);
return create(hour, minute, second, nano);
} | [
"public",
"LocalTime",
"withHour",
"(",
"int",
"hour",
")",
"{",
"if",
"(",
"this",
".",
"hour",
"==",
"hour",
")",
"{",
"return",
"this",
";",
"}",
"HOUR_OF_DAY",
".",
"checkValidValue",
"(",
"hour",
")",
";",
"return",
"create",
"(",
"hour",
",",
"... | Returns a copy of this {@code LocalTime} with the hour-of-day altered.
<p>
This instance is immutable and unaffected by this method call.
@param hour the hour-of-day to set in the result, from 0 to 23
@return a {@code LocalTime} based on this time with the requested hour, not null
@throws DateTimeException if the hou... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"LocalTime",
"}",
"with",
"the",
"hour",
"-",
"of",
"-",
"day",
"altered",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalTime.java#L863-L869 |
geomajas/geomajas-project-server | common-servlet/src/main/java/org/geomajas/servlet/CacheFilter.java | CacheFilter.shouldCompress | public boolean shouldCompress(String requestUri) {
"""
Should this request URI be compressed?
@param requestUri request URI
@return true when should be compressed
"""
String uri = requestUri.toLowerCase();
return checkSuffixes(uri, zipSuffixes);
} | java | public boolean shouldCompress(String requestUri) {
String uri = requestUri.toLowerCase();
return checkSuffixes(uri, zipSuffixes);
} | [
"public",
"boolean",
"shouldCompress",
"(",
"String",
"requestUri",
")",
"{",
"String",
"uri",
"=",
"requestUri",
".",
"toLowerCase",
"(",
")",
";",
"return",
"checkSuffixes",
"(",
"uri",
",",
"zipSuffixes",
")",
";",
"}"
] | Should this request URI be compressed?
@param requestUri request URI
@return true when should be compressed | [
"Should",
"this",
"request",
"URI",
"be",
"compressed?"
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/common-servlet/src/main/java/org/geomajas/servlet/CacheFilter.java#L233-L236 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/block/MatrixOps_DDRB.java | MatrixOps_DDRB.blockAligned | public static boolean blockAligned( int blockLength , DSubmatrixD1 A ) {
"""
Checks to see if the submatrix has its boundaries along inner blocks.
@param blockLength Size of an inner block.
@param A Submatrix.
@return If it is block aligned or not.
"""
if( A.col0 % blockLength != 0 )
r... | java | public static boolean blockAligned( int blockLength , DSubmatrixD1 A ) {
if( A.col0 % blockLength != 0 )
return false;
if( A.row0 % blockLength != 0 )
return false;
if( A.col1 % blockLength != 0 && A.col1 != A.original.numCols ) {
return false;
}
... | [
"public",
"static",
"boolean",
"blockAligned",
"(",
"int",
"blockLength",
",",
"DSubmatrixD1",
"A",
")",
"{",
"if",
"(",
"A",
".",
"col0",
"%",
"blockLength",
"!=",
"0",
")",
"return",
"false",
";",
"if",
"(",
"A",
".",
"row0",
"%",
"blockLength",
"!="... | Checks to see if the submatrix has its boundaries along inner blocks.
@param blockLength Size of an inner block.
@param A Submatrix.
@return If it is block aligned or not. | [
"Checks",
"to",
"see",
"if",
"the",
"submatrix",
"has",
"its",
"boundaries",
"along",
"inner",
"blocks",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/block/MatrixOps_DDRB.java#L604-L619 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.LongArray | public JBBPDslBuilder LongArray(final String name, final String sizeExpression) {
"""
Add named long array which size calculated through expression.
@param name name of the field, can be null for anonymous
@param sizeExpression expression to be used to calculate size, must not be null
@return the bu... | java | public JBBPDslBuilder LongArray(final String name, final String sizeExpression) {
final Item item = new Item(BinType.LONG_ARRAY, name, this.byteOrder);
item.sizeExpression = assertExpressionChars(sizeExpression);
this.addItem(item);
return this;
} | [
"public",
"JBBPDslBuilder",
"LongArray",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"sizeExpression",
")",
"{",
"final",
"Item",
"item",
"=",
"new",
"Item",
"(",
"BinType",
".",
"LONG_ARRAY",
",",
"name",
",",
"this",
".",
"byteOrder",
")",
";... | Add named long array which size calculated through expression.
@param name name of the field, can be null for anonymous
@param sizeExpression expression to be used to calculate size, must not be null
@return the builder instance, must not be null | [
"Add",
"named",
"long",
"array",
"which",
"size",
"calculated",
"through",
"expression",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L1201-L1206 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_ip_failover_id_GET | public OvhFailoverIp project_serviceName_ip_failover_id_GET(String serviceName, String id) throws IOException {
"""
Get failover ip
REST: GET /cloud/project/{serviceName}/ip/failover/{id}
@param id [required] Ip id
@param serviceName [required] Project id
"""
String qPath = "/cloud/project/{serviceName}... | java | public OvhFailoverIp project_serviceName_ip_failover_id_GET(String serviceName, String id) throws IOException {
String qPath = "/cloud/project/{serviceName}/ip/failover/{id}";
StringBuilder sb = path(qPath, serviceName, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhFailov... | [
"public",
"OvhFailoverIp",
"project_serviceName_ip_failover_id_GET",
"(",
"String",
"serviceName",
",",
"String",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/ip/failover/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
... | Get failover ip
REST: GET /cloud/project/{serviceName}/ip/failover/{id}
@param id [required] Ip id
@param serviceName [required] Project id | [
"Get",
"failover",
"ip"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1309-L1314 |
stapler/stapler | core/src/main/java/org/kohsuke/stapler/export/Model.java | Model.writeTo | public void writeTo(T object, TreePruner pruner, DataWriter writer) throws IOException {
"""
Writes the property values of the given object to the writer.
@param pruner
Controls which portion of the object graph will be sent to the writer.
"""
writer.type(null,object.getClass());
writer.sta... | java | public void writeTo(T object, TreePruner pruner, DataWriter writer) throws IOException {
writer.type(null,object.getClass());
writer.startObject();
writeNestedObjectTo(object, pruner, writer);
writer.endObject();
} | [
"public",
"void",
"writeTo",
"(",
"T",
"object",
",",
"TreePruner",
"pruner",
",",
"DataWriter",
"writer",
")",
"throws",
"IOException",
"{",
"writer",
".",
"type",
"(",
"null",
",",
"object",
".",
"getClass",
"(",
")",
")",
";",
"writer",
".",
"startObj... | Writes the property values of the given object to the writer.
@param pruner
Controls which portion of the object graph will be sent to the writer. | [
"Writes",
"the",
"property",
"values",
"of",
"the",
"given",
"object",
"to",
"the",
"writer",
"."
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/core/src/main/java/org/kohsuke/stapler/export/Model.java#L191-L196 |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/AbstractDMultiMapView.java | AbstractDMultiMapView.wrapValues | Collection<V> wrapValues(K key, Collection<V> values) {
"""
Wrap the given values into a dedicated view.
<p>The replies view may be a {@link SingleKeyValueListView} or a {@link SingleKeyValueSetView} according to the type of the
given values' collection.
@param key the key of the values.
@param values the ... | java | Collection<V> wrapValues(K key, Collection<V> values) {
final Object backEnd = DataViewDelegate.undelegate(values);
if (backEnd instanceof List<?>) {
return new SingleKeyValueListView(key, (List<V>) values);
}
if (backEnd instanceof Set<?>) {
return new SingleKeyValueSetView(key, (Set<V>) values);
}
t... | [
"Collection",
"<",
"V",
">",
"wrapValues",
"(",
"K",
"key",
",",
"Collection",
"<",
"V",
">",
"values",
")",
"{",
"final",
"Object",
"backEnd",
"=",
"DataViewDelegate",
".",
"undelegate",
"(",
"values",
")",
";",
"if",
"(",
"backEnd",
"instanceof",
"List... | Wrap the given values into a dedicated view.
<p>The replies view may be a {@link SingleKeyValueListView} or a {@link SingleKeyValueSetView} according to the type of the
given values' collection.
@param key the key of the values.
@param values the values.
@return the wrapper. | [
"Wrap",
"the",
"given",
"values",
"into",
"a",
"dedicated",
"view",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/AbstractDMultiMapView.java#L90-L99 |
prestodb/presto | presto-parquet/src/main/java/com/facebook/presto/parquet/ParquetTypeUtils.java | ParquetTypeUtils.lookupColumnByName | public static ColumnIO lookupColumnByName(GroupColumnIO groupColumnIO, String columnName) {
"""
Parquet column names are case-sensitive unlike Hive, which converts all column names to lowercase.
Therefore, when we look up columns we first check for exact match, and if that fails we look for a case-insensitive mat... | java | public static ColumnIO lookupColumnByName(GroupColumnIO groupColumnIO, String columnName)
{
ColumnIO columnIO = groupColumnIO.getChild(columnName);
if (columnIO != null) {
return columnIO;
}
for (int i = 0; i < groupColumnIO.getChildrenCount(); i++) {
if (gr... | [
"public",
"static",
"ColumnIO",
"lookupColumnByName",
"(",
"GroupColumnIO",
"groupColumnIO",
",",
"String",
"columnName",
")",
"{",
"ColumnIO",
"columnIO",
"=",
"groupColumnIO",
".",
"getChild",
"(",
"columnName",
")",
";",
"if",
"(",
"columnIO",
"!=",
"null",
"... | Parquet column names are case-sensitive unlike Hive, which converts all column names to lowercase.
Therefore, when we look up columns we first check for exact match, and if that fails we look for a case-insensitive match. | [
"Parquet",
"column",
"names",
"are",
"case",
"-",
"sensitive",
"unlike",
"Hive",
"which",
"converts",
"all",
"column",
"names",
"to",
"lowercase",
".",
"Therefore",
"when",
"we",
"look",
"up",
"columns",
"we",
"first",
"check",
"for",
"exact",
"match",
"and"... | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-parquet/src/main/java/com/facebook/presto/parquet/ParquetTypeUtils.java#L207-L222 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java | AppServiceCertificateOrdersInner.resendRequestEmails | public void resendRequestEmails(String resourceGroupName, String certificateOrderName) {
"""
Verify domain ownership for this certificate order.
Verify domain ownership for this certificate order.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param certificateOrderName Na... | java | public void resendRequestEmails(String resourceGroupName, String certificateOrderName) {
resendRequestEmailsWithServiceResponseAsync(resourceGroupName, certificateOrderName).toBlocking().single().body();
} | [
"public",
"void",
"resendRequestEmails",
"(",
"String",
"resourceGroupName",
",",
"String",
"certificateOrderName",
")",
"{",
"resendRequestEmailsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"certificateOrderName",
")",
".",
"toBlocking",
"(",
")",
".",
"sing... | Verify domain ownership for this certificate order.
Verify domain ownership for this certificate order.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param certificateOrderName Name of the certificate order.
@throws IllegalArgumentException thrown if parameters fail the validation... | [
"Verify",
"domain",
"ownership",
"for",
"this",
"certificate",
"order",
".",
"Verify",
"domain",
"ownership",
"for",
"this",
"certificate",
"order",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java#L1866-L1868 |
hageldave/ImagingKit | ImagingKit_Core/src/main/java/hageldave/imagingkit/core/util/ImagePanel.java | ImagePanel.checkerStrokeForSize | protected static final Stroke checkerStrokeForSize(int size) {
"""
Creates a stroke for a checkerboard pattern with specified size. <br>
This is used by {@link #setCheckerSize(int)}
@param size width of the stroke
@return the stroke
@since 1.4
"""
return new BasicStroke(size, BasicStroke.CAP_SQUARE, Basi... | java | protected static final Stroke checkerStrokeForSize(int size) {
return new BasicStroke(size, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_BEVEL, 1, new float[]{0,size*2}, 0);
} | [
"protected",
"static",
"final",
"Stroke",
"checkerStrokeForSize",
"(",
"int",
"size",
")",
"{",
"return",
"new",
"BasicStroke",
"(",
"size",
",",
"BasicStroke",
".",
"CAP_SQUARE",
",",
"BasicStroke",
".",
"JOIN_BEVEL",
",",
"1",
",",
"new",
"float",
"[",
"]"... | Creates a stroke for a checkerboard pattern with specified size. <br>
This is used by {@link #setCheckerSize(int)}
@param size width of the stroke
@return the stroke
@since 1.4 | [
"Creates",
"a",
"stroke",
"for",
"a",
"checkerboard",
"pattern",
"with",
"specified",
"size",
".",
"<br",
">",
"This",
"is",
"used",
"by",
"{"
] | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Core/src/main/java/hageldave/imagingkit/core/util/ImagePanel.java#L330-L332 |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java | ReadStreamOld.readAll | public int readAll(char []buf, int offset, int length) throws IOException {
"""
Reads into a character buffer from the stream. <code>length</code>
characters will always be read until the end of file is reached.
@param buf character buffer to fill
@param offset starting offset into the character buffer
@par... | java | public int readAll(char []buf, int offset, int length) throws IOException
{
int readLength = 0;
while (length > 0) {
int sublen = read(buf, offset, length);
if (sublen <= 0) {
return readLength > 0 ? readLength : -1;
}
offset += sublen;
readLength += sublen;
leng... | [
"public",
"int",
"readAll",
"(",
"char",
"[",
"]",
"buf",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"int",
"readLength",
"=",
"0",
";",
"while",
"(",
"length",
">",
"0",
")",
"{",
"int",
"sublen",
"=",
"read",
"... | Reads into a character buffer from the stream. <code>length</code>
characters will always be read until the end of file is reached.
@param buf character buffer to fill
@param offset starting offset into the character buffer
@param length maximum number of characters to read
@return number of characters read or -1 on ... | [
"Reads",
"into",
"a",
"character",
"buffer",
"from",
"the",
"stream",
".",
"<code",
">",
"length<",
"/",
"code",
">",
"characters",
"will",
"always",
"be",
"read",
"until",
"the",
"end",
"of",
"file",
"is",
"reached",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java#L663-L680 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/client/ApiClient.java | ApiClient.requestJWTApplicationToken | public OAuth.OAuthToken requestJWTApplicationToken(String clientId, java.util.List<String>scopes, byte[] rsaPrivateKey, long expiresIn) throws IllegalArgumentException, IOException, ApiException {
"""
<b>RESERVED FOR PARTNERS</b> Request JWT Application Token
Configures the current instance of ApiClient with a fr... | java | public OAuth.OAuthToken requestJWTApplicationToken(String clientId, java.util.List<String>scopes, byte[] rsaPrivateKey, long expiresIn) throws IllegalArgumentException, IOException, ApiException {
return this.requestJWTUserToken(clientId, null, scopes, rsaPrivateKey, expiresIn);
} | [
"public",
"OAuth",
".",
"OAuthToken",
"requestJWTApplicationToken",
"(",
"String",
"clientId",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"scopes",
",",
"byte",
"[",
"]",
"rsaPrivateKey",
",",
"long",
"expiresIn",
")",
"throws",
"IllegalArgumen... | <b>RESERVED FOR PARTNERS</b> Request JWT Application Token
Configures the current instance of ApiClient with a fresh OAuth JWT access token from DocuSign
@param clientId DocuSign OAuth Client Id (AKA Integrator Key)
@param scopes the list of requested scopes. Values include {@link OAuth#Scope_SIGNATURE}, {@link OAuth#S... | [
"<b",
">",
"RESERVED",
"FOR",
"PARTNERS<",
"/",
"b",
">",
"Request",
"JWT",
"Application",
"Token",
"Configures",
"the",
"current",
"instance",
"of",
"ApiClient",
"with",
"a",
"fresh",
"OAuth",
"JWT",
"access",
"token",
"from",
"DocuSign"
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/client/ApiClient.java#L764-L766 |
ixa-ehu/ixa-pipe-ml | src/main/java/eus/ixa/ixa/pipe/ml/utils/IOUtils.java | IOUtils.openFromFile | public static InputStream openFromFile(final File file) {
"""
Open file to an input stream.
@param file
the file
@return the input stream
"""
try {
InputStream is = new BufferedInputStream(new FileInputStream(file),
BUFFER_SIZE);
if (file.getName().endsWith(".gz") || file.getName... | java | public static InputStream openFromFile(final File file) {
try {
InputStream is = new BufferedInputStream(new FileInputStream(file),
BUFFER_SIZE);
if (file.getName().endsWith(".gz") || file.getName().endsWith("gz")) {
is = new GZIPInputStream(is, BUFFER_SIZE);
}
return is;
... | [
"public",
"static",
"InputStream",
"openFromFile",
"(",
"final",
"File",
"file",
")",
"{",
"try",
"{",
"InputStream",
"is",
"=",
"new",
"BufferedInputStream",
"(",
"new",
"FileInputStream",
"(",
"file",
")",
",",
"BUFFER_SIZE",
")",
";",
"if",
"(",
"file",
... | Open file to an input stream.
@param file
the file
@return the input stream | [
"Open",
"file",
"to",
"an",
"input",
"stream",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/utils/IOUtils.java#L368-L380 |
Erudika/para | para-server/src/main/java/com/erudika/para/i18n/LanguageUtils.java | LanguageUtils.setDefaultLanguage | public void setDefaultLanguage(Map<String, String> deflang) {
"""
Sets the default language map. It is the basis language template which is to be translated.
@param deflang the default language map
"""
if (deflang != null && !deflang.isEmpty()) {
LANG_CACHE.put(getDefaultLanguageCode(), deflang);
}
} | java | public void setDefaultLanguage(Map<String, String> deflang) {
if (deflang != null && !deflang.isEmpty()) {
LANG_CACHE.put(getDefaultLanguageCode(), deflang);
}
} | [
"public",
"void",
"setDefaultLanguage",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"deflang",
")",
"{",
"if",
"(",
"deflang",
"!=",
"null",
"&&",
"!",
"deflang",
".",
"isEmpty",
"(",
")",
")",
"{",
"LANG_CACHE",
".",
"put",
"(",
"getDefaultLanguageCo... | Sets the default language map. It is the basis language template which is to be translated.
@param deflang the default language map | [
"Sets",
"the",
"default",
"language",
"map",
".",
"It",
"is",
"the",
"basis",
"language",
"template",
"which",
"is",
"to",
"be",
"translated",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/i18n/LanguageUtils.java#L204-L208 |
datacleaner/DataCleaner | engine/core/src/main/java/org/datacleaner/result/AnnotatedRowsResult.java | AnnotatedRowsResult.createIfSampleRowsAvailable | public static AnnotatedRowsResult createIfSampleRowsAvailable(final RowAnnotation annotation,
final RowAnnotationFactory annotationFactory, final InputColumn<?>... columns) {
"""
Factory method for {@link AnnotatedRowsResult} that will return non-null
ONLY if the {@link RowAnnotation} passed in has an... | java | public static AnnotatedRowsResult createIfSampleRowsAvailable(final RowAnnotation annotation,
final RowAnnotationFactory annotationFactory, final InputColumn<?>... columns) {
if (annotationFactory.hasSampleRows(annotation)) {
return new AnnotatedRowsResult(annotation, annotationFactory, ... | [
"public",
"static",
"AnnotatedRowsResult",
"createIfSampleRowsAvailable",
"(",
"final",
"RowAnnotation",
"annotation",
",",
"final",
"RowAnnotationFactory",
"annotationFactory",
",",
"final",
"InputColumn",
"<",
"?",
">",
"...",
"columns",
")",
"{",
"if",
"(",
"annota... | Factory method for {@link AnnotatedRowsResult} that will return non-null
ONLY if the {@link RowAnnotation} passed in has any sample rows according
to the {@link RowAnnotationFactory}.
Otherwise returning null has the benefit that usually it makes it easy to
filter out unnecesary drill-to-detail result objects.
@param... | [
"Factory",
"method",
"for",
"{",
"@link",
"AnnotatedRowsResult",
"}",
"that",
"will",
"return",
"non",
"-",
"null",
"ONLY",
"if",
"the",
"{",
"@link",
"RowAnnotation",
"}",
"passed",
"in",
"has",
"any",
"sample",
"rows",
"according",
"to",
"the",
"{",
"@li... | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/core/src/main/java/org/datacleaner/result/AnnotatedRowsResult.java#L86-L92 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java | CmsSitemapController.removeEntry | private void removeEntry(CmsUUID entryId, CmsUUID parentId) {
"""
Removes the given entry from the data model.<p>
@param entryId the id of the entry to remove
@param parentId the parent entry id
"""
CmsClientSitemapEntry entry = getEntryById(entryId);
CmsClientSitemapEntry deleteParent = g... | java | private void removeEntry(CmsUUID entryId, CmsUUID parentId) {
CmsClientSitemapEntry entry = getEntryById(entryId);
CmsClientSitemapEntry deleteParent = getEntryById(parentId);
removeAllChildren(entry);
deleteParent.removeSubEntry(entry.getPosition());
m_entriesById.remove(entryI... | [
"private",
"void",
"removeEntry",
"(",
"CmsUUID",
"entryId",
",",
"CmsUUID",
"parentId",
")",
"{",
"CmsClientSitemapEntry",
"entry",
"=",
"getEntryById",
"(",
"entryId",
")",
";",
"CmsClientSitemapEntry",
"deleteParent",
"=",
"getEntryById",
"(",
"parentId",
")",
... | Removes the given entry from the data model.<p>
@param entryId the id of the entry to remove
@param parentId the parent entry id | [
"Removes",
"the",
"given",
"entry",
"from",
"the",
"data",
"model",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java#L2423-L2436 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionBinding.java | InjectionBinding.createDefinitionReference | public Reference createDefinitionReference(String bindingName, String type, Map<String, Object> properties) throws InjectionException {
"""
Create a Reference to a resource definition.
@param bindingName the binding name, or null if none
@param type the resource type
@param properties the resource-specific pr... | java | public Reference createDefinitionReference(String bindingName, String type, Map<String, Object> properties) throws InjectionException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled()) {
Map<String, Object> traceProps = properties;
... | [
"public",
"Reference",
"createDefinitionReference",
"(",
"String",
"bindingName",
",",
"String",
"type",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"throws",
"InjectionException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
... | Create a Reference to a resource definition.
@param bindingName the binding name, or null if none
@param type the resource type
@param properties the resource-specific properties
@return the resource definition Reference | [
"Create",
"a",
"Reference",
"to",
"a",
"resource",
"definition",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionBinding.java#L1222-L1247 |
pro-grade/pro-grade | src/main/java/net/sourceforge/prograde/policy/ProGradePolicy.java | ProGradePolicy.fixEncodedURI | private static String fixEncodedURI(final String encodedUri) {
"""
Gets {@link URI#toASCIIString()} as an input and the escaped octets %XX are converted to lower case (because of the
Oracle PolicyFile implementation of CodeSource comparing).
@param encodedUri
@return given URI String with lower-cased codes of... | java | private static String fixEncodedURI(final String encodedUri) {
if (encodedUri == null) {
return null;
}
final StringBuilder sb = new StringBuilder();
int lastPercIdx = -3; // we will check position-2
for (int i = 0, n = encodedUri.length(); i < n; i++) {
c... | [
"private",
"static",
"String",
"fixEncodedURI",
"(",
"final",
"String",
"encodedUri",
")",
"{",
"if",
"(",
"encodedUri",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"int",
... | Gets {@link URI#toASCIIString()} as an input and the escaped octets %XX are converted to lower case (because of the
Oracle PolicyFile implementation of CodeSource comparing).
@param encodedUri
@return given URI String with lower-cased codes of non-ascii characters | [
"Gets",
"{",
"@link",
"URI#toASCIIString",
"()",
"}",
"as",
"an",
"input",
"and",
"the",
"escaped",
"octets",
"%XX",
"are",
"converted",
"to",
"lower",
"case",
"(",
"because",
"of",
"the",
"Oracle",
"PolicyFile",
"implementation",
"of",
"CodeSource",
"comparin... | train | https://github.com/pro-grade/pro-grade/blob/371b0d1349c37bd048a06206d3fa1b0c3c1cd9ab/src/main/java/net/sourceforge/prograde/policy/ProGradePolicy.java#L866-L882 |
pravega/pravega | common/src/main/java/io/pravega/common/util/HashedArray.java | HashedArray.arrayEquals | public static boolean arrayEquals(ArrayView av1, ArrayView av2) {
"""
Determines if the given {@link ArrayView} instances contain the same data.
@param av1 The first instance.
@param av2 The second instance.
@return True if both instances have the same length and contain the same data.
"""
int len... | java | public static boolean arrayEquals(ArrayView av1, ArrayView av2) {
int len = av1.getLength();
if (len != av2.getLength()) {
return false;
}
byte[] a1 = av1.array();
int o1 = av1.arrayOffset();
byte[] a2 = av2.array();
int o2 = av2.arrayOffset();
... | [
"public",
"static",
"boolean",
"arrayEquals",
"(",
"ArrayView",
"av1",
",",
"ArrayView",
"av2",
")",
"{",
"int",
"len",
"=",
"av1",
".",
"getLength",
"(",
")",
";",
"if",
"(",
"len",
"!=",
"av2",
".",
"getLength",
"(",
")",
")",
"{",
"return",
"false... | Determines if the given {@link ArrayView} instances contain the same data.
@param av1 The first instance.
@param av2 The second instance.
@return True if both instances have the same length and contain the same data. | [
"Determines",
"if",
"the",
"given",
"{",
"@link",
"ArrayView",
"}",
"instances",
"contain",
"the",
"same",
"data",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/HashedArray.java#L78-L95 |
js-lib-com/commons | src/main/java/js/util/Classes.java | Classes.newInstance | @SuppressWarnings("unchecked")
public static <T> T newInstance(String className, Object... arguments) {
"""
Create a new instance. Handy utility for hidden classes creation. Constructor accepting given arguments, if any,
must exists.
@param className fully qualified class name,
@param arguments variable nu... | java | @SuppressWarnings("unchecked")
public static <T> T newInstance(String className, Object... arguments)
{
return (T)newInstance(Classes.forName(className), arguments);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"String",
"className",
",",
"Object",
"...",
"arguments",
")",
"{",
"return",
"(",
"T",
")",
"newInstance",
"(",
"Classes",
".",
"forName",
"(",... | Create a new instance. Handy utility for hidden classes creation. Constructor accepting given arguments, if any,
must exists.
@param className fully qualified class name,
@param arguments variable number of arguments to be passed to constructor.
@param <T> instance type.
@return newly created instance.
@throws NoSuchB... | [
"Create",
"a",
"new",
"instance",
".",
"Handy",
"utility",
"for",
"hidden",
"classes",
"creation",
".",
"Constructor",
"accepting",
"given",
"arguments",
"if",
"any",
"must",
"exists",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Classes.java#L1317-L1321 |
canoo/open-dolphin | subprojects/server/src/main/groovy/org/opendolphin/server/adapter/DolphinServlet.java | DolphinServlet.writeHeaders | protected void writeHeaders(HttpServletRequest request, HttpServletResponse response, List<Command> results) throws ServletException, IOException {
"""
Updates {@code response} headers if needed.
@param request - an HttpServletRequest object that contains the request the client has made of the servlet
@param ... | java | protected void writeHeaders(HttpServletRequest request, HttpServletResponse response, List<Command> results) throws ServletException, IOException {
// empty on purpose
} | [
"protected",
"void",
"writeHeaders",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"List",
"<",
"Command",
">",
"results",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"// empty on purpose",
"}"
] | Updates {@code response} headers if needed.
@param request - an HttpServletRequest object that contains the request the client has made of the servlet
@param response - an HttpServletResponse object that contains the response the servlet sends to the client
@param results - the list of commands to be sent to the cl... | [
"Updates",
"{",
"@code",
"response",
"}",
"headers",
"if",
"needed",
"."
] | train | https://github.com/canoo/open-dolphin/blob/50166defc3ef2de473d7a7246c32dc04304d80ef/subprojects/server/src/main/groovy/org/opendolphin/server/adapter/DolphinServlet.java#L93-L95 |
podio/podio-java | src/main/java/com/podio/org/OrgAPI.java | OrgAPI.getEndMemberInfo | public EndMemberInfo getEndMemberInfo(int orgId, int userId) {
"""
Returns information about what would happen if this user would be removed from the org
@param orgId
The id of the organization
@param userId
The id of the user
@return The information about the users workspace memberships in the org
"""
... | java | public EndMemberInfo getEndMemberInfo(int orgId, int userId) {
return getResourceFactory().getApiResource(
"/org/" + orgId + "/member/" + userId + "/end_member_info").get(
EndMemberInfo.class);
} | [
"public",
"EndMemberInfo",
"getEndMemberInfo",
"(",
"int",
"orgId",
",",
"int",
"userId",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/org/\"",
"+",
"orgId",
"+",
"\"/member/\"",
"+",
"userId",
"+",
"\"/end_member_info\"",
... | Returns information about what would happen if this user would be removed from the org
@param orgId
The id of the organization
@param userId
The id of the user
@return The information about the users workspace memberships in the org | [
"Returns",
"information",
"about",
"what",
"would",
"happen",
"if",
"this",
"user",
"would",
"be",
"removed",
"from",
"the",
"org"
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/org/OrgAPI.java#L224-L228 |
sarxos/webcam-capture | webcam-capture/src/main/java/com/github/sarxos/webcam/Webcam.java | Webcam.getDefault | public static Webcam getDefault(long timeout) throws TimeoutException, WebcamException {
"""
Will discover and return first webcam available in the system.
@param timeout the webcam discovery timeout (1 minute by default)
@return Default webcam (first from the list)
@throws TimeoutException when discovery tim... | java | public static Webcam getDefault(long timeout) throws TimeoutException, WebcamException {
if (timeout < 0) {
throw new IllegalArgumentException(String.format("Timeout cannot be negative (%d)", timeout));
}
return getDefault(timeout, TimeUnit.MILLISECONDS);
} | [
"public",
"static",
"Webcam",
"getDefault",
"(",
"long",
"timeout",
")",
"throws",
"TimeoutException",
",",
"WebcamException",
"{",
"if",
"(",
"timeout",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"Time... | Will discover and return first webcam available in the system.
@param timeout the webcam discovery timeout (1 minute by default)
@return Default webcam (first from the list)
@throws TimeoutException when discovery timeout has been exceeded
@throws WebcamException if something is really wrong
@throws IllegalArgumentExc... | [
"Will",
"discover",
"and",
"return",
"first",
"webcam",
"available",
"in",
"the",
"system",
"."
] | train | https://github.com/sarxos/webcam-capture/blob/efbdae04f9ba48db9ec621e94a9bcd6f031882c8/webcam-capture/src/main/java/com/github/sarxos/webcam/Webcam.java#L929-L934 |
JoeKerouac/utils | src/main/java/com/joe/utils/reflect/ReflectUtil.java | ReflectUtil.execMethod | @SuppressWarnings("unchecked")
public static <T> T execMethod(Method method, Object target, Object... params) {
"""
执行方法
@param method 要调用的方法
@param target 方法所在Class的实例,对于静态方法要传入null或者Class对象
@param params 调用方法的参数
@param <T> 方法返回类型
@return 方法调用结果
"""
allowAccess(method);
try {
... | java | @SuppressWarnings("unchecked")
public static <T> T execMethod(Method method, Object target, Object... params) {
allowAccess(method);
try {
return (T) method.invoke(target, params);
} catch (Throwable e) {
throw new ReflectException(e);
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"execMethod",
"(",
"Method",
"method",
",",
"Object",
"target",
",",
"Object",
"...",
"params",
")",
"{",
"allowAccess",
"(",
"method",
")",
";",
"try",
"{",
"ret... | 执行方法
@param method 要调用的方法
@param target 方法所在Class的实例,对于静态方法要传入null或者Class对象
@param params 调用方法的参数
@param <T> 方法返回类型
@return 方法调用结果 | [
"执行方法"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/reflect/ReflectUtil.java#L245-L253 |
alkacon/opencms-core | src/org/opencms/util/CmsStringUtil.java | CmsStringUtil.isProperPrefixPath | public static boolean isProperPrefixPath(String firstPath, String secondPath) {
"""
Checks if the first path is a prefix of the second path, but not equivalent to it.<p>
@param firstPath the first path
@param secondPath the second path
@return true if the first path is a prefix path of the second path, but ... | java | public static boolean isProperPrefixPath(String firstPath, String secondPath) {
firstPath = CmsStringUtil.joinPaths(firstPath, "/");
secondPath = CmsStringUtil.joinPaths(secondPath, "/");
return secondPath.startsWith(firstPath) && !firstPath.equals(secondPath);
} | [
"public",
"static",
"boolean",
"isProperPrefixPath",
"(",
"String",
"firstPath",
",",
"String",
"secondPath",
")",
"{",
"firstPath",
"=",
"CmsStringUtil",
".",
"joinPaths",
"(",
"firstPath",
",",
"\"/\"",
")",
";",
"secondPath",
"=",
"CmsStringUtil",
".",
"joinP... | Checks if the first path is a prefix of the second path, but not equivalent to it.<p>
@param firstPath the first path
@param secondPath the second path
@return true if the first path is a prefix path of the second path, but not equivalent | [
"Checks",
"if",
"the",
"first",
"path",
"is",
"a",
"prefix",
"of",
"the",
"second",
"path",
"but",
"not",
"equivalent",
"to",
"it",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsStringUtil.java#L1114-L1120 |
protostuff/protostuff-compiler | protostuff-generator/src/main/java/io/protostuff/generator/CompilerUtils.java | CompilerUtils.copyResource | public void copyResource(String name, String destinationFilename) {
"""
Copy a classpath resource to the given location on a filesystem.
"""
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
if (classLoader == null) {
String error = "Can not obtain classloade... | java | public void copyResource(String name, String destinationFilename) {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
if (classLoader == null) {
String error = "Can not obtain classloader instance";
throw new IllegalStateException(error);
}
... | [
"public",
"void",
"copyResource",
"(",
"String",
"name",
",",
"String",
"destinationFilename",
")",
"{",
"ClassLoader",
"classLoader",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
";",
"if",
"(",
"classLoader",
"==",
"... | Copy a classpath resource to the given location on a filesystem. | [
"Copy",
"a",
"classpath",
"resource",
"to",
"the",
"given",
"location",
"on",
"a",
"filesystem",
"."
] | train | https://github.com/protostuff/protostuff-compiler/blob/665256c42cb41da849e8321ffcab088350ace171/protostuff-generator/src/main/java/io/protostuff/generator/CompilerUtils.java#L32-L48 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.