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 |
|---|---|---|---|---|---|---|---|---|---|---|
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | JavaConnector.contextClickAt | public void contextClickAt(double lat, double lon) {
"""
called when the user has context-clicked in the map. the coordinates are EPSG:4326 (WGS) values.
@param lat
new latitude value
@param lon
new longitude value
"""
final Coordinate coordinate = new Coordinate(lat, lon);
if (lo... | java | public void contextClickAt(double lat, double lon) {
final Coordinate coordinate = new Coordinate(lat, lon);
if (logger.isTraceEnabled()) {
logger.trace("JS reports context click at {}", coordinate);
}
fireEvent(new MapViewEvent(MapViewEvent.MAP_RIGHTCLICK... | [
"public",
"void",
"contextClickAt",
"(",
"double",
"lat",
",",
"double",
"lon",
")",
"{",
"final",
"Coordinate",
"coordinate",
"=",
"new",
"Coordinate",
"(",
"lat",
",",
"lon",
")",
";",
"if",
"(",
"logger",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"... | called when the user has context-clicked in the map. the coordinates are EPSG:4326 (WGS) values.
@param lat
new latitude value
@param lon
new longitude value | [
"called",
"when",
"the",
"user",
"has",
"context",
"-",
"clicked",
"in",
"the",
"map",
".",
"the",
"coordinates",
"are",
"EPSG",
":",
"4326",
"(",
"WGS",
")",
"values",
"."
] | train | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L1388-L1394 |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java | SRTPCryptoContext.checkReplay | boolean checkReplay(int seqNo, long guessedIndex) {
"""
Checks if a packet is a replayed on based on its sequence number.
This method supports a 64 packet history relative the the given sequence
number.
Sequence Number is guaranteed to be real (not faked) through
authentication.
@param seqNo
sequence n... | java | boolean checkReplay(int seqNo, long guessedIndex) {
// compute the index of previously received packet and its
// delta to the new received packet
long localIndex = (((long) this.roc) << 16) | this.seqNum;
long delta = guessedIndex - localIndex;
if (delta > 0) {
/* Packet not yet received */
return tru... | [
"boolean",
"checkReplay",
"(",
"int",
"seqNo",
",",
"long",
"guessedIndex",
")",
"{",
"// compute the index of previously received packet and its",
"// delta to the new received packet",
"long",
"localIndex",
"=",
"(",
"(",
"(",
"long",
")",
"this",
".",
"roc",
")",
"... | Checks if a packet is a replayed on based on its sequence number.
This method supports a 64 packet history relative the the given sequence
number.
Sequence Number is guaranteed to be real (not faked) through
authentication.
@param seqNo
sequence number of the packet
@param guessedIndex
guessed roc
@return true if th... | [
"Checks",
"if",
"a",
"packet",
"is",
"a",
"replayed",
"on",
"based",
"on",
"its",
"sequence",
"number",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java#L552-L575 |
knowm/XChange | xchange-anx/src/main/java/org/knowm/xchange/anx/v2/ANXAdapters.java | ANXAdapters.adaptOrder | public static LimitOrder adaptOrder(
BigDecimal originalAmount,
BigDecimal price,
String tradedCurrency,
String transactionCurrency,
String orderTypeString,
String id,
Date timestamp) {
"""
Adapts a ANXOrder to a LimitOrder
@param price
@param orderTypeString
@return
... | java | public static LimitOrder adaptOrder(
BigDecimal originalAmount,
BigDecimal price,
String tradedCurrency,
String transactionCurrency,
String orderTypeString,
String id,
Date timestamp) {
// place a limit order
OrderType orderType = adaptSide(orderTypeString);
Curren... | [
"public",
"static",
"LimitOrder",
"adaptOrder",
"(",
"BigDecimal",
"originalAmount",
",",
"BigDecimal",
"price",
",",
"String",
"tradedCurrency",
",",
"String",
"transactionCurrency",
",",
"String",
"orderTypeString",
",",
"String",
"id",
",",
"Date",
"timestamp",
"... | Adapts a ANXOrder to a LimitOrder
@param price
@param orderTypeString
@return | [
"Adapts",
"a",
"ANXOrder",
"to",
"a",
"LimitOrder"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/ANXAdapters.java#L70-L87 |
dadoonet/fscrawler | elasticsearch-client/elasticsearch-client-v5/src/main/java/fr/pilato/elasticsearch/crawler/fs/client/v5/ElasticsearchClientV5.java | ElasticsearchClientV5.deleteByQuery | public void deleteByQuery(String index, String type) throws IOException {
"""
Fully removes a type from an index (removes data)
@param index index name
@param type type
@throws IOException In case of error
"""
logger.debug("deleteByQuery [{}]/[{}]", index, type);
String deleteByQuery = "{\n... | java | public void deleteByQuery(String index, String type) throws IOException {
logger.debug("deleteByQuery [{}]/[{}]", index, type);
String deleteByQuery = "{\n" +
" \"query\": {\n" +
" \"match_all\": {}\n" +
" }\n" +
"}";
HttpEnt... | [
"public",
"void",
"deleteByQuery",
"(",
"String",
"index",
",",
"String",
"type",
")",
"throws",
"IOException",
"{",
"logger",
".",
"debug",
"(",
"\"deleteByQuery [{}]/[{}]\"",
",",
"index",
",",
"type",
")",
";",
"String",
"deleteByQuery",
"=",
"\"{\\n\"",
"+... | Fully removes a type from an index (removes data)
@param index index name
@param type type
@throws IOException In case of error | [
"Fully",
"removes",
"a",
"type",
"from",
"an",
"index",
"(",
"removes",
"data",
")"
] | train | https://github.com/dadoonet/fscrawler/blob/cca00a14e21ef9986aa30e19b160463aed6bf921/elasticsearch-client/elasticsearch-client-v5/src/main/java/fr/pilato/elasticsearch/crawler/fs/client/v5/ElasticsearchClientV5.java#L348-L361 |
damianszczepanik/cucumber-reporting | src/main/java/net/masterthought/cucumber/ReportParser.java | ReportParser.parseForFeature | private Feature[] parseForFeature(String jsonFile) {
"""
Reads passed file and returns parsed features.
@param jsonFile
JSON file that should be read
@return array of parsed features
"""
try (Reader reader = new InputStreamReader(new FileInputStream(jsonFile), StandardCharsets.UTF_8)) {
... | java | private Feature[] parseForFeature(String jsonFile) {
try (Reader reader = new InputStreamReader(new FileInputStream(jsonFile), StandardCharsets.UTF_8)) {
Feature[] features = mapper.readValue(reader, Feature[].class);
if (ArrayUtils.isEmpty(features)) {
LOG.log(Level.INFO... | [
"private",
"Feature",
"[",
"]",
"parseForFeature",
"(",
"String",
"jsonFile",
")",
"{",
"try",
"(",
"Reader",
"reader",
"=",
"new",
"InputStreamReader",
"(",
"new",
"FileInputStream",
"(",
"jsonFile",
")",
",",
"StandardCharsets",
".",
"UTF_8",
")",
")",
"{"... | Reads passed file and returns parsed features.
@param jsonFile
JSON file that should be read
@return array of parsed features | [
"Reads",
"passed",
"file",
"and",
"returns",
"parsed",
"features",
"."
] | train | https://github.com/damianszczepanik/cucumber-reporting/blob/9ffe0d4a9c0aec161b0988a930a8312ba36dc742/src/main/java/net/masterthought/cucumber/ReportParser.java#L91-L104 |
Jasig/uPortal | uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/provider/AuthorizationPrincipalImpl.java | AuthorizationPrincipalImpl.canManage | @Override
public boolean canManage(PortletLifecycleState state, String categoryId)
throws AuthorizationException {
"""
Answers if this <code>IAuthorizationPrincipal</code> has permission to publish.
@return boolean
@exception AuthorizationException thrown when authorization information could no... | java | @Override
public boolean canManage(PortletLifecycleState state, String categoryId)
throws AuthorizationException {
return getAuthorizationService().canPrincipalManage(this, state, categoryId);
} | [
"@",
"Override",
"public",
"boolean",
"canManage",
"(",
"PortletLifecycleState",
"state",
",",
"String",
"categoryId",
")",
"throws",
"AuthorizationException",
"{",
"return",
"getAuthorizationService",
"(",
")",
".",
"canPrincipalManage",
"(",
"this",
",",
"state",
... | Answers if this <code>IAuthorizationPrincipal</code> has permission to publish.
@return boolean
@exception AuthorizationException thrown when authorization information could not be
retrieved. | [
"Answers",
"if",
"this",
"<code",
">",
"IAuthorizationPrincipal<",
"/",
"code",
">",
"has",
"permission",
"to",
"publish",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/provider/AuthorizationPrincipalImpl.java#L60-L64 |
alkacon/opencms-core | src/org/opencms/db/CmsUserSettings.java | CmsUserSettings.setPreferredEditor | public void setPreferredEditor(String resourceType, String editorUri) {
"""
Sets the preferred editor for the given resource type of the user.<p>
@param resourceType the resource type
@param editorUri the editor URI
"""
if (editorUri == null) {
m_editorSettings.remove(resourceType);
... | java | public void setPreferredEditor(String resourceType, String editorUri) {
if (editorUri == null) {
m_editorSettings.remove(resourceType);
} else {
m_editorSettings.put(resourceType, editorUri);
}
} | [
"public",
"void",
"setPreferredEditor",
"(",
"String",
"resourceType",
",",
"String",
"editorUri",
")",
"{",
"if",
"(",
"editorUri",
"==",
"null",
")",
"{",
"m_editorSettings",
".",
"remove",
"(",
"resourceType",
")",
";",
"}",
"else",
"{",
"m_editorSettings",... | Sets the preferred editor for the given resource type of the user.<p>
@param resourceType the resource type
@param editorUri the editor URI | [
"Sets",
"the",
"preferred",
"editor",
"for",
"the",
"given",
"resource",
"type",
"of",
"the",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsUserSettings.java#L1969-L1976 |
cogroo/cogroo4 | cogroo-nlp/src/main/java/org/cogroo/tools/featurizer/DefaultFeaturizerContextGenerator.java | DefaultFeaturizerContextGenerator.getContext | public String[] getContext(int i, String[] toks, String[] tags, String[] preds) {
"""
Returns the context for making a pos tag decision at the specified token
index given the specified tokens and previous tags.
@param i
The index of the token for which the context is provided.
@param toks
The tokens in the ... | java | public String[] getContext(int i, String[] toks, String[] tags, String[] preds) {
List<String> e = new ArrayList<String>();
if(isWiderContext)
createWindowFeats(i, toks, tags, preds, e);
else
create3WindowFeats(i, toks, tags, preds, e);
if(i > 0)
wrappWindowFeatures("prev_", i-1... | [
"public",
"String",
"[",
"]",
"getContext",
"(",
"int",
"i",
",",
"String",
"[",
"]",
"toks",
",",
"String",
"[",
"]",
"tags",
",",
"String",
"[",
"]",
"preds",
")",
"{",
"List",
"<",
"String",
">",
"e",
"=",
"new",
"ArrayList",
"<",
"String",
">... | Returns the context for making a pos tag decision at the specified token
index given the specified tokens and previous tags.
@param i
The index of the token for which the context is provided.
@param toks
The tokens in the sentence.
@param tags
pos-tags
@param preds
The tags assigned to the previous words in the senten... | [
"Returns",
"the",
"context",
"for",
"making",
"a",
"pos",
"tag",
"decision",
"at",
"the",
"specified",
"token",
"index",
"given",
"the",
"specified",
"tokens",
"and",
"previous",
"tags",
"."
] | train | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-nlp/src/main/java/org/cogroo/tools/featurizer/DefaultFeaturizerContextGenerator.java#L105-L125 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/linear/AROW.java | AROW.setR | public void setR(double r) {
"""
Sets the r parameter of AROW, which controls the regularization. Larger
values reduce the change in the model on each update.
@param r the regularization parameter in (0, Inf)
"""
if(Double.isNaN(r) || Double.isInfinite(r) || r <= 0)
throw new IllegalArgum... | java | public void setR(double r)
{
if(Double.isNaN(r) || Double.isInfinite(r) || r <= 0)
throw new IllegalArgumentException("r must be a postive constant, not " + r);
this.r = r;
} | [
"public",
"void",
"setR",
"(",
"double",
"r",
")",
"{",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"r",
")",
"||",
"Double",
".",
"isInfinite",
"(",
"r",
")",
"||",
"r",
"<=",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"r must be a posti... | Sets the r parameter of AROW, which controls the regularization. Larger
values reduce the change in the model on each update.
@param r the regularization parameter in (0, Inf) | [
"Sets",
"the",
"r",
"parameter",
"of",
"AROW",
"which",
"controls",
"the",
"regularization",
".",
"Larger",
"values",
"reduce",
"the",
"change",
"in",
"the",
"model",
"on",
"each",
"update",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/AROW.java#L125-L130 |
netty/netty | common/src/main/java/io/netty/util/internal/PromiseNotificationUtil.java | PromiseNotificationUtil.tryCancel | public static void tryCancel(Promise<?> p, InternalLogger logger) {
"""
Try to cancel the {@link Promise} and log if {@code logger} is not {@code null} in case this fails.
"""
if (!p.cancel(false) && logger != null) {
Throwable err = p.cause();
if (err == null) {
... | java | public static void tryCancel(Promise<?> p, InternalLogger logger) {
if (!p.cancel(false) && logger != null) {
Throwable err = p.cause();
if (err == null) {
logger.warn("Failed to cancel promise because it has succeeded already: {}", p);
} else {
... | [
"public",
"static",
"void",
"tryCancel",
"(",
"Promise",
"<",
"?",
">",
"p",
",",
"InternalLogger",
"logger",
")",
"{",
"if",
"(",
"!",
"p",
".",
"cancel",
"(",
"false",
")",
"&&",
"logger",
"!=",
"null",
")",
"{",
"Throwable",
"err",
"=",
"p",
"."... | Try to cancel the {@link Promise} and log if {@code logger} is not {@code null} in case this fails. | [
"Try",
"to",
"cancel",
"the",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/PromiseNotificationUtil.java#L31-L42 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/subnet/SubnetClient.java | SubnetClient.listSubnets | public ListSubnetsResponse listSubnets(ListSubnetsRequest request) {
"""
Return a list of subnet owned by the authenticated user.
@param request The request containing all options for listing own's subnet.
@return The response containing a list of subnets owned by the authenticated user.
"""
checkN... | java | public ListSubnetsResponse listSubnets(ListSubnetsRequest request) {
checkNotNull(request, "request should not be null.");
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET, SUBNET_PREFIX);
if (request.getMarker() != null) {
internalRequest.addParameter... | [
"public",
"ListSubnetsResponse",
"listSubnets",
"(",
"ListSubnetsRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"this",
".",
"createRequest",
"(",
"request",
","... | Return a list of subnet owned by the authenticated user.
@param request The request containing all options for listing own's subnet.
@return The response containing a list of subnets owned by the authenticated user. | [
"Return",
"a",
"list",
"of",
"subnet",
"owned",
"by",
"the",
"authenticated",
"user",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/subnet/SubnetClient.java#L212-L222 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTransform.java | GVRTransform.rotateByAxis | public void rotateByAxis(float angle, float x, float y, float z) {
"""
Modify the transform's current rotation in angle/axis terms.
@param angle
Angle of rotation in degrees.
@param x
'X' component of the axis.
@param y
'Y' component of the axis.
@param z
'Z' component of the axis.
"""
Native... | java | public void rotateByAxis(float angle, float x, float y, float z) {
NativeTransform.rotateByAxis(getNative(), angle * TO_RADIANS, x, y, z);
} | [
"public",
"void",
"rotateByAxis",
"(",
"float",
"angle",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"NativeTransform",
".",
"rotateByAxis",
"(",
"getNative",
"(",
")",
",",
"angle",
"*",
"TO_RADIANS",
",",
"x",
",",
"y",
",",
... | Modify the transform's current rotation in angle/axis terms.
@param angle
Angle of rotation in degrees.
@param x
'X' component of the axis.
@param y
'Y' component of the axis.
@param z
'Z' component of the axis. | [
"Modify",
"the",
"transform",
"s",
"current",
"rotation",
"in",
"angle",
"/",
"axis",
"terms",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTransform.java#L444-L446 |
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.createPrebuiltEntityRoleAsync | public Observable<UUID> createPrebuiltEntityRoleAsync(UUID appId, String versionId, UUID entityId, CreatePrebuiltEntityRoleOptionalParameter createPrebuiltEntityRoleOptionalParameter) {
"""
Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The version ID.... | java | public Observable<UUID> createPrebuiltEntityRoleAsync(UUID appId, String versionId, UUID entityId, CreatePrebuiltEntityRoleOptionalParameter createPrebuiltEntityRoleOptionalParameter) {
return createPrebuiltEntityRoleWithServiceResponseAsync(appId, versionId, entityId, createPrebuiltEntityRoleOptionalParameter)... | [
"public",
"Observable",
"<",
"UUID",
">",
"createPrebuiltEntityRoleAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"CreatePrebuiltEntityRoleOptionalParameter",
"createPrebuiltEntityRoleOptionalParameter",
")",
"{",
"return",
"createPr... | Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity model ID.
@param createPrebuiltEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentExcept... | [
"Create",
"an",
"entity",
"role",
"for",
"an",
"entity",
"in",
"the",
"application",
"."
] | 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#L8061-L8068 |
google/closure-compiler | src/com/google/javascript/jscomp/RewriteAsyncIteration.java | RewriteAsyncIteration.convertAsyncGenerator | private void convertAsyncGenerator(NodeTraversal t, Node originalFunction) {
"""
Moves the body of an async generator function into a nested generator function and removes the
async and generator props from the original function.
<pre>{@code
async function* foo() {
bar();
}
}</pre>
<p>becomes
<pre>{@... | java | private void convertAsyncGenerator(NodeTraversal t, Node originalFunction) {
checkNotNull(originalFunction);
checkState(originalFunction.isAsyncGeneratorFunction());
Node asyncGeneratorWrapperRef =
astFactory.createAsyncGeneratorWrapperReference(originalFunction.getJSType(), t.getScope());
Node... | [
"private",
"void",
"convertAsyncGenerator",
"(",
"NodeTraversal",
"t",
",",
"Node",
"originalFunction",
")",
"{",
"checkNotNull",
"(",
"originalFunction",
")",
";",
"checkState",
"(",
"originalFunction",
".",
"isAsyncGeneratorFunction",
"(",
")",
")",
";",
"Node",
... | Moves the body of an async generator function into a nested generator function and removes the
async and generator props from the original function.
<pre>{@code
async function* foo() {
bar();
}
}</pre>
<p>becomes
<pre>{@code
function foo() {
return new $jscomp.AsyncGeneratorWrapper((function*(){
bar();
})())
}
}</pr... | [
"Moves",
"the",
"body",
"of",
"an",
"async",
"generator",
"function",
"into",
"a",
"nested",
"generator",
"function",
"and",
"removes",
"the",
"async",
"and",
"generator",
"props",
"from",
"the",
"original",
"function",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/RewriteAsyncIteration.java#L370-L398 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java | DocTreeScanner.visitAuthor | @Override
public R visitAuthor(AuthorTree node, P p) {
"""
{@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning
"""
return scan(node.getName(), p);
} | java | @Override
public R visitAuthor(AuthorTree node, P p) {
return scan(node.getName(), p);
} | [
"@",
"Override",
"public",
"R",
"visitAuthor",
"(",
"AuthorTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"scan",
"(",
"node",
".",
"getName",
"(",
")",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"scans",
"the",
"children",
"in",
"left",
"to",
"right",
"order",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java#L145-L148 |
jboss/jboss-jstl-api_spec | src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java | SetSupport.exportToMapProperty | void exportToMapProperty(Object target, String property, Object result) {
"""
Export the result into a Map.
@param target the Map to export into
@param property the key to export into
@param result the value to export
"""
@SuppressWarnings("unchecked")
Map<Object, Object> map = (Map<Ob... | java | void exportToMapProperty(Object target, String property, Object result) {
@SuppressWarnings("unchecked")
Map<Object, Object> map = (Map<Object, Object>) target;
if (result == null) {
map.remove(property);
} else {
map.put(property, result);
}
} | [
"void",
"exportToMapProperty",
"(",
"Object",
"target",
",",
"String",
"property",
",",
"Object",
"result",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"Map",
"<",
"Object",
",",
"Object",
">",
"map",
"=",
"(",
"Map",
"<",
"Object",
",",
... | Export the result into a Map.
@param target the Map to export into
@param property the key to export into
@param result the value to export | [
"Export",
"the",
"result",
"into",
"a",
"Map",
"."
] | train | https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java#L200-L208 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/ControlMessageFactoryImpl.java | ControlMessageFactoryImpl.createInboundControlMessage | public final ControlMessage createInboundControlMessage(byte rawMessage[], int offset, int length)
throws MessageDecodeFailedException {
"""
Create a ControlMessage of appropriate specialization to represent an
inbound message.
(To be called by the Communications... | java | public final ControlMessage createInboundControlMessage(byte rawMessage[], int offset, int length)
throws MessageDecodeFailedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())SibTr.entry(tc, "createInboundControlMessage", new Object[]{ raw... | [
"public",
"final",
"ControlMessage",
"createInboundControlMessage",
"(",
"byte",
"rawMessage",
"[",
"]",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"MessageDecodeFailedException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")"... | Create a ControlMessage of appropriate specialization to represent an
inbound message.
(To be called by the Communications component.)
@param rawMessage The inbound byte array containging a complete message
@param offset The offset within the byte array at which the message begins
@param length The length o... | [
"Create",
"a",
"ControlMessage",
"of",
"appropriate",
"specialization",
"to",
"represent",
"an",
"inbound",
"message",
".",
"(",
"To",
"be",
"called",
"by",
"the",
"Communications",
"component",
".",
")"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/ControlMessageFactoryImpl.java#L787-L800 |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsSelectListener.java | ViewControlsSelectListener.computeSurfacePoint | protected Vec4 computeSurfacePoint(OrbitView view, Angle heading, Angle pitch) {
"""
Find out where on the terrain surface the eye would be looking at with the given heading and pitch angles.
@param view the orbit view
@param heading heading direction clockwise from north.
@param pitch view pitch angle f... | java | protected Vec4 computeSurfacePoint(OrbitView view, Angle heading, Angle pitch)
{
Globe globe = wwd.getModel().getGlobe();
// Compute transform to be applied to north pointing Y so that it would point in the view direction
// Move coordinate system to view center point
Matrix transfor... | [
"protected",
"Vec4",
"computeSurfacePoint",
"(",
"OrbitView",
"view",
",",
"Angle",
"heading",
",",
"Angle",
"pitch",
")",
"{",
"Globe",
"globe",
"=",
"wwd",
".",
"getModel",
"(",
")",
".",
"getGlobe",
"(",
")",
";",
"// Compute transform to be applied to north ... | Find out where on the terrain surface the eye would be looking at with the given heading and pitch angles.
@param view the orbit view
@param heading heading direction clockwise from north.
@param pitch view pitch angle from the surface normal at the center point.
@return the terrain surface point the view would ... | [
"Find",
"out",
"where",
"on",
"the",
"terrain",
"surface",
"the",
"eye",
"would",
"be",
"looking",
"at",
"with",
"the",
"given",
"heading",
"and",
"pitch",
"angles",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsSelectListener.java#L626-L641 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/ArchUtils.java | ArchUtils.addProcessor | private static void addProcessor(final String key, final Processor processor) throws IllegalStateException {
"""
Adds the given {@link Processor} with the given key {@link String} to the map.
@param key The key as {@link String}.
@param processor The {@link Processor} to add.
@throws IllegalStateException If ... | java | private static void addProcessor(final String key, final Processor processor) throws IllegalStateException {
if (!ARCH_TO_PROCESSOR.containsKey(key)) {
ARCH_TO_PROCESSOR.put(key, processor);
} else {
final String msg = "Key " + key + " already exists in processor map";
... | [
"private",
"static",
"void",
"addProcessor",
"(",
"final",
"String",
"key",
",",
"final",
"Processor",
"processor",
")",
"throws",
"IllegalStateException",
"{",
"if",
"(",
"!",
"ARCH_TO_PROCESSOR",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"ARCH_TO_PROCESSO... | Adds the given {@link Processor} with the given key {@link String} to the map.
@param key The key as {@link String}.
@param processor The {@link Processor} to add.
@throws IllegalStateException If the key already exists. | [
"Adds",
"the",
"given",
"{",
"@link",
"Processor",
"}",
"with",
"the",
"given",
"key",
"{",
"@link",
"String",
"}",
"to",
"the",
"map",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ArchUtils.java#L91-L98 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/trie/DoubleArrayTrie.java | DoubleArrayTrie.matchTail | private int matchTail(int base, int index, String key) {
"""
Check match in tail array
@param base
@param index
@param key
@return index if it is complete match. 0 if it is prefix match. negative value if it doesn't match
"""
int positionInTailArr = base - TAIL_OFFSET;
int keyLength = ke... | java | private int matchTail(int base, int index, String key) {
int positionInTailArr = base - TAIL_OFFSET;
int keyLength = key.length();
for (int i = 0; i < keyLength; i++) {
if (key.charAt(i) != tailBuffer.get(positionInTailArr + i)) {
return -1;
}
}
... | [
"private",
"int",
"matchTail",
"(",
"int",
"base",
",",
"int",
"index",
",",
"String",
"key",
")",
"{",
"int",
"positionInTailArr",
"=",
"base",
"-",
"TAIL_OFFSET",
";",
"int",
"keyLength",
"=",
"key",
".",
"length",
"(",
")",
";",
"for",
"(",
"int",
... | Check match in tail array
@param base
@param index
@param key
@return index if it is complete match. 0 if it is prefix match. negative value if it doesn't match | [
"Check",
"match",
"in",
"tail",
"array"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/trie/DoubleArrayTrie.java#L264-L274 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/variant/metadata/VariantMetadataManager.java | VariantMetadataManager.addIndividual | public void addIndividual(org.opencb.biodata.models.metadata.Individual individual, String studyId) {
"""
Add an individual to a given variant study metadata (from study ID).
@param individual Individual to add
@param studyId Study ID
"""
// Sanity check
if (individual == null || StringU... | java | public void addIndividual(org.opencb.biodata.models.metadata.Individual individual, String studyId) {
// Sanity check
if (individual == null || StringUtils.isEmpty(individual.getId())) {
logger.error("Individual (or its ID) is null or empty.");
return;
}
VariantS... | [
"public",
"void",
"addIndividual",
"(",
"org",
".",
"opencb",
".",
"biodata",
".",
"models",
".",
"metadata",
".",
"Individual",
"individual",
",",
"String",
"studyId",
")",
"{",
"// Sanity check",
"if",
"(",
"individual",
"==",
"null",
"||",
"StringUtils",
... | Add an individual to a given variant study metadata (from study ID).
@param individual Individual to add
@param studyId Study ID | [
"Add",
"an",
"individual",
"to",
"a",
"given",
"variant",
"study",
"metadata",
"(",
"from",
"study",
"ID",
")",
"."
] | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/metadata/VariantMetadataManager.java#L326-L349 |
davetcc/tcMenu | tcMenuJavaApi/src/main/java/com/thecoderscorner/menu/domain/state/MenuTree.java | MenuTree.replaceMenuById | public void replaceMenuById(SubMenuItem subMenu, MenuItem toReplace) {
"""
Replace the menu item that has a given parent with the one provided
@param subMenu the parent
@param toReplace the menu item to replace by ID
"""
synchronized (subMenuItems) {
ArrayList<MenuItem> list = subMenuItem... | java | public void replaceMenuById(SubMenuItem subMenu, MenuItem toReplace) {
synchronized (subMenuItems) {
ArrayList<MenuItem> list = subMenuItems.get(subMenu);
int idx = -1;
for (int i = 0; i < list.size(); ++i) {
if (list.get(i).getId() == toReplace.getId()) {
... | [
"public",
"void",
"replaceMenuById",
"(",
"SubMenuItem",
"subMenu",
",",
"MenuItem",
"toReplace",
")",
"{",
"synchronized",
"(",
"subMenuItems",
")",
"{",
"ArrayList",
"<",
"MenuItem",
">",
"list",
"=",
"subMenuItems",
".",
"get",
"(",
"subMenu",
")",
";",
"... | Replace the menu item that has a given parent with the one provided
@param subMenu the parent
@param toReplace the menu item to replace by ID | [
"Replace",
"the",
"menu",
"item",
"that",
"has",
"a",
"given",
"parent",
"with",
"the",
"one",
"provided"
] | train | https://github.com/davetcc/tcMenu/blob/61546e4b982b25ceaff384073fe9ec1fff55e64a/tcMenuJavaApi/src/main/java/com/thecoderscorner/menu/domain/state/MenuTree.java#L129-L148 |
aws/aws-sdk-java | aws-java-sdk-signer/src/main/java/com/amazonaws/services/signer/model/SigningProfile.java | SigningProfile.withSigningParameters | public SigningProfile withSigningParameters(java.util.Map<String, String> signingParameters) {
"""
<p>
The parameters that are available for use by an AWS Signer user.
</p>
@param signingParameters
The parameters that are available for use by an AWS Signer user.
@return Returns a reference to this object so... | java | public SigningProfile withSigningParameters(java.util.Map<String, String> signingParameters) {
setSigningParameters(signingParameters);
return this;
} | [
"public",
"SigningProfile",
"withSigningParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"signingParameters",
")",
"{",
"setSigningParameters",
"(",
"signingParameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The parameters that are available for use by an AWS Signer user.
</p>
@param signingParameters
The parameters that are available for use by an AWS Signer user.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"parameters",
"that",
"are",
"available",
"for",
"use",
"by",
"an",
"AWS",
"Signer",
"user",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-signer/src/main/java/com/amazonaws/services/signer/model/SigningProfile.java#L218-L221 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.isSameFile | public boolean isSameFile(JimfsPath path, FileSystemView view2, JimfsPath path2)
throws IOException {
"""
Returns whether or not the two given paths locate the same file. The second path is located
using the given view rather than this file view.
"""
if (!isSameFileSystem(view2)) {
return fals... | java | public boolean isSameFile(JimfsPath path, FileSystemView view2, JimfsPath path2)
throws IOException {
if (!isSameFileSystem(view2)) {
return false;
}
store.readLock().lock();
try {
File file = lookUp(path, Options.FOLLOW_LINKS).fileOrNull();
File file2 = view2.lookUp(path2, Opti... | [
"public",
"boolean",
"isSameFile",
"(",
"JimfsPath",
"path",
",",
"FileSystemView",
"view2",
",",
"JimfsPath",
"path2",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"isSameFileSystem",
"(",
"view2",
")",
")",
"{",
"return",
"false",
";",
"}",
"store",
... | Returns whether or not the two given paths locate the same file. The second path is located
using the given view rather than this file view. | [
"Returns",
"whether",
"or",
"not",
"the",
"two",
"given",
"paths",
"locate",
"the",
"same",
"file",
".",
"The",
"second",
"path",
"is",
"located",
"using",
"the",
"given",
"view",
"rather",
"than",
"this",
"file",
"view",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L175-L189 |
dihedron/dihedron-commons | src/main/java/org/dihedron/core/variables/Variables.java | Variables.replaceVariables | public static final String replaceVariables(String text, ValueProvider... providers) {
"""
Matches all variables (according to the ${[a-zA-Z_][a-zA-Z0-9_\-]*} pattern)
and replaces them with the value provided by the set of value provides.
The processing is repeated until no more valid variable names can be foun... | java | public static final String replaceVariables(String text, ValueProvider... providers) {
return replaceVariables(text, DEFAULT_CASE_SENSITIVE, providers);
} | [
"public",
"static",
"final",
"String",
"replaceVariables",
"(",
"String",
"text",
",",
"ValueProvider",
"...",
"providers",
")",
"{",
"return",
"replaceVariables",
"(",
"text",
",",
"DEFAULT_CASE_SENSITIVE",
",",
"providers",
")",
";",
"}"
] | Matches all variables (according to the ${[a-zA-Z_][a-zA-Z0-9_\-]*} pattern)
and replaces them with the value provided by the set of value provides.
The processing is repeated until no more valid variable names can be found
in the input text, or no more variables can be bound (e.g. when some values
are not available); ... | [
"Matches",
"all",
"variables",
"(",
"according",
"to",
"the",
"$",
"{",
"[",
"a",
"-",
"zA",
"-",
"Z_",
"]",
"[",
"a",
"-",
"zA",
"-",
"Z0",
"-",
"9_",
"\\",
"-",
"]",
"*",
"}",
"pattern",
")",
"and",
"replaces",
"them",
"with",
"the",
"value",... | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/variables/Variables.java#L53-L55 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.BitArray | public JBBPDslBuilder BitArray(final String name, final String bitLenExpression, final int size) {
"""
Add named fixed length bit array, size of one bit field is calculated by expression.
@param name name of the array, if null then anonymous one
@param bitLenExpression expression to calculate lengt... | java | public JBBPDslBuilder BitArray(final String name, final String bitLenExpression, final int size) {
return this.BitArray(name, bitLenExpression, arraySizeToString(size));
} | [
"public",
"JBBPDslBuilder",
"BitArray",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"bitLenExpression",
",",
"final",
"int",
"size",
")",
"{",
"return",
"this",
".",
"BitArray",
"(",
"name",
",",
"bitLenExpression",
",",
"arraySizeToString",
"(",
"... | Add named fixed length bit array, size of one bit field is calculated by expression.
@param name name of the array, if null then anonymous one
@param bitLenExpression expression to calculate length of the bit field, must not be null
@param size number of elements in array, if negative then till... | [
"Add",
"named",
"fixed",
"length",
"bit",
"array",
"size",
"of",
"one",
"bit",
"field",
"is",
"calculated",
"by",
"expression",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L688-L690 |
facebook/fresco | fbcore/src/main/java/com/facebook/common/activitylistener/ActivityListenerManager.java | ActivityListenerManager.register | public static void register(ActivityListener activityListener, Context context) {
"""
If given context is an instance of ListenableActivity then creates new instance of
WeakReferenceActivityListenerAdapter and adds it to activity's listeners
"""
ListenableActivity activity = getListenableActivity(context)... | java | public static void register(ActivityListener activityListener, Context context) {
ListenableActivity activity = getListenableActivity(context);
if (activity != null) {
Listener listener = new Listener(activityListener);
activity.addActivityListener(listener);
}
} | [
"public",
"static",
"void",
"register",
"(",
"ActivityListener",
"activityListener",
",",
"Context",
"context",
")",
"{",
"ListenableActivity",
"activity",
"=",
"getListenableActivity",
"(",
"context",
")",
";",
"if",
"(",
"activity",
"!=",
"null",
")",
"{",
"Li... | If given context is an instance of ListenableActivity then creates new instance of
WeakReferenceActivityListenerAdapter and adds it to activity's listeners | [
"If",
"given",
"context",
"is",
"an",
"instance",
"of",
"ListenableActivity",
"then",
"creates",
"new",
"instance",
"of",
"WeakReferenceActivityListenerAdapter",
"and",
"adds",
"it",
"to",
"activity",
"s",
"listeners"
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/fbcore/src/main/java/com/facebook/common/activitylistener/ActivityListenerManager.java#L29-L35 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/transform/serde/BaseSerializer.java | BaseSerializer.deserializeSequenceComparatorList | public List<SequenceComparator> deserializeSequenceComparatorList(String str) {
"""
Deserialize a SequenceComparator List serialized using {@link #serializeSequenceComparatorList(List)}, or
an array serialized using {@link #serialize(SequenceComparator[])}
@param str String representation (YAML/JSON) of the Se... | java | public List<SequenceComparator> deserializeSequenceComparatorList(String str) {
return load(str, ListWrappers.SequenceComparatorList.class).getList();
} | [
"public",
"List",
"<",
"SequenceComparator",
">",
"deserializeSequenceComparatorList",
"(",
"String",
"str",
")",
"{",
"return",
"load",
"(",
"str",
",",
"ListWrappers",
".",
"SequenceComparatorList",
".",
"class",
")",
".",
"getList",
"(",
")",
";",
"}"
] | Deserialize a SequenceComparator List serialized using {@link #serializeSequenceComparatorList(List)}, or
an array serialized using {@link #serialize(SequenceComparator[])}
@param str String representation (YAML/JSON) of the SequenceComparator list
@return {@code List<SequenceComparator>} | [
"Deserialize",
"a",
"SequenceComparator",
"List",
"serialized",
"using",
"{",
"@link",
"#serializeSequenceComparatorList",
"(",
"List",
")",
"}",
"or",
"an",
"array",
"serialized",
"using",
"{",
"@link",
"#serialize",
"(",
"SequenceComparator",
"[]",
")",
"}"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/serde/BaseSerializer.java#L322-L324 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AnderbergHierarchicalClustering.java | AnderbergHierarchicalClustering.findMerge | protected int findMerge(int size, MatrixParadigm mat, double[] bestd, int[] besti, PointerHierarchyRepresentationBuilder builder) {
"""
Perform the next merge step.
Due to the cache, this is now O(n) each time, instead of O(n*n).
@param size Data set size
@param mat Matrix paradigm
@param bestd Best distan... | java | protected int findMerge(int size, MatrixParadigm mat, double[] bestd, int[] besti, PointerHierarchyRepresentationBuilder builder) {
double mindist = Double.POSITIVE_INFINITY;
int x = -1, y = -1;
// Find minimum:
for(int cx = 0; cx < size; cx++) {
// Skip if object has already joined a cluster:
... | [
"protected",
"int",
"findMerge",
"(",
"int",
"size",
",",
"MatrixParadigm",
"mat",
",",
"double",
"[",
"]",
"bestd",
",",
"int",
"[",
"]",
"besti",
",",
"PointerHierarchyRepresentationBuilder",
"builder",
")",
"{",
"double",
"mindist",
"=",
"Double",
".",
"P... | Perform the next merge step.
Due to the cache, this is now O(n) each time, instead of O(n*n).
@param size Data set size
@param mat Matrix paradigm
@param bestd Best distance
@param besti Index of best distance
@param builder Hierarchy builder
@return x, for shrinking the working set. | [
"Perform",
"the",
"next",
"merge",
"step",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AnderbergHierarchicalClustering.java#L185-L206 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsList.java | CmsList.changeId | protected void changeId(I item, String id) {
"""
Changes the id for the given item.<p>
@param item the item to change the id for
@param id the new id
"""
if (m_items.remove(item.getId()) != null) {
m_items.put(id, item);
}
} | java | protected void changeId(I item, String id) {
if (m_items.remove(item.getId()) != null) {
m_items.put(id, item);
}
} | [
"protected",
"void",
"changeId",
"(",
"I",
"item",
",",
"String",
"id",
")",
"{",
"if",
"(",
"m_items",
".",
"remove",
"(",
"item",
".",
"getId",
"(",
")",
")",
"!=",
"null",
")",
"{",
"m_items",
".",
"put",
"(",
"id",
",",
"item",
")",
";",
"}... | Changes the id for the given item.<p>
@param item the item to change the id for
@param id the new id | [
"Changes",
"the",
"id",
"for",
"the",
"given",
"item",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsList.java#L412-L417 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java | DrizzlePreparedStatement.setTime | public void setTime(final int parameterIndex, final Time x) throws SQLException {
"""
Since Drizzle has no TIME datatype, time in milliseconds is stored in a packed integer
@param parameterIndex the first parameter is 1, the second is 2, ...
@param x the parameter value
@throws java.sql.SQLExcept... | java | public void setTime(final int parameterIndex, final Time x) throws SQLException {
if(x == null) {
setNull(parameterIndex, Types.TIME);
return;
}
setParameter(parameterIndex, new TimeParameter(x.getTime()));
} | [
"public",
"void",
"setTime",
"(",
"final",
"int",
"parameterIndex",
",",
"final",
"Time",
"x",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"x",
"==",
"null",
")",
"{",
"setNull",
"(",
"parameterIndex",
",",
"Types",
".",
"TIME",
")",
";",
"return",
... | Since Drizzle has no TIME datatype, time in milliseconds is stored in a packed integer
@param parameterIndex the first parameter is 1, the second is 2, ...
@param x the parameter value
@throws java.sql.SQLException if parameterIndex does not correspond to a parameter marker in the SQL statement;
if a data... | [
"Since",
"Drizzle",
"has",
"no",
"TIME",
"datatype",
"time",
"in",
"milliseconds",
"is",
"stored",
"in",
"a",
"packed",
"integer"
] | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java#L1154-L1162 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/ipc/ProtocolSignature.java | ProtocolSignature.getProtocolSignature | public static ProtocolSignature getProtocolSignature(
int clientMethodsHashCode,
long serverVersion,
Class<? extends VersionedProtocol> protocol) {
"""
Get a server protocol's signature
@param clientMethodsHashCode client protocol methods hashcode
@param serverVersion server protocol version
... | java | public static ProtocolSignature getProtocolSignature(
int clientMethodsHashCode,
long serverVersion,
Class<? extends VersionedProtocol> protocol) {
// try to get the finger print & signature from the cache
ProtocolSigFingerprint sig = getSigFingerprint(protocol, serverVersion);
// che... | [
"public",
"static",
"ProtocolSignature",
"getProtocolSignature",
"(",
"int",
"clientMethodsHashCode",
",",
"long",
"serverVersion",
",",
"Class",
"<",
"?",
"extends",
"VersionedProtocol",
">",
"protocol",
")",
"{",
"// try to get the finger print & signature from the cache",
... | Get a server protocol's signature
@param clientMethodsHashCode client protocol methods hashcode
@param serverVersion server protocol version
@param protocol protocol
@return the server's protocol signature | [
"Get",
"a",
"server",
"protocol",
"s",
"signature"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/ipc/ProtocolSignature.java#L207-L220 |
apache/incubator-heron | heron/spi/src/java/org/apache/heron/spi/utils/UploaderUtils.java | UploaderUtils.generateFilename | public static String generateFilename(
String topologyName,
String role) {
"""
Generate a unique filename to upload in the storage service
@param topologyName topology name
@param role role owns the topology
@return a unique filename
"""
// By default, we have empty tag info and version 0
... | java | public static String generateFilename(
String topologyName,
String role) {
// By default, we have empty tag info and version 0
return generateFilename(topologyName, role, "tag", 0, DEFAULT_FILENAME_EXTENSION);
} | [
"public",
"static",
"String",
"generateFilename",
"(",
"String",
"topologyName",
",",
"String",
"role",
")",
"{",
"// By default, we have empty tag info and version 0",
"return",
"generateFilename",
"(",
"topologyName",
",",
"role",
",",
"\"tag\"",
",",
"0",
",",
"DEF... | Generate a unique filename to upload in the storage service
@param topologyName topology name
@param role role owns the topology
@return a unique filename | [
"Generate",
"a",
"unique",
"filename",
"to",
"upload",
"in",
"the",
"storage",
"service"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/spi/src/java/org/apache/heron/spi/utils/UploaderUtils.java#L45-L50 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/FeatureSupportsInner.java | FeatureSupportsInner.validateAsync | public Observable<AzureVMResourceFeatureSupportResponseInner> validateAsync(String azureRegion, FeatureSupportRequest parameters) {
"""
It will validate if given feature with resource properties is supported in service.
@param azureRegion Azure region to hit Api
@param parameters Feature support request object... | java | public Observable<AzureVMResourceFeatureSupportResponseInner> validateAsync(String azureRegion, FeatureSupportRequest parameters) {
return validateWithServiceResponseAsync(azureRegion, parameters).map(new Func1<ServiceResponse<AzureVMResourceFeatureSupportResponseInner>, AzureVMResourceFeatureSupportResponseInn... | [
"public",
"Observable",
"<",
"AzureVMResourceFeatureSupportResponseInner",
">",
"validateAsync",
"(",
"String",
"azureRegion",
",",
"FeatureSupportRequest",
"parameters",
")",
"{",
"return",
"validateWithServiceResponseAsync",
"(",
"azureRegion",
",",
"parameters",
")",
"."... | It will validate if given feature with resource properties is supported in service.
@param azureRegion Azure region to hit Api
@param parameters Feature support request object
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the AzureVMResourceFeatureSupportResponseIn... | [
"It",
"will",
"validate",
"if",
"given",
"feature",
"with",
"resource",
"properties",
"is",
"supported",
"in",
"service",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/FeatureSupportsInner.java#L98-L105 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularDistortBase_F32.java | EquirectangularDistortBase_F32.compute | @Override
public void compute(int x, int y, Point2D_F32 out ) {
"""
Input is in pinhole camera pixel coordinates. Output is in equirectangular coordinates
@param x Pixel x-coordinate in rendered pinhole camera
@param y Pixel y-coordinate in rendered pinhole camera
"""
// grab precomputed normalized ima... | java | @Override
public void compute(int x, int y, Point2D_F32 out ) {
// grab precomputed normalized image coordinate at canonical location
Point3D_F32 v = vectors[y*outWidth+x];
// move to requested orientation
GeometryMath_F32.mult(R,v,n); // TODO make faster by not using an array based matrix
// compute pixel ... | [
"@",
"Override",
"public",
"void",
"compute",
"(",
"int",
"x",
",",
"int",
"y",
",",
"Point2D_F32",
"out",
")",
"{",
"// grab precomputed normalized image coordinate at canonical location",
"Point3D_F32",
"v",
"=",
"vectors",
"[",
"y",
"*",
"outWidth",
"+",
"x",
... | Input is in pinhole camera pixel coordinates. Output is in equirectangular coordinates
@param x Pixel x-coordinate in rendered pinhole camera
@param y Pixel y-coordinate in rendered pinhole camera | [
"Input",
"is",
"in",
"pinhole",
"camera",
"pixel",
"coordinates",
".",
"Output",
"is",
"in",
"equirectangular",
"coordinates"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularDistortBase_F32.java#L107-L116 |
google/closure-compiler | src/com/google/javascript/jscomp/ExploitAssigns.java | ExploitAssigns.collapseAssign | private void collapseAssign(Node assign, Node expr, Node exprParent) {
"""
Try to collapse the given assign into subsequent expressions.
"""
Node leftValue = assign.getFirstChild();
Node rightValue = leftValue.getNext();
if (leftValue.isDestructuringPattern()) {
// We don't collapse expressi... | java | private void collapseAssign(Node assign, Node expr, Node exprParent) {
Node leftValue = assign.getFirstChild();
Node rightValue = leftValue.getNext();
if (leftValue.isDestructuringPattern()) {
// We don't collapse expressions containing these because they can have side effects:
// - Reassigni... | [
"private",
"void",
"collapseAssign",
"(",
"Node",
"assign",
",",
"Node",
"expr",
",",
"Node",
"exprParent",
")",
"{",
"Node",
"leftValue",
"=",
"assign",
".",
"getFirstChild",
"(",
")",
";",
"Node",
"rightValue",
"=",
"leftValue",
".",
"getNext",
"(",
")",... | Try to collapse the given assign into subsequent expressions. | [
"Try",
"to",
"collapse",
"the",
"given",
"assign",
"into",
"subsequent",
"expressions",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ExploitAssigns.java#L43-L64 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePolynomialMath.java | QrCodePolynomialMath.decodeFormatMessage | public static void decodeFormatMessage(int message , QrCode qr ) {
"""
Assumes that the format message has no errors in it and decodes its data and saves it into the qr code
@param message format data bits after the mask has been remove and shifted over 10 bits
@param qr Where the results are written to
""... | java | public static void decodeFormatMessage(int message , QrCode qr ) {
int error = message >> 3;
qr.error = QrCode.ErrorLevel.lookup(error);
qr.mask = QrCodeMaskPattern.lookupMask(message&0x07);
} | [
"public",
"static",
"void",
"decodeFormatMessage",
"(",
"int",
"message",
",",
"QrCode",
"qr",
")",
"{",
"int",
"error",
"=",
"message",
">>",
"3",
";",
"qr",
".",
"error",
"=",
"QrCode",
".",
"ErrorLevel",
".",
"lookup",
"(",
"error",
")",
";",
"qr",
... | Assumes that the format message has no errors in it and decodes its data and saves it into the qr code
@param message format data bits after the mask has been remove and shifted over 10 bits
@param qr Where the results are written to | [
"Assumes",
"that",
"the",
"format",
"message",
"has",
"no",
"errors",
"in",
"it",
"and",
"decodes",
"its",
"data",
"and",
"saves",
"it",
"into",
"the",
"qr",
"code"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePolynomialMath.java#L94-L99 |
httl/httl | httl/src/main/java/httl/spi/engines/DefaultEngine.java | DefaultEngine.hasResource | public boolean hasResource(String name, Locale locale) {
"""
Tests whether the resource denoted by this abstract pathname exists.
@param name - template name
@param locale - resource locale
@return exists
@see #getEngine()
"""
name = UrlUtils.cleanName(name);
locale = cleanLocale(locale... | java | public boolean hasResource(String name, Locale locale) {
name = UrlUtils.cleanName(name);
locale = cleanLocale(locale);
return stringLoader.exists(name, locale) || loader.exists(name, locale);
} | [
"public",
"boolean",
"hasResource",
"(",
"String",
"name",
",",
"Locale",
"locale",
")",
"{",
"name",
"=",
"UrlUtils",
".",
"cleanName",
"(",
"name",
")",
";",
"locale",
"=",
"cleanLocale",
"(",
"locale",
")",
";",
"return",
"stringLoader",
".",
"exists",
... | Tests whether the resource denoted by this abstract pathname exists.
@param name - template name
@param locale - resource locale
@return exists
@see #getEngine() | [
"Tests",
"whether",
"the",
"resource",
"denoted",
"by",
"this",
"abstract",
"pathname",
"exists",
"."
] | train | https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/spi/engines/DefaultEngine.java#L328-L332 |
huahin/huahin-unit | src/main/java/org/huahinframework/unit/FilterDriver.java | FilterDriver.setParameter | @SuppressWarnings( {
"""
parameter setting.
@param name parameter name
@param value Enum parameter value
""" "unchecked", "rawtypes" })
public void setParameter(String name, Enum value) {
conf.setEnum(name, value);
} | java | @SuppressWarnings({ "unchecked", "rawtypes" })
public void setParameter(String name, Enum value) {
conf.setEnum(name, value);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"void",
"setParameter",
"(",
"String",
"name",
",",
"Enum",
"value",
")",
"{",
"conf",
".",
"setEnum",
"(",
"name",
",",
"value",
")",
";",
"}"
] | parameter setting.
@param name parameter name
@param value Enum parameter value | [
"parameter",
"setting",
"."
] | train | https://github.com/huahin/huahin-unit/blob/7993d390eff8dba4510a3a1e6a3c8bef95697316/src/main/java/org/huahinframework/unit/FilterDriver.java#L767-L770 |
RestComm/jss7 | map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/datacoding/GSMCharset.java | GSMCharset.sliceString | public String[] sliceString(String data, int charCount) {
"""
Slicing of a data String into substrings that fits to characters / septets count in charCount parameter.
@param data
@return
"""
return sliceString(data, charCount, this.mainTable, this.extensionTable);
} | java | public String[] sliceString(String data, int charCount) {
return sliceString(data, charCount, this.mainTable, this.extensionTable);
} | [
"public",
"String",
"[",
"]",
"sliceString",
"(",
"String",
"data",
",",
"int",
"charCount",
")",
"{",
"return",
"sliceString",
"(",
"data",
",",
"charCount",
",",
"this",
".",
"mainTable",
",",
"this",
".",
"extensionTable",
")",
";",
"}"
] | Slicing of a data String into substrings that fits to characters / septets count in charCount parameter.
@param data
@return | [
"Slicing",
"of",
"a",
"data",
"String",
"into",
"substrings",
"that",
"fits",
"to",
"characters",
"/",
"septets",
"count",
"in",
"charCount",
"parameter",
"."
] | train | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/datacoding/GSMCharset.java#L252-L254 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionManager.java | CustomVisionPredictionManager.authenticate | public static PredictionEndpoint authenticate(RestClient restClient, final String apiKey) {
"""
Initializes an instance of Custom Vision Prediction API client.
@param restClient the REST client to connect to Azure.
@param apiKey the Custom Vision Prediction API key
@return the Custom Vision Prediction API cli... | java | public static PredictionEndpoint authenticate(RestClient restClient, final String apiKey) {
return new PredictionEndpointImpl(restClient).withApiKey(apiKey);
} | [
"public",
"static",
"PredictionEndpoint",
"authenticate",
"(",
"RestClient",
"restClient",
",",
"final",
"String",
"apiKey",
")",
"{",
"return",
"new",
"PredictionEndpointImpl",
"(",
"restClient",
")",
".",
"withApiKey",
"(",
"apiKey",
")",
";",
"}"
] | Initializes an instance of Custom Vision Prediction API client.
@param restClient the REST client to connect to Azure.
@param apiKey the Custom Vision Prediction API key
@return the Custom Vision Prediction API client | [
"Initializes",
"an",
"instance",
"of",
"Custom",
"Vision",
"Prediction",
"API",
"client",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionManager.java#L74-L76 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/security/CipherUtil.java | CipherUtil.validateTime | public static void validateTime(String timestamp, int duration) throws Exception {
"""
Validates the timestamp and insures that it falls within the specified duration.
@param timestamp Timestamp in yyyyMMddHHmmssz format.
@param duration Validity duration in minutes.
@throws Exception Unspecified exception.
... | java | public static void validateTime(String timestamp, int duration) throws Exception {
Date date = getTimestampFormatter().parse(timestamp);
long sign_time = date.getTime();
long now_time = System.currentTimeMillis();
long diff = now_time - sign_time;
long min_diff = diff / (60 * 100... | [
"public",
"static",
"void",
"validateTime",
"(",
"String",
"timestamp",
",",
"int",
"duration",
")",
"throws",
"Exception",
"{",
"Date",
"date",
"=",
"getTimestampFormatter",
"(",
")",
".",
"parse",
"(",
"timestamp",
")",
";",
"long",
"sign_time",
"=",
"date... | Validates the timestamp and insures that it falls within the specified duration.
@param timestamp Timestamp in yyyyMMddHHmmssz format.
@param duration Validity duration in minutes.
@throws Exception Unspecified exception. | [
"Validates",
"the",
"timestamp",
"and",
"insures",
"that",
"it",
"falls",
"within",
"the",
"specified",
"duration",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/security/CipherUtil.java#L140-L150 |
apache/incubator-druid | extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java | BloomKFilter.addHash | public static void addHash(ByteBuffer buffer, long hash64) {
"""
ByteBuffer based copy of {@link BloomKFilter#addHash(long)} that adds a value to the ByteBuffer in place.
"""
final int hash1 = (int) hash64;
final int hash2 = (int) (hash64 >>> 32);
int firstHash = hash1 + hash2;
// hashcode sho... | java | public static void addHash(ByteBuffer buffer, long hash64)
{
final int hash1 = (int) hash64;
final int hash2 = (int) (hash64 >>> 32);
int firstHash = hash1 + hash2;
// hashcode should be positive, flip all the bits if it's negative
if (firstHash < 0) {
firstHash = ~firstHash;
}
Byt... | [
"public",
"static",
"void",
"addHash",
"(",
"ByteBuffer",
"buffer",
",",
"long",
"hash64",
")",
"{",
"final",
"int",
"hash1",
"=",
"(",
"int",
")",
"hash64",
";",
"final",
"int",
"hash2",
"=",
"(",
"int",
")",
"(",
"hash64",
">>>",
"32",
")",
";",
... | ByteBuffer based copy of {@link BloomKFilter#addHash(long)} that adds a value to the ByteBuffer in place. | [
"ByteBuffer",
"based",
"copy",
"of",
"{"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/BloomKFilter.java#L392-L425 |
playn/playn | core/src/playn/core/Image.java | Image.createTexture | public Texture createTexture (Texture.Config config) {
"""
Creates a texture with this image's bitmap data using {@code config}. NOTE: this creates a new
texture with every call. This is generally only needed if you plan to create multiple textures
from the same bitmap, with different configurations. Otherwise j... | java | public Texture createTexture (Texture.Config config) {
if (!isLoaded()) throw new IllegalStateException(
"Cannot create texture from unready image: " + this);
int texWidth = config.toTexWidth(pixelWidth());
int texHeight = config.toTexHeight(pixelHeight());
if (texWidth <= 0 || texHeight <= 0) th... | [
"public",
"Texture",
"createTexture",
"(",
"Texture",
".",
"Config",
"config",
")",
"{",
"if",
"(",
"!",
"isLoaded",
"(",
")",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cannot create texture from unready image: \"",
"+",
"this",
")",
";",
"int",
"tex... | Creates a texture with this image's bitmap data using {@code config}. NOTE: this creates a new
texture with every call. This is generally only needed if you plan to create multiple textures
from the same bitmap, with different configurations. Otherwise just use {@link #texture} to
create the image's "default" texture w... | [
"Creates",
"a",
"texture",
"with",
"this",
"image",
"s",
"bitmap",
"data",
"using",
"{"
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/Image.java#L169-L182 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/descriptivestatistics/Descriptives.java | Descriptives.normalizeExp | public static void normalizeExp(AssociativeArray associativeArray) {
"""
Normalizes the exponentials of provided associative array by using the
log-sum-exp trick.
@param associativeArray
"""
double max = max(associativeArray.toFlatDataCollection());
double sum = 0.0;
//Prevents num... | java | public static void normalizeExp(AssociativeArray associativeArray) {
double max = max(associativeArray.toFlatDataCollection());
double sum = 0.0;
//Prevents numeric underflow by subtracting the max. References: http://www.youtube.com/watch?v=-RVM21Voo7Q
for(Map.Entry<Object, Object> ent... | [
"public",
"static",
"void",
"normalizeExp",
"(",
"AssociativeArray",
"associativeArray",
")",
"{",
"double",
"max",
"=",
"max",
"(",
"associativeArray",
".",
"toFlatDataCollection",
"(",
")",
")",
";",
"double",
"sum",
"=",
"0.0",
";",
"//Prevents numeric underflo... | Normalizes the exponentials of provided associative array by using the
log-sum-exp trick.
@param associativeArray | [
"Normalizes",
"the",
"exponentials",
"of",
"provided",
"associative",
"array",
"by",
"using",
"the",
"log",
"-",
"sum",
"-",
"exp",
"trick",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/descriptivestatistics/Descriptives.java#L706-L723 |
strator-dev/greenpepper | greenpepper-open/extensions-external/php/src/main/java/com/greenpepper/phpsud/container/PHPMethodDescriptor.java | PHPMethodDescriptor.execNoResponse | public void execNoResponse(String id, String ... params) throws Exception {
"""
<p>execNoResponse.</p>
@param id a {@link java.lang.String} object.
@param params a {@link java.lang.String} object.
@throws java.lang.Exception if any.
"""
container.run(getCmd(id, params));
} | java | public void execNoResponse(String id, String ... params) throws Exception {
container.run(getCmd(id, params));
} | [
"public",
"void",
"execNoResponse",
"(",
"String",
"id",
",",
"String",
"...",
"params",
")",
"throws",
"Exception",
"{",
"container",
".",
"run",
"(",
"getCmd",
"(",
"id",
",",
"params",
")",
")",
";",
"}"
] | <p>execNoResponse.</p>
@param id a {@link java.lang.String} object.
@param params a {@link java.lang.String} object.
@throws java.lang.Exception if any. | [
"<p",
">",
"execNoResponse",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/extensions-external/php/src/main/java/com/greenpepper/phpsud/container/PHPMethodDescriptor.java#L151-L153 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java | StringSupport.isAlphaNumericOrContainsOnlyCharacters | public static boolean isAlphaNumericOrContainsOnlyCharacters(String in, String chars) {
"""
tells whether all characters in a String are letters or digits or part of a given String
@param in String to evaluate
@param chars characters which are allowed in the given String
"""
char c = 0;
for (int i = 0;... | java | public static boolean isAlphaNumericOrContainsOnlyCharacters(String in, String chars) {
char c = 0;
for (int i = 0; i < in.length(); i++) {
c = in.charAt(i);
if (Character.isLetterOrDigit(c) == (chars.indexOf(c) != -1)) {
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"isAlphaNumericOrContainsOnlyCharacters",
"(",
"String",
"in",
",",
"String",
"chars",
")",
"{",
"char",
"c",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"in",
".",
"length",
"(",
")",
";",
"i",
"++"... | tells whether all characters in a String are letters or digits or part of a given String
@param in String to evaluate
@param chars characters which are allowed in the given String | [
"tells",
"whether",
"all",
"characters",
"in",
"a",
"String",
"are",
"letters",
"or",
"digits",
"or",
"part",
"of",
"a",
"given",
"String"
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java#L397-L406 |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/parser/xes/DataUsageExtension.java | DataUsageExtension.assignData | public void assignData(XEvent event, String data) {
"""
Assigns the data attribute value for a given event.
@param event Event to be modified.
@param data Data string to be assigned.
"""
if (data != null && data.trim().length() > 0) {
XAttributeLiteral attr = (XAtt... | java | public void assignData(XEvent event, String data) {
if (data != null && data.trim().length() > 0) {
XAttributeLiteral attr = (XAttributeLiteral) ATTR_DATA.clone();
attr.setValue(data.trim());
event.getAttributes().put(KEY_DATA, ... | [
"public",
"void",
"assignData",
"(",
"XEvent",
"event",
",",
"String",
"data",
")",
"{",
"if",
"(",
"data",
"!=",
"null",
"&&",
"data",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"XAttributeLiteral",
"attr",
"=",
"(",
"XAtt... | Assigns the data attribute value for a given event.
@param event Event to be modified.
@param data Data string to be assigned. | [
"Assigns",
"the",
"data",
"attribute",
"value",
"for",
"a",
"given",
"event",
"."
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/parser/xes/DataUsageExtension.java#L110-L116 |
fozziethebeat/S-Space | opt/src/main/java/edu/ucla/sspace/lra/LatentRelationalAnalysis.java | LatentRelationalAnalysis.combinatorialPatternMaker | private static String combinatorialPatternMaker(String[] str, int str_size, int c) {
"""
Makes patterns by replacing words in str with wildcards based on the binary value of c.
"""
String comb_pattern = "";
int curr_comb = 1;
for (int i = 0; i < str_size; i++) {
if ((c & cur... | java | private static String combinatorialPatternMaker(String[] str, int str_size, int c) {
String comb_pattern = "";
int curr_comb = 1;
for (int i = 0; i < str_size; i++) {
if ((c & curr_comb) != 0) {
comb_pattern += str[i] + "\\s";
} else {
comb... | [
"private",
"static",
"String",
"combinatorialPatternMaker",
"(",
"String",
"[",
"]",
"str",
",",
"int",
"str_size",
",",
"int",
"c",
")",
"{",
"String",
"comb_pattern",
"=",
"\"\"",
";",
"int",
"curr_comb",
"=",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"... | Makes patterns by replacing words in str with wildcards based on the binary value of c. | [
"Makes",
"patterns",
"by",
"replacing",
"words",
"in",
"str",
"with",
"wildcards",
"based",
"on",
"the",
"binary",
"value",
"of",
"c",
"."
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/opt/src/main/java/edu/ucla/sspace/lra/LatentRelationalAnalysis.java#L610-L623 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/cellprocessor/constraint/LengthBetween.java | LengthBetween.checkPreconditions | private static void checkPreconditions(final int min, final int max) {
"""
Checks the preconditions for creating a new {@link LengthBetween} processor.
@param min
the minimum String length
@param max
the maximum String length
@throws IllegalArgumentException
{@literal if max < min, or min is < 0}
"""
... | java | private static void checkPreconditions(final int min, final int max) {
if( min > max ) {
throw new IllegalArgumentException(String.format("max (%d) should not be < min (%d)", max, min));
}
if( min < 0 ) {
throw new IllegalArgumentException(String.format("mi... | [
"private",
"static",
"void",
"checkPreconditions",
"(",
"final",
"int",
"min",
",",
"final",
"int",
"max",
")",
"{",
"if",
"(",
"min",
">",
"max",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"max (%d) should not... | Checks the preconditions for creating a new {@link LengthBetween} processor.
@param min
the minimum String length
@param max
the maximum String length
@throws IllegalArgumentException
{@literal if max < min, or min is < 0} | [
"Checks",
"the",
"preconditions",
"for",
"creating",
"a",
"new",
"{",
"@link",
"LengthBetween",
"}",
"processor",
"."
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/cellprocessor/constraint/LengthBetween.java#L49-L57 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowVersionsInner.java | WorkflowVersionsInner.getAsync | public Observable<WorkflowVersionInner> getAsync(String resourceGroupName, String workflowName, String versionId) {
"""
Gets a workflow version.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param versionId The workflow versionId.
@throws IllegalArgumentException t... | java | public Observable<WorkflowVersionInner> getAsync(String resourceGroupName, String workflowName, String versionId) {
return getWithServiceResponseAsync(resourceGroupName, workflowName, versionId).map(new Func1<ServiceResponse<WorkflowVersionInner>, WorkflowVersionInner>() {
@Override
publ... | [
"public",
"Observable",
"<",
"WorkflowVersionInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
",",
"String",
"versionId",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"workflowName",
",",
... | Gets a workflow version.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param versionId The workflow versionId.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the WorkflowVersionInner object | [
"Gets",
"a",
"workflow",
"version",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowVersionsInner.java#L365-L372 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/Panel.java | Panel.addComponent | public Panel addComponent(Component component, LayoutData layoutData) {
"""
This method is a shortcut for calling:
<pre>
{@code
component.setLayoutData(layoutData);
panel.addComponent(component);
}
</pre>
@param component Component to add to the panel
@param layoutData Layout data to assign to the componen... | java | public Panel addComponent(Component component, LayoutData layoutData) {
if(component != null) {
component.setLayoutData(layoutData);
addComponent(component);
}
return this;
} | [
"public",
"Panel",
"addComponent",
"(",
"Component",
"component",
",",
"LayoutData",
"layoutData",
")",
"{",
"if",
"(",
"component",
"!=",
"null",
")",
"{",
"component",
".",
"setLayoutData",
"(",
"layoutData",
")",
";",
"addComponent",
"(",
"component",
")",
... | This method is a shortcut for calling:
<pre>
{@code
component.setLayoutData(layoutData);
panel.addComponent(component);
}
</pre>
@param component Component to add to the panel
@param layoutData Layout data to assign to the component
@return Itself | [
"This",
"method",
"is",
"a",
"shortcut",
"for",
"calling",
":",
"<pre",
">",
"{"
] | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/Panel.java#L116-L122 |
JavaMoney/jsr354-api | src/main/java/javax/money/AbstractQueryBuilder.java | AbstractQueryBuilder.setProviderNames | public B setProviderNames(List<String> providers) {
"""
Set the providers to be considered. If not set explicitly the <i>default</i> ISO currencies as
returned by {@link java.util.Currency} is used.
@param providers the providers to use, not null.
@return the query builder for chaining.
"""
Object... | java | public B setProviderNames(List<String> providers) {
Objects.requireNonNull(providers);
return set(AbstractQuery.KEY_QUERY_PROVIDERS, providers);
} | [
"public",
"B",
"setProviderNames",
"(",
"List",
"<",
"String",
">",
"providers",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"providers",
")",
";",
"return",
"set",
"(",
"AbstractQuery",
".",
"KEY_QUERY_PROVIDERS",
",",
"providers",
")",
";",
"}"
] | Set the providers to be considered. If not set explicitly the <i>default</i> ISO currencies as
returned by {@link java.util.Currency} is used.
@param providers the providers to use, not null.
@return the query builder for chaining. | [
"Set",
"the",
"providers",
"to",
"be",
"considered",
".",
"If",
"not",
"set",
"explicitly",
"the",
"<i",
">",
"default<",
"/",
"i",
">",
"ISO",
"currencies",
"as",
"returned",
"by",
"{",
"@link",
"java",
".",
"util",
".",
"Currency",
"}",
"is",
"used",... | train | https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/AbstractQueryBuilder.java#L61-L64 |
alkacon/opencms-core | src/org/opencms/relations/CmsCategoryService.java | CmsCategoryService.repairRelations | public void repairRelations(CmsObject cms, CmsResource resource) throws CmsException {
"""
Repairs broken category relations.<p>
This could be caused by renaming/moving a category folder,
or changing the category repositories base folder name.<p>
Also repairs problems when creating/deleting conflicting
cat... | java | public void repairRelations(CmsObject cms, CmsResource resource) throws CmsException {
internalReadResourceCategories(cms, resource, true);
} | [
"public",
"void",
"repairRelations",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"internalReadResourceCategories",
"(",
"cms",
",",
"resource",
",",
"true",
")",
";",
"}"
] | Repairs broken category relations.<p>
This could be caused by renaming/moving a category folder,
or changing the category repositories base folder name.<p>
Also repairs problems when creating/deleting conflicting
category folders across several repositories.<p>
The resource has to be previously locked.<p>
@param cm... | [
"Repairs",
"broken",
"category",
"relations",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsCategoryService.java#L727-L730 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.objectDeepCopyWithBlackList | public static <T> T objectDeepCopyWithBlackList(Object from, Object to, String... blockFields) {
"""
Object deep copy with black list t.
@param <T> the type parameter
@param from the from
@param to the to
@param blockFields the block fields
@return the t
"""
if (to == nu... | java | public static <T> T objectDeepCopyWithBlackList(Object from, Object to, String... blockFields) {
if (to == null) {
to = getNewInstance(from.getClass());
}
List<String> whiteList = new ArrayList<>();
Method[] methods = from.getClass().getMethods();
for (Method m : ... | [
"public",
"static",
"<",
"T",
">",
"T",
"objectDeepCopyWithBlackList",
"(",
"Object",
"from",
",",
"Object",
"to",
",",
"String",
"...",
"blockFields",
")",
"{",
"if",
"(",
"to",
"==",
"null",
")",
"{",
"to",
"=",
"getNewInstance",
"(",
"from",
".",
"g... | Object deep copy with black list t.
@param <T> the type parameter
@param from the from
@param to the to
@param blockFields the block fields
@return the t | [
"Object",
"deep",
"copy",
"with",
"black",
"list",
"t",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L397-L423 |
gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/reasoning/bayes/smile/ShanksAgentBayesianReasoningCapability.java | ShanksAgentBayesianReasoningCapability.getHypothesis | public static float getHypothesis(Network bn, String nodeName, String status)
throws ShanksException {
"""
Get the value of a status in a node
@param bn
@param nodeName
@param status
@return a float with the probability
@throws UnknownNodeException
@throws UnknowkNodeStateException
"""
... | java | public static float getHypothesis(Network bn, String nodeName, String status)
throws ShanksException {
int node = ShanksAgentBayesianReasoningCapability.getNode(bn, nodeName);
String[] states = bn.getOutcomeIds(node);
for (int i = 0; i < states.length; i++) {
if (status.e... | [
"public",
"static",
"float",
"getHypothesis",
"(",
"Network",
"bn",
",",
"String",
"nodeName",
",",
"String",
"status",
")",
"throws",
"ShanksException",
"{",
"int",
"node",
"=",
"ShanksAgentBayesianReasoningCapability",
".",
"getNode",
"(",
"bn",
",",
"nodeName",... | Get the value of a status in a node
@param bn
@param nodeName
@param status
@return a float with the probability
@throws UnknownNodeException
@throws UnknowkNodeStateException | [
"Get",
"the",
"value",
"of",
"a",
"status",
"in",
"a",
"node"
] | train | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/reasoning/bayes/smile/ShanksAgentBayesianReasoningCapability.java#L364-L374 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/core/ImageLoaderEngine.java | ImageLoaderEngine.prepareDisplayTaskFor | void prepareDisplayTaskFor(ImageAware imageAware, String memoryCacheKey) {
"""
Associates <b>memoryCacheKey</b> with <b>imageAware</b>. Then it helps to define image URI is loaded into View at
exact moment.
"""
cacheKeysForImageAwares.put(imageAware.getId(), memoryCacheKey);
} | java | void prepareDisplayTaskFor(ImageAware imageAware, String memoryCacheKey) {
cacheKeysForImageAwares.put(imageAware.getId(), memoryCacheKey);
} | [
"void",
"prepareDisplayTaskFor",
"(",
"ImageAware",
"imageAware",
",",
"String",
"memoryCacheKey",
")",
"{",
"cacheKeysForImageAwares",
".",
"put",
"(",
"imageAware",
".",
"getId",
"(",
")",
",",
"memoryCacheKey",
")",
";",
"}"
] | Associates <b>memoryCacheKey</b> with <b>imageAware</b>. Then it helps to define image URI is loaded into View at
exact moment. | [
"Associates",
"<b",
">",
"memoryCacheKey<",
"/",
"b",
">",
"with",
"<b",
">",
"imageAware<",
"/",
"b",
">",
".",
"Then",
"it",
"helps",
"to",
"define",
"image",
"URI",
"is",
"loaded",
"into",
"View",
"at",
"exact",
"moment",
"."
] | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/core/ImageLoaderEngine.java#L117-L119 |
treasure-data/td-client-java | src/main/java/com/treasuredata/client/TDHttpClient.java | TDHttpClient.call | @SuppressWarnings(value = "unchecked cast")
public <Result> Result call(TDApiRequest apiRequest, Optional<String> apiKeyCache, final JavaType resultType)
throws TDClientException {
"""
Submit an API request, and bind the returned JSON data into an object of the given result jackson JavaType.
For m... | java | @SuppressWarnings(value = "unchecked cast")
public <Result> Result call(TDApiRequest apiRequest, Optional<String> apiKeyCache, final JavaType resultType)
throws TDClientException
{
try {
byte[] content = submitRequest(apiRequest, apiKeyCache, byteArrayContentHandler);
... | [
"@",
"SuppressWarnings",
"(",
"value",
"=",
"\"unchecked cast\"",
")",
"public",
"<",
"Result",
">",
"Result",
"call",
"(",
"TDApiRequest",
"apiRequest",
",",
"Optional",
"<",
"String",
">",
"apiKeyCache",
",",
"final",
"JavaType",
"resultType",
")",
"throws",
... | Submit an API request, and bind the returned JSON data into an object of the given result jackson JavaType.
For mapping it uses Jackson object mapper.
@param apiRequest
@param resultType
@param <Result>
@return
@throws TDClientException | [
"Submit",
"an",
"API",
"request",
"and",
"bind",
"the",
"returned",
"JSON",
"data",
"into",
"an",
"object",
"of",
"the",
"given",
"result",
"jackson",
"JavaType",
".",
"For",
"mapping",
"it",
"uses",
"Jackson",
"object",
"mapper",
"."
] | train | https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/TDHttpClient.java#L546-L569 |
52inc/android-52Kit | library/src/main/java/com/ftinc/kit/util/BuildUtils.java | BuildUtils.checkForRunningService | public static boolean checkForRunningService(Context ctx, String serviceClassName) {
"""
Check for a running service
@param ctx the application context
@param serviceClassName the service class name
@return true if service is running, false overwise
"""
ActivityManager ... | java | public static boolean checkForRunningService(Context ctx, String serviceClassName) {
ActivityManager manager = (ActivityManager) ctx.getSystemService(Context.ACTIVITY_SERVICE);
for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
if (serviceClass... | [
"public",
"static",
"boolean",
"checkForRunningService",
"(",
"Context",
"ctx",
",",
"String",
"serviceClassName",
")",
"{",
"ActivityManager",
"manager",
"=",
"(",
"ActivityManager",
")",
"ctx",
".",
"getSystemService",
"(",
"Context",
".",
"ACTIVITY_SERVICE",
")",... | Check for a running service
@param ctx the application context
@param serviceClassName the service class name
@return true if service is running, false overwise | [
"Check",
"for",
"a",
"running",
"service"
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/util/BuildUtils.java#L120-L128 |
ModeShape/modeshape | modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java | JcrTools.findOrCreateChild | public Node findOrCreateChild( Node parent,
String name ) throws RepositoryException {
"""
Get or create a node with the specified node under the specified parent node.
@param parent the parent node. may not be null
@param name the name of the child node. may not be null
@re... | java | public Node findOrCreateChild( Node parent,
String name ) throws RepositoryException {
return findOrCreateChild(parent, name, null);
} | [
"public",
"Node",
"findOrCreateChild",
"(",
"Node",
"parent",
",",
"String",
"name",
")",
"throws",
"RepositoryException",
"{",
"return",
"findOrCreateChild",
"(",
"parent",
",",
"name",
",",
"null",
")",
";",
"}"
] | Get or create a node with the specified node under the specified parent node.
@param parent the parent node. may not be null
@param name the name of the child node. may not be null
@return the existing or newly created child node
@throws RepositoryException
@throws IllegalArgumentException if either the parent or name... | [
"Get",
"or",
"create",
"a",
"node",
"with",
"the",
"specified",
"node",
"under",
"the",
"specified",
"parent",
"node",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java#L460-L463 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java | GoogleMapShape.boundingBox | public BoundingBox boundingBox() {
"""
Get a bounding box that includes the shape
@return bounding box
"""
BoundingBox boundingBox = new BoundingBox(Double.MAX_VALUE, Double.MAX_VALUE, -Double.MAX_VALUE, -Double.MAX_VALUE);
expandBoundingBox(boundingBox);
return boundingBox;
} | java | public BoundingBox boundingBox() {
BoundingBox boundingBox = new BoundingBox(Double.MAX_VALUE, Double.MAX_VALUE, -Double.MAX_VALUE, -Double.MAX_VALUE);
expandBoundingBox(boundingBox);
return boundingBox;
} | [
"public",
"BoundingBox",
"boundingBox",
"(",
")",
"{",
"BoundingBox",
"boundingBox",
"=",
"new",
"BoundingBox",
"(",
"Double",
".",
"MAX_VALUE",
",",
"Double",
".",
"MAX_VALUE",
",",
"-",
"Double",
".",
"MAX_VALUE",
",",
"-",
"Double",
".",
"MAX_VALUE",
")",... | Get a bounding box that includes the shape
@return bounding box | [
"Get",
"a",
"bounding",
"box",
"that",
"includes",
"the",
"shape"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java#L363-L367 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/WorkspacesApi.java | WorkspacesApi.listWorkspaceFilePages | public PageImages listWorkspaceFilePages(String accountId, String workspaceId, String folderId, String fileId) throws ApiException {
"""
List File Pages
Retrieves a workspace file as rasterized pages.
@param accountId The external account number (int) or account ID Guid. (required)
@param workspaceId Specifies ... | java | public PageImages listWorkspaceFilePages(String accountId, String workspaceId, String folderId, String fileId) throws ApiException {
return listWorkspaceFilePages(accountId, workspaceId, folderId, fileId, null);
} | [
"public",
"PageImages",
"listWorkspaceFilePages",
"(",
"String",
"accountId",
",",
"String",
"workspaceId",
",",
"String",
"folderId",
",",
"String",
"fileId",
")",
"throws",
"ApiException",
"{",
"return",
"listWorkspaceFilePages",
"(",
"accountId",
",",
"workspaceId"... | List File Pages
Retrieves a workspace file as rasterized pages.
@param accountId The external account number (int) or account ID Guid. (required)
@param workspaceId Specifies the workspace ID GUID. (required)
@param folderId The ID of the folder being accessed. (required)
@param fileId Specifies the room file ID GUID. ... | [
"List",
"File",
"Pages",
"Retrieves",
"a",
"workspace",
"file",
"as",
"rasterized",
"pages",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/WorkspacesApi.java#L477-L479 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.listWebAppsWithServiceResponseAsync | public Observable<ServiceResponse<Page<SiteInner>>> listWebAppsWithServiceResponseAsync(final String resourceGroupName, final String name, final String skipToken, final String filter, final String top) {
"""
Get all apps associated with an App Service plan.
Get all apps associated with an App Service plan.
@pa... | java | public Observable<ServiceResponse<Page<SiteInner>>> listWebAppsWithServiceResponseAsync(final String resourceGroupName, final String name, final String skipToken, final String filter, final String top) {
return listWebAppsSinglePageAsync(resourceGroupName, name, skipToken, filter, top)
.concatMap(ne... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"SiteInner",
">",
">",
">",
"listWebAppsWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
",",
"final",
"String",
"skipToken",
",",
"final",
"St... | Get all apps associated with an App Service plan.
Get all apps associated with an App Service plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@param skipToken Skip to a web app in the list of webapps associated with app service plan. If... | [
"Get",
"all",
"apps",
"associated",
"with",
"an",
"App",
"Service",
"plan",
".",
"Get",
"all",
"apps",
"associated",
"with",
"an",
"App",
"Service",
"plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L2568-L2580 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/StringUtils.java | StringUtils.makeAsciiTableCell | private static String makeAsciiTableCell(Object obj, int padLeft, int padRight, boolean tsv) {
"""
The cell String is the string representation of the object.
If padLeft is greater than 0, it is padded. Ditto right
"""
String result = obj.toString();
if (padLeft > 0) {
result = padLeft(result... | java | private static String makeAsciiTableCell(Object obj, int padLeft, int padRight, boolean tsv) {
String result = obj.toString();
if (padLeft > 0) {
result = padLeft(result, padLeft);
}
if (padRight > 0) {
result = pad(result, padRight);
}
if (tsv) {
result = result + '\t... | [
"private",
"static",
"String",
"makeAsciiTableCell",
"(",
"Object",
"obj",
",",
"int",
"padLeft",
",",
"int",
"padRight",
",",
"boolean",
"tsv",
")",
"{",
"String",
"result",
"=",
"obj",
".",
"toString",
"(",
")",
";",
"if",
"(",
"padLeft",
">",
"0",
"... | The cell String is the string representation of the object.
If padLeft is greater than 0, it is padded. Ditto right | [
"The",
"cell",
"String",
"is",
"the",
"string",
"representation",
"of",
"the",
"object",
".",
"If",
"padLeft",
"is",
"greater",
"than",
"0",
"it",
"is",
"padded",
".",
"Ditto",
"right"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/StringUtils.java#L1501-L1513 |
samskivert/samskivert | src/main/java/com/samskivert/text/MessageUtil.java | MessageUtil.tcompose | public static String tcompose (String key, String... args) {
"""
A convenience method for calling {@link #compose(String,String[])} with an array of argument
that will be automatically tainted.
"""
for (int ii = 0, nn = args.length; ii < nn; ii++) {
args[ii] = taint(args[ii]);
}
... | java | public static String tcompose (String key, String... args)
{
for (int ii = 0, nn = args.length; ii < nn; ii++) {
args[ii] = taint(args[ii]);
}
return compose(key, args);
} | [
"public",
"static",
"String",
"tcompose",
"(",
"String",
"key",
",",
"String",
"...",
"args",
")",
"{",
"for",
"(",
"int",
"ii",
"=",
"0",
",",
"nn",
"=",
"args",
".",
"length",
";",
"ii",
"<",
"nn",
";",
"ii",
"++",
")",
"{",
"args",
"[",
"ii"... | A convenience method for calling {@link #compose(String,String[])} with an array of argument
that will be automatically tainted. | [
"A",
"convenience",
"method",
"for",
"calling",
"{"
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/text/MessageUtil.java#L143-L149 |
bazaarvoice/emodb | sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStreaming.java | DataStoreStreaming.updateAll | public static void updateAll(DataStore dataStore, Iterable<Update> updates, Set<String> tags) {
"""
Creates, updates or deletes zero or more pieces of content in the data store.
You can attach a set of databus event tags for these updates
"""
updateAll(dataStore, updates.iterator(), tags);
} | java | public static void updateAll(DataStore dataStore, Iterable<Update> updates, Set<String> tags) {
updateAll(dataStore, updates.iterator(), tags);
} | [
"public",
"static",
"void",
"updateAll",
"(",
"DataStore",
"dataStore",
",",
"Iterable",
"<",
"Update",
">",
"updates",
",",
"Set",
"<",
"String",
">",
"tags",
")",
"{",
"updateAll",
"(",
"dataStore",
",",
"updates",
".",
"iterator",
"(",
")",
",",
"tags... | Creates, updates or deletes zero or more pieces of content in the data store.
You can attach a set of databus event tags for these updates | [
"Creates",
"updates",
"or",
"deletes",
"zero",
"or",
"more",
"pieces",
"of",
"content",
"in",
"the",
"data",
"store",
".",
"You",
"can",
"attach",
"a",
"set",
"of",
"databus",
"event",
"tags",
"for",
"these",
"updates"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStreaming.java#L143-L145 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/packet/AbstractError.java | AbstractError.getExtension | public <PE extends ExtensionElement> PE getExtension(String elementName, String namespace) {
"""
Returns the first stanza extension that matches the specified element name and
namespace, or <tt>null</tt> if it doesn't exist.
@param elementName the XML element name of the stanza extension.
@param namespace the... | java | public <PE extends ExtensionElement> PE getExtension(String elementName, String namespace) {
return PacketUtil.extensionElementFrom(extensions, elementName, namespace);
} | [
"public",
"<",
"PE",
"extends",
"ExtensionElement",
">",
"PE",
"getExtension",
"(",
"String",
"elementName",
",",
"String",
"namespace",
")",
"{",
"return",
"PacketUtil",
".",
"extensionElementFrom",
"(",
"extensions",
",",
"elementName",
",",
"namespace",
")",
... | Returns the first stanza extension that matches the specified element name and
namespace, or <tt>null</tt> if it doesn't exist.
@param elementName the XML element name of the stanza extension.
@param namespace the XML element namespace of the stanza extension.
@param <PE> type of the ExtensionElement.
@return the exte... | [
"Returns",
"the",
"first",
"stanza",
"extension",
"that",
"matches",
"the",
"specified",
"element",
"name",
"and",
"namespace",
"or",
"<tt",
">",
"null<",
"/",
"tt",
">",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/packet/AbstractError.java#L103-L105 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.findField | public static Field findField(String className, String fieldName) throws ClassNotFoundException {
"""
Find a field with given name defined in given class.
@param className
the name of the class
@param fieldName
the name of the field
@return the Field, or null if no such field could be found
"""
... | java | public static Field findField(String className, String fieldName) throws ClassNotFoundException {
JavaClass jclass = Repository.lookupClass(className);
while (jclass != null) {
Field[] fieldList = jclass.getFields();
for (Field field : fieldList) {
if (field.getN... | [
"public",
"static",
"Field",
"findField",
"(",
"String",
"className",
",",
"String",
"fieldName",
")",
"throws",
"ClassNotFoundException",
"{",
"JavaClass",
"jclass",
"=",
"Repository",
".",
"lookupClass",
"(",
"className",
")",
";",
"while",
"(",
"jclass",
"!="... | Find a field with given name defined in given class.
@param className
the name of the class
@param fieldName
the name of the field
@return the Field, or null if no such field could be found | [
"Find",
"a",
"field",
"with",
"given",
"name",
"defined",
"in",
"given",
"class",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L890-L905 |
centic9/commons-dost | src/main/java/org/dstadler/commons/svn/SVNCommands.java | SVNCommands.recordMerge | public static InputStream recordMerge(File directory, String branchName, long... revisions) throws IOException {
"""
Record a manual merge from one branch to the local working directory.
@param directory The local working directory
@param branchName The branch that was merged in manually
@param revisions The ... | java | public static InputStream recordMerge(File directory, String branchName, long... revisions) throws IOException {
// svn merge -c 3328 --record-only ^/calc/trunk
CommandLine cmdLine = new CommandLine(SVN_CMD);
cmdLine.addArgument(CMD_MERGE);
addDefaultArguments(cmdLine, null, null);
... | [
"public",
"static",
"InputStream",
"recordMerge",
"(",
"File",
"directory",
",",
"String",
"branchName",
",",
"long",
"...",
"revisions",
")",
"throws",
"IOException",
"{",
"// \t\t\t\tsvn merge -c 3328 --record-only ^/calc/trunk",
"CommandLine",
"cmdLine",
"=",
"new",
... | Record a manual merge from one branch to the local working directory.
@param directory The local working directory
@param branchName The branch that was merged in manually
@param revisions The list of merged revisions.
@return A stream which provides the output of the "svn merge" command, should be closed by the calle... | [
"Record",
"a",
"manual",
"merge",
"from",
"one",
"branch",
"to",
"the",
"local",
"working",
"directory",
"."
] | train | https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/svn/SVNCommands.java#L491-L510 |
pf4j/pf4j-update | src/main/java/org/pf4j/update/SimpleFileDownloader.java | SimpleFileDownloader.downloadFile | public Path downloadFile(URL fileUrl) throws PluginException, IOException {
"""
Downloads a file. If HTTP(S) or FTP, stream content, if local file:/ do a simple filesystem copy to tmp folder.
Other protocols not supported.
@param fileUrl the URI representing the file to download
@return the path of downloaded... | java | public Path downloadFile(URL fileUrl) throws PluginException, IOException {
switch (fileUrl.getProtocol()) {
case "http":
case "https":
case "ftp":
return downloadFileHttp(fileUrl);
case "file":
return copyLocalFile(fileUrl);
... | [
"public",
"Path",
"downloadFile",
"(",
"URL",
"fileUrl",
")",
"throws",
"PluginException",
",",
"IOException",
"{",
"switch",
"(",
"fileUrl",
".",
"getProtocol",
"(",
")",
")",
"{",
"case",
"\"http\"",
":",
"case",
"\"https\"",
":",
"case",
"\"ftp\"",
":",
... | Downloads a file. If HTTP(S) or FTP, stream content, if local file:/ do a simple filesystem copy to tmp folder.
Other protocols not supported.
@param fileUrl the URI representing the file to download
@return the path of downloaded/copied file
@throws IOException in case of network or IO problems
@throws PluginExceptio... | [
"Downloads",
"a",
"file",
".",
"If",
"HTTP",
"(",
"S",
")",
"or",
"FTP",
"stream",
"content",
"if",
"local",
"file",
":",
"/",
"do",
"a",
"simple",
"filesystem",
"copy",
"to",
"tmp",
"folder",
".",
"Other",
"protocols",
"not",
"supported",
"."
] | train | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/SimpleFileDownloader.java#L54-L65 |
alipay/sofa-rpc | core-impl/codec/src/main/java/com/alipay/sofa/rpc/codec/snappy/SnappyDecompressor.java | SnappyDecompressor.incrementalCopy | private static void incrementalCopy(byte[] src, int srcIndex, byte[] op, int opIndex, int length) {
"""
Copy "len" bytes from "src" to "op", one byte at a time. Used for
handling COPY operations where the input and output regions may
overlap. For example, suppose:
src == "ab"
op == src + 2
len == ... | java | private static void incrementalCopy(byte[] src, int srcIndex, byte[] op, int opIndex, int length) {
do {
op[opIndex++] = src[srcIndex++];
} while (--length > 0);
} | [
"private",
"static",
"void",
"incrementalCopy",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcIndex",
",",
"byte",
"[",
"]",
"op",
",",
"int",
"opIndex",
",",
"int",
"length",
")",
"{",
"do",
"{",
"op",
"[",
"opIndex",
"++",
"]",
"=",
"src",
"[",
... | Copy "len" bytes from "src" to "op", one byte at a time. Used for
handling COPY operations where the input and output regions may
overlap. For example, suppose:
src == "ab"
op == src + 2
len == 20
<p>
After incrementalCopy, the result will have
eleven copies of "ab"
ababababababababababab
Note that this doe... | [
"Copy",
"len",
"bytes",
"from",
"src",
"to",
"op",
"one",
"byte",
"at",
"a",
"time",
".",
"Used",
"for",
"handling",
"COPY",
"operations",
"where",
"the",
"input",
"and",
"output",
"regions",
"may",
"overlap",
".",
"For",
"example",
"suppose",
":",
"src"... | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core-impl/codec/src/main/java/com/alipay/sofa/rpc/codec/snappy/SnappyDecompressor.java#L317-L321 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java | SvgGraphicsContext.setSize | public void setSize(int newWidth, int newHeight) {
"""
Apply a new size on the graphics context.
@param newWidth
The new newWidth in pixels for this graphics context.
@param newHeight
The new newHeight in pixels for this graphics context.
"""
this.width = newWidth;
this.height = newHeight;
if (hel... | java | public void setSize(int newWidth, int newHeight) {
this.width = newWidth;
this.height = newHeight;
if (helper.getRootElement() != null) {
String sWidth = Integer.toString(newWidth);
String sHeight = Integer.toString(newHeight);
Dom.setElementAttribute(helper.getRootElement(), "width", sWidth);
Dom.se... | [
"public",
"void",
"setSize",
"(",
"int",
"newWidth",
",",
"int",
"newHeight",
")",
"{",
"this",
".",
"width",
"=",
"newWidth",
";",
"this",
".",
"height",
"=",
"newHeight",
";",
"if",
"(",
"helper",
".",
"getRootElement",
"(",
")",
"!=",
"null",
")",
... | Apply a new size on the graphics context.
@param newWidth
The new newWidth in pixels for this graphics context.
@param newHeight
The new newHeight in pixels for this graphics context. | [
"Apply",
"a",
"new",
"size",
"on",
"the",
"graphics",
"context",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java#L709-L720 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java | LdapConnection.toKey | @Trivial
private static String toKey(String name, String filterExpr, Object[] filterArgs, SearchControls cons) {
"""
Returns a hash key for the name|filterExpr|filterArgs|cons tuple used in the search
query-results cache.
@param name The name of the context or object to search
@param filterExpr the filter... | java | @Trivial
private static String toKey(String name, String filterExpr, Object[] filterArgs, SearchControls cons) {
int length = name.length() + filterExpr.length() + filterArgs.length + 200;
StringBuffer key = new StringBuffer(length);
key.append(name);
key.append("|");
key.app... | [
"@",
"Trivial",
"private",
"static",
"String",
"toKey",
"(",
"String",
"name",
",",
"String",
"filterExpr",
",",
"Object",
"[",
"]",
"filterArgs",
",",
"SearchControls",
"cons",
")",
"{",
"int",
"length",
"=",
"name",
".",
"length",
"(",
")",
"+",
"filte... | Returns a hash key for the name|filterExpr|filterArgs|cons tuple used in the search
query-results cache.
@param name The name of the context or object to search
@param filterExpr the filter expression used in the search.
@param filterArgs the filter arguments used in the search.
@param cons The search controls used in... | [
"Returns",
"a",
"hash",
"key",
"for",
"the",
"name|filterExpr|filterArgs|cons",
"tuple",
"used",
"in",
"the",
"search",
"query",
"-",
"results",
"cache",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java#L243-L262 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/DBConn.java | DBConn.reconnect | private void reconnect(Exception reconnectEx) {
"""
an DBNotAvailableException and leave the Thrift connection null.
"""
// Log the exception as a warning.
m_logger.warn("Reconnecting to Cassandra due to error", reconnectEx);
// Reconnect up to the configured number of time... | java | private void reconnect(Exception reconnectEx) {
// Log the exception as a warning.
m_logger.warn("Reconnecting to Cassandra due to error", reconnectEx);
// Reconnect up to the configured number of times, waiting a little between each attempt.
boolean bSuccess = false;
... | [
"private",
"void",
"reconnect",
"(",
"Exception",
"reconnectEx",
")",
"{",
"// Log the exception as a warning.\r",
"m_logger",
".",
"warn",
"(",
"\"Reconnecting to Cassandra due to error\"",
",",
"reconnectEx",
")",
";",
"// Reconnect up to the configured number of times, waiting... | an DBNotAvailableException and leave the Thrift connection null. | [
"an",
"DBNotAvailableException",
"and",
"leave",
"the",
"Thrift",
"connection",
"null",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/DBConn.java#L518-L544 |
actframework/actframework | src/main/java/act/ws/WebSocketConnectionRegistry.java | WebSocketConnectionRegistry.signOff | public void signOff(String key, WebSocketConnection connection) {
"""
Detach a connection from a key.
@param key
the key
@param connection
the connection
"""
ConcurrentMap<WebSocketConnection, WebSocketConnection> connections = registry.get(key);
if (null == connections) {
ret... | java | public void signOff(String key, WebSocketConnection connection) {
ConcurrentMap<WebSocketConnection, WebSocketConnection> connections = registry.get(key);
if (null == connections) {
return;
}
connections.remove(connection);
} | [
"public",
"void",
"signOff",
"(",
"String",
"key",
",",
"WebSocketConnection",
"connection",
")",
"{",
"ConcurrentMap",
"<",
"WebSocketConnection",
",",
"WebSocketConnection",
">",
"connections",
"=",
"registry",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"n... | Detach a connection from a key.
@param key
the key
@param connection
the connection | [
"Detach",
"a",
"connection",
"from",
"a",
"key",
"."
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/ws/WebSocketConnectionRegistry.java#L203-L209 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/ParserDDL.java | ParserDDL.processAlterTableDropConstraint | void processAlterTableDropConstraint(Table table, String name,
boolean cascade) {
"""
Responsible for handling tail of ALTER TABLE ... DROP CONSTRAINT ...
"""
session.commit(false);
TableWorks tableWorks = new TableWorks(session, table);
table... | java | void processAlterTableDropConstraint(Table table, String name,
boolean cascade) {
session.commit(false);
TableWorks tableWorks = new TableWorks(session, table);
tableWorks.dropConstraint(name, cascade);
return;
} | [
"void",
"processAlterTableDropConstraint",
"(",
"Table",
"table",
",",
"String",
"name",
",",
"boolean",
"cascade",
")",
"{",
"session",
".",
"commit",
"(",
"false",
")",
";",
"TableWorks",
"tableWorks",
"=",
"new",
"TableWorks",
"(",
"session",
",",
"table",
... | Responsible for handling tail of ALTER TABLE ... DROP CONSTRAINT ... | [
"Responsible",
"for",
"handling",
"tail",
"of",
"ALTER",
"TABLE",
"...",
"DROP",
"CONSTRAINT",
"..."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/ParserDDL.java#L4275-L4285 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/KeyArea.java | KeyArea.setupKeyBuffer | public void setupKeyBuffer(BaseBuffer destBuffer, int iAreaDesc, boolean bMoveToField) {
"""
Set up the key area indicated.
Remember to clear the destBuffer first.
@param destBuffer A BaseBuffer to fill with data (ignore if null).
@param iAreaDesc The (optional) temporary area to copy the current fields to.
@p... | java | public void setupKeyBuffer(BaseBuffer destBuffer, int iAreaDesc, boolean bMoveToField)
{
boolean bForceUniqueKey = true;
int iKeyFieldCount = this.getKeyFields(bForceUniqueKey, false);
for (int iKeyFieldSeq = DBConstants.MAIN_KEY_FIELD; iKeyFieldSeq < iKeyFieldCount; iKeyFieldSeq++)
... | [
"public",
"void",
"setupKeyBuffer",
"(",
"BaseBuffer",
"destBuffer",
",",
"int",
"iAreaDesc",
",",
"boolean",
"bMoveToField",
")",
"{",
"boolean",
"bForceUniqueKey",
"=",
"true",
";",
"int",
"iKeyFieldCount",
"=",
"this",
".",
"getKeyFields",
"(",
"bForceUniqueKey... | Set up the key area indicated.
Remember to clear the destBuffer first.
@param destBuffer A BaseBuffer to fill with data (ignore if null).
@param iAreaDesc The (optional) temporary area to copy the current fields to.
@param bMoveToField If true, move the param field to the field (default). | [
"Set",
"up",
"the",
"key",
"area",
"indicated",
".",
"Remember",
"to",
"clear",
"the",
"destBuffer",
"first",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/KeyArea.java#L481-L504 |
spockframework/spock | spock-core/src/main/java/org/spockframework/runtime/GroovyRuntimeUtil.java | GroovyRuntimeUtil.getProperty | public static Object getProperty(Object target, String property) {
"""
Note: This method may throw checked exceptions although it doesn't say so.
"""
try {
return InvokerHelper.getProperty(target, property);
} catch (InvokerInvocationException e) {
ExceptionUtil.sneakyThrow(e.getCause());
... | java | public static Object getProperty(Object target, String property) {
try {
return InvokerHelper.getProperty(target, property);
} catch (InvokerInvocationException e) {
ExceptionUtil.sneakyThrow(e.getCause());
return null; // never reached
}
} | [
"public",
"static",
"Object",
"getProperty",
"(",
"Object",
"target",
",",
"String",
"property",
")",
"{",
"try",
"{",
"return",
"InvokerHelper",
".",
"getProperty",
"(",
"target",
",",
"property",
")",
";",
"}",
"catch",
"(",
"InvokerInvocationException",
"e"... | Note: This method may throw checked exceptions although it doesn't say so. | [
"Note",
":",
"This",
"method",
"may",
"throw",
"checked",
"exceptions",
"although",
"it",
"doesn",
"t",
"say",
"so",
"."
] | train | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/runtime/GroovyRuntimeUtil.java#L134-L141 |
hawkular/hawkular-apm | client/collector/src/main/java/org/hawkular/apm/client/collector/internal/ProcessorManager.java | ProcessorManager.isProcessed | public boolean isProcessed(Trace trace, Node node, Direction direction) {
"""
This method determines whether the trace, for the supplied node
and in/out direction, will process available information.
@param trace The trace
@param node The current node
@param direction The direction
@return Whether processin... | java | public boolean isProcessed(Trace trace, Node node, Direction direction) {
boolean ret = false;
if (trace.getTransaction() != null) {
List<ProcessorWrapper> procs = null;
synchronized (processors) {
procs = processors.get(trace.getTransaction());
}
... | [
"public",
"boolean",
"isProcessed",
"(",
"Trace",
"trace",
",",
"Node",
"node",
",",
"Direction",
"direction",
")",
"{",
"boolean",
"ret",
"=",
"false",
";",
"if",
"(",
"trace",
".",
"getTransaction",
"(",
")",
"!=",
"null",
")",
"{",
"List",
"<",
"Pro... | This method determines whether the trace, for the supplied node
and in/out direction, will process available information.
@param trace The trace
@param node The current node
@param direction The direction
@return Whether processing instructions have been defined | [
"This",
"method",
"determines",
"whether",
"the",
"trace",
"for",
"the",
"supplied",
"node",
"and",
"in",
"/",
"out",
"direction",
"will",
"process",
"available",
"information",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/client/collector/src/main/java/org/hawkular/apm/client/collector/internal/ProcessorManager.java#L125-L148 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/Drawer.java | Drawer.updateItemAtPosition | public void updateItemAtPosition(@NonNull IDrawerItem drawerItem, int position) {
"""
Update a drawerItem at a specific position
@param drawerItem
@param position
"""
if (mDrawerBuilder.checkDrawerItem(position, false)) {
mDrawerBuilder.getItemAdapter().set(position, drawerItem);
... | java | public void updateItemAtPosition(@NonNull IDrawerItem drawerItem, int position) {
if (mDrawerBuilder.checkDrawerItem(position, false)) {
mDrawerBuilder.getItemAdapter().set(position, drawerItem);
}
} | [
"public",
"void",
"updateItemAtPosition",
"(",
"@",
"NonNull",
"IDrawerItem",
"drawerItem",
",",
"int",
"position",
")",
"{",
"if",
"(",
"mDrawerBuilder",
".",
"checkDrawerItem",
"(",
"position",
",",
"false",
")",
")",
"{",
"mDrawerBuilder",
".",
"getItemAdapte... | Update a drawerItem at a specific position
@param drawerItem
@param position | [
"Update",
"a",
"drawerItem",
"at",
"a",
"specific",
"position"
] | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L712-L716 |
Erudika/para | para-core/src/main/java/com/erudika/para/utils/Utils.java | Utils.generateSecurityToken | public static String generateSecurityToken(int length, boolean urlSafe) {
"""
Generates an authentication token - a random string encoded in Base64.
@param length the length of the generated token
@param urlSafe switches to a URL safe encoding
@return a random string
"""
final byte[] bytes = new byte[leng... | java | public static String generateSecurityToken(int length, boolean urlSafe) {
final byte[] bytes = new byte[length];
SecureRandom rand;
try {
rand = SecureRandom.getInstance("SHA1PRNG");
} catch (NoSuchAlgorithmException ex) {
logger.error(null, ex);
rand = new SecureRandom();
}
rand.nextBytes(bytes);
... | [
"public",
"static",
"String",
"generateSecurityToken",
"(",
"int",
"length",
",",
"boolean",
"urlSafe",
")",
"{",
"final",
"byte",
"[",
"]",
"bytes",
"=",
"new",
"byte",
"[",
"length",
"]",
";",
"SecureRandom",
"rand",
";",
"try",
"{",
"rand",
"=",
"Secu... | Generates an authentication token - a random string encoded in Base64.
@param length the length of the generated token
@param urlSafe switches to a URL safe encoding
@return a random string | [
"Generates",
"an",
"authentication",
"token",
"-",
"a",
"random",
"string",
"encoded",
"in",
"Base64",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/utils/Utils.java#L214-L225 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/log/AbstractLogAdapter.java | AbstractLogAdapter.throwError | protected void throwError(final MessageItem messageItem, final Throwable t, final Object... parameters) {
"""
If an error is logged when running in Developer Mode, Throw a Runtime Exception.
When an exception is logged and when an error is logged and we are running in Developer Mode
@param messageItem the me... | java | protected void throwError(final MessageItem messageItem, final Throwable t, final Object... parameters) {
if (messageItem.getLevel() == JRLevel.Exception ||
messageItem.getLevel() == JRLevel.Error && CoreParameters.DEVELOPER_MODE.get()) {
throw new CoreRuntimeException(messageItem... | [
"protected",
"void",
"throwError",
"(",
"final",
"MessageItem",
"messageItem",
",",
"final",
"Throwable",
"t",
",",
"final",
"Object",
"...",
"parameters",
")",
"{",
"if",
"(",
"messageItem",
".",
"getLevel",
"(",
")",
"==",
"JRLevel",
".",
"Exception",
"||"... | If an error is logged when running in Developer Mode, Throw a Runtime Exception.
When an exception is logged and when an error is logged and we are running in Developer Mode
@param messageItem the message to display for the exception thrown
@param t the throwable source (could be null)
@param parameters the message p... | [
"If",
"an",
"error",
"is",
"logged",
"when",
"running",
"in",
"Developer",
"Mode",
"Throw",
"a",
"Runtime",
"Exception",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/log/AbstractLogAdapter.java#L46-L51 |
apache/flink | flink-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/RollingSink.java | RollingSink.openNewPartFile | private void openNewPartFile() throws Exception {
"""
Opens a new part file.
<p>This closes the old bucket file and retrieves a new bucket path from the {@code Bucketer}.
"""
closeCurrentPartFile();
Path newBucketDirectory = bucketer.getNextBucketPath(new Path(basePath));
if (!newBucketDirectory.e... | java | private void openNewPartFile() throws Exception {
closeCurrentPartFile();
Path newBucketDirectory = bucketer.getNextBucketPath(new Path(basePath));
if (!newBucketDirectory.equals(currentBucketDirectory)) {
currentBucketDirectory = newBucketDirectory;
try {
if (fs.mkdirs(currentBucketDirectory)) {
... | [
"private",
"void",
"openNewPartFile",
"(",
")",
"throws",
"Exception",
"{",
"closeCurrentPartFile",
"(",
")",
";",
"Path",
"newBucketDirectory",
"=",
"bucketer",
".",
"getNextBucketPath",
"(",
"new",
"Path",
"(",
"basePath",
")",
")",
";",
"if",
"(",
"!",
"n... | Opens a new part file.
<p>This closes the old bucket file and retrieves a new bucket path from the {@code Bucketer}. | [
"Opens",
"a",
"new",
"part",
"file",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/RollingSink.java#L446-L482 |
aws/aws-sdk-java | aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java | Utils.assertNotNull | public static <T> T assertNotNull(T argument, String msg) {
"""
Throws IllegalArgumentException with the specified error message if the input
is null, otherwise return the input as is.
"""
if (argument == null) throw new IllegalArgumentException(msg);
return argument;
} | java | public static <T> T assertNotNull(T argument, String msg) {
if (argument == null) throw new IllegalArgumentException(msg);
return argument;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"assertNotNull",
"(",
"T",
"argument",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"argument",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"msg",
")",
";",
"return",
"argument",
";",
"}"
] | Throws IllegalArgumentException with the specified error message if the input
is null, otherwise return the input as is. | [
"Throws",
"IllegalArgumentException",
"with",
"the",
"specified",
"error",
"message",
"if",
"the",
"input",
"is",
"null",
"otherwise",
"return",
"the",
"input",
"as",
"is",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java#L253-L256 |
lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/RequestHeader.java | RequestHeader.withAcceptedResponseProtocols | public RequestHeader withAcceptedResponseProtocols(PSequence<MessageProtocol> acceptedResponseProtocols) {
"""
Return a copy of this request header with the given accepted response protocols set.
@param acceptedResponseProtocols The accepted response protocols to set.
@return A copy of this request header.
... | java | public RequestHeader withAcceptedResponseProtocols(PSequence<MessageProtocol> acceptedResponseProtocols) {
return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, principal, headers, lowercaseHeaders);
} | [
"public",
"RequestHeader",
"withAcceptedResponseProtocols",
"(",
"PSequence",
"<",
"MessageProtocol",
">",
"acceptedResponseProtocols",
")",
"{",
"return",
"new",
"RequestHeader",
"(",
"method",
",",
"uri",
",",
"protocol",
",",
"acceptedResponseProtocols",
",",
"princi... | Return a copy of this request header with the given accepted response protocols set.
@param acceptedResponseProtocols The accepted response protocols to set.
@return A copy of this request header. | [
"Return",
"a",
"copy",
"of",
"this",
"request",
"header",
"with",
"the",
"given",
"accepted",
"response",
"protocols",
"set",
"."
] | train | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/RequestHeader.java#L117-L119 |
redkale/redkale | src/org/redkale/util/SelectColumn.java | SelectColumn.includes | public static SelectColumn includes(String[] cols, String... columns) {
"""
class中的字段名
@param cols 包含的字段名集合
@param columns 包含的字段名集合
@return SelectColumn
"""
return new SelectColumn(Utility.append(cols, columns), false);
} | java | public static SelectColumn includes(String[] cols, String... columns) {
return new SelectColumn(Utility.append(cols, columns), false);
} | [
"public",
"static",
"SelectColumn",
"includes",
"(",
"String",
"[",
"]",
"cols",
",",
"String",
"...",
"columns",
")",
"{",
"return",
"new",
"SelectColumn",
"(",
"Utility",
".",
"append",
"(",
"cols",
",",
"columns",
")",
",",
"false",
")",
";",
"}"
] | class中的字段名
@param cols 包含的字段名集合
@param columns 包含的字段名集合
@return SelectColumn | [
"class中的字段名"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/util/SelectColumn.java#L118-L120 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/util/Components.java | Components.getComponentClasses | public static List<Class<?>> getComponentClasses(URL jar) throws IOException {
"""
Get all components from a jar file
@param jar
@return the list of components from the jar. (Implement 'Execute' annotation)
@throws IOException
@throws ClassNotFoundException
"""
JarInputStream jarFile = new JarInp... | java | public static List<Class<?>> getComponentClasses(URL jar) throws IOException {
JarInputStream jarFile = new JarInputStream(jar.openStream());
URLClassLoader cl = new URLClassLoader(new URL[]{jar}, Thread.currentThread().getContextClassLoader());
List<Class<?>> idx = new ArrayList<Class<?>>();
... | [
"public",
"static",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"getComponentClasses",
"(",
"URL",
"jar",
")",
"throws",
"IOException",
"{",
"JarInputStream",
"jarFile",
"=",
"new",
"JarInputStream",
"(",
"jar",
".",
"openStream",
"(",
")",
")",
";",
"URLCla... | Get all components from a jar file
@param jar
@return the list of components from the jar. (Implement 'Execute' annotation)
@throws IOException
@throws ClassNotFoundException | [
"Get",
"all",
"components",
"from",
"a",
"jar",
"file"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/util/Components.java#L304-L331 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusNetworkLayer.java | BusNetworkLayer.onBusLineRemoved | protected boolean onBusLineRemoved(BusLine line, int index) {
"""
Invoked when a bus line was removed from the attached network.
<p>This function exists to allow be override to provide a specific behaviour
when a bus line has been removed.
@param line is the removed line.
@param index is the index of the b... | java | protected boolean onBusLineRemoved(BusLine line, int index) {
if (this.autoUpdate.get()) {
try {
removeMapLayerAt(index);
return true;
} catch (Throwable exception) {
//
}
}
return false;
} | [
"protected",
"boolean",
"onBusLineRemoved",
"(",
"BusLine",
"line",
",",
"int",
"index",
")",
"{",
"if",
"(",
"this",
".",
"autoUpdate",
".",
"get",
"(",
")",
")",
"{",
"try",
"{",
"removeMapLayerAt",
"(",
"index",
")",
";",
"return",
"true",
";",
"}",... | Invoked when a bus line was removed from the attached network.
<p>This function exists to allow be override to provide a specific behaviour
when a bus line has been removed.
@param line is the removed line.
@param index is the index of the bus line.
@return <code>true</code> if the events was fired, otherwise <code>f... | [
"Invoked",
"when",
"a",
"bus",
"line",
"was",
"removed",
"from",
"the",
"attached",
"network",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusNetworkLayer.java#L285-L295 |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/cdi/CDIOperations.java | CDIOperations.getProjectEventTypes | public List<JavaResource> getProjectEventTypes(Project project) {
"""
Returns all the possible event types from the given {@link Project}
"""
final List<JavaResource> eventTypes = new ArrayList<>();
if (project != null)
{
project.getFacet(JavaSourceFacet.class).visitJavaSources(new J... | java | public List<JavaResource> getProjectEventTypes(Project project)
{
final List<JavaResource> eventTypes = new ArrayList<>();
if (project != null)
{
project.getFacet(JavaSourceFacet.class).visitJavaSources(new JavaResourceVisitor()
{
@Override
public void visi... | [
"public",
"List",
"<",
"JavaResource",
">",
"getProjectEventTypes",
"(",
"Project",
"project",
")",
"{",
"final",
"List",
"<",
"JavaResource",
">",
"eventTypes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"project",
"!=",
"null",
")",
"{",
... | Returns all the possible event types from the given {@link Project} | [
"Returns",
"all",
"the",
"possible",
"event",
"types",
"from",
"the",
"given",
"{"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/cdi/CDIOperations.java#L178-L193 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Binder.java | Binder.setField | public MethodHandle setField(MethodHandles.Lookup lookup, String name) throws NoSuchFieldException, IllegalAccessException {
"""
Apply the chain of transforms and bind them to an object field assignment specified
using the end signature plus the given class and name. The end signature must take
the target class ... | java | public MethodHandle setField(MethodHandles.Lookup lookup, String name) throws NoSuchFieldException, IllegalAccessException {
return invoke(lookup.findSetter(type().parameterType(0), name, type().parameterType(1)));
} | [
"public",
"MethodHandle",
"setField",
"(",
"MethodHandles",
".",
"Lookup",
"lookup",
",",
"String",
"name",
")",
"throws",
"NoSuchFieldException",
",",
"IllegalAccessException",
"{",
"return",
"invoke",
"(",
"lookup",
".",
"findSetter",
"(",
"type",
"(",
")",
".... | Apply the chain of transforms and bind them to an object field assignment specified
using the end signature plus the given class and name. The end signature must take
the target class or a subclass and the field's type as its arguments, and its return
type must be compatible with void.
If the final handle's type does ... | [
"Apply",
"the",
"chain",
"of",
"transforms",
"and",
"bind",
"them",
"to",
"an",
"object",
"field",
"assignment",
"specified",
"using",
"the",
"end",
"signature",
"plus",
"the",
"given",
"class",
"and",
"name",
".",
"The",
"end",
"signature",
"must",
"take",
... | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1475-L1477 |
fabiomaffioletti/jsondoc | jsondoc-core/src/main/java/org/jsondoc/core/scanner/AbstractJSONDocScanner.java | AbstractJSONDocScanner.getJSONDoc | public JSONDoc getJSONDoc(String version, String basePath, List<String> packages, boolean playgroundEnabled, MethodDisplay displayMethodAs) {
"""
Returns the main <code>ApiDoc</code>, containing <code>ApiMethodDoc</code> and <code>ApiObjectDoc</code> objects
@return An <code>ApiDoc</code> object
"""
Set<URL... | java | public JSONDoc getJSONDoc(String version, String basePath, List<String> packages, boolean playgroundEnabled, MethodDisplay displayMethodAs) {
Set<URL> urls = new HashSet<URL>();
FilterBuilder filter = new FilterBuilder();
log.debug("Found " + packages.size() + " package(s) to scan...");
for (String pkg : pac... | [
"public",
"JSONDoc",
"getJSONDoc",
"(",
"String",
"version",
",",
"String",
"basePath",
",",
"List",
"<",
"String",
">",
"packages",
",",
"boolean",
"playgroundEnabled",
",",
"MethodDisplay",
"displayMethodAs",
")",
"{",
"Set",
"<",
"URL",
">",
"urls",
"=",
... | Returns the main <code>ApiDoc</code>, containing <code>ApiMethodDoc</code> and <code>ApiObjectDoc</code> objects
@return An <code>ApiDoc</code> object | [
"Returns",
"the",
"main",
"<code",
">",
"ApiDoc<",
"/",
"code",
">",
"containing",
"<code",
">",
"ApiMethodDoc<",
"/",
"code",
">",
"and",
"<code",
">",
"ApiObjectDoc<",
"/",
"code",
">",
"objects"
] | train | https://github.com/fabiomaffioletti/jsondoc/blob/26bf413c236e7c3b66f534c2451b157783c1f45e/jsondoc-core/src/main/java/org/jsondoc/core/scanner/AbstractJSONDocScanner.java#L78-L112 |
mgm-tp/jfunk | jfunk-core/src/main/java/com/mgmtp/jfunk/core/scripting/ScriptContext.java | ScriptContext.setToFormEntry | @Cmd
public void setToFormEntry(final String configProperty, final String dataSetKey, final String entryKey) {
"""
Sets a {@link DataSet} entry from a configuration property.
@param configProperty
the configuration key
@param dataSetKey
the {@link DataSet} key
@param entryKey
the key of the {@link DataSet... | java | @Cmd
public void setToFormEntry(final String configProperty, final String dataSetKey, final String entryKey) {
String resolvedConfigProperty = resolveProperty(configProperty);
String resolvedDataSetKey = resolveProperty(dataSetKey);
String resolvedEntryKey = resolveProperty(entryKey);
DataSet dataSet = dataSo... | [
"@",
"Cmd",
"public",
"void",
"setToFormEntry",
"(",
"final",
"String",
"configProperty",
",",
"final",
"String",
"dataSetKey",
",",
"final",
"String",
"entryKey",
")",
"{",
"String",
"resolvedConfigProperty",
"=",
"resolveProperty",
"(",
"configProperty",
")",
";... | Sets a {@link DataSet} entry from a configuration property.
@param configProperty
the configuration key
@param dataSetKey
the {@link DataSet} key
@param entryKey
the key of the {@link DataSet} entry | [
"Sets",
"a",
"{",
"@link",
"DataSet",
"}",
"entry",
"from",
"a",
"configuration",
"property",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/scripting/ScriptContext.java#L883-L897 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java | Task.executeAsyncCallRunnable | private void executeAsyncCallRunnable(Runnable runnable, String callName, boolean blocking) {
"""
Utility method to dispatch an asynchronous call on the invokable.
@param runnable The async call runnable.
@param callName The name of the call, for logging purposes.
"""
// make sure the executor is initial... | java | private void executeAsyncCallRunnable(Runnable runnable, String callName, boolean blocking) {
// make sure the executor is initialized. lock against concurrent calls to this function
synchronized (this) {
if (executionState != ExecutionState.RUNNING) {
return;
}
// get ourselves a reference on the sta... | [
"private",
"void",
"executeAsyncCallRunnable",
"(",
"Runnable",
"runnable",
",",
"String",
"callName",
",",
"boolean",
"blocking",
")",
"{",
"// make sure the executor is initialized. lock against concurrent calls to this function",
"synchronized",
"(",
"this",
")",
"{",
"if"... | Utility method to dispatch an asynchronous call on the invokable.
@param runnable The async call runnable.
@param callName The name of the call, for logging purposes. | [
"Utility",
"method",
"to",
"dispatch",
"an",
"asynchronous",
"call",
"on",
"the",
"invokable",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java#L1319-L1369 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/Note.java | Note.createResponse | public Note createResponse(String name, String content, boolean personal, Map<String, Object> attributes) {
"""
Create a response to this note.
@param name The name of the note
@param content The content of the note
@param personal True if the note is only visible to the currently logged in user
@param ... | java | public Note createResponse(String name, String content, boolean personal, Map<String, Object> attributes) {
return getInstance().create().note(this, name, content, personal, attributes);
} | [
"public",
"Note",
"createResponse",
"(",
"String",
"name",
",",
"String",
"content",
",",
"boolean",
"personal",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
")",
"{",
"return",
"getInstance",
"(",
")",
".",
"create",
"(",
")",
".",
"note... | Create a response to this note.
@param name The name of the note
@param content The content of the note
@param personal True if the note is only visible to the currently logged in user
@param attributes additional attributes for response to this note.
@return a new note | [
"Create",
"a",
"response",
"to",
"this",
"note",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Note.java#L135-L137 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/item/MalisisItemBlock.java | MalisisItemBlock.checkMerge | private IBlockState checkMerge(ItemStack itemStack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) {
"""
Checks whether the block can be merged with the one already in the world.
@param itemStack the item stack
@param player the player
@param world the wor... | java | private IBlockState checkMerge(ItemStack itemStack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
{
IBlockState state = world.getBlockState(pos);
IMergedBlock mergedBlock = getMerged(state);
if (mergedBlock == null // || (offset && !mergedBlock.doubleCheckMe... | [
"private",
"IBlockState",
"checkMerge",
"(",
"ItemStack",
"itemStack",
",",
"EntityPlayer",
"player",
",",
"World",
"world",
",",
"BlockPos",
"pos",
",",
"EnumFacing",
"side",
",",
"float",
"hitX",
",",
"float",
"hitY",
",",
"float",
"hitZ",
")",
"{",
"IBloc... | Checks whether the block can be merged with the one already in the world.
@param itemStack the item stack
@param player the player
@param world the world
@param pos the pos
@param side the side
@param hitX the hit X
@param hitY the hit Y
@param hitZ the hit Z
@return the i block state | [
"Checks",
"whether",
"the",
"block",
"can",
"be",
"merged",
"with",
"the",
"one",
"already",
"in",
"the",
"world",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/item/MalisisItemBlock.java#L183-L192 |
ops4j/org.ops4j.base | ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java | Resources.getLong | public long getLong( String key, long defaultValue )
throws MissingResourceException {
"""
Retrieve a long from bundle.
@param key the key of resource
@param defaultValue the default value if key is missing
@return the resource long
@throws MissingResourceException if the requested key i... | java | public long getLong( String key, long defaultValue )
throws MissingResourceException
{
try
{
return getLong( key );
}
catch( MissingResourceException mre )
{
return defaultValue;
}
} | [
"public",
"long",
"getLong",
"(",
"String",
"key",
",",
"long",
"defaultValue",
")",
"throws",
"MissingResourceException",
"{",
"try",
"{",
"return",
"getLong",
"(",
"key",
")",
";",
"}",
"catch",
"(",
"MissingResourceException",
"mre",
")",
"{",
"return",
"... | Retrieve a long from bundle.
@param key the key of resource
@param defaultValue the default value if key is missing
@return the resource long
@throws MissingResourceException if the requested key is unknown | [
"Retrieve",
"a",
"long",
"from",
"bundle",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java#L377-L388 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.getCompressionMethodOfEntry | public static int getCompressionMethodOfEntry(File zip, String name) {
"""
Returns the compression method of a given entry of the ZIP file.
@param zip
ZIP file.
@param name
entry name.
@return Returns <code>ZipEntry.STORED</code>, <code>ZipEntry.DEFLATED</code> or -1 if
the ZIP file does not contain the gi... | java | public static int getCompressionMethodOfEntry(File zip, String name) {
ZipFile zf = null;
try {
zf = new ZipFile(zip);
ZipEntry zipEntry = zf.getEntry(name);
if (zipEntry == null) {
return -1;
}
return zipEntry.getMethod();
}
catch (IOException e) {
throw ZipE... | [
"public",
"static",
"int",
"getCompressionMethodOfEntry",
"(",
"File",
"zip",
",",
"String",
"name",
")",
"{",
"ZipFile",
"zf",
"=",
"null",
";",
"try",
"{",
"zf",
"=",
"new",
"ZipFile",
"(",
"zip",
")",
";",
"ZipEntry",
"zipEntry",
"=",
"zf",
".",
"ge... | Returns the compression method of a given entry of the ZIP file.
@param zip
ZIP file.
@param name
entry name.
@return Returns <code>ZipEntry.STORED</code>, <code>ZipEntry.DEFLATED</code> or -1 if
the ZIP file does not contain the given entry. | [
"Returns",
"the",
"compression",
"method",
"of",
"a",
"given",
"entry",
"of",
"the",
"ZIP",
"file",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L127-L143 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/config/ConfigUtils.java | ConfigUtils.getConfig | public static <T extends NamedConfig> T getConfig(ConfigPatternMatcher configPatternMatcher,
Map<String, T> configs, String name,
Class clazz) {
"""
Returns a config for the given name, creating one
if nece... | java | public static <T extends NamedConfig> T getConfig(ConfigPatternMatcher configPatternMatcher,
Map<String, T> configs, String name,
Class clazz) {
return getConfig(configPatternMatcher, configs, name, clazz... | [
"public",
"static",
"<",
"T",
"extends",
"NamedConfig",
">",
"T",
"getConfig",
"(",
"ConfigPatternMatcher",
"configPatternMatcher",
",",
"Map",
"<",
"String",
",",
"T",
">",
"configs",
",",
"String",
"name",
",",
"Class",
"clazz",
")",
"{",
"return",
"getCon... | Returns a config for the given name, creating one
if necessary and adding it to the collection of known configurations.
<p>
The configuration is found by matching the configuration name
pattern to the provided {@code name} without the partition qualifier
(the part of the name after {@code '@'}).
If no configuration mat... | [
"Returns",
"a",
"config",
"for",
"the",
"given",
"name",
"creating",
"one",
"if",
"necessary",
"and",
"adding",
"it",
"to",
"the",
"collection",
"of",
"known",
"configurations",
".",
"<p",
">",
"The",
"configuration",
"is",
"found",
"by",
"matching",
"the",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/config/ConfigUtils.java#L93-L97 |
apereo/cas | support/cas-server-support-memcached-core/src/main/java/org/apereo/cas/memcached/kryo/serial/RegisteredServiceSerializer.java | RegisteredServiceSerializer.writeObjectByReflection | private static void writeObjectByReflection(final Kryo kryo, final Output output, final Object obj) {
"""
Write object by reflection.
@param kryo the kryo
@param output the output
@param obj the obj
"""
val className = obj.getClass().getCanonicalName();
kryo.writeObject(output, classN... | java | private static void writeObjectByReflection(final Kryo kryo, final Output output, final Object obj) {
val className = obj.getClass().getCanonicalName();
kryo.writeObject(output, className);
kryo.writeObject(output, obj);
} | [
"private",
"static",
"void",
"writeObjectByReflection",
"(",
"final",
"Kryo",
"kryo",
",",
"final",
"Output",
"output",
",",
"final",
"Object",
"obj",
")",
"{",
"val",
"className",
"=",
"obj",
".",
"getClass",
"(",
")",
".",
"getCanonicalName",
"(",
")",
"... | Write object by reflection.
@param kryo the kryo
@param output the output
@param obj the obj | [
"Write",
"object",
"by",
"reflection",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-memcached-core/src/main/java/org/apereo/cas/memcached/kryo/serial/RegisteredServiceSerializer.java#L60-L64 |
structr/structr | structr-core/src/main/java/org/structr/module/JarConfigurationProvider.java | JarConfigurationProvider.registerPropertyGroup | @Override
public void registerPropertyGroup(Class type, PropertyKey key, PropertyGroup propertyGroup) {
"""
Registers a property group for the given key of the given entity
type. A property group can be used to combine a set of properties
into an object.
@param type the type of the entities for which the pro... | java | @Override
public void registerPropertyGroup(Class type, PropertyKey key, PropertyGroup propertyGroup) {
getPropertyGroupMapForType(type).put(key.dbName(), propertyGroup);
} | [
"@",
"Override",
"public",
"void",
"registerPropertyGroup",
"(",
"Class",
"type",
",",
"PropertyKey",
"key",
",",
"PropertyGroup",
"propertyGroup",
")",
"{",
"getPropertyGroupMapForType",
"(",
"type",
")",
".",
"put",
"(",
"key",
".",
"dbName",
"(",
")",
",",
... | Registers a property group for the given key of the given entity
type. A property group can be used to combine a set of properties
into an object.
@param type the type of the entities for which the property group
should be registered
@param key the property key under which the property group should be
visible
@param p... | [
"Registers",
"a",
"property",
"group",
"for",
"the",
"given",
"key",
"of",
"the",
"given",
"entity",
"type",
".",
"A",
"property",
"group",
"can",
"be",
"used",
"to",
"combine",
"a",
"set",
"of",
"properties",
"into",
"an",
"object",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/module/JarConfigurationProvider.java#L715-L718 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.