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 |
|---|---|---|---|---|---|---|---|---|---|---|
evandor/unitprofiler | unitprofiler.core/src/main/java/de/twenty11/unitprofile/callback/ProfilerCallback.java | ProfilerCallback.start | public static MethodInvocation start(String objectName, String methodName, int lineNumber) {
"""
the first invocation for this profiling session.
@param objectName
@param methodName
@return
"""
bigMessage("Starting profiling... " + objectName + "#" + methodName + " (" + lineNumber + ")");
... | java | public static MethodInvocation start(String objectName, String methodName, int lineNumber) {
bigMessage("Starting profiling... " + objectName + "#" + methodName + " (" + lineNumber + ")");
if (profiling()) {
logger.error("Profiling was already started for '{}'", callstack.getFirst().getCls()... | [
"public",
"static",
"MethodInvocation",
"start",
"(",
"String",
"objectName",
",",
"String",
"methodName",
",",
"int",
"lineNumber",
")",
"{",
"bigMessage",
"(",
"\"Starting profiling... \"",
"+",
"objectName",
"+",
"\"#\"",
"+",
"methodName",
"+",
"\" (\"",
"+",
... | the first invocation for this profiling session.
@param objectName
@param methodName
@return | [
"the",
"first",
"invocation",
"for",
"this",
"profiling",
"session",
"."
] | train | https://github.com/evandor/unitprofiler/blob/a875635d0f45ca7f9694c5e9c815109877d056b5/unitprofiler.core/src/main/java/de/twenty11/unitprofile/callback/ProfilerCallback.java#L40-L54 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java | OjbTagsHandler.forAllReferenceDefinitions | public void forAllReferenceDefinitions(String template, Properties attributes) throws XDocletException {
"""
Processes the template for all reference definitions of the current class definition.
@param template The template
@param attributes The attributes of the tag
@exception XDoclet... | java | public void forAllReferenceDefinitions(String template, Properties attributes) throws XDocletException
{
for (Iterator it = _curClassDef.getReferences(); it.hasNext(); )
{
_curReferenceDef = (ReferenceDescriptorDef)it.next();
// first we check whether it is an inherited ... | [
"public",
"void",
"forAllReferenceDefinitions",
"(",
"String",
"template",
",",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"for",
"(",
"Iterator",
"it",
"=",
"_curClassDef",
".",
"getReferences",
"(",
")",
";",
"it",
".",
"hasNext",
"(",... | Processes the template for all reference definitions of the current class definition.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException if an error occurs
@doc.tag type="block" | [
"Processes",
"the",
"template",
"for",
"all",
"reference",
"definitions",
"of",
"the",
"current",
"class",
"definition",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L954-L971 |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/scsi/sense/SenseData.java | SenseData.getReponseCodeFor | public static final int getReponseCodeFor (final ErrorType errorType, final SenseDataFormat senseDataFormat) {
"""
Returns the proper response code for the given error type and sense data format.
@param errorType a sense data error type
@param senseDataFormat a sense data format
@return the proper response co... | java | public static final int getReponseCodeFor (final ErrorType errorType, final SenseDataFormat senseDataFormat) {
if (senseDataFormat == SenseDataFormat.FIXED) {
if (errorType == ErrorType.CURRENT)
return 0x70;
else
// errorType == DEFERRED
... | [
"public",
"static",
"final",
"int",
"getReponseCodeFor",
"(",
"final",
"ErrorType",
"errorType",
",",
"final",
"SenseDataFormat",
"senseDataFormat",
")",
"{",
"if",
"(",
"senseDataFormat",
"==",
"SenseDataFormat",
".",
"FIXED",
")",
"{",
"if",
"(",
"errorType",
... | Returns the proper response code for the given error type and sense data format.
@param errorType a sense data error type
@param senseDataFormat a sense data format
@return the proper response code | [
"Returns",
"the",
"proper",
"response",
"code",
"for",
"the",
"given",
"error",
"type",
"and",
"sense",
"data",
"format",
"."
] | train | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/scsi/sense/SenseData.java#L77-L94 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.updateChannelConfiguration | public void updateChannelConfiguration(UpdateChannelConfiguration updateChannelConfiguration, byte[]... signers) throws TransactionException, InvalidArgumentException {
"""
Update channel with specified channel configuration
@param updateChannelConfiguration Updated Channel configuration
@param signers ... | java | public void updateChannelConfiguration(UpdateChannelConfiguration updateChannelConfiguration, byte[]... signers) throws TransactionException, InvalidArgumentException {
updateChannelConfiguration(updateChannelConfiguration, getRandomOrderer(), signers);
} | [
"public",
"void",
"updateChannelConfiguration",
"(",
"UpdateChannelConfiguration",
"updateChannelConfiguration",
",",
"byte",
"[",
"]",
"...",
"signers",
")",
"throws",
"TransactionException",
",",
"InvalidArgumentException",
"{",
"updateChannelConfiguration",
"(",
"updateCha... | Update channel with specified channel configuration
@param updateChannelConfiguration Updated Channel configuration
@param signers signers
@throws TransactionException
@throws InvalidArgumentException | [
"Update",
"channel",
"with",
"specified",
"channel",
"configuration"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L406-L410 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/AvroUtils.java | AvroUtils.switchName | public static Schema switchName(Schema schema, String newName) {
"""
Copies the input {@link org.apache.avro.Schema} but changes the schema name.
@param schema {@link org.apache.avro.Schema} to copy.
@param newName name for the copied {@link org.apache.avro.Schema}.
@return A {@link org.apache.avro.Schema} that... | java | public static Schema switchName(Schema schema, String newName) {
if (schema.getName().equals(newName)) {
return schema;
}
Schema newSchema = Schema.createRecord(newName, schema.getDoc(), schema.getNamespace(), schema.isError());
List<Field> fields = schema.getFields();
Iterable<Field> fields... | [
"public",
"static",
"Schema",
"switchName",
"(",
"Schema",
"schema",
",",
"String",
"newName",
")",
"{",
"if",
"(",
"schema",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"newName",
")",
")",
"{",
"return",
"schema",
";",
"}",
"Schema",
"newSchema",
"... | Copies the input {@link org.apache.avro.Schema} but changes the schema name.
@param schema {@link org.apache.avro.Schema} to copy.
@param newName name for the copied {@link org.apache.avro.Schema}.
@return A {@link org.apache.avro.Schema} that is a copy of schema, but has the name newName. | [
"Copies",
"the",
"input",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/AvroUtils.java#L673-L695 |
rzwitserloot/lombok | src/core/lombok/eclipse/EclipseNode.java | EclipseNode.addWarning | public void addWarning(String message, int sourceStart, int sourceEnd) {
"""
Generate a compiler warning that shows the wavy underline from-to the stated character positions.
"""
ast.addProblem(ast.new ParseProblem(true, message, sourceStart, sourceEnd));
} | java | public void addWarning(String message, int sourceStart, int sourceEnd) {
ast.addProblem(ast.new ParseProblem(true, message, sourceStart, sourceEnd));
} | [
"public",
"void",
"addWarning",
"(",
"String",
"message",
",",
"int",
"sourceStart",
",",
"int",
"sourceEnd",
")",
"{",
"ast",
".",
"addProblem",
"(",
"ast",
".",
"new",
"ParseProblem",
"(",
"true",
",",
"message",
",",
"sourceStart",
",",
"sourceEnd",
")"... | Generate a compiler warning that shows the wavy underline from-to the stated character positions. | [
"Generate",
"a",
"compiler",
"warning",
"that",
"shows",
"the",
"wavy",
"underline",
"from",
"-",
"to",
"the",
"stated",
"character",
"positions",
"."
] | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/eclipse/EclipseNode.java#L183-L185 |
JOML-CI/JOML | src/org/joml/Matrix3x2f.java | Matrix3x2f.scale | public Matrix3x2f scale(Vector2fc xy, Matrix3x2f dest) {
"""
Apply scaling to this matrix by scaling the base axes by the given <code>xy</code> factors
and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix,
then the new matrix will be... | java | public Matrix3x2f scale(Vector2fc xy, Matrix3x2f dest) {
return scale(xy.x(), xy.y(), dest);
} | [
"public",
"Matrix3x2f",
"scale",
"(",
"Vector2fc",
"xy",
",",
"Matrix3x2f",
"dest",
")",
"{",
"return",
"scale",
"(",
"xy",
".",
"x",
"(",
")",
",",
"xy",
".",
"y",
"(",
")",
",",
"dest",
")",
";",
"}"
] | Apply scaling to this matrix by scaling the base axes by the given <code>xy</code> factors
and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix,
then the new matrix will be <code>M * S</code>. So when transforming a
vector <code>v</code> with... | [
"Apply",
"scaling",
"to",
"this",
"matrix",
"by",
"scaling",
"the",
"base",
"axes",
"by",
"the",
"given",
"<code",
">",
"xy<",
"/",
"code",
">",
"factors",
"and",
"store",
"the",
"result",
"in",
"<code",
">",
"dest<",
"/",
"code",
">",
".",
"<p",
">"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3x2f.java#L1280-L1282 |
apache/groovy | subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java | DateTimeExtensions.getOffset | public static ZoneOffset getOffset(final ZoneId self, Instant instant) {
"""
Returns a {@link java.time.ZoneOffset} for this zone as of the provided {@link java.time.Instant}.
@param self a ZoneId
@param instant an Instant
@return a ZoneOffset
@since 2.5.0
"""
return self.getRules().getOffset(... | java | public static ZoneOffset getOffset(final ZoneId self, Instant instant) {
return self.getRules().getOffset(instant);
} | [
"public",
"static",
"ZoneOffset",
"getOffset",
"(",
"final",
"ZoneId",
"self",
",",
"Instant",
"instant",
")",
"{",
"return",
"self",
".",
"getRules",
"(",
")",
".",
"getOffset",
"(",
"instant",
")",
";",
"}"
] | Returns a {@link java.time.ZoneOffset} for this zone as of the provided {@link java.time.Instant}.
@param self a ZoneId
@param instant an Instant
@return a ZoneOffset
@since 2.5.0 | [
"Returns",
"a",
"{",
"@link",
"java",
".",
"time",
".",
"ZoneOffset",
"}",
"for",
"this",
"zone",
"as",
"of",
"the",
"provided",
"{",
"@link",
"java",
".",
"time",
".",
"Instant",
"}",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java#L1845-L1847 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java | CoronaJobTracker.getResourceReportList | public List<ResourceReport> getResourceReportList(String resourceType) {
"""
Based on the resource type, get a resource report of the grant # and
task #. Used by coronajobresources.jsp for debugging which resources are
being used
@param resourceType Map or reduce type
@return List of the resource reports fo... | java | public List<ResourceReport> getResourceReportList(String resourceType) {
Map<Integer, ResourceReport> resourceReportMap =
new TreeMap<Integer, ResourceReport>();
synchronized (lockObject) {
for (Map.Entry<TaskAttemptID, Integer> entry :
taskLookupTable.taskIdToGrantMap.entrySet()) {
... | [
"public",
"List",
"<",
"ResourceReport",
">",
"getResourceReportList",
"(",
"String",
"resourceType",
")",
"{",
"Map",
"<",
"Integer",
",",
"ResourceReport",
">",
"resourceReportMap",
"=",
"new",
"TreeMap",
"<",
"Integer",
",",
"ResourceReport",
">",
"(",
")",
... | Based on the resource type, get a resource report of the grant # and
task #. Used by coronajobresources.jsp for debugging which resources are
being used
@param resourceType Map or reduce type
@return List of the resource reports for the appropriate type sorted by id. | [
"Based",
"on",
"the",
"resource",
"type",
"get",
"a",
"resource",
"report",
"of",
"the",
"grant",
"#",
"and",
"task",
"#",
".",
"Used",
"by",
"coronajobresources",
".",
"jsp",
"for",
"debugging",
"which",
"resources",
"are",
"being",
"used"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java#L2979-L3003 |
Jasig/uPortal | uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/layout/dlm/remoting/ChannelListController.java | ChannelListController.listChannels | @RequestMapping(value = "/portletList", method = RequestMethod.GET)
public ModelAndView listChannels(
WebRequest webRequest,
HttpServletRequest request,
@RequestParam(value = "type", required = false) String type) {
"""
Original, pre-4.3 version of this API. Always returns t... | java | @RequestMapping(value = "/portletList", method = RequestMethod.GET)
public ModelAndView listChannels(
WebRequest webRequest,
HttpServletRequest request,
@RequestParam(value = "type", required = false) String type) {
if (TYPE_MANAGE.equals(type)) {
throw new U... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/portletList\"",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"ModelAndView",
"listChannels",
"(",
"WebRequest",
"webRequest",
",",
"HttpServletRequest",
"request",
",",
"@",
"RequestParam",
"(",
"val... | Original, pre-4.3 version of this API. Always returns the entire contents of the Portlet
Registry, including uncategorized portlets, to which the user has access. Access is based on
the SUBSCRIBE permission. | [
"Original",
"pre",
"-",
"4",
".",
"3",
"version",
"of",
"this",
"API",
".",
"Always",
"returns",
"the",
"entire",
"contents",
"of",
"the",
"Portlet",
"Registry",
"including",
"uncategorized",
"portlets",
"to",
"which",
"the",
"user",
"has",
"access",
".",
... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/layout/dlm/remoting/ChannelListController.java#L162-L181 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONObject.java | JSONObject.element | public JSONObject element( String key, Map value, JsonConfig jsonConfig ) {
"""
Put a key/value pair in the JSONObject, where the value will be a
JSONObject which is produced from a Map.
@param key A key string.
@param value A Map value.
@return this.
@throws JSONException
"""
verifyIsNull();
... | java | public JSONObject element( String key, Map value, JsonConfig jsonConfig ) {
verifyIsNull();
if( value instanceof JSONObject ){
return setInternal( key, value, jsonConfig );
}else{
return element( key, JSONObject.fromObject( value, jsonConfig ), jsonConfig );
}
} | [
"public",
"JSONObject",
"element",
"(",
"String",
"key",
",",
"Map",
"value",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"verifyIsNull",
"(",
")",
";",
"if",
"(",
"value",
"instanceof",
"JSONObject",
")",
"{",
"return",
"setInternal",
"(",
"key",
",",
"val... | Put a key/value pair in the JSONObject, where the value will be a
JSONObject which is produced from a Map.
@param key A key string.
@param value A Map value.
@return this.
@throws JSONException | [
"Put",
"a",
"key",
"/",
"value",
"pair",
"in",
"the",
"JSONObject",
"where",
"the",
"value",
"will",
"be",
"a",
"JSONObject",
"which",
"is",
"produced",
"from",
"a",
"Map",
"."
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONObject.java#L1667-L1674 |
Netflix/ribbon | ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/reactive/ExecutionContextListenerInvoker.java | ExecutionContextListenerInvoker.onStartWithServer | public void onStartWithServer(ExecutionContext<I> context, ExecutionInfo info) {
"""
Called when a server is chosen and the request is going to be executed on the server.
"""
for (ExecutionListener<I, O> listener: listeners) {
try {
if (!isListenerDisabled(listener)) {
... | java | public void onStartWithServer(ExecutionContext<I> context, ExecutionInfo info) {
for (ExecutionListener<I, O> listener: listeners) {
try {
if (!isListenerDisabled(listener)) {
listener.onStartWithServer(context.getChildContext(listener), info);
}
... | [
"public",
"void",
"onStartWithServer",
"(",
"ExecutionContext",
"<",
"I",
">",
"context",
",",
"ExecutionInfo",
"info",
")",
"{",
"for",
"(",
"ExecutionListener",
"<",
"I",
",",
"O",
">",
"listener",
":",
"listeners",
")",
"{",
"try",
"{",
"if",
"(",
"!"... | Called when a server is chosen and the request is going to be executed on the server. | [
"Called",
"when",
"a",
"server",
"is",
"chosen",
"and",
"the",
"request",
"is",
"going",
"to",
"be",
"executed",
"on",
"the",
"server",
"."
] | train | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/reactive/ExecutionContextListenerInvoker.java#L94-L107 |
craftercms/profile | security-provider/src/main/java/org/craftercms/security/authentication/impl/AuthenticationRequiredHandlerImpl.java | AuthenticationRequiredHandlerImpl.handle | public void handle(RequestContext context, AuthenticationException e) throws SecurityProviderException,
IOException {
"""
Saves the current request in the request cache and then redirects to the login form page.
@param context the request security context
@param e the exception with the reaso... | java | public void handle(RequestContext context, AuthenticationException e) throws SecurityProviderException,
IOException {
saveRequest(context);
String loginFormUrl = getLoginFormUrl();
if (StringUtils.isNotEmpty(loginFormUrl)) {
RedirectUtils.redirect(context.getRequest(), ... | [
"public",
"void",
"handle",
"(",
"RequestContext",
"context",
",",
"AuthenticationException",
"e",
")",
"throws",
"SecurityProviderException",
",",
"IOException",
"{",
"saveRequest",
"(",
"context",
")",
";",
"String",
"loginFormUrl",
"=",
"getLoginFormUrl",
"(",
")... | Saves the current request in the request cache and then redirects to the login form page.
@param context the request security context
@param e the exception with the reason for requiring authentication | [
"Saves",
"the",
"current",
"request",
"in",
"the",
"request",
"cache",
"and",
"then",
"redirects",
"to",
"the",
"login",
"form",
"page",
"."
] | train | https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/authentication/impl/AuthenticationRequiredHandlerImpl.java#L82-L93 |
js-lib-com/dom | src/main/java/js/dom/w3c/DocumentImpl.java | DocumentImpl.getElement | Element getElement(Node node) {
"""
Get the element associated to node. Returns the element bound to given node. If no element instance found, create a new
{@link Element} instance, bound it to node then returns it. Returns null is given node is undefined or null.
<p>
Element instance is saved on node using {@l... | java | Element getElement(Node node) {
if (node == null) {
return null;
}
// element instance is cached as node user defined data and reused
Object value = node.getUserData(BACK_REF);
if (value != null) {
return (Element) value;
}
Element el = new ElementImpl(this, node);
node.setUserData(BACK_... | [
"Element",
"getElement",
"(",
"Node",
"node",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// element instance is cached as node user defined data and reused\r",
"Object",
"value",
"=",
"node",
".",
"getUserData",
"(",
"BACK_RE... | Get the element associated to node. Returns the element bound to given node. If no element instance found, create a new
{@link Element} instance, bound it to node then returns it. Returns null is given node is undefined or null.
<p>
Element instance is saved on node using {@link Node#setUserData(String, Object, org.w3c... | [
"Get",
"the",
"element",
"associated",
"to",
"node",
".",
"Returns",
"the",
"element",
"bound",
"to",
"given",
"node",
".",
"If",
"no",
"element",
"instance",
"found",
"create",
"a",
"new",
"{",
"@link",
"Element",
"}",
"instance",
"bound",
"it",
"to",
"... | train | https://github.com/js-lib-com/dom/blob/8c7cd7c802977f210674dec7c2a8f61e8de05b63/src/main/java/js/dom/w3c/DocumentImpl.java#L65-L77 |
aws/aws-sdk-java | aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/DeleteChannelResult.java | DeleteChannelResult.withTags | public DeleteChannelResult withTags(java.util.Map<String, String> tags) {
"""
A collection of key-value pairs.
@param tags
A collection of key-value pairs.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
} | java | public DeleteChannelResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"DeleteChannelResult",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | A collection of key-value pairs.
@param tags
A collection of key-value pairs.
@return Returns a reference to this object so that method calls can be chained together. | [
"A",
"collection",
"of",
"key",
"-",
"value",
"pairs",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/DeleteChannelResult.java#L658-L661 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/ReflectionUtils.java | ReflectionUtils.hasSuperClass | public static boolean hasSuperClass(Class<?> clazz, Class<?> superClazz) {
"""
Tells if a class is a sub-class of a super-class.
Note:
<ul>
<li>Sub-class against super-class: this method returns {@code true}.</li>
<li>Sub-interface against super-interface: this method returns
{@code true}.</li>
<li>Class a... | java | public static boolean hasSuperClass(Class<?> clazz, Class<?> superClazz) {
if (clazz == null || superClazz == null || clazz == superClazz) {
return false;
}
if (clazz.isInterface()) {
return superClazz.isAssignableFrom(clazz);
}
Class<?> parent = clazz.g... | [
"public",
"static",
"boolean",
"hasSuperClass",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Class",
"<",
"?",
">",
"superClazz",
")",
"{",
"if",
"(",
"clazz",
"==",
"null",
"||",
"superClazz",
"==",
"null",
"||",
"clazz",
"==",
"superClazz",
")",
"{",
... | Tells if a class is a sub-class of a super-class.
Note:
<ul>
<li>Sub-class against super-class: this method returns {@code true}.</li>
<li>Sub-interface against super-interface: this method returns
{@code true}.</li>
<li>Class against interface: this method returns {@code false}.</li>
</ul>
@param clazz
class to chec... | [
"Tells",
"if",
"a",
"class",
"is",
"a",
"sub",
"-",
"class",
"of",
"a",
"super",
"-",
"class",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/ReflectionUtils.java#L111-L128 |
haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/MagickUtil.java | MagickUtil.grayToBuffered | private static BufferedImage grayToBuffered(MagickImage pImage, boolean pAlpha) throws MagickException {
"""
Converts a gray {@code MagickImage} to a {@code BufferedImage}, of
type {@code TYPE_USHORT_GRAY} or {@code TYPE_BYTE_GRAY}.
@param pImage the original {@code MagickImage}
@param pAlpha keep alpha chann... | java | private static BufferedImage grayToBuffered(MagickImage pImage, boolean pAlpha) throws MagickException {
Dimension size = pImage.getDimension();
int length = size.width * size.height;
int bands = pAlpha ? 2 : 1;
byte[] pixels = new byte[length * bands];
// TODO: Make a fix... | [
"private",
"static",
"BufferedImage",
"grayToBuffered",
"(",
"MagickImage",
"pImage",
",",
"boolean",
"pAlpha",
")",
"throws",
"MagickException",
"{",
"Dimension",
"size",
"=",
"pImage",
".",
"getDimension",
"(",
")",
";",
"int",
"length",
"=",
"size",
".",
"w... | Converts a gray {@code MagickImage} to a {@code BufferedImage}, of
type {@code TYPE_USHORT_GRAY} or {@code TYPE_BYTE_GRAY}.
@param pImage the original {@code MagickImage}
@param pAlpha keep alpha channel
@return a new {@code BufferedImage}
@throws MagickException if an exception occurs during conversion
@see Buffere... | [
"Converts",
"a",
"gray",
"{",
"@code",
"MagickImage",
"}",
"to",
"a",
"{",
"@code",
"BufferedImage",
"}",
"of",
"type",
"{",
"@code",
"TYPE_USHORT_GRAY",
"}",
"or",
"{",
"@code",
"TYPE_BYTE_GRAY",
"}",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/MagickUtil.java#L409-L430 |
jbundle/jbundle | base/message/service/src/main/java/org/jbundle/base/message/service/BaseMessageServiceActivator.java | BaseMessageServiceActivator.shutdownService | public boolean shutdownService(Object service, BundleContext context) {
"""
Stop this service.
Override this to do all the startup.
@param bundleService
@param context bundle context
@return true if successful.
"""
if (service instanceof BaseServiceMessageTransport) // Always
((BaseServ... | java | public boolean shutdownService(Object service, BundleContext context)
{
if (service instanceof BaseServiceMessageTransport) // Always
((BaseServiceMessageTransport)service).free();
return super.shutdownService(service, context);
} | [
"public",
"boolean",
"shutdownService",
"(",
"Object",
"service",
",",
"BundleContext",
"context",
")",
"{",
"if",
"(",
"service",
"instanceof",
"BaseServiceMessageTransport",
")",
"// Always",
"(",
"(",
"BaseServiceMessageTransport",
")",
"service",
")",
".",
"free... | Stop this service.
Override this to do all the startup.
@param bundleService
@param context bundle context
@return true if successful. | [
"Stop",
"this",
"service",
".",
"Override",
"this",
"to",
"do",
"all",
"the",
"startup",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/service/src/main/java/org/jbundle/base/message/service/BaseMessageServiceActivator.java#L113-L118 |
aws/aws-sdk-java | aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/model/TagQueueRequest.java | TagQueueRequest.withTags | public TagQueueRequest withTags(java.util.Map<String, String> tags) {
"""
<p>
The list of tags to be added to the specified queue.
</p>
@param tags
The list of tags to be added to the specified queue.
@return Returns a reference to this object so that method calls can be chained together.
"""
se... | java | public TagQueueRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"TagQueueRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The list of tags to be added to the specified queue.
</p>
@param tags
The list of tags to be added to the specified queue.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"list",
"of",
"tags",
"to",
"be",
"added",
"to",
"the",
"specified",
"queue",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/model/TagQueueRequest.java#L139-L142 |
cache2k/cache2k | cache2k-api/src/main/java/org/cache2k/CacheManager.java | CacheManager.getInstance | public static CacheManager getInstance(ClassLoader cl, String managerName) {
"""
Retrieve a cache manager with the specified name using the specified classloader.
If not existing, a manager with that name is created. Different cache managers are
created for different class loaders. Manager names should be unique... | java | public static CacheManager getInstance(ClassLoader cl, String managerName) {
return PROVIDER.getManager(cl, managerName);
} | [
"public",
"static",
"CacheManager",
"getInstance",
"(",
"ClassLoader",
"cl",
",",
"String",
"managerName",
")",
"{",
"return",
"PROVIDER",
".",
"getManager",
"(",
"cl",
",",
"managerName",
")",
";",
"}"
] | Retrieve a cache manager with the specified name using the specified classloader.
If not existing, a manager with that name is created. Different cache managers are
created for different class loaders. Manager names should be unique within one VM instance.
<p>The allowed characters in a manager name are identical to t... | [
"Retrieve",
"a",
"cache",
"manager",
"with",
"the",
"specified",
"name",
"using",
"the",
"specified",
"classloader",
".",
"If",
"not",
"existing",
"a",
"manager",
"with",
"that",
"name",
"is",
"created",
".",
"Different",
"cache",
"managers",
"are",
"created",... | train | https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/CacheManager.java#L123-L125 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLObjectPropertyDomainAxiomImpl_CustomFieldSerializer.java | OWLObjectPropertyDomainAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLObjectPropertyDomainAxiomImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link c... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLObjectPropertyDomainAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLObjectPropertyDomainAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}... | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLObjectPropertyDomainAxiomImpl_CustomFieldSerializer.java#L98-L101 |
umeding/fuzzer | src/main/java/com/uwemeding/fuzzer/java/JavaOutputType.java | JavaOutputType.addCalculateCrispValue | private void addCalculateCrispValue(Program program, Java.CLASS clazz) {
"""
Calculate the crisp output value.
<p>
@param method the calling method
@param variable the output variable
"""
Java.METHOD calc = clazz.addMETHOD("private", "Number", "calculateCrispValue");
calc.setComment("Calculate the cr... | java | private void addCalculateCrispValue(Program program, Java.CLASS clazz) {
Java.METHOD calc = clazz.addMETHOD("private", "Number", "calculateCrispValue");
calc.setComment("Calculate the crisp value");
calc.setReturnComment("the crisp value");
calc.addArg("Number", "from", "Start interval");
calc.addArg("Number... | [
"private",
"void",
"addCalculateCrispValue",
"(",
"Program",
"program",
",",
"Java",
".",
"CLASS",
"clazz",
")",
"{",
"Java",
".",
"METHOD",
"calc",
"=",
"clazz",
".",
"addMETHOD",
"(",
"\"private\"",
",",
"\"Number\"",
",",
"\"calculateCrispValue\"",
")",
";"... | Calculate the crisp output value.
<p>
@param method the calling method
@param variable the output variable | [
"Calculate",
"the",
"crisp",
"output",
"value",
".",
"<p",
">"
] | train | https://github.com/umeding/fuzzer/blob/e8aa46313bb1d1328865f26f99455124aede828c/src/main/java/com/uwemeding/fuzzer/java/JavaOutputType.java#L235-L256 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TitlePaneCloseButtonPainter.java | TitlePaneCloseButtonPainter.decodeCloseGradient | private Paint decodeCloseGradient(Shape s, Color top, Color bottom) {
"""
Create the gradient for the close button.
@param s the shape to fill.
@param top the top color.
@param bottom the bottom color.
@return the gradient.
"""
Rectangle r = s.getBounds();
int widt... | java | private Paint decodeCloseGradient(Shape s, Color top, Color bottom) {
Rectangle r = s.getBounds();
int width = r.width;
int height = r.height;
return createGradient(r.x + width / 2, r.y, r.x + width / 2, r.y + height - 1, new float[] { 0f, 1f }, new Color[] { top, bott... | [
"private",
"Paint",
"decodeCloseGradient",
"(",
"Shape",
"s",
",",
"Color",
"top",
",",
"Color",
"bottom",
")",
"{",
"Rectangle",
"r",
"=",
"s",
".",
"getBounds",
"(",
")",
";",
"int",
"width",
"=",
"r",
".",
"width",
";",
"int",
"height",
"=",
"r",
... | Create the gradient for the close button.
@param s the shape to fill.
@param top the top color.
@param bottom the bottom color.
@return the gradient. | [
"Create",
"the",
"gradient",
"for",
"the",
"close",
"button",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TitlePaneCloseButtonPainter.java#L186-L192 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/query/Criteria.java | Criteria.within | public Criteria within(Point location, @Nullable Distance distance) {
"""
Creates new {@link Predicate} for {@code !geodist}
@param location {@link Point} in degrees
@param distance
@return
"""
Assert.notNull(location, "Location must not be null!");
assertPositiveDistanceValue(distance);
predicates.... | java | public Criteria within(Point location, @Nullable Distance distance) {
Assert.notNull(location, "Location must not be null!");
assertPositiveDistanceValue(distance);
predicates.add(
new Predicate(OperationKey.WITHIN, new Object[] { location, distance != null ? distance : new Distance(0) }));
return this;
} | [
"public",
"Criteria",
"within",
"(",
"Point",
"location",
",",
"@",
"Nullable",
"Distance",
"distance",
")",
"{",
"Assert",
".",
"notNull",
"(",
"location",
",",
"\"Location must not be null!\"",
")",
";",
"assertPositiveDistanceValue",
"(",
"distance",
")",
";",
... | Creates new {@link Predicate} for {@code !geodist}
@param location {@link Point} in degrees
@param distance
@return | [
"Creates",
"new",
"{",
"@link",
"Predicate",
"}",
"for",
"{",
"@code",
"!geodist",
"}"
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/query/Criteria.java#L500-L506 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/async/WatcherManager.java | WatcherManager.validateWatcher | public boolean validateWatcher(String name, Watcher watcher) {
"""
Validate whether the Watcher register to the Service.
@param name
the Service Name.
@param watcher
the Watcher Object.
@return
return true if the Watcher registered to the Service.
"""
synchronized(watchers){
if(watc... | java | public boolean validateWatcher(String name, Watcher watcher){
synchronized(watchers){
if(watchers.containsKey(name)){
return watchers.get(name).contains(watcher);
}
return false;
}
} | [
"public",
"boolean",
"validateWatcher",
"(",
"String",
"name",
",",
"Watcher",
"watcher",
")",
"{",
"synchronized",
"(",
"watchers",
")",
"{",
"if",
"(",
"watchers",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"watchers",
".",
"get",
"(",
"... | Validate whether the Watcher register to the Service.
@param name
the Service Name.
@param watcher
the Watcher Object.
@return
return true if the Watcher registered to the Service. | [
"Validate",
"whether",
"the",
"Watcher",
"register",
"to",
"the",
"Service",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/async/WatcherManager.java#L135-L142 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java | GenericEncodingStrategy.getLobFromLocator | private void getLobFromLocator(CodeAssembler a, StorablePropertyInfo info) {
"""
Generates code to get a Lob from a locator from RawSupport. RawSupport
instance, Storable instance, property name and long locator must be on
the stack. Result is a Lob on the stack, which may be null.
"""
if (!info.isL... | java | private void getLobFromLocator(CodeAssembler a, StorablePropertyInfo info) {
if (!info.isLob()) {
throw new IllegalArgumentException();
}
TypeDesc type = info.getStorageType();
String name;
if (Blob.class.isAssignableFrom(type.toClass())) {
name =... | [
"private",
"void",
"getLobFromLocator",
"(",
"CodeAssembler",
"a",
",",
"StorablePropertyInfo",
"info",
")",
"{",
"if",
"(",
"!",
"info",
".",
"isLob",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"TypeDesc",
"type",
... | Generates code to get a Lob from a locator from RawSupport. RawSupport
instance, Storable instance, property name and long locator must be on
the stack. Result is a Lob on the stack, which may be null. | [
"Generates",
"code",
"to",
"get",
"a",
"Lob",
"from",
"a",
"locator",
"from",
"RawSupport",
".",
"RawSupport",
"instance",
"Storable",
"instance",
"property",
"name",
"and",
"long",
"locator",
"must",
"be",
"on",
"the",
"stack",
".",
"Result",
"is",
"a",
"... | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java#L1808-L1826 |
pmlopes/yoke | framework/src/main/java/com/jetdrone/vertx/yoke/sockjs/impl/EventBusBridgeImpl.java | EventBusBridgeImpl.checkMatches | private boolean checkMatches(boolean inbound, String address, Object body) {
"""
/*
Empty inboundPermitted means reject everything - this is the default.
If at least one match is supplied and all the fields of any match match then the message inboundPermitted,
this means that specifying one match with a JSON em... | java | private boolean checkMatches(boolean inbound, String address, Object body) {
List<PermittedOptions> matches = inbound ? inboundPermitted : outboundPermitted;
for (PermittedOptions matchHolder : matches) {
String matchAddress = matchHolder.getAddress();
String matchRegex;
if (matchAddress == ... | [
"private",
"boolean",
"checkMatches",
"(",
"boolean",
"inbound",
",",
"String",
"address",
",",
"Object",
"body",
")",
"{",
"List",
"<",
"PermittedOptions",
">",
"matches",
"=",
"inbound",
"?",
"inboundPermitted",
":",
"outboundPermitted",
";",
"for",
"(",
"Pe... | /*
Empty inboundPermitted means reject everything - this is the default.
If at least one match is supplied and all the fields of any match match then the message inboundPermitted,
this means that specifying one match with a JSON empty object means everything is accepted | [
"/",
"*",
"Empty",
"inboundPermitted",
"means",
"reject",
"everything",
"-",
"this",
"is",
"the",
"default",
".",
"If",
"at",
"least",
"one",
"match",
"is",
"supplied",
"and",
"all",
"the",
"fields",
"of",
"any",
"match",
"match",
"then",
"the",
"message",... | train | https://github.com/pmlopes/yoke/blob/fe8a64036f09fb745f0644faddd46162d64faf3c/framework/src/main/java/com/jetdrone/vertx/yoke/sockjs/impl/EventBusBridgeImpl.java#L423-L448 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/commands/ProcessControlHelper.java | ProcessControlHelper.createDumps | private ReturnCode createDumps(Set<JavaDumpAction> javaDumpActions, boolean introspect, String dumpTimestamp) {
"""
Run the relevant command for dumping the system
@param javaDumpActions the java dump actions to take place
@param systemDump whether this is a full dump (true) or just javadump (false)
@par... | java | private ReturnCode createDumps(Set<JavaDumpAction> javaDumpActions, boolean introspect, String dumpTimestamp) {
ServerLock serverLock = ServerLock.createTestLock(bootProps);
ReturnCode dumpRc = ReturnCode.OK;
// The lock file may have been (erroneously) deleted: this can happen on linux
... | [
"private",
"ReturnCode",
"createDumps",
"(",
"Set",
"<",
"JavaDumpAction",
">",
"javaDumpActions",
",",
"boolean",
"introspect",
",",
"String",
"dumpTimestamp",
")",
"{",
"ServerLock",
"serverLock",
"=",
"ServerLock",
".",
"createTestLock",
"(",
"bootProps",
")",
... | Run the relevant command for dumping the system
@param javaDumpActions the java dump actions to take place
@param systemDump whether this is a full dump (true) or just javadump (false)
@param dumpTimestamp the timestamp on the server dump packager of the full dump
@return the return code from attempting to run ... | [
"Run",
"the",
"relevant",
"command",
"for",
"dumping",
"the",
"system"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/commands/ProcessControlHelper.java#L439-L474 |
matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikRequest.java | PiwikRequest.setCustomTrackingParameter | public void setCustomTrackingParameter(String key, Object value) {
"""
Set a custom tracking parameter whose toString() value will be sent to
the Piwik server. These parameters are stored separately from named Piwik
parameters, meaning it is not possible to overwrite or clear named Piwik
parameters with this m... | java | public void setCustomTrackingParameter(String key, Object value){
if (key == null){
throw new NullPointerException("Key cannot be null.");
}
if (value == null){
customTrackingParameters.remove(key);
}
else{
List l = new ArrayList();
... | [
"public",
"void",
"setCustomTrackingParameter",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Key cannot be null.\"",
")",
";",
"}",
"if",
"(",
"value",
"==",... | Set a custom tracking parameter whose toString() value will be sent to
the Piwik server. These parameters are stored separately from named Piwik
parameters, meaning it is not possible to overwrite or clear named Piwik
parameters with this method. A custom parameter that has the same name
as a named Piwik parameter wi... | [
"Set",
"a",
"custom",
"tracking",
"parameter",
"whose",
"toString",
"()",
"value",
"will",
"be",
"sent",
"to",
"the",
"Piwik",
"server",
".",
"These",
"parameters",
"are",
"stored",
"separately",
"from",
"named",
"Piwik",
"parameters",
"meaning",
"it",
"is",
... | train | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikRequest.java#L469-L481 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/translate/AggregateTranslator.java | AggregateTranslator.translate | @Override
@GwtIncompatible("incompatible method")
public int translate(final CharSequence input, final int index, final Writer out) throws IOException {
"""
The first translator to consume codepoints from the input is the 'winner'.
Execution stops with the number of consumed codepoints being returned.
{@... | java | @Override
@GwtIncompatible("incompatible method")
public int translate(final CharSequence input, final int index, final Writer out) throws IOException {
for (final CharSequenceTranslator translator : translators) {
final int consumed = translator.translate(input, index, out);
if(... | [
"@",
"Override",
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"int",
"translate",
"(",
"final",
"CharSequence",
"input",
",",
"final",
"int",
"index",
",",
"final",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"for",
"(",
"fina... | The first translator to consume codepoints from the input is the 'winner'.
Execution stops with the number of consumed codepoints being returned.
{@inheritDoc} | [
"The",
"first",
"translator",
"to",
"consume",
"codepoints",
"from",
"the",
"input",
"is",
"the",
"winner",
".",
"Execution",
"stops",
"with",
"the",
"number",
"of",
"consumed",
"codepoints",
"being",
"returned",
".",
"{"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/translate/AggregateTranslator.java#L55-L65 |
google/truth | core/src/main/java/com/google/common/truth/FailureMetadata.java | FailureMetadata.withMessage | FailureMetadata withMessage(String format, Object[] args) {
"""
Returns a new instance whose failures will contain the given message. The way for Truth users
to set a message is {@code check().withMessage(...).that(...)} (for calls from within a {@code
Subject}) or {@link Truth#assertWithMessage} (for most other... | java | FailureMetadata withMessage(String format, Object[] args) {
ImmutableList<LazyMessage> messages = append(this.messages, new LazyMessage(format, args));
return derive(messages, steps);
} | [
"FailureMetadata",
"withMessage",
"(",
"String",
"format",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"ImmutableList",
"<",
"LazyMessage",
">",
"messages",
"=",
"append",
"(",
"this",
".",
"messages",
",",
"new",
"LazyMessage",
"(",
"format",
",",
"args",
... | Returns a new instance whose failures will contain the given message. The way for Truth users
to set a message is {@code check().withMessage(...).that(...)} (for calls from within a {@code
Subject}) or {@link Truth#assertWithMessage} (for most other calls). | [
"Returns",
"a",
"new",
"instance",
"whose",
"failures",
"will",
"contain",
"the",
"given",
"message",
".",
"The",
"way",
"for",
"Truth",
"users",
"to",
"set",
"a",
"message",
"is",
"{"
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/FailureMetadata.java#L163-L166 |
jmrozanec/cron-utils | src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java | CronDefinitionBuilder.instanceDefinitionFor | public static CronDefinition instanceDefinitionFor(final CronType cronType) {
"""
Creates CronDefinition instance matching cronType specification.
@param cronType - some cron type. If null, a RuntimeException will be raised.
@return CronDefinition instance if definition is found; a RuntimeException otherwise.
... | java | public static CronDefinition instanceDefinitionFor(final CronType cronType) {
switch (cronType) {
case CRON4J:
return cron4j();
case QUARTZ:
return quartz();
case UNIX:
return unixCrontab();
case SPRING:
... | [
"public",
"static",
"CronDefinition",
"instanceDefinitionFor",
"(",
"final",
"CronType",
"cronType",
")",
"{",
"switch",
"(",
"cronType",
")",
"{",
"case",
"CRON4J",
":",
"return",
"cron4j",
"(",
")",
";",
"case",
"QUARTZ",
":",
"return",
"quartz",
"(",
")",... | Creates CronDefinition instance matching cronType specification.
@param cronType - some cron type. If null, a RuntimeException will be raised.
@return CronDefinition instance if definition is found; a RuntimeException otherwise. | [
"Creates",
"CronDefinition",
"instance",
"matching",
"cronType",
"specification",
"."
] | train | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java#L376-L389 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/entityentry/impl/OgmEntityEntryState.java | OgmEntityEntryState.setAssociation | public void setAssociation(String collectionRole, Association association) {
"""
Set the association in the entry state.
@param collectionRole the role of the association
@param association the association
"""
if ( associations == null ) {
associations = new HashMap<>();
}
associations.put( collec... | java | public void setAssociation(String collectionRole, Association association) {
if ( associations == null ) {
associations = new HashMap<>();
}
associations.put( collectionRole, association );
} | [
"public",
"void",
"setAssociation",
"(",
"String",
"collectionRole",
",",
"Association",
"association",
")",
"{",
"if",
"(",
"associations",
"==",
"null",
")",
"{",
"associations",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"}",
"associations",
".",
"put",
... | Set the association in the entry state.
@param collectionRole the role of the association
@param association the association | [
"Set",
"the",
"association",
"in",
"the",
"entry",
"state",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/entityentry/impl/OgmEntityEntryState.java#L76-L81 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java | SpiderTransaction.deleteShardedLinkRow | public void deleteShardedLinkRow(FieldDefinition linkDef, String owningObjID, int shardNumber) {
"""
Delete the shard row for the given sharded link and shard number.
@param linkDef {@link FieldDefinition} of a sharded link.
@param owningObjID ID of object that owns the link.
@param shardNumber Shar... | java | public void deleteShardedLinkRow(FieldDefinition linkDef, String owningObjID, int shardNumber) {
assert linkDef.isSharded();
assert shardNumber > 0;
deleteRow(SpiderService.termsStoreName(linkDef.getTableDef()),
SpiderService.shardedLinkTermRowKey(linkDef, owningObjID, shar... | [
"public",
"void",
"deleteShardedLinkRow",
"(",
"FieldDefinition",
"linkDef",
",",
"String",
"owningObjID",
",",
"int",
"shardNumber",
")",
"{",
"assert",
"linkDef",
".",
"isSharded",
"(",
")",
";",
"assert",
"shardNumber",
">",
"0",
";",
"deleteRow",
"(",
"Spi... | Delete the shard row for the given sharded link and shard number.
@param linkDef {@link FieldDefinition} of a sharded link.
@param owningObjID ID of object that owns the link.
@param shardNumber Shard number of row to be deleted. Must be > 0.
@see #addShardedLinkValue(String, FieldDefinition,... | [
"Delete",
"the",
"shard",
"row",
"for",
"the",
"given",
"sharded",
"link",
"and",
"shard",
"number",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java#L449-L454 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java | HttpConnection.outputNotify | public void outputNotify(OutputStream out, int action, Object ignoredData)
throws IOException {
"""
Output Notifications.
Trigger header and/or filters from output stream observations.
Also finalizes method of indicating response content length.
Called as a result of the connection subscribing for notif... | java | public void outputNotify(OutputStream out, int action, Object ignoredData)
throws IOException
{
if (_response==null)
return;
switch(action)
{
case OutputObserver.__FIRST_WRITE:
if (!_firstWrite)
{
firstWrite();
... | [
"public",
"void",
"outputNotify",
"(",
"OutputStream",
"out",
",",
"int",
"action",
",",
"Object",
"ignoredData",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_response",
"==",
"null",
")",
"return",
";",
"switch",
"(",
"action",
")",
"{",
"case",
"Outpu... | Output Notifications.
Trigger header and/or filters from output stream observations.
Also finalizes method of indicating response content length.
Called as a result of the connection subscribing for notifications
to the HttpOutputStream.
@see HttpOutputStream
@param out The output stream observed.
@param action The act... | [
"Output",
"Notifications",
".",
"Trigger",
"header",
"and",
"/",
"or",
"filters",
"from",
"output",
"stream",
"observations",
".",
"Also",
"finalizes",
"method",
"of",
"indicating",
"response",
"content",
"length",
".",
"Called",
"as",
"a",
"result",
"of",
"th... | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java#L535-L573 |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/gateway/client/util/WrappedByteBuffer.java | WrappedByteBuffer.expandAt | WrappedByteBuffer expandAt(int i, int expectedRemaining) {
"""
Expands the buffer to support the expected number of remaining bytes at the specified index.
@param index the index
@param expectedRemaining the expected number of remaining bytes
@return the buffer
"""
if ((i + expectedRemaining) <=... | java | WrappedByteBuffer expandAt(int i, int expectedRemaining) {
if ((i + expectedRemaining) <= _buf.limit()) {
return this;
} else {
if ((i + expectedRemaining) <= _buf.capacity()) {
_buf.limit(i + expectedRemaining);
} else {
// reallocate ... | [
"WrappedByteBuffer",
"expandAt",
"(",
"int",
"i",
",",
"int",
"expectedRemaining",
")",
"{",
"if",
"(",
"(",
"i",
"+",
"expectedRemaining",
")",
"<=",
"_buf",
".",
"limit",
"(",
")",
")",
"{",
"return",
"this",
";",
"}",
"else",
"{",
"if",
"(",
"(",
... | Expands the buffer to support the expected number of remaining bytes at the specified index.
@param index the index
@param expectedRemaining the expected number of remaining bytes
@return the buffer | [
"Expands",
"the",
"buffer",
"to",
"support",
"the",
"expected",
"number",
"of",
"remaining",
"bytes",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/gateway/client/util/WrappedByteBuffer.java#L1185-L1207 |
spotbugs/spotbugs | spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrameComponentFactory.java | MainFrameComponentFactory.createSourceCodePanel | JPanel createSourceCodePanel() {
"""
Creates the source code panel, but does not put anything in it.
"""
Font sourceFont = new Font("Monospaced", Font.PLAIN, (int) Driver.getFontSize());
mainFrame.getSourceCodeTextPane().setFont(sourceFont);
mainFrame.getSourceCodeTextPane().setEditable... | java | JPanel createSourceCodePanel() {
Font sourceFont = new Font("Monospaced", Font.PLAIN, (int) Driver.getFontSize());
mainFrame.getSourceCodeTextPane().setFont(sourceFont);
mainFrame.getSourceCodeTextPane().setEditable(false);
mainFrame.getSourceCodeTextPane().getCaret().setSelectionVisible... | [
"JPanel",
"createSourceCodePanel",
"(",
")",
"{",
"Font",
"sourceFont",
"=",
"new",
"Font",
"(",
"\"Monospaced\"",
",",
"Font",
".",
"PLAIN",
",",
"(",
"int",
")",
"Driver",
".",
"getFontSize",
"(",
")",
")",
";",
"mainFrame",
".",
"getSourceCodeTextPane",
... | Creates the source code panel, but does not put anything in it. | [
"Creates",
"the",
"source",
"code",
"panel",
"but",
"does",
"not",
"put",
"anything",
"in",
"it",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrameComponentFactory.java#L137-L155 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/CmsUndoRedoHandler.java | CmsUndoRedoHandler.internalAddChange | void internalAddChange(String valuePath, String attributeName, int valueIndex, ChangeType changeType) {
"""
Internally adds a change to the undo stack.<p>
@param valuePath the entity value path
@param attributeName the attribute name
@param valueIndex the value index
@param changeType the change type
"""... | java | void internalAddChange(String valuePath, String attributeName, int valueIndex, ChangeType changeType) {
m_changeTimer = null;
//TODO: keep the IDs, otherwise redo will not work
CmsEntity currentData = m_entity.cloneEntity();
if (!currentData.equals(m_current.getEntityData())) {
... | [
"void",
"internalAddChange",
"(",
"String",
"valuePath",
",",
"String",
"attributeName",
",",
"int",
"valueIndex",
",",
"ChangeType",
"changeType",
")",
"{",
"m_changeTimer",
"=",
"null",
";",
"//TODO: keep the IDs, otherwise redo will not work",
"CmsEntity",
"currentData... | Internally adds a change to the undo stack.<p>
@param valuePath the entity value path
@param attributeName the attribute name
@param valueIndex the value index
@param changeType the change type | [
"Internally",
"adds",
"a",
"change",
"to",
"the",
"undo",
"stack",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/CmsUndoRedoHandler.java#L474-L485 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java | MPD9AbstractReader.processCalendarData | protected void processCalendarData(ProjectCalendar calendar, Row row) {
"""
Read calendar hours and exception data.
@param calendar parent calendar
@param row calendar hours and exception data
"""
int dayIndex = row.getInt("CD_DAY_OR_EXCEPTION");
if (dayIndex == 0)
{
processCalen... | java | protected void processCalendarData(ProjectCalendar calendar, Row row)
{
int dayIndex = row.getInt("CD_DAY_OR_EXCEPTION");
if (dayIndex == 0)
{
processCalendarException(calendar, row);
}
else
{
processCalendarHours(calendar, row, dayIndex);
}
} | [
"protected",
"void",
"processCalendarData",
"(",
"ProjectCalendar",
"calendar",
",",
"Row",
"row",
")",
"{",
"int",
"dayIndex",
"=",
"row",
".",
"getInt",
"(",
"\"CD_DAY_OR_EXCEPTION\"",
")",
";",
"if",
"(",
"dayIndex",
"==",
"0",
")",
"{",
"processCalendarExc... | Read calendar hours and exception data.
@param calendar parent calendar
@param row calendar hours and exception data | [
"Read",
"calendar",
"hours",
"and",
"exception",
"data",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L272-L283 |
Devskiller/jfairy | src/main/java/com/devskiller/jfairy/data/MapBasedDataMaster.java | MapBasedDataMaster.getStringList | @SuppressWarnings("unchecked")
@Override
public List<String> getStringList(String key) {
"""
Returns list (null safe) of elements for desired key from dataSource files
@param key desired node key
@return list of elements for desired key
@throws IllegalArgumentException if no element for key has been found
... | java | @SuppressWarnings("unchecked")
@Override
public List<String> getStringList(String key) {
return getData(key, List.class);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"List",
"<",
"String",
">",
"getStringList",
"(",
"String",
"key",
")",
"{",
"return",
"getData",
"(",
"key",
",",
"List",
".",
"class",
")",
";",
"}"
] | Returns list (null safe) of elements for desired key from dataSource files
@param key desired node key
@return list of elements for desired key
@throws IllegalArgumentException if no element for key has been found | [
"Returns",
"list",
"(",
"null",
"safe",
")",
"of",
"elements",
"for",
"desired",
"key",
"from",
"dataSource",
"files"
] | train | https://github.com/Devskiller/jfairy/blob/126d1c8b1545f725afd10f969b9d27005ac520b7/src/main/java/com/devskiller/jfairy/data/MapBasedDataMaster.java#L42-L46 |
VoltDB/voltdb | src/frontend/org/voltdb/types/VoltDecimalHelper.java | VoltDecimalHelper.roundToScale | static private final BigDecimal roundToScale(BigDecimal bd, int scale, RoundingMode mode) throws RuntimeException {
"""
Round a BigDecimal number to a scale, given the rounding mode.
Note that the precision of the result can depend not only on its original
precision and scale and the desired scale, but also on i... | java | static private final BigDecimal roundToScale(BigDecimal bd, int scale, RoundingMode mode) throws RuntimeException
{
int lostScaleDigits = bd.scale() - scale;
if (lostScaleDigits <= 0) {
return bd;
}
if (!isRoundingEnabled()) {
throw new RuntimeException(String... | [
"static",
"private",
"final",
"BigDecimal",
"roundToScale",
"(",
"BigDecimal",
"bd",
",",
"int",
"scale",
",",
"RoundingMode",
"mode",
")",
"throws",
"RuntimeException",
"{",
"int",
"lostScaleDigits",
"=",
"bd",
".",
"scale",
"(",
")",
"-",
"scale",
";",
"if... | Round a BigDecimal number to a scale, given the rounding mode.
Note that the precision of the result can depend not only on its original
precision and scale and the desired scale, but also on its value.
For example, when rounding up with scale 2:<br>
9.1999 with input scale 4 and precision 5 returns 9.20 with precision... | [
"Round",
"a",
"BigDecimal",
"number",
"to",
"a",
"scale",
"given",
"the",
"rounding",
"mode",
".",
"Note",
"that",
"the",
"precision",
"of",
"the",
"result",
"can",
"depend",
"not",
"only",
"on",
"its",
"original",
"precision",
"and",
"scale",
"and",
"the"... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/types/VoltDecimalHelper.java#L208-L225 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/Type1Font.java | Type1Font.setKerning | public boolean setKerning(int char1, int char2, int kern) {
"""
Sets the kerning between two Unicode chars.
@param char1 the first char
@param char2 the second char
@param kern the kerning to apply in normalized 1000 units
@return <code>true</code> if the kerning was applied, <code>false</code> otherwise
"... | java | public boolean setKerning(int char1, int char2, int kern) {
String first = GlyphList.unicodeToName(char1);
if (first == null)
return false;
String second = GlyphList.unicodeToName(char2);
if (second == null)
return false;
Object obj[] = (Object[])KernPairs... | [
"public",
"boolean",
"setKerning",
"(",
"int",
"char1",
",",
"int",
"char2",
",",
"int",
"kern",
")",
"{",
"String",
"first",
"=",
"GlyphList",
".",
"unicodeToName",
"(",
"char1",
")",
";",
"if",
"(",
"first",
"==",
"null",
")",
"return",
"false",
";",... | Sets the kerning between two Unicode chars.
@param char1 the first char
@param char2 the second char
@param kern the kerning to apply in normalized 1000 units
@return <code>true</code> if the kerning was applied, <code>false</code> otherwise | [
"Sets",
"the",
"kerning",
"between",
"two",
"Unicode",
"chars",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/Type1Font.java#L787-L813 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/shared/RenderContext.java | RenderContext.usePrimaryMsg | public boolean usePrimaryMsg(long msgId, long fallbackId) {
"""
Returns {@code true} if the primary msg should be used instead of the fallback.
"""
// Note: we need to make sure the fallback msg is actually present if we are going to fallback.
// use getMsgParts() since if the bundle is a RenderOnlySoy... | java | public boolean usePrimaryMsg(long msgId, long fallbackId) {
// Note: we need to make sure the fallback msg is actually present if we are going to fallback.
// use getMsgParts() since if the bundle is a RenderOnlySoyMsgBundleImpl then this will be
// allocation free.
return !msgBundle.getMsgParts(msgId).... | [
"public",
"boolean",
"usePrimaryMsg",
"(",
"long",
"msgId",
",",
"long",
"fallbackId",
")",
"{",
"// Note: we need to make sure the fallback msg is actually present if we are going to fallback.",
"// use getMsgParts() since if the bundle is a RenderOnlySoyMsgBundleImpl then this will be",
... | Returns {@code true} if the primary msg should be used instead of the fallback. | [
"Returns",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/shared/RenderContext.java#L179-L184 |
aws/aws-sdk-java | aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/transfer/ArchiveTransferManager.java | ArchiveTransferManager.appendToFile | private void appendToFile(RandomAccessFile output, InputStream input)
throws IOException {
"""
Writes the data from the given input stream to the given output stream.
"""
byte[] buffer = new byte[1024 * 1024];
int bytesRead = 0;
do {
bytesRead = input.read(buffer... | java | private void appendToFile(RandomAccessFile output, InputStream input)
throws IOException {
byte[] buffer = new byte[1024 * 1024];
int bytesRead = 0;
do {
bytesRead = input.read(buffer);
if (bytesRead < 0)
break;
output.write(buffer,... | [
"private",
"void",
"appendToFile",
"(",
"RandomAccessFile",
"output",
",",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"1024",
"*",
"1024",
"]",
";",
"int",
"bytesRead",
"=",
"0",
";",
"... | Writes the data from the given input stream to the given output stream. | [
"Writes",
"the",
"data",
"from",
"the",
"given",
"input",
"stream",
"to",
"the",
"given",
"output",
"stream",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/transfer/ArchiveTransferManager.java#L660-L671 |
jmrozanec/cron-utils | src/main/java/com/cronutils/model/time/TimeNode.java | TimeNode.getValueFromList | @VisibleForTesting
int getValueFromList(final List<Integer> values, int index, final AtomicInteger shift) {
"""
Obtain value from list considering specified index and required shifts.
@param values - possible values
@param index - index to be considered
@param shift - shifts that should be applied
@ret... | java | @VisibleForTesting
int getValueFromList(final List<Integer> values, int index, final AtomicInteger shift) {
Preconditions.checkNotNullNorEmpty(values, "List must not be empty");
if (index < 0) {
index = index + values.size();
shift.incrementAndGet();
return getVal... | [
"@",
"VisibleForTesting",
"int",
"getValueFromList",
"(",
"final",
"List",
"<",
"Integer",
">",
"values",
",",
"int",
"index",
",",
"final",
"AtomicInteger",
"shift",
")",
"{",
"Preconditions",
".",
"checkNotNullNorEmpty",
"(",
"values",
",",
"\"List must not be e... | Obtain value from list considering specified index and required shifts.
@param values - possible values
@param index - index to be considered
@param shift - shifts that should be applied
@return int - required value from values list | [
"Obtain",
"value",
"from",
"list",
"considering",
"specified",
"index",
"and",
"required",
"shifts",
"."
] | train | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/time/TimeNode.java#L129-L143 |
offbynull/coroutines | instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SimpleClassWriter.java | SimpleClassWriter.getCommonSuperClass | @Override
protected String getCommonSuperClass(final String type1, final String type2) {
"""
Derives common super class from the super name mapping passed in to the constructor.
@param type1 the internal name of a class.
@param type2 the internal name of another class.
@return the internal name of the commo... | java | @Override
protected String getCommonSuperClass(final String type1, final String type2) {
Validate.notNull(type1);
Validate.notNull(type2);
infoRepo.getInformation(type1);
LinkedHashSet<String> type1Hierarchy = flattenHierarchy(type1);
LinkedHashSet<String> type2Hiera... | [
"@",
"Override",
"protected",
"String",
"getCommonSuperClass",
"(",
"final",
"String",
"type1",
",",
"final",
"String",
"type2",
")",
"{",
"Validate",
".",
"notNull",
"(",
"type1",
")",
";",
"Validate",
".",
"notNull",
"(",
"type2",
")",
";",
"infoRepo",
"... | Derives common super class from the super name mapping passed in to the constructor.
@param type1 the internal name of a class.
@param type2 the internal name of another class.
@return the internal name of the common super class of the two given classes
@throws NullPointerException if any argument is {@code null} | [
"Derives",
"common",
"super",
"class",
"from",
"the",
"super",
"name",
"mapping",
"passed",
"in",
"to",
"the",
"constructor",
"."
] | train | https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SimpleClassWriter.java#L69-L87 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/util/retry/Retry.java | Retry.wrapForRetry | public static <T> Observable<T> wrapForRetry(Observable<T> source, int maxAttempts, Delay retryDelay) {
"""
Wrap an {@link Observable} so that it will retry on all errors. The retry will occur for a maximum number of
attempts and with a provided {@link Delay} between each attempt.
@param source the {@link Obse... | java | public static <T> Observable<T> wrapForRetry(Observable<T> source, int maxAttempts, Delay retryDelay) {
return wrapForRetry(source, new RetryWithDelayHandler(maxAttempts, retryDelay));
} | [
"public",
"static",
"<",
"T",
">",
"Observable",
"<",
"T",
">",
"wrapForRetry",
"(",
"Observable",
"<",
"T",
">",
"source",
",",
"int",
"maxAttempts",
",",
"Delay",
"retryDelay",
")",
"{",
"return",
"wrapForRetry",
"(",
"source",
",",
"new",
"RetryWithDela... | Wrap an {@link Observable} so that it will retry on all errors. The retry will occur for a maximum number of
attempts and with a provided {@link Delay} between each attempt.
@param source the {@link Observable} to wrap.
@param maxAttempts the maximum number of times to attempt a retry. It will be capped at <code>{@lin... | [
"Wrap",
"an",
"{",
"@link",
"Observable",
"}",
"so",
"that",
"it",
"will",
"retry",
"on",
"all",
"errors",
".",
"The",
"retry",
"will",
"occur",
"for",
"a",
"maximum",
"number",
"of",
"attempts",
"and",
"with",
"a",
"provided",
"{",
"@link",
"Delay",
"... | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/util/retry/Retry.java#L65-L67 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java | GeneratedDConnectionDaoImpl.queryByCreatedDate | public Iterable<DConnection> queryByCreatedDate(java.util.Date createdDate) {
"""
query-by method for field createdDate
@param createdDate the specified attribute
@return an Iterable of DConnections for the specified createdDate
"""
return queryByField(null, DConnectionMapper.Field.CREATEDDATE.getFieldNa... | java | public Iterable<DConnection> queryByCreatedDate(java.util.Date createdDate) {
return queryByField(null, DConnectionMapper.Field.CREATEDDATE.getFieldName(), createdDate);
} | [
"public",
"Iterable",
"<",
"DConnection",
">",
"queryByCreatedDate",
"(",
"java",
".",
"util",
".",
"Date",
"createdDate",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DConnectionMapper",
".",
"Field",
".",
"CREATEDDATE",
".",
"getFieldName",
"(",
")... | query-by method for field createdDate
@param createdDate the specified attribute
@return an Iterable of DConnections for the specified createdDate | [
"query",
"-",
"by",
"method",
"for",
"field",
"createdDate"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java#L70-L72 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_mitigationProfiles_ipMitigationProfile_GET | public OvhMitigationProfile ip_mitigationProfiles_ipMitigationProfile_GET(String ip, String ipMitigationProfile) throws IOException {
"""
Get this object properties
REST: GET /ip/{ip}/mitigationProfiles/{ipMitigationProfile}
@param ip [required]
@param ipMitigationProfile [required]
"""
String qPath = "... | java | public OvhMitigationProfile ip_mitigationProfiles_ipMitigationProfile_GET(String ip, String ipMitigationProfile) throws IOException {
String qPath = "/ip/{ip}/mitigationProfiles/{ipMitigationProfile}";
StringBuilder sb = path(qPath, ip, ipMitigationProfile);
String resp = exec(qPath, "GET", sb.toString(), null);
... | [
"public",
"OvhMitigationProfile",
"ip_mitigationProfiles_ipMitigationProfile_GET",
"(",
"String",
"ip",
",",
"String",
"ipMitigationProfile",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/mitigationProfiles/{ipMitigationProfile}\"",
";",
"StringBuilder",
... | Get this object properties
REST: GET /ip/{ip}/mitigationProfiles/{ipMitigationProfile}
@param ip [required]
@param ipMitigationProfile [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L900-L905 |
jenkinsci/ssh-slaves-plugin | src/main/java/com/trilead/ssh2/jenkins/SFTPClient.java | SFTPClient.chmod | public void chmod(String path, int permissions) throws IOException {
"""
Change file or directory permissions.
@param path file or directory path.
@param permissions POSIX permissions.
@throws IOException in case of error.
"""
SFTPv3FileAttributes atts = new SFTPv3FileAttributes();
atts.perm... | java | public void chmod(String path, int permissions) throws IOException {
SFTPv3FileAttributes atts = new SFTPv3FileAttributes();
atts.permissions = permissions;
setstat(path, atts);
} | [
"public",
"void",
"chmod",
"(",
"String",
"path",
",",
"int",
"permissions",
")",
"throws",
"IOException",
"{",
"SFTPv3FileAttributes",
"atts",
"=",
"new",
"SFTPv3FileAttributes",
"(",
")",
";",
"atts",
".",
"permissions",
"=",
"permissions",
";",
"setstat",
"... | Change file or directory permissions.
@param path file or directory path.
@param permissions POSIX permissions.
@throws IOException in case of error. | [
"Change",
"file",
"or",
"directory",
"permissions",
"."
] | train | https://github.com/jenkinsci/ssh-slaves-plugin/blob/95f528730fc1e01b25983459927b7516ead3ee00/src/main/java/com/trilead/ssh2/jenkins/SFTPClient.java#L124-L128 |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/storage/CryptoUtil.java | CryptoUtil.getAESKey | @VisibleForTesting
byte[] getAESKey() throws IncompatibleDeviceException, CryptoException {
"""
Attempts to recover the existing AES Key or generates a new one if none is found.
@return a valid AES Key bytes
@throws IncompatibleDeviceException in the event the device can't understand the cryptographic set... | java | @VisibleForTesting
byte[] getAESKey() throws IncompatibleDeviceException, CryptoException {
final String encodedEncryptedAES = storage.retrieveString(KEY_ALIAS);
if (encodedEncryptedAES != null) {
//Return existing key
byte[] encryptedAES = Base64.decode(encodedEncryptedAES, ... | [
"@",
"VisibleForTesting",
"byte",
"[",
"]",
"getAESKey",
"(",
")",
"throws",
"IncompatibleDeviceException",
",",
"CryptoException",
"{",
"final",
"String",
"encodedEncryptedAES",
"=",
"storage",
".",
"retrieveString",
"(",
"KEY_ALIAS",
")",
";",
"if",
"(",
"encode... | Attempts to recover the existing AES Key or generates a new one if none is found.
@return a valid AES Key bytes
@throws IncompatibleDeviceException in the event the device can't understand the cryptographic settings required
@throws CryptoException if the stored RSA keys can't be recovered and should be d... | [
"Attempts",
"to",
"recover",
"the",
"existing",
"AES",
"Key",
"or",
"generates",
"a",
"new",
"one",
"if",
"none",
"is",
"found",
"."
] | train | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/storage/CryptoUtil.java#L339-L369 |
janus-project/guava.janusproject.io | guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/FluentIterable.java | FluentIterable.append | @Beta
@CheckReturnValue
public final FluentIterable<E> append(Iterable<? extends E> other) {
"""
Returns a fluent iterable whose iterators traverse first the elements of this fluent iterable,
followed by those of {@code other}. The iterators are not polled until necessary.
<p>The returned iterable's {@code... | java | @Beta
@CheckReturnValue
public final FluentIterable<E> append(Iterable<? extends E> other) {
return from(Iterables.concat(iterable, other));
} | [
"@",
"Beta",
"@",
"CheckReturnValue",
"public",
"final",
"FluentIterable",
"<",
"E",
">",
"append",
"(",
"Iterable",
"<",
"?",
"extends",
"E",
">",
"other",
")",
"{",
"return",
"from",
"(",
"Iterables",
".",
"concat",
"(",
"iterable",
",",
"other",
")",
... | Returns a fluent iterable whose iterators traverse first the elements of this fluent iterable,
followed by those of {@code other}. The iterators are not polled until necessary.
<p>The returned iterable's {@code Iterator} supports {@code remove()} when the corresponding
{@code Iterator} supports it.
@since 18.0 | [
"Returns",
"a",
"fluent",
"iterable",
"whose",
"iterators",
"traverse",
"first",
"the",
"elements",
"of",
"this",
"fluent",
"iterable",
"followed",
"by",
"those",
"of",
"{",
"@code",
"other",
"}",
".",
"The",
"iterators",
"are",
"not",
"polled",
"until",
"ne... | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/FluentIterable.java#L174-L178 |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java | SshUtilities.getRunningDockerContainerId | public static String getRunningDockerContainerId( Session session, String containerName ) throws JSchException, IOException {
"""
Get the container id of a running docker container.
@param session the session to use.
@param containerName the name of the container, used in a grep filter.
@return the id of the ... | java | public static String getRunningDockerContainerId( Session session, String containerName ) throws JSchException, IOException {
String command = "docker ps | grep " + containerName;
String remoteResponseStr = launchACommand(session, command);
if (remoteResponseStr.length() == 0) {
retu... | [
"public",
"static",
"String",
"getRunningDockerContainerId",
"(",
"Session",
"session",
",",
"String",
"containerName",
")",
"throws",
"JSchException",
",",
"IOException",
"{",
"String",
"command",
"=",
"\"docker ps | grep \"",
"+",
"containerName",
";",
"String",
"re... | Get the container id of a running docker container.
@param session the session to use.
@param containerName the name of the container, used in a grep filter.
@return the id of the container or null.
@throws JSchException
@throws IOException | [
"Get",
"the",
"container",
"id",
"of",
"a",
"running",
"docker",
"container",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java#L162-L185 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/lang/NativeLoader.java | NativeLoader.loadLibrary0 | static void loadLibrary0(String pLibrary, String pResource, ClassLoader pLoader) {
"""
Loads a native library.
@param pLibrary name of the library
@param pResource name of the resource
@param pLoader the class loader to use
@throws UnsatisfiedLinkError
"""
if (pLibrary == null) {
... | java | static void loadLibrary0(String pLibrary, String pResource, ClassLoader pLoader) {
if (pLibrary == null) {
throw new IllegalArgumentException("library == null");
}
// Try loading normal way
UnsatisfiedLinkError unsatisfied;
try {
System.loadLibrar... | [
"static",
"void",
"loadLibrary0",
"(",
"String",
"pLibrary",
",",
"String",
"pResource",
",",
"ClassLoader",
"pLoader",
")",
"{",
"if",
"(",
"pLibrary",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"library == null\"",
")",
";",
"... | Loads a native library.
@param pLibrary name of the library
@param pResource name of the resource
@param pLoader the class loader to use
@throws UnsatisfiedLinkError | [
"Loads",
"a",
"native",
"library",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/lang/NativeLoader.java#L230-L276 |
gosu-lang/gosu-lang | gosu-lab/src/main/java/editor/plugin/typeloader/java/JavaDocument.java | JavaDocument.remove | @Override
public void remove( int offset, int length ) throws BadLocationException {
"""
/*
Override to apply syntax highlighting after the document has been updated
"""
super.remove( offset, length );
processChangedLines( offset, 0 );
} | java | @Override
public void remove( int offset, int length ) throws BadLocationException
{
super.remove( offset, length );
processChangedLines( offset, 0 );
} | [
"@",
"Override",
"public",
"void",
"remove",
"(",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"BadLocationException",
"{",
"super",
".",
"remove",
"(",
"offset",
",",
"length",
")",
";",
"processChangedLines",
"(",
"offset",
",",
"0",
")",
";",
... | /*
Override to apply syntax highlighting after the document has been updated | [
"/",
"*",
"Override",
"to",
"apply",
"syntax",
"highlighting",
"after",
"the",
"document",
"has",
"been",
"updated"
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-lab/src/main/java/editor/plugin/typeloader/java/JavaDocument.java#L139-L144 |
tango-controls/JTango | server/src/main/java/org/tango/server/properties/AttributePropertiesManager.java | AttributePropertiesManager.getAttributePropertyFromDB | public String getAttributePropertyFromDB(final String attributeName, final String propertyName) throws DevFailed {
"""
Get an attribute property from tango db
@param attributeName
@param propertyName
@return The property
@throws DevFailed
"""
xlogger.entry(propertyName);
String[] result =... | java | public String getAttributePropertyFromDB(final String attributeName, final String propertyName) throws DevFailed {
xlogger.entry(propertyName);
String[] result = new String[] {};
final Map<String, String[]> prop = DatabaseFactory.getDatabase().getAttributeProperties(deviceName,
a... | [
"public",
"String",
"getAttributePropertyFromDB",
"(",
"final",
"String",
"attributeName",
",",
"final",
"String",
"propertyName",
")",
"throws",
"DevFailed",
"{",
"xlogger",
".",
"entry",
"(",
"propertyName",
")",
";",
"String",
"[",
"]",
"result",
"=",
"new",
... | Get an attribute property from tango db
@param attributeName
@param propertyName
@return The property
@throws DevFailed | [
"Get",
"an",
"attribute",
"property",
"from",
"tango",
"db"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/properties/AttributePropertiesManager.java#L108-L124 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/rules/patterns/PatternToken.java | PatternToken.setStringPosException | public void setStringPosException(
String token, boolean regExp, boolean inflected,
boolean negation, boolean scopeNext, boolean scopePrevious,
String posToken, boolean posRegExp, boolean posNegation, Boolean caseSensitivity) {
"""
Sets a string and/or pos exception for matching token... | java | public void setStringPosException(
String token, boolean regExp, boolean inflected,
boolean negation, boolean scopeNext, boolean scopePrevious,
String posToken, boolean posRegExp, boolean posNegation, Boolean caseSensitivity) {
PatternToken exception = new PatternToken(token, caseSensi... | [
"public",
"void",
"setStringPosException",
"(",
"String",
"token",
",",
"boolean",
"regExp",
",",
"boolean",
"inflected",
",",
"boolean",
"negation",
",",
"boolean",
"scopeNext",
",",
"boolean",
"scopePrevious",
",",
"String",
"posToken",
",",
"boolean",
"posRegEx... | Sets a string and/or pos exception for matching tokens.
@param token The string in the exception.
@param regExp True if the string is specified as a regular expression.
@param inflected True if the string is a base form (lemma).
@param negation True if the exception is negated.
@param scopeNext True if the exception sc... | [
"Sets",
"a",
"string",
"and",
"/",
"or",
"pos",
"exception",
"for",
"matching",
"tokens",
"."
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/patterns/PatternToken.java#L332-L341 |
JoeKerouac/utils | src/main/java/com/joe/utils/reflect/ByteCodeUtils.java | ByteCodeUtils.getDesc | public static String getDesc(Class<?> returnType, Class<?>... paramTypes) {
"""
获取指定参数类型、返回值的方法的byte code说明
@param returnType 方法返回值
@param paramTypes 方法参数
@return byte code方法说明
"""
StringBuilder sb = new StringBuilder();
sb.append("(");
for (Class<?> type : paramTypes) {
... | java | public static String getDesc(Class<?> returnType, Class<?>... paramTypes) {
StringBuilder sb = new StringBuilder();
sb.append("(");
for (Class<?> type : paramTypes) {
sb.append(ByteCodeUtils.getByteCodeType(type));
}
sb.append(")");
// sb.append(StringU... | [
"public",
"static",
"String",
"getDesc",
"(",
"Class",
"<",
"?",
">",
"returnType",
",",
"Class",
"<",
"?",
">",
"...",
"paramTypes",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"(\"",
")",
... | 获取指定参数类型、返回值的方法的byte code说明
@param returnType 方法返回值
@param paramTypes 方法参数
@return byte code方法说明 | [
"获取指定参数类型、返回值的方法的byte",
"code说明"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/reflect/ByteCodeUtils.java#L104-L114 |
dihedron/dihedron-commons | src/main/java/org/dihedron/patterns/functional/Functional.java | Functional.forEach | public static final <S, E> S forEach(List<E> list, S state, Fx<S, E> functor) {
"""
Applies the given functor to all elements in the input list.
@param list
the list to which the functor will be applied.
@param state
an state variable, that will be used as the return vale for the iteration.
@param functor
... | java | public static final <S, E> S forEach(List<E> list, S state, Fx<S, E> functor) {
return new FunctionalList<S, E>(list).forEach(state, functor);
} | [
"public",
"static",
"final",
"<",
"S",
",",
"E",
">",
"S",
"forEach",
"(",
"List",
"<",
"E",
">",
"list",
",",
"S",
"state",
",",
"Fx",
"<",
"S",
",",
"E",
">",
"functor",
")",
"{",
"return",
"new",
"FunctionalList",
"<",
"S",
",",
"E",
">",
... | Applies the given functor to all elements in the input list.
@param list
the list to which the functor will be applied.
@param state
an state variable, that will be used as the return vale for the iteration.
@param functor
a function to be applied to all elements in the list.
@return
the state object after the process... | [
"Applies",
"the",
"given",
"functor",
"to",
"all",
"elements",
"in",
"the",
"input",
"list",
"."
] | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/patterns/functional/Functional.java#L71-L73 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.Val | public JBBPDslBuilder Val(final String name, final String expression) {
"""
Add virtual field which not be read but its value will be calculated by expression
@param name name of the value, it must not be null or empty
@param expression expression to calculate value, it must not be null or empty
@return... | java | public JBBPDslBuilder Val(final String name, final String expression) {
final Item item = new ItemVal(
assertTextNotNullAndTrimmedNotEmpty(name),
assertExpressionChars(assertTextNotNullAndTrimmedNotEmpty(expression)).trim()
);
this.addItem(item);
return this;
} | [
"public",
"JBBPDslBuilder",
"Val",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"expression",
")",
"{",
"final",
"Item",
"item",
"=",
"new",
"ItemVal",
"(",
"assertTextNotNullAndTrimmedNotEmpty",
"(",
"name",
")",
",",
"assertExpressionChars",
"(",
"a... | Add virtual field which not be read but its value will be calculated by expression
@param name name of the value, it must not be null or empty
@param expression expression to calculate value, it must not be null or empty
@return the builder instance, must not be null | [
"Add",
"virtual",
"field",
"which",
"not",
"be",
"read",
"but",
"its",
"value",
"will",
"be",
"calculated",
"by",
"expression"
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L392-L399 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java | ModificationBuilderTarget.modifyFile | public T modifyFile(final String name, final List<String> path, final byte[] existingHash, final byte[] newHash, final boolean isDirectory) {
"""
Modify a misc file.
@param name the file name
@param path the relative path
@param existingHash the existing hash
@param newHash the new hash of the modified conte... | java | public T modifyFile(final String name, final List<String> path, final byte[] existingHash, final byte[] newHash, final boolean isDirectory) {
return modifyFile(name, path, existingHash, newHash, isDirectory, null);
} | [
"public",
"T",
"modifyFile",
"(",
"final",
"String",
"name",
",",
"final",
"List",
"<",
"String",
">",
"path",
",",
"final",
"byte",
"[",
"]",
"existingHash",
",",
"final",
"byte",
"[",
"]",
"newHash",
",",
"final",
"boolean",
"isDirectory",
")",
"{",
... | Modify a misc file.
@param name the file name
@param path the relative path
@param existingHash the existing hash
@param newHash the new hash of the modified content
@param isDirectory whether the file is a directory or not
@return the builder | [
"Modify",
"a",
"misc",
"file",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L136-L138 |
NLPchina/ansj_seg | src/main/java/org/ansj/library/DicLibrary.java | DicLibrary.insertOrCreate | public static void insertOrCreate(String key, String keyword, String nature, int freq) {
"""
关键词增加
@param keyword 所要增加的关键词
@param nature 关键词的词性
@param freq 关键词的词频
"""
Forest dic = get(key);
if(dic==null){
dic = new Forest() ;
put(key,key,dic);
}
String[] paramers = new String[2];
paramers[... | java | public static void insertOrCreate(String key, String keyword, String nature, int freq) {
Forest dic = get(key);
if(dic==null){
dic = new Forest() ;
put(key,key,dic);
}
String[] paramers = new String[2];
paramers[0] = nature;
paramers[1] = String.valueOf(freq);
Value value = new Value(keyword, parame... | [
"public",
"static",
"void",
"insertOrCreate",
"(",
"String",
"key",
",",
"String",
"keyword",
",",
"String",
"nature",
",",
"int",
"freq",
")",
"{",
"Forest",
"dic",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"dic",
"==",
"null",
")",
"{",
"dic",
... | 关键词增加
@param keyword 所要增加的关键词
@param nature 关键词的词性
@param freq 关键词的词频 | [
"关键词增加"
] | train | https://github.com/NLPchina/ansj_seg/blob/1addfa08c9dc86872fcdb06c7f0955dd5d197585/src/main/java/org/ansj/library/DicLibrary.java#L74-L85 |
m-m-m/util | resource/src/main/java/net/sf/mmm/util/resource/base/AbstractBrowsableResourceFactory.java | AbstractBrowsableResourceFactory.registerProvider | public void registerProvider(DataResourceProvider<? extends DataResource> provider, String schemaPrefix) {
"""
This method registers the given {@code provider} for the given {@code schemaPrefix}.
@param provider is the {@link DataResourceProvider} to register.
@param schemaPrefix is the {@link ResourceUriImpl#... | java | public void registerProvider(DataResourceProvider<? extends DataResource> provider, String schemaPrefix) {
getInitializationState().requireNotInitilized();
Objects.requireNonNull(provider, "provider");
Objects.requireNonNull(provider.getResourceType(), "provider.resourceType");
String[] schemaPrefixes;... | [
"public",
"void",
"registerProvider",
"(",
"DataResourceProvider",
"<",
"?",
"extends",
"DataResource",
">",
"provider",
",",
"String",
"schemaPrefix",
")",
"{",
"getInitializationState",
"(",
")",
".",
"requireNotInitilized",
"(",
")",
";",
"Objects",
".",
"requi... | This method registers the given {@code provider} for the given {@code schemaPrefix}.
@param provider is the {@link DataResourceProvider} to register.
@param schemaPrefix is the {@link ResourceUriImpl#getSchemePrefix() scheme-prefix} for which the provider
shall be registered. | [
"This",
"method",
"registers",
"the",
"given",
"{",
"@code",
"provider",
"}",
"for",
"the",
"given",
"{",
"@code",
"schemaPrefix",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/resource/src/main/java/net/sf/mmm/util/resource/base/AbstractBrowsableResourceFactory.java#L52-L73 |
riversun/bigdoc | src/main/java/org/riversun/bigdoc/bin/BinFileSearcher.java | BinFileSearcher.searchPartially | public List<Long> searchPartially(File f, byte[] searchBytes, long startPosition, long maxSizeToRead) {
"""
Search for a sequence of bytes from the file within the specified size
range starting at the specified position .
@param f
@param searchBytes
a sequence of bytes you want to find
@param startPosition
... | java | public List<Long> searchPartially(File f, byte[] searchBytes, long startPosition, long maxSizeToRead) {
if (USE_NIO) {
return searchPartiallyUsingNIO(f, searchBytes, startPosition, maxSizeToRead, null);
} else {
return searchPartiallyUsingLegacy(f, searchBytes, startPosition, maxSizeToRead, null);
}
} | [
"public",
"List",
"<",
"Long",
">",
"searchPartially",
"(",
"File",
"f",
",",
"byte",
"[",
"]",
"searchBytes",
",",
"long",
"startPosition",
",",
"long",
"maxSizeToRead",
")",
"{",
"if",
"(",
"USE_NIO",
")",
"{",
"return",
"searchPartiallyUsingNIO",
"(",
"... | Search for a sequence of bytes from the file within the specified size
range starting at the specified position .
@param f
@param searchBytes
a sequence of bytes you want to find
@param startPosition
'0' means the beginning of the file
@param maxSizeToRead
max size to read.'-1' means read until the end.
@return | [
"Search",
"for",
"a",
"sequence",
"of",
"bytes",
"from",
"the",
"file",
"within",
"the",
"specified",
"size",
"range",
"starting",
"at",
"the",
"specified",
"position",
"."
] | train | https://github.com/riversun/bigdoc/blob/46bd7c9a8667be23acdb1ad8286027e4b08cff3a/src/main/java/org/riversun/bigdoc/bin/BinFileSearcher.java#L220-L226 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/TransitiveGroup.java | TransitiveGroup.checkTransitives | private void checkTransitives(Tile neighbor, String group, GroupTransition current, TileRef ref) {
"""
Check transitive tiles.
@param neighbor The current neighbor.
@param group The current group.
@param current The current transition.
@param ref The tile ref to check.
"""
if (!group.equals(curr... | java | private void checkTransitives(Tile neighbor, String group, GroupTransition current, TileRef ref)
{
if (!group.equals(current.getOut())
&& TransitionType.CENTER == mapTransition.getTransition(ref, current.getOut()).getType())
{
map.setTile(map.createTile(ref.getSheet(), r... | [
"private",
"void",
"checkTransitives",
"(",
"Tile",
"neighbor",
",",
"String",
"group",
",",
"GroupTransition",
"current",
",",
"TileRef",
"ref",
")",
"{",
"if",
"(",
"!",
"group",
".",
"equals",
"(",
"current",
".",
"getOut",
"(",
")",
")",
"&&",
"Trans... | Check transitive tiles.
@param neighbor The current neighbor.
@param group The current group.
@param current The current transition.
@param ref The tile ref to check. | [
"Check",
"transitive",
"tiles",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/TransitiveGroup.java#L319-L326 |
vincentk/joptimizer | src/main/java/com/joptimizer/util/Utils.java | Utils.calculateScaledResidual | public static double calculateScaledResidual(double[][] A, double[][] X, double[][] B) {
"""
Calculate the scaled residual
<br> ||Ax-b||_oo/( ||A||_oo . ||x||_oo + ||b||_oo ), with
<br> ||x||_oo = max(||x[i]||)
"""
DoubleMatrix2D AMatrix = DoubleFactory2D.dense.make(A);
DoubleMatrix2D XMatrix = Double... | java | public static double calculateScaledResidual(double[][] A, double[][] X, double[][] B){
DoubleMatrix2D AMatrix = DoubleFactory2D.dense.make(A);
DoubleMatrix2D XMatrix = DoubleFactory2D.dense.make(X);
DoubleMatrix2D BMatrix = DoubleFactory2D.dense.make(B);
return calculateScaledResidual(AMatrix, XMatrix, BM... | [
"public",
"static",
"double",
"calculateScaledResidual",
"(",
"double",
"[",
"]",
"[",
"]",
"A",
",",
"double",
"[",
"]",
"[",
"]",
"X",
",",
"double",
"[",
"]",
"[",
"]",
"B",
")",
"{",
"DoubleMatrix2D",
"AMatrix",
"=",
"DoubleFactory2D",
".",
"dense"... | Calculate the scaled residual
<br> ||Ax-b||_oo/( ||A||_oo . ||x||_oo + ||b||_oo ), with
<br> ||x||_oo = max(||x[i]||) | [
"Calculate",
"the",
"scaled",
"residual",
"<br",
">",
"||Ax",
"-",
"b||_oo",
"/",
"(",
"||A||_oo",
".",
"||x||_oo",
"+",
"||b||_oo",
")",
"with",
"<br",
">",
"||x||_oo",
"=",
"max",
"(",
"||x",
"[",
"i",
"]",
"||",
")"
] | train | https://github.com/vincentk/joptimizer/blob/65064c1bb0b26c7261358021e4c93d06dd43564f/src/main/java/com/joptimizer/util/Utils.java#L134-L139 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.listCompositeEntitiesWithServiceResponseAsync | public Observable<ServiceResponse<List<CompositeEntityExtractor>>> listCompositeEntitiesWithServiceResponseAsync(UUID appId, String versionId, ListCompositeEntitiesOptionalParameter listCompositeEntitiesOptionalParameter) {
"""
Gets information about the composite entity models.
@param appId The application ID.... | java | public Observable<ServiceResponse<List<CompositeEntityExtractor>>> listCompositeEntitiesWithServiceResponseAsync(UUID appId, String versionId, ListCompositeEntitiesOptionalParameter listCompositeEntitiesOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Pa... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"List",
"<",
"CompositeEntityExtractor",
">",
">",
">",
"listCompositeEntitiesWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"ListCompositeEntitiesOptionalParameter",
"listCompositeEntitie... | Gets information about the composite entity models.
@param appId The application ID.
@param versionId The version ID.
@param listCompositeEntitiesOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation... | [
"Gets",
"information",
"about",
"the",
"composite",
"entity",
"models",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L1688-L1702 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/style/stylers/AdvancedImpl.java | AdvancedImpl.tableLayout | @Override
public final void tableLayout(PdfPTable table, float[][] widths, float[] heights, int headerRows, int rowStart, PdfContentByte[] canvases) {
"""
An advanced styler may be added as event to a table by {@link StyleHelper#style(java.lang.Object, java.lang.Object, java.util.Collection) }
when the element... | java | @Override
public final void tableLayout(PdfPTable table, float[][] widths, float[] heights, int headerRows, int rowStart, PdfContentByte[] canvases) {
final int footer = widths.length - table.getFooterRows();
final int header = table.getHeaderRows();
int columns = widths[header].length - 1;
f... | [
"@",
"Override",
"public",
"final",
"void",
"tableLayout",
"(",
"PdfPTable",
"table",
",",
"float",
"[",
"]",
"[",
"]",
"widths",
",",
"float",
"[",
"]",
"heights",
",",
"int",
"headerRows",
",",
"int",
"rowStart",
",",
"PdfContentByte",
"[",
"]",
"canva... | An advanced styler may be added as event to a table by {@link StyleHelper#style(java.lang.Object, java.lang.Object, java.util.Collection) }
when the element styled is a table and the {@link EVENTMODE} is ALL or TABLE. This enables drawing near a table.
Calls {@link #draw(com.itextpdf.text.Rectangle, java.lang.String) }... | [
"An",
"advanced",
"styler",
"may",
"be",
"added",
"as",
"event",
"to",
"a",
"table",
"by",
"{",
"@link",
"StyleHelper#style",
"(",
"java",
".",
"lang",
".",
"Object",
"java",
".",
"lang",
".",
"Object",
"java",
".",
"util",
".",
"Collection",
")",
"}",... | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/stylers/AdvancedImpl.java#L391-L404 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMsgProducerImpl.java | JmsMsgProducerImpl.sendUsingConnection | private void sendUsingConnection(Destination destination, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException {
"""
This method is internal method which would send message to ME on top
of connection. This is called from Sync send and Async Send. In case of Sync send
it would hav... | java | private void sendUsingConnection(Destination destination, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "sendUsingConnection", new Object[] { destination, message, deliver... | [
"private",
"void",
"sendUsingConnection",
"(",
"Destination",
"destination",
",",
"Message",
"message",
",",
"int",
"deliveryMode",
",",
"int",
"priority",
",",
"long",
"timeToLive",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTraci... | This method is internal method which would send message to ME on top
of connection. This is called from Sync send and Async Send. In case of Sync send
it would have guarded with monitor sessionSyncLock.
@param destination
@param message
@param deliveryMode
@param priority
@param timeToLive
@throws JMSException | [
"This",
"method",
"is",
"internal",
"method",
"which",
"would",
"send",
"message",
"to",
"ME",
"on",
"top",
"of",
"connection",
".",
"This",
"is",
"called",
"from",
"Sync",
"send",
"and",
"Async",
"Send",
".",
"In",
"case",
"of",
"Sync",
"send",
"it",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMsgProducerImpl.java#L939-L972 |
kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java | URIUtils.modifyURIScheme | public static String modifyURIScheme(String uri, String newScheme) {
"""
Helper method for modifying URI scheme
@param uri
@param newScheme
@return
"""
try {
URI uriObj = new URI(uri);
return uriToString(URLUtils.modifyURIScheme(uriObj, newScheme));
}
catch (U... | java | public static String modifyURIScheme(String uri, String newScheme) {
try {
URI uriObj = new URI(uri);
return uriToString(URLUtils.modifyURIScheme(uriObj, newScheme));
}
catch (URISyntaxException e) {
try {
return (new NetworkInterfaceURI(uri)).... | [
"public",
"static",
"String",
"modifyURIScheme",
"(",
"String",
"uri",
",",
"String",
"newScheme",
")",
"{",
"try",
"{",
"URI",
"uriObj",
"=",
"new",
"URI",
"(",
"uri",
")",
";",
"return",
"uriToString",
"(",
"URLUtils",
".",
"modifyURIScheme",
"(",
"uriOb... | Helper method for modifying URI scheme
@param uri
@param newScheme
@return | [
"Helper",
"method",
"for",
"modifying",
"URI",
"scheme"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java#L282-L295 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.setInt | public static void setInt(MemorySegment[] segments, int offset, int value) {
"""
set int from segments.
@param segments target segments.
@param offset value offset.
"""
if (inFirstSegment(segments, offset, 4)) {
segments[0].putInt(offset, value);
} else {
setIntMultiSegments(segments, offset, val... | java | public static void setInt(MemorySegment[] segments, int offset, int value) {
if (inFirstSegment(segments, offset, 4)) {
segments[0].putInt(offset, value);
} else {
setIntMultiSegments(segments, offset, value);
}
} | [
"public",
"static",
"void",
"setInt",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"int",
"value",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"4",
")",
")",
"{",
"segments",
"[",
"0",
"]",
".... | set int from segments.
@param segments target segments.
@param offset value offset. | [
"set",
"int",
"from",
"segments",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L664-L670 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/ModuleSpaceMemberships.java | ModuleSpaceMemberships.fetchOne | public CMASpaceMembership fetchOne(String spaceId, String membershipId) {
"""
Fetches one space membership by its id from Contentful.
@param spaceId the space this membership is hosted by.
@param membershipId the id of the membership to be found.
@return null if no membership was found, otherwise the fou... | java | public CMASpaceMembership fetchOne(String spaceId, String membershipId) {
assertNotNull(spaceId, "spaceId");
assertNotNull(membershipId, "membershipId");
return service.fetchOne(spaceId, membershipId).blockingFirst();
} | [
"public",
"CMASpaceMembership",
"fetchOne",
"(",
"String",
"spaceId",
",",
"String",
"membershipId",
")",
"{",
"assertNotNull",
"(",
"spaceId",
",",
"\"spaceId\"",
")",
";",
"assertNotNull",
"(",
"membershipId",
",",
"\"membershipId\"",
")",
";",
"return",
"servic... | Fetches one space membership by its id from Contentful.
@param spaceId the space this membership is hosted by.
@param membershipId the id of the membership to be found.
@return null if no membership was found, otherwise the found membership.
@throws IllegalArgumentException if space id is null.
@throws IllegalArg... | [
"Fetches",
"one",
"space",
"membership",
"by",
"its",
"id",
"from",
"Contentful",
"."
] | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/ModuleSpaceMemberships.java#L152-L157 |
ops4j/org.ops4j.base | ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java | ZipExploder.processJars | public void processJars(File[] jarFiles, File destDir) throws IOException {
"""
Explode source JAR files into a target directory
@param jarFiles
list of source files
@param destDir
target directory name (should already exist)
@exception IOException
error creating a target file
"""
for (int i = ... | java | public void processJars(File[] jarFiles, File destDir) throws IOException {
for (int i = 0; i < jarFiles.length; i++) {
processFile(jarFiles[i], destDir);
}
} | [
"public",
"void",
"processJars",
"(",
"File",
"[",
"]",
"jarFiles",
",",
"File",
"destDir",
")",
"throws",
"IOException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"jarFiles",
".",
"length",
";",
"i",
"++",
")",
"{",
"processFile",
"(",
... | Explode source JAR files into a target directory
@param jarFiles
list of source files
@param destDir
target directory name (should already exist)
@exception IOException
error creating a target file | [
"Explode",
"source",
"JAR",
"files",
"into",
"a",
"target",
"directory"
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java#L168-L172 |
Drivemode/TypefaceHelper | TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java | TypefaceHelper.setTypeface | public <D extends Dialog> void setTypeface(D dialog, @StringRes int strResId) {
"""
Set the typeface for the dialog view.
@param dialog the dialog.
@param strResId string resource containing typeface name.
"""
setTypeface(dialog, mApplication.getString(strResId));
} | java | public <D extends Dialog> void setTypeface(D dialog, @StringRes int strResId) {
setTypeface(dialog, mApplication.getString(strResId));
} | [
"public",
"<",
"D",
"extends",
"Dialog",
">",
"void",
"setTypeface",
"(",
"D",
"dialog",
",",
"@",
"StringRes",
"int",
"strResId",
")",
"{",
"setTypeface",
"(",
"dialog",
",",
"mApplication",
".",
"getString",
"(",
"strResId",
")",
")",
";",
"}"
] | Set the typeface for the dialog view.
@param dialog the dialog.
@param strResId string resource containing typeface name. | [
"Set",
"the",
"typeface",
"for",
"the",
"dialog",
"view",
"."
] | train | https://github.com/Drivemode/TypefaceHelper/blob/86bef9ce16b9626b7076559e846db1b9f043c008/TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java#L475-L477 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/Provisioner.java | Provisioner.getBundleLocation | public static String getBundleLocation(String urlString, String productName) {
"""
Gets the bundle location.
The location format is consistent with what SchemaBundle and BundleList.
@return The bundle location.
"""
String productNameInfo = (productName != null && !productName.isEmpty()) ? (BUNDLE_L... | java | public static String getBundleLocation(String urlString, String productName) {
String productNameInfo = (productName != null && !productName.isEmpty()) ? (BUNDLE_LOC_PROD_EXT_TAG + productName + ":") : "";
return BUNDLE_LOC_FEATURE_TAG + productNameInfo + urlString;
} | [
"public",
"static",
"String",
"getBundleLocation",
"(",
"String",
"urlString",
",",
"String",
"productName",
")",
"{",
"String",
"productNameInfo",
"=",
"(",
"productName",
"!=",
"null",
"&&",
"!",
"productName",
".",
"isEmpty",
"(",
")",
")",
"?",
"(",
"BUN... | Gets the bundle location.
The location format is consistent with what SchemaBundle and BundleList.
@return The bundle location. | [
"Gets",
"the",
"bundle",
"location",
".",
"The",
"location",
"format",
"is",
"consistent",
"with",
"what",
"SchemaBundle",
"and",
"BundleList",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/Provisioner.java#L628-L631 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Collections.java | Collections.copy | public static <T> void copy(List<? super T> dest, List<? extends T> src) {
"""
Copies all of the elements from one list into another. After the
operation, the index of each copied element in the destination list
will be identical to its index in the source list. The destination
list must be at least as long a... | java | public static <T> void copy(List<? super T> dest, List<? extends T> src) {
int srcSize = src.size();
if (srcSize > dest.size())
throw new IndexOutOfBoundsException("Source does not fit in dest");
if (srcSize < COPY_THRESHOLD ||
(src instanceof RandomAccess && dest instan... | [
"public",
"static",
"<",
"T",
">",
"void",
"copy",
"(",
"List",
"<",
"?",
"super",
"T",
">",
"dest",
",",
"List",
"<",
"?",
"extends",
"T",
">",
"src",
")",
"{",
"int",
"srcSize",
"=",
"src",
".",
"size",
"(",
")",
";",
"if",
"(",
"srcSize",
... | Copies all of the elements from one list into another. After the
operation, the index of each copied element in the destination list
will be identical to its index in the source list. The destination
list must be at least as long as the source list. If it is longer, the
remaining elements in the destination list are... | [
"Copies",
"all",
"of",
"the",
"elements",
"from",
"one",
"list",
"into",
"another",
".",
"After",
"the",
"operation",
"the",
"index",
"of",
"each",
"copied",
"element",
"in",
"the",
"destination",
"list",
"will",
"be",
"identical",
"to",
"its",
"index",
"i... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Collections.java#L585-L602 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java | EscapedFunctions2.sqluser | public static void sqluser(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
"""
user translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens
"""
zeroArgumentFunctionCall(buf, "user", "user", parsedArg... | java | public static void sqluser(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
zeroArgumentFunctionCall(buf, "user", "user", parsedArgs);
} | [
"public",
"static",
"void",
"sqluser",
"(",
"StringBuilder",
"buf",
",",
"List",
"<",
"?",
"extends",
"CharSequence",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"zeroArgumentFunctionCall",
"(",
"buf",
",",
"\"user\"",
",",
"\"user\"",
",",
"parsedArg... | user translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens | [
"user",
"translation"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L637-L639 |
spring-projects/spring-hateoas | src/main/java/org/springframework/hateoas/Link.java | Link.andAffordance | public Link andAffordance(HttpMethod httpMethod, ResolvableType inputType, List<QueryParameter> queryMethodParameters,
ResolvableType outputType) {
"""
Convenience method when chaining an existing {@link Link}. Defaults the name of the affordance to verb + classname,
e.g. {@literal <httpMethod=HttpMethod.PUT, ... | java | public Link andAffordance(HttpMethod httpMethod, ResolvableType inputType, List<QueryParameter> queryMethodParameters,
ResolvableType outputType) {
String name = httpMethod.toString().toLowerCase();
Class<?> resolvedInputType = inputType.resolve();
if (resolvedInputType != null) {
name += resolvedInputTyp... | [
"public",
"Link",
"andAffordance",
"(",
"HttpMethod",
"httpMethod",
",",
"ResolvableType",
"inputType",
",",
"List",
"<",
"QueryParameter",
">",
"queryMethodParameters",
",",
"ResolvableType",
"outputType",
")",
"{",
"String",
"name",
"=",
"httpMethod",
".",
"toStri... | Convenience method when chaining an existing {@link Link}. Defaults the name of the affordance to verb + classname,
e.g. {@literal <httpMethod=HttpMethod.PUT, inputType=Employee>} produces {@literal <name=putEmployee>}.
@param httpMethod
@param inputType
@param queryMethodParameters
@param outputType
@return | [
"Convenience",
"method",
"when",
"chaining",
"an",
"existing",
"{",
"@link",
"Link",
"}",
".",
"Defaults",
"the",
"name",
"of",
"the",
"affordance",
"to",
"verb",
"+",
"classname",
"e",
".",
"g",
".",
"{",
"@literal",
"<httpMethod",
"=",
"HttpMethod",
".",... | train | https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/Link.java#L239-L250 |
hazelcast/hazelcast | hazelcast-client/src/main/java/com/hazelcast/client/proxy/txn/ClientTransactionUtil.java | ClientTransactionUtil.invoke | public static ClientMessage invoke(ClientMessage request, String objectName, HazelcastClientInstanceImpl client,
Connection connection) {
"""
Handles the invocation exception for transactions so that users will not see internal exceptions.
<p>
More specifically IOException,... | java | public static ClientMessage invoke(ClientMessage request, String objectName, HazelcastClientInstanceImpl client,
Connection connection) {
try {
final ClientInvocation clientInvocation = new ClientInvocation(client, request, objectName, connection);
... | [
"public",
"static",
"ClientMessage",
"invoke",
"(",
"ClientMessage",
"request",
",",
"String",
"objectName",
",",
"HazelcastClientInstanceImpl",
"client",
",",
"Connection",
"connection",
")",
"{",
"try",
"{",
"final",
"ClientInvocation",
"clientInvocation",
"=",
"new... | Handles the invocation exception for transactions so that users will not see internal exceptions.
<p>
More specifically IOException, because in case of a IO problem in ClientInvocation that send to a connection
sends IOException to user. This wraps that exception into a TransactionException. | [
"Handles",
"the",
"invocation",
"exception",
"for",
"transactions",
"so",
"that",
"users",
"will",
"not",
"see",
"internal",
"exceptions",
".",
"<p",
">",
"More",
"specifically",
"IOException",
"because",
"in",
"case",
"of",
"a",
"IO",
"problem",
"in",
"Client... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/proxy/txn/ClientTransactionUtil.java#L52-L61 |
apereo/cas | core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/support/RegisteredServiceMappedRegexAttributeFilter.java | RegisteredServiceMappedRegexAttributeFilter.handleUnmappedAttribute | protected void handleUnmappedAttribute(final Map<String, List<Object>> attributesToRelease, final String attributeName, final Object attributeValue) {
"""
Handle unmapped attribute.
@param attributesToRelease the attributes to release
@param attributeName the attribute name
@param attributeValue th... | java | protected void handleUnmappedAttribute(final Map<String, List<Object>> attributesToRelease, final String attributeName, final Object attributeValue) {
LOGGER.debug("Found attribute [{}] that is not defined in pattern definitions", attributeName);
if (excludeUnmappedAttributes) {
LOGGER.debug... | [
"protected",
"void",
"handleUnmappedAttribute",
"(",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"Object",
">",
">",
"attributesToRelease",
",",
"final",
"String",
"attributeName",
",",
"final",
"Object",
"attributeValue",
")",
"{",
"LOGGER",
".",
"debug",
... | Handle unmapped attribute.
@param attributesToRelease the attributes to release
@param attributeName the attribute name
@param attributeValue the attribute value | [
"Handle",
"unmapped",
"attribute",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/support/RegisteredServiceMappedRegexAttributeFilter.java#L92-L100 |
jamesagnew/hapi-fhir | hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/filters/Escape_Once.java | Escape_Once.apply | @Override
public Object apply(Object value, Object... params) {
"""
/*
escape_once(input)
returns an escaped version of html without affecting
existing escaped entities
"""
String str = super.asString(value);
return str.replaceAll("&(?!([a-zA-Z]+|#[0-9]+|#x[0-9A-Fa-f]+);)", "&")
... | java | @Override
public Object apply(Object value, Object... params) {
String str = super.asString(value);
return str.replaceAll("&(?!([a-zA-Z]+|#[0-9]+|#x[0-9A-Fa-f]+);)", "&")
.replace("<", "<")
.replace(">", ">")
.replace("\"", """);
} | [
"@",
"Override",
"public",
"Object",
"apply",
"(",
"Object",
"value",
",",
"Object",
"...",
"params",
")",
"{",
"String",
"str",
"=",
"super",
".",
"asString",
"(",
"value",
")",
";",
"return",
"str",
".",
"replaceAll",
"(",
"\"&(?!([a-zA-Z]+|#[0-9]+|#x[0-9A... | /*
escape_once(input)
returns an escaped version of html without affecting
existing escaped entities | [
"/",
"*",
"escape_once",
"(",
"input",
")"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/filters/Escape_Once.java#L11-L20 |
nmdp-bioinformatics/genotype-list | gl-service/src/main/java/org/nmdp/gl/service/nomenclature/AbstractNomenclature.java | AbstractNomenclature.loadAllele | protected final Allele loadAllele(final String glstring, final String accession) throws IOException {
"""
Load and register the specified allele in GL String format.
@param glstring allele in GL String format, must not be null or empty
@param accession allele accession, must not be null
@return the registered... | java | protected final Allele loadAllele(final String glstring, final String accession) throws IOException {
final String id = glstringResolver.resolveAllele(glstring);
Allele allele = idResolver.findAllele(id);
if (allele == null) {
Matcher m = ALLELE_PATTERN.matcher(glstring);
... | [
"protected",
"final",
"Allele",
"loadAllele",
"(",
"final",
"String",
"glstring",
",",
"final",
"String",
"accession",
")",
"throws",
"IOException",
"{",
"final",
"String",
"id",
"=",
"glstringResolver",
".",
"resolveAllele",
"(",
"glstring",
")",
";",
"Allele",... | Load and register the specified allele in GL String format.
@param glstring allele in GL String format, must not be null or empty
@param accession allele accession, must not be null
@return the registered allele
@throws IOException if an I/O error occurs | [
"Load",
"and",
"register",
"the",
"specified",
"allele",
"in",
"GL",
"String",
"format",
"."
] | train | https://github.com/nmdp-bioinformatics/genotype-list/blob/03b2579552cb9f680a62ffaaecdca9c2a5d12ee4/gl-service/src/main/java/org/nmdp/gl/service/nomenclature/AbstractNomenclature.java#L96-L112 |
awslabs/jsii | packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/Util.java | Util.readString | static String readString(final InputStream is) {
"""
Reads a string from an input stream.
@param is The input stream.,
@return A string.
"""
try (final Scanner s = new Scanner(is, "UTF-8")) {
s.useDelimiter("\\A");
if (s.hasNext()) {
return s.next();
... | java | static String readString(final InputStream is) {
try (final Scanner s = new Scanner(is, "UTF-8")) {
s.useDelimiter("\\A");
if (s.hasNext()) {
return s.next();
} else {
return "";
}
}
} | [
"static",
"String",
"readString",
"(",
"final",
"InputStream",
"is",
")",
"{",
"try",
"(",
"final",
"Scanner",
"s",
"=",
"new",
"Scanner",
"(",
"is",
",",
"\"UTF-8\"",
")",
")",
"{",
"s",
".",
"useDelimiter",
"(",
"\"\\\\A\"",
")",
";",
"if",
"(",
"s... | Reads a string from an input stream.
@param is The input stream.,
@return A string. | [
"Reads",
"a",
"string",
"from",
"an",
"input",
"stream",
"."
] | train | https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/Util.java#L32-L41 |
demidenko05/beigesoft-orm | src/main/java/org/beigesoft/orm/service/ASrvOrm.java | ASrvOrm.updateEntity | @Override
public final <T> void updateEntity(
final Map<String, Object> pAddParam,
final T pEntity) throws Exception {
"""
<p>Update entity in DB.</p>
@param <T> entity type
@param pAddParam additional param
@param pEntity entity
@throws Exception - an exception
"""
ColumnsValues columnsVal... | java | @Override
public final <T> void updateEntity(
final Map<String, Object> pAddParam,
final T pEntity) throws Exception {
ColumnsValues columnsValues = evalColumnsValues(pAddParam, pEntity);
String whereStr = evalWhereForUpdate(pEntity, columnsValues);
prepareColumnValuesForUpdate(columnsValues, pE... | [
"@",
"Override",
"public",
"final",
"<",
"T",
">",
"void",
"updateEntity",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"pAddParam",
",",
"final",
"T",
"pEntity",
")",
"throws",
"Exception",
"{",
"ColumnsValues",
"columnsValues",
"=",
"evalColumns... | <p>Update entity in DB.</p>
@param <T> entity type
@param pAddParam additional param
@param pEntity entity
@throws Exception - an exception | [
"<p",
">",
"Update",
"entity",
"in",
"DB",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/demidenko05/beigesoft-orm/blob/f1b2c70701a111741a436911ca24ef9d38eba0b9/src/main/java/org/beigesoft/orm/service/ASrvOrm.java#L268-L289 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.rotateAroundLocal | public Matrix4f rotateAroundLocal(Quaternionfc quat, float ox, float oy, float oz, Matrix4f dest) {
"""
/* (non-Javadoc)
@see org.joml.Matrix4fc#rotateAroundLocal(org.joml.Quaternionfc, float, float, float, org.joml.Matrix4f)
"""
float w2 = quat.w() * quat.w();
float x2 = quat.x() * quat.x();
... | java | public Matrix4f rotateAroundLocal(Quaternionfc quat, float ox, float oy, float oz, Matrix4f dest) {
float w2 = quat.w() * quat.w();
float x2 = quat.x() * quat.x();
float y2 = quat.y() * quat.y();
float z2 = quat.z() * quat.z();
float zw = quat.z() * quat.w();
float xy = q... | [
"public",
"Matrix4f",
"rotateAroundLocal",
"(",
"Quaternionfc",
"quat",
",",
"float",
"ox",
",",
"float",
"oy",
",",
"float",
"oz",
",",
"Matrix4f",
"dest",
")",
"{",
"float",
"w2",
"=",
"quat",
".",
"w",
"(",
")",
"*",
"quat",
".",
"w",
"(",
")",
... | /* (non-Javadoc)
@see org.joml.Matrix4fc#rotateAroundLocal(org.joml.Quaternionfc, float, float, float, org.joml.Matrix4f) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L11484-L11534 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java | BaseXmlImporter.reloadChangesInfoAfterUC | protected void reloadChangesInfoAfterUC(ImportNodeData currentNodeInfo, String identifier)
throws PathNotFoundException, IllegalPathException, RepositoryException {
"""
Reload path information after uuid collision
@param currentNodeInfo
@param identifier
@throws PathNotFoundException
@throws IllegalPat... | java | protected void reloadChangesInfoAfterUC(ImportNodeData currentNodeInfo, String identifier)
throws PathNotFoundException, IllegalPathException, RepositoryException
{
reloadChangesInfoAfterUC(getParent(), currentNodeInfo, identifier);
} | [
"protected",
"void",
"reloadChangesInfoAfterUC",
"(",
"ImportNodeData",
"currentNodeInfo",
",",
"String",
"identifier",
")",
"throws",
"PathNotFoundException",
",",
"IllegalPathException",
",",
"RepositoryException",
"{",
"reloadChangesInfoAfterUC",
"(",
"getParent",
"(",
"... | Reload path information after uuid collision
@param currentNodeInfo
@param identifier
@throws PathNotFoundException
@throws IllegalPathException
@throws RepositoryException | [
"Reload",
"path",
"information",
"after",
"uuid",
"collision"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java#L443-L447 |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/runtime/KnowledgeRuntimeManagerRegistry.java | KnowledgeRuntimeManagerRegistry.getRuntimeManager | public static final synchronized KnowledgeRuntimeManager getRuntimeManager(QName serviceDomainName, QName serviceName) {
"""
Gets a runtime manager.
@param serviceDomainName the service domain name
@param serviceName the service name
@return the runtime manager
"""
if (serviceDomainName == null) {... | java | public static final synchronized KnowledgeRuntimeManager getRuntimeManager(QName serviceDomainName, QName serviceName) {
if (serviceDomainName == null) {
serviceDomainName = ROOT_DOMAIN;
}
Map<QName, KnowledgeRuntimeManager> reg = REGISTRY.get(serviceDomainName);
return reg !... | [
"public",
"static",
"final",
"synchronized",
"KnowledgeRuntimeManager",
"getRuntimeManager",
"(",
"QName",
"serviceDomainName",
",",
"QName",
"serviceName",
")",
"{",
"if",
"(",
"serviceDomainName",
"==",
"null",
")",
"{",
"serviceDomainName",
"=",
"ROOT_DOMAIN",
";",... | Gets a runtime manager.
@param serviceDomainName the service domain name
@param serviceName the service name
@return the runtime manager | [
"Gets",
"a",
"runtime",
"manager",
"."
] | train | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/runtime/KnowledgeRuntimeManagerRegistry.java#L35-L41 |
JakeWharton/NineOldAndroids | library/src/com/nineoldandroids/animation/ObjectAnimator.java | ObjectAnimator.ofObject | public static <T, V> ObjectAnimator ofObject(T target, Property<T, V> property,
TypeEvaluator<V> evaluator, V... values) {
"""
Constructs and returns an ObjectAnimator that animates between Object values. A single
value implies that that value is the one being animated to. Two values imply a starting
... | java | public static <T, V> ObjectAnimator ofObject(T target, Property<T, V> property,
TypeEvaluator<V> evaluator, V... values) {
ObjectAnimator anim = new ObjectAnimator(target, property);
anim.setObjectValues(values);
anim.setEvaluator(evaluator);
return anim;
} | [
"public",
"static",
"<",
"T",
",",
"V",
">",
"ObjectAnimator",
"ofObject",
"(",
"T",
"target",
",",
"Property",
"<",
"T",
",",
"V",
">",
"property",
",",
"TypeEvaluator",
"<",
"V",
">",
"evaluator",
",",
"V",
"...",
"values",
")",
"{",
"ObjectAnimator"... | Constructs and returns an ObjectAnimator that animates between Object values. A single
value implies that that value is the one being animated to. Two values imply a starting
and ending values. More than two values imply a starting value, values to animate through
along the way, and an ending value (these values will b... | [
"Constructs",
"and",
"returns",
"an",
"ObjectAnimator",
"that",
"animates",
"between",
"Object",
"values",
".",
"A",
"single",
"value",
"implies",
"that",
"that",
"value",
"is",
"the",
"one",
"being",
"animated",
"to",
".",
"Two",
"values",
"imply",
"a",
"st... | train | https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/animation/ObjectAnimator.java#L295-L301 |
JodaOrg/joda-time | src/main/java/org/joda/time/Partial.java | Partial.withFieldAddWrapped | public Partial withFieldAddWrapped(DurationFieldType fieldType, int amount) {
"""
Gets a copy of this Partial with the value of the specified field increased.
If this partial does not support the field, an exception is thrown.
<p>
If the addition is zero, then <code>this</code> is returned.
The addition will o... | java | public Partial withFieldAddWrapped(DurationFieldType fieldType, int amount) {
int index = indexOfSupported(fieldType);
if (amount == 0) {
return this;
}
int[] newValues = getValues();
newValues = getField(index).addWrapPartial(this, index, newValues, amount);
... | [
"public",
"Partial",
"withFieldAddWrapped",
"(",
"DurationFieldType",
"fieldType",
",",
"int",
"amount",
")",
"{",
"int",
"index",
"=",
"indexOfSupported",
"(",
"fieldType",
")",
";",
"if",
"(",
"amount",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"i... | Gets a copy of this Partial with the value of the specified field increased.
If this partial does not support the field, an exception is thrown.
<p>
If the addition is zero, then <code>this</code> is returned.
The addition will overflow into larger fields (eg. minute to hour).
If the maximum is reached, the addition wi... | [
"Gets",
"a",
"copy",
"of",
"this",
"Partial",
"with",
"the",
"value",
"of",
"the",
"specified",
"field",
"increased",
".",
"If",
"this",
"partial",
"does",
"not",
"support",
"the",
"field",
"an",
"exception",
"is",
"thrown",
".",
"<p",
">",
"If",
"the",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Partial.java#L594-L602 |
logic-ng/LogicNG | src/main/java/org/logicng/solvers/maxsat/encodings/Encoder.java | Encoder.encodeAMO | public void encodeAMO(final MiniSatStyleSolver s, final LNGIntVector lits) {
"""
Encodes an AMO constraint in the given solver.
@param s the solver
@param lits the literals for the constraint
@throws IllegalStateException if the AMO encoding is unknown
"""
switch (this.amoEncoding) {
case LADDE... | java | public void encodeAMO(final MiniSatStyleSolver s, final LNGIntVector lits) {
switch (this.amoEncoding) {
case LADDER:
this.ladder.encode(s, lits);
break;
default:
throw new IllegalStateException("Unknown AMO encoding: " + this.amoEncoding);
}
} | [
"public",
"void",
"encodeAMO",
"(",
"final",
"MiniSatStyleSolver",
"s",
",",
"final",
"LNGIntVector",
"lits",
")",
"{",
"switch",
"(",
"this",
".",
"amoEncoding",
")",
"{",
"case",
"LADDER",
":",
"this",
".",
"ladder",
".",
"encode",
"(",
"s",
",",
"lits... | Encodes an AMO constraint in the given solver.
@param s the solver
@param lits the literals for the constraint
@throws IllegalStateException if the AMO encoding is unknown | [
"Encodes",
"an",
"AMO",
"constraint",
"in",
"the",
"given",
"solver",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/maxsat/encodings/Encoder.java#L151-L159 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java | DateFunctions.datePartStr | public static Expression datePartStr(Expression expression, DatePartExt part) {
"""
Returned expression results in Date part as an integer.
The date expression is a string in a supported format, and part is one of the supported date part strings.
"""
return x("DATE_PART_STR(" + expression.toString() +... | java | public static Expression datePartStr(Expression expression, DatePartExt part) {
return x("DATE_PART_STR(" + expression.toString() + ", \"" + part.toString() + "\")");
} | [
"public",
"static",
"Expression",
"datePartStr",
"(",
"Expression",
"expression",
",",
"DatePartExt",
"part",
")",
"{",
"return",
"x",
"(",
"\"DATE_PART_STR(\"",
"+",
"expression",
".",
"toString",
"(",
")",
"+",
"\", \\\"\"",
"+",
"part",
".",
"toString",
"("... | Returned expression results in Date part as an integer.
The date expression is a string in a supported format, and part is one of the supported date part strings. | [
"Returned",
"expression",
"results",
"in",
"Date",
"part",
"as",
"an",
"integer",
".",
"The",
"date",
"expression",
"is",
"a",
"string",
"in",
"a",
"supported",
"format",
"and",
"part",
"is",
"one",
"of",
"the",
"supported",
"date",
"part",
"strings",
"."
... | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java#L156-L158 |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModel.java | HullWhiteModel.getV | private RandomVariable getV(double time, double maturity) {
"""
Calculates the drift adjustment for the log numeraire, that is
\(
\int_{t}^{T} \sigma^{2}(s) B(s,T)^{2} \mathrm{d}s
\) where \( B(t,T) = \int_{t}^{T} \exp(-\int_{s}^{T} a(\tau) \mathrm{d}\tau) \mathrm{d}s \).
@param time The parameter t in \( \i... | java | private RandomVariable getV(double time, double maturity) {
if(time == maturity) {
return new Scalar(0.0);
}
int timeIndexStart = volatilityModel.getTimeDiscretization().getTimeIndex(time);
if(timeIndexStart < 0) {
timeIndexStart = -timeIndexStart-2; // Get timeIndex corresponding to previous point
}
... | [
"private",
"RandomVariable",
"getV",
"(",
"double",
"time",
",",
"double",
"maturity",
")",
"{",
"if",
"(",
"time",
"==",
"maturity",
")",
"{",
"return",
"new",
"Scalar",
"(",
"0.0",
")",
";",
"}",
"int",
"timeIndexStart",
"=",
"volatilityModel",
".",
"g... | Calculates the drift adjustment for the log numeraire, that is
\(
\int_{t}^{T} \sigma^{2}(s) B(s,T)^{2} \mathrm{d}s
\) where \( B(t,T) = \int_{t}^{T} \exp(-\int_{s}^{T} a(\tau) \mathrm{d}\tau) \mathrm{d}s \).
@param time The parameter t in \( \int_{t}^{T} \sigma^{2}(s) B(s,T)^{2} \mathrm{d}s \)
@param maturity The par... | [
"Calculates",
"the",
"drift",
"adjustment",
"for",
"the",
"log",
"numeraire",
"that",
"is",
"\\",
"(",
"\\",
"int_",
"{",
"t",
"}",
"^",
"{",
"T",
"}",
"\\",
"sigma^",
"{",
"2",
"}",
"(",
"s",
")",
"B",
"(",
"s",
"T",
")",
"^",
"{",
"2",
"}",... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModel.java#L656-L700 |
redkale/redkale | src/org/redkale/net/http/HttpRequest.java | HttpRequest.getRequstURIPath | public int getRequstURIPath(String prefix, int defvalue) {
"""
获取请求URL分段中含prefix段的int值 <br>
例如请求URL /pipes/record/query/offset:0/limit:50 <br>
获取offset参数: int offset = request.getRequstURIPath("offset:", 0); <br>
获取limit参数: int limit = request.getRequstURIPath("limit:", 20); <br>
@param prefix prefix... | java | public int getRequstURIPath(String prefix, int defvalue) {
String val = getRequstURIPath(prefix, null);
try {
return val == null ? defvalue : Integer.parseInt(val);
} catch (NumberFormatException e) {
return defvalue;
}
} | [
"public",
"int",
"getRequstURIPath",
"(",
"String",
"prefix",
",",
"int",
"defvalue",
")",
"{",
"String",
"val",
"=",
"getRequstURIPath",
"(",
"prefix",
",",
"null",
")",
";",
"try",
"{",
"return",
"val",
"==",
"null",
"?",
"defvalue",
":",
"Integer",
".... | 获取请求URL分段中含prefix段的int值 <br>
例如请求URL /pipes/record/query/offset:0/limit:50 <br>
获取offset参数: int offset = request.getRequstURIPath("offset:", 0); <br>
获取limit参数: int limit = request.getRequstURIPath("limit:", 20); <br>
@param prefix prefix段前缀
@param defvalue 默认int值
@return int值 | [
"获取请求URL分段中含prefix段的int值",
"<br",
">",
"例如请求URL",
"/",
"pipes",
"/",
"record",
"/",
"query",
"/",
"offset",
":",
"0",
"/",
"limit",
":",
"50",
"<br",
">",
"获取offset参数",
":",
"int",
"offset",
"=",
"request",
".",
"getRequstURIPath",
"(",
"offset",
":",
"0... | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/net/http/HttpRequest.java#L857-L864 |
axibase/atsd-jdbc | src/main/java/com/axibase/tsd/driver/jdbc/ext/AtsdMeta.java | AtsdMeta.prepareGetMetricUrls | @Nonnull
static Collection<MetricLocation> prepareGetMetricUrls(List<String> metricMasks, String tableFilter, boolean underscoreAsLiteral) {
"""
Prepare URL to retrieve metrics
@param metricMasks filter specified in `tables` connection string parameter
@param tableFilter filter specified in method parameter
@p... | java | @Nonnull
static Collection<MetricLocation> prepareGetMetricUrls(List<String> metricMasks, String tableFilter, boolean underscoreAsLiteral) {
if (WildcardsUtil.isRetrieveAllPattern(tableFilter) || tableFilter.isEmpty()) {
if (metricMasks.isEmpty()) {
return Collections.emptyList();
} else {
return build... | [
"@",
"Nonnull",
"static",
"Collection",
"<",
"MetricLocation",
">",
"prepareGetMetricUrls",
"(",
"List",
"<",
"String",
">",
"metricMasks",
",",
"String",
"tableFilter",
",",
"boolean",
"underscoreAsLiteral",
")",
"{",
"if",
"(",
"WildcardsUtil",
".",
"isRetrieveA... | Prepare URL to retrieve metrics
@param metricMasks filter specified in `tables` connection string parameter
@param tableFilter filter specified in method parameter
@param underscoreAsLiteral treat underscore as not a metacharacter
@return MetricLocation | [
"Prepare",
"URL",
"to",
"retrieve",
"metrics"
] | train | https://github.com/axibase/atsd-jdbc/blob/8bbd9d65f645272aa1d7fc07081bd10bd3e0c376/src/main/java/com/axibase/tsd/driver/jdbc/ext/AtsdMeta.java#L661-L672 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.deleteVariable | public void deleteVariable(Object projectIdOrPath, String key) throws GitLabApiException {
"""
Deletes a project variable.
<pre><code>DELETE /projects/:id/variables/:key</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
... | java | public void deleteVariable(Object projectIdOrPath, String key) throws GitLabApiException {
delete(Response.Status.NO_CONTENT, null, "projects", getProjectIdOrPath(projectIdOrPath), "variables", key);
} | [
"public",
"void",
"deleteVariable",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"key",
")",
"throws",
"GitLabApiException",
"{",
"delete",
"(",
"Response",
".",
"Status",
".",
"NO_CONTENT",
",",
"null",
",",
"\"projects\"",
",",
"getProjectIdOrPath",
"(",
"... | Deletes a project variable.
<pre><code>DELETE /projects/:id/variables/:key</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param key the key of an existing variable, required
@throws GitLabApiException if any exception occurs | [
"Deletes",
"a",
"project",
"variable",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L2580-L2582 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/othersys/LinkExamples.java | LinkExamples.addLink | private void addLink(final WSubMenu subMenu, final WLink link) {
"""
Adds a WLink to a sub-menu.
@param subMenu the sub-menu to add the link to
@param link the link to add.
"""
subMenu.add(new WMenuItem(new WDecoratedLabel(link)));
} | java | private void addLink(final WSubMenu subMenu, final WLink link) {
subMenu.add(new WMenuItem(new WDecoratedLabel(link)));
} | [
"private",
"void",
"addLink",
"(",
"final",
"WSubMenu",
"subMenu",
",",
"final",
"WLink",
"link",
")",
"{",
"subMenu",
".",
"add",
"(",
"new",
"WMenuItem",
"(",
"new",
"WDecoratedLabel",
"(",
"link",
")",
")",
")",
";",
"}"
] | Adds a WLink to a sub-menu.
@param subMenu the sub-menu to add the link to
@param link the link to add. | [
"Adds",
"a",
"WLink",
"to",
"a",
"sub",
"-",
"menu",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/othersys/LinkExamples.java#L62-L64 |
alkacon/opencms-core | src/org/opencms/file/collectors/CmsPriorityResourceCollector.java | CmsPriorityResourceCollector.allInFolderPriorityDate | protected List<CmsResource> allInFolderPriorityDate(
CmsObject cms,
String param,
boolean tree,
boolean asc,
int numResults) throws CmsException {
"""
Returns a list of all resource in a specified folder sorted by priority, then date ascending or descending.<p>
@param cms... | java | protected List<CmsResource> allInFolderPriorityDate(
CmsObject cms,
String param,
boolean tree,
boolean asc,
int numResults) throws CmsException {
CmsCollectorData data = new CmsCollectorData(param);
String foldername = CmsResource.getFolderPath(data.getFileName(... | [
"protected",
"List",
"<",
"CmsResource",
">",
"allInFolderPriorityDate",
"(",
"CmsObject",
"cms",
",",
"String",
"param",
",",
"boolean",
"tree",
",",
"boolean",
"asc",
",",
"int",
"numResults",
")",
"throws",
"CmsException",
"{",
"CmsCollectorData",
"data",
"="... | Returns a list of all resource in a specified folder sorted by priority, then date ascending or descending.<p>
@param cms the current OpenCms user context
@param param the folder name to use
@param tree if true, look in folder and all child folders, if false, look only in given folder
@param asc if true, the date sort... | [
"Returns",
"a",
"list",
"of",
"all",
"resource",
"in",
"a",
"specified",
"folder",
"sorted",
"by",
"priority",
"then",
"date",
"ascending",
"or",
"descending",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/collectors/CmsPriorityResourceCollector.java#L224-L247 |
structr/structr | structr-ui/src/main/java/org/structr/web/common/FileHelper.java | FileHelper.updateMetadata | public static void updateMetadata(final File file, final PropertyMap map) throws FrameworkException {
"""
Update checksums, content type, size and additional properties of the given file
@param file the file
@param map additional properties
@throws FrameworkException
"""
updateMetadata(file, map, false... | java | public static void updateMetadata(final File file, final PropertyMap map) throws FrameworkException {
updateMetadata(file, map, false);
} | [
"public",
"static",
"void",
"updateMetadata",
"(",
"final",
"File",
"file",
",",
"final",
"PropertyMap",
"map",
")",
"throws",
"FrameworkException",
"{",
"updateMetadata",
"(",
"file",
",",
"map",
",",
"false",
")",
";",
"}"
] | Update checksums, content type, size and additional properties of the given file
@param file the file
@param map additional properties
@throws FrameworkException | [
"Update",
"checksums",
"content",
"type",
"size",
"and",
"additional",
"properties",
"of",
"the",
"given",
"file"
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L399-L401 |
Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/ResponseCacheImpl.java | ResponseCacheImpl.getPayLoad | private String getPayLoad(Key key, Applications apps) {
"""
Generate pay load with both JSON and XML formats for all applications.
"""
EncoderWrapper encoderWrapper = serverCodecs.getEncoder(key.getType(), key.getEurekaAccept());
String result;
try {
result = encoderWrapper.... | java | private String getPayLoad(Key key, Applications apps) {
EncoderWrapper encoderWrapper = serverCodecs.getEncoder(key.getType(), key.getEurekaAccept());
String result;
try {
result = encoderWrapper.encode(apps);
} catch (Exception e) {
logger.error("Failed to encode... | [
"private",
"String",
"getPayLoad",
"(",
"Key",
"key",
",",
"Applications",
"apps",
")",
"{",
"EncoderWrapper",
"encoderWrapper",
"=",
"serverCodecs",
".",
"getEncoder",
"(",
"key",
".",
"getType",
"(",
")",
",",
"key",
".",
"getEurekaAccept",
"(",
")",
")",
... | Generate pay load with both JSON and XML formats for all applications. | [
"Generate",
"pay",
"load",
"with",
"both",
"JSON",
"and",
"XML",
"formats",
"for",
"all",
"applications",
"."
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/ResponseCacheImpl.java#L367-L380 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java | HtmlSerialFieldWriter.addMemberDescription | public void addMemberDescription(SerialFieldTag serialFieldTag, Content contentTree) {
"""
Add the description text for this member represented by the tag.
@param serialFieldTag the field to document (represented by tag)
@param contentTree the tree to which the deprecated info will be added
"""
Str... | java | public void addMemberDescription(SerialFieldTag serialFieldTag, Content contentTree) {
String serialFieldTagDesc = serialFieldTag.description().trim();
if (!serialFieldTagDesc.isEmpty()) {
Content serialFieldContent = new RawHtml(serialFieldTagDesc);
Content div = HtmlTree.DIV(Ht... | [
"public",
"void",
"addMemberDescription",
"(",
"SerialFieldTag",
"serialFieldTag",
",",
"Content",
"contentTree",
")",
"{",
"String",
"serialFieldTagDesc",
"=",
"serialFieldTag",
".",
"description",
"(",
")",
".",
"trim",
"(",
")",
";",
"if",
"(",
"!",
"serialFi... | Add the description text for this member represented by the tag.
@param serialFieldTag the field to document (represented by tag)
@param contentTree the tree to which the deprecated info will be added | [
"Add",
"the",
"description",
"text",
"for",
"this",
"member",
"represented",
"by",
"the",
"tag",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java#L168-L175 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.