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 |
|---|---|---|---|---|---|---|---|---|---|---|
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_redirection_id_changeRedirection_POST | public OvhTaskSpecialAccount domain_redirection_id_changeRedirection_POST(String domain, String id, String to) throws IOException {
"""
Change redirection
REST: POST /email/domain/{domain}/redirection/{id}/changeRedirection
@param to [required] Target of account
@param domain [required] Name of your domain na... | java | public OvhTaskSpecialAccount domain_redirection_id_changeRedirection_POST(String domain, String id, String to) throws IOException {
String qPath = "/email/domain/{domain}/redirection/{id}/changeRedirection";
StringBuilder sb = path(qPath, domain, id);
HashMap<String, Object>o = new HashMap<String, Object>();
ad... | [
"public",
"OvhTaskSpecialAccount",
"domain_redirection_id_changeRedirection_POST",
"(",
"String",
"domain",
",",
"String",
"id",
",",
"String",
"to",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/redirection/{id}/changeRedirection\"",
";... | Change redirection
REST: POST /email/domain/{domain}/redirection/{id}/changeRedirection
@param to [required] Target of account
@param domain [required] Name of your domain name
@param id [required] | [
"Change",
"redirection"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L1008-L1015 |
lets-blade/blade | src/main/java/com/blade/mvc/RouteContext.java | RouteContext.query | public String query(String paramName, String defaultValue) {
"""
Get a request parameter, if NULL is returned to defaultValue
@param paramName parameter name
@param defaultValue default String value
@return Return request parameter values
"""
return this.request.query(paramName, defaultValue);
... | java | public String query(String paramName, String defaultValue) {
return this.request.query(paramName, defaultValue);
} | [
"public",
"String",
"query",
"(",
"String",
"paramName",
",",
"String",
"defaultValue",
")",
"{",
"return",
"this",
".",
"request",
".",
"query",
"(",
"paramName",
",",
"defaultValue",
")",
";",
"}"
] | Get a request parameter, if NULL is returned to defaultValue
@param paramName parameter name
@param defaultValue default String value
@return Return request parameter values | [
"Get",
"a",
"request",
"parameter",
"if",
"NULL",
"is",
"returned",
"to",
"defaultValue"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/mvc/RouteContext.java#L173-L175 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/internal/util/network/FbBotMillNetworkController.java | FbBotMillNetworkController.postFormDataMessage | public static void postFormDataMessage(String recipient,
AttachmentType type, File file) {
"""
POSTs a message as a JSON string to Facebook.
@param recipient
the recipient
@param type
the type
@param file
the file
"""
String pageToken = FbBotMillContext.getInstance().getPageToken();
// If the pa... | java | public static void postFormDataMessage(String recipient,
AttachmentType type, File file) {
String pageToken = FbBotMillContext.getInstance().getPageToken();
// If the page token is invalid, returns.
if (!validatePageToken(pageToken)) {
return;
}
// TODO: add checks for valid attachmentTypes (FILE, AUDI... | [
"public",
"static",
"void",
"postFormDataMessage",
"(",
"String",
"recipient",
",",
"AttachmentType",
"type",
",",
"File",
"file",
")",
"{",
"String",
"pageToken",
"=",
"FbBotMillContext",
".",
"getInstance",
"(",
")",
".",
"getPageToken",
"(",
")",
";",
"// I... | POSTs a message as a JSON string to Facebook.
@param recipient
the recipient
@param type
the type
@param file
the file | [
"POSTs",
"a",
"message",
"as",
"a",
"JSON",
"string",
"to",
"Facebook",
"."
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/internal/util/network/FbBotMillNetworkController.java#L478-L529 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.paymentMean_creditCard_id_PUT | public void paymentMean_creditCard_id_PUT(Long id, OvhCreditCard body) throws IOException {
"""
Alter this object properties
REST: PUT /me/paymentMean/creditCard/{id}
@param body [required] New object properties
@param id [required] Id of the object
"""
String qPath = "/me/paymentMean/creditCard/{id}";
... | java | public void paymentMean_creditCard_id_PUT(Long id, OvhCreditCard body) throws IOException {
String qPath = "/me/paymentMean/creditCard/{id}";
StringBuilder sb = path(qPath, id);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"paymentMean_creditCard_id_PUT",
"(",
"Long",
"id",
",",
"OvhCreditCard",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/paymentMean/creditCard/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"id",
... | Alter this object properties
REST: PUT /me/paymentMean/creditCard/{id}
@param body [required] New object properties
@param id [required] Id of the object | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L844-L848 |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.marshallIntoObject | public <T> T marshallIntoObject(Class<T> clazz, Map<String, AttributeValue> itemAttributes) {
"""
Creates and fills in the attributes on an instance of the class given
with the attributes given.
<p>
This is accomplished by looking for getter methods annotated with an
appropriate annotation, then looking for ma... | java | public <T> T marshallIntoObject(Class<T> clazz, Map<String, AttributeValue> itemAttributes) {
T toReturn = null;
try {
toReturn = clazz.newInstance();
} catch ( InstantiationException e ) {
throw new DynamoDBMappingException("Failed to instantiate new instance of class", ... | [
"public",
"<",
"T",
">",
"T",
"marshallIntoObject",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
"itemAttributes",
")",
"{",
"T",
"toReturn",
"=",
"null",
";",
"try",
"{",
"toReturn",
"=",
"clazz",
".",
... | Creates and fills in the attributes on an instance of the class given
with the attributes given.
<p>
This is accomplished by looking for getter methods annotated with an
appropriate annotation, then looking for matching attribute names in the
item attribute map.
@param clazz
The class to instantiate and hydrate
@param... | [
"Creates",
"and",
"fills",
"in",
"the",
"attributes",
"on",
"an",
"instance",
"of",
"the",
"class",
"given",
"with",
"the",
"attributes",
"given",
".",
"<p",
">",
"This",
"is",
"accomplished",
"by",
"looking",
"for",
"getter",
"methods",
"annotated",
"with",... | train | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L298-L321 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java | PolylineSplitMerge.maximumDistance | static int maximumDistance(List<Point2D_I32> contour , int indexA , int indexB ) {
"""
Finds the point in the contour which maximizes the distance between points A
and B.
@param contour List of all pointsi n the contour
@param indexA Index of point A
@param indexB Index of point B
@return Index of maximal d... | java | static int maximumDistance(List<Point2D_I32> contour , int indexA , int indexB ) {
Point2D_I32 a = contour.get(indexA);
Point2D_I32 b = contour.get(indexB);
int best = -1;
double bestDistance = -Double.MAX_VALUE;
for (int i = 0; i < contour.size(); i++) {
Point2D_I32 c = contour.get(i);
// can't sum s... | [
"static",
"int",
"maximumDistance",
"(",
"List",
"<",
"Point2D_I32",
">",
"contour",
",",
"int",
"indexA",
",",
"int",
"indexB",
")",
"{",
"Point2D_I32",
"a",
"=",
"contour",
".",
"get",
"(",
"indexA",
")",
";",
"Point2D_I32",
"b",
"=",
"contour",
".",
... | Finds the point in the contour which maximizes the distance between points A
and B.
@param contour List of all pointsi n the contour
@param indexA Index of point A
@param indexB Index of point B
@return Index of maximal distant point | [
"Finds",
"the",
"point",
"in",
"the",
"contour",
"which",
"maximizes",
"the",
"distance",
"between",
"points",
"A",
"and",
"B",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java#L597-L616 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/copy/CopyManager.java | CopyManager.copyIn | public long copyIn(final String sql, InputStream from) throws SQLException, IOException {
"""
Use COPY FROM STDIN for very fast copying from an InputStream into a database table.
@param sql COPY FROM STDIN statement
@param from a CSV file or such
@return number of rows updated for server 8.2 or newer; -1 for ... | java | public long copyIn(final String sql, InputStream from) throws SQLException, IOException {
return copyIn(sql, from, DEFAULT_BUFFER_SIZE);
} | [
"public",
"long",
"copyIn",
"(",
"final",
"String",
"sql",
",",
"InputStream",
"from",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"return",
"copyIn",
"(",
"sql",
",",
"from",
",",
"DEFAULT_BUFFER_SIZE",
")",
";",
"}"
] | Use COPY FROM STDIN for very fast copying from an InputStream into a database table.
@param sql COPY FROM STDIN statement
@param from a CSV file or such
@return number of rows updated for server 8.2 or newer; -1 for older
@throws SQLException on database usage issues
@throws IOException upon input stream or database c... | [
"Use",
"COPY",
"FROM",
"STDIN",
"for",
"very",
"fast",
"copying",
"from",
"an",
"InputStream",
"into",
"a",
"database",
"table",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/copy/CopyManager.java#L198-L200 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspLoginPersistingBean.java | CmsJspLoginPersistingBean.logout | public void logout(boolean invalidateToken) throws IOException {
"""
Logs the user out and optionally invalidates their login token.<p>
@param invalidateToken true if the token should be invalidated
@throws IOException if something goes wrong
"""
if (isLoggedIn() && invalidateToken) {
... | java | public void logout(boolean invalidateToken) throws IOException {
if (isLoggedIn() && invalidateToken) {
CmsUser user = getCmsObject().getRequestContext().getCurrentUser();
CmsPersistentLoginTokenHandler tokenHandler = new CmsPersistentLoginTokenHandler();
try {
... | [
"public",
"void",
"logout",
"(",
"boolean",
"invalidateToken",
")",
"throws",
"IOException",
"{",
"if",
"(",
"isLoggedIn",
"(",
")",
"&&",
"invalidateToken",
")",
"{",
"CmsUser",
"user",
"=",
"getCmsObject",
"(",
")",
".",
"getRequestContext",
"(",
")",
".",... | Logs the user out and optionally invalidates their login token.<p>
@param invalidateToken true if the token should be invalidated
@throws IOException if something goes wrong | [
"Logs",
"the",
"user",
"out",
"and",
"optionally",
"invalidates",
"their",
"login",
"token",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspLoginPersistingBean.java#L135-L157 |
b3log/latke | latke-core/src/main/java/org/json/XML.java | XML.toJSONObject | public static JSONObject toJSONObject(Reader reader, boolean keepStrings) throws JSONException {
"""
Convert a well-formed (but not necessarily valid) XML into a
JSONObject. Some information may be lost in this transformation because
JSON is a data format and XML is a document format. XML uses elements,
attribu... | java | public static JSONObject toJSONObject(Reader reader, boolean keepStrings) throws JSONException {
JSONObject jo = new JSONObject();
XMLTokener x = new XMLTokener(reader);
while (x.more()) {
x.skipPast("<");
if(x.more()) {
parse(x, jo, null, keepStrings);
... | [
"public",
"static",
"JSONObject",
"toJSONObject",
"(",
"Reader",
"reader",
",",
"boolean",
"keepStrings",
")",
"throws",
"JSONException",
"{",
"JSONObject",
"jo",
"=",
"new",
"JSONObject",
"(",
")",
";",
"XMLTokener",
"x",
"=",
"new",
"XMLTokener",
"(",
"reade... | Convert a well-formed (but not necessarily valid) XML into a
JSONObject. Some information may be lost in this transformation because
JSON is a data format and XML is a document format. XML uses elements,
attributes, and content text, while JSON uses unordered collections of
name/value pairs and arrays of values. JSON d... | [
"Convert",
"a",
"well",
"-",
"formed",
"(",
"but",
"not",
"necessarily",
"valid",
")",
"XML",
"into",
"a",
"JSONObject",
".",
"Some",
"information",
"may",
"be",
"lost",
"in",
"this",
"transformation",
"because",
"JSON",
"is",
"a",
"data",
"format",
"and",... | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/json/XML.java#L514-L524 |
Red5/red5-server-common | src/main/java/org/red5/server/scope/Scope.java | Scope.createChildScope | public boolean createChildScope(String name) {
"""
Create child scope of room type, with the given name.
@param name child scope name
@return true on success, false otherwise
"""
// quick lookup by name
log.debug("createChildScope: {}", name);
if (children.hasName(name)) {
... | java | public boolean createChildScope(String name) {
// quick lookup by name
log.debug("createChildScope: {}", name);
if (children.hasName(name)) {
log.debug("Scope: {} already exists, children: {}", name, children.getNames());
} else {
return addChildScope(new Bu... | [
"public",
"boolean",
"createChildScope",
"(",
"String",
"name",
")",
"{",
"// quick lookup by name\r",
"log",
".",
"debug",
"(",
"\"createChildScope: {}\"",
",",
"name",
")",
";",
"if",
"(",
"children",
".",
"hasName",
"(",
"name",
")",
")",
"{",
"log",
".",... | Create child scope of room type, with the given name.
@param name child scope name
@return true on success, false otherwise | [
"Create",
"child",
"scope",
"of",
"room",
"type",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/scope/Scope.java#L295-L304 |
infinispan/infinispan | commons/src/main/java/org/infinispan/commons/marshall/MarshallableTypeHints.java | MarshallableTypeHints.markMarshallable | public void markMarshallable(Class<?> type, boolean isMarshallable) {
"""
Marks a particular type as being marshallable or not being not marshallable.
@param type Class to mark as serializable or non-serializable
@param isMarshallable Whether the type can be marshalled or not.
"""
MarshallingType mar... | java | public void markMarshallable(Class<?> type, boolean isMarshallable) {
MarshallingType marshallType = typeHints.get(type);
if (marshallableUpdateRequired(isMarshallable, marshallType)) {
boolean replaced = typeHints.replace(type, marshallType, new MarshallingType(
Boolean.valueOf(isMa... | [
"public",
"void",
"markMarshallable",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"boolean",
"isMarshallable",
")",
"{",
"MarshallingType",
"marshallType",
"=",
"typeHints",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"marshallableUpdateRequired",
"(",
"isMars... | Marks a particular type as being marshallable or not being not marshallable.
@param type Class to mark as serializable or non-serializable
@param isMarshallable Whether the type can be marshalled or not. | [
"Marks",
"a",
"particular",
"type",
"as",
"being",
"marshallable",
"or",
"not",
"being",
"not",
"marshallable",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/marshall/MarshallableTypeHints.java#L98-L116 |
Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.completeThrowable | final boolean completeThrowable(Throwable x, Object r) {
"""
Completes with the given (non-null) exceptional result as a wrapped CompletionException unless
it is one already, unless already completed. May complete with the given Object r (which must
have been the result of a source future) if it is equivalent, i... | java | final boolean completeThrowable(Throwable x, Object r) {
return U.compareAndSwapObject(this, RESULT, null, encodeThrowable(x, r));
} | [
"final",
"boolean",
"completeThrowable",
"(",
"Throwable",
"x",
",",
"Object",
"r",
")",
"{",
"return",
"U",
".",
"compareAndSwapObject",
"(",
"this",
",",
"RESULT",
",",
"null",
",",
"encodeThrowable",
"(",
"x",
",",
"r",
")",
")",
";",
"}"
] | Completes with the given (non-null) exceptional result as a wrapped CompletionException unless
it is one already, unless already completed. May complete with the given Object r (which must
have been the result of a source future) if it is equivalent, i.e. if this is a simple
propagation of an existing CompletionExcepti... | [
"Completes",
"with",
"the",
"given",
"(",
"non",
"-",
"null",
")",
"exceptional",
"result",
"as",
"a",
"wrapped",
"CompletionException",
"unless",
"it",
"is",
"one",
"already",
"unless",
"already",
"completed",
".",
"May",
"complete",
"with",
"the",
"given",
... | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L626-L628 |
FXMisc/WellBehavedFX | src/main/java/org/fxmisc/wellbehaved/event/template/InputMapTemplate.java | InputMapTemplate.installFallback | public static <S extends Node, E extends Event> void installFallback(InputMapTemplate<S, E> imt, S node) {
"""
Instantiates the input map and installs it into the node via {@link Nodes#addFallbackInputMap(Node, InputMap)}
"""
Nodes.addFallbackInputMap(node, imt.instantiate(node));
} | java | public static <S extends Node, E extends Event> void installFallback(InputMapTemplate<S, E> imt, S node) {
Nodes.addFallbackInputMap(node, imt.instantiate(node));
} | [
"public",
"static",
"<",
"S",
"extends",
"Node",
",",
"E",
"extends",
"Event",
">",
"void",
"installFallback",
"(",
"InputMapTemplate",
"<",
"S",
",",
"E",
">",
"imt",
",",
"S",
"node",
")",
"{",
"Nodes",
".",
"addFallbackInputMap",
"(",
"node",
",",
"... | Instantiates the input map and installs it into the node via {@link Nodes#addFallbackInputMap(Node, InputMap)} | [
"Instantiates",
"the",
"input",
"map",
"and",
"installs",
"it",
"into",
"the",
"node",
"via",
"{"
] | train | https://github.com/FXMisc/WellBehavedFX/blob/ca889734481f5439655ca8deb6f742964b5654b0/src/main/java/org/fxmisc/wellbehaved/event/template/InputMapTemplate.java#L385-L387 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/chunklistener/ChunkListener.java | ChunkListener.callPreListener | public boolean callPreListener(Chunk chunk, BlockPos listener, BlockPos modified, IBlockState oldState, IBlockState newState) {
"""
Calls {@link IBlockListener.Pre#onBlockSet(net.minecraft.world.World, BlockPos, BlockPos, IBlockState, IBlockState)} for the listener
{@link BlockPos}.
@param chunk the chunk
@pa... | java | public boolean callPreListener(Chunk chunk, BlockPos listener, BlockPos modified, IBlockState oldState, IBlockState newState)
{
IBlockListener.Pre bl = IComponent.getComponent(IBlockListener.Pre.class, chunk.getWorld().getBlockState(listener).getBlock());
return bl.onBlockSet(chunk.getWorld(), listener, modified, ... | [
"public",
"boolean",
"callPreListener",
"(",
"Chunk",
"chunk",
",",
"BlockPos",
"listener",
",",
"BlockPos",
"modified",
",",
"IBlockState",
"oldState",
",",
"IBlockState",
"newState",
")",
"{",
"IBlockListener",
".",
"Pre",
"bl",
"=",
"IComponent",
".",
"getCom... | Calls {@link IBlockListener.Pre#onBlockSet(net.minecraft.world.World, BlockPos, BlockPos, IBlockState, IBlockState)} for the listener
{@link BlockPos}.
@param chunk the chunk
@param listener the listener
@param modified the modified
@param oldState the old state
@param newState the new state
@return true, if successfu... | [
"Calls",
"{",
"@link",
"IBlockListener",
".",
"Pre#onBlockSet",
"(",
"net",
".",
"minecraft",
".",
"world",
".",
"World",
"BlockPos",
"BlockPos",
"IBlockState",
"IBlockState",
")",
"}",
"for",
"the",
"listener",
"{",
"@link",
"BlockPos",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/chunklistener/ChunkListener.java#L72-L76 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/to/GeoJsonToAssembler.java | GeoJsonToAssembler.fromTransferObject | public MultiPoint fromTransferObject(MultiPointTo input, CrsId crsId) {
"""
Creates a multipoint object starting from a transfer object.
@param input the multipoint transfer object
@param crsId the crs id to use (ignores the crs of the input). If null, uses the crs of the input.
@return the corresponding geom... | java | public MultiPoint fromTransferObject(MultiPointTo input, CrsId crsId) {
if (input == null) { return null; }
crsId = getCrsId(input, crsId);
isValid(input);
Point[] points = new Point[input.getCoordinates().length];
for (int i = 0; i < points.length; i++) {
points[i]... | [
"public",
"MultiPoint",
"fromTransferObject",
"(",
"MultiPointTo",
"input",
",",
"CrsId",
"crsId",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"crsId",
"=",
"getCrsId",
"(",
"input",
",",
"crsId",
")",
";",
"isValid"... | Creates a multipoint object starting from a transfer object.
@param input the multipoint transfer object
@param crsId the crs id to use (ignores the crs of the input). If null, uses the crs of the input.
@return the corresponding geometry
@throws IllegalArgumentException If the geometry could not be constructed due to... | [
"Creates",
"a",
"multipoint",
"object",
"starting",
"from",
"a",
"transfer",
"object",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/to/GeoJsonToAssembler.java#L396-L407 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/Criteria.java | Criteria.getUserAlias | private UserAlias getUserAlias(Object attribute) {
"""
Retrieves or if necessary, creates a user alias to be used
by a child criteria
@param attribute The alias to set
"""
if (m_userAlias != null)
{
return m_userAlias;
}
if (!(attribute instanceof String))
{
return null;
}
if (m_... | java | private UserAlias getUserAlias(Object attribute)
{
if (m_userAlias != null)
{
return m_userAlias;
}
if (!(attribute instanceof String))
{
return null;
}
if (m_alias == null)
{
return null;
}
if (m_aliasPath == null)
{
boolean allPathsAliased = true;
return new User... | [
"private",
"UserAlias",
"getUserAlias",
"(",
"Object",
"attribute",
")",
"{",
"if",
"(",
"m_userAlias",
"!=",
"null",
")",
"{",
"return",
"m_userAlias",
";",
"}",
"if",
"(",
"!",
"(",
"attribute",
"instanceof",
"String",
")",
")",
"{",
"return",
"null",
... | Retrieves or if necessary, creates a user alias to be used
by a child criteria
@param attribute The alias to set | [
"Retrieves",
"or",
"if",
"necessary",
"creates",
"a",
"user",
"alias",
"to",
"be",
"used",
"by",
"a",
"child",
"criteria"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/Criteria.java#L1055-L1075 |
taskadapter/redmine-java-api | src/main/java/com/taskadapter/redmineapi/internal/comm/betterssl/BetterSSLFactory.java | BetterSSLFactory.createSocketFactory | public static SSLSocketFactory createSocketFactory(Collection<KeyStore> extraStores) throws KeyStoreException, KeyManagementException {
"""
Creates a new SSL socket factory which supports both system-installed
keys and all additional keys in the provided keystores.
@param extraStores
extra keystores containin... | java | public static SSLSocketFactory createSocketFactory(Collection<KeyStore> extraStores) throws KeyStoreException, KeyManagementException {
final Collection<X509TrustManager> managers = new ArrayList<>();
for (KeyStore ks : extraStores) {
addX509Managers(managers, ks);
}
/* Add default manager. */
addX509Mana... | [
"public",
"static",
"SSLSocketFactory",
"createSocketFactory",
"(",
"Collection",
"<",
"KeyStore",
">",
"extraStores",
")",
"throws",
"KeyStoreException",
",",
"KeyManagementException",
"{",
"final",
"Collection",
"<",
"X509TrustManager",
">",
"managers",
"=",
"new",
... | Creates a new SSL socket factory which supports both system-installed
keys and all additional keys in the provided keystores.
@param extraStores
extra keystores containing root certificate authorities.
@return Socket factory supporting authorization for both system (default)
keystores and all the extraStores.
@throws ... | [
"Creates",
"a",
"new",
"SSL",
"socket",
"factory",
"which",
"supports",
"both",
"system",
"-",
"installed",
"keys",
"and",
"all",
"additional",
"keys",
"in",
"the",
"provided",
"keystores",
"."
] | train | https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/comm/betterssl/BetterSSLFactory.java#L37-L53 |
colin-lee/mybatis-spring-support | src/main/java/com/github/mybatis/util/EntityUtil.java | EntityUtil.nameConvert | static String nameConvert(String name, boolean mapCamelCaseToUnderscore) {
"""
将当前的类名转换成数据库表名或者列名。
例如:Blog -> blog, HTTPClient -> http_client, BlogAuthor -> blog_author
@return 转换后的名字
"""
if (!mapCamelCaseToUnderscore)
return name;
StringBuilder sbd = new StringBuilder();
char prevChar = ... | java | static String nameConvert(String name, boolean mapCamelCaseToUnderscore) {
if (!mapCamelCaseToUnderscore)
return name;
StringBuilder sbd = new StringBuilder();
char prevChar = name.charAt(0);
sbd.append(Character.toLowerCase(prevChar));
for (int i = 1, len = name.length(); i < len; i++) {
... | [
"static",
"String",
"nameConvert",
"(",
"String",
"name",
",",
"boolean",
"mapCamelCaseToUnderscore",
")",
"{",
"if",
"(",
"!",
"mapCamelCaseToUnderscore",
")",
"return",
"name",
";",
"StringBuilder",
"sbd",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"char",
... | 将当前的类名转换成数据库表名或者列名。
例如:Blog -> blog, HTTPClient -> http_client, BlogAuthor -> blog_author
@return 转换后的名字 | [
"将当前的类名转换成数据库表名或者列名。",
"例如:Blog",
"-",
">",
"blog,",
"HTTPClient",
"-",
">",
"http_client",
"BlogAuthor",
"-",
">",
"blog_author"
] | train | https://github.com/colin-lee/mybatis-spring-support/blob/de412e98d00e9a012c0619778fa1a61832863b82/src/main/java/com/github/mybatis/util/EntityUtil.java#L124-L145 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/trace/Status.java | Status.withDescription | public Status withDescription(@Nullable String description) {
"""
Creates a derived instance of {@code Status} with the given description.
@param description the new description of the {@code Status}.
@return The newly created {@code Status} with the given description.
@since 0.5
"""
if (Utils.equalsO... | java | public Status withDescription(@Nullable String description) {
if (Utils.equalsObjects(this.description, description)) {
return this;
}
return new Status(this.canonicalCode, description);
} | [
"public",
"Status",
"withDescription",
"(",
"@",
"Nullable",
"String",
"description",
")",
"{",
"if",
"(",
"Utils",
".",
"equalsObjects",
"(",
"this",
".",
"description",
",",
"description",
")",
")",
"{",
"return",
"this",
";",
"}",
"return",
"new",
"Stat... | Creates a derived instance of {@code Status} with the given description.
@param description the new description of the {@code Status}.
@return The newly created {@code Status} with the given description.
@since 0.5 | [
"Creates",
"a",
"derived",
"instance",
"of",
"{",
"@code",
"Status",
"}",
"with",
"the",
"given",
"description",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/Status.java#L396-L401 |
alkacon/opencms-core | src/org/opencms/module/CmsModuleManager.java | CmsModuleManager.addModule | public synchronized void addModule(CmsObject cms, CmsModule module)
throws CmsSecurityException, CmsConfigurationException {
"""
Adds a new module to the module manager.<p>
@param cms must be initialized with "Admin" permissions
@param module the module to add
@throws CmsSecurityException if the require... | java | public synchronized void addModule(CmsObject cms, CmsModule module)
throws CmsSecurityException, CmsConfigurationException {
// check the role permissions
OpenCms.getRoleManager().checkRole(cms, CmsRole.DATABASE_MANAGER);
if (m_modules.containsKey(module.getName())) {
// module... | [
"public",
"synchronized",
"void",
"addModule",
"(",
"CmsObject",
"cms",
",",
"CmsModule",
"module",
")",
"throws",
"CmsSecurityException",
",",
"CmsConfigurationException",
"{",
"// check the role permissions",
"OpenCms",
".",
"getRoleManager",
"(",
")",
".",
"checkRole... | Adds a new module to the module manager.<p>
@param cms must be initialized with "Admin" permissions
@param module the module to add
@throws CmsSecurityException if the required permissions are not available (i.e. no "Admin" CmsObject has been provided)
@throws CmsConfigurationException if a module with this name is a... | [
"Adds",
"a",
"new",
"module",
"to",
"the",
"module",
"manager",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/module/CmsModuleManager.java#L339-L381 |
windup/windup | reporting/impl/src/main/java/org/jboss/windup/reporting/rules/generation/techreport/TechReportService.java | TechReportService.normalizePlacement | private static TechReportPlacement normalizePlacement(GraphContext graphContext, TechReportPlacement placement) {
"""
This relies on the tag structure in the XML when the place:* mapping tags have exactly one parent outside the place: group, which is the tag
they are mapped to.
"""
TagGraphService tag... | java | private static TechReportPlacement normalizePlacement(GraphContext graphContext, TechReportPlacement placement)
{
TagGraphService tagService = new TagGraphService(graphContext);
final TechReportPlacement normalPlacement = new TechReportPlacement();
normalPlacement.sector = getNonPlaceParent... | [
"private",
"static",
"TechReportPlacement",
"normalizePlacement",
"(",
"GraphContext",
"graphContext",
",",
"TechReportPlacement",
"placement",
")",
"{",
"TagGraphService",
"tagService",
"=",
"new",
"TagGraphService",
"(",
"graphContext",
")",
";",
"final",
"TechReportPla... | This relies on the tag structure in the XML when the place:* mapping tags have exactly one parent outside the place: group, which is the tag
they are mapped to. | [
"This",
"relies",
"on",
"the",
"tag",
"structure",
"in",
"the",
"XML",
"when",
"the",
"place",
":",
"*",
"mapping",
"tags",
"have",
"exactly",
"one",
"parent",
"outside",
"the",
"place",
":",
"group",
"which",
"is",
"the",
"tag",
"they",
"are",
"mapped",... | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/impl/src/main/java/org/jboss/windup/reporting/rules/generation/techreport/TechReportService.java#L130-L139 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.copy | public static long copy(Reader reader, Writer writer, int bufferSize) throws IORuntimeException {
"""
将Reader中的内容复制到Writer中
@param reader Reader
@param writer Writer
@param bufferSize 缓存大小
@return 传输的byte数
@throws IORuntimeException IO异常
"""
return copy(reader, writer, bufferSize, null);
} | java | public static long copy(Reader reader, Writer writer, int bufferSize) throws IORuntimeException {
return copy(reader, writer, bufferSize, null);
} | [
"public",
"static",
"long",
"copy",
"(",
"Reader",
"reader",
",",
"Writer",
"writer",
",",
"int",
"bufferSize",
")",
"throws",
"IORuntimeException",
"{",
"return",
"copy",
"(",
"reader",
",",
"writer",
",",
"bufferSize",
",",
"null",
")",
";",
"}"
] | 将Reader中的内容复制到Writer中
@param reader Reader
@param writer Writer
@param bufferSize 缓存大小
@return 传输的byte数
@throws IORuntimeException IO异常 | [
"将Reader中的内容复制到Writer中"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L86-L88 |
infinispan/infinispan | persistence/remote/src/main/java/org/infinispan/persistence/remote/configuration/ExecutorFactoryConfigurationBuilder.java | ExecutorFactoryConfigurationBuilder.addExecutorProperty | public ExecutorFactoryConfigurationBuilder addExecutorProperty(String key, String value) {
"""
Add key/value property pair to this executor factory configuration
@param key
property key
@param value
property value
@return previous value if exists, null otherwise
"""
TypedProperties properties = at... | java | public ExecutorFactoryConfigurationBuilder addExecutorProperty(String key, String value) {
TypedProperties properties = attributes.attribute(PROPERTIES).get();
properties.put(key, value);
attributes.attribute(PROPERTIES).set(properties);
return this;
} | [
"public",
"ExecutorFactoryConfigurationBuilder",
"addExecutorProperty",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"TypedProperties",
"properties",
"=",
"attributes",
".",
"attribute",
"(",
"PROPERTIES",
")",
".",
"get",
"(",
")",
";",
"properties",
"... | Add key/value property pair to this executor factory configuration
@param key
property key
@param value
property value
@return previous value if exists, null otherwise | [
"Add",
"key",
"/",
"value",
"property",
"pair",
"to",
"this",
"executor",
"factory",
"configuration"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/persistence/remote/src/main/java/org/infinispan/persistence/remote/configuration/ExecutorFactoryConfigurationBuilder.java#L59-L64 |
couchbase/CouchbaseMock | src/main/java/com/couchbase/mock/memcached/protocol/BinaryConfigResponse.java | BinaryConfigResponse.createGetConfig | public static BinaryResponse createGetConfig(BinaryCommand command, MemcachedServer server) {
"""
Creates a response for {@code CMD_GET_CONFIG}
@param command The command received
@param server The server
@return A response containing the config with a successful code, or
an empty response with NOT_SUPPORTED
... | java | public static BinaryResponse createGetConfig(BinaryCommand command, MemcachedServer server) {
return create(command, server, ErrorCode.SUCCESS, ErrorCode.NOT_SUPPORTED);
} | [
"public",
"static",
"BinaryResponse",
"createGetConfig",
"(",
"BinaryCommand",
"command",
",",
"MemcachedServer",
"server",
")",
"{",
"return",
"create",
"(",
"command",
",",
"server",
",",
"ErrorCode",
".",
"SUCCESS",
",",
"ErrorCode",
".",
"NOT_SUPPORTED",
")",
... | Creates a response for {@code CMD_GET_CONFIG}
@param command The command received
@param server The server
@return A response containing the config with a successful code, or
an empty response with NOT_SUPPORTED | [
"Creates",
"a",
"response",
"for",
"{"
] | train | https://github.com/couchbase/CouchbaseMock/blob/2085bbebade1d5b6356480e7bf335139d08383da/src/main/java/com/couchbase/mock/memcached/protocol/BinaryConfigResponse.java#L68-L70 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.rebuildInstance | public void rebuildInstance(String instanceId, String imageId, String adminPass) throws BceClientException {
"""
Rebuilding the instance owned by the user.
After rebuilding the instance,
all of snapshots created from original instance system disk will be deleted,
all of customized images will be saved for usi... | java | public void rebuildInstance(String instanceId, String imageId, String adminPass) throws BceClientException {
this.rebuildInstance(new RebuildInstanceRequest().withInstanceId(instanceId)
.withImageId(imageId).withAdminPass(adminPass));
} | [
"public",
"void",
"rebuildInstance",
"(",
"String",
"instanceId",
",",
"String",
"imageId",
",",
"String",
"adminPass",
")",
"throws",
"BceClientException",
"{",
"this",
".",
"rebuildInstance",
"(",
"new",
"RebuildInstanceRequest",
"(",
")",
".",
"withInstanceId",
... | Rebuilding the instance owned by the user.
After rebuilding the instance,
all of snapshots created from original instance system disk will be deleted,
all of customized images will be saved for using in the future.
This is an asynchronous interface,
you can get the latest status by invoke {@link #getInstance(GetInsta... | [
"Rebuilding",
"the",
"instance",
"owned",
"by",
"the",
"user",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L597-L600 |
Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/guice/LifecycleInjector.java | LifecycleInjector.createInjector | public Injector createInjector(Collection<Module> additionalModules) {
"""
Create the main injector
@param additionalModules any additional modules
@return injector
"""
List<Module> localModules = Lists.newArrayList();
// Add the discovered modules FIRST. The discovered modules
... | java | public Injector createInjector(Collection<Module> additionalModules)
{
List<Module> localModules = Lists.newArrayList();
// Add the discovered modules FIRST. The discovered modules
// are added, and will subsequently be configured, in module dependency
// order which will ... | [
"public",
"Injector",
"createInjector",
"(",
"Collection",
"<",
"Module",
">",
"additionalModules",
")",
"{",
"List",
"<",
"Module",
">",
"localModules",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"// Add the discovered modules FIRST. The discovered modules",
... | Create the main injector
@param additionalModules any additional modules
@return injector | [
"Create",
"the",
"main",
"injector"
] | train | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/guice/LifecycleInjector.java#L372-L412 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/application/ProcessApplicationContext.java | ProcessApplicationContext.withProcessApplicationContext | public static <T> T withProcessApplicationContext(Callable<T> callable, String processApplicationName) throws Exception {
"""
<p>Takes a callable and executes all engine API invocations within that callable in the context
of the given process application
<p>Equivalent to
<pre>
try {
ProcessApplicationContex... | java | public static <T> T withProcessApplicationContext(Callable<T> callable, String processApplicationName) throws Exception {
try {
setCurrentProcessApplication(processApplicationName);
return callable.call();
}
finally {
clear();
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withProcessApplicationContext",
"(",
"Callable",
"<",
"T",
">",
"callable",
",",
"String",
"processApplicationName",
")",
"throws",
"Exception",
"{",
"try",
"{",
"setCurrentProcessApplication",
"(",
"processApplicationName",
... | <p>Takes a callable and executes all engine API invocations within that callable in the context
of the given process application
<p>Equivalent to
<pre>
try {
ProcessApplicationContext.setCurrentProcessApplication("someProcessApplication");
callable.call();
} finally {
ProcessApplicationContext.clear();
}
</pre>
@para... | [
"<p",
">",
"Takes",
"a",
"callable",
"and",
"executes",
"all",
"engine",
"API",
"invocations",
"within",
"that",
"callable",
"in",
"the",
"context",
"of",
"the",
"given",
"process",
"application"
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/application/ProcessApplicationContext.java#L120-L128 |
beders/Resty | src/main/java/us/monoid/util/EncoderUtil.java | EncoderUtil.encodeAddressDisplayName | public static String encodeAddressDisplayName(String displayName) {
"""
Encodes the display-name portion of an address. See <a
href='http://www.faqs.org/rfcs/rfc5322.html'>RFC 5322</a> section 3.4 and
<a href='http://www.faqs.org/rfcs/rfc2047.html'>RFC 2047</a> section 5.3.
The specified string should not be fo... | java | public static String encodeAddressDisplayName(String displayName) {
// display-name = phrase
// phrase = 1*( encoded-word / word )
// word = atom / quoted-string
// atom = [CFWS] 1*atext [CFWS]
// CFWS = comment or folding white space
if (isAtomPhrase(displayName)) {
return displayName;
} else if (has... | [
"public",
"static",
"String",
"encodeAddressDisplayName",
"(",
"String",
"displayName",
")",
"{",
"// display-name = phrase",
"// phrase = 1*( encoded-word / word )",
"// word = atom / quoted-string",
"// atom = [CFWS] 1*atext [CFWS]",
"// CFWS = comment or folding white space",
"if",
... | Encodes the display-name portion of an address. See <a
href='http://www.faqs.org/rfcs/rfc5322.html'>RFC 5322</a> section 3.4 and
<a href='http://www.faqs.org/rfcs/rfc2047.html'>RFC 2047</a> section 5.3.
The specified string should not be folded.
@param displayName
display-name to encode.
@return encoded display-name. | [
"Encodes",
"the",
"display",
"-",
"name",
"portion",
"of",
"an",
"address",
".",
"See",
"<a",
"href",
"=",
"http",
":",
"//",
"www",
".",
"faqs",
".",
"org",
"/",
"rfcs",
"/",
"rfc5322",
".",
"html",
">",
"RFC",
"5322<",
"/",
"a",
">",
"section",
... | train | https://github.com/beders/Resty/blob/4493603e9689c942cc3e53b9c5018010e414a364/src/main/java/us/monoid/util/EncoderUtil.java#L115-L129 |
zaproxy/zaproxy | src/org/zaproxy/zap/view/TabbedPanel2.java | TabbedPanel2.setVisible | public void setVisible(Component c, boolean visible) {
"""
Sets whether or not the given component (and corresponding tab) is visible.
<p>
<strong>Note:</strong> Non-{@link AbstractPanel#isHideable() hideable} and {@link AbstractPanel#isPinned() pinned} panels
are hidden as well.
@param c the component to sh... | java | public void setVisible(Component c, boolean visible) {
if (visible) {
if (this.hiddenTabs.contains(c)) {
if (c instanceof AbstractPanel) {
// Don't use the addTab(AbstractPanel) methods as we need to force visibility
AbstractPanel panel = (AbstractPanel)c;
this.addTab(c.getName(), panel.get... | [
"public",
"void",
"setVisible",
"(",
"Component",
"c",
",",
"boolean",
"visible",
")",
"{",
"if",
"(",
"visible",
")",
"{",
"if",
"(",
"this",
".",
"hiddenTabs",
".",
"contains",
"(",
"c",
")",
")",
"{",
"if",
"(",
"c",
"instanceof",
"AbstractPanel",
... | Sets whether or not the given component (and corresponding tab) is visible.
<p>
<strong>Note:</strong> Non-{@link AbstractPanel#isHideable() hideable} and {@link AbstractPanel#isPinned() pinned} panels
are hidden as well.
@param c the component to show or hide.
@param visible {@code true} if the tab of the component s... | [
"Sets",
"whether",
"or",
"not",
"the",
"given",
"component",
"(",
"and",
"corresponding",
"tab",
")",
"is",
"visible",
".",
"<p",
">",
"<strong",
">",
"Note",
":",
"<",
"/",
"strong",
">",
"Non",
"-",
"{",
"@link",
"AbstractPanel#isHideable",
"()",
"hide... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/TabbedPanel2.java#L225-L253 |
BioPAX/Paxtools | paxtools-core/src/main/java/org/biopax/paxtools/converter/LevelUpgrader.java | LevelUpgrader.getMappedPE | private PhysicalEntity getMappedPE(physicalEntityParticipant pep, Model newModel) {
"""
/*
pEP->PE; pE->ER class mapping was done for "simple" entities;
for complex and the "basic" pE, it is pE->PE mapping
(although pEPs were skipped, their properties are to save anyway)
"""
String id = pep2PE.get(pep.get... | java | private PhysicalEntity getMappedPE(physicalEntityParticipant pep, Model newModel)
{
String id = pep2PE.get(pep.getUri());
physicalEntity pe2er = pep.getPHYSICAL_ENTITY();
if(id == null || pe2er == null)
throw new IllegalAccessError("Illegal pEP (cannot convert): "
+ pep.getUri());
BioPAXElement p... | [
"private",
"PhysicalEntity",
"getMappedPE",
"(",
"physicalEntityParticipant",
"pep",
",",
"Model",
"newModel",
")",
"{",
"String",
"id",
"=",
"pep2PE",
".",
"get",
"(",
"pep",
".",
"getUri",
"(",
")",
")",
";",
"physicalEntity",
"pe2er",
"=",
"pep",
".",
"... | /*
pEP->PE; pE->ER class mapping was done for "simple" entities;
for complex and the "basic" pE, it is pE->PE mapping
(although pEPs were skipped, their properties are to save anyway) | [
"/",
"*",
"pEP",
"-",
">",
"PE",
";",
"pE",
"-",
">",
"ER",
"class",
"mapping",
"was",
"done",
"for",
"simple",
"entities",
";",
"for",
"complex",
"and",
"the",
"basic",
"pE",
"it",
"is",
"pE",
"-",
">",
"PE",
"mapping",
"(",
"although",
"pEPs",
... | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/converter/LevelUpgrader.java#L450-L477 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/Iterate.java | Iterate.removeAllFrom | public static <T, R extends Collection<T>> R removeAllFrom(Iterable<? extends T> iterable, R targetCollection) {
"""
Remove all elements present in Iterable from the target collection, return the target collection.
"""
Iterate.removeAllIterable(iterable, targetCollection);
return targetCollecti... | java | public static <T, R extends Collection<T>> R removeAllFrom(Iterable<? extends T> iterable, R targetCollection)
{
Iterate.removeAllIterable(iterable, targetCollection);
return targetCollection;
} | [
"public",
"static",
"<",
"T",
",",
"R",
"extends",
"Collection",
"<",
"T",
">",
">",
"R",
"removeAllFrom",
"(",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"iterable",
",",
"R",
"targetCollection",
")",
"{",
"Iterate",
".",
"removeAllIterable",
"(",
"iter... | Remove all elements present in Iterable from the target collection, return the target collection. | [
"Remove",
"all",
"elements",
"present",
"in",
"Iterable",
"from",
"the",
"target",
"collection",
"return",
"the",
"target",
"collection",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/Iterate.java#L1142-L1146 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jEntityQueries.java | BaseNeo4jEntityQueries.completeFindAssociationQuery | private String completeFindAssociationQuery(String relationshipType, AssociationKeyMetadata associationKeyMetadata) {
"""
/*
Example:
MATCH (owner:ENTITY:Car {`carId.maker`: {0}, `carId.model`: {1}}) <-[r:tires]- (target)
RETURN r, owner, target
or for embedded associations:
MATCH (owner:ENTITY:StoryGam... | java | private String completeFindAssociationQuery(String relationshipType, AssociationKeyMetadata associationKeyMetadata) {
StringBuilder queryBuilder = findAssociationPartialQuery( relationshipType, associationKeyMetadata );
queryBuilder.append( "RETURN id(target), r, " );
queryBuilder.append( ENTITY_ALIAS );
queryB... | [
"private",
"String",
"completeFindAssociationQuery",
"(",
"String",
"relationshipType",
",",
"AssociationKeyMetadata",
"associationKeyMetadata",
")",
"{",
"StringBuilder",
"queryBuilder",
"=",
"findAssociationPartialQuery",
"(",
"relationshipType",
",",
"associationKeyMetadata",
... | /*
Example:
MATCH (owner:ENTITY:Car {`carId.maker`: {0}, `carId.model`: {1}}) <-[r:tires]- (target)
RETURN r, owner, target
or for embedded associations:
MATCH (owner:ENTITY:StoryGame {id: {0}}) -[:evilBranch]-> (:EMBEDDED) -[r:additionalEndings]-> (target:EMBEDDED)
RETURN id(target), r, owner, target ORDER BY id(ta... | [
"/",
"*",
"Example",
":"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jEntityQueries.java#L338-L344 |
aws/aws-sdk-java | aws-java-sdk-pi/src/main/java/com/amazonaws/services/pi/model/ResponseResourceMetricKey.java | ResponseResourceMetricKey.withDimensions | public ResponseResourceMetricKey withDimensions(java.util.Map<String, String> dimensions) {
"""
<p>
The valid dimensions for the metric.
</p>
@param dimensions
The valid dimensions for the metric.
@return Returns a reference to this object so that method calls can be chained together.
"""
setDim... | java | public ResponseResourceMetricKey withDimensions(java.util.Map<String, String> dimensions) {
setDimensions(dimensions);
return this;
} | [
"public",
"ResponseResourceMetricKey",
"withDimensions",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"dimensions",
")",
"{",
"setDimensions",
"(",
"dimensions",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The valid dimensions for the metric.
</p>
@param dimensions
The valid dimensions for the metric.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"valid",
"dimensions",
"for",
"the",
"metric",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pi/src/main/java/com/amazonaws/services/pi/model/ResponseResourceMetricKey.java#L224-L227 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/util/BooleanFormula.java | BooleanFormula.addExpandTerm | private static void addExpandTerm(int i, int ord, int byteValue, Term termValue, Set<Integer> terms) {
"""
Utility method to expand a term and add it to the list of results when the
expansion is complete. The result terms are represented using a list of
integer bit-fields, with each integer representing a term ... | java | private static void addExpandTerm(int i, int ord, int byteValue, Term termValue, Set<Integer> terms) {
if (i < ord) {
int mask = 1 << i;
byte bitValue = termValue.get(i);
if (bitValue == 1) {
byteValue |= (-1 & mask);
addExpandTerm(i+1, ord, byteValue, termValue, terms);
} else if (bitValue... | [
"private",
"static",
"void",
"addExpandTerm",
"(",
"int",
"i",
",",
"int",
"ord",
",",
"int",
"byteValue",
",",
"Term",
"termValue",
",",
"Set",
"<",
"Integer",
">",
"terms",
")",
"{",
"if",
"(",
"i",
"<",
"ord",
")",
"{",
"int",
"mask",
"=",
"1",
... | Utility method to expand a term and add it to the list of results when the
expansion is complete. The result terms are represented using a list of
integer bit-fields, with each integer representing a term in bit-field form.
This usage imposes a size limit of {@link Integer#SIZE} on the terms that
can be handled by th... | [
"Utility",
"method",
"to",
"expand",
"a",
"term",
"and",
"add",
"it",
"to",
"the",
"list",
"of",
"results",
"when",
"the",
"expansion",
"is",
"complete",
".",
"The",
"result",
"terms",
"are",
"represented",
"using",
"a",
"list",
"of",
"integer",
"bit",
"... | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/BooleanFormula.java#L656-L674 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java | ImageLoading.getScaleFactor | private static int getScaleFactor(ImageMetadata metadata, int maxPixels) {
"""
Calculating scale factor with limit of pixel amount
@param metadata image metadata
@param maxPixels limit for pixels
@return scale factor
"""
int scale = 1;
int scaledW = metadata.getW();
int scaledH = ... | java | private static int getScaleFactor(ImageMetadata metadata, int maxPixels) {
int scale = 1;
int scaledW = metadata.getW();
int scaledH = metadata.getH();
while (scaledW * scaledH > maxPixels) {
scale *= 2;
scaledH /= 2;
scaledW /= 2;
}
re... | [
"private",
"static",
"int",
"getScaleFactor",
"(",
"ImageMetadata",
"metadata",
",",
"int",
"maxPixels",
")",
"{",
"int",
"scale",
"=",
"1",
";",
"int",
"scaledW",
"=",
"metadata",
".",
"getW",
"(",
")",
";",
"int",
"scaledH",
"=",
"metadata",
".",
"getH... | Calculating scale factor with limit of pixel amount
@param metadata image metadata
@param maxPixels limit for pixels
@return scale factor | [
"Calculating",
"scale",
"factor",
"with",
"limit",
"of",
"pixel",
"amount"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java#L535-L545 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java | ApiOvhEmailpro.service_account_email_fullAccess_allowedAccountId_GET | public OvhAccountFullAccess service_account_email_fullAccess_allowedAccountId_GET(String service, String email, Long allowedAccountId) throws IOException {
"""
Get this object properties
REST: GET /email/pro/{service}/account/{email}/fullAccess/{allowedAccountId}
@param service [required] The internal name of ... | java | public OvhAccountFullAccess service_account_email_fullAccess_allowedAccountId_GET(String service, String email, Long allowedAccountId) throws IOException {
String qPath = "/email/pro/{service}/account/{email}/fullAccess/{allowedAccountId}";
StringBuilder sb = path(qPath, service, email, allowedAccountId);
String ... | [
"public",
"OvhAccountFullAccess",
"service_account_email_fullAccess_allowedAccountId_GET",
"(",
"String",
"service",
",",
"String",
"email",
",",
"Long",
"allowedAccountId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/pro/{service}/account/{email}/fullA... | Get this object properties
REST: GET /email/pro/{service}/account/{email}/fullAccess/{allowedAccountId}
@param service [required] The internal name of your pro organization
@param email [required] Default email for this mailbox
@param allowedAccountId [required] Account id to give full access
API beta | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java#L337-L342 |
netty/netty | buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java | CompositeByteBuf.removeComponents | public CompositeByteBuf removeComponents(int cIndex, int numComponents) {
"""
Remove the number of {@link ByteBuf}s starting from the given index.
@param cIndex the index on which the {@link ByteBuf}s will be started to removed
@param numComponents the number of components to remove
"""
checkCompon... | java | public CompositeByteBuf removeComponents(int cIndex, int numComponents) {
checkComponentIndex(cIndex, numComponents);
if (numComponents == 0) {
return this;
}
int endIndex = cIndex + numComponents;
boolean needsUpdate = false;
for (int i = cIndex; i < endInde... | [
"public",
"CompositeByteBuf",
"removeComponents",
"(",
"int",
"cIndex",
",",
"int",
"numComponents",
")",
"{",
"checkComponentIndex",
"(",
"cIndex",
",",
"numComponents",
")",
";",
"if",
"(",
"numComponents",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
... | Remove the number of {@link ByteBuf}s starting from the given index.
@param cIndex the index on which the {@link ByteBuf}s will be started to removed
@param numComponents the number of components to remove | [
"Remove",
"the",
"number",
"of",
"{",
"@link",
"ByteBuf",
"}",
"s",
"starting",
"from",
"the",
"given",
"index",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java#L599-L624 |
lucee/Lucee | core/src/main/java/lucee/runtime/schedule/StorageUtil.java | StorageUtil.toBoolean | public boolean toBoolean(Element el, String attributeName, boolean defaultValue) {
"""
reads a XML Element Attribute ans cast it to a boolean value
@param el XML Element to read Attribute from it
@param attributeName Name of the Attribute to read
@param defaultValue if attribute doesn't exist return default v... | java | public boolean toBoolean(Element el, String attributeName, boolean defaultValue) {
String value = el.getAttribute(attributeName);
if (value == null) return defaultValue;
return Caster.toBooleanValue(value, false);
} | [
"public",
"boolean",
"toBoolean",
"(",
"Element",
"el",
",",
"String",
"attributeName",
",",
"boolean",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"el",
".",
"getAttribute",
"(",
"attributeName",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"ret... | reads a XML Element Attribute ans cast it to a boolean value
@param el XML Element to read Attribute from it
@param attributeName Name of the Attribute to read
@param defaultValue if attribute doesn't exist return default value
@return Attribute Value | [
"reads",
"a",
"XML",
"Element",
"Attribute",
"ans",
"cast",
"it",
"to",
"a",
"boolean",
"value"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/schedule/StorageUtil.java#L198-L202 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/file/PathOperations.java | PathOperations.deleteFile | @Nonnull
public static FileIOError deleteFile (@Nonnull final Path aFile) {
"""
Delete an existing file.
@param aFile
The file to be deleted. May not be <code>null</code>.
@return A non-<code>null</code> error code.
"""
ValueEnforcer.notNull (aFile, "Path");
final Path aRealFile = _getUnifiedPa... | java | @Nonnull
public static FileIOError deleteFile (@Nonnull final Path aFile)
{
ValueEnforcer.notNull (aFile, "Path");
final Path aRealFile = _getUnifiedPath (aFile);
if (!aRealFile.toFile ().isFile ())
return EFileIOErrorCode.SOURCE_DOES_NOT_EXIST.getAsIOError (EFileIOOperation.DELETE_FILE, aRealFi... | [
"@",
"Nonnull",
"public",
"static",
"FileIOError",
"deleteFile",
"(",
"@",
"Nonnull",
"final",
"Path",
"aFile",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aFile",
",",
"\"Path\"",
")",
";",
"final",
"Path",
"aRealFile",
"=",
"_getUnifiedPath",
"(",
"aF... | Delete an existing file.
@param aFile
The file to be deleted. May not be <code>null</code>.
@return A non-<code>null</code> error code. | [
"Delete",
"an",
"existing",
"file",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/file/PathOperations.java#L382-L398 |
tcurdt/jdeb | src/main/java/org/vafer/jdeb/producers/Producers.java | Producers.defaultFileEntryWithName | static TarArchiveEntry defaultFileEntryWithName( final String fileName ) {
"""
Creates a tar file entry with defaults parameters.
@param fileName the entry name
@return file entry with reasonable defaults
"""
TarArchiveEntry entry = new TarArchiveEntry(fileName, true);
entry.setUserId(ROOT_UI... | java | static TarArchiveEntry defaultFileEntryWithName( final String fileName ) {
TarArchiveEntry entry = new TarArchiveEntry(fileName, true);
entry.setUserId(ROOT_UID);
entry.setUserName(ROOT_NAME);
entry.setGroupId(ROOT_UID);
entry.setGroupName(ROOT_NAME);
entry.setMode(TarArc... | [
"static",
"TarArchiveEntry",
"defaultFileEntryWithName",
"(",
"final",
"String",
"fileName",
")",
"{",
"TarArchiveEntry",
"entry",
"=",
"new",
"TarArchiveEntry",
"(",
"fileName",
",",
"true",
")",
";",
"entry",
".",
"setUserId",
"(",
"ROOT_UID",
")",
";",
"entry... | Creates a tar file entry with defaults parameters.
@param fileName the entry name
@return file entry with reasonable defaults | [
"Creates",
"a",
"tar",
"file",
"entry",
"with",
"defaults",
"parameters",
"."
] | train | https://github.com/tcurdt/jdeb/blob/b899a7b1b3391356aafc491ab601f258961f67f0/src/main/java/org/vafer/jdeb/producers/Producers.java#L42-L50 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.replaceExtension | @Pure
public static File replaceExtension(File filename, String extension) {
"""
Replace the extension of the specified filename by the given extension.
If the filename has no extension, the specified one will be added.
@param filename is the filename to parse.
@param extension is the extension to remove if ... | java | @Pure
public static File replaceExtension(File filename, String extension) {
if (filename == null) {
return null;
}
if (extension == null) {
return filename;
}
final File dir = filename.getParentFile();
final String name = filename.getName();
final int idx = name.lastIndexOf(getFileExtensionCharact... | [
"@",
"Pure",
"public",
"static",
"File",
"replaceExtension",
"(",
"File",
"filename",
",",
"String",
"extension",
")",
"{",
"if",
"(",
"filename",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"extension",
"==",
"null",
")",
"{",
"retu... | Replace the extension of the specified filename by the given extension.
If the filename has no extension, the specified one will be added.
@param filename is the filename to parse.
@param extension is the extension to remove if it is existing.
@return the filename without the extension. | [
"Replace",
"the",
"extension",
"of",
"the",
"specified",
"filename",
"by",
"the",
"given",
"extension",
".",
"If",
"the",
"filename",
"has",
"no",
"extension",
"the",
"specified",
"one",
"will",
"be",
"added",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L1296-L1318 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/stereo/CyclicCarbohydrateRecognition.java | CyclicCarbohydrateRecognition.horizontalOffset | private Point2d horizontalOffset(Point2d[] points, Turn[] turns, Projection projection) {
"""
Determine the horizontal offset of the projection. This allows
projections that are drawn at angle to be correctly interpreted.
Currently only projections of chair conformations are considered.
@param points poin... | java | private Point2d horizontalOffset(Point2d[] points, Turn[] turns, Projection projection) {
// Haworth must currently be drawn vertically, I have seen them drawn
// slanted but it's difficult to determine which way the projection
// is relative
if (projection != Projection.Chair)
... | [
"private",
"Point2d",
"horizontalOffset",
"(",
"Point2d",
"[",
"]",
"points",
",",
"Turn",
"[",
"]",
"turns",
",",
"Projection",
"projection",
")",
"{",
"// Haworth must currently be drawn vertically, I have seen them drawn",
"// slanted but it's difficult to determine which wa... | Determine the horizontal offset of the projection. This allows
projections that are drawn at angle to be correctly interpreted.
Currently only projections of chair conformations are considered.
@param points points of the cycle
@param turns the turns in the cycle (left/right)
@param projection the type of pro... | [
"Determine",
"the",
"horizontal",
"offset",
"of",
"the",
"projection",
".",
"This",
"allows",
"projections",
"that",
"are",
"drawn",
"at",
"angle",
"to",
"be",
"correctly",
"interpreted",
".",
"Currently",
"only",
"projections",
"of",
"chair",
"conformations",
"... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/stereo/CyclicCarbohydrateRecognition.java#L390-L420 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.deleteCertificateOperation | public CertificateOperation deleteCertificateOperation(String vaultBaseUrl, String certificateName) {
"""
Deletes the creation operation for a specific certificate.
Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operat... | java | public CertificateOperation deleteCertificateOperation(String vaultBaseUrl, String certificateName) {
return deleteCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body();
} | [
"public",
"CertificateOperation",
"deleteCertificateOperation",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
")",
"{",
"return",
"deleteCertificateOperationWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"certificateName",
")",
".",
"toBlocking",
"(",... | Deletes the creation operation for a specific certificate.
Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission.
@param vaultBaseUrl The vault name, for example https://myvaul... | [
"Deletes",
"the",
"creation",
"operation",
"for",
"a",
"specific",
"certificate",
".",
"Deletes",
"the",
"creation",
"operation",
"for",
"a",
"specified",
"certificate",
"that",
"is",
"in",
"the",
"process",
"of",
"being",
"created",
".",
"The",
"certificate",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L7822-L7824 |
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.deleteCompositeEntityAsync | public Observable<OperationStatus> deleteCompositeEntityAsync(UUID appId, String versionId, UUID cEntityId) {
"""
Deletes a composite entity extractor from the application.
@param appId The application ID.
@param versionId The version ID.
@param cEntityId The composite entity extractor ID.
@throws IllegalArg... | java | public Observable<OperationStatus> deleteCompositeEntityAsync(UUID appId, String versionId, UUID cEntityId) {
return deleteCompositeEntityWithServiceResponseAsync(appId, versionId, cEntityId).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Override
public OperationS... | [
"public",
"Observable",
"<",
"OperationStatus",
">",
"deleteCompositeEntityAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"cEntityId",
")",
"{",
"return",
"deleteCompositeEntityWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"cE... | Deletes a composite entity extractor from the application.
@param appId The application ID.
@param versionId The version ID.
@param cEntityId The composite entity extractor ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatus object | [
"Deletes",
"a",
"composite",
"entity",
"extractor",
"from",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L4154-L4161 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListUserSegmentEntryRelPersistenceImpl.java | CommercePriceListUserSegmentEntryRelPersistenceImpl.findAll | @Override
public List<CommercePriceListUserSegmentEntryRel> findAll(int start, int end) {
"""
Returns a range of all the commerce price list user segment entry rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not pri... | java | @Override
public List<CommercePriceListUserSegmentEntryRel> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommercePriceListUserSegmentEntryRel",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce price list user segment entry rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the s... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"price",
"list",
"user",
"segment",
"entry",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListUserSegmentEntryRelPersistenceImpl.java#L3005-L3008 |
groovy/groovy-core | src/main/groovy/lang/GroovyClassLoader.java | GroovyClassLoader.recompile | protected Class recompile(URL source, String className, Class oldClass) throws CompilationFailedException, IOException {
"""
(Re)Compiles the given source.
This method starts the compilation of a given source, if
the source has changed since the class was created. For
this isSourceNewer is called.
@param sou... | java | protected Class recompile(URL source, String className, Class oldClass) throws CompilationFailedException, IOException {
if (source != null) {
// found a source, compile it if newer
if ((oldClass != null && isSourceNewer(source, oldClass)) || (oldClass == null)) {
synchro... | [
"protected",
"Class",
"recompile",
"(",
"URL",
"source",
",",
"String",
"className",
",",
"Class",
"oldClass",
")",
"throws",
"CompilationFailedException",
",",
"IOException",
"{",
"if",
"(",
"source",
"!=",
"null",
")",
"{",
"// found a source, compile it if newer"... | (Re)Compiles the given source.
This method starts the compilation of a given source, if
the source has changed since the class was created. For
this isSourceNewer is called.
@param source the source pointer for the compilation
@param className the name of the class to be generated
@param oldClass a possible former... | [
"(",
"Re",
")",
"Compiles",
"the",
"given",
"source",
".",
"This",
"method",
"starts",
"the",
"compilation",
"of",
"a",
"given",
"source",
"if",
"the",
"source",
"has",
"changed",
"since",
"the",
"class",
"was",
"created",
".",
"For",
"this",
"isSourceNewe... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/lang/GroovyClassLoader.java#L753-L772 |
micronaut-projects/micronaut-core | http/src/main/java/io/micronaut/http/context/ServerRequestContext.java | ServerRequestContext.with | public static void with(HttpRequest request, Runnable runnable) {
"""
Wrap the execution of the given runnable in request context processing.
@param request The request
@param runnable The runnable
"""
HttpRequest existing = REQUEST.get();
boolean isSet = false;
try {
i... | java | public static void with(HttpRequest request, Runnable runnable) {
HttpRequest existing = REQUEST.get();
boolean isSet = false;
try {
if (request != existing) {
isSet = true;
REQUEST.set(request);
}
runnable.run();
} fina... | [
"public",
"static",
"void",
"with",
"(",
"HttpRequest",
"request",
",",
"Runnable",
"runnable",
")",
"{",
"HttpRequest",
"existing",
"=",
"REQUEST",
".",
"get",
"(",
")",
";",
"boolean",
"isSet",
"=",
"false",
";",
"try",
"{",
"if",
"(",
"request",
"!=",... | Wrap the execution of the given runnable in request context processing.
@param request The request
@param runnable The runnable | [
"Wrap",
"the",
"execution",
"of",
"the",
"given",
"runnable",
"in",
"request",
"context",
"processing",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http/src/main/java/io/micronaut/http/context/ServerRequestContext.java#L44-L58 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/types/TimecodeBuilder.java | TimecodeBuilder.fromSMPTE | public static TimecodeBuilder fromSMPTE(String smpte) {
"""
Part a Timecode encoded in the SMPTE style (<code>[dd:]hh:mm:ss:ff</code> - or <code>[dd:]hh:mm:ss;ff</code> for
drop-frame
timecode)
@param smpte
the SMPTE-encoded timecode
@return a parsed timecode object
@throws RuntimeException
if parsing... | java | public static TimecodeBuilder fromSMPTE(String smpte)
{
final boolean dropFrame = smpte.indexOf(';') != -1;
final boolean negative = smpte.charAt(0) == '-';
final String[] parts = smpte.replace(';', ':').split(":");
if (parts.length > 5 || parts.length < 4)
throw new IllegalArgumentException("Field mismat... | [
"public",
"static",
"TimecodeBuilder",
"fromSMPTE",
"(",
"String",
"smpte",
")",
"{",
"final",
"boolean",
"dropFrame",
"=",
"smpte",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
";",
"final",
"boolean",
"negative",
"=",
"smpte",
".",
"charAt",
"("... | Part a Timecode encoded in the SMPTE style (<code>[dd:]hh:mm:ss:ff</code> - or <code>[dd:]hh:mm:ss;ff</code> for
drop-frame
timecode)
@param smpte
the SMPTE-encoded timecode
@return a parsed timecode object
@throws RuntimeException
if parsing fails | [
"Part",
"a",
"Timecode",
"encoded",
"in",
"the",
"SMPTE",
"style",
"(",
"<code",
">",
"[",
"dd",
":",
"]",
"hh",
":",
"mm",
":",
"ss",
":",
"ff<",
"/",
"code",
">",
"-",
"or",
"<code",
">",
"[",
"dd",
":",
"]",
"hh",
":",
"mm",
":",
"ss",
"... | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/types/TimecodeBuilder.java#L291-L325 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java | CassandraSchemaManager.onSetSubComparator | private void onSetSubComparator(CfDef cfDef, Properties cfProperties, StringBuilder builder) {
"""
On set sub comparator.
@param cfDef
the cf def
@param cfProperties
the cf properties
@param builder
the builder
"""
String subComparatorType = cfProperties.getProperty(CassandraConstants.SUBCOMPAR... | java | private void onSetSubComparator(CfDef cfDef, Properties cfProperties, StringBuilder builder)
{
String subComparatorType = cfProperties.getProperty(CassandraConstants.SUBCOMPARATOR_TYPE);
if (subComparatorType != null && ColumnFamilyType.valueOf(cfDef.getColumn_type()) == ColumnFamilyType.Super)
... | [
"private",
"void",
"onSetSubComparator",
"(",
"CfDef",
"cfDef",
",",
"Properties",
"cfProperties",
",",
"StringBuilder",
"builder",
")",
"{",
"String",
"subComparatorType",
"=",
"cfProperties",
".",
"getProperty",
"(",
"CassandraConstants",
".",
"SUBCOMPARATOR_TYPE",
... | On set sub comparator.
@param cfDef
the cf def
@param cfProperties
the cf properties
@param builder
the builder | [
"On",
"set",
"sub",
"comparator",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L2686-L2701 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/bucket/BucketFlusher.java | BucketFlusher.pollMarkerDocuments | private static Observable<Boolean> pollMarkerDocuments(final ClusterFacade core, final String bucket) {
"""
Helper method to poll the list of marker documents until all of them are gone.
@param core the core reference.
@param bucket the name of the bucket.
@return an observable completing when all marker docu... | java | private static Observable<Boolean> pollMarkerDocuments(final ClusterFacade core, final String bucket) {
return Observable
.from(FLUSH_MARKERS)
.flatMap(new Func1<String, Observable<GetResponse>>() {
@Override
public Observable<GetResponse> call(final Strin... | [
"private",
"static",
"Observable",
"<",
"Boolean",
">",
"pollMarkerDocuments",
"(",
"final",
"ClusterFacade",
"core",
",",
"final",
"String",
"bucket",
")",
"{",
"return",
"Observable",
".",
"from",
"(",
"FLUSH_MARKERS",
")",
".",
"flatMap",
"(",
"new",
"Func1... | Helper method to poll the list of marker documents until all of them are gone.
@param core the core reference.
@param bucket the name of the bucket.
@return an observable completing when all marker documents are gone. | [
"Helper",
"method",
"to",
"poll",
"the",
"list",
"of",
"marker",
"documents",
"until",
"all",
"of",
"them",
"are",
"gone",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/bucket/BucketFlusher.java#L195-L247 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/util/DatabaseManagerSwing.java | DatabaseManagerSwing.setStatusLine | void setStatusLine(String busyBaseString, int rowCount) {
"""
Added: (weconsultants@users) Sets up\changes the running status icon
"""
iReadyStatus.setSelected(busyBaseString != null);
if (busyBaseString == null) {
String additionalMsg = "";
if (schemaFilter != null) ... | java | void setStatusLine(String busyBaseString, int rowCount) {
iReadyStatus.setSelected(busyBaseString != null);
if (busyBaseString == null) {
String additionalMsg = "";
if (schemaFilter != null) {
additionalMsg = " / Tree showing objects in schema '"
... | [
"void",
"setStatusLine",
"(",
"String",
"busyBaseString",
",",
"int",
"rowCount",
")",
"{",
"iReadyStatus",
".",
"setSelected",
"(",
"busyBaseString",
"!=",
"null",
")",
";",
"if",
"(",
"busyBaseString",
"==",
"null",
")",
"{",
"String",
"additionalMsg",
"=",
... | Added: (weconsultants@users) Sets up\changes the running status icon | [
"Added",
":",
"(",
"weconsultants"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/util/DatabaseManagerSwing.java#L2345-L2365 |
mapbox/mapbox-navigation-android | libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/camera/DynamicCamera.java | DynamicCamera.createCameraPosition | private CameraPosition createCameraPosition(Location location, RouteProgress routeProgress) {
"""
Creates a camera position with the current location and upcoming maneuver location.
<p>
Using {@link MapboxMap#getCameraForLatLngBounds(LatLngBounds, int[])} with a {@link LatLngBounds}
that includes the current lo... | java | private CameraPosition createCameraPosition(Location location, RouteProgress routeProgress) {
LegStep upComingStep = routeProgress.currentLegProgress().upComingStep();
if (upComingStep != null) {
Point stepManeuverPoint = upComingStep.maneuver().location();
List<LatLng> latLngs = new ArrayList<>();... | [
"private",
"CameraPosition",
"createCameraPosition",
"(",
"Location",
"location",
",",
"RouteProgress",
"routeProgress",
")",
"{",
"LegStep",
"upComingStep",
"=",
"routeProgress",
".",
"currentLegProgress",
"(",
")",
".",
"upComingStep",
"(",
")",
";",
"if",
"(",
... | Creates a camera position with the current location and upcoming maneuver location.
<p>
Using {@link MapboxMap#getCameraForLatLngBounds(LatLngBounds, int[])} with a {@link LatLngBounds}
that includes the current location and upcoming maneuver location.
@param location for current location
@param routeProgress for... | [
"Creates",
"a",
"camera",
"position",
"with",
"the",
"current",
"location",
"and",
"upcoming",
"maneuver",
"location",
".",
"<p",
">",
"Using",
"{",
"@link",
"MapboxMap#getCameraForLatLngBounds",
"(",
"LatLngBounds",
"int",
"[]",
")",
"}",
"with",
"a",
"{",
"@... | train | https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/camera/DynamicCamera.java#L128-L151 |
jbundle/jbundle | app/program/manual/util/src/main/java/org/jbundle/app/program/manual/util/WriteResourceClass.java | WriteResourceClass.writeResources | public void writeResources(String strClassName) {
"""
Write out all the data fields for this class (not file fields!)
Required: strClassName - Current Class
"""
boolean bResourceListBundle = ResourceTypeField.LIST_RESOURCE_BUNDLE.equals(this.getRecord(ProgramControl.PROGRAM_CONTROL_FILE).getField(Program... | java | public void writeResources(String strClassName)
{
boolean bResourceListBundle = ResourceTypeField.LIST_RESOURCE_BUNDLE.equals(this.getRecord(ProgramControl.PROGRAM_CONTROL_FILE).getField(ProgramControl.CLASS_RESOURCE_TYPE).toString());
if (bResourceListBundle)
{
m_StreamOut.writeit("protecte... | [
"public",
"void",
"writeResources",
"(",
"String",
"strClassName",
")",
"{",
"boolean",
"bResourceListBundle",
"=",
"ResourceTypeField",
".",
"LIST_RESOURCE_BUNDLE",
".",
"equals",
"(",
"this",
".",
"getRecord",
"(",
"ProgramControl",
".",
"PROGRAM_CONTROL_FILE",
")",... | Write out all the data fields for this class (not file fields!)
Required: strClassName - Current Class | [
"Write",
"out",
"all",
"the",
"data",
"fields",
"for",
"this",
"class",
"(",
"not",
"file",
"fields!",
")",
"Required",
":",
"strClassName",
"-",
"Current",
"Class"
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/manual/util/src/main/java/org/jbundle/app/program/manual/util/WriteResourceClass.java#L124-L156 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.deleteAllStaticExportPublishedResources | public void deleteAllStaticExportPublishedResources(CmsRequestContext context, int linkType) throws CmsException {
"""
Deletes all entries in the published resource table.<p>
@param context the current request context
@param linkType the type of resource deleted (0= non-parameter, 1=parameter)
@throws CmsEx... | java | public void deleteAllStaticExportPublishedResources(CmsRequestContext context, int linkType) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
m_driverManager.deleteAllStaticExportPublishedResources(dbc, linkType);
} catch (Exception e) {
... | [
"public",
"void",
"deleteAllStaticExportPublishedResources",
"(",
"CmsRequestContext",
"context",
",",
"int",
"linkType",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"try",
"{",
... | Deletes all entries in the published resource table.<p>
@param context the current request context
@param linkType the type of resource deleted (0= non-parameter, 1=parameter)
@throws CmsException if something goes wrong | [
"Deletes",
"all",
"entries",
"in",
"the",
"published",
"resource",
"table",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L1280-L1290 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker00.java | WebSocketServerHandshaker00.close | @Override
public ChannelFuture close(Channel channel, CloseWebSocketFrame frame, ChannelPromise promise) {
"""
Echo back the closing frame
@param channel
Channel
@param frame
Web Socket frame that was received
"""
return channel.writeAndFlush(frame, promise);
} | java | @Override
public ChannelFuture close(Channel channel, CloseWebSocketFrame frame, ChannelPromise promise) {
return channel.writeAndFlush(frame, promise);
} | [
"@",
"Override",
"public",
"ChannelFuture",
"close",
"(",
"Channel",
"channel",
",",
"CloseWebSocketFrame",
"frame",
",",
"ChannelPromise",
"promise",
")",
"{",
"return",
"channel",
".",
"writeAndFlush",
"(",
"frame",
",",
"promise",
")",
";",
"}"
] | Echo back the closing frame
@param channel
Channel
@param frame
Web Socket frame that was received | [
"Echo",
"back",
"the",
"closing",
"frame"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker00.java#L185-L188 |
CenturyLinkCloud/mdw | mdw-workflow/src/com/centurylink/mdw/workflow/activity/validate/SwaggerValidatorActivity.java | SwaggerValidatorActivity.handleResult | protected Object handleResult(Result result) throws ActivityException {
"""
Populates "response" variable with a default JSON status object. Can be overwritten by
custom logic in a downstream activity, or in a JsonRestService implementation.
"""
ServiceValuesAccess serviceValues = getRuntimeContext()... | java | protected Object handleResult(Result result) throws ActivityException {
ServiceValuesAccess serviceValues = getRuntimeContext().getServiceValues();
StatusResponse statusResponse;
if (result.isError()) {
logsevere("Validation error: " + result.getStatus().toString());
stat... | [
"protected",
"Object",
"handleResult",
"(",
"Result",
"result",
")",
"throws",
"ActivityException",
"{",
"ServiceValuesAccess",
"serviceValues",
"=",
"getRuntimeContext",
"(",
")",
".",
"getServiceValues",
"(",
")",
";",
"StatusResponse",
"statusResponse",
";",
"if",
... | Populates "response" variable with a default JSON status object. Can be overwritten by
custom logic in a downstream activity, or in a JsonRestService implementation. | [
"Populates",
"response",
"variable",
"with",
"a",
"default",
"JSON",
"status",
"object",
".",
"Can",
"be",
"overwritten",
"by",
"custom",
"logic",
"in",
"a",
"downstream",
"activity",
"or",
"in",
"a",
"JsonRestService",
"implementation",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-workflow/src/com/centurylink/mdw/workflow/activity/validate/SwaggerValidatorActivity.java#L130-L161 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java | DragableArea.duringDrag | protected boolean duringDrag(SVGPoint startPoint, SVGPoint dragPoint, Event evt, boolean inside) {
"""
Method called during drags.
@param startPoint Drag starting point
@param dragPoint Drag end point
@param evt The event object
@param inside Inside the tracked element
@return {@code true} to continue the d... | java | protected boolean duringDrag(SVGPoint startPoint, SVGPoint dragPoint, Event evt, boolean inside) {
if (listener != null) {
return listener.duringDrag(startPoint, dragPoint, evt, inside);
}
return true;
} | [
"protected",
"boolean",
"duringDrag",
"(",
"SVGPoint",
"startPoint",
",",
"SVGPoint",
"dragPoint",
",",
"Event",
"evt",
",",
"boolean",
"inside",
")",
"{",
"if",
"(",
"listener",
"!=",
"null",
")",
"{",
"return",
"listener",
".",
"duringDrag",
"(",
"startPoi... | Method called during drags.
@param startPoint Drag starting point
@param dragPoint Drag end point
@param evt The event object
@param inside Inside the tracked element
@return {@code true} to continue the drag | [
"Method",
"called",
"during",
"drags",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java#L283-L288 |
fengwenyi/JavaLib | src/main/java/com/fengwenyi/javalib/util/RSAUtil.java | RSAUtil.publicKeyDecrypt | public static String publicKeyDecrypt(String key, String cipherText) throws NoSuchAlgorithmException,
InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, BadPaddingException,
IllegalBlockSizeException {
"""
公钥解密
@param key [ellipsis]
@param cipherText [ellipsis]
@return... | java | public static String publicKeyDecrypt(String key, String cipherText) throws NoSuchAlgorithmException,
InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, BadPaddingException,
IllegalBlockSizeException {
PublicKey publicKey = commonGetPublickeyByText(key);
Cipher... | [
"public",
"static",
"String",
"publicKeyDecrypt",
"(",
"String",
"key",
",",
"String",
"cipherText",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeySpecException",
",",
"NoSuchPaddingException",
",",
"InvalidKeyException",
",",
"BadPaddingException",
",",
"Ill... | 公钥解密
@param key [ellipsis]
@param cipherText [ellipsis]
@return [ellipsis]
@throws NoSuchAlgorithmException [ellipsis]
@throws InvalidKeySpecException [ellipsis]
@throws NoSuchPaddingException [ellipsis]
@throws InvalidKeyException [ellipsis]
@throws BadPaddingException [ellipsis]
@throws IllegalBlockSizeException [ell... | [
"公钥解密"
] | train | https://github.com/fengwenyi/JavaLib/blob/14838b13fb11c024e41be766aa3e13ead4be1703/src/main/java/com/fengwenyi/javalib/util/RSAUtil.java#L97-L106 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/Workitem.java | Workitem.createEffort | public Effort createEffort(double value, Member member, DateTime date) {
"""
Log an effort record against this workitem with the current day and time
and given member and value.
@param member The subject of the Effort.
@param value if the Effort.
@param date of the Effort record.
@return created Effort reco... | java | public Effort createEffort(double value, Member member, DateTime date) {
return getInstance().create().effort(value, this, member, date);
} | [
"public",
"Effort",
"createEffort",
"(",
"double",
"value",
",",
"Member",
"member",
",",
"DateTime",
"date",
")",
"{",
"return",
"getInstance",
"(",
")",
".",
"create",
"(",
")",
".",
"effort",
"(",
"value",
",",
"this",
",",
"member",
",",
"date",
")... | Log an effort record against this workitem with the current day and time
and given member and value.
@param member The subject of the Effort.
@param value if the Effort.
@param date of the Effort record.
@return created Effort record.
@throws IllegalStateException if Effort tracking is not enabled. | [
"Log",
"an",
"effort",
"record",
"against",
"this",
"workitem",
"with",
"the",
"current",
"day",
"and",
"time",
"and",
"given",
"member",
"and",
"value",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Workitem.java#L170-L172 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/to/GeoJsonToAssembler.java | GeoJsonToAssembler.fromTransferObject | public LineString fromTransferObject(LineStringTo input, CrsId crsId) {
"""
Creates a linestring object starting from a transfer object.
@param input the linestring transfer object
@param crsId the crs id to use (ignores the crs of the input). If null, uses the crs of the input.
@return the corresponding geom... | java | public LineString fromTransferObject(LineStringTo input, CrsId crsId) {
if (input == null) { return null; }
crsId = getCrsId(input, crsId);
isValid(input);
return new LineString(createPointSequence(input.getCoordinates(), crsId));
} | [
"public",
"LineString",
"fromTransferObject",
"(",
"LineStringTo",
"input",
",",
"CrsId",
"crsId",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"crsId",
"=",
"getCrsId",
"(",
"input",
",",
"crsId",
")",
";",
"isValid"... | Creates a linestring object starting from a transfer object.
@param input the linestring transfer object
@param crsId the crs id to use (ignores the crs of the input). If null, uses the crs of the input.
@return the corresponding geometry
@throws IllegalArgumentException If the geometry could not be constructed due to... | [
"Creates",
"a",
"linestring",
"object",
"starting",
"from",
"a",
"transfer",
"object",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/to/GeoJsonToAssembler.java#L368-L375 |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerNew.java | OMMapManagerNew.binarySearch | private int binarySearch(OMMapBufferEntry[] fileEntries, long beginOffset, int beginPosition, int endPosition) {
"""
This method is used in
com.orientechnologies.orient.core.storage.fs.OMMapManagerNew#searchAmongExisting(com.orientechnologies.orient
.core.storage.fs.OFileMMap, com.orientechnologies.orient.core.s... | java | private int binarySearch(OMMapBufferEntry[] fileEntries, long beginOffset, int beginPosition, int endPosition) {
int midPosition;
while (beginPosition <= endPosition) {
midPosition = (beginPosition + endPosition) >>> 1;
final OMMapBufferEntry entry = fileEntries[midPosition];
if (en... | [
"private",
"int",
"binarySearch",
"(",
"OMMapBufferEntry",
"[",
"]",
"fileEntries",
",",
"long",
"beginOffset",
",",
"int",
"beginPosition",
",",
"int",
"endPosition",
")",
"{",
"int",
"midPosition",
";",
"while",
"(",
"beginPosition",
"<=",
"endPosition",
")",
... | This method is used in
com.orientechnologies.orient.core.storage.fs.OMMapManagerNew#searchAmongExisting(com.orientechnologies.orient
.core.storage.fs.OFileMMap, com.orientechnologies.orient.core.storage.fs.OMMapBufferEntry[], long, int) to search necessary
entry.
@param fileEntries
already mapped entries.
@param begin... | [
"This",
"method",
"is",
"used",
"in",
"com",
".",
"orientechnologies",
".",
"orient",
".",
"core",
".",
"storage",
".",
"fs",
".",
"OMMapManagerNew#searchAmongExisting",
"(",
"com",
".",
"orientechnologies",
".",
"orient",
".",
"core",
".",
"storage",
".",
"... | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerNew.java#L263-L289 |
Azure/azure-sdk-for-java | iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java | IotHubResourcesInner.listJobsWithServiceResponseAsync | public Observable<ServiceResponse<Page<JobResponseInner>>> listJobsWithServiceResponseAsync(final String resourceGroupName, final String resourceName) {
"""
Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
Get a list ... | java | public Observable<ServiceResponse<Page<JobResponseInner>>> listJobsWithServiceResponseAsync(final String resourceGroupName, final String resourceName) {
return listJobsSinglePageAsync(resourceGroupName, resourceName)
.concatMap(new Func1<ServiceResponse<Page<JobResponseInner>>, Observable<ServiceRes... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"JobResponseInner",
">",
">",
">",
"listJobsWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"resourceName",
")",
"{",
"return",
"listJobsSinglePageAsync",
... | Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
@param resourceGroupName Th... | [
"Get",
"a",
"list",
"of",
"all",
"the",
"jobs",
"in",
"an",
"IoT",
"hub",
".",
"For",
"more",
"information",
"see",
":",
"https",
":",
"//",
"docs",
".",
"microsoft",
".",
"com",
"/",
"azure",
"/",
"iot",
"-",
"hub",
"/",
"iot",
"-",
"hub",
"-",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java#L2139-L2151 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.order_orderId_payment_GET | public OvhPayment order_orderId_payment_GET(Long orderId) throws IOException {
"""
Get this object properties
REST: GET /me/order/{orderId}/payment
@param orderId [required]
"""
String qPath = "/me/order/{orderId}/payment";
StringBuilder sb = path(qPath, orderId);
String resp = exec(qPath, "GET", sb.... | java | public OvhPayment order_orderId_payment_GET(Long orderId) throws IOException {
String qPath = "/me/order/{orderId}/payment";
StringBuilder sb = path(qPath, orderId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPayment.class);
} | [
"public",
"OvhPayment",
"order_orderId_payment_GET",
"(",
"Long",
"orderId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/order/{orderId}/payment\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"orderId",
")",
";",
"String",
"r... | Get this object properties
REST: GET /me/order/{orderId}/payment
@param orderId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1858-L1863 |
biezhi/anima | src/main/java/io/github/biezhi/anima/core/AnimaCache.java | AnimaCache.getTableName | public static String getTableName(String className, String prefix) {
"""
User -> users
User -> t_users
@param className
@param prefix
@return
"""
boolean hasPrefix = prefix != null && prefix.trim().length() > 0;
return hasPrefix ? English.plural(prefix + "_" + AnimaUtils.toUnderline(class... | java | public static String getTableName(String className, String prefix) {
boolean hasPrefix = prefix != null && prefix.trim().length() > 0;
return hasPrefix ? English.plural(prefix + "_" + AnimaUtils.toUnderline(className), 2) : English.plural(AnimaUtils.toUnderline(className), 2);
} | [
"public",
"static",
"String",
"getTableName",
"(",
"String",
"className",
",",
"String",
"prefix",
")",
"{",
"boolean",
"hasPrefix",
"=",
"prefix",
"!=",
"null",
"&&",
"prefix",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
";",
"return",
"... | User -> users
User -> t_users
@param className
@param prefix
@return | [
"User",
"-",
">",
"users",
"User",
"-",
">",
"t_users"
] | train | https://github.com/biezhi/anima/blob/d6655e47ac4c08d9d7f961ac0569062bead8b1ed/src/main/java/io/github/biezhi/anima/core/AnimaCache.java#L79-L82 |
casmi/casmi | src/main/java/casmi/graphics/element/Lines.java | Lines.setEndCornerColor | public void setEndCornerColor(Color color) {
"""
Sets the end point's color for gradation.
@param color The color of the end point.
"""
if (endColor == null) {
endColor = new RGBColor(0.0, 0.0, 0.0);
}
setGradation(true);
this.endColor = color;
} | java | public void setEndCornerColor(Color color) {
if (endColor == null) {
endColor = new RGBColor(0.0, 0.0, 0.0);
}
setGradation(true);
this.endColor = color;
} | [
"public",
"void",
"setEndCornerColor",
"(",
"Color",
"color",
")",
"{",
"if",
"(",
"endColor",
"==",
"null",
")",
"{",
"endColor",
"=",
"new",
"RGBColor",
"(",
"0.0",
",",
"0.0",
",",
"0.0",
")",
";",
"}",
"setGradation",
"(",
"true",
")",
";",
"this... | Sets the end point's color for gradation.
@param color The color of the end point. | [
"Sets",
"the",
"end",
"point",
"s",
"color",
"for",
"gradation",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/element/Lines.java#L286-L292 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/datahandler/CassandraDataHandlerBase.java | CassandraDataHandlerBase.setCollectionValue | private void setCollectionValue(Object entity, Object thriftColumnValue, Attribute attribute) {
"""
Populates collection field(s) into entity.
@param entity
the entity
@param thriftColumnValue
the thrift column value
@param attribute
the attribute
"""
try
{
ByteBuffer valueB... | java | private void setCollectionValue(Object entity, Object thriftColumnValue, Attribute attribute)
{
try
{
ByteBuffer valueByteBuffer = ByteBuffer.wrap((byte[]) thriftColumnValue);
if (Collection.class.isAssignableFrom(((Field) attribute.getJavaMember()).getType()))
{
... | [
"private",
"void",
"setCollectionValue",
"(",
"Object",
"entity",
",",
"Object",
"thriftColumnValue",
",",
"Attribute",
"attribute",
")",
"{",
"try",
"{",
"ByteBuffer",
"valueByteBuffer",
"=",
"ByteBuffer",
".",
"wrap",
"(",
"(",
"byte",
"[",
"]",
")",
"thrift... | Populates collection field(s) into entity.
@param entity
the entity
@param thriftColumnValue
the thrift column value
@param attribute
the attribute | [
"Populates",
"collection",
"field",
"(",
"s",
")",
"into",
"entity",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/datahandler/CassandraDataHandlerBase.java#L2569-L2599 |
HubSpot/Singularity | SingularityExecutor/src/main/java/com/hubspot/singularity/executor/SingularityExecutor.java | SingularityExecutor.killTask | @Override
public void killTask(ExecutorDriver executorDriver, Protos.TaskID taskID) {
"""
Invoked when a task running within this executor has been killed
(via SchedulerDriver::killTask). Note that no status update will
be sent on behalf of the executor, the executor is responsible
for creating a new TaskStat... | java | @Override
public void killTask(ExecutorDriver executorDriver, Protos.TaskID taskID) {
final String taskId = taskID.getValue();
LOG.info("Asked to kill task {}", taskId);
KillState killState = monitor.requestKill(taskId);
switch (killState) {
case DIDNT_EXIST:
case INCONSISTENT_STATE:
... | [
"@",
"Override",
"public",
"void",
"killTask",
"(",
"ExecutorDriver",
"executorDriver",
",",
"Protos",
".",
"TaskID",
"taskID",
")",
"{",
"final",
"String",
"taskId",
"=",
"taskID",
".",
"getValue",
"(",
")",
";",
"LOG",
".",
"info",
"(",
"\"Asked to kill ta... | Invoked when a task running within this executor has been killed
(via SchedulerDriver::killTask). Note that no status update will
be sent on behalf of the executor, the executor is responsible
for creating a new TaskStatus (i.e., with TASK_KILLED) and
invoking ExecutorDriver::sendStatusUpdate. | [
"Invoked",
"when",
"a",
"task",
"running",
"within",
"this",
"executor",
"has",
"been",
"killed",
"(",
"via",
"SchedulerDriver",
"::",
"killTask",
")",
".",
"Note",
"that",
"no",
"status",
"update",
"will",
"be",
"sent",
"on",
"behalf",
"of",
"the",
"execu... | train | https://github.com/HubSpot/Singularity/blob/384a8c16a10aa076af5ca45c8dfcedab9e5122c8/SingularityExecutor/src/main/java/com/hubspot/singularity/executor/SingularityExecutor.java#L111-L130 |
aws/aws-sdk-java | aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/ConfigurationItem.java | ConfigurationItem.withSupplementaryConfiguration | public ConfigurationItem withSupplementaryConfiguration(java.util.Map<String, String> supplementaryConfiguration) {
"""
<p>
Configuration attributes that AWS Config returns for certain resource types to supplement the information
returned for the <code>configuration</code> parameter.
</p>
@param supplementar... | java | public ConfigurationItem withSupplementaryConfiguration(java.util.Map<String, String> supplementaryConfiguration) {
setSupplementaryConfiguration(supplementaryConfiguration);
return this;
} | [
"public",
"ConfigurationItem",
"withSupplementaryConfiguration",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"supplementaryConfiguration",
")",
"{",
"setSupplementaryConfiguration",
"(",
"supplementaryConfiguration",
")",
";",
"return",
"thi... | <p>
Configuration attributes that AWS Config returns for certain resource types to supplement the information
returned for the <code>configuration</code> parameter.
</p>
@param supplementaryConfiguration
Configuration attributes that AWS Config returns for certain resource types to supplement the information
returned ... | [
"<p",
">",
"Configuration",
"attributes",
"that",
"AWS",
"Config",
"returns",
"for",
"certain",
"resource",
"types",
"to",
"supplement",
"the",
"information",
"returned",
"for",
"the",
"<code",
">",
"configuration<",
"/",
"code",
">",
"parameter",
".",
"<",
"/... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/ConfigurationItem.java#L1117-L1120 |
Bernardo-MG/maven-site-fixer | src/main/java/com/bernardomg/velocity/tool/HtmlTool.java | HtmlTool.removeClass | public final void removeClass(final Element root, final String selector,
final String className) {
"""
Finds a set of elements through a CSS selector and removes the received
class from them, if they have it.
<p>
If the elements end without classes then the class attribute is also
removed.
@para... | java | public final void removeClass(final Element root, final String selector,
final String className) {
final Iterable<Element> elements; // Elements selected
checkNotNull(root, "Received a null pointer as root element");
checkNotNull(selector, "Received a null pointer as selector");
... | [
"public",
"final",
"void",
"removeClass",
"(",
"final",
"Element",
"root",
",",
"final",
"String",
"selector",
",",
"final",
"String",
"className",
")",
"{",
"final",
"Iterable",
"<",
"Element",
">",
"elements",
";",
"// Elements selected",
"checkNotNull",
"(",
... | Finds a set of elements through a CSS selector and removes the received
class from them, if they have it.
<p>
If the elements end without classes then the class attribute is also
removed.
@param root
root element for the selection
@param selector
CSS selector for the elements with the class to remove
@param className
... | [
"Finds",
"a",
"set",
"of",
"elements",
"through",
"a",
"CSS",
"selector",
"and",
"removes",
"the",
"received",
"class",
"from",
"them",
"if",
"they",
"have",
"it",
".",
"<p",
">",
"If",
"the",
"elements",
"end",
"without",
"classes",
"then",
"the",
"clas... | train | https://github.com/Bernardo-MG/maven-site-fixer/blob/e064472faa7edb0fca11647a22d90ad72089baa3/src/main/java/com/bernardomg/velocity/tool/HtmlTool.java#L113-L130 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/StreamCharBuffer.java | StreamCharBuffer.writeTo | public void writeTo(Writer target, boolean flushTarget, boolean emptyAfter)
throws IOException {
"""
Writes the buffer content to a target java.io.Writer
@param target Writer
@param flushTarget calls target.flush() before finishing
@param emptyAfter empties the buffer if true
@throws IOException
... | java | public void writeTo(Writer target, boolean flushTarget, boolean emptyAfter)
throws IOException
{
//if (target instanceof GrailsWrappedWriter) {
// target = ((GrailsWrappedWriter)target).unwrap();
//}
if (target instanceof StreamCharBufferWriter)
{
i... | [
"public",
"void",
"writeTo",
"(",
"Writer",
"target",
",",
"boolean",
"flushTarget",
",",
"boolean",
"emptyAfter",
")",
"throws",
"IOException",
"{",
"//if (target instanceof GrailsWrappedWriter) {",
"// target = ((GrailsWrappedWriter)target).unwrap();",
"//}",
"if",
"(",
... | Writes the buffer content to a target java.io.Writer
@param target Writer
@param flushTarget calls target.flush() before finishing
@param emptyAfter empties the buffer if true
@throws IOException | [
"Writes",
"the",
"buffer",
"content",
"to",
"a",
"target",
"java",
".",
"io",
".",
"Writer"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/StreamCharBuffer.java#L522-L539 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.createMultiPolygon | public MultiPolygon createMultiPolygon(List<Polygon> polygonList,
boolean hasZ, boolean hasM) {
"""
Convert a list of {@link Polygon} to a {@link MultiPolygon}
@param polygonList polygon list
@param hasZ has z flag
@param hasM has m flag
@return multi ... | java | public MultiPolygon createMultiPolygon(List<Polygon> polygonList,
boolean hasZ, boolean hasM) {
MultiPolygon multiPolygon = new MultiPolygon(hasZ, hasM);
for (Polygon polygon : polygonList) {
multiPolygon.addPolygon(polygon);
}
re... | [
"public",
"MultiPolygon",
"createMultiPolygon",
"(",
"List",
"<",
"Polygon",
">",
"polygonList",
",",
"boolean",
"hasZ",
",",
"boolean",
"hasM",
")",
"{",
"MultiPolygon",
"multiPolygon",
"=",
"new",
"MultiPolygon",
"(",
"hasZ",
",",
"hasM",
")",
";",
"for",
... | Convert a list of {@link Polygon} to a {@link MultiPolygon}
@param polygonList polygon list
@param hasZ has z flag
@param hasM has m flag
@return multi polygon | [
"Convert",
"a",
"list",
"of",
"{",
"@link",
"Polygon",
"}",
"to",
"a",
"{",
"@link",
"MultiPolygon",
"}"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L1055-L1065 |
Drivemode/TypefaceHelper | TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java | TypefaceHelper.setTypeface | public void setTypeface(Paint paint, String typefaceName) {
"""
Set the typeface to the target paint.
@param paint the set typeface.
@param typefaceName typeface name.
"""
Typeface typeface = mCache.get(typefaceName);
paint.setTypeface(typeface);
} | java | public void setTypeface(Paint paint, String typefaceName) {
Typeface typeface = mCache.get(typefaceName);
paint.setTypeface(typeface);
} | [
"public",
"void",
"setTypeface",
"(",
"Paint",
"paint",
",",
"String",
"typefaceName",
")",
"{",
"Typeface",
"typeface",
"=",
"mCache",
".",
"get",
"(",
"typefaceName",
")",
";",
"paint",
".",
"setTypeface",
"(",
"typeface",
")",
";",
"}"
] | Set the typeface to the target paint.
@param paint the set typeface.
@param typefaceName typeface name. | [
"Set",
"the",
"typeface",
"to",
"the",
"target",
"paint",
"."
] | train | https://github.com/Drivemode/TypefaceHelper/blob/86bef9ce16b9626b7076559e846db1b9f043c008/TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java#L195-L198 |
legsem/legstar-core2 | legstar-jaxb-generator/src/main/java/com/legstar/jaxb/generator/EachHelper.java | EachHelper.hashContext | private CharSequence hashContext(final Object context, final Options options)
throws IOException {
"""
Iterate over a hash like object.
@param context The context object.
@param options The helper options.
@return The string output.
@throws IOException If something goes wrong.
"""
Set... | java | private CharSequence hashContext(final Object context, final Options options)
throws IOException {
Set < Entry < String, Object >> propertySet = options
.propertySet(context);
StringBuilder buffer = new StringBuilder();
Context parent = options.context;
boolea... | [
"private",
"CharSequence",
"hashContext",
"(",
"final",
"Object",
"context",
",",
"final",
"Options",
"options",
")",
"throws",
"IOException",
"{",
"Set",
"<",
"Entry",
"<",
"String",
",",
"Object",
">",
">",
"propertySet",
"=",
"options",
".",
"propertySet",
... | Iterate over a hash like object.
@param context The context object.
@param options The helper options.
@return The string output.
@throws IOException If something goes wrong. | [
"Iterate",
"over",
"a",
"hash",
"like",
"object",
"."
] | train | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-jaxb-generator/src/main/java/com/legstar/jaxb/generator/EachHelper.java#L54-L70 |
liferay/com-liferay-commerce | commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListPersistenceImpl.java | CommerceWishListPersistenceImpl.countByU_LtC | @Override
public int countByU_LtC(long userId, Date createDate) {
"""
Returns the number of commerce wish lists where userId = ? and createDate < ?.
@param userId the user ID
@param createDate the create date
@return the number of matching commerce wish lists
"""
FinderPath finderPath = FIND... | java | @Override
public int countByU_LtC(long userId, Date createDate) {
FinderPath finderPath = FINDER_PATH_WITH_PAGINATION_COUNT_BY_U_LTC;
Object[] finderArgs = new Object[] { userId, _getTime(createDate) };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBun... | [
"@",
"Override",
"public",
"int",
"countByU_LtC",
"(",
"long",
"userId",
",",
"Date",
"createDate",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_WITH_PAGINATION_COUNT_BY_U_LTC",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",
"[",
"]",
"{... | Returns the number of commerce wish lists where userId = ? and createDate < ?.
@param userId the user ID
@param createDate the create date
@return the number of matching commerce wish lists | [
"Returns",
"the",
"number",
"of",
"commerce",
"wish",
"lists",
"where",
"userId",
"=",
"?",
";",
"and",
"createDate",
"<",
";",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListPersistenceImpl.java#L3550-L3608 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/datetime/DateTimeFormatterCache.java | DateTimeFormatterCache.getDateTimeFormatterStrict | @Nonnull
public static DateTimeFormatter getDateTimeFormatterStrict (@Nonnull @Nonempty final String sPattern) {
"""
Get the cached DateTimeFormatter using STRICT resolving.
@param sPattern
The pattern to retrieve. May neither be <code>null</code> nor empty.
@return The compiled DateTimeFormatter and never ... | java | @Nonnull
public static DateTimeFormatter getDateTimeFormatterStrict (@Nonnull @Nonempty final String sPattern)
{
return getDateTimeFormatter (sPattern, ResolverStyle.STRICT);
} | [
"@",
"Nonnull",
"public",
"static",
"DateTimeFormatter",
"getDateTimeFormatterStrict",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sPattern",
")",
"{",
"return",
"getDateTimeFormatter",
"(",
"sPattern",
",",
"ResolverStyle",
".",
"STRICT",
")",
";",
... | Get the cached DateTimeFormatter using STRICT resolving.
@param sPattern
The pattern to retrieve. May neither be <code>null</code> nor empty.
@return The compiled DateTimeFormatter and never <code>null</code> .
@throws IllegalArgumentException
If the pattern is invalid | [
"Get",
"the",
"cached",
"DateTimeFormatter",
"using",
"STRICT",
"resolving",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/datetime/DateTimeFormatterCache.java#L76-L80 |
exKAZUu/GameAIArena | src/main/java/net/exkazuu/gameaiarena/api/Point2.java | Point2.add | public Point2 add(Point2 that) {
"""
Point(this.x + that.x, this.y + that.y)となるPoint型を返します。
@param that このPoint型に加算するPoint型
@return このPoint型に引数のPoint型を加算した結果
"""
return new Point2(x + that.x, y + that.y);
} | java | public Point2 add(Point2 that) {
return new Point2(x + that.x, y + that.y);
} | [
"public",
"Point2",
"add",
"(",
"Point2",
"that",
")",
"{",
"return",
"new",
"Point2",
"(",
"x",
"+",
"that",
".",
"x",
",",
"y",
"+",
"that",
".",
"y",
")",
";",
"}"
] | Point(this.x + that.x, this.y + that.y)となるPoint型を返します。
@param that このPoint型に加算するPoint型
@return このPoint型に引数のPoint型を加算した結果 | [
"Point",
"(",
"this",
".",
"x",
"+",
"that",
".",
"x",
"this",
".",
"y",
"+",
"that",
".",
"y",
")",
"となるPoint型を返します。"
] | train | https://github.com/exKAZUu/GameAIArena/blob/66894c251569fb763174654d6c262c5176dfcf48/src/main/java/net/exkazuu/gameaiarena/api/Point2.java#L91-L93 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/object/TabularDataConverter.java | TabularDataConverter.checkForFullTabularDataRepresentation | private boolean checkForFullTabularDataRepresentation(JSONObject pValue, TabularType pType) {
"""
Check for a full table data representation and do some sanity checks
"""
if (pValue.containsKey("indexNames") && pValue.containsKey("values") && pValue.size() == 2) {
Object jsonVal = pValue.ge... | java | private boolean checkForFullTabularDataRepresentation(JSONObject pValue, TabularType pType) {
if (pValue.containsKey("indexNames") && pValue.containsKey("values") && pValue.size() == 2) {
Object jsonVal = pValue.get("indexNames");
if (!(jsonVal instanceof JSONArray)) {
th... | [
"private",
"boolean",
"checkForFullTabularDataRepresentation",
"(",
"JSONObject",
"pValue",
",",
"TabularType",
"pType",
")",
"{",
"if",
"(",
"pValue",
".",
"containsKey",
"(",
"\"indexNames\"",
")",
"&&",
"pValue",
".",
"containsKey",
"(",
"\"values\"",
")",
"&&"... | Check for a full table data representation and do some sanity checks | [
"Check",
"for",
"a",
"full",
"table",
"data",
"representation",
"and",
"do",
"some",
"sanity",
"checks"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/object/TabularDataConverter.java#L109-L130 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java | ServicesInner.listSkusAsync | public Observable<Page<AvailableServiceSkuInner>> listSkusAsync(final String groupName, final String serviceName) {
"""
Get compatible SKUs.
The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated t... | java | public Observable<Page<AvailableServiceSkuInner>> listSkusAsync(final String groupName, final String serviceName) {
return listSkusWithServiceResponseAsync(groupName, serviceName)
.map(new Func1<ServiceResponse<Page<AvailableServiceSkuInner>>, Page<AvailableServiceSkuInner>>() {
@Ove... | [
"public",
"Observable",
"<",
"Page",
"<",
"AvailableServiceSkuInner",
">",
">",
"listSkusAsync",
"(",
"final",
"String",
"groupName",
",",
"final",
"String",
"serviceName",
")",
"{",
"return",
"listSkusWithServiceResponseAsync",
"(",
"groupName",
",",
"serviceName",
... | Get compatible SKUs.
The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to.
@param groupName Name of the resource group
@param serviceName Name of the service
@throws IllegalArgumentException thrown... | [
"Get",
"compatible",
"SKUs",
".",
"The",
"services",
"resource",
"is",
"the",
"top",
"-",
"level",
"resource",
"that",
"represents",
"the",
"Data",
"Migration",
"Service",
".",
"The",
"skus",
"action",
"returns",
"the",
"list",
"of",
"SKUs",
"that",
"a",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java#L1395-L1403 |
EdwardRaff/JSAT | JSAT/src/jsat/math/ContinuedFraction.java | ContinuedFraction.backwardNaive | public double backwardNaive(int n, double... args) {
"""
Approximates the continued fraction using a naive approximation
@param n the number of iterations to perform
@param args the values to input for the variables of the continued fraction
@return an approximation of the value of the continued fraciton
... | java | public double backwardNaive(int n, double... args)
{
double term = getA(n, args)/getB(n,args);
for(n = n-1; n >0; n--)
{
term = getA(n, args)/(getB(n,args)+term);
}
return term + getB(0, args);
} | [
"public",
"double",
"backwardNaive",
"(",
"int",
"n",
",",
"double",
"...",
"args",
")",
"{",
"double",
"term",
"=",
"getA",
"(",
"n",
",",
"args",
")",
"/",
"getB",
"(",
"n",
",",
"args",
")",
";",
"for",
"(",
"n",
"=",
"n",
"-",
"1",
";",
"... | Approximates the continued fraction using a naive approximation
@param n the number of iterations to perform
@param args the values to input for the variables of the continued fraction
@return an approximation of the value of the continued fraciton | [
"Approximates",
"the",
"continued",
"fraction",
"using",
"a",
"naive",
"approximation"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/ContinuedFraction.java#L41-L51 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java | ST_RingBuffer.ringBuffer | public static Geometry ringBuffer(Geometry geom, double bufferSize, int numBuffer) throws SQLException {
"""
Compute a ring buffer around a geometry
@param geom
@param bufferSize
@param numBuffer
@return
@throws java.sql.SQLException
"""
return ringBuffer(geom, bufferSize, numBuffer, "endcap=round... | java | public static Geometry ringBuffer(Geometry geom, double bufferSize, int numBuffer) throws SQLException {
return ringBuffer(geom, bufferSize, numBuffer, "endcap=round");
} | [
"public",
"static",
"Geometry",
"ringBuffer",
"(",
"Geometry",
"geom",
",",
"double",
"bufferSize",
",",
"int",
"numBuffer",
")",
"throws",
"SQLException",
"{",
"return",
"ringBuffer",
"(",
"geom",
",",
"bufferSize",
",",
"numBuffer",
",",
"\"endcap=round\"",
")... | Compute a ring buffer around a geometry
@param geom
@param bufferSize
@param numBuffer
@return
@throws java.sql.SQLException | [
"Compute",
"a",
"ring",
"buffer",
"around",
"a",
"geometry"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java#L64-L66 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/UniverseApi.java | UniverseApi.getUniverseStationsStationId | public StationResponse getUniverseStationsStationId(Integer stationId, String datasource, String ifNoneMatch)
throws ApiException {
"""
Get station information Get information on a station --- This route
expires daily at 11:05
@param stationId
station_id integer (required)
@param datasource
The ... | java | public StationResponse getUniverseStationsStationId(Integer stationId, String datasource, String ifNoneMatch)
throws ApiException {
ApiResponse<StationResponse> resp = getUniverseStationsStationIdWithHttpInfo(stationId, datasource, ifNoneMatch);
return resp.getData();
} | [
"public",
"StationResponse",
"getUniverseStationsStationId",
"(",
"Integer",
"stationId",
",",
"String",
"datasource",
",",
"String",
"ifNoneMatch",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"StationResponse",
">",
"resp",
"=",
"getUniverseStationsStationIdW... | Get station information Get information on a station --- This route
expires daily at 11:05
@param stationId
station_id integer (required)
@param datasource
The server name you would like data from (optional, default to
tranquility)
@param ifNoneMatch
ETag from a previous request. A 304 will be returned if this
matches... | [
"Get",
"station",
"information",
"Get",
"information",
"on",
"a",
"station",
"---",
"This",
"route",
"expires",
"daily",
"at",
"11",
":",
"05"
] | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/UniverseApi.java#L3082-L3086 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsJspStatusBean.java | CmsJspStatusBean.includeTemplatePart | public void includeTemplatePart(String target, String element, Map<String, Object> parameterMap)
throws JspException {
"""
Include a template part to display on the error page.<p>
@param target the target uri of the file in the OpenCms VFS (can be relative or absolute)
@param element the element (template ... | java | public void includeTemplatePart(String target, String element, Map<String, Object> parameterMap)
throws JspException {
// store current site root and URI
String currentSiteRoot = getRequestContext().getSiteRoot();
String currentUri = getRequestContext().getUri();
try {
... | [
"public",
"void",
"includeTemplatePart",
"(",
"String",
"target",
",",
"String",
"element",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"parameterMap",
")",
"throws",
"JspException",
"{",
"// store current site root and URI",
"String",
"currentSiteRoot",
"=",
"ge... | Include a template part to display on the error page.<p>
@param target the target uri of the file in the OpenCms VFS (can be relative or absolute)
@param element the element (template selector) to display from the target
@param parameterMap a map of the request parameters
@throws JspException in case there were probl... | [
"Include",
"a",
"template",
"part",
"to",
"display",
"on",
"the",
"error",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspStatusBean.java#L385-L403 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SocketBindingJBossASClient.java | SocketBindingJBossASClient.setSocketBindingPort | public void setSocketBindingPort(String socketBindingGroupName, String socketBindingName, String interfaceName)
throws Exception {
"""
Sets the interface name for the named socket binding found in the named socket binding group.
@param socketBindingGroupName the name of the socket binding group that has... | java | public void setSocketBindingPort(String socketBindingGroupName, String socketBindingName, String interfaceName)
throws Exception {
setSocketBindingInterfaceExpression(socketBindingGroupName, socketBindingName, null, interfaceName);
} | [
"public",
"void",
"setSocketBindingPort",
"(",
"String",
"socketBindingGroupName",
",",
"String",
"socketBindingName",
",",
"String",
"interfaceName",
")",
"throws",
"Exception",
"{",
"setSocketBindingInterfaceExpression",
"(",
"socketBindingGroupName",
",",
"socketBindingNam... | Sets the interface name for the named socket binding found in the named socket binding group.
@param socketBindingGroupName the name of the socket binding group that has the named socket binding
@param socketBindingName the name of the socket binding whose interface is to be set
@param interfaceName the new interface ... | [
"Sets",
"the",
"interface",
"name",
"for",
"the",
"named",
"socket",
"binding",
"found",
"in",
"the",
"named",
"socket",
"binding",
"group",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SocketBindingJBossASClient.java#L306-L309 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateNotEqual | public static void validateNotEqual(Object t1, Object t2, String errorMsg) throws ValidateException {
"""
验证是否不等,相等抛出异常<br>
@param t1 对象1
@param t2 对象2
@param errorMsg 错误信息
@throws ValidateException 验证异常
"""
if (equal(t1, t2)) {
throw new ValidateException(errorMsg);
}
} | java | public static void validateNotEqual(Object t1, Object t2, String errorMsg) throws ValidateException {
if (equal(t1, t2)) {
throw new ValidateException(errorMsg);
}
} | [
"public",
"static",
"void",
"validateNotEqual",
"(",
"Object",
"t1",
",",
"Object",
"t2",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"equal",
"(",
"t1",
",",
"t2",
")",
")",
"{",
"throw",
"new",
"ValidateException",
"(",... | 验证是否不等,相等抛出异常<br>
@param t1 对象1
@param t2 对象2
@param errorMsg 错误信息
@throws ValidateException 验证异常 | [
"验证是否不等,相等抛出异常<br",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L263-L267 |
spring-projects/spring-android | spring-android-rest-template/src/main/java/org/springframework/web/util/UriUtils.java | UriUtils.encodePort | public static String encodePort(String port, String encoding) throws UnsupportedEncodingException {
"""
Encodes the given URI port with the given encoding.
@param port the port to be encoded
@param encoding the character encoding to encode to
@return the encoded port
@throws UnsupportedEncodingException when t... | java | public static String encodePort(String port, String encoding) throws UnsupportedEncodingException {
return HierarchicalUriComponents.encodeUriComponent(port, encoding, HierarchicalUriComponents.Type.PORT);
} | [
"public",
"static",
"String",
"encodePort",
"(",
"String",
"port",
",",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"HierarchicalUriComponents",
".",
"encodeUriComponent",
"(",
"port",
",",
"encoding",
",",
"HierarchicalUriCompone... | Encodes the given URI port with the given encoding.
@param port the port to be encoded
@param encoding the character encoding to encode to
@return the encoded port
@throws UnsupportedEncodingException when the given encoding parameter is not supported | [
"Encodes",
"the",
"given",
"URI",
"port",
"with",
"the",
"given",
"encoding",
"."
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/web/util/UriUtils.java#L263-L265 |
vkostyukov/la4j | src/main/java/org/la4j/Matrix.java | Matrix.insertColumn | public Matrix insertColumn(int j, Vector column) {
"""
Adds one column to matrix.
@param j the column index
@return matrix with column.
"""
if (j > columns || j < 0) {
throw new IndexOutOfBoundsException("Illegal column number, must be 0.." + columns);
}
Matrix result;
... | java | public Matrix insertColumn(int j, Vector column) {
if (j > columns || j < 0) {
throw new IndexOutOfBoundsException("Illegal column number, must be 0.." + columns);
}
Matrix result;
if (rows == 0) {
result = blankOfShape(column.length(), columns + 1);
} el... | [
"public",
"Matrix",
"insertColumn",
"(",
"int",
"j",
",",
"Vector",
"column",
")",
"{",
"if",
"(",
"j",
">",
"columns",
"||",
"j",
"<",
"0",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"Illegal column number, must be 0..\"",
"+",
"columns",
... | Adds one column to matrix.
@param j the column index
@return matrix with column. | [
"Adds",
"one",
"column",
"to",
"matrix",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrix.java#L1075-L1098 |
Omertron/api-tvrage | src/main/java/com/omertron/tvrageapi/tools/TVRageParser.java | TVRageParser.parseEpisode | private static Episode parseEpisode(Element eEpisode, String season) {
"""
Parse the episode node into an Episode object
@param eEpisode
@param season
@return
"""
Episode episode = new Episode();
EpisodeNumber en = new EpisodeNumber();
en.setSeason(season);
en.setEpisode(D... | java | private static Episode parseEpisode(Element eEpisode, String season) {
Episode episode = new Episode();
EpisodeNumber en = new EpisodeNumber();
en.setSeason(season);
en.setEpisode(DOMHelper.getValueFromElement(eEpisode, "seasonnum"));
en.setAbsolute(DOMHelper.getValueFromElement... | [
"private",
"static",
"Episode",
"parseEpisode",
"(",
"Element",
"eEpisode",
",",
"String",
"season",
")",
"{",
"Episode",
"episode",
"=",
"new",
"Episode",
"(",
")",
";",
"EpisodeNumber",
"en",
"=",
"new",
"EpisodeNumber",
"(",
")",
";",
"en",
".",
"setSea... | Parse the episode node into an Episode object
@param eEpisode
@param season
@return | [
"Parse",
"the",
"episode",
"node",
"into",
"an",
"Episode",
"object"
] | train | https://github.com/Omertron/api-tvrage/blob/4e805a99de812fabea69d97098f2376be14d51bc/src/main/java/com/omertron/tvrageapi/tools/TVRageParser.java#L196-L214 |
OpenTSDB/opentsdb | src/tsd/client/QueryUi.java | QueryUi.makeAxesPanel | private Grid makeAxesPanel() {
"""
Builds the panel containing customizations for the axes of the graph.
"""
final Grid grid = new Grid(5, 3);
grid.setText(0, 1, "Y");
grid.setText(0, 2, "Y2");
setTextAlignCenter(grid.getRowFormatter().getElement(0));
grid.setText(1, 0, "Label");
grid.s... | java | private Grid makeAxesPanel() {
final Grid grid = new Grid(5, 3);
grid.setText(0, 1, "Y");
grid.setText(0, 2, "Y2");
setTextAlignCenter(grid.getRowFormatter().getElement(0));
grid.setText(1, 0, "Label");
grid.setWidget(1, 1, ylabel);
grid.setWidget(1, 2, y2label);
grid.setText(2, 0, "Form... | [
"private",
"Grid",
"makeAxesPanel",
"(",
")",
"{",
"final",
"Grid",
"grid",
"=",
"new",
"Grid",
"(",
"5",
",",
"3",
")",
";",
"grid",
".",
"setText",
"(",
"0",
",",
"1",
",",
"\"Y\"",
")",
";",
"grid",
".",
"setText",
"(",
"0",
",",
"2",
",",
... | Builds the panel containing customizations for the axes of the graph. | [
"Builds",
"the",
"panel",
"containing",
"customizations",
"for",
"the",
"axes",
"of",
"the",
"graph",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/client/QueryUi.java#L517-L537 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_publicFolder_path_permission_POST | public OvhTask organizationName_service_exchangeService_publicFolder_path_permission_POST(String organizationName, String exchangeService, String path, OvhPublicFolderRightTypeEnum accessRights, Long allowedAccountId) throws IOException {
"""
Create public folder permission
REST: POST /email/exchange/{organizat... | java | public OvhTask organizationName_service_exchangeService_publicFolder_path_permission_POST(String organizationName, String exchangeService, String path, OvhPublicFolderRightTypeEnum accessRights, Long allowedAccountId) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/pu... | [
"public",
"OvhTask",
"organizationName_service_exchangeService_publicFolder_path_permission_POST",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"path",
",",
"OvhPublicFolderRightTypeEnum",
"accessRights",
",",
"Long",
"allowedAccountId",
")"... | Create public folder permission
REST: POST /email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission
@param allowedAccountId [required] Account id to have access to public folder
@param accessRights [required] Access rights to be set for the account
@param organizationName [required] ... | [
"Create",
"public",
"folder",
"permission"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L229-L237 |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/EmailIntents.java | EmailIntents.newEmailIntent | public static Intent newEmailIntent(String address, String subject, String body, Uri attachment) {
"""
Create an intent to send an email with an attachment to a single recipient
@param address The recipient address (or null if not specified)
@param subject The subject of the email (or null if not specifi... | java | public static Intent newEmailIntent(String address, String subject, String body, Uri attachment) {
return newEmailIntent(address == null ? null : new String[]{address}, subject, body, attachment);
} | [
"public",
"static",
"Intent",
"newEmailIntent",
"(",
"String",
"address",
",",
"String",
"subject",
",",
"String",
"body",
",",
"Uri",
"attachment",
")",
"{",
"return",
"newEmailIntent",
"(",
"address",
"==",
"null",
"?",
"null",
":",
"new",
"String",
"[",
... | Create an intent to send an email with an attachment to a single recipient
@param address The recipient address (or null if not specified)
@param subject The subject of the email (or null if not specified)
@param body The body of the email (or null if not specified)
@param attachment The URI of a file to a... | [
"Create",
"an",
"intent",
"to",
"send",
"an",
"email",
"with",
"an",
"attachment",
"to",
"a",
"single",
"recipient"
] | train | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/EmailIntents.java#L51-L53 |
jledit/jledit | core/src/main/java/org/jledit/terminal/JlEditTerminalFactory.java | JlEditTerminalFactory.get | public static Terminal get(Terminal terminal, boolean preExists) throws Exception {
"""
Wraps a {@link Terminal}.
@param terminal
@param preExists
@return
@throws Exception
"""
if (UnixTerminal.class.isAssignableFrom(terminal.getClass())) {
return new JlEditUnixTerminal((UnixTerminal) t... | java | public static Terminal get(Terminal terminal, boolean preExists) throws Exception {
if (UnixTerminal.class.isAssignableFrom(terminal.getClass())) {
return new JlEditUnixTerminal((UnixTerminal) terminal, preExists);
} else if (WindowsTerminal.class.isAssignableFrom(terminal.getClass())) {
... | [
"public",
"static",
"Terminal",
"get",
"(",
"Terminal",
"terminal",
",",
"boolean",
"preExists",
")",
"throws",
"Exception",
"{",
"if",
"(",
"UnixTerminal",
".",
"class",
".",
"isAssignableFrom",
"(",
"terminal",
".",
"getClass",
"(",
")",
")",
")",
"{",
"... | Wraps a {@link Terminal}.
@param terminal
@param preExists
@return
@throws Exception | [
"Wraps",
"a",
"{"
] | train | https://github.com/jledit/jledit/blob/ced2c4b44330664adb65f8be4c8fff780ccaa6fd/core/src/main/java/org/jledit/terminal/JlEditTerminalFactory.java#L64-L72 |
Azure/azure-sdk-for-java | cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java | DatabaseAccountsInner.patchAsync | public Observable<DatabaseAccountInner> patchAsync(String resourceGroupName, String accountName, DatabaseAccountPatchParameters updateParameters) {
"""
Patches the properties of an existing Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB ... | java | public Observable<DatabaseAccountInner> patchAsync(String resourceGroupName, String accountName, DatabaseAccountPatchParameters updateParameters) {
return patchWithServiceResponseAsync(resourceGroupName, accountName, updateParameters).map(new Func1<ServiceResponse<DatabaseAccountInner>, DatabaseAccountInner>() ... | [
"public",
"Observable",
"<",
"DatabaseAccountInner",
">",
"patchAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"DatabaseAccountPatchParameters",
"updateParameters",
")",
"{",
"return",
"patchWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Patches the properties of an existing Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param updateParameters The tags parameter to patch for the current database account.
@throws IllegalArgumentException thrown if paramete... | [
"Patches",
"the",
"properties",
"of",
"an",
"existing",
"Azure",
"Cosmos",
"DB",
"database",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java#L301-L308 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcServiceUtils.java | AkkaRpcServiceUtils.createRpcService | public static RpcService createRpcService(
String hostname,
String portRangeDefinition,
Configuration configuration,
String actorSystemName,
@Nonnull BootstrapTools.ActorSystemExecutorConfiguration actorSystemExecutorConfiguration) throws Exception {
"""
Utility method to create RPC service from configur... | java | public static RpcService createRpcService(
String hostname,
String portRangeDefinition,
Configuration configuration,
String actorSystemName,
@Nonnull BootstrapTools.ActorSystemExecutorConfiguration actorSystemExecutorConfiguration) throws Exception {
final ActorSystem actorSystem = BootstrapTools.startActo... | [
"public",
"static",
"RpcService",
"createRpcService",
"(",
"String",
"hostname",
",",
"String",
"portRangeDefinition",
",",
"Configuration",
"configuration",
",",
"String",
"actorSystemName",
",",
"@",
"Nonnull",
"BootstrapTools",
".",
"ActorSystemExecutorConfiguration",
... | Utility method to create RPC service from configuration and hostname, port.
@param hostname The hostname/address that describes the TaskManager's data location.
@param portRangeDefinition The port range to start TaskManager on.
@param configuration The configuration for the TaskManager.
@param actorSystemName The acto... | [
"Utility",
"method",
"to",
"create",
"RPC",
"service",
"from",
"configuration",
"and",
"hostname",
"port",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcServiceUtils.java#L118-L134 |
advantageous/guicefx | guicefx/src/main/java/io/advantageous/guicefx/JavaFXModule.java | JavaFXModule.configure | @Override
protected final void configure() {
"""
Binds two listeners for classes annotated with {@link Presents} and {@link LoadedBy}. Classes annotated with
{@link Presents} will be directly set as the controller for the loaded fxml. Classes annotated with
{@link LoadedBy} will be used in the controller f... | java | @Override
protected final void configure() {
bindListener(
new AbstractMatcher<TypeLiteral<?>>() {
@Override
public boolean matches(TypeLiteral<?> typeLiteral) {
return typeLiteral.getRawType().isAnnotationPresent(Presents.clas... | [
"@",
"Override",
"protected",
"final",
"void",
"configure",
"(",
")",
"{",
"bindListener",
"(",
"new",
"AbstractMatcher",
"<",
"TypeLiteral",
"<",
"?",
">",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
"(",
"TypeLiteral",
"<",
"?",
... | Binds two listeners for classes annotated with {@link Presents} and {@link LoadedBy}. Classes annotated with
{@link Presents} will be directly set as the controller for the loaded fxml. Classes annotated with
{@link LoadedBy} will be used in the controller factory created by the {@link javafx.fxml.FXMLLoader}. | [
"Binds",
"two",
"listeners",
"for",
"classes",
"annotated",
"with",
"{"
] | train | https://github.com/advantageous/guicefx/blob/03a31740298041d8fb77edc195e19945fc8b479a/guicefx/src/main/java/io/advantageous/guicefx/JavaFXModule.java#L49-L103 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/nosql/mongo/MongoDS.java | MongoDS.createCredentail | private MongoCredential createCredentail(String group) {
"""
创建{@link MongoCredential},用于服务端验证<br>
此方法会首先读取指定分组下的属性,用户没有定义则读取空分组下的属性
@param group 分组
@return {@link MongoCredential},如果用户未指定用户名密码返回null
@since 4.1.20
"""
final Setting setting = this.setting;
if(null == setting) {
return null;
}... | java | private MongoCredential createCredentail(String group) {
final Setting setting = this.setting;
if(null == setting) {
return null;
}
final String user = setting.getStr("user", group, setting.getStr("user"));
final String pass = setting.getStr("pass", group, setting.getStr("pass"));
final String dat... | [
"private",
"MongoCredential",
"createCredentail",
"(",
"String",
"group",
")",
"{",
"final",
"Setting",
"setting",
"=",
"this",
".",
"setting",
";",
"if",
"(",
"null",
"==",
"setting",
")",
"{",
"return",
"null",
";",
"}",
"final",
"String",
"user",
"=",
... | 创建{@link MongoCredential},用于服务端验证<br>
此方法会首先读取指定分组下的属性,用户没有定义则读取空分组下的属性
@param group 分组
@return {@link MongoCredential},如果用户未指定用户名密码返回null
@since 4.1.20 | [
"创建",
"{",
"@link",
"MongoCredential",
"}",
",用于服务端验证<br",
">",
"此方法会首先读取指定分组下的属性,用户没有定义则读取空分组下的属性"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/nosql/mongo/MongoDS.java#L295-L304 |
kiegroup/drools | kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/compiler/ItemDefinitionDependenciesSorter.java | ItemDefinitionDependenciesSorter.dfVisit | private void dfVisit(ItemDefinition node, List<ItemDefinition> allNodes, Collection<ItemDefinition> visited, List<ItemDefinition> dfv) {
"""
Performs a depth first visit, but keeping a separate reference of visited/visiting nodes, _also_ to avoid potential issues of circularities.
"""
visited.add(node)... | java | private void dfVisit(ItemDefinition node, List<ItemDefinition> allNodes, Collection<ItemDefinition> visited, List<ItemDefinition> dfv) {
visited.add(node);
List<ItemDefinition> neighbours = allNodes.stream()
.filter(n -> !n.getName().equals(node.getName... | [
"private",
"void",
"dfVisit",
"(",
"ItemDefinition",
"node",
",",
"List",
"<",
"ItemDefinition",
">",
"allNodes",
",",
"Collection",
"<",
"ItemDefinition",
">",
"visited",
",",
"List",
"<",
"ItemDefinition",
">",
"dfv",
")",
"{",
"visited",
".",
"add",
"(",
... | Performs a depth first visit, but keeping a separate reference of visited/visiting nodes, _also_ to avoid potential issues of circularities. | [
"Performs",
"a",
"depth",
"first",
"visit",
"but",
"keeping",
"a",
"separate",
"reference",
"of",
"visited",
"/",
"visiting",
"nodes",
"_also_",
"to",
"avoid",
"potential",
"issues",
"of",
"circularities",
"."
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/compiler/ItemDefinitionDependenciesSorter.java#L58-L72 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.Comment | public JBBPDslBuilder Comment(final String text) {
"""
Add comment, in case that a field followed by the comment, the comment will be placed on the same line as field definition.
@param text text of comment, can be null
@return the builder instance, must not be null
"""
this.addItem(new ItemComment(tex... | java | public JBBPDslBuilder Comment(final String text) {
this.addItem(new ItemComment(text == null ? "" : text, false));
return this;
} | [
"public",
"JBBPDslBuilder",
"Comment",
"(",
"final",
"String",
"text",
")",
"{",
"this",
".",
"addItem",
"(",
"new",
"ItemComment",
"(",
"text",
"==",
"null",
"?",
"\"\"",
":",
"text",
",",
"false",
")",
")",
";",
"return",
"this",
";",
"}"
] | Add comment, in case that a field followed by the comment, the comment will be placed on the same line as field definition.
@param text text of comment, can be null
@return the builder instance, must not be null | [
"Add",
"comment",
"in",
"case",
"that",
"a",
"field",
"followed",
"by",
"the",
"comment",
"the",
"comment",
"will",
"be",
"placed",
"on",
"the",
"same",
"line",
"as",
"field",
"definition",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L1301-L1304 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/transport/netty/ConfigPipeline.java | ConfigPipeline.initChannel | @Override
protected void initChannel(final Channel ch) throws Exception {
"""
Init the pipeline with the HTTP codec and our handler which does all the json chunk
decoding and parsing.
<p>
If trace logging is enabled also add the logging handler so we can figure out whats
going on when debugging.
"""
... | java | @Override
protected void initChannel(final Channel ch) throws Exception {
ChannelPipeline pipeline = ch.pipeline();
if (environment.sslEnabled()) {
pipeline.addLast(new SslHandler(sslEngineFactory.get()));
}
if (LOGGER.isTraceEnabled()) {
pipeline.addLast(new LoggingHandler(LogLevel.TRACE... | [
"@",
"Override",
"protected",
"void",
"initChannel",
"(",
"final",
"Channel",
"ch",
")",
"throws",
"Exception",
"{",
"ChannelPipeline",
"pipeline",
"=",
"ch",
".",
"pipeline",
"(",
")",
";",
"if",
"(",
"environment",
".",
"sslEnabled",
"(",
")",
")",
"{",
... | Init the pipeline with the HTTP codec and our handler which does all the json chunk
decoding and parsing.
<p>
If trace logging is enabled also add the logging handler so we can figure out whats
going on when debugging. | [
"Init",
"the",
"pipeline",
"with",
"the",
"HTTP",
"codec",
"and",
"our",
"handler",
"which",
"does",
"all",
"the",
"json",
"chunk",
"decoding",
"and",
"parsing",
".",
"<p",
">",
"If",
"trace",
"logging",
"is",
"enabled",
"also",
"add",
"the",
"logging",
... | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/transport/netty/ConfigPipeline.java#L107-L123 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TitlePaneCloseButtonPainter.java | TitlePaneCloseButtonPainter.paintClose | private void paintClose(Graphics2D g, JComponent c, int width, int height, ButtonColors colors) {
"""
Paint the background of the button using the specified colors.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the hei... | java | private void paintClose(Graphics2D g, JComponent c, int width, int height, ButtonColors colors) {
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
Shape s = decodeInterior(width, height);
g.setPaint(decodeCloseGradient(s, colors.interiorTop, colors.interio... | [
"private",
"void",
"paintClose",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
",",
"ButtonColors",
"colors",
")",
"{",
"g",
".",
"setRenderingHint",
"(",
"RenderingHints",
".",
"KEY_ANTIALIASING",
",",
"RenderingHi... | Paint the background of the button using the specified colors.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component.
@param colors the color set to use to paint the button. | [
"Paint",
"the",
"background",
"of",
"the",
"button",
"using",
"the",
"specified",
"colors",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TitlePaneCloseButtonPainter.java#L152-L175 |
graknlabs/grakn | server/src/graql/gremlin/spanningtree/datastructure/FibonacciHeap.java | FibonacciHeap.mergeLists | private Entry mergeLists(Entry a, Entry b) {
"""
Merge two doubly-linked circular lists, given a pointer into each.
Return the smaller of the two arguments.
"""
if (a == null) return b;
if (b == null) return a;
// splice the two circular lists together like a Mobius strip
fina... | java | private Entry mergeLists(Entry a, Entry b) {
if (a == null) return b;
if (b == null) return a;
// splice the two circular lists together like a Mobius strip
final Entry aOldNext = a.next;
a.next = b.next;
a.next.previous = a;
b.next = aOldNext;
b.next.pre... | [
"private",
"Entry",
"mergeLists",
"(",
"Entry",
"a",
",",
"Entry",
"b",
")",
"{",
"if",
"(",
"a",
"==",
"null",
")",
"return",
"b",
";",
"if",
"(",
"b",
"==",
"null",
")",
"return",
"a",
";",
"// splice the two circular lists together like a Mobius strip",
... | Merge two doubly-linked circular lists, given a pointer into each.
Return the smaller of the two arguments. | [
"Merge",
"two",
"doubly",
"-",
"linked",
"circular",
"lists",
"given",
"a",
"pointer",
"into",
"each",
".",
"Return",
"the",
"smaller",
"of",
"the",
"two",
"arguments",
"."
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/graql/gremlin/spanningtree/datastructure/FibonacciHeap.java#L266-L278 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.