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 |
|---|---|---|---|---|---|---|---|---|---|---|
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/transform/serde/JsonMappers.java | JsonMappers.registerLegacyCustomClassesForJSON | public static void registerLegacyCustomClassesForJSON(List<Pair<String,Class>> classes) {
"""
Register a set of classes (Layer, GraphVertex, InputPreProcessor, IActivation, ILossFunction, ReconstructionDistribution
ONLY) for JSON deserialization, with custom names.<br>
Using this method directly should never be ... | java | public static void registerLegacyCustomClassesForJSON(List<Pair<String,Class>> classes){
for(Pair<String,Class> p : classes){
String s = p.getFirst();
Class c = p.getRight();
//Check if it's a valid class to register...
boolean found = false;
for( Clas... | [
"public",
"static",
"void",
"registerLegacyCustomClassesForJSON",
"(",
"List",
"<",
"Pair",
"<",
"String",
",",
"Class",
">",
">",
"classes",
")",
"{",
"for",
"(",
"Pair",
"<",
"String",
",",
"Class",
">",
"p",
":",
"classes",
")",
"{",
"String",
"s",
... | Register a set of classes (Layer, GraphVertex, InputPreProcessor, IActivation, ILossFunction, ReconstructionDistribution
ONLY) for JSON deserialization, with custom names.<br>
Using this method directly should never be required (instead: use {@link #registerLegacyCustomClassesForJSON(Class[])}
but is added in case it i... | [
"Register",
"a",
"set",
"of",
"classes",
"(",
"Layer",
"GraphVertex",
"InputPreProcessor",
"IActivation",
"ILossFunction",
"ReconstructionDistribution",
"ONLY",
")",
"for",
"JSON",
"deserialization",
"with",
"custom",
"names",
".",
"<br",
">",
"Using",
"this",
"meth... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/serde/JsonMappers.java#L160-L179 |
BioPAX/Paxtools | paxtools-core/src/main/java/org/biopax/paxtools/io/BioPAXIOHandlerAdapter.java | BioPAXIOHandlerAdapter.bindValue | protected void bindValue(String valueString, PropertyEditor editor, BioPAXElement bpe, Model model) {
"""
This method binds the value to the bpe. Actual assignment is handled by the editor - but this method performs
most of the workarounds and also error handling due to invalid parameters.
@param valueString to ... | java | protected void bindValue(String valueString, PropertyEditor editor, BioPAXElement bpe, Model model)
{
if (log.isDebugEnabled())
{
log.debug("Binding: " + bpe + '(' + bpe.getModelInterface() + " has " + editor + ' ' + valueString);
}
Object value = (valueString==null)?null:valueString.trim();
if (editor... | [
"protected",
"void",
"bindValue",
"(",
"String",
"valueString",
",",
"PropertyEditor",
"editor",
",",
"BioPAXElement",
"bpe",
",",
"Model",
"model",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Binding... | This method binds the value to the bpe. Actual assignment is handled by the editor - but this method performs
most of the workarounds and also error handling due to invalid parameters.
@param valueString to be assigned
@param editor that maps to the property
@param bpe to be bound
@param model to be populated. | [
"This",
"method",
"binds",
"the",
"value",
"to",
"the",
"bpe",
".",
"Actual",
"assignment",
"is",
"handled",
"by",
"the",
"editor",
"-",
"but",
"this",
"method",
"performs",
"most",
"of",
"the",
"workarounds",
"and",
"also",
"error",
"handling",
"due",
"to... | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/io/BioPAXIOHandlerAdapter.java#L312-L339 |
JodaOrg/joda-money | src/main/java/org/joda/money/BigMoney.java | BigMoney.ofScale | public static BigMoney ofScale(CurrencyUnit currency, BigDecimal amount, int scale) {
"""
Obtains an instance of {@code BigMoney} from a {@code BigDecimal} at a specific scale.
<p>
This allows you to create an instance with a specific currency and amount.
No rounding is performed on the amount, so it must have ... | java | public static BigMoney ofScale(CurrencyUnit currency, BigDecimal amount, int scale) {
return BigMoney.ofScale(currency, amount, scale, RoundingMode.UNNECESSARY);
} | [
"public",
"static",
"BigMoney",
"ofScale",
"(",
"CurrencyUnit",
"currency",
",",
"BigDecimal",
"amount",
",",
"int",
"scale",
")",
"{",
"return",
"BigMoney",
".",
"ofScale",
"(",
"currency",
",",
"amount",
",",
"scale",
",",
"RoundingMode",
".",
"UNNECESSARY",... | Obtains an instance of {@code BigMoney} from a {@code BigDecimal} at a specific scale.
<p>
This allows you to create an instance with a specific currency and amount.
No rounding is performed on the amount, so it must have a
scale less than or equal to the new scale.
The result will have a minimum scale of zero.
@param... | [
"Obtains",
"an",
"instance",
"of",
"{",
"@code",
"BigMoney",
"}",
"from",
"a",
"{",
"@code",
"BigDecimal",
"}",
"at",
"a",
"specific",
"scale",
".",
"<p",
">",
"This",
"allows",
"you",
"to",
"create",
"an",
"instance",
"with",
"a",
"specific",
"currency"... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/BigMoney.java#L131-L133 |
line/armeria | thrift/src/main/java/com/linecorp/armeria/common/thrift/AsyncMethodCallbacks.java | AsyncMethodCallbacks.invokeOnError | public static void invokeOnError(AsyncMethodCallback<?> callback, Throwable cause) {
"""
Invokes {@link AsyncMethodCallback#onError(Exception)}. If the specified {@code cause} is not an
{@link Exception}, it will be wrapped with a {@link CompletionException}.
"""
requireNonNull(callback, "callback");
... | java | public static void invokeOnError(AsyncMethodCallback<?> callback, Throwable cause) {
requireNonNull(callback, "callback");
requireNonNull(cause, "cause");
if (cause instanceof Exception) {
callback.onError((Exception) cause);
} else {
callback.onError(new Completi... | [
"public",
"static",
"void",
"invokeOnError",
"(",
"AsyncMethodCallback",
"<",
"?",
">",
"callback",
",",
"Throwable",
"cause",
")",
"{",
"requireNonNull",
"(",
"callback",
",",
"\"callback\"",
")",
";",
"requireNonNull",
"(",
"cause",
",",
"\"cause\"",
")",
";... | Invokes {@link AsyncMethodCallback#onError(Exception)}. If the specified {@code cause} is not an
{@link Exception}, it will be wrapped with a {@link CompletionException}. | [
"Invokes",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/thrift/src/main/java/com/linecorp/armeria/common/thrift/AsyncMethodCallbacks.java#L67-L75 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/super_src/org/opencms/util/CmsUUID.java | CmsUUID.checkId | public static void checkId(CmsUUID id, boolean canBeNull) {
"""
Check that the given id is not the null id.<p>
@param id the id to check
@param canBeNull only if flag is set, <code>null</code> is accepted
@see #isNullUUID()
"""
if (canBeNull && (id == null)) {
return;
}
... | java | public static void checkId(CmsUUID id, boolean canBeNull) {
if (canBeNull && (id == null)) {
return;
}
if ((!canBeNull && (id == null)) || id.isNullUUID()) {
throw new IllegalArgumentException(Messages.get().key(Messages.ERR_INVALID_UUID_1, id));
}
} | [
"public",
"static",
"void",
"checkId",
"(",
"CmsUUID",
"id",
",",
"boolean",
"canBeNull",
")",
"{",
"if",
"(",
"canBeNull",
"&&",
"(",
"id",
"==",
"null",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"(",
"!",
"canBeNull",
"&&",
"(",
"id",
"==",
... | Check that the given id is not the null id.<p>
@param id the id to check
@param canBeNull only if flag is set, <code>null</code> is accepted
@see #isNullUUID() | [
"Check",
"that",
"the",
"given",
"id",
"is",
"not",
"the",
"null",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/super_src/org/opencms/util/CmsUUID.java#L78-L86 |
forge/furnace | se/src/main/java/org/jboss/forge/furnace/se/FurnaceFactory.java | FurnaceFactory.getInstance | public static Furnace getInstance(final ClassLoader clientLoader) {
"""
Produce a {@link Furnace} instance using the given {@link ClassLoader} to act as the client for which
{@link Class} instances should be translated across {@link ClassLoader} boundaries, and using the default
bootstrap {@link ClassLoader} to ... | java | public static Furnace getInstance(final ClassLoader clientLoader)
{
final BootstrapClassLoader loader = new BootstrapClassLoader("bootpath");
return getInstance(clientLoader, loader);
} | [
"public",
"static",
"Furnace",
"getInstance",
"(",
"final",
"ClassLoader",
"clientLoader",
")",
"{",
"final",
"BootstrapClassLoader",
"loader",
"=",
"new",
"BootstrapClassLoader",
"(",
"\"bootpath\"",
")",
";",
"return",
"getInstance",
"(",
"clientLoader",
",",
"loa... | Produce a {@link Furnace} instance using the given {@link ClassLoader} to act as the client for which
{@link Class} instances should be translated across {@link ClassLoader} boundaries, and using the default
bootstrap {@link ClassLoader} to load core furnace implementation JARs from `<code>src/main/java/bootpath/*</cod... | [
"Produce",
"a",
"{"
] | train | https://github.com/forge/furnace/blob/bbe6deaa3c0d85ba43daa3e2f7d486f2dad21e0a/se/src/main/java/org/jboss/forge/furnace/se/FurnaceFactory.java#L47-L51 |
wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java | JacksonSingleton.setMappers | private void setMappers(ObjectMapper mapper, XmlMapper xml) {
"""
Sets the object mapper.
@param mapper the object mapper to use
"""
synchronized (lock) {
this.mapper = mapper;
this.xml = xml;
// mapper and xml are set to null on invalidation.
if (mapp... | java | private void setMappers(ObjectMapper mapper, XmlMapper xml) {
synchronized (lock) {
this.mapper = mapper;
this.xml = xml;
// mapper and xml are set to null on invalidation.
if (mapper != null && xml != null) {
applyMapperConfiguration(mapper, xml);... | [
"private",
"void",
"setMappers",
"(",
"ObjectMapper",
"mapper",
",",
"XmlMapper",
"xml",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"this",
".",
"mapper",
"=",
"mapper",
";",
"this",
".",
"xml",
"=",
"xml",
";",
"// mapper and xml are set to null on inva... | Sets the object mapper.
@param mapper the object mapper to use | [
"Sets",
"the",
"object",
"mapper",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java#L287-L296 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URLConnection.java | URLConnection.readBytes | static private int readBytes(int c[], int len, InputStream is)
throws IOException {
"""
Tries to read the specified number of bytes from the stream
Returns -1, If EOF is reached before len bytes are read, returns 0
otherwise
"""
byte buf[] = new byte[len];
if (is.read(buf, 0,... | java | static private int readBytes(int c[], int len, InputStream is)
throws IOException {
byte buf[] = new byte[len];
if (is.read(buf, 0, len) < len) {
return -1;
}
// fill the passed in int array
for (int i = 0; i < len; i++) {
c[i] = buf[i] ... | [
"static",
"private",
"int",
"readBytes",
"(",
"int",
"c",
"[",
"]",
",",
"int",
"len",
",",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"byte",
"buf",
"[",
"]",
"=",
"new",
"byte",
"[",
"len",
"]",
";",
"if",
"(",
"is",
".",
"read",
"... | Tries to read the specified number of bytes from the stream
Returns -1, If EOF is reached before len bytes are read, returns 0
otherwise | [
"Tries",
"to",
"read",
"the",
"specified",
"number",
"of",
"bytes",
"from",
"the",
"stream",
"Returns",
"-",
"1",
"If",
"EOF",
"is",
"reached",
"before",
"len",
"bytes",
"are",
"read",
"returns",
"0",
"otherwise"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URLConnection.java#L1738-L1751 |
sdl/odata | odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java | EntityDataModelUtil.getAndCheckAction | public static Action getAndCheckAction(EntityDataModel entityDataModel, String actionName) {
"""
Gets the action by the specified name, throw an exception if no action with the specified name
exists.
@param entityDataModel The entity data model.
@param actionName The name of action.
@return the Action i... | java | public static Action getAndCheckAction(EntityDataModel entityDataModel, String actionName) {
int namespaceLastIndex = actionName.lastIndexOf('.');
String namespace = actionName.substring(0, namespaceLastIndex);
String simpleActionName = actionName.substring(namespaceLastIndex + 1);
Schem... | [
"public",
"static",
"Action",
"getAndCheckAction",
"(",
"EntityDataModel",
"entityDataModel",
",",
"String",
"actionName",
")",
"{",
"int",
"namespaceLastIndex",
"=",
"actionName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"String",
"namespace",
"=",
"actionNam... | Gets the action by the specified name, throw an exception if no action with the specified name
exists.
@param entityDataModel The entity data model.
@param actionName The name of action.
@return the Action instance specified by given actionName. | [
"Gets",
"the",
"action",
"by",
"the",
"specified",
"name",
"throw",
"an",
"exception",
"if",
"no",
"action",
"with",
"the",
"specified",
"name",
"exists",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L648-L662 |
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.listMultiRolePoolsWithServiceResponseAsync | public Observable<ServiceResponse<Page<WorkerPoolResourceInner>>> listMultiRolePoolsWithServiceResponseAsync(final String resourceGroupName, final String name) {
"""
Get all multi-role pools.
Get all multi-role pools.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param na... | java | public Observable<ServiceResponse<Page<WorkerPoolResourceInner>>> listMultiRolePoolsWithServiceResponseAsync(final String resourceGroupName, final String name) {
return listMultiRolePoolsSinglePageAsync(resourceGroupName, name)
.concatMap(new Func1<ServiceResponse<Page<WorkerPoolResourceInner>>, Obs... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"WorkerPoolResourceInner",
">",
">",
">",
"listMultiRolePoolsWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
")",
"{",
"return",
"listMultiRolePools... | Get all multi-role pools.
Get all multi-role pools.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<WorkerPoolResource... | [
"Get",
"all",
"multi",
"-",
"role",
"pools",
".",
"Get",
"all",
"multi",
"-",
"role",
"pools",
"."
] | 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#L2114-L2126 |
Impetus/Kundera | src/kundera-rdbms/src/main/java/com/impetus/client/rdbms/HibernateClient.java | HibernateClient.getQueryInstance | public SQLQuery getQueryInstance(String nativeQuery, EntityMetadata m) {
"""
Gets the query instance.
@param nativeQuery
the native query
@param m
the m
@return the query instance
"""
s = getStatelessSession();
SQLQuery q = s.createSQLQuery(nativeQuery).addEntity(m.getEntityClazz());
... | java | public SQLQuery getQueryInstance(String nativeQuery, EntityMetadata m)
{
s = getStatelessSession();
SQLQuery q = s.createSQLQuery(nativeQuery).addEntity(m.getEntityClazz());
List<String> relations = m.getRelationNames();
if (relations != null)
{
for (String r : ... | [
"public",
"SQLQuery",
"getQueryInstance",
"(",
"String",
"nativeQuery",
",",
"EntityMetadata",
"m",
")",
"{",
"s",
"=",
"getStatelessSession",
"(",
")",
";",
"SQLQuery",
"q",
"=",
"s",
".",
"createSQLQuery",
"(",
"nativeQuery",
")",
".",
"addEntity",
"(",
"m... | Gets the query instance.
@param nativeQuery
the native query
@param m
the m
@return the query instance | [
"Gets",
"the",
"query",
"instance",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-rdbms/src/main/java/com/impetus/client/rdbms/HibernateClient.java#L675-L702 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/auth/AuthInterface.java | AuthInterface.getAuthorizationUrl | public String getAuthorizationUrl(OAuth1RequestToken oAuthRequestToken, Permission permission) {
"""
Get the auth URL, this is step two of authorization.
@param oAuthRequestToken
the token from a {@link AuthInterface#getRequestToken} call.
"""
OAuth10aService service = new ServiceBuilder(apiKey)... | java | public String getAuthorizationUrl(OAuth1RequestToken oAuthRequestToken, Permission permission) {
OAuth10aService service = new ServiceBuilder(apiKey)
.apiSecret(sharedSecret)
.build(FlickrApi.instance());
String authorizationUrl = service.getAuthorizationUrl(oAuthRe... | [
"public",
"String",
"getAuthorizationUrl",
"(",
"OAuth1RequestToken",
"oAuthRequestToken",
",",
"Permission",
"permission",
")",
"{",
"OAuth10aService",
"service",
"=",
"new",
"ServiceBuilder",
"(",
"apiKey",
")",
".",
"apiSecret",
"(",
"sharedSecret",
")",
".",
"bu... | Get the auth URL, this is step two of authorization.
@param oAuthRequestToken
the token from a {@link AuthInterface#getRequestToken} call. | [
"Get",
"the",
"auth",
"URL",
"this",
"is",
"step",
"two",
"of",
"authorization",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/auth/AuthInterface.java#L109-L116 |
phax/ph-commons | ph-json/src/main/java/com/helger/json/serialize/JsonReader.java | JsonReader.isValidJson | public static boolean isValidJson (@Nonnull @WillClose final InputStream aIS, @Nonnull final Charset aFallbackCharset) {
"""
Check if the passed input stream can be resembled to valid Json content.
This is accomplished by fully parsing the Json file each time the method is
called. This consumes <b>less memory</b... | java | public static boolean isValidJson (@Nonnull @WillClose final InputStream aIS, @Nonnull final Charset aFallbackCharset)
{
ValueEnforcer.notNull (aIS, "InputStream");
ValueEnforcer.notNull (aFallbackCharset, "FallbackCharset");
try
{
final Reader aReader = CharsetHelper.getReaderByBOM (aIS, aFall... | [
"public",
"static",
"boolean",
"isValidJson",
"(",
"@",
"Nonnull",
"@",
"WillClose",
"final",
"InputStream",
"aIS",
",",
"@",
"Nonnull",
"final",
"Charset",
"aFallbackCharset",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aIS",
",",
"\"InputStream\"",
")",
... | Check if the passed input stream can be resembled to valid Json content.
This is accomplished by fully parsing the Json file each time the method is
called. This consumes <b>less memory</b> than calling any of the
<code>read...</code> methods and checking for a non-<code>null</code>
result.
@param aIS
The input stream... | [
"Check",
"if",
"the",
"passed",
"input",
"stream",
"can",
"be",
"resembled",
"to",
"valid",
"Json",
"content",
".",
"This",
"is",
"accomplished",
"by",
"fully",
"parsing",
"the",
"Json",
"file",
"each",
"time",
"the",
"method",
"is",
"called",
".",
"This",... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-json/src/main/java/com/helger/json/serialize/JsonReader.java#L344-L358 |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java | ID3v2Tag.setCommentFrame | public void setCommentFrame(String description, String comment) {
"""
Set the data contained in the comments frame (COMM).
@param description a description of the comment
@param comment the comment
"""
try
{
byte[] b = new byte[description.length() + comment.length() + 5];
int bytesCopied = 0;
... | java | public void setCommentFrame(String description, String comment)
{
try
{
byte[] b = new byte[description.length() + comment.length() + 5];
int bytesCopied = 0;
b[bytesCopied++] = 0;
b[bytesCopied++] = 'e';
b[bytesCopied++] = 'n';
b[bytesCopied++] = 'g';
System.arraycopy(description.getBytes(ENC... | [
"public",
"void",
"setCommentFrame",
"(",
"String",
"description",
",",
"String",
"comment",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"b",
"=",
"new",
"byte",
"[",
"description",
".",
"length",
"(",
")",
"+",
"comment",
".",
"length",
"(",
")",
"+",
"... | Set the data contained in the comments frame (COMM).
@param description a description of the comment
@param comment the comment | [
"Set",
"the",
"data",
"contained",
"in",
"the",
"comments",
"frame",
"(",
"COMM",
")",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java#L395-L417 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/Validate.java | Validate.notEmpty | public static <T> T[] notEmpty(final T[] array, final String message, final Object... values) {
"""
<p>Validate that the specified argument array is neither {@code null}
nor a length of zero (no elements); otherwise throwing an exception
with the specified message.
<pre>Validate.notEmpty(myArray, "The array m... | java | public static <T> T[] notEmpty(final T[] array, final String message, final Object... values) {
if (array == null) {
throw new NullPointerException(StringUtils.simpleFormat(message, values));
}
if (array.length == 0) {
throw new IllegalArgumentException(StringUtils.simple... | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"notEmpty",
"(",
"final",
"T",
"[",
"]",
"array",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"if",
"(",
"array",
"==",
"null",
")",
"{",
"throw",
"new",
... | <p>Validate that the specified argument array is neither {@code null}
nor a length of zero (no elements); otherwise throwing an exception
with the specified message.
<pre>Validate.notEmpty(myArray, "The array must not be empty");</pre>
@param <T> the array type
@param array the array to check, validated not null by ... | [
"<p",
">",
"Validate",
"that",
"the",
"specified",
"argument",
"array",
"is",
"neither",
"{",
"@code",
"null",
"}",
"nor",
"a",
"length",
"of",
"zero",
"(",
"no",
"elements",
")",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/Validate.java#L251-L259 |
alkacon/opencms-core | src/org/opencms/db/CmsImportFolder.java | CmsImportFolder.importResources | private void importResources(File folder, String importPath) throws Exception {
"""
Imports the resources from the folder in the real file system to the OpenCms VFS.<p>
@param folder the folder to import from
@param importPath the OpenCms VFS import path to import to
@throws Exception if something goes wrong ... | java | private void importResources(File folder, String importPath) throws Exception {
String[] diskFiles = folder.list();
File currentFile;
for (int i = 0; i < diskFiles.length; i++) {
currentFile = new File(folder, diskFiles[i]);
if (currentFile.isDirectory()) {
... | [
"private",
"void",
"importResources",
"(",
"File",
"folder",
",",
"String",
"importPath",
")",
"throws",
"Exception",
"{",
"String",
"[",
"]",
"diskFiles",
"=",
"folder",
".",
"list",
"(",
")",
";",
"File",
"currentFile",
";",
"for",
"(",
"int",
"i",
"="... | Imports the resources from the folder in the real file system to the OpenCms VFS.<p>
@param folder the folder to import from
@param importPath the OpenCms VFS import path to import to
@throws Exception if something goes wrong during file IO | [
"Imports",
"the",
"resources",
"from",
"the",
"folder",
"in",
"the",
"real",
"file",
"system",
"to",
"the",
"OpenCms",
"VFS",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsImportFolder.java#L231-L262 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginDefinition.java | PluginDefinition.getValueWithDefault | private String getValueWithDefault(String value, String manifestKey) {
"""
Returns a value's default if the initial value is null or empty.
@param value The initial value.
@param manifestKey The manifest key from which to obtain the default value.
@return The initial value or, if it was null or empty, the def... | java | private String getValueWithDefault(String value, String manifestKey) {
if (StringUtils.isEmpty(value) && manifest != null) {
value = manifest.getMainAttributes().getValue(manifestKey);
}
return value;
} | [
"private",
"String",
"getValueWithDefault",
"(",
"String",
"value",
",",
"String",
"manifestKey",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"value",
")",
"&&",
"manifest",
"!=",
"null",
")",
"{",
"value",
"=",
"manifest",
".",
"getMainAttribut... | Returns a value's default if the initial value is null or empty.
@param value The initial value.
@param manifestKey The manifest key from which to obtain the default value.
@return The initial value or, if it was null or empty, the default value. | [
"Returns",
"a",
"value",
"s",
"default",
"if",
"the",
"initial",
"value",
"is",
"null",
"or",
"empty",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginDefinition.java#L592-L598 |
JoeKerouac/utils | src/main/java/com/joe/utils/common/JMail.java | JMail.sendEmail | public Future<Boolean> sendEmail(EmailBody body, String to, String title) {
"""
发送邮件
@param body 邮件内容
@param to 邮件接收人
@param title 邮件标题
@return 如果发送成功则返回<code>true</code>
"""
return sendEmail(body, to, title, null, null);
} | java | public Future<Boolean> sendEmail(EmailBody body, String to, String title) {
return sendEmail(body, to, title, null, null);
} | [
"public",
"Future",
"<",
"Boolean",
">",
"sendEmail",
"(",
"EmailBody",
"body",
",",
"String",
"to",
",",
"String",
"title",
")",
"{",
"return",
"sendEmail",
"(",
"body",
",",
"to",
",",
"title",
",",
"null",
",",
"null",
")",
";",
"}"
] | 发送邮件
@param body 邮件内容
@param to 邮件接收人
@param title 邮件标题
@return 如果发送成功则返回<code>true</code> | [
"发送邮件"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/JMail.java#L110-L112 |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DeleteManager.java | DeleteManager.addDeleteDirective | public static void addDeleteDirective(Element compViewNode, String elementID, IPerson person)
throws PortalException {
"""
Create and append a delete directive to delete the node identified by the passed in element
id. If this node contains any incorporated elements then they must also have a delete
... | java | public static void addDeleteDirective(Element compViewNode, String elementID, IPerson person)
throws PortalException {
Document plf = (Document) person.getAttribute(Constants.PLF);
Element delSet = getDeleteSet(plf, person, true);
addDeleteDirective(compViewNode, elementID, person, p... | [
"public",
"static",
"void",
"addDeleteDirective",
"(",
"Element",
"compViewNode",
",",
"String",
"elementID",
",",
"IPerson",
"person",
")",
"throws",
"PortalException",
"{",
"Document",
"plf",
"=",
"(",
"Document",
")",
"person",
".",
"getAttribute",
"(",
"Cons... | Create and append a delete directive to delete the node identified by the passed in element
id. If this node contains any incorporated elements then they must also have a delete
directive added in here to prevent incorporated channels originating in another column from
reappearing in that column because the position se... | [
"Create",
"and",
"append",
"a",
"delete",
"directive",
"to",
"delete",
"the",
"node",
"identified",
"by",
"the",
"passed",
"in",
"element",
"id",
".",
"If",
"this",
"node",
"contains",
"any",
"incorporated",
"elements",
"then",
"they",
"must",
"also",
"have"... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DeleteManager.java#L149-L154 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseShiftExpression | private Expr parseShiftExpression(EnclosingScope scope, boolean terminated) {
"""
Parse a shift expression, which has the form:
<pre>
ShiftExpr ::= AdditiveExpr [ ( "<<" | ">>" ) AdditiveExpr ]
</pre>
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared)... | java | private Expr parseShiftExpression(EnclosingScope scope, boolean terminated) {
int start = index;
Expr lhs = parseAdditiveExpression(scope, terminated);
Token lookahead;
while ((lookahead = tryAndMatch(terminated, LeftAngleLeftAngle, RightAngleRightAngle)) != null) {
Expr rhs = parseAdditiveExpression(scope,... | [
"private",
"Expr",
"parseShiftExpression",
"(",
"EnclosingScope",
"scope",
",",
"boolean",
"terminated",
")",
"{",
"int",
"start",
"=",
"index",
";",
"Expr",
"lhs",
"=",
"parseAdditiveExpression",
"(",
"scope",
",",
"terminated",
")",
";",
"Token",
"lookahead",
... | Parse a shift expression, which has the form:
<pre>
ShiftExpr ::= AdditiveExpr [ ( "<<" | ">>" ) AdditiveExpr ]
</pre>
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@param terminated
This indicates that the ex... | [
"Parse",
"a",
"shift",
"expression",
"which",
"has",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L2034-L2053 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/matrix/ClutoSparseMatrixBuilder.java | ClutoSparseMatrixBuilder.finish | public synchronized void finish() {
"""
{@inheritDoc} Once this method has been called, any subsequent calls will
have no effect and will not throw an exception.
"""
if (!isFinished) {
isFinished = true;
try {
writer.close();
// Re-open as a rand... | java | public synchronized void finish() {
if (!isFinished) {
isFinished = true;
try {
writer.close();
// Re-open as a random access file so we can overwrite the 3 int
// header that specifies the number of dimensions and values.
/... | [
"public",
"synchronized",
"void",
"finish",
"(",
")",
"{",
"if",
"(",
"!",
"isFinished",
")",
"{",
"isFinished",
"=",
"true",
";",
"try",
"{",
"writer",
".",
"close",
"(",
")",
";",
"// Re-open as a random access file so we can overwrite the 3 int",
"// header tha... | {@inheritDoc} Once this method has been called, any subsequent calls will
have no effect and will not throw an exception. | [
"{"
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/ClutoSparseMatrixBuilder.java#L260-L284 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/download/DownloadPanel.java | DownloadPanel.newFileNameLabel | protected Component newFileNameLabel(final String id, final IModel<String> model) {
"""
Factory method for creating the new {@link Label} for the file name. This method is invoked
in the constructor from the derived classes and can be overridden so users can provide their
own version of a new {@link Label} for t... | java | protected Component newFileNameLabel(final String id, final IModel<String> model)
{
return ComponentFactory.newLabel(id, model);
} | [
"protected",
"Component",
"newFileNameLabel",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"String",
">",
"model",
")",
"{",
"return",
"ComponentFactory",
".",
"newLabel",
"(",
"id",
",",
"model",
")",
";",
"}"
] | Factory method for creating the new {@link Label} for the file name. This method is invoked
in the constructor from the derived classes and can be overridden so users can provide their
own version of a new {@link Label} for the file name.
@param id
the id
@param model
the model
@return the new {@link Label} for the fi... | [
"Factory",
"method",
"for",
"creating",
"the",
"new",
"{",
"@link",
"Label",
"}",
"for",
"the",
"file",
"name",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/download/DownloadPanel.java#L145-L148 |
lunisolar/magma | magma-func/src/main/java/eu/lunisolar/magma/func/Function4U.java | Function4U.biFunc | public static <T1, T2, R> BiFunction biFunc(final BiFunction<T1, T2, R> lambda) {
"""
Convenient method in case lambda expression is ambiguous for the compiler.
"""
return lambda;
} | java | public static <T1, T2, R> BiFunction biFunc(final BiFunction<T1, T2, R> lambda) {
return lambda;
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"R",
">",
"BiFunction",
"biFunc",
"(",
"final",
"BiFunction",
"<",
"T1",
",",
"T2",
",",
"R",
">",
"lambda",
")",
"{",
"return",
"lambda",
";",
"}"
] | Convenient method in case lambda expression is ambiguous for the compiler. | [
"Convenient",
"method",
"in",
"case",
"lambda",
"expression",
"is",
"ambiguous",
"for",
"the",
"compiler",
"."
] | train | https://github.com/lunisolar/magma/blob/83809c6d1a33d913aec6c49920251e4f0be8b213/magma-func/src/main/java/eu/lunisolar/magma/func/Function4U.java#L237-L239 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalReader.java | JournalReader.readStreamArgument | private void readStreamArgument(XMLEventReader reader,
ConsumerJournalEntry journalEntry,
String name) throws XMLStreamException,
JournalException {
"""
An InputStream argument appears as a Base64-encoded String. It must be
decode... | java | private void readStreamArgument(XMLEventReader reader,
ConsumerJournalEntry journalEntry,
String name) throws XMLStreamException,
JournalException {
try {
File tempFile = JournalHelper.createTempFile();
D... | [
"private",
"void",
"readStreamArgument",
"(",
"XMLEventReader",
"reader",
",",
"ConsumerJournalEntry",
"journalEntry",
",",
"String",
"name",
")",
"throws",
"XMLStreamException",
",",
"JournalException",
"{",
"try",
"{",
"File",
"tempFile",
"=",
"JournalHelper",
".",
... | An InputStream argument appears as a Base64-encoded String. It must be
decoded and written to a temp file, so it can be presented to the
management method as an InputStream again. | [
"An",
"InputStream",
"argument",
"appears",
"as",
"a",
"Base64",
"-",
"encoded",
"String",
".",
"It",
"must",
"be",
"decoded",
"and",
"written",
"to",
"a",
"temp",
"file",
"so",
"it",
"can",
"be",
"presented",
"to",
"the",
"management",
"method",
"as",
"... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalReader.java#L405-L434 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.listPreparationAndReleaseTaskStatusNextAsync | public Observable<Page<JobPreparationAndReleaseTaskExecutionInformation>> listPreparationAndReleaseTaskStatusNextAsync(final String nextPageLink, final JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions) {
"""
Lists the execution status of the Job Preparation and Jo... | java | public Observable<Page<JobPreparationAndReleaseTaskExecutionInformation>> listPreparationAndReleaseTaskStatusNextAsync(final String nextPageLink, final JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions) {
return listPreparationAndReleaseTaskStatusNextWithService... | [
"public",
"Observable",
"<",
"Page",
"<",
"JobPreparationAndReleaseTaskExecutionInformation",
">",
">",
"listPreparationAndReleaseTaskStatusNextAsync",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"JobListPreparationAndReleaseTaskStatusNextOptions",
"jobListPreparationAndRel... | Lists the execution status of the Job Preparation and Job Release task for the specified job across the compute nodes where the job has run.
This API returns the Job Preparation and Job Release task status on all compute nodes that have run the Job Preparation or Job Release task. This includes nodes which have since b... | [
"Lists",
"the",
"execution",
"status",
"of",
"the",
"Job",
"Preparation",
"and",
"Job",
"Release",
"task",
"for",
"the",
"specified",
"job",
"across",
"the",
"compute",
"nodes",
"where",
"the",
"job",
"has",
"run",
".",
"This",
"API",
"returns",
"the",
"Jo... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L3965-L3973 |
Netflix/spectator | spectator-api/src/main/java/com/netflix/spectator/impl/AsciiSet.java | AsciiSet.fromPattern | public static AsciiSet fromPattern(String pattern) {
"""
Create a set containing ascii characters using a simple pattern. The pattern is similar
to a character set in regex. For example, {@code ABC} would contain the characters
{@code A}, {@code B}, and {@code C}. Ranges are supported so all uppercase letters co... | java | public static AsciiSet fromPattern(String pattern) {
final boolean[] members = new boolean[128];
final int n = pattern.length();
for (int i = 0; i < n; ++i) {
final char c = pattern.charAt(i);
if (c >= members.length) {
throw new IllegalArgumentException("invalid pattern, '" + c + "' is ... | [
"public",
"static",
"AsciiSet",
"fromPattern",
"(",
"String",
"pattern",
")",
"{",
"final",
"boolean",
"[",
"]",
"members",
"=",
"new",
"boolean",
"[",
"128",
"]",
";",
"final",
"int",
"n",
"=",
"pattern",
".",
"length",
"(",
")",
";",
"for",
"(",
"i... | Create a set containing ascii characters using a simple pattern. The pattern is similar
to a character set in regex. For example, {@code ABC} would contain the characters
{@code A}, {@code B}, and {@code C}. Ranges are supported so all uppercase letters could
be specified as {@code A-Z}. The dash, {@code -}, will be in... | [
"Create",
"a",
"set",
"containing",
"ascii",
"characters",
"using",
"a",
"simple",
"pattern",
".",
"The",
"pattern",
"is",
"similar",
"to",
"a",
"character",
"set",
"in",
"regex",
".",
"For",
"example",
"{",
"@code",
"ABC",
"}",
"would",
"contain",
"the",
... | train | https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-api/src/main/java/com/netflix/spectator/impl/AsciiSet.java#L91-L112 |
mikepenz/FastAdapter | library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/ActionModeHelper.java | ActionModeHelper.onClick | public Boolean onClick(AppCompatActivity act, IItem item) {
"""
implements the basic behavior of a CAB and multi select behavior,
including logics if the clicked item is collapsible
@param act the current Activity
@param item the current item
@return null if nothing was done, or a boolean to inform if the e... | java | public Boolean onClick(AppCompatActivity act, IItem item) {
//if we are current in CAB mode, and we remove the last selection, we want to finish the actionMode
if (mActionMode != null && (mSelectExtension.getSelectedItems().size() == 1) && item.isSelected()) {
mActionMode.finish();
... | [
"public",
"Boolean",
"onClick",
"(",
"AppCompatActivity",
"act",
",",
"IItem",
"item",
")",
"{",
"//if we are current in CAB mode, and we remove the last selection, we want to finish the actionMode",
"if",
"(",
"mActionMode",
"!=",
"null",
"&&",
"(",
"mSelectExtension",
".",
... | implements the basic behavior of a CAB and multi select behavior,
including logics if the clicked item is collapsible
@param act the current Activity
@param item the current item
@return null if nothing was done, or a boolean to inform if the event was consumed | [
"implements",
"the",
"basic",
"behavior",
"of",
"a",
"CAB",
"and",
"multi",
"select",
"behavior",
"including",
"logics",
"if",
"the",
"clicked",
"item",
"is",
"collapsible"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/ActionModeHelper.java#L117-L137 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.jensenShannonDivergence | public static <E> double jensenShannonDivergence(Counter<E> c1, Counter<E> c2) {
"""
Calculates the Jensen-Shannon divergence between the two counters. That is,
it calculates 1/2 [KL(c1 || avg(c1,c2)) + KL(c2 || avg(c1,c2))] .
@return The Jensen-Shannon divergence between the distributions
"""
Counter... | java | public static <E> double jensenShannonDivergence(Counter<E> c1, Counter<E> c2) {
Counter<E> average = average(c1, c2);
double kl1 = klDivergence(c1, average);
double kl2 = klDivergence(c2, average);
return (kl1 + kl2) / 2.0;
} | [
"public",
"static",
"<",
"E",
">",
"double",
"jensenShannonDivergence",
"(",
"Counter",
"<",
"E",
">",
"c1",
",",
"Counter",
"<",
"E",
">",
"c2",
")",
"{",
"Counter",
"<",
"E",
">",
"average",
"=",
"average",
"(",
"c1",
",",
"c2",
")",
";",
"double... | Calculates the Jensen-Shannon divergence between the two counters. That is,
it calculates 1/2 [KL(c1 || avg(c1,c2)) + KL(c2 || avg(c1,c2))] .
@return The Jensen-Shannon divergence between the distributions | [
"Calculates",
"the",
"Jensen",
"-",
"Shannon",
"divergence",
"between",
"the",
"two",
"counters",
".",
"That",
"is",
"it",
"calculates",
"1",
"/",
"2",
"[",
"KL",
"(",
"c1",
"||",
"avg",
"(",
"c1",
"c2",
"))",
"+",
"KL",
"(",
"c2",
"||",
"avg",
"("... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1234-L1239 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/CompanyServiceClient.java | CompanyServiceClient.createCompany | public final Company createCompany(String parent, Company company) {
"""
Creates a new company entity.
<p>Sample code:
<pre><code>
try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
TenantOrProjectName parent = TenantName.of("[PROJECT]", "[TENANT]");
Company company = Compan... | java | public final Company createCompany(String parent, Company company) {
CreateCompanyRequest request =
CreateCompanyRequest.newBuilder().setParent(parent).setCompany(company).build();
return createCompany(request);
} | [
"public",
"final",
"Company",
"createCompany",
"(",
"String",
"parent",
",",
"Company",
"company",
")",
"{",
"CreateCompanyRequest",
"request",
"=",
"CreateCompanyRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
")",
".",
"setCompany",
"("... | Creates a new company entity.
<p>Sample code:
<pre><code>
try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
TenantOrProjectName parent = TenantName.of("[PROJECT]", "[TENANT]");
Company company = Company.newBuilder().build();
Company response = companyServiceClient.createCompany(parent.... | [
"Creates",
"a",
"new",
"company",
"entity",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/CompanyServiceClient.java#L216-L221 |
grails/grails-core | grails-core/src/main/groovy/org/grails/plugins/AbstractGrailsPluginManager.java | AbstractGrailsPluginManager.doRuntimeConfiguration | public void doRuntimeConfiguration(String pluginName, RuntimeSpringConfiguration springConfig) {
"""
Base implementation that will perform runtime configuration for the specified plugin name.
"""
checkInitialised();
GrailsPlugin plugin = getGrailsPlugin(pluginName);
if (plugin == null) ... | java | public void doRuntimeConfiguration(String pluginName, RuntimeSpringConfiguration springConfig) {
checkInitialised();
GrailsPlugin plugin = getGrailsPlugin(pluginName);
if (plugin == null) {
throw new PluginException("Plugin [" + pluginName + "] not found");
}
if (!pl... | [
"public",
"void",
"doRuntimeConfiguration",
"(",
"String",
"pluginName",
",",
"RuntimeSpringConfiguration",
"springConfig",
")",
"{",
"checkInitialised",
"(",
")",
";",
"GrailsPlugin",
"plugin",
"=",
"getGrailsPlugin",
"(",
"pluginName",
")",
";",
"if",
"(",
"plugin... | Base implementation that will perform runtime configuration for the specified plugin name. | [
"Base",
"implementation",
"that",
"will",
"perform",
"runtime",
"configuration",
"for",
"the",
"specified",
"plugin",
"name",
"."
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/plugins/AbstractGrailsPluginManager.java#L174-L197 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/annotation/AnnotationMetadataWriter.java | AnnotationMetadataWriter.pushAnnotationAttributes | @Internal
private static void pushAnnotationAttributes(Type declaringType, ClassVisitor declaringClassWriter, GeneratorAdapter generatorAdapter, Map<? extends CharSequence, Object> annotationData, Map<String, GeneratorAdapter> loadTypeMethods) {
"""
Writes annotation attributes to the given generator.
@para... | java | @Internal
private static void pushAnnotationAttributes(Type declaringType, ClassVisitor declaringClassWriter, GeneratorAdapter generatorAdapter, Map<? extends CharSequence, Object> annotationData, Map<String, GeneratorAdapter> loadTypeMethods) {
int totalSize = annotationData.size() * 2;
// start a ... | [
"@",
"Internal",
"private",
"static",
"void",
"pushAnnotationAttributes",
"(",
"Type",
"declaringType",
",",
"ClassVisitor",
"declaringClassWriter",
",",
"GeneratorAdapter",
"generatorAdapter",
",",
"Map",
"<",
"?",
"extends",
"CharSequence",
",",
"Object",
">",
"anno... | Writes annotation attributes to the given generator.
@param declaringClassWriter The declaring class
@param generatorAdapter The generator adapter
@param annotationData The annotation data
@param loadTypeMethods Generated methods that load types | [
"Writes",
"annotation",
"attributes",
"to",
"the",
"given",
"generator",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/AnnotationMetadataWriter.java#L228-L246 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java | ByteUtils.bytesToLong | public static final long bytesToLong( byte[] data, int[] offset ) {
"""
Return the <code>long</code> represented by the bytes in
<code>data</code> staring at offset <code>offset[0]</code>.
@param data the array from which to read
@param offset A single element array whose first element is the index in
data f... | java | public static final long bytesToLong( byte[] data, int[] offset ) {
long result = 0;
for( int i = 0; i < SIZE_LONG; ++i ) {
result <<= 8;
int res = byteToUnsignedInt(data[offset[0]++]);
result = result | res;
}
return result;
} | [
"public",
"static",
"final",
"long",
"bytesToLong",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"[",
"]",
"offset",
")",
"{",
"long",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"SIZE_LONG",
";",
"++",
"i",
")",
"{"... | Return the <code>long</code> represented by the bytes in
<code>data</code> staring at offset <code>offset[0]</code>.
@param data the array from which to read
@param offset A single element array whose first element is the index in
data from which to begin reading on function entry, and which
on function exit has been... | [
"Return",
"the",
"<code",
">",
"long<",
"/",
"code",
">",
"represented",
"by",
"the",
"bytes",
"in",
"<code",
">",
"data<",
"/",
"code",
">",
"staring",
"at",
"offset",
"<code",
">",
"offset",
"[",
"0",
"]",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java#L162-L173 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/ComponentTagDeclarationLibrary.java | ComponentTagDeclarationLibrary.addComponent | public final void addComponent(String namespace, String name, String componentType, String rendererType,
Class<? extends TagHandler> handlerType) {
"""
Add a ComponentHandler with the specified componentType and rendererType, aliased by the tag name. The Facelet
will be comp... | java | public final void addComponent(String namespace, String name, String componentType, String rendererType,
Class<? extends TagHandler> handlerType)
{
Map<String, TagHandlerFactory> map = _factories.get(namespace);
if (map == null)
{
map = new ... | [
"public",
"final",
"void",
"addComponent",
"(",
"String",
"namespace",
",",
"String",
"name",
",",
"String",
"componentType",
",",
"String",
"rendererType",
",",
"Class",
"<",
"?",
"extends",
"TagHandler",
">",
"handlerType",
")",
"{",
"Map",
"<",
"String",
... | Add a ComponentHandler with the specified componentType and rendererType, aliased by the tag name. The Facelet
will be compiled with the specified HandlerType (which must extend AbstractComponentHandler).
@see AbstractComponentHandler
@param name
name to use, "foo" would be <my:foo />
@param componentType
component... | [
"Add",
"a",
"ComponentHandler",
"with",
"the",
"specified",
"componentType",
"and",
"rendererType",
"aliased",
"by",
"the",
"tag",
"name",
".",
"The",
"Facelet",
"will",
"be",
"compiled",
"with",
"the",
"specified",
"HandlerType",
"(",
"which",
"must",
"extend",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/ComponentTagDeclarationLibrary.java#L169-L179 |
apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/dml/select/SelectParserFactory.java | SelectParserFactory.newInstance | public static AbstractSelectParser newInstance(final DatabaseType dbType, final ShardingRule shardingRule, final LexerEngine lexerEngine, final ShardingTableMetaData shardingTableMetaData) {
"""
Create select parser instance.
@param dbType database type
@param shardingRule databases and tables sharding rule
@... | java | public static AbstractSelectParser newInstance(final DatabaseType dbType, final ShardingRule shardingRule, final LexerEngine lexerEngine, final ShardingTableMetaData shardingTableMetaData) {
switch (dbType) {
case H2:
case MySQL:
return new MySQLSelectParser(shardingRule,... | [
"public",
"static",
"AbstractSelectParser",
"newInstance",
"(",
"final",
"DatabaseType",
"dbType",
",",
"final",
"ShardingRule",
"shardingRule",
",",
"final",
"LexerEngine",
"lexerEngine",
",",
"final",
"ShardingTableMetaData",
"shardingTableMetaData",
")",
"{",
"switch",... | Create select parser instance.
@param dbType database type
@param shardingRule databases and tables sharding rule
@param lexerEngine lexical analysis engine.
@param shardingTableMetaData sharding metadata.
@return select parser instance | [
"Create",
"select",
"parser",
"instance",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/dml/select/SelectParserFactory.java#L48-L62 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.getPanToViewTranslation | public Matrix getPanToViewTranslation() {
"""
Return the translation of coordinates relative to the pan origin to view coordinates.
@return transformation matrix
"""
if (viewState.getScale() > 0) {
double dX = -((viewState.getX() - viewState.getPanX()) * viewState.getScale()) + width / 2;
double dY ... | java | public Matrix getPanToViewTranslation() {
if (viewState.getScale() > 0) {
double dX = -((viewState.getX() - viewState.getPanX()) * viewState.getScale()) + width / 2;
double dY = (viewState.getY() - viewState.getPanY()) * viewState.getScale() + height / 2;
return new Matrix(1, 0, 0, 1, dX, dY);
}
return n... | [
"public",
"Matrix",
"getPanToViewTranslation",
"(",
")",
"{",
"if",
"(",
"viewState",
".",
"getScale",
"(",
")",
">",
"0",
")",
"{",
"double",
"dX",
"=",
"-",
"(",
"(",
"viewState",
".",
"getX",
"(",
")",
"-",
"viewState",
".",
"getPanX",
"(",
")",
... | Return the translation of coordinates relative to the pan origin to view coordinates.
@return transformation matrix | [
"Return",
"the",
"translation",
"of",
"coordinates",
"relative",
"to",
"the",
"pan",
"origin",
"to",
"view",
"coordinates",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L183-L190 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Table.java | Table.addCell | public void addCell(Cell aCell, int row, int column) throws BadElementException {
"""
Adds a <CODE>Cell</CODE> to the <CODE>Table</CODE> at a certain row and column.
@param aCell The <CODE>Cell</CODE> to add
@param row The row where the <CODE>Cell</CODE> will be added
@param column T... | java | public void addCell(Cell aCell, int row, int column) throws BadElementException {
addCell(aCell, new Point(row,column));
} | [
"public",
"void",
"addCell",
"(",
"Cell",
"aCell",
",",
"int",
"row",
",",
"int",
"column",
")",
"throws",
"BadElementException",
"{",
"addCell",
"(",
"aCell",
",",
"new",
"Point",
"(",
"row",
",",
"column",
")",
")",
";",
"}"
] | Adds a <CODE>Cell</CODE> to the <CODE>Table</CODE> at a certain row and column.
@param aCell The <CODE>Cell</CODE> to add
@param row The row where the <CODE>Cell</CODE> will be added
@param column The column where the <CODE>Cell</CODE> will be added
@throws BadElementException | [
"Adds",
"a",
"<CODE",
">",
"Cell<",
"/",
"CODE",
">",
"to",
"the",
"<CODE",
">",
"Table<",
"/",
"CODE",
">",
"at",
"a",
"certain",
"row",
"and",
"column",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Table.java#L685-L687 |
radkovo/Pdf2Dom | src/main/java/org/fit/pdfdom/PDFBoxTree.java | PDFBoxTree.colorString | protected String colorString(int ir, int ig, int ib) {
"""
Creates a CSS rgb() specification from the color component values.
@param ir red value (0..255)
@param ig green value (0..255)
@param ib blue value (0..255)
@return the rgb() string
"""
return String.format("#%02x%02x%02x", ir, ig, ib);
} | java | protected String colorString(int ir, int ig, int ib)
{
return String.format("#%02x%02x%02x", ir, ig, ib);
} | [
"protected",
"String",
"colorString",
"(",
"int",
"ir",
",",
"int",
"ig",
",",
"int",
"ib",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"#%02x%02x%02x\"",
",",
"ir",
",",
"ig",
",",
"ib",
")",
";",
"}"
] | Creates a CSS rgb() specification from the color component values.
@param ir red value (0..255)
@param ig green value (0..255)
@param ib blue value (0..255)
@return the rgb() string | [
"Creates",
"a",
"CSS",
"rgb",
"()",
"specification",
"from",
"the",
"color",
"component",
"values",
"."
] | train | https://github.com/radkovo/Pdf2Dom/blob/12e52b80eca7f57fc41e6ed895bf1db72c38da53/src/main/java/org/fit/pdfdom/PDFBoxTree.java#L916-L919 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java | DomainsInner.getOwnershipIdentifier | public DomainOwnershipIdentifierInner getOwnershipIdentifier(String resourceGroupName, String domainName, String name) {
"""
Get ownership identifier for domain.
Get ownership identifier for domain.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param domainName Name of do... | java | public DomainOwnershipIdentifierInner getOwnershipIdentifier(String resourceGroupName, String domainName, String name) {
return getOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name).toBlocking().single().body();
} | [
"public",
"DomainOwnershipIdentifierInner",
"getOwnershipIdentifier",
"(",
"String",
"resourceGroupName",
",",
"String",
"domainName",
",",
"String",
"name",
")",
"{",
"return",
"getOwnershipIdentifierWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"domainName",
","... | Get ownership identifier for domain.
Get ownership identifier for domain.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param domainName Name of domain.
@param name Name of identifier.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws DefaultErrorRe... | [
"Get",
"ownership",
"identifier",
"for",
"domain",
".",
"Get",
"ownership",
"identifier",
"for",
"domain",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java#L1423-L1425 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/datatable/DataTableBeanProviderExample.java | DataTableBeanProviderExample.createTable | private WDataTable createTable() {
"""
Creates and configures the table to be used by the example. The table is configured with global rather than user
data. Although this is not a realistic scenario, it will suffice for this example.
@return a new configured table.
"""
WDataTable tbl = new WDataTable();... | java | private WDataTable createTable() {
WDataTable tbl = new WDataTable();
tbl.addColumn(new WTableColumn("First name", new WText()));
tbl.addColumn(new WTableColumn("Last name", new WText()));
tbl.addColumn(new WTableColumn("DOB", new WText()));
return tbl;
} | [
"private",
"WDataTable",
"createTable",
"(",
")",
"{",
"WDataTable",
"tbl",
"=",
"new",
"WDataTable",
"(",
")",
";",
"tbl",
".",
"addColumn",
"(",
"new",
"WTableColumn",
"(",
"\"First name\"",
",",
"new",
"WText",
"(",
")",
")",
")",
";",
"tbl",
".",
"... | Creates and configures the table to be used by the example. The table is configured with global rather than user
data. Although this is not a realistic scenario, it will suffice for this example.
@return a new configured table. | [
"Creates",
"and",
"configures",
"the",
"table",
"to",
"be",
"used",
"by",
"the",
"example",
".",
"The",
"table",
"is",
"configured",
"with",
"global",
"rather",
"than",
"user",
"data",
".",
"Although",
"this",
"is",
"not",
"a",
"realistic",
"scenario",
"it... | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/datatable/DataTableBeanProviderExample.java#L61-L67 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsJspImageBean.java | CmsJspImageBean.calcRatioHeightPercentage | protected String calcRatioHeightPercentage(double width, double height) {
"""
Returns the ratio height percentage of an image based on width and height.<p>
@param width width to calculate percentage from
@param height height to calculate percentage from
@return the ratio height percentage of an image based ... | java | protected String calcRatioHeightPercentage(double width, double height) {
double p = Math.round((height / width) * 10000000.0) / 100000.0;
return String.valueOf(p) + "%";
} | [
"protected",
"String",
"calcRatioHeightPercentage",
"(",
"double",
"width",
",",
"double",
"height",
")",
"{",
"double",
"p",
"=",
"Math",
".",
"round",
"(",
"(",
"height",
"/",
"width",
")",
"*",
"10000000.0",
")",
"/",
"100000.0",
";",
"return",
"String"... | Returns the ratio height percentage of an image based on width and height.<p>
@param width width to calculate percentage from
@param height height to calculate percentage from
@return the ratio height percentage of an image based on width and height | [
"Returns",
"the",
"ratio",
"height",
"percentage",
"of",
"an",
"image",
"based",
"on",
"width",
"and",
"height",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspImageBean.java#L956-L960 |
apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/source/workunit/ExtractFactory.java | ExtractFactory.getUniqueExtract | public synchronized Extract getUniqueExtract(TableType type, String namespace, String table) {
"""
Returns a unique {@link Extract} instance.
Any two calls of this method from the same {@link ExtractFactory} instance guarantees to
return {@link Extract}s with different IDs.
@param type {@link TableType}
@par... | java | public synchronized Extract getUniqueExtract(TableType type, String namespace, String table) {
Extract newExtract = new Extract(type, namespace, table);
while (this.createdInstances.contains(newExtract)) {
if (Strings.isNullOrEmpty(newExtract.getExtractId())) {
newExtract.setExtractId(this.dtf.pri... | [
"public",
"synchronized",
"Extract",
"getUniqueExtract",
"(",
"TableType",
"type",
",",
"String",
"namespace",
",",
"String",
"table",
")",
"{",
"Extract",
"newExtract",
"=",
"new",
"Extract",
"(",
"type",
",",
"namespace",
",",
"table",
")",
";",
"while",
"... | Returns a unique {@link Extract} instance.
Any two calls of this method from the same {@link ExtractFactory} instance guarantees to
return {@link Extract}s with different IDs.
@param type {@link TableType}
@param namespace dot separated namespace path
@param table table name
@return a unique {@link Extract} instance | [
"Returns",
"a",
"unique",
"{",
"@link",
"Extract",
"}",
"instance",
".",
"Any",
"two",
"calls",
"of",
"this",
"method",
"from",
"the",
"same",
"{",
"@link",
"ExtractFactory",
"}",
"instance",
"guarantees",
"to",
"return",
"{",
"@link",
"Extract",
"}",
"s",... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/source/workunit/ExtractFactory.java#L53-L65 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/APIClient.java | APIClient.updateApiKey | public JSONObject updateApiKey(String key, List<String> acls, RequestOptions requestOptions) throws AlgoliaException {
"""
Update an api key
@param acls the list of ACL for this key. Defined by an array of strings that
can contains the following values:
- search: allow to search (https and http)
- ... | java | public JSONObject updateApiKey(String key, List<String> acls, RequestOptions requestOptions) throws AlgoliaException {
return updateApiKey(key, acls, 0, 0, 0, null, requestOptions);
} | [
"public",
"JSONObject",
"updateApiKey",
"(",
"String",
"key",
",",
"List",
"<",
"String",
">",
"acls",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"return",
"updateApiKey",
"(",
"key",
",",
"acls",
",",
"0",
",",
"0",
","... | Update an api key
@param acls the list of ACL for this key. Defined by an array of strings that
can contains the following values:
- search: allow to search (https and http)
- addObject: allows to add/update an object in the index (https only)
- deleteObject : allows to delete an existing object (https only)... | [
"Update",
"an",
"api",
"key"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L752-L754 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/touchSpin/TouchSpinRenderer.java | TouchSpinRenderer.decode | @Override
public void decode(FacesContext context, UIComponent component) {
"""
This methods receives and processes input made by the user. More specifically, it ckecks whether the
user has interacted with the current b:spinner. The default implementation simply stores
the input value in the list of submitted v... | java | @Override
public void decode(FacesContext context, UIComponent component) {
TouchSpin spinner = (TouchSpin) component;
if (spinner.isDisabled() || spinner.isReadonly()) {
return;
}
decodeBehaviors(context, spinner);
String clientId = spinner.getClientId(context);
String name = spinner.getName();
if... | [
"@",
"Override",
"public",
"void",
"decode",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"{",
"TouchSpin",
"spinner",
"=",
"(",
"TouchSpin",
")",
"component",
";",
"if",
"(",
"spinner",
".",
"isDisabled",
"(",
")",
"||",
"spinner",
... | This methods receives and processes input made by the user. More specifically, it ckecks whether the
user has interacted with the current b:spinner. The default implementation simply stores
the input value in the list of submitted values. If the validation checks are passed,
the values in the <code>submittedValues</cod... | [
"This",
"methods",
"receives",
"and",
"processes",
"input",
"made",
"by",
"the",
"user",
".",
"More",
"specifically",
"it",
"ckecks",
"whether",
"the",
"user",
"has",
"interacted",
"with",
"the",
"current",
"b",
":",
"spinner",
".",
"The",
"default",
"implem... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/touchSpin/TouchSpinRenderer.java#L46-L67 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/librarycache/LibraryCacheManager.java | LibraryCacheManager.unregisterInternal | private void unregisterInternal(final JobID id) {
"""
Unregisters a job ID and releases the resources associated with it.
@param id
the job ID to unregister
"""
// Use spin lock here
while (this.lockMap.putIfAbsent(id, LOCK_OBJECT) != null);
if (decrementReferenceCounter(id) == 0) {
this.library... | java | private void unregisterInternal(final JobID id) {
// Use spin lock here
while (this.lockMap.putIfAbsent(id, LOCK_OBJECT) != null);
if (decrementReferenceCounter(id) == 0) {
this.libraryManagerEntries.remove(id);
}
this.lockMap.remove(id);
} | [
"private",
"void",
"unregisterInternal",
"(",
"final",
"JobID",
"id",
")",
"{",
"// Use spin lock here",
"while",
"(",
"this",
".",
"lockMap",
".",
"putIfAbsent",
"(",
"id",
",",
"LOCK_OBJECT",
")",
"!=",
"null",
")",
";",
"if",
"(",
"decrementReferenceCounter... | Unregisters a job ID and releases the resources associated with it.
@param id
the job ID to unregister | [
"Unregisters",
"a",
"job",
"ID",
"and",
"releases",
"the",
"resources",
"associated",
"with",
"it",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/librarycache/LibraryCacheManager.java#L357-L367 |
LearnLib/learnlib | algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTHypothesis.java | AbstractTTTHypothesis.getInternalTransition | public TTTTransition<I, D> getInternalTransition(TTTState<I, D> state, I input) {
"""
Retrieves the <i>internal</i> transition (i.e., the {@link TTTTransition} object) for a given state and input.
This method is required since the {@link DFA} interface requires the return value of {@link
#getTransition(TTTState,... | java | public TTTTransition<I, D> getInternalTransition(TTTState<I, D> state, I input) {
int inputIdx = alphabet.getSymbolIndex(input);
return getInternalTransition(state, inputIdx);
} | [
"public",
"TTTTransition",
"<",
"I",
",",
"D",
">",
"getInternalTransition",
"(",
"TTTState",
"<",
"I",
",",
"D",
">",
"state",
",",
"I",
"input",
")",
"{",
"int",
"inputIdx",
"=",
"alphabet",
".",
"getSymbolIndex",
"(",
"input",
")",
";",
"return",
"g... | Retrieves the <i>internal</i> transition (i.e., the {@link TTTTransition} object) for a given state and input.
This method is required since the {@link DFA} interface requires the return value of {@link
#getTransition(TTTState, Object)} to refer to the successor state directly.
@param state
the source state
@param inp... | [
"Retrieves",
"the",
"<i",
">",
"internal<",
"/",
"i",
">",
"transition",
"(",
"i",
".",
"e",
".",
"the",
"{",
"@link",
"TTTTransition",
"}",
"object",
")",
"for",
"a",
"given",
"state",
"and",
"input",
".",
"This",
"method",
"is",
"required",
"since",
... | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTHypothesis.java#L98-L101 |
phax/ph-commons | ph-datetime/src/main/java/com/helger/datetime/util/PDTXMLConverter.java | PDTXMLConverter.getXMLCalendarTime | @Nonnull
public static XMLGregorianCalendar getXMLCalendarTime (final int nHour,
final int nMinute,
final int nSecond,
final int nMilliSecond) {
... | java | @Nonnull
public static XMLGregorianCalendar getXMLCalendarTime (final int nHour,
final int nMinute,
final int nSecond,
final int nMilliSecond)
{
... | [
"@",
"Nonnull",
"public",
"static",
"XMLGregorianCalendar",
"getXMLCalendarTime",
"(",
"final",
"int",
"nHour",
",",
"final",
"int",
"nMinute",
",",
"final",
"int",
"nSecond",
",",
"final",
"int",
"nMilliSecond",
")",
"{",
"return",
"getXMLCalendarTime",
"(",
"n... | <p>
Create a Java representation of XML Schema builtin datatype
<code>date</code> or <code>g*</code>.
</p>
<p>
For example, an instance of <code>gYear</code> can be created invoking this
factory with <code>month</code> and <code>day</code> parameters set to
{@link DatatypeConstants#FIELD_UNDEFINED}.
</p>
<p>
A {@link D... | [
"<p",
">",
"Create",
"a",
"Java",
"representation",
"of",
"XML",
"Schema",
"builtin",
"datatype",
"<code",
">",
"date<",
"/",
"code",
">",
"or",
"<code",
">",
"g",
"*",
"<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">",
"<p",
">",
"For",
"example",
... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-datetime/src/main/java/com/helger/datetime/util/PDTXMLConverter.java#L450-L457 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ConfigurationService.java | ConfigurationService.addValue | public void addValue(String name, String value) throws Exception {
"""
Add a name/value pair to the configuration table
@param name name of configuration item
@param value value of configuration item
@throws Exception exception
"""
PreparedStatement statement = null;
try (Connection sqlCon... | java | public void addValue(String name, String value) throws Exception {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"INSERT INTO " + Constants.DB_TABLE_CONFIGURATION +
... | [
"public",
"void",
"addValue",
"(",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"Exception",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"sqlService",
".",
"getConnection",
"(",
")",
")",... | Add a name/value pair to the configuration table
@param name name of configuration item
@param value value of configuration item
@throws Exception exception | [
"Add",
"a",
"name",
"/",
"value",
"pair",
"to",
"the",
"configuration",
"table"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ConfigurationService.java#L147-L168 |
paoding-code/paoding-rose | paoding-rose-web/src/main/java/net/paoding/rose/util/Base64.java | Base64.decode4to3 | private final int decode4to3(byte[] source, int srcOffset, byte[] destination, int destOffset) {
"""
Decodes four bytes from array <var>source</var>
and writes the resulting bytes (up to three of them)
to <var>destination</var>.
The source and destination arrays can be manipulated
anywhere along their length b... | java | private final int decode4to3(byte[] source, int srcOffset, byte[] destination, int destOffset) {
// Example: Dk== or Dk..
if (source[ srcOffset + 2] == PADDING_CHAR) {
int outBuff = ( ( DECODABET[ source[ srcOffset ] ] & 0xFF ) << 18 )
| ( ( DECODABET[ source[ srcOffset + 1] ] & 0xFF ) << 12 );
... | [
"private",
"final",
"int",
"decode4to3",
"(",
"byte",
"[",
"]",
"source",
",",
"int",
"srcOffset",
",",
"byte",
"[",
"]",
"destination",
",",
"int",
"destOffset",
")",
"{",
"// Example: Dk== or Dk..\r",
"if",
"(",
"source",
"[",
"srcOffset",
"+",
"2",
"]",... | Decodes four bytes from array <var>source</var>
and writes the resulting bytes (up to three of them)
to <var>destination</var>.
The source and destination arrays can be manipulated
anywhere along their length by specifying
<var>srcOffset</var> and <var>destOffset</var>.
This method does not check to make sure your arra... | [
"Decodes",
"four",
"bytes",
"from",
"array",
"<var",
">",
"source<",
"/",
"var",
">",
"and",
"writes",
"the",
"resulting",
"bytes",
"(",
"up",
"to",
"three",
"of",
"them",
")",
"to",
"<var",
">",
"destination<",
"/",
"var",
">",
".",
"The",
"source",
... | train | https://github.com/paoding-code/paoding-rose/blob/8b512704174dd6cba95e544c7d6ab66105cb8ec4/paoding-rose-web/src/main/java/net/paoding/rose/util/Base64.java#L344-L378 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.pressImage | public static void pressImage(InputStream srcStream, OutputStream destStream, Image pressImg, int x, int y, float alpha) {
"""
给图片添加图片水印<br>
此方法并不关闭流
@param srcStream 源图像流
@param destStream 目标图像流
@param pressImg 水印图片,可以使用{@link ImageIO#read(File)}方法读取文件
@param x 修正值。 默认在中间,偏移量相对于中间偏移
@param y 修正值。 默认在中间,偏移... | java | public static void pressImage(InputStream srcStream, OutputStream destStream, Image pressImg, int x, int y, float alpha) {
pressImage(read(srcStream), getImageOutputStream(destStream), pressImg, x, y, alpha);
} | [
"public",
"static",
"void",
"pressImage",
"(",
"InputStream",
"srcStream",
",",
"OutputStream",
"destStream",
",",
"Image",
"pressImg",
",",
"int",
"x",
",",
"int",
"y",
",",
"float",
"alpha",
")",
"{",
"pressImage",
"(",
"read",
"(",
"srcStream",
")",
","... | 给图片添加图片水印<br>
此方法并不关闭流
@param srcStream 源图像流
@param destStream 目标图像流
@param pressImg 水印图片,可以使用{@link ImageIO#read(File)}方法读取文件
@param x 修正值。 默认在中间,偏移量相对于中间偏移
@param y 修正值。 默认在中间,偏移量相对于中间偏移
@param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 | [
"给图片添加图片水印<br",
">",
"此方法并不关闭流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L891-L893 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/constraint/PEChainsIntersect.java | PEChainsIntersect.satisfies | @Override
public boolean satisfies(Match match, int... ind) {
"""
Creates two PhysicalEntity chains with the given endpoints, and checks if they are
intersecting.
@param match current pattern match
@param ind mapped indices
@return true if the chains are intersecting or not intersecting as desired
"""
P... | java | @Override
public boolean satisfies(Match match, int... ind)
{
PhysicalEntity pe0 = (PhysicalEntity) match.get(ind[0]);
PhysicalEntity pe1 = (PhysicalEntity) match.get(ind[1]);
PhysicalEntity pe2 = (PhysicalEntity) match.get(ind[2]);
PhysicalEntity pe3 = (PhysicalEntity) match.get(ind[3]);
PhysicalEntityCha... | [
"@",
"Override",
"public",
"boolean",
"satisfies",
"(",
"Match",
"match",
",",
"int",
"...",
"ind",
")",
"{",
"PhysicalEntity",
"pe0",
"=",
"(",
"PhysicalEntity",
")",
"match",
".",
"get",
"(",
"ind",
"[",
"0",
"]",
")",
";",
"PhysicalEntity",
"pe1",
"... | Creates two PhysicalEntity chains with the given endpoints, and checks if they are
intersecting.
@param match current pattern match
@param ind mapped indices
@return true if the chains are intersecting or not intersecting as desired | [
"Creates",
"two",
"PhysicalEntity",
"chains",
"with",
"the",
"given",
"endpoints",
"and",
"checks",
"if",
"they",
"are",
"intersecting",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/PEChainsIntersect.java#L57-L69 |
h2oai/h2o-2 | src/main/java/water/fvec/ParseDataset2.java | ParseProgress.make | static ParseProgress make( Key[] fkeys ) {
"""
Total number of steps is equal to total bytecount across files
"""
long total = 0;
for( Key fkey : fkeys )
total += getVec(fkey).length();
return new ParseProgress(0,total);
} | java | static ParseProgress make( Key[] fkeys ) {
long total = 0;
for( Key fkey : fkeys )
total += getVec(fkey).length();
return new ParseProgress(0,total);
} | [
"static",
"ParseProgress",
"make",
"(",
"Key",
"[",
"]",
"fkeys",
")",
"{",
"long",
"total",
"=",
"0",
";",
"for",
"(",
"Key",
"fkey",
":",
"fkeys",
")",
"total",
"+=",
"getVec",
"(",
"fkey",
")",
".",
"length",
"(",
")",
";",
"return",
"new",
"P... | Total number of steps is equal to total bytecount across files | [
"Total",
"number",
"of",
"steps",
"is",
"equal",
"to",
"total",
"bytecount",
"across",
"files"
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/ParseDataset2.java#L159-L164 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.getProjectsViaSudoWithPagination | public List<GitlabProject> getProjectsViaSudoWithPagination(GitlabUser user, int page, int perPage) throws IOException {
"""
Get a list of projects of perPage elements accessible by the authenticated user given page offset
@param user Gitlab User to invoke sudo with
@param page Page offset
@param perPag... | java | public List<GitlabProject> getProjectsViaSudoWithPagination(GitlabUser user, int page, int perPage) throws IOException {
Pagination pagination = new Pagination()
.withPage(page)
.withPerPage(perPage);
return getProjectsViaSudoWithPagination(user, pagination);
} | [
"public",
"List",
"<",
"GitlabProject",
">",
"getProjectsViaSudoWithPagination",
"(",
"GitlabUser",
"user",
",",
"int",
"page",
",",
"int",
"perPage",
")",
"throws",
"IOException",
"{",
"Pagination",
"pagination",
"=",
"new",
"Pagination",
"(",
")",
".",
"withPa... | Get a list of projects of perPage elements accessible by the authenticated user given page offset
@param user Gitlab User to invoke sudo with
@param page Page offset
@param perPage Number of elements to get after page offset
@return A list of gitlab projects
@throws IOException Gitlab API call error | [
"Get",
"a",
"list",
"of",
"projects",
"of",
"perPage",
"elements",
"accessible",
"by",
"the",
"authenticated",
"user",
"given",
"page",
"offset"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L926-L931 |
pedrovgs/DraggablePanel | draggablepanel/src/main/java/com/github/pedrovgs/DraggableView.java | DraggableView.cloneMotionEventWithAction | private MotionEvent cloneMotionEventWithAction(MotionEvent event, int action) {
"""
Clone given motion event and set specified action. This method is useful, when we want to
cancel event propagation in child views by sending event with {@link
android.view.MotionEvent#ACTION_CANCEL}
action.
@param event event... | java | private MotionEvent cloneMotionEventWithAction(MotionEvent event, int action) {
return MotionEvent.obtain(event.getDownTime(), event.getEventTime(), action, event.getX(),
event.getY(), event.getMetaState());
} | [
"private",
"MotionEvent",
"cloneMotionEventWithAction",
"(",
"MotionEvent",
"event",
",",
"int",
"action",
")",
"{",
"return",
"MotionEvent",
".",
"obtain",
"(",
"event",
".",
"getDownTime",
"(",
")",
",",
"event",
".",
"getEventTime",
"(",
")",
",",
"action",... | Clone given motion event and set specified action. This method is useful, when we want to
cancel event propagation in child views by sending event with {@link
android.view.MotionEvent#ACTION_CANCEL}
action.
@param event event to clone
@param action new action
@return cloned motion event | [
"Clone",
"given",
"motion",
"event",
"and",
"set",
"specified",
"action",
".",
"This",
"method",
"is",
"useful",
"when",
"we",
"want",
"to",
"cancel",
"event",
"propagation",
"in",
"child",
"views",
"by",
"sending",
"event",
"with",
"{",
"@link",
"android",
... | train | https://github.com/pedrovgs/DraggablePanel/blob/6b6d1806fa4140113f31307a2571bf02435aa53a/draggablepanel/src/main/java/com/github/pedrovgs/DraggableView.java#L420-L423 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java | BigDecimal.multiplyDivideAndRound | private static BigDecimal multiplyDivideAndRound(long dividend0, long dividend1, long divisor, int scale, int roundingMode,
int preferredScale) {
"""
/*
performs divideAndRound for (dividend0*dividend1, divisor)
returns null if quotient can't fit into long val... | java | private static BigDecimal multiplyDivideAndRound(long dividend0, long dividend1, long divisor, int scale, int roundingMode,
int preferredScale) {
int qsign = Long.signum(dividend0)*Long.signum(dividend1)*Long.signum(divisor);
dividend0 = Math.abs(divi... | [
"private",
"static",
"BigDecimal",
"multiplyDivideAndRound",
"(",
"long",
"dividend0",
",",
"long",
"dividend1",
",",
"long",
"divisor",
",",
"int",
"scale",
",",
"int",
"roundingMode",
",",
"int",
"preferredScale",
")",
"{",
"int",
"qsign",
"=",
"Long",
".",
... | /*
performs divideAndRound for (dividend0*dividend1, divisor)
returns null if quotient can't fit into long value; | [
"/",
"*",
"performs",
"divideAndRound",
"for",
"(",
"dividend0",
"*",
"dividend1",
"divisor",
")",
"returns",
"null",
"if",
"quotient",
"can",
"t",
"fit",
"into",
"long",
"value",
";"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java#L4763-L4792 |
pac4j/pac4j | pac4j-core/src/main/java/org/pac4j/core/profile/ProfileHelper.java | ProfileHelper.sanitizeIdentifier | public static String sanitizeIdentifier(final BasicUserProfile profile, final Object id) {
"""
Sanitize into a string identifier.
@param profile the user profile
@param id the identifier object
@return the sanitized identifier
"""
if (id != null) {
String sId = id.toString();
... | java | public static String sanitizeIdentifier(final BasicUserProfile profile, final Object id) {
if (id != null) {
String sId = id.toString();
if (profile != null) {
final String type = profile.getClass().getName() + BasicUserProfile.SEPARATOR;
if (sId.startsWit... | [
"public",
"static",
"String",
"sanitizeIdentifier",
"(",
"final",
"BasicUserProfile",
"profile",
",",
"final",
"Object",
"id",
")",
"{",
"if",
"(",
"id",
"!=",
"null",
")",
"{",
"String",
"sId",
"=",
"id",
".",
"toString",
"(",
")",
";",
"if",
"(",
"pr... | Sanitize into a string identifier.
@param profile the user profile
@param id the identifier object
@return the sanitized identifier | [
"Sanitize",
"into",
"a",
"string",
"identifier",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-core/src/main/java/org/pac4j/core/profile/ProfileHelper.java#L128-L140 |
samskivert/pythagoras | src/main/java/pythagoras/f/Quaternion.java | Quaternion.fromAngleAxis | public Quaternion fromAngleAxis (float angle, float x, float y, float z) {
"""
Sets this quaternion to the rotation described by the given angle and normalized
axis.
@return a reference to this quaternion, for chaining.
"""
float sina = FloatMath.sin(angle / 2f);
return set(x*sina, y*sina, ... | java | public Quaternion fromAngleAxis (float angle, float x, float y, float z) {
float sina = FloatMath.sin(angle / 2f);
return set(x*sina, y*sina, z*sina, FloatMath.cos(angle / 2f));
} | [
"public",
"Quaternion",
"fromAngleAxis",
"(",
"float",
"angle",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"float",
"sina",
"=",
"FloatMath",
".",
"sin",
"(",
"angle",
"/",
"2f",
")",
";",
"return",
"set",
"(",
"x",
"*",
"si... | Sets this quaternion to the rotation described by the given angle and normalized
axis.
@return a reference to this quaternion, for chaining. | [
"Sets",
"this",
"quaternion",
"to",
"the",
"rotation",
"described",
"by",
"the",
"given",
"angle",
"and",
"normalized",
"axis",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Quaternion.java#L165-L168 |
davidmoten/rxjava-extras | src/main/java/com/github/davidmoten/rx/Transformers.java | Transformers.delayFinalUnsubscribe | public static <T> Transformer<T, T> delayFinalUnsubscribe(long duration, TimeUnit unit) {
"""
If multiple concurrently open subscriptions happen to a source
transformed by this method then an additional do-nothing subscription
will be maintained to the source and will only be closed after the
specified duration... | java | public static <T> Transformer<T, T> delayFinalUnsubscribe(long duration, TimeUnit unit) {
return delayFinalUnsubscribe(duration, unit, Schedulers.computation());
} | [
"public",
"static",
"<",
"T",
">",
"Transformer",
"<",
"T",
",",
"T",
">",
"delayFinalUnsubscribe",
"(",
"long",
"duration",
",",
"TimeUnit",
"unit",
")",
"{",
"return",
"delayFinalUnsubscribe",
"(",
"duration",
",",
"unit",
",",
"Schedulers",
".",
"computat... | If multiple concurrently open subscriptions happen to a source
transformed by this method then an additional do-nothing subscription
will be maintained to the source and will only be closed after the
specified duration has passed from the final unsubscription of the open
subscriptions. If another subscription happens d... | [
"If",
"multiple",
"concurrently",
"open",
"subscriptions",
"happen",
"to",
"a",
"source",
"transformed",
"by",
"this",
"method",
"then",
"an",
"additional",
"do",
"-",
"nothing",
"subscription",
"will",
"be",
"maintained",
"to",
"the",
"source",
"and",
"will",
... | train | https://github.com/davidmoten/rxjava-extras/blob/a91d2ba7d454843250e0b0fce36084f9fb02a551/src/main/java/com/github/davidmoten/rx/Transformers.java#L915-L917 |
taimos/RESTUtils | src/main/java/de/taimos/restutils/RESTAssert.java | RESTAssert.assertSingleElement | public static void assertSingleElement(final Collection<?> collection, final StatusType status) {
"""
assert that collection has one element
@param collection the collection to check
@param status the status code to throw
@throws WebApplicationException with given status code
"""
RESTAssert.assertNotNul... | java | public static void assertSingleElement(final Collection<?> collection, final StatusType status) {
RESTAssert.assertNotNull(collection, status);
RESTAssert.assertTrue(collection.size() == 1, status);
} | [
"public",
"static",
"void",
"assertSingleElement",
"(",
"final",
"Collection",
"<",
"?",
">",
"collection",
",",
"final",
"StatusType",
"status",
")",
"{",
"RESTAssert",
".",
"assertNotNull",
"(",
"collection",
",",
"status",
")",
";",
"RESTAssert",
".",
"asse... | assert that collection has one element
@param collection the collection to check
@param status the status code to throw
@throws WebApplicationException with given status code | [
"assert",
"that",
"collection",
"has",
"one",
"element"
] | train | https://github.com/taimos/RESTUtils/blob/bdb1bf9a2eb13ede0eec6f071c10cb2698313501/src/main/java/de/taimos/restutils/RESTAssert.java#L225-L228 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.noNullElements | @ArgumentsChecked
@Throws( {
"""
Ensures that an iterable reference is neither {@code null} nor contains any elements that are {@code null}.
<p>
We recommend to use the overloaded method {@link Check#noNullElements(Iterable, String)} and pass as second
argument the name of the parameter to enhance the except... | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalNullElementsException.class })
public static <T extends Iterable<?>> T noNullElements(@Nonnull final T iterable) {
return noNullElements(iterable, EMPTY_ARGUMENT_NAME);
} | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"IllegalNullElementsException",
".",
"class",
"}",
")",
"public",
"static",
"<",
"T",
"extends",
"Iterable",
"<",
"?",
">",
">",
"T",
"noNullElements",
"(",
"@... | Ensures that an iterable reference is neither {@code null} nor contains any elements that are {@code null}.
<p>
We recommend to use the overloaded method {@link Check#noNullElements(Iterable, String)} and pass as second
argument the name of the parameter to enhance the exception message.
@param iterable
the iterable ... | [
"Ensures",
"that",
"an",
"iterable",
"reference",
"is",
"neither",
"{",
"@code",
"null",
"}",
"nor",
"contains",
"any",
"elements",
"that",
"are",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L1825-L1829 |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/alg/InputSanityCheck.java | InputSanityCheck.checkReshapeB | public static void checkReshapeB(ImageMultiBand<?> imgA, ImageMultiBand<?> imgB) {
"""
Throws exception if two images are the same instance. Otherwise reshapes B to match A
"""
if( imgA == imgB )
throw new IllegalArgumentException("Image's can't be the same instance");
imgB.reshape(imgA.width,imgA.heigh... | java | public static void checkReshapeB(ImageMultiBand<?> imgA, ImageMultiBand<?> imgB) {
if( imgA == imgB )
throw new IllegalArgumentException("Image's can't be the same instance");
imgB.reshape(imgA.width,imgA.height,imgA.getNumBands());
} | [
"public",
"static",
"void",
"checkReshapeB",
"(",
"ImageMultiBand",
"<",
"?",
">",
"imgA",
",",
"ImageMultiBand",
"<",
"?",
">",
"imgB",
")",
"{",
"if",
"(",
"imgA",
"==",
"imgB",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Image's can't be the sa... | Throws exception if two images are the same instance. Otherwise reshapes B to match A | [
"Throws",
"exception",
"if",
"two",
"images",
"are",
"the",
"same",
"instance",
".",
"Otherwise",
"reshapes",
"B",
"to",
"match",
"A"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/alg/InputSanityCheck.java#L93-L97 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuStreamWaitValue32 | public static int cuStreamWaitValue32(CUstream stream, CUdeviceptr addr, int value, int flags) {
"""
Wait on a memory location.<br>
<br>
Enqueues a synchronization of the stream on the given memory location.
Work ordered after the operation will block until the given condition on
the memory is satisfied. By de... | java | public static int cuStreamWaitValue32(CUstream stream, CUdeviceptr addr, int value, int flags)
{
return checkResult(cuStreamWaitValue32Native(stream, addr, value, flags));
} | [
"public",
"static",
"int",
"cuStreamWaitValue32",
"(",
"CUstream",
"stream",
",",
"CUdeviceptr",
"addr",
",",
"int",
"value",
",",
"int",
"flags",
")",
"{",
"return",
"checkResult",
"(",
"cuStreamWaitValue32Native",
"(",
"stream",
",",
"addr",
",",
"value",
",... | Wait on a memory location.<br>
<br>
Enqueues a synchronization of the stream on the given memory location.
Work ordered after the operation will block until the given condition on
the memory is satisfied. By default, the condition is to wait for
(int32_t)(*addr - value) >= 0, a cyclic greater-or-equal. Other condition
... | [
"Wait",
"on",
"a",
"memory",
"location",
".",
"<br",
">",
"<br",
">",
"Enqueues",
"a",
"synchronization",
"of",
"the",
"stream",
"on",
"the",
"given",
"memory",
"location",
".",
"Work",
"ordered",
"after",
"the",
"operation",
"will",
"block",
"until",
"the... | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L13691-L13694 |
auth0/auth0-java | src/main/java/com/auth0/client/auth/AuthAPI.java | AuthAPI.resetPassword | public Request resetPassword(String email, String connection) {
"""
Request a password reset for the given email and database connection. The response will always be successful even if
there's no user associated to the given email for that database connection.
i.e.:
<pre>
{@code
AuthAPI auth = new AuthAPI("me... | java | public Request resetPassword(String email, String connection) {
Asserts.assertNotNull(email, "email");
Asserts.assertNotNull(connection, "connection");
String url = baseUrl
.newBuilder()
.addPathSegment(PATH_DBCONNECTIONS)
.addPathSegment("change_... | [
"public",
"Request",
"resetPassword",
"(",
"String",
"email",
",",
"String",
"connection",
")",
"{",
"Asserts",
".",
"assertNotNull",
"(",
"email",
",",
"\"email\"",
")",
";",
"Asserts",
".",
"assertNotNull",
"(",
"connection",
",",
"\"connection\"",
")",
";",... | Request a password reset for the given email and database connection. The response will always be successful even if
there's no user associated to the given email for that database connection.
i.e.:
<pre>
{@code
AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfk... | [
"Request",
"a",
"password",
"reset",
"for",
"the",
"given",
"email",
"and",
"database",
"connection",
".",
"The",
"response",
"will",
"always",
"be",
"successful",
"even",
"if",
"there",
"s",
"no",
"user",
"associated",
"to",
"the",
"given",
"email",
"for",
... | train | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/auth/AuthAPI.java#L210-L225 |
VoltDB/voltdb | third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java | HelpFormatter.appendOptionGroup | private void appendOptionGroup(StringBuffer buff, OptionGroup group) {
"""
Appends the usage clause for an OptionGroup to a StringBuffer.
The clause is wrapped in square brackets if the group is required.
The display of the options is handled by appendOption
@param buff the StringBuffer to append to
@param gro... | java | private void appendOptionGroup(StringBuffer buff, OptionGroup group)
{
if (!group.isRequired())
{
buff.append("[");
}
List<Option> optList = new ArrayList<Option>(group.getOptions());
if (getOptionComparator() != null)
{
Collections.sort(optLi... | [
"private",
"void",
"appendOptionGroup",
"(",
"StringBuffer",
"buff",
",",
"OptionGroup",
"group",
")",
"{",
"if",
"(",
"!",
"group",
".",
"isRequired",
"(",
")",
")",
"{",
"buff",
".",
"append",
"(",
"\"[\"",
")",
";",
"}",
"List",
"<",
"Option",
">",
... | Appends the usage clause for an OptionGroup to a StringBuffer.
The clause is wrapped in square brackets if the group is required.
The display of the options is handled by appendOption
@param buff the StringBuffer to append to
@param group the group to append
@see #appendOption(StringBuffer,Option,boolean) | [
"Appends",
"the",
"usage",
"clause",
"for",
"an",
"OptionGroup",
"to",
"a",
"StringBuffer",
".",
"The",
"clause",
"is",
"wrapped",
"in",
"square",
"brackets",
"if",
"the",
"group",
"is",
"required",
".",
"The",
"display",
"of",
"the",
"options",
"is",
"han... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java#L644-L672 |
CloudSlang/score | score-api/src/main/java/io/cloudslang/score/lang/ExecutionRuntimeServices.java | ExecutionRuntimeServices.setSubFlowsData | public void setSubFlowsData(Map<String, Long> runningPlansIds, Map<String, Long> beginStepsIds) {
"""
put all the data relevant for sub flows: map of runningPlanIds and list of BeginStepIds
@param runningPlansIds - map of flowUUID to runningPlanId
@param beginStepsIds - map of flowUUID to beginStepId
"""
... | java | public void setSubFlowsData(Map<String, Long> runningPlansIds, Map<String, Long> beginStepsIds) {
contextMap.put(RUNNING_PLANS_MAP, (Serializable) runningPlansIds);
contextMap.put(BEGIN_STEPS_MAP, (Serializable) beginStepsIds);
} | [
"public",
"void",
"setSubFlowsData",
"(",
"Map",
"<",
"String",
",",
"Long",
">",
"runningPlansIds",
",",
"Map",
"<",
"String",
",",
"Long",
">",
"beginStepsIds",
")",
"{",
"contextMap",
".",
"put",
"(",
"RUNNING_PLANS_MAP",
",",
"(",
"Serializable",
")",
... | put all the data relevant for sub flows: map of runningPlanIds and list of BeginStepIds
@param runningPlansIds - map of flowUUID to runningPlanId
@param beginStepsIds - map of flowUUID to beginStepId | [
"put",
"all",
"the",
"data",
"relevant",
"for",
"sub",
"flows",
":",
"map",
"of",
"runningPlanIds",
"and",
"list",
"of",
"BeginStepIds"
] | train | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/score-api/src/main/java/io/cloudslang/score/lang/ExecutionRuntimeServices.java#L115-L118 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/AttributeValue.java | AttributeValue.withM | public AttributeValue withM(java.util.Map<String, AttributeValue> m) {
"""
<p>
An attribute of type Map. For example:
</p>
<p>
<code>"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}</code>
</p>
@param m
An attribute of type Map. For example:</p>
<p>
<code>"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}</... | java | public AttributeValue withM(java.util.Map<String, AttributeValue> m) {
setM(m);
return this;
} | [
"public",
"AttributeValue",
"withM",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
"m",
")",
"{",
"setM",
"(",
"m",
")",
";",
"return",
"this",
";",
"}"
] | <p>
An attribute of type Map. For example:
</p>
<p>
<code>"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}</code>
</p>
@param m
An attribute of type Map. For example:</p>
<p>
<code>"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}</code>
@return Returns a reference to this object so that method calls can be chained toget... | [
"<p",
">",
"An",
"attribute",
"of",
"type",
"Map",
".",
"For",
"example",
":",
"<",
"/",
"p",
">",
"<p",
">",
"<code",
">",
"M",
":",
"{",
"Name",
":",
"{",
"S",
":",
"Joe",
"}",
"Age",
":",
"{",
"N",
":",
"35",
"}}",
"<",
"/",
"code",
">... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/AttributeValue.java#L739-L742 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.beginUpdate | public VirtualMachineScaleSetInner beginUpdate(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) {
"""
Update a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set to create or update.
@param paramete... | java | public VirtualMachineScaleSetInner beginUpdate(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, parameters).toBlocking().single().body();
} | [
"public",
"VirtualMachineScaleSetInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"VirtualMachineScaleSetUpdate",
"parameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetN... | Update a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set to create or update.
@param parameters The scale set object.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejec... | [
"Update",
"a",
"VM",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L454-L456 |
reactor/reactor-netty | src/main/java/reactor/netty/channel/BootstrapHandlers.java | BootstrapHandlers.removeConfiguration | public static ServerBootstrap removeConfiguration(ServerBootstrap b, String name) {
"""
Remove a configuration given its unique name from the given {@link
ServerBootstrap}
@param b a server bootstrap
@param name a configuration name
"""
Objects.requireNonNull(b, "bootstrap");
Objects.requireNonNull(na... | java | public static ServerBootstrap removeConfiguration(ServerBootstrap b, String name) {
Objects.requireNonNull(b, "bootstrap");
Objects.requireNonNull(name, "name");
if (b.config().childHandler() != null) {
b.childHandler(removeConfiguration(b.config().childHandler(), name));
}
return b;
} | [
"public",
"static",
"ServerBootstrap",
"removeConfiguration",
"(",
"ServerBootstrap",
"b",
",",
"String",
"name",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"b",
",",
"\"bootstrap\"",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"name",
",",
"\"name\""... | Remove a configuration given its unique name from the given {@link
ServerBootstrap}
@param b a server bootstrap
@param name a configuration name | [
"Remove",
"a",
"configuration",
"given",
"its",
"unique",
"name",
"from",
"the",
"given",
"{",
"@link",
"ServerBootstrap",
"}"
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/channel/BootstrapHandlers.java#L166-L173 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java | ImmatureClass.hasMethodInHierarchy | private static boolean hasMethodInHierarchy(JavaClass cls, String methodName, String methodSig)
throws ClassNotFoundException {
"""
looks to see if this class (or some class in its hierarchy (besides Object)
has implemented the specified method.
@param cls the class to look in
@param methodName the ... | java | private static boolean hasMethodInHierarchy(JavaClass cls, String methodName, String methodSig)
throws ClassNotFoundException {
String clsName = cls.getClassName();
if (Values.DOTTED_JAVA_LANG_OBJECT.equals(clsName)) {
return false;
}
if (Statistics.getStatistics().getMethodStatistics(clsName.replace('.'... | [
"private",
"static",
"boolean",
"hasMethodInHierarchy",
"(",
"JavaClass",
"cls",
",",
"String",
"methodName",
",",
"String",
"methodSig",
")",
"throws",
"ClassNotFoundException",
"{",
"String",
"clsName",
"=",
"cls",
".",
"getClassName",
"(",
")",
";",
"if",
"("... | looks to see if this class (or some class in its hierarchy (besides Object)
has implemented the specified method.
@param cls the class to look in
@param methodName the method name to look for
@param methodSig the method signature to look for
@return when toString is found
@throws ClassNotFoundException if a ... | [
"looks",
"to",
"see",
"if",
"this",
"class",
"(",
"or",
"some",
"class",
"in",
"its",
"hierarchy",
"(",
"besides",
"Object",
")",
"has",
"implemented",
"the",
"specified",
"method",
"."
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java#L275-L287 |
vakinge/jeesuite-libs | jeesuite-common/src/main/java/com/jeesuite/common/util/DateUtils.java | DateUtils.format | public static String format(Date date, String... patterns) {
"""
格式化日期为日期字符串<br>
generate by: vakin jiang at 2012-3-7
@param orig
@param patterns
@return
"""
if (date == null)
return "";
String pattern = TIMESTAMP_PATTERN;
if (patterns != null && patterns.length > 0
... | java | public static String format(Date date, String... patterns) {
if (date == null)
return "";
String pattern = TIMESTAMP_PATTERN;
if (patterns != null && patterns.length > 0
&& StringUtils.isNotBlank(patterns[0])) {
pattern = patterns[0];
}
ret... | [
"public",
"static",
"String",
"format",
"(",
"Date",
"date",
",",
"String",
"...",
"patterns",
")",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"return",
"\"\"",
";",
"String",
"pattern",
"=",
"TIMESTAMP_PATTERN",
";",
"if",
"(",
"patterns",
"!=",
"null",... | 格式化日期为日期字符串<br>
generate by: vakin jiang at 2012-3-7
@param orig
@param patterns
@return | [
"格式化日期为日期字符串<br",
">",
"generate",
"by",
":",
"vakin",
"jiang",
"at",
"2012",
"-",
"3",
"-",
"7"
] | train | https://github.com/vakinge/jeesuite-libs/blob/c48fe2c7fbd294892cf4030dbec96e744dd3e386/jeesuite-common/src/main/java/com/jeesuite/common/util/DateUtils.java#L175-L184 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java | LeaseManager.addLease | synchronized Lease addLease(String holder, String src, long timestamp) {
"""
Adds (or re-adds) the lease for the specified file.
@param client that will hold the lease
@param src file path to associated with the lease.
@param timestamp time that the file was opened. (could be in the
past if loaded from FsImage... | java | synchronized Lease addLease(String holder, String src, long timestamp) {
Lease lease = getLease(holder);
if (lease == null) {
lease = new Lease(holder);
leases.put(holder, lease);
sortedLeases.add(lease);
} else {
renewLease(lease);
}
sortedLeasesByPath.put(src, new LeaseOpen... | [
"synchronized",
"Lease",
"addLease",
"(",
"String",
"holder",
",",
"String",
"src",
",",
"long",
"timestamp",
")",
"{",
"Lease",
"lease",
"=",
"getLease",
"(",
"holder",
")",
";",
"if",
"(",
"lease",
"==",
"null",
")",
"{",
"lease",
"=",
"new",
"Lease"... | Adds (or re-adds) the lease for the specified file.
@param client that will hold the lease
@param src file path to associated with the lease.
@param timestamp time that the file was opened. (could be in the
past if loaded from FsImage | [
"Adds",
"(",
"or",
"re",
"-",
"adds",
")",
"the",
"lease",
"for",
"the",
"specified",
"file",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java#L154-L167 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLUtils.java | SSLUtils.getSSLEngine | public static SSLEngine getSSLEngine(SSLContext context, FlowType type, SSLLinkConfig config, SSLConnectionLink connLink) {
"""
Setup the SSL engine for the given context.
@param context used to build the engine
@param type to determine if connection is inbound or outbound
@param config SSL channel configurat... | java | public static SSLEngine getSSLEngine(SSLContext context, FlowType type, SSLLinkConfig config, SSLConnectionLink connLink) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "getSSLEngine");
}
// Create a new SSL engine for this connection.
SSLEn... | [
"public",
"static",
"SSLEngine",
"getSSLEngine",
"(",
"SSLContext",
"context",
",",
"FlowType",
"type",
",",
"SSLLinkConfig",
"config",
",",
"SSLConnectionLink",
"connLink",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
... | Setup the SSL engine for the given context.
@param context used to build the engine
@param type to determine if connection is inbound or outbound
@param config SSL channel configuration
@param connLink
@return SSLEngine | [
"Setup",
"the",
"SSL",
"engine",
"for",
"the",
"given",
"context",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLUtils.java#L1156-L1168 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/util/annotation/AnnotationUtils.java | AnnotationUtils.findAnnotation | public static <A extends Annotation> A findAnnotation(final AnnotatedElement source, final Class<A> targetAnnotationClass) {
"""
Deep search of specified annotation considering "annotation as meta annotation" case (annotation annotated with specified annotation).
@param source
specified annotated element
@par... | java | public static <A extends Annotation> A findAnnotation(final AnnotatedElement source, final Class<A> targetAnnotationClass) {
Objects.requireNonNull(source, "incoming 'source' is not valid");
Objects.requireNonNull(targetAnnotationClass, "incoming 'targetAnnotationClass' is not valid");
final A result = source.ge... | [
"public",
"static",
"<",
"A",
"extends",
"Annotation",
">",
"A",
"findAnnotation",
"(",
"final",
"AnnotatedElement",
"source",
",",
"final",
"Class",
"<",
"A",
">",
"targetAnnotationClass",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"source",
",",
"\"inc... | Deep search of specified annotation considering "annotation as meta annotation" case (annotation annotated with specified annotation).
@param source
specified annotated element
@param targetAnnotationClass
specified annotation class
@param <A>
the type of the annotation to query for and return if present
@return speci... | [
"Deep",
"search",
"of",
"specified",
"annotation",
"considering",
"annotation",
"as",
"meta",
"annotation",
"case",
"(",
"annotation",
"annotated",
"with",
"specified",
"annotation",
")",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/util/annotation/AnnotationUtils.java#L32-L41 |
ManfredTremmel/gwt-commons-lang3 | src/main/resources/org/apache/commons/jre/java/util/GregorianCalendar.java | GregorianCalendar.getWeekOne | @SuppressWarnings("deprecation")
private Date getWeekOne(int year) {
"""
Gets the date of the first week for the specified year.
@param year This is year - 1900 as returned by Date.getYear()
@return
"""
GregorianCalendar weekOne = new GregorianCalendar();
weekOne.setFirstDayOfWeek(getFirstDayOfWeek());
... | java | @SuppressWarnings("deprecation")
private Date getWeekOne(int year) {
GregorianCalendar weekOne = new GregorianCalendar();
weekOne.setFirstDayOfWeek(getFirstDayOfWeek());
weekOne.setMinimalDaysInFirstWeek(getMinimalDaysInFirstWeek());
weekOne.setTime(new Date(year, 0, 1));
// can we use the week of 1/1/year a... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"Date",
"getWeekOne",
"(",
"int",
"year",
")",
"{",
"GregorianCalendar",
"weekOne",
"=",
"new",
"GregorianCalendar",
"(",
")",
";",
"weekOne",
".",
"setFirstDayOfWeek",
"(",
"getFirstDayOfWeek",
"(",... | Gets the date of the first week for the specified year.
@param year This is year - 1900 as returned by Date.getYear()
@return | [
"Gets",
"the",
"date",
"of",
"the",
"first",
"week",
"for",
"the",
"specified",
"year",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/resources/org/apache/commons/jre/java/util/GregorianCalendar.java#L396-L412 |
diffplug/durian | src/com/diffplug/common/base/TreeNode.java | TreeNode.copy | public static <T> TreeNode<T> copy(TreeDef<T> treeDef, T root) {
"""
Creates a hierarchy of TreeNodes that copies the structure and content of the given tree.
"""
return copy(treeDef, root, Function.identity());
} | java | public static <T> TreeNode<T> copy(TreeDef<T> treeDef, T root) {
return copy(treeDef, root, Function.identity());
} | [
"public",
"static",
"<",
"T",
">",
"TreeNode",
"<",
"T",
">",
"copy",
"(",
"TreeDef",
"<",
"T",
">",
"treeDef",
",",
"T",
"root",
")",
"{",
"return",
"copy",
"(",
"treeDef",
",",
"root",
",",
"Function",
".",
"identity",
"(",
")",
")",
";",
"}"
] | Creates a hierarchy of TreeNodes that copies the structure and content of the given tree. | [
"Creates",
"a",
"hierarchy",
"of",
"TreeNodes",
"that",
"copies",
"the",
"structure",
"and",
"content",
"of",
"the",
"given",
"tree",
"."
] | train | https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/TreeNode.java#L137-L139 |
Swagger2Markup/swagger2markup | src/main/java/io/github/swagger2markup/spi/PathsDocumentExtension.java | PathsDocumentExtension.levelOffset | protected int levelOffset(Context context) {
"""
Returns title level offset from 1 to apply to content
@param context context
@return title level offset
"""
//TODO: Unused method, make sure this is never used and then remove it.
int levelOffset;
switch (context.position) {
... | java | protected int levelOffset(Context context) {
//TODO: Unused method, make sure this is never used and then remove it.
int levelOffset;
switch (context.position) {
case DOCUMENT_BEFORE:
case DOCUMENT_AFTER:
levelOffset = 0;
break;
... | [
"protected",
"int",
"levelOffset",
"(",
"Context",
"context",
")",
"{",
"//TODO: Unused method, make sure this is never used and then remove it.",
"int",
"levelOffset",
";",
"switch",
"(",
"context",
".",
"position",
")",
"{",
"case",
"DOCUMENT_BEFORE",
":",
"case",
"DO... | Returns title level offset from 1 to apply to content
@param context context
@return title level offset | [
"Returns",
"title",
"level",
"offset",
"from",
"1",
"to",
"apply",
"to",
"content"
] | train | https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/spi/PathsDocumentExtension.java#L39-L81 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/JMFileAppender.java | JMFileAppender.appendLinesAndClose | public static Path appendLinesAndClose(String filePath, String... lines) {
"""
Append lines and close path.
@param filePath the file path
@param lines the lines
@return the path
"""
return appendLinesAndClose(filePath, UTF_8, lines);
} | java | public static Path appendLinesAndClose(String filePath, String... lines) {
return appendLinesAndClose(filePath, UTF_8, lines);
} | [
"public",
"static",
"Path",
"appendLinesAndClose",
"(",
"String",
"filePath",
",",
"String",
"...",
"lines",
")",
"{",
"return",
"appendLinesAndClose",
"(",
"filePath",
",",
"UTF_8",
",",
"lines",
")",
";",
"}"
] | Append lines and close path.
@param filePath the file path
@param lines the lines
@return the path | [
"Append",
"lines",
"and",
"close",
"path",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/JMFileAppender.java#L122-L124 |
Netflix/Hystrix | hystrix-core/src/main/java/com/netflix/hystrix/HystrixCollapser.java | HystrixCollapser.execute | public ResponseType execute() {
"""
Used for synchronous execution.
<p>
If {@link Scope#REQUEST} is being used then synchronous execution will only result in collapsing if other threads are running within the same scope.
@return ResponseType
Result of {@link HystrixCommand}{@code <BatchReturnType>} execution... | java | public ResponseType execute() {
try {
return queue().get();
} catch (Throwable e) {
if (e instanceof HystrixRuntimeException) {
throw (HystrixRuntimeException) e;
}
// if we have an exception we know about we'll throw it directly without th... | [
"public",
"ResponseType",
"execute",
"(",
")",
"{",
"try",
"{",
"return",
"queue",
"(",
")",
".",
"get",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"e",
")",
"{",
"if",
"(",
"e",
"instanceof",
"HystrixRuntimeException",
")",
"{",
"throw",
"(",
"H... | Used for synchronous execution.
<p>
If {@link Scope#REQUEST} is being used then synchronous execution will only result in collapsing if other threads are running within the same scope.
@return ResponseType
Result of {@link HystrixCommand}{@code <BatchReturnType>} execution after passing through {@link #mapResponseToRe... | [
"Used",
"for",
"synchronous",
"execution",
".",
"<p",
">",
"If",
"{",
"@link",
"Scope#REQUEST",
"}",
"is",
"being",
"used",
"then",
"synchronous",
"execution",
"will",
"only",
"result",
"in",
"collapsing",
"if",
"other",
"threads",
"are",
"running",
"within",
... | train | https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCollapser.java#L426-L443 |
openengsb/openengsb | components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/Diff.java | Diff.removeIfExist | private EDBObject removeIfExist(String oid, List<EDBObject> tempList) {
"""
Removes the element with the given oid if it exists in the list and returns it. If it not exists, null will be
returned.
"""
Iterator<EDBObject> iterator = tempList.iterator();
while (iterator.hasNext()) {
... | java | private EDBObject removeIfExist(String oid, List<EDBObject> tempList) {
Iterator<EDBObject> iterator = tempList.iterator();
while (iterator.hasNext()) {
EDBObject obj = iterator.next();
if (obj.getOID().equals(oid)) {
iterator.remove();
return obj;... | [
"private",
"EDBObject",
"removeIfExist",
"(",
"String",
"oid",
",",
"List",
"<",
"EDBObject",
">",
"tempList",
")",
"{",
"Iterator",
"<",
"EDBObject",
">",
"iterator",
"=",
"tempList",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"iterator",
".",
"hasNext... | Removes the element with the given oid if it exists in the list and returns it. If it not exists, null will be
returned. | [
"Removes",
"the",
"element",
"with",
"the",
"given",
"oid",
"if",
"it",
"exists",
"in",
"the",
"list",
"and",
"returns",
"it",
".",
"If",
"it",
"not",
"exists",
"null",
"will",
"be",
"returned",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/Diff.java#L107-L118 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java | DatabaseImpl.forceInsert | public void forceInsert(InternalDocumentRevision rev, String... revisionHistory) throws
DocumentException {
"""
<p>Inserts a revision of a document with an existing revision ID</p>
<p>Equivalent to:</p>
<code>
forceInsert(rev, Arrays.asList(revisionHistory), null, null, false);
</code>
@para... | java | public void forceInsert(InternalDocumentRevision rev, String... revisionHistory) throws
DocumentException {
Misc.checkState(this.isOpen(), "Database is closed");
this.forceInsert(Collections.singletonList(new ForceInsertItem(rev, Arrays.asList
(revisionHistory), null, null, f... | [
"public",
"void",
"forceInsert",
"(",
"InternalDocumentRevision",
"rev",
",",
"String",
"...",
"revisionHistory",
")",
"throws",
"DocumentException",
"{",
"Misc",
".",
"checkState",
"(",
"this",
".",
"isOpen",
"(",
")",
",",
"\"Database is closed\"",
")",
";",
"... | <p>Inserts a revision of a document with an existing revision ID</p>
<p>Equivalent to:</p>
<code>
forceInsert(rev, Arrays.asList(revisionHistory), null, null, false);
</code>
@param rev A {@code DocumentRevision} containing the information for a revision
from a remote DocumentStore.
@param revisionHistor... | [
"<p",
">",
"Inserts",
"a",
"revision",
"of",
"a",
"document",
"with",
"an",
"existing",
"revision",
"ID<",
"/",
"p",
">"
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java#L592-L597 |
hypercube1024/firefly | firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java | DefaultBeanProcessor.matchesPrimitive | private boolean matchesPrimitive(Class<?> targetType, Class<?> valueType) {
"""
Check whether a value is of the same primitive type as <code>targetType</code>.
@param targetType The primitive type to target.
@param valueType The value to match to the primitive type.
@return Whether <code>valueType</code> can... | java | private boolean matchesPrimitive(Class<?> targetType, Class<?> valueType) {
if (!targetType.isPrimitive()) {
return false;
}
try {
// see if there is a "TYPE" field. This is present for primitive wrappers.
Field typeField = valueType.getField("TYPE");
... | [
"private",
"boolean",
"matchesPrimitive",
"(",
"Class",
"<",
"?",
">",
"targetType",
",",
"Class",
"<",
"?",
">",
"valueType",
")",
"{",
"if",
"(",
"!",
"targetType",
".",
"isPrimitive",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"/... | Check whether a value is of the same primitive type as <code>targetType</code>.
@param targetType The primitive type to target.
@param valueType The value to match to the primitive type.
@return Whether <code>valueType</code> can be coerced (e.g. autoboxed) into <code>targetType</code>. | [
"Check",
"whether",
"a",
"value",
"is",
"of",
"the",
"same",
"primitive",
"type",
"as",
"<code",
">",
"targetType<",
"/",
"code",
">",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java#L236-L257 |
bekkopen/NoCommons | src/main/java/no/bekk/bekkopen/person/FodselsnummerCalculator.java | FodselsnummerCalculator.getManyDNumberFodselsnummerForDate | public static List<Fodselsnummer> getManyDNumberFodselsnummerForDate(Date date) {
"""
Returns a List with with VALID DNumber Fodselsnummer instances for a given Date.
@param date The Date instance
@return A List with Fodelsnummer instances
"""
if (date == null) {
throw new IllegalArgumentException();
... | java | public static List<Fodselsnummer> getManyDNumberFodselsnummerForDate(Date date) {
if (date == null) {
throw new IllegalArgumentException();
}
DateFormat df = new SimpleDateFormat("ddMMyy");
String centuryString = getCentury(date);
String dateString = df.format(date);
dateString = new StringBuilder()
... | [
"public",
"static",
"List",
"<",
"Fodselsnummer",
">",
"getManyDNumberFodselsnummerForDate",
"(",
"Date",
"date",
")",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"DateFormat",
"df",
"=",
"n... | Returns a List with with VALID DNumber Fodselsnummer instances for a given Date.
@param date The Date instance
@return A List with Fodelsnummer instances | [
"Returns",
"a",
"List",
"with",
"with",
"VALID",
"DNumber",
"Fodselsnummer",
"instances",
"for",
"a",
"given",
"Date",
"."
] | train | https://github.com/bekkopen/NoCommons/blob/5a576696390cecaac111fa97fde581e0c1afb9b8/src/main/java/no/bekk/bekkopen/person/FodselsnummerCalculator.java#L41-L53 |
Metatavu/paytrail-rest-api-sdk | src/main/java/fi/metatavu/paytrail/PaytrailService.java | PaytrailService.confirmPayment | public boolean confirmPayment(String orderNumber, String timestamp, String paid, String method, String authCode) {
"""
This function can be used to validate parameters returned by return and notify requests.
Parameters must be validated in order to avoid hacking of payment confirmation.
"""
String base = ne... | java | public boolean confirmPayment(String orderNumber, String timestamp, String paid, String method, String authCode) {
String base = new StringBuilder()
.append(orderNumber)
.append('|')
.append(timestamp)
.append('|')
.append(paid)
.append('|')
.append(method)
.append('|')
.a... | [
"public",
"boolean",
"confirmPayment",
"(",
"String",
"orderNumber",
",",
"String",
"timestamp",
",",
"String",
"paid",
",",
"String",
"method",
",",
"String",
"authCode",
")",
"{",
"String",
"base",
"=",
"new",
"StringBuilder",
"(",
")",
".",
"append",
"(",... | This function can be used to validate parameters returned by return and notify requests.
Parameters must be validated in order to avoid hacking of payment confirmation. | [
"This",
"function",
"can",
"be",
"used",
"to",
"validate",
"parameters",
"returned",
"by",
"return",
"and",
"notify",
"requests",
".",
"Parameters",
"must",
"be",
"validated",
"in",
"order",
"to",
"avoid",
"hacking",
"of",
"payment",
"confirmation",
"."
] | train | https://github.com/Metatavu/paytrail-rest-api-sdk/blob/16fb16f89dae3523e836ac4ef0ab5dc0f96e9f05/src/main/java/fi/metatavu/paytrail/PaytrailService.java#L93-L111 |
devnied/Bit-lib4j | src/main/java/fr/devnied/bitlib/BitUtils.java | BitUtils.setNextValue | protected void setNextValue(final long pValue, final int pLength, final int pMaxSize) {
"""
Add Value to the current position with the specified size
@param pValue
value to add
@param pLength
length of the value
@param pMaxSize
max size in bits
"""
long value = pValue;
// Set to max value if pVal... | java | protected void setNextValue(final long pValue, final int pLength, final int pMaxSize) {
long value = pValue;
// Set to max value if pValue cannot be stored on pLength bits.
long bitMax = (long) Math.pow(2, Math.min(pLength, pMaxSize));
if (pValue > bitMax) {
value = bitMax - 1;
}
// size to wrote
... | [
"protected",
"void",
"setNextValue",
"(",
"final",
"long",
"pValue",
",",
"final",
"int",
"pLength",
",",
"final",
"int",
"pMaxSize",
")",
"{",
"long",
"value",
"=",
"pValue",
";",
"// Set to max value if pValue cannot be stored on pLength bits.\r",
"long",
"bitMax",
... | Add Value to the current position with the specified size
@param pValue
value to add
@param pLength
length of the value
@param pMaxSize
max size in bits | [
"Add",
"Value",
"to",
"the",
"current",
"position",
"with",
"the",
"specified",
"size"
] | train | https://github.com/devnied/Bit-lib4j/blob/bdfa79fd12e7e3d5cf1196291825ef1bb12a1ee0/src/main/java/fr/devnied/bitlib/BitUtils.java#L590-L616 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.signAsync | public ServiceFuture<KeyOperationResult> signAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback) {
"""
Creates a signature from a digest using the specified key.
The SIGN operation is applica... | java | public ServiceFuture<KeyOperationResult> signAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback) {
return ServiceFuture.fromResponse(signWithServiceResponseAsync(vaultBaseUrl, keyName, keyV... | [
"public",
"ServiceFuture",
"<",
"KeyOperationResult",
">",
"signAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"String",
"keyVersion",
",",
"JsonWebKeySignatureAlgorithm",
"algorithm",
",",
"byte",
"[",
"]",
"value",
",",
"final",
"ServiceCall... | Creates a signature from a digest using the specified key.
The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission.
@param vaultBaseUrl The vault name, for example https://myva... | [
"Creates",
"a",
"signature",
"from",
"a",
"digest",
"using",
"the",
"specified",
"key",
".",
"The",
"SIGN",
"operation",
"is",
"applicable",
"to",
"asymmetric",
"and",
"symmetric",
"keys",
"stored",
"in",
"Azure",
"Key",
"Vault",
"since",
"this",
"operation",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L2387-L2389 |
Wikidata/Wikidata-Toolkit | wdtk-rdf/src/main/java/org/wikidata/wdtk/rdf/SnakRdfConverter.java | SnakRdfConverter.setSnakContext | public void setSnakContext(Resource subject, PropertyContext propertyContext) {
"""
Sets the context in which snaks should be used. This is useful when
converting many snaks that have the same context. In this case, one can
set the context manually and use the converter as a {@link SnakVisitor}.
@param subjec... | java | public void setSnakContext(Resource subject, PropertyContext propertyContext) {
this.currentSubject = subject;
this.currentPropertyContext = propertyContext;
this.simple = (this.currentPropertyContext == PropertyContext.DIRECT)
|| (this.currentPropertyContext == PropertyContext.VALUE_SIMPLE)
|| (this.curr... | [
"public",
"void",
"setSnakContext",
"(",
"Resource",
"subject",
",",
"PropertyContext",
"propertyContext",
")",
"{",
"this",
".",
"currentSubject",
"=",
"subject",
";",
"this",
".",
"currentPropertyContext",
"=",
"propertyContext",
";",
"this",
".",
"simple",
"=",... | Sets the context in which snaks should be used. This is useful when
converting many snaks that have the same context. In this case, one can
set the context manually and use the converter as a {@link SnakVisitor}.
@param subject
the resource that should be used as a subject of the serialied
triples
@param propertyConte... | [
"Sets",
"the",
"context",
"in",
"which",
"snaks",
"should",
"be",
"used",
".",
"This",
"is",
"useful",
"when",
"converting",
"many",
"snaks",
"that",
"have",
"the",
"same",
"context",
".",
"In",
"this",
"case",
"one",
"can",
"set",
"the",
"context",
"man... | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-rdf/src/main/java/org/wikidata/wdtk/rdf/SnakRdfConverter.java#L135-L143 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractSegment3F.java | AbstractSegment3F.computeLineLineIntersectionFactor | @Pure
public static double computeLineLineIntersectionFactor(
double x1, double y1, double z1, double x2, double y2, double z2,
double x3, double y3, double z3, double x4, double y4, double z4) {
"""
Replies one position factor for the intersection point between two lines.
<p>
Let line equations for L1 an... | java | @Pure
public static double computeLineLineIntersectionFactor(
double x1, double y1, double z1, double x2, double y2, double z2,
double x3, double y3, double z3, double x4, double y4, double z4) {
//We compute the 4 vectors P1P2, P3P4, P1P3 and P2P4
Vector3f a = new Vector3f(x2 - x1, y2 - y1, z2 - z1);
Ve... | [
"@",
"Pure",
"public",
"static",
"double",
"computeLineLineIntersectionFactor",
"(",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"z1",
",",
"double",
"x2",
",",
"double",
"y2",
",",
"double",
"z2",
",",
"double",
"x3",
",",
"double",
"y3",
",",
"... | Replies one position factor for the intersection point between two lines.
<p>
Let line equations for L1 and L2:<br>
<code>L1: P1 + factor1 * (P2-P1)</code><br>
<code>L2: P3 + factor2 * (P4-P3)</code><br>
If lines are intersecting, then<br>
<code>P1 + factor1 * (P2-P1) = P3 + factor2 * (P4-P3)</code>
<p>
This function c... | [
"Replies",
"one",
"position",
"factor",
"for",
"the",
"intersection",
"point",
"between",
"two",
"lines",
".",
"<p",
">",
"Let",
"line",
"equations",
"for",
"L1",
"and",
"L2",
":",
"<br",
">",
"<code",
">",
"L1",
":",
"P1",
"+",
"factor1",
"*",
"(",
... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractSegment3F.java#L327-L353 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/features/FilterUtilities.java | FilterUtilities.getIntersectsGeometryFilter | public static Filter getIntersectsGeometryFilter( String geomName, Geometry geometry ) throws CQLException {
"""
Creates an intersect filter.
@param geomName the name of the geom field to filter.
@param geometry the geometry to use as filtering geom.
@return the filter.
@throws CQLException
"""
F... | java | public static Filter getIntersectsGeometryFilter( String geomName, Geometry geometry ) throws CQLException {
Filter result = CQL.toFilter("INTERSECTS(" + geomName + ", " + geometry.toText() + " )");
return result;
} | [
"public",
"static",
"Filter",
"getIntersectsGeometryFilter",
"(",
"String",
"geomName",
",",
"Geometry",
"geometry",
")",
"throws",
"CQLException",
"{",
"Filter",
"result",
"=",
"CQL",
".",
"toFilter",
"(",
"\"INTERSECTS(\"",
"+",
"geomName",
"+",
"\", \"",
"+",
... | Creates an intersect filter.
@param geomName the name of the geom field to filter.
@param geometry the geometry to use as filtering geom.
@return the filter.
@throws CQLException | [
"Creates",
"an",
"intersect",
"filter",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/features/FilterUtilities.java#L102-L105 |
jenkinsci/jenkins | core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java | HudsonPrivateSecurityRealm.doCreateAccountByAdmin | @RequirePOST
public void doCreateAccountByAdmin(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
"""
Creates a user account. Used by admins.
This version behaves differently from {@link #doCreateAccount(StaplerRequest, StaplerResponse)} in that
this is someone creating anothe... | java | @RequirePOST
public void doCreateAccountByAdmin(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
createAccountByAdmin(req, rsp, "addUser.jelly", "."); // send the user back to the listing page on success
} | [
"@",
"RequirePOST",
"public",
"void",
"doCreateAccountByAdmin",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"createAccountByAdmin",
"(",
"req",
",",
"rsp",
",",
"\"addUser.jelly\"",
",",
"\... | Creates a user account. Used by admins.
This version behaves differently from {@link #doCreateAccount(StaplerRequest, StaplerResponse)} in that
this is someone creating another user. | [
"Creates",
"a",
"user",
"account",
".",
"Used",
"by",
"admins",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java#L295-L298 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java | ResourcesInner.beginDelete | public void beginDelete(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
"""
Deletes a resource.
@param resourceGroupName The name of the resource group that contains the resource to delete. The name is case ins... | java | public void beginDelete(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
beginDeleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersi... | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceProviderNamespace",
",",
"String",
"parentResourcePath",
",",
"String",
"resourceType",
",",
"String",
"resourceName",
",",
"String",
"apiVersion",
")",
"{",
"beginDeleteWithSer... | Deletes a resource.
@param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
@param resourceProviderNamespace The namespace of the resource provider.
@param parentResourcePath The parent resource identity.
@param resourceType The resource type.
@param ... | [
"Deletes",
"a",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L1180-L1182 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/MembersView.java | MembersView.cloneAdding | static MembersView cloneAdding(MembersView source, Collection<MemberInfo> newMembers) {
"""
Creates clone of source {@link MembersView} additionally including new members.
@param source source map
@param newMembers new members to add
@return clone map
"""
List<MemberInfo> list = new ArrayList<... | java | static MembersView cloneAdding(MembersView source, Collection<MemberInfo> newMembers) {
List<MemberInfo> list = new ArrayList<>(source.size() + newMembers.size());
list.addAll(source.getMembers());
int newVersion = max(source.version, source.size());
for (MemberInfo newMember : newMember... | [
"static",
"MembersView",
"cloneAdding",
"(",
"MembersView",
"source",
",",
"Collection",
"<",
"MemberInfo",
">",
"newMembers",
")",
"{",
"List",
"<",
"MemberInfo",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
"source",
".",
"size",
"(",
")",
"+",
"newM... | Creates clone of source {@link MembersView} additionally including new members.
@param source source map
@param newMembers new members to add
@return clone map | [
"Creates",
"clone",
"of",
"source",
"{",
"@link",
"MembersView",
"}",
"additionally",
"including",
"new",
"members",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/MembersView.java#L61-L72 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/context/RpcInternalContext.java | RpcInternalContext.setLocalAddress | @Deprecated
public RpcInternalContext setLocalAddress(String host, int port) {
"""
set local address.
@param host the host
@param port the port
@return context local address
"""
if (host == null) {
return this;
}
if (port < 0 || port > 0xFFFF) {
port = 0... | java | @Deprecated
public RpcInternalContext setLocalAddress(String host, int port) {
if (host == null) {
return this;
}
if (port < 0 || port > 0xFFFF) {
port = 0;
}
// 提前检查是否为空,防止createUnresolved抛出异常,损耗性能
this.localAddress = InetSocketAddress.createU... | [
"@",
"Deprecated",
"public",
"RpcInternalContext",
"setLocalAddress",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"if",
"(",
"host",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"if",
"(",
"port",
"<",
"0",
"||",
"port",
">",
"0xFFFF",
... | set local address.
@param host the host
@param port the port
@return context local address | [
"set",
"local",
"address",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/context/RpcInternalContext.java#L255-L266 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/Utility.java | Utility.getId | public static int getId(Context context, String id, String defType) {
"""
Get the int resource id with specified type definition
@param context
@param id String resource id
@return int resource id
"""
String type = "R." + defType + ".";
if (id.startsWith(type)) {
id = id.substrin... | java | public static int getId(Context context, String id, String defType) {
String type = "R." + defType + ".";
if (id.startsWith(type)) {
id = id.substring(type.length());
}
Resources r = context.getResources();
int resId = r.getIdentifier(id, defType,
con... | [
"public",
"static",
"int",
"getId",
"(",
"Context",
"context",
",",
"String",
"id",
",",
"String",
"defType",
")",
"{",
"String",
"type",
"=",
"\"R.\"",
"+",
"defType",
"+",
"\".\"",
";",
"if",
"(",
"id",
".",
"startsWith",
"(",
"type",
")",
")",
"{"... | Get the int resource id with specified type definition
@param context
@param id String resource id
@return int resource id | [
"Get",
"the",
"int",
"resource",
"id",
"with",
"specified",
"type",
"definition"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/Utility.java#L119-L133 |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateValue.java | CmsSerialDateValue.readOptionalString | private String readOptionalString(JSONObject json, String key, String defaultValue) {
"""
Read an optional string value form a JSON Object.
@param json the JSON object to read from.
@param key the key for the string value in the provided JSON object.
@param defaultValue the default value, to be returned if the ... | java | private String readOptionalString(JSONObject json, String key, String defaultValue) {
try {
String str = json.getString(key);
if (str != null) {
return str;
}
} catch (JSONException e) {
LOG.debug("Reading optional JSON string failed. Def... | [
"private",
"String",
"readOptionalString",
"(",
"JSONObject",
"json",
",",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"try",
"{",
"String",
"str",
"=",
"json",
".",
"getString",
"(",
"key",
")",
";",
"if",
"(",
"str",
"!=",
"null",
")",
... | Read an optional string value form a JSON Object.
@param json the JSON object to read from.
@param key the key for the string value in the provided JSON object.
@param defaultValue the default value, to be returned if the string can not be read from the JSON object.
@return the string or the default value if reading th... | [
"Read",
"an",
"optional",
"string",
"value",
"form",
"a",
"JSON",
"Object",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateValue.java#L385-L397 |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/ObjectMappedQuery.java | ObjectMappedQuery.getResults | public List<T> getResults(Connection conn, DataObject object) throws Exception {
"""
Executes the query and returns the results as a list of objects.
"""
return executeSelect(conn, object, new ResultSetMapper<ArrayListCollector<T>>(new ArrayListCollector<T>()));
} | java | public List<T> getResults(Connection conn, DataObject object) throws Exception {
return executeSelect(conn, object, new ResultSetMapper<ArrayListCollector<T>>(new ArrayListCollector<T>()));
} | [
"public",
"List",
"<",
"T",
">",
"getResults",
"(",
"Connection",
"conn",
",",
"DataObject",
"object",
")",
"throws",
"Exception",
"{",
"return",
"executeSelect",
"(",
"conn",
",",
"object",
",",
"new",
"ResultSetMapper",
"<",
"ArrayListCollector",
"<",
"T",
... | Executes the query and returns the results as a list of objects. | [
"Executes",
"the",
"query",
"and",
"returns",
"the",
"results",
"as",
"a",
"list",
"of",
"objects",
"."
] | train | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/ObjectMappedQuery.java#L128-L130 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSection.java | IPv6AddressSection.hasUppercaseVariations | public boolean hasUppercaseVariations(int base, boolean lowerOnly) {
"""
Returns whether this subnet or address has alphabetic digits when printed.
Note that this method does not indicate whether any address contained within this subnet has alphabetic digits,
only whether the subnet itself when printed has alp... | java | public boolean hasUppercaseVariations(int base, boolean lowerOnly) {
if(base > 10) {
int count = getSegmentCount();
for(int i = 0; i < count; i++) {
IPv6AddressSegment seg = getSegment(i);
if(seg.hasUppercaseVariations(base, lowerOnly)) {
return true;
}
}
}
return false;
} | [
"public",
"boolean",
"hasUppercaseVariations",
"(",
"int",
"base",
",",
"boolean",
"lowerOnly",
")",
"{",
"if",
"(",
"base",
">",
"10",
")",
"{",
"int",
"count",
"=",
"getSegmentCount",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
... | Returns whether this subnet or address has alphabetic digits when printed.
Note that this method does not indicate whether any address contained within this subnet has alphabetic digits,
only whether the subnet itself when printed has alphabetic digits.
@return whether the section has alphabetic digits when printed. | [
"Returns",
"whether",
"this",
"subnet",
"or",
"address",
"has",
"alphabetic",
"digits",
"when",
"printed",
"."
] | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSection.java#L1410-L1421 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeAnalysis.java | TypeAnalysis.computeBlockExceptionSet | private CachedExceptionSet computeBlockExceptionSet(BasicBlock basicBlock, TypeFrame result) throws DataflowAnalysisException {
"""
Compute the set of exceptions that can be thrown from the given basic
block. This should only be called if the existing cached exception set is
out of date.
@param basicBlock
th... | java | private CachedExceptionSet computeBlockExceptionSet(BasicBlock basicBlock, TypeFrame result) throws DataflowAnalysisException {
ExceptionSet exceptionSet = computeThrownExceptionTypes(basicBlock);
TypeFrame copyOfResult = createFact();
copy(result, copyOfResult);
CachedExceptionSet c... | [
"private",
"CachedExceptionSet",
"computeBlockExceptionSet",
"(",
"BasicBlock",
"basicBlock",
",",
"TypeFrame",
"result",
")",
"throws",
"DataflowAnalysisException",
"{",
"ExceptionSet",
"exceptionSet",
"=",
"computeThrownExceptionTypes",
"(",
"basicBlock",
")",
";",
"TypeF... | Compute the set of exceptions that can be thrown from the given basic
block. This should only be called if the existing cached exception set is
out of date.
@param basicBlock
the basic block
@param result
the result fact for the block; this is used to determine
whether or not the cached exception set is up to date
@re... | [
"Compute",
"the",
"set",
"of",
"exceptions",
"that",
"can",
"be",
"thrown",
"from",
"the",
"given",
"basic",
"block",
".",
"This",
"should",
"only",
"be",
"called",
"if",
"the",
"existing",
"cached",
"exception",
"set",
"is",
"out",
"of",
"date",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeAnalysis.java#L729-L741 |
alkacon/opencms-core | src/org/opencms/workplace/CmsDialog.java | CmsDialog.buildLockConfirmationMessageJS | public String buildLockConfirmationMessageJS() {
"""
Returns the html code to build the confirmation messages.<p>
@return html code
"""
StringBuffer html = new StringBuffer(512);
html.append("<script type='text/javascript'><!--\n");
html.append("function setConfirmationMessage(locks... | java | public String buildLockConfirmationMessageJS() {
StringBuffer html = new StringBuffer(512);
html.append("<script type='text/javascript'><!--\n");
html.append("function setConfirmationMessage(locks, blockinglocks) {\n");
html.append("\tvar confMsg = document.getElementById('conf-msg');\n... | [
"public",
"String",
"buildLockConfirmationMessageJS",
"(",
")",
"{",
"StringBuffer",
"html",
"=",
"new",
"StringBuffer",
"(",
"512",
")",
";",
"html",
".",
"append",
"(",
"\"<script type='text/javascript'><!--\\n\"",
")",
";",
"html",
".",
"append",
"(",
"\"functi... | Returns the html code to build the confirmation messages.<p>
@return html code | [
"Returns",
"the",
"html",
"code",
"to",
"build",
"the",
"confirmation",
"messages",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsDialog.java#L444-L476 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Assert.java | Assert.noNullElements | public static <T> T[] noNullElements(T[] array, String errorMsgTemplate, Object... params) throws IllegalArgumentException {
"""
断言给定数组是否不包含{@code null}元素,如果数组为空或 {@code null}将被认为不包含
<pre class="code">
Assert.noNullElements(array, "The array must have non-null elements");
</pre>
@param <T> 数组元素类型
@param a... | java | public static <T> T[] noNullElements(T[] array, String errorMsgTemplate, Object... params) throws IllegalArgumentException {
if (ArrayUtil.hasNull(array)) {
throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params));
}
return array;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"noNullElements",
"(",
"T",
"[",
"]",
"array",
",",
"String",
"errorMsgTemplate",
",",
"Object",
"...",
"params",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"ArrayUtil",
".",
"hasNull",
"(",... | 断言给定数组是否不包含{@code null}元素,如果数组为空或 {@code null}将被认为不包含
<pre class="code">
Assert.noNullElements(array, "The array must have non-null elements");
</pre>
@param <T> 数组元素类型
@param array 被检查的数组
@param errorMsgTemplate 异常时的消息模板
@param params 参数列表
@return 被检查的数组
@throws IllegalArgumentException if the object array contains ... | [
"断言给定数组是否不包含",
"{",
"@code",
"null",
"}",
"元素,如果数组为空或",
"{",
"@code",
"null",
"}",
"将被认为不包含"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Assert.java#L314-L319 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/ManagementClientAsync.java | ManagementClientAsync.updateRuleAsync | public CompletableFuture<RuleDescription> updateRuleAsync(String topicName, String subscriptionName, RuleDescription ruleDescription) {
"""
Updates an existing rule.
@param topicName - Name of the topic.
@param subscriptionName - Name of the subscription.
@param ruleDescription - A {@link RuleDescription} objec... | java | public CompletableFuture<RuleDescription> updateRuleAsync(String topicName, String subscriptionName, RuleDescription ruleDescription) {
return putRuleAsync(topicName, subscriptionName, ruleDescription, true);
} | [
"public",
"CompletableFuture",
"<",
"RuleDescription",
">",
"updateRuleAsync",
"(",
"String",
"topicName",
",",
"String",
"subscriptionName",
",",
"RuleDescription",
"ruleDescription",
")",
"{",
"return",
"putRuleAsync",
"(",
"topicName",
",",
"subscriptionName",
",",
... | Updates an existing rule.
@param topicName - Name of the topic.
@param subscriptionName - Name of the subscription.
@param ruleDescription - A {@link RuleDescription} object describing the attributes with which the rule will be updated.
@return {@link RuleDescription} of the updated rule.
@throws IllegalArgumentExcepti... | [
"Updates",
"an",
"existing",
"rule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/ManagementClientAsync.java#L720-L722 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java | JsonUtil.put | public static void put(Writer writer, Byte value) throws IOException {
"""
Writes the given value with the given writer.
@param writer
@param value
@throws IOException
@author vvakame
"""
if (value == null) {
writer.write("null");
} else {
writer.write(value.toString());
}
} | java | public static void put(Writer writer, Byte value) throws IOException {
if (value == null) {
writer.write("null");
} else {
writer.write(value.toString());
}
} | [
"public",
"static",
"void",
"put",
"(",
"Writer",
"writer",
",",
"Byte",
"value",
")",
"throws",
"IOException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"writer",
".",
"write",
"(",
"\"null\"",
")",
";",
"}",
"else",
"{",
"writer",
".",
"writ... | Writes the given value with the given writer.
@param writer
@param value
@throws IOException
@author vvakame | [
"Writes",
"the",
"given",
"value",
"with",
"the",
"given",
"writer",
"."
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java#L245-L251 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.