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 |
|---|---|---|---|---|---|---|---|---|---|---|
mikepenz/Materialize | library/src/main/java/com/mikepenz/materialize/util/UIUtils.java | UIUtils.setTranslucentNavigationFlag | public static void setTranslucentNavigationFlag(Activity activity, boolean on) {
"""
helper method to set the TranslucentNavigationFlag
@param on
"""
if (Build.VERSION.SDK_INT >= 19) {
setFlag(activity, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, on);
}
} | java | public static void setTranslucentNavigationFlag(Activity activity, boolean on) {
if (Build.VERSION.SDK_INT >= 19) {
setFlag(activity, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, on);
}
} | [
"public",
"static",
"void",
"setTranslucentNavigationFlag",
"(",
"Activity",
"activity",
",",
"boolean",
"on",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"19",
")",
"{",
"setFlag",
"(",
"activity",
",",
"WindowManager",
".",
"LayoutP... | helper method to set the TranslucentNavigationFlag
@param on | [
"helper",
"method",
"to",
"set",
"the",
"TranslucentNavigationFlag"
] | train | https://github.com/mikepenz/Materialize/blob/2612c10c7570191a78d57f23620e945d61370e3d/library/src/main/java/com/mikepenz/materialize/util/UIUtils.java#L211-L215 |
zaproxy/zaproxy | src/org/zaproxy/zap/authentication/GenericAuthenticationCredentials.java | GenericAuthenticationCredentials.getSetCredentialsForUserApiAction | public static ApiDynamicActionImplementor getSetCredentialsForUserApiAction(
final AuthenticationMethodType methodType) {
"""
Gets the api action for setting a {@link GenericAuthenticationCredentials} for an User.
@param methodType the method type for which this is called
@return api action implementation
... | java | public static ApiDynamicActionImplementor getSetCredentialsForUserApiAction(
final AuthenticationMethodType methodType) {
return new ApiDynamicActionImplementor(ACTION_SET_CREDENTIALS, null,
new String[] { PARAM_CONFIG_PARAMS }) {
@Override
public void handleAction(JSONObject params) throws ApiException... | [
"public",
"static",
"ApiDynamicActionImplementor",
"getSetCredentialsForUserApiAction",
"(",
"final",
"AuthenticationMethodType",
"methodType",
")",
"{",
"return",
"new",
"ApiDynamicActionImplementor",
"(",
"ACTION_SET_CREDENTIALS",
",",
"null",
",",
"new",
"String",
"[",
"... | Gets the api action for setting a {@link GenericAuthenticationCredentials} for an User.
@param methodType the method type for which this is called
@return api action implementation | [
"Gets",
"the",
"api",
"action",
"for",
"setting",
"a",
"{",
"@link",
"GenericAuthenticationCredentials",
"}",
"for",
"an",
"User",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/authentication/GenericAuthenticationCredentials.java#L125-L156 |
relayrides/pushy | micrometer-metrics-listener/src/main/java/com/turo/pushy/apns/metrics/micrometer/MicrometerApnsClientMetricsListener.java | MicrometerApnsClientMetricsListener.handleNotificationSent | @Override
public void handleNotificationSent(final ApnsClient apnsClient, final long notificationId) {
"""
Records a successful attempt to send a notification and updates metrics accordingly.
@param apnsClient the client that sent the notification; note that this is ignored by
{@code MicrometerApnsClientMe... | java | @Override
public void handleNotificationSent(final ApnsClient apnsClient, final long notificationId) {
this.notificationStartTimes.put(notificationId, System.nanoTime());
this.sentNotifications.increment();
} | [
"@",
"Override",
"public",
"void",
"handleNotificationSent",
"(",
"final",
"ApnsClient",
"apnsClient",
",",
"final",
"long",
"notificationId",
")",
"{",
"this",
".",
"notificationStartTimes",
".",
"put",
"(",
"notificationId",
",",
"System",
".",
"nanoTime",
"(",
... | Records a successful attempt to send a notification and updates metrics accordingly.
@param apnsClient the client that sent the notification; note that this is ignored by
{@code MicrometerApnsClientMetricsListener} instances, which should always be used for exactly one client
@param notificationId an opaque, unique id... | [
"Records",
"a",
"successful",
"attempt",
"to",
"send",
"a",
"notification",
"and",
"updates",
"metrics",
"accordingly",
"."
] | train | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/micrometer-metrics-listener/src/main/java/com/turo/pushy/apns/metrics/micrometer/MicrometerApnsClientMetricsListener.java#L196-L200 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/DefaultErrorHandler.java | DefaultErrorHandler.renderDirectly | protected void renderDirectly(int statusCode, RouteContext routeContext) {
"""
Render the result directly (without template).
@param routeContext
"""
if (application.getPippoSettings().isProd()) {
routeContext.getResponse().commit();
} else {
if (statusCode == HttpCon... | java | protected void renderDirectly(int statusCode, RouteContext routeContext) {
if (application.getPippoSettings().isProd()) {
routeContext.getResponse().commit();
} else {
if (statusCode == HttpConstants.StatusCode.NOT_FOUND) {
StringBuilder content = new StringBuilde... | [
"protected",
"void",
"renderDirectly",
"(",
"int",
"statusCode",
",",
"RouteContext",
"routeContext",
")",
"{",
"if",
"(",
"application",
".",
"getPippoSettings",
"(",
")",
".",
"isProd",
"(",
")",
")",
"{",
"routeContext",
".",
"getResponse",
"(",
")",
".",... | Render the result directly (without template).
@param routeContext | [
"Render",
"the",
"result",
"directly",
"(",
"without",
"template",
")",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/DefaultErrorHandler.java#L215-L256 |
jbundle/jbundle | base/message/core/src/main/java/org/jbundle/base/message/core/trx/TrxMessageHeader.java | TrxMessageHeader.put | public void put(String strKey, Object objData) {
"""
Return the state of this object as a properties object.
@param strKey The key to return.
@return The properties.
"""
if (m_mapMessageHeader == null)
m_mapMessageHeader = new HashMap<String,Object>();
objData = m_mapMessageHeader... | java | public void put(String strKey, Object objData)
{
if (m_mapMessageHeader == null)
m_mapMessageHeader = new HashMap<String,Object>();
objData = m_mapMessageHeader.put(strKey, objData);
} | [
"public",
"void",
"put",
"(",
"String",
"strKey",
",",
"Object",
"objData",
")",
"{",
"if",
"(",
"m_mapMessageHeader",
"==",
"null",
")",
"m_mapMessageHeader",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"objData",
"=",
"m_ma... | Return the state of this object as a properties object.
@param strKey The key to return.
@return The properties. | [
"Return",
"the",
"state",
"of",
"this",
"object",
"as",
"a",
"properties",
"object",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/core/src/main/java/org/jbundle/base/message/core/trx/TrxMessageHeader.java#L271-L276 |
landawn/AbacusUtil | src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java | PoolablePreparedStatement.setString | @Override
public void setString(int parameterIndex, String x) throws SQLException {
"""
Method setString.
@param parameterIndex
@param x
@throws SQLException
@see java.sql.PreparedStatement#setString(int, String)
"""
internalStmt.setString(parameterIndex, x);
} | java | @Override
public void setString(int parameterIndex, String x) throws SQLException {
internalStmt.setString(parameterIndex, x);
} | [
"@",
"Override",
"public",
"void",
"setString",
"(",
"int",
"parameterIndex",
",",
"String",
"x",
")",
"throws",
"SQLException",
"{",
"internalStmt",
".",
"setString",
"(",
"parameterIndex",
",",
"x",
")",
";",
"}"
] | Method setString.
@param parameterIndex
@param x
@throws SQLException
@see java.sql.PreparedStatement#setString(int, String) | [
"Method",
"setString",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L991-L994 |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/URLPackageScanner.java | URLPackageScanner.newInstance | public static URLPackageScanner newInstance(boolean addRecursively, final ClassLoader classLoader,
final Callback callback, final String packageName) {
"""
Factory method to create an instance of URLPackageScanner.
@param addRecursively flag to add child packages
... | java | public static URLPackageScanner newInstance(boolean addRecursively, final ClassLoader classLoader,
final Callback callback, final String packageName) {
Validate.notNull(packageName, "Package name must be specified");
Validate.notNull(addRecursively, "AddRe... | [
"public",
"static",
"URLPackageScanner",
"newInstance",
"(",
"boolean",
"addRecursively",
",",
"final",
"ClassLoader",
"classLoader",
",",
"final",
"Callback",
"callback",
",",
"final",
"String",
"packageName",
")",
"{",
"Validate",
".",
"notNull",
"(",
"packageName... | Factory method to create an instance of URLPackageScanner.
@param addRecursively flag to add child packages
@param classLoader class loader that will have classes added
@param callback Callback to invoke when a matching class is found
@param packageName Package that will be scanned
@return new instance of ... | [
"Factory",
"method",
"to",
"create",
"an",
"instance",
"of",
"URLPackageScanner",
"."
] | train | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/URLPackageScanner.java#L79-L87 |
Netflix/Hystrix | hystrix-core/src/main/java/com/netflix/hystrix/strategy/executionhook/HystrixCommandExecutionHook.java | HystrixCommandExecutionHook.onRunSuccess | @Deprecated
public <T> T onRunSuccess(HystrixInvokable<T> commandInstance, T response) {
"""
DEPRECATED: Change usages of this to {@link #onExecutionEmit} if you want to add a hook for each value emitted by the command
or to {@link #onExecutionSuccess} if you want to add a hook when the command successfully e... | java | @Deprecated
public <T> T onRunSuccess(HystrixInvokable<T> commandInstance, T response) {
// pass-thru by default
return response;
} | [
"@",
"Deprecated",
"public",
"<",
"T",
">",
"T",
"onRunSuccess",
"(",
"HystrixInvokable",
"<",
"T",
">",
"commandInstance",
",",
"T",
"response",
")",
"{",
"// pass-thru by default",
"return",
"response",
";",
"}"
] | DEPRECATED: Change usages of this to {@link #onExecutionEmit} if you want to add a hook for each value emitted by the command
or to {@link #onExecutionSuccess} if you want to add a hook when the command successfully executes
Invoked after successful execution of {@link HystrixCommand#run()} with response value.
In a {... | [
"DEPRECATED",
":",
"Change",
"usages",
"of",
"this",
"to",
"{",
"@link",
"#onExecutionEmit",
"}",
"if",
"you",
"want",
"to",
"add",
"a",
"hook",
"for",
"each",
"value",
"emitted",
"by",
"the",
"command",
"or",
"to",
"{",
"@link",
"#onExecutionSuccess",
"}"... | train | https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/strategy/executionhook/HystrixCommandExecutionHook.java#L298-L302 |
davidmoten/rxjava-extras | src/main/java/com/github/davidmoten/rx/Transformers.java | Transformers.collectWhile | public static <T, R> Transformer<T, R> collectWhile(final Func0<R> factory,
final Action2<? super R, ? super T> collect,
final Func2<? super R, ? super T, Boolean> condition,
final Func1<? super R, Boolean> isEmpty) {
"""
<p>
Returns a {@link Transformer} that returns an {@link... | java | public static <T, R> Transformer<T, R> collectWhile(final Func0<R> factory,
final Action2<? super R, ? super T> collect,
final Func2<? super R, ? super T, Boolean> condition,
final Func1<? super R, Boolean> isEmpty) {
Func3<R, T, Observer<R>, R> transition = new Func3<R, T, O... | [
"public",
"static",
"<",
"T",
",",
"R",
">",
"Transformer",
"<",
"T",
",",
"R",
">",
"collectWhile",
"(",
"final",
"Func0",
"<",
"R",
">",
"factory",
",",
"final",
"Action2",
"<",
"?",
"super",
"R",
",",
"?",
"super",
"T",
">",
"collect",
",",
"f... | <p>
Returns a {@link Transformer} that returns an {@link Observable} that is
collected into {@code Collection} instances created by {@code factory}
that are emitted when the collection and latest emission do not satisfy
{@code condition} or on completion.
<p>
<img src=
"https://github.com/davidmoten/rxjava-extras/blob... | [
"<p",
">",
"Returns",
"a",
"{",
"@link",
"Transformer",
"}",
"that",
"returns",
"an",
"{",
"@link",
"Observable",
"}",
"that",
"is",
"collected",
"into",
"{",
"@code",
"Collection",
"}",
"instances",
"created",
"by",
"{",
"@code",
"factory",
"}",
"that",
... | train | https://github.com/davidmoten/rxjava-extras/blob/a91d2ba7d454843250e0b0fce36084f9fb02a551/src/main/java/com/github/davidmoten/rx/Transformers.java#L544-L575 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractLinear.java | AbstractLinear.create_TRACK_Image | protected BufferedImage create_TRACK_Image(final int WIDTH, final int HEIGHT, final double MIN_VALUE,
final double MAX_VALUE, final double TRACK_START,
final double TRACK_SECTION, final double TRA... | java | protected BufferedImage create_TRACK_Image(final int WIDTH, final int HEIGHT, final double MIN_VALUE,
final double MAX_VALUE, final double TRACK_START,
final double TRACK_SECTION, final double TRA... | [
"protected",
"BufferedImage",
"create_TRACK_Image",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"int",
"HEIGHT",
",",
"final",
"double",
"MIN_VALUE",
",",
"final",
"double",
"MAX_VALUE",
",",
"final",
"double",
"TRACK_START",
",",
"final",
"double",
"TRACK_SECTION... | Returns the track image with the given values.
@param WIDTH
@param HEIGHT
@param MIN_VALUE
@param MAX_VALUE
@param TRACK_START
@param TRACK_SECTION
@param TRACK_STOP
@param TRACK_START_COLOR
@param TRACK_SECTION_COLOR
@param TRACK_STOP_COLOR
@return a buffered image of the track colored with the given values | [
"Returns",
"the",
"track",
"image",
"with",
"the",
"given",
"values",
"."
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractLinear.java#L973-L980 |
onepf/OpenIAB | library/src/main/java/org/onepf/oms/appstore/googleUtils/Base64.java | Base64.decodeWebSafe | @NotNull
public static byte[] decodeWebSafe(byte[] source, int off, int len)
throws Base64DecoderException {
"""
Decodes web safe Base64 content in byte array format and returns
the decoded byte array.
Web safe encoding uses '-' instead of '+', '_' instead of '/'
@param source the Base64 encod... | java | @NotNull
public static byte[] decodeWebSafe(byte[] source, int off, int len)
throws Base64DecoderException {
return decode(source, off, len, WEBSAFE_DECODABET);
} | [
"@",
"NotNull",
"public",
"static",
"byte",
"[",
"]",
"decodeWebSafe",
"(",
"byte",
"[",
"]",
"source",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"Base64DecoderException",
"{",
"return",
"decode",
"(",
"source",
",",
"off",
",",
"len",
",",
... | Decodes web safe Base64 content in byte array format and returns
the decoded byte array.
Web safe encoding uses '-' instead of '+', '_' instead of '/'
@param source the Base64 encoded data
@param off the offset of where to begin decoding
@param len the length of characters to decode
@return decoded data | [
"Decodes",
"web",
"safe",
"Base64",
"content",
"in",
"byte",
"array",
"format",
"and",
"returns",
"the",
"decoded",
"byte",
"array",
".",
"Web",
"safe",
"encoding",
"uses",
"-",
"instead",
"of",
"+",
"_",
"instead",
"of",
"/"
] | train | https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/appstore/googleUtils/Base64.java#L514-L518 |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.elementBeforeImpl | protected Element elementBeforeImpl(String name) {
"""
Add a named XML element to the document as a sibling element
that precedes the position of this builder node.
When adding an element to a namespaced document, the new node will be
assigned a namespace matching it's qualified name prefix (if any) or
the d... | java | protected Element elementBeforeImpl(String name) {
String prefix = getPrefixFromQualifiedName(name);
String namespaceURI = this.xmlNode.lookupNamespaceURI(prefix);
return elementBeforeImpl(name, namespaceURI);
} | [
"protected",
"Element",
"elementBeforeImpl",
"(",
"String",
"name",
")",
"{",
"String",
"prefix",
"=",
"getPrefixFromQualifiedName",
"(",
"name",
")",
";",
"String",
"namespaceURI",
"=",
"this",
".",
"xmlNode",
".",
"lookupNamespaceURI",
"(",
"prefix",
")",
";",... | Add a named XML element to the document as a sibling element
that precedes the position of this builder node.
When adding an element to a namespaced document, the new node will be
assigned a namespace matching it's qualified name prefix (if any) or
the document's default namespace. NOTE: If the element has a prefix th... | [
"Add",
"a",
"named",
"XML",
"element",
"to",
"the",
"document",
"as",
"a",
"sibling",
"element",
"that",
"precedes",
"the",
"position",
"of",
"this",
"builder",
"node",
"."
] | train | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L765-L769 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/MapTilePathModel.java | MapTilePathModel.getFreeTileAround | private CoordTile getFreeTileAround(Pathfindable mover, int tx, int ty, int tw, int th, int radius, Integer id) {
"""
Search a free area from this location.
@param mover The object moving on map.
@param tx The horizontal tile index.
@param ty The vertical tile index.
@param tw The width in tile.
@param th T... | java | private CoordTile getFreeTileAround(Pathfindable mover, int tx, int ty, int tw, int th, int radius, Integer id)
{
for (int ctx = tx - radius; ctx <= tx + radius; ctx++)
{
for (int cty = ty - radius; cty <= ty + radius; cty++)
{
if (isAreaAvailable(mover, ctx, ... | [
"private",
"CoordTile",
"getFreeTileAround",
"(",
"Pathfindable",
"mover",
",",
"int",
"tx",
",",
"int",
"ty",
",",
"int",
"tw",
",",
"int",
"th",
",",
"int",
"radius",
",",
"Integer",
"id",
")",
"{",
"for",
"(",
"int",
"ctx",
"=",
"tx",
"-",
"radius... | Search a free area from this location.
@param mover The object moving on map.
@param tx The horizontal tile index.
@param ty The vertical tile index.
@param tw The width in tile.
@param th The height in tile.
@param radius The search radius.
@param id The mover id.
@return The free tile found (<code>null</code> if non... | [
"Search",
"a",
"free",
"area",
"from",
"this",
"location",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/MapTilePathModel.java#L212-L225 |
terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/http/HttpUtil.java | HttpUtil.forwardPost | public static Response forwardPost(URI uri, HttpServletRequest request, boolean forwardHeaders) throws URISyntaxException, HttpException {
"""
Forward POST to uri based on given request
@param uri uri The URI to forward to.
@param request The original {@link HttpServletRequest}
@param forwar... | java | public static Response forwardPost(URI uri, HttpServletRequest request, boolean forwardHeaders) throws URISyntaxException, HttpException {
Header[] headersToForward = null;
if (request != null && forwardHeaders) {
headersToForward = HttpUtil.getHeadersFromRequest(request);
}
... | [
"public",
"static",
"Response",
"forwardPost",
"(",
"URI",
"uri",
",",
"HttpServletRequest",
"request",
",",
"boolean",
"forwardHeaders",
")",
"throws",
"URISyntaxException",
",",
"HttpException",
"{",
"Header",
"[",
"]",
"headersToForward",
"=",
"null",
";",
"if"... | Forward POST to uri based on given request
@param uri uri The URI to forward to.
@param request The original {@link HttpServletRequest}
@param forwardHeaders Should headers of request should be forwarded
@return
@throws URISyntaxException
@throws HttpException | [
"Forward",
"POST",
"to",
"uri",
"based",
"on",
"given",
"request"
] | train | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/http/HttpUtil.java#L1214-L1225 |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/layoutmanager/BaseLayoutManager.java | BaseLayoutManager.recycleByRenderState | protected void recycleByRenderState(RecyclerView.Recycler recycler, RenderState renderState) {
"""
Helper method to call appropriate recycle method depending on current render layout
direction
@param recycler Current recycler that is attached to RecyclerView
@param renderState Current render state. Right n... | java | protected void recycleByRenderState(RecyclerView.Recycler recycler, RenderState renderState) {
if (renderState.mLayoutDirection == RenderState.LAYOUT_START) {
recycleViewsFromEnd(recycler, renderState.mScrollingOffset);
} else {
recycleViewsFromStart(recycler, renderState.mScroll... | [
"protected",
"void",
"recycleByRenderState",
"(",
"RecyclerView",
".",
"Recycler",
"recycler",
",",
"RenderState",
"renderState",
")",
"{",
"if",
"(",
"renderState",
".",
"mLayoutDirection",
"==",
"RenderState",
".",
"LAYOUT_START",
")",
"{",
"recycleViewsFromEnd",
... | Helper method to call appropriate recycle method depending on current render layout
direction
@param recycler Current recycler that is attached to RecyclerView
@param renderState Current render state. Right now, this object does not change but
we may consider moving it out of this view so passing around as a
parame... | [
"Helper",
"method",
"to",
"call",
"appropriate",
"recycle",
"method",
"depending",
"on",
"current",
"render",
"layout",
"direction"
] | train | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/layoutmanager/BaseLayoutManager.java#L969-L975 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.order_orderId_status_GET | public OvhOrderStatusEnum order_orderId_status_GET(Long orderId) throws IOException {
"""
Return status of order
REST: GET /me/order/{orderId}/status
@param orderId [required]
"""
String qPath = "/me/order/{orderId}/status";
StringBuilder sb = path(qPath, orderId);
String resp = exec(qPath, "GET", sb... | java | public OvhOrderStatusEnum order_orderId_status_GET(Long orderId) throws IOException {
String qPath = "/me/order/{orderId}/status";
StringBuilder sb = path(qPath, orderId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhOrderStatusEnum.class);
} | [
"public",
"OvhOrderStatusEnum",
"order_orderId_status_GET",
"(",
"Long",
"orderId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/order/{orderId}/status\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"orderId",
")",
";",
"String"... | Return status of order
REST: GET /me/order/{orderId}/status
@param orderId [required] | [
"Return",
"status",
"of",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1884-L1889 |
joniles/mpxj | src/main/java/net/sf/mpxj/planner/PlannerWriter.java | PlannerWriter.writePredecessors | private void writePredecessors(Task mpxjTask, net.sf.mpxj.planner.schema.Task plannerTask) {
"""
This method writes predecessor data to a Planner file.
We have to deal with a slight anomaly in this method that is introduced
by the MPX file format. It would be possible for someone to create an
MPX file with both... | java | private void writePredecessors(Task mpxjTask, net.sf.mpxj.planner.schema.Task plannerTask)
{
Predecessors plannerPredecessors = m_factory.createPredecessors();
plannerTask.setPredecessors(plannerPredecessors);
List<Predecessor> predecessorList = plannerPredecessors.getPredecessor();
int id = ... | [
"private",
"void",
"writePredecessors",
"(",
"Task",
"mpxjTask",
",",
"net",
".",
"sf",
".",
"mpxj",
".",
"planner",
".",
"schema",
".",
"Task",
"plannerTask",
")",
"{",
"Predecessors",
"plannerPredecessors",
"=",
"m_factory",
".",
"createPredecessors",
"(",
"... | This method writes predecessor data to a Planner file.
We have to deal with a slight anomaly in this method that is introduced
by the MPX file format. It would be possible for someone to create an
MPX file with both the predecessor list and the unique ID predecessor
list populated... which means that we must process bo... | [
"This",
"method",
"writes",
"predecessor",
"data",
"to",
"a",
"Planner",
"file",
".",
"We",
"have",
"to",
"deal",
"with",
"a",
"slight",
"anomaly",
"in",
"this",
"method",
"that",
"is",
"introduced",
"by",
"the",
"MPX",
"file",
"format",
".",
"It",
"woul... | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/planner/PlannerWriter.java#L510-L529 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/compare/SimpleCompareFileExtensions.java | SimpleCompareFileExtensions.compareFilesByLength | public static boolean compareFilesByLength(final File sourceFile, final File fileToCompare) {
"""
Compare files by length.
@param sourceFile
the source file
@param fileToCompare
the file to compare
@return true if the length are equal, otherwise false.
"""
return CompareFileExtensions
.compareFiles... | java | public static boolean compareFilesByLength(final File sourceFile, final File fileToCompare)
{
return CompareFileExtensions
.compareFiles(sourceFile, fileToCompare, true, true, false, true, true, true)
.getLengthEquality();
} | [
"public",
"static",
"boolean",
"compareFilesByLength",
"(",
"final",
"File",
"sourceFile",
",",
"final",
"File",
"fileToCompare",
")",
"{",
"return",
"CompareFileExtensions",
".",
"compareFiles",
"(",
"sourceFile",
",",
"fileToCompare",
",",
"true",
",",
"true",
"... | Compare files by length.
@param sourceFile
the source file
@param fileToCompare
the file to compare
@return true if the length are equal, otherwise false. | [
"Compare",
"files",
"by",
"length",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/compare/SimpleCompareFileExtensions.java#L180-L185 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java | JsonRpcBasicServer.findBestMethodByParamsNode | private AMethodWithItsArgs findBestMethodByParamsNode(Set<Method> methods, JsonNode paramsNode) {
"""
Finds the {@link Method} from the supplied {@link Set} that
best matches the rest of the arguments supplied and returns
it as a {@link AMethodWithItsArgs} class.
@param methods the {@link Method}s
@param ... | java | private AMethodWithItsArgs findBestMethodByParamsNode(Set<Method> methods, JsonNode paramsNode) {
if (hasNoParameters(paramsNode)) {
return findBestMethodUsingParamIndexes(methods, 0, null);
}
AMethodWithItsArgs matchedMethod;
if (paramsNode.isArray()) {
matchedMethod = findBestMethodUsingParamIndexes(met... | [
"private",
"AMethodWithItsArgs",
"findBestMethodByParamsNode",
"(",
"Set",
"<",
"Method",
">",
"methods",
",",
"JsonNode",
"paramsNode",
")",
"{",
"if",
"(",
"hasNoParameters",
"(",
"paramsNode",
")",
")",
"{",
"return",
"findBestMethodUsingParamIndexes",
"(",
"meth... | Finds the {@link Method} from the supplied {@link Set} that
best matches the rest of the arguments supplied and returns
it as a {@link AMethodWithItsArgs} class.
@param methods the {@link Method}s
@param paramsNode the {@link JsonNode} passed as the parameters
@return the {@link AMethodWithItsArgs} | [
"Finds",
"the",
"{",
"@link",
"Method",
"}",
"from",
"the",
"supplied",
"{",
"@link",
"Set",
"}",
"that",
"best",
"matches",
"the",
"rest",
"of",
"the",
"arguments",
"supplied",
"and",
"returns",
"it",
"as",
"a",
"{",
"@link",
"AMethodWithItsArgs",
"}",
... | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java#L618-L634 |
xebialabs/overcast | src/main/java/com/xebialabs/overcast/OverthereUtil.java | OverthereUtil.copyFiles | public static void copyFiles(OverthereConnection srcHost, OverthereConnection dstHost, List<String> copySpec) {
"""
Copy files from srcHost to dstHost. Files are copied using overthere. So from file to file or from directory to
directory. If copySpec's length is even then files/directories are copied pair wise. I... | java | public static void copyFiles(OverthereConnection srcHost, OverthereConnection dstHost, List<String> copySpec) {
if (copySpec.isEmpty()) {
return;
}
if (copySpec.size() % 2 == 0) {
Iterator<String> toCopy = copySpec.iterator();
while (toCopy.hasNext()) {
... | [
"public",
"static",
"void",
"copyFiles",
"(",
"OverthereConnection",
"srcHost",
",",
"OverthereConnection",
"dstHost",
",",
"List",
"<",
"String",
">",
"copySpec",
")",
"{",
"if",
"(",
"copySpec",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"if... | Copy files from srcHost to dstHost. Files are copied using overthere. So from file to file or from directory to
directory. If copySpec's length is even then files/directories are copied pair wise. If copySpec's lenght is odd
then everything is copied into the last entry. | [
"Copy",
"files",
"from",
"srcHost",
"to",
"dstHost",
".",
"Files",
"are",
"copied",
"using",
"overthere",
".",
"So",
"from",
"file",
"to",
"file",
"or",
"from",
"directory",
"to",
"directory",
".",
"If",
"copySpec",
"s",
"length",
"is",
"even",
"then",
"... | train | https://github.com/xebialabs/overcast/blob/716e57b66870c9afe51edc3b6045863a34fb0061/src/main/java/com/xebialabs/overcast/OverthereUtil.java#L86-L108 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java | BusItinerary.insertBusHaltBefore | public BusItineraryHalt insertBusHaltBefore(BusItineraryHalt beforeHalt, UUID id, BusItineraryHaltType type) {
"""
Insert newHalt before beforeHalt in the ordered list of {@link BusItineraryHalt}.
@param beforeHalt the halt where insert the new halt
@param id id of the new halt
@param type the type of bus halt
... | java | public BusItineraryHalt insertBusHaltBefore(BusItineraryHalt beforeHalt, UUID id, BusItineraryHaltType type) {
return this.insertBusHaltBefore(beforeHalt, id, null, type);
} | [
"public",
"BusItineraryHalt",
"insertBusHaltBefore",
"(",
"BusItineraryHalt",
"beforeHalt",
",",
"UUID",
"id",
",",
"BusItineraryHaltType",
"type",
")",
"{",
"return",
"this",
".",
"insertBusHaltBefore",
"(",
"beforeHalt",
",",
"id",
",",
"null",
",",
"type",
")",... | Insert newHalt before beforeHalt in the ordered list of {@link BusItineraryHalt}.
@param beforeHalt the halt where insert the new halt
@param id id of the new halt
@param type the type of bus halt
@return the added bus halt, otherwise <code>null</code> | [
"Insert",
"newHalt",
"before",
"beforeHalt",
"in",
"the",
"ordered",
"list",
"of",
"{",
"@link",
"BusItineraryHalt",
"}",
".",
"@param",
"beforeHalt",
"the",
"halt",
"where",
"insert",
"the",
"new",
"halt",
"@param",
"id",
"id",
"of",
"the",
"new",
"halt",
... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java#L1248-L1250 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java | VirtualNetworkGatewayConnectionsInner.updateTagsAsync | public Observable<VirtualNetworkGatewayConnectionListEntityInner> updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map<String, String> tags) {
"""
Updates a virtual network gateway connection tags.
@param resourceGroupName The name of the resource group.
@param virtualNetwo... | java | public Observable<VirtualNetworkGatewayConnectionListEntityInner> updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map<String, String> tags) {
return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).map(new Func1<ServiceRespons... | [
"public",
"Observable",
"<",
"VirtualNetworkGatewayConnectionListEntityInner",
">",
"updateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayConnectionName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"u... | Updates a virtual network gateway connection tags.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
@param tags Resource tags.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the obs... | [
"Updates",
"a",
"virtual",
"network",
"gateway",
"connection",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java#L638-L645 |
3pillarlabs/spring-data-simpledb | spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/reflection/ReflectionUtils.java | ReflectionUtils.getPropertyField | public static Field getPropertyField(Class<?> clazz, String propertyPath) {
"""
Retrieve the {@link Field} corresponding to the propertyPath in the given
class.
@param clazz
@param propertyPath
@return
"""
Field propertyField = null;
try {
String[] properties = propertyPath.split("\\.");
Fie... | java | public static Field getPropertyField(Class<?> clazz, String propertyPath) {
Field propertyField = null;
try {
String[] properties = propertyPath.split("\\.");
Field carField = getDeclaredFieldInHierarchy(clazz, properties[0]);
if (properties.length == 1) {
propertyField = carField;
} else {
... | [
"public",
"static",
"Field",
"getPropertyField",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"propertyPath",
")",
"{",
"Field",
"propertyField",
"=",
"null",
";",
"try",
"{",
"String",
"[",
"]",
"properties",
"=",
"propertyPath",
".",
"split",
"("... | Retrieve the {@link Field} corresponding to the propertyPath in the given
class.
@param clazz
@param propertyPath
@return | [
"Retrieve",
"the",
"{",
"@link",
"Field",
"}",
"corresponding",
"to",
"the",
"propertyPath",
"in",
"the",
"given",
"class",
"."
] | train | https://github.com/3pillarlabs/spring-data-simpledb/blob/f1e0eb4e48ec4674d3966e8f5bc04c95031f93ae/spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/reflection/ReflectionUtils.java#L271-L289 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-infinispan/src/main/java/org/xwiki/cache/infinispan/internal/InfinispanConfigurationLoader.java | InfinispanConfigurationLoader.customizeEviction | private void customizeEviction(ConfigurationBuilder builder) {
"""
Customize the eviction configuration.
@param buil the configuration builder
@param configuration the configuration
@return the configuration builder
"""
EntryEvictionConfiguration eec =
(EntryEvictionConfiguration) getC... | java | private void customizeEviction(ConfigurationBuilder builder)
{
EntryEvictionConfiguration eec =
(EntryEvictionConfiguration) getCacheConfiguration().get(EntryEvictionConfiguration.CONFIGURATIONID);
if (eec != null && eec.getAlgorithm() == EntryEvictionConfiguration.Algorithm.LRU) {
... | [
"private",
"void",
"customizeEviction",
"(",
"ConfigurationBuilder",
"builder",
")",
"{",
"EntryEvictionConfiguration",
"eec",
"=",
"(",
"EntryEvictionConfiguration",
")",
"getCacheConfiguration",
"(",
")",
".",
"get",
"(",
"EntryEvictionConfiguration",
".",
"CONFIGURATIO... | Customize the eviction configuration.
@param buil the configuration builder
@param configuration the configuration
@return the configuration builder | [
"Customize",
"the",
"eviction",
"configuration",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-infinispan/src/main/java/org/xwiki/cache/infinispan/internal/InfinispanConfigurationLoader.java#L74-L96 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Statement.java | Statement.executeQuery | public ResultSet executeQuery(ReadContext context, Options.QueryOption... options) {
"""
Executes the query in {@code context}. {@code statement.executeQuery(context)} is exactly
equivalent to {@code context.executeQuery(statement)}.
@see ReadContext#executeQuery(Statement, Options.QueryOption...)
"""
... | java | public ResultSet executeQuery(ReadContext context, Options.QueryOption... options) {
return context.executeQuery(this, options);
} | [
"public",
"ResultSet",
"executeQuery",
"(",
"ReadContext",
"context",
",",
"Options",
".",
"QueryOption",
"...",
"options",
")",
"{",
"return",
"context",
".",
"executeQuery",
"(",
"this",
",",
"options",
")",
";",
"}"
] | Executes the query in {@code context}. {@code statement.executeQuery(context)} is exactly
equivalent to {@code context.executeQuery(statement)}.
@see ReadContext#executeQuery(Statement, Options.QueryOption...) | [
"Executes",
"the",
"query",
"in",
"{",
"@code",
"context",
"}",
".",
"{",
"@code",
"statement",
".",
"executeQuery",
"(",
"context",
")",
"}",
"is",
"exactly",
"equivalent",
"to",
"{",
"@code",
"context",
".",
"executeQuery",
"(",
"statement",
")",
"}",
... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Statement.java#L135-L137 |
haifengl/smile | demo/src/main/java/smile/demo/SmileDemo.java | SmileDemo.createAndShowGUI | public static void createAndShowGUI(boolean exitOnClose) {
"""
Create the GUI and show it. For thread safety,
this method should be invoked from the
event dispatch thread.
"""
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(in... | java | public static void createAndShowGUI(boolean exitOnClose) {
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
... | [
"public",
"static",
"void",
"createAndShowGUI",
"(",
"boolean",
"exitOnClose",
")",
"{",
"try",
"{",
"for",
"(",
"LookAndFeelInfo",
"info",
":",
"UIManager",
".",
"getInstalledLookAndFeels",
"(",
")",
")",
"{",
"if",
"(",
"\"Nimbus\"",
".",
"equals",
"(",
"i... | Create the GUI and show it. For thread safety,
this method should be invoked from the
event dispatch thread. | [
"Create",
"the",
"GUI",
"and",
"show",
"it",
".",
"For",
"thread",
"safety",
"this",
"method",
"should",
"be",
"invoked",
"from",
"the",
"event",
"dispatch",
"thread",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/demo/src/main/java/smile/demo/SmileDemo.java#L542-L575 |
Azure/azure-sdk-for-java | datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRulesInner.java | VirtualNetworkRulesInner.updateAsync | public Observable<VirtualNetworkRuleInner> updateAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName, UpdateVirtualNetworkRuleParameters parameters) {
"""
Updates the specified virtual network rule.
@param resourceGroupName The name of the Azure resource group.
@param accountName ... | java | public Observable<VirtualNetworkRuleInner> updateAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName, UpdateVirtualNetworkRuleParameters parameters) {
return updateWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters).map(new Func1<ServiceResp... | [
"public",
"Observable",
"<",
"VirtualNetworkRuleInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"virtualNetworkRuleName",
",",
"UpdateVirtualNetworkRuleParameters",
"parameters",
")",
"{",
"return",
"updateWithSer... | Updates the specified virtual network rule.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Store account.
@param virtualNetworkRuleName The name of the virtual network rule to update.
@param parameters Parameters supplied to update the virtual network rule.
... | [
"Updates",
"the",
"specified",
"virtual",
"network",
"rule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRulesInner.java#L538-L545 |
foundation-runtime/service-directory | 1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/lookup/DirectoryLookupService.java | DirectoryLookupService.addNotificationHandler | public void addNotificationHandler(String serviceName, NotificationHandler handler) {
"""
Add a NotificationHandler to the Service.
<p/>
This method checks the duplicated NotificationHandler for the serviceName, if the NotificationHandler
already exists for the serviceName, do nothing.
@param serviceName the... | java | public void addNotificationHandler(String serviceName, NotificationHandler handler) {
ServiceInstanceUtils.validateServiceName(serviceName);
if (handler == null) {
throw new ServiceException(ErrorCode.SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR,
ErrorCode.SERVICE_DIRECTORY_NUL... | [
"public",
"void",
"addNotificationHandler",
"(",
"String",
"serviceName",
",",
"NotificationHandler",
"handler",
")",
"{",
"ServiceInstanceUtils",
".",
"validateServiceName",
"(",
"serviceName",
")",
";",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"throw",
"new... | Add a NotificationHandler to the Service.
<p/>
This method checks the duplicated NotificationHandler for the serviceName, if the NotificationHandler
already exists for the serviceName, do nothing.
@param serviceName the service name.
@param handler the NotificationHandler for the service. | [
"Add",
"a",
"NotificationHandler",
"to",
"the",
"Service",
".",
"<p",
"/",
">",
"This",
"method",
"checks",
"the",
"duplicated",
"NotificationHandler",
"for",
"the",
"serviceName",
"if",
"the",
"NotificationHandler",
"already",
"exists",
"for",
"the",
"serviceName... | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/lookup/DirectoryLookupService.java#L411-L432 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/LongStream.java | LongStream.findLast | @NotNull
public OptionalLong findLast() {
"""
Returns the last element wrapped by {@code OptionalLong} class.
If stream is empty, returns {@code OptionalLong.empty()}.
<p>This is a short-circuiting terminal operation.
@return an {@code OptionalLong} with the last element
or {@code OptionalLong.empty()}... | java | @NotNull
public OptionalLong findLast() {
return reduce(new LongBinaryOperator() {
@Override
public long applyAsLong(long left, long right) {
return right;
}
});
} | [
"@",
"NotNull",
"public",
"OptionalLong",
"findLast",
"(",
")",
"{",
"return",
"reduce",
"(",
"new",
"LongBinaryOperator",
"(",
")",
"{",
"@",
"Override",
"public",
"long",
"applyAsLong",
"(",
"long",
"left",
",",
"long",
"right",
")",
"{",
"return",
"righ... | Returns the last element wrapped by {@code OptionalLong} class.
If stream is empty, returns {@code OptionalLong.empty()}.
<p>This is a short-circuiting terminal operation.
@return an {@code OptionalLong} with the last element
or {@code OptionalLong.empty()} if the stream is empty
@since 1.1.8 | [
"Returns",
"the",
"last",
"element",
"wrapped",
"by",
"{",
"@code",
"OptionalLong",
"}",
"class",
".",
"If",
"stream",
"is",
"empty",
"returns",
"{",
"@code",
"OptionalLong",
".",
"empty",
"()",
"}",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/LongStream.java#L1165-L1173 |
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.deleteCustomEntityRoleAsync | public Observable<OperationStatus> deleteCustomEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) {
"""
Delete an entity role.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role Id.
@throws IllegalArgumentExce... | java | public Observable<OperationStatus> deleteCustomEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) {
return deleteCustomEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Override
... | [
"public",
"Observable",
"<",
"OperationStatus",
">",
"deleteCustomEntityRoleAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"deleteCustomEntityRoleWithServiceResponseAsync",
"(",
"appId",
",... | Delete an entity role.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role Id.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatus object | [
"Delete",
"an",
"entity",
"role",
"."
] | 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#L13897-L13904 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/CatalogUtil.java | CatalogUtil.getAutoGenDDLFromJar | public static String getAutoGenDDLFromJar(InMemoryJarfile jarfile)
throws IOException {
"""
Get the auto generated DDL from the catalog jar.
@param jarfile in-memory catalog jar file
@return Auto generated DDL stored in catalog.jar
@throws IOException If the catalog or the auto generated ddl canno... | java | public static String getAutoGenDDLFromJar(InMemoryJarfile jarfile)
throws IOException
{
// Read the raw auto generated ddl bytes.
byte[] ddlBytes = jarfile.get(VoltCompiler.AUTOGEN_DDL_FILE_NAME);
if (ddlBytes == null) {
throw new IOException("Auto generated schema DD... | [
"public",
"static",
"String",
"getAutoGenDDLFromJar",
"(",
"InMemoryJarfile",
"jarfile",
")",
"throws",
"IOException",
"{",
"// Read the raw auto generated ddl bytes.",
"byte",
"[",
"]",
"ddlBytes",
"=",
"jarfile",
".",
"get",
"(",
"VoltCompiler",
".",
"AUTOGEN_DDL_FILE... | Get the auto generated DDL from the catalog jar.
@param jarfile in-memory catalog jar file
@return Auto generated DDL stored in catalog.jar
@throws IOException If the catalog or the auto generated ddl cannot be loaded. | [
"Get",
"the",
"auto",
"generated",
"DDL",
"from",
"the",
"catalog",
"jar",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/CatalogUtil.java#L337-L347 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_antihack_ipBlocked_GET | public OvhBlockedIp ip_antihack_ipBlocked_GET(String ip, String ipBlocked) throws IOException {
"""
Get this object properties
REST: GET /ip/{ip}/antihack/{ipBlocked}
@param ip [required]
@param ipBlocked [required] your IP
"""
String qPath = "/ip/{ip}/antihack/{ipBlocked}";
StringBuilder sb = path(qP... | java | public OvhBlockedIp ip_antihack_ipBlocked_GET(String ip, String ipBlocked) throws IOException {
String qPath = "/ip/{ip}/antihack/{ipBlocked}";
StringBuilder sb = path(qPath, ip, ipBlocked);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhBlockedIp.class);
} | [
"public",
"OvhBlockedIp",
"ip_antihack_ipBlocked_GET",
"(",
"String",
"ip",
",",
"String",
"ipBlocked",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/antihack/{ipBlocked}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"ip",
... | Get this object properties
REST: GET /ip/{ip}/antihack/{ipBlocked}
@param ip [required]
@param ipBlocked [required] your IP | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L873-L878 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java | VelocityUtil.getContent | public static String getContent(VelocityEngine ve, String templateFileName, VelocityContext context) {
"""
获得指定模板填充后的内容
@param ve 模板引擎
@param templateFileName 模板名称
@param context 上下文(变量值的容器)
@return 模板和内容匹配后的内容
"""
final StringWriter writer = new StringWriter(); // StringWriter不需要关闭
toWriter(ve, te... | java | public static String getContent(VelocityEngine ve, String templateFileName, VelocityContext context) {
final StringWriter writer = new StringWriter(); // StringWriter不需要关闭
toWriter(ve, templateFileName, context, writer);
return writer.toString();
} | [
"public",
"static",
"String",
"getContent",
"(",
"VelocityEngine",
"ve",
",",
"String",
"templateFileName",
",",
"VelocityContext",
"context",
")",
"{",
"final",
"StringWriter",
"writer",
"=",
"new",
"StringWriter",
"(",
")",
";",
"// StringWriter不需要关闭\r",
"toWriter... | 获得指定模板填充后的内容
@param ve 模板引擎
@param templateFileName 模板名称
@param context 上下文(变量值的容器)
@return 模板和内容匹配后的内容 | [
"获得指定模板填充后的内容"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java#L114-L118 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.toSpreadMap | public static SpreadMap toSpreadMap(Iterable self) {
"""
Creates a spreadable map from this iterable.
<p>
@param self an iterable
@return a newly created SpreadMap
@see groovy.lang.SpreadMap#SpreadMap(java.util.List)
@see #toSpreadMap(java.util.Map)
@since 2.4.0
"""
if (self == null)
... | java | public static SpreadMap toSpreadMap(Iterable self) {
if (self == null)
throw new GroovyRuntimeException("Fail to convert Iterable to SpreadMap, because it is null.");
else
return toSpreadMap(asList(self));
} | [
"public",
"static",
"SpreadMap",
"toSpreadMap",
"(",
"Iterable",
"self",
")",
"{",
"if",
"(",
"self",
"==",
"null",
")",
"throw",
"new",
"GroovyRuntimeException",
"(",
"\"Fail to convert Iterable to SpreadMap, because it is null.\"",
")",
";",
"else",
"return",
"toSpr... | Creates a spreadable map from this iterable.
<p>
@param self an iterable
@return a newly created SpreadMap
@see groovy.lang.SpreadMap#SpreadMap(java.util.List)
@see #toSpreadMap(java.util.Map)
@since 2.4.0 | [
"Creates",
"a",
"spreadable",
"map",
"from",
"this",
"iterable",
".",
"<p",
">"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L8577-L8582 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.putAt | public static void putAt(List self, IntRange range, Collection col) {
"""
List subscript assignment operator when given a range as the index and
the assignment operand is a collection.
Example: <pre class="groovyTestCase">def myList = [4, 3, 5, 1, 2, 8, 10]
myList[3..5] = ["a", true]
assert myList == [4, 3, 5,... | java | public static void putAt(List self, IntRange range, Collection col) {
List sublist = resizeListWithRangeAndGetSublist(self, range);
if (col.isEmpty()) return;
sublist.addAll(col);
} | [
"public",
"static",
"void",
"putAt",
"(",
"List",
"self",
",",
"IntRange",
"range",
",",
"Collection",
"col",
")",
"{",
"List",
"sublist",
"=",
"resizeListWithRangeAndGetSublist",
"(",
"self",
",",
"range",
")",
";",
"if",
"(",
"col",
".",
"isEmpty",
"(",
... | List subscript assignment operator when given a range as the index and
the assignment operand is a collection.
Example: <pre class="groovyTestCase">def myList = [4, 3, 5, 1, 2, 8, 10]
myList[3..5] = ["a", true]
assert myList == [4, 3, 5, "a", true, 10]</pre>
Items in the given
range are replaced with items from the co... | [
"List",
"subscript",
"assignment",
"operator",
"when",
"given",
"a",
"range",
"as",
"the",
"index",
"and",
"the",
"assignment",
"operand",
"is",
"a",
"collection",
".",
"Example",
":",
"<pre",
"class",
"=",
"groovyTestCase",
">",
"def",
"myList",
"=",
"[",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L8044-L8048 |
azkaban/azkaban | az-core/src/main/java/azkaban/utils/Props.java | Props.getUri | public URI getUri(final String name, final URI defaultValue) {
"""
Returns the double representation of the value. If the value is null, then the default value is
returned. If the value isn't a uri, then a IllegalArgumentException will be thrown.
"""
if (containsKey(name)) {
return getUri(name);
... | java | public URI getUri(final String name, final URI defaultValue) {
if (containsKey(name)) {
return getUri(name);
} else {
return defaultValue;
}
} | [
"public",
"URI",
"getUri",
"(",
"final",
"String",
"name",
",",
"final",
"URI",
"defaultValue",
")",
"{",
"if",
"(",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"getUri",
"(",
"name",
")",
";",
"}",
"else",
"{",
"return",
"defaultValue",
";",
... | Returns the double representation of the value. If the value is null, then the default value is
returned. If the value isn't a uri, then a IllegalArgumentException will be thrown. | [
"Returns",
"the",
"double",
"representation",
"of",
"the",
"value",
".",
"If",
"the",
"value",
"is",
"null",
"then",
"the",
"default",
"value",
"is",
"returned",
".",
"If",
"the",
"value",
"isn",
"t",
"a",
"uri",
"then",
"a",
"IllegalArgumentException",
"w... | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L629-L635 |
libgdx/box2dlights | src/box2dLight/RayHandler.java | RayHandler.useCustomViewport | public void useCustomViewport(int x, int y, int width, int height) {
"""
Sets rendering to custom viewport with specified position and size
<p>Note: you will be responsible for update of viewport via this method
in case of any changes (on resize)
"""
customViewport = true;
viewportX = x;
viewportY = y;... | java | public void useCustomViewport(int x, int y, int width, int height) {
customViewport = true;
viewportX = x;
viewportY = y;
viewportWidth = width;
viewportHeight = height;
} | [
"public",
"void",
"useCustomViewport",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"customViewport",
"=",
"true",
";",
"viewportX",
"=",
"x",
";",
"viewportY",
"=",
"y",
";",
"viewportWidth",
"=",
"width",
";"... | Sets rendering to custom viewport with specified position and size
<p>Note: you will be responsible for update of viewport via this method
in case of any changes (on resize) | [
"Sets",
"rendering",
"to",
"custom",
"viewport",
"with",
"specified",
"position",
"and",
"size",
"<p",
">",
"Note",
":",
"you",
"will",
"be",
"responsible",
"for",
"update",
"of",
"viewport",
"via",
"this",
"method",
"in",
"case",
"of",
"any",
"changes",
"... | train | https://github.com/libgdx/box2dlights/blob/08cf93a41464f71d32475aaa2fe280dc6af78ff3/src/box2dLight/RayHandler.java#L594-L600 |
io7m/jaffirm | com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Preconditions.java | Preconditions.checkPreconditionI | public static int checkPreconditionI(
final int value,
final IntPredicate predicate,
final IntFunction<String> describer) {
"""
An {@code int} specialized version of {@link #checkPrecondition(Object,
ContractConditionType)}.
@param value The value
@param predicate The predicate
@param describ... | java | public static int checkPreconditionI(
final int value,
final IntPredicate predicate,
final IntFunction<String> describer)
{
final boolean ok;
try {
ok = predicate.test(value);
} catch (final Throwable e) {
final Violations violations = singleViolation(failedPredicate(e));
thr... | [
"public",
"static",
"int",
"checkPreconditionI",
"(",
"final",
"int",
"value",
",",
"final",
"IntPredicate",
"predicate",
",",
"final",
"IntFunction",
"<",
"String",
">",
"describer",
")",
"{",
"final",
"boolean",
"ok",
";",
"try",
"{",
"ok",
"=",
"predicate... | An {@code int} specialized version of {@link #checkPrecondition(Object,
ContractConditionType)}.
@param value The value
@param predicate The predicate
@param describer The describer for the predicate
@return value
@throws PreconditionViolationException If the predicate is false | [
"An",
"{",
"@code",
"int",
"}",
"specialized",
"version",
"of",
"{",
"@link",
"#checkPrecondition",
"(",
"Object",
"ContractConditionType",
")",
"}",
"."
] | train | https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Preconditions.java#L377-L392 |
hazelcast/hazelcast-kubernetes | src/main/java/com/hazelcast/kubernetes/RetryUtils.java | RetryUtils.retry | public static <T> T retry(Callable<T> callable, int retries, List<String> nonRetryableKeywords) {
"""
Calls {@code callable.call()} until it does not throw an exception (but no more than {@code retries} times).
<p>
Note that {@code callable} should be an idempotent operation which is a call to the Kubernetes mas... | java | public static <T> T retry(Callable<T> callable, int retries, List<String> nonRetryableKeywords) {
int retryCount = 0;
while (true) {
try {
return callable.call();
} catch (Exception e) {
retryCount++;
if (retryCount > retries || con... | [
"public",
"static",
"<",
"T",
">",
"T",
"retry",
"(",
"Callable",
"<",
"T",
">",
"callable",
",",
"int",
"retries",
",",
"List",
"<",
"String",
">",
"nonRetryableKeywords",
")",
"{",
"int",
"retryCount",
"=",
"0",
";",
"while",
"(",
"true",
")",
"{",... | Calls {@code callable.call()} until it does not throw an exception (but no more than {@code retries} times).
<p>
Note that {@code callable} should be an idempotent operation which is a call to the Kubernetes master.
<p>
If {@code callable} throws an unchecked exception, it is wrapped into {@link HazelcastException}. | [
"Calls",
"{"
] | train | https://github.com/hazelcast/hazelcast-kubernetes/blob/b1144067addf56d1446a9e1007f5cb3290b86815/src/main/java/com/hazelcast/kubernetes/RetryUtils.java#L49-L66 |
google/auto | service/processor/src/main/java/com/google/auto/service/processor/AutoServiceProcessor.java | AutoServiceProcessor.getValueFieldOfClasses | private ImmutableSet<DeclaredType> getValueFieldOfClasses(AnnotationMirror annotationMirror) {
"""
Returns the contents of a {@code Class[]}-typed "value" field in a given {@code annotationMirror}.
"""
return getAnnotationValue(annotationMirror, "value")
.accept(
new SimpleAnnotationVal... | java | private ImmutableSet<DeclaredType> getValueFieldOfClasses(AnnotationMirror annotationMirror) {
return getAnnotationValue(annotationMirror, "value")
.accept(
new SimpleAnnotationValueVisitor8<ImmutableSet<DeclaredType>, Void>() {
@Override
public ImmutableSet<DeclaredT... | [
"private",
"ImmutableSet",
"<",
"DeclaredType",
">",
"getValueFieldOfClasses",
"(",
"AnnotationMirror",
"annotationMirror",
")",
"{",
"return",
"getAnnotationValue",
"(",
"annotationMirror",
",",
"\"value\"",
")",
".",
"accept",
"(",
"new",
"SimpleAnnotationValueVisitor8"... | Returns the contents of a {@code Class[]}-typed "value" field in a given {@code annotationMirror}. | [
"Returns",
"the",
"contents",
"of",
"a",
"{"
] | train | https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/service/processor/src/main/java/com/google/auto/service/processor/AutoServiceProcessor.java#L258-L279 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java | RTFEmbeddedObject.readDataBlock | private static int readDataBlock(String text, int offset, int length, List<byte[]> blocks) {
"""
Reads a data block and adds it to the list of blocks.
@param text RTF data
@param offset current offset
@param length next block length
@param blocks list of blocks
@return next offset
"""
int bytes = ... | java | private static int readDataBlock(String text, int offset, int length, List<byte[]> blocks)
{
int bytes = length / 2;
byte[] data = new byte[bytes];
for (int index = 0; index < bytes; index++)
{
data[index] = (byte) Integer.parseInt(text.substring(offset, offset + 2), 16);
o... | [
"private",
"static",
"int",
"readDataBlock",
"(",
"String",
"text",
",",
"int",
"offset",
",",
"int",
"length",
",",
"List",
"<",
"byte",
"[",
"]",
">",
"blocks",
")",
"{",
"int",
"bytes",
"=",
"length",
"/",
"2",
";",
"byte",
"[",
"]",
"data",
"="... | Reads a data block and adds it to the list of blocks.
@param text RTF data
@param offset current offset
@param length next block length
@param blocks list of blocks
@return next offset | [
"Reads",
"a",
"data",
"block",
"and",
"adds",
"it",
"to",
"the",
"list",
"of",
"blocks",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java#L369-L382 |
vtatai/srec | core/src/main/java/com/github/srec/util/Utils.java | Utils.groovyEvaluate | public static Object groovyEvaluate(ExecutionContext context, String expression) {
"""
Evaluates an expression using Groovy. All VarCommands inside the context are used in order to evaluate the given
expression.
@param context The EC
@param expression The expression to evaluate
@return The value
"""
... | java | public static Object groovyEvaluate(ExecutionContext context, String expression) {
Binding binding = new Binding();
for (Map.Entry<String, CommandSymbol> entry : context.getSymbols().entrySet()) {
final CommandSymbol symbol = entry.getValue();
if (symbol instanceof VarCommand) {
... | [
"public",
"static",
"Object",
"groovyEvaluate",
"(",
"ExecutionContext",
"context",
",",
"String",
"expression",
")",
"{",
"Binding",
"binding",
"=",
"new",
"Binding",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"CommandSymbol",
">",
... | Evaluates an expression using Groovy. All VarCommands inside the context are used in order to evaluate the given
expression.
@param context The EC
@param expression The expression to evaluate
@return The value | [
"Evaluates",
"an",
"expression",
"using",
"Groovy",
".",
"All",
"VarCommands",
"inside",
"the",
"context",
"are",
"used",
"in",
"order",
"to",
"evaluate",
"the",
"given",
"expression",
"."
] | train | https://github.com/vtatai/srec/blob/87fa6754a6a5f8569ef628db4d149eea04062568/core/src/main/java/com/github/srec/util/Utils.java#L243-L257 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java | Utils.isSubclassOf | public boolean isSubclassOf(TypeElement t1, TypeElement t2) {
"""
Test whether a class is a subclass of another class.
@param t1 the candidate superclass.
@param t2 the target
@return true if t1 is a superclass of t2.
"""
return typeUtils.isSubtype(t1.asType(), t2.asType());
} | java | public boolean isSubclassOf(TypeElement t1, TypeElement t2) {
return typeUtils.isSubtype(t1.asType(), t2.asType());
} | [
"public",
"boolean",
"isSubclassOf",
"(",
"TypeElement",
"t1",
",",
"TypeElement",
"t2",
")",
"{",
"return",
"typeUtils",
".",
"isSubtype",
"(",
"t1",
".",
"asType",
"(",
")",
",",
"t2",
".",
"asType",
"(",
")",
")",
";",
"}"
] | Test whether a class is a subclass of another class.
@param t1 the candidate superclass.
@param t2 the target
@return true if t1 is a superclass of t2. | [
"Test",
"whether",
"a",
"class",
"is",
"a",
"subclass",
"of",
"another",
"class",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java#L216-L218 |
roskenet/springboot-javafx-support | src/main/java/de/felixroske/jfxsupport/AbstractFxmlView.java | AbstractFxmlView.loadSynchronously | private FXMLLoader loadSynchronously(final URL resource, final Optional<ResourceBundle> bundle) throws IllegalStateException {
"""
Load synchronously.
@param resource
the resource
@param bundle
the bundle
@return the FXML loader
@throws IllegalStateException
the illegal state exception
"""
final FX... | java | private FXMLLoader loadSynchronously(final URL resource, final Optional<ResourceBundle> bundle) throws IllegalStateException {
final FXMLLoader loader = new FXMLLoader(resource, bundle.orElse(null));
loader.setControllerFactory(this::createControllerForType);
try {
loader.load();
} catch (final IOException... | [
"private",
"FXMLLoader",
"loadSynchronously",
"(",
"final",
"URL",
"resource",
",",
"final",
"Optional",
"<",
"ResourceBundle",
">",
"bundle",
")",
"throws",
"IllegalStateException",
"{",
"final",
"FXMLLoader",
"loader",
"=",
"new",
"FXMLLoader",
"(",
"resource",
... | Load synchronously.
@param resource
the resource
@param bundle
the bundle
@return the FXML loader
@throws IllegalStateException
the illegal state exception | [
"Load",
"synchronously",
"."
] | train | https://github.com/roskenet/springboot-javafx-support/blob/aed1da178ecb204eb00508b3ce1e2a11d4fa9619/src/main/java/de/felixroske/jfxsupport/AbstractFxmlView.java#L153-L165 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernel.java | FactoryKernel.table1D_F32 | public static Kernel1D_F32 table1D_F32(int radius, boolean normalized) {
"""
<p>
Create an floating point table convolution kernel. If un-normalized then all
the elements are equal to one, otherwise they are equal to one over the width.
</p>
<p>
See {@link boofcv.alg.filter.convolve.ConvolveImageBox} or {@... | java | public static Kernel1D_F32 table1D_F32(int radius, boolean normalized) {
Kernel1D_F32 ret = new Kernel1D_F32(radius * 2 + 1);
float val = normalized ? 1.0f / ret.width : 1.0f;
for (int i = 0; i < ret.data.length; i++) {
ret.data[i] = val;
}
return ret;
} | [
"public",
"static",
"Kernel1D_F32",
"table1D_F32",
"(",
"int",
"radius",
",",
"boolean",
"normalized",
")",
"{",
"Kernel1D_F32",
"ret",
"=",
"new",
"Kernel1D_F32",
"(",
"radius",
"*",
"2",
"+",
"1",
")",
";",
"float",
"val",
"=",
"normalized",
"?",
"1.0f",... | <p>
Create an floating point table convolution kernel. If un-normalized then all
the elements are equal to one, otherwise they are equal to one over the width.
</p>
<p>
See {@link boofcv.alg.filter.convolve.ConvolveImageBox} or {@link boofcv.alg.filter.convolve.ConvolveImageMean} for faster ways to convolve these ker... | [
"<p",
">",
"Create",
"an",
"floating",
"point",
"table",
"convolution",
"kernel",
".",
"If",
"un",
"-",
"normalized",
"then",
"all",
"the",
"elements",
"are",
"equal",
"to",
"one",
"otherwise",
"they",
"are",
"equal",
"to",
"one",
"over",
"the",
"width",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernel.java#L152-L162 |
actframework/actframework | src/main/java/act/ws/WebSocketContext.java | WebSocketContext.sendToTagged | public WebSocketContext sendToTagged(String message, String tag) {
"""
Send message to all connections labeled with tag specified
with self connection excluded
@param message the message to be sent
@param tag the string that tag the connections to be sent
@return this context
"""
return sendToTag... | java | public WebSocketContext sendToTagged(String message, String tag) {
return sendToTagged(message, tag, false);
} | [
"public",
"WebSocketContext",
"sendToTagged",
"(",
"String",
"message",
",",
"String",
"tag",
")",
"{",
"return",
"sendToTagged",
"(",
"message",
",",
"tag",
",",
"false",
")",
";",
"}"
] | Send message to all connections labeled with tag specified
with self connection excluded
@param message the message to be sent
@param tag the string that tag the connections to be sent
@return this context | [
"Send",
"message",
"to",
"all",
"connections",
"labeled",
"with",
"tag",
"specified",
"with",
"self",
"connection",
"excluded"
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/ws/WebSocketContext.java#L220-L222 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsADESessionCache.java | CmsADESessionCache.getTemplateBean | public TemplateBean getTemplateBean(String uri, boolean safe) {
"""
Gets the cached template bean for a given container page uri.<p>
@param uri the container page uri
@param safe if true, return a valid template bean even if it hasn't been cached before
@return the template bean
"""
TemplateBea... | java | public TemplateBean getTemplateBean(String uri, boolean safe) {
TemplateBean templateBean = m_templateBeanCache.get(uri);
if ((templateBean != null) || !safe) {
return templateBean;
}
return new TemplateBean("", "");
} | [
"public",
"TemplateBean",
"getTemplateBean",
"(",
"String",
"uri",
",",
"boolean",
"safe",
")",
"{",
"TemplateBean",
"templateBean",
"=",
"m_templateBeanCache",
".",
"get",
"(",
"uri",
")",
";",
"if",
"(",
"(",
"templateBean",
"!=",
"null",
")",
"||",
"!",
... | Gets the cached template bean for a given container page uri.<p>
@param uri the container page uri
@param safe if true, return a valid template bean even if it hasn't been cached before
@return the template bean | [
"Gets",
"the",
"cached",
"template",
"bean",
"for",
"a",
"given",
"container",
"page",
"uri",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsADESessionCache.java#L371-L378 |
azkaban/azkaban | az-core/src/main/java/azkaban/metrics/MetricsManager.java | MetricsManager.addGauge | public <T> void addGauge(final String name, final Supplier<T> gaugeFunc) {
"""
A {@link Gauge} is an instantaneous reading of a particular value. This method leverages
Supplier, a Functional Interface, to get Generics metrics values. With this support, no matter
what our interesting metrics is a Double or a Long... | java | public <T> void addGauge(final String name, final Supplier<T> gaugeFunc) {
this.registry.register(name, (Gauge<T>) gaugeFunc::get);
} | [
"public",
"<",
"T",
">",
"void",
"addGauge",
"(",
"final",
"String",
"name",
",",
"final",
"Supplier",
"<",
"T",
">",
"gaugeFunc",
")",
"{",
"this",
".",
"registry",
".",
"register",
"(",
"name",
",",
"(",
"Gauge",
"<",
"T",
">",
")",
"gaugeFunc",
... | A {@link Gauge} is an instantaneous reading of a particular value. This method leverages
Supplier, a Functional Interface, to get Generics metrics values. With this support, no matter
what our interesting metrics is a Double or a Long, we could pass it to Metrics Parser.
E.g., in {@link CommonMetrics#setupAllMetrics()... | [
"A",
"{",
"@link",
"Gauge",
"}",
"is",
"an",
"instantaneous",
"reading",
"of",
"a",
"particular",
"value",
".",
"This",
"method",
"leverages",
"Supplier",
"a",
"Functional",
"Interface",
"to",
"get",
"Generics",
"metrics",
"values",
".",
"With",
"this",
"sup... | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/metrics/MetricsManager.java#L80-L82 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java | AbstractFrameModelingVisitor.modelNormalInstruction | public void modelNormalInstruction(Instruction ins, int numWordsConsumed, int numWordsProduced) {
"""
Model the stack for instructions handled by handleNormalInstruction().
Subclasses may override to provide analysis-specific behavior.
@param ins
the Instruction to model
@param numWordsConsumed
number of st... | java | public void modelNormalInstruction(Instruction ins, int numWordsConsumed, int numWordsProduced) {
modelInstruction(ins, numWordsConsumed, numWordsProduced, getDefaultValue());
} | [
"public",
"void",
"modelNormalInstruction",
"(",
"Instruction",
"ins",
",",
"int",
"numWordsConsumed",
",",
"int",
"numWordsProduced",
")",
"{",
"modelInstruction",
"(",
"ins",
",",
"numWordsConsumed",
",",
"numWordsProduced",
",",
"getDefaultValue",
"(",
")",
")",
... | Model the stack for instructions handled by handleNormalInstruction().
Subclasses may override to provide analysis-specific behavior.
@param ins
the Instruction to model
@param numWordsConsumed
number of stack words consumed
@param numWordsProduced
number of stack words produced | [
"Model",
"the",
"stack",
"for",
"instructions",
"handled",
"by",
"handleNormalInstruction",
"()",
".",
"Subclasses",
"may",
"override",
"to",
"provide",
"analysis",
"-",
"specific",
"behavior",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java#L373-L375 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseSroti | public static int cusparseSroti(
cusparseHandle handle,
int nnz,
Pointer xVal,
Pointer xInd,
Pointer y,
Pointer c,
Pointer s,
int idxBase) {
"""
Description: Givens rotation, where c and s are cosine and sine,
x and y are sparse and de... | java | public static int cusparseSroti(
cusparseHandle handle,
int nnz,
Pointer xVal,
Pointer xInd,
Pointer y,
Pointer c,
Pointer s,
int idxBase)
{
return checkResult(cusparseSrotiNative(handle, nnz, xVal, xInd, y, c, s, idxBase));
... | [
"public",
"static",
"int",
"cusparseSroti",
"(",
"cusparseHandle",
"handle",
",",
"int",
"nnz",
",",
"Pointer",
"xVal",
",",
"Pointer",
"xInd",
",",
"Pointer",
"y",
",",
"Pointer",
"c",
",",
"Pointer",
"s",
",",
"int",
"idxBase",
")",
"{",
"return",
"che... | Description: Givens rotation, where c and s are cosine and sine,
x and y are sparse and dense vectors, respectively. | [
"Description",
":",
"Givens",
"rotation",
"where",
"c",
"and",
"s",
"are",
"cosine",
"and",
"sine",
"x",
"and",
"y",
"are",
"sparse",
"and",
"dense",
"vectors",
"respectively",
"."
] | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L1090-L1101 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/up/SignupFormPanel.java | SignupFormPanel.newForm | @SuppressWarnings( {
"""
Factory method for creating the Form. This method is invoked in the constructor from the
derived classes and can be overridden so users can provide their own version of a Form.
@param id
the id
@param model
the model
@return the form
""" "unchecked", "rawtypes" })
protected Fo... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
protected Form<?> newForm(final String id,
final IModel<? extends BaseUsernameSignUpModel> model)
{
return new Form(id, model);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"protected",
"Form",
"<",
"?",
">",
"newForm",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"?",
"extends",
"BaseUsernameSignUpModel",
">",
"model",
")",
"{",
... | Factory method for creating the Form. This method is invoked in the constructor from the
derived classes and can be overridden so users can provide their own version of a Form.
@param id
the id
@param model
the model
@return the form | [
"Factory",
"method",
"for",
"creating",
"the",
"Form",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",
"their",
"own",
"version",
"of"... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/up/SignupFormPanel.java#L155-L160 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java | ArrayUtil.setOrAppend | public static Object setOrAppend(Object array, int index, Object value) {
"""
将元素值设置为数组的某个位置,当给定的index大于数组长度,则追加
@param array 已有数组
@param index 位置,大于长度追加,否则替换
@param value 新值
@return 新数组或原有数组
@since 4.1.2
"""
if(index < length(array)) {
Array.set(array, index, value);
return array;
}else {... | java | public static Object setOrAppend(Object array, int index, Object value) {
if(index < length(array)) {
Array.set(array, index, value);
return array;
}else {
return append(array, value);
}
} | [
"public",
"static",
"Object",
"setOrAppend",
"(",
"Object",
"array",
",",
"int",
"index",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"index",
"<",
"length",
"(",
"array",
")",
")",
"{",
"Array",
".",
"set",
"(",
"array",
",",
"index",
",",
"value",... | 将元素值设置为数组的某个位置,当给定的index大于数组长度,则追加
@param array 已有数组
@param index 位置,大于长度追加,否则替换
@param value 新值
@return 新数组或原有数组
@since 4.1.2 | [
"将元素值设置为数组的某个位置,当给定的index大于数组长度,则追加"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L435-L442 |
fabric8io/fabric8-forge | addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java | MavenHelpers.ensureMavenDependencyAdded | public static boolean ensureMavenDependencyAdded(Project project, DependencyInstaller dependencyInstaller, String groupId, String artifactId, String scope) {
"""
Returns true if the dependency was added or false if its already there
"""
List<Dependency> dependencies = project.getFacet(DependencyFacet.c... | java | public static boolean ensureMavenDependencyAdded(Project project, DependencyInstaller dependencyInstaller, String groupId, String artifactId, String scope) {
List<Dependency> dependencies = project.getFacet(DependencyFacet.class).getEffectiveDependencies();
for (Dependency d : dependencies) {
... | [
"public",
"static",
"boolean",
"ensureMavenDependencyAdded",
"(",
"Project",
"project",
",",
"DependencyInstaller",
"dependencyInstaller",
",",
"String",
"groupId",
",",
"String",
"artifactId",
",",
"String",
"scope",
")",
"{",
"List",
"<",
"Dependency",
">",
"depen... | Returns true if the dependency was added or false if its already there | [
"Returns",
"true",
"if",
"the",
"dependency",
"was",
"added",
"or",
"false",
"if",
"its",
"already",
"there"
] | train | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java#L121-L147 |
zaproxy/zaproxy | src/org/zaproxy/zap/utils/FontUtils.java | FontUtils.getFont | public static Font getFont (Font font, int style, Size size) {
"""
Gets the specified font with the specified style and size, correctly scaled
@param style
@param size
@since 2.7.0
@return
"""
return getFont(font, size).deriveFont(style);
} | java | public static Font getFont (Font font, int style, Size size) {
return getFont(font, size).deriveFont(style);
} | [
"public",
"static",
"Font",
"getFont",
"(",
"Font",
"font",
",",
"int",
"style",
",",
"Size",
"size",
")",
"{",
"return",
"getFont",
"(",
"font",
",",
"size",
")",
".",
"deriveFont",
"(",
"style",
")",
";",
"}"
] | Gets the specified font with the specified style and size, correctly scaled
@param style
@param size
@since 2.7.0
@return | [
"Gets",
"the",
"specified",
"font",
"with",
"the",
"specified",
"style",
"and",
"size",
"correctly",
"scaled"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/FontUtils.java#L190-L192 |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/NaryTreeNode.java | NaryTreeNode.addChild | public final boolean addChild(int index, N newChild) {
"""
Add a child node at the specified index.
@param index is the insertion index.
@param newChild is the new child to insert.
@return <code>true</code> on success, otherwise <code>false</code>
"""
if (newChild == null) {
return false;
}
fina... | java | public final boolean addChild(int index, N newChild) {
if (newChild == null) {
return false;
}
final int count = (this.children == null) ? 0 : this.children.size();
final N oldParent = newChild.getParentNode();
if (oldParent != this && oldParent != null) {
newChild.removeFromParent();
}
final int... | [
"public",
"final",
"boolean",
"addChild",
"(",
"int",
"index",
",",
"N",
"newChild",
")",
"{",
"if",
"(",
"newChild",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"final",
"int",
"count",
"=",
"(",
"this",
".",
"children",
"==",
"null",
")",
... | Add a child node at the specified index.
@param index is the insertion index.
@param newChild is the new child to insert.
@return <code>true</code> on success, otherwise <code>false</code> | [
"Add",
"a",
"child",
"node",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/NaryTreeNode.java#L341-L375 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbMemberTagsHandler.java | OjbMemberTagsHandler.isMethod | public void isMethod(String template, Properties attributes) throws XDocletException {
"""
The <code>isMethod</code> processes the template body if the current member is a method.
@param template a <code>String</code> value
@param attributes a <code>Properties</code> value
@exception X... | java | public void isMethod(String template, Properties attributes) throws XDocletException
{
if (getCurrentMethod() != null) {
generate(template);
}
} | [
"public",
"void",
"isMethod",
"(",
"String",
"template",
",",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"if",
"(",
"getCurrentMethod",
"(",
")",
"!=",
"null",
")",
"{",
"generate",
"(",
"template",
")",
";",
"}",
"}"
] | The <code>isMethod</code> processes the template body if the current member is a method.
@param template a <code>String</code> value
@param attributes a <code>Properties</code> value
@exception XDocletException if an error occurs
@doc:tag type="block" | [
"The",
"<code",
">",
"isMethod<",
"/",
"code",
">",
"processes",
"the",
"template",
"body",
"if",
"the",
"current",
"member",
"is",
"a",
"method",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbMemberTagsHandler.java#L134-L139 |
baratine/baratine | web/src/main/java/com/caucho/v5/io/SocketStream.java | SocketStream.readTimeout | @Override
public int readTimeout(byte []buf, int offset, int length, long timeout)
throws IOException {
"""
Reads bytes from the socket.
@param buf byte buffer receiving the bytes
@param offset offset into the buffer
@param length number of bytes to read
@return number of bytes read or -1
@exception t... | java | @Override
public int readTimeout(byte []buf, int offset, int length, long timeout)
throws IOException
{
Socket s = _s;
if (s == null) {
return -1;
}
int oldTimeout = s.getSoTimeout();
s.setSoTimeout((int) timeout);
try {
int result = read(buf, offset, length)... | [
"@",
"Override",
"public",
"int",
"readTimeout",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"offset",
",",
"int",
"length",
",",
"long",
"timeout",
")",
"throws",
"IOException",
"{",
"Socket",
"s",
"=",
"_s",
";",
"if",
"(",
"s",
"==",
"null",
")",
... | Reads bytes from the socket.
@param buf byte buffer receiving the bytes
@param offset offset into the buffer
@param length number of bytes to read
@return number of bytes read or -1
@exception throws ClientDisconnectException if the connection is dropped | [
"Reads",
"bytes",
"from",
"the",
"socket",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/SocketStream.java#L242-L270 |
steveash/jopenfst | src/main/java/com/github/steveash/jopenfst/operations/Determinize.java | Determinize.computeFinalWeight | private double computeFinalWeight(final int outputStateId,
final DetStateTuple targetTuple,
Deque<DetElement> finalQueue) {
"""
_this_ new outState a final state, and instead we queue it into a separate queue for later expansion
"""
Un... | java | private double computeFinalWeight(final int outputStateId,
final DetStateTuple targetTuple,
Deque<DetElement> finalQueue) {
UnionWeight<GallicWeight> result = this.unionSemiring.zero();
for (DetElement detElement : targetTuple.getElements()... | [
"private",
"double",
"computeFinalWeight",
"(",
"final",
"int",
"outputStateId",
",",
"final",
"DetStateTuple",
"targetTuple",
",",
"Deque",
"<",
"DetElement",
">",
"finalQueue",
")",
"{",
"UnionWeight",
"<",
"GallicWeight",
">",
"result",
"=",
"this",
".",
"uni... | _this_ new outState a final state, and instead we queue it into a separate queue for later expansion | [
"_this_",
"new",
"outState",
"a",
"final",
"state",
"and",
"instead",
"we",
"queue",
"it",
"into",
"a",
"separate",
"queue",
"for",
"later",
"expansion"
] | train | https://github.com/steveash/jopenfst/blob/4c675203015c1cfad2072556cb532b6edc73261d/src/main/java/com/github/steveash/jopenfst/operations/Determinize.java#L278-L303 |
lets-blade/blade | src/main/java/com/blade/kit/ConvertKit.java | ConvertKit.outputStream2String | public static String outputStream2String(final OutputStream out, final String charsetName) {
"""
outputStream转string按编码
@param out 输出流
@param charsetName 编码格式
@return 字符串
"""
if (out == null || isSpace(charsetName)) return null;
try {
return new String(outputStream2Byte... | java | public static String outputStream2String(final OutputStream out, final String charsetName) {
if (out == null || isSpace(charsetName)) return null;
try {
return new String(outputStream2Bytes(out), charsetName);
} catch (UnsupportedEncodingException e) {
e.printStackTrace()... | [
"public",
"static",
"String",
"outputStream2String",
"(",
"final",
"OutputStream",
"out",
",",
"final",
"String",
"charsetName",
")",
"{",
"if",
"(",
"out",
"==",
"null",
"||",
"isSpace",
"(",
"charsetName",
")",
")",
"return",
"null",
";",
"try",
"{",
"re... | outputStream转string按编码
@param out 输出流
@param charsetName 编码格式
@return 字符串 | [
"outputStream转string按编码"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/kit/ConvertKit.java#L372-L380 |
apereo/cas | support/cas-server-support-saml-idp-metadata/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/cache/resolver/BaseSamlRegisteredServiceMetadataResolver.java | BaseSamlRegisteredServiceMetadataResolver.addMetadataFiltersToMetadataResolver | protected void addMetadataFiltersToMetadataResolver(final AbstractMetadataResolver metadataProvider, final MetadataFilter... metadataFilterList) {
"""
Add metadata filters to metadata resolver.
@param metadataProvider the metadata provider
@param metadataFilterList the metadata filter list
"""
ad... | java | protected void addMetadataFiltersToMetadataResolver(final AbstractMetadataResolver metadataProvider, final MetadataFilter... metadataFilterList) {
addMetadataFiltersToMetadataResolver(metadataProvider, Arrays.stream(metadataFilterList).collect(Collectors.toList()));
} | [
"protected",
"void",
"addMetadataFiltersToMetadataResolver",
"(",
"final",
"AbstractMetadataResolver",
"metadataProvider",
",",
"final",
"MetadataFilter",
"...",
"metadataFilterList",
")",
"{",
"addMetadataFiltersToMetadataResolver",
"(",
"metadataProvider",
",",
"Arrays",
".",... | Add metadata filters to metadata resolver.
@param metadataProvider the metadata provider
@param metadataFilterList the metadata filter list | [
"Add",
"metadata",
"filters",
"to",
"metadata",
"resolver",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-idp-metadata/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/cache/resolver/BaseSamlRegisteredServiceMetadataResolver.java#L182-L184 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java | ClusterControllerClient.getCluster | public final Cluster getCluster(String projectId, String region, String clusterName) {
"""
Gets the resource representation for a cluster in a project.
<p>Sample code:
<pre><code>
try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
String projectId = "";
String regio... | java | public final Cluster getCluster(String projectId, String region, String clusterName) {
GetClusterRequest request =
GetClusterRequest.newBuilder()
.setProjectId(projectId)
.setRegion(region)
.setClusterName(clusterName)
.build();
return getCluster(request)... | [
"public",
"final",
"Cluster",
"getCluster",
"(",
"String",
"projectId",
",",
"String",
"region",
",",
"String",
"clusterName",
")",
"{",
"GetClusterRequest",
"request",
"=",
"GetClusterRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
"(",
"projectId",
... | Gets the resource representation for a cluster in a project.
<p>Sample code:
<pre><code>
try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
String projectId = "";
String region = "";
String clusterName = "";
Cluster response = clusterControllerClient.getCluster(projectId, regio... | [
"Gets",
"the",
"resource",
"representation",
"for",
"a",
"cluster",
"in",
"a",
"project",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java#L593-L602 |
paypal/SeLion | client/src/main/java/com/paypal/selion/internal/platform/pageyaml/GuiMapReaderFactory.java | GuiMapReaderFactory.getInstance | public static GuiMapReader getInstance(String pageDomain, String pageClassName) throws IOException {
"""
Method to get the reader instance depending on the input parameters.
@param pageDomain
domain folder under which the input data files are present.
@param pageClassName
Page class name. May not be <code>nu... | java | public static GuiMapReader getInstance(String pageDomain, String pageClassName) throws IOException {
logger.entering(new Object[]{pageDomain, pageClassName});
Preconditions.checkArgument(StringUtils.isNotBlank(pageClassName),
"pageClassName can not be null, empty, or whitespace");
... | [
"public",
"static",
"GuiMapReader",
"getInstance",
"(",
"String",
"pageDomain",
",",
"String",
"pageClassName",
")",
"throws",
"IOException",
"{",
"logger",
".",
"entering",
"(",
"new",
"Object",
"[",
"]",
"{",
"pageDomain",
",",
"pageClassName",
"}",
")",
";"... | Method to get the reader instance depending on the input parameters.
@param pageDomain
domain folder under which the input data files are present.
@param pageClassName
Page class name. May not be <code>null</code>, empty, or whitespace.
@return DataProvider instance
@throws IOException | [
"Method",
"to",
"get",
"the",
"reader",
"instance",
"depending",
"on",
"the",
"input",
"parameters",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/platform/pageyaml/GuiMapReaderFactory.java#L52-L82 |
Bernardo-MG/repository-pattern-java | src/main/java/com/wandrell/pattern/repository/jpa/JpaRepository.java | JpaRepository.buildQuery | private final Query buildQuery(final NamedParameterQueryData query) {
"""
Creates a {@code Query} from the data contained on the received
{@code QueryData}.
<p>
The string query contained on the {@code QueryData} will be transformed
into the {@code Query}, to which the parameters contained on that same
receiv... | java | private final Query buildQuery(final NamedParameterQueryData query) {
final Query builtQuery; // Query created from the query data
// Builds the base query
builtQuery = getEntityManager().createQuery(query.getQuery());
// Applies the parameters
for (final Entry<String, Object> ... | [
"private",
"final",
"Query",
"buildQuery",
"(",
"final",
"NamedParameterQueryData",
"query",
")",
"{",
"final",
"Query",
"builtQuery",
";",
"// Query created from the query data",
"// Builds the base query",
"builtQuery",
"=",
"getEntityManager",
"(",
")",
".",
"createQue... | Creates a {@code Query} from the data contained on the received
{@code QueryData}.
<p>
The string query contained on the {@code QueryData} will be transformed
into the {@code Query}, to which the parameters contained on that same
received object will be applied.
@param query
the base query
@return a {@code Query} crea... | [
"Creates",
"a",
"{",
"@code",
"Query",
"}",
"from",
"the",
"data",
"contained",
"on",
"the",
"received",
"{",
"@code",
"QueryData",
"}",
".",
"<p",
">",
"The",
"string",
"query",
"contained",
"on",
"the",
"{",
"@code",
"QueryData",
"}",
"will",
"be",
"... | train | https://github.com/Bernardo-MG/repository-pattern-java/blob/e94d5bbf9aeeb45acc8485f3686a6e791b082ea8/src/main/java/com/wandrell/pattern/repository/jpa/JpaRepository.java#L328-L341 |
Netflix/governator | governator-core/src/main/java/com/netflix/governator/InjectorBuilder.java | InjectorBuilder.traceEachElement | @Deprecated
public InjectorBuilder traceEachElement(ElementVisitor<String> visitor) {
"""
Iterator through all elements of the current module and write the output of the
ElementVisitor to the logger at debug level. 'null' responses are ignored
@param visitor
@deprecated Use forEachElement(visitor, messag... | java | @Deprecated
public InjectorBuilder traceEachElement(ElementVisitor<String> visitor) {
return forEachElement(visitor, message -> LOG.debug(message));
} | [
"@",
"Deprecated",
"public",
"InjectorBuilder",
"traceEachElement",
"(",
"ElementVisitor",
"<",
"String",
">",
"visitor",
")",
"{",
"return",
"forEachElement",
"(",
"visitor",
",",
"message",
"->",
"LOG",
".",
"debug",
"(",
"message",
")",
")",
";",
"}"
] | Iterator through all elements of the current module and write the output of the
ElementVisitor to the logger at debug level. 'null' responses are ignored
@param visitor
@deprecated Use forEachElement(visitor, message -> LOG.debug(message)); instead | [
"Iterator",
"through",
"all",
"elements",
"of",
"the",
"current",
"module",
"and",
"write",
"the",
"output",
"of",
"the",
"ElementVisitor",
"to",
"the",
"logger",
"at",
"debug",
"level",
".",
"null",
"responses",
"are",
"ignored",
"@param",
"visitor"
] | train | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-core/src/main/java/com/netflix/governator/InjectorBuilder.java#L111-L114 |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/contextspace/Context.java | Context.postConstruction | public EventSpace postConstruction() {
"""
Create the default space in this context.
@return the created space.
"""
this.spaceRepository.postConstruction();
this.defaultSpace = createSpace(OpenEventSpaceSpecification.class, this.defaultSpaceID);
if (this.defaultSpace == null) {
// The default space... | java | public EventSpace postConstruction() {
this.spaceRepository.postConstruction();
this.defaultSpace = createSpace(OpenEventSpaceSpecification.class, this.defaultSpaceID);
if (this.defaultSpace == null) {
// The default space could have been created before thanks to Hazelcast,
// thus createSpace returns null ... | [
"public",
"EventSpace",
"postConstruction",
"(",
")",
"{",
"this",
".",
"spaceRepository",
".",
"postConstruction",
"(",
")",
";",
"this",
".",
"defaultSpace",
"=",
"createSpace",
"(",
"OpenEventSpaceSpecification",
".",
"class",
",",
"this",
".",
"defaultSpaceID"... | Create the default space in this context.
@return the created space. | [
"Create",
"the",
"default",
"space",
"in",
"this",
"context",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/contextspace/Context.java#L100-L111 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.binarySearch | public static int binarySearch(final char[] a, final int fromIndex, final int toIndex, final char key) {
"""
{@link Arrays#binarySearch(char[], int, int, char)}
@param a
@param fromIndex
@param toIndex
@param key
@return
"""
return Array.binarySearch(a, fromIndex, toIndex, key);
} | java | public static int binarySearch(final char[] a, final int fromIndex, final int toIndex, final char key) {
return Array.binarySearch(a, fromIndex, toIndex, key);
} | [
"public",
"static",
"int",
"binarySearch",
"(",
"final",
"char",
"[",
"]",
"a",
",",
"final",
"int",
"fromIndex",
",",
"final",
"int",
"toIndex",
",",
"final",
"char",
"key",
")",
"{",
"return",
"Array",
".",
"binarySearch",
"(",
"a",
",",
"fromIndex",
... | {@link Arrays#binarySearch(char[], int, int, char)}
@param a
@param fromIndex
@param toIndex
@param key
@return | [
"{",
"@link",
"Arrays#binarySearch",
"(",
"char",
"[]",
"int",
"int",
"char",
")",
"}"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L12101-L12103 |
mnlipp/jgrapes | examples/src/org/jgrapes/http/demo/httpserver/FormProcessor.java | FormProcessor.onInput | @Handler
public void onInput(Input<ByteBuffer> event, IOSubchannel channel)
throws InterruptedException, UnsupportedEncodingException {
"""
Hanlde input.
@param event the event
@param channel the channel
@throws InterruptedException the interrupted exception
@throws UnsupportedEncodingExcepti... | java | @Handler
public void onInput(Input<ByteBuffer> event, IOSubchannel channel)
throws InterruptedException, UnsupportedEncodingException {
Optional<FormContext> ctx = channel.associated(this, FormContext.class);
if (!ctx.isPresent()) {
return;
}
ctx.get().fieldDe... | [
"@",
"Handler",
"public",
"void",
"onInput",
"(",
"Input",
"<",
"ByteBuffer",
">",
"event",
",",
"IOSubchannel",
"channel",
")",
"throws",
"InterruptedException",
",",
"UnsupportedEncodingException",
"{",
"Optional",
"<",
"FormContext",
">",
"ctx",
"=",
"channel",... | Hanlde input.
@param event the event
@param channel the channel
@throws InterruptedException the interrupted exception
@throws UnsupportedEncodingException the unsupported encoding exception | [
"Hanlde",
"input",
"."
] | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/examples/src/org/jgrapes/http/demo/httpserver/FormProcessor.java#L108-L141 |
craftercms/commons | utilities/src/main/java/org/craftercms/commons/collections/MapUtils.java | MapUtils.deepMerge | @SuppressWarnings("unchecked")
public static Map deepMerge(Map dst, Map src) {
"""
Deep merges two maps
@param dst the map where elements will be merged into
@param src the map with the elements to merge
@return a deep merge of the two given maps.
"""
if (dst != null && src != null) {
... | java | @SuppressWarnings("unchecked")
public static Map deepMerge(Map dst, Map src) {
if (dst != null && src != null) {
for (Object key : src.keySet()) {
if (src.get(key) instanceof Map && dst.get(key) instanceof Map) {
Map originalChild = (Map)dst.get(key);
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Map",
"deepMerge",
"(",
"Map",
"dst",
",",
"Map",
"src",
")",
"{",
"if",
"(",
"dst",
"!=",
"null",
"&&",
"src",
"!=",
"null",
")",
"{",
"for",
"(",
"Object",
"key",
":",
"src",
... | Deep merges two maps
@param dst the map where elements will be merged into
@param src the map with the elements to merge
@return a deep merge of the two given maps. | [
"Deep",
"merges",
"two",
"maps"
] | train | https://github.com/craftercms/commons/blob/3074fe49e56c2a4aae0832f40b17ae563335dc83/utilities/src/main/java/org/craftercms/commons/collections/MapUtils.java#L39-L54 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/dynamic/ProxyUtils.java | ProxyUtils.createServiceInstance | public static <T> T createServiceInstance(T impl, String category, String subsystem, Class<T> interf, Class<?>... additionalInterfaces) {
"""
Shortcut method to create service instance. Creates an instance with service interface name as instance name, custom category and subsystem, ServiceStatsCallHandler and Serv... | java | public static <T> T createServiceInstance(T impl, String category, String subsystem, Class<T> interf, Class<?>... additionalInterfaces){
return createServiceInstance(impl, null, category, subsystem, interf, additionalInterfaces);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"createServiceInstance",
"(",
"T",
"impl",
",",
"String",
"category",
",",
"String",
"subsystem",
",",
"Class",
"<",
"T",
">",
"interf",
",",
"Class",
"<",
"?",
">",
"...",
"additionalInterfaces",
")",
"{",
"return... | Shortcut method to create service instance. Creates an instance with service interface name as instance name, custom category and subsystem, ServiceStatsCallHandler and ServiceStatsFactory.
@param <T>
@param impl
@param category
@param subsystem
@param interf
@param additionalInterfaces
@return a newly created proxy of... | [
"Shortcut",
"method",
"to",
"create",
"service",
"instance",
".",
"Creates",
"an",
"instance",
"with",
"service",
"interface",
"name",
"as",
"instance",
"name",
"custom",
"category",
"and",
"subsystem",
"ServiceStatsCallHandler",
"and",
"ServiceStatsFactory",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/dynamic/ProxyUtils.java#L143-L145 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.expectPrivate | public static synchronized <T> IExpectationSetters<T> expectPrivate(Object instance, String methodName,
Class<?> where, Object... arguments) throws Exception {
"""
Used to specify expectations on methods using the method name at a
specific pl... | java | public static synchronized <T> IExpectationSetters<T> expectPrivate(Object instance, String methodName,
Class<?> where, Object... arguments) throws Exception {
return expectPrivate(instance, methodName, where, null, arguments);
} | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"IExpectationSetters",
"<",
"T",
">",
"expectPrivate",
"(",
"Object",
"instance",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"where",
",",
"Object",
"...",
"arguments",
")",
"throws",
"Excepti... | Used to specify expectations on methods using the method name at a
specific place in the class hierarchy (specified by the
{@code where} parameter). Works on for example private or package
private methods. | [
"Used",
"to",
"specify",
"expectations",
"on",
"methods",
"using",
"the",
"method",
"name",
"at",
"a",
"specific",
"place",
"in",
"the",
"class",
"hierarchy",
"(",
"specified",
"by",
"the",
"{"
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L1242-L1245 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataPropertyDomainAxiomImpl_CustomFieldSerializer.java | OWLDataPropertyDomainAxiomImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDataPropertyDomainAxiomImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.goo... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDataPropertyDomainAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLDataPropertyDomainAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataPropertyDomainAxiomImpl_CustomFieldSerializer.java#L76-L79 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.opentracing.1.3/src/com/ibm/ws/microprofile/opentracing/OpenTracingService.java | OpenTracingService.isTraced | public static boolean isTraced(String classOperationName, String methodOperationName) {
"""
Return true if {@code methodOperationName} is not null (i.e. it represents
something that has the {@code Traced} annotation) and if the
{@code Traced} annotation was not explicitly set to {@code false}, or return
true if... | java | public static boolean isTraced(String classOperationName, String methodOperationName) {
return isTraced(methodOperationName) || (isTraced(classOperationName) && !OPERATION_NAME_UNTRACED.equals(methodOperationName));
} | [
"public",
"static",
"boolean",
"isTraced",
"(",
"String",
"classOperationName",
",",
"String",
"methodOperationName",
")",
"{",
"return",
"isTraced",
"(",
"methodOperationName",
")",
"||",
"(",
"isTraced",
"(",
"classOperationName",
")",
"&&",
"!",
"OPERATION_NAME_U... | Return true if {@code methodOperationName} is not null (i.e. it represents
something that has the {@code Traced} annotation) and if the
{@code Traced} annotation was not explicitly set to {@code false}, or return
true if {@code classOperationName} is not null (i.e. it represents
something that has the {@code Traced} an... | [
"Return",
"true",
"if",
"{",
"@code",
"methodOperationName",
"}",
"is",
"not",
"null",
"(",
"i",
".",
"e",
".",
"it",
"represents",
"something",
"that",
"has",
"the",
"{",
"@code",
"Traced",
"}",
"annotation",
")",
"and",
"if",
"the",
"{",
"@code",
"Tr... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.opentracing.1.3/src/com/ibm/ws/microprofile/opentracing/OpenTracingService.java#L87-L89 |
eserating/siren4j | src/main/java/com/google/code/siren4j/converter/ReflectingConverter.java | ReflectingConverter.handleAddProperty | protected void handleAddProperty(EntityBuilder builder, String propName, Field currentField, Object obj) {
"""
Handles adding a property to an entity builder. Called by {@link ReflectingConverter#toEntity(Object, Field, Object, List)}
for each property found.
@param builder
@param propName
@param currentFiel... | java | protected void handleAddProperty(EntityBuilder builder, String propName, Field currentField, Object obj) {
builder.addProperty(propName, ReflectionUtils.getFieldValue(currentField, obj));
} | [
"protected",
"void",
"handleAddProperty",
"(",
"EntityBuilder",
"builder",
",",
"String",
"propName",
",",
"Field",
"currentField",
",",
"Object",
"obj",
")",
"{",
"builder",
".",
"addProperty",
"(",
"propName",
",",
"ReflectionUtils",
".",
"getFieldValue",
"(",
... | Handles adding a property to an entity builder. Called by {@link ReflectingConverter#toEntity(Object, Field, Object, List)}
for each property found.
@param builder
@param propName
@param currentField
@param obj | [
"Handles",
"adding",
"a",
"property",
"to",
"an",
"entity",
"builder",
".",
"Called",
"by",
"{",
"@link",
"ReflectingConverter#toEntity",
"(",
"Object",
"Field",
"Object",
"List",
")",
"}",
"for",
"each",
"property",
"found",
"."
] | train | https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/converter/ReflectingConverter.java#L458-L460 |
jbundle/jbundle | thin/base/screen/util/src/main/java/org/jbundle/thin/base/screen/util/ParamDispatcher.java | ParamDispatcher.firePropertyChange | public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
"""
The firePropertyChange method was generated to support the propertyChange field.
@param propertyName The property name.
@param oldValue The old value.
@param newValue The new value.
"""
if (propertyChange != ... | java | public void firePropertyChange(String propertyName, Object oldValue, Object newValue)
{
if (propertyChange != null)
propertyChange.firePropertyChange(propertyName, oldValue, newValue);
} | [
"public",
"void",
"firePropertyChange",
"(",
"String",
"propertyName",
",",
"Object",
"oldValue",
",",
"Object",
"newValue",
")",
"{",
"if",
"(",
"propertyChange",
"!=",
"null",
")",
"propertyChange",
".",
"firePropertyChange",
"(",
"propertyName",
",",
"oldValue"... | The firePropertyChange method was generated to support the propertyChange field.
@param propertyName The property name.
@param oldValue The old value.
@param newValue The new value. | [
"The",
"firePropertyChange",
"method",
"was",
"generated",
"to",
"support",
"the",
"propertyChange",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util/src/main/java/org/jbundle/thin/base/screen/util/ParamDispatcher.java#L149-L153 |
Jsondb/jsondb-core | src/main/java/io/jsondb/crypto/CryptoUtil.java | CryptoUtil.encryptFields | public static void encryptFields(Object object, CollectionMetaData cmd, ICipher cipher)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
"""
A utility method to encrypt the value of field marked by the @Secret annotation using its
setter/mutator method.
@param object th... | java | public static void encryptFields(Object object, CollectionMetaData cmd, ICipher cipher)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
for (String secretAnnotatedFieldName: cmd.getSecretAnnotatedFieldNames()) {
Method getterMethod = cmd.getGetterMethodForFieldName(... | [
"public",
"static",
"void",
"encryptFields",
"(",
"Object",
"object",
",",
"CollectionMetaData",
"cmd",
",",
"ICipher",
"cipher",
")",
"throws",
"IllegalAccessException",
",",
"IllegalArgumentException",
",",
"InvocationTargetException",
"{",
"for",
"(",
"String",
"se... | A utility method to encrypt the value of field marked by the @Secret annotation using its
setter/mutator method.
@param object the actual Object representing the POJO we want the Id of.
@param cmd the CollectionMetaData object from which we can obtain the list
containing names of fields which have the @Secret annotatio... | [
"A",
"utility",
"method",
"to",
"encrypt",
"the",
"value",
"of",
"field",
"marked",
"by",
"the"
] | train | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/crypto/CryptoUtil.java#L58-L77 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns.java | ns.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
ns_responses result = (ns_responses) service.get_payload_formatter().st... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_responses result = (ns_responses) service.get_payload_formatter().string_to_resource(ns_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION_NOT_EXISTS)
... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ns_responses",
"result",
"=",
"(",
"ns_responses",
")",
"service",
".",
"get_payload_formatter",
"(",
")"... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns.java#L1040-L1057 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | FSNamesystem.getDatanode | public DatanodeDescriptor getDatanode(DatanodeID nodeID) throws IOException {
"""
Get data node by storage ID.
@param nodeID
@return DatanodeDescriptor or null if the node is not found.
@throws IOException
"""
UnregisteredDatanodeException e = null;
DatanodeDescriptor node = datanodeMap.get(nodeID... | java | public DatanodeDescriptor getDatanode(DatanodeID nodeID) throws IOException {
UnregisteredDatanodeException e = null;
DatanodeDescriptor node = datanodeMap.get(nodeID.getStorageID());
if (node == null) {
return null;
}
if (!node.getName().equals(nodeID.getName())) {
e = new UnregisteredD... | [
"public",
"DatanodeDescriptor",
"getDatanode",
"(",
"DatanodeID",
"nodeID",
")",
"throws",
"IOException",
"{",
"UnregisteredDatanodeException",
"e",
"=",
"null",
";",
"DatanodeDescriptor",
"node",
"=",
"datanodeMap",
".",
"get",
"(",
"nodeID",
".",
"getStorageID",
"... | Get data node by storage ID.
@param nodeID
@return DatanodeDescriptor or null if the node is not found.
@throws IOException | [
"Get",
"data",
"node",
"by",
"storage",
"ID",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L8417-L8430 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/feature/Feature.java | Feature.setImageUrlAttribute | public void setImageUrlAttribute(String name, String value) {
"""
Set attribute value of given type.
@param name attribute name
@param value attribute value
"""
Attribute attribute = getAttributes().get(name);
if (!(attribute instanceof ImageUrlAttribute)) {
throw new IllegalStateException("Cannot s... | java | public void setImageUrlAttribute(String name, String value) {
Attribute attribute = getAttributes().get(name);
if (!(attribute instanceof ImageUrlAttribute)) {
throw new IllegalStateException("Cannot set imageUrl value on attribute with different type, " +
attribute.getClass().getName() + " setting value " ... | [
"public",
"void",
"setImageUrlAttribute",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"Attribute",
"attribute",
"=",
"getAttributes",
"(",
")",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"!",
"(",
"attribute",
"instanceof",
"ImageUrlAttribute... | Set attribute value of given type.
@param name attribute name
@param value attribute value | [
"Set",
"attribute",
"value",
"of",
"given",
"type",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/feature/Feature.java#L290-L297 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysInner.java | P2sVpnGatewaysInner.updateTagsAsync | public Observable<P2SVpnGatewayInner> updateTagsAsync(String resourceGroupName, String gatewayName) {
"""
Updates virtual wan p2s vpn gateway tags.
@param resourceGroupName The resource group name of the P2SVpnGateway.
@param gatewayName The name of the gateway.
@throws IllegalArgumentException thrown if para... | java | public Observable<P2SVpnGatewayInner> updateTagsAsync(String resourceGroupName, String gatewayName) {
return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1<ServiceResponse<P2SVpnGatewayInner>, P2SVpnGatewayInner>() {
@Override
public P2SVpnGatewayInner c... | [
"public",
"Observable",
"<",
"P2SVpnGatewayInner",
">",
"updateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"gatewayName",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"gatewayName",
")",
".",
"map",
"(",
"... | Updates virtual wan p2s vpn gateway tags.
@param resourceGroupName The resource group name of the P2SVpnGateway.
@param gatewayName The name of the gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Updates",
"virtual",
"wan",
"p2s",
"vpn",
"gateway",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysInner.java#L415-L422 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/config/jmx/JawrApplicationConfigManager.java | JawrApplicationConfigManager.areEquals | public boolean areEquals(String str1, String str2, String str3) {
"""
Returns true if the 3 string are equals.
@param str1
the first string
@param str2
the 2nd string
@param str3
the 3rd string
@return true if the 3 string are equals.
"""
return (str1 == null && str2 == null && str3 == null
|| ... | java | public boolean areEquals(String str1, String str2, String str3) {
return (str1 == null && str2 == null && str3 == null
|| str1 != null && str2 != null && str3 != null && str1.equals(str2) && str2.equals(str3));
} | [
"public",
"boolean",
"areEquals",
"(",
"String",
"str1",
",",
"String",
"str2",
",",
"String",
"str3",
")",
"{",
"return",
"(",
"str1",
"==",
"null",
"&&",
"str2",
"==",
"null",
"&&",
"str3",
"==",
"null",
"||",
"str1",
"!=",
"null",
"&&",
"str2",
"!... | Returns true if the 3 string are equals.
@param str1
the first string
@param str2
the 2nd string
@param str3
the 3rd string
@return true if the 3 string are equals. | [
"Returns",
"true",
"if",
"the",
"3",
"string",
"are",
"equals",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/config/jmx/JawrApplicationConfigManager.java#L622-L626 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/DojoHttpTransport.java | DojoHttpTransport.endResponse | protected String endResponse(HttpServletRequest request, Object arg) {
"""
Handles the
{@link com.ibm.jaggr.core.transport.IHttpTransport.LayerContributionType#END_RESPONSE} layer
listener event
@param request
the http request object
@param arg
null
@return the layer contribution
"""
String result ... | java | protected String endResponse(HttpServletRequest request, Object arg) {
String result = ""; //$NON-NLS-1$
@SuppressWarnings("unchecked")
Set<String> requiredModules = (Set<String>)request.getAttribute(ADD_REQUIRE_DEPS_REQATTRNAME);
if (requiredModules != null && !requiredModules.isEmpty()) {
// issue a r... | [
"protected",
"String",
"endResponse",
"(",
"HttpServletRequest",
"request",
",",
"Object",
"arg",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"//$NON-NLS-1$\r",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"Set",
"<",
"String",
">",
"requiredModules",
... | Handles the
{@link com.ibm.jaggr.core.transport.IHttpTransport.LayerContributionType#END_RESPONSE} layer
listener event
@param request
the http request object
@param arg
null
@return the layer contribution | [
"Handles",
"the",
"{",
"@link",
"com",
".",
"ibm",
".",
"jaggr",
".",
"core",
".",
"transport",
".",
"IHttpTransport",
".",
"LayerContributionType#END_RESPONSE",
"}",
"layer",
"listener",
"event"
] | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/DojoHttpTransport.java#L410-L426 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/offline/OfflineMessageManager.java | OfflineMessageManager.getMessages | public List<Message> getMessages(final List<String> nodes) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Returns a List of the offline <tt>Messages</tt> whose stamp matches the specified
request. The request will include the list of stamps that uniquely identifi... | java | public List<Message> getMessages(final List<String> nodes) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
List<Message> messages = new ArrayList<>(nodes.size());
OfflineMessageRequest request = new OfflineMessageRequest();
for (String node : nodes) ... | [
"public",
"List",
"<",
"Message",
">",
"getMessages",
"(",
"final",
"List",
"<",
"String",
">",
"nodes",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"List",
"<",
"Message",
">",
... | Returns a List of the offline <tt>Messages</tt> whose stamp matches the specified
request. The request will include the list of stamps that uniquely identifies
the offline messages to retrieve. The returned offline messages will not be deleted
from the server. Use {@link #deleteMessages(java.util.List)} to delete the m... | [
"Returns",
"a",
"List",
"of",
"the",
"offline",
"<tt",
">",
"Messages<",
"/",
"tt",
">",
"whose",
"stamp",
"matches",
"the",
"specified",
"request",
".",
"The",
"request",
"will",
"include",
"the",
"list",
"of",
"stamps",
"that",
"uniquely",
"identifies",
... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/offline/OfflineMessageManager.java#L150-L184 |
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/ProtectionIntentsInner.java | ProtectionIntentsInner.validateAsync | public Observable<PreValidateEnableBackupResponseInner> validateAsync(String azureRegion, PreValidateEnableBackupRequest parameters) {
"""
It will validate followings
1. Vault capacity
2. VM is already protected
3. Any VM related configuration passed in properties.
@param azureRegion Azure region to hit Api
... | java | public Observable<PreValidateEnableBackupResponseInner> validateAsync(String azureRegion, PreValidateEnableBackupRequest parameters) {
return validateWithServiceResponseAsync(azureRegion, parameters).map(new Func1<ServiceResponse<PreValidateEnableBackupResponseInner>, PreValidateEnableBackupResponseInner>() {
... | [
"public",
"Observable",
"<",
"PreValidateEnableBackupResponseInner",
">",
"validateAsync",
"(",
"String",
"azureRegion",
",",
"PreValidateEnableBackupRequest",
"parameters",
")",
"{",
"return",
"validateWithServiceResponseAsync",
"(",
"azureRegion",
",",
"parameters",
")",
... | It will validate followings
1. Vault capacity
2. VM is already protected
3. Any VM related configuration passed in properties.
@param azureRegion Azure region to hit Api
@param parameters Enable backup validation request on Virtual Machine
@throws IllegalArgumentException thrown if parameters fail the validation
@retu... | [
"It",
"will",
"validate",
"followings",
"1",
".",
"Vault",
"capacity",
"2",
".",
"VM",
"is",
"already",
"protected",
"3",
".",
"Any",
"VM",
"related",
"configuration",
"passed",
"in",
"properties",
"."
] | 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/ProtectionIntentsInner.java#L112-L119 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/GosuCollectionUtil.java | GosuCollectionUtil.startsWith | public static boolean startsWith( List<?> list, List<?> prefix ) {
"""
{@link String#startsWith(String)} for Lists.
@return true iff list is at least as big as prefix, and if the first prefix.size() elements
are element-wise equal to the elements of prefix.
"""
if( list.size() < prefix.size() )
{
... | java | public static boolean startsWith( List<?> list, List<?> prefix )
{
if( list.size() < prefix.size() )
{
return false;
}
Iterator<?> listIter = list.iterator();
for( Object prefixElement : prefix )
{
boolean b = listIter.hasNext();
assert b :
"list claims to have at lea... | [
"public",
"static",
"boolean",
"startsWith",
"(",
"List",
"<",
"?",
">",
"list",
",",
"List",
"<",
"?",
">",
"prefix",
")",
"{",
"if",
"(",
"list",
".",
"size",
"(",
")",
"<",
"prefix",
".",
"size",
"(",
")",
")",
"{",
"return",
"false",
";",
"... | {@link String#startsWith(String)} for Lists.
@return true iff list is at least as big as prefix, and if the first prefix.size() elements
are element-wise equal to the elements of prefix. | [
"{",
"@link",
"String#startsWith",
"(",
"String",
")",
"}",
"for",
"Lists",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuCollectionUtil.java#L70-L88 |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java | Graph.validate | public Boolean validate(GraphValidator<K, VV, EV> validator) throws Exception {
"""
Function that checks whether a Graph is a valid Graph,
as defined by the given {@link GraphValidator}.
@return true if the Graph is valid.
"""
return validator.validate(this);
} | java | public Boolean validate(GraphValidator<K, VV, EV> validator) throws Exception {
return validator.validate(this);
} | [
"public",
"Boolean",
"validate",
"(",
"GraphValidator",
"<",
"K",
",",
"VV",
",",
"EV",
">",
"validator",
")",
"throws",
"Exception",
"{",
"return",
"validator",
".",
"validate",
"(",
"this",
")",
";",
"}"
] | Function that checks whether a Graph is a valid Graph,
as defined by the given {@link GraphValidator}.
@return true if the Graph is valid. | [
"Function",
"that",
"checks",
"whether",
"a",
"Graph",
"is",
"a",
"valid",
"Graph",
"as",
"defined",
"by",
"the",
"given",
"{",
"@link",
"GraphValidator",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java#L446-L448 |
rzwitserloot/lombok | src/core/lombok/javac/apt/LombokProcessor.java | LombokProcessor.getJavacProcessingEnvironment | public JavacProcessingEnvironment getJavacProcessingEnvironment(Object procEnv) {
"""
This class casts the given processing environment to a JavacProcessingEnvironment. In case of
gradle incremental compilation, the delegate ProcessingEnvironment of the gradle wrapper is returned.
"""
if (procEnv instanceof... | java | public JavacProcessingEnvironment getJavacProcessingEnvironment(Object procEnv) {
if (procEnv instanceof JavacProcessingEnvironment) return (JavacProcessingEnvironment) procEnv;
// try to find a "delegate" field in the object, and use this to try to obtain a JavacProcessingEnvironment
for (Class<?> procEnvClas... | [
"public",
"JavacProcessingEnvironment",
"getJavacProcessingEnvironment",
"(",
"Object",
"procEnv",
")",
"{",
"if",
"(",
"procEnv",
"instanceof",
"JavacProcessingEnvironment",
")",
"return",
"(",
"JavacProcessingEnvironment",
")",
"procEnv",
";",
"// try to find a \"delegate\"... | This class casts the given processing environment to a JavacProcessingEnvironment. In case of
gradle incremental compilation, the delegate ProcessingEnvironment of the gradle wrapper is returned. | [
"This",
"class",
"casts",
"the",
"given",
"processing",
"environment",
"to",
"a",
"JavacProcessingEnvironment",
".",
"In",
"case",
"of",
"gradle",
"incremental",
"compilation",
"the",
"delegate",
"ProcessingEnvironment",
"of",
"the",
"gradle",
"wrapper",
"is",
"retu... | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/javac/apt/LombokProcessor.java#L409-L424 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java | FileOperations.getFilePropertiesFromTask | public FileProperties getFilePropertiesFromTask(String jobId, String taskId, String fileName) throws BatchErrorException, IOException {
"""
Gets information about a file from the specified task's directory on its compute node.
@param jobId The ID of the job containing the task.
@param taskId The ID of the task... | java | public FileProperties getFilePropertiesFromTask(String jobId, String taskId, String fileName) throws BatchErrorException, IOException {
return getFilePropertiesFromTask(jobId, taskId, fileName, null);
} | [
"public",
"FileProperties",
"getFilePropertiesFromTask",
"(",
"String",
"jobId",
",",
"String",
"taskId",
",",
"String",
"fileName",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"return",
"getFilePropertiesFromTask",
"(",
"jobId",
",",
"taskId",
",",... | Gets information about a file from the specified task's directory on its compute node.
@param jobId The ID of the job containing the task.
@param taskId The ID of the task.
@param fileName The name of the file to retrieve.
@return A {@link FileProperties} instance containing information about the file.
@throws BatchEr... | [
"Gets",
"information",
"about",
"a",
"file",
"from",
"the",
"specified",
"task",
"s",
"directory",
"on",
"its",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java#L330-L332 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/BandwidthClient.java | BandwidthClient.generateGetRequest | protected HttpGet generateGetRequest(final String path, final Map<String, Object> paramMap) {
"""
Helper method to build the GET request for the server.
@param path the path.
@param paramMap the parameters map.
@return the get object.
"""
final List<NameValuePair> pairs = new ArrayList<NameValuePa... | java | protected HttpGet generateGetRequest(final String path, final Map<String, Object> paramMap) {
final List<NameValuePair> pairs = new ArrayList<NameValuePair>();
for (final String key : paramMap.keySet()) {
pairs.add(new BasicNameValuePair(key, paramMap.get(key).toString()));
}
... | [
"protected",
"HttpGet",
"generateGetRequest",
"(",
"final",
"String",
"path",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"paramMap",
")",
"{",
"final",
"List",
"<",
"NameValuePair",
">",
"pairs",
"=",
"new",
"ArrayList",
"<",
"NameValuePair",
">... | Helper method to build the GET request for the server.
@param path the path.
@param paramMap the parameters map.
@return the get object. | [
"Helper",
"method",
"to",
"build",
"the",
"GET",
"request",
"for",
"the",
"server",
"."
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/BandwidthClient.java#L610-L617 |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/ElementNameQualifier.java | ElementNameQualifier.qualifyForComparison | public boolean qualifyForComparison(Element control, Element test) {
"""
Determine whether two elements qualify for further Difference comparison.
@param control
@param test
@return true if the two elements qualify for further comparison based on
their similar namespace URI and non-namespaced tag name,
false... | java | public boolean qualifyForComparison(Element control, Element test) {
return ElementSelectors.byName.canBeCompared(control, test);
} | [
"public",
"boolean",
"qualifyForComparison",
"(",
"Element",
"control",
",",
"Element",
"test",
")",
"{",
"return",
"ElementSelectors",
".",
"byName",
".",
"canBeCompared",
"(",
"control",
",",
"test",
")",
";",
"}"
] | Determine whether two elements qualify for further Difference comparison.
@param control
@param test
@return true if the two elements qualify for further comparison based on
their similar namespace URI and non-namespaced tag name,
false otherwise | [
"Determine",
"whether",
"two",
"elements",
"qualify",
"for",
"further",
"Difference",
"comparison",
"."
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/ElementNameQualifier.java#L59-L61 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.createTempDir | protected File createTempDir(String namePrefix) {
"""
Create a temporary subdirectory inside the root temp directory.
@param namePrefix the prefix for the folder name.
@return the temp directory.
@see #getTempDirectory()
"""
final File tempDir = new File(getTempDirectory(), namePrefix);
cleanFolder(te... | java | protected File createTempDir(String namePrefix) {
final File tempDir = new File(getTempDirectory(), namePrefix);
cleanFolder(tempDir, ACCEPT_ALL_FILTER, true, true);
if (!tempDir.mkdirs()) {
throw new RuntimeException(MessageFormat.format(Messages.SarlBatchCompiler_8, tempDir.getAbsolutePath()));
}
this.te... | [
"protected",
"File",
"createTempDir",
"(",
"String",
"namePrefix",
")",
"{",
"final",
"File",
"tempDir",
"=",
"new",
"File",
"(",
"getTempDirectory",
"(",
")",
",",
"namePrefix",
")",
";",
"cleanFolder",
"(",
"tempDir",
",",
"ACCEPT_ALL_FILTER",
",",
"true",
... | Create a temporary subdirectory inside the root temp directory.
@param namePrefix the prefix for the folder name.
@return the temp directory.
@see #getTempDirectory() | [
"Create",
"a",
"temporary",
"subdirectory",
"inside",
"the",
"root",
"temp",
"directory",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1902-L1910 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/DFSAdmin.java | DFSAdmin.refreshNamenodes | public int refreshNamenodes(String[] argv, int i) throws IOException {
"""
Refresh the namenodes served by the {@link DataNode}.
Usage: java DFSAdmin -refreshNamenodes datanodehost:port
@param argv List of of command line parameters.
@param idx The index of the command that is being processed.
@exception IOExc... | java | public int refreshNamenodes(String[] argv, int i) throws IOException {
ClientDatanodeProtocol datanode = null;
String dnAddr = (argv.length == 2) ? argv[i] : null;
try {
datanode = getClientDatanodeProtocol(dnAddr);
if (datanode != null) {
datanode.refreshNamenodes();
retu... | [
"public",
"int",
"refreshNamenodes",
"(",
"String",
"[",
"]",
"argv",
",",
"int",
"i",
")",
"throws",
"IOException",
"{",
"ClientDatanodeProtocol",
"datanode",
"=",
"null",
";",
"String",
"dnAddr",
"=",
"(",
"argv",
".",
"length",
"==",
"2",
")",
"?",
"a... | Refresh the namenodes served by the {@link DataNode}.
Usage: java DFSAdmin -refreshNamenodes datanodehost:port
@param argv List of of command line parameters.
@param idx The index of the command that is being processed.
@exception IOException if an error accoured wile accessing
the file or path.
@return exitcode 0 on s... | [
"Refresh",
"the",
"namenodes",
"served",
"by",
"the",
"{"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/DFSAdmin.java#L832-L848 |
RogerParkinson/madura-objects-parent | madura-objects/src/main/java/org/springframework/context/support/JdbcMessageSource.java | JdbcMessageSource.resolveCodeInternal | protected MessageFormat resolveCodeInternal(String code, Locale locale) {
"""
Check in base the message associated with the given code and locale
@param code
the code of the message to solve
@param locale
the locale to check against
@return a MessageFormat if one were found, either for the given locale or
... | java | protected MessageFormat resolveCodeInternal(String code, Locale locale) {
String result;
lastQuery = System.currentTimeMillis();
try {
result = (String) jdbcTemplate.queryForObject(sqlStatement,
new Object[] { code, locale.toString() }, String.class);
} ... | [
"protected",
"MessageFormat",
"resolveCodeInternal",
"(",
"String",
"code",
",",
"Locale",
"locale",
")",
"{",
"String",
"result",
";",
"lastQuery",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"try",
"{",
"result",
"=",
"(",
"String",
")",
"jdbcT... | Check in base the message associated with the given code and locale
@param code
the code of the message to solve
@param locale
the locale to check against
@return a MessageFormat if one were found, either for the given locale or
for the default on, or null if nothing could be found | [
"Check",
"in",
"base",
"the",
"message",
"associated",
"with",
"the",
"given",
"code",
"and",
"locale"
] | train | https://github.com/RogerParkinson/madura-objects-parent/blob/9b5385dd0437611f0ce8506f63646e018d06fb8e/madura-objects/src/main/java/org/springframework/context/support/JdbcMessageSource.java#L100-L123 |
banq/jdonframework | JdonAccessory/jdon-struts1x/src/main/java/com/jdon/model/handler/HandlerMethodMetaArgsFactory.java | HandlerMethodMetaArgsFactory.createGetMethod | public MethodMetaArgs createGetMethod(HandlerMetaDef handlerMetaDef, Object keyValue) {
"""
create find method the service's find method parameter type must be
String type
@param handlerMetaDef
@param keyValue
@return MethodMetaArgs instance
"""
String p_methodName = handlerMetaDef.getFindMethod();
... | java | public MethodMetaArgs createGetMethod(HandlerMetaDef handlerMetaDef, Object keyValue) {
String p_methodName = handlerMetaDef.getFindMethod();
if (p_methodName == null) {
Debug.logError("[JdonFramework] not configure the findMethod parameter: <getMethod name=XXXXX /> ", module);
}
if (keyValue == null)... | [
"public",
"MethodMetaArgs",
"createGetMethod",
"(",
"HandlerMetaDef",
"handlerMetaDef",
",",
"Object",
"keyValue",
")",
"{",
"String",
"p_methodName",
"=",
"handlerMetaDef",
".",
"getFindMethod",
"(",
")",
";",
"if",
"(",
"p_methodName",
"==",
"null",
")",
"{",
... | create find method the service's find method parameter type must be
String type
@param handlerMetaDef
@param keyValue
@return MethodMetaArgs instance | [
"create",
"find",
"method",
"the",
"service",
"s",
"find",
"method",
"parameter",
"type",
"must",
"be",
"String",
"type"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-struts1x/src/main/java/com/jdon/model/handler/HandlerMethodMetaArgsFactory.java#L61-L72 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/util/QueryUtil.java | QueryUtil.getValue | @Deprecated
public static Object getValue(QueryColumn column, int row) {
"""
return the value at the given position (row), returns the default empty value ("" or null) for
wrong row or null values. this method only exist for backward compatibility and should not be
used for new functinality
@param column
... | java | @Deprecated
public static Object getValue(QueryColumn column, int row) {// print.ds();
if (NullSupportHelper.full()) return column.get(row, null);
Object v = column.get(row, "");
return v == null ? "" : v;
} | [
"@",
"Deprecated",
"public",
"static",
"Object",
"getValue",
"(",
"QueryColumn",
"column",
",",
"int",
"row",
")",
"{",
"// print.ds();",
"if",
"(",
"NullSupportHelper",
".",
"full",
"(",
")",
")",
"return",
"column",
".",
"get",
"(",
"row",
",",
"null",
... | return the value at the given position (row), returns the default empty value ("" or null) for
wrong row or null values. this method only exist for backward compatibility and should not be
used for new functinality
@param column
@param row
@return
@deprecated use instead QueryColumn.get(int,Object) | [
"return",
"the",
"value",
"at",
"the",
"given",
"position",
"(",
"row",
")",
"returns",
"the",
"default",
"empty",
"value",
"(",
"or",
"null",
")",
"for",
"wrong",
"row",
"or",
"null",
"values",
".",
"this",
"method",
"only",
"exist",
"for",
"backward",
... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/QueryUtil.java#L354-L359 |
neoremind/fluent-validator | fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/FluentValidator.java | FluentValidator.putAttribute2Context | public FluentValidator putAttribute2Context(String key, Object value) {
"""
将键值对放入上下文
@param key 键
@param value 值
@return FluentValidator
"""
if (context == null) {
context = new ValidatorContext();
}
context.setAttribute(key, value);
return this;
} | java | public FluentValidator putAttribute2Context(String key, Object value) {
if (context == null) {
context = new ValidatorContext();
}
context.setAttribute(key, value);
return this;
} | [
"public",
"FluentValidator",
"putAttribute2Context",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"context",
"=",
"new",
"ValidatorContext",
"(",
")",
";",
"}",
"context",
".",
"setAttribute",
"(",
"... | 将键值对放入上下文
@param key 键
@param value 值
@return FluentValidator | [
"将键值对放入上下文"
] | train | https://github.com/neoremind/fluent-validator/blob/b516970591aa9468b44ba63938b98ec341fd6ead/fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/FluentValidator.java#L100-L106 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.deleteProject | public void deleteProject(CmsDbContext dbc, CmsProject deleteProject, boolean resetResources) throws CmsException {
"""
Deletes a project.<p>
Only the admin or the owner of the project can do this.
@param dbc the current database context
@param deleteProject the project to be deleted
@param resetResources ... | java | public void deleteProject(CmsDbContext dbc, CmsProject deleteProject, boolean resetResources) throws CmsException {
CmsUUID projectId = deleteProject.getUuid();
if (resetResources) {
// changed/new/deleted files in the specified project
List<CmsResource> modifiedFiles = readCha... | [
"public",
"void",
"deleteProject",
"(",
"CmsDbContext",
"dbc",
",",
"CmsProject",
"deleteProject",
",",
"boolean",
"resetResources",
")",
"throws",
"CmsException",
"{",
"CmsUUID",
"projectId",
"=",
"deleteProject",
".",
"getUuid",
"(",
")",
";",
"if",
"(",
"rese... | Deletes a project.<p>
Only the admin or the owner of the project can do this.
@param dbc the current database context
@param deleteProject the project to be deleted
@param resetResources if true, the resources of the project to delete will be reset to their online state, or deleted if they have no online state
@thro... | [
"Deletes",
"a",
"project",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L2703-L2738 |
denisneuling/apitrary.jar | apitrary-api-client/src/main/java/com/apitrary/api/client/util/ClassUtil.java | ClassUtil.getValueOf | @SuppressWarnings("unchecked")
public static <T> T getValueOf(Field field, Object reference, Class<?> referenceClazz, Class<T> valueType) {
"""
<p>
getValueOf.
</p>
@param field
a {@link java.lang.reflect.Field} object.
@param valueType
a {@link java.lang.Class} object.
@param <T>
a T object.
@return a... | java | @SuppressWarnings("unchecked")
public static <T> T getValueOf(Field field, Object reference, Class<?> referenceClazz, Class<T> valueType) {
try {
field.setAccessible(true);
Object toReturn = (T) field.get(reference);
if (String.class.isInstance(valueType.getClass()) && !String.class.isInstance(toReturn.getC... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getValueOf",
"(",
"Field",
"field",
",",
"Object",
"reference",
",",
"Class",
"<",
"?",
">",
"referenceClazz",
",",
"Class",
"<",
"T",
">",
"valueType",
")",
"{"... | <p>
getValueOf.
</p>
@param field
a {@link java.lang.reflect.Field} object.
@param valueType
a {@link java.lang.Class} object.
@param <T>
a T object.
@return a T object. | [
"<p",
">",
"getValueOf",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/denisneuling/apitrary.jar/blob/b7f639a1e735c60ba2b1b62851926757f5de8628/apitrary-api-client/src/main/java/com/apitrary/api/client/util/ClassUtil.java#L185-L198 |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/util/MirageUtil.java | MirageUtil.getColumnName | public static String getColumnName(EntityOperator entityOperator, Class<?> clazz, PropertyDesc pd, NameConverter nameConverter) {
"""
Returns the column name from the property.
<p>
If the property has {@link Column} annotation then this method returns the annotated column name,
otherwise creates column name fro... | java | public static String getColumnName(EntityOperator entityOperator, Class<?> clazz, PropertyDesc pd, NameConverter nameConverter){
ColumnInfo column = entityOperator.getColumnInfo(clazz, pd, nameConverter);
if(column != null){
return column.name;
} else {
return nameCo... | [
"public",
"static",
"String",
"getColumnName",
"(",
"EntityOperator",
"entityOperator",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"PropertyDesc",
"pd",
",",
"NameConverter",
"nameConverter",
")",
"{",
"ColumnInfo",
"column",
"=",
"entityOperator",
".",
"getColumn... | Returns the column name from the property.
<p>
If the property has {@link Column} annotation then this method returns the annotated column name,
otherwise creates column name from the property name using {@link NameConverter}.
@param entityOperator the entity operator
@param pd the property
@param clazz the class
@par... | [
"Returns",
"the",
"column",
"name",
"from",
"the",
"property",
".",
"<p",
">",
"If",
"the",
"property",
"has",
"{",
"@link",
"Column",
"}",
"annotation",
"then",
"this",
"method",
"returns",
"the",
"annotated",
"column",
"name",
"otherwise",
"creates",
"colu... | train | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/util/MirageUtil.java#L102-L109 |
litsec/swedish-eid-shibboleth-base | shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/service/impl/AbstractAuthenticationBaseService.java | AbstractAuthenticationBaseService.getLogString | protected String getLogString(ProfileRequestContext<?, ?> context) {
"""
Returns a string to include in logging statements. The returned log string contains information about the current
request being processed. The format on the log string is {@code key1='value1',key2='value2', ...}.
@param context
request c... | java | protected String getLogString(ProfileRequestContext<?, ?> context) {
try {
AuthnRequest authnRequest = this.getAuthnRequest(context);
return String.format("request-id='%s',sp='%s'", authnRequest.getID(), authnRequest.getIssuer().getValue());
}
catch (Exception e) {
return "";
}
} | [
"protected",
"String",
"getLogString",
"(",
"ProfileRequestContext",
"<",
"?",
",",
"?",
">",
"context",
")",
"{",
"try",
"{",
"AuthnRequest",
"authnRequest",
"=",
"this",
".",
"getAuthnRequest",
"(",
"context",
")",
";",
"return",
"String",
".",
"format",
"... | Returns a string to include in logging statements. The returned log string contains information about the current
request being processed. The format on the log string is {@code key1='value1',key2='value2', ...}.
@param context
request context
@return a string to be used in log entries | [
"Returns",
"a",
"string",
"to",
"include",
"in",
"logging",
"statements",
".",
"The",
"returned",
"log",
"string",
"contains",
"information",
"about",
"the",
"current",
"request",
"being",
"processed",
".",
"The",
"format",
"on",
"the",
"log",
"string",
"is",
... | train | https://github.com/litsec/swedish-eid-shibboleth-base/blob/aaaa467ff61f07d7dfa31627fb36851a37da6804/shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/service/impl/AbstractAuthenticationBaseService.java#L83-L91 |
zxing/zxing | android/src/com/google/zxing/client/android/HttpHelper.java | HttpHelper.downloadViaHttp | public static CharSequence downloadViaHttp(String uri, ContentType type) throws IOException {
"""
Downloads the entire resource instead of part.
@param uri URI to retrieve
@param type expected text-like MIME type of that content
@return content as a {@code String}
@throws IOException if the content can't be ... | java | public static CharSequence downloadViaHttp(String uri, ContentType type) throws IOException {
return downloadViaHttp(uri, type, Integer.MAX_VALUE);
} | [
"public",
"static",
"CharSequence",
"downloadViaHttp",
"(",
"String",
"uri",
",",
"ContentType",
"type",
")",
"throws",
"IOException",
"{",
"return",
"downloadViaHttp",
"(",
"uri",
",",
"type",
",",
"Integer",
".",
"MAX_VALUE",
")",
";",
"}"
] | Downloads the entire resource instead of part.
@param uri URI to retrieve
@param type expected text-like MIME type of that content
@return content as a {@code String}
@throws IOException if the content can't be retrieved because of a bad URI, network problem, etc.
@see #downloadViaHttp(String, HttpHelper.ContentType, ... | [
"Downloads",
"the",
"entire",
"resource",
"instead",
"of",
"part",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/android/src/com/google/zxing/client/android/HttpHelper.java#L68-L70 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.