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 |
|---|---|---|---|---|---|---|---|---|---|---|
code4everything/util | src/main/java/com/zhazhapan/util/NetUtils.java | NetUtils.getCookie | public static Cookie getCookie(String name, HttpServletRequest request) {
"""
通过名称获取Cookie
@param name Cookie名
@param request {@link HttpServletRequest}
@return {@link Cookie}
@since 1.0.8
"""
return getCookie(name, request.getCookies());
} | java | public static Cookie getCookie(String name, HttpServletRequest request) {
return getCookie(name, request.getCookies());
} | [
"public",
"static",
"Cookie",
"getCookie",
"(",
"String",
"name",
",",
"HttpServletRequest",
"request",
")",
"{",
"return",
"getCookie",
"(",
"name",
",",
"request",
".",
"getCookies",
"(",
")",
")",
";",
"}"
] | 通过名称获取Cookie
@param name Cookie名
@param request {@link HttpServletRequest}
@return {@link Cookie}
@since 1.0.8 | [
"通过名称获取Cookie"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/NetUtils.java#L629-L631 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/interest/FactoryDetectPoint.java | FactoryDetectPoint.createKitRos | public static <T extends ImageGray<T>, D extends ImageGray<D>>
GeneralFeatureDetector<T, D> createKitRos(@Nullable ConfigGeneralDetector configDetector, Class<D> derivType) {
"""
Detects Kitchen and Rosenfeld corners.
@param configDetector Configuration for feature detector.
@param derivType Type of der... | java | public static <T extends ImageGray<T>, D extends ImageGray<D>>
GeneralFeatureDetector<T, D> createKitRos(@Nullable ConfigGeneralDetector configDetector, Class<D> derivType) {
if( configDetector == null)
configDetector = new ConfigGeneralDetector();
GeneralFeatureIntensity<T, D> intensity = new WrapperKitRosCor... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"GeneralFeatureDetector",
"<",
"T",
",",
"D",
">",
"createKitRos",
"(",
"@",
"Nullable",
"ConfigGeneralDetector",
"configDetector",
","... | Detects Kitchen and Rosenfeld corners.
@param configDetector Configuration for feature detector.
@param derivType Type of derivative image.
@see boofcv.alg.feature.detect.intensity.KitRosCornerIntensity | [
"Detects",
"Kitchen",
"and",
"Rosenfeld",
"corners",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/interest/FactoryDetectPoint.java#L110-L117 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.deleteAddOn | public void deleteAddOn(final String planCode, final String addOnCode) {
"""
Deletes an {@link AddOn} for a Plan
<p>
@param planCode The {@link Plan} object.
@param addOnCode The {@link AddOn} object to delete.
"""
doDELETE(Plan.PLANS_RESOURCE +
"/" +
planCode +
... | java | public void deleteAddOn(final String planCode, final String addOnCode) {
doDELETE(Plan.PLANS_RESOURCE +
"/" +
planCode +
AddOn.ADDONS_RESOURCE +
"/" +
addOnCode);
} | [
"public",
"void",
"deleteAddOn",
"(",
"final",
"String",
"planCode",
",",
"final",
"String",
"addOnCode",
")",
"{",
"doDELETE",
"(",
"Plan",
".",
"PLANS_RESOURCE",
"+",
"\"/\"",
"+",
"planCode",
"+",
"AddOn",
".",
"ADDONS_RESOURCE",
"+",
"\"/\"",
"+",
"addOn... | Deletes an {@link AddOn} for a Plan
<p>
@param planCode The {@link Plan} object.
@param addOnCode The {@link AddOn} object to delete. | [
"Deletes",
"an",
"{",
"@link",
"AddOn",
"}",
"for",
"a",
"Plan",
"<p",
">"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1506-L1513 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/DTDValidatorBase.java | DTDValidatorBase.mayHaveNsDefaults | @Override
public boolean mayHaveNsDefaults(String elemPrefix, String elemLN) {
"""
Calling this method before {@link #checkNsDefaults} is necessary
to pass information regarding the current element; although
it will become available later on (via normal XMLValidator interface),
that's too late (after namesp... | java | @Override
public boolean mayHaveNsDefaults(String elemPrefix, String elemLN)
{
mTmpKey.reset(elemPrefix, elemLN);
DTDElement elem = mElemSpecs.get(mTmpKey);
mCurrElem = elem;
return (elem != null) && elem.hasNsDefaults();
} | [
"@",
"Override",
"public",
"boolean",
"mayHaveNsDefaults",
"(",
"String",
"elemPrefix",
",",
"String",
"elemLN",
")",
"{",
"mTmpKey",
".",
"reset",
"(",
"elemPrefix",
",",
"elemLN",
")",
";",
"DTDElement",
"elem",
"=",
"mElemSpecs",
".",
"get",
"(",
"mTmpKey... | Calling this method before {@link #checkNsDefaults} is necessary
to pass information regarding the current element; although
it will become available later on (via normal XMLValidator interface),
that's too late (after namespace binding and resolving). | [
"Calling",
"this",
"method",
"before",
"{"
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/DTDValidatorBase.java#L381-L388 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java | DoubleIntIndex.addSorted | public synchronized boolean addSorted(int key, int value) {
"""
Adds a key, value pair into the table with the guarantee that the key
is equal or larger than the largest existing key. This prevents a sort
from taking place on next call to find()
@param key the key
@param value the value
@return true or fals... | java | public synchronized boolean addSorted(int key, int value) {
if (count == capacity) {
if (fixedSize) {
return false;
} else {
doubleCapacity();
}
}
if (count != 0 && value < values[count - 1]) {
return false;
... | [
"public",
"synchronized",
"boolean",
"addSorted",
"(",
"int",
"key",
",",
"int",
"value",
")",
"{",
"if",
"(",
"count",
"==",
"capacity",
")",
"{",
"if",
"(",
"fixedSize",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"doubleCapacity",
"(",
")",
... | Adds a key, value pair into the table with the guarantee that the key
is equal or larger than the largest existing key. This prevents a sort
from taking place on next call to find()
@param key the key
@param value the value
@return true or false depending on success | [
"Adds",
"a",
"key",
"value",
"pair",
"into",
"the",
"table",
"with",
"the",
"guarantee",
"that",
"the",
"key",
"is",
"equal",
"or",
"larger",
"than",
"the",
"largest",
"existing",
"key",
".",
"This",
"prevents",
"a",
"sort",
"from",
"taking",
"place",
"o... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java#L185-L206 |
haifengl/smile | core/src/main/java/smile/classification/NeuralNetwork.java | NeuralNetwork.learn | public double learn(double[] x, double[] y, double weight) {
"""
Update the neural network with given instance and associated target value.
Note that this method is NOT multi-thread safe.
@param x the training instance.
@param y the target value.
@param weight a positive weight value associated with the traini... | java | public double learn(double[] x, double[] y, double weight) {
setInput(x);
propagate();
double err = weight * computeOutputError(y);
if (weight != 1.0) {
for (int i = 0; i < outputLayer.units; i++) {
outputLayer.error[i] *= weight;
}
}
... | [
"public",
"double",
"learn",
"(",
"double",
"[",
"]",
"x",
",",
"double",
"[",
"]",
"y",
",",
"double",
"weight",
")",
"{",
"setInput",
"(",
"x",
")",
";",
"propagate",
"(",
")",
";",
"double",
"err",
"=",
"weight",
"*",
"computeOutputError",
"(",
... | Update the neural network with given instance and associated target value.
Note that this method is NOT multi-thread safe.
@param x the training instance.
@param y the target value.
@param weight a positive weight value associated with the training instance.
@return the weighted training error before back-propagation. | [
"Update",
"the",
"neural",
"network",
"with",
"given",
"instance",
"and",
"associated",
"target",
"value",
".",
"Note",
"that",
"this",
"method",
"is",
"NOT",
"multi",
"-",
"thread",
"safe",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/classification/NeuralNetwork.java#L849-L864 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.mockStaticPartialStrict | public static synchronized void mockStaticPartialStrict(Class<?> clazz, String... methodNames) {
"""
A utility method that may be used to mock several <b>static</b> methods
(strict) in an easy way (by just passing in the method names of the
method you wish to mock). Note that you cannot uniquely specify a method... | java | public static synchronized void mockStaticPartialStrict(Class<?> clazz, String... methodNames) {
mockStaticStrict(clazz, Whitebox.getMethods(clazz, methodNames));
} | [
"public",
"static",
"synchronized",
"void",
"mockStaticPartialStrict",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"...",
"methodNames",
")",
"{",
"mockStaticStrict",
"(",
"clazz",
",",
"Whitebox",
".",
"getMethods",
"(",
"clazz",
",",
"methodNames",
... | A utility method that may be used to mock several <b>static</b> methods
(strict) in an easy way (by just passing in the method names of the
method you wish to mock). Note that you cannot uniquely specify a method
to mock using this method if there are several methods with the same name
in {@code type}. This method will... | [
"A",
"utility",
"method",
"that",
"may",
"be",
"used",
"to",
"mock",
"several",
"<b",
">",
"static<",
"/",
"b",
">",
"methods",
"(",
"strict",
")",
"in",
"an",
"easy",
"way",
"(",
"by",
"just",
"passing",
"in",
"the",
"method",
"names",
"of",
"the",
... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L591-L593 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.profile_setFBML | public boolean profile_setFBML(CharSequence fbmlMarkup, Integer userId)
throws FacebookException, IOException {
"""
Sets the FBML for a user's profile, including the content for both the profile box
and the profile actions.
@param userId the user whose profile FBML to set
@param fbmlMarkup refer to the FBML... | java | public boolean profile_setFBML(CharSequence fbmlMarkup, Integer userId)
throws FacebookException, IOException {
return extractBoolean(this.callMethod(FacebookMethod.PROFILE_SET_FBML,
new Pair<String, CharSequence>("uid", Integer.toString(userId)),
... | [
"public",
"boolean",
"profile_setFBML",
"(",
"CharSequence",
"fbmlMarkup",
",",
"Integer",
"userId",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"return",
"extractBoolean",
"(",
"this",
".",
"callMethod",
"(",
"FacebookMethod",
".",
"PROFILE_SET_FBML"... | Sets the FBML for a user's profile, including the content for both the profile box
and the profile actions.
@param userId the user whose profile FBML to set
@param fbmlMarkup refer to the FBML documentation for a description of the markup and its role in various contexts
@return a boolean indicating whether the FBML wa... | [
"Sets",
"the",
"FBML",
"for",
"a",
"user",
"s",
"profile",
"including",
"the",
"content",
"for",
"both",
"the",
"profile",
"box",
"and",
"the",
"profile",
"actions",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L1421-L1426 |
apereo/cas | support/cas-server-support-digest-authentication/src/main/java/org/apereo/cas/digest/util/DigestAuthenticationUtils.java | DigestAuthenticationUtils.createAuthenticateHeader | public static String createAuthenticateHeader(final String realm, final String authMethod, final String nonce) {
"""
Create authenticate header, containing the realm, nonce, opaque, etc.
@param realm the realm
@param authMethod the auth method
@param nonce the nonce
@return the header string
""... | java | public static String createAuthenticateHeader(final String realm, final String authMethod, final String nonce) {
val stringBuilder = new StringBuilder("Digest realm=\"")
.append(realm).append("\",");
if (StringUtils.isNotBlank(authMethod)) {
stringBuilder.append("qop=").append(au... | [
"public",
"static",
"String",
"createAuthenticateHeader",
"(",
"final",
"String",
"realm",
",",
"final",
"String",
"authMethod",
",",
"final",
"String",
"nonce",
")",
"{",
"val",
"stringBuilder",
"=",
"new",
"StringBuilder",
"(",
"\"Digest realm=\\\"\"",
")",
".",... | Create authenticate header, containing the realm, nonce, opaque, etc.
@param realm the realm
@param authMethod the auth method
@param nonce the nonce
@return the header string | [
"Create",
"authenticate",
"header",
"containing",
"the",
"realm",
"nonce",
"opaque",
"etc",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-digest-authentication/src/main/java/org/apereo/cas/digest/util/DigestAuthenticationUtils.java#L63-L73 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/aspera/transfer/TransferListener.java | TransferListener.removeTransactionSession | private void removeTransactionSession(String xferId, String sessionId) {
"""
Removes the specified transaction session
@param xferId
@param sessionId
"""
List<String> sessions = transactionSessions.get(xferId);
if(sessions != null){
final boolean removal = sessions.remove(sessionId);
if (removal... | java | private void removeTransactionSession(String xferId, String sessionId) {
List<String> sessions = transactionSessions.get(xferId);
if(sessions != null){
final boolean removal = sessions.remove(sessionId);
if (removal) {
ascpCount--;
}
}
} | [
"private",
"void",
"removeTransactionSession",
"(",
"String",
"xferId",
",",
"String",
"sessionId",
")",
"{",
"List",
"<",
"String",
">",
"sessions",
"=",
"transactionSessions",
".",
"get",
"(",
"xferId",
")",
";",
"if",
"(",
"sessions",
"!=",
"null",
")",
... | Removes the specified transaction session
@param xferId
@param sessionId | [
"Removes",
"the",
"specified",
"transaction",
"session"
] | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/aspera/transfer/TransferListener.java#L335-L344 |
enioka/jqm | jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/JqmEngine.java | JqmEngine.purgeDeadJobInstances | private void purgeDeadJobInstances(DbConn cnx, Node node) {
"""
To be called at node startup - it purges all job instances associated to this node.
@param cnx
@param node
"""
for (JobInstance ji : JobInstance.select(cnx, "ji_select_by_node", node.getId()))
{
try
{
... | java | private void purgeDeadJobInstances(DbConn cnx, Node node)
{
for (JobInstance ji : JobInstance.select(cnx, "ji_select_by_node", node.getId()))
{
try
{
cnx.runSelectSingle("history_select_state_by_id", String.class, ji.getId());
}
catch (... | [
"private",
"void",
"purgeDeadJobInstances",
"(",
"DbConn",
"cnx",
",",
"Node",
"node",
")",
"{",
"for",
"(",
"JobInstance",
"ji",
":",
"JobInstance",
".",
"select",
"(",
"cnx",
",",
"\"ji_select_by_node\"",
",",
"node",
".",
"getId",
"(",
")",
")",
")",
... | To be called at node startup - it purges all job instances associated to this node.
@param cnx
@param node | [
"To",
"be",
"called",
"at",
"node",
"startup",
"-",
"it",
"purges",
"all",
"job",
"instances",
"associated",
"to",
"this",
"node",
"."
] | train | https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/JqmEngine.java#L492-L511 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbGenres.java | TmdbGenres.getGenreList | private ResultList<Genre> getGenreList(String language, MethodSub sub) throws MovieDbException {
"""
Get the list of genres for movies or TV
@param language
@param sub
@return
@throws MovieDbException
"""
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.LANGUAGE, lan... | java | private ResultList<Genre> getGenreList(String language, MethodSub sub) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.LANGUAGE, language);
URL url = new ApiUrl(apiKey, MethodBase.GENRE).subMethod(sub).buildUrl(parameters);
String webpage... | [
"private",
"ResultList",
"<",
"Genre",
">",
"getGenreList",
"(",
"String",
"language",
",",
"MethodSub",
"sub",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
".",
"add",
"(",
... | Get the list of genres for movies or TV
@param language
@param sub
@return
@throws MovieDbException | [
"Get",
"the",
"list",
"of",
"genres",
"for",
"movies",
"or",
"TV"
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbGenres.java#L85-L100 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.setIcon | public static boolean setIcon(MarkerOptions markerOptions, IconRow icon, float density, IconCache iconCache) {
"""
Set the icon into the marker options
@param markerOptions marker options
@param icon icon row
@param density display density: {@link android.util.DisplayMetrics#density}
@param ic... | java | public static boolean setIcon(MarkerOptions markerOptions, IconRow icon, float density, IconCache iconCache) {
boolean iconSet = false;
if (icon != null) {
Bitmap iconImage = createIcon(icon, density, iconCache);
markerOptions.icon(BitmapDescriptorFactory
.... | [
"public",
"static",
"boolean",
"setIcon",
"(",
"MarkerOptions",
"markerOptions",
",",
"IconRow",
"icon",
",",
"float",
"density",
",",
"IconCache",
"iconCache",
")",
"{",
"boolean",
"iconSet",
"=",
"false",
";",
"if",
"(",
"icon",
"!=",
"null",
")",
"{",
"... | Set the icon into the marker options
@param markerOptions marker options
@param icon icon row
@param density display density: {@link android.util.DisplayMetrics#density}
@param iconCache icon cache
@return true if icon was set into the marker options | [
"Set",
"the",
"icon",
"into",
"the",
"marker",
"options"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L264-L282 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Image.java | Image.getInstance | public static Image getInstance(int width, int height, byte[] data, byte[] globals) {
"""
Creates a JBIG2 Image.
@param width the width of the image
@param height the height of the image
@param data the raw image data
@param globals JBIG2 globals
@since 2.1.5
"""
Image img = new ImgJBIG2(width, height, ... | java | public static Image getInstance(int width, int height, byte[] data, byte[] globals) {
Image img = new ImgJBIG2(width, height, data, globals);
return img;
} | [
"public",
"static",
"Image",
"getInstance",
"(",
"int",
"width",
",",
"int",
"height",
",",
"byte",
"[",
"]",
"data",
",",
"byte",
"[",
"]",
"globals",
")",
"{",
"Image",
"img",
"=",
"new",
"ImgJBIG2",
"(",
"width",
",",
"height",
",",
"data",
",",
... | Creates a JBIG2 Image.
@param width the width of the image
@param height the height of the image
@param data the raw image data
@param globals JBIG2 globals
@since 2.1.5 | [
"Creates",
"a",
"JBIG2",
"Image",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Image.java#L477-L480 |
beanshell/beanshell | src/main/java/bsh/Reflect.java | Reflect.getDeclaredMethod | public static BshMethod getDeclaredMethod(Class<?> type, String name, Class<?>[] sig) {
"""
/*
Get method from either class static or object instance namespaces
"""
if (!isGeneratedClass(type))
return null;
BshMethod meth = getMethod(type, name, sig);
if (null == meth && !t... | java | public static BshMethod getDeclaredMethod(Class<?> type, String name, Class<?>[] sig) {
if (!isGeneratedClass(type))
return null;
BshMethod meth = getMethod(type, name, sig);
if (null == meth && !type.isInterface())
return getMethod(getNewInstance(type), name, sig);
... | [
"public",
"static",
"BshMethod",
"getDeclaredMethod",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"sig",
")",
"{",
"if",
"(",
"!",
"isGeneratedClass",
"(",
"type",
")",
")",
"return",
"null",
";"... | /*
Get method from either class static or object instance namespaces | [
"/",
"*",
"Get",
"method",
"from",
"either",
"class",
"static",
"or",
"object",
"instance",
"namespaces"
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Reflect.java#L833-L840 |
netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.forEachByteDesc | public int forEachByteDesc(int index, int length, ByteProcessor visitor) throws Exception {
"""
Iterates over the specified area of this buffer with the specified {@code processor} in descending order.
(i.e. {@code (index + length - 1)}, {@code (index + length - 2)}, ... {@code index}).
@return {@code -1} if t... | java | public int forEachByteDesc(int index, int length, ByteProcessor visitor) throws Exception {
if (isOutOfBounds(index, length, length())) {
throw new IndexOutOfBoundsException("expected: " + "0 <= index(" + index + ") <= start + length(" + length
+ ") <= " + "length(" + length() + ... | [
"public",
"int",
"forEachByteDesc",
"(",
"int",
"index",
",",
"int",
"length",
",",
"ByteProcessor",
"visitor",
")",
"throws",
"Exception",
"{",
"if",
"(",
"isOutOfBounds",
"(",
"index",
",",
"length",
",",
"length",
"(",
")",
")",
")",
"{",
"throw",
"ne... | Iterates over the specified area of this buffer with the specified {@code processor} in descending order.
(i.e. {@code (index + length - 1)}, {@code (index + length - 2)}, ... {@code index}).
@return {@code -1} if the processor iterated to or beyond the beginning of the specified area.
The last-visited index If the {@... | [
"Iterates",
"over",
"the",
"specified",
"area",
"of",
"this",
"buffer",
"with",
"the",
"specified",
"{",
"@code",
"processor",
"}",
"in",
"descending",
"order",
".",
"(",
"i",
".",
"e",
".",
"{",
"@code",
"(",
"index",
"+",
"length",
"-",
"1",
")",
"... | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L304-L310 |
JDBDT/jdbdt | src/main/java/org/jdbdt/DB.java | DB.logSnapshot | void logSnapshot(CallInfo callInfo, DataSet data) {
"""
Log query result.
@param callInfo Call info.
@param data Data set.
"""
if (isEnabled(Option.LOG_SNAPSHOTS)) {
log.write(callInfo, data);
}
} | java | void logSnapshot(CallInfo callInfo, DataSet data) {
if (isEnabled(Option.LOG_SNAPSHOTS)) {
log.write(callInfo, data);
}
} | [
"void",
"logSnapshot",
"(",
"CallInfo",
"callInfo",
",",
"DataSet",
"data",
")",
"{",
"if",
"(",
"isEnabled",
"(",
"Option",
".",
"LOG_SNAPSHOTS",
")",
")",
"{",
"log",
".",
"write",
"(",
"callInfo",
",",
"data",
")",
";",
"}",
"}"
] | Log query result.
@param callInfo Call info.
@param data Data set. | [
"Log",
"query",
"result",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/DB.java#L479-L483 |
killbill/killbill | jaxrs/src/main/java/org/killbill/billing/jaxrs/json/OverdueJson.java | OverdueJson.computeReevaluationInterval | private static DefaultDuration computeReevaluationInterval(final Integer inputReevaluationInterval, int prevTimeSinceEarliestUnpaidInvoice, int curTimeSinceEarliestUnpaidInvoice) {
"""
Unless the user knows what it's doing (inputReevaluationInterval != null), for time based condition we set the reevaluation inter... | java | private static DefaultDuration computeReevaluationInterval(final Integer inputReevaluationInterval, int prevTimeSinceEarliestUnpaidInvoice, int curTimeSinceEarliestUnpaidInvoice) {
if (inputReevaluationInterval != null && inputReevaluationInterval > 0) {
return new DefaultDuration().setUnit(TimeUni... | [
"private",
"static",
"DefaultDuration",
"computeReevaluationInterval",
"(",
"final",
"Integer",
"inputReevaluationInterval",
",",
"int",
"prevTimeSinceEarliestUnpaidInvoice",
",",
"int",
"curTimeSinceEarliestUnpaidInvoice",
")",
"{",
"if",
"(",
"inputReevaluationInterval",
"!="... | Unless the user knows what it's doing (inputReevaluationInterval != null), for time based condition we set the reevaluation interval to match the transition to the next state | [
"Unless",
"the",
"user",
"knows",
"what",
"it",
"s",
"doing",
"(",
"inputReevaluationInterval",
"!",
"=",
"null",
")",
"for",
"time",
"based",
"condition",
"we",
"set",
"the",
"reevaluation",
"interval",
"to",
"match",
"the",
"transition",
"to",
"the",
"next... | train | https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/OverdueJson.java#L143-L155 |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java | JSONObject.putOpt | public JSONObject putOpt(String name, Object value) throws JSONException {
"""
Equivalent to {@code put(name, value)} when both parameters are non-null; does
nothing otherwise.
@param name the name of the property
@param value the value of the property
@return this object.
@throws JSONException if an error oc... | java | public JSONObject putOpt(String name, Object value) throws JSONException {
if (name == null || value == null) {
return this;
}
return put(name, value);
} | [
"public",
"JSONObject",
"putOpt",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"value",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"return",
"put",
"(",
"name",
",",... | Equivalent to {@code put(name, value)} when both parameters are non-null; does
nothing otherwise.
@param name the name of the property
@param value the value of the property
@return this object.
@throws JSONException if an error occurs | [
"Equivalent",
"to",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java#L284-L289 |
citrusframework/citrus | modules/citrus-http/src/main/java/com/consol/citrus/http/message/HttpMessage.java | HttpMessage.fromRequestData | public static HttpMessage fromRequestData(final String requestData) {
"""
Reads request from complete request dump.
@param requestData The request dump to parse
@return The parsed dump as HttpMessage
"""
try (final BufferedReader reader = new BufferedReader(new StringReader(requestData))) {
... | java | public static HttpMessage fromRequestData(final String requestData) {
try (final BufferedReader reader = new BufferedReader(new StringReader(requestData))) {
final HttpMessage request = new HttpMessage();
final String[] requestLine = reader.readLine().split("\\s");
if (reque... | [
"public",
"static",
"HttpMessage",
"fromRequestData",
"(",
"final",
"String",
"requestData",
")",
"{",
"try",
"(",
"final",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"StringReader",
"(",
"requestData",
")",
")",
")",
"{",
"final",
"... | Reads request from complete request dump.
@param requestData The request dump to parse
@return The parsed dump as HttpMessage | [
"Reads",
"request",
"from",
"complete",
"request",
"dump",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-http/src/main/java/com/consol/citrus/http/message/HttpMessage.java#L509-L530 |
VueGWT/vue-gwt | core/src/main/java/com/axellience/vuegwt/core/client/component/options/VueComponentOptions.java | VueComponentOptions.initData | @JsOverlay
public final void initData(boolean useFactory, Set<String> fieldNames) {
"""
Initialise the data structure, then set it to either a Factory or directly on the Component.
@param useFactory Boolean representing whether or not to use a Factory.
@param fieldNames Name of the data fields in the object
... | java | @JsOverlay
public final void initData(boolean useFactory, Set<String> fieldNames) {
JsPropertyMap<Object> dataFields = JsPropertyMap.of();
dataFieldsToProxy = new HashSet<>();
for (String fieldName : fieldNames) {
dataFields.set(fieldName, null);
// If field name starts with $ or _ Vue.js won... | [
"@",
"JsOverlay",
"public",
"final",
"void",
"initData",
"(",
"boolean",
"useFactory",
",",
"Set",
"<",
"String",
">",
"fieldNames",
")",
"{",
"JsPropertyMap",
"<",
"Object",
">",
"dataFields",
"=",
"JsPropertyMap",
".",
"of",
"(",
")",
";",
"dataFieldsToPro... | Initialise the data structure, then set it to either a Factory or directly on the Component.
@param useFactory Boolean representing whether or not to use a Factory.
@param fieldNames Name of the data fields in the object | [
"Initialise",
"the",
"data",
"structure",
"then",
"set",
"it",
"to",
"either",
"a",
"Factory",
"or",
"directly",
"on",
"the",
"Component",
"."
] | train | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/core/src/main/java/com/axellience/vuegwt/core/client/component/options/VueComponentOptions.java#L81-L100 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/auth/Auth.java | Auth.setupTable | public static void setupTable(String name, String cql) {
"""
Set up table from given CREATE TABLE statement under system_auth keyspace, if not already done so.
@param name name of the table
@param cql CREATE TABLE statement
"""
if (Schema.instance.getCFMetaData(AUTH_KS, name) == null)
{
... | java | public static void setupTable(String name, String cql)
{
if (Schema.instance.getCFMetaData(AUTH_KS, name) == null)
{
try
{
CFStatement parsed = (CFStatement)QueryProcessor.parseStatement(cql);
parsed.prepareKeyspace(AUTH_KS);
Cr... | [
"public",
"static",
"void",
"setupTable",
"(",
"String",
"name",
",",
"String",
"cql",
")",
"{",
"if",
"(",
"Schema",
".",
"instance",
".",
"getCFMetaData",
"(",
"AUTH_KS",
",",
"name",
")",
"==",
"null",
")",
"{",
"try",
"{",
"CFStatement",
"parsed",
... | Set up table from given CREATE TABLE statement under system_auth keyspace, if not already done so.
@param name name of the table
@param cql CREATE TABLE statement | [
"Set",
"up",
"table",
"from",
"given",
"CREATE",
"TABLE",
"statement",
"under",
"system_auth",
"keyspace",
"if",
"not",
"already",
"done",
"so",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/auth/Auth.java#L203-L221 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsfContainer_fat_2.3/fat/src/com/ibm/ws/jsf/container/fat/utils/JSFUtils.java | JSFUtils.createHttpUrlString | public static String createHttpUrlString(LibertyServer server, String contextRoot, String path) {
"""
Construct a URL for a test case so a request can be made.
@param server - The server that is under test, this is used to get the port and host name.
@param contextRoot - The context root of the application
@p... | java | public static String createHttpUrlString(LibertyServer server, String contextRoot, String path) {
StringBuilder sb = new StringBuilder();
sb.append("http://")
.append(server.getHostname())
.append(":")
.append(server.getHttpDefaultPort())
.append("/")
.... | [
"public",
"static",
"String",
"createHttpUrlString",
"(",
"LibertyServer",
"server",
",",
"String",
"contextRoot",
",",
"String",
"path",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"http://\"",
")",... | Construct a URL for a test case so a request can be made.
@param server - The server that is under test, this is used to get the port and host name.
@param contextRoot - The context root of the application
@param path - Additional path information for the request.
@return - A fully formed URL string.
@throws Exception | [
"Construct",
"a",
"URL",
"for",
"a",
"test",
"case",
"so",
"a",
"request",
"can",
"be",
"made",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsfContainer_fat_2.3/fat/src/com/ibm/ws/jsf/container/fat/utils/JSFUtils.java#L49-L62 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/BaseField.java | BaseField.createScreenComponent | public static ScreenComponent createScreenComponent(String componentType, ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String,Object> properties) {
"""
Create a screen component of this type.
@param componentType
@param itsLocation
@param targetScreen
@para... | java | public static ScreenComponent createScreenComponent(String componentType, ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String,Object> properties)
{
String screenFieldClass = null;
if (!componentType.contains("."))
screenFieldClass = S... | [
"public",
"static",
"ScreenComponent",
"createScreenComponent",
"(",
"String",
"componentType",
",",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Map",
"<",
"String",
",",
"Obje... | Create a screen component of this type.
@param componentType
@param itsLocation
@param targetScreen
@param convert
@param iDisplayFieldDesc
@param properties
@return | [
"Create",
"a",
"screen",
"component",
"of",
"this",
"type",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L1412-L1429 |
elki-project/elki | elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/vafile/VAFile.java | VAFile.calculateApproximation | public VectorApproximation calculateApproximation(DBID id, V dv) {
"""
Calculate the VA file position given the existing borders.
@param id Object ID
@param dv Data vector
@return Vector approximation
"""
int[] approximation = new int[dv.getDimensionality()];
for(int d = 0; d < splitPositions.leng... | java | public VectorApproximation calculateApproximation(DBID id, V dv) {
int[] approximation = new int[dv.getDimensionality()];
for(int d = 0; d < splitPositions.length; d++) {
final double val = dv.doubleValue(d);
final int lastBorderIndex = splitPositions[d].length - 1;
// Value is below data gri... | [
"public",
"VectorApproximation",
"calculateApproximation",
"(",
"DBID",
"id",
",",
"V",
"dv",
")",
"{",
"int",
"[",
"]",
"approximation",
"=",
"new",
"int",
"[",
"dv",
".",
"getDimensionality",
"(",
")",
"]",
";",
"for",
"(",
"int",
"d",
"=",
"0",
";",... | Calculate the VA file position given the existing borders.
@param id Object ID
@param dv Data vector
@return Vector approximation | [
"Calculate",
"the",
"VA",
"file",
"position",
"given",
"the",
"existing",
"borders",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/vafile/VAFile.java#L178-L205 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_account_primaryEmailAddress_alias_alias_GET | public OvhExchangeAccountAlias organizationName_service_exchangeService_account_primaryEmailAddress_alias_alias_GET(String organizationName, String exchangeService, String primaryEmailAddress, String alias) throws IOException {
"""
Get this object properties
REST: GET /email/exchange/{organizationName}/service/... | java | public OvhExchangeAccountAlias organizationName_service_exchangeService_account_primaryEmailAddress_alias_alias_GET(String organizationName, String exchangeService, String primaryEmailAddress, String alias) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/account/{prim... | [
"public",
"OvhExchangeAccountAlias",
"organizationName_service_exchangeService_account_primaryEmailAddress_alias_alias_GET",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"primaryEmailAddress",
",",
"String",
"alias",
")",
"throws",
"IOExceptio... | Get this object properties
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias/{alias}
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange service
@param primaryEma... | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L1673-L1678 |
infinispan/infinispan | lucene/directory-provider/src/main/java/org/infinispan/hibernate/search/impl/InfinispanConfigurationParser.java | InfinispanConfigurationParser.parseFile | public ConfigurationBuilderHolder parseFile(String filename, String transportOverrideResource, ServiceManager serviceManager) throws IOException {
"""
Resolves an Infinispan configuration file but using the Hibernate Search classloader. The returned Infinispan
configuration template also overrides Infinispan's ru... | java | public ConfigurationBuilderHolder parseFile(String filename, String transportOverrideResource, ServiceManager serviceManager) throws IOException {
ClassLoaderService classLoaderService = serviceManager.requestService(ClassLoaderService.class);
try {
return parseFile(classLoaderService, filename, tr... | [
"public",
"ConfigurationBuilderHolder",
"parseFile",
"(",
"String",
"filename",
",",
"String",
"transportOverrideResource",
",",
"ServiceManager",
"serviceManager",
")",
"throws",
"IOException",
"{",
"ClassLoaderService",
"classLoaderService",
"=",
"serviceManager",
".",
"r... | Resolves an Infinispan configuration file but using the Hibernate Search classloader. The returned Infinispan
configuration template also overrides Infinispan's runtime classloader to the one of Hibernate Search.
@param filename Infinispan configuration resource name
@param transportOverrideResource A... | [
"Resolves",
"an",
"Infinispan",
"configuration",
"file",
"but",
"using",
"the",
"Hibernate",
"Search",
"classloader",
".",
"The",
"returned",
"Infinispan",
"configuration",
"template",
"also",
"overrides",
"Infinispan",
"s",
"runtime",
"classloader",
"to",
"the",
"o... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/directory-provider/src/main/java/org/infinispan/hibernate/search/impl/InfinispanConfigurationParser.java#L44-L51 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/utils/IoBufferDecoder.java | IoBufferDecoder.setDelimiter | public void setDelimiter(byte[] delim, boolean resetMatchCount) {
"""
Dynamically sets a new delimiter. Next time
{@link IoBufferDecoder#decodeOnce(IoSession, int) } will be called it will use the new
delimiter. Delimiter matching is reset only if <tt>resetMatchCount</tt> is true but
decoding will continue from... | java | public void setDelimiter(byte[] delim, boolean resetMatchCount) {
if (delim == null) {
throw new NullPointerException("Null delimiter not allowed");
}
// Convert delimiter to IoBuffer.
IoBuffer delimiter = IoBuffer.allocate(delim.length);
delimiter.put(delim);
... | [
"public",
"void",
"setDelimiter",
"(",
"byte",
"[",
"]",
"delim",
",",
"boolean",
"resetMatchCount",
")",
"{",
"if",
"(",
"delim",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Null delimiter not allowed\"",
")",
";",
"}",
"// Convert... | Dynamically sets a new delimiter. Next time
{@link IoBufferDecoder#decodeOnce(IoSession, int) } will be called it will use the new
delimiter. Delimiter matching is reset only if <tt>resetMatchCount</tt> is true but
decoding will continue from current position.
NB : Delimiter {@link LineDelimiter#AUTO} is not allowed.
... | [
"Dynamically",
"sets",
"a",
"new",
"delimiter",
".",
"Next",
"time",
"{",
"@link",
"IoBufferDecoder#decodeOnce",
"(",
"IoSession",
"int",
")",
"}",
"will",
"be",
"called",
"it",
"will",
"use",
"the",
"new",
"delimiter",
".",
"Delimiter",
"matching",
"is",
"r... | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/utils/IoBufferDecoder.java#L157-L172 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenericGenbankHeaderFormat.java | GenericGenbankHeaderFormat._get_date | private String _get_date(S sequence) {
"""
/*
private String _write_multi_entries(String tag, ArrayList<String>
text_list) { String output = _write_single_line(tag,text_list.remove(0));
for(String s : text_list) { output += _write_single_line("", s); } return
output; }
"""
Date sysdate = Calendar.getInst... | java | private String _get_date(S sequence) {
Date sysdate = Calendar.getInstance().getTime();
// String default_date =
// sysdate.get(Calendar.DAY_OF_MONTH)+"-"+sysdate.get(Calendar.MONTH)+"-"+sysdate.get(Calendar.YEAR);
String default_date = new SimpleDateFormat("dd-MMM-yyyy")
.format(sysdate);
return default... | [
"private",
"String",
"_get_date",
"(",
"S",
"sequence",
")",
"{",
"Date",
"sysdate",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
".",
"getTime",
"(",
")",
";",
"// String default_date =",
"// sysdate.get(Calendar.DAY_OF_MONTH)+\"-\"+sysdate.get(Calendar.MONTH)+\"-\"+sy... | /*
private String _write_multi_entries(String tag, ArrayList<String>
text_list) { String output = _write_single_line(tag,text_list.remove(0));
for(String s : text_list) { output += _write_single_line("", s); } return
output; } | [
"/",
"*",
"private",
"String",
"_write_multi_entries",
"(",
"String",
"tag",
"ArrayList<String",
">",
"text_list",
")",
"{",
"String",
"output",
"=",
"_write_single_line",
"(",
"tag",
"text_list",
".",
"remove",
"(",
"0",
"))",
";",
"for",
"(",
"String",
"s"... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenericGenbankHeaderFormat.java#L94-L113 |
aws/aws-sdk-java | aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/AddMetadata.java | AddMetadata.getServiceIdIfNotProvided | private static String getServiceIdIfNotProvided(ServiceMetadata metadata, String interfaceName) {
"""
/*
Get the serviceId from the map if it's missing from metadata.
"""
if (INTERFACE_NAME_TO_SERVICE_ID.containsKey(interfaceName)) {
return INTERFACE_NAME_TO_SERVICE_ID.get(interfaceName);
... | java | private static String getServiceIdIfNotProvided(ServiceMetadata metadata, String interfaceName) {
if (INTERFACE_NAME_TO_SERVICE_ID.containsKey(interfaceName)) {
return INTERFACE_NAME_TO_SERVICE_ID.get(interfaceName);
}
String serviceId = metadata.getServiceId();
if (service... | [
"private",
"static",
"String",
"getServiceIdIfNotProvided",
"(",
"ServiceMetadata",
"metadata",
",",
"String",
"interfaceName",
")",
"{",
"if",
"(",
"INTERFACE_NAME_TO_SERVICE_ID",
".",
"containsKey",
"(",
"interfaceName",
")",
")",
"{",
"return",
"INTERFACE_NAME_TO_SER... | /*
Get the serviceId from the map if it's missing from metadata. | [
"/",
"*",
"Get",
"the",
"serviceId",
"from",
"the",
"map",
"if",
"it",
"s",
"missing",
"from",
"metadata",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/AddMetadata.java#L159-L171 |
strator-dev/greenpepper | greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Repository.java | Repository.addRequirement | public void addRequirement(Requirement requirement) throws GreenPepperServerException {
"""
<p>addRequirement.</p>
@param requirement a {@link com.greenpepper.server.domain.Requirement} object.
@throws com.greenpepper.server.GreenPepperServerException if any.
"""
if(requirements.contains(requiremen... | java | public void addRequirement(Requirement requirement) throws GreenPepperServerException
{
if(requirements.contains(requirement) || requirementNameExists(requirement.getName()))
throw new GreenPepperServerException( GreenPepperServerErrorKey.REQUIREMENT_ALREADY_EXISTS, "Requirement already exists")... | [
"public",
"void",
"addRequirement",
"(",
"Requirement",
"requirement",
")",
"throws",
"GreenPepperServerException",
"{",
"if",
"(",
"requirements",
".",
"contains",
"(",
"requirement",
")",
"||",
"requirementNameExists",
"(",
"requirement",
".",
"getName",
"(",
")",... | <p>addRequirement.</p>
@param requirement a {@link com.greenpepper.server.domain.Requirement} object.
@throws com.greenpepper.server.GreenPepperServerException if any. | [
"<p",
">",
"addRequirement",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Repository.java#L348-L355 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java | ComponentFactory.newFragment | public static Fragment newFragment(final String id, final String markupId,
final MarkupContainer markupProvider) {
"""
Factory method for create a new {@link Fragment}.
@param id
the id
@param markupId
The associated id of the associated markup fragment
@param markupProvider
The component whose markup co... | java | public static Fragment newFragment(final String id, final String markupId,
final MarkupContainer markupProvider)
{
return newFragment(id, markupId, markupProvider, null);
} | [
"public",
"static",
"Fragment",
"newFragment",
"(",
"final",
"String",
"id",
",",
"final",
"String",
"markupId",
",",
"final",
"MarkupContainer",
"markupProvider",
")",
"{",
"return",
"newFragment",
"(",
"id",
",",
"markupId",
",",
"markupProvider",
",",
"null",... | Factory method for create a new {@link Fragment}.
@param id
the id
@param markupId
The associated id of the associated markup fragment
@param markupProvider
The component whose markup contains the fragment's markup
@return The new {@link Fragment}. | [
"Factory",
"method",
"for",
"create",
"a",
"new",
"{",
"@link",
"Fragment",
"}",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java#L315-L319 |
yidongnan/grpc-spring-boot-starter | grpc-client-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/security/CallCredentialsHelper.java | CallCredentialsHelper.encodeBasicAuth | public static String encodeBasicAuth(final String username, final String password) {
"""
Encodes the given username and password as basic auth. The header value will be encoded with
{@link StandardCharsets#UTF_8 UTF_8}.
@param username The username to use.
@param password The password to use.
@return The enc... | java | public static String encodeBasicAuth(final String username, final String password) {
requireNonNull(username, "username");
requireNonNull(password, "password");
final String auth = username + ':' + password;
byte[] encoded;
try {
encoded = Base64.getEncoder().encode(a... | [
"public",
"static",
"String",
"encodeBasicAuth",
"(",
"final",
"String",
"username",
",",
"final",
"String",
"password",
")",
"{",
"requireNonNull",
"(",
"username",
",",
"\"username\"",
")",
";",
"requireNonNull",
"(",
"password",
",",
"\"password\"",
")",
";",... | Encodes the given username and password as basic auth. The header value will be encoded with
{@link StandardCharsets#UTF_8 UTF_8}.
@param username The username to use.
@param password The password to use.
@return The encoded basic auth header value. | [
"Encodes",
"the",
"given",
"username",
"and",
"password",
"as",
"basic",
"auth",
".",
"The",
"header",
"value",
"will",
"be",
"encoded",
"with",
"{",
"@link",
"StandardCharsets#UTF_8",
"UTF_8",
"}",
"."
] | train | https://github.com/yidongnan/grpc-spring-boot-starter/blob/07f8853cfafc9707584f2371aff012e590217b85/grpc-client-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/security/CallCredentialsHelper.java#L201-L212 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.serviceName_pca_pcaServiceName_sessions_sessionId_files_fileId_GET | public OvhFile serviceName_pca_pcaServiceName_sessions_sessionId_files_fileId_GET(String serviceName, String pcaServiceName, String sessionId, String fileId) throws IOException {
"""
Get this object properties
REST: GET /cloud/{serviceName}/pca/{pcaServiceName}/sessions/{sessionId}/files/{fileId}
@param servic... | java | public OvhFile serviceName_pca_pcaServiceName_sessions_sessionId_files_fileId_GET(String serviceName, String pcaServiceName, String sessionId, String fileId) throws IOException {
String qPath = "/cloud/{serviceName}/pca/{pcaServiceName}/sessions/{sessionId}/files/{fileId}";
StringBuilder sb = path(qPath, serviceNam... | [
"public",
"OvhFile",
"serviceName_pca_pcaServiceName_sessions_sessionId_files_fileId_GET",
"(",
"String",
"serviceName",
",",
"String",
"pcaServiceName",
",",
"String",
"sessionId",
",",
"String",
"fileId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cl... | Get this object properties
REST: GET /cloud/{serviceName}/pca/{pcaServiceName}/sessions/{sessionId}/files/{fileId}
@param serviceName [required] The internal name of your public cloud passport
@param pcaServiceName [required] The internal name of your PCA offer
@param sessionId [required] Session ID
@param fileId [req... | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2515-L2520 |
graphql-java/graphql-java | src/main/java/graphql/schema/idl/SchemaTypeChecker.java | SchemaTypeChecker.checkDeprecatedDirective | static void checkDeprecatedDirective(List<GraphQLError> errors, Directive directive, Supplier<InvalidDeprecationDirectiveError> errorSupplier) {
"""
A special check for the magic @deprecated directive
@param errors the list of errors
@param directive the directive to check
@param errorSupplier the ... | java | static void checkDeprecatedDirective(List<GraphQLError> errors, Directive directive, Supplier<InvalidDeprecationDirectiveError> errorSupplier) {
if ("deprecated".equals(directive.getName())) {
// it can have zero args
List<Argument> arguments = directive.getArguments();
if (a... | [
"static",
"void",
"checkDeprecatedDirective",
"(",
"List",
"<",
"GraphQLError",
">",
"errors",
",",
"Directive",
"directive",
",",
"Supplier",
"<",
"InvalidDeprecationDirectiveError",
">",
"errorSupplier",
")",
"{",
"if",
"(",
"\"deprecated\"",
".",
"equals",
"(",
... | A special check for the magic @deprecated directive
@param errors the list of errors
@param directive the directive to check
@param errorSupplier the error supplier function | [
"A",
"special",
"check",
"for",
"the",
"magic",
"@deprecated",
"directive"
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/schema/idl/SchemaTypeChecker.java#L347-L364 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/CoronaConf.java | CoronaConf.getPoolInfo | public PoolInfo getPoolInfo() {
"""
Get the pool info. In order to support previous behavior, a single pool
name is accepted.
@return Pool info, using a default pool group if the
explicit pool can not be found
"""
String poolNameProperty = get(IMPLICIT_POOL_PROPERTY, "user.name");
String explicitPo... | java | public PoolInfo getPoolInfo() {
String poolNameProperty = get(IMPLICIT_POOL_PROPERTY, "user.name");
String explicitPool =
get(EXPLICIT_POOL_PROPERTY, get(poolNameProperty, "")).trim();
String[] poolInfoSplitString = explicitPool.split("[.]");
if (poolInfoSplitString != null && poolInfoSplitStrin... | [
"public",
"PoolInfo",
"getPoolInfo",
"(",
")",
"{",
"String",
"poolNameProperty",
"=",
"get",
"(",
"IMPLICIT_POOL_PROPERTY",
",",
"\"user.name\"",
")",
";",
"String",
"explicitPool",
"=",
"get",
"(",
"EXPLICIT_POOL_PROPERTY",
",",
"get",
"(",
"poolNameProperty",
"... | Get the pool info. In order to support previous behavior, a single pool
name is accepted.
@return Pool info, using a default pool group if the
explicit pool can not be found | [
"Get",
"the",
"pool",
"info",
".",
"In",
"order",
"to",
"support",
"previous",
"behavior",
"a",
"single",
"pool",
"name",
"is",
"accepted",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/CoronaConf.java#L376-L388 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/Parameters.java | Parameters.setDictionary | @NonNull
public Parameters setDictionary(@NonNull String name, Dictionary value) {
"""
Set the Dictionary value to the query parameter referenced by the given name. A query parameter
is defined by using the Expression's parameter(String name) function.
@param name The parameter name.
@param value The Dic... | java | @NonNull
public Parameters setDictionary(@NonNull String name, Dictionary value) {
return setValue(name, value);
} | [
"@",
"NonNull",
"public",
"Parameters",
"setDictionary",
"(",
"@",
"NonNull",
"String",
"name",
",",
"Dictionary",
"value",
")",
"{",
"return",
"setValue",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Set the Dictionary value to the query parameter referenced by the given name. A query parameter
is defined by using the Expression's parameter(String name) function.
@param name The parameter name.
@param value The Dictionary value.
@return The self object. | [
"Set",
"the",
"Dictionary",
"value",
"to",
"the",
"query",
"parameter",
"referenced",
"by",
"the",
"given",
"name",
".",
"A",
"query",
"parameter",
"is",
"defined",
"by",
"using",
"the",
"Expression",
"s",
"parameter",
"(",
"String",
"name",
")",
"function",... | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Parameters.java#L196-L199 |
arakelian/more-commons | src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java | XmlStreamReaderUtils.requiredFloatAttribute | public static float requiredFloatAttribute(final XMLStreamReader reader, final String localName)
throws XMLStreamException {
"""
Returns the value of an attribute as a float. If the attribute is empty, this method throws
an exception.
@param reader
<code>XMLStreamReader</code> that contains attrib... | java | public static float requiredFloatAttribute(final XMLStreamReader reader, final String localName)
throws XMLStreamException {
return requiredFloatAttribute(reader, null, localName);
} | [
"public",
"static",
"float",
"requiredFloatAttribute",
"(",
"final",
"XMLStreamReader",
"reader",
",",
"final",
"String",
"localName",
")",
"throws",
"XMLStreamException",
"{",
"return",
"requiredFloatAttribute",
"(",
"reader",
",",
"null",
",",
"localName",
")",
";... | Returns the value of an attribute as a float. If the attribute is empty, this method throws
an exception.
@param reader
<code>XMLStreamReader</code> that contains attribute values.
@param localName
local name of attribute (the namespace is ignored).
@return value of attribute as float
@throws XMLStreamException
if att... | [
"Returns",
"the",
"value",
"of",
"an",
"attribute",
"as",
"a",
"float",
".",
"If",
"the",
"attribute",
"is",
"empty",
"this",
"method",
"throws",
"an",
"exception",
"."
] | train | https://github.com/arakelian/more-commons/blob/83c607044f64a7f6c005a67866c0ef7cb68d6e29/src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java#L1174-L1177 |
pietermartin/sqlg | sqlg-core/src/main/java/org/umlg/sqlg/structure/SqlgStartupManager.java | SqlgStartupManager.createOrUpdateGraph | private String createOrUpdateGraph(String version) {
"""
create or update the graph metadata
@param version the new version of the graph
@return the old version of the graph, or null if there was no graph
"""
String oldVersion = null;
Connection conn = this.sqlgGraph.tx().getConnection();
... | java | private String createOrUpdateGraph(String version) {
String oldVersion = null;
Connection conn = this.sqlgGraph.tx().getConnection();
try {
DatabaseMetaData metadata = conn.getMetaData();
String[] types = new String[]{"TABLE"};
//load the vertices
... | [
"private",
"String",
"createOrUpdateGraph",
"(",
"String",
"version",
")",
"{",
"String",
"oldVersion",
"=",
"null",
";",
"Connection",
"conn",
"=",
"this",
".",
"sqlgGraph",
".",
"tx",
"(",
")",
".",
"getConnection",
"(",
")",
";",
"try",
"{",
"DatabaseMe... | create or update the graph metadata
@param version the new version of the graph
@return the old version of the graph, or null if there was no graph | [
"create",
"or",
"update",
"the",
"graph",
"metadata"
] | train | https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/structure/SqlgStartupManager.java#L176-L214 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SystemProcessingTimeService.java | SystemProcessingTimeService.registerTimer | @Override
public ScheduledFuture<?> registerTimer(long timestamp, ProcessingTimeCallback target) {
"""
Registers a task to be executed no sooner than time {@code timestamp}, but without strong
guarantees of order.
@param timestamp Time when the task is to be enabled (in processing time)
@param target The ... | java | @Override
public ScheduledFuture<?> registerTimer(long timestamp, ProcessingTimeCallback target) {
// delay the firing of the timer by 1 ms to align the semantics with watermark. A watermark
// T says we won't see elements in the future with a timestamp smaller or equal to T.
// With processing time, we therefo... | [
"@",
"Override",
"public",
"ScheduledFuture",
"<",
"?",
">",
"registerTimer",
"(",
"long",
"timestamp",
",",
"ProcessingTimeCallback",
"target",
")",
"{",
"// delay the firing of the timer by 1 ms to align the semantics with watermark. A watermark",
"// T says we won't see elements... | Registers a task to be executed no sooner than time {@code timestamp}, but without strong
guarantees of order.
@param timestamp Time when the task is to be enabled (in processing time)
@param target The task to be executed
@return The future that represents the scheduled task. This always returns some future,
even ... | [
"Registers",
"a",
"task",
"to",
"be",
"executed",
"no",
"sooner",
"than",
"time",
"{",
"@code",
"timestamp",
"}",
"but",
"without",
"strong",
"guarantees",
"of",
"order",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SystemProcessingTimeService.java#L110-L137 |
attribyte/wpdb | src/main/java/org/attribyte/wp/db/DB.java | DB.clearPostTerm | public void clearPostTerm(final long postId, final long taxonomyTermId) throws SQLException {
"""
Clears a single taxonomy term associated with a post.
@param postId The post id.
@param taxonomyTermId The taxonomy term id.
@throws SQLException on database error.
"""
Connection conn = null;
Prepa... | java | public void clearPostTerm(final long postId, final long taxonomyTermId) throws SQLException {
Connection conn = null;
PreparedStatement stmt = null;
Timer.Context ctx = metrics.postTermsClearTimer.time();
try {
conn = connectionSupplier.getConnection();
stmt = conn.prepareState... | [
"public",
"void",
"clearPostTerm",
"(",
"final",
"long",
"postId",
",",
"final",
"long",
"taxonomyTermId",
")",
"throws",
"SQLException",
"{",
"Connection",
"conn",
"=",
"null",
";",
"PreparedStatement",
"stmt",
"=",
"null",
";",
"Timer",
".",
"Context",
"ctx"... | Clears a single taxonomy term associated with a post.
@param postId The post id.
@param taxonomyTermId The taxonomy term id.
@throws SQLException on database error. | [
"Clears",
"a",
"single",
"taxonomy",
"term",
"associated",
"with",
"a",
"post",
"."
] | train | https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/db/DB.java#L2468-L2482 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/BadSyntaxForRegularExpression.java | BadSyntaxForRegularExpression.getIntValue | private int getIntValue(int stackDepth, int defaultValue) {
"""
return an int on the stack, or 'defaultValue' if can't determine
"""
if (stack.getStackDepth() < stackDepth) {
return defaultValue;
}
OpcodeStack.Item it = stack.getStackItem(stackDepth);
Object value = ... | java | private int getIntValue(int stackDepth, int defaultValue) {
if (stack.getStackDepth() < stackDepth) {
return defaultValue;
}
OpcodeStack.Item it = stack.getStackItem(stackDepth);
Object value = it.getConstant();
if (!(value instanceof Integer)) {
return de... | [
"private",
"int",
"getIntValue",
"(",
"int",
"stackDepth",
",",
"int",
"defaultValue",
")",
"{",
"if",
"(",
"stack",
".",
"getStackDepth",
"(",
")",
"<",
"stackDepth",
")",
"{",
"return",
"defaultValue",
";",
"}",
"OpcodeStack",
".",
"Item",
"it",
"=",
"... | return an int on the stack, or 'defaultValue' if can't determine | [
"return",
"an",
"int",
"on",
"the",
"stack",
"or",
"defaultValue",
"if",
"can",
"t",
"determine"
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/BadSyntaxForRegularExpression.java#L119-L129 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.newObjectInputStream | public static ObjectInputStream newObjectInputStream(File file, final ClassLoader classLoader) throws IOException {
"""
Create an object input stream for this file using the given class loader.
@param file a file
@param classLoader the class loader to use when loading the class
@return an object input ... | java | public static ObjectInputStream newObjectInputStream(File file, final ClassLoader classLoader) throws IOException {
return IOGroovyMethods.newObjectInputStream(new FileInputStream(file), classLoader);
} | [
"public",
"static",
"ObjectInputStream",
"newObjectInputStream",
"(",
"File",
"file",
",",
"final",
"ClassLoader",
"classLoader",
")",
"throws",
"IOException",
"{",
"return",
"IOGroovyMethods",
".",
"newObjectInputStream",
"(",
"new",
"FileInputStream",
"(",
"file",
"... | Create an object input stream for this file using the given class loader.
@param file a file
@param classLoader the class loader to use when loading the class
@return an object input stream
@throws IOException if an IOException occurs.
@since 1.5.0 | [
"Create",
"an",
"object",
"input",
"stream",
"for",
"this",
"file",
"using",
"the",
"given",
"class",
"loader",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L174-L176 |
davidcarboni-archive/httpino | src/main/java/com/github/davidcarboni/httpino/Endpoint.java | Endpoint.setParameter | public Endpoint setParameter(String name, Object value) {
"""
Creates a new {@link Endpoint} instance with an additional GET parameter.
Typical usage is to add a request-specific parameter to an endpoint, which is why this method returns a new instance, rather than modifying the existing one.
This allows you a... | java | public Endpoint setParameter(String name, Object value) {
Endpoint configured = new Endpoint(this);
if (StringUtils.isNotBlank(name) && value != null) {
configured.parameters.put(name, value.toString());
}
return configured;
} | [
"public",
"Endpoint",
"setParameter",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"Endpoint",
"configured",
"=",
"new",
"Endpoint",
"(",
"this",
")",
";",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"name",
")",
"&&",
"value",
"!=",
"n... | Creates a new {@link Endpoint} instance with an additional GET parameter.
Typical usage is to add a request-specific parameter to an endpoint, which is why this method returns a new instance, rather than modifying the existing one.
This allows you add different parameters/values at different times without affecting th... | [
"Creates",
"a",
"new",
"{",
"@link",
"Endpoint",
"}",
"instance",
"with",
"an",
"additional",
"GET",
"parameter",
"."
] | train | https://github.com/davidcarboni-archive/httpino/blob/a78c91874e6d9b2e452cf3aa68d4fea804d977ca/src/main/java/com/github/davidcarboni/httpino/Endpoint.java#L74-L80 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201811/inventoryservice/GetTopLevelAdUnits.java | GetTopLevelAdUnits.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 InventoryService.
InventoryServiceInterface inventoryService =
adManagerServices.get(session, InventoryServiceInterface.class);
// Get the NetworkService.
Netwo... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"// Get the InventoryService.",
"InventoryServiceInterface",
"inventoryService",
"=",
"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/v201811/inventoryservice/GetTopLevelAdUnits.java#L53-L95 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/services/path/PathManagerService.java | PathManagerService.removePathEntry | final void removePathEntry(final String pathName, boolean check) throws OperationFailedException {
"""
Removes the entry for a path and sends an {@link org.jboss.as.controller.services.path.PathManager.Event#REMOVED}
notification to any registered
{@linkplain org.jboss.as.controller.services.path.PathManager.Cal... | java | final void removePathEntry(final String pathName, boolean check) throws OperationFailedException{
synchronized (pathEntries) {
PathEntry pathEntry = pathEntries.get(pathName);
if (pathEntry.isReadOnly()) {
throw ControllerLogger.ROOT_LOGGER.pathEntryIsReadOnly(pathName);
... | [
"final",
"void",
"removePathEntry",
"(",
"final",
"String",
"pathName",
",",
"boolean",
"check",
")",
"throws",
"OperationFailedException",
"{",
"synchronized",
"(",
"pathEntries",
")",
"{",
"PathEntry",
"pathEntry",
"=",
"pathEntries",
".",
"get",
"(",
"pathName"... | Removes the entry for a path and sends an {@link org.jboss.as.controller.services.path.PathManager.Event#REMOVED}
notification to any registered
{@linkplain org.jboss.as.controller.services.path.PathManager.Callback#pathEvent(Event, PathEntry) callbacks}.
@param pathName the logical name of the path within the model. C... | [
"Removes",
"the",
"entry",
"for",
"a",
"path",
"and",
"sends",
"an",
"{"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/services/path/PathManagerService.java#L224-L247 |
graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/shapes/BBox.java | BBox.parseTwoPoints | public static BBox parseTwoPoints(String objectAsString) {
"""
This method creates a BBox out of a string in format lat1,lon1,lat2,lon2
"""
String[] splittedObject = objectAsString.split(",");
if (splittedObject.length != 4)
throw new IllegalArgumentException("BBox should have 4 pa... | java | public static BBox parseTwoPoints(String objectAsString) {
String[] splittedObject = objectAsString.split(",");
if (splittedObject.length != 4)
throw new IllegalArgumentException("BBox should have 4 parts but was " + objectAsString);
double minLat = Double.parseDouble(splittedObjec... | [
"public",
"static",
"BBox",
"parseTwoPoints",
"(",
"String",
"objectAsString",
")",
"{",
"String",
"[",
"]",
"splittedObject",
"=",
"objectAsString",
".",
"split",
"(",
"\",\"",
")",
";",
"if",
"(",
"splittedObject",
".",
"length",
"!=",
"4",
")",
"throw",
... | This method creates a BBox out of a string in format lat1,lon1,lat2,lon2 | [
"This",
"method",
"creates",
"a",
"BBox",
"out",
"of",
"a",
"string",
"in",
"format",
"lat1",
"lon1",
"lat2",
"lon2"
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/shapes/BBox.java#L304-L329 |
Netflix/Turbine | turbine-core/src/main/java/com/netflix/turbine/aggregator/NumberList.java | NumberList.delta | @SuppressWarnings("unchecked")
public static NumberList delta(NumberList currentMap, NumberList previousMap) {
"""
unchecked but we know we can go from Map<String, Long> to Map<String, Object>
"""
return delta((Map)currentMap.numbers, (Map)previousMap.numbers);
} | java | @SuppressWarnings("unchecked")
public static NumberList delta(NumberList currentMap, NumberList previousMap) {
return delta((Map)currentMap.numbers, (Map)previousMap.numbers);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"NumberList",
"delta",
"(",
"NumberList",
"currentMap",
",",
"NumberList",
"previousMap",
")",
"{",
"return",
"delta",
"(",
"(",
"Map",
")",
"currentMap",
".",
"numbers",
",",
"(",
"Map",
... | unchecked but we know we can go from Map<String, Long> to Map<String, Object> | [
"unchecked",
"but",
"we",
"know",
"we",
"can",
"go",
"from",
"Map<String",
"Long",
">",
"to",
"Map<String",
"Object",
">"
] | train | https://github.com/Netflix/Turbine/blob/0e924058aa4d1d526310206a51dcf82f65274d58/turbine-core/src/main/java/com/netflix/turbine/aggregator/NumberList.java#L53-L56 |
twilio/twilio-java | src/main/java/com/twilio/base/Reader.java | Reader.previousPage | public Page<T> previousPage(final Page<T> page) {
"""
Fetch the prior page of resources.
@param page current page of resources
@return Page containing the previous pageSize of resources
"""
return previousPage(page, Twilio.getRestClient());
} | java | public Page<T> previousPage(final Page<T> page) {
return previousPage(page, Twilio.getRestClient());
} | [
"public",
"Page",
"<",
"T",
">",
"previousPage",
"(",
"final",
"Page",
"<",
"T",
">",
"page",
")",
"{",
"return",
"previousPage",
"(",
"page",
",",
"Twilio",
".",
"getRestClient",
"(",
")",
")",
";",
"}"
] | Fetch the prior page of resources.
@param page current page of resources
@return Page containing the previous pageSize of resources | [
"Fetch",
"the",
"prior",
"page",
"of",
"resources",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/base/Reader.java#L120-L122 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.telephony_defaultIpRestriction_POST | public OvhDefaultIpRestriction telephony_defaultIpRestriction_POST(String subnet, OvhProtocolEnum type) throws IOException {
"""
Create a default IP restriction for your future VoIP lines
REST: POST /me/telephony/defaultIpRestriction
@param subnet [required] The IPv4 subnet you want to allow
@param type [requ... | java | public OvhDefaultIpRestriction telephony_defaultIpRestriction_POST(String subnet, OvhProtocolEnum type) throws IOException {
String qPath = "/me/telephony/defaultIpRestriction";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "subnet", subnet);
addBody(o, "... | [
"public",
"OvhDefaultIpRestriction",
"telephony_defaultIpRestriction_POST",
"(",
"String",
"subnet",
",",
"OvhProtocolEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/telephony/defaultIpRestriction\"",
";",
"StringBuilder",
"sb",
"=",
"path",... | Create a default IP restriction for your future VoIP lines
REST: POST /me/telephony/defaultIpRestriction
@param subnet [required] The IPv4 subnet you want to allow
@param type [required] The protocol you want to restrict (sip/mgcp) | [
"Create",
"a",
"default",
"IP",
"restriction",
"for",
"your",
"future",
"VoIP",
"lines"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1761-L1769 |
mp911de/spinach | src/main/java/biz/paluch/spinach/cluster/QueueListener.java | QueueListener.call | @Override
public void call(Subscriber<? super Job<K, V>> subscriber) {
"""
Setup subscriptions when the Observable subscription is set up.
@param subscriber the subscriber
"""
log.debug("onSubscribe()");
if (subscriber.isUnsubscribed()) {
return;
}
String su... | java | @Override
public void call(Subscriber<? super Job<K, V>> subscriber) {
log.debug("onSubscribe()");
if (subscriber.isUnsubscribed()) {
return;
}
String subscriberId = getClass().getSimpleName() + "-" + id + "-" + subscriberIds.incrementAndGet();
subscriber.onStar... | [
"@",
"Override",
"public",
"void",
"call",
"(",
"Subscriber",
"<",
"?",
"super",
"Job",
"<",
"K",
",",
"V",
">",
">",
"subscriber",
")",
"{",
"log",
".",
"debug",
"(",
"\"onSubscribe()\"",
")",
";",
"if",
"(",
"subscriber",
".",
"isUnsubscribed",
"(",
... | Setup subscriptions when the Observable subscription is set up.
@param subscriber the subscriber | [
"Setup",
"subscriptions",
"when",
"the",
"Observable",
"subscription",
"is",
"set",
"up",
"."
] | train | https://github.com/mp911de/spinach/blob/ca8081f52de17c46dce6ffdcb519eec600c5c93d/src/main/java/biz/paluch/spinach/cluster/QueueListener.java#L79-L114 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.getAccountAdjustments | public Adjustments getAccountAdjustments(final String accountCode, final Adjustments.AdjustmentType type, final Adjustments.AdjustmentState state) {
"""
Get Account Adjustments
<p>
@param accountCode recurly account id
@param type {@link com.ning.billing.recurly.model.Adjustments.AdjustmentType}
@param state... | java | public Adjustments getAccountAdjustments(final String accountCode, final Adjustments.AdjustmentType type, final Adjustments.AdjustmentState state) {
return getAccountAdjustments(accountCode, type, state, new QueryParams());
} | [
"public",
"Adjustments",
"getAccountAdjustments",
"(",
"final",
"String",
"accountCode",
",",
"final",
"Adjustments",
".",
"AdjustmentType",
"type",
",",
"final",
"Adjustments",
".",
"AdjustmentState",
"state",
")",
"{",
"return",
"getAccountAdjustments",
"(",
"accoun... | Get Account Adjustments
<p>
@param accountCode recurly account id
@param type {@link com.ning.billing.recurly.model.Adjustments.AdjustmentType}
@param state {@link com.ning.billing.recurly.model.Adjustments.AdjustmentState}
@return the adjustments on the account | [
"Get",
"Account",
"Adjustments",
"<p",
">"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L400-L402 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/ReflectionUtil.java | ReflectionUtil.getAnnotation | public static <T extends Annotation> T getAnnotation(Method method, Class<T> type) {
"""
Returns the first {@link Annotation} of the given type
defined on the given {@link Method}.
@param <T> the type
@param method the method
@param type the type of annotation
@return the annotation or null
"""
f... | java | public static <T extends Annotation> T getAnnotation(Method method, Class<T> type) {
for (Annotation a : getAnnotations(method)) {
if (type.isInstance(a)) {
return type.cast(a);
}
}
return null;
} | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"getAnnotation",
"(",
"Method",
"method",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"for",
"(",
"Annotation",
"a",
":",
"getAnnotations",
"(",
"method",
")",
")",
"{",
"if",
"(",
"... | Returns the first {@link Annotation} of the given type
defined on the given {@link Method}.
@param <T> the type
@param method the method
@param type the type of annotation
@return the annotation or null | [
"Returns",
"the",
"first",
"{",
"@link",
"Annotation",
"}",
"of",
"the",
"given",
"type",
"defined",
"on",
"the",
"given",
"{",
"@link",
"Method",
"}",
"."
] | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/ReflectionUtil.java#L134-L141 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnsessionpolicy_binding.java | vpnsessionpolicy_binding.get | public static vpnsessionpolicy_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch vpnsessionpolicy_binding resource of given name .
"""
vpnsessionpolicy_binding obj = new vpnsessionpolicy_binding();
obj.set_name(name);
vpnsessionpolicy_binding response = (vpnsess... | java | public static vpnsessionpolicy_binding get(nitro_service service, String name) throws Exception{
vpnsessionpolicy_binding obj = new vpnsessionpolicy_binding();
obj.set_name(name);
vpnsessionpolicy_binding response = (vpnsessionpolicy_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"vpnsessionpolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"vpnsessionpolicy_binding",
"obj",
"=",
"new",
"vpnsessionpolicy_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"... | Use this API to fetch vpnsessionpolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"vpnsessionpolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnsessionpolicy_binding.java#L136-L141 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java | AllClassesFrameWriter.addContents | protected void addContents(List<Doc> classlist, boolean wantFrames,
Content content) {
"""
Given a list of classes, generate links for each class or interface.
If the class kind is interface, print it in the italics font. Also all
links should target the right-hand frame. If clicked on any class name... | java | protected void addContents(List<Doc> classlist, boolean wantFrames,
Content content) {
for (int i = 0; i < classlist.size(); i++) {
ClassDoc cd = (ClassDoc)classlist.get(i);
if (!Util.isCoreClass(cd)) {
continue;
}
Content label = itali... | [
"protected",
"void",
"addContents",
"(",
"List",
"<",
"Doc",
">",
"classlist",
",",
"boolean",
"wantFrames",
",",
"Content",
"content",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"classlist",
".",
"size",
"(",
")",
";",
"i",
"++",
"... | Given a list of classes, generate links for each class or interface.
If the class kind is interface, print it in the italics font. Also all
links should target the right-hand frame. If clicked on any class name
in this page, appropriate class page should get opened in the right-hand
frame.
@param classlist Sorted list... | [
"Given",
"a",
"list",
"of",
"classes",
"generate",
"links",
"for",
"each",
"class",
"or",
"interface",
".",
"If",
"the",
"class",
"kind",
"is",
"interface",
"print",
"it",
"in",
"the",
"italics",
"font",
".",
"Also",
"all",
"links",
"should",
"target",
"... | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java#L152-L170 |
mikepenz/FastAdapter | app/src/main/java/com/mikepenz/fastadapter/app/items/SwipeableItem.java | SwipeableItem.bindView | @Override
public void bindView(ViewHolder viewHolder, List<Object> payloads) {
"""
binds the data of this item onto the viewHolder
@param viewHolder the viewHolder of this item
"""
super.bindView(viewHolder, payloads);
//set the text for the name
StringHolder.applyTo(name, viewH... | java | @Override
public void bindView(ViewHolder viewHolder, List<Object> payloads) {
super.bindView(viewHolder, payloads);
//set the text for the name
StringHolder.applyTo(name, viewHolder.name);
//set the text for the description or hide
StringHolder.applyToOrHide(description, vi... | [
"@",
"Override",
"public",
"void",
"bindView",
"(",
"ViewHolder",
"viewHolder",
",",
"List",
"<",
"Object",
">",
"payloads",
")",
"{",
"super",
".",
"bindView",
"(",
"viewHolder",
",",
"payloads",
")",
";",
"//set the text for the name",
"StringHolder",
".",
"... | binds the data of this item onto the viewHolder
@param viewHolder the viewHolder of this item | [
"binds",
"the",
"data",
"of",
"this",
"item",
"onto",
"the",
"viewHolder"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/app/src/main/java/com/mikepenz/fastadapter/app/items/SwipeableItem.java#L115-L137 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/TSNE.java | TSNE.sqDist | protected double sqDist(double[] v1, double[] v2) {
"""
Squared distance, in projection space.
@param v1 First vector
@param v2 Second vector
@return Squared distance
"""
assert (v1.length == v2.length) : "Lengths do not agree: " + v1.length + " " + v2.length;
double sum = 0;
for(int i = 0; i ... | java | protected double sqDist(double[] v1, double[] v2) {
assert (v1.length == v2.length) : "Lengths do not agree: " + v1.length + " " + v2.length;
double sum = 0;
for(int i = 0; i < v1.length; i++) {
final double diff = v1[i] - v2[i];
sum += diff * diff;
}
++projectedDistances;
return sum... | [
"protected",
"double",
"sqDist",
"(",
"double",
"[",
"]",
"v1",
",",
"double",
"[",
"]",
"v2",
")",
"{",
"assert",
"(",
"v1",
".",
"length",
"==",
"v2",
".",
"length",
")",
":",
"\"Lengths do not agree: \"",
"+",
"v1",
".",
"length",
"+",
"\" \"",
"+... | Squared distance, in projection space.
@param v1 First vector
@param v2 Second vector
@return Squared distance | [
"Squared",
"distance",
"in",
"projection",
"space",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/TSNE.java#L296-L305 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java | MemberEnter.memberEnter | protected void memberEnter(JCTree tree, Env<AttrContext> env) {
"""
Enter field and method definitions and process import
clauses, catching any completion failure exceptions.
"""
Env<AttrContext> prevEnv = this.env;
try {
this.env = env;
tree.accept(this);
} ca... | java | protected void memberEnter(JCTree tree, Env<AttrContext> env) {
Env<AttrContext> prevEnv = this.env;
try {
this.env = env;
tree.accept(this);
} catch (CompletionFailure ex) {
chk.completionError(tree.pos(), ex);
} finally {
this.env = prev... | [
"protected",
"void",
"memberEnter",
"(",
"JCTree",
"tree",
",",
"Env",
"<",
"AttrContext",
">",
"env",
")",
"{",
"Env",
"<",
"AttrContext",
">",
"prevEnv",
"=",
"this",
".",
"env",
";",
"try",
"{",
"this",
".",
"env",
"=",
"env",
";",
"tree",
".",
... | Enter field and method definitions and process import
clauses, catching any completion failure exceptions. | [
"Enter",
"field",
"and",
"method",
"definitions",
"and",
"process",
"import",
"clauses",
"catching",
"any",
"completion",
"failure",
"exceptions",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java#L157-L167 |
aws/aws-sdk-java | aws-java-sdk-lexmodelbuilding/src/main/java/com/amazonaws/services/lexmodelbuilding/model/GetBotChannelAssociationResult.java | GetBotChannelAssociationResult.withBotConfiguration | public GetBotChannelAssociationResult withBotConfiguration(java.util.Map<String, String> botConfiguration) {
"""
<p>
Provides information that the messaging platform needs to communicate with the Amazon Lex bot.
</p>
@param botConfiguration
Provides information that the messaging platform needs to communicat... | java | public GetBotChannelAssociationResult withBotConfiguration(java.util.Map<String, String> botConfiguration) {
setBotConfiguration(botConfiguration);
return this;
} | [
"public",
"GetBotChannelAssociationResult",
"withBotConfiguration",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"botConfiguration",
")",
"{",
"setBotConfiguration",
"(",
"botConfiguration",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Provides information that the messaging platform needs to communicate with the Amazon Lex bot.
</p>
@param botConfiguration
Provides information that the messaging platform needs to communicate with the Amazon Lex bot.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Provides",
"information",
"that",
"the",
"messaging",
"platform",
"needs",
"to",
"communicate",
"with",
"the",
"Amazon",
"Lex",
"bot",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-lexmodelbuilding/src/main/java/com/amazonaws/services/lexmodelbuilding/model/GetBotChannelAssociationResult.java#L408-L411 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/ActorSDK.java | ActorSDK.startMessagingActivity | public void startMessagingActivity(Context context, Bundle extras) {
"""
Method is used internally for starting default activity or activity added in delegate
@param context current context
@param extras activity extras
"""
if (!startDelegateActivity(context, delegate.getStartIntent(), extras)) {
... | java | public void startMessagingActivity(Context context, Bundle extras) {
if (!startDelegateActivity(context, delegate.getStartIntent(), extras)) {
startActivity(context, extras, RootActivity.class);
}
} | [
"public",
"void",
"startMessagingActivity",
"(",
"Context",
"context",
",",
"Bundle",
"extras",
")",
"{",
"if",
"(",
"!",
"startDelegateActivity",
"(",
"context",
",",
"delegate",
".",
"getStartIntent",
"(",
")",
",",
"extras",
")",
")",
"{",
"startActivity",
... | Method is used internally for starting default activity or activity added in delegate
@param context current context
@param extras activity extras | [
"Method",
"is",
"used",
"internally",
"for",
"starting",
"default",
"activity",
"or",
"activity",
"added",
"in",
"delegate"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/ActorSDK.java#L933-L937 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_acl_POST | public OvhAcl domain_acl_POST(String domain, String accountId) throws IOException {
"""
Create new ACL
REST: POST /email/domain/{domain}/acl
@param accountId [required] Deleguates rights to
@param domain [required] Name of your domain name
"""
String qPath = "/email/domain/{domain}/acl";
StringBuilder... | java | public OvhAcl domain_acl_POST(String domain, String accountId) throws IOException {
String qPath = "/email/domain/{domain}/acl";
StringBuilder sb = path(qPath, domain);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "accountId", accountId);
String resp = exec(qPath, "POST", sb.toString()... | [
"public",
"OvhAcl",
"domain_acl_POST",
"(",
"String",
"domain",
",",
"String",
"accountId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/acl\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"domain",
")",
";... | Create new ACL
REST: POST /email/domain/{domain}/acl
@param accountId [required] Deleguates rights to
@param domain [required] Name of your domain name | [
"Create",
"new",
"ACL"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L1292-L1299 |
j-a-w-r/jawr-main-repo | jawr-tools/jawr-bundle-processor/src/main/java/net/jawr/web/bundle/processor/BundleProcessor.java | BundleProcessor.createBinaryBundle | protected void createBinaryBundle(HttpServlet servlet,
BinaryResourcesHandler binaryRsHandler, String destDirPath,
ServletConfig servletConfig, boolean keepUrlMapping)
throws IOException, ServletException {
"""
Create the image bundle
@param servlet
the servlet
@param binaryRsHandler
the binary reso... | java | protected void createBinaryBundle(HttpServlet servlet,
BinaryResourcesHandler binaryRsHandler, String destDirPath,
ServletConfig servletConfig, boolean keepUrlMapping)
throws IOException, ServletException {
Map<String, String> bundleImgMap = binaryRsHandler.getBinaryPathMap();
Iterator<String> bundleItera... | [
"protected",
"void",
"createBinaryBundle",
"(",
"HttpServlet",
"servlet",
",",
"BinaryResourcesHandler",
"binaryRsHandler",
",",
"String",
"destDirPath",
",",
"ServletConfig",
"servletConfig",
",",
"boolean",
"keepUrlMapping",
")",
"throws",
"IOException",
",",
"ServletEx... | Create the image bundle
@param servlet
the servlet
@param binaryRsHandler
the binary resource handler
@param destDirPath
the destination directory path
@param servletMapping
the mapping
@param keepUrlMapping
= the flag indicating if we must keep the url mapping
@throws IOException
if an IOExceptin occurs
@throws Servl... | [
"Create",
"the",
"image",
"bundle"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr-tools/jawr-bundle-processor/src/main/java/net/jawr/web/bundle/processor/BundleProcessor.java#L1013-L1060 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/http/MultiPartFaxJob2HTTPRequestConverter.java | MultiPartFaxJob2HTTPRequestConverter.addAdditionalContentParts | protected void addAdditionalContentParts(HTTPFaxClientSpi faxClientSpi,FaxActionType faxActionType,FaxJob faxJob,List<ContentPart<?>> contentList) {
"""
This function enables extending classes to add additional content parts.
@param faxClientSpi
The HTTP fax client SPI
@param faxActionType
The fax action... | java | protected void addAdditionalContentParts(HTTPFaxClientSpi faxClientSpi,FaxActionType faxActionType,FaxJob faxJob,List<ContentPart<?>> contentList)
{
//empty hook for extending classes
} | [
"protected",
"void",
"addAdditionalContentParts",
"(",
"HTTPFaxClientSpi",
"faxClientSpi",
",",
"FaxActionType",
"faxActionType",
",",
"FaxJob",
"faxJob",
",",
"List",
"<",
"ContentPart",
"<",
"?",
">",
">",
"contentList",
")",
"{",
"//empty hook for extending classes",... | This function enables extending classes to add additional content parts.
@param faxClientSpi
The HTTP fax client SPI
@param faxActionType
The fax action type
@param faxJob
The fax job object
@param contentList
The content list with all the created parts | [
"This",
"function",
"enables",
"extending",
"classes",
"to",
"add",
"additional",
"content",
"parts",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/MultiPartFaxJob2HTTPRequestConverter.java#L566-L569 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java | BindDataSourceBuilder.generateSchema | private static void generateSchema(SQLiteDatabaseSchema schema) throws FileNotFoundException, IOException {
"""
Generate schema.
@param schema
the schema
@throws FileNotFoundException
the file not found exception
@throws IOException
Signals that an I/O exception has occurred.
"""
// when we run in JU... | java | private static void generateSchema(SQLiteDatabaseSchema schema) throws FileNotFoundException, IOException {
// when we run in JUNIT of Kripton, we don't have to generate schemas
// if (BindDataSourceSubProcessor.JUNIT_TEST_MODE)
// return;
if (!schema.generateSchema)
return;
// and now, write schema.creat... | [
"private",
"static",
"void",
"generateSchema",
"(",
"SQLiteDatabaseSchema",
"schema",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"// when we run in JUNIT of Kripton, we don't have to generate schemas",
"// if (BindDataSourceSubProcessor.JUNIT_TEST_MODE)",
"// retu... | Generate schema.
@param schema
the schema
@throws FileNotFoundException
the file not found exception
@throws IOException
Signals that an I/O exception has occurred. | [
"Generate",
"schema",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java#L159-L197 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/Actions.java | Actions.dragAndDrop | public Actions dragAndDrop(WebElement source, WebElement target) {
"""
A convenience method that performs click-and-hold at the location of the source element,
moves to the location of the target element, then releases the mouse.
@param source element to emulate button down at.
@param target element to move t... | java | public Actions dragAndDrop(WebElement source, WebElement target) {
if (isBuildingActions()) {
action.addAction(new ClickAndHoldAction(jsonMouse, (Locatable) source));
action.addAction(new MoveMouseAction(jsonMouse, (Locatable) target));
action.addAction(new ButtonReleaseAction(jsonMouse, (Locatabl... | [
"public",
"Actions",
"dragAndDrop",
"(",
"WebElement",
"source",
",",
"WebElement",
"target",
")",
"{",
"if",
"(",
"isBuildingActions",
"(",
")",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"ClickAndHoldAction",
"(",
"jsonMouse",
",",
"(",
"Locatable",
... | A convenience method that performs click-and-hold at the location of the source element,
moves to the location of the target element, then releases the mouse.
@param source element to emulate button down at.
@param target element to move to and release the mouse at.
@return A self reference. | [
"A",
"convenience",
"method",
"that",
"performs",
"click",
"-",
"and",
"-",
"hold",
"at",
"the",
"location",
"of",
"the",
"source",
"element",
"moves",
"to",
"the",
"location",
"of",
"the",
"target",
"element",
"then",
"releases",
"the",
"mouse",
"."
] | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L448-L459 |
samskivert/samskivert | src/main/java/com/samskivert/util/ConfigUtil.java | ConfigUtil.loadProperties | public static void loadProperties (String path, ClassLoader loader, Properties target)
throws IOException {
"""
Like {@link #loadProperties(String,ClassLoader)} but the properties are loaded into the
supplied {@link Properties} object.
"""
InputStream in = getStream(path, loader);
if (... | java | public static void loadProperties (String path, ClassLoader loader, Properties target)
throws IOException
{
InputStream in = getStream(path, loader);
if (in == null) {
throw new FileNotFoundException(path);
}
target.load(in);
in.close();
} | [
"public",
"static",
"void",
"loadProperties",
"(",
"String",
"path",
",",
"ClassLoader",
"loader",
",",
"Properties",
"target",
")",
"throws",
"IOException",
"{",
"InputStream",
"in",
"=",
"getStream",
"(",
"path",
",",
"loader",
")",
";",
"if",
"(",
"in",
... | Like {@link #loadProperties(String,ClassLoader)} but the properties are loaded into the
supplied {@link Properties} object. | [
"Like",
"{"
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ConfigUtil.java#L78-L87 |
WASdev/tool.accelerate.core | liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java | DomUtil.getChildNode | public static Node getChildNode(Node parentNode, String name, String value) {
"""
Get the matching child node
@param parentNode - the parent node
@param name - name of child node to match
@param value - value of child node to match, specify null to not match value
@return the child node if a match was found, n... | java | public static Node getChildNode(Node parentNode, String name, String value){
List<Node> matchingChildren = getChildren(parentNode, name, value);
return (matchingChildren.size() > 0) ? matchingChildren.get(0) : null;
} | [
"public",
"static",
"Node",
"getChildNode",
"(",
"Node",
"parentNode",
",",
"String",
"name",
",",
"String",
"value",
")",
"{",
"List",
"<",
"Node",
">",
"matchingChildren",
"=",
"getChildren",
"(",
"parentNode",
",",
"name",
",",
"value",
")",
";",
"retur... | Get the matching child node
@param parentNode - the parent node
@param name - name of child node to match
@param value - value of child node to match, specify null to not match value
@return the child node if a match was found, null otherwise | [
"Get",
"the",
"matching",
"child",
"node"
] | train | https://github.com/WASdev/tool.accelerate.core/blob/6511da654a69a25a76573eb76eefff349d9c4d80/liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java#L50-L53 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.listNotifications | public ListNotificationsResponse listNotifications() {
"""
List all your live notifications.
@return The list of all your live notifications
"""
ListNotificationsRequest request = new ListNotificationsRequest();
InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, LIV... | java | public ListNotificationsResponse listNotifications() {
ListNotificationsRequest request = new ListNotificationsRequest();
InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, LIVE_NOTIFICATION);
return invokeHttpClient(internalRequest, ListNotificationsResponse.class);
... | [
"public",
"ListNotificationsResponse",
"listNotifications",
"(",
")",
"{",
"ListNotificationsRequest",
"request",
"=",
"new",
"ListNotificationsRequest",
"(",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"createRequest",
"(",
"HttpMethodName",
".",
"GET",
",",
"... | List all your live notifications.
@return The list of all your live notifications | [
"List",
"all",
"your",
"live",
"notifications",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L1149-L1153 |
agmip/agmip-common-functions | src/main/java/org/agmip/functions/PTSaxton2006.java | PTSaxton2006.calcGravePlusDensity | public static String calcGravePlusDensity(String slsnd, String slcly, String omPct, String slcf) {
"""
Equation 20 for calculating Bulk soil density (matric plus gravel),
g/cm-3
@param slsnd Sand weight percentage by layer ([0,100]%)
@param slcly Clay weight percentage by layer ([0,100]%)
@param omPct Organi... | java | public static String calcGravePlusDensity(String slsnd, String slcly, String omPct, String slcf) {
String slbdm = calcNormalDensity(slsnd, slcly, omPct);
String alpha = divide(slbdm, "2.65");
String slcfv = divide(product(alpha, slcf), substract("1", slcf, product("-1", slcf, alpha)));
... | [
"public",
"static",
"String",
"calcGravePlusDensity",
"(",
"String",
"slsnd",
",",
"String",
"slcly",
",",
"String",
"omPct",
",",
"String",
"slcf",
")",
"{",
"String",
"slbdm",
"=",
"calcNormalDensity",
"(",
"slsnd",
",",
"slcly",
",",
"omPct",
")",
";",
... | Equation 20 for calculating Bulk soil density (matric plus gravel),
g/cm-3
@param slsnd Sand weight percentage by layer ([0,100]%)
@param slcly Clay weight percentage by layer ([0,100]%)
@param omPct Organic matter weight percentage by layer ([0,100]%), (=
SLOC * 1.72)
@param slcf Grave weight fraction by layer (g/g) | [
"Equation",
"20",
"for",
"calculating",
"Bulk",
"soil",
"density",
"(",
"matric",
"plus",
"gravel",
")",
"g",
"/",
"cm",
"-",
"3"
] | train | https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/functions/PTSaxton2006.java#L357-L366 |
OpenLiberty/open-liberty | dev/com.ibm.ws.rest.handler/src/com/ibm/ws/rest/handler/internal/servlet/RESTProxyServlet.java | RESTProxyServlet.handleWithDelegate | private void handleWithDelegate(final HttpServletRequest request, final HttpServletResponse response) throws IOException {
"""
For any request URL other than the context root, delegate to the
appropriate handler. If no handler is available, a 404 will be set
into the response.
@param request
@param response
... | java | private void handleWithDelegate(final HttpServletRequest request, final HttpServletResponse response) throws IOException {
//Delegate to handler
boolean foundHandler = REST_HANDLER_CONTAINER.handleRequest(new ServletRESTRequestImpl(request), new ServletRESTResponseImpl(response));
//RESTHandler ... | [
"private",
"void",
"handleWithDelegate",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"//Delegate to handler",
"boolean",
"foundHandler",
"=",
"REST_HANDLER_CONTAINER",
".",
"handleRequest... | For any request URL other than the context root, delegate to the
appropriate handler. If no handler is available, a 404 will be set
into the response.
@param request
@param response
@param pathInfo
@throws IOException | [
"For",
"any",
"request",
"URL",
"other",
"than",
"the",
"context",
"root",
"delegate",
"to",
"the",
"appropriate",
"handler",
".",
"If",
"no",
"handler",
"is",
"available",
"a",
"404",
"will",
"be",
"set",
"into",
"the",
"response",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.rest.handler/src/com/ibm/ws/rest/handler/internal/servlet/RESTProxyServlet.java#L117-L126 |
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.update | public DataBoxEdgeDeviceInner update(String deviceName, String resourceGroupName, Map<String, String> tags) {
"""
Modifies a Data Box Edge/Gateway resource.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@param tags The tags attached to the Data Box Edge/Gateway resource.... | java | public DataBoxEdgeDeviceInner update(String deviceName, String resourceGroupName, Map<String, String> tags) {
return updateWithServiceResponseAsync(deviceName, resourceGroupName, tags).toBlocking().single().body();
} | [
"public",
"DataBoxEdgeDeviceInner",
"update",
"(",
"String",
"deviceName",
",",
"String",
"resourceGroupName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"deviceName",
",",
"resourceGroupName",
"... | Modifies a Data Box Edge/Gateway resource.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@param tags The tags attached to the Data Box Edge/Gateway resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is ... | [
"Modifies",
"a",
"Data",
"Box",
"Edge",
"/",
"Gateway",
"resource",
"."
] | 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#L1111-L1113 |
knowm/XChange | xchange-coingi/src/main/java/org/knowm/xchange/coingi/service/CoingiAccountService.java | CoingiAccountService.requestDepositAddress | @Override
public String requestDepositAddress(Currency currency, String... arguments) throws IOException {
"""
This returns the current deposit address. It does not generate a new one! Repeated calls will
return the same.
"""
try {
CoingiDepositWalletRequest request =
new CoingiDepositWa... | java | @Override
public String requestDepositAddress(Currency currency, String... arguments) throws IOException {
try {
CoingiDepositWalletRequest request =
new CoingiDepositWalletRequest().setCurrency(currency.getCurrencyCode().toUpperCase());
return depositWallet(request).getAddress();
} catc... | [
"@",
"Override",
"public",
"String",
"requestDepositAddress",
"(",
"Currency",
"currency",
",",
"String",
"...",
"arguments",
")",
"throws",
"IOException",
"{",
"try",
"{",
"CoingiDepositWalletRequest",
"request",
"=",
"new",
"CoingiDepositWalletRequest",
"(",
")",
... | This returns the current deposit address. It does not generate a new one! Repeated calls will
return the same. | [
"This",
"returns",
"the",
"current",
"deposit",
"address",
".",
"It",
"does",
"not",
"generate",
"a",
"new",
"one!",
"Repeated",
"calls",
"will",
"return",
"the",
"same",
"."
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-coingi/src/main/java/org/knowm/xchange/coingi/service/CoingiAccountService.java#L76-L85 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/util/cli/ArgParser.java | ArgParser.addFlagFileOption | private void addFlagFileOption() {
"""
Adds a special option --flagfile (akin to gflags' flagfile option
http://gflags.github.io/gflags/#special) that specifies a file from which to read additional
flags.
"""
String name = "flagfile";
String shortName = getAndAddUniqueShortName(name);
... | java | private void addFlagFileOption() {
String name = "flagfile";
String shortName = getAndAddUniqueShortName(name);
String description = "Special flag: file from which to read additional flags"
+ " (lines starting with # are ignored as comments,"
+ " and these flags a... | [
"private",
"void",
"addFlagFileOption",
"(",
")",
"{",
"String",
"name",
"=",
"\"flagfile\"",
";",
"String",
"shortName",
"=",
"getAndAddUniqueShortName",
"(",
"name",
")",
";",
"String",
"description",
"=",
"\"Special flag: file from which to read additional flags\"",
... | Adds a special option --flagfile (akin to gflags' flagfile option
http://gflags.github.io/gflags/#special) that specifies a file from which to read additional
flags. | [
"Adds",
"a",
"special",
"option",
"--",
"flagfile",
"(",
"akin",
"to",
"gflags",
"flagfile",
"option",
"http",
":",
"//",
"gflags",
".",
"github",
".",
"io",
"/",
"gflags",
"/",
"#special",
")",
"that",
"specifies",
"a",
"file",
"from",
"which",
"to",
... | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/util/cli/ArgParser.java#L77-L86 |
hellojavaer/ddal | ddal-sequence/src/main/java/org/hellojavaer/ddal/sequence/HttpSequenceRangeGetter.java | HttpSequenceRangeGetter.get | @Override
public SequenceRange get(String schemaName, String tableName, int step) throws Exception {
"""
param: clientId= &accessToken= &schemaName= &tableName= &step=
return: beginValue= &endValue= &errorCode= &errorMessage=
"""
Map<String, String> param = new HashMap<>();
param.put("clie... | java | @Override
public SequenceRange get(String schemaName, String tableName, int step) throws Exception {
Map<String, String> param = new HashMap<>();
param.put("clientId", clientId);
param.put("accessToken", accessToken);
param.put("schemaName", schemaName);
param.put("tableName"... | [
"@",
"Override",
"public",
"SequenceRange",
"get",
"(",
"String",
"schemaName",
",",
"String",
"tableName",
",",
"int",
"step",
")",
"throws",
"Exception",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"param",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";"... | param: clientId= &accessToken= &schemaName= &tableName= &step=
return: beginValue= &endValue= &errorCode= &errorMessage= | [
"param",
":",
"clientId",
"=",
"&accessToken",
"=",
"&schemaName",
"=",
"&tableName",
"=",
"&step",
"=",
"return",
":",
"beginValue",
"=",
"&endValue",
"=",
"&errorCode",
"=",
"&errorMessage",
"="
] | train | https://github.com/hellojavaer/ddal/blob/876dc32ece8bb983df64e94bdcc9045f0ee5cc3b/ddal-sequence/src/main/java/org/hellojavaer/ddal/sequence/HttpSequenceRangeGetter.java#L52-L79 |
cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java | MolecularFormulaManipulator.getMolecularFormula | public static IMolecularFormula getMolecularFormula(String stringMF, IMolecularFormula formula) {
"""
add in a instance of IMolecularFormula the elements extracts form
molecular formula string. The string is immediately analyzed and a set of Nodes
is built based on this analysis
<p> The hydrogens must be implic... | java | public static IMolecularFormula getMolecularFormula(String stringMF, IMolecularFormula formula) {
return getMolecularFormula(stringMF, formula, false);
} | [
"public",
"static",
"IMolecularFormula",
"getMolecularFormula",
"(",
"String",
"stringMF",
",",
"IMolecularFormula",
"formula",
")",
"{",
"return",
"getMolecularFormula",
"(",
"stringMF",
",",
"formula",
",",
"false",
")",
";",
"}"
] | add in a instance of IMolecularFormula the elements extracts form
molecular formula string. The string is immediately analyzed and a set of Nodes
is built based on this analysis
<p> The hydrogens must be implicit.
@param stringMF The molecularFormula string
@return The filled IMolecularFormula
@see ... | [
"add",
"in",
"a",
"instance",
"of",
"IMolecularFormula",
"the",
"elements",
"extracts",
"form",
"molecular",
"formula",
"string",
".",
"The",
"string",
"is",
"immediately",
"analyzed",
"and",
"a",
"set",
"of",
"Nodes",
"is",
"built",
"based",
"on",
"this",
"... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L617-L619 |
Cleveroad/AdaptiveTableLayout | library/src/main/java/com/cleveroad/adaptivetablelayout/LinkedAdaptiveTableAdapter.java | LinkedAdaptiveTableAdapter.notifyItemChanged | @Override
public void notifyItemChanged(int rowIndex, int columnIndex) {
"""
{@inheritDoc}
@param rowIndex the row index
@param columnIndex the column index
"""
for (AdaptiveTableDataSetObserver observer : mAdaptiveTableDataSetObservers) {
observer.notifyItemChanged(rowIndex, col... | java | @Override
public void notifyItemChanged(int rowIndex, int columnIndex) {
for (AdaptiveTableDataSetObserver observer : mAdaptiveTableDataSetObservers) {
observer.notifyItemChanged(rowIndex, columnIndex);
}
} | [
"@",
"Override",
"public",
"void",
"notifyItemChanged",
"(",
"int",
"rowIndex",
",",
"int",
"columnIndex",
")",
"{",
"for",
"(",
"AdaptiveTableDataSetObserver",
"observer",
":",
"mAdaptiveTableDataSetObservers",
")",
"{",
"observer",
".",
"notifyItemChanged",
"(",
"... | {@inheritDoc}
@param rowIndex the row index
@param columnIndex the column index | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/Cleveroad/AdaptiveTableLayout/blob/188213b35e05e635497b03fe741799782dde7208/library/src/main/java/com/cleveroad/adaptivetablelayout/LinkedAdaptiveTableAdapter.java#L97-L102 |
l0s/fernet-java8 | fernet-aws-secrets-manager-rotator/src/main/java/com/macasaet/fernet/aws/secretsmanager/rotation/SecretsManager.java | SecretsManager.putSecretValue | public void putSecretValue(final String secretId, final String clientRequestToken, final Key key, final Stage stage) {
"""
Store a single Fernet key in a secret. This requires the permission <code>secretsmanager:PutSecretValue</code>
@param secretId
the ARN of the secret
@param clientRequestToken
the secret ... | java | public void putSecretValue(final String secretId, final String clientRequestToken, final Key key, final Stage stage) {
putSecretValue(secretId, clientRequestToken, singletonList(key), stage);
} | [
"public",
"void",
"putSecretValue",
"(",
"final",
"String",
"secretId",
",",
"final",
"String",
"clientRequestToken",
",",
"final",
"Key",
"key",
",",
"final",
"Stage",
"stage",
")",
"{",
"putSecretValue",
"(",
"secretId",
",",
"clientRequestToken",
",",
"single... | Store a single Fernet key in a secret. This requires the permission <code>secretsmanager:PutSecretValue</code>
@param secretId
the ARN of the secret
@param clientRequestToken
the secret version identifier
@param key
the key to store in the secret
@param stage
the stage with which to tag the version | [
"Store",
"a",
"single",
"Fernet",
"key",
"in",
"a",
"secret",
".",
"This",
"requires",
"the",
"permission",
"<code",
">",
"secretsmanager",
":",
"PutSecretValue<",
"/",
"code",
">"
] | train | https://github.com/l0s/fernet-java8/blob/427244bc1af605ffca0ac2469d66b297ea9f77b3/fernet-aws-secrets-manager-rotator/src/main/java/com/macasaet/fernet/aws/secretsmanager/rotation/SecretsManager.java#L147-L149 |
inferred/FreeBuilder | src/main/java/org/inferred/freebuilder/processor/source/Scope.java | Scope.computeIfAbsent | public <V> V computeIfAbsent(Key<V> key, Supplier<V> supplier) {
"""
If {@code key} is not already associated with a value, computes its value using
{@code supplier} and enters it into the scope.
@return the current (existing or computed) value associated with {@code key}
"""
V value = get(key);
if... | java | public <V> V computeIfAbsent(Key<V> key, Supplier<V> supplier) {
V value = get(key);
if (value != null) {
return value;
} else if (canStore(key)) {
entries.put(key, RECURSION_SENTINEL);
value = supplier.get();
entries.put(key, requireNonNull(value));
return value;
} else if... | [
"public",
"<",
"V",
">",
"V",
"computeIfAbsent",
"(",
"Key",
"<",
"V",
">",
"key",
",",
"Supplier",
"<",
"V",
">",
"supplier",
")",
"{",
"V",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"return",
"valu... | If {@code key} is not already associated with a value, computes its value using
{@code supplier} and enters it into the scope.
@return the current (existing or computed) value associated with {@code key} | [
"If",
"{",
"@code",
"key",
"}",
"is",
"not",
"already",
"associated",
"with",
"a",
"value",
"computes",
"its",
"value",
"using",
"{",
"@code",
"supplier",
"}",
"and",
"enters",
"it",
"into",
"the",
"scope",
"."
] | train | https://github.com/inferred/FreeBuilder/blob/d5a222f90648aece135da4b971c55a60afe8649c/src/main/java/org/inferred/freebuilder/processor/source/Scope.java#L96-L111 |
BlueBrain/bluima | modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java | diff_match_patch.patch_make | public LinkedList<Patch> patch_make(LinkedList<Diff> diffs) {
"""
Compute a list of patches to turn text1 into text2. text1 will be derived
from the provided diffs.
@param diffs
Array of Diff objects for text1 to text2.
@return LinkedList of Patch objects.
"""
if (diffs == null) {
thr... | java | public LinkedList<Patch> patch_make(LinkedList<Diff> diffs) {
if (diffs == null) {
throw new IllegalArgumentException("Null inputs. (patch_make)");
}
// No origin string provided, compute our own.
String text1 = diff_text1(diffs);
return patch_make(text1, diffs);
... | [
"public",
"LinkedList",
"<",
"Patch",
">",
"patch_make",
"(",
"LinkedList",
"<",
"Diff",
">",
"diffs",
")",
"{",
"if",
"(",
"diffs",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Null inputs. (patch_make)\"",
")",
";",
"}",
"// ... | Compute a list of patches to turn text1 into text2. text1 will be derived
from the provided diffs.
@param diffs
Array of Diff objects for text1 to text2.
@return LinkedList of Patch objects. | [
"Compute",
"a",
"list",
"of",
"patches",
"to",
"turn",
"text1",
"into",
"text2",
".",
"text1",
"will",
"be",
"derived",
"from",
"the",
"provided",
"diffs",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java#L1953-L1960 |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java | ModelDiff.createModelDiff | public static ModelDiff createModelDiff(OpenEngSBModel before, OpenEngSBModel after) {
"""
Creates an instance of the ModelDiff class based on the both models which are passed to the function. It
instantiate the class and calculates the differences of this two models.
"""
ModelDiff diff = new ModelDif... | java | public static ModelDiff createModelDiff(OpenEngSBModel before, OpenEngSBModel after) {
ModelDiff diff = new ModelDiff(before, after);
calculateDifferences(diff);
return diff;
} | [
"public",
"static",
"ModelDiff",
"createModelDiff",
"(",
"OpenEngSBModel",
"before",
",",
"OpenEngSBModel",
"after",
")",
"{",
"ModelDiff",
"diff",
"=",
"new",
"ModelDiff",
"(",
"before",
",",
"after",
")",
";",
"calculateDifferences",
"(",
"diff",
")",
";",
"... | Creates an instance of the ModelDiff class based on the both models which are passed to the function. It
instantiate the class and calculates the differences of this two models. | [
"Creates",
"an",
"instance",
"of",
"the",
"ModelDiff",
"class",
"based",
"on",
"the",
"both",
"models",
"which",
"are",
"passed",
"to",
"the",
"function",
".",
"It",
"instantiate",
"the",
"class",
"and",
"calculates",
"the",
"differences",
"of",
"this",
"two... | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java#L50-L54 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java | DetectPolygonBinaryGrayRefine.process | public void process(T gray , GrayU8 binary ) {
"""
Detects polygons inside the grayscale image and its thresholded version
@param gray Gray scale image
@param binary Binary version of grayscale image
"""
detector.process(gray,binary);
if( refineGray != null )
refineGray.setImage(gray);
edgeIntensity... | java | public void process(T gray , GrayU8 binary ) {
detector.process(gray,binary);
if( refineGray != null )
refineGray.setImage(gray);
edgeIntensity.setImage(gray);
long time0 = System.nanoTime();
FastQueue<DetectPolygonFromContour.Info> detections = detector.getFound();
if( adjustForBias != null ) {
int... | [
"public",
"void",
"process",
"(",
"T",
"gray",
",",
"GrayU8",
"binary",
")",
"{",
"detector",
".",
"process",
"(",
"gray",
",",
"binary",
")",
";",
"if",
"(",
"refineGray",
"!=",
"null",
")",
"refineGray",
".",
"setImage",
"(",
"gray",
")",
";",
"edg... | Detects polygons inside the grayscale image and its thresholded version
@param gray Gray scale image
@param binary Binary version of grayscale image | [
"Detects",
"polygons",
"inside",
"the",
"grayscale",
"image",
"and",
"its",
"thresholded",
"version"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java#L149-L177 |
apereo/cas | core/cas-server-core-authentication-mfa-api/src/main/java/org/apereo/cas/authentication/MultifactorAuthenticationUtils.java | MultifactorAuthenticationUtils.validateEventIdForMatchingTransitionInContext | public static Event validateEventIdForMatchingTransitionInContext(final String eventId,
final Optional<RequestContext> context,
final Map<String, Object> attributes) {
"""
Val... | java | public static Event validateEventIdForMatchingTransitionInContext(final String eventId,
final Optional<RequestContext> context,
final Map<String, Object> attributes) {
val ... | [
"public",
"static",
"Event",
"validateEventIdForMatchingTransitionInContext",
"(",
"final",
"String",
"eventId",
",",
"final",
"Optional",
"<",
"RequestContext",
">",
"context",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
")",
"{",
"val",... | Validate event id for matching transition in context event.
@param eventId the event id
@param context the context
@param attributes the attributes
@return the event | [
"Validate",
"event",
"id",
"for",
"matching",
"transition",
"in",
"context",
"event",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-authentication-mfa-api/src/main/java/org/apereo/cas/authentication/MultifactorAuthenticationUtils.java#L64-L77 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/database/DBAccessFactory.java | DBAccessFactory.createDBAccess | public static IDBAccess createDBAccess(DBType dbType, Properties properties,
AuthToken authToken) {
"""
create an IDBAccess (an accessor) for a specific database,
supports authentication.
@param dbType the type of database to access. Can be
<br/>DBType.REMOTE or DBType.EMBEDDED or DBType.IN_MEMORY
@param pr... | java | public static IDBAccess createDBAccess(DBType dbType, Properties properties,
AuthToken authToken) {
return createDBAccess(dbType, properties, null, null, authToken);
} | [
"public",
"static",
"IDBAccess",
"createDBAccess",
"(",
"DBType",
"dbType",
",",
"Properties",
"properties",
",",
"AuthToken",
"authToken",
")",
"{",
"return",
"createDBAccess",
"(",
"dbType",
",",
"properties",
",",
"null",
",",
"null",
",",
"authToken",
")",
... | create an IDBAccess (an accessor) for a specific database,
supports authentication.
@param dbType the type of database to access. Can be
<br/>DBType.REMOTE or DBType.EMBEDDED or DBType.IN_MEMORY
@param properties to configure the database connection.
<br/>The appropriate database access class will pick the properties i... | [
"create",
"an",
"IDBAccess",
"(",
"an",
"accessor",
")",
"for",
"a",
"specific",
"database",
"supports",
"authentication",
"."
] | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/database/DBAccessFactory.java#L93-L96 |
jbundle/jbundle | main/msg/src/main/java/org/jbundle/main/msg/db/MessageTransport.java | MessageTransport.createMessageTransport | public Object createMessageTransport(String messageTransportType, Task task) {
"""
Get the message transport for this type
@param messageTransportType
@returns The concrete BaseMessageTransport implementation.
"""
MessageTransport messageTransport = this.getMessageTransport(messageTransportType);
... | java | public Object createMessageTransport(String messageTransportType, Task task)
{
MessageTransport messageTransport = this.getMessageTransport(messageTransportType);
String className = null;
if (messageTransport != null)
className = ((PropertiesField)messageTransport.getField(Messag... | [
"public",
"Object",
"createMessageTransport",
"(",
"String",
"messageTransportType",
",",
"Task",
"task",
")",
"{",
"MessageTransport",
"messageTransport",
"=",
"this",
".",
"getMessageTransport",
"(",
"messageTransportType",
")",
";",
"String",
"className",
"=",
"nul... | Get the message transport for this type
@param messageTransportType
@returns The concrete BaseMessageTransport implementation. | [
"Get",
"the",
"message",
"transport",
"for",
"this",
"type"
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/msg/src/main/java/org/jbundle/main/msg/db/MessageTransport.java#L221-L237 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/util/Version.java | Version.parseVersion | public static Version parseVersion(String versionString) {
"""
Parses a {@link String} into a {@link Version}. This expects a version string in the form of
"X[.Y[.Z]][anything]". That is a major number, followed optionally by a minor only or a minor + a patch revision,
everything after that being completely igno... | java | public static Version parseVersion(String versionString) {
requireNonNull(versionString, "versionString");
Matcher matcher = VERSION_PATTERN.matcher(versionString);
if (matcher.matches() && matcher.groupCount() == 3) {
int major = Integer.parseInt(matcher.group(1));
int minor = matcher.group(2)... | [
"public",
"static",
"Version",
"parseVersion",
"(",
"String",
"versionString",
")",
"{",
"requireNonNull",
"(",
"versionString",
",",
"\"versionString\"",
")",
";",
"Matcher",
"matcher",
"=",
"VERSION_PATTERN",
".",
"matcher",
"(",
"versionString",
")",
";",
"if",... | Parses a {@link String} into a {@link Version}. This expects a version string in the form of
"X[.Y[.Z]][anything]". That is a major number, followed optionally by a minor only or a minor + a patch revision,
everything after that being completely ignored.
<p>
The parsing is extremely lenient, accepting any input string ... | [
"Parses",
"a",
"{",
"@link",
"String",
"}",
"into",
"a",
"{",
"@link",
"Version",
"}",
".",
"This",
"expects",
"a",
"version",
"string",
"in",
"the",
"form",
"of",
"X",
"[",
".",
"Y",
"[",
".",
"Z",
"]]",
"[",
"anything",
"]",
".",
"That",
"is",
... | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/util/Version.java#L122-L135 |
camunda/camunda-bpmn-model | src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractBoundaryEventBuilder.java | AbstractBoundaryEventBuilder.errorEventDefinition | public ErrorEventDefinitionBuilder errorEventDefinition(String id) {
"""
Creates an error event definition with an unique id
and returns a builder for the error event definition.
@return the error event definition builder object
"""
ErrorEventDefinition errorEventDefinition = createEmptyErrorEventDefin... | java | public ErrorEventDefinitionBuilder errorEventDefinition(String id) {
ErrorEventDefinition errorEventDefinition = createEmptyErrorEventDefinition();
if (id != null) {
errorEventDefinition.setId(id);
}
element.getEventDefinitions().add(errorEventDefinition);
return new ErrorEventDefinitionBuild... | [
"public",
"ErrorEventDefinitionBuilder",
"errorEventDefinition",
"(",
"String",
"id",
")",
"{",
"ErrorEventDefinition",
"errorEventDefinition",
"=",
"createEmptyErrorEventDefinition",
"(",
")",
";",
"if",
"(",
"id",
"!=",
"null",
")",
"{",
"errorEventDefinition",
".",
... | Creates an error event definition with an unique id
and returns a builder for the error event definition.
@return the error event definition builder object | [
"Creates",
"an",
"error",
"event",
"definition",
"with",
"an",
"unique",
"id",
"and",
"returns",
"a",
"builder",
"for",
"the",
"error",
"event",
"definition",
"."
] | train | https://github.com/camunda/camunda-bpmn-model/blob/debcadf041d10fa62b799de0307b832cea84e5d4/src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractBoundaryEventBuilder.java#L79-L87 |
jglobus/JGlobus | myproxy/src/main/java/org/globus/myproxy/MyProxy.java | MyProxy.opensslHash | protected static String opensslHash(X509Certificate cert) {
"""
/*
the following methods are based off code to compute the subject
name hash from:
http://blog.piefox.com/2008/10/javaopenssl-ca-generation.html
"""
try {
return openssl_X509_NAME_hash(cert.getSubjectX500Principal());
... | java | protected static String opensslHash(X509Certificate cert) {
try {
return openssl_X509_NAME_hash(cert.getSubjectX500Principal());
}
catch (Exception e) {
throw new Error("MD5 isn't available!", e);
}
} | [
"protected",
"static",
"String",
"opensslHash",
"(",
"X509Certificate",
"cert",
")",
"{",
"try",
"{",
"return",
"openssl_X509_NAME_hash",
"(",
"cert",
".",
"getSubjectX500Principal",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
... | /*
the following methods are based off code to compute the subject
name hash from:
http://blog.piefox.com/2008/10/javaopenssl-ca-generation.html | [
"/",
"*",
"the",
"following",
"methods",
"are",
"based",
"off",
"code",
"to",
"compute",
"the",
"subject",
"name",
"hash",
"from",
":",
"http",
":",
"//",
"blog",
".",
"piefox",
".",
"com",
"/",
"2008",
"/",
"10",
"/",
"javaopenssl",
"-",
"ca",
"-",
... | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/myproxy/src/main/java/org/globus/myproxy/MyProxy.java#L1497-L1504 |
atomix/copycat | server/src/main/java/io/atomix/copycat/server/storage/Storage.java | Storage.openSnapshotStore | public SnapshotStore openSnapshotStore(String name) {
"""
Opens a new {@link SnapshotStore}, recovering snapshots from disk if they exist.
<p>
The snapshot store will be loaded using based on the configured {@link StorageLevel}. If the storage level is persistent
then the snapshot store will be loaded from disk... | java | public SnapshotStore openSnapshotStore(String name) {
return new SnapshotStore(name, this, ThreadContext.currentContextOrThrow().serializer().clone());
} | [
"public",
"SnapshotStore",
"openSnapshotStore",
"(",
"String",
"name",
")",
"{",
"return",
"new",
"SnapshotStore",
"(",
"name",
",",
"this",
",",
"ThreadContext",
".",
"currentContextOrThrow",
"(",
")",
".",
"serializer",
"(",
")",
".",
"clone",
"(",
")",
")... | Opens a new {@link SnapshotStore}, recovering snapshots from disk if they exist.
<p>
The snapshot store will be loaded using based on the configured {@link StorageLevel}. If the storage level is persistent
then the snapshot store will be loaded from disk, otherwise a new snapshot store will be created.
@param name The... | [
"Opens",
"a",
"new",
"{",
"@link",
"SnapshotStore",
"}",
"recovering",
"snapshots",
"from",
"disk",
"if",
"they",
"exist",
".",
"<p",
">",
"The",
"snapshot",
"store",
"will",
"be",
"loaded",
"using",
"based",
"on",
"the",
"configured",
"{",
"@link",
"Stora... | train | https://github.com/atomix/copycat/blob/c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10/server/src/main/java/io/atomix/copycat/server/storage/Storage.java#L292-L294 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.getSectionLevel | private int getSectionLevel(SpanManager sm, Span sectionNameSpan) {
"""
Returns the number of Equality Chars which are used to specify the level
of the Section.
"""
int begin = sectionNameSpan.getStart();
int end = sectionNameSpan.getEnd();
int level = 0;
try
{
while ((sm.charAt(begin + level) =... | java | private int getSectionLevel(SpanManager sm, Span sectionNameSpan)
{
int begin = sectionNameSpan.getStart();
int end = sectionNameSpan.getEnd();
int level = 0;
try
{
while ((sm.charAt(begin + level) == '=')
&& (sm.charAt(end - 1 - level) == '='))
{
level++;
}
}
catch (StringIndexOutOfBo... | [
"private",
"int",
"getSectionLevel",
"(",
"SpanManager",
"sm",
",",
"Span",
"sectionNameSpan",
")",
"{",
"int",
"begin",
"=",
"sectionNameSpan",
".",
"getStart",
"(",
")",
";",
"int",
"end",
"=",
"sectionNameSpan",
".",
"getEnd",
"(",
")",
";",
"int",
"lev... | Returns the number of Equality Chars which are used to specify the level
of the Section. | [
"Returns",
"the",
"number",
"of",
"Equality",
"Chars",
"which",
"are",
"used",
"to",
"specify",
"the",
"level",
"of",
"the",
"Section",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java#L754-L780 |
fommil/matrix-toolkits-java | src/main/java/no/uib/cipr/matrix/io/MatrixVectorReader.java | MatrixVectorReader.readCoordinateSize | public MatrixSize readCoordinateSize() throws IOException {
"""
Reads in the size of a coordinate matrix. Skips initial comments
"""
int numRows = getInt(), numColumns = getInt(), numEntries = getInt();
return new MatrixSize(numRows, numColumns, numEntries);
} | java | public MatrixSize readCoordinateSize() throws IOException {
int numRows = getInt(), numColumns = getInt(), numEntries = getInt();
return new MatrixSize(numRows, numColumns, numEntries);
} | [
"public",
"MatrixSize",
"readCoordinateSize",
"(",
")",
"throws",
"IOException",
"{",
"int",
"numRows",
"=",
"getInt",
"(",
")",
",",
"numColumns",
"=",
"getInt",
"(",
")",
",",
"numEntries",
"=",
"getInt",
"(",
")",
";",
"return",
"new",
"MatrixSize",
"("... | Reads in the size of a coordinate matrix. Skips initial comments | [
"Reads",
"in",
"the",
"size",
"of",
"a",
"coordinate",
"matrix",
".",
"Skips",
"initial",
"comments"
] | train | https://github.com/fommil/matrix-toolkits-java/blob/6157618bc86bcda3749af2a60bf869d8f3292960/src/main/java/no/uib/cipr/matrix/io/MatrixVectorReader.java#L284-L288 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getItem | public Future<Item> getItem(int id, ItemData data) {
"""
<p>
Retrieve a specific item
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param id The id of the item
@param data Additional information to retrieve
@return The item
@see <a href=https://developer.riotgam... | java | public Future<Item> getItem(int id, ItemData data) {
return new DummyFuture<>(handler.getItem(id, data));
} | [
"public",
"Future",
"<",
"Item",
">",
"getItem",
"(",
"int",
"id",
",",
"ItemData",
"data",
")",
"{",
"return",
"new",
"DummyFuture",
"<>",
"(",
"handler",
".",
"getItem",
"(",
"id",
",",
"data",
")",
")",
";",
"}"
] | <p>
Retrieve a specific item
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param id The id of the item
@param data Additional information to retrieve
@return The item
@see <a href=https://developer.riotgames.com/api/methods#!/649/2176>Official API documentation</a> | [
"<p",
">",
"Retrieve",
"a",
"specific",
"item",
"<",
"/",
"p",
">",
"This",
"method",
"does",
"not",
"count",
"towards",
"the",
"rate",
"limit",
"and",
"is",
"not",
"affected",
"by",
"the",
"throttle"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L506-L508 |
google/closure-templates | java/src/com/google/template/soy/data/SanitizedContents.java | SanitizedContents.constantAttributes | public static SanitizedContent constantAttributes(@CompileTimeConstant final String constant) {
"""
Wraps an assumed-safe constant string that specifies an attribute.
<p>This only accepts compile-time constants, based on the assumption that attributes that are
controlled by the application (and not user input)... | java | public static SanitizedContent constantAttributes(@CompileTimeConstant final String constant) {
return fromConstant(constant, ContentKind.ATTRIBUTES, Dir.LTR);
} | [
"public",
"static",
"SanitizedContent",
"constantAttributes",
"(",
"@",
"CompileTimeConstant",
"final",
"String",
"constant",
")",
"{",
"return",
"fromConstant",
"(",
"constant",
",",
"ContentKind",
".",
"ATTRIBUTES",
",",
"Dir",
".",
"LTR",
")",
";",
"}"
] | Wraps an assumed-safe constant string that specifies an attribute.
<p>This only accepts compile-time constants, based on the assumption that attributes that are
controlled by the application (and not user input) are considered safe. | [
"Wraps",
"an",
"assumed",
"-",
"safe",
"constant",
"string",
"that",
"specifies",
"an",
"attribute",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SanitizedContents.java#L208-L210 |
tvesalainen/util | util/src/main/java/org/vesalainen/lang/Primitives.java | Primitives.writeLong | public static final void writeLong(long value, byte[] array, int offset) {
"""
Write value to byte array
@param value
@param array
@param offset
@see java.nio.ByteBuffer#putLong(long)
"""
if (array.length < offset + 8)
{
throw new IllegalArgumentException("no room in array");... | java | public static final void writeLong(long value, byte[] array, int offset)
{
if (array.length < offset + 8)
{
throw new IllegalArgumentException("no room in array");
}
array[offset] = (byte) (value >> 56);
array[offset + 1] = (byte) ((value >> 48) & 0xff);
... | [
"public",
"static",
"final",
"void",
"writeLong",
"(",
"long",
"value",
",",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"array",
".",
"length",
"<",
"offset",
"+",
"8",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(... | Write value to byte array
@param value
@param array
@param offset
@see java.nio.ByteBuffer#putLong(long) | [
"Write",
"value",
"to",
"byte",
"array"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/lang/Primitives.java#L253-L267 |
gallandarakhneorg/afc | advanced/gis/gisinputoutput/src/main/java/org/arakhne/afc/gis/io/xml/XMLGISElementUtil.java | XMLGISElementUtil.readMapElement | public static MapElement readMapElement(Element element, String elementNodeName,
PathBuilder pathBuilder, XMLResources resources) throws IOException {
"""
Read a map element from the XML description.
@param element is the XML node to read.
@param elementNodeName is the name of the XML node that should conta... | java | public static MapElement readMapElement(Element element, String elementNodeName,
PathBuilder pathBuilder, XMLResources resources) throws IOException {
return readMapElement(element, elementNodeName, null, pathBuilder, resources);
} | [
"public",
"static",
"MapElement",
"readMapElement",
"(",
"Element",
"element",
",",
"String",
"elementNodeName",
",",
"PathBuilder",
"pathBuilder",
",",
"XMLResources",
"resources",
")",
"throws",
"IOException",
"{",
"return",
"readMapElement",
"(",
"element",
",",
... | Read a map element from the XML description.
@param element is the XML node to read.
@param elementNodeName is the name of the XML node that should contains the map element data.
It must be one of {@link #NODE_POINT}, {@link #NODE_CIRCLE}, {@link #NODE_POLYGON}, {@link #NODE_POLYLINE},
{@link #NODE_MULTIPOINT}, or {@c... | [
"Read",
"a",
"map",
"element",
"from",
"the",
"XML",
"description",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisinputoutput/src/main/java/org/arakhne/afc/gis/io/xml/XMLGISElementUtil.java#L239-L242 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/UtilMath.java | UtilMath.curveValue | public static double curveValue(double value, double dest, double speed) {
"""
Apply progressive modifications to a value.
@param value The value.
@param dest The value to reach.
@param speed The effect speed (must not be equal to 0.0).
@return The modified value.
@throws LionEngineException If invalid argu... | java | public static double curveValue(double value, double dest, double speed)
{
Check.different(speed, 0.0);
final double reciprocal = 1.0 / speed;
final double invReciprocal = 1.0 - reciprocal;
return value * invReciprocal + dest * reciprocal;
} | [
"public",
"static",
"double",
"curveValue",
"(",
"double",
"value",
",",
"double",
"dest",
",",
"double",
"speed",
")",
"{",
"Check",
".",
"different",
"(",
"speed",
",",
"0.0",
")",
";",
"final",
"double",
"reciprocal",
"=",
"1.0",
"/",
"speed",
";",
... | Apply progressive modifications to a value.
@param value The value.
@param dest The value to reach.
@param speed The effect speed (must not be equal to 0.0).
@return The modified value.
@throws LionEngineException If invalid argument. | [
"Apply",
"progressive",
"modifications",
"to",
"a",
"value",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/UtilMath.java#L157-L165 |
google/error-prone-javac | src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java | Util.remoteInputOutput | public static ExecutionControl remoteInputOutput(InputStream input, OutputStream output,
Map<String, OutputStream> outputStreamMap, Map<String, InputStream> inputStreamMap,
BiFunction<ObjectInput, ObjectOutput, ExecutionControl> factory) throws IOException {
"""
Creates an ExecutionControl ... | java | public static ExecutionControl remoteInputOutput(InputStream input, OutputStream output,
Map<String, OutputStream> outputStreamMap, Map<String, InputStream> inputStreamMap,
BiFunction<ObjectInput, ObjectOutput, ExecutionControl> factory) throws IOException {
ExecutionControl[] result = n... | [
"public",
"static",
"ExecutionControl",
"remoteInputOutput",
"(",
"InputStream",
"input",
",",
"OutputStream",
"output",
",",
"Map",
"<",
"String",
",",
"OutputStream",
">",
"outputStreamMap",
",",
"Map",
"<",
"String",
",",
"InputStream",
">",
"inputStreamMap",
"... | Creates an ExecutionControl for given packetized input and output. The given InputStream
is de-packetized, and content forwarded to ObjectInput and given OutputStreams. The ObjectOutput
and values read from the given InputStream are packetized and sent to the given OutputStream.
@param input the packetized input strea... | [
"Creates",
"an",
"ExecutionControl",
"for",
"given",
"packetized",
"input",
"and",
"output",
".",
"The",
"given",
"InputStream",
"is",
"de",
"-",
"packetized",
"and",
"content",
"forwarded",
"to",
"ObjectInput",
"and",
"given",
"OutputStreams",
".",
"The",
"Obje... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java#L159-L202 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsfContainer_fat_2.2/fat/src/com/ibm/ws/jsf/container/fat/JSFUtils.java | JSFUtils.createHttpUrl | public static URL createHttpUrl(LibertyServer server, String contextRoot, String path) throws Exception {
"""
Construct a URL for a test case so a request can be made.
@param server - The server that is under test, this is used to get the port and host name.
@param contextRoot - The context root of the applica... | java | public static URL createHttpUrl(LibertyServer server, String contextRoot, String path) throws Exception {
URL result = new URL("http://" + server.getHostname() + ":" + server.getHttpDefaultPort() +
"/" + contextRoot + "/" + path);
return result;
} | [
"public",
"static",
"URL",
"createHttpUrl",
"(",
"LibertyServer",
"server",
",",
"String",
"contextRoot",
",",
"String",
"path",
")",
"throws",
"Exception",
"{",
"URL",
"result",
"=",
"new",
"URL",
"(",
"\"http://\"",
"+",
"server",
".",
"getHostname",
"(",
... | Construct a URL for a test case so a request can be made.
@param server - The server that is under test, this is used to get the port and host name.
@param contextRoot - The context root of the application
@param path - Additional path information for the request.
@return - A fully formed URL.
@throws Exception | [
"Construct",
"a",
"URL",
"for",
"a",
"test",
"case",
"so",
"a",
"request",
"can",
"be",
"made",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsfContainer_fat_2.2/fat/src/com/ibm/ws/jsf/container/fat/JSFUtils.java#L36-L41 |
facebookarchive/hadoop-20 | src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorEngine.java | SimulatorEngine.markCompletedJob | void markCompletedJob(JobStatus jobStatus, long timestamp) {
"""
Called when a job is completed. Insert a {@link JobCompleteEvent} into the
{@link SimulatorEventQueue}. This event will be picked up by
{@link SimulatorJobClient}, which will in turn decide whether the
simulation is done.
@param jobStatus final s... | java | void markCompletedJob(JobStatus jobStatus, long timestamp) {
queue.add(new JobCompleteEvent(jc, timestamp, jobStatus, this));
} | [
"void",
"markCompletedJob",
"(",
"JobStatus",
"jobStatus",
",",
"long",
"timestamp",
")",
"{",
"queue",
".",
"add",
"(",
"new",
"JobCompleteEvent",
"(",
"jc",
",",
"timestamp",
",",
"jobStatus",
",",
"this",
")",
")",
";",
"}"
] | Called when a job is completed. Insert a {@link JobCompleteEvent} into the
{@link SimulatorEventQueue}. This event will be picked up by
{@link SimulatorJobClient}, which will in turn decide whether the
simulation is done.
@param jobStatus final status of a job, SUCCEEDED or FAILED
@param timestamp time stamp when the j... | [
"Called",
"when",
"a",
"job",
"is",
"completed",
".",
"Insert",
"a",
"{"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorEngine.java#L219-L221 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/collections/IndexAliasMap.java | IndexAliasMap.addAllWithAlias | public void addAllWithAlias(List<String> aliasList, List<V> dataList) {
"""
Add all with alias.
@param aliasList the alias list
@param dataList the data list
"""
synchronized (dataList) {
JMLambda.runByBoolean(aliasList.size() == dataList.size(),
() -> JMStream.numb... | java | public void addAllWithAlias(List<String> aliasList, List<V> dataList) {
synchronized (dataList) {
JMLambda.runByBoolean(aliasList.size() == dataList.size(),
() -> JMStream.numberRangeWithCount(0, 1, dataList.size())
.forEach(i -> addWithAlias(aliasList... | [
"public",
"void",
"addAllWithAlias",
"(",
"List",
"<",
"String",
">",
"aliasList",
",",
"List",
"<",
"V",
">",
"dataList",
")",
"{",
"synchronized",
"(",
"dataList",
")",
"{",
"JMLambda",
".",
"runByBoolean",
"(",
"aliasList",
".",
"size",
"(",
")",
"=="... | Add all with alias.
@param aliasList the alias list
@param dataList the data list | [
"Add",
"all",
"with",
"alias",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/collections/IndexAliasMap.java#L51-L64 |
soklet/soklet | src/main/java/com/soklet/web/ResourcePath.java | ResourcePath.extractComponents | protected List<Component> extractComponents(String path, ComponentParsingStrategy strategy) {
"""
Assumes {@code path} is already normalized via {@link #normalizePath(String)}.
@param path
Path from which components are extracted
@param strategy
How to perform the extraction (literal or look for placeholders... | java | protected List<Component> extractComponents(String path, ComponentParsingStrategy strategy) {
requireNonNull(path);
requireNonNull(strategy);
if ("/".equals(path))
return emptyList();
// Strip off leading /
path = path.substring(1);
List<String> values = asList(path.split("/"));
boo... | [
"protected",
"List",
"<",
"Component",
">",
"extractComponents",
"(",
"String",
"path",
",",
"ComponentParsingStrategy",
"strategy",
")",
"{",
"requireNonNull",
"(",
"path",
")",
";",
"requireNonNull",
"(",
"strategy",
")",
";",
"if",
"(",
"\"/\"",
".",
"equal... | Assumes {@code path} is already normalized via {@link #normalizePath(String)}.
@param path
Path from which components are extracted
@param strategy
How to perform the extraction (literal or look for placeholders)
@return Logical components of the supplied {@code path} | [
"Assumes",
"{",
"@code",
"path",
"}",
"is",
"already",
"normalized",
"via",
"{",
"@link",
"#normalizePath",
"(",
"String",
")",
"}",
"."
] | train | https://github.com/soklet/soklet/blob/4f12de07d9c132e0126d50ad11cc1d8576594700/src/main/java/com/soklet/web/ResourcePath.java#L156-L183 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.