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 |
|---|---|---|---|---|---|---|---|---|---|---|
lukas-krecan/lambda-param-name-extractor | src/main/java/net/javacrumbs/lambdaextractor/ParameterNameExtractor.java | ParameterNameExtractor.lambdaMethod | private static Method lambdaMethod(SerializedLambda serializedLambda) {
"""
<ol>
<li>Serializes lambda to SerializedLambda</li>
<li>Finds containing class - class where the lambda method is implemented</li>
<li>Finds the method in the containing class</li>
</ol>
"""
Class<?> containingClass = getCl... | java | private static Method lambdaMethod(SerializedLambda serializedLambda) {
Class<?> containingClass = getClassForName(serializedLambda.getImplClass());
String implMethodName = serializedLambda.getImplMethodName();
return getMethod(containingClass, implMethodName);
} | [
"private",
"static",
"Method",
"lambdaMethod",
"(",
"SerializedLambda",
"serializedLambda",
")",
"{",
"Class",
"<",
"?",
">",
"containingClass",
"=",
"getClassForName",
"(",
"serializedLambda",
".",
"getImplClass",
"(",
")",
")",
";",
"String",
"implMethodName",
"... | <ol>
<li>Serializes lambda to SerializedLambda</li>
<li>Finds containing class - class where the lambda method is implemented</li>
<li>Finds the method in the containing class</li>
</ol> | [
"<ol",
">",
"<li",
">",
"Serializes",
"lambda",
"to",
"SerializedLambda<",
"/",
"li",
">",
"<li",
">",
"Finds",
"containing",
"class",
"-",
"class",
"where",
"the",
"lambda",
"method",
"is",
"implemented<",
"/",
"li",
">",
"<li",
">",
"Finds",
"the",
"me... | train | https://github.com/lukas-krecan/lambda-param-name-extractor/blob/dec73479df14797771c8ec92819577f32a679362/src/main/java/net/javacrumbs/lambdaextractor/ParameterNameExtractor.java#L83-L87 |
facebook/fresco | imagepipeline-base/src/main/java/com/facebook/imagepipeline/bitmaps/PlatformBitmapFactory.java | PlatformBitmapFactory.createBitmap | public CloseableReference<Bitmap> createBitmap(Bitmap source, @Nullable Object callerContext) {
"""
Creates a bitmap from the specified source bitmap.
It is initialized with the same density as the original bitmap.
@param source The bitmap we are copying
@param callerContext the Tag to track who create the ... | java | public CloseableReference<Bitmap> createBitmap(Bitmap source, @Nullable Object callerContext) {
return createBitmap(source, 0, 0, source.getWidth(), source.getHeight(), callerContext);
} | [
"public",
"CloseableReference",
"<",
"Bitmap",
">",
"createBitmap",
"(",
"Bitmap",
"source",
",",
"@",
"Nullable",
"Object",
"callerContext",
")",
"{",
"return",
"createBitmap",
"(",
"source",
",",
"0",
",",
"0",
",",
"source",
".",
"getWidth",
"(",
")",
"... | Creates a bitmap from the specified source bitmap.
It is initialized with the same density as the original bitmap.
@param source The bitmap we are copying
@param callerContext the Tag to track who create the Bitmap
@return a reference to the bitmap
@throws IllegalArgumentException if the x, y, width, height values a... | [
"Creates",
"a",
"bitmap",
"from",
"the",
"specified",
"source",
"bitmap",
".",
"It",
"is",
"initialized",
"with",
"the",
"same",
"density",
"as",
"the",
"original",
"bitmap",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/bitmaps/PlatformBitmapFactory.java#L124-L126 |
code4everything/util | src/main/java/com/zhazhapan/util/Calculator.java | Calculator.calculate | public static BigDecimal calculate(String formula) throws Exception {
"""
连续计算,使用默认精度(100)
@param formula 表达式
@return {@link BigDecimal}
@throws Exception 异常
"""
formula = formula.replaceAll("\\s", "");
if (isFormula(formula)) {
return doCalculate(formula);
} else {... | java | public static BigDecimal calculate(String formula) throws Exception {
formula = formula.replaceAll("\\s", "");
if (isFormula(formula)) {
return doCalculate(formula);
} else {
throw new Exception("calculation formula is not valid, please check up on it carefully.");
... | [
"public",
"static",
"BigDecimal",
"calculate",
"(",
"String",
"formula",
")",
"throws",
"Exception",
"{",
"formula",
"=",
"formula",
".",
"replaceAll",
"(",
"\"\\\\s\"",
",",
"\"\"",
")",
";",
"if",
"(",
"isFormula",
"(",
"formula",
")",
")",
"{",
"return"... | 连续计算,使用默认精度(100)
@param formula 表达式
@return {@link BigDecimal}
@throws Exception 异常 | [
"连续计算,使用默认精度(100)"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/Calculator.java#L40-L47 |
foundation-runtime/service-directory | 1.1/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/HeartbeatDirectoryRegistrationService.java | HeartbeatDirectoryRegistrationService.unregisterCachedServiceInstance | private void unregisterCachedServiceInstance(
String serviceName, String providerId) {
"""
Delete the Cached ProvidedServiceInstance by serviceName and providerId.
It is thread safe.
@param serviceName
the serviceName.
@param providerId
the providerId.
"""
try {
write.l... | java | private void unregisterCachedServiceInstance(
String serviceName, String providerId) {
try {
write.lock();
ServiceInstanceId id = new ServiceInstanceId(serviceName, providerId);
getCacheServiceInstances().remove(id);
LOGGER.debug(
"... | [
"private",
"void",
"unregisterCachedServiceInstance",
"(",
"String",
"serviceName",
",",
"String",
"providerId",
")",
"{",
"try",
"{",
"write",
".",
"lock",
"(",
")",
";",
"ServiceInstanceId",
"id",
"=",
"new",
"ServiceInstanceId",
"(",
"serviceName",
",",
"prov... | Delete the Cached ProvidedServiceInstance by serviceName and providerId.
It is thread safe.
@param serviceName
the serviceName.
@param providerId
the providerId. | [
"Delete",
"the",
"Cached",
"ProvidedServiceInstance",
"by",
"serviceName",
"and",
"providerId",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/1.1/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/HeartbeatDirectoryRegistrationService.java#L371-L383 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/PropertiesUtils.java | PropertiesUtils.hasProperty | public static boolean hasProperty(Properties props, String key) {
"""
Returns true iff the given Properties contains a property with the given
key (name), and its value is not "false" or "no" or "off".
@param props Properties object
@param key The key to test
@return true iff the given Properties contains a ... | java | public static boolean hasProperty(Properties props, String key) {
String value = props.getProperty(key);
if (value == null) {
return false;
}
value = value.toLowerCase();
return ! (value.equals("false") || value.equals("no") || value.equals("off"));
} | [
"public",
"static",
"boolean",
"hasProperty",
"(",
"Properties",
"props",
",",
"String",
"key",
")",
"{",
"String",
"value",
"=",
"props",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}"... | Returns true iff the given Properties contains a property with the given
key (name), and its value is not "false" or "no" or "off".
@param props Properties object
@param key The key to test
@return true iff the given Properties contains a property with the given
key (name), and its value is not "false" or "no" or "off... | [
"Returns",
"true",
"iff",
"the",
"given",
"Properties",
"contains",
"a",
"property",
"with",
"the",
"given",
"key",
"(",
"name",
")",
"and",
"its",
"value",
"is",
"not",
"false",
"or",
"no",
"or",
"off",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/PropertiesUtils.java#L26-L33 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/PippoSettings.java | PippoSettings.getLong | public long getLong(String name, long defaultValue) {
"""
Returns the long value for the specified name. If the name does not
exist or the value for the name can not be interpreted as an long, the
defaultValue is returned.
@param name
@param defaultValue
@return name value or defaultValue
"""
tr... | java | public long getLong(String name, long defaultValue) {
try {
String value = getString(name, null);
if (!StringUtils.isNullOrEmpty(value)) {
return Long.parseLong(value.trim());
}
} catch (NumberFormatException e) {
log.warn("Failed to parse ... | [
"public",
"long",
"getLong",
"(",
"String",
"name",
",",
"long",
"defaultValue",
")",
"{",
"try",
"{",
"String",
"value",
"=",
"getString",
"(",
"name",
",",
"null",
")",
";",
"if",
"(",
"!",
"StringUtils",
".",
"isNullOrEmpty",
"(",
"value",
")",
")",... | Returns the long value for the specified name. If the name does not
exist or the value for the name can not be interpreted as an long, the
defaultValue is returned.
@param name
@param defaultValue
@return name value or defaultValue | [
"Returns",
"the",
"long",
"value",
"for",
"the",
"specified",
"name",
".",
"If",
"the",
"name",
"does",
"not",
"exist",
"or",
"the",
"value",
"for",
"the",
"name",
"can",
"not",
"be",
"interpreted",
"as",
"an",
"long",
"the",
"defaultValue",
"is",
"retur... | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/PippoSettings.java#L518-L530 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/session/AbstractDocumentQuery.java | AbstractDocumentQuery._whereEndsWith | public void _whereEndsWith(String fieldName, Object value, boolean exact) {
"""
Matches fields which ends with the specified value.
@param fieldName Field name to use
@param value Values to find
"""
WhereParams whereParams = new WhereParams();
whereParams.setFieldName(fieldName);
wher... | java | public void _whereEndsWith(String fieldName, Object value, boolean exact) {
WhereParams whereParams = new WhereParams();
whereParams.setFieldName(fieldName);
whereParams.setValue(value);
whereParams.setAllowWildcards(true);
Object transformToEqualValue = transformValue(wherePara... | [
"public",
"void",
"_whereEndsWith",
"(",
"String",
"fieldName",
",",
"Object",
"value",
",",
"boolean",
"exact",
")",
"{",
"WhereParams",
"whereParams",
"=",
"new",
"WhereParams",
"(",
")",
";",
"whereParams",
".",
"setFieldName",
"(",
"fieldName",
")",
";",
... | Matches fields which ends with the specified value.
@param fieldName Field name to use
@param value Values to find | [
"Matches",
"fields",
"which",
"ends",
"with",
"the",
"specified",
"value",
"."
] | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/session/AbstractDocumentQuery.java#L631-L647 |
OpenLiberty/open-liberty | dev/com.ibm.ws.org.apache.aries.jndi.core/src/org/apache/aries/jndi/startup/Activator.java | Activator.setField | private static void setField(Class<?> expectedType, Object value, boolean saveOriginal) throws IllegalStateException {
"""
/*
There are no public API to reset the InitialContextFactoryBuilder or
ObjectFactoryBuilder on the NamingManager so try to use reflection.
"""
try {
for (Field field... | java | private static void setField(Class<?> expectedType, Object value, boolean saveOriginal) throws IllegalStateException {
try {
for (Field field : NamingManager.class.getDeclaredFields()) {
if (expectedType.equals(field.getType())) {
field.setAccessible(true);
... | [
"private",
"static",
"void",
"setField",
"(",
"Class",
"<",
"?",
">",
"expectedType",
",",
"Object",
"value",
",",
"boolean",
"saveOriginal",
")",
"throws",
"IllegalStateException",
"{",
"try",
"{",
"for",
"(",
"Field",
"field",
":",
"NamingManager",
".",
"c... | /*
There are no public API to reset the InitialContextFactoryBuilder or
ObjectFactoryBuilder on the NamingManager so try to use reflection. | [
"/",
"*",
"There",
"are",
"no",
"public",
"API",
"to",
"reset",
"the",
"InitialContextFactoryBuilder",
"or",
"ObjectFactoryBuilder",
"on",
"the",
"NamingManager",
"so",
"try",
"to",
"use",
"reflection",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.aries.jndi.core/src/org/apache/aries/jndi/startup/Activator.java#L189-L210 |
lindar-open/well-rested-client | src/main/java/com/lindar/wellrested/vo/Result.java | Result.orElseDoAndReturnDefault | public T orElseDoAndReturnDefault(Runnable function, T defaultVal) {
"""
The Runnable function here has NOTHING to do with Threads! It's just a functional interface that allows you to
run a piece of code (function) when the result data is null and success is false - a function that receives and returns nothing (v... | java | public T orElseDoAndReturnDefault(Runnable function, T defaultVal) {
if (isSuccessAndNotNull()) {
return data;
}
function.run();
return defaultVal;
} | [
"public",
"T",
"orElseDoAndReturnDefault",
"(",
"Runnable",
"function",
",",
"T",
"defaultVal",
")",
"{",
"if",
"(",
"isSuccessAndNotNull",
"(",
")",
")",
"{",
"return",
"data",
";",
"}",
"function",
".",
"run",
"(",
")",
";",
"return",
"defaultVal",
";",
... | The Runnable function here has NOTHING to do with Threads! It's just a functional interface that allows you to
run a piece of code (function) when the result data is null and success is false - a function that receives and returns nothing (void)
@param function
@param defaultVal
@return | [
"The",
"Runnable",
"function",
"here",
"has",
"NOTHING",
"to",
"do",
"with",
"Threads!",
"It",
"s",
"just",
"a",
"functional",
"interface",
"that",
"allows",
"you",
"to",
"run",
"a",
"piece",
"of",
"code",
"(",
"function",
")",
"when",
"the",
"result",
"... | train | https://github.com/lindar-open/well-rested-client/blob/d87542f747cd624e3ce0cdc8230f51836326596b/src/main/java/com/lindar/wellrested/vo/Result.java#L124-L130 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseBigDecimal | @Nullable
public static BigDecimal parseBigDecimal (@Nullable final String sStr,
@Nonnegative final int nScale,
@Nonnull final RoundingMode eRoundingMode) {
"""
Parse the given {@link String} as {@link BigDecimal}.
@param ... | java | @Nullable
public static BigDecimal parseBigDecimal (@Nullable final String sStr,
@Nonnegative final int nScale,
@Nonnull final RoundingMode eRoundingMode)
{
return parseBigDecimal (sStr, nScale, eRoundingMode, null);
} | [
"@",
"Nullable",
"public",
"static",
"BigDecimal",
"parseBigDecimal",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"@",
"Nonnegative",
"final",
"int",
"nScale",
",",
"@",
"Nonnull",
"final",
"RoundingMode",
"eRoundingMode",
")",
"{",
"return",
"parseBig... | Parse the given {@link String} as {@link BigDecimal}.
@param sStr
The String to parse. May be <code>null</code>.
@param nScale
The scaling (decimal places) to be used for the result. Must be ≥
0!
@param eRoundingMode
The rounding mode to be used to achieve the scale. May not be
<code>null</code>.
@return <code>null... | [
"Parse",
"the",
"given",
"{",
"@link",
"String",
"}",
"as",
"{",
"@link",
"BigDecimal",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L1509-L1515 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.createProject_POST | public OvhNewProject createProject_POST(Long credit, String description, String voucher) throws IOException {
"""
Start a new cloud project
REST: POST /cloud/createProject
@param credit [required] Amount of cloud credit to purchase. Unit is base currency.
@param description [required] Project description
@pa... | java | public OvhNewProject createProject_POST(Long credit, String description, String voucher) throws IOException {
String qPath = "/cloud/createProject";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "credit", credit);
addBody(o, "description", description);
... | [
"public",
"OvhNewProject",
"createProject_POST",
"(",
"Long",
"credit",
",",
"String",
"description",
",",
"String",
"voucher",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/createProject\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qP... | Start a new cloud project
REST: POST /cloud/createProject
@param credit [required] Amount of cloud credit to purchase. Unit is base currency.
@param description [required] Project description
@param voucher [required] Voucher code | [
"Start",
"a",
"new",
"cloud",
"project"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2356-L2365 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cartServiceOption_domain_GET | public ArrayList<String> cartServiceOption_domain_GET(String whoisOwner) throws IOException {
"""
List available services
REST: GET /order/cartServiceOption/domain
@param whoisOwner Filter the value of whoisOwner property (=)
"""
String qPath = "/order/cartServiceOption/domain";
StringBuilder sb = path... | java | public ArrayList<String> cartServiceOption_domain_GET(String whoisOwner) throws IOException {
String qPath = "/order/cartServiceOption/domain";
StringBuilder sb = path(qPath);
query(sb, "whoisOwner", whoisOwner);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t1);
} | [
"public",
"ArrayList",
"<",
"String",
">",
"cartServiceOption_domain_GET",
"(",
"String",
"whoisOwner",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cartServiceOption/domain\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",... | List available services
REST: GET /order/cartServiceOption/domain
@param whoisOwner Filter the value of whoisOwner property (=) | [
"List",
"available",
"services"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L247-L253 |
dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.beginArray | public String beginArray() throws IOException {
"""
Begins an Array
@return This array's name
@throws IOException Something went wrong reading
"""
String name = null;
if (currentValue.getKey() == NAME) {
name = currentValue.getValue().asString();
consume();
}
if (c... | java | public String beginArray() throws IOException {
String name = null;
if (currentValue.getKey() == NAME) {
name = currentValue.getValue().asString();
consume();
}
if (currentValue.getKey() == BEGIN_ARRAY) {
consume();
} else if (readStack.peek() != BEGIN_ARRAY) {
... | [
"public",
"String",
"beginArray",
"(",
")",
"throws",
"IOException",
"{",
"String",
"name",
"=",
"null",
";",
"if",
"(",
"currentValue",
".",
"getKey",
"(",
")",
"==",
"NAME",
")",
"{",
"name",
"=",
"currentValue",
".",
"getValue",
"(",
")",
".",
"asSt... | Begins an Array
@return This array's name
@throws IOException Something went wrong reading | [
"Begins",
"an",
"Array"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L89-L101 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Types.java | Types.newInstance | public static <T> T newInstance(Class<T> clazz) {
"""
Creates a new instance of the given class by invoking its default constructor.
<p>The given class must be public and must have a public default constructor, and must not be
an array or an interface or be abstract. If an enclosing class, it must be static.
... | java | public static <T> T newInstance(Class<T> clazz) {
// TODO(yanivi): investigate "sneaky" options for allocating the class that GSON uses, like
// setting the constructor to be accessible, or possibly provide a factory method of a special
// name
try {
return clazz.newInstance();
} catch (Illega... | [
"public",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"// TODO(yanivi): investigate \"sneaky\" options for allocating the class that GSON uses, like",
"// setting the constructor to be accessible, or possibly provide a factory method o... | Creates a new instance of the given class by invoking its default constructor.
<p>The given class must be public and must have a public default constructor, and must not be
an array or an interface or be abstract. If an enclosing class, it must be static. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"given",
"class",
"by",
"invoking",
"its",
"default",
"constructor",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Types.java#L108-L119 |
trajano/caliper | caliper/src/main/java/com/google/caliper/options/CommandLineParser.java | CommandLineParser.parseAndInject | public void parseAndInject(String[] args, T injectee) throws InvalidCommandException {
"""
Parses the command-line arguments 'args', setting the @Option fields of the 'optionSource'
provided to the constructor. Returns a list of the positional arguments left over after
processing all options.
"""
this.in... | java | public void parseAndInject(String[] args, T injectee) throws InvalidCommandException {
this.injectee = injectee;
pendingInjections.clear();
Iterator<String> argsIter = Iterators.forArray(args);
ImmutableList.Builder<String> builder = ImmutableList.builder();
while (argsIter.hasNext()) {
Strin... | [
"public",
"void",
"parseAndInject",
"(",
"String",
"[",
"]",
"args",
",",
"T",
"injectee",
")",
"throws",
"InvalidCommandException",
"{",
"this",
".",
"injectee",
"=",
"injectee",
";",
"pendingInjections",
".",
"clear",
"(",
")",
";",
"Iterator",
"<",
"Strin... | Parses the command-line arguments 'args', setting the @Option fields of the 'optionSource'
provided to the constructor. Returns a list of the positional arguments left over after
processing all options. | [
"Parses",
"the",
"command",
"-",
"line",
"arguments",
"args",
"setting",
"the"
] | train | https://github.com/trajano/caliper/blob/a8bcfd84fa9d7b893b3edfadc3b13240ae5cd658/caliper/src/main/java/com/google/caliper/options/CommandLineParser.java#L153-L179 |
linkedin/PalDB | paldb/src/main/java/com/linkedin/paldb/utils/LongPacker.java | LongPacker.packLong | static public int packLong(DataOutput os, long value)
throws IOException {
"""
Pack non-negative long into output stream. It will occupy 1-10 bytes
depending on value (lower values occupy smaller space)
@param os the data output
@param value the long value
@return the number of bytes written
@throws I... | java | static public int packLong(DataOutput os, long value)
throws IOException {
if (value < 0) {
throw new IllegalArgumentException("negative value: v=" + value);
}
int i = 1;
while ((value & ~0x7FL) != 0) {
os.write((((int) value & 0x7F) | 0x80));
value >>>= 7;
i++;
}
... | [
"static",
"public",
"int",
"packLong",
"(",
"DataOutput",
"os",
",",
"long",
"value",
")",
"throws",
"IOException",
"{",
"if",
"(",
"value",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"negative value: v=\"",
"+",
"value",
")",
";"... | Pack non-negative long into output stream. It will occupy 1-10 bytes
depending on value (lower values occupy smaller space)
@param os the data output
@param value the long value
@return the number of bytes written
@throws IOException if an error occurs with the stream | [
"Pack",
"non",
"-",
"negative",
"long",
"into",
"output",
"stream",
".",
"It",
"will",
"occupy",
"1",
"-",
"10",
"bytes",
"depending",
"on",
"value",
"(",
"lower",
"values",
"occupy",
"smaller",
"space",
")"
] | train | https://github.com/linkedin/PalDB/blob/d05ccdd3f67855eb2675dbd82599f19aa7a9f650/paldb/src/main/java/com/linkedin/paldb/utils/LongPacker.java#L45-L60 |
landawn/AbacusUtil | src/com/landawn/abacus/util/DoubleList.java | DoubleList.allMatch | public <E extends Exception> boolean allMatch(Try.DoublePredicate<E> filter) throws E {
"""
Returns whether all elements of this List match the provided predicate.
@param filter
@return
"""
return allMatch(0, size(), filter);
} | java | public <E extends Exception> boolean allMatch(Try.DoublePredicate<E> filter) throws E {
return allMatch(0, size(), filter);
} | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"boolean",
"allMatch",
"(",
"Try",
".",
"DoublePredicate",
"<",
"E",
">",
"filter",
")",
"throws",
"E",
"{",
"return",
"allMatch",
"(",
"0",
",",
"size",
"(",
")",
",",
"filter",
")",
";",
"}"
] | Returns whether all elements of this List match the provided predicate.
@param filter
@return | [
"Returns",
"whether",
"all",
"elements",
"of",
"this",
"List",
"match",
"the",
"provided",
"predicate",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DoubleList.java#L903-L905 |
phax/ph-commons | ph-datetime/src/main/java/com/helger/datetime/util/PDTHelper.java | PDTHelper.birthdayCompare | public static int birthdayCompare (@Nullable final LocalDate aDate1, @Nullable final LocalDate aDate2) {
"""
Compare two dates by birthday. This means, the dates are only compared by
day and month, and <b>not</b> by year!
@param aDate1
First date. May be <code>null</code>.
@param aDate2
Second date. May be ... | java | public static int birthdayCompare (@Nullable final LocalDate aDate1, @Nullable final LocalDate aDate2)
{
if (EqualsHelper.identityEqual (aDate1, aDate2))
return 0;
if (aDate1 == null)
return -1;
if (aDate2 == null)
return 1;
// first compare month
int ret = aDate1.getMonth ().co... | [
"public",
"static",
"int",
"birthdayCompare",
"(",
"@",
"Nullable",
"final",
"LocalDate",
"aDate1",
",",
"@",
"Nullable",
"final",
"LocalDate",
"aDate2",
")",
"{",
"if",
"(",
"EqualsHelper",
".",
"identityEqual",
"(",
"aDate1",
",",
"aDate2",
")",
")",
"retu... | Compare two dates by birthday. This means, the dates are only compared by
day and month, and <b>not</b> by year!
@param aDate1
First date. May be <code>null</code>.
@param aDate2
Second date. May be <code>null</code>.
@return same as {@link Comparator#compare(Object, Object)} | [
"Compare",
"two",
"dates",
"by",
"birthday",
".",
"This",
"means",
"the",
"dates",
"are",
"only",
"compared",
"by",
"day",
"and",
"month",
"and",
"<b",
">",
"not<",
"/",
"b",
">",
"by",
"year!"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-datetime/src/main/java/com/helger/datetime/util/PDTHelper.java#L281-L298 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/TimeZoneGenericNames.java | TimeZoneGenericNames.formatPattern | private synchronized String formatPattern(Pattern pat, String... args) {
"""
Private simple pattern formatter used for formatting generic location names
and partial location names. We intentionally use JDK MessageFormat
for performance reason.
@param pat the message pattern enum
@param args the format argume... | java | private synchronized String formatPattern(Pattern pat, String... args) {
if (_patternFormatters == null) {
_patternFormatters = new MessageFormat[Pattern.values().length];
}
int idx = pat.ordinal();
if (_patternFormatters[idx] == null) {
String patText;
... | [
"private",
"synchronized",
"String",
"formatPattern",
"(",
"Pattern",
"pat",
",",
"String",
"...",
"args",
")",
"{",
"if",
"(",
"_patternFormatters",
"==",
"null",
")",
"{",
"_patternFormatters",
"=",
"new",
"MessageFormat",
"[",
"Pattern",
".",
"values",
"(",... | Private simple pattern formatter used for formatting generic location names
and partial location names. We intentionally use JDK MessageFormat
for performance reason.
@param pat the message pattern enum
@param args the format argument(s)
@return the formatted string | [
"Private",
"simple",
"pattern",
"formatter",
"used",
"for",
"formatting",
"generic",
"location",
"names",
"and",
"partial",
"location",
"names",
".",
"We",
"intentionally",
"use",
"JDK",
"MessageFormat",
"for",
"performance",
"reason",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/TimeZoneGenericNames.java#L443-L462 |
w3c/epubcheck | src/main/java/com/adobe/epubcheck/vocab/Property.java | Property.newFrom | public static Property newFrom(String name, String base, String prefix) {
"""
Creates a new instance from a short name, a prefix, and a stem URI.
@param name
the short name of the property (aka "reference").
@param base
the stem URI used to compute the full URI value.
@param prefix
the prefix used in the C... | java | public static Property newFrom(String name, String base, String prefix)
{
return new Property(name, base, prefix, null);
} | [
"public",
"static",
"Property",
"newFrom",
"(",
"String",
"name",
",",
"String",
"base",
",",
"String",
"prefix",
")",
"{",
"return",
"new",
"Property",
"(",
"name",
",",
"base",
",",
"prefix",
",",
"null",
")",
";",
"}"
] | Creates a new instance from a short name, a prefix, and a stem URI.
@param name
the short name of the property (aka "reference").
@param base
the stem URI used to compute the full URI value.
@param prefix
the prefix used in the CURIE form.
@return | [
"Creates",
"a",
"new",
"instance",
"from",
"a",
"short",
"name",
"a",
"prefix",
"and",
"a",
"stem",
"URI",
"."
] | train | https://github.com/w3c/epubcheck/blob/4d5a24d9f2878a2a5497eb11c036cc18fe2c0a78/src/main/java/com/adobe/epubcheck/vocab/Property.java#L42-L45 |
airlift/resolver | resolver/src/main/java/io/airlift/resolver/internal/Slf4jLoggerManager.java | Slf4jLoggerManager.getLoggerForComponent | public Logger getLoggerForComponent(String role, String hint) {
"""
The logger name for a component with a non-null hint is <code>role.hint</code>.
<b>Warning</b>: this does not conform to logger name as class name convention.
(and what about <code>null</code> and <code>default</code> hint equivalence?)
"""
... | java | public Logger getLoggerForComponent(String role, String hint)
{
return (null == hint
? getLoggerForComponent(role)
: new Slf4jLogger(loggerFactory.getLogger(role + '.' + hint)));
} | [
"public",
"Logger",
"getLoggerForComponent",
"(",
"String",
"role",
",",
"String",
"hint",
")",
"{",
"return",
"(",
"null",
"==",
"hint",
"?",
"getLoggerForComponent",
"(",
"role",
")",
":",
"new",
"Slf4jLogger",
"(",
"loggerFactory",
".",
"getLogger",
"(",
... | The logger name for a component with a non-null hint is <code>role.hint</code>.
<b>Warning</b>: this does not conform to logger name as class name convention.
(and what about <code>null</code> and <code>default</code> hint equivalence?) | [
"The",
"logger",
"name",
"for",
"a",
"component",
"with",
"a",
"non",
"-",
"null",
"hint",
"is",
"<code",
">",
"role",
".",
"hint<",
"/",
"code",
">",
".",
"<b",
">",
"Warning<",
"/",
"b",
">",
":",
"this",
"does",
"not",
"conform",
"to",
"logger",... | train | https://github.com/airlift/resolver/blob/d34a9f3f9c5b0b94007a324d61771bf7eeb27592/resolver/src/main/java/io/airlift/resolver/internal/Slf4jLoggerManager.java#L53-L58 |
btrplace/scheduler | json/src/main/java/org/btrplace/json/model/view/network/StaticRoutingConverter.java | StaticRoutingConverter.nodesMapFromJSON | public StaticRouting.NodesMap nodesMapFromJSON(Model mo, JSONObject o) throws JSONConverterException {
"""
Convert a JSON nodes map object into a Java NodesMap object
@param o the JSON object to convert
@return the nodes map
"""
return new StaticRouting.NodesMap(requiredNode(mo, o, "src"), required... | java | public StaticRouting.NodesMap nodesMapFromJSON(Model mo, JSONObject o) throws JSONConverterException {
return new StaticRouting.NodesMap(requiredNode(mo, o, "src"), requiredNode(mo, o, "dst"));
} | [
"public",
"StaticRouting",
".",
"NodesMap",
"nodesMapFromJSON",
"(",
"Model",
"mo",
",",
"JSONObject",
"o",
")",
"throws",
"JSONConverterException",
"{",
"return",
"new",
"StaticRouting",
".",
"NodesMap",
"(",
"requiredNode",
"(",
"mo",
",",
"o",
",",
"\"src\"",... | Convert a JSON nodes map object into a Java NodesMap object
@param o the JSON object to convert
@return the nodes map | [
"Convert",
"a",
"JSON",
"nodes",
"map",
"object",
"into",
"a",
"Java",
"NodesMap",
"object"
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/model/view/network/StaticRoutingConverter.java#L90-L92 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/validate/Schema.java | Schema.validateAndThrowException | public void validateAndThrowException(String correlationId, Object value) throws ValidationException {
"""
Validates the given value and throws a ValidationException if errors were
found.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param value a value to be ... | java | public void validateAndThrowException(String correlationId, Object value) throws ValidationException {
validateAndThrowException(correlationId, value, false);
} | [
"public",
"void",
"validateAndThrowException",
"(",
"String",
"correlationId",
",",
"Object",
"value",
")",
"throws",
"ValidationException",
"{",
"validateAndThrowException",
"(",
"correlationId",
",",
"value",
",",
"false",
")",
";",
"}"
] | Validates the given value and throws a ValidationException if errors were
found.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param value a value to be validated.
@throws ValidationException when errors occured in validation
@see ValidationException#throwExceptionIfNe... | [
"Validates",
"the",
"given",
"value",
"and",
"throws",
"a",
"ValidationException",
"if",
"errors",
"were",
"found",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/validate/Schema.java#L232-L234 |
GoogleCloudPlatform/google-cloud-datastore | java/datastore/src/main/java/com/google/datastore/v1/client/DatastoreHelper.java | DatastoreHelper.getServiceAccountCredential | public static Credential getServiceAccountCredential(String serviceAccountId,
String privateKeyFile) throws GeneralSecurityException, IOException {
"""
Constructs credentials for the given account and key.
@param serviceAccountId service account ID (typically an e-mail address).
@param privateKeyFile the... | java | public static Credential getServiceAccountCredential(String serviceAccountId,
String privateKeyFile) throws GeneralSecurityException, IOException {
return getServiceAccountCredential(serviceAccountId, privateKeyFile, DatastoreOptions.SCOPES);
} | [
"public",
"static",
"Credential",
"getServiceAccountCredential",
"(",
"String",
"serviceAccountId",
",",
"String",
"privateKeyFile",
")",
"throws",
"GeneralSecurityException",
",",
"IOException",
"{",
"return",
"getServiceAccountCredential",
"(",
"serviceAccountId",
",",
"p... | Constructs credentials for the given account and key.
@param serviceAccountId service account ID (typically an e-mail address).
@param privateKeyFile the file name from which to get the private key.
@return valid credentials or {@code null} | [
"Constructs",
"credentials",
"for",
"the",
"given",
"account",
"and",
"key",
"."
] | train | https://github.com/GoogleCloudPlatform/google-cloud-datastore/blob/a23940d0634d7f537faf01ad9e60598046bcb40a/java/datastore/src/main/java/com/google/datastore/v1/client/DatastoreHelper.java#L163-L166 |
zerodhatech/javakiteconnect | kiteconnect/src/com/zerodhatech/ticker/KiteTicker.java | KiteTicker.getIndeciesData | private Tick getIndeciesData(byte[] bin, int x) {
"""
Parses NSE indices data.
@return Tick is the parsed index data.
"""
int dec = 100;
Tick tick = new Tick();
tick.setMode(modeFull);
tick.setTradable(false);
tick.setInstrumentToken(x);
tick.setLastTradedPrice(... | java | private Tick getIndeciesData(byte[] bin, int x){
int dec = 100;
Tick tick = new Tick();
tick.setMode(modeFull);
tick.setTradable(false);
tick.setInstrumentToken(x);
tick.setLastTradedPrice(convertToDouble(getBytes(bin, 4, 8)) / dec);
tick.setHighPrice(convertToDou... | [
"private",
"Tick",
"getIndeciesData",
"(",
"byte",
"[",
"]",
"bin",
",",
"int",
"x",
")",
"{",
"int",
"dec",
"=",
"100",
";",
"Tick",
"tick",
"=",
"new",
"Tick",
"(",
")",
";",
"tick",
".",
"setMode",
"(",
"modeFull",
")",
";",
"tick",
".",
"setT... | Parses NSE indices data.
@return Tick is the parsed index data. | [
"Parses",
"NSE",
"indices",
"data",
"."
] | train | https://github.com/zerodhatech/javakiteconnect/blob/4a3f15ff2c8a1b3b6ec61799f8bb047e4dfeb92d/kiteconnect/src/com/zerodhatech/ticker/KiteTicker.java#L479-L500 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.getField | @SuppressWarnings( {
"""
Convenience method to get a field from a class type.
The method will first try to look for a declared field in the same class.
If the method is not declared in this class it will look for the field in
the super class. This will continue throughout the whole class hierarchy.
If the fi... | java | @SuppressWarnings({"unchecked", "rawtypes"})
public static Field getField(Class<?> type, String fieldName) {
LinkedList<Class<?>> examine = new LinkedList<Class<?>>();
examine.add(type);
Set<Class<?>> done = new HashSet<Class<?>>();
while (!examine.isEmpty()) {
Class<?> t... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"static",
"Field",
"getField",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"fieldName",
")",
"{",
"LinkedList",
"<",
"Class",
"<",
"?",
">",
">",
"examin... | Convenience method to get a field from a class type.
The method will first try to look for a declared field in the same class.
If the method is not declared in this class it will look for the field in
the super class. This will continue throughout the whole class hierarchy.
If the field is not found an {@link IllegalA... | [
"Convenience",
"method",
"to",
"get",
"a",
"field",
"from",
"a",
"class",
"type",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L198-L225 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/Tick.java | Tick.elapsedTime | public boolean elapsedTime(int rate, long milli) {
"""
Check if specific time has been elapsed (in tick referential).
@param rate The rate reference.
@param milli The milliseconds to check (based on frame time).
@return <code>true</code> if time elapsed, <code>false</code> else.
@throws LionEngineException I... | java | public boolean elapsedTime(int rate, long milli)
{
if (started && rate > 0)
{
final double frameTime = ONE_SECOND_IN_MILLI / rate;
return Double.compare(milli, StrictMath.floor(currentTicks * frameTime)) <= 0;
}
return false;
} | [
"public",
"boolean",
"elapsedTime",
"(",
"int",
"rate",
",",
"long",
"milli",
")",
"{",
"if",
"(",
"started",
"&&",
"rate",
">",
"0",
")",
"{",
"final",
"double",
"frameTime",
"=",
"ONE_SECOND_IN_MILLI",
"/",
"rate",
";",
"return",
"Double",
".",
"compar... | Check if specific time has been elapsed (in tick referential).
@param rate The rate reference.
@param milli The milliseconds to check (based on frame time).
@return <code>true</code> if time elapsed, <code>false</code> else.
@throws LionEngineException If invalid argument. | [
"Check",
"if",
"specific",
"time",
"has",
"been",
"elapsed",
"(",
"in",
"tick",
"referential",
")",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/Tick.java#L140-L148 |
beihaifeiwu/dolphin | dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/formatter/StringHelper.java | StringHelper.collapseQualifier | public static String collapseQualifier(String qualifier, boolean includeDots) {
"""
Given a qualifier, collapse it.
@param qualifier The qualifier to collapse.
@param includeDots Should we include the dots in the collapsed form?
@return The collapsed form.
"""
StringTokenizer tokenizer = new StringT... | java | public static String collapseQualifier(String qualifier, boolean includeDots) {
StringTokenizer tokenizer = new StringTokenizer(qualifier, ".");
String collapsed = Character.toString(tokenizer.nextToken().charAt(0));
while (tokenizer.hasMoreTokens()) {
if (includeDots) {
collapsed += '.';
... | [
"public",
"static",
"String",
"collapseQualifier",
"(",
"String",
"qualifier",
",",
"boolean",
"includeDots",
")",
"{",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokenizer",
"(",
"qualifier",
",",
"\".\"",
")",
";",
"String",
"collapsed",
"=",
"Character"... | Given a qualifier, collapse it.
@param qualifier The qualifier to collapse.
@param includeDots Should we include the dots in the collapsed form?
@return The collapsed form. | [
"Given",
"a",
"qualifier",
"collapse",
"it",
"."
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/formatter/StringHelper.java#L250-L260 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.updateWorkerPool | public WorkerPoolResourceInner updateWorkerPool(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) {
"""
Create or update a worker pool.
Create or update a worker pool.
@param resourceGroupName Name of the resource group to which the resource belongs.
@pa... | java | public WorkerPoolResourceInner updateWorkerPool(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) {
return updateWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).toBlocking().single().body();
} | [
"public",
"WorkerPoolResourceInner",
"updateWorkerPool",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"workerPoolName",
",",
"WorkerPoolResourceInner",
"workerPoolEnvelope",
")",
"{",
"return",
"updateWorkerPoolWithServiceResponseAsync",
"(",
"res... | Create or update a worker pool.
Create or update a worker pool.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param workerPoolName Name of the worker pool.
@param workerPoolEnvelope Properties of the worker pool.
@throws IllegalArgu... | [
"Create",
"or",
"update",
"a",
"worker",
"pool",
".",
"Create",
"or",
"update",
"a",
"worker",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L5387-L5389 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/tm/tmtrafficpolicy_stats.java | tmtrafficpolicy_stats.get | public static tmtrafficpolicy_stats get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch statistics of tmtrafficpolicy_stats resource of given name .
"""
tmtrafficpolicy_stats obj = new tmtrafficpolicy_stats();
obj.set_name(name);
tmtrafficpolicy_stats response = (tmtraffi... | java | public static tmtrafficpolicy_stats get(nitro_service service, String name) throws Exception{
tmtrafficpolicy_stats obj = new tmtrafficpolicy_stats();
obj.set_name(name);
tmtrafficpolicy_stats response = (tmtrafficpolicy_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"tmtrafficpolicy_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"tmtrafficpolicy_stats",
"obj",
"=",
"new",
"tmtrafficpolicy_stats",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
... | Use this API to fetch statistics of tmtrafficpolicy_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"tmtrafficpolicy_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/tm/tmtrafficpolicy_stats.java#L149-L154 |
lessthanoptimal/ejml | main/ejml-core/src/org/ejml/data/DMatrixRMaj.java | DMatrixRMaj.get | @Override
public double get( int row , int col ) {
"""
Returns the value of the specified matrix element. Performs a bounds check to make sure
the requested element is part of the matrix.
@param row The row of the element.
@param col The column of the element.
@return The value of the element.
"""
... | java | @Override
public double get( int row , int col ) {
if( col < 0 || col >= numCols || row < 0 || row >= numRows ) {
throw new IllegalArgumentException("Specified element is out of bounds: "+row+" "+col);
}
return data[ row * numCols + col ];
} | [
"@",
"Override",
"public",
"double",
"get",
"(",
"int",
"row",
",",
"int",
"col",
")",
"{",
"if",
"(",
"col",
"<",
"0",
"||",
"col",
">=",
"numCols",
"||",
"row",
"<",
"0",
"||",
"row",
">=",
"numRows",
")",
"{",
"throw",
"new",
"IllegalArgumentExc... | Returns the value of the specified matrix element. Performs a bounds check to make sure
the requested element is part of the matrix.
@param row The row of the element.
@param col The column of the element.
@return The value of the element. | [
"Returns",
"the",
"value",
"of",
"the",
"specified",
"matrix",
"element",
".",
"Performs",
"a",
"bounds",
"check",
"to",
"make",
"sure",
"the",
"requested",
"element",
"is",
"part",
"of",
"the",
"matrix",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/data/DMatrixRMaj.java#L254-L261 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/MemoryEntityLockStore.java | MemoryEntityLockStore.primAdd | private void primAdd(IEntityLock lock, Date expiration) throws LockingException {
"""
Adds this IEntityLock to the store.
@param lock
@param expiration
"""
long now = System.currentTimeMillis();
long willExpire = expiration.getTime();
long cacheIntervalSecs = (willExpire - now) / 10... | java | private void primAdd(IEntityLock lock, Date expiration) throws LockingException {
long now = System.currentTimeMillis();
long willExpire = expiration.getTime();
long cacheIntervalSecs = (willExpire - now) / 1000;
if (cacheIntervalSecs > 0) {
SmartCache sc = (SmartCache) getL... | [
"private",
"void",
"primAdd",
"(",
"IEntityLock",
"lock",
",",
"Date",
"expiration",
")",
"throws",
"LockingException",
"{",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"long",
"willExpire",
"=",
"expiration",
".",
"getTime",
"(",
... | Adds this IEntityLock to the store.
@param lock
@param expiration | [
"Adds",
"this",
"IEntityLock",
"to",
"the",
"store",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/MemoryEntityLockStore.java#L272-L285 |
authlete/authlete-java-common | src/main/java/com/authlete/common/util/TypedProperties.java | TypedProperties.getEnum | public <TEnum extends Enum<TEnum>> TEnum getEnum(Enum<?> key, Class<TEnum> enumClass, TEnum defaultValue) {
"""
Equivalent to {@link #getEnum(String, Class, Enum)
getEnum}{@code (key.name(), enumClass, defaultValue)}.
If {@code key} is null, {@code defaultValue} is returned.
"""
if (key == null)
... | java | public <TEnum extends Enum<TEnum>> TEnum getEnum(Enum<?> key, Class<TEnum> enumClass, TEnum defaultValue)
{
if (key == null)
{
return defaultValue;
}
return getEnum(key.name(), enumClass, defaultValue);
} | [
"public",
"<",
"TEnum",
"extends",
"Enum",
"<",
"TEnum",
">",
">",
"TEnum",
"getEnum",
"(",
"Enum",
"<",
"?",
">",
"key",
",",
"Class",
"<",
"TEnum",
">",
"enumClass",
",",
"TEnum",
"defaultValue",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{"... | Equivalent to {@link #getEnum(String, Class, Enum)
getEnum}{@code (key.name(), enumClass, defaultValue)}.
If {@code key} is null, {@code defaultValue} is returned. | [
"Equivalent",
"to",
"{"
] | train | https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/util/TypedProperties.java#L424-L432 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/StatisticsInner.java | StatisticsInner.listByAutomationAccountAsync | public Observable<List<StatisticsModelInner>> listByAutomationAccountAsync(String resourceGroupName, String automationAccountName, String filter) {
"""
Retrieve the statistics for the account.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation acco... | java | public Observable<List<StatisticsModelInner>> listByAutomationAccountAsync(String resourceGroupName, String automationAccountName, String filter) {
return listByAutomationAccountWithServiceResponseAsync(resourceGroupName, automationAccountName, filter).map(new Func1<ServiceResponse<List<StatisticsModelInner>>, ... | [
"public",
"Observable",
"<",
"List",
"<",
"StatisticsModelInner",
">",
">",
"listByAutomationAccountAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"filter",
")",
"{",
"return",
"listByAutomationAccountWithServiceResponseAs... | Retrieve the statistics for the account.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param filter The filter to apply on the operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the... | [
"Retrieve",
"the",
"statistics",
"for",
"the",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/StatisticsInner.java#L182-L189 |
CloudSlang/cs-actions | cs-vmware/src/main/java/io/cloudslang/content/vmware/services/VmService.java | VmService.createVM | public Map<String, String> createVM(HttpInputs httpInputs, VmInputs vmInputs) throws Exception {
"""
Method used to connect to specified data center and create a virtual machine using the inputs provided.
@param httpInputs Object that has all the inputs necessary to made a connection to data center
@param vmIn... | java | public Map<String, String> createVM(HttpInputs httpInputs, VmInputs vmInputs) throws Exception {
ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs);
try {
VmUtils utils = new VmUtils();
ManagedObjectReference vmFolderMor = utils.getMorFolder(v... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"createVM",
"(",
"HttpInputs",
"httpInputs",
",",
"VmInputs",
"vmInputs",
")",
"throws",
"Exception",
"{",
"ConnectionResources",
"connectionResources",
"=",
"new",
"ConnectionResources",
"(",
"httpInputs",
",",
... | Method used to connect to specified data center and create a virtual machine using the inputs provided.
@param httpInputs Object that has all the inputs necessary to made a connection to data center
@param vmInputs Object that has all the specific inputs necessary to create a new virtual machine
@return Map with Str... | [
"Method",
"used",
"to",
"connect",
"to",
"specified",
"data",
"center",
"and",
"create",
"a",
"virtual",
"machine",
"using",
"the",
"inputs",
"provided",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-vmware/src/main/java/io/cloudslang/content/vmware/services/VmService.java#L83-L107 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Maps.java | Maps.getOrDefault | public static <K, V> V getOrDefault(final Map<K, V> map, final Object key, final V defaultValue) {
"""
Returns the value to which the specified key is mapped, or
{@code defaultValue} if this map contains no mapping for the key.
@param map
@param key
@param defaultValue
@return
"""
if (N.isNullO... | java | public static <K, V> V getOrDefault(final Map<K, V> map, final Object key, final V defaultValue) {
if (N.isNullOrEmpty(map)) {
return defaultValue;
}
final V val = map.get(key);
if (val != null || map.containsKey(key)) {
return val;
} else {
... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"V",
"getOrDefault",
"(",
"final",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"final",
"Object",
"key",
",",
"final",
"V",
"defaultValue",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"map",
"... | Returns the value to which the specified key is mapped, or
{@code defaultValue} if this map contains no mapping for the key.
@param map
@param key
@param defaultValue
@return | [
"Returns",
"the",
"value",
"to",
"which",
"the",
"specified",
"key",
"is",
"mapped",
"or",
"{",
"@code",
"defaultValue",
"}",
"if",
"this",
"map",
"contains",
"no",
"mapping",
"for",
"the",
"key",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Maps.java#L234-L246 |
qiujiayu/AutoLoadCache | src/main/java/com/jarvis/cache/script/AbstractScriptParser.java | AbstractScriptParser.isCacheable | public boolean isCacheable(ExCache cache, Object target, Object[] arguments, Object result) throws Exception {
"""
是否可以缓存
@param cache ExCache
@param target AOP 拦截到的实例
@param arguments 参数
@param result 执行结果
@return cacheAble 是否可以进行缓存
@throws Exception 异常
"""
if (null == cache || cach... | java | public boolean isCacheable(ExCache cache, Object target, Object[] arguments, Object result) throws Exception {
if (null == cache || cache.expire() < 0 || cache.key().length() == 0) {
return false;
}
boolean rv = true;
if (null != cache.condition() && cache.condition().le... | [
"public",
"boolean",
"isCacheable",
"(",
"ExCache",
"cache",
",",
"Object",
"target",
",",
"Object",
"[",
"]",
"arguments",
",",
"Object",
"result",
")",
"throws",
"Exception",
"{",
"if",
"(",
"null",
"==",
"cache",
"||",
"cache",
".",
"expire",
"(",
")"... | 是否可以缓存
@param cache ExCache
@param target AOP 拦截到的实例
@param arguments 参数
@param result 执行结果
@return cacheAble 是否可以进行缓存
@throws Exception 异常 | [
"是否可以缓存"
] | train | https://github.com/qiujiayu/AutoLoadCache/blob/8121c146f1a420fa6d6832e849acadb547c13622/src/main/java/com/jarvis/cache/script/AbstractScriptParser.java#L127-L136 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java | DatabaseHelper.reuseKerbrosConnection | public void reuseKerbrosConnection(Connection sqlConn, GSSCredential gssCred, Properties props) throws SQLException {
"""
Method used to reuse a connection using kerberos.
This method will reset all connection properties, thus, after a reuse
is called, connection should be treated as if it was a newly created co... | java | public void reuseKerbrosConnection(Connection sqlConn, GSSCredential gssCred, Properties props) throws SQLException {
// an exception would have been thrown earlier than this point, so adding the trace just in case.
if (tc.isDebugEnabled()) {
Tr.debug(this, tc, "Kerberos reuse is not support... | [
"public",
"void",
"reuseKerbrosConnection",
"(",
"Connection",
"sqlConn",
",",
"GSSCredential",
"gssCred",
",",
"Properties",
"props",
")",
"throws",
"SQLException",
"{",
"// an exception would have been thrown earlier than this point, so adding the trace just in case.",
"if",
"(... | Method used to reuse a connection using kerberos.
This method will reset all connection properties, thus, after a reuse
is called, connection should be treated as if it was a newly created connection
@param java.sql.Connection conn
@param GSSCredential gssCred
@param Properties props
@throws SQLException | [
"Method",
"used",
"to",
"reuse",
"a",
"connection",
"using",
"kerberos",
".",
"This",
"method",
"will",
"reset",
"all",
"connection",
"properties",
"thus",
"after",
"a",
"reuse",
"is",
"called",
"connection",
"should",
"be",
"treated",
"as",
"if",
"it",
"was... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java#L1073-L1078 |
Erudika/para | para-client/src/main/java/com/erudika/para/client/ParaClient.java | ParaClient.invokePost | public Response invokePost(String resourcePath, Entity<?> entity) {
"""
Invoke a POST request to the Para API.
@param resourcePath the subpath after '/v1/', should not start with '/'
@param entity request body
@return a {@link Response} object
"""
logger.debug("POST {}, entity: {}", getFullPath(resourcePa... | java | public Response invokePost(String resourcePath, Entity<?> entity) {
logger.debug("POST {}, entity: {}", getFullPath(resourcePath), entity);
return invokeSignedRequest(getApiClient(), accessKey, key(true), POST,
getEndpoint(), getFullPath(resourcePath), null, null, entity);
} | [
"public",
"Response",
"invokePost",
"(",
"String",
"resourcePath",
",",
"Entity",
"<",
"?",
">",
"entity",
")",
"{",
"logger",
".",
"debug",
"(",
"\"POST {}, entity: {}\"",
",",
"getFullPath",
"(",
"resourcePath",
")",
",",
"entity",
")",
";",
"return",
"inv... | Invoke a POST request to the Para API.
@param resourcePath the subpath after '/v1/', should not start with '/'
@param entity request body
@return a {@link Response} object | [
"Invoke",
"a",
"POST",
"request",
"to",
"the",
"Para",
"API",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L336-L340 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java | IOUtils.getPDBConservation | public static String getPDBConservation(boolean web, char c1, char c2, boolean similar) {
"""
Creates formatted String for displaying conservation in PDB output
@param web true for HTML display
@param c1 character in first sequence
@param c2 character in second sequence
@param similar true if c1 and c2 are c... | java | public static String getPDBConservation(boolean web, char c1, char c2, boolean similar) {
return getPDBString(web, c1, c2, similar, "|", ".", " ", web ? " " : " ");
} | [
"public",
"static",
"String",
"getPDBConservation",
"(",
"boolean",
"web",
",",
"char",
"c1",
",",
"char",
"c2",
",",
"boolean",
"similar",
")",
"{",
"return",
"getPDBString",
"(",
"web",
",",
"c1",
",",
"c2",
",",
"similar",
",",
"\"|\"",
",",
"\".\"",
... | Creates formatted String for displaying conservation in PDB output
@param web true for HTML display
@param c1 character in first sequence
@param c2 character in second sequence
@param similar true if c1 and c2 are considered similar compounds
@return formatted String | [
"Creates",
"formatted",
"String",
"for",
"displaying",
"conservation",
"in",
"PDB",
"output"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java#L292-L294 |
bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleGetFileContent | protected FileContent handleGetFileContent(Class<? extends FileEntity> type, Integer entityId, Integer fileId) {
"""
Makes the api call to get the file content
@param type
@param entityId
@param fileId
@return
"""
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForGetFil... | java | protected FileContent handleGetFileContent(Class<? extends FileEntity> type, Integer entityId, Integer fileId) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForGetFile(BullhornEntityInfo.getTypesRestEntityName(type),
entityId, fileId);
String url = restUrlFa... | [
"protected",
"FileContent",
"handleGetFileContent",
"(",
"Class",
"<",
"?",
"extends",
"FileEntity",
">",
"type",
",",
"Integer",
"entityId",
",",
"Integer",
"fileId",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
"=",
"restUriVariablesFact... | Makes the api call to get the file content
@param type
@param entityId
@param fileId
@return | [
"Makes",
"the",
"api",
"call",
"to",
"get",
"the",
"file",
"content"
] | train | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1599-L1607 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/Recording.java | Recording.get | public static Recording get(final BandwidthClient client, final String id) throws Exception {
"""
Recording factory method. Returns recording object from id
@param client the client
@param id the recording id
@return the recording
@throws IOException unexpected error
"""
final String recordin... | java | public static Recording get(final BandwidthClient client, final String id) throws Exception {
final String recordingsUri = client.getUserResourceUri(BandwidthConstants.RECORDINGS_URI_PATH);
final String uri = StringUtils.join(new String[]{
recordingsUri,
id
... | [
"public",
"static",
"Recording",
"get",
"(",
"final",
"BandwidthClient",
"client",
",",
"final",
"String",
"id",
")",
"throws",
"Exception",
"{",
"final",
"String",
"recordingsUri",
"=",
"client",
".",
"getUserResourceUri",
"(",
"BandwidthConstants",
".",
"RECORDI... | Recording factory method. Returns recording object from id
@param client the client
@param id the recording id
@return the recording
@throws IOException unexpected error | [
"Recording",
"factory",
"method",
".",
"Returns",
"recording",
"object",
"from",
"id"
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Recording.java#L80-L89 |
playn/playn | core/src/playn/core/json/JsonObject.java | JsonObject.getBoolean | public boolean getBoolean(String key, boolean default_) {
"""
Returns the {@link Boolean} at the given key, or the default if it does not exist or is the
wrong type.
"""
Object o = get(key);
return o instanceof Boolean ? (Boolean) o : default_;
} | java | public boolean getBoolean(String key, boolean default_) {
Object o = get(key);
return o instanceof Boolean ? (Boolean) o : default_;
} | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
",",
"boolean",
"default_",
")",
"{",
"Object",
"o",
"=",
"get",
"(",
"key",
")",
";",
"return",
"o",
"instanceof",
"Boolean",
"?",
"(",
"Boolean",
")",
"o",
":",
"default_",
";",
"}"
] | Returns the {@link Boolean} at the given key, or the default if it does not exist or is the
wrong type. | [
"Returns",
"the",
"{"
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/json/JsonObject.java#L75-L78 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java | Value.float64Array | public static Value float64Array(@Nullable double[] v) {
"""
Returns an {@code ARRAY<FLOAT64>} value.
@param v the source of element values, which may be null to produce a value for which {@code
isNull()} is {@code true}
"""
return float64Array(v, 0, v == null ? 0 : v.length);
} | java | public static Value float64Array(@Nullable double[] v) {
return float64Array(v, 0, v == null ? 0 : v.length);
} | [
"public",
"static",
"Value",
"float64Array",
"(",
"@",
"Nullable",
"double",
"[",
"]",
"v",
")",
"{",
"return",
"float64Array",
"(",
"v",
",",
"0",
",",
"v",
"==",
"null",
"?",
"0",
":",
"v",
".",
"length",
")",
";",
"}"
] | Returns an {@code ARRAY<FLOAT64>} value.
@param v the source of element values, which may be null to produce a value for which {@code
isNull()} is {@code true} | [
"Returns",
"an",
"{",
"@code",
"ARRAY<FLOAT64",
">",
"}",
"value",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java#L258-L260 |
hamcrest/hamcrest-junit | src/main/java/org/hamcrest/junit/ErrorCollector.java | ErrorCollector.checkThat | public <T> void checkThat(final T value, final Matcher<T> matcher) {
"""
Adds a failure to the table if {@code matcher} does not match {@code value}.
Execution continues, but the test will fail at the end if the match fails.
"""
checkThat("", value, matcher);
} | java | public <T> void checkThat(final T value, final Matcher<T> matcher) {
checkThat("", value, matcher);
} | [
"public",
"<",
"T",
">",
"void",
"checkThat",
"(",
"final",
"T",
"value",
",",
"final",
"Matcher",
"<",
"T",
">",
"matcher",
")",
"{",
"checkThat",
"(",
"\"\"",
",",
"value",
",",
"matcher",
")",
";",
"}"
] | Adds a failure to the table if {@code matcher} does not match {@code value}.
Execution continues, but the test will fail at the end if the match fails. | [
"Adds",
"a",
"failure",
"to",
"the",
"table",
"if",
"{"
] | train | https://github.com/hamcrest/hamcrest-junit/blob/5e02d55230b560f255433bcc490afaeda9e1a043/src/main/java/org/hamcrest/junit/ErrorCollector.java#L54-L56 |
Azure/azure-sdk-for-java | features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/implementation/FeaturesInner.java | FeaturesInner.registerAsync | public Observable<FeatureResultInner> registerAsync(String resourceProviderNamespace, String featureName) {
"""
Registers the preview feature for the subscription.
@param resourceProviderNamespace The namespace of the resource provider.
@param featureName The name of the feature to register.
@throws IllegalAr... | java | public Observable<FeatureResultInner> registerAsync(String resourceProviderNamespace, String featureName) {
return registerWithServiceResponseAsync(resourceProviderNamespace, featureName).map(new Func1<ServiceResponse<FeatureResultInner>, FeatureResultInner>() {
@Override
public FeatureR... | [
"public",
"Observable",
"<",
"FeatureResultInner",
">",
"registerAsync",
"(",
"String",
"resourceProviderNamespace",
",",
"String",
"featureName",
")",
"{",
"return",
"registerWithServiceResponseAsync",
"(",
"resourceProviderNamespace",
",",
"featureName",
")",
".",
"map"... | Registers the preview feature for the subscription.
@param resourceProviderNamespace The namespace of the resource provider.
@param featureName The name of the feature to register.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the FeatureResultInner object | [
"Registers",
"the",
"preview",
"feature",
"for",
"the",
"subscription",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/implementation/FeaturesInner.java#L430-L437 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/json/ArrayExtractor.java | ArrayExtractor.extractObject | public Object extractObject(ObjectToJsonConverter pConverter, Object pValue, Stack<String> pPathParts,boolean jsonify) throws AttributeNotFoundException {
"""
Extract an array and, if to be jsonified, put it into an {@link JSONArray}. An index can be used (on top of
the extra args stack) in order to specify a sin... | java | public Object extractObject(ObjectToJsonConverter pConverter, Object pValue, Stack<String> pPathParts,boolean jsonify) throws AttributeNotFoundException {
int length = pConverter.getCollectionLength(Array.getLength(pValue));
String pathPart = pPathParts.isEmpty() ? null : pPathParts.pop();
if (p... | [
"public",
"Object",
"extractObject",
"(",
"ObjectToJsonConverter",
"pConverter",
",",
"Object",
"pValue",
",",
"Stack",
"<",
"String",
">",
"pPathParts",
",",
"boolean",
"jsonify",
")",
"throws",
"AttributeNotFoundException",
"{",
"int",
"length",
"=",
"pConverter",... | Extract an array and, if to be jsonified, put it into an {@link JSONArray}. An index can be used (on top of
the extra args stack) in order to specify a single value within the array.
@param pConverter the global converter in order to be able do dispatch for
serializing inner data types
@param pValue the value to conve... | [
"Extract",
"an",
"array",
"and",
"if",
"to",
"be",
"jsonified",
"put",
"it",
"into",
"an",
"{",
"@link",
"JSONArray",
"}",
".",
"An",
"index",
"can",
"be",
"used",
"(",
"on",
"top",
"of",
"the",
"extra",
"args",
"stack",
")",
"in",
"order",
"to",
"... | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ArrayExtractor.java#L59-L67 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/ContainerKeyIndex.java | ContainerKeyIndex.validateConditionalUpdate | private CompletableFuture<Void> validateConditionalUpdate(DirectSegmentAccess segment, TableKeyBatch batch, TimeoutTimer timer) {
"""
Validates all the conditional updates specified in the given TableKeyBatch.
@param segment The Segment to operate on.
@param batch The TableKeyBatch to validate.
@param timer... | java | private CompletableFuture<Void> validateConditionalUpdate(DirectSegmentAccess segment, TableKeyBatch batch, TimeoutTimer timer) {
Exceptions.checkNotClosed(this.closed.get(), this);
List<UUID> hashes = batch.getVersionedItems().stream()
.map(TableKeyBatch.Item::getHash)
.... | [
"private",
"CompletableFuture",
"<",
"Void",
">",
"validateConditionalUpdate",
"(",
"DirectSegmentAccess",
"segment",
",",
"TableKeyBatch",
"batch",
",",
"TimeoutTimer",
"timer",
")",
"{",
"Exceptions",
".",
"checkNotClosed",
"(",
"this",
".",
"closed",
".",
"get",
... | Validates all the conditional updates specified in the given TableKeyBatch.
@param segment The Segment to operate on.
@param batch The TableKeyBatch to validate.
@param timer Timer for the operation.
@return A CompletableFuture that, when completed, will indicate that validation succeeded. If the validation did
no... | [
"Validates",
"all",
"the",
"conditional",
"updates",
"specified",
"in",
"the",
"given",
"TableKeyBatch",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/ContainerKeyIndex.java#L396-L414 |
jimmoores/quandl4j | core/src/main/java/com/jimmoores/quandl/SearchResult.java | SearchResult.getCurrentPage | public int getCurrentPage() {
"""
Get the current page of this result set. You can specify the page number in the request. Throws a QuandlRuntimeException if Quandl
response doesn't contain this field, although it should.
@return the page number of this result set
"""
try {
final int currentPage ... | java | public int getCurrentPage() {
try {
final int currentPage = _jsonObject.getJSONObject(META_OBJECT_FIELD).getInt("current_page");
return currentPage;
} catch (JSONException ex) {
throw new QuandlRuntimeException("Could not find total_count field in results from Quandl", ex);
}
} | [
"public",
"int",
"getCurrentPage",
"(",
")",
"{",
"try",
"{",
"final",
"int",
"currentPage",
"=",
"_jsonObject",
".",
"getJSONObject",
"(",
"META_OBJECT_FIELD",
")",
".",
"getInt",
"(",
"\"current_page\"",
")",
";",
"return",
"currentPage",
";",
"}",
"catch",
... | Get the current page of this result set. You can specify the page number in the request. Throws a QuandlRuntimeException if Quandl
response doesn't contain this field, although it should.
@return the page number of this result set | [
"Get",
"the",
"current",
"page",
"of",
"this",
"result",
"set",
".",
"You",
"can",
"specify",
"the",
"page",
"number",
"in",
"the",
"request",
".",
"Throws",
"a",
"QuandlRuntimeException",
"if",
"Quandl",
"response",
"doesn",
"t",
"contain",
"this",
"field",... | train | https://github.com/jimmoores/quandl4j/blob/5d67ae60279d889da93ae7aa3bf6b7d536f88822/core/src/main/java/com/jimmoores/quandl/SearchResult.java#L77-L84 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/xml/CWF2XML.java | CWF2XML.excludeKey | private String excludeKey(String name, String cmpname, String value) {
"""
Returns the exclusion lookup key for the property.
@param name The property name.
@param cmpname The component name (may be null).
@param value The property value (may be null).
@return The exclusion lookup key.
"""
String... | java | private String excludeKey(String name, String cmpname, String value) {
StringBuilder sb = new StringBuilder(cmpname == null ? "" : cmpname + ".");
sb.append(name).append(value == null ? "" : "=" + value);
return sb.toString();
} | [
"private",
"String",
"excludeKey",
"(",
"String",
"name",
",",
"String",
"cmpname",
",",
"String",
"value",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"cmpname",
"==",
"null",
"?",
"\"\"",
":",
"cmpname",
"+",
"\".\"",
")",
";",
"... | Returns the exclusion lookup key for the property.
@param name The property name.
@param cmpname The component name (may be null).
@param value The property value (may be null).
@return The exclusion lookup key. | [
"Returns",
"the",
"exclusion",
"lookup",
"key",
"for",
"the",
"property",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/xml/CWF2XML.java#L191-L195 |
apache/flink | flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosArtifactServer.java | MesosArtifactServer.addFile | public synchronized URL addFile(File localFile, String remoteFile) throws IOException, MalformedURLException {
"""
Adds a file to the artifact server.
@param localFile the local file to serve.
@param remoteFile the remote path with which to locate the file.
@return the fully-qualified remote path to the file.
... | java | public synchronized URL addFile(File localFile, String remoteFile) throws IOException, MalformedURLException {
return addPath(new Path(localFile.toURI()), new Path(remoteFile));
} | [
"public",
"synchronized",
"URL",
"addFile",
"(",
"File",
"localFile",
",",
"String",
"remoteFile",
")",
"throws",
"IOException",
",",
"MalformedURLException",
"{",
"return",
"addPath",
"(",
"new",
"Path",
"(",
"localFile",
".",
"toURI",
"(",
")",
")",
",",
"... | Adds a file to the artifact server.
@param localFile the local file to serve.
@param remoteFile the remote path with which to locate the file.
@return the fully-qualified remote path to the file.
@throws MalformedURLException if the remote path is invalid. | [
"Adds",
"a",
"file",
"to",
"the",
"artifact",
"server",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosArtifactServer.java#L198-L200 |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/HttpUtil.java | HttpUtil.urlWithForm | public static String urlWithForm(String url, Map<String, Object> form, Charset charset, boolean isEncodeParams) {
"""
将表单数据加到URL中(用于GET表单提交)<br>
表单的键值对会被url编码,但是url中原参数不会被编码
@param url URL
@param form 表单数据
@param charset 编码
@param isEncodeParams 是否对键和值做转义处理
@return 合成后的URL
"""
if (isEncodeParams && ... | java | public static String urlWithForm(String url, Map<String, Object> form, Charset charset, boolean isEncodeParams) {
if (isEncodeParams && StrUtil.contains(url, '?')) {
// 在需要编码的情况下,如果url中已经有部分参数,则编码之
url = encodeParams(url, charset);
}
// url和参数是分别编码的
return urlWithForm(url, toParams(form, charset),... | [
"public",
"static",
"String",
"urlWithForm",
"(",
"String",
"url",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"form",
",",
"Charset",
"charset",
",",
"boolean",
"isEncodeParams",
")",
"{",
"if",
"(",
"isEncodeParams",
"&&",
"StrUtil",
".",
"contains",
... | 将表单数据加到URL中(用于GET表单提交)<br>
表单的键值对会被url编码,但是url中原参数不会被编码
@param url URL
@param form 表单数据
@param charset 编码
@param isEncodeParams 是否对键和值做转义处理
@return 合成后的URL | [
"将表单数据加到URL中(用于GET表单提交)<br",
">",
"表单的键值对会被url编码,但是url中原参数不会被编码"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpUtil.java#L604-L612 |
opentok/Opentok-Java-SDK | src/main/java/com/opentok/OpenTok.java | OpenTok.getStream | public Stream getStream(String sessionId, String streamId) throws OpenTokException {
"""
Gets an {@link Stream} object for the given sessionId and streamId.
@param sessionId The session ID.
@param streamId The stream ID.
@return The {@link Stream} object.
"""
String stream = this.client.getStream(... | java | public Stream getStream(String sessionId, String streamId) throws OpenTokException {
String stream = this.client.getStream(sessionId, streamId);
try {
return streamReader.readValue(stream);
} catch (Exception e) {
throw new RequestException("Exception mapping json: " + e.... | [
"public",
"Stream",
"getStream",
"(",
"String",
"sessionId",
",",
"String",
"streamId",
")",
"throws",
"OpenTokException",
"{",
"String",
"stream",
"=",
"this",
".",
"client",
".",
"getStream",
"(",
"sessionId",
",",
"streamId",
")",
";",
"try",
"{",
"return... | Gets an {@link Stream} object for the given sessionId and streamId.
@param sessionId The session ID.
@param streamId The stream ID.
@return The {@link Stream} object. | [
"Gets",
"an",
"{",
"@link",
"Stream",
"}",
"object",
"for",
"the",
"given",
"sessionId",
"and",
"streamId",
"."
] | train | https://github.com/opentok/Opentok-Java-SDK/blob/d71b7999facc3131c415aebea874ea55776d477f/src/main/java/com/opentok/OpenTok.java#L654-L661 |
spotbugs/spotbugs | spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrame.java | MainFrame.openAnalysis | public boolean openAnalysis(File f, SaveType saveType) {
"""
Opens the analysis. Also clears the source and summary panes. Makes
comments enabled false. Sets the saveType and adds the file to the recent
menu.
@param f
@return whether the operation was successful
"""
if (!f.exists() || !f.canRead(... | java | public boolean openAnalysis(File f, SaveType saveType) {
if (!f.exists() || !f.canRead()) {
throw new IllegalArgumentException("Can't read " + f.getPath());
}
mainFrameLoadSaveHelper.prepareForFileLoad(f, saveType);
mainFrameLoadSaveHelper.loadAnalysis(f);
return tr... | [
"public",
"boolean",
"openAnalysis",
"(",
"File",
"f",
",",
"SaveType",
"saveType",
")",
"{",
"if",
"(",
"!",
"f",
".",
"exists",
"(",
")",
"||",
"!",
"f",
".",
"canRead",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Can't re... | Opens the analysis. Also clears the source and summary panes. Makes
comments enabled false. Sets the saveType and adds the file to the recent
menu.
@param f
@return whether the operation was successful | [
"Opens",
"the",
"analysis",
".",
"Also",
"clears",
"the",
"source",
"and",
"summary",
"panes",
".",
"Makes",
"comments",
"enabled",
"false",
".",
"Sets",
"the",
"saveType",
"and",
"adds",
"the",
"file",
"to",
"the",
"recent",
"menu",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrame.java#L392-L401 |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/tar/TarHeader.java | TarHeader.parseOctal | public static long parseOctal(byte[] header, int offset, int length) throws InvalidHeaderException {
"""
Parse an octal string from a header buffer. This is used for the file permission mode value.
@param header
The header buffer from which to parse.
@param offset
The offset into the buffer from which to par... | java | public static long parseOctal(byte[] header, int offset, int length) throws InvalidHeaderException {
long result = 0;
boolean stillPadding = true;
int end = offset + length;
for (int i = offset; i < end; ++i) {
if (header[i] == 0) {
break;
... | [
"public",
"static",
"long",
"parseOctal",
"(",
"byte",
"[",
"]",
"header",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"InvalidHeaderException",
"{",
"long",
"result",
"=",
"0",
";",
"boolean",
"stillPadding",
"=",
"true",
";",
"int",
"end",... | Parse an octal string from a header buffer. This is used for the file permission mode value.
@param header
The header buffer from which to parse.
@param offset
The offset into the buffer from which to parse.
@param length
The number of header bytes to parse.
@return The long value of the octal string. | [
"Parse",
"an",
"octal",
"string",
"from",
"a",
"header",
"buffer",
".",
"This",
"is",
"used",
"for",
"the",
"file",
"permission",
"mode",
"value",
"."
] | train | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/tar/TarHeader.java#L256-L282 |
samskivert/pythagoras | src/main/java/pythagoras/d/Quaternion.java | Quaternion.fromAxes | public Quaternion fromAxes (IVector3 nx, IVector3 ny, IVector3 nz) {
"""
Sets this quaternion to one that rotates onto the given unit axes.
@return a reference to this quaternion, for chaining.
"""
double nxx = nx.x(), nyy = ny.y(), nzz = nz.z();
double x2 = (1f + nxx - nyy - nzz)/4f;
... | java | public Quaternion fromAxes (IVector3 nx, IVector3 ny, IVector3 nz) {
double nxx = nx.x(), nyy = ny.y(), nzz = nz.z();
double x2 = (1f + nxx - nyy - nzz)/4f;
double y2 = (1f - nxx + nyy - nzz)/4f;
double z2 = (1f - nxx - nyy + nzz)/4f;
double w2 = (1f - x2 - y2 - z2);
retu... | [
"public",
"Quaternion",
"fromAxes",
"(",
"IVector3",
"nx",
",",
"IVector3",
"ny",
",",
"IVector3",
"nz",
")",
"{",
"double",
"nxx",
"=",
"nx",
".",
"x",
"(",
")",
",",
"nyy",
"=",
"ny",
".",
"y",
"(",
")",
",",
"nzz",
"=",
"nz",
".",
"z",
"(",
... | Sets this quaternion to one that rotates onto the given unit axes.
@return a reference to this quaternion, for chaining. | [
"Sets",
"this",
"quaternion",
"to",
"one",
"that",
"rotates",
"onto",
"the",
"given",
"unit",
"axes",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Quaternion.java#L137-L147 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/ControlBar.java | ControlBar.addControl | public Widget addControl(String name, int resId, Widget.OnTouchListener listener) {
"""
Add new control at the end of control bar with specified touch listener and resource.
Size of control bar is updated based on new number of controls.
@param name name of the control to remove
@param resId the control face
@... | java | public Widget addControl(String name, int resId, Widget.OnTouchListener listener) {
return addControl(name, resId, null, listener, -1);
} | [
"public",
"Widget",
"addControl",
"(",
"String",
"name",
",",
"int",
"resId",
",",
"Widget",
".",
"OnTouchListener",
"listener",
")",
"{",
"return",
"addControl",
"(",
"name",
",",
"resId",
",",
"null",
",",
"listener",
",",
"-",
"1",
")",
";",
"}"
] | Add new control at the end of control bar with specified touch listener and resource.
Size of control bar is updated based on new number of controls.
@param name name of the control to remove
@param resId the control face
@param listener touch listener | [
"Add",
"new",
"control",
"at",
"the",
"end",
"of",
"control",
"bar",
"with",
"specified",
"touch",
"listener",
"and",
"resource",
".",
"Size",
"of",
"control",
"bar",
"is",
"updated",
"based",
"on",
"new",
"number",
"of",
"controls",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/ControlBar.java#L170-L172 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/http/ApacheHTTPClient.java | ApacheHTTPClient.setRequestContent | protected void setRequestContent(HTTPRequest httpRequest,HttpMethodBase httpMethodClient) {
"""
This function sets the request content.
@param httpRequest
The HTTP request
@param httpMethodClient
The apache HTTP method
"""
//set content
if(httpMethodClient instanceof EntityEnclosingMe... | java | protected void setRequestContent(HTTPRequest httpRequest,HttpMethodBase httpMethodClient)
{
//set content
if(httpMethodClient instanceof EntityEnclosingMethod)
{
EntityEnclosingMethod pushMethod=(EntityEnclosingMethod)httpMethodClient;
RequestEntity reque... | [
"protected",
"void",
"setRequestContent",
"(",
"HTTPRequest",
"httpRequest",
",",
"HttpMethodBase",
"httpMethodClient",
")",
"{",
"//set content",
"if",
"(",
"httpMethodClient",
"instanceof",
"EntityEnclosingMethod",
")",
"{",
"EntityEnclosingMethod",
"pushMethod",
"=",
"... | This function sets the request content.
@param httpRequest
The HTTP request
@param httpMethodClient
The apache HTTP method | [
"This",
"function",
"sets",
"the",
"request",
"content",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/ApacheHTTPClient.java#L397-L428 |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertBodyPresent | public static void assertBodyPresent(String msg, SipMessage sipMessage) {
"""
Asserts that the given SIP message contains a body. Assertion failure output includes the given
message text.
@param msg message text to output if the assertion fails.
@param sipMessage the SIP message.
"""
assertNotNull("N... | java | public static void assertBodyPresent(String msg, SipMessage sipMessage) {
assertNotNull("Null assert object passed in", sipMessage);
assertTrue(msg, sipMessage.getContentLength() > 0);
} | [
"public",
"static",
"void",
"assertBodyPresent",
"(",
"String",
"msg",
",",
"SipMessage",
"sipMessage",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"sipMessage",
")",
";",
"assertTrue",
"(",
"msg",
",",
"sipMessage",
".",
"getContentLeng... | Asserts that the given SIP message contains a body. Assertion failure output includes the given
message text.
@param msg message text to output if the assertion fails.
@param sipMessage the SIP message. | [
"Asserts",
"that",
"the",
"given",
"SIP",
"message",
"contains",
"a",
"body",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
"given",
"message",
"text",
"."
] | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L648-L651 |
wizzardo/tools | modules/tools-io/src/main/java/com/wizzardo/tools/io/BoyerMoore.java | BoyerMoore.suffixLength | private static int suffixLength(byte[] needle, int p) {
"""
Returns the maximum length of the substring ends at p and is a suffix.
"""
int len = 0;
for (int i = p, j = needle.length - 1; i >= 0 && needle[i] == needle[j]; --i, --j) {
len++;
}
return len;
} | java | private static int suffixLength(byte[] needle, int p) {
int len = 0;
for (int i = p, j = needle.length - 1; i >= 0 && needle[i] == needle[j]; --i, --j) {
len++;
}
return len;
} | [
"private",
"static",
"int",
"suffixLength",
"(",
"byte",
"[",
"]",
"needle",
",",
"int",
"p",
")",
"{",
"int",
"len",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"p",
",",
"j",
"=",
"needle",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
"&&"... | Returns the maximum length of the substring ends at p and is a suffix. | [
"Returns",
"the",
"maximum",
"length",
"of",
"the",
"substring",
"ends",
"at",
"p",
"and",
"is",
"a",
"suffix",
"."
] | train | https://github.com/wizzardo/tools/blob/d14a3c5706408ff47973d630f039a7ad00953c24/modules/tools-io/src/main/java/com/wizzardo/tools/io/BoyerMoore.java#L110-L116 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java | SimpleDocTreeVisitor.visitIndex | @Override
public R visitIndex(IndexTree node, P p) {
"""
{@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction}
"""
return defaultAction(node, p);
} | java | @Override
public R visitIndex(IndexTree node, P p) {
return defaultAction(node, p);
} | [
"@",
"Override",
"public",
"R",
"visitIndex",
"(",
"IndexTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"defaultAction",
"(",
"node",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction} | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"calls",
"{",
"@code",
"defaultAction",
"}",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L237-L240 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/collections/CollectionUtils.java | CollectionUtils.TableCellValue | public static <V> Function<Table.Cell<?, ?, V>, V> TableCellValue() {
"""
Guava function to get the value of a {@link com.google.common.collect.Table} cell.
"""
return new Function<Table.Cell<?, ?, V>, V>() {
@Override
public V apply(Table.Cell<?, ?, V> input) {
return input.getValue();... | java | public static <V> Function<Table.Cell<?, ?, V>, V> TableCellValue() {
return new Function<Table.Cell<?, ?, V>, V>() {
@Override
public V apply(Table.Cell<?, ?, V> input) {
return input.getValue();
}
};
} | [
"public",
"static",
"<",
"V",
">",
"Function",
"<",
"Table",
".",
"Cell",
"<",
"?",
",",
"?",
",",
"V",
">",
",",
"V",
">",
"TableCellValue",
"(",
")",
"{",
"return",
"new",
"Function",
"<",
"Table",
".",
"Cell",
"<",
"?",
",",
"?",
",",
"V",
... | Guava function to get the value of a {@link com.google.common.collect.Table} cell. | [
"Guava",
"function",
"to",
"get",
"the",
"value",
"of",
"a",
"{"
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/collections/CollectionUtils.java#L152-L159 |
likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java | AbstractParser.hasKey | protected boolean hasKey(final String key, final JSONObject jsonObject) {
"""
Does the JSONObject have a specified key?
@param key key to check
@param jsonObject object to check
@return true if the key exists
"""
return jsonObject != null
&& jsonObject.has(key);
} | java | protected boolean hasKey(final String key, final JSONObject jsonObject) {
return jsonObject != null
&& jsonObject.has(key);
} | [
"protected",
"boolean",
"hasKey",
"(",
"final",
"String",
"key",
",",
"final",
"JSONObject",
"jsonObject",
")",
"{",
"return",
"jsonObject",
"!=",
"null",
"&&",
"jsonObject",
".",
"has",
"(",
"key",
")",
";",
"}"
] | Does the JSONObject have a specified key?
@param key key to check
@param jsonObject object to check
@return true if the key exists | [
"Does",
"the",
"JSONObject",
"have",
"a",
"specified",
"key?"
] | train | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java#L340-L343 |
datastax/java-driver | query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java | SchemaBuilder.dropFunction | @NonNull
public static Drop dropFunction(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier functionName) {
"""
Starts a DROP FUNCTION query for the given function name for the given keyspace name.
"""
return new DefaultDrop(keyspace, functionName, "FUNCTION");
} | java | @NonNull
public static Drop dropFunction(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier functionName) {
return new DefaultDrop(keyspace, functionName, "FUNCTION");
} | [
"@",
"NonNull",
"public",
"static",
"Drop",
"dropFunction",
"(",
"@",
"Nullable",
"CqlIdentifier",
"keyspace",
",",
"@",
"NonNull",
"CqlIdentifier",
"functionName",
")",
"{",
"return",
"new",
"DefaultDrop",
"(",
"keyspace",
",",
"functionName",
",",
"\"FUNCTION\""... | Starts a DROP FUNCTION query for the given function name for the given keyspace name. | [
"Starts",
"a",
"DROP",
"FUNCTION",
"query",
"for",
"the",
"given",
"function",
"name",
"for",
"the",
"given",
"keyspace",
"name",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java#L515-L519 |
google/j2objc | translator/src/main/java/com/google/devtools/j2objc/translate/Functionizer.java | Functionizer.setFunctionCaller | private void setFunctionCaller(MethodDeclaration method, ExecutableElement methodElement) {
"""
Replace method block statements with single statement that invokes function.
"""
TypeMirror returnType = methodElement.getReturnType();
TypeElement declaringClass = ElementUtil.getDeclaringClass(methodElemen... | java | private void setFunctionCaller(MethodDeclaration method, ExecutableElement methodElement) {
TypeMirror returnType = methodElement.getReturnType();
TypeElement declaringClass = ElementUtil.getDeclaringClass(methodElement);
Block body = new Block();
method.setBody(body);
method.removeModifiers(Modifie... | [
"private",
"void",
"setFunctionCaller",
"(",
"MethodDeclaration",
"method",
",",
"ExecutableElement",
"methodElement",
")",
"{",
"TypeMirror",
"returnType",
"=",
"methodElement",
".",
"getReturnType",
"(",
")",
";",
"TypeElement",
"declaringClass",
"=",
"ElementUtil",
... | Replace method block statements with single statement that invokes function. | [
"Replace",
"method",
"block",
"statements",
"with",
"single",
"statement",
"that",
"invokes",
"function",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/translate/Functionizer.java#L487-L511 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java | ConstantsSummaryBuilder.buildClassConstantSummary | public void buildClassConstantSummary(XMLNode node, Content summariesTree) {
"""
Build the summary for the current class.
@param node the XML element that specifies which components to document
@param summariesTree the tree to which the class constant summary will be added
"""
ClassDoc[] classes = ... | java | public void buildClassConstantSummary(XMLNode node, Content summariesTree) {
ClassDoc[] classes = currentPackage.name().length() > 0 ?
currentPackage.allClasses() :
configuration.classDocCatalog.allClasses(
DocletConstants.DEFAULT_PACKAGE_NAME);
Arrays.sort(classe... | [
"public",
"void",
"buildClassConstantSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"summariesTree",
")",
"{",
"ClassDoc",
"[",
"]",
"classes",
"=",
"currentPackage",
".",
"name",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
"?",
"currentPackage",
".",
... | Build the summary for the current class.
@param node the XML element that specifies which components to document
@param summariesTree the tree to which the class constant summary will be added | [
"Build",
"the",
"summary",
"for",
"the",
"current",
"class",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java#L207-L224 |
lucee/Lucee | core/src/main/java/lucee/runtime/net/rpc/ref/WSClientReflector.java | WSClientReflector.callWithNamedValues | @Override
public Object callWithNamedValues(Config config, Key methodName, Struct arguments) throws PageException {
"""
/*
@Override public Call getLastCall() throws PageException { try { if(getLastCall==null)
getLastCall=clazz.getMethod("getLastCall", WSHandlerReflector.EMPTY_CLASS); return (Call)
getLastC... | java | @Override
public Object callWithNamedValues(Config config, Key methodName, Struct arguments) throws PageException {
try {
if (callWithNamedValues == null) callWithNamedValues = clazz.getMethod("callWithNamedValues", new Class[] { Config.class, Key.class, Struct.class });
return callWithNamedValues.invoke... | [
"@",
"Override",
"public",
"Object",
"callWithNamedValues",
"(",
"Config",
"config",
",",
"Key",
"methodName",
",",
"Struct",
"arguments",
")",
"throws",
"PageException",
"{",
"try",
"{",
"if",
"(",
"callWithNamedValues",
"==",
"null",
")",
"callWithNamedValues",
... | /*
@Override public Call getLastCall() throws PageException { try { if(getLastCall==null)
getLastCall=clazz.getMethod("getLastCall", WSHandlerReflector.EMPTY_CLASS); return (Call)
getLastCall.invoke(obj,WSHandlerReflector.EMPTY_OBJECT); } catch(Exception e) { throw
Caster.toPageException(e); } } | [
"/",
"*"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/rpc/ref/WSClientReflector.java#L179-L188 |
michel-kraemer/bson4jackson | src/main/java/de/undercouch/bson4jackson/io/DynamicOutputBuffer.java | DynamicOutputBuffer.putBytes | public void putBytes(int pos, byte... bs) {
"""
Puts several bytes into the buffer at the given position.
Does not increase the write position.
@param pos the position where to put the bytes
@param bs an array of bytes to put
"""
adaptSize(pos + bs.length);
ByteBuffer bb = null;
int i = _bufferSize;
... | java | public void putBytes(int pos, byte... bs) {
adaptSize(pos + bs.length);
ByteBuffer bb = null;
int i = _bufferSize;
for (byte b : bs) {
if (i == _bufferSize) {
bb = getBuffer(pos);
i = pos % _bufferSize;
}
bb.put(i, b);
++i;
++pos;
}
} | [
"public",
"void",
"putBytes",
"(",
"int",
"pos",
",",
"byte",
"...",
"bs",
")",
"{",
"adaptSize",
"(",
"pos",
"+",
"bs",
".",
"length",
")",
";",
"ByteBuffer",
"bb",
"=",
"null",
";",
"int",
"i",
"=",
"_bufferSize",
";",
"for",
"(",
"byte",
"b",
... | Puts several bytes into the buffer at the given position.
Does not increase the write position.
@param pos the position where to put the bytes
@param bs an array of bytes to put | [
"Puts",
"several",
"bytes",
"into",
"the",
"buffer",
"at",
"the",
"given",
"position",
".",
"Does",
"not",
"increase",
"the",
"write",
"position",
"."
] | train | https://github.com/michel-kraemer/bson4jackson/blob/32d2ab3c516b3c07490fdfcf0c5e4ed0a2ee3979/src/main/java/de/undercouch/bson4jackson/io/DynamicOutputBuffer.java#L362-L375 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java | QueryExecutorImpl.writeToCopy | public synchronized void writeToCopy(CopyOperationImpl op, byte[] data, int off, int siz)
throws SQLException {
"""
Sends data during a live COPY IN operation. Only unlocks the connection if server suddenly
returns CommandComplete, which should not happen
@param op the CopyIn operation presumably current... | java | public synchronized void writeToCopy(CopyOperationImpl op, byte[] data, int off, int siz)
throws SQLException {
if (!hasLock(op)) {
throw new PSQLException(GT.tr("Tried to write to an inactive copy operation"),
PSQLState.OBJECT_NOT_IN_STATE);
}
LOGGER.log(Level.FINEST, " FE=> CopyData... | [
"public",
"synchronized",
"void",
"writeToCopy",
"(",
"CopyOperationImpl",
"op",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"off",
",",
"int",
"siz",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"!",
"hasLock",
"(",
"op",
")",
")",
"{",
"throw",
"new... | Sends data during a live COPY IN operation. Only unlocks the connection if server suddenly
returns CommandComplete, which should not happen
@param op the CopyIn operation presumably currently holding lock on this connection
@param data bytes to send
@param off index of first byte to send (usually 0)
@param siz number ... | [
"Sends",
"data",
"during",
"a",
"live",
"COPY",
"IN",
"operation",
".",
"Only",
"unlocks",
"the",
"connection",
"if",
"server",
"suddenly",
"returns",
"CommandComplete",
"which",
"should",
"not",
"happen"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java#L1012-L1031 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsInner.java | LabsInner.addUsers | public void addUsers(String resourceGroupName, String labAccountName, String labName, List<String> emailAddresses) {
"""
Add users to a lab.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param emailAddresses Li... | java | public void addUsers(String resourceGroupName, String labAccountName, String labName, List<String> emailAddresses) {
addUsersWithServiceResponseAsync(resourceGroupName, labAccountName, labName, emailAddresses).toBlocking().single().body();
} | [
"public",
"void",
"addUsers",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"List",
"<",
"String",
">",
"emailAddresses",
")",
"{",
"addUsersWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"labAccountName... | Add users to a lab.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param emailAddresses List of user emails addresses to add to the lab.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws Cl... | [
"Add",
"users",
"to",
"a",
"lab",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsInner.java#L935-L937 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java | SqlBuilder.buildCondition | private String buildCondition(LogicalOperator logicalOperator, Condition... conditions) {
"""
构建组合条件<br>
例如:name = ? AND type IN (?, ?) AND other LIKE ?
@param logicalOperator 逻辑运算符
@param conditions 条件对象
@return 构建后的SQL语句条件部分
"""
if (ArrayUtil.isEmpty(conditions)) {
return StrUtil.EMPTY;
}
... | java | private String buildCondition(LogicalOperator logicalOperator, Condition... conditions) {
if (ArrayUtil.isEmpty(conditions)) {
return StrUtil.EMPTY;
}
if (null == logicalOperator) {
logicalOperator = LogicalOperator.AND;
}
final StringBuilder conditionStrBuilder = new StringBuilder();
boolea... | [
"private",
"String",
"buildCondition",
"(",
"LogicalOperator",
"logicalOperator",
",",
"Condition",
"...",
"conditions",
")",
"{",
"if",
"(",
"ArrayUtil",
".",
"isEmpty",
"(",
"conditions",
")",
")",
"{",
"return",
"StrUtil",
".",
"EMPTY",
";",
"}",
"if",
"(... | 构建组合条件<br>
例如:name = ? AND type IN (?, ?) AND other LIKE ?
@param logicalOperator 逻辑运算符
@param conditions 条件对象
@return 构建后的SQL语句条件部分 | [
"构建组合条件<br",
">",
"例如:name",
"=",
"?",
"AND",
"type",
"IN",
"(",
"?",
"?",
")",
"AND",
"other",
"LIKE",
"?"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java#L587-L611 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainersInner.java | ProtectionContainersInner.getAsync | public Observable<ProtectionContainerResourceInner> getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName) {
"""
Gets details of the specific container registered to your Recovery Services vault.
@param vaultName The name of the Recovery Services vault.
@param resourceGro... | java | public Observable<ProtectionContainerResourceInner> getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName) {
return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName).map(new Func1<ServiceResponse<ProtectionContainerResourceInner>, Protect... | [
"public",
"Observable",
"<",
"ProtectionContainerResourceInner",
">",
"getAsync",
"(",
"String",
"vaultName",
",",
"String",
"resourceGroupName",
",",
"String",
"fabricName",
",",
"String",
"containerName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"vaultN... | Gets details of the specific container registered to your Recovery Services vault.
@param vaultName The name of the Recovery Services vault.
@param resourceGroupName The name of the resource group associated with the Recovery Services vault.
@param fabricName The fabric name associated with the container.
@param conta... | [
"Gets",
"details",
"of",
"the",
"specific",
"container",
"registered",
"to",
"your",
"Recovery",
"Services",
"vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainersInner.java#L116-L123 |
cloudendpoints/endpoints-management-java | endpoints-control/src/main/java/com/google/api/control/model/ResourceName.java | ResourceName.createFromFullName | @Nullable
public static ResourceName createFromFullName(PathTemplate template, String path) {
"""
Creates a new resource name based on given template and path, where the path contains an
endpoint. If the path does not match, null is returned.
"""
ImmutableMap<String, String> values = template.matchFromF... | java | @Nullable
public static ResourceName createFromFullName(PathTemplate template, String path) {
ImmutableMap<String, String> values = template.matchFromFullName(path);
if (values == null) {
return null;
}
return new ResourceName(template, values, null);
} | [
"@",
"Nullable",
"public",
"static",
"ResourceName",
"createFromFullName",
"(",
"PathTemplate",
"template",
",",
"String",
"path",
")",
"{",
"ImmutableMap",
"<",
"String",
",",
"String",
">",
"values",
"=",
"template",
".",
"matchFromFullName",
"(",
"path",
")",... | Creates a new resource name based on given template and path, where the path contains an
endpoint. If the path does not match, null is returned. | [
"Creates",
"a",
"new",
"resource",
"name",
"based",
"on",
"given",
"template",
"and",
"path",
"where",
"the",
"path",
"contains",
"an",
"endpoint",
".",
"If",
"the",
"path",
"does",
"not",
"match",
"null",
"is",
"returned",
"."
] | train | https://github.com/cloudendpoints/endpoints-management-java/blob/5bbf20ddadbbd51b890049e3c338c28abe2c9f94/endpoints-control/src/main/java/com/google/api/control/model/ResourceName.java#L123-L130 |
line/armeria | thrift/src/main/java/com/linecorp/armeria/server/thrift/THttpService.java | THttpService.newDecorator | public static Function<Service<RpcRequest, RpcResponse>, THttpService> newDecorator(
SerializationFormat defaultSerializationFormat,
Iterable<SerializationFormat> otherAllowedSerializationFormats) {
"""
Creates a new decorator that supports the protocols specified in {@code allowedSerializa... | java | public static Function<Service<RpcRequest, RpcResponse>, THttpService> newDecorator(
SerializationFormat defaultSerializationFormat,
Iterable<SerializationFormat> otherAllowedSerializationFormats) {
final SerializationFormat[] allowedSerializationFormatArray = newAllowedSerializationFor... | [
"public",
"static",
"Function",
"<",
"Service",
"<",
"RpcRequest",
",",
"RpcResponse",
">",
",",
"THttpService",
">",
"newDecorator",
"(",
"SerializationFormat",
"defaultSerializationFormat",
",",
"Iterable",
"<",
"SerializationFormat",
">",
"otherAllowedSerializationForm... | Creates a new decorator that supports the protocols specified in {@code allowedSerializationFormats} and
defaults to the specified {@code defaultSerializationFormat} when the client doesn't specify one.
Currently, the only way to specify a serialization format is by using the HTTP session protocol and
setting the Conte... | [
"Creates",
"a",
"new",
"decorator",
"that",
"supports",
"the",
"protocols",
"specified",
"in",
"{",
"@code",
"allowedSerializationFormats",
"}",
"and",
"defaults",
"to",
"the",
"specified",
"{",
"@code",
"defaultSerializationFormat",
"}",
"when",
"the",
"client",
... | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/thrift/src/main/java/com/linecorp/armeria/server/thrift/THttpService.java#L332-L340 |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/contents/Contents.java | Contents.importXML | public void importXML(String name, int option) {
"""
Imports contents from the given file.
@param name
@param option
"""
console.jcrService().importXML(repository, workspace(), path(), name,
option, new AsyncCallback<Object>() {
@Override
public void onFailur... | java | public void importXML(String name, int option) {
console.jcrService().importXML(repository, workspace(), path(), name,
option, new AsyncCallback<Object>() {
@Override
public void onFailure(Throwable caught) {
SC.say(caught.getMessage());
}
... | [
"public",
"void",
"importXML",
"(",
"String",
"name",
",",
"int",
"option",
")",
"{",
"console",
".",
"jcrService",
"(",
")",
".",
"importXML",
"(",
"repository",
",",
"workspace",
"(",
")",
",",
"path",
"(",
")",
",",
"name",
",",
"option",
",",
"ne... | Imports contents from the given file.
@param name
@param option | [
"Imports",
"contents",
"from",
"the",
"given",
"file",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/contents/Contents.java#L369-L382 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java | Resolve.resolveSelfContaining | Symbol resolveSelfContaining(DiagnosticPosition pos,
Env<AttrContext> env,
Symbol member,
boolean isSuperCall) {
"""
Resolve `c.this' for an enclosing class c that contains the
named member.
@param pos Th... | java | Symbol resolveSelfContaining(DiagnosticPosition pos,
Env<AttrContext> env,
Symbol member,
boolean isSuperCall) {
Symbol sym = resolveSelfContainingInternal(env, member, isSuperCall);
if (sym == null) {
... | [
"Symbol",
"resolveSelfContaining",
"(",
"DiagnosticPosition",
"pos",
",",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"Symbol",
"member",
",",
"boolean",
"isSuperCall",
")",
"{",
"Symbol",
"sym",
"=",
"resolveSelfContainingInternal",
"(",
"env",
",",
"member",
"... | Resolve `c.this' for an enclosing class c that contains the
named member.
@param pos The position to use for error reporting.
@param env The environment current at the expression.
@param member The member that must be contained in the result. | [
"Resolve",
"c",
".",
"this",
"for",
"an",
"enclosing",
"class",
"c",
"that",
"contains",
"the",
"named",
"member",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java#L3577-L3588 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/Popups.java | Popups.makeDraggable | public static void makeDraggable (HasAllMouseHandlers dragHandle, PopupPanel target) {
"""
Adds mouse handlers to the specified drag handle that cause the supplied target popup to be
dragged around the display. The drag handle is assumed to be a child of the popup.
"""
DragHandler dragger = new DragHa... | java | public static void makeDraggable (HasAllMouseHandlers dragHandle, PopupPanel target)
{
DragHandler dragger = new DragHandler(target);
dragHandle.addMouseDownHandler(dragger);
dragHandle.addMouseUpHandler(dragger);
dragHandle.addMouseMoveHandler(dragger);
} | [
"public",
"static",
"void",
"makeDraggable",
"(",
"HasAllMouseHandlers",
"dragHandle",
",",
"PopupPanel",
"target",
")",
"{",
"DragHandler",
"dragger",
"=",
"new",
"DragHandler",
"(",
"target",
")",
";",
"dragHandle",
".",
"addMouseDownHandler",
"(",
"dragger",
")... | Adds mouse handlers to the specified drag handle that cause the supplied target popup to be
dragged around the display. The drag handle is assumed to be a child of the popup. | [
"Adds",
"mouse",
"handlers",
"to",
"the",
"specified",
"drag",
"handle",
"that",
"cause",
"the",
"supplied",
"target",
"popup",
"to",
"be",
"dragged",
"around",
"the",
"display",
".",
"The",
"drag",
"handle",
"is",
"assumed",
"to",
"be",
"a",
"child",
"of"... | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Popups.java#L392-L398 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedceph/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedceph.java | ApiOvhDedicatedceph.serviceName_pool_POST | public String serviceName_pool_POST(String serviceName, String poolName) throws IOException {
"""
Create a new ceph pool
REST: POST /dedicated/ceph/{serviceName}/pool
@param serviceName [required] ID of cluster
@param poolName [required] Name of new pool
API beta
"""
String qPath = "/dedicated/ceph/{... | java | public String serviceName_pool_POST(String serviceName, String poolName) throws IOException {
String qPath = "/dedicated/ceph/{serviceName}/pool";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "poolName", poolName);
String resp = exec(qPath, ... | [
"public",
"String",
"serviceName_pool_POST",
"(",
"String",
"serviceName",
",",
"String",
"poolName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/ceph/{serviceName}/pool\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"se... | Create a new ceph pool
REST: POST /dedicated/ceph/{serviceName}/pool
@param serviceName [required] ID of cluster
@param poolName [required] Name of new pool
API beta | [
"Create",
"a",
"new",
"ceph",
"pool"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedceph/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedceph.java#L108-L115 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ssl_certkey.java | ns_ssl_certkey.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
ns_ssl_certkey_responses result = (ns_ssl_certkey_responses) service.ge... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_ssl_certkey_responses result = (ns_ssl_certkey_responses) service.get_payload_formatter().string_to_resource(ns_ssl_certkey_responses.class, response);
if(result.errorcode != 0)
{
if (result.er... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ns_ssl_certkey_responses",
"result",
"=",
"(",
"ns_ssl_certkey_responses",
")",
"service",
".",
"get_payload_... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ssl_certkey.java#L677-L694 |
azkaban/azkaban | az-core/src/main/java/azkaban/utils/PropsUtils.java | PropsUtils.loadPluginProps | public static Props loadPluginProps(final File pluginDir) {
"""
Load plugin properties
@param pluginDir plugin's Base Directory
@return The properties
"""
if (!pluginDir.exists()) {
logger.error("Error! Plugin path " + pluginDir.getPath() + " doesn't exist.");
return null;
}
if (!p... | java | public static Props loadPluginProps(final File pluginDir) {
if (!pluginDir.exists()) {
logger.error("Error! Plugin path " + pluginDir.getPath() + " doesn't exist.");
return null;
}
if (!pluginDir.isDirectory()) {
logger.error("The plugin path " + pluginDir + " is not a directory.");
... | [
"public",
"static",
"Props",
"loadPluginProps",
"(",
"final",
"File",
"pluginDir",
")",
"{",
"if",
"(",
"!",
"pluginDir",
".",
"exists",
"(",
")",
")",
"{",
"logger",
".",
"error",
"(",
"\"Error! Plugin path \"",
"+",
"pluginDir",
".",
"getPath",
"(",
")",... | Load plugin properties
@param pluginDir plugin's Base Directory
@return The properties | [
"Load",
"plugin",
"properties"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L120-L151 |
aol/cyclops | cyclops/src/main/java/com/oath/cyclops/util/box/MutableLong.java | MutableLong.fromExternal | public static MutableLong fromExternal(final LongSupplier s, final LongConsumer c) {
"""
Construct a MutableLong that gets and sets an external value using the provided Supplier and Consumer
e.g.
<pre>
{@code
MutableLong mutable = MutableLong.fromExternal(()->!this.value,val->!this.value);
}
</pre>
@p... | java | public static MutableLong fromExternal(final LongSupplier s, final LongConsumer c) {
return new MutableLong() {
@Override
public long getAsLong() {
return s.getAsLong();
}
@Override
public Long get() {
return getAsLong(... | [
"public",
"static",
"MutableLong",
"fromExternal",
"(",
"final",
"LongSupplier",
"s",
",",
"final",
"LongConsumer",
"c",
")",
"{",
"return",
"new",
"MutableLong",
"(",
")",
"{",
"@",
"Override",
"public",
"long",
"getAsLong",
"(",
")",
"{",
"return",
"s",
... | Construct a MutableLong that gets and sets an external value using the provided Supplier and Consumer
e.g.
<pre>
{@code
MutableLong mutable = MutableLong.fromExternal(()->!this.value,val->!this.value);
}
</pre>
@param s Supplier of an external value
@param c Consumer that sets an external value
@return MutableLong t... | [
"Construct",
"a",
"MutableLong",
"that",
"gets",
"and",
"sets",
"an",
"external",
"value",
"using",
"the",
"provided",
"Supplier",
"and",
"Consumer"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/com/oath/cyclops/util/box/MutableLong.java#L81-L99 |
Nordstrom/JUnit-Foundation | src/main/java/com/nordstrom/automation/junit/LifecycleHooks.java | LifecycleHooks.getDeclaredField | static Field getDeclaredField(Object target, String name) throws NoSuchFieldException {
"""
Get the specified field of the supplied object.
@param target target object
@param name field name
@return {@link Field} object for the requested field
@throws NoSuchFieldException if a field with the specified name i... | java | static Field getDeclaredField(Object target, String name) throws NoSuchFieldException {
Throwable thrown = null;
for (Class<?> current = target.getClass(); current != null; current = current.getSuperclass()) {
try {
return current.getDeclaredField(name);
} ca... | [
"static",
"Field",
"getDeclaredField",
"(",
"Object",
"target",
",",
"String",
"name",
")",
"throws",
"NoSuchFieldException",
"{",
"Throwable",
"thrown",
"=",
"null",
";",
"for",
"(",
"Class",
"<",
"?",
">",
"current",
"=",
"target",
".",
"getClass",
"(",
... | Get the specified field of the supplied object.
@param target target object
@param name field name
@return {@link Field} object for the requested field
@throws NoSuchFieldException if a field with the specified name is not found
@throws SecurityException if the request is denied | [
"Get",
"the",
"specified",
"field",
"of",
"the",
"supplied",
"object",
"."
] | train | https://github.com/Nordstrom/JUnit-Foundation/blob/f24d91f8677d262c27d18ef29ed633eaac717be5/src/main/java/com/nordstrom/automation/junit/LifecycleHooks.java#L293-L307 |
apache/incubator-druid | sql/src/main/java/org/apache/druid/sql/calcite/planner/Calcites.java | Calcites.jodaToCalciteDate | public static int jodaToCalciteDate(final DateTime dateTime, final DateTimeZone timeZone) {
"""
Calcite expects "DATE" types to be number of days from the epoch to the UTC date matching the local time fields.
@param dateTime joda timestamp
@param timeZone session time zone
@return Calcite style date
"""... | java | public static int jodaToCalciteDate(final DateTime dateTime, final DateTimeZone timeZone)
{
final DateTime date = dateTime.withZone(timeZone).dayOfMonth().roundFloorCopy();
return Days.daysBetween(DateTimes.EPOCH, date.withZoneRetainFields(DateTimeZone.UTC)).getDays();
} | [
"public",
"static",
"int",
"jodaToCalciteDate",
"(",
"final",
"DateTime",
"dateTime",
",",
"final",
"DateTimeZone",
"timeZone",
")",
"{",
"final",
"DateTime",
"date",
"=",
"dateTime",
".",
"withZone",
"(",
"timeZone",
")",
".",
"dayOfMonth",
"(",
")",
".",
"... | Calcite expects "DATE" types to be number of days from the epoch to the UTC date matching the local time fields.
@param dateTime joda timestamp
@param timeZone session time zone
@return Calcite style date | [
"Calcite",
"expects",
"DATE",
"types",
"to",
"be",
"number",
"of",
"days",
"from",
"the",
"epoch",
"to",
"the",
"UTC",
"date",
"matching",
"the",
"local",
"time",
"fields",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/sql/src/main/java/org/apache/druid/sql/calcite/planner/Calcites.java#L237-L241 |
Impetus/Kundera | src/kundera-cassandra/cassandra-ds-driver/src/main/java/com/impetus/kundera/client/cassandra/dsdriver/DSClient.java | DSClient.iterateAndReturn | private List iterateAndReturn(ResultSet rSet, EntityMetadata metadata) {
"""
Iterate and return.
@param rSet
the r set
@param entityClazz
the entity clazz
@param metadata
the metadata
@return the list
"""
MetamodelImpl metaModel =
(MetamodelImpl) kunderaMetadata.getApplicationMetad... | java | private List iterateAndReturn(ResultSet rSet, EntityMetadata metadata) {
MetamodelImpl metaModel =
(MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(metadata.getPersistenceUnit());
EntityType entityType = metaModel.entity(metadata.getEntityClazz());
Iterator<Row>... | [
"private",
"List",
"iterateAndReturn",
"(",
"ResultSet",
"rSet",
",",
"EntityMetadata",
"metadata",
")",
"{",
"MetamodelImpl",
"metaModel",
"=",
"(",
"MetamodelImpl",
")",
"kunderaMetadata",
".",
"getApplicationMetadata",
"(",
")",
".",
"getMetamodel",
"(",
"metadat... | Iterate and return.
@param rSet
the r set
@param entityClazz
the entity clazz
@param metadata
the metadata
@return the list | [
"Iterate",
"and",
"return",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-ds-driver/src/main/java/com/impetus/kundera/client/cassandra/dsdriver/DSClient.java#L811-L827 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/retry/WaitStrategies.java | WaitStrategies.exponentialWait | public static <V> Action1<TaskContext<V>> exponentialWait(long initTime, long maxTime, TimeUnit timeUnit) {
"""
The exponential increase sleep time.
@param initTime The first sleep time.
@param maxTime The max sleep time.
@param timeUnit The time unit.
@param <V> The return value type.
@return The wai... | java | public static <V> Action1<TaskContext<V>> exponentialWait(long initTime, long maxTime, TimeUnit timeUnit) {
return exponentialWait(initTime, maxTime, timeUnit, 2);
} | [
"public",
"static",
"<",
"V",
">",
"Action1",
"<",
"TaskContext",
"<",
"V",
">",
">",
"exponentialWait",
"(",
"long",
"initTime",
",",
"long",
"maxTime",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"return",
"exponentialWait",
"(",
"initTime",
",",
"maxTime",
"... | The exponential increase sleep time.
@param initTime The first sleep time.
@param maxTime The max sleep time.
@param timeUnit The time unit.
@param <V> The return value type.
@return The wait strategy action. | [
"The",
"exponential",
"increase",
"sleep",
"time",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/retry/WaitStrategies.java#L55-L57 |
jledit/jledit | core/src/main/java/org/jledit/utils/Strings.java | Strings.tryToTrimToSize | public static String tryToTrimToSize(String s, int length, boolean trimSuffix) {
"""
Try to trim a String to the given size.
@param s The String to trim.
@param length The trim length.
@param trimSuffix Flag the specifies if trimming should be applied to the suffix of the String.
@retur... | java | public static String tryToTrimToSize(String s, int length, boolean trimSuffix) {
if (s == null || s.isEmpty()) {
return s;
} else if (s.length() <= length) {
return s;
} else if (s.contains(File.separator)) {
String before = s.substring(0, s.lastIndexOf(File.s... | [
"public",
"static",
"String",
"tryToTrimToSize",
"(",
"String",
"s",
",",
"int",
"length",
",",
"boolean",
"trimSuffix",
")",
"{",
"if",
"(",
"s",
"==",
"null",
"||",
"s",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"s",
";",
"}",
"else",
"if",
"... | Try to trim a String to the given size.
@param s The String to trim.
@param length The trim length.
@param trimSuffix Flag the specifies if trimming should be applied to the suffix of the String.
@return | [
"Try",
"to",
"trim",
"a",
"String",
"to",
"the",
"given",
"size",
"."
] | train | https://github.com/jledit/jledit/blob/ced2c4b44330664adb65f8be4c8fff780ccaa6fd/core/src/main/java/org/jledit/utils/Strings.java#L44-L60 |
zxing/zxing | android/src/com/google/zxing/client/android/camera/CameraManager.java | CameraManager.startPreview | public synchronized void startPreview() {
"""
Asks the camera hardware to begin drawing preview frames to the screen.
"""
OpenCamera theCamera = camera;
if (theCamera != null && !previewing) {
theCamera.getCamera().startPreview();
previewing = true;
autoFocusManager = new AutoFocusMan... | java | public synchronized void startPreview() {
OpenCamera theCamera = camera;
if (theCamera != null && !previewing) {
theCamera.getCamera().startPreview();
previewing = true;
autoFocusManager = new AutoFocusManager(context, theCamera.getCamera());
}
} | [
"public",
"synchronized",
"void",
"startPreview",
"(",
")",
"{",
"OpenCamera",
"theCamera",
"=",
"camera",
";",
"if",
"(",
"theCamera",
"!=",
"null",
"&&",
"!",
"previewing",
")",
"{",
"theCamera",
".",
"getCamera",
"(",
")",
".",
"startPreview",
"(",
")",... | Asks the camera hardware to begin drawing preview frames to the screen. | [
"Asks",
"the",
"camera",
"hardware",
"to",
"begin",
"drawing",
"preview",
"frames",
"to",
"the",
"screen",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/android/src/com/google/zxing/client/android/camera/CameraManager.java#L145-L152 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/AsyncWork.java | AsyncWork.listenInline | public final void listenInline(Listener<T> onready, ISynchronizationPoint<TError> onErrorAndCancel) {
"""
Call onready on success, or forward error/cancellation to onErrorAndCancel.
"""
listenInline(new AsyncWorkListener<T,TError>() {
@Override
public void ready(T result) {
onready.fire(result)... | java | public final void listenInline(Listener<T> onready, ISynchronizationPoint<TError> onErrorAndCancel) {
listenInline(new AsyncWorkListener<T,TError>() {
@Override
public void ready(T result) {
onready.fire(result);
}
@Override
public void error(TError error) {
onErrorAndCancel.error(... | [
"public",
"final",
"void",
"listenInline",
"(",
"Listener",
"<",
"T",
">",
"onready",
",",
"ISynchronizationPoint",
"<",
"TError",
">",
"onErrorAndCancel",
")",
"{",
"listenInline",
"(",
"new",
"AsyncWorkListener",
"<",
"T",
",",
"TError",
">",
"(",
")",
"{"... | Call onready on success, or forward error/cancellation to onErrorAndCancel. | [
"Call",
"onready",
"on",
"success",
"or",
"forward",
"error",
"/",
"cancellation",
"to",
"onErrorAndCancel",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/AsyncWork.java#L215-L237 |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/OutputFileWriter.java | OutputFileWriter.getCSVOutput | private byte[] getCSVOutput(List<String[]> lines) {
"""
Returns the CSV output file data.
@param lines The lines to add to the output file
@return The byte array representing the CSV output file data
"""
StringWriter writer = new StringWriter();
csv = new CSVWriter(writer, delimiter.separator... | java | private byte[] getCSVOutput(List<String[]> lines)
{
StringWriter writer = new StringWriter();
csv = new CSVWriter(writer, delimiter.separator().charAt(0));
for(int i = 0; i < lines.size(); i++)
{
csv.writeNext((String[])lines.get(i), quotes);
}
// The con... | [
"private",
"byte",
"[",
"]",
"getCSVOutput",
"(",
"List",
"<",
"String",
"[",
"]",
">",
"lines",
")",
"{",
"StringWriter",
"writer",
"=",
"new",
"StringWriter",
"(",
")",
";",
"csv",
"=",
"new",
"CSVWriter",
"(",
"writer",
",",
"delimiter",
".",
"separ... | Returns the CSV output file data.
@param lines The lines to add to the output file
@return The byte array representing the CSV output file data | [
"Returns",
"the",
"CSV",
"output",
"file",
"data",
"."
] | train | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/OutputFileWriter.java#L225-L236 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java | SARLFormatter._format | protected void _format(SarlBehaviorUnit behaviorUnit, IFormattableDocument document) {
"""
Format a behavior unit.
@param behaviorUnit the behavior unit.
@param document the document.
"""
formatAnnotations(behaviorUnit, document, XbaseFormatterPreferenceKeys.newLineAfterMethodAnnotations);
final ISema... | java | protected void _format(SarlBehaviorUnit behaviorUnit, IFormattableDocument document) {
formatAnnotations(behaviorUnit, document, XbaseFormatterPreferenceKeys.newLineAfterMethodAnnotations);
final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(behaviorUnit);
document.append(regionFor.keyw... | [
"protected",
"void",
"_format",
"(",
"SarlBehaviorUnit",
"behaviorUnit",
",",
"IFormattableDocument",
"document",
")",
"{",
"formatAnnotations",
"(",
"behaviorUnit",
",",
"document",
",",
"XbaseFormatterPreferenceKeys",
".",
"newLineAfterMethodAnnotations",
")",
";",
"fin... | Format a behavior unit.
@param behaviorUnit the behavior unit.
@param document the document. | [
"Format",
"a",
"behavior",
"unit",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java#L441-L468 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/PropertiesUtil.java | PropertiesUtil.getLong | public static long getLong(Properties config, String key, long defaultValue) {
"""
Get long from properties.
This method throws an exception if the long is not valid.
@param config Properties
@param key key in Properties
@param defaultValue default value if value is not set
@return default or value of key
... | java | public static long getLong(Properties config, String key, long defaultValue) {
String val = config.getProperty(key);
if (val == null) {
return defaultValue;
} else {
try {
return Long.parseLong(val);
} catch (NumberFormatException nfe) {
throw new IllegalArgumentException("Value for configuration... | [
"public",
"static",
"long",
"getLong",
"(",
"Properties",
"config",
",",
"String",
"key",
",",
"long",
"defaultValue",
")",
"{",
"String",
"val",
"=",
"config",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"return... | Get long from properties.
This method throws an exception if the long is not valid.
@param config Properties
@param key key in Properties
@param defaultValue default value if value is not set
@return default or value of key | [
"Get",
"long",
"from",
"properties",
".",
"This",
"method",
"throws",
"an",
"exception",
"if",
"the",
"long",
"is",
"not",
"valid",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/PropertiesUtil.java#L61-L73 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexCacheEntry.java | CmsFlexCacheEntry.setVariationData | public void setVariationData(String theVariationKey, Map<String, I_CmsLruCacheObject> theVariationMap) {
"""
Stores a backward reference to the map and key where this cache entry is stored.<p>
This is required for the FlexCache.<p>
@param theVariationKey the variation key
@param theVariationMap the variatio... | java | public void setVariationData(String theVariationKey, Map<String, I_CmsLruCacheObject> theVariationMap) {
m_variationKey = theVariationKey;
m_variationMap = theVariationMap;
} | [
"public",
"void",
"setVariationData",
"(",
"String",
"theVariationKey",
",",
"Map",
"<",
"String",
",",
"I_CmsLruCacheObject",
">",
"theVariationMap",
")",
"{",
"m_variationKey",
"=",
"theVariationKey",
";",
"m_variationMap",
"=",
"theVariationMap",
";",
"}"
] | Stores a backward reference to the map and key where this cache entry is stored.<p>
This is required for the FlexCache.<p>
@param theVariationKey the variation key
@param theVariationMap the variation map | [
"Stores",
"a",
"backward",
"reference",
"to",
"the",
"map",
"and",
"key",
"where",
"this",
"cache",
"entry",
"is",
"stored",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexCacheEntry.java#L553-L557 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/NotesApi.java | NotesApi.createIssueNote | public Note createIssueNote(Object projectIdOrPath, Integer issueIid, String body) throws GitLabApiException {
"""
Create a issues's note.
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance @param projectIdOrPath the project ID to create the issues for
@param issu... | java | public Note createIssueNote(Object projectIdOrPath, Integer issueIid, String body) throws GitLabApiException {
return (createIssueNote(projectIdOrPath, issueIid, body, null));
} | [
"public",
"Note",
"createIssueNote",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
",",
"String",
"body",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"createIssueNote",
"(",
"projectIdOrPath",
",",
"issueIid",
",",
"body",
",",
"null",... | Create a issues's note.
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance @param projectIdOrPath the project ID to create the issues for
@param issueIid the issue IID to create the notes for
@param body the content of note
@return the created Note instance
@throws GitLa... | [
"Create",
"a",
"issues",
"s",
"note",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/NotesApi.java#L154-L156 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.serializeChannel | public byte[] serializeChannel() throws IOException, InvalidArgumentException {
"""
Serialize channel to a byte array using Java serialization.
Deserialized channel will NOT be in an initialized state.
@throws InvalidArgumentException
@throws IOException
"""
if (isShutdown()) {
throw ... | java | public byte[] serializeChannel() throws IOException, InvalidArgumentException {
if (isShutdown()) {
throw new InvalidArgumentException(format("Channel %s has been shutdown.", getName()));
}
ObjectOutputStream out = null;
try {
ByteArrayOutputStream bai = new By... | [
"public",
"byte",
"[",
"]",
"serializeChannel",
"(",
")",
"throws",
"IOException",
",",
"InvalidArgumentException",
"{",
"if",
"(",
"isShutdown",
"(",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"format",
"(",
"\"Channel %s has been shutdown.\"",... | Serialize channel to a byte array using Java serialization.
Deserialized channel will NOT be in an initialized state.
@throws InvalidArgumentException
@throws IOException | [
"Serialize",
"channel",
"to",
"a",
"byte",
"array",
"using",
"Java",
"serialization",
".",
"Deserialized",
"channel",
"will",
"NOT",
"be",
"in",
"an",
"initialized",
"state",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L6164-L6188 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java | BusItinerary.getDistanceBetweenBusHalts | @Pure
public double getDistanceBetweenBusHalts(int firsthaltIndex, int lasthaltIndex) {
"""
Replies the distance between two bus halt.
@param firsthaltIndex is the index of the first bus halt.
@param lasthaltIndex is the index of the last bus halt.
@return the distance in meters between the given bus halts.
... | java | @Pure
public double getDistanceBetweenBusHalts(int firsthaltIndex, int lasthaltIndex) {
if (firsthaltIndex < 0 || firsthaltIndex >= this.validHalts.size() - 1) {
throw new ArrayIndexOutOfBoundsException(firsthaltIndex);
}
if (lasthaltIndex <= firsthaltIndex || lasthaltIndex >= this.validHalts.size()) {
thr... | [
"@",
"Pure",
"public",
"double",
"getDistanceBetweenBusHalts",
"(",
"int",
"firsthaltIndex",
",",
"int",
"lasthaltIndex",
")",
"{",
"if",
"(",
"firsthaltIndex",
"<",
"0",
"||",
"firsthaltIndex",
">=",
"this",
".",
"validHalts",
".",
"size",
"(",
")",
"-",
"1... | Replies the distance between two bus halt.
@param firsthaltIndex is the index of the first bus halt.
@param lasthaltIndex is the index of the last bus halt.
@return the distance in meters between the given bus halts. | [
"Replies",
"the",
"distance",
"between",
"two",
"bus",
"halt",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java#L934-L970 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/lock/LockTable.java | LockTable.addLock | public synchronized SessionInfo addLock(Object bookmark, SessionInfo sessionInfo) {
"""
Add this lock to the table.
@param bookmark The bookmark to lock.
@param session The session to lock.
@return null if successful, the session of the locking user if not successful.
"""
Utility.getLogger().info("L... | java | public synchronized SessionInfo addLock(Object bookmark, SessionInfo sessionInfo)
{
Utility.getLogger().info("Lock: " + bookmark + ", Session: " + sessionInfo.m_iSessionID + " success: " + !this.containsKey(bookmark));
if (this.containsKey(bookmark))
return (SessionInfo)this.get(bookmark... | [
"public",
"synchronized",
"SessionInfo",
"addLock",
"(",
"Object",
"bookmark",
",",
"SessionInfo",
"sessionInfo",
")",
"{",
"Utility",
".",
"getLogger",
"(",
")",
".",
"info",
"(",
"\"Lock: \"",
"+",
"bookmark",
"+",
"\", Session: \"",
"+",
"sessionInfo",
".",
... | Add this lock to the table.
@param bookmark The bookmark to lock.
@param session The session to lock.
@return null if successful, the session of the locking user if not successful. | [
"Add",
"this",
"lock",
"to",
"the",
"table",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/lock/LockTable.java#L34-L40 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermListsImpl.java | ListManagementTermListsImpl.updateAsync | public Observable<TermList> updateAsync(String listId, String contentType, BodyModel bodyParameter) {
"""
Updates an Term List.
@param listId List Id of the image list.
@param contentType The content type.
@param bodyParameter Schema of the body.
@throws IllegalArgumentException thrown if parameters fail the... | java | public Observable<TermList> updateAsync(String listId, String contentType, BodyModel bodyParameter) {
return updateWithServiceResponseAsync(listId, contentType, bodyParameter).map(new Func1<ServiceResponse<TermList>, TermList>() {
@Override
public TermList call(ServiceResponse<TermList> ... | [
"public",
"Observable",
"<",
"TermList",
">",
"updateAsync",
"(",
"String",
"listId",
",",
"String",
"contentType",
",",
"BodyModel",
"bodyParameter",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"listId",
",",
"contentType",
",",
"bodyParameter",
")",... | Updates an Term List.
@param listId List Id of the image list.
@param contentType The content type.
@param bodyParameter Schema of the body.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the TermList object | [
"Updates",
"an",
"Term",
"List",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermListsImpl.java#L283-L290 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java | CPInstancePersistenceImpl.findByG_ST | @Override
public List<CPInstance> findByG_ST(long groupId, int status, int start,
int end, OrderByComparator<CPInstance> orderByComparator) {
"""
Returns an ordered range of all the cp instances where groupId = ? and status = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - st... | java | @Override
public List<CPInstance> findByG_ST(long groupId, int status, int start,
int end, OrderByComparator<CPInstance> orderByComparator) {
return findByG_ST(groupId, status, start, end, orderByComparator, true);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPInstance",
">",
"findByG_ST",
"(",
"long",
"groupId",
",",
"int",
"status",
",",
"int",
"start",
",",
"int",
"end",
",",
"OrderByComparator",
"<",
"CPInstance",
">",
"orderByComparator",
")",
"{",
"return",
"findByG... | Returns an ordered range of all the cp instances where groupId = ? and status = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the fi... | [
"Returns",
"an",
"ordered",
"range",
"of",
"all",
"the",
"cp",
"instances",
"where",
"groupId",
"=",
"?",
";",
"and",
"status",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java#L3069-L3073 |
ozimov/cirneco | hamcrest/guava-hamcrest-matchers/src/main/java/it/ozimov/cirneco/hamcrest/guava/collect/IsMultisetElementWithCount.java | IsMultisetElementWithCount.elementWithCount | public static <E> Matcher<Multiset<E>> elementWithCount(final E element, final int size) {
"""
Creates a matcher for {@linkplain Multiset} matching when the examined object <code>E</code> has <code>
size</code> occurrences.
"""
return new IsMultisetElementWithCount(element, size);
} | java | public static <E> Matcher<Multiset<E>> elementWithCount(final E element, final int size) {
return new IsMultisetElementWithCount(element, size);
} | [
"public",
"static",
"<",
"E",
">",
"Matcher",
"<",
"Multiset",
"<",
"E",
">",
">",
"elementWithCount",
"(",
"final",
"E",
"element",
",",
"final",
"int",
"size",
")",
"{",
"return",
"new",
"IsMultisetElementWithCount",
"(",
"element",
",",
"size",
")",
"... | Creates a matcher for {@linkplain Multiset} matching when the examined object <code>E</code> has <code>
size</code> occurrences. | [
"Creates",
"a",
"matcher",
"for",
"{"
] | train | https://github.com/ozimov/cirneco/blob/78ad782da0a2256634cfbebb2f97ed78c993b999/hamcrest/guava-hamcrest-matchers/src/main/java/it/ozimov/cirneco/hamcrest/guava/collect/IsMultisetElementWithCount.java#L31-L33 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/CommonUtils.java | CommonUtils.convertMsToDate | public static String convertMsToDate(long millis, String dateFormatPattern) {
"""
Converts a millisecond number to a formatted date String.
@param millis a long millisecond number
@param dateFormatPattern the date format to follow when converting. i.e. mm-dd-yyyy
@return formatted date String
"""
Date... | java | public static String convertMsToDate(long millis, String dateFormatPattern) {
DateFormat dateFormat = new SimpleDateFormat(dateFormatPattern);
return dateFormat.format(new Date(millis));
} | [
"public",
"static",
"String",
"convertMsToDate",
"(",
"long",
"millis",
",",
"String",
"dateFormatPattern",
")",
"{",
"DateFormat",
"dateFormat",
"=",
"new",
"SimpleDateFormat",
"(",
"dateFormatPattern",
")",
";",
"return",
"dateFormat",
".",
"format",
"(",
"new",... | Converts a millisecond number to a formatted date String.
@param millis a long millisecond number
@param dateFormatPattern the date format to follow when converting. i.e. mm-dd-yyyy
@return formatted date String | [
"Converts",
"a",
"millisecond",
"number",
"to",
"a",
"formatted",
"date",
"String",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L606-L609 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.