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 |
|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src/org/opencms/ui/apps/cacheadmin/CmsImageCacheTable.java | CmsImageCacheTable.showVariationsWindow | void showVariationsWindow(String resource) {
"""
Shows dialog for variations of given resource.<p>
@param resource to show variations for
"""
final Window window = CmsBasicDialog.prepareWindow(DialogWidth.max);
CmsVariationsDialog variationsDialog = new CmsVariationsDialog(resource, new Run... | java | void showVariationsWindow(String resource) {
final Window window = CmsBasicDialog.prepareWindow(DialogWidth.max);
CmsVariationsDialog variationsDialog = new CmsVariationsDialog(resource, new Runnable() {
public void run() {
window.close();
}
}, Mode.I... | [
"void",
"showVariationsWindow",
"(",
"String",
"resource",
")",
"{",
"final",
"Window",
"window",
"=",
"CmsBasicDialog",
".",
"prepareWindow",
"(",
"DialogWidth",
".",
"max",
")",
";",
"CmsVariationsDialog",
"variationsDialog",
"=",
"new",
"CmsVariationsDialog",
"("... | Shows dialog for variations of given resource.<p>
@param resource to show variations for | [
"Shows",
"dialog",
"for",
"variations",
"of",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/cacheadmin/CmsImageCacheTable.java#L411-L433 |
elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.randomShuffle | public static void randomShuffle(ArrayModifiableDBIDs ids, RandomFactory rnd) {
"""
Produce a random shuffling of the given DBID array.
@param ids Original DBIDs, no duplicates allowed
@param rnd Random generator
"""
randomShuffle(ids, rnd.getSingleThreadedRandom(), ids.size());
} | java | public static void randomShuffle(ArrayModifiableDBIDs ids, RandomFactory rnd) {
randomShuffle(ids, rnd.getSingleThreadedRandom(), ids.size());
} | [
"public",
"static",
"void",
"randomShuffle",
"(",
"ArrayModifiableDBIDs",
"ids",
",",
"RandomFactory",
"rnd",
")",
"{",
"randomShuffle",
"(",
"ids",
",",
"rnd",
".",
"getSingleThreadedRandom",
"(",
")",
",",
"ids",
".",
"size",
"(",
")",
")",
";",
"}"
] | Produce a random shuffling of the given DBID array.
@param ids Original DBIDs, no duplicates allowed
@param rnd Random generator | [
"Produce",
"a",
"random",
"shuffling",
"of",
"the",
"given",
"DBID",
"array",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L510-L512 |
radkovo/CSSBox | src/main/java/org/fit/cssbox/layout/BlockTableBox.java | BlockTableBox.organizeContent | private void organizeContent() {
"""
Goes through the list of child boxes and organizes them into captions, header,
footer, etc.
"""
table = new TableBox(el, g, ctx);
table.adoptParent(this);
table.setStyle(style);
for (Iterator<Box> it = nested.iterator(); it.hasNext(... | java | private void organizeContent()
{
table = new TableBox(el, g, ctx);
table.adoptParent(this);
table.setStyle(style);
for (Iterator<Box> it = nested.iterator(); it.hasNext(); )
{
Box box = it.next();
if (box instanceof TableCaptionBox)
... | [
"private",
"void",
"organizeContent",
"(",
")",
"{",
"table",
"=",
"new",
"TableBox",
"(",
"el",
",",
"g",
",",
"ctx",
")",
";",
"table",
".",
"adoptParent",
"(",
"this",
")",
";",
"table",
".",
"setStyle",
"(",
"style",
")",
";",
"for",
"(",
"Iter... | Goes through the list of child boxes and organizes them into captions, header,
footer, etc. | [
"Goes",
"through",
"the",
"list",
"of",
"child",
"boxes",
"and",
"organizes",
"them",
"into",
"captions",
"header",
"footer",
"etc",
"."
] | train | https://github.com/radkovo/CSSBox/blob/38aaf8f22d233d7b4dbc12a56cdbc72b447bc559/src/main/java/org/fit/cssbox/layout/BlockTableBox.java#L269-L297 |
elki-project/elki | addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/UKMeans.java | UKMeans.getExpectedRepDistance | protected double getExpectedRepDistance(NumberVector rep, DiscreteUncertainObject uo) {
"""
Get expected distance between a Vector and an uncertain object
@param rep A vector, e.g. a cluster representative
@param uo A discrete uncertain object
@return The distance
"""
SquaredEuclideanDistanceFunction ... | java | protected double getExpectedRepDistance(NumberVector rep, DiscreteUncertainObject uo) {
SquaredEuclideanDistanceFunction euclidean = SquaredEuclideanDistanceFunction.STATIC;
int counter = 0;
double sum = 0.0;
for(int i = 0; i < uo.getNumberSamples(); i++) {
sum += euclidean.distance(rep, uo.getSam... | [
"protected",
"double",
"getExpectedRepDistance",
"(",
"NumberVector",
"rep",
",",
"DiscreteUncertainObject",
"uo",
")",
"{",
"SquaredEuclideanDistanceFunction",
"euclidean",
"=",
"SquaredEuclideanDistanceFunction",
".",
"STATIC",
";",
"int",
"counter",
"=",
"0",
";",
"d... | Get expected distance between a Vector and an uncertain object
@param rep A vector, e.g. a cluster representative
@param uo A discrete uncertain object
@return The distance | [
"Get",
"expected",
"distance",
"between",
"a",
"Vector",
"and",
"an",
"uncertain",
"object"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/UKMeans.java#L243-L252 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/data/clock/Day.java | Day.getFirstOfMonth | public static Day getFirstOfMonth(int dayOfWeek, int month, int year) {
"""
Find the first of a specific day in a given month. For instance
first Tuesday of May:
getFirstOfMonth(Calendar.TUESDAY, Calendar.MAY, 2005);
@param dayOfWeek Weekday to get.
@param month Month of day to get.
@param year ... | java | public static Day getFirstOfMonth(int dayOfWeek, int month, int year)
{
return Day.getNthOfMonth(1, dayOfWeek, month, year);
} | [
"public",
"static",
"Day",
"getFirstOfMonth",
"(",
"int",
"dayOfWeek",
",",
"int",
"month",
",",
"int",
"year",
")",
"{",
"return",
"Day",
".",
"getNthOfMonth",
"(",
"1",
",",
"dayOfWeek",
",",
"month",
",",
"year",
")",
";",
"}"
] | Find the first of a specific day in a given month. For instance
first Tuesday of May:
getFirstOfMonth(Calendar.TUESDAY, Calendar.MAY, 2005);
@param dayOfWeek Weekday to get.
@param month Month of day to get.
@param year Year of day to get.
@return The requested day. | [
"Find",
"the",
"first",
"of",
"a",
"specific",
"day",
"in",
"a",
"given",
"month",
".",
"For",
"instance",
"first",
"Tuesday",
"of",
"May",
":",
"getFirstOfMonth",
"(",
"Calendar",
".",
"TUESDAY",
"Calendar",
".",
"MAY",
"2005",
")",
";"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/data/clock/Day.java#L588-L591 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/TileConfig.java | TileConfig.imports | public static TileRef imports(Xml nodeTile) {
"""
Create the tile data from node.
@param nodeTile The node reference (must not be <code>null</code>).
@return The tile data.
@throws LionEngineException If <code>null</code> argument or error when reading.
"""
Check.notNull(nodeTile);
fin... | java | public static TileRef imports(Xml nodeTile)
{
Check.notNull(nodeTile);
final int sheet = nodeTile.readInteger(ATT_TILE_SHEET);
final int number = nodeTile.readInteger(ATT_TILE_NUMBER);
return new TileRef(sheet, number);
} | [
"public",
"static",
"TileRef",
"imports",
"(",
"Xml",
"nodeTile",
")",
"{",
"Check",
".",
"notNull",
"(",
"nodeTile",
")",
";",
"final",
"int",
"sheet",
"=",
"nodeTile",
".",
"readInteger",
"(",
"ATT_TILE_SHEET",
")",
";",
"final",
"int",
"number",
"=",
... | Create the tile data from node.
@param nodeTile The node reference (must not be <code>null</code>).
@return The tile data.
@throws LionEngineException If <code>null</code> argument or error when reading. | [
"Create",
"the",
"tile",
"data",
"from",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/TileConfig.java#L49-L57 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaReferenceUtilsImpl.java | JmsJcaReferenceUtilsImpl.getMapFromReference | public Map getMapFromReference(final Reference ref, final Map defaults) {
"""
Uses the reference passed in to extract a map of properties which have
been stored in this Reference.
@param ref
the reference
@param defaults
the default set of properties to be used (those in the reference will override these)
... | java | public Map getMapFromReference(final Reference ref, final Map defaults) {
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, "getMapFromReference", new Object[] {ref,defaults});
}
Map extractedProps = null;
// Extract a Map of th... | [
"public",
"Map",
"getMapFromReference",
"(",
"final",
"Reference",
"ref",
",",
"final",
"Map",
"defaults",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"TRACE",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
... | Uses the reference passed in to extract a map of properties which have
been stored in this Reference.
@param ref
the reference
@param defaults
the default set of properties to be used (those in the reference will override these)
@return the map of properties | [
"Uses",
"the",
"reference",
"passed",
"in",
"to",
"extract",
"a",
"map",
"of",
"properties",
"which",
"have",
"been",
"stored",
"in",
"this",
"Reference",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaReferenceUtilsImpl.java#L386-L427 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java | JsonRpcClient.readResponse | public Object readResponse(Type returnType, InputStream input) throws Throwable {
"""
Reads a JSON-PRC response from the server. This blocks until
a response is received.
@param returnType the expected return type
@param input the {@link InputStream} to read from
@return the object returned by the JSON... | java | public Object readResponse(Type returnType, InputStream input) throws Throwable {
return readResponse(returnType, input, null);
} | [
"public",
"Object",
"readResponse",
"(",
"Type",
"returnType",
",",
"InputStream",
"input",
")",
"throws",
"Throwable",
"{",
"return",
"readResponse",
"(",
"returnType",
",",
"input",
",",
"null",
")",
";",
"}"
] | Reads a JSON-PRC response from the server. This blocks until
a response is received.
@param returnType the expected return type
@param input the {@link InputStream} to read from
@return the object returned by the JSON-RPC response
@throws Throwable on error | [
"Reads",
"a",
"JSON",
"-",
"PRC",
"response",
"from",
"the",
"server",
".",
"This",
"blocks",
"until",
"a",
"response",
"is",
"received",
"."
] | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java#L530-L532 |
omise/omise-java | src/main/java/co/omise/resources/Resource.java | Resource.buildUrl | protected HttpUrl buildUrl(Endpoint endpoint, String path, String... segments) {
"""
Builds and returns a valid {@link HttpUrl} pointing to the given {@link Endpoint}'s host
and with all the supplied segments concatenated.
@param endpoint The Omise API {@link Endpoint} to point to.
@param path The base AP... | java | protected HttpUrl buildUrl(Endpoint endpoint, String path, String... segments) {
Preconditions.checkNotNull(endpoint);
Preconditions.checkNotNull(path);
HttpUrl.Builder builder = endpoint.buildUrl()
.addPathSegment(path);
for (String segment : segments) {
if... | [
"protected",
"HttpUrl",
"buildUrl",
"(",
"Endpoint",
"endpoint",
",",
"String",
"path",
",",
"String",
"...",
"segments",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"endpoint",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"path",
")",
";",
... | Builds and returns a valid {@link HttpUrl} pointing to the given {@link Endpoint}'s host
and with all the supplied segments concatenated.
@param endpoint The Omise API {@link Endpoint} to point to.
@param path The base API path.
@param segments Additional URL path segments that should be appended.
@return An {@lin... | [
"Builds",
"and",
"returns",
"a",
"valid",
"{",
"@link",
"HttpUrl",
"}",
"pointing",
"to",
"the",
"given",
"{",
"@link",
"Endpoint",
"}",
"s",
"host",
"and",
"with",
"all",
"the",
"supplied",
"segments",
"concatenated",
"."
] | train | https://github.com/omise/omise-java/blob/95aafc5e8c21b44e6d00a5a9080b9e353fe98042/src/main/java/co/omise/resources/Resource.java#L104-L120 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/tools/Model.java | Model.setTrackStop | public void setTrackStop(final double TRACK_STOP) {
"""
Sets the track stop value of the gauge to the given value
@param TRACK_STOP
"""
// check values
if (Double.compare(trackStart, TRACK_STOP) == 0) {
throw new IllegalArgumentException("Track stop value cannot equal track start v... | java | public void setTrackStop(final double TRACK_STOP) {
// check values
if (Double.compare(trackStart, TRACK_STOP) == 0) {
throw new IllegalArgumentException("Track stop value cannot equal track start value");
}
trackStop = TRACK_STOP;
validate();
fireStateChanged... | [
"public",
"void",
"setTrackStop",
"(",
"final",
"double",
"TRACK_STOP",
")",
"{",
"// check values",
"if",
"(",
"Double",
".",
"compare",
"(",
"trackStart",
",",
"TRACK_STOP",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Track ... | Sets the track stop value of the gauge to the given value
@param TRACK_STOP | [
"Sets",
"the",
"track",
"stop",
"value",
"of",
"the",
"gauge",
"to",
"the",
"given",
"value"
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/tools/Model.java#L1448-L1456 |
ManfredTremmel/gwt-bean-validators | mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/EmailMustHaveSameDomainValidator.java | EmailMustHaveSameDomainValidator.isValid | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
"""
{@inheritDoc} check if given object is valid.
@see javax.validation.ConstraintValidator#isValid(Object,
javax.validation.ConstraintValidatorContext)
"""
if (pvalue == null) {
return true... | java | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
if (pvalue == null) {
return true;
}
try {
final String field1Value =
getDomainOf(BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, field1Name));
final String field2V... | [
"@",
"Override",
"public",
"final",
"boolean",
"isValid",
"(",
"final",
"Object",
"pvalue",
",",
"final",
"ConstraintValidatorContext",
"pcontext",
")",
"{",
"if",
"(",
"pvalue",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"try",
"{",
"final",
"Str... | {@inheritDoc} check if given object is valid.
@see javax.validation.ConstraintValidator#isValid(Object,
javax.validation.ConstraintValidatorContext) | [
"{",
"@inheritDoc",
"}",
"check",
"if",
"given",
"object",
"is",
"valid",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/EmailMustHaveSameDomainValidator.java#L80-L99 |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/utilities/ImageIOGreyScale.java | ImageIOGreyScale.getImageWriters | public static Iterator<ImageWriter> getImageWriters(ImageTypeSpecifier type, String formatName) {
"""
Returns an <code>Iterator</code> containing all currently registered <code>ImageWriter</code>s that
claim to be able to encode images of the given layout (specified using an
<code>ImageTypeSpecifier</code>) in t... | java | public static Iterator<ImageWriter> getImageWriters(ImageTypeSpecifier type, String formatName) {
if (type == null) {
throw new IllegalArgumentException("type == null!");
}
if (formatName == null) {
throw new IllegalArgumentException("formatName == null!");
}
Iterator iter;
// Ensure categor... | [
"public",
"static",
"Iterator",
"<",
"ImageWriter",
">",
"getImageWriters",
"(",
"ImageTypeSpecifier",
"type",
",",
"String",
"formatName",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"type == null!\"",
... | Returns an <code>Iterator</code> containing all currently registered <code>ImageWriter</code>s that
claim to be able to encode images of the given layout (specified using an
<code>ImageTypeSpecifier</code>) in the given format.
@param type
an <code>ImageTypeSpecifier</code> indicating the layout of the image to be wri... | [
"Returns",
"an",
"<code",
">",
"Iterator<",
"/",
"code",
">",
"containing",
"all",
"currently",
"registered",
"<code",
">",
"ImageWriter<",
"/",
"code",
">",
"s",
"that",
"claim",
"to",
"be",
"able",
"to",
"encode",
"images",
"of",
"the",
"given",
"layout"... | train | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/ImageIOGreyScale.java#L1017-L1034 |
actframework/actframework | src/main/java/act/crypto/AppCrypto.java | AppCrypto.passwordHash | public char[] passwordHash(char[] password) {
"""
Generate crypted hash of given password. This method is more secure than
{@link #passwordHash(String)} as it will fill the password char array
with `\0` once used.
See <a href="http://stackoverflow.com/questions/8881291/why-is-char-preferred-over-string-for-pa... | java | public char[] passwordHash(char[] password) {
if (null == password) {
return null;
}
return BCrypt.hashpw(password, BCrypt.gensalt());
} | [
"public",
"char",
"[",
"]",
"passwordHash",
"(",
"char",
"[",
"]",
"password",
")",
"{",
"if",
"(",
"null",
"==",
"password",
")",
"{",
"return",
"null",
";",
"}",
"return",
"BCrypt",
".",
"hashpw",
"(",
"password",
",",
"BCrypt",
".",
"gensalt",
"("... | Generate crypted hash of given password. This method is more secure than
{@link #passwordHash(String)} as it will fill the password char array
with `\0` once used.
See <a href="http://stackoverflow.com/questions/8881291/why-is-char-preferred-over-string-for-passwords-in-java">This SO for more detail</a>
@param passwor... | [
"Generate",
"crypted",
"hash",
"of",
"given",
"password",
".",
"This",
"method",
"is",
"more",
"secure",
"than",
"{",
"@link",
"#passwordHash",
"(",
"String",
")",
"}",
"as",
"it",
"will",
"fill",
"the",
"password",
"char",
"array",
"with",
"\\",
"0",
"o... | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/crypto/AppCrypto.java#L69-L74 |
podio/podio-java | src/main/java/com/podio/task/TaskAPI.java | TaskAPI.updatePrivate | public void updatePrivate(int taskId, boolean priv) {
"""
Update the private flag on the given task.
@param taskId
The id of the task
@param priv
<code>true</code> if the task should be private,
<code>false</code> otherwise
"""
getResourceFactory().getApiResource("/task/" + taskId + "/private")
.e... | java | public void updatePrivate(int taskId, boolean priv) {
getResourceFactory().getApiResource("/task/" + taskId + "/private")
.entity(new TaskPrivate(priv), MediaType.APPLICATION_JSON_TYPE)
.put();
} | [
"public",
"void",
"updatePrivate",
"(",
"int",
"taskId",
",",
"boolean",
"priv",
")",
"{",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/task/\"",
"+",
"taskId",
"+",
"\"/private\"",
")",
".",
"entity",
"(",
"new",
"TaskPrivate",
"(",
"priv... | Update the private flag on the given task.
@param taskId
The id of the task
@param priv
<code>true</code> if the task should be private,
<code>false</code> otherwise | [
"Update",
"the",
"private",
"flag",
"on",
"the",
"given",
"task",
"."
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/task/TaskAPI.java#L130-L134 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/config/ConfigValueHelper.java | ConfigValueHelper.checkNormalWithComma | protected static void checkNormalWithComma(String configKey, String configValue) throws SofaRpcRuntimeException {
"""
检查字符串是否是正常值(含逗号),不是则抛出异常
@param configKey 配置项
@param configValue 配置值
@throws SofaRpcRuntimeException 非法异常
"""
checkPattern(configKey, configValue, NORMAL_COMMA, "only allow a-zA-... | java | protected static void checkNormalWithComma(String configKey, String configValue) throws SofaRpcRuntimeException {
checkPattern(configKey, configValue, NORMAL_COMMA, "only allow a-zA-Z0-9 '-' '_' '.' ','");
} | [
"protected",
"static",
"void",
"checkNormalWithComma",
"(",
"String",
"configKey",
",",
"String",
"configValue",
")",
"throws",
"SofaRpcRuntimeException",
"{",
"checkPattern",
"(",
"configKey",
",",
"configValue",
",",
"NORMAL_COMMA",
",",
"\"only allow a-zA-Z0-9 '-' '_' ... | 检查字符串是否是正常值(含逗号),不是则抛出异常
@param configKey 配置项
@param configValue 配置值
@throws SofaRpcRuntimeException 非法异常 | [
"检查字符串是否是正常值(含逗号),不是则抛出异常"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/config/ConfigValueHelper.java#L108-L110 |
orhanobut/wasp | wasp/src/main/java/com/orhanobut/wasp/utils/MockFactory.java | MockFactory.readMockResponse | public static String readMockResponse(Context context, String filePath) {
"""
Reads mock response string from given path.
@param context Context with file access
@param filePath Path to mock file
@return Response string
"""
String responseString;
try {
responseString = IOUtils.readFileFrom... | java | public static String readMockResponse(Context context, String filePath) {
String responseString;
try {
responseString = IOUtils.readFileFromAssets(context, filePath);
} catch (IOException e) {
throw new RuntimeException(e);
}
if (TextUtils.isEmpty(responseString)) {
throw new Runt... | [
"public",
"static",
"String",
"readMockResponse",
"(",
"Context",
"context",
",",
"String",
"filePath",
")",
"{",
"String",
"responseString",
";",
"try",
"{",
"responseString",
"=",
"IOUtils",
".",
"readFileFromAssets",
"(",
"context",
",",
"filePath",
")",
";",... | Reads mock response string from given path.
@param context Context with file access
@param filePath Path to mock file
@return Response string | [
"Reads",
"mock",
"response",
"string",
"from",
"given",
"path",
"."
] | train | https://github.com/orhanobut/wasp/blob/295d8747aa7e410b185a620a6b87239816a38c11/wasp/src/main/java/com/orhanobut/wasp/utils/MockFactory.java#L37-L50 |
jbundle/jbundle | thin/base/util/util/src/main/java/org/jbundle/thin/base/util/message/RemoteMessageManager.java | RemoteMessageManager.getMessageQueue | public BaseMessageQueue getMessageQueue(String strQueueName, String strQueueType) {
"""
Get this Message Queue (or create one if this name doesn't exist).
Creates a RemoteMessageQueue if this queue doesn't exist.
@param strQueueName The queue name to lookup.
@param strQueueType The queue type if this queue need... | java | public BaseMessageQueue getMessageQueue(String strQueueName, String strQueueType)
{
// Look up the message Queue!
BaseMessageQueue messageQueue = (BaseMessageQueue)super.getMessageQueue(strQueueName, strQueueType);
if (messageQueue != null)
return messageQueue;
return new... | [
"public",
"BaseMessageQueue",
"getMessageQueue",
"(",
"String",
"strQueueName",
",",
"String",
"strQueueType",
")",
"{",
"// Look up the message Queue!",
"BaseMessageQueue",
"messageQueue",
"=",
"(",
"BaseMessageQueue",
")",
"super",
".",
"getMessageQueue",
"(",
"strQueue... | Get this Message Queue (or create one if this name doesn't exist).
Creates a RemoteMessageQueue if this queue doesn't exist.
@param strQueueName The queue name to lookup.
@param strQueueType The queue type if this queue needs to be created.
@return The message queue. | [
"Get",
"this",
"Message",
"Queue",
"(",
"or",
"create",
"one",
"if",
"this",
"name",
"doesn",
"t",
"exist",
")",
".",
"Creates",
"a",
"RemoteMessageQueue",
"if",
"this",
"queue",
"doesn",
"t",
"exist",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/util/util/src/main/java/org/jbundle/thin/base/util/message/RemoteMessageManager.java#L61-L68 |
att/AAF | authz/authz-core/src/main/java/com/att/cssa/rserv/CachingFileAccess.java | CachingFileAccess.cleanupParams | public void cleanupParams(int size, long interval) {
"""
Reset the Cleanup size and interval
The size and interval when started are 500 items (memory size unknown) checked every minute in a background thread.
@param size
@param interval
"""
timer.cancel();
timer.schedule(new Cleanup(content,size), i... | java | public void cleanupParams(int size, long interval) {
timer.cancel();
timer.schedule(new Cleanup(content,size), interval, interval);
} | [
"public",
"void",
"cleanupParams",
"(",
"int",
"size",
",",
"long",
"interval",
")",
"{",
"timer",
".",
"cancel",
"(",
")",
";",
"timer",
".",
"schedule",
"(",
"new",
"Cleanup",
"(",
"content",
",",
"size",
")",
",",
"interval",
",",
"interval",
")",
... | Reset the Cleanup size and interval
The size and interval when started are 500 items (memory size unknown) checked every minute in a background thread.
@param size
@param interval | [
"Reset",
"the",
"Cleanup",
"size",
"and",
"interval"
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-core/src/main/java/com/att/cssa/rserv/CachingFileAccess.java#L171-L174 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/AbstractCalendarAndExceptionFactory.java | AbstractCalendarAndExceptionFactory.processWorkWeeks | private void processWorkWeeks(byte[] data, int offset, ProjectCalendar cal) {
"""
Read the work weeks.
@param data calendar data
@param offset current offset into data
@param cal parent calendar
"""
// System.out.println("Calendar=" + cal.getName());
// System.out.println("Work week ... | java | private void processWorkWeeks(byte[] data, int offset, ProjectCalendar cal)
{
// System.out.println("Calendar=" + cal.getName());
// System.out.println("Work week block start offset=" + offset);
// System.out.println(ByteArrayHelper.hexdump(data, true, 16, ""));
// skip 4 byte... | [
"private",
"void",
"processWorkWeeks",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"ProjectCalendar",
"cal",
")",
"{",
"// System.out.println(\"Calendar=\" + cal.getName());",
"// System.out.println(\"Work week block start offset=\" + offset);",
"// S... | Read the work weeks.
@param data calendar data
@param offset current offset into data
@param cal parent calendar | [
"Read",
"the",
"work",
"weeks",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/AbstractCalendarAndExceptionFactory.java#L221-L271 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java | DevicesInner.listByResourceGroupAsync | public Observable<Page<DataBoxEdgeDeviceInner>> listByResourceGroupAsync(final String resourceGroupName, final String expand) {
"""
Gets all the data box edge/gateway devices in a resource group.
@param resourceGroupName The resource group name.
@param expand Specify $expand=details to populate additional fiel... | java | public Observable<Page<DataBoxEdgeDeviceInner>> listByResourceGroupAsync(final String resourceGroupName, final String expand) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName, expand)
.map(new Func1<ServiceResponse<Page<DataBoxEdgeDeviceInner>>, Page<DataBoxEdgeDeviceInner>>() ... | [
"public",
"Observable",
"<",
"Page",
"<",
"DataBoxEdgeDeviceInner",
">",
">",
"listByResourceGroupAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"expand",
")",
"{",
"return",
"listByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupN... | Gets all the data box edge/gateway devices in a resource group.
@param resourceGroupName The resource group name.
@param expand Specify $expand=details to populate additional fields related to the resource or Specify $skipToken=<token> to populate the next page in the list.
@throws IllegalArgumentException throw... | [
"Gets",
"all",
"the",
"data",
"box",
"edge",
"/",
"gateway",
"devices",
"in",
"a",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java#L535-L543 |
telly/groundy | library/src/main/java/com/telly/groundy/TaskResult.java | TaskResult.add | public TaskResult add(String key, CharSequence value) {
"""
Inserts a CharSequence value into the mapping of this Bundle, replacing any existing value for
the given key. Either key or value may be null.
@param key a String, or null
@param value a CharSequence, or null
"""
mBundle.putCharSequence(key,... | java | public TaskResult add(String key, CharSequence value) {
mBundle.putCharSequence(key, value);
return this;
} | [
"public",
"TaskResult",
"add",
"(",
"String",
"key",
",",
"CharSequence",
"value",
")",
"{",
"mBundle",
".",
"putCharSequence",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a CharSequence value into the mapping of this Bundle, replacing any existing value for
the given key. Either key or value may be null.
@param key a String, or null
@param value a CharSequence, or null | [
"Inserts",
"a",
"CharSequence",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/TaskResult.java#L167-L170 |
zxing/zxing | core/src/main/java/com/google/zxing/pdf417/encoder/PDF417.java | PDF417.calculateNumberOfRows | private static int calculateNumberOfRows(int m, int k, int c) {
"""
Calculates the necessary number of rows as described in annex Q of ISO/IEC 15438:2001(E).
@param m the number of source codewords prior to the additional of the Symbol Length
Descriptor and any pad codewords
@param k the number of error corre... | java | private static int calculateNumberOfRows(int m, int k, int c) {
int r = ((m + 1 + k) / c) + 1;
if (c * r >= (m + 1 + k + c)) {
r--;
}
return r;
} | [
"private",
"static",
"int",
"calculateNumberOfRows",
"(",
"int",
"m",
",",
"int",
"k",
",",
"int",
"c",
")",
"{",
"int",
"r",
"=",
"(",
"(",
"m",
"+",
"1",
"+",
"k",
")",
"/",
"c",
")",
"+",
"1",
";",
"if",
"(",
"c",
"*",
"r",
">=",
"(",
... | Calculates the necessary number of rows as described in annex Q of ISO/IEC 15438:2001(E).
@param m the number of source codewords prior to the additional of the Symbol Length
Descriptor and any pad codewords
@param k the number of error correction codewords
@param c the number of columns in the symbol in the data regi... | [
"Calculates",
"the",
"necessary",
"number",
"of",
"rows",
"as",
"described",
"in",
"annex",
"Q",
"of",
"ISO",
"/",
"IEC",
"15438",
":",
"2001",
"(",
"E",
")",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/pdf417/encoder/PDF417.java#L552-L558 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindInconsistentSync2.java | FindInconsistentSync2.isGetterMethod | public static boolean isGetterMethod(ClassContext classContext, Method method) {
"""
Determine whether or not the the given method is a getter method. I.e.,
if it just returns the value of an instance field.
@param classContext
the ClassContext for the class containing the method
@param method
the method
... | java | public static boolean isGetterMethod(ClassContext classContext, Method method) {
MethodGen methodGen = classContext.getMethodGen(method);
if (methodGen == null) {
return false;
}
InstructionList il = methodGen.getInstructionList();
// System.out.println("Checking gett... | [
"public",
"static",
"boolean",
"isGetterMethod",
"(",
"ClassContext",
"classContext",
",",
"Method",
"method",
")",
"{",
"MethodGen",
"methodGen",
"=",
"classContext",
".",
"getMethodGen",
"(",
"method",
")",
";",
"if",
"(",
"methodGen",
"==",
"null",
")",
"{"... | Determine whether or not the the given method is a getter method. I.e.,
if it just returns the value of an instance field.
@param classContext
the ClassContext for the class containing the method
@param method
the method | [
"Determine",
"whether",
"or",
"not",
"the",
"the",
"given",
"method",
"is",
"a",
"getter",
"method",
".",
"I",
".",
"e",
".",
"if",
"it",
"just",
"returns",
"the",
"value",
"of",
"an",
"instance",
"field",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindInconsistentSync2.java#L813-L865 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunckPyramid.java | HornSchunckPyramid.interpolateFlowScale | protected void interpolateFlowScale(int widthNew, int heightNew) {
"""
Provides an initial estimate for the flow by interpolating values from the previous layer.
"""
initFlowX.reshape(widthNew,heightNew);
initFlowY.reshape(widthNew,heightNew);
interpolateFlowScale(flowX, initFlowX);
interpolateFlowSca... | java | protected void interpolateFlowScale(int widthNew, int heightNew) {
initFlowX.reshape(widthNew,heightNew);
initFlowY.reshape(widthNew,heightNew);
interpolateFlowScale(flowX, initFlowX);
interpolateFlowScale(flowY, initFlowY);
flowX.reshape(widthNew,heightNew);
flowY.reshape(widthNew,heightNew);
// init ... | [
"protected",
"void",
"interpolateFlowScale",
"(",
"int",
"widthNew",
",",
"int",
"heightNew",
")",
"{",
"initFlowX",
".",
"reshape",
"(",
"widthNew",
",",
"heightNew",
")",
";",
"initFlowY",
".",
"reshape",
"(",
"widthNew",
",",
"heightNew",
")",
";",
"inter... | Provides an initial estimate for the flow by interpolating values from the previous layer. | [
"Provides",
"an",
"initial",
"estimate",
"for",
"the",
"flow",
"by",
"interpolating",
"values",
"from",
"the",
"previous",
"layer",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunckPyramid.java#L155-L169 |
jenkinsci/jenkins | core/src/main/java/hudson/ExtensionListView.java | ExtensionListView.createList | public static <T> List<T> createList(final Class<T> type) {
"""
Creates a plain {@link List} backed by the current {@link ExtensionList}.
"""
return new AbstractList<T>() {
private ExtensionList<T> storage() {
return Jenkins.getInstance().getExtensionList(type);
... | java | public static <T> List<T> createList(final Class<T> type) {
return new AbstractList<T>() {
private ExtensionList<T> storage() {
return Jenkins.getInstance().getExtensionList(type);
}
@Override
public Iterator<T> iterator() {
return... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"createList",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"new",
"AbstractList",
"<",
"T",
">",
"(",
")",
"{",
"private",
"ExtensionList",
"<",
"T",
">",
"storage",
"("... | Creates a plain {@link List} backed by the current {@link ExtensionList}. | [
"Creates",
"a",
"plain",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/ExtensionListView.java#L58-L98 |
kaazing/gateway | transport/http/src/main/java/org/kaazing/gateway/transport/http/security/auth/challenge/TokenHttpChallengeFactory.java | TokenHttpChallengeFactory.makeChallengeString | @Override
protected String makeChallengeString(ResourceAddress address, HttpRealmInfo realm, Object... params) {
"""
/* Override the HttpChallengeFactoryAdapter makeChallengeString method,
since that method automatically adds the "realm=" challenge parameter,
and for the suis generis "Application Token" auth... | java | @Override
protected String makeChallengeString(ResourceAddress address, HttpRealmInfo realm, Object... params) {
StringBuilder sb = new StringBuilder();
String challengeScheme = realm.getChallengeScheme();
if (isApplication(challengeScheme)) {
sb.append(AUTH_SCHEME_APPLICATION_P... | [
"@",
"Override",
"protected",
"String",
"makeChallengeString",
"(",
"ResourceAddress",
"address",
",",
"HttpRealmInfo",
"realm",
",",
"Object",
"...",
"params",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"challengeScheme... | /* Override the HttpChallengeFactoryAdapter makeChallengeString method,
since that method automatically adds the "realm=" challenge parameter,
and for the suis generis "Application Token" authentication scheme --
explicitly designed to be opaque -- we want to stay out of the way
of the custom opaque tokens. | [
"/",
"*",
"Override",
"the",
"HttpChallengeFactoryAdapter",
"makeChallengeString",
"method",
"since",
"that",
"method",
"automatically",
"adds",
"the",
"realm",
"=",
"challenge",
"parameter",
"and",
"for",
"the",
"suis",
"generis",
"Application",
"Token",
"authenticat... | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/http/src/main/java/org/kaazing/gateway/transport/http/security/auth/challenge/TokenHttpChallengeFactory.java#L40-L59 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201902/companyservice/GetAdvertisers.java | GetAdvertisers.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
"""
Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws ... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
CompanyServiceInterface companyService =
adManagerServices.get(session, CompanyServiceInterface.class);
// Create a statement to select companies.
StatementBuilder statementBu... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"CompanyServiceInterface",
"companyService",
"=",
"adManagerServices",
".",
"get",
"(",
"session",
",",
"C... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201902/companyservice/GetAdvertisers.java#L52-L86 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenbankWriter.java | GenbankWriter.process | public void process() throws Exception {
"""
Allow an override of operating system line separator for programs that
needs a specific CRLF or CR or LF option
@param lineSeparator
"""
// Loosely based on code from Howard Salis
// TODO - Force lower case?
// boolean closeit = false;
PrintWriter writer... | java | public void process() throws Exception {
// Loosely based on code from Howard Salis
// TODO - Force lower case?
// boolean closeit = false;
PrintWriter writer = new PrintWriter(os);
for (S sequence : sequences) {
String header = headerFormat.getHeader(sequence);
writer.format(header);
writer.println(... | [
"public",
"void",
"process",
"(",
")",
"throws",
"Exception",
"{",
"// Loosely based on code from Howard Salis",
"// TODO - Force lower case?",
"// boolean closeit = false;",
"PrintWriter",
"writer",
"=",
"new",
"PrintWriter",
"(",
"os",
")",
";",
"for",
"(",
"S",
"sequ... | Allow an override of operating system line separator for programs that
needs a specific CRLF or CR or LF option
@param lineSeparator | [
"Allow",
"an",
"override",
"of",
"operating",
"system",
"line",
"separator",
"for",
"programs",
"that",
"needs",
"a",
"specific",
"CRLF",
"or",
"CR",
"or",
"LF",
"option"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenbankWriter.java#L88-L133 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/AbstractBaseParams.java | AbstractBaseParams.readInteger | protected int readInteger(final String intString, final int min, final int max) {
"""
Read ab integer string value.
@param intString the integer value
@param min the minimum value allowed
@param max the maximum value allowed
@return the value parsed according to its range
"""
return Math.max(Ma... | java | protected int readInteger(final String intString, final int min, final int max) {
return Math.max(Math.min(Integer.parseInt(intString), max), min);
} | [
"protected",
"int",
"readInteger",
"(",
"final",
"String",
"intString",
",",
"final",
"int",
"min",
",",
"final",
"int",
"max",
")",
"{",
"return",
"Math",
".",
"max",
"(",
"Math",
".",
"min",
"(",
"Integer",
".",
"parseInt",
"(",
"intString",
")",
","... | Read ab integer string value.
@param intString the integer value
@param min the minimum value allowed
@param max the maximum value allowed
@return the value parsed according to its range | [
"Read",
"ab",
"integer",
"string",
"value",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/AbstractBaseParams.java#L166-L168 |
alkacon/opencms-core | src/org/opencms/file/collectors/CmsSubscriptionCollector.java | CmsSubscriptionCollector.getSubscriptionFilter | protected CmsSubscriptionFilter getSubscriptionFilter(CmsObject cms, String param) throws CmsException {
"""
Returns the configured subscription filter to use.<p>
@param cms the current users context
@param param an optional collector parameter
@return the configured subscription filter to use
@throws Cm... | java | protected CmsSubscriptionFilter getSubscriptionFilter(CmsObject cms, String param) throws CmsException {
return getSubscriptionFilter(cms, getParameters(param));
} | [
"protected",
"CmsSubscriptionFilter",
"getSubscriptionFilter",
"(",
"CmsObject",
"cms",
",",
"String",
"param",
")",
"throws",
"CmsException",
"{",
"return",
"getSubscriptionFilter",
"(",
"cms",
",",
"getParameters",
"(",
"param",
")",
")",
";",
"}"
] | Returns the configured subscription filter to use.<p>
@param cms the current users context
@param param an optional collector parameter
@return the configured subscription filter to use
@throws CmsException if something goes wrong | [
"Returns",
"the",
"configured",
"subscription",
"filter",
"to",
"use",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/collectors/CmsSubscriptionCollector.java#L322-L325 |
ops4j/org.ops4j.pax.exam2 | containers/pax-exam-container-eclipse/src/main/java/org/ops4j/pax/exam/container/eclipse/impl/sources/directory/DirectoryResolver.java | DirectoryResolver.storeToFolder | public static void storeToFolder(File folder, Collection<? extends EclipseBundle> bundles,
Collection<? extends EclipseFeature> features) throws IOException {
"""
Stores the given collection of bundles and features to the given folder in a way so it can be
read back by the directory resolver. All bundles... | java | public static void storeToFolder(File folder, Collection<? extends EclipseBundle> bundles,
Collection<? extends EclipseFeature> features) throws IOException {
File pluginsFolder = new File(folder, PLUGINS_FOLDER);
File featuresFolder = new File(folder, FEATURES_FOLDER);
FileUtils.for... | [
"public",
"static",
"void",
"storeToFolder",
"(",
"File",
"folder",
",",
"Collection",
"<",
"?",
"extends",
"EclipseBundle",
">",
"bundles",
",",
"Collection",
"<",
"?",
"extends",
"EclipseFeature",
">",
"features",
")",
"throws",
"IOException",
"{",
"File",
"... | Stores the given collection of bundles and features to the given folder in a way so it can be
read back by the directory resolver. All bundles and features must be able to be transformed
to an input stream via the {@link StreamReference} interface or an exception is raised!
@param folder
the folder to store the artifa... | [
"Stores",
"the",
"given",
"collection",
"of",
"bundles",
"and",
"features",
"to",
"the",
"given",
"folder",
"in",
"a",
"way",
"so",
"it",
"can",
"be",
"read",
"back",
"by",
"the",
"directory",
"resolver",
".",
"All",
"bundles",
"and",
"features",
"must",
... | train | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/containers/pax-exam-container-eclipse/src/main/java/org/ops4j/pax/exam/container/eclipse/impl/sources/directory/DirectoryResolver.java#L141-L170 |
groovy/groovy-core | src/main/groovy/beans/BindableASTTransformation.java | BindableASTTransformation.createBindableStatement | protected Statement createBindableStatement(PropertyNode propertyNode, Expression fieldExpression) {
"""
Creates a statement body similar to:
<code>this.firePropertyChange("field", field, field = value)</code>
@param propertyNode the field node for the property
@param fieldExpression a field express... | java | protected Statement createBindableStatement(PropertyNode propertyNode, Expression fieldExpression) {
// create statementBody
return stmt(callThisX("firePropertyChange", args(constX(propertyNode.getName()), fieldExpression, assignX(fieldExpression, varX("value")))));
} | [
"protected",
"Statement",
"createBindableStatement",
"(",
"PropertyNode",
"propertyNode",
",",
"Expression",
"fieldExpression",
")",
"{",
"// create statementBody\r",
"return",
"stmt",
"(",
"callThisX",
"(",
"\"firePropertyChange\"",
",",
"args",
"(",
"constX",
"(",
"pr... | Creates a statement body similar to:
<code>this.firePropertyChange("field", field, field = value)</code>
@param propertyNode the field node for the property
@param fieldExpression a field expression for setting the property value
@return the created statement | [
"Creates",
"a",
"statement",
"body",
"similar",
"to",
":",
"<code",
">",
"this",
".",
"firePropertyChange",
"(",
"field",
"field",
"field",
"=",
"value",
")",
"<",
"/",
"code",
">"
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/beans/BindableASTTransformation.java#L234-L237 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/plugins/configuration/PluginAdapterUtility.java | PluginAdapterUtility.configureObjectFieldsWithProperties | public static Map<String, Object> configureObjectFieldsWithProperties(
final Object object,
final Map<String, Object> inputConfig
) {
"""
Set field values on an object using introspection and input values for those properties
@param object object
@param inputConfig input
@return Map ... | java | public static Map<String, Object> configureObjectFieldsWithProperties(
final Object object,
final Map<String, Object> inputConfig
)
{
return configureObjectFieldsWithProperties(object, buildFieldProperties(object), inputConfig);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"configureObjectFieldsWithProperties",
"(",
"final",
"Object",
"object",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"inputConfig",
")",
"{",
"return",
"configureObjectFieldsWithProperties",
... | Set field values on an object using introspection and input values for those properties
@param object object
@param inputConfig input
@return Map of resolved properties that were not configured in the object's fields | [
"Set",
"field",
"values",
"on",
"an",
"object",
"using",
"introspection",
"and",
"input",
"values",
"for",
"those",
"properties"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/plugins/configuration/PluginAdapterUtility.java#L380-L386 |
aws/aws-sdk-java | aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/internal/netty/handler/ErrorUnmarshallingHandler.java | ErrorUnmarshallingHandler.cumulateContent | private void cumulateContent(ChannelHandlerContext ctx, HttpContent msg) {
"""
Adds the current {@link HttpContent} to the cumulation of data.
@param ctx Channel context.
@param msg Current {@link HttpContent} message.
"""
cumulation = cumulator.cumulate(ctx.alloc(), cumulation, msg.content());
... | java | private void cumulateContent(ChannelHandlerContext ctx, HttpContent msg) {
cumulation = cumulator.cumulate(ctx.alloc(), cumulation, msg.content());
} | [
"private",
"void",
"cumulateContent",
"(",
"ChannelHandlerContext",
"ctx",
",",
"HttpContent",
"msg",
")",
"{",
"cumulation",
"=",
"cumulator",
".",
"cumulate",
"(",
"ctx",
".",
"alloc",
"(",
")",
",",
"cumulation",
",",
"msg",
".",
"content",
"(",
")",
")... | Adds the current {@link HttpContent} to the cumulation of data.
@param ctx Channel context.
@param msg Current {@link HttpContent} message. | [
"Adds",
"the",
"current",
"{",
"@link",
"HttpContent",
"}",
"to",
"the",
"cumulation",
"of",
"data",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/internal/netty/handler/ErrorUnmarshallingHandler.java#L126-L128 |
duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/rest/SpaceResource.java | SpaceResource.getSpaceContents | public String getSpaceContents(String spaceID,
String storeID,
String prefix,
long maxResults,
String marker) throws ResourceException {
"""
Gets a listing of the contents of ... | java | public String getSpaceContents(String spaceID,
String storeID,
String prefix,
long maxResults,
String marker) throws ResourceException {
Element spaceElem = new Element("sp... | [
"public",
"String",
"getSpaceContents",
"(",
"String",
"spaceID",
",",
"String",
"storeID",
",",
"String",
"prefix",
",",
"long",
"maxResults",
",",
"String",
"marker",
")",
"throws",
"ResourceException",
"{",
"Element",
"spaceElem",
"=",
"new",
"Element",
"(",
... | Gets a listing of the contents of a space.
@param spaceID
@param storeID
@param prefix
@param maxResults
@param marker
@return XML listing of space contents | [
"Gets",
"a",
"listing",
"of",
"the",
"contents",
"of",
"a",
"space",
"."
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/rest/SpaceResource.java#L126-L158 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRulesInner.java | RouteFilterRulesInner.updateAsync | public Observable<RouteFilterRuleInner> updateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) {
"""
Updates a route in the specified route filter.
@param resourceGroupName The name of the resource group.
@param routeFilterName The name of... | java | public Observable<RouteFilterRuleInner> updateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) {
return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1<ServiceResponse<Ro... | [
"public",
"Observable",
"<",
"RouteFilterRuleInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"routeFilterName",
",",
"String",
"ruleName",
",",
"PatchRouteFilterRule",
"routeFilterRuleParameters",
")",
"{",
"return",
"updateWithServiceResponse... | Updates a route in the specified route filter.
@param resourceGroupName The name of the resource group.
@param routeFilterName The name of the route filter.
@param ruleName The name of the route filter rule.
@param routeFilterRuleParameters Parameters supplied to the update route filter rule operation.
@throws Illegal... | [
"Updates",
"a",
"route",
"in",
"the",
"specified",
"route",
"filter",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRulesInner.java#L583-L590 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java | DatabaseImpl.getAllRevisionsOfDocument | public DocumentRevisionTree getAllRevisionsOfDocument(final String docId) {
"""
<p>Returns {@code DocumentRevisionTree} of a document.</p>
<p>The tree contains the complete revision history of the document,
including branches for conflicts and deleted leaves.</p>
@param docId ID of the document
@return {@... | java | public DocumentRevisionTree getAllRevisionsOfDocument(final String docId) {
try {
return get(queue.submit(new GetAllRevisionsOfDocumentCallable(docId, this.attachmentsDir, this.attachmentStreamFactory)));
} catch (ExecutionException e) {
logger.log(Level.SEVERE, "Failed to get a... | [
"public",
"DocumentRevisionTree",
"getAllRevisionsOfDocument",
"(",
"final",
"String",
"docId",
")",
"{",
"try",
"{",
"return",
"get",
"(",
"queue",
".",
"submit",
"(",
"new",
"GetAllRevisionsOfDocumentCallable",
"(",
"docId",
",",
"this",
".",
"attachmentsDir",
"... | <p>Returns {@code DocumentRevisionTree} of a document.</p>
<p>The tree contains the complete revision history of the document,
including branches for conflicts and deleted leaves.</p>
@param docId ID of the document
@return {@code DocumentRevisionTree} of the specified document | [
"<p",
">",
"Returns",
"{",
"@code",
"DocumentRevisionTree",
"}",
"of",
"a",
"document",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java#L273-L281 |
elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/OutputStreamLogger.java | OutputStreamLogger.countNonNewline | private int countNonNewline(char[] cbuf, int off, int len) {
"""
Count the number of non-newline characters before first newline in the string.
@param cbuf character buffer
@param off offset
@param len length
@return number of non-newline characters
"""
for(int cnt = 0; cnt < len; cnt++) {
fina... | java | private int countNonNewline(char[] cbuf, int off, int len) {
for(int cnt = 0; cnt < len; cnt++) {
final int pos = off + cnt;
if(cbuf[pos] == UNIX_NEWLINE) {
return cnt;
}
if(cbuf[pos] == CARRIAGE_RETURN) {
return cnt;
}
}
return len;
} | [
"private",
"int",
"countNonNewline",
"(",
"char",
"[",
"]",
"cbuf",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"for",
"(",
"int",
"cnt",
"=",
"0",
";",
"cnt",
"<",
"len",
";",
"cnt",
"++",
")",
"{",
"final",
"int",
"pos",
"=",
"off",
"+",
... | Count the number of non-newline characters before first newline in the string.
@param cbuf character buffer
@param off offset
@param len length
@return number of non-newline characters | [
"Count",
"the",
"number",
"of",
"non",
"-",
"newline",
"characters",
"before",
"first",
"newline",
"in",
"the",
"string",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/OutputStreamLogger.java#L170-L181 |
google/error-prone-javac | src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java | JShellTool.fluffmsg | @Override
public void fluffmsg(String key, Object... args) {
"""
Print (fluff) using resource bundle look-up, MessageFormat, and add
prefix and postfix
@param key the resource key
@param args
"""
if (showFluff()) {
hardmsg(key, args);
}
} | java | @Override
public void fluffmsg(String key, Object... args) {
if (showFluff()) {
hardmsg(key, args);
}
} | [
"@",
"Override",
"public",
"void",
"fluffmsg",
"(",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"showFluff",
"(",
")",
")",
"{",
"hardmsg",
"(",
"key",
",",
"args",
")",
";",
"}",
"}"
] | Print (fluff) using resource bundle look-up, MessageFormat, and add
prefix and postfix
@param key the resource key
@param args | [
"Print",
"(",
"fluff",
")",
"using",
"resource",
"bundle",
"look",
"-",
"up",
"MessageFormat",
"and",
"add",
"prefix",
"and",
"postfix"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java#L837-L842 |
apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java | GenericsUtils.parameterizeInterfaceGenerics | @Deprecated
public static ClassNode parameterizeInterfaceGenerics(final ClassNode hint, final ClassNode target) {
"""
Interface class nodes retrieved from {@link org.codehaus.groovy.ast.ClassNode#getInterfaces()}
or {@link org.codehaus.groovy.ast.ClassNode#getAllInterfaces()} are returned with generic type
a... | java | @Deprecated
public static ClassNode parameterizeInterfaceGenerics(final ClassNode hint, final ClassNode target) {
return parameterizeType(hint, target);
} | [
"@",
"Deprecated",
"public",
"static",
"ClassNode",
"parameterizeInterfaceGenerics",
"(",
"final",
"ClassNode",
"hint",
",",
"final",
"ClassNode",
"target",
")",
"{",
"return",
"parameterizeType",
"(",
"hint",
",",
"target",
")",
";",
"}"
] | Interface class nodes retrieved from {@link org.codehaus.groovy.ast.ClassNode#getInterfaces()}
or {@link org.codehaus.groovy.ast.ClassNode#getAllInterfaces()} are returned with generic type
arguments. This method allows returning a parameterized interface given the parameterized class
node which implements this interfa... | [
"Interface",
"class",
"nodes",
"retrieved",
"from",
"{",
"@link",
"org",
".",
"codehaus",
".",
"groovy",
".",
"ast",
".",
"ClassNode#getInterfaces",
"()",
"}",
"or",
"{",
"@link",
"org",
".",
"codehaus",
".",
"groovy",
".",
"ast",
".",
"ClassNode#getAllInter... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java#L239-L242 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java | SDMath.iamax | public SDVariable iamax(SDVariable in, boolean keepDims, int... dimensions) {
"""
Index of the max absolute value: argmax(abs(in))
@see SameDiff#argmax(String, SDVariable, boolean, int...)
"""
return iamax(null, in, keepDims, dimensions);
} | java | public SDVariable iamax(SDVariable in, boolean keepDims, int... dimensions) {
return iamax(null, in, keepDims, dimensions);
} | [
"public",
"SDVariable",
"iamax",
"(",
"SDVariable",
"in",
",",
"boolean",
"keepDims",
",",
"int",
"...",
"dimensions",
")",
"{",
"return",
"iamax",
"(",
"null",
",",
"in",
",",
"keepDims",
",",
"dimensions",
")",
";",
"}"
] | Index of the max absolute value: argmax(abs(in))
@see SameDiff#argmax(String, SDVariable, boolean, int...) | [
"Index",
"of",
"the",
"max",
"absolute",
"value",
":",
"argmax",
"(",
"abs",
"(",
"in",
"))"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L1232-L1234 |
alkacon/opencms-core | src/org/opencms/widgets/A_CmsFormatterWidget.java | A_CmsFormatterWidget.getMessage | static String getMessage(CmsObject cms, String message, Object... args) {
"""
Gets a message string.<p>
@param cms the CMS context
@param message the message key
@param args the message arguments
@return the message string
"""
Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cm... | java | static String getMessage(CmsObject cms, String message, Object... args) {
Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms);
return Messages.get().getBundle(locale).key(message, args);
} | [
"static",
"String",
"getMessage",
"(",
"CmsObject",
"cms",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"Locale",
"locale",
"=",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
".",
"getWorkplaceLocale",
"(",
"cms",
")",
";",
"return",
... | Gets a message string.<p>
@param cms the CMS context
@param message the message key
@param args the message arguments
@return the message string | [
"Gets",
"a",
"message",
"string",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/A_CmsFormatterWidget.java#L148-L152 |
apache/incubator-gobblin | gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/HiveRegistrationUnitComparator.java | HiveRegistrationUnitComparator.checkExistingIsSuperset | protected <E> void checkExistingIsSuperset(Set<E> existingSet, Set<E> newSet) {
"""
Compare an existing state and a new {@link Set} to ensure that the existing {@link Set} contains all entries in the new
{@link Set}, and update {@link #result} accordingly.
"""
this.result |= !existingSet.containsAll(newSe... | java | protected <E> void checkExistingIsSuperset(Set<E> existingSet, Set<E> newSet) {
this.result |= !existingSet.containsAll(newSet);
} | [
"protected",
"<",
"E",
">",
"void",
"checkExistingIsSuperset",
"(",
"Set",
"<",
"E",
">",
"existingSet",
",",
"Set",
"<",
"E",
">",
"newSet",
")",
"{",
"this",
".",
"result",
"|=",
"!",
"existingSet",
".",
"containsAll",
"(",
"newSet",
")",
";",
"}"
] | Compare an existing state and a new {@link Set} to ensure that the existing {@link Set} contains all entries in the new
{@link Set}, and update {@link #result} accordingly. | [
"Compare",
"an",
"existing",
"state",
"and",
"a",
"new",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/HiveRegistrationUnitComparator.java#L197-L199 |
requery/requery | requery-android/src/main/java/io/requery/android/sqlite/BasePreparedStatement.java | BasePreparedStatement.bindBlobLiteral | protected void bindBlobLiteral(int index, byte[] value) {
"""
inlines a blob literal into the sql statement since it can't be used as bind parameter
"""
if (blobLiterals == null) {
blobLiterals = new LinkedHashMap<>();
}
blobLiterals.put(index, value);
} | java | protected void bindBlobLiteral(int index, byte[] value) {
if (blobLiterals == null) {
blobLiterals = new LinkedHashMap<>();
}
blobLiterals.put(index, value);
} | [
"protected",
"void",
"bindBlobLiteral",
"(",
"int",
"index",
",",
"byte",
"[",
"]",
"value",
")",
"{",
"if",
"(",
"blobLiterals",
"==",
"null",
")",
"{",
"blobLiterals",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"}",
"blobLiterals",
".",
"put",
... | inlines a blob literal into the sql statement since it can't be used as bind parameter | [
"inlines",
"a",
"blob",
"literal",
"into",
"the",
"sql",
"statement",
"since",
"it",
"can",
"t",
"be",
"used",
"as",
"bind",
"parameter"
] | train | https://github.com/requery/requery/blob/3070590c2ef76bb7062570bf9df03cd482db024a/requery-android/src/main/java/io/requery/android/sqlite/BasePreparedStatement.java#L115-L120 |
UrielCh/ovh-java-sdk | ovh-java-sdk-saascsp2/src/main/java/net/minidev/ovh/api/ApiOvhSaascsp2.java | ApiOvhSaascsp2.serviceName_subscription_POST | public OvhOfficeTask serviceName_subscription_POST(String serviceName, Long licenseId, Long quantity) throws IOException {
"""
Add a subscription to this tenant
REST: POST /saas/csp2/{serviceName}/subscription
@param licenseId [required] License's type unique identifier
@param quantity [required] Quantity of ... | java | public OvhOfficeTask serviceName_subscription_POST(String serviceName, Long licenseId, Long quantity) throws IOException {
String qPath = "/saas/csp2/{serviceName}/subscription";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "licenseId", licens... | [
"public",
"OvhOfficeTask",
"serviceName_subscription_POST",
"(",
"String",
"serviceName",
",",
"Long",
"licenseId",
",",
"Long",
"quantity",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/saas/csp2/{serviceName}/subscription\"",
";",
"StringBuilder",
"sb",... | Add a subscription to this tenant
REST: POST /saas/csp2/{serviceName}/subscription
@param licenseId [required] License's type unique identifier
@param quantity [required] Quantity of licenses to order
@param serviceName [required] The unique identifier of your Office service
API beta | [
"Add",
"a",
"subscription",
"to",
"this",
"tenant"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-saascsp2/src/main/java/net/minidev/ovh/api/ApiOvhSaascsp2.java#L70-L78 |
apache/incubator-druid | core/src/main/java/org/apache/druid/concurrent/ConcurrentAwaitableCounter.java | ConcurrentAwaitableCounter.awaitCount | public void awaitCount(long totalCount, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException {
"""
Await until the {@link #increment} is called on this counter object the specified number of times from the creation
of this counter object, for not longer than the specified period of time. If ... | java | public void awaitCount(long totalCount, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException
{
checkTotalCount(totalCount);
long nanos = unit.toNanos(timeout);
long currentCount = sync.getCount();
while (compareCounts(totalCount, currentCount) > 0) {
if (!sync.tryAcquireSha... | [
"public",
"void",
"awaitCount",
"(",
"long",
"totalCount",
",",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
",",
"TimeoutException",
"{",
"checkTotalCount",
"(",
"totalCount",
")",
";",
"long",
"nanos",
"=",
"unit",
".",
... | Await until the {@link #increment} is called on this counter object the specified number of times from the creation
of this counter object, for not longer than the specified period of time. If by this time the target increment
count is not reached, {@link TimeoutException} is thrown. | [
"Await",
"until",
"the",
"{"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/concurrent/ConcurrentAwaitableCounter.java#L119-L130 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/StratifiedSampling.java | StratifiedSampling.std | public static double std(TransposeDataCollection sampleDataCollection, AssociativeArray populationNh) {
"""
Calculate the standard deviation of the sample
@param sampleDataCollection
@param populationNh
@return
"""
return Math.sqrt(variance(sampleDataCollection, populationNh));
} | java | public static double std(TransposeDataCollection sampleDataCollection, AssociativeArray populationNh) {
return Math.sqrt(variance(sampleDataCollection, populationNh));
} | [
"public",
"static",
"double",
"std",
"(",
"TransposeDataCollection",
"sampleDataCollection",
",",
"AssociativeArray",
"populationNh",
")",
"{",
"return",
"Math",
".",
"sqrt",
"(",
"variance",
"(",
"sampleDataCollection",
",",
"populationNh",
")",
")",
";",
"}"
] | Calculate the standard deviation of the sample
@param sampleDataCollection
@param populationNh
@return | [
"Calculate",
"the",
"standard",
"deviation",
"of",
"the",
"sample"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/StratifiedSampling.java#L154-L156 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/ECKey.java | ECKey.recoverFromSignature | @Nullable
public static ECKey recoverFromSignature(int recId, ECDSASignature sig, Sha256Hash message, boolean compressed) {
"""
<p>Given the components of a signature and a selector value, recover and return the public key
that generated the signature according to the algorithm in SEC1v2 section 4.1.6.</p>
... | java | @Nullable
public static ECKey recoverFromSignature(int recId, ECDSASignature sig, Sha256Hash message, boolean compressed) {
Preconditions.checkArgument(recId >= 0, "recId must be positive");
Preconditions.checkArgument(sig.r.signum() >= 0, "r must be positive");
Preconditions.checkArgument(s... | [
"@",
"Nullable",
"public",
"static",
"ECKey",
"recoverFromSignature",
"(",
"int",
"recId",
",",
"ECDSASignature",
"sig",
",",
"Sha256Hash",
"message",
",",
"boolean",
"compressed",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"recId",
">=",
"0",
",",
... | <p>Given the components of a signature and a selector value, recover and return the public key
that generated the signature according to the algorithm in SEC1v2 section 4.1.6.</p>
<p>The recId is an index from 0 to 3 which indicates which of the 4 possible keys is the correct one. Because
the key recovery operation yi... | [
"<p",
">",
"Given",
"the",
"components",
"of",
"a",
"signature",
"and",
"a",
"selector",
"value",
"recover",
"and",
"return",
"the",
"public",
"key",
"that",
"generated",
"the",
"signature",
"according",
"to",
"the",
"algorithm",
"in",
"SEC1v2",
"section",
"... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/ECKey.java#L981-L1029 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/net/ForwardingClient.java | ForwardingClient.getRemoteForwardingTunnels | public ActiveTunnel[] getRemoteForwardingTunnels(String addressToBind,
int portToBind) throws IOException {
"""
Get the active tunnels for a remote forwarding listener.
@param addressToBind
@param portToBind
@return ActiveTunnel[]
@throws IOException
"""
return getRemoteForwardingTunnels(generateKey... | java | public ActiveTunnel[] getRemoteForwardingTunnels(String addressToBind,
int portToBind) throws IOException {
return getRemoteForwardingTunnels(generateKey(addressToBind, portToBind));
} | [
"public",
"ActiveTunnel",
"[",
"]",
"getRemoteForwardingTunnels",
"(",
"String",
"addressToBind",
",",
"int",
"portToBind",
")",
"throws",
"IOException",
"{",
"return",
"getRemoteForwardingTunnels",
"(",
"generateKey",
"(",
"addressToBind",
",",
"portToBind",
")",
")"... | Get the active tunnels for a remote forwarding listener.
@param addressToBind
@param portToBind
@return ActiveTunnel[]
@throws IOException | [
"Get",
"the",
"active",
"tunnels",
"for",
"a",
"remote",
"forwarding",
"listener",
"."
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/net/ForwardingClient.java#L577-L580 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/selectMultiMenu/SelectMultiMenuRenderer.java | SelectMultiMenuRenderer.renderOptions | protected void renderOptions(FacesContext context, ResponseWriter rw, String[] selectedOption, SelectMultiMenu menu)
throws IOException {
"""
Parts of this class are an adapted version of
InputRenderer#getSelectItems() of PrimeFaces 5.1.
@param rw
@param selectedOption
@throws IOException
"""
Conver... | java | protected void renderOptions(FacesContext context, ResponseWriter rw, String[] selectedOption, SelectMultiMenu menu)
throws IOException {
Converter converter = menu.getConverter();
List<SelectItemAndComponent> items = SelectItemUtils.collectOptions(context, menu, converter);
for (int index = 0; index < items.... | [
"protected",
"void",
"renderOptions",
"(",
"FacesContext",
"context",
",",
"ResponseWriter",
"rw",
",",
"String",
"[",
"]",
"selectedOption",
",",
"SelectMultiMenu",
"menu",
")",
"throws",
"IOException",
"{",
"Converter",
"converter",
"=",
"menu",
".",
"getConvert... | Parts of this class are an adapted version of
InputRenderer#getSelectItems() of PrimeFaces 5.1.
@param rw
@param selectedOption
@throws IOException | [
"Parts",
"of",
"this",
"class",
"are",
"an",
"adapted",
"version",
"of",
"InputRenderer#getSelectItems",
"()",
"of",
"PrimeFaces",
"5",
".",
"1",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/selectMultiMenu/SelectMultiMenuRenderer.java#L560-L573 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/spi/impl/AbstractInvocationFuture.java | AbstractInvocationFuture.registerWaiter | private Object registerWaiter(Object waiter, Executor executor) {
"""
Registers a waiter (thread/ExecutionCallback) that gets notified when
the future completes.
@param waiter the waiter
@param executor the {@link Executor} to use in case of an
{@link ExecutionCallback}.
@return VOID if the registration w... | java | private Object registerWaiter(Object waiter, Executor executor) {
assert !(waiter instanceof UnblockableThread) : "Waiting for response on this thread is illegal";
WaitNode waitNode = null;
for (; ; ) {
final Object oldState = state;
if (isDone(oldState)) {
... | [
"private",
"Object",
"registerWaiter",
"(",
"Object",
"waiter",
",",
"Executor",
"executor",
")",
"{",
"assert",
"!",
"(",
"waiter",
"instanceof",
"UnblockableThread",
")",
":",
"\"Waiting for response on this thread is illegal\"",
";",
"WaitNode",
"waitNode",
"=",
"n... | Registers a waiter (thread/ExecutionCallback) that gets notified when
the future completes.
@param waiter the waiter
@param executor the {@link Executor} to use in case of an
{@link ExecutionCallback}.
@return VOID if the registration was a success, anything else but void
is the response. | [
"Registers",
"a",
"waiter",
"(",
"thread",
"/",
"ExecutionCallback",
")",
"that",
"gets",
"notified",
"when",
"the",
"future",
"completes",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/impl/AbstractInvocationFuture.java#L298-L325 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getMonthLength | static int getMonthLength(int month, int year) {
"""
Returns month length.
@param month month (0-based)
@param year year
@return month length
"""
Integer[] newMonths = getAdjustedMonthLength(year);
return newMonths[month].intValue();
} | java | static int getMonthLength(int month, int year) {
Integer[] newMonths = getAdjustedMonthLength(year);
return newMonths[month].intValue();
} | [
"static",
"int",
"getMonthLength",
"(",
"int",
"month",
",",
"int",
"year",
")",
"{",
"Integer",
"[",
"]",
"newMonths",
"=",
"getAdjustedMonthLength",
"(",
"year",
")",
";",
"return",
"newMonths",
"[",
"month",
"]",
".",
"intValue",
"(",
")",
";",
"}"
] | Returns month length.
@param month month (0-based)
@param year year
@return month length | [
"Returns",
"month",
"length",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L1136-L1139 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/MultiPoint.java | MultiPoint.fromLngLats | public static MultiPoint fromLngLats(@NonNull List<Point> points) {
"""
Create a new instance of this class by defining a list of {@link Point}s which follow the
correct specifications described in the Point documentation. Note that there should not be any
duplicate points inside the list. <p> Note that if less ... | java | public static MultiPoint fromLngLats(@NonNull List<Point> points) {
return new MultiPoint(TYPE, null, points);
} | [
"public",
"static",
"MultiPoint",
"fromLngLats",
"(",
"@",
"NonNull",
"List",
"<",
"Point",
">",
"points",
")",
"{",
"return",
"new",
"MultiPoint",
"(",
"TYPE",
",",
"null",
",",
"points",
")",
";",
"}"
] | Create a new instance of this class by defining a list of {@link Point}s which follow the
correct specifications described in the Point documentation. Note that there should not be any
duplicate points inside the list. <p> Note that if less than 2 points are passed in, a runtime
exception will occur. </p>
@param point... | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"defining",
"a",
"list",
"of",
"{",
"@link",
"Point",
"}",
"s",
"which",
"follow",
"the",
"correct",
"specifications",
"described",
"in",
"the",
"Point",
"documentation",
".",
"Note",
"that",
"... | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/MultiPoint.java#L77-L79 |
alkacon/opencms-core | src/org/opencms/importexport/CmsImportExportManager.java | CmsImportExportManager.addImportPrincipalTranslation | public void addImportPrincipalTranslation(String type, String from, String to) {
"""
Adds an import princial translation to the configuration.<p>
@param type the princial type ("USER" or "GROUP")
@param from the "from" translation source
@param to the "to" translation target
"""
if (LOG.isDebugEn... | java | public void addImportPrincipalTranslation(String type, String from, String to) {
if (LOG.isDebugEnabled()) {
LOG.debug(
Messages.get().getBundle().key(
Messages.LOG_IMPORTEXPORT_ADDED_PRINCIPAL_TRANSLATION_3,
type,
from,
... | [
"public",
"void",
"addImportPrincipalTranslation",
"(",
"String",
"type",
",",
"String",
"from",
",",
"String",
"to",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"Messages",
".",
"get",
"(",
")",
"."... | Adds an import princial translation to the configuration.<p>
@param type the princial type ("USER" or "GROUP")
@param from the "from" translation source
@param to the "to" translation target | [
"Adds",
"an",
"import",
"princial",
"translation",
"to",
"the",
"configuration",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsImportExportManager.java#L560-L582 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/impl/TransformedRenditionHandler.java | TransformedRenditionHandler.rotateMapHeight | private long rotateMapHeight(long width, long height) {
"""
Swaps height with width if rotated 90° clock-wise or counter clock-wise
@param width Rendition width
@param height Rendition height
@return Height
"""
if (rotation != null && (rotation == ROTATE_90 || rotation == ROTATE_270)) {
return wid... | java | private long rotateMapHeight(long width, long height) {
if (rotation != null && (rotation == ROTATE_90 || rotation == ROTATE_270)) {
return width;
}
else {
return height;
}
} | [
"private",
"long",
"rotateMapHeight",
"(",
"long",
"width",
",",
"long",
"height",
")",
"{",
"if",
"(",
"rotation",
"!=",
"null",
"&&",
"(",
"rotation",
"==",
"ROTATE_90",
"||",
"rotation",
"==",
"ROTATE_270",
")",
")",
"{",
"return",
"width",
";",
"}",
... | Swaps height with width if rotated 90° clock-wise or counter clock-wise
@param width Rendition width
@param height Rendition height
@return Height | [
"Swaps",
"height",
"with",
"width",
"if",
"rotated",
"90°",
"clock",
"-",
"wise",
"or",
"counter",
"clock",
"-",
"wise"
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/impl/TransformedRenditionHandler.java#L149-L156 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java | DirectoryServiceClient.attachSession | public void attachSession(List<ServiceInstanceToken> instanceTokens, final AttachSessionCallback cb, Object context) {
"""
Attach ServiceInstance to the Session.
When create a new session, it need to attach the session again.
@param instanceTokens
the instance list.
@param cb
the callback.
@param context... | java | public void attachSession(List<ServiceInstanceToken> instanceTokens, final AttachSessionCallback cb, Object context){
ProtocolHeader header = new ProtocolHeader();
header.setType(ProtocolType.AttachSession);
String sessionId = connection.getSessionId();
AttachSessionProtocol protocol = ... | [
"public",
"void",
"attachSession",
"(",
"List",
"<",
"ServiceInstanceToken",
">",
"instanceTokens",
",",
"final",
"AttachSessionCallback",
"cb",
",",
"Object",
"context",
")",
"{",
"ProtocolHeader",
"header",
"=",
"new",
"ProtocolHeader",
"(",
")",
";",
"header",
... | Attach ServiceInstance to the Session.
When create a new session, it need to attach the session again.
@param instanceTokens
the instance list.
@param cb
the callback.
@param context
the context object. | [
"Attach",
"ServiceInstance",
"to",
"the",
"Session",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java#L505-L523 |
FINRAOS/DataGenerator | dg-core/src/main/java/org/finra/datagenerator/engine/scxml/tags/SetAssignExtension.java | SetAssignExtension.pipelinePossibleStates | public List<Map<String, String>> pipelinePossibleStates(SetAssignTag action,
List<Map<String, String>> possibleStateList) {
"""
Performs variable assignments from a set of values
@param action a SetAssignTag Action
@param possibleStateList... | java | public List<Map<String, String>> pipelinePossibleStates(SetAssignTag action,
List<Map<String, String>> possibleStateList) {
if (action == null) {
throw new NullActionException("Called with a null action, and possibleStateList = "
... | [
"public",
"List",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"pipelinePossibleStates",
"(",
"SetAssignTag",
"action",
",",
"List",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"possibleStateList",
")",
"{",
"if",
"(",
"action",
"==",
"nul... | Performs variable assignments from a set of values
@param action a SetAssignTag Action
@param possibleStateList a current list of possible states produced so far from expanding a model state
@return the cartesian product of every current possible state and the set of values specified by action | [
"Performs",
"variable",
"assignments",
"from",
"a",
"set",
"of",
"values"
] | train | https://github.com/FINRAOS/DataGenerator/blob/1f69f949401cbed4db4f553c3eb8350832c4d45a/dg-core/src/main/java/org/finra/datagenerator/engine/scxml/tags/SetAssignExtension.java#L61-L95 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/RunnableUtils.java | RunnableUtils.runWithSleepThenReturnValueUninterrupted | public static <T> T runWithSleepThenReturnValueUninterrupted(long milliseconds, ReturningRunnable<T> runnable) {
"""
Runs the given {@link ReturningRunnable} object and then causes the current, calling {@link Thread} to sleep
for the given number of milliseconds before returning a value.
This utility method sl... | java | public static <T> T runWithSleepThenReturnValueUninterrupted(long milliseconds, ReturningRunnable<T> runnable) {
Assert.isTrue(milliseconds > 0, "Milliseconds [%d] must be greater than 0", milliseconds);
T returnValue = runnable.run();
safeSleep(milliseconds);
return returnValue;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"runWithSleepThenReturnValueUninterrupted",
"(",
"long",
"milliseconds",
",",
"ReturningRunnable",
"<",
"T",
">",
"runnable",
")",
"{",
"Assert",
".",
"isTrue",
"(",
"milliseconds",
">",
"0",
",",
"\"Milliseconds [%d] must b... | Runs the given {@link ReturningRunnable} object and then causes the current, calling {@link Thread} to sleep
for the given number of milliseconds before returning a value.
This utility method sleeps uninterrupted, resetting the interrupt bit if the current, calling {@link Thread}
is interrupted during sleep.
This uti... | [
"Runs",
"the",
"given",
"{",
"@link",
"ReturningRunnable",
"}",
"object",
"and",
"then",
"causes",
"the",
"current",
"calling",
"{",
"@link",
"Thread",
"}",
"to",
"sleep",
"for",
"the",
"given",
"number",
"of",
"milliseconds",
"before",
"returning",
"a",
"va... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/RunnableUtils.java#L183-L192 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createPartialMock | public static <T> T createPartialMock(Class<T> type, String methodName, Class<?>[] methodParameterTypes,
Object... constructorArguments) {
"""
A utility method that may be used to mock several methods in an easy way
(by just passing in the method names of the method you w... | java | public static <T> T createPartialMock(Class<T> type, String methodName, Class<?>[] methodParameterTypes,
Object... constructorArguments) {
Constructor<?> constructor = WhiteboxImpl.findUniqueConstructorOrThrowException(type, constructorArguments);
ConstructorArg... | [
"public",
"static",
"<",
"T",
">",
"T",
"createPartialMock",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"methodParameterTypes",
",",
"Object",
"...",
"constructorArguments",
")",
"{",
"Construct... | A utility method that may be used to mock several methods in an easy way
(by just passing in the method names of the method you wish to mock). Use
this to handle overloaded methods. The mock object created will support
mocking of final and native methods and invokes a specific constructor
based on the supplied argument... | [
"A",
"utility",
"method",
"that",
"may",
"be",
"used",
"to",
"mock",
"several",
"methods",
"in",
"an",
"easy",
"way",
"(",
"by",
"just",
"passing",
"in",
"the",
"method",
"names",
"of",
"the",
"method",
"you",
"wish",
"to",
"mock",
")",
".",
"Use",
"... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L977-L983 |
Syncleus/aparapi | src/main/java/com/aparapi/ProfileReport.java | ProfileReport.setProfileReport | public void setProfileReport(final long reportId, final long[] _currentTimes) {
"""
Sets specific report data.
@param reportId the unique identifier for this report (the identifier is unique within the <kernel,device> tuple)
@param _currentTimes the profiling data
"""
id = reportId;
System.arraycopy(_cur... | java | public void setProfileReport(final long reportId, final long[] _currentTimes) {
id = reportId;
System.arraycopy(_currentTimes, 0, currentTimes, 0, NUM_EVENTS);
} | [
"public",
"void",
"setProfileReport",
"(",
"final",
"long",
"reportId",
",",
"final",
"long",
"[",
"]",
"_currentTimes",
")",
"{",
"id",
"=",
"reportId",
";",
"System",
".",
"arraycopy",
"(",
"_currentTimes",
",",
"0",
",",
"currentTimes",
",",
"0",
",",
... | Sets specific report data.
@param reportId the unique identifier for this report (the identifier is unique within the <kernel,device> tuple)
@param _currentTimes the profiling data | [
"Sets",
"specific",
"report",
"data",
"."
] | train | https://github.com/Syncleus/aparapi/blob/6d5892c8e69854b3968c541023de37cf4762bd24/src/main/java/com/aparapi/ProfileReport.java#L53-L56 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/parameter/ObjectParameter.java | ObjectParameter.parseEnumParameter | @SuppressWarnings("unchecked")
private Object parseEnumParameter(final Enum<?> e, final String serializedObject) {
"""
Parse an Enum definition by calling Enum.valueOf.
@param serializedObject the full enumerated value
@return the class object
"""
final Object res = Enum.valueOf(e.getClass(),... | java | @SuppressWarnings("unchecked")
private Object parseEnumParameter(final Enum<?> e, final String serializedObject) {
final Object res = Enum.valueOf(e.getClass(), serializedObject);
return res;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"Object",
"parseEnumParameter",
"(",
"final",
"Enum",
"<",
"?",
">",
"e",
",",
"final",
"String",
"serializedObject",
")",
"{",
"final",
"Object",
"res",
"=",
"Enum",
".",
"valueOf",
"(",
"e",
... | Parse an Enum definition by calling Enum.valueOf.
@param serializedObject the full enumerated value
@return the class object | [
"Parse",
"an",
"Enum",
"definition",
"by",
"calling",
"Enum",
".",
"valueOf",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/parameter/ObjectParameter.java#L179-L183 |
qiujiayu/AutoLoadCache | src/main/java/com/jarvis/cache/CacheHandler.java | CacheHandler.getCacheOpType | private CacheOpType getCacheOpType(Cache cache, Object[] arguments) {
"""
获取CacheOpType,从三个地方获取:<br>
1. Cache注解中获取;<br>
2. 从ThreadLocal中获取;<br>
3. 从参数中获取;<br>
上面三者的优先级:从低到高。
@param cache 注解
@param arguments 参数
@return CacheOpType
"""
CacheOpType opType = cache.opType();
CacheOpType... | java | private CacheOpType getCacheOpType(Cache cache, Object[] arguments) {
CacheOpType opType = cache.opType();
CacheOpType tmpOpType = CacheHelper.getCacheOpType();
if (null != tmpOpType) {
opType = tmpOpType;
}
if (null != arguments && arguments.length > 0) {
... | [
"private",
"CacheOpType",
"getCacheOpType",
"(",
"Cache",
"cache",
",",
"Object",
"[",
"]",
"arguments",
")",
"{",
"CacheOpType",
"opType",
"=",
"cache",
".",
"opType",
"(",
")",
";",
"CacheOpType",
"tmpOpType",
"=",
"CacheHelper",
".",
"getCacheOpType",
"(",
... | 获取CacheOpType,从三个地方获取:<br>
1. Cache注解中获取;<br>
2. 从ThreadLocal中获取;<br>
3. 从参数中获取;<br>
上面三者的优先级:从低到高。
@param cache 注解
@param arguments 参数
@return CacheOpType | [
"获取CacheOpType,从三个地方获取:<br",
">",
"1",
".",
"Cache注解中获取;<br",
">",
"2",
".",
"从ThreadLocal中获取;<br",
">",
"3",
".",
"从参数中获取;<br",
">",
"上面三者的优先级:从低到高。"
] | train | https://github.com/qiujiayu/AutoLoadCache/blob/8121c146f1a420fa6d6832e849acadb547c13622/src/main/java/com/jarvis/cache/CacheHandler.java#L131-L149 |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.applyButtonTreeCellRenderer | public static void applyButtonTreeCellRenderer(JTree tree,
Function<Object, JButton> buttonFactory,
Function<Object, String> textFactory) {
"""
Apply a cell renderer to the given tree that will create cells that
consist of a button and a label, based on
a {@link GenericTreeCellRenderer}.<br>
... | java | public static void applyButtonTreeCellRenderer(JTree tree,
Function<Object, JButton> buttonFactory,
Function<Object, String> textFactory)
{
TreeCellRenderer treeCellrenderer = new GenericTreeCellRenderer()
{
@Override
protected void prepare(Object node... | [
"public",
"static",
"void",
"applyButtonTreeCellRenderer",
"(",
"JTree",
"tree",
",",
"Function",
"<",
"Object",
",",
"JButton",
">",
"buttonFactory",
",",
"Function",
"<",
"Object",
",",
"String",
">",
"textFactory",
")",
"{",
"TreeCellRenderer",
"treeCellrendere... | Apply a cell renderer to the given tree that will create cells that
consist of a button and a label, based on
a {@link GenericTreeCellRenderer}.<br>
<br>
An editor will be installed for the tree, making the buttons
clickable.<br>
<br>
Some details about the exact layout of the cells are intentionally
not specified.
@p... | [
"Apply",
"a",
"cell",
"renderer",
"to",
"the",
"given",
"tree",
"that",
"will",
"create",
"cells",
"that",
"consist",
"of",
"a",
"button",
"and",
"a",
"label",
"based",
"on",
"a",
"{",
"@link",
"GenericTreeCellRenderer",
"}",
".",
"<br",
">",
"<br",
">",... | train | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L653-L699 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/CopySoundexHandler.java | CopySoundexHandler.fieldChanged | public int fieldChanged(boolean bDisplayOption, int moveMode) {
"""
The Field has Changed.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_RETURN if okay).
"""
String source = this.getOwner().getStr... | java | public int fieldChanged(boolean bDisplayOption, int moveMode)
{
String source = this.getOwner().getString();
String soundex = this.soundex(source.substring(0, Math.min(4, source.length())));
if (soundex == null)
return DBConstants.NORMAL_RETURN;
short hashValue = this.has... | [
"public",
"int",
"fieldChanged",
"(",
"boolean",
"bDisplayOption",
",",
"int",
"moveMode",
")",
"{",
"String",
"source",
"=",
"this",
".",
"getOwner",
"(",
")",
".",
"getString",
"(",
")",
";",
"String",
"soundex",
"=",
"this",
".",
"soundex",
"(",
"sour... | The Field has Changed.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_RETURN if okay). | [
"The",
"Field",
"has",
"Changed",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/CopySoundexHandler.java#L75-L84 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PlainChangesLogImpl.java | PlainChangesLogImpl.getItemState | public ItemState getItemState(NodeData parentData, QPathEntry name, ItemType itemType) throws IllegalPathException {
"""
Get ItemState by parent and item name.
@param parentData
parent
@param name
item name
@param itemType
item type
@return
@throws IllegalPathException
"""
if (itemType != ItemT... | java | public ItemState getItemState(NodeData parentData, QPathEntry name, ItemType itemType) throws IllegalPathException
{
if (itemType != ItemType.UNKNOWN)
{
return index.get(new ParentIDQPathBasedKey(parentData.getIdentifier(), name, itemType));
}
else
{
ItemState state = ... | [
"public",
"ItemState",
"getItemState",
"(",
"NodeData",
"parentData",
",",
"QPathEntry",
"name",
",",
"ItemType",
"itemType",
")",
"throws",
"IllegalPathException",
"{",
"if",
"(",
"itemType",
"!=",
"ItemType",
".",
"UNKNOWN",
")",
"{",
"return",
"index",
".",
... | Get ItemState by parent and item name.
@param parentData
parent
@param name
item name
@param itemType
item type
@return
@throws IllegalPathException | [
"Get",
"ItemState",
"by",
"parent",
"and",
"item",
"name",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PlainChangesLogImpl.java#L716-L731 |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/util/MonitoredObject.java | MonitoredObject.addConst | @javax.annotation.Nonnull
public com.simiacryptus.util.MonitoredObject addConst(final String key, final Object item) {
"""
Add const monitored object.
@param key the key
@param item the item
@return the monitored object
"""
items.put(key, item);
return this;
} | java | @javax.annotation.Nonnull
public com.simiacryptus.util.MonitoredObject addConst(final String key, final Object item) {
items.put(key, item);
return this;
} | [
"@",
"javax",
".",
"annotation",
".",
"Nonnull",
"public",
"com",
".",
"simiacryptus",
".",
"util",
".",
"MonitoredObject",
"addConst",
"(",
"final",
"String",
"key",
",",
"final",
"Object",
"item",
")",
"{",
"items",
".",
"put",
"(",
"key",
",",
"item",... | Add const monitored object.
@param key the key
@param item the item
@return the monitored object | [
"Add",
"const",
"monitored",
"object",
"."
] | train | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/util/MonitoredObject.java#L41-L45 |
VoltDB/voltdb | src/frontend/org/voltdb/plannodes/AggregatePlanNode.java | AggregatePlanNode.convertToSerialAggregatePlanNode | public static AggregatePlanNode convertToSerialAggregatePlanNode(HashAggregatePlanNode hashAggregateNode) {
"""
Convert HashAggregate into a Serialized Aggregate
@param hashAggregateNode HashAggregatePlanNode
@return AggregatePlanNode
"""
AggregatePlanNode serialAggr = new AggregatePlanNode();
... | java | public static AggregatePlanNode convertToSerialAggregatePlanNode(HashAggregatePlanNode hashAggregateNode) {
AggregatePlanNode serialAggr = new AggregatePlanNode();
return setAggregatePlanNode(hashAggregateNode, serialAggr);
} | [
"public",
"static",
"AggregatePlanNode",
"convertToSerialAggregatePlanNode",
"(",
"HashAggregatePlanNode",
"hashAggregateNode",
")",
"{",
"AggregatePlanNode",
"serialAggr",
"=",
"new",
"AggregatePlanNode",
"(",
")",
";",
"return",
"setAggregatePlanNode",
"(",
"hashAggregateNo... | Convert HashAggregate into a Serialized Aggregate
@param hashAggregateNode HashAggregatePlanNode
@return AggregatePlanNode | [
"Convert",
"HashAggregate",
"into",
"a",
"Serialized",
"Aggregate"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/AggregatePlanNode.java#L591-L594 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.deleteCertificateContactsAsync | public ServiceFuture<Contacts> deleteCertificateContactsAsync(String vaultBaseUrl, final ServiceCallback<Contacts> serviceCallback) {
"""
Deletes the certificate contacts for a specified key vault.
Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/man... | java | public ServiceFuture<Contacts> deleteCertificateContactsAsync(String vaultBaseUrl, final ServiceCallback<Contacts> serviceCallback) {
return ServiceFuture.fromResponse(deleteCertificateContactsWithServiceResponseAsync(vaultBaseUrl), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"Contacts",
">",
"deleteCertificateContactsAsync",
"(",
"String",
"vaultBaseUrl",
",",
"final",
"ServiceCallback",
"<",
"Contacts",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
".",
"fromResponse",
"(",
"deleteCertificateC... | Deletes the certificate contacts for a specified key vault.
Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param serviceCallback the async Servi... | [
"Deletes",
"the",
"certificate",
"contacts",
"for",
"a",
"specified",
"key",
"vault",
".",
"Deletes",
"the",
"certificate",
"contacts",
"for",
"a",
"specified",
"key",
"vault",
"certificate",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"man... | 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#L5595-L5597 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.writeInt | public static int writeInt(byte[] array, int offset, int v) {
"""
Write an integer to the byte array at the given offset.
@param array Array to write to
@param offset Offset to write to
@param v data
@return number of bytes written
"""
array[offset + 0] = (byte) (v >>> 24);
array[offset + 1] = (b... | java | public static int writeInt(byte[] array, int offset, int v) {
array[offset + 0] = (byte) (v >>> 24);
array[offset + 1] = (byte) (v >>> 16);
array[offset + 2] = (byte) (v >>> 8);
array[offset + 3] = (byte) (v >>> 0);
return SIZE_INT;
} | [
"public",
"static",
"int",
"writeInt",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
",",
"int",
"v",
")",
"{",
"array",
"[",
"offset",
"+",
"0",
"]",
"=",
"(",
"byte",
")",
"(",
"v",
">>>",
"24",
")",
";",
"array",
"[",
"offset",
"+",
... | Write an integer to the byte array at the given offset.
@param array Array to write to
@param offset Offset to write to
@param v data
@return number of bytes written | [
"Write",
"an",
"integer",
"to",
"the",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L120-L126 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/init/StartupDatabaseConnection.java | StartupDatabaseConnection.configureDBType | protected static void configureDBType(final Context _compCtx,
final String _classDBType)
throws StartupException {
"""
The class defined with parameter _classDBType initialized and bind to {@link #RESOURCE_DBTYPE}. The initialized
class must be extended from class... | java | protected static void configureDBType(final Context _compCtx,
final String _classDBType)
throws StartupException
{
try {
final AbstractDatabase<?> dbType = (AbstractDatabase<?>) Class.forName(_classDBType).newInstance();
if (dbType ==... | [
"protected",
"static",
"void",
"configureDBType",
"(",
"final",
"Context",
"_compCtx",
",",
"final",
"String",
"_classDBType",
")",
"throws",
"StartupException",
"{",
"try",
"{",
"final",
"AbstractDatabase",
"<",
"?",
">",
"dbType",
"=",
"(",
"AbstractDatabase",
... | The class defined with parameter _classDBType initialized and bind to {@link #RESOURCE_DBTYPE}. The initialized
class must be extended from class {@link AbstractDatabase}.
@param _compCtx Java root naming context
@param _classDBType class name of the database type
@throws StartupException if the database type class co... | [
"The",
"class",
"defined",
"with",
"parameter",
"_classDBType",
"initialized",
"and",
"bind",
"to",
"{",
"@link",
"#RESOURCE_DBTYPE",
"}",
".",
"The",
"initialized",
"class",
"must",
"be",
"extended",
"from",
"class",
"{",
"@link",
"AbstractDatabase",
"}",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/init/StartupDatabaseConnection.java#L404-L424 |
buschmais/jqa-core-framework | rule/src/main/java/com/buschmais/jqassistant/core/rule/api/executor/RuleSetExecutor.java | RuleSetExecutor.applyConcept | private boolean applyConcept(RuleSet ruleSet, Concept concept, Severity severity) throws RuleException {
"""
Applies the given concept.
@param concept
The concept.
@throws RuleException
If the concept cannot be applied.
"""
Boolean result = executedConcepts.get(concept);
if (result == nul... | java | private boolean applyConcept(RuleSet ruleSet, Concept concept, Severity severity) throws RuleException {
Boolean result = executedConcepts.get(concept);
if (result == null) {
if (applyRequiredConcepts(ruleSet, concept)) {
result = ruleVisitor.visitConcept(concept, severity);
... | [
"private",
"boolean",
"applyConcept",
"(",
"RuleSet",
"ruleSet",
",",
"Concept",
"concept",
",",
"Severity",
"severity",
")",
"throws",
"RuleException",
"{",
"Boolean",
"result",
"=",
"executedConcepts",
".",
"get",
"(",
"concept",
")",
";",
"if",
"(",
"result... | Applies the given concept.
@param concept
The concept.
@throws RuleException
If the concept cannot be applied. | [
"Applies",
"the",
"given",
"concept",
"."
] | train | https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/rule/src/main/java/com/buschmais/jqassistant/core/rule/api/executor/RuleSetExecutor.java#L180-L192 |
clanie/clanie-core | src/main/java/dk/clanie/collections/NumberMap.java | NumberMap.newBigDecimalMap | public static <K> NumberMap<K, BigDecimal> newBigDecimalMap() {
"""
Creates a NumberMap for BigDecimals.
@param <K>
@return NumberMap<K, BigDecimal>
"""
return new NumberMap<K, BigDecimal>() {
@Override
public void add(K key, BigDecimal addend) {
put(key, containsKey(key) ? get(key).add(a... | java | public static <K> NumberMap<K, BigDecimal> newBigDecimalMap() {
return new NumberMap<K, BigDecimal>() {
@Override
public void add(K key, BigDecimal addend) {
put(key, containsKey(key) ? get(key).add(addend) : addend);
}
@Override
public void sub(K key, BigDecimal subtrahend) {
put(key, (contain... | [
"public",
"static",
"<",
"K",
">",
"NumberMap",
"<",
"K",
",",
"BigDecimal",
">",
"newBigDecimalMap",
"(",
")",
"{",
"return",
"new",
"NumberMap",
"<",
"K",
",",
"BigDecimal",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"add",
"(",
"K",
"k... | Creates a NumberMap for BigDecimals.
@param <K>
@return NumberMap<K, BigDecimal> | [
"Creates",
"a",
"NumberMap",
"for",
"BigDecimals",
"."
] | train | https://github.com/clanie/clanie-core/blob/ac8a655b93127f0e281b741c4d53f429be2816ad/src/main/java/dk/clanie/collections/NumberMap.java#L72-L83 |
arnaudroger/SimpleFlatMapper | sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/DiscriminatorJdbcBuilder.java | DiscriminatorJdbcBuilder.when | public DiscriminatorJdbcSubBuilder when(String value, TypeReference<? extends T> type) {
"""
Add a discriminator value with its associated type specified by the type reference.
@param value the value
@param type the type reference
@return the current builder
"""
return when(value, type.getType());
... | java | public DiscriminatorJdbcSubBuilder when(String value, TypeReference<? extends T> type) {
return when(value, type.getType());
} | [
"public",
"DiscriminatorJdbcSubBuilder",
"when",
"(",
"String",
"value",
",",
"TypeReference",
"<",
"?",
"extends",
"T",
">",
"type",
")",
"{",
"return",
"when",
"(",
"value",
",",
"type",
".",
"getType",
"(",
")",
")",
";",
"}"
] | Add a discriminator value with its associated type specified by the type reference.
@param value the value
@param type the type reference
@return the current builder | [
"Add",
"a",
"discriminator",
"value",
"with",
"its",
"associated",
"type",
"specified",
"by",
"the",
"type",
"reference",
"."
] | train | https://github.com/arnaudroger/SimpleFlatMapper/blob/93435438c18f26c87963d5e0f3ebf0f264dcd8c2/sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/DiscriminatorJdbcBuilder.java#L77-L79 |
YahooArchive/samoa | samoa-api/src/main/java/com/yahoo/labs/samoa/topology/TopologyBuilder.java | TopologyBuilder.initTopology | public void initTopology(String topologyName, int delay) {
"""
Initiates topology with a specific name and a delay between consecutive instances.
@param topologyName
@param delay
delay between injections of two instances from source (in milliseconds)
"""
if (this.topology != null) {
//... | java | public void initTopology(String topologyName, int delay) {
if (this.topology != null) {
// TODO: possible refactor this code later
System.out.println("Topology has been initialized before!");
return;
}
this.topology = componentFactory.createTopology(topologyNa... | [
"public",
"void",
"initTopology",
"(",
"String",
"topologyName",
",",
"int",
"delay",
")",
"{",
"if",
"(",
"this",
".",
"topology",
"!=",
"null",
")",
"{",
"// TODO: possible refactor this code later",
"System",
".",
"out",
".",
"println",
"(",
"\"Topology has b... | Initiates topology with a specific name and a delay between consecutive instances.
@param topologyName
@param delay
delay between injections of two instances from source (in milliseconds) | [
"Initiates",
"topology",
"with",
"a",
"specific",
"name",
"and",
"a",
"delay",
"between",
"consecutive",
"instances",
"."
] | train | https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/topology/TopologyBuilder.java#L76-L83 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201808/placementservice/GetAllPlacements.java | GetAllPlacements.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
"""
Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws ... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
// Get the PlacementService.
PlacementServiceInterface placementService =
adManagerServices.get(session, PlacementServiceInterface.class);
// Create a statement to get all pla... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"// Get the PlacementService.",
"PlacementServiceInterface",
"placementService",
"=",
"adManagerServices",
".",
... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201808/placementservice/GetAllPlacements.java#L52-L85 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataDecoder.java | DataDecoder.decodeShort | public static short decodeShort(byte[] src, int srcOffset)
throws CorruptEncodingException {
"""
Decodes a signed short from exactly 2 bytes.
@param src source of encoded bytes
@param srcOffset offset into source array
@return signed short value
"""
try {
return (short)(((sr... | java | public static short decodeShort(byte[] src, int srcOffset)
throws CorruptEncodingException
{
try {
return (short)(((src[srcOffset] << 8) | (src[srcOffset + 1] & 0xff)) ^ 0x8000);
} catch (IndexOutOfBoundsException e) {
throw new CorruptEncodingException(null, e)... | [
"public",
"static",
"short",
"decodeShort",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"throws",
"CorruptEncodingException",
"{",
"try",
"{",
"return",
"(",
"short",
")",
"(",
"(",
"(",
"src",
"[",
"srcOffset",
"]",
"<<",
"8",
")",
"|"... | Decodes a signed short from exactly 2 bytes.
@param src source of encoded bytes
@param srcOffset offset into source array
@return signed short value | [
"Decodes",
"a",
"signed",
"short",
"from",
"exactly",
"2",
"bytes",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataDecoder.java#L174-L182 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.setPerspective | public Matrix4f setPerspective(float fovy, float aspect, float zNear, float zFar) {
"""
Set this matrix to be a symmetric perspective projection frustum transformation for a right-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code>.
<p>
In order to apply the perspective projection trans... | java | public Matrix4f setPerspective(float fovy, float aspect, float zNear, float zFar) {
return setPerspective(fovy, aspect, zNear, zFar, false);
} | [
"public",
"Matrix4f",
"setPerspective",
"(",
"float",
"fovy",
",",
"float",
"aspect",
",",
"float",
"zNear",
",",
"float",
"zFar",
")",
"{",
"return",
"setPerspective",
"(",
"fovy",
",",
"aspect",
",",
"zNear",
",",
"zFar",
",",
"false",
")",
";",
"}"
] | Set this matrix to be a symmetric perspective projection frustum transformation for a right-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code>.
<p>
In order to apply the perspective projection transformation to an existing transformation,
use {@link #perspective(float, float, float, float) per... | [
"Set",
"this",
"matrix",
"to",
"be",
"a",
"symmetric",
"perspective",
"projection",
"frustum",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"using",
"OpenGL",
"s",
"NDC",
"z",
"range",
"of",
"<code",
">",
"[",
"-",
"1",
"..... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L9859-L9861 |
j-easy/easy-batch | easybatch-extensions/easybatch-quartz/src/main/java/org/easybatch/extensions/quartz/JobScheduler.java | JobScheduler.scheduleAt | public void scheduleAt(final org.easybatch.core.job.Job job, final Date startTime) throws JobSchedulerException {
"""
Schedule a job to start at a fixed point of time.
@param job the job to schedule
@param startTime the start time
"""
checkNotNull(job, "job");
checkNotNull(startTime, ... | java | public void scheduleAt(final org.easybatch.core.job.Job job, final Date startTime) throws JobSchedulerException {
checkNotNull(job, "job");
checkNotNull(startTime, "startTime");
String name = job.getName();
String jobName = JOB_NAME_PREFIX + name;
String triggerName = TRIGGER_NA... | [
"public",
"void",
"scheduleAt",
"(",
"final",
"org",
".",
"easybatch",
".",
"core",
".",
"job",
".",
"Job",
"job",
",",
"final",
"Date",
"startTime",
")",
"throws",
"JobSchedulerException",
"{",
"checkNotNull",
"(",
"job",
",",
"\"job\"",
")",
";",
"checkN... | Schedule a job to start at a fixed point of time.
@param job the job to schedule
@param startTime the start time | [
"Schedule",
"a",
"job",
"to",
"start",
"at",
"a",
"fixed",
"point",
"of",
"time",
"."
] | train | https://github.com/j-easy/easy-batch/blob/46286e1091dae1206674e2a30e0609c31feae36c/easybatch-extensions/easybatch-quartz/src/main/java/org/easybatch/extensions/quartz/JobScheduler.java#L87-L109 |
buschmais/jqa-core-framework | rule/src/main/java/com/buschmais/jqassistant/core/rule/impl/reader/XmlHelper.java | XmlHelper.getSchema | public static Schema getSchema(String resource) {
"""
Return a {@link Schema} instance for the given resource.
@param resource
The resource.
@return The {@link Schema} instance.
"""
Schema schema;
try {
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XM... | java | public static Schema getSchema(String resource) {
Schema schema;
try {
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
schema = schemaFactory.newSchema(XmlHelper.class.getResource(resource));
} catch (SAXException e) {
... | [
"public",
"static",
"Schema",
"getSchema",
"(",
"String",
"resource",
")",
"{",
"Schema",
"schema",
";",
"try",
"{",
"SchemaFactory",
"schemaFactory",
"=",
"SchemaFactory",
".",
"newInstance",
"(",
"XMLConstants",
".",
"W3C_XML_SCHEMA_NS_URI",
")",
";",
"schema",
... | Return a {@link Schema} instance for the given resource.
@param resource
The resource.
@return The {@link Schema} instance. | [
"Return",
"a",
"{",
"@link",
"Schema",
"}",
"instance",
"for",
"the",
"given",
"resource",
"."
] | train | https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/rule/src/main/java/com/buschmais/jqassistant/core/rule/impl/reader/XmlHelper.java#L21-L30 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/process/result/ActionResult.java | ActionResult.setResultValue | public void setResultValue(String actionId, Object resultValue) {
"""
Sets the result value of the action.
@param actionId the new action id
@param resultValue the new result value of the action
"""
if (actionId == null || !actionId.contains(ActivityContext.ID_SEPARATOR)) {
this.actionI... | java | public void setResultValue(String actionId, Object resultValue) {
if (actionId == null || !actionId.contains(ActivityContext.ID_SEPARATOR)) {
this.actionId = actionId;
this.resultValue = resultValue;
} else {
String[] ids = StringUtils.tokenize(actionId, ActivityConte... | [
"public",
"void",
"setResultValue",
"(",
"String",
"actionId",
",",
"Object",
"resultValue",
")",
"{",
"if",
"(",
"actionId",
"==",
"null",
"||",
"!",
"actionId",
".",
"contains",
"(",
"ActivityContext",
".",
"ID_SEPARATOR",
")",
")",
"{",
"this",
".",
"ac... | Sets the result value of the action.
@param actionId the new action id
@param resultValue the new result value of the action | [
"Sets",
"the",
"result",
"value",
"of",
"the",
"action",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/process/result/ActionResult.java#L59-L85 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.getTargetPackageLink | public Content getTargetPackageLink(PackageDoc pd, String target,
Content label) {
"""
Get Package link, with target frame.
@param pd The link will be to the "package-summary.html" page for this package
@param target name of the target frame
@param label tag for the link
@return a content for the... | java | public Content getTargetPackageLink(PackageDoc pd, String target,
Content label) {
return getHyperLink(pathString(pd, DocPaths.PACKAGE_SUMMARY), label, "", target);
} | [
"public",
"Content",
"getTargetPackageLink",
"(",
"PackageDoc",
"pd",
",",
"String",
"target",
",",
"Content",
"label",
")",
"{",
"return",
"getHyperLink",
"(",
"pathString",
"(",
"pd",
",",
"DocPaths",
".",
"PACKAGE_SUMMARY",
")",
",",
"label",
",",
"\"\"",
... | Get Package link, with target frame.
@param pd The link will be to the "package-summary.html" page for this package
@param target name of the target frame
@param label tag for the link
@return a content for the target package link | [
"Get",
"Package",
"link",
"with",
"target",
"frame",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L285-L288 |
iwgang/CountdownView | library/src/main/java/cn/iwgang/countdownview/CountdownView.java | CountdownView.customTimeShow | @Deprecated
public void customTimeShow(boolean isShowDay, boolean isShowHour, boolean isShowMinute, boolean isShowSecond, boolean isShowMillisecond) {
"""
custom time show
@param isShowDay isShowDay
@param isShowHour isShowHour
@param isShowMinute isShowMinute
@param isShowSecond isShowSecond
@param isSh... | java | @Deprecated
public void customTimeShow(boolean isShowDay, boolean isShowHour, boolean isShowMinute, boolean isShowSecond, boolean isShowMillisecond) {
mCountdown.mHasSetIsShowDay = true;
mCountdown.mHasSetIsShowHour = true;
boolean isModCountdownInterval = mCountdown.refTimeShow(isShowDay,... | [
"@",
"Deprecated",
"public",
"void",
"customTimeShow",
"(",
"boolean",
"isShowDay",
",",
"boolean",
"isShowHour",
",",
"boolean",
"isShowMinute",
",",
"boolean",
"isShowSecond",
",",
"boolean",
"isShowMillisecond",
")",
"{",
"mCountdown",
".",
"mHasSetIsShowDay",
"=... | custom time show
@param isShowDay isShowDay
@param isShowHour isShowHour
@param isShowMinute isShowMinute
@param isShowSecond isShowSecond
@param isShowMillisecond isShowMillisecond
use:{@link #dynamicShow(DynamicConfig)} | [
"custom",
"time",
"show",
"@param",
"isShowDay",
"isShowDay",
"@param",
"isShowHour",
"isShowHour",
"@param",
"isShowMinute",
"isShowMinute",
"@param",
"isShowSecond",
"isShowSecond",
"@param",
"isShowMillisecond",
"isShowMillisecond"
] | train | https://github.com/iwgang/CountdownView/blob/3433615826b6e0a38b92e3362ba032947d9e8be7/library/src/main/java/cn/iwgang/countdownview/CountdownView.java#L177-L188 |
structurizr/java | structurizr-core/src/com/structurizr/documentation/ViewpointsAndPerspectivesDocumentationTemplate.java | ViewpointsAndPerspectivesDocumentationTemplate.addAppendicesSection | public Section addAppendicesSection(SoftwareSystem softwareSystem, File... files) throws IOException {
"""
Adds an "Appendices" section relating to a {@link SoftwareSystem} from one or more files.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@param files ... | java | public Section addAppendicesSection(SoftwareSystem softwareSystem, File... files) throws IOException {
return addSection(softwareSystem, "Appendices", files);
} | [
"public",
"Section",
"addAppendicesSection",
"(",
"SoftwareSystem",
"softwareSystem",
",",
"File",
"...",
"files",
")",
"throws",
"IOException",
"{",
"return",
"addSection",
"(",
"softwareSystem",
",",
"\"Appendices\"",
",",
"files",
")",
";",
"}"
] | Adds an "Appendices" section relating to a {@link SoftwareSystem} from one or more files.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@param files one or more File objects that point to the documentation content
@return a documentation {@link Se... | [
"Adds",
"an",
"Appendices",
"section",
"relating",
"to",
"a",
"{",
"@link",
"SoftwareSystem",
"}",
"from",
"one",
"or",
"more",
"files",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/documentation/ViewpointsAndPerspectivesDocumentationTemplate.java#L188-L190 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java | ServletUtil.setHeader | public static void setHeader(HttpServletResponse response, String name, Object value) {
"""
设置响应的Header
@param response 响应对象{@link HttpServletResponse}
@param name 名
@param value 值,可以是String,Date, int
"""
if (value instanceof String) {
response.setHeader(name, (String) value);
} else if (Date.cl... | java | public static void setHeader(HttpServletResponse response, String name, Object value) {
if (value instanceof String) {
response.setHeader(name, (String) value);
} else if (Date.class.isAssignableFrom(value.getClass())) {
response.setDateHeader(name, ((Date) value).getTime());
} else if (value instanceo... | [
"public",
"static",
"void",
"setHeader",
"(",
"HttpServletResponse",
"response",
",",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"instanceof",
"String",
")",
"{",
"response",
".",
"setHeader",
"(",
"name",
",",
"(",
"String",
"... | 设置响应的Header
@param response 响应对象{@link HttpServletResponse}
@param name 名
@param value 值,可以是String,Date, int | [
"设置响应的Header"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java#L578-L588 |
lucee/Lucee | core/src/main/java/lucee/runtime/net/ldap/LDAPClient.java | LDAPClient.modifydn | public void modifydn(String dn, String attributes) throws NamingException {
"""
modifies distinguished name attribute for LDAP entries on LDAP server
@param dn
@param attributes
@throws NamingException
"""
DirContext ctx = new InitialDirContext(env);
ctx.rename(dn, attributes);
ctx.close();
} | java | public void modifydn(String dn, String attributes) throws NamingException {
DirContext ctx = new InitialDirContext(env);
ctx.rename(dn, attributes);
ctx.close();
} | [
"public",
"void",
"modifydn",
"(",
"String",
"dn",
",",
"String",
"attributes",
")",
"throws",
"NamingException",
"{",
"DirContext",
"ctx",
"=",
"new",
"InitialDirContext",
"(",
"env",
")",
";",
"ctx",
".",
"rename",
"(",
"dn",
",",
"attributes",
")",
";",... | modifies distinguished name attribute for LDAP entries on LDAP server
@param dn
@param attributes
@throws NamingException | [
"modifies",
"distinguished",
"name",
"attribute",
"for",
"LDAP",
"entries",
"on",
"LDAP",
"server"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/ldap/LDAPClient.java#L203-L207 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/history/FsJobArchivist.java | FsJobArchivist.archiveJob | public static Path archiveJob(Path rootPath, JobID jobId, Collection<ArchivedJson> jsonToArchive) throws IOException {
"""
Writes the given {@link AccessExecutionGraph} to the {@link FileSystem} pointed to by
{@link JobManagerOptions#ARCHIVE_DIR}.
@param rootPath directory to which the archive should be writte... | java | public static Path archiveJob(Path rootPath, JobID jobId, Collection<ArchivedJson> jsonToArchive) throws IOException {
try {
FileSystem fs = rootPath.getFileSystem();
Path path = new Path(rootPath, jobId.toString());
OutputStream out = fs.create(path, FileSystem.WriteMode.NO_OVERWRITE);
try (JsonGenerato... | [
"public",
"static",
"Path",
"archiveJob",
"(",
"Path",
"rootPath",
",",
"JobID",
"jobId",
",",
"Collection",
"<",
"ArchivedJson",
">",
"jsonToArchive",
")",
"throws",
"IOException",
"{",
"try",
"{",
"FileSystem",
"fs",
"=",
"rootPath",
".",
"getFileSystem",
"(... | Writes the given {@link AccessExecutionGraph} to the {@link FileSystem} pointed to by
{@link JobManagerOptions#ARCHIVE_DIR}.
@param rootPath directory to which the archive should be written to
@param jobId job id
@param jsonToArchive collection of json-path pairs to that should be archived
@return path to where the a... | [
"Writes",
"the",
"given",
"{",
"@link",
"AccessExecutionGraph",
"}",
"to",
"the",
"{",
"@link",
"FileSystem",
"}",
"pointed",
"to",
"by",
"{",
"@link",
"JobManagerOptions#ARCHIVE_DIR",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/history/FsJobArchivist.java#L71-L98 |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/FileColumn.java | FileColumn.convertDateTime | private String convertDateTime(long dt, String format) {
"""
Converts the given milliseconds date value to the output date format.
@param dt The date to be formatted
@param format The format to use for the date
@return The formatted date
"""
if(format.length() == 0)
format = Formats.DATE... | java | private String convertDateTime(long dt, String format)
{
if(format.length() == 0)
format = Formats.DATETIME_FORMAT;
return FormatUtilities.getFormattedDateTime(dt, format, false, 0L);
} | [
"private",
"String",
"convertDateTime",
"(",
"long",
"dt",
",",
"String",
"format",
")",
"{",
"if",
"(",
"format",
".",
"length",
"(",
")",
"==",
"0",
")",
"format",
"=",
"Formats",
".",
"DATETIME_FORMAT",
";",
"return",
"FormatUtilities",
".",
"getFormatt... | Converts the given milliseconds date value to the output date format.
@param dt The date to be formatted
@param format The format to use for the date
@return The formatted date | [
"Converts",
"the",
"given",
"milliseconds",
"date",
"value",
"to",
"the",
"output",
"date",
"format",
"."
] | train | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/FileColumn.java#L701-L706 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/CollectionLiteralsTypeComputer.java | CollectionLiteralsTypeComputer.matchesExpectation | protected boolean matchesExpectation(LightweightTypeReference elementType, LightweightTypeReference expectation) {
"""
Implements fall-back strategy. If the expected type of a collection literal does not match the actual type, but the expected element
types would match the actual element type, the collection lite... | java | protected boolean matchesExpectation(LightweightTypeReference elementType, LightweightTypeReference expectation) {
return expectation != null && expectation.isResolved() && !expectation.isWildcard() && expectation.isAssignableFrom(elementType);
} | [
"protected",
"boolean",
"matchesExpectation",
"(",
"LightweightTypeReference",
"elementType",
",",
"LightweightTypeReference",
"expectation",
")",
"{",
"return",
"expectation",
"!=",
"null",
"&&",
"expectation",
".",
"isResolved",
"(",
")",
"&&",
"!",
"expectation",
"... | Implements fall-back strategy. If the expected type of a collection literal does not match the actual type, but the expected element
types would match the actual element type, the collection literal will be successfully typed according to the expectation. | [
"Implements",
"fall",
"-",
"back",
"strategy",
".",
"If",
"the",
"expected",
"type",
"of",
"a",
"collection",
"literal",
"does",
"not",
"match",
"the",
"actual",
"type",
"but",
"the",
"expected",
"element",
"types",
"would",
"match",
"the",
"actual",
"elemen... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/CollectionLiteralsTypeComputer.java#L290-L292 |
hamnis/json-collection | src/main/java/net/hamnaberg/json/DataContainer.java | DataContainer.addAll | @SuppressWarnings("unchecked")
public A addAll(Iterable<Property> toAdd) {
"""
Adds properties to the data.
@param toAdd the properties to add
@return a new copy of the template.
"""
Data data = getData();
Data modified = data.addAll(toAdd);
if (data == modified) {
ret... | java | @SuppressWarnings("unchecked")
public A addAll(Iterable<Property> toAdd) {
Data data = getData();
Data modified = data.addAll(toAdd);
if (data == modified) {
return (A)this;
}
return copy(delegate.put("data", Property.toArrayNode(data)));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"A",
"addAll",
"(",
"Iterable",
"<",
"Property",
">",
"toAdd",
")",
"{",
"Data",
"data",
"=",
"getData",
"(",
")",
";",
"Data",
"modified",
"=",
"data",
".",
"addAll",
"(",
"toAdd",
")",
";"... | Adds properties to the data.
@param toAdd the properties to add
@return a new copy of the template. | [
"Adds",
"properties",
"to",
"the",
"data",
"."
] | train | https://github.com/hamnis/json-collection/blob/fbd4a1c6ab75b70b3b4cb981b608b395e9c8c180/src/main/java/net/hamnaberg/json/DataContainer.java#L60-L69 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.sendTransaction | public CompletableFuture<TransactionEvent> sendTransaction(Collection<? extends ProposalResponse> proposalResponses, Collection<Orderer> orderers, User userContext) {
"""
Send transaction to one of a specified set of orderers with the specified user context.
IF there are no eventing peers this future returns imme... | java | public CompletableFuture<TransactionEvent> sendTransaction(Collection<? extends ProposalResponse> proposalResponses, Collection<Orderer> orderers, User userContext) {
return sendTransaction(proposalResponses, createTransactionOptions().orderers(orderers).userContext(userContext));
} | [
"public",
"CompletableFuture",
"<",
"TransactionEvent",
">",
"sendTransaction",
"(",
"Collection",
"<",
"?",
"extends",
"ProposalResponse",
">",
"proposalResponses",
",",
"Collection",
"<",
"Orderer",
">",
"orderers",
",",
"User",
"userContext",
")",
"{",
"return",
... | Send transaction to one of a specified set of orderers with the specified user context.
IF there are no eventing peers this future returns immediately completed
indicating that orderer has accepted the transaction only.
@param proposalResponses
@param orderers
@return Future allowing access to the result of the transa... | [
"Send",
"transaction",
"to",
"one",
"of",
"a",
"specified",
"set",
"of",
"orderers",
"with",
"the",
"specified",
"user",
"context",
".",
"IF",
"there",
"are",
"no",
"eventing",
"peers",
"this",
"future",
"returns",
"immediately",
"completed",
"indicating",
"th... | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L4890-L4892 |
OpenHFT/Chronicle-Map | src/main/java/net/openhft/chronicle/hash/replication/DefaultEventualConsistencyStrategy.java | DefaultEventualConsistencyStrategy.decideOnRemoteModification | public static AcceptanceDecision decideOnRemoteModification(
ReplicableEntry entry, RemoteOperationContext<?> context) {
"""
Returns the acceptance decision, should be made about the modification operation in the
given {@code context}, aiming to modify the given {@code entry}. This method doesn't do a... | java | public static AcceptanceDecision decideOnRemoteModification(
ReplicableEntry entry, RemoteOperationContext<?> context) {
long remoteTimestamp = context.remoteTimestamp();
long originTimestamp = entry.originTimestamp();
// Last write wins
if (remoteTimestamp > originTimestamp)... | [
"public",
"static",
"AcceptanceDecision",
"decideOnRemoteModification",
"(",
"ReplicableEntry",
"entry",
",",
"RemoteOperationContext",
"<",
"?",
">",
"context",
")",
"{",
"long",
"remoteTimestamp",
"=",
"context",
".",
"remoteTimestamp",
"(",
")",
";",
"long",
"ori... | Returns the acceptance decision, should be made about the modification operation in the
given {@code context}, aiming to modify the given {@code entry}. This method doesn't do any
changes to {@code entry} nor {@code context} state. {@link MapRemoteOperations} and
{@link SetRemoteOperations} method implementations shoul... | [
"Returns",
"the",
"acceptance",
"decision",
"should",
"be",
"made",
"about",
"the",
"modification",
"operation",
"in",
"the",
"given",
"{",
"@code",
"context",
"}",
"aiming",
"to",
"modify",
"the",
"given",
"{",
"@code",
"entry",
"}",
".",
"This",
"method",
... | train | https://github.com/OpenHFT/Chronicle-Map/blob/0b09733cc96302f96be4394a261699eeb021fe37/src/main/java/net/openhft/chronicle/hash/replication/DefaultEventualConsistencyStrategy.java#L52-L84 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/services/rest/JsonRestService.java | JsonRestService.post | @POST
public JSONObject post(String path, JSONObject content, Map<String,String> headers) throws ServiceException, JSONException {
"""
Create a new entity or relationship.
Or perform other action requests that cannot be categorized into put or delete.
"""
throw new ServiceException(ServiceExceptio... | java | @POST
public JSONObject post(String path, JSONObject content, Map<String,String> headers) throws ServiceException, JSONException {
throw new ServiceException(ServiceException.NOT_ALLOWED, "POST not implemented");
} | [
"@",
"POST",
"public",
"JSONObject",
"post",
"(",
"String",
"path",
",",
"JSONObject",
"content",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"throws",
"ServiceException",
",",
"JSONException",
"{",
"throw",
"new",
"ServiceException",
"(",
... | Create a new entity or relationship.
Or perform other action requests that cannot be categorized into put or delete. | [
"Create",
"a",
"new",
"entity",
"or",
"relationship",
".",
"Or",
"perform",
"other",
"action",
"requests",
"that",
"cannot",
"be",
"categorized",
"into",
"put",
"or",
"delete",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/services/rest/JsonRestService.java#L121-L124 |
Stratio/stratio-cassandra | src/java/com/stratio/cassandra/contrib/ComparatorChain.java | ComparatorChain.addComparator | public void addComparator(Comparator<T> comparator, boolean reverse) {
"""
Add a Comparator to the end of the chain using the given sortFields order
@param comparator Comparator to add to the end of the chain
@param reverse false = forward sortFields order; true = reverse sortFields order
"""
ch... | java | public void addComparator(Comparator<T> comparator, boolean reverse) {
checkLocked();
comparatorChain.add(comparator);
if (reverse == true) {
orderingBits.set(comparatorChain.size() - 1);
}
} | [
"public",
"void",
"addComparator",
"(",
"Comparator",
"<",
"T",
">",
"comparator",
",",
"boolean",
"reverse",
")",
"{",
"checkLocked",
"(",
")",
";",
"comparatorChain",
".",
"add",
"(",
"comparator",
")",
";",
"if",
"(",
"reverse",
"==",
"true",
")",
"{"... | Add a Comparator to the end of the chain using the given sortFields order
@param comparator Comparator to add to the end of the chain
@param reverse false = forward sortFields order; true = reverse sortFields order | [
"Add",
"a",
"Comparator",
"to",
"the",
"end",
"of",
"the",
"chain",
"using",
"the",
"given",
"sortFields",
"order"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/contrib/ComparatorChain.java#L135-L142 |
structr/structr | structr-core/src/main/java/org/structr/schema/action/Function.java | Function.assertArrayHasLengthAndAllElementsNotNull | protected void assertArrayHasLengthAndAllElementsNotNull(final Object[] array, final Integer length) throws ArgumentCountException, ArgumentNullException {
"""
Test if the given object array has exact the given length and all its elements are not null.
@param array
@param length
@throws ArgumentCountException... | java | protected void assertArrayHasLengthAndAllElementsNotNull(final Object[] array, final Integer length) throws ArgumentCountException, ArgumentNullException {
if (array.length != length) {
throw ArgumentCountException.notEqual(array.length, length);
}
for (final Object element : array) {
if (element == null... | [
"protected",
"void",
"assertArrayHasLengthAndAllElementsNotNull",
"(",
"final",
"Object",
"[",
"]",
"array",
",",
"final",
"Integer",
"length",
")",
"throws",
"ArgumentCountException",
",",
"ArgumentNullException",
"{",
"if",
"(",
"array",
".",
"length",
"!=",
"leng... | Test if the given object array has exact the given length and all its elements are not null.
@param array
@param length
@throws ArgumentCountException in case of wrong number of parameters
@throws ArgumentNullException in case of a null parameter | [
"Test",
"if",
"the",
"given",
"object",
"array",
"has",
"exact",
"the",
"given",
"length",
"and",
"all",
"its",
"elements",
"are",
"not",
"null",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/action/Function.java#L169-L181 |
hibernate/hibernate-ogm | infinispan-remote/src/main/java/org/hibernate/ogm/datastore/infinispanremote/impl/protobuf/schema/SchemaDefinitions.java | SchemaDefinitions.deploySchema | public void deploySchema(String generatedProtobufName, RemoteCache<String, String> protobufCache, SchemaCapture schemaCapture, SchemaOverride schemaOverrideService,
URL schemaOverrideResource) {
"""
Typically this is transparently handled by using the Protostream codecs but be aware of it when bypassing Protost... | java | public void deploySchema(String generatedProtobufName, RemoteCache<String, String> protobufCache, SchemaCapture schemaCapture, SchemaOverride schemaOverrideService,
URL schemaOverrideResource) {
// user defined schema
if ( schemaOverrideService != null || schemaOverrideResource != null ) {
cachedSchema = new ... | [
"public",
"void",
"deploySchema",
"(",
"String",
"generatedProtobufName",
",",
"RemoteCache",
"<",
"String",
",",
"String",
">",
"protobufCache",
",",
"SchemaCapture",
"schemaCapture",
",",
"SchemaOverride",
"schemaOverrideService",
",",
"URL",
"schemaOverrideResource",
... | Typically this is transparently handled by using the Protostream codecs but be aware of it when bypassing Protostream. | [
"Typically",
"this",
"is",
"transparently",
"handled",
"by",
"using",
"the",
"Protostream",
"codecs",
"but",
"be",
"aware",
"of",
"it",
"when",
"bypassing",
"Protostream",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-remote/src/main/java/org/hibernate/ogm/datastore/infinispanremote/impl/protobuf/schema/SchemaDefinitions.java#L54-L78 |
structr/structr | structr-modules/structr-signed-jar-module/src/main/java/org/structr/jar/SignedJarBuilder.java | SignedJarBuilder.writeFile | public void writeFile(File inputFile, String jarPath) throws IOException {
"""
Writes a new {@link File} into the archive.
@param inputFile the {@link File} to write.
@param jarPath the filepath inside the archive.
@throws IOException
"""
// Get an input stream on the file.
FileInputStream fis = new ... | java | public void writeFile(File inputFile, String jarPath) throws IOException {
// Get an input stream on the file.
FileInputStream fis = new FileInputStream(inputFile);
try {
// create the zip entry
JarEntry entry = new JarEntry(jarPath);
entry.setTime(inputFile.lastModified());
writeEntry(fis, entry);
... | [
"public",
"void",
"writeFile",
"(",
"File",
"inputFile",
",",
"String",
"jarPath",
")",
"throws",
"IOException",
"{",
"// Get an input stream on the file.",
"FileInputStream",
"fis",
"=",
"new",
"FileInputStream",
"(",
"inputFile",
")",
";",
"try",
"{",
"// create t... | Writes a new {@link File} into the archive.
@param inputFile the {@link File} to write.
@param jarPath the filepath inside the archive.
@throws IOException | [
"Writes",
"a",
"new",
"{",
"@link",
"File",
"}",
"into",
"the",
"archive",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-modules/structr-signed-jar-module/src/main/java/org/structr/jar/SignedJarBuilder.java#L100-L114 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.setOrthoSymmetricLH | public Matrix4f setOrthoSymmetricLH(float width, float height, float zNear, float zFar) {
"""
Set this matrix to be a symmetric orthographic projection transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code>.
<p>
This method is equivalent to calling {@link #setOrth... | java | public Matrix4f setOrthoSymmetricLH(float width, float height, float zNear, float zFar) {
return setOrthoSymmetricLH(width, height, zNear, zFar, false);
} | [
"public",
"Matrix4f",
"setOrthoSymmetricLH",
"(",
"float",
"width",
",",
"float",
"height",
",",
"float",
"zNear",
",",
"float",
"zFar",
")",
"{",
"return",
"setOrthoSymmetricLH",
"(",
"width",
",",
"height",
",",
"zNear",
",",
"zFar",
",",
"false",
")",
"... | Set this matrix to be a symmetric orthographic projection transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code>.
<p>
This method is equivalent to calling {@link #setOrthoLH(float, float, float, float, float, float) setOrthoLH()} with
<code>left=-width/2</code>, <code>rig... | [
"Set",
"this",
"matrix",
"to",
"be",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"using",
"OpenGL",
"s",
"NDC",
"z",
"range",
"of",
"<code",
">",
"[",
"-",
"1",
"..",
"+",
"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L7768-L7770 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java | SyncGroupsInner.listHubSchemasAsync | public Observable<Page<SyncFullSchemaPropertiesInner>> listHubSchemasAsync(final String resourceGroupName, final String serverName, final String databaseName, final String syncGroupName) {
"""
Gets a collection of hub database schemas.
@param resourceGroupName The name of the resource group that contains the re... | java | public Observable<Page<SyncFullSchemaPropertiesInner>> listHubSchemasAsync(final String resourceGroupName, final String serverName, final String databaseName, final String syncGroupName) {
return listHubSchemasWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName)
.map(... | [
"public",
"Observable",
"<",
"Page",
"<",
"SyncFullSchemaPropertiesInner",
">",
">",
"listHubSchemasAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"serverName",
",",
"final",
"String",
"databaseName",
",",
"final",
"String",
"syncGroupNam... | Gets a collection of hub database schemas.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database on which the sync group is h... | [
"Gets",
"a",
"collection",
"of",
"hub",
"database",
"schemas",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java#L496-L504 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java | Settings.logProperties | private void logProperties(@NotNull final String header, @NotNull final Properties properties) {
"""
Logs the properties. This will not log any properties that contain
'password' in the key.
@param header the header to print with the log message
@param properties the properties to log
"""
if (LOGG... | java | private void logProperties(@NotNull final String header, @NotNull final Properties properties) {
if (LOGGER.isDebugEnabled()) {
final StringWriter sw = new StringWriter();
try (final PrintWriter pw = new PrintWriter(sw)) {
pw.format("%s:%n%n", header);
fin... | [
"private",
"void",
"logProperties",
"(",
"@",
"NotNull",
"final",
"String",
"header",
",",
"@",
"NotNull",
"final",
"Properties",
"properties",
")",
"{",
"if",
"(",
"LOGGER",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"final",
"StringWriter",
"sw",
"=",
"n... | Logs the properties. This will not log any properties that contain
'password' in the key.
@param header the header to print with the log message
@param properties the properties to log | [
"Logs",
"the",
"properties",
".",
"This",
"will",
"not",
"log",
"any",
"properties",
"that",
"contain",
"password",
"in",
"the",
"key",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java#L635-L657 |
jaxio/javaee-lab | javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java | GenericRepository.findPropertyCount | @Transactional
public int findPropertyCount(E entity, SearchParameters sp, List<Attribute<?, ?>> attributes) {
"""
Count the number of E instances.
@param entity a sample entity whose non-null properties may be used as search hint
@param sp carries additional search information
@param attribut... | java | @Transactional
public int findPropertyCount(E entity, SearchParameters sp, List<Attribute<?, ?>> attributes) {
if (sp.hasNamedQuery()) {
return byNamedQueryUtil.numberByNamedQuery(sp).intValue();
}
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
CriteriaQuer... | [
"@",
"Transactional",
"public",
"int",
"findPropertyCount",
"(",
"E",
"entity",
",",
"SearchParameters",
"sp",
",",
"List",
"<",
"Attribute",
"<",
"?",
",",
"?",
">",
">",
"attributes",
")",
"{",
"if",
"(",
"sp",
".",
"hasNamedQuery",
"(",
")",
")",
"{... | Count the number of E instances.
@param entity a sample entity whose non-null properties may be used as search hint
@param sp carries additional search information
@param attributes the list of attributes to the property
@return the number of entities matching the search. | [
"Count",
"the",
"number",
"of",
"E",
"instances",
"."
] | train | https://github.com/jaxio/javaee-lab/blob/61238b967952446d81cc68424a4e809093a77fcf/javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java#L405-L434 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.