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 |
|---|---|---|---|---|---|---|---|---|---|---|
dwdyer/watchmaker | examples/src/java/main/org/uncommons/watchmaker/examples/geneticprogramming/TreeFactory.java | TreeFactory.makeNode | private Node makeNode(Random rng, int maxDepth) {
"""
Recursively constructs a tree of Nodes, up to the specified maximum depth.
@param rng The RNG used to random create nodes.
@param maxDepth The maximum depth of the generated tree.
@return A tree of nodes.
"""
if (functionProbability.nextEvent(rng... | java | private Node makeNode(Random rng, int maxDepth)
{
if (functionProbability.nextEvent(rng) && maxDepth > 1)
{
// Max depth for sub-trees is one less than max depth for this node.
int depth = maxDepth - 1;
switch (rng.nextInt(5))
{
case 0:... | [
"private",
"Node",
"makeNode",
"(",
"Random",
"rng",
",",
"int",
"maxDepth",
")",
"{",
"if",
"(",
"functionProbability",
".",
"nextEvent",
"(",
"rng",
")",
"&&",
"maxDepth",
">",
"1",
")",
"{",
"// Max depth for sub-trees is one less than max depth for this node.",
... | Recursively constructs a tree of Nodes, up to the specified maximum depth.
@param rng The RNG used to random create nodes.
@param maxDepth The maximum depth of the generated tree.
@return A tree of nodes. | [
"Recursively",
"constructs",
"a",
"tree",
"of",
"Nodes",
"up",
"to",
"the",
"specified",
"maximum",
"depth",
"."
] | train | https://github.com/dwdyer/watchmaker/blob/33d942350e6bf7d9a17b9262a4f898158530247e/examples/src/java/main/org/uncommons/watchmaker/examples/geneticprogramming/TreeFactory.java#L91-L114 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionValuePersistenceImpl.java | CPOptionValuePersistenceImpl.fetchByC_K | @Override
public CPOptionValue fetchByC_K(long CPOptionId, String key) {
"""
Returns the cp option value where CPOptionId = ? and key = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param CPOptionId the cp option ID
@param key the key
@return the matching cp option ... | java | @Override
public CPOptionValue fetchByC_K(long CPOptionId, String key) {
return fetchByC_K(CPOptionId, key, true);
} | [
"@",
"Override",
"public",
"CPOptionValue",
"fetchByC_K",
"(",
"long",
"CPOptionId",
",",
"String",
"key",
")",
"{",
"return",
"fetchByC_K",
"(",
"CPOptionId",
",",
"key",
",",
"true",
")",
";",
"}"
] | Returns the cp option value where CPOptionId = ? and key = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param CPOptionId the cp option ID
@param key the key
@return the matching cp option value, or <code>null</code> if a matching cp option value could not be found | [
"Returns",
"the",
"cp",
"option",
"value",
"where",
"CPOptionId",
"=",
"?",
";",
"and",
"key",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"finder",
"ca... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionValuePersistenceImpl.java#L3060-L3063 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/exception/fault/FaultException.java | FaultException.formatMessage | protected void formatMessage(String aID, Map<Object,Object> aBindValues) {
"""
Format the exception message using the presenter getText method
@param aID the key of the message
@param aBindValues the values to plug into the message.
"""
Presenter presenter = Presenter.getPresenter(this.getClass());
... | java | protected void formatMessage(String aID, Map<Object,Object> aBindValues)
{
Presenter presenter = Presenter.getPresenter(this.getClass());
message = presenter.getText(aID,aBindValues);
} | [
"protected",
"void",
"formatMessage",
"(",
"String",
"aID",
",",
"Map",
"<",
"Object",
",",
"Object",
">",
"aBindValues",
")",
"{",
"Presenter",
"presenter",
"=",
"Presenter",
".",
"getPresenter",
"(",
"this",
".",
"getClass",
"(",
")",
")",
";",
"message"... | Format the exception message using the presenter getText method
@param aID the key of the message
@param aBindValues the values to plug into the message. | [
"Format",
"the",
"exception",
"message",
"using",
"the",
"presenter",
"getText",
"method"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/exception/fault/FaultException.java#L215-L220 |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/NumberBindings.java | NumberBindings.divideSafe | public static NumberBinding divideSafe(ObservableValue<Number> dividend, ObservableValue<Number> divisor, ObservableValue<Number> defaultValue) {
"""
An number binding of a division that won't throw an {@link java.lang.ArithmeticException}
when a division by zero happens. See {@link #divideSafe(javafx.beans.value... | java | public static NumberBinding divideSafe(ObservableValue<Number> dividend, ObservableValue<Number> divisor, ObservableValue<Number> defaultValue) {
return Bindings.createDoubleBinding(() -> {
if (divisor.getValue().doubleValue() == 0) {
return defaultValue.getValue().doubleValue();
... | [
"public",
"static",
"NumberBinding",
"divideSafe",
"(",
"ObservableValue",
"<",
"Number",
">",
"dividend",
",",
"ObservableValue",
"<",
"Number",
">",
"divisor",
",",
"ObservableValue",
"<",
"Number",
">",
"defaultValue",
")",
"{",
"return",
"Bindings",
".",
"cr... | An number binding of a division that won't throw an {@link java.lang.ArithmeticException}
when a division by zero happens. See {@link #divideSafe(javafx.beans.value.ObservableIntegerValue,
javafx.beans.value.ObservableIntegerValue)}
for more informations.
@param dividend the observable value used as dividend
@para... | [
"An",
"number",
"binding",
"of",
"a",
"division",
"that",
"won",
"t",
"throw",
"an",
"{",
"@link",
"java",
".",
"lang",
".",
"ArithmeticException",
"}",
"when",
"a",
"division",
"by",
"zero",
"happens",
".",
"See",
"{",
"@link",
"#divideSafe",
"(",
"java... | train | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/NumberBindings.java#L110-L120 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/components/TimePicker.java | TimePicker.zDrawTextFieldIndicators | public void zDrawTextFieldIndicators() {
"""
zDrawTextFieldIndicators, This will draw the text field indicators, to indicate to the user
the state of any text in the text field, including the validity of any time that has been
typed. The text field indicators include the text field background color, foreground c... | java | public void zDrawTextFieldIndicators() {
if (!isEnabled()) {
// (Possibility: DisabledComponent)
// Note: The time should always be validated (as if the component lost focus), before
// the component is disabled.
timeTextField.setBackground(new Color(240, 240, 240... | [
"public",
"void",
"zDrawTextFieldIndicators",
"(",
")",
"{",
"if",
"(",
"!",
"isEnabled",
"(",
")",
")",
"{",
"// (Possibility: DisabledComponent)",
"// Note: The time should always be validated (as if the component lost focus), before",
"// the component is disabled.",
"timeTextFi... | zDrawTextFieldIndicators, This will draw the text field indicators, to indicate to the user
the state of any text in the text field, including the validity of any time that has been
typed. The text field indicators include the text field background color, foreground color,
font color, and font.
Note: This function is ... | [
"zDrawTextFieldIndicators",
"This",
"will",
"draw",
"the",
"text",
"field",
"indicators",
"to",
"indicate",
"to",
"the",
"user",
"the",
"state",
"of",
"any",
"text",
"in",
"the",
"text",
"field",
"including",
"the",
"validity",
"of",
"any",
"time",
"that",
"... | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/components/TimePicker.java#L844-L891 |
hal/elemento | core/src/main/java/org/jboss/gwt/elemento/core/Elements.java | Elements.lazyInsertBefore | public static void lazyInsertBefore(Element newElement, Element before) {
"""
Inserts the specified element into the parent of the before element if not already present. If parent already
contains child, this method does nothing.
"""
if (!before.parentNode.contains(newElement)) {
before.pa... | java | public static void lazyInsertBefore(Element newElement, Element before) {
if (!before.parentNode.contains(newElement)) {
before.parentNode.insertBefore(newElement, before);
}
} | [
"public",
"static",
"void",
"lazyInsertBefore",
"(",
"Element",
"newElement",
",",
"Element",
"before",
")",
"{",
"if",
"(",
"!",
"before",
".",
"parentNode",
".",
"contains",
"(",
"newElement",
")",
")",
"{",
"before",
".",
"parentNode",
".",
"insertBefore"... | Inserts the specified element into the parent of the before element if not already present. If parent already
contains child, this method does nothing. | [
"Inserts",
"the",
"specified",
"element",
"into",
"the",
"parent",
"of",
"the",
"before",
"element",
"if",
"not",
"already",
"present",
".",
"If",
"parent",
"already",
"contains",
"child",
"this",
"method",
"does",
"nothing",
"."
] | train | https://github.com/hal/elemento/blob/26da2d5a1fe2ec55b779737dbaeda25a942eee61/core/src/main/java/org/jboss/gwt/elemento/core/Elements.java#L688-L692 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java | BitsUtil.nextClearBit | public static int nextClearBit(long v, int start) {
"""
Find the next clear bit.
@param v Value to process
@param start Start position (inclusive)
@return Position of next clear bit, or -1.
"""
if(start >= Long.SIZE) {
return -1;
}
start = start < 0 ? 0 : start;
long cur = ~v & (LONG... | java | public static int nextClearBit(long v, int start) {
if(start >= Long.SIZE) {
return -1;
}
start = start < 0 ? 0 : start;
long cur = ~v & (LONG_ALL_BITS << start);
return cur == 0 ? -1 : Long.numberOfTrailingZeros(cur);
} | [
"public",
"static",
"int",
"nextClearBit",
"(",
"long",
"v",
",",
"int",
"start",
")",
"{",
"if",
"(",
"start",
">=",
"Long",
".",
"SIZE",
")",
"{",
"return",
"-",
"1",
";",
"}",
"start",
"=",
"start",
"<",
"0",
"?",
"0",
":",
"start",
";",
"lo... | Find the next clear bit.
@param v Value to process
@param start Start position (inclusive)
@return Position of next clear bit, or -1. | [
"Find",
"the",
"next",
"clear",
"bit",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java#L1350-L1357 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/cache/ThreadLocalCacheEntryFactory.java | ThreadLocalCacheEntryFactory.getWithData | public Element getWithData(Ehcache cache, Object key, A data) {
"""
Wraps an {@link Ehcache#get(Object)} call with setting/clearing the {@link ThreadLocal}
"""
this.threadData.set(data);
try {
return cache.get(key);
} finally {
this.threadData.remove();
}... | java | public Element getWithData(Ehcache cache, Object key, A data) {
this.threadData.set(data);
try {
return cache.get(key);
} finally {
this.threadData.remove();
}
} | [
"public",
"Element",
"getWithData",
"(",
"Ehcache",
"cache",
",",
"Object",
"key",
",",
"A",
"data",
")",
"{",
"this",
".",
"threadData",
".",
"set",
"(",
"data",
")",
";",
"try",
"{",
"return",
"cache",
".",
"get",
"(",
"key",
")",
";",
"}",
"fina... | Wraps an {@link Ehcache#get(Object)} call with setting/clearing the {@link ThreadLocal} | [
"Wraps",
"an",
"{"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/cache/ThreadLocalCacheEntryFactory.java#L38-L45 |
neoremind/fluent-validator | fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/support/ConcurrentCache.java | ConcurrentCache.get | public V get(K key, Callable<V> callable) {
"""
通过关键字获取数据,如果存在则直接返回,如果不存在,则通过计算<code>callable</code>来生成
@param key 查找关键字
@param callable # @see Callable
@return 计算结果
"""
Future<V> future = concurrentMap.get(key);
if (future == null) {
FutureTask<V> futureTask = new Futur... | java | public V get(K key, Callable<V> callable) {
Future<V> future = concurrentMap.get(key);
if (future == null) {
FutureTask<V> futureTask = new FutureTask<V>(callable);
future = concurrentMap.putIfAbsent(key, futureTask);
if (future == null) {
future = fut... | [
"public",
"V",
"get",
"(",
"K",
"key",
",",
"Callable",
"<",
"V",
">",
"callable",
")",
"{",
"Future",
"<",
"V",
">",
"future",
"=",
"concurrentMap",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"future",
"==",
"null",
")",
"{",
"FutureTask",
"<"... | 通过关键字获取数据,如果存在则直接返回,如果不存在,则通过计算<code>callable</code>来生成
@param key 查找关键字
@param callable # @see Callable
@return 计算结果 | [
"通过关键字获取数据,如果存在则直接返回,如果不存在,则通过计算<code",
">",
"callable<",
"/",
"code",
">",
"来生成"
] | train | https://github.com/neoremind/fluent-validator/blob/b516970591aa9468b44ba63938b98ec341fd6ead/fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/support/ConcurrentCache.java#L32-L49 |
udoprog/ffwd-client-java | src/main/java/com/google/protobuf250/CodedOutputStream.java | CodedOutputStream.writeSFixed64 | public void writeSFixed64(final int fieldNumber, final long value)
throws IOException {
"""
Write an {@code sfixed64} field, including tag, to the stream.
"""
writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED64);
writeSFixed64NoTag(value);
} | java | public void writeSFixed64(final int fieldNumber, final long value)
throws IOException {
writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED64);
writeSFixed64NoTag(value);
} | [
"public",
"void",
"writeSFixed64",
"(",
"final",
"int",
"fieldNumber",
",",
"final",
"long",
"value",
")",
"throws",
"IOException",
"{",
"writeTag",
"(",
"fieldNumber",
",",
"WireFormat",
".",
"WIRETYPE_FIXED64",
")",
";",
"writeSFixed64NoTag",
"(",
"value",
")"... | Write an {@code sfixed64} field, including tag, to the stream. | [
"Write",
"an",
"{"
] | train | https://github.com/udoprog/ffwd-client-java/blob/b4161d2b138e3edb8fa9420cc3cc653d5764cf5b/src/main/java/com/google/protobuf250/CodedOutputStream.java#L257-L261 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java | PatternBox.neighborOf | public static Pattern neighborOf() {
"""
Constructs a pattern where first and last proteins are related through an interaction. They
can be participants or controllers. No limitation.
@return the pattern
"""
Pattern p = new Pattern(SequenceEntityReference.class, "Protein 1");
p.add(linkedER(true), "Prote... | java | public static Pattern neighborOf()
{
Pattern p = new Pattern(SequenceEntityReference.class, "Protein 1");
p.add(linkedER(true), "Protein 1", "generic Protein 1");
p.add(erToPE(), "generic Protein 1", "SPE1");
p.add(linkToComplex(), "SPE1", "PE1");
p.add(peToInter(), "PE1", "Inter");
p.add(interToPE(), "Int... | [
"public",
"static",
"Pattern",
"neighborOf",
"(",
")",
"{",
"Pattern",
"p",
"=",
"new",
"Pattern",
"(",
"SequenceEntityReference",
".",
"class",
",",
"\"Protein 1\"",
")",
";",
"p",
".",
"add",
"(",
"linkedER",
"(",
"true",
")",
",",
"\"Protein 1\"",
",",
... | Constructs a pattern where first and last proteins are related through an interaction. They
can be participants or controllers. No limitation.
@return the pattern | [
"Constructs",
"a",
"pattern",
"where",
"first",
"and",
"last",
"proteins",
"are",
"related",
"through",
"an",
"interaction",
".",
"They",
"can",
"be",
"participants",
"or",
"controllers",
".",
"No",
"limitation",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L570-L585 |
datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.setContent | public Request setContent(String text, ContentType contentType) {
"""
set request content from input text string with given content type
@param text : text to be sent as http content
@param contentType : type of content set in header
@return : Request Object with content type header and conetnt entity value... | java | public Request setContent(String text, ContentType contentType) {
entity = new StringEntity(text, contentType);
return this;
} | [
"public",
"Request",
"setContent",
"(",
"String",
"text",
",",
"ContentType",
"contentType",
")",
"{",
"entity",
"=",
"new",
"StringEntity",
"(",
"text",
",",
"contentType",
")",
";",
"return",
"this",
";",
"}"
] | set request content from input text string with given content type
@param text : text to be sent as http content
@param contentType : type of content set in header
@return : Request Object with content type header and conetnt entity value set | [
"set",
"request",
"content",
"from",
"input",
"text",
"string",
"with",
"given",
"content",
"type"
] | train | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L400-L403 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java | JDBCResultSet.updateInt | public void updateInt(int columnIndex, int x) throws SQLException {
"""
<!-- start generic documentation -->
Updates the designated column with an <code>int</code> value.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying... | java | public void updateInt(int columnIndex, int x) throws SQLException {
startUpdate(columnIndex);
preparedStatement.setIntParameter(columnIndex, x);
} | [
"public",
"void",
"updateInt",
"(",
"int",
"columnIndex",
",",
"int",
"x",
")",
"throws",
"SQLException",
"{",
"startUpdate",
"(",
"columnIndex",
")",
";",
"preparedStatement",
".",
"setIntParameter",
"(",
"columnIndex",
",",
"x",
")",
";",
"}"
] | <!-- start generic documentation -->
Updates the designated column with an <code>int</code> value.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the <code>updateRow</code> or
<code>insertRow</code> methods a... | [
"<!",
"--",
"start",
"generic",
"documentation",
"--",
">",
"Updates",
"the",
"designated",
"column",
"with",
"an",
"<code",
">",
"int<",
"/",
"code",
">",
"value",
".",
"The",
"updater",
"methods",
"are",
"used",
"to",
"update",
"column",
"values",
"in",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java#L2749-L2752 |
landawn/AbacusUtil | src/com/landawn/abacus/util/CSVUtil.java | CSVUtil.loadCSV | @SuppressWarnings("rawtypes")
public static <E extends Exception> DataSet loadCSV(final File csvFile, final long offset, final long count, final Try.Predicate<String[], E> filter,
final Map<String, ? extends Type> columnTypeMap) throws UncheckedIOException, E {
"""
Load the data from CSV.
@param... | java | @SuppressWarnings("rawtypes")
public static <E extends Exception> DataSet loadCSV(final File csvFile, final long offset, final long count, final Try.Predicate<String[], E> filter,
final Map<String, ? extends Type> columnTypeMap) throws UncheckedIOException, E {
InputStream csvInputStream = nu... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"<",
"E",
"extends",
"Exception",
">",
"DataSet",
"loadCSV",
"(",
"final",
"File",
"csvFile",
",",
"final",
"long",
"offset",
",",
"final",
"long",
"count",
",",
"final",
"Try",
".",
"P... | Load the data from CSV.
@param csvFile
@param offset
@param count
@param filter
@param columnTypeMap
@return | [
"Load",
"the",
"data",
"from",
"CSV",
".",
"@param",
"csvFile",
"@param",
"offset",
"@param",
"count",
"@param",
"filter",
"@param",
"columnTypeMap"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/CSVUtil.java#L404-L418 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPHandler.java | RTMPHandler.invokeCall | protected void invokeCall(RTMPConnection conn, IServiceCall call) {
"""
Remoting call invocation handler.
@param conn
RTMP connection
@param call
Service call
"""
final IScope scope = conn.getScope();
if (scope != null) {
if (scope.hasHandler()) {
final ISc... | java | protected void invokeCall(RTMPConnection conn, IServiceCall call) {
final IScope scope = conn.getScope();
if (scope != null) {
if (scope.hasHandler()) {
final IScopeHandler handler = scope.getHandler();
log.debug("Scope: {} handler: {}", scope, handler);
... | [
"protected",
"void",
"invokeCall",
"(",
"RTMPConnection",
"conn",
",",
"IServiceCall",
"call",
")",
"{",
"final",
"IScope",
"scope",
"=",
"conn",
".",
"getScope",
"(",
")",
";",
"if",
"(",
"scope",
"!=",
"null",
")",
"{",
"if",
"(",
"scope",
".",
"hasH... | Remoting call invocation handler.
@param conn
RTMP connection
@param call
Service call | [
"Remoting",
"call",
"invocation",
"handler",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPHandler.java#L177-L195 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/MPXReader.java | MPXReader.addDateRange | private void addDateRange(ProjectCalendarHours hours, Date start, Date end) {
"""
Get a date range that correctly handles the case where the end time
is midnight. In this instance the end time should be the start of the
next day.
@param hours calendar hours
@param start start date
@param end end date
""... | java | private void addDateRange(ProjectCalendarHours hours, Date start, Date end)
{
if (start != null && end != null)
{
Calendar cal = DateHelper.popCalendar(end);
// If the time ends on midnight, the date should be the next day. Otherwise problems occur.
if (cal.get(Calendar.HOUR_OF... | [
"private",
"void",
"addDateRange",
"(",
"ProjectCalendarHours",
"hours",
",",
"Date",
"start",
",",
"Date",
"end",
")",
"{",
"if",
"(",
"start",
"!=",
"null",
"&&",
"end",
"!=",
"null",
")",
"{",
"Calendar",
"cal",
"=",
"DateHelper",
".",
"popCalendar",
... | Get a date range that correctly handles the case where the end time
is midnight. In this instance the end time should be the start of the
next day.
@param hours calendar hours
@param start start date
@param end end date | [
"Get",
"a",
"date",
"range",
"that",
"correctly",
"handles",
"the",
"case",
"where",
"the",
"end",
"time",
"is",
"midnight",
".",
"In",
"this",
"instance",
"the",
"end",
"time",
"should",
"be",
"the",
"start",
"of",
"the",
"next",
"day",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/MPXReader.java#L649-L664 |
matthewhorridge/mdock | src/main/java/org/coode/mdock/SplitterNode.java | SplitterNode.insertNodeAfter | public void insertNodeAfter(Node insert, Node after, double split) {
"""
Inserts a node after (right of or bottom of) a given node by splitting the inserted
node with the given node.
@param insert The node to be inserted
@param after The node that the inserted node will be split with.
@param split The w... | java | public void insertNodeAfter(Node insert, Node after, double split) {
addChild(insert, children.indexOf(after) + 1, split);
notifyStateChange();
} | [
"public",
"void",
"insertNodeAfter",
"(",
"Node",
"insert",
",",
"Node",
"after",
",",
"double",
"split",
")",
"{",
"addChild",
"(",
"insert",
",",
"children",
".",
"indexOf",
"(",
"after",
")",
"+",
"1",
",",
"split",
")",
";",
"notifyStateChange",
"(",... | Inserts a node after (right of or bottom of) a given node by splitting the inserted
node with the given node.
@param insert The node to be inserted
@param after The node that the inserted node will be split with.
@param split The weight | [
"Inserts",
"a",
"node",
"after",
"(",
"right",
"of",
"or",
"bottom",
"of",
")",
"a",
"given",
"node",
"by",
"splitting",
"the",
"inserted",
"node",
"with",
"the",
"given",
"node",
"."
] | train | https://github.com/matthewhorridge/mdock/blob/37839a56f30bdb73d56d82c4d1afe548d66b404b/src/main/java/org/coode/mdock/SplitterNode.java#L291-L294 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java | BloatedAssignmentScope.sawLoad | private void sawLoad(int seen, int pc) {
"""
processes a register store by updating the appropriate scope block to mark this register as being read in the block
@param seen
the currently parsed opcode
@param pc
the current program counter
"""
int reg = RegisterUtils.getLoadReg(this, seen);
... | java | private void sawLoad(int seen, int pc) {
int reg = RegisterUtils.getLoadReg(this, seen);
if (!ignoreRegs.get(reg)) {
ScopeBlock sb = findScopeBlock(rootScopeBlock, pc);
if (sb != null) {
sb.addLoad(reg, pc);
} else {
ignoreRegs.set(reg)... | [
"private",
"void",
"sawLoad",
"(",
"int",
"seen",
",",
"int",
"pc",
")",
"{",
"int",
"reg",
"=",
"RegisterUtils",
".",
"getLoadReg",
"(",
"this",
",",
"seen",
")",
";",
"if",
"(",
"!",
"ignoreRegs",
".",
"get",
"(",
"reg",
")",
")",
"{",
"ScopeBloc... | processes a register store by updating the appropriate scope block to mark this register as being read in the block
@param seen
the currently parsed opcode
@param pc
the current program counter | [
"processes",
"a",
"register",
"store",
"by",
"updating",
"the",
"appropriate",
"scope",
"block",
"to",
"mark",
"this",
"register",
"as",
"being",
"read",
"in",
"the",
"block"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java#L355-L365 |
ixa-ehu/ixa-pipe-pos | src/main/java/eus/ixa/ixa/pipe/pos/MorphoFactory.java | MorphoFactory.createMorpheme | public final Morpheme createMorpheme(final String word, final String tag) {
"""
Construct morpheme object with word and morphological tag.
@param word
the word
@param tag
the morphological tag
@return the morpheme object
"""
final Morpheme morpheme = new Morpheme();
morpheme.setValue(word);
... | java | public final Morpheme createMorpheme(final String word, final String tag) {
final Morpheme morpheme = new Morpheme();
morpheme.setValue(word);
morpheme.setTag(tag);
return morpheme;
} | [
"public",
"final",
"Morpheme",
"createMorpheme",
"(",
"final",
"String",
"word",
",",
"final",
"String",
"tag",
")",
"{",
"final",
"Morpheme",
"morpheme",
"=",
"new",
"Morpheme",
"(",
")",
";",
"morpheme",
".",
"setValue",
"(",
"word",
")",
";",
"morpheme"... | Construct morpheme object with word and morphological tag.
@param word
the word
@param tag
the morphological tag
@return the morpheme object | [
"Construct",
"morpheme",
"object",
"with",
"word",
"and",
"morphological",
"tag",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/MorphoFactory.java#L36-L41 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java | ConstructorBuilder.getInstance | public static ConstructorBuilder getInstance(Context context,
TypeElement typeElement, ConstructorWriter writer) {
"""
Construct a new ConstructorBuilder.
@param context the build context.
@param typeElement the class whoses members are being documented.
@param writer the doclet specific writer.
... | java | public static ConstructorBuilder getInstance(Context context,
TypeElement typeElement, ConstructorWriter writer) {
return new ConstructorBuilder(context, typeElement, writer);
} | [
"public",
"static",
"ConstructorBuilder",
"getInstance",
"(",
"Context",
"context",
",",
"TypeElement",
"typeElement",
",",
"ConstructorWriter",
"writer",
")",
"{",
"return",
"new",
"ConstructorBuilder",
"(",
"context",
",",
"typeElement",
",",
"writer",
")",
";",
... | Construct a new ConstructorBuilder.
@param context the build context.
@param typeElement the class whoses members are being documented.
@param writer the doclet specific writer.
@return the new ConstructorBuilder | [
"Construct",
"a",
"new",
"ConstructorBuilder",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java#L115-L118 |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedCollection.java | FileBasedCollection.addEntry | public Entry addEntry(final Entry entry) throws Exception {
"""
Add entry to collection.
@param entry Entry to be added to collection. Entry will be saved to disk in a directory
under the collection's directory and the path will follow the pattern
[collection-plural]/[entryid]/entry.xml. The entry will be add... | java | public Entry addEntry(final Entry entry) throws Exception {
synchronized (FileStore.getFileStore()) {
final Feed f = getFeedDocument();
final String fsid = FileStore.getFileStore().getNextId();
updateTimestamps(entry);
// Save entry to file
final Str... | [
"public",
"Entry",
"addEntry",
"(",
"final",
"Entry",
"entry",
")",
"throws",
"Exception",
"{",
"synchronized",
"(",
"FileStore",
".",
"getFileStore",
"(",
")",
")",
"{",
"final",
"Feed",
"f",
"=",
"getFeedDocument",
"(",
")",
";",
"final",
"String",
"fsid... | Add entry to collection.
@param entry Entry to be added to collection. Entry will be saved to disk in a directory
under the collection's directory and the path will follow the pattern
[collection-plural]/[entryid]/entry.xml. The entry will be added to the
collection's feed in [collection-plural]/feed.xml.
@throws java... | [
"Add",
"entry",
"to",
"collection",
"."
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedCollection.java#L188-L210 |
michael-rapp/AndroidMaterialDialog | library/src/main/java/de/mrapp/android/dialog/adapter/ViewPagerAdapter.java | ViewPagerAdapter.addItem | public final void addItem(@Nullable final CharSequence title,
@NonNull final Class<? extends Fragment> fragmentClass,
@Nullable final Bundle arguments) {
"""
Adds a new fragment to the adapter.
@param title
The title of the fragment, which should be a... | java | public final void addItem(@Nullable final CharSequence title,
@NonNull final Class<? extends Fragment> fragmentClass,
@Nullable final Bundle arguments) {
Condition.INSTANCE.ensureNotNull(fragmentClass, "The fragment class may not be null");
ite... | [
"public",
"final",
"void",
"addItem",
"(",
"@",
"Nullable",
"final",
"CharSequence",
"title",
",",
"@",
"NonNull",
"final",
"Class",
"<",
"?",
"extends",
"Fragment",
">",
"fragmentClass",
",",
"@",
"Nullable",
"final",
"Bundle",
"arguments",
")",
"{",
"Condi... | Adds a new fragment to the adapter.
@param title
The title of the fragment, which should be added, as an instance of the type {@link
CharSequence} or null, if no title should be set
@param fragmentClass
The class of the fragment, which should be added, as an instance of the class {@link
Class}. The class may not be nu... | [
"Adds",
"a",
"new",
"fragment",
"to",
"the",
"adapter",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialDialog/blob/8990eed72ee5f5a9720836ee708f71ac0d43053b/library/src/main/java/de/mrapp/android/dialog/adapter/ViewPagerAdapter.java#L84-L90 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java | HylaFaxJob.getSenderName | public String getSenderName() {
"""
This function returns the fax job sender name.
@return The fax job sender name
"""
String value=null;
try
{
value=this.JOB.getFromUser();
}
catch(Exception exception)
{
throw new FaxException("Error ... | java | public String getSenderName()
{
String value=null;
try
{
value=this.JOB.getFromUser();
}
catch(Exception exception)
{
throw new FaxException("Error while extracting job sender name.",exception);
}
return value;
} | [
"public",
"String",
"getSenderName",
"(",
")",
"{",
"String",
"value",
"=",
"null",
";",
"try",
"{",
"value",
"=",
"this",
".",
"JOB",
".",
"getFromUser",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"exception",
")",
"{",
"throw",
"new",
"FaxExcepti... | This function returns the fax job sender name.
@return The fax job sender name | [
"This",
"function",
"returns",
"the",
"fax",
"job",
"sender",
"name",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java#L225-L238 |
google/closure-compiler | src/com/google/javascript/jscomp/PeepholeMinimizeConditions.java | PeepholeMinimizeConditions.maybeReplaceChildWithNumber | private Node maybeReplaceChildWithNumber(Node n, Node parent, int num) {
"""
Replaces a node with a number node if the new number node is not equivalent
to the current node.
Returns the replacement for n if it was replaced, otherwise returns n.
"""
Node newNode = IR.number(num);
if (!newNode.isEqui... | java | private Node maybeReplaceChildWithNumber(Node n, Node parent, int num) {
Node newNode = IR.number(num);
if (!newNode.isEquivalentTo(n)) {
parent.replaceChild(n, newNode);
reportChangeToEnclosingScope(newNode);
markFunctionsDeleted(n);
return newNode;
}
return n;
} | [
"private",
"Node",
"maybeReplaceChildWithNumber",
"(",
"Node",
"n",
",",
"Node",
"parent",
",",
"int",
"num",
")",
"{",
"Node",
"newNode",
"=",
"IR",
".",
"number",
"(",
"num",
")",
";",
"if",
"(",
"!",
"newNode",
".",
"isEquivalentTo",
"(",
"n",
")",
... | Replaces a node with a number node if the new number node is not equivalent
to the current node.
Returns the replacement for n if it was replaced, otherwise returns n. | [
"Replaces",
"a",
"node",
"with",
"a",
"number",
"node",
"if",
"the",
"new",
"number",
"node",
"is",
"not",
"equivalent",
"to",
"the",
"current",
"node",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/PeepholeMinimizeConditions.java#L1140-L1151 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_historyConsumption_date_file_GET | public OvhPcsFile billingAccount_historyConsumption_date_file_GET(String billingAccount, java.util.Date date, OvhBillDocument extension) throws IOException {
"""
Previous billed consumption files
REST: GET /telephony/{billingAccount}/historyConsumption/{date}/file
@param extension [required] Document suffix
@... | java | public OvhPcsFile billingAccount_historyConsumption_date_file_GET(String billingAccount, java.util.Date date, OvhBillDocument extension) throws IOException {
String qPath = "/telephony/{billingAccount}/historyConsumption/{date}/file";
StringBuilder sb = path(qPath, billingAccount, date);
query(sb, "extension", ex... | [
"public",
"OvhPcsFile",
"billingAccount_historyConsumption_date_file_GET",
"(",
"String",
"billingAccount",
",",
"java",
".",
"util",
".",
"Date",
"date",
",",
"OvhBillDocument",
"extension",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{bill... | Previous billed consumption files
REST: GET /telephony/{billingAccount}/historyConsumption/{date}/file
@param extension [required] Document suffix
@param billingAccount [required] The name of your billingAccount
@param date [required] | [
"Previous",
"billed",
"consumption",
"files"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L685-L691 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4ClientConnection.java | JDBC4ClientConnection.updateApplicationCatalog | public ClientResponse updateApplicationCatalog(File catalogPath, File deploymentPath)
throws IOException, NoConnectionsException, ProcCallException {
"""
Synchronously invokes UpdateApplicationCatalog procedure. Blocks until a result is available.
A {@link ProcCallException} is thrown if the response ... | java | public ClientResponse updateApplicationCatalog(File catalogPath, File deploymentPath)
throws IOException, NoConnectionsException, ProcCallException
{
ClientImpl currentClient = this.getClient();
try {
return currentClient.updateApplicationCatalog(catalogPath, deploymentPath);... | [
"public",
"ClientResponse",
"updateApplicationCatalog",
"(",
"File",
"catalogPath",
",",
"File",
"deploymentPath",
")",
"throws",
"IOException",
",",
"NoConnectionsException",
",",
"ProcCallException",
"{",
"ClientImpl",
"currentClient",
"=",
"this",
".",
"getClient",
"... | Synchronously invokes UpdateApplicationCatalog procedure. Blocks until a result is available.
A {@link ProcCallException} is thrown if the response is anything other then success.
@param catalogPath
Path to the catalog jar file.
@param deploymentPath
Path to the deployment file
@return array of VoltTable results
@thro... | [
"Synchronously",
"invokes",
"UpdateApplicationCatalog",
"procedure",
".",
"Blocks",
"until",
"a",
"result",
"is",
"available",
".",
"A",
"{",
"@link",
"ProcCallException",
"}",
"is",
"thrown",
"if",
"the",
"response",
"is",
"anything",
"other",
"then",
"success",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4ClientConnection.java#L540-L551 |
amaembo/streamex | src/main/java/one/util/streamex/IntStreamEx.java | IntStreamEx.rangeClosed | public static IntStreamEx rangeClosed(int startInclusive, int endInclusive, int step) {
"""
Returns a sequential ordered {@code IntStreamEx} from
{@code startInclusive} (inclusive) to {@code endInclusive} (inclusive) by
the specified incremental step. The negative step values are also
supported. In this case th... | java | public static IntStreamEx rangeClosed(int startInclusive, int endInclusive, int step) {
if (step == 0)
throw new IllegalArgumentException("step = 0");
if (step == 1)
return seq(IntStream.rangeClosed(startInclusive, endInclusive));
if (step == -1) {
// Handled ... | [
"public",
"static",
"IntStreamEx",
"rangeClosed",
"(",
"int",
"startInclusive",
",",
"int",
"endInclusive",
",",
"int",
"step",
")",
"{",
"if",
"(",
"step",
"==",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"step = 0\"",
")",
";",
"if",
"(",... | Returns a sequential ordered {@code IntStreamEx} from
{@code startInclusive} (inclusive) to {@code endInclusive} (inclusive) by
the specified incremental step. The negative step values are also
supported. In this case the {@code startInclusive} should be greater than
{@code endInclusive}.
<p>
Note that depending on th... | [
"Returns",
"a",
"sequential",
"ordered",
"{",
"@code",
"IntStreamEx",
"}",
"from",
"{",
"@code",
"startInclusive",
"}",
"(",
"inclusive",
")",
"to",
"{",
"@code",
"endInclusive",
"}",
"(",
"inclusive",
")",
"by",
"the",
"specified",
"incremental",
"step",
".... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/IntStreamEx.java#L2579-L2595 |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.isNotPresentDisplayedEnabledInput | private boolean isNotPresentDisplayedEnabledInput(String action, String expected, String extra) {
"""
Determines if something is present, displayed, enabled, and an input.
This returns true if all four are true, otherwise, it returns false
@param action - what action is occurring
@param expected - what is t... | java | private boolean isNotPresentDisplayedEnabledInput(String action, String expected, String extra) {
// wait for element to be present
if (isNotPresent(action, expected, extra)) {
return true;
}
// wait for element to be displayed
if (isNotDisplayed(action, expected, ext... | [
"private",
"boolean",
"isNotPresentDisplayedEnabledInput",
"(",
"String",
"action",
",",
"String",
"expected",
",",
"String",
"extra",
")",
"{",
"// wait for element to be present",
"if",
"(",
"isNotPresent",
"(",
"action",
",",
"expected",
",",
"extra",
")",
")",
... | Determines if something is present, displayed, enabled, and an input.
This returns true if all four are true, otherwise, it returns false
@param action - what action is occurring
@param expected - what is the expected result
@param extra - what actually is occurring
@return Boolean: is the element present, displa... | [
"Determines",
"if",
"something",
"is",
"present",
"displayed",
"enabled",
"and",
"an",
"input",
".",
"This",
"returns",
"true",
"if",
"all",
"four",
"are",
"true",
"otherwise",
"it",
"returns",
"false"
] | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L734-L745 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BaseTaglet.java | BaseTaglet.getTagletOutput | public Content getTagletOutput(Element element, DocTree tag, TagletWriter writer) {
"""
{@inheritDoc}
@throws UnsupportedTagletOperationException thrown when the method is
not supported by the taglet.
"""
throw new UnsupportedTagletOperationException("Method not supported in taglet " + getName() + ".... | java | public Content getTagletOutput(Element element, DocTree tag, TagletWriter writer) {
throw new UnsupportedTagletOperationException("Method not supported in taglet " + getName() + ".");
} | [
"public",
"Content",
"getTagletOutput",
"(",
"Element",
"element",
",",
"DocTree",
"tag",
",",
"TagletWriter",
"writer",
")",
"{",
"throw",
"new",
"UnsupportedTagletOperationException",
"(",
"\"Method not supported in taglet \"",
"+",
"getName",
"(",
")",
"+",
"\".\""... | {@inheritDoc}
@throws UnsupportedTagletOperationException thrown when the method is
not supported by the taglet. | [
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BaseTaglet.java#L147-L149 |
nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.checkTTC | protected final boolean checkTTC(FontFileReader in, String name) throws IOException {
"""
Check if this is a TrueType collection and that the given
name exists in the collection.
If it does, set offset in fontfile to the beginning of
the Table Directory for that font.
@param in FontFileReader to read from
@pa... | java | protected final boolean checkTTC(FontFileReader in, String name) throws IOException {
String tag = in.readTTFString(4);
if ("ttcf".equals(tag)) {
// This is a TrueType Collection
in.skip(4);
// Read directory offsets
int numDirectories = (int)in.readTTFU... | [
"protected",
"final",
"boolean",
"checkTTC",
"(",
"FontFileReader",
"in",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"String",
"tag",
"=",
"in",
".",
"readTTFString",
"(",
"4",
")",
";",
"if",
"(",
"\"ttcf\"",
".",
"equals",
"(",
"tag",
")... | Check if this is a TrueType collection and that the given
name exists in the collection.
If it does, set offset in fontfile to the beginning of
the Table Directory for that font.
@param in FontFileReader to read from
@param name The name to check
@return True if not collection or font name present, false otherwise
@thr... | [
"Check",
"if",
"this",
"is",
"a",
"TrueType",
"collection",
"and",
"that",
"the",
"given",
"name",
"exists",
"in",
"the",
"collection",
".",
"If",
"it",
"does",
"set",
"offset",
"in",
"fontfile",
"to",
"the",
"beginning",
"of",
"the",
"Table",
"Directory",... | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L1427-L1480 |
datacleaner/DataCleaner | desktop/ui/src/main/java/org/datacleaner/widgets/tabs/CloseableTabbedPaneUI.java | CloseableTabbedPaneUI.calculateTabWidth | @Override
protected int calculateTabWidth(final int tabPlacement, final int tabIndex, final FontMetrics metrics) {
"""
Override this to provide extra space on right for close button
"""
if (_pane.getSeparators().contains(tabIndex)) {
return SEPARATOR_WIDTH;
}
int width =... | java | @Override
protected int calculateTabWidth(final int tabPlacement, final int tabIndex, final FontMetrics metrics) {
if (_pane.getSeparators().contains(tabIndex)) {
return SEPARATOR_WIDTH;
}
int width = super.calculateTabWidth(tabPlacement, tabIndex, metrics);
if (!_pane.ge... | [
"@",
"Override",
"protected",
"int",
"calculateTabWidth",
"(",
"final",
"int",
"tabPlacement",
",",
"final",
"int",
"tabIndex",
",",
"final",
"FontMetrics",
"metrics",
")",
"{",
"if",
"(",
"_pane",
".",
"getSeparators",
"(",
")",
".",
"contains",
"(",
"tabIn... | Override this to provide extra space on right for close button | [
"Override",
"this",
"to",
"provide",
"extra",
"space",
"on",
"right",
"for",
"close",
"button"
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/desktop/ui/src/main/java/org/datacleaner/widgets/tabs/CloseableTabbedPaneUI.java#L131-L141 |
cesarferreira/AndroidQuickUtils | library/src/main/java/quickutils/core/categories/math.java | math.getRandomDouble | public static double getRandomDouble(double min, double max) {
"""
Returns a random double between MIN inclusive and MAX inclusive.
@param min
value inclusive
@param max
value inclusive
@return an int between 0 inclusive and MAX exclusive.
"""
Random r = new Random();
return min + (max - min) * r.... | java | public static double getRandomDouble(double min, double max) {
Random r = new Random();
return min + (max - min) * r.nextDouble();
} | [
"public",
"static",
"double",
"getRandomDouble",
"(",
"double",
"min",
",",
"double",
"max",
")",
"{",
"Random",
"r",
"=",
"new",
"Random",
"(",
")",
";",
"return",
"min",
"+",
"(",
"max",
"-",
"min",
")",
"*",
"r",
".",
"nextDouble",
"(",
")",
";"... | Returns a random double between MIN inclusive and MAX inclusive.
@param min
value inclusive
@param max
value inclusive
@return an int between 0 inclusive and MAX exclusive. | [
"Returns",
"a",
"random",
"double",
"between",
"MIN",
"inclusive",
"and",
"MAX",
"inclusive",
"."
] | train | https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/math.java#L125-L128 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.createInstance | public CreateInstanceResponse createInstance(CreateInstanceRequest request)
throws BceClientException {
"""
Create a bcc Instance with the specified options,
see all the supported instance in {@link com.baidubce.services.bcc.model.instance.InstanceType}
You must fill the field of clientToken,which is... | java | public CreateInstanceResponse createInstance(CreateInstanceRequest request)
throws BceClientException {
checkNotNull(request, "request should not be null.");
if (Strings.isNullOrEmpty(request.getClientToken())) {
request.setClientToken(this.generateClientToken());
}
... | [
"public",
"CreateInstanceResponse",
"createInstance",
"(",
"CreateInstanceRequest",
"request",
")",
"throws",
"BceClientException",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"r... | Create a bcc Instance with the specified options,
see all the supported instance in {@link com.baidubce.services.bcc.model.instance.InstanceType}
You must fill the field of clientToken,which is especially for keeping idempotent.
This is an asynchronous interface,
you can get the latest status by invoke {@link #getInst... | [
"Create",
"a",
"bcc",
"Instance",
"with",
"the",
"specified",
"options",
"see",
"all",
"the",
"supported",
"instance",
"in",
"{",
"@link",
"com",
".",
"baidubce",
".",
"services",
".",
"bcc",
".",
"model",
".",
"instance",
".",
"InstanceType",
"}",
"You",
... | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L272-L297 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventsInner.java | LiveEventsInner.resetAsync | public Observable<Void> resetAsync(String resourceGroupName, String accountName, String liveEventName) {
"""
Reset Live Event.
Resets an existing Live Event.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param liveE... | java | public Observable<Void> resetAsync(String resourceGroupName, String accountName, String liveEventName) {
return resetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> res... | [
"public",
"Observable",
"<",
"Void",
">",
"resetAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"liveEventName",
")",
"{",
"return",
"resetWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
",",
"liveEvent... | Reset Live Event.
Resets an existing Live Event.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param liveEventName The name of the Live Event.
@throws IllegalArgumentException thrown if parameters fail the validation
@return ... | [
"Reset",
"Live",
"Event",
".",
"Resets",
"an",
"existing",
"Live",
"Event",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventsInner.java#L1684-L1691 |
alibaba/canal | dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java | LogBuffer.getDecimal | public final BigDecimal getDecimal(final int pos, final int precision, final int scale) {
"""
Return big decimal from buffer.
@see mysql-5.1.60/strings/decimal.c - bin2decimal()
"""
final int intg = precision - scale;
final int frac = scale;
final int intg0 = intg / DIG_PER_INT32;... | java | public final BigDecimal getDecimal(final int pos, final int precision, final int scale) {
final int intg = precision - scale;
final int frac = scale;
final int intg0 = intg / DIG_PER_INT32;
final int frac0 = frac / DIG_PER_INT32;
final int intg0x = intg - intg0 * DIG_PER_INT... | [
"public",
"final",
"BigDecimal",
"getDecimal",
"(",
"final",
"int",
"pos",
",",
"final",
"int",
"precision",
",",
"final",
"int",
"scale",
")",
"{",
"final",
"int",
"intg",
"=",
"precision",
"-",
"scale",
";",
"final",
"int",
"frac",
"=",
"scale",
";",
... | Return big decimal from buffer.
@see mysql-5.1.60/strings/decimal.c - bin2decimal() | [
"Return",
"big",
"decimal",
"from",
"buffer",
"."
] | train | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L1229-L1246 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java | DefaultQueryLogEntryCreator.writeParamsEntry | protected void writeParamsEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
"""
Write query parameters.
<p>default for prepared: Params:[(foo,100),(bar,101)],
<p>default for callable: Params:[(1=foo,key=100),(1=bar,key=101)],
@param sb StringBuilder to write
@param... | java | protected void writeParamsEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
boolean isPrepared = execInfo.getStatementType() == StatementType.PREPARED;
sb.append("Params:[");
for (QueryInfo queryInfo : queryInfoList) {
for (List<ParameterSetOperation... | [
"protected",
"void",
"writeParamsEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"boolean",
"isPrepared",
"=",
"execInfo",
".",
"getStatementType",
"(",
")",
"==",
"StatementType"... | Write query parameters.
<p>default for prepared: Params:[(foo,100),(bar,101)],
<p>default for callable: Params:[(1=foo,key=100),(1=bar,key=101)],
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list
@since 1.3.3 | [
"Write",
"query",
"parameters",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java#L258-L282 |
EdwardRaff/JSAT | JSAT/src/jsat/clustering/OPTICS.java | OPTICS.setXi | public void setXi(double xi) {
"""
Sets the xi value used in {@link ExtractionMethod#XI_STEEP_ORIGINAL} to
produce cluster results.
@param xi the value in the range (0, 1)
@throws ArithmeticException if the value is not in the appropriate range
"""
if(xi <= 0 || xi >= 1 || Double.isNaN(xi))
... | java | public void setXi(double xi)
{
if(xi <= 0 || xi >= 1 || Double.isNaN(xi))
throw new ArithmeticException("xi must be in the range (0, 1) not " + xi);
this.xi = xi;
this.one_min_xi = 1.0 - xi;
} | [
"public",
"void",
"setXi",
"(",
"double",
"xi",
")",
"{",
"if",
"(",
"xi",
"<=",
"0",
"||",
"xi",
">=",
"1",
"||",
"Double",
".",
"isNaN",
"(",
"xi",
")",
")",
"throw",
"new",
"ArithmeticException",
"(",
"\"xi must be in the range (0, 1) not \"",
"+",
"x... | Sets the xi value used in {@link ExtractionMethod#XI_STEEP_ORIGINAL} to
produce cluster results.
@param xi the value in the range (0, 1)
@throws ArithmeticException if the value is not in the appropriate range | [
"Sets",
"the",
"xi",
"value",
"used",
"in",
"{",
"@link",
"ExtractionMethod#XI_STEEP_ORIGINAL",
"}",
"to",
"produce",
"cluster",
"results",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/clustering/OPTICS.java#L226-L232 |
VoltDB/voltdb | src/frontend/org/voltdb/importer/ChannelDistributer.java | ChannelDistributer.shutdown | public void shutdown() {
"""
Sets the done flag, shuts down its executor thread, and deletes its own host
and candidate nodes
"""
if (m_done.compareAndSet(false, true)) {
m_es.shutdown();
m_buses.shutdown();
DeleteNode deleteHost = new DeleteNode(joinZKPath(HOST_DN,... | java | public void shutdown() {
if (m_done.compareAndSet(false, true)) {
m_es.shutdown();
m_buses.shutdown();
DeleteNode deleteHost = new DeleteNode(joinZKPath(HOST_DN, m_hostId));
DeleteNode deleteCandidate = new DeleteNode(m_candidate);
try {
... | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"if",
"(",
"m_done",
".",
"compareAndSet",
"(",
"false",
",",
"true",
")",
")",
"{",
"m_es",
".",
"shutdown",
"(",
")",
";",
"m_buses",
".",
"shutdown",
"(",
")",
";",
"DeleteNode",
"deleteHost",
"=",
"new... | Sets the done flag, shuts down its executor thread, and deletes its own host
and candidate nodes | [
"Sets",
"the",
"done",
"flag",
"shuts",
"down",
"its",
"executor",
"thread",
"and",
"deletes",
"its",
"own",
"host",
"and",
"candidate",
"nodes"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ChannelDistributer.java#L515-L534 |
carewebframework/carewebframework-core | org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/controller/ActionListener.java | ActionListener.eventCallback | @Override
public void eventCallback(String eventName, Object eventData) {
"""
This is the callback for the generic event that is monitored by this listener. It will result
in the invocation of the doAction method of each bound action target.
"""
for (IActionTarget target : new ArrayList<>(targets)... | java | @Override
public void eventCallback(String eventName, Object eventData) {
for (IActionTarget target : new ArrayList<>(targets)) {
try {
target.doAction(action);
} catch (Throwable t) {
}
}
} | [
"@",
"Override",
"public",
"void",
"eventCallback",
"(",
"String",
"eventName",
",",
"Object",
"eventData",
")",
"{",
"for",
"(",
"IActionTarget",
"target",
":",
"new",
"ArrayList",
"<>",
"(",
"targets",
")",
")",
"{",
"try",
"{",
"target",
".",
"doAction"... | This is the callback for the generic event that is monitored by this listener. It will result
in the invocation of the doAction method of each bound action target. | [
"This",
"is",
"the",
"callback",
"for",
"the",
"generic",
"event",
"that",
"is",
"monitored",
"by",
"this",
"listener",
".",
"It",
"will",
"result",
"in",
"the",
"invocation",
"of",
"the",
"doAction",
"method",
"of",
"each",
"bound",
"action",
"target",
".... | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/controller/ActionListener.java#L88-L97 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java | RuntimeExceptionsFactory.newUnsupportedOperationException | public static UnsupportedOperationException newUnsupportedOperationException(Throwable cause,
String message, Object... args) {
"""
Constructs and initializes a new {@link UnsupportedOperationException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[... | java | public static UnsupportedOperationException newUnsupportedOperationException(Throwable cause,
String message, Object... args) {
return new UnsupportedOperationException(format(message, args), cause);
} | [
"public",
"static",
"UnsupportedOperationException",
"newUnsupportedOperationException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"UnsupportedOperationException",
"(",
"format",
"(",
"message",
",",
... | Constructs and initializes a new {@link UnsupportedOperationException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link UnsupportedOperationException} was thrown.
@param message {@l... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"UnsupportedOperationException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java#L268-L272 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java | ProfileSummaryBuilder.buildContent | public void buildContent(XMLNode node, Content contentTree) {
"""
Build the content for the profile doc.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the profile contents
will be added
"""
Content profileContentTree = profileW... | java | public void buildContent(XMLNode node, Content contentTree) {
Content profileContentTree = profileWriter.getContentHeader();
buildChildren(node, profileContentTree);
contentTree.addContent(profileContentTree);
} | [
"public",
"void",
"buildContent",
"(",
"XMLNode",
"node",
",",
"Content",
"contentTree",
")",
"{",
"Content",
"profileContentTree",
"=",
"profileWriter",
".",
"getContentHeader",
"(",
")",
";",
"buildChildren",
"(",
"node",
",",
"profileContentTree",
")",
";",
"... | Build the content for the profile doc.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the profile contents
will be added | [
"Build",
"the",
"content",
"for",
"the",
"profile",
"doc",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L141-L145 |
grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java | GroovyPagesUriSupport.getDeployedViewURI | public String getDeployedViewURI(String controllerName, String viewName) {
"""
Obtains a view URI when deployed within the /WEB-INF/grails-app/views context
@param controllerName The name of the controller
@param viewName The name of the view
@return The view URI
"""
FastStringWriter buf = new FastS... | java | public String getDeployedViewURI(String controllerName, String viewName) {
FastStringWriter buf = new FastStringWriter(PATH_TO_VIEWS);
return getViewURIInternal(controllerName, viewName, buf, true);
} | [
"public",
"String",
"getDeployedViewURI",
"(",
"String",
"controllerName",
",",
"String",
"viewName",
")",
"{",
"FastStringWriter",
"buf",
"=",
"new",
"FastStringWriter",
"(",
"PATH_TO_VIEWS",
")",
";",
"return",
"getViewURIInternal",
"(",
"controllerName",
",",
"vi... | Obtains a view URI when deployed within the /WEB-INF/grails-app/views context
@param controllerName The name of the controller
@param viewName The name of the view
@return The view URI | [
"Obtains",
"a",
"view",
"URI",
"when",
"deployed",
"within",
"the",
"/",
"WEB",
"-",
"INF",
"/",
"grails",
"-",
"app",
"/",
"views",
"context"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java#L221-L224 |
EMCECS/nfs-client-java | src/main/java/com/emc/ecs/nfsclient/rpc/RpcWrapper.java | RpcWrapper.callRpcChecked | public void callRpcChecked(S request, RpcResponseHandler<? extends T> responseHandler) throws IOException {
"""
Convenience wrapper for NFS RPC calls where the IP is determined by a
byte[] key. This method just determines the IP address and calls the
basic method.
@param request
The request to send.
@param ... | java | public void callRpcChecked(S request, RpcResponseHandler<? extends T> responseHandler) throws IOException {
callRpcChecked(request, responseHandler, chooseIP(request.getIpKey()));
} | [
"public",
"void",
"callRpcChecked",
"(",
"S",
"request",
",",
"RpcResponseHandler",
"<",
"?",
"extends",
"T",
">",
"responseHandler",
")",
"throws",
"IOException",
"{",
"callRpcChecked",
"(",
"request",
",",
"responseHandler",
",",
"chooseIP",
"(",
"request",
".... | Convenience wrapper for NFS RPC calls where the IP is determined by a
byte[] key. This method just determines the IP address and calls the
basic method.
@param request
The request to send.
@param responseHandler
A response handler.
@throws IOException | [
"Convenience",
"wrapper",
"for",
"NFS",
"RPC",
"calls",
"where",
"the",
"IP",
"is",
"determined",
"by",
"a",
"byte",
"[]",
"key",
".",
"This",
"method",
"just",
"determines",
"the",
"IP",
"address",
"and",
"calls",
"the",
"basic",
"method",
"."
] | train | https://github.com/EMCECS/nfs-client-java/blob/7ba25bad5052b95cd286052745327729288b2843/src/main/java/com/emc/ecs/nfsclient/rpc/RpcWrapper.java#L175-L177 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/RegularFile.java | RegularFile.get | private static int get(byte[] block, int offset, ByteBuffer buf, int len) {
"""
Reads len bytes starting at the given offset in the given block into the given byte buffer.
"""
buf.put(block, offset, len);
return len;
} | java | private static int get(byte[] block, int offset, ByteBuffer buf, int len) {
buf.put(block, offset, len);
return len;
} | [
"private",
"static",
"int",
"get",
"(",
"byte",
"[",
"]",
"block",
",",
"int",
"offset",
",",
"ByteBuffer",
"buf",
",",
"int",
"len",
")",
"{",
"buf",
".",
"put",
"(",
"block",
",",
"offset",
",",
"len",
")",
";",
"return",
"len",
";",
"}"
] | Reads len bytes starting at the given offset in the given block into the given byte buffer. | [
"Reads",
"len",
"bytes",
"starting",
"at",
"the",
"given",
"offset",
"in",
"the",
"given",
"block",
"into",
"the",
"given",
"byte",
"buffer",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L657-L660 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/SASLAuthentication.java | SASLAuthentication.challengeReceived | public void challengeReceived(String challenge, boolean finalChallenge) throws SmackSaslException, NotConnectedException, InterruptedException {
"""
The server is challenging the SASL authentication we just sent. Forward the challenge
to the current SASLMechanism we are using. The SASLMechanism will eventually se... | java | public void challengeReceived(String challenge, boolean finalChallenge) throws SmackSaslException, NotConnectedException, InterruptedException {
try {
currentMechanism.challengeReceived(challenge, finalChallenge);
} catch (InterruptedException | SmackSaslException | NotConnectedException e) ... | [
"public",
"void",
"challengeReceived",
"(",
"String",
"challenge",
",",
"boolean",
"finalChallenge",
")",
"throws",
"SmackSaslException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"try",
"{",
"currentMechanism",
".",
"challengeReceived",
"(",
"chal... | The server is challenging the SASL authentication we just sent. Forward the challenge
to the current SASLMechanism we are using. The SASLMechanism will eventually send a response to
the server. The length of the challenge-response sequence varies according to the
SASLMechanism in use.
@param challenge a base64 encoded... | [
"The",
"server",
"is",
"challenging",
"the",
"SASL",
"authentication",
"we",
"just",
"sent",
".",
"Forward",
"the",
"challenge",
"to",
"the",
"current",
"SASLMechanism",
"we",
"are",
"using",
".",
"The",
"SASLMechanism",
"will",
"eventually",
"send",
"a",
"res... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/SASLAuthentication.java#L261-L268 |
haraldk/TwelveMonkeys | common/common-io/src/main/java/com/twelvemonkeys/io/FileUtil.java | FileUtil.getDirectoryname | public static String getDirectoryname(final String pPath, final char pSeparator) {
"""
Extracts the directory path without the filename, from a complete
filename path.
@param pPath The full filename path.
@param pSeparator the separator char used in {@code pPath}
@return the path without the filename.
@see ... | java | public static String getDirectoryname(final String pPath, final char pSeparator) {
int index = pPath.lastIndexOf(pSeparator);
if (index < 0) {
return ""; // Assume only filename
}
return pPath.substring(0, index);
} | [
"public",
"static",
"String",
"getDirectoryname",
"(",
"final",
"String",
"pPath",
",",
"final",
"char",
"pSeparator",
")",
"{",
"int",
"index",
"=",
"pPath",
".",
"lastIndexOf",
"(",
"pSeparator",
")",
";",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"retur... | Extracts the directory path without the filename, from a complete
filename path.
@param pPath The full filename path.
@param pSeparator the separator char used in {@code pPath}
@return the path without the filename.
@see File#getParent
@see #getFilename | [
"Extracts",
"the",
"directory",
"path",
"without",
"the",
"filename",
"from",
"a",
"complete",
"filename",
"path",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-io/src/main/java/com/twelvemonkeys/io/FileUtil.java#L436-L443 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java | WebUtils.putAuthenticationResultBuilder | public static void putAuthenticationResultBuilder(final AuthenticationResultBuilder builder, final RequestContext ctx) {
"""
Put authentication result builder.
@param builder the builder
@param ctx the ctx
"""
ctx.getConversationScope().put(PARAMETER_AUTHENTICATION_RESULT_BUILDER, builder);
... | java | public static void putAuthenticationResultBuilder(final AuthenticationResultBuilder builder, final RequestContext ctx) {
ctx.getConversationScope().put(PARAMETER_AUTHENTICATION_RESULT_BUILDER, builder);
} | [
"public",
"static",
"void",
"putAuthenticationResultBuilder",
"(",
"final",
"AuthenticationResultBuilder",
"builder",
",",
"final",
"RequestContext",
"ctx",
")",
"{",
"ctx",
".",
"getConversationScope",
"(",
")",
".",
"put",
"(",
"PARAMETER_AUTHENTICATION_RESULT_BUILDER",... | Put authentication result builder.
@param builder the builder
@param ctx the ctx | [
"Put",
"authentication",
"result",
"builder",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java#L486-L488 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/util/ReflectionUtils.java | ReflectionUtils.findSetter | public static Method findSetter(final Object object, final String fieldName, final Class<?> argumentType) {
"""
Returns the setter method associated with the object's field.
<p>
This method handles any autoboxing/unboxing of the argument passed to the setter (e.g. if the setter type is a
primitive {@code int} b... | java | public static Method findSetter(final Object object, final String fieldName, final Class<?> argumentType) {
if( object == null ) {
throw new NullPointerException("object should not be null");
} else if( fieldName == null ) {
throw new NullPointerException("fieldName should not be null");
} else if( argument... | [
"public",
"static",
"Method",
"findSetter",
"(",
"final",
"Object",
"object",
",",
"final",
"String",
"fieldName",
",",
"final",
"Class",
"<",
"?",
">",
"argumentType",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerExce... | Returns the setter method associated with the object's field.
<p>
This method handles any autoboxing/unboxing of the argument passed to the setter (e.g. if the setter type is a
primitive {@code int} but the argument passed to the setter is an {@code Integer}) by looking for a setter with
the same type, and failing that... | [
"Returns",
"the",
"setter",
"method",
"associated",
"with",
"the",
"object",
"s",
"field",
".",
"<p",
">",
"This",
"method",
"handles",
"any",
"autoboxing",
"/",
"unboxing",
"of",
"the",
"argument",
"passed",
"to",
"the",
"setter",
"(",
"e",
".",
"g",
".... | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/util/ReflectionUtils.java#L163-L193 |
Red5/red5-io | src/main/java/org/red5/io/object/Serializer.java | Serializer.serializeField | public static boolean serializeField(String keyName, Field field, Method getter) {
"""
Checks whether the field should be serialized or not
@param keyName
key name
@param field
The field to be serialized
@param getter
Getter method for field
@return <tt>true</tt> if the field should be serialized, otherwi... | java | public static boolean serializeField(String keyName, Field field, Method getter) {
log.trace("serializeField - keyName: {} field: {} method: {}", new Object[] { keyName, field, getter });
// if "field" is a class or is transient, skip it
if ("class".equals(keyName)) {
return false;
... | [
"public",
"static",
"boolean",
"serializeField",
"(",
"String",
"keyName",
",",
"Field",
"field",
",",
"Method",
"getter",
")",
"{",
"log",
".",
"trace",
"(",
"\"serializeField - keyName: {} field: {} method: {}\"",
",",
"new",
"Object",
"[",
"]",
"{",
"keyName",
... | Checks whether the field should be serialized or not
@param keyName
key name
@param field
The field to be serialized
@param getter
Getter method for field
@return <tt>true</tt> if the field should be serialized, otherwise <tt>false</tt> | [
"Checks",
"whether",
"the",
"field",
"should",
"be",
"serialized",
"or",
"not"
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/object/Serializer.java#L374-L395 |
mangstadt/biweekly | src/main/java/biweekly/util/com/google/ical/iter/Generators.java | Generators.serialSecondGenerator | static Generator serialSecondGenerator(final int interval, final DateValue dtStart) {
"""
Constructs a generator that generates seconds in the given date's minute
successively counting from the first second passed in.
@param interval number of seconds to advance each step
@param dtStart the date
@return the se... | java | static Generator serialSecondGenerator(final int interval, final DateValue dtStart) {
final TimeValue dtStartTime = TimeUtils.timeOf(dtStart);
return new Generator() {
int second = dtStartTime.second() - interval;
int minute = dtStartTime.minute();
int hour = dtStartTime.hour();
int day = dtStart.day();... | [
"static",
"Generator",
"serialSecondGenerator",
"(",
"final",
"int",
"interval",
",",
"final",
"DateValue",
"dtStart",
")",
"{",
"final",
"TimeValue",
"dtStartTime",
"=",
"TimeUtils",
".",
"timeOf",
"(",
"dtStart",
")",
";",
"return",
"new",
"Generator",
"(",
... | Constructs a generator that generates seconds in the given date's minute
successively counting from the first second passed in.
@param interval number of seconds to advance each step
@param dtStart the date
@return the second in dtStart the first time called and interval + last
return value on subsequent calls | [
"Constructs",
"a",
"generator",
"that",
"generates",
"seconds",
"in",
"the",
"given",
"date",
"s",
"minute",
"successively",
"counting",
"from",
"the",
"first",
"second",
"passed",
"in",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/iter/Generators.java#L348-L392 |
realtime-framework/RealtimeStorage-Android | library/src/main/java/co/realtime/storage/StorageRef.java | StorageRef.getTables | public StorageRef getTables(OnTableSnapshot onTableSnapshot, OnError onError) {
"""
Retrieves a list of the names of all tables created by the user's subscription.
<pre>
StorageRef storage = new StorageRef("your_app_key", "your_token");
storage.getTables(new OnTableSnapshot() {
@Override
public void ... | java | public StorageRef getTables(OnTableSnapshot onTableSnapshot, OnError onError){
PostBodyBuilder pbb = new PostBodyBuilder(context);
Rest r = new Rest(context, RestType.LISTTABLES, pbb, null);
r.onError = onError;
r.onTableSnapshot = onTableSnapshot;
context.processRest(r);
return this;
} | [
"public",
"StorageRef",
"getTables",
"(",
"OnTableSnapshot",
"onTableSnapshot",
",",
"OnError",
"onError",
")",
"{",
"PostBodyBuilder",
"pbb",
"=",
"new",
"PostBodyBuilder",
"(",
"context",
")",
";",
"Rest",
"r",
"=",
"new",
"Rest",
"(",
"context",
",",
"RestT... | Retrieves a list of the names of all tables created by the user's subscription.
<pre>
StorageRef storage = new StorageRef("your_app_key", "your_token");
storage.getTables(new OnTableSnapshot() {
@Override
public void run(TableSnapshot tableSnapshot) {
if(tableSnapshot != null) {
Log.d("StorageRef", "Table Name: ... | [
"Retrieves",
"a",
"list",
"of",
"the",
"names",
"of",
"all",
"tables",
"created",
"by",
"the",
"user",
"s",
"subscription",
"."
] | train | https://github.com/realtime-framework/RealtimeStorage-Android/blob/05816a6b7a6dcc83f9e7400ac3048494dadca302/library/src/main/java/co/realtime/storage/StorageRef.java#L372-L379 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/convert/BitConverter.java | BitConverter.setState | public int setState(boolean bState, boolean bDisplayOption, int iMoveMode) {
"""
For binary fields, set the current state.
Sets the target bit to the state.
@param state The state to set this field.
@param bDisplayOption Display changed fields if true.
@param iMoveMode The move mode.
@return The error code (o... | java | public int setState(boolean bState, boolean bDisplayOption, int iMoveMode)
{
int iFieldValue = (int)this.getValue();
if (!m_bTrueIfMatch)
bState = !bState; // Do opposite operation
if (bState)
iFieldValue |= (1 << m_iBitNumber); // Set the bit
else
... | [
"public",
"int",
"setState",
"(",
"boolean",
"bState",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"int",
"iFieldValue",
"=",
"(",
"int",
")",
"this",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"!",
"m_bTrueIfMatch",
")",
"bState... | For binary fields, set the current state.
Sets the target bit to the state.
@param state The state to set this field.
@param bDisplayOption Display changed fields if true.
@param iMoveMode The move mode.
@return The error code (or NORMAL_RETURN). | [
"For",
"binary",
"fields",
"set",
"the",
"current",
"state",
".",
"Sets",
"the",
"target",
"bit",
"to",
"the",
"state",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/convert/BitConverter.java#L122-L132 |
grails/grails-gdoc-engine | src/main/java/org/radeox/macro/Preserved.java | Preserved.addSpecial | protected void addSpecial(String c, String replacement) {
"""
Add a replacement for the special character c which may be a string
@param c the character to replace
@param replacement the new string
"""
specialString += c;
special.put(c, replacement);
} | java | protected void addSpecial(String c, String replacement) {
specialString += c;
special.put(c, replacement);
} | [
"protected",
"void",
"addSpecial",
"(",
"String",
"c",
",",
"String",
"replacement",
")",
"{",
"specialString",
"+=",
"c",
";",
"special",
".",
"put",
"(",
"c",
",",
"replacement",
")",
";",
"}"
] | Add a replacement for the special character c which may be a string
@param c the character to replace
@param replacement the new string | [
"Add",
"a",
"replacement",
"for",
"the",
"special",
"character",
"c",
"which",
"may",
"be",
"a",
"string"
] | train | https://github.com/grails/grails-gdoc-engine/blob/e52aa09eaa61510dc48b27603bd9ea116cd6531a/src/main/java/org/radeox/macro/Preserved.java#L53-L56 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XNodeSet.java | XNodeSet.notEquals | public boolean notEquals(XObject obj2) throws javax.xml.transform.TransformerException {
"""
Tell if two objects are functionally not equal.
@param obj2 object to compare this nodeset to
@return see this.compare(...)
@throws javax.xml.transform.TransformerException
"""
return compare(obj2, S_NEQ);... | java | public boolean notEquals(XObject obj2) throws javax.xml.transform.TransformerException
{
return compare(obj2, S_NEQ);
} | [
"public",
"boolean",
"notEquals",
"(",
"XObject",
"obj2",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"return",
"compare",
"(",
"obj2",
",",
"S_NEQ",
")",
";",
"}"
] | Tell if two objects are functionally not equal.
@param obj2 object to compare this nodeset to
@return see this.compare(...)
@throws javax.xml.transform.TransformerException | [
"Tell",
"if",
"two",
"objects",
"are",
"functionally",
"not",
"equal",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XNodeSet.java#L722-L725 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/trees/SemanticHeadFinder.java | SemanticHeadFinder.ruleChanges | private void ruleChanges() {
"""
makes modifications of Collins' rules to better fit with semantic notions of heads
"""
// NP: don't want a POS to be the head
nonTerminalInfo.put("NP", new String[][]{{"rightdis", "NN", "NNP", "NNPS", "NNS", "NX", "NML", "JJR"}, {"left", "NP", "PRP"}, {"rightdis", "$... | java | private void ruleChanges() {
// NP: don't want a POS to be the head
nonTerminalInfo.put("NP", new String[][]{{"rightdis", "NN", "NNP", "NNPS", "NNS", "NX", "NML", "JJR"}, {"left", "NP", "PRP"}, {"rightdis", "$", "ADJP", "FW"}, {"right", "CD"}, {"rightdis", "JJ", "JJS", "QP", "DT", "WDT", "NML", "PRN", "RB", ... | [
"private",
"void",
"ruleChanges",
"(",
")",
"{",
"// NP: don't want a POS to be the head\r",
"nonTerminalInfo",
".",
"put",
"(",
"\"NP\"",
",",
"new",
"String",
"[",
"]",
"[",
"]",
"{",
"{",
"\"rightdis\"",
",",
"\"NN\"",
",",
"\"NNP\"",
",",
"\"NNPS\"",
",",... | makes modifications of Collins' rules to better fit with semantic notions of heads | [
"makes",
"modifications",
"of",
"Collins",
"rules",
"to",
"better",
"fit",
"with",
"semantic",
"notions",
"of",
"heads"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/SemanticHeadFinder.java#L110-L151 |
Talend/tesb-rt-se | locator/src/main/java/org/talend/esb/servicelocator/client/SLPropertiesImpl.java | SLPropertiesImpl.addProperty | public void addProperty(String name, String... values) {
"""
Add a property with the given name and the given list of values to this Properties object. Name
and values are trimmed before the property is added.
@param name the name of the property, must not be <code>null</code>.
@param values the values of the... | java | public void addProperty(String name, String... values) {
List<String> valueList = new ArrayList<String>();
for (String value : values) {
valueList.add(value.trim());
}
properties.put(name.trim(), valueList);
} | [
"public",
"void",
"addProperty",
"(",
"String",
"name",
",",
"String",
"...",
"values",
")",
"{",
"List",
"<",
"String",
">",
"valueList",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"String",
"value",
":",
"values",
")",
... | Add a property with the given name and the given list of values to this Properties object. Name
and values are trimmed before the property is added.
@param name the name of the property, must not be <code>null</code>.
@param values the values of the property, must no be <code>null</code>,
none of the values must be <... | [
"Add",
"a",
"property",
"with",
"the",
"given",
"name",
"and",
"the",
"given",
"list",
"of",
"values",
"to",
"this",
"Properties",
"object",
".",
"Name",
"and",
"values",
"are",
"trimmed",
"before",
"the",
"property",
"is",
"added",
"."
] | train | https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/locator/src/main/java/org/talend/esb/servicelocator/client/SLPropertiesImpl.java#L52-L58 |
google/j2objc | jre_emul/android/platform/external/mockwebserver/src/main/java/com/google/mockwebserver/MockResponse.java | MockResponse.setChunkedBody | public MockResponse setChunkedBody(byte[] body, int maxChunkSize) {
"""
Sets the response body to {@code body}, chunked every {@code
maxChunkSize} bytes.
"""
removeHeader("Content-Length");
headers.add(CHUNKED_BODY_HEADER);
try {
ByteArrayOutputStream bytesOut = new ByteAr... | java | public MockResponse setChunkedBody(byte[] body, int maxChunkSize) {
removeHeader("Content-Length");
headers.add(CHUNKED_BODY_HEADER);
try {
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
int pos = 0;
while (pos < body.length) {
... | [
"public",
"MockResponse",
"setChunkedBody",
"(",
"byte",
"[",
"]",
"body",
",",
"int",
"maxChunkSize",
")",
"{",
"removeHeader",
"(",
"\"Content-Length\"",
")",
";",
"headers",
".",
"add",
"(",
"CHUNKED_BODY_HEADER",
")",
";",
"try",
"{",
"ByteArrayOutputStream"... | Sets the response body to {@code body}, chunked every {@code
maxChunkSize} bytes. | [
"Sets",
"the",
"response",
"body",
"to",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/mockwebserver/src/main/java/com/google/mockwebserver/MockResponse.java#L186-L208 |
googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/compute/v1/ComputeExample.java | ComputeExample.insertAddressUsingCallable | private static void insertAddressUsingCallable(AddressClient client, String newAddressName)
throws InterruptedException, ExecutionException {
"""
Use an callable object to make an addresses.insert method call.
"""
// Begin samplegen code for insertAddress().
ProjectRegionName region = ProjectRegi... | java | private static void insertAddressUsingCallable(AddressClient client, String newAddressName)
throws InterruptedException, ExecutionException {
// Begin samplegen code for insertAddress().
ProjectRegionName region = ProjectRegionName.of(PROJECT_NAME, REGION);
Address address = Address.newBuilder().build... | [
"private",
"static",
"void",
"insertAddressUsingCallable",
"(",
"AddressClient",
"client",
",",
"String",
"newAddressName",
")",
"throws",
"InterruptedException",
",",
"ExecutionException",
"{",
"// Begin samplegen code for insertAddress().",
"ProjectRegionName",
"region",
"=",... | Use an callable object to make an addresses.insert method call. | [
"Use",
"an",
"callable",
"object",
"to",
"make",
"an",
"addresses",
".",
"insert",
"method",
"call",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/compute/v1/ComputeExample.java#L103-L119 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java | PersonGroupPersonsImpl.getFaceAsync | public Observable<PersistedFace> getFaceAsync(String personGroupId, UUID personId, UUID persistedFaceId) {
"""
Retrieve information about a persisted face (specified by persistedFaceId, personId and its belonging personGroupId).
@param personGroupId Id referencing a particular person group.
@param personId Id ... | java | public Observable<PersistedFace> getFaceAsync(String personGroupId, UUID personId, UUID persistedFaceId) {
return getFaceWithServiceResponseAsync(personGroupId, personId, persistedFaceId).map(new Func1<ServiceResponse<PersistedFace>, PersistedFace>() {
@Override
public PersistedFace call... | [
"public",
"Observable",
"<",
"PersistedFace",
">",
"getFaceAsync",
"(",
"String",
"personGroupId",
",",
"UUID",
"personId",
",",
"UUID",
"persistedFaceId",
")",
"{",
"return",
"getFaceWithServiceResponseAsync",
"(",
"personGroupId",
",",
"personId",
",",
"persistedFac... | Retrieve information about a persisted face (specified by persistedFaceId, personId and its belonging personGroupId).
@param personGroupId Id referencing a particular person group.
@param personId Id referencing a particular person.
@param persistedFaceId Id referencing a particular persistedFaceId of an existing face... | [
"Retrieve",
"information",
"about",
"a",
"persisted",
"face",
"(",
"specified",
"by",
"persistedFaceId",
"personId",
"and",
"its",
"belonging",
"personGroupId",
")",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java#L917-L924 |
craftercms/deployer | src/main/java/org/craftercms/deployer/utils/ConfigUtils.java | ConfigUtils.getLongProperty | public static Long getLongProperty(Configuration config, String key) throws DeployerConfigurationException {
"""
Returns the specified Long property from the configuration
@param config the configuration
@param key the key of the property
@return the Long value of the property, or null if not found
@throw... | java | public static Long getLongProperty(Configuration config, String key) throws DeployerConfigurationException {
return getLongProperty(config, key, null);
} | [
"public",
"static",
"Long",
"getLongProperty",
"(",
"Configuration",
"config",
",",
"String",
"key",
")",
"throws",
"DeployerConfigurationException",
"{",
"return",
"getLongProperty",
"(",
"config",
",",
"key",
",",
"null",
")",
";",
"}"
] | Returns the specified Long property from the configuration
@param config the configuration
@param key the key of the property
@return the Long value of the property, or null if not found
@throws DeployerConfigurationException if an error occurred | [
"Returns",
"the",
"specified",
"Long",
"property",
"from",
"the",
"configuration"
] | train | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/utils/ConfigUtils.java#L200-L202 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/util/TreeUtil.java | TreeUtil.compare | private static int compare(Treenode item1, Treenode item2) {
"""
Case insensitive comparison of labels of two tree items.
@param item1 First tree item.
@param item2 Second tree item.
@return Result of the comparison.
"""
String label1 = item1.getLabel();
String label2 = item2.getLabel();
... | java | private static int compare(Treenode item1, Treenode item2) {
String label1 = item1.getLabel();
String label2 = item2.getLabel();
return label1 == label2 ? 0 : label1 == null ? -1 : label2 == null ? -1 : label1.compareToIgnoreCase(label2);
} | [
"private",
"static",
"int",
"compare",
"(",
"Treenode",
"item1",
",",
"Treenode",
"item2",
")",
"{",
"String",
"label1",
"=",
"item1",
".",
"getLabel",
"(",
")",
";",
"String",
"label2",
"=",
"item2",
".",
"getLabel",
"(",
")",
";",
"return",
"label1",
... | Case insensitive comparison of labels of two tree items.
@param item1 First tree item.
@param item2 Second tree item.
@return Result of the comparison. | [
"Case",
"insensitive",
"comparison",
"of",
"labels",
"of",
"two",
"tree",
"items",
"."
] | 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#L258-L262 |
ixa-ehu/ixa-pipe-ml | src/main/java/eus/ixa/ixa/pipe/ml/parse/Parse.java | Parse.setChild | public void setChild(final int index, final String label) {
"""
Replaces the child at the specified index with a new child with the
specified label.
@param index
The index of the child to be replaced.
@param label
The label to be assigned to the new child.
"""
final Parse newChild = (Parse) this.par... | java | public void setChild(final int index, final String label) {
final Parse newChild = (Parse) this.parts.get(index).clone();
newChild.setLabel(label);
this.parts.set(index, newChild);
} | [
"public",
"void",
"setChild",
"(",
"final",
"int",
"index",
",",
"final",
"String",
"label",
")",
"{",
"final",
"Parse",
"newChild",
"=",
"(",
"Parse",
")",
"this",
".",
"parts",
".",
"get",
"(",
"index",
")",
".",
"clone",
"(",
")",
";",
"newChild",... | Replaces the child at the specified index with a new child with the
specified label.
@param index
The index of the child to be replaced.
@param label
The label to be assigned to the new child. | [
"Replaces",
"the",
"child",
"at",
"the",
"specified",
"index",
"with",
"a",
"new",
"child",
"with",
"the",
"specified",
"label",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/parse/Parse.java#L542-L546 |
thymeleaf/thymeleaf-spring | thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/util/SpringValueFormatter.java | SpringValueFormatter.getDisplayString | public static String getDisplayString(final Object value, final boolean htmlEscape) {
"""
/*
NOTE This code is based on org.springframework.web.servlet.tags.form.ValueFormatter as of Spring 5.0.0
Original license is Apache License 2.0, which is the same as the license for this file.
Original copyright notice is... | java | public static String getDisplayString(final Object value, final boolean htmlEscape) {
final String displayValue = ObjectUtils.getDisplayString(value);
return (htmlEscape ? HtmlUtils.htmlEscape(displayValue) : displayValue);
} | [
"public",
"static",
"String",
"getDisplayString",
"(",
"final",
"Object",
"value",
",",
"final",
"boolean",
"htmlEscape",
")",
"{",
"final",
"String",
"displayValue",
"=",
"ObjectUtils",
".",
"getDisplayString",
"(",
"value",
")",
";",
"return",
"(",
"htmlEscape... | /*
NOTE This code is based on org.springframework.web.servlet.tags.form.ValueFormatter as of Spring 5.0.0
Original license is Apache License 2.0, which is the same as the license for this file.
Original copyright notice is "Copyright 2002-2012 the original author or authors".
Original authors are Rob Harrop and Juergen... | [
"/",
"*",
"NOTE",
"This",
"code",
"is",
"based",
"on",
"org",
".",
"springframework",
".",
"web",
".",
"servlet",
".",
"tags",
".",
"form",
".",
"ValueFormatter",
"as",
"of",
"Spring",
"5",
".",
"0",
".",
"0",
"Original",
"license",
"is",
"Apache",
"... | train | https://github.com/thymeleaf/thymeleaf-spring/blob/9aa15a19017a0938e57646e3deefb8a90ab78dcb/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/util/SpringValueFormatter.java#L50-L53 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java | ValueEnforcer.notNullAndEquals | public static <T> T notNullAndEquals (final T aValue, final String sName, @Nonnull final T aExpectedValue) {
"""
Check that the passed value is not <code>null</code> and equal to the
provided expected value.
@param <T>
Type to be checked and returned
@param aValue
The value to check.
@param sName
The name... | java | public static <T> T notNullAndEquals (final T aValue, final String sName, @Nonnull final T aExpectedValue)
{
if (isEnabled ())
return notNullAndEquals (aValue, () -> sName, aExpectedValue);
return aValue;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"notNullAndEquals",
"(",
"final",
"T",
"aValue",
",",
"final",
"String",
"sName",
",",
"@",
"Nonnull",
"final",
"T",
"aExpectedValue",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
")",
"return",
"notNullAndEquals",
... | Check that the passed value is not <code>null</code> and equal to the
provided expected value.
@param <T>
Type to be checked and returned
@param aValue
The value to check.
@param sName
The name of the value (e.g. the parameter name)
@param aExpectedValue
The expected value. May not be <code>null</code>.
@return The pa... | [
"Check",
"that",
"the",
"passed",
"value",
"is",
"not",
"<code",
">",
"null<",
"/",
"code",
">",
"and",
"equal",
"to",
"the",
"provided",
"expected",
"value",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java#L1370-L1375 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceIndividualGroupService.java | ReferenceIndividualGroupService.findLocalMemberGroups | protected Iterator findLocalMemberGroups(IEntityGroup eg) throws GroupsException {
"""
Returns and caches the member groups for the <code>IEntityGroup</code>
@param eg IEntityGroup
"""
Collection groups = new ArrayList(10);
IEntityGroup group = null;
for (Iterator it = getGroupStore(... | java | protected Iterator findLocalMemberGroups(IEntityGroup eg) throws GroupsException {
Collection groups = new ArrayList(10);
IEntityGroup group = null;
for (Iterator it = getGroupStore().findMemberGroups(eg); it.hasNext(); ) {
group = (IEntityGroup) it.next();
if (group == n... | [
"protected",
"Iterator",
"findLocalMemberGroups",
"(",
"IEntityGroup",
"eg",
")",
"throws",
"GroupsException",
"{",
"Collection",
"groups",
"=",
"new",
"ArrayList",
"(",
"10",
")",
";",
"IEntityGroup",
"group",
"=",
"null",
";",
"for",
"(",
"Iterator",
"it",
"... | Returns and caches the member groups for the <code>IEntityGroup</code>
@param eg IEntityGroup | [
"Returns",
"and",
"caches",
"the",
"member",
"groups",
"for",
"the",
"<code",
">",
"IEntityGroup<",
"/",
"code",
">"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceIndividualGroupService.java#L268-L291 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/filter/DependentFileFilter.java | DependentFileFilter.init | public void init(Record record, String thisFileFieldName, BaseField fldThisFile, String thisFileFieldName2, BaseField fldThisFile2, String thisFileFieldName3, BaseField fldThisFile3) {
"""
Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()).
@param iFieldSeq The Fir... | java | public void init(Record record, String thisFileFieldName, BaseField fldThisFile, String thisFileFieldName2, BaseField fldThisFile2, String thisFileFieldName3, BaseField fldThisFile3)
{
super.init(record);
this.thisFileFieldName = thisFileFieldName;
m_fldThisFile = fldThisFile;
this.t... | [
"public",
"void",
"init",
"(",
"Record",
"record",
",",
"String",
"thisFileFieldName",
",",
"BaseField",
"fldThisFile",
",",
"String",
"thisFileFieldName2",
",",
"BaseField",
"fldThisFile2",
",",
"String",
"thisFileFieldName3",
",",
"BaseField",
"fldThisFile3",
")",
... | Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()).
@param iFieldSeq The First field sequence of the key.
@param fldThisFile The first field
@param iFieldSeq2 The Second field sequence of the key (-1 for none).
@param fldThisFile2 The second field
@param iFieldSeq3 The Th... | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/filter/DependentFileFilter.java#L68-L79 |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/conditions/Conditions.java | Conditions.betweenExclusiveMin | public static Between betweenExclusiveMin( String property, int minimum, int maximum) {
"""
Returns a {@link ICondition condition} that is satisfied by a {@link org.cornutum.tcases.PropertySet} that contains
between a specified minimum (exclusive) and maximum (inclusive) number of instances of a property.
"""... | java | public static Between betweenExclusiveMin( String property, int minimum, int maximum)
{
return new Between( moreThan( property, minimum), notMoreThan( property, maximum));
} | [
"public",
"static",
"Between",
"betweenExclusiveMin",
"(",
"String",
"property",
",",
"int",
"minimum",
",",
"int",
"maximum",
")",
"{",
"return",
"new",
"Between",
"(",
"moreThan",
"(",
"property",
",",
"minimum",
")",
",",
"notMoreThan",
"(",
"property",
"... | Returns a {@link ICondition condition} that is satisfied by a {@link org.cornutum.tcases.PropertySet} that contains
between a specified minimum (exclusive) and maximum (inclusive) number of instances of a property. | [
"Returns",
"a",
"{"
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/conditions/Conditions.java#L154-L157 |
SeleniumHQ/fluent-selenium | java/src/main/java/org/seleniumhq/selenium/fluent/FluentSelect.java | FluentSelect.selectByVisibleText | public FluentSelect selectByVisibleText(final String text) {
"""
<p>
Select all options that display text matching the argument. That is, when given "Bar" this
would select an option like:
</p>
<option value="foo">Bar</option>
@param text The visible text to match against
"""
execute... | java | public FluentSelect selectByVisibleText(final String text) {
executeAndWrapReThrowIfNeeded(new SelectByVisibleText(text), Context.singular(context, "selectByVisibleText", null, text), true);
return new FluentSelect(super.delegate, currentElement.getFound(), this.context, monitor, booleanInsteadOfNotFoun... | [
"public",
"FluentSelect",
"selectByVisibleText",
"(",
"final",
"String",
"text",
")",
"{",
"executeAndWrapReThrowIfNeeded",
"(",
"new",
"SelectByVisibleText",
"(",
"text",
")",
",",
"Context",
".",
"singular",
"(",
"context",
",",
"\"selectByVisibleText\"",
",",
"nu... | <p>
Select all options that display text matching the argument. That is, when given "Bar" this
would select an option like:
</p>
<option value="foo">Bar</option>
@param text The visible text to match against | [
"<p",
">",
"Select",
"all",
"options",
"that",
"display",
"text",
"matching",
"the",
"argument",
".",
"That",
"is",
"when",
"given",
"Bar",
"this",
"would",
"select",
"an",
"option",
"like",
":",
"<",
"/",
"p",
">",
"<",
";",
"option",
"value",
"=",
... | train | https://github.com/SeleniumHQ/fluent-selenium/blob/fcb171471a7d1abb2800bcbca21b3ae3e6c12472/java/src/main/java/org/seleniumhq/selenium/fluent/FluentSelect.java#L88-L91 |
rpau/javalang | src/main/java/org/walkmod/javalang/actions/ReplaceAction.java | ReplaceAction.getText | public String getText(String indentation, char indentationChar) {
"""
Returns the new text to insert with the appropriate indentation and comments
@param indentation
the existing indentation at the file. It never should be null and it is needed for
files that mix tabs and spaces in the same line.
@param inde... | java | public String getText(String indentation, char indentationChar) {
newCode = FormatterHelper.indent(
newNode.getPrettySource(indentationChar, indentationLevel, indentationSize, acceptedComments),
indentation, indentationChar, indentationLevel, indentationSize, requiresExtraIndent... | [
"public",
"String",
"getText",
"(",
"String",
"indentation",
",",
"char",
"indentationChar",
")",
"{",
"newCode",
"=",
"FormatterHelper",
".",
"indent",
"(",
"newNode",
".",
"getPrettySource",
"(",
"indentationChar",
",",
"indentationLevel",
",",
"indentationSize",
... | Returns the new text to insert with the appropriate indentation and comments
@param indentation
the existing indentation at the file. It never should be null and it is needed for
files that mix tabs and spaces in the same line.
@param indentationChar
the used indentation char (' ', or '\t')
@return the new text that r... | [
"Returns",
"the",
"new",
"text",
"to",
"insert",
"with",
"the",
"appropriate",
"indentation",
"and",
"comments"
] | train | https://github.com/rpau/javalang/blob/17ab1d6cbe7527a2f272049c4958354328de2171/src/main/java/org/walkmod/javalang/actions/ReplaceAction.java#L105-L112 |
nightcode/yaranga | core/src/org/nightcode/common/base/Hexs.java | Hexs.fromByteArray | public String fromByteArray(byte[] bytes, int offset, int length) {
"""
Returns a hexadecimal string representation of {@code length} bytes of {@code bytes}
starting at offset {@code offset}.
@param bytes a bytes to convert
@param offset start offset in the bytes
@param length maximum number of bytes to use
... | java | public String fromByteArray(byte[] bytes, int offset, int length) {
java.util.Objects.requireNonNull(bytes, "bytes");
Objects.validArgument(offset >= 0, "offset must be equal or greater than zero");
Objects.validArgument(length > 0, "length must be greater than zero");
Objects.validArgument(offset + len... | [
"public",
"String",
"fromByteArray",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"java",
".",
"util",
".",
"Objects",
".",
"requireNonNull",
"(",
"bytes",
",",
"\"bytes\"",
")",
";",
"Objects",
".",
"validArgumen... | Returns a hexadecimal string representation of {@code length} bytes of {@code bytes}
starting at offset {@code offset}.
@param bytes a bytes to convert
@param offset start offset in the bytes
@param length maximum number of bytes to use
@return a hexadecimal string representation of each bytes of {@code bytes} | [
"Returns",
"a",
"hexadecimal",
"string",
"representation",
"of",
"{",
"@code",
"length",
"}",
"bytes",
"of",
"{",
"@code",
"bytes",
"}",
"starting",
"at",
"offset",
"{",
"@code",
"offset",
"}",
"."
] | train | https://github.com/nightcode/yaranga/blob/f02cf8d8bcd365b6b1d55638938631a00e9ee808/core/src/org/nightcode/common/base/Hexs.java#L78-L89 |
twitter/cloudhopper-commons | ch-commons-xbean/src/main/java/com/cloudhopper/commons/xbean/util/PropertiesReplacementUtil.java | PropertiesReplacementUtil.replaceProperties | static public InputStream replaceProperties(InputStream source, Properties props, String startStr, String endStr) throws IOException, SubstitutionException {
"""
Creates an InputStream containing the document resulting from replacing template
parameters in the given InputStream source.
@param source The source s... | java | static public InputStream replaceProperties(InputStream source, Properties props, String startStr, String endStr) throws IOException, SubstitutionException {
String template = streamToString(source);
String replaced = StringUtil.substituteWithProperties(template, startStr, endStr, props);
System.err.println(template... | [
"static",
"public",
"InputStream",
"replaceProperties",
"(",
"InputStream",
"source",
",",
"Properties",
"props",
",",
"String",
"startStr",
",",
"String",
"endStr",
")",
"throws",
"IOException",
",",
"SubstitutionException",
"{",
"String",
"template",
"=",
"streamT... | Creates an InputStream containing the document resulting from replacing template
parameters in the given InputStream source.
@param source The source stream
@param props The properties
@param startStr The String that marks the start of a replacement key such as "${"
@param endStr The String that marks the end of a repl... | [
"Creates",
"an",
"InputStream",
"containing",
"the",
"document",
"resulting",
"from",
"replacing",
"template",
"parameters",
"in",
"the",
"given",
"InputStream",
"source",
"."
] | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-xbean/src/main/java/com/cloudhopper/commons/xbean/util/PropertiesReplacementUtil.java#L123-L129 |
Impetus/Kundera | src/kundera-rethinkdb/src/main/java/com/impetus/client/rethink/RethinkDBClient.java | RethinkDBClient.iterateAndPopulateRmap | private MapObject iterateAndPopulateRmap(Object entity, MetamodelImpl metaModel, Iterator<Attribute> iterator) {
"""
Iterate and populate rmap.
@param entity
the entity
@param metaModel
the meta model
@param iterator
the iterator
@return the map object
"""
MapObject map = r.hashMap();
... | java | private MapObject iterateAndPopulateRmap(Object entity, MetamodelImpl metaModel, Iterator<Attribute> iterator)
{
MapObject map = r.hashMap();
while (iterator.hasNext())
{
Attribute attribute = iterator.next();
Field field = (Field) attribute.getJavaMember();
... | [
"private",
"MapObject",
"iterateAndPopulateRmap",
"(",
"Object",
"entity",
",",
"MetamodelImpl",
"metaModel",
",",
"Iterator",
"<",
"Attribute",
">",
"iterator",
")",
"{",
"MapObject",
"map",
"=",
"r",
".",
"hashMap",
"(",
")",
";",
"while",
"(",
"iterator",
... | Iterate and populate rmap.
@param entity
the entity
@param metaModel
the meta model
@param iterator
the iterator
@return the map object | [
"Iterate",
"and",
"populate",
"rmap",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-rethinkdb/src/main/java/com/impetus/client/rethink/RethinkDBClient.java#L347-L365 |
Azure/azure-sdk-for-java | cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java | DatabaseAccountsInner.beginOnlineRegionAsync | public Observable<Void> beginOnlineRegionAsync(String resourceGroupName, String accountName, String region) {
"""
Online the specified region for the specified Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param... | java | public Observable<Void> beginOnlineRegionAsync(String resourceGroupName, String accountName, String region) {
return beginOnlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse... | [
"public",
"Observable",
"<",
"Void",
">",
"beginOnlineRegionAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"region",
")",
"{",
"return",
"beginOnlineRegionWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
... | Online the specified region for the specified Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param region Cosmos DB region, with spaces between words and each word capitalized.
@throws IllegalArgumentException thrown if p... | [
"Online",
"the",
"specified",
"region",
"for",
"the",
"specified",
"Azure",
"Cosmos",
"DB",
"database",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java#L1560-L1567 |
LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/io/gzarc/GZIPIndexer.java | GZIPIndexer.index | public static LongBigArrayBigList index(final InputStream in, final ProgressLogger pl) throws IOException {
"""
Returns a list of pointers to a GZIP archive entries positions (including the end of file).
@param in the stream from which to read the GZIP archive.
@param pl a progress logger.
@return a list of l... | java | public static LongBigArrayBigList index(final InputStream in, final ProgressLogger pl) throws IOException {
final LongBigArrayBigList pointers = new LongBigArrayBigList();
long current = 0;
final GZIPArchiveReader gzar = new GZIPArchiveReader(in);
GZIPArchive.ReadEntry re;
for (;;) {
re = gzar.skipEntry();... | [
"public",
"static",
"LongBigArrayBigList",
"index",
"(",
"final",
"InputStream",
"in",
",",
"final",
"ProgressLogger",
"pl",
")",
"throws",
"IOException",
"{",
"final",
"LongBigArrayBigList",
"pointers",
"=",
"new",
"LongBigArrayBigList",
"(",
")",
";",
"long",
"c... | Returns a list of pointers to a GZIP archive entries positions (including the end of file).
@param in the stream from which to read the GZIP archive.
@param pl a progress logger.
@return a list of longs where the <em>i</em>-th long is the offset in the stream of the first byte of the <em>i</em>-th archive entry. | [
"Returns",
"a",
"list",
"of",
"pointers",
"to",
"a",
"GZIP",
"archive",
"entries",
"positions",
"(",
"including",
"the",
"end",
"of",
"file",
")",
"."
] | train | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/io/gzarc/GZIPIndexer.java#L62-L76 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java | ContentSpecParser.createEmptyLevelFromType | protected Level createEmptyLevelFromType(final int lineNumber, final LevelType levelType, final String input) {
"""
Creates an empty Level using the LevelType to determine which Level subclass to instantiate.
@param lineNumber The line number of the level.
@param levelType The Level Type.
@param input T... | java | protected Level createEmptyLevelFromType(final int lineNumber, final LevelType levelType, final String input) {
// Create the level based on the type
switch (levelType) {
case APPENDIX:
return new Appendix(null, lineNumber, input);
case CHAPTER:
re... | [
"protected",
"Level",
"createEmptyLevelFromType",
"(",
"final",
"int",
"lineNumber",
",",
"final",
"LevelType",
"levelType",
",",
"final",
"String",
"input",
")",
"{",
"// Create the level based on the type",
"switch",
"(",
"levelType",
")",
"{",
"case",
"APPENDIX",
... | Creates an empty Level using the LevelType to determine which Level subclass to instantiate.
@param lineNumber The line number of the level.
@param levelType The Level Type.
@param input The string that represents the level, if one exists,
@return The empty Level subclass object, or a plain Level object if no ty... | [
"Creates",
"an",
"empty",
"Level",
"using",
"the",
"LevelType",
"to",
"determine",
"which",
"Level",
"subclass",
"to",
"instantiate",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java#L1243-L1261 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxFile.java | BoxFile.uploadNewVersion | public BoxFile.Info uploadNewVersion(InputStream fileContent, String fileContentSHA1) {
"""
Uploads a new version of this file, replacing the current version. Note that only users with premium accounts
will be able to view and recover previous versions of the file.
@param fileContent a stream containing th... | java | public BoxFile.Info uploadNewVersion(InputStream fileContent, String fileContentSHA1) {
return this.uploadNewVersion(fileContent, fileContentSHA1, null);
} | [
"public",
"BoxFile",
".",
"Info",
"uploadNewVersion",
"(",
"InputStream",
"fileContent",
",",
"String",
"fileContentSHA1",
")",
"{",
"return",
"this",
".",
"uploadNewVersion",
"(",
"fileContent",
",",
"fileContentSHA1",
",",
"null",
")",
";",
"}"
] | Uploads a new version of this file, replacing the current version. Note that only users with premium accounts
will be able to view and recover previous versions of the file.
@param fileContent a stream containing the new file contents.
@param fileContentSHA1 a string containing the SHA1 hash of the new file conten... | [
"Uploads",
"a",
"new",
"version",
"of",
"this",
"file",
"replacing",
"the",
"current",
"version",
".",
"Note",
"that",
"only",
"users",
"with",
"premium",
"accounts",
"will",
"be",
"able",
"to",
"view",
"and",
"recover",
"previous",
"versions",
"of",
"the",
... | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFile.java#L810-L812 |
guardtime/ksi-java-sdk | ksi-service-client/src/main/java/com/guardtime/ksi/pdu/v1/AbstractKSIRequest.java | AbstractKSIRequest.calculateMac | protected DataHash calculateMac() throws KSIException {
"""
Calculates the MAC based on header and payload TLVs.
@return Calculated data hash.
@throws KSIException
if HMAC generation fails.
"""
try {
HashAlgorithm algorithm = HashAlgorithm.getByName("DEFAULT");
algorithm.ch... | java | protected DataHash calculateMac() throws KSIException {
try {
HashAlgorithm algorithm = HashAlgorithm.getByName("DEFAULT");
algorithm.checkExpiration();
return new DataHash(algorithm, Util.calculateHMAC(getContent(), this.loginKey, algorithm.getName()));
} catch (IOEx... | [
"protected",
"DataHash",
"calculateMac",
"(",
")",
"throws",
"KSIException",
"{",
"try",
"{",
"HashAlgorithm",
"algorithm",
"=",
"HashAlgorithm",
".",
"getByName",
"(",
"\"DEFAULT\"",
")",
";",
"algorithm",
".",
"checkExpiration",
"(",
")",
";",
"return",
"new",... | Calculates the MAC based on header and payload TLVs.
@return Calculated data hash.
@throws KSIException
if HMAC generation fails. | [
"Calculates",
"the",
"MAC",
"based",
"on",
"header",
"and",
"payload",
"TLVs",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-service-client/src/main/java/com/guardtime/ksi/pdu/v1/AbstractKSIRequest.java#L132-L148 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/utils/MpJwtAppSetupUtils.java | MpJwtAppSetupUtils.genericCreateArchiveWithoutJsps | public WebArchive genericCreateArchiveWithoutJsps(String baseWarName, List<String> classList) throws Exception {
"""
Create a new war with "standard" content for tests using these utils.
Finally add the classes that are specific to this war (they come from the classList passed in)
@param baseWarName - the base... | java | public WebArchive genericCreateArchiveWithoutJsps(String baseWarName, List<String> classList) throws Exception {
try {
String warName = getWarName(baseWarName);
WebArchive newWar = ShrinkWrap.create(WebArchive.class, warName);
addDefaultFileAssetsForAppsToWar(warName, newWar)... | [
"public",
"WebArchive",
"genericCreateArchiveWithoutJsps",
"(",
"String",
"baseWarName",
",",
"List",
"<",
"String",
">",
"classList",
")",
"throws",
"Exception",
"{",
"try",
"{",
"String",
"warName",
"=",
"getWarName",
"(",
"baseWarName",
")",
";",
"WebArchive",
... | Create a new war with "standard" content for tests using these utils.
Finally add the classes that are specific to this war (they come from the classList passed in)
@param baseWarName - the base name of the war
@param classList - the list of classes specific to this war
@return - the generated war
@throws Exception | [
"Create",
"a",
"new",
"war",
"with",
"standard",
"content",
"for",
"tests",
"using",
"these",
"utils",
".",
"Finally",
"add",
"the",
"classes",
"that",
"are",
"specific",
"to",
"this",
"war",
"(",
"they",
"come",
"from",
"the",
"classList",
"passed",
"in",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/utils/MpJwtAppSetupUtils.java#L254-L267 |
Squarespace/cldr | core/src/main/java/com/squarespace/cldr/numbers/NumberFormatContext.java | NumberFormatContext.setPattern | public void setPattern(NumberPattern pattern, int _maxSigDigits, int _minSigDigits) {
"""
Set the pattern and initialize parameters based on the arguments, pattern and options settings.
"""
Format format = pattern.format();
minIntDigits = orDefault(options.minimumIntegerDigits(), format.minimumIntegerD... | java | public void setPattern(NumberPattern pattern, int _maxSigDigits, int _minSigDigits) {
Format format = pattern.format();
minIntDigits = orDefault(options.minimumIntegerDigits(), format.minimumIntegerDigits());
maxFracDigits = currencyDigits == -1 ? format.maximumFractionDigits() : currencyDigits;
maxFra... | [
"public",
"void",
"setPattern",
"(",
"NumberPattern",
"pattern",
",",
"int",
"_maxSigDigits",
",",
"int",
"_minSigDigits",
")",
"{",
"Format",
"format",
"=",
"pattern",
".",
"format",
"(",
")",
";",
"minIntDigits",
"=",
"orDefault",
"(",
"options",
".",
"min... | Set the pattern and initialize parameters based on the arguments, pattern and options settings. | [
"Set",
"the",
"pattern",
"and",
"initialize",
"parameters",
"based",
"on",
"the",
"arguments",
"pattern",
"and",
"options",
"settings",
"."
] | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/core/src/main/java/com/squarespace/cldr/numbers/NumberFormatContext.java#L54-L72 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java | FindBugs.configureTrainingDatabases | public static void configureTrainingDatabases(IFindBugsEngine findBugs) throws IOException {
"""
Configure training databases.
@param findBugs
the IFindBugsEngine to configure
@throws IOException
"""
if (findBugs.emitTrainingOutput()) {
String trainingOutputDir = findBugs.getTrainingOu... | java | public static void configureTrainingDatabases(IFindBugsEngine findBugs) throws IOException {
if (findBugs.emitTrainingOutput()) {
String trainingOutputDir = findBugs.getTrainingOutputDir();
if (!new File(trainingOutputDir).isDirectory()) {
throw new IOException("Training... | [
"public",
"static",
"void",
"configureTrainingDatabases",
"(",
"IFindBugsEngine",
"findBugs",
")",
"throws",
"IOException",
"{",
"if",
"(",
"findBugs",
".",
"emitTrainingOutput",
"(",
")",
")",
"{",
"String",
"trainingOutputDir",
"=",
"findBugs",
".",
"getTrainingOu... | Configure training databases.
@param findBugs
the IFindBugsEngine to configure
@throws IOException | [
"Configure",
"training",
"databases",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java#L218-L242 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.createImagesFromUrlsAsync | public Observable<ImageCreateSummary> createImagesFromUrlsAsync(UUID projectId, ImageUrlCreateBatch batch) {
"""
Add the provided images urls to the set of training images.
This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags.
@param projectId The p... | java | public Observable<ImageCreateSummary> createImagesFromUrlsAsync(UUID projectId, ImageUrlCreateBatch batch) {
return createImagesFromUrlsWithServiceResponseAsync(projectId, batch).map(new Func1<ServiceResponse<ImageCreateSummary>, ImageCreateSummary>() {
@Override
public ImageCreateSummar... | [
"public",
"Observable",
"<",
"ImageCreateSummary",
">",
"createImagesFromUrlsAsync",
"(",
"UUID",
"projectId",
",",
"ImageUrlCreateBatch",
"batch",
")",
"{",
"return",
"createImagesFromUrlsWithServiceResponseAsync",
"(",
"projectId",
",",
"batch",
")",
".",
"map",
"(",
... | Add the provided images urls to the set of training images.
This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags.
@param projectId The project id
@param batch Image urls and tag ids. Limited to 64 images and 20 tags per batch
@throws IllegalArgumentExceptio... | [
"Add",
"the",
"provided",
"images",
"urls",
"to",
"the",
"set",
"of",
"training",
"images",
".",
"This",
"API",
"accepts",
"a",
"batch",
"of",
"urls",
"and",
"optionally",
"tags",
"to",
"create",
"images",
".",
"There",
"is",
"a",
"limit",
"of",
"64",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L3867-L3874 |
census-instrumentation/opencensus-java | impl_core/src/main/java/io/opencensus/implcore/internal/VarInt.java | VarInt.putVarLong | public static void putVarLong(long v, ByteBuffer sink) {
"""
Encodes a long integer in a variable-length encoding, 7 bits per byte, to a ByteBuffer sink.
@param v the value to encode
@param sink the ByteBuffer to add the encoded value
"""
while (true) {
int bits = ((int) v) & 0x7f;
v >>>= 7... | java | public static void putVarLong(long v, ByteBuffer sink) {
while (true) {
int bits = ((int) v) & 0x7f;
v >>>= 7;
if (v == 0) {
sink.put((byte) bits);
return;
}
sink.put((byte) (bits | 0x80));
}
} | [
"public",
"static",
"void",
"putVarLong",
"(",
"long",
"v",
",",
"ByteBuffer",
"sink",
")",
"{",
"while",
"(",
"true",
")",
"{",
"int",
"bits",
"=",
"(",
"(",
"int",
")",
"v",
")",
"&",
"0x7f",
";",
"v",
">>>=",
"7",
";",
"if",
"(",
"v",
"==",
... | Encodes a long integer in a variable-length encoding, 7 bits per byte, to a ByteBuffer sink.
@param v the value to encode
@param sink the ByteBuffer to add the encoded value | [
"Encodes",
"a",
"long",
"integer",
"in",
"a",
"variable",
"-",
"length",
"encoding",
"7",
"bits",
"per",
"byte",
"to",
"a",
"ByteBuffer",
"sink",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/impl_core/src/main/java/io/opencensus/implcore/internal/VarInt.java#L272-L282 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.getBuildVariable | public GitlabBuildVariable getBuildVariable(Integer projectId, String key)
throws IOException {
"""
Gets build variable associated with a project and key.
@param projectId The ID of the project.
@param key The key of the variable.
@return A variable.
@throws IOException on gitlab api call e... | java | public GitlabBuildVariable getBuildVariable(Integer projectId, String key)
throws IOException {
String tailUrl = GitlabProject.URL + "/" +
projectId +
GitlabBuildVariable.URL + "/" +
key;
return retrieve().to(tailUrl, GitlabBuildVariable.class)... | [
"public",
"GitlabBuildVariable",
"getBuildVariable",
"(",
"Integer",
"projectId",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"String",
"tailUrl",
"=",
"GitlabProject",
".",
"URL",
"+",
"\"/\"",
"+",
"projectId",
"+",
"GitlabBuildVariable",
".",
"URL"... | Gets build variable associated with a project and key.
@param projectId The ID of the project.
@param key The key of the variable.
@return A variable.
@throws IOException on gitlab api call error | [
"Gets",
"build",
"variable",
"associated",
"with",
"a",
"project",
"and",
"key",
"."
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3645-L3652 |
aws/aws-sdk-java | aws-java-sdk-health/src/main/java/com/amazonaws/services/health/model/AffectedEntity.java | AffectedEntity.withTags | public AffectedEntity withTags(java.util.Map<String, String> tags) {
"""
<p>
A map of entity tags attached to the affected entity.
</p>
@param tags
A map of entity tags attached to the affected entity.
@return Returns a reference to this object so that method calls can be chained together.
"""
s... | java | public AffectedEntity withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"AffectedEntity",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map of entity tags attached to the affected entity.
</p>
@param tags
A map of entity tags attached to the affected entity.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"map",
"of",
"entity",
"tags",
"attached",
"to",
"the",
"affected",
"entity",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-health/src/main/java/com/amazonaws/services/health/model/AffectedEntity.java#L456-L459 |
joniles/mpxj | src/main/java/net/sf/mpxj/asta/TextFileRow.java | TextFileRow.getColumnValue | private Object getColumnValue(String table, String column, String data, int type, boolean epochDateFormat) throws MPXJException {
"""
Maps the text representation of column data to Java types.
@param table table name
@param column column name
@param data text representation of column data
@param type column ... | java | private Object getColumnValue(String table, String column, String data, int type, boolean epochDateFormat) throws MPXJException
{
try
{
Object value = null;
switch (type)
{
case Types.BIT:
{
value = DatatypeConverter.parseBoolean(data);
... | [
"private",
"Object",
"getColumnValue",
"(",
"String",
"table",
",",
"String",
"column",
",",
"String",
"data",
",",
"int",
"type",
",",
"boolean",
"epochDateFormat",
")",
"throws",
"MPXJException",
"{",
"try",
"{",
"Object",
"value",
"=",
"null",
";",
"switc... | Maps the text representation of column data to Java types.
@param table table name
@param column column name
@param data text representation of column data
@param type column data type
@param epochDateFormat true if date is represented as an offset from an epoch
@return Java representation of column data
@throws MPXJE... | [
"Maps",
"the",
"text",
"representation",
"of",
"column",
"data",
"to",
"Java",
"types",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/TextFileRow.java#L75-L140 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ResourceBundlesHandlerImpl.java | ResourceBundlesHandlerImpl.executeGlobalPreprocessing | private void executeGlobalPreprocessing(List<JoinableResourceBundle> bundlesToBuild, boolean processBundleFlag,
StopWatch stopWatch) {
"""
Executes the global preprocessing
@param bundlesToBuild
The list of bundles to rebuild
@param processBundleFlag
the flag indicating if the bundles needs to be proces... | java | private void executeGlobalPreprocessing(List<JoinableResourceBundle> bundlesToBuild, boolean processBundleFlag,
StopWatch stopWatch) {
stopProcessIfNeeded();
if (resourceTypePreprocessor != null) {
if (stopWatch != null) {
stopWatch.start("Global preprocessing");
}
GlobalPreprocessingContext ctx =... | [
"private",
"void",
"executeGlobalPreprocessing",
"(",
"List",
"<",
"JoinableResourceBundle",
">",
"bundlesToBuild",
",",
"boolean",
"processBundleFlag",
",",
"StopWatch",
"stopWatch",
")",
"{",
"stopProcessIfNeeded",
"(",
")",
";",
"if",
"(",
"resourceTypePreprocessor",... | Executes the global preprocessing
@param bundlesToBuild
The list of bundles to rebuild
@param processBundleFlag
the flag indicating if the bundles needs to be processed
@param stopWatch
the stopWatch | [
"Executes",
"the",
"global",
"preprocessing"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ResourceBundlesHandlerImpl.java#L732-L756 |
tuenti/ButtonMenu | library/src/main/java/com/tuenti/buttonmenu/animator/ScrollAnimator.java | ScrollAnimator.onScrollPositionChanged | private void onScrollPositionChanged(int oldScrollPosition, int newScrollPosition) {
"""
Perform the "translateY" animation using the new scroll position and the old scroll position to show or hide
the animated view.
@param oldScrollPosition
@param newScrollPosition
"""
int newScrollDirection;
if (ne... | java | private void onScrollPositionChanged(int oldScrollPosition, int newScrollPosition) {
int newScrollDirection;
if (newScrollPosition < oldScrollPosition) {
newScrollDirection = SCROLL_TO_TOP;
} else {
newScrollDirection = SCROLL_TO_BOTTOM;
}
if (directionHasChanged(newScrollDirection)) {
translateYAn... | [
"private",
"void",
"onScrollPositionChanged",
"(",
"int",
"oldScrollPosition",
",",
"int",
"newScrollPosition",
")",
"{",
"int",
"newScrollDirection",
";",
"if",
"(",
"newScrollPosition",
"<",
"oldScrollPosition",
")",
"{",
"newScrollDirection",
"=",
"SCROLL_TO_TOP",
... | Perform the "translateY" animation using the new scroll position and the old scroll position to show or hide
the animated view.
@param oldScrollPosition
@param newScrollPosition | [
"Perform",
"the",
"translateY",
"animation",
"using",
"the",
"new",
"scroll",
"position",
"and",
"the",
"old",
"scroll",
"position",
"to",
"show",
"or",
"hide",
"the",
"animated",
"view",
"."
] | train | https://github.com/tuenti/ButtonMenu/blob/95791383f6f976933496542b54e8c6dbdd73e669/library/src/main/java/com/tuenti/buttonmenu/animator/ScrollAnimator.java#L192-L204 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.buildGenericType | public static Object buildGenericType(final Class<?> mainClass, final Class<?> assignableClass, final Object... parameters) throws CoreException {
"""
Build the nth generic type of a class.
@param mainClass The main class used (that contain at least one generic type)
@param assignableClass the parent type of t... | java | public static Object buildGenericType(final Class<?> mainClass, final Class<?> assignableClass, final Object... parameters) throws CoreException {
return buildGenericType(mainClass, new Class<?>[] { assignableClass }, parameters);
} | [
"public",
"static",
"Object",
"buildGenericType",
"(",
"final",
"Class",
"<",
"?",
">",
"mainClass",
",",
"final",
"Class",
"<",
"?",
">",
"assignableClass",
",",
"final",
"Object",
"...",
"parameters",
")",
"throws",
"CoreException",
"{",
"return",
"buildGene... | Build the nth generic type of a class.
@param mainClass The main class used (that contain at least one generic type)
@param assignableClass the parent type of the generic to build
@param parameters used by the constructor of the generic type
@return a new instance of the generic type
@throws CoreException if the ins... | [
"Build",
"the",
"nth",
"generic",
"type",
"of",
"a",
"class",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L85-L87 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.escapeUriQueryParam | public static void escapeUriQueryParam(final Reader reader, final Writer writer, final String encoding)
throws IOException {
"""
<p>
Perform am URI query parameter (name or value) <strong>escape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
The follo... | java | public static void escapeUriQueryParam(final Reader reader, final Writer writer, final String encoding)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
if (encoding == null) {
throw new Ill... | [
"public",
"static",
"void",
"escapeUriQueryParam",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
",",
"final",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"throw",
"new",
"Illega... | <p>
Perform am URI query parameter (name or value) <strong>escape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
The following are the only allowed chars in an URI query parameter (will not be escaped):
</p>
<ul>
<li><tt>A-Z a-z 0-9</tt></li>
<li><tt>- . _ ~</tt></li>
<li>... | [
"<p",
">",
"Perform",
"am",
"URI",
"query",
"parameter",
"(",
"name",
"or",
"value",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L1007-L1020 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java | InstanceClient.setTagsInstance | @BetaApi
public final Operation setTagsInstance(String instance, Tags tagsResource) {
"""
Sets network tags for the specified instance to the data included in the request.
<p>Sample code:
<pre><code>
try (InstanceClient instanceClient = InstanceClient.create()) {
ProjectZoneInstanceName instance = Projec... | java | @BetaApi
public final Operation setTagsInstance(String instance, Tags tagsResource) {
SetTagsInstanceHttpRequest request =
SetTagsInstanceHttpRequest.newBuilder()
.setInstance(instance)
.setTagsResource(tagsResource)
.build();
return setTagsInstance(request);
} | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"setTagsInstance",
"(",
"String",
"instance",
",",
"Tags",
"tagsResource",
")",
"{",
"SetTagsInstanceHttpRequest",
"request",
"=",
"SetTagsInstanceHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setInstance",
"(",
"in... | Sets network tags for the specified instance to the data included in the request.
<p>Sample code:
<pre><code>
try (InstanceClient instanceClient = InstanceClient.create()) {
ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
Tags tagsResource = Tags.newBuilder().build(... | [
"Sets",
"network",
"tags",
"for",
"the",
"specified",
"instance",
"to",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java#L3161-L3170 |
windup/windup | rules-java/api/src/main/java/org/jboss/windup/rules/apps/mavenize/ArchiveCoordinateService.java | ArchiveCoordinateService.getSingleOrCreate | public ArchiveCoordinateModel getSingleOrCreate(String groupId, String artifactId, String version) {
"""
Returns a single ArchiveCoordinateModel with given G:A:V. Creates it if it does not already exist.
"""
ArchiveCoordinateModel archive = findSingle(groupId, artifactId, version);
if (archive ... | java | public ArchiveCoordinateModel getSingleOrCreate(String groupId, String artifactId, String version)
{
ArchiveCoordinateModel archive = findSingle(groupId, artifactId, version);
if (archive != null)
return archive;
else
return create().setGroupId(groupId).setArtifactId(... | [
"public",
"ArchiveCoordinateModel",
"getSingleOrCreate",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
",",
"String",
"version",
")",
"{",
"ArchiveCoordinateModel",
"archive",
"=",
"findSingle",
"(",
"groupId",
",",
"artifactId",
",",
"version",
")",
";",
... | Returns a single ArchiveCoordinateModel with given G:A:V. Creates it if it does not already exist. | [
"Returns",
"a",
"single",
"ArchiveCoordinateModel",
"with",
"given",
"G",
":",
"A",
":",
"V",
".",
"Creates",
"it",
"if",
"it",
"does",
"not",
"already",
"exist",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java/api/src/main/java/org/jboss/windup/rules/apps/mavenize/ArchiveCoordinateService.java#L29-L36 |
devnied/EMV-NFC-Paycard-Enrollment | library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/AbstractByteBean.java | AbstractByteBean.setField | protected void setField(final Field field, final IFile pData, final Object pValue) {
"""
Method used to set the value of a field
@param field
the field to set
@param pData
Object containing the field
@param pValue
the value of the field
"""
if (field != null) {
try {
field.set(pData, pValue);
... | java | protected void setField(final Field field, final IFile pData, final Object pValue) {
if (field != null) {
try {
field.set(pData, pValue);
} catch (IllegalArgumentException e) {
LOGGER.error("Parameters of fied.set are not valid", e);
} catch (IllegalAccessException e) {
LOGGER.error("Impossible t... | [
"protected",
"void",
"setField",
"(",
"final",
"Field",
"field",
",",
"final",
"IFile",
"pData",
",",
"final",
"Object",
"pValue",
")",
"{",
"if",
"(",
"field",
"!=",
"null",
")",
"{",
"try",
"{",
"field",
".",
"set",
"(",
"pData",
",",
"pValue",
")"... | Method used to set the value of a field
@param field
the field to set
@param pData
Object containing the field
@param pValue
the value of the field | [
"Method",
"used",
"to",
"set",
"the",
"value",
"of",
"a",
"field"
] | train | https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/AbstractByteBean.java#L113-L123 |
infinispan/infinispan | extended-statistics/src/main/java/org/infinispan/stats/CacheStatisticManager.java | CacheStatisticManager.beginTransaction | public final void beginTransaction(GlobalTransaction globalTransaction, boolean local) {
"""
Signals the start of a transaction.
@param local {@code true} if the transaction is local.
"""
if (local) {
//Not overriding the InitialValue method leads me to have "null" at the first invocation of ... | java | public final void beginTransaction(GlobalTransaction globalTransaction, boolean local) {
if (local) {
//Not overriding the InitialValue method leads me to have "null" at the first invocation of get()
TransactionStatistics lts = createTransactionStatisticIfAbsent(globalTransaction, true);
... | [
"public",
"final",
"void",
"beginTransaction",
"(",
"GlobalTransaction",
"globalTransaction",
",",
"boolean",
"local",
")",
"{",
"if",
"(",
"local",
")",
"{",
"//Not overriding the InitialValue method leads me to have \"null\" at the first invocation of get()",
"TransactionStatis... | Signals the start of a transaction.
@param local {@code true} if the transaction is local. | [
"Signals",
"the",
"start",
"of",
"a",
"transaction",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/extended-statistics/src/main/java/org/infinispan/stats/CacheStatisticManager.java#L170-L183 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Fraction.java | Fraction.of | public static Fraction of(String str) {
"""
<p>
Creates a Fraction from a <code>String</code>.
</p>
<p>
The formats accepted are:
</p>
<ol>
<li><code>double</code> String containing a dot</li>
<li>'X Y/Z'</li>
<li>'Y/Z'</li>
<li>'X' (a simple whole number)</li>
</ol>
<p>
and a .
</p>
@param st... | java | public static Fraction of(String str) {
if (str == null) {
throw new IllegalArgumentException("The string must not be null");
}
// parse double format
int pos = str.indexOf('.');
if (pos >= 0) {
return of(Double.parseDouble(str));
}
// par... | [
"public",
"static",
"Fraction",
"of",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The string must not be null\"",
")",
";",
"}",
"// parse double format",
"int",
"pos",
"=",
"str... | <p>
Creates a Fraction from a <code>String</code>.
</p>
<p>
The formats accepted are:
</p>
<ol>
<li><code>double</code> String containing a dot</li>
<li>'X Y/Z'</li>
<li>'Y/Z'</li>
<li>'X' (a simple whole number)</li>
</ol>
<p>
and a .
</p>
@param str
the string to parse, must not be <code>null</code>
@return the ne... | [
"<p",
">",
"Creates",
"a",
"Fraction",
"from",
"a",
"<code",
">",
"String<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Fraction.java#L366-L401 |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/Main.java | Main.findBuildFile | private File findBuildFile(final String start, final String suffix) {
"""
Search parent directories for the build file.
<p>
Takes the given target as a suffix to append to each parent directory in
search of a build file. Once the root of the file-system has been reached
<code>null</code> is returned.
@param... | java | private File findBuildFile(final String start, final String suffix) {
if (args.msgOutputLevel >= Project.MSG_INFO) {
System.out.println("Searching for " + suffix + " ...");
}
File parent = new File(new File(start).getAbsolutePath());
File file = new File(parent, suffix);
... | [
"private",
"File",
"findBuildFile",
"(",
"final",
"String",
"start",
",",
"final",
"String",
"suffix",
")",
"{",
"if",
"(",
"args",
".",
"msgOutputLevel",
">=",
"Project",
".",
"MSG_INFO",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Searching f... | Search parent directories for the build file.
<p>
Takes the given target as a suffix to append to each parent directory in
search of a build file. Once the root of the file-system has been reached
<code>null</code> is returned.
@param start Leaf directory of search. Must not be <code>null</code>.
@param suffix Suffix... | [
"Search",
"parent",
"directories",
"for",
"the",
"build",
"file",
".",
"<p",
">",
"Takes",
"the",
"given",
"target",
"as",
"a",
"suffix",
"to",
"append",
"to",
"each",
"parent",
"directory",
"in",
"search",
"of",
"a",
"build",
"file",
".",
"Once",
"the",... | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/Main.java#L515-L539 |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/segment/SegmentServiceImpl.java | SegmentServiceImpl.readMetaSegment | private boolean readMetaSegment(ReadStream is, int crc)
throws IOException {
"""
metadata for a segment
<pre><code>
address int48
length int16
crc int32
</code></pre>
"""
long value = BitsUtil.readLong(is);
crc = Crc32Caucho.generate(crc, value);
int crcFile = BitsUtil.readInt... | java | private boolean readMetaSegment(ReadStream is, int crc)
throws IOException
{
long value = BitsUtil.readLong(is);
crc = Crc32Caucho.generate(crc, value);
int crcFile = BitsUtil.readInt(is);
if (crcFile != crc) {
log.fine("meta-segment crc mismatch");
return false;
}
... | [
"private",
"boolean",
"readMetaSegment",
"(",
"ReadStream",
"is",
",",
"int",
"crc",
")",
"throws",
"IOException",
"{",
"long",
"value",
"=",
"BitsUtil",
".",
"readLong",
"(",
"is",
")",
";",
"crc",
"=",
"Crc32Caucho",
".",
"generate",
"(",
"crc",
",",
"... | metadata for a segment
<pre><code>
address int48
length int16
crc int32
</code></pre> | [
"metadata",
"for",
"a",
"segment"
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/segment/SegmentServiceImpl.java#L822-L846 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/SliceOps.java | SliceOps.calcSliceFence | private static long calcSliceFence(long skip, long limit) {
"""
Calculates the slice fence, which is one past the index of the slice
range
@param skip the number of elements to skip, assumed to be >= 0
@param limit the number of elements to limit, assumed to be >= 0, with
a value of {@code Long.MAX_VALUE} if t... | java | private static long calcSliceFence(long skip, long limit) {
long sliceFence = limit >= 0 ? skip + limit : Long.MAX_VALUE;
// Check for overflow
return (sliceFence >= 0) ? sliceFence : Long.MAX_VALUE;
} | [
"private",
"static",
"long",
"calcSliceFence",
"(",
"long",
"skip",
",",
"long",
"limit",
")",
"{",
"long",
"sliceFence",
"=",
"limit",
">=",
"0",
"?",
"skip",
"+",
"limit",
":",
"Long",
".",
"MAX_VALUE",
";",
"// Check for overflow",
"return",
"(",
"slice... | Calculates the slice fence, which is one past the index of the slice
range
@param skip the number of elements to skip, assumed to be >= 0
@param limit the number of elements to limit, assumed to be >= 0, with
a value of {@code Long.MAX_VALUE} if there is no limit
@return the slice fence. | [
"Calculates",
"the",
"slice",
"fence",
"which",
"is",
"one",
"past",
"the",
"index",
"of",
"the",
"slice",
"range"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/SliceOps.java#L64-L68 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java | TasksInner.beginCreateAsync | public Observable<TaskInner> beginCreateAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) {
"""
Creates a task for a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belon... | java | public Observable<TaskInner> beginCreateAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters).map(new Func1<ServiceResponse<TaskInner>, TaskInner>() {
... | [
"public",
"Observable",
"<",
"TaskInner",
">",
"beginCreateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"taskName",
",",
"TaskInner",
"taskCreateParameters",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(",
"re... | Creates a task for a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param taskName The name of the container registry task.
@param taskCreateParameters The parame... | [
"Creates",
"a",
"task",
"for",
"a",
"container",
"registry",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java#L444-L451 |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageImpl.java | MessageImpl.addReaction | public void addReaction(Emoji emoji, boolean you) {
"""
Adds an emoji to the list of reactions.
@param emoji The emoji.
@param you Whether this reaction is used by you or not.
"""
Optional<Reaction> reaction = reactions.stream().filter(r -> emoji.equalsEmoji(r.getEmoji())).findAny();
reacti... | java | public void addReaction(Emoji emoji, boolean you) {
Optional<Reaction> reaction = reactions.stream().filter(r -> emoji.equalsEmoji(r.getEmoji())).findAny();
reaction.ifPresent(r -> ((ReactionImpl) r).incrementCount(you));
if (!reaction.isPresent()) {
reactions.add(new ReactionImpl(th... | [
"public",
"void",
"addReaction",
"(",
"Emoji",
"emoji",
",",
"boolean",
"you",
")",
"{",
"Optional",
"<",
"Reaction",
">",
"reaction",
"=",
"reactions",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"r",
"->",
"emoji",
".",
"equalsEmoji",
"(",
"r",
".",... | Adds an emoji to the list of reactions.
@param emoji The emoji.
@param you Whether this reaction is used by you or not. | [
"Adds",
"an",
"emoji",
"to",
"the",
"list",
"of",
"reactions",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageImpl.java#L260-L266 |
js-lib-com/template.xhtml | src/main/java/js/template/xhtml/ValueOperator.java | ValueOperator.doExec | @Override
protected Object doExec(Element element, Object scope, String propertyPath, Object... arguments) throws TemplateException {
"""
Execute VALUE operator. Uses property path to extract content value, convert it to string and set element <em>value</em>
attribute.
@param element context element, unused,... | java | @Override
protected Object doExec(Element element, Object scope, String propertyPath, Object... arguments) throws TemplateException {
if (!propertyPath.equals(".") && ConverterRegistry.hasType(scope.getClass())) {
throw new TemplateException("Operand is property path but scope is not an object.");
}
Stri... | [
"@",
"Override",
"protected",
"Object",
"doExec",
"(",
"Element",
"element",
",",
"Object",
"scope",
",",
"String",
"propertyPath",
",",
"Object",
"...",
"arguments",
")",
"throws",
"TemplateException",
"{",
"if",
"(",
"!",
"propertyPath",
".",
"equals",
"(",
... | Execute VALUE operator. Uses property path to extract content value, convert it to string and set element <em>value</em>
attribute.
@param element context element, unused,
@param scope scope object,
@param propertyPath property path,
@param arguments optional arguments, {@link Format} instance in this case.
@return al... | [
"Execute",
"VALUE",
"operator",
".",
"Uses",
"property",
"path",
"to",
"extract",
"content",
"value",
"convert",
"it",
"to",
"string",
"and",
"set",
"element",
"<em",
">",
"value<",
"/",
"em",
">",
"attribute",
"."
] | train | https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/ValueOperator.java#L46-L70 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.