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 |
|---|---|---|---|---|---|---|---|---|---|---|
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/DatabaseManager.java | DatabaseManager.deRegisterServer | private static void deRegisterServer(Server server, Database db) {
"""
Deregisters a server as serving a given database. Not yet used.
"""
Iterator it = serverMap.values().iterator();
for (; it.hasNext(); ) {
HashSet databases = (HashSet) it.next();
databases.remove(d... | java | private static void deRegisterServer(Server server, Database db) {
Iterator it = serverMap.values().iterator();
for (; it.hasNext(); ) {
HashSet databases = (HashSet) it.next();
databases.remove(db);
if (databases.isEmpty()) {
it.remove();
... | [
"private",
"static",
"void",
"deRegisterServer",
"(",
"Server",
"server",
",",
"Database",
"db",
")",
"{",
"Iterator",
"it",
"=",
"serverMap",
".",
"values",
"(",
")",
".",
"iterator",
"(",
")",
";",
"for",
"(",
";",
"it",
".",
"hasNext",
"(",
")",
"... | Deregisters a server as serving a given database. Not yet used. | [
"Deregisters",
"a",
"server",
"as",
"serving",
"a",
"given",
"database",
".",
"Not",
"yet",
"used",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/DatabaseManager.java#L449-L462 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java | ServicesInner.beginCreateOrUpdate | public DataMigrationServiceInner beginCreateOrUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters) {
"""
Create or update DMS Instance.
The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an exist... | java | public DataMigrationServiceInner beginCreateOrUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().single().body();
} | [
"public",
"DataMigrationServiceInner",
"beginCreateOrUpdate",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
",",
"DataMigrationServiceInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"groupName",
",",
"serviceName",
","... | Create or update DMS Instance.
The services resource is the top-level resource that represents the Data Migration Service. The PUT method creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", whi... | [
"Create",
"or",
"update",
"DMS",
"Instance",
".",
"The",
"services",
"resource",
"is",
"the",
"top",
"-",
"level",
"resource",
"that",
"represents",
"the",
"Data",
"Migration",
"Service",
".",
"The",
"PUT",
"method",
"creates",
"a",
"new",
"service",
"or",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java#L245-L247 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java | PublicIPAddressesInner.getByResourceGroupAsync | public Observable<PublicIPAddressInner> getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName, String expand) {
"""
Gets the specified public IP address in a specified resource group.
@param resourceGroupName The name of the resource group.
@param publicIpAddressName The name of the subn... | java | public Observable<PublicIPAddressInner> getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName, String expand) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand).map(new Func1<ServiceResponse<PublicIPAddressInner>, PublicIPAddressInner>() {
... | [
"public",
"Observable",
"<",
"PublicIPAddressInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"publicIpAddressName",
",",
"String",
"expand",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Gets the specified public IP address in a specified resource group.
@param resourceGroupName The name of the resource group.
@param publicIpAddressName The name of the subnet.
@param expand Expands referenced resources.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to... | [
"Gets",
"the",
"specified",
"public",
"IP",
"address",
"in",
"a",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java#L403-L410 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/map/AbstractMap.java | AbstractMap.chooseShrinkCapacity | protected int chooseShrinkCapacity(int size, double minLoad, double maxLoad) {
"""
Chooses a new prime table capacity optimized for shrinking that (approximately) satisfies the invariant
<tt>c * minLoadFactor <= size <= c * maxLoadFactor</tt>
and has at least one FREE slot for the given size.
"""
return... | java | protected int chooseShrinkCapacity(int size, double minLoad, double maxLoad) {
return nextPrime(Math.max(size+1, (int) ((4*size / (minLoad+3*maxLoad)))));
} | [
"protected",
"int",
"chooseShrinkCapacity",
"(",
"int",
"size",
",",
"double",
"minLoad",
",",
"double",
"maxLoad",
")",
"{",
"return",
"nextPrime",
"(",
"Math",
".",
"max",
"(",
"size",
"+",
"1",
",",
"(",
"int",
")",
"(",
"(",
"4",
"*",
"size",
"/"... | Chooses a new prime table capacity optimized for shrinking that (approximately) satisfies the invariant
<tt>c * minLoadFactor <= size <= c * maxLoadFactor</tt>
and has at least one FREE slot for the given size. | [
"Chooses",
"a",
"new",
"prime",
"table",
"capacity",
"optimized",
"for",
"shrinking",
"that",
"(",
"approximately",
")",
"satisfies",
"the",
"invariant",
"<tt",
">",
"c",
"*",
"minLoadFactor",
"<",
"=",
"size",
"<",
"=",
"c",
"*",
"maxLoadFactor<",
"/",
"t... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/AbstractMap.java#L92-L94 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/HttpCookie.java | HttpCookie.parseInternal | private static HttpCookie parseInternal(String header,
boolean retainHeader) {
"""
/*
Parse header string to cookie object.
@param header header string; should contain only one NAME=VALUE pair
@return an HttpCookie being extracted
@throws IllegalArg... | java | private static HttpCookie parseInternal(String header,
boolean retainHeader)
{
HttpCookie cookie = null;
String namevaluePair = null;
StringTokenizer tokenizer = new StringTokenizer(header, ";");
// there should always have at least on na... | [
"private",
"static",
"HttpCookie",
"parseInternal",
"(",
"String",
"header",
",",
"boolean",
"retainHeader",
")",
"{",
"HttpCookie",
"cookie",
"=",
"null",
";",
"String",
"namevaluePair",
"=",
"null",
";",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokeniz... | /*
Parse header string to cookie object.
@param header header string; should contain only one NAME=VALUE pair
@return an HttpCookie being extracted
@throws IllegalArgumentException if header string violates the cookie
specification | [
"/",
"*",
"Parse",
"header",
"string",
"to",
"cookie",
"object",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/HttpCookie.java#L975-L1024 |
LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/ByteArrayDiskQueue.java | ByteArrayDiskQueue.createNew | public static ByteArrayDiskQueue createNew(final File file, final int bufferSize, final boolean direct) throws IOException {
"""
Creates a new disk-based queue of byte arrays.
@param file the file that will be used to dump the queue on disk.
@param bufferSize the number of items in the circular buffer (will be... | java | public static ByteArrayDiskQueue createNew(final File file, final int bufferSize, final boolean direct) throws IOException {
return new ByteArrayDiskQueue(ByteDiskQueue.createNew(file, bufferSize, direct));
} | [
"public",
"static",
"ByteArrayDiskQueue",
"createNew",
"(",
"final",
"File",
"file",
",",
"final",
"int",
"bufferSize",
",",
"final",
"boolean",
"direct",
")",
"throws",
"IOException",
"{",
"return",
"new",
"ByteArrayDiskQueue",
"(",
"ByteDiskQueue",
".",
"createN... | Creates a new disk-based queue of byte arrays.
@param file the file that will be used to dump the queue on disk.
@param bufferSize the number of items in the circular buffer (will be possibly decreased so to be a power of two).
@param direct whether the {@link ByteBuffer} used by this queue should be {@linkplain ByteB... | [
"Creates",
"a",
"new",
"disk",
"-",
"based",
"queue",
"of",
"byte",
"arrays",
"."
] | train | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/ByteArrayDiskQueue.java#L66-L68 |
ironjacamar/ironjacamar | sjc/src/main/java/org/ironjacamar/sjc/SecurityActions.java | SecurityActions.createURLCLassLoader | static URLClassLoader createURLCLassLoader(final URL[] urls, final ClassLoader parent) {
"""
Create an URLClassLoader
@param urls The urls
@param parent The parent class loader
@return The class loader
"""
return (URLClassLoader)AccessController.doPrivileged(new PrivilegedAction<Object>()
{
... | java | static URLClassLoader createURLCLassLoader(final URL[] urls, final ClassLoader parent)
{
return (URLClassLoader)AccessController.doPrivileged(new PrivilegedAction<Object>()
{
public Object run()
{
return new URLClassLoader(urls, parent);
}
});
} | [
"static",
"URLClassLoader",
"createURLCLassLoader",
"(",
"final",
"URL",
"[",
"]",
"urls",
",",
"final",
"ClassLoader",
"parent",
")",
"{",
"return",
"(",
"URLClassLoader",
")",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"Object"... | Create an URLClassLoader
@param urls The urls
@param parent The parent class loader
@return The class loader | [
"Create",
"an",
"URLClassLoader"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/sjc/src/main/java/org/ironjacamar/sjc/SecurityActions.java#L128-L137 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularTools_F64.java | EquirectangularTools_F64.equiToNorm | public void equiToNorm(double x , double y , Point3D_F64 norm ) {
"""
Converts equirectangular into normalized pointing vector
@param x pixel coordinate in equirectangular image
@param y pixel coordinate in equirectangular image
@param norm Normalized pointing vector
"""
equiToLatLon(x,y, temp);
Conve... | java | public void equiToNorm(double x , double y , Point3D_F64 norm ) {
equiToLatLon(x,y, temp);
ConvertCoordinates3D_F64.latlonToUnitVector(temp.lat,temp.lon, norm);
} | [
"public",
"void",
"equiToNorm",
"(",
"double",
"x",
",",
"double",
"y",
",",
"Point3D_F64",
"norm",
")",
"{",
"equiToLatLon",
"(",
"x",
",",
"y",
",",
"temp",
")",
";",
"ConvertCoordinates3D_F64",
".",
"latlonToUnitVector",
"(",
"temp",
".",
"lat",
",",
... | Converts equirectangular into normalized pointing vector
@param x pixel coordinate in equirectangular image
@param y pixel coordinate in equirectangular image
@param norm Normalized pointing vector | [
"Converts",
"equirectangular",
"into",
"normalized",
"pointing",
"vector"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularTools_F64.java#L84-L87 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java | SpanCell.setAttribute | public void setAttribute(String name, String value, String facet)
throws JspException {
"""
<p>
Implementation of {@link org.apache.beehive.netui.tags.IAttributeConsumer} interface. This
allows a page author to add additional attributes to the HTML rendered by this tag. The attribute
facets which ... | java | public void setAttribute(String name, String value, String facet)
throws JspException {
if(facet == null || facet.equals(SPAN_FACET_NAME))
super.addStateAttribute(_spanState, name, value);
else
super.setAttribute(name, value, facet);
} | [
"public",
"void",
"setAttribute",
"(",
"String",
"name",
",",
"String",
"value",
",",
"String",
"facet",
")",
"throws",
"JspException",
"{",
"if",
"(",
"facet",
"==",
"null",
"||",
"facet",
".",
"equals",
"(",
"SPAN_FACET_NAME",
")",
")",
"super",
".",
"... | <p>
Implementation of {@link org.apache.beehive.netui.tags.IAttributeConsumer} interface. This
allows a page author to add additional attributes to the HTML rendered by this tag. The attribute
facets which can be consumed include:
<ul>
<li><code>span</code> -- attributes set using this facet will be rendered as HTML ... | [
"<p",
">",
"Implementation",
"of",
"{",
"@link",
"org",
".",
"apache",
".",
"beehive",
".",
"netui",
".",
"tags",
".",
"IAttributeConsumer",
"}",
"interface",
".",
"This",
"allows",
"a",
"page",
"author",
"to",
"add",
"additional",
"attributes",
"to",
"the... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java#L330-L336 |
google/truth | core/src/main/java/com/google/common/truth/TruthFailureSubject.java | TruthFailureSubject.factValue | public StringSubject factValue(String key, int index) {
"""
Returns a subject for the value of the {@code index}-th instance of the fact with the given
name. Most Truth failures do not contain multiple facts with the same key, so most tests should
use {@linkplain #factValue(String) the other overload} of {@code ... | java | public StringSubject factValue(String key, int index) {
checkArgument(index >= 0, "index must be nonnegative: %s", index);
return doFactValue(key, index);
} | [
"public",
"StringSubject",
"factValue",
"(",
"String",
"key",
",",
"int",
"index",
")",
"{",
"checkArgument",
"(",
"index",
">=",
"0",
",",
"\"index must be nonnegative: %s\"",
",",
"index",
")",
";",
"return",
"doFactValue",
"(",
"key",
",",
"index",
")",
"... | Returns a subject for the value of the {@code index}-th instance of the fact with the given
name. Most Truth failures do not contain multiple facts with the same key, so most tests should
use {@linkplain #factValue(String) the other overload} of {@code factValue}. | [
"Returns",
"a",
"subject",
"for",
"the",
"value",
"of",
"the",
"{"
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/TruthFailureSubject.java#L124-L127 |
demidenko05/beigesoft-webstore | src/main/java/org/beigesoft/webstore/processor/PrcRefreshItemsInList.java | PrcRefreshItemsInList.findFirstIdxFor | protected final <T extends AItemSpecifics<?, ?>> int findFirstIdxFor(final List<T> pOutdGdSpList, final IHasIdLongVersionName pItem) {
"""
<p>Find the first index of specific with given item.</p>
@param <T> item specifics type
@param pOutdGdSpList GS list
@param pItem Goods
@return the first index of specific... | java | protected final <T extends AItemSpecifics<?, ?>> int findFirstIdxFor(final List<T> pOutdGdSpList, final IHasIdLongVersionName pItem) {
int j = 0;
while (!pOutdGdSpList.get(j).getItem().getItsId().equals(pItem.getItsId())) {
j++;
}
return j;
} | [
"protected",
"final",
"<",
"T",
"extends",
"AItemSpecifics",
"<",
"?",
",",
"?",
">",
">",
"int",
"findFirstIdxFor",
"(",
"final",
"List",
"<",
"T",
">",
"pOutdGdSpList",
",",
"final",
"IHasIdLongVersionName",
"pItem",
")",
"{",
"int",
"j",
"=",
"0",
";"... | <p>Find the first index of specific with given item.</p>
@param <T> item specifics type
@param pOutdGdSpList GS list
@param pItem Goods
@return the first index of specific with given item
it throws Exception - if out of bounds | [
"<p",
">",
"Find",
"the",
"first",
"index",
"of",
"specific",
"with",
"given",
"item",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/demidenko05/beigesoft-webstore/blob/41ed2e2f1c640d37951d5fb235f26856008b87e1/src/main/java/org/beigesoft/webstore/processor/PrcRefreshItemsInList.java#L1170-L1176 |
structurizr/java | structurizr-core/src/com/structurizr/documentation/DocumentationTemplate.java | DocumentationTemplate.addSection | public Section addSection(String title, File... files) throws IOException {
"""
Adds a custom section from one or more files, that isn't related to any element in the model.
@param title the section title
@param files one or more File objects that point to the documentation content
@re... | java | public Section addSection(String title, File... files) throws IOException {
return add(null, title, files);
} | [
"public",
"Section",
"addSection",
"(",
"String",
"title",
",",
"File",
"...",
"files",
")",
"throws",
"IOException",
"{",
"return",
"add",
"(",
"null",
",",
"title",
",",
"files",
")",
";",
"}"
] | Adds a custom section from one or more files, that isn't related to any element in the model.
@param title the section title
@param files one or more File objects that point to the documentation content
@return a documentation {@link Section}
@throws IOException if there i... | [
"Adds",
"a",
"custom",
"section",
"from",
"one",
"or",
"more",
"files",
"that",
"isn",
"t",
"related",
"to",
"any",
"element",
"in",
"the",
"model",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/documentation/DocumentationTemplate.java#L47-L49 |
3redronin/mu-server | src/main/java/io/muserver/rest/SafeHtml.java | SafeHtml.followingCharsAre | private static boolean followingCharsAre(String str, int startIndex, String nextChars) {
"""
Tests if the chars following position {@code startIndex} in string
{@code str} are that of {@code nextChars}.
@param str
@param startIndex
@param nextChars
@return
"""
return (str.indexOf(nextChars, sta... | java | private static boolean followingCharsAre(String str, int startIndex, String nextChars) {
return (str.indexOf(nextChars, startIndex + 1) == (startIndex + 1));
} | [
"private",
"static",
"boolean",
"followingCharsAre",
"(",
"String",
"str",
",",
"int",
"startIndex",
",",
"String",
"nextChars",
")",
"{",
"return",
"(",
"str",
".",
"indexOf",
"(",
"nextChars",
",",
"startIndex",
"+",
"1",
")",
"==",
"(",
"startIndex",
"+... | Tests if the chars following position {@code startIndex} in string
{@code str} are that of {@code nextChars}.
@param str
@param startIndex
@param nextChars
@return | [
"Tests",
"if",
"the",
"chars",
"following",
"position",
"{",
"@code",
"startIndex",
"}",
"in",
"string",
"{",
"@code",
"str",
"}",
"are",
"that",
"of",
"{",
"@code",
"nextChars",
"}",
"."
] | train | https://github.com/3redronin/mu-server/blob/51598606a3082a121fbd785348ee9770b40308e6/src/main/java/io/muserver/rest/SafeHtml.java#L191-L193 |
grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.createArgumentListFromParameters | public static ArgumentListExpression createArgumentListFromParameters(Parameter[] parameterTypes, boolean thisAsFirstArgument, Map<String, ClassNode> genericsPlaceholders) {
"""
Creates an argument list from the given parameter types.
@param parameterTypes The parameter types
@param thisAsFirstArgument Whether... | java | public static ArgumentListExpression createArgumentListFromParameters(Parameter[] parameterTypes, boolean thisAsFirstArgument, Map<String, ClassNode> genericsPlaceholders) {
ArgumentListExpression arguments = new ArgumentListExpression();
if (thisAsFirstArgument) {
arguments.addExpression(n... | [
"public",
"static",
"ArgumentListExpression",
"createArgumentListFromParameters",
"(",
"Parameter",
"[",
"]",
"parameterTypes",
",",
"boolean",
"thisAsFirstArgument",
",",
"Map",
"<",
"String",
",",
"ClassNode",
">",
"genericsPlaceholders",
")",
"{",
"ArgumentListExpressi... | Creates an argument list from the given parameter types.
@param parameterTypes The parameter types
@param thisAsFirstArgument Whether to include a reference to 'this' as the first argument
@param genericsPlaceholders
@return the arguments | [
"Creates",
"an",
"argument",
"list",
"from",
"the",
"given",
"parameter",
"types",
"."
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L333-L344 |
knowm/XChange | xchange-mercadobitcoin/src/main/java/org/knowm/xchange/mercadobitcoin/service/MercadoBitcoinTradeService.java | MercadoBitcoinTradeService.placeLimitOrder | @Override
public String placeLimitOrder(LimitOrder limitOrder) throws IOException {
"""
The result is not the pure order id. It is a composition with the currency pair and the order
id (the same format used as parameter of {@link #cancelOrder}). Please see {@link
org.knowm.xchange.mercadobitcoin.MercadoBitcoin... | java | @Override
public String placeLimitOrder(LimitOrder limitOrder) throws IOException {
String pair;
if (limitOrder.getCurrencyPair().equals(CurrencyPair.BTC_BRL)) {
pair = "btc_brl";
} else if (limitOrder.getCurrencyPair().equals(new CurrencyPair(Currency.LTC, Currency.BRL))) {
pair = "ltc_brl"... | [
"@",
"Override",
"public",
"String",
"placeLimitOrder",
"(",
"LimitOrder",
"limitOrder",
")",
"throws",
"IOException",
"{",
"String",
"pair",
";",
"if",
"(",
"limitOrder",
".",
"getCurrencyPair",
"(",
")",
".",
"equals",
"(",
"CurrencyPair",
".",
"BTC_BRL",
")... | The result is not the pure order id. It is a composition with the currency pair and the order
id (the same format used as parameter of {@link #cancelOrder}). Please see {@link
org.knowm.xchange.mercadobitcoin.MercadoBitcoinUtils#makeMercadoBitcoinOrderId} . | [
"The",
"result",
"is",
"not",
"the",
"pure",
"order",
"id",
".",
"It",
"is",
"a",
"composition",
"with",
"the",
"currency",
"pair",
"and",
"the",
"order",
"id",
"(",
"the",
"same",
"format",
"used",
"as",
"parameter",
"of",
"{"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-mercadobitcoin/src/main/java/org/knowm/xchange/mercadobitcoin/service/MercadoBitcoinTradeService.java#L82-L109 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.selectCheckbox | @Conditioned
@Lorsque("Je mets à jour la case à cocher '(.*)-(.*)' avec '(.*)'[\\.|\\?]")
@Then("I update checkbox '(.*)-(.*)' with '(.*)'[\\.|\\?]")
public void selectCheckbox(String page, String elementKey, boolean value, List<GherkinStepCondition> conditions) throws TechnicalException, FailureExceptio... | java | @Conditioned
@Lorsque("Je mets à jour la case à cocher '(.*)-(.*)' avec '(.*)'[\\.|\\?]")
@Then("I update checkbox '(.*)-(.*)' with '(.*)'[\\.|\\?]")
public void selectCheckbox(String page, String elementKey, boolean value, List<GherkinStepCondition> conditions) throws TechnicalException, FailureExceptio... | [
"@",
"Conditioned",
"@",
"Lorsque",
"(",
"\"Je mets à jour la case à cocher '(.*)-(.*)' avec '(.*)'[\\\\.|\\\\?]\")\r",
"",
"@",
"Then",
"(",
"\"I update checkbox '(.*)-(.*)' with '(.*)'[\\\\.|\\\\?]\"",
")",
"public",
"void",
"selectCheckbox",
"(",
"String",
"page",
",",
"Stri... | Updates the value of a html checkbox element with conditions.
@param page
The concerned page of elementKey
@param elementKey
The key of PageElement to select
@param value
To check or not ?
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition})... | [
"Updates",
"the",
"value",
"of",
"a",
"html",
"checkbox",
"element",
"with",
"conditions",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L889-L894 |
sap-production/xcode-maven-plugin | modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/XCodePackageManager.java | XCodePackageManager.packageArtifacts | void packageArtifacts(final File compileDir, final MavenProject project, final Set<String> bundles)
throws IOException, XCodeException {
"""
Packages all the artifacts. The main artifact is set and all side artifacts are attached for
deployment.
@param bundles
@param buildDir
"""
File mainA... | java | void packageArtifacts(final File compileDir, final MavenProject project, final Set<String> bundles)
throws IOException, XCodeException
{
File mainArtifact = createMainArtifactFile(project);
attachBundle(compileDir, project, bundles, mainArtifact);
final File mainArtifactFile = archiveMainArtifa... | [
"void",
"packageArtifacts",
"(",
"final",
"File",
"compileDir",
",",
"final",
"MavenProject",
"project",
",",
"final",
"Set",
"<",
"String",
">",
"bundles",
")",
"throws",
"IOException",
",",
"XCodeException",
"{",
"File",
"mainArtifact",
"=",
"createMainArtifactF... | Packages all the artifacts. The main artifact is set and all side artifacts are attached for
deployment.
@param bundles
@param buildDir | [
"Packages",
"all",
"the",
"artifacts",
".",
"The",
"main",
"artifact",
"is",
"set",
"and",
"all",
"side",
"artifacts",
"are",
"attached",
"for",
"deployment",
"."
] | train | https://github.com/sap-production/xcode-maven-plugin/blob/3f8aa380f501a1d7602f33fef2f6348354e7eb7c/modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/XCodePackageManager.java#L65-L76 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/ThreadUtil.java | ThreadUtil.createThreadName | public static String createThreadName(String hzName, String name) {
"""
Creates the threadname with prefix and notation.
@param hzName the name of the hazelcast instance
@param name the basic name of the thread
@return the threadname .
@throws java.lang.NullPointerException if name is null.
"""
... | java | public static String createThreadName(String hzName, String name) {
checkNotNull(name, "name can't be null");
return "hz." + hzName + "." + name;
} | [
"public",
"static",
"String",
"createThreadName",
"(",
"String",
"hzName",
",",
"String",
"name",
")",
"{",
"checkNotNull",
"(",
"name",
",",
"\"name can't be null\"",
")",
";",
"return",
"\"hz.\"",
"+",
"hzName",
"+",
"\".\"",
"+",
"name",
";",
"}"
] | Creates the threadname with prefix and notation.
@param hzName the name of the hazelcast instance
@param name the basic name of the thread
@return the threadname .
@throws java.lang.NullPointerException if name is null. | [
"Creates",
"the",
"threadname",
"with",
"prefix",
"and",
"notation",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/ThreadUtil.java#L69-L72 |
FilteredPush/event_date_qc | src/main/java/org/filteredpush/qc/date/DateUtils.java | DateUtils.extractDateToDayFromVerbatimER | public static EventResult extractDateToDayFromVerbatimER(String verbatimEventDate, int yearsBeforeSuspect) {
"""
Extract a date from a verbatim date, returning ranges specified to day.
@param verbatimEventDate a string containing a verbatim event date.
@param yearsBeforeSuspect the value for a year before whic... | java | public static EventResult extractDateToDayFromVerbatimER(String verbatimEventDate, int yearsBeforeSuspect) {
EventResult result = extractDateFromVerbatimER(verbatimEventDate, yearsBeforeSuspect, null);
logger.debug(result.getResultState());
logger.debug(result.getResult());
if (result!=null && resu... | [
"public",
"static",
"EventResult",
"extractDateToDayFromVerbatimER",
"(",
"String",
"verbatimEventDate",
",",
"int",
"yearsBeforeSuspect",
")",
"{",
"EventResult",
"result",
"=",
"extractDateFromVerbatimER",
"(",
"verbatimEventDate",
",",
"yearsBeforeSuspect",
",",
"null",
... | Extract a date from a verbatim date, returning ranges specified to day.
@param verbatimEventDate a string containing a verbatim event date.
@param yearsBeforeSuspect the value for a year before which parsed years should be considered suspect.
@return an EventResult object containing the extracted date. | [
"Extract",
"a",
"date",
"from",
"a",
"verbatim",
"date",
"returning",
"ranges",
"specified",
"to",
"day",
"."
] | train | https://github.com/FilteredPush/event_date_qc/blob/52957a71b94b00b767e37924f976e2c7e8868ff3/src/main/java/org/filteredpush/qc/date/DateUtils.java#L254-L272 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.readUser | public CmsUser readUser(CmsDbContext dbc, String username) throws CmsDataAccessException {
"""
Returns a user object.<p>
@param dbc the current database context
@param username the name of the user that is to be read
@return user read
@throws CmsDataAccessException if operation was not successful
"""... | java | public CmsUser readUser(CmsDbContext dbc, String username) throws CmsDataAccessException {
CmsUser user = m_monitor.getCachedUser(username);
if (user == null) {
user = getUserDriver(dbc).readUser(dbc, username);
m_monitor.cacheUser(user);
}
// important: do not r... | [
"public",
"CmsUser",
"readUser",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"username",
")",
"throws",
"CmsDataAccessException",
"{",
"CmsUser",
"user",
"=",
"m_monitor",
".",
"getCachedUser",
"(",
"username",
")",
";",
"if",
"(",
"user",
"==",
"null",
")",
... | Returns a user object.<p>
@param dbc the current database context
@param username the name of the user that is to be read
@return user read
@throws CmsDataAccessException if operation was not successful | [
"Returns",
"a",
"user",
"object",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L8118-L8127 |
apache/fluo-recipes | modules/core/src/main/java/org/apache/fluo/recipes/core/transaction/RecordingTransactionBase.java | RecordingTransactionBase.wrap | public static RecordingTransactionBase wrap(TransactionBase txb, Predicate<LogEntry> filter) {
"""
Creates a RecordingTransactionBase using the provided LogEntry filter function and existing
TransactionBase
"""
return new RecordingTransactionBase(txb, filter);
} | java | public static RecordingTransactionBase wrap(TransactionBase txb, Predicate<LogEntry> filter) {
return new RecordingTransactionBase(txb, filter);
} | [
"public",
"static",
"RecordingTransactionBase",
"wrap",
"(",
"TransactionBase",
"txb",
",",
"Predicate",
"<",
"LogEntry",
">",
"filter",
")",
"{",
"return",
"new",
"RecordingTransactionBase",
"(",
"txb",
",",
"filter",
")",
";",
"}"
] | Creates a RecordingTransactionBase using the provided LogEntry filter function and existing
TransactionBase | [
"Creates",
"a",
"RecordingTransactionBase",
"using",
"the",
"provided",
"LogEntry",
"filter",
"function",
"and",
"existing",
"TransactionBase"
] | train | https://github.com/apache/fluo-recipes/blob/24c11234c9654b16d999437ff49ddc3db86665f8/modules/core/src/main/java/org/apache/fluo/recipes/core/transaction/RecordingTransactionBase.java#L310-L312 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONObject.java | JSONObject.optInt | public int optInt( String key, int defaultValue ) {
"""
Get an optional int value associated with a key, or the default if there
is no such key or if the value is not a number. If the value is a string,
an attempt will be made to evaluate it as a number.
@param key A key string.
@param defaultValue The defau... | java | public int optInt( String key, int defaultValue ) {
verifyIsNull();
try{
return getInt( key );
}catch( Exception e ){
return defaultValue;
}
} | [
"public",
"int",
"optInt",
"(",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"verifyIsNull",
"(",
")",
";",
"try",
"{",
"return",
"getInt",
"(",
"key",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",
"defaultValue",
";",
... | Get an optional int value associated with a key, or the default if there
is no such key or if the value is not a number. If the value is a string,
an attempt will be made to evaluate it as a number.
@param key A key string.
@param defaultValue The default.
@return An object which is the value. | [
"Get",
"an",
"optional",
"int",
"value",
"associated",
"with",
"a",
"key",
"or",
"the",
"default",
"if",
"there",
"is",
"no",
"such",
"key",
"or",
"if",
"the",
"value",
"is",
"not",
"a",
"number",
".",
"If",
"the",
"value",
"is",
"a",
"string",
"an",... | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONObject.java#L2202-L2209 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/multilayer/SparkDl4jMultiLayer.java | SparkDl4jMultiLayer.fitContinuousLabeledPoint | public MultiLayerNetwork fitContinuousLabeledPoint(JavaRDD<LabeledPoint> rdd) {
"""
Fits a MultiLayerNetwork using Spark MLLib LabeledPoint instances
This will convert labeled points that have continuous labels used for regression to the internal
DL4J data format and train the model on that
@param rdd the javaR... | java | public MultiLayerNetwork fitContinuousLabeledPoint(JavaRDD<LabeledPoint> rdd) {
return fit(MLLibUtil.fromContinuousLabeledPoint(sc, rdd));
} | [
"public",
"MultiLayerNetwork",
"fitContinuousLabeledPoint",
"(",
"JavaRDD",
"<",
"LabeledPoint",
">",
"rdd",
")",
"{",
"return",
"fit",
"(",
"MLLibUtil",
".",
"fromContinuousLabeledPoint",
"(",
"sc",
",",
"rdd",
")",
")",
";",
"}"
] | Fits a MultiLayerNetwork using Spark MLLib LabeledPoint instances
This will convert labeled points that have continuous labels used for regression to the internal
DL4J data format and train the model on that
@param rdd the javaRDD containing the labeled points
@return a MultiLayerNetwork | [
"Fits",
"a",
"MultiLayerNetwork",
"using",
"Spark",
"MLLib",
"LabeledPoint",
"instances",
"This",
"will",
"convert",
"labeled",
"points",
"that",
"have",
"continuous",
"labels",
"used",
"for",
"regression",
"to",
"the",
"internal",
"DL4J",
"data",
"format",
"and",... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/multilayer/SparkDl4jMultiLayer.java#L333-L335 |
relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/ApnsClient.java | ApnsClient.sendNotification | @SuppressWarnings("unchecked")
public <T extends ApnsPushNotification> PushNotificationFuture<T, PushNotificationResponse<T>> sendNotification(final T notification) {
"""
<p>Sends a push notification to the APNs gateway.</p>
<p>This method returns a {@code Future} that indicates whether the notification was... | java | @SuppressWarnings("unchecked")
public <T extends ApnsPushNotification> PushNotificationFuture<T, PushNotificationResponse<T>> sendNotification(final T notification) {
final PushNotificationFuture<T, PushNotificationResponse<T>> responseFuture;
if (!this.isClosed.get()) {
final PushNotif... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"ApnsPushNotification",
">",
"PushNotificationFuture",
"<",
"T",
",",
"PushNotificationResponse",
"<",
"T",
">",
">",
"sendNotification",
"(",
"final",
"T",
"notification",
")",
"{"... | <p>Sends a push notification to the APNs gateway.</p>
<p>This method returns a {@code Future} that indicates whether the notification was accepted or rejected by the
gateway. If the notification was accepted, it may be delivered to its destination device at some time in the
future, but final delivery is not guaranteed... | [
"<p",
">",
"Sends",
"a",
"push",
"notification",
"to",
"the",
"APNs",
"gateway",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/ApnsClient.java#L198-L259 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/index/strtree/STRtreeJGT.java | STRtreeJGT.nearestNeighbour | public Object nearestNeighbour( Envelope env, Object item, ItemDistance itemDist ) {
"""
Finds the item in this tree which is nearest to the given {@link Object},
using {@link org.locationtech.jts.index.strtree.ItemDistance} as the distance metric.
A Branch-and-Bound tree traversal algorithm is used
to provide ... | java | public Object nearestNeighbour( Envelope env, Object item, ItemDistance itemDist ) {
Boundable bnd = new ItemBoundable(env, item);
BoundablePair bp = new BoundablePair(this.getRoot(), bnd, itemDist);
return nearestNeighbour(bp)[0];
} | [
"public",
"Object",
"nearestNeighbour",
"(",
"Envelope",
"env",
",",
"Object",
"item",
",",
"ItemDistance",
"itemDist",
")",
"{",
"Boundable",
"bnd",
"=",
"new",
"ItemBoundable",
"(",
"env",
",",
"item",
")",
";",
"BoundablePair",
"bp",
"=",
"new",
"Boundabl... | Finds the item in this tree which is nearest to the given {@link Object},
using {@link org.locationtech.jts.index.strtree.ItemDistance} as the distance metric.
A Branch-and-Bound tree traversal algorithm is used
to provide an efficient search.
<p>
The query <tt>object</tt> does <b>not</b> have to be
contained in the tr... | [
"Finds",
"the",
"item",
"in",
"this",
"tree",
"which",
"is",
"nearest",
"to",
"the",
"given",
"{",
"@link",
"Object",
"}",
"using",
"{",
"@link",
"org",
".",
"locationtech",
".",
"jts",
".",
"index",
".",
"strtree",
".",
"ItemDistance",
"}",
"as",
"the... | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/index/strtree/STRtreeJGT.java#L306-L310 |
groovyfx-project/groovyfx | src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java | FXBindableASTTransformation.addJavaFXProperty | private void addJavaFXProperty(SourceUnit source, AnnotationNode node, ClassNode declaringClass, FieldNode field) {
"""
Adds a JavaFX property to the class in place of the original Groovy property. A pair of synthetic
getter/setter methods is generated to provide pseudo-access to the original property.
@param... | java | private void addJavaFXProperty(SourceUnit source, AnnotationNode node, ClassNode declaringClass, FieldNode field) {
String fieldName = field.getName();
for (PropertyNode propertyNode : declaringClass.getProperties()) {
if (propertyNode.getName().equals(fieldName)) {
if (field... | [
"private",
"void",
"addJavaFXProperty",
"(",
"SourceUnit",
"source",
",",
"AnnotationNode",
"node",
",",
"ClassNode",
"declaringClass",
",",
"FieldNode",
"field",
")",
"{",
"String",
"fieldName",
"=",
"field",
".",
"getName",
"(",
")",
";",
"for",
"(",
"Proper... | Adds a JavaFX property to the class in place of the original Groovy property. A pair of synthetic
getter/setter methods is generated to provide pseudo-access to the original property.
@param source The SourceUnit in which the annotation was found
@param node The node that was annotated
@param declar... | [
"Adds",
"a",
"JavaFX",
"property",
"to",
"the",
"class",
"in",
"place",
"of",
"the",
"original",
"Groovy",
"property",
".",
"A",
"pair",
"of",
"synthetic",
"getter",
"/",
"setter",
"methods",
"is",
"generated",
"to",
"provide",
"pseudo",
"-",
"access",
"to... | train | https://github.com/groovyfx-project/groovyfx/blob/7067d76793601ce4de9c642d4c0c0e11db7907cb/src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java#L210-L227 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/DeviceTypesApi.java | DeviceTypesApi.getManifestProperties | public ManifestPropertiesEnvelope getManifestProperties(String deviceTypeId, String version) throws ApiException {
"""
Get manifest properties
Get a Device Type's manifest properties for a specific version.
@param deviceTypeId Device Type ID. (required)
@param version Manifest Version. (required)
@return M... | java | public ManifestPropertiesEnvelope getManifestProperties(String deviceTypeId, String version) throws ApiException {
ApiResponse<ManifestPropertiesEnvelope> resp = getManifestPropertiesWithHttpInfo(deviceTypeId, version);
return resp.getData();
} | [
"public",
"ManifestPropertiesEnvelope",
"getManifestProperties",
"(",
"String",
"deviceTypeId",
",",
"String",
"version",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ManifestPropertiesEnvelope",
">",
"resp",
"=",
"getManifestPropertiesWithHttpInfo",
"(",
"devic... | Get manifest properties
Get a Device Type's manifest properties for a specific version.
@param deviceTypeId Device Type ID. (required)
@param version Manifest Version. (required)
@return ManifestPropertiesEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response bod... | [
"Get",
"manifest",
"properties",
"Get",
"a",
"Device",
"Type'",
";",
"s",
"manifest",
"properties",
"for",
"a",
"specific",
"version",
"."
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/DeviceTypesApi.java#L760-L763 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/web/PortalWebUtils.java | PortalWebUtils.getMapSessionAttribute | public static <K, V> ConcurrentMap<K, V> getMapSessionAttribute(
HttpSession session, String name) {
"""
Get a {@link ConcurrentMap} for the specified name from the {@link HttpSession} attributes.
If it doesn't exist create it and store it in the attributes. This is done in a thread-safe
matter that ... | java | public static <K, V> ConcurrentMap<K, V> getMapSessionAttribute(
HttpSession session, String name) {
return getMapSessionAttribute(session, name, true);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"ConcurrentMap",
"<",
"K",
",",
"V",
">",
"getMapSessionAttribute",
"(",
"HttpSession",
"session",
",",
"String",
"name",
")",
"{",
"return",
"getMapSessionAttribute",
"(",
"session",
",",
"name",
",",
"true",
"... | Get a {@link ConcurrentMap} for the specified name from the {@link HttpSession} attributes.
If it doesn't exist create it and store it in the attributes. This is done in a thread-safe
matter that ensures only one Map per name & session will be created @See {@link
WebUtils#getSessionMutex(HttpSession)} | [
"Get",
"a",
"{"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/web/PortalWebUtils.java#L98-L101 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/application/Application.java | Application.getResourceBundle | public ResourceBundle getResourceBundle(FacesContext ctx, String name) throws FacesException, NullPointerException {
"""
<p>
Find a <code>ResourceBundle</code> as defined in the application configuration resources under the specified
name. If a <code>ResourceBundle</code> was defined for the name, return an inst... | java | public ResourceBundle getResourceBundle(FacesContext ctx, String name) throws FacesException, NullPointerException
{
Application application = getMyfacesApplicationInstance(ctx);
if (application != null)
{
return application.getResourceBundle(ctx, name);
}
throw n... | [
"public",
"ResourceBundle",
"getResourceBundle",
"(",
"FacesContext",
"ctx",
",",
"String",
"name",
")",
"throws",
"FacesException",
",",
"NullPointerException",
"{",
"Application",
"application",
"=",
"getMyfacesApplicationInstance",
"(",
"ctx",
")",
";",
"if",
"(",
... | <p>
Find a <code>ResourceBundle</code> as defined in the application configuration resources under the specified
name. If a <code>ResourceBundle</code> was defined for the name, return an instance that uses the locale of the
current <code>{@link javax.faces.component.UIViewRoot}</code>.
</p>
<p>
The default implementa... | [
"<p",
">",
"Find",
"a",
"<code",
">",
"ResourceBundle<",
"/",
"code",
">",
"as",
"defined",
"in",
"the",
"application",
"configuration",
"resources",
"under",
"the",
"specified",
"name",
".",
"If",
"a",
"<code",
">",
"ResourceBundle<",
"/",
"code",
">",
"w... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/application/Application.java#L820-L828 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/decorators/predefined/GenericStatsDecorator.java | GenericStatsDecorator.addCaption | public void addCaption(String name, String type) {
"""
Add a caption value.
@param name the caption
@param type short description
"""
captions.add(new StatCaptionBean(name, name + " as " + type, ""));
} | java | public void addCaption(String name, String type) {
captions.add(new StatCaptionBean(name, name + " as " + type, ""));
} | [
"public",
"void",
"addCaption",
"(",
"String",
"name",
",",
"String",
"type",
")",
"{",
"captions",
".",
"add",
"(",
"new",
"StatCaptionBean",
"(",
"name",
",",
"name",
"+",
"\" as \"",
"+",
"type",
",",
"\"\"",
")",
")",
";",
"}"
] | Add a caption value.
@param name the caption
@param type short description | [
"Add",
"a",
"caption",
"value",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/decorators/predefined/GenericStatsDecorator.java#L83-L85 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/wrapper/json/PJsonArray.java | PJsonArray.getFloat | @Override
public final float getFloat(final int i) {
"""
Get the element at the index as a float.
@param i the index of the element to access
"""
double val = this.array.optDouble(i, Double.MAX_VALUE);
if (val == Double.MAX_VALUE) {
throw new ObjectMissingException(this, "[" ... | java | @Override
public final float getFloat(final int i) {
double val = this.array.optDouble(i, Double.MAX_VALUE);
if (val == Double.MAX_VALUE) {
throw new ObjectMissingException(this, "[" + i + "]");
}
return (float) val;
} | [
"@",
"Override",
"public",
"final",
"float",
"getFloat",
"(",
"final",
"int",
"i",
")",
"{",
"double",
"val",
"=",
"this",
".",
"array",
".",
"optDouble",
"(",
"i",
",",
"Double",
".",
"MAX_VALUE",
")",
";",
"if",
"(",
"val",
"==",
"Double",
".",
"... | Get the element at the index as a float.
@param i the index of the element to access | [
"Get",
"the",
"element",
"at",
"the",
"index",
"as",
"a",
"float",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/json/PJsonArray.java#L113-L120 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/util/StringUtils.java | StringUtils.convertDotToUnderscore | public static String convertDotToUnderscore(String dottedProperty, boolean uppercase) {
"""
Replace the dots in the property with underscore and
transform to uppercase based on given flag.
@param dottedProperty The property with dots, example - a.b.c
@param uppercase To transform to uppercase string
@re... | java | public static String convertDotToUnderscore(String dottedProperty, boolean uppercase) {
if (dottedProperty == null) {
return dottedProperty;
}
Optional<String> converted = Optional.of(dottedProperty)
.map(value -> value.replace('.', '_'))
.map(value -> upperca... | [
"public",
"static",
"String",
"convertDotToUnderscore",
"(",
"String",
"dottedProperty",
",",
"boolean",
"uppercase",
")",
"{",
"if",
"(",
"dottedProperty",
"==",
"null",
")",
"{",
"return",
"dottedProperty",
";",
"}",
"Optional",
"<",
"String",
">",
"converted"... | Replace the dots in the property with underscore and
transform to uppercase based on given flag.
@param dottedProperty The property with dots, example - a.b.c
@param uppercase To transform to uppercase string
@return The converted value | [
"Replace",
"the",
"dots",
"in",
"the",
"property",
"with",
"underscore",
"and",
"transform",
"to",
"uppercase",
"based",
"on",
"given",
"flag",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/StringUtils.java#L234-L242 |
youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/serverhandler/ServerUserEventHandler.java | ServerUserEventHandler.checkUserAgent | protected Object checkUserAgent(ServerUserHandlerClass handler, ApiUser userAgent) {
"""
Check whether context of user agent is application or game
@param handler structure of handler
@param userAgent user agent object
@return user agent or game user agent object
"""
if(handler.getUserClass().isAs... | java | protected Object checkUserAgent(ServerUserHandlerClass handler, ApiUser userAgent) {
if(handler.getUserClass().isAssignableFrom(userAgent.getClass()))
return userAgent;
return UserAgentUtil.getGameUser(userAgent, handler.getUserClass());
} | [
"protected",
"Object",
"checkUserAgent",
"(",
"ServerUserHandlerClass",
"handler",
",",
"ApiUser",
"userAgent",
")",
"{",
"if",
"(",
"handler",
".",
"getUserClass",
"(",
")",
".",
"isAssignableFrom",
"(",
"userAgent",
".",
"getClass",
"(",
")",
")",
")",
"retu... | Check whether context of user agent is application or game
@param handler structure of handler
@param userAgent user agent object
@return user agent or game user agent object | [
"Check",
"whether",
"context",
"of",
"user",
"agent",
"is",
"application",
"or",
"game"
] | train | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/serverhandler/ServerUserEventHandler.java#L48-L52 |
ocelotds/ocelot | ocelot-web/src/main/java/org/ocelotds/cache/JsCacheAnnotationServices.java | JsCacheAnnotationServices.processJsCacheRemove | public void processJsCacheRemove(JsCacheRemove jcr, List<String> paramNames, List<String> jsonArgs) {
"""
Process an annotation JsCacheRemove and send a removeCache message to all clients connected
@param jcr : l'annotation
@param paramNames : name of parameters
@param jsonArgs : method arguments json format
... | java | public void processJsCacheRemove(JsCacheRemove jcr, List<String> paramNames, List<String> jsonArgs) {
logger.debug("Process JsCacheRemove annotation : {}", jcr);
MessageToClient messageToClient = new MessageToClient();
messageToClient.setId(Constants.Cache.CLEANCACHE_TOPIC);
String argpart = cacheArgumentSe... | [
"public",
"void",
"processJsCacheRemove",
"(",
"JsCacheRemove",
"jcr",
",",
"List",
"<",
"String",
">",
"paramNames",
",",
"List",
"<",
"String",
">",
"jsonArgs",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Process JsCacheRemove annotation : {}\"",
",",
"jcr",
")"... | Process an annotation JsCacheRemove and send a removeCache message to all clients connected
@param jcr : l'annotation
@param paramNames : name of parameters
@param jsonArgs : method arguments json format | [
"Process",
"an",
"annotation",
"JsCacheRemove",
"and",
"send",
"a",
"removeCache",
"message",
"to",
"all",
"clients",
"connected"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/cache/JsCacheAnnotationServices.java#L99-L117 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java | DocTreeScanner.visitHidden | @Override
public R visitHidden(HiddenTree node, P p) {
"""
{@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning
"""
return scan(node.getBody(), p);
} | java | @Override
public R visitHidden(HiddenTree node, P p) {
return scan(node.getBody(), p);
} | [
"@",
"Override",
"public",
"R",
"visitHidden",
"(",
"HiddenTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"scan",
"(",
"node",
".",
"getBody",
"(",
")",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"scans",
"the",
"children",
"in",
"left",
"to",
"right",
"order",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java#L244-L247 |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java | Bytes.putDouble | public static int putDouble(byte [] bytes, int offset, double d) {
"""
Put a double value out to the specified byte array position.
@param bytes byte array
@param offset offset to write to
@param d value
@return New offset into array <code>bytes</code>
"""
return putLong(bytes, offset, Double.doubleToL... | java | public static int putDouble(byte [] bytes, int offset, double d) {
return putLong(bytes, offset, Double.doubleToLongBits(d));
} | [
"public",
"static",
"int",
"putDouble",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"double",
"d",
")",
"{",
"return",
"putLong",
"(",
"bytes",
",",
"offset",
",",
"Double",
".",
"doubleToLongBits",
"(",
"d",
")",
")",
";",
"}"
] | Put a double value out to the specified byte array position.
@param bytes byte array
@param offset offset to write to
@param d value
@return New offset into array <code>bytes</code> | [
"Put",
"a",
"double",
"value",
"out",
"to",
"the",
"specified",
"byte",
"array",
"position",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java#L508-L510 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.setAtt | public static void setAtt(Element el, String name, int d) {
"""
Set a SVG attribute
@param el element
@param name attribute name
@param d integer value
"""
el.setAttribute(name, Integer.toString(d));
} | java | public static void setAtt(Element el, String name, int d) {
el.setAttribute(name, Integer.toString(d));
} | [
"public",
"static",
"void",
"setAtt",
"(",
"Element",
"el",
",",
"String",
"name",
",",
"int",
"d",
")",
"{",
"el",
".",
"setAttribute",
"(",
"name",
",",
"Integer",
".",
"toString",
"(",
"d",
")",
")",
";",
"}"
] | Set a SVG attribute
@param el element
@param name attribute name
@param d integer value | [
"Set",
"a",
"SVG",
"attribute"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L305-L307 |
alkacon/opencms-core | src/org/opencms/ui/CmsUserIconHelper.java | CmsUserIconHelper.getIconPath | private String getIconPath(CmsObject cms, CmsUser user, IconSize size) {
"""
Returns the ident-icon path for the given user.<p>
@param cms the cms context
@param user the user
@param size IconSize to get icon for
@return the icon path
"""
String userIconPath = (String)user.getAdditionalInfo(US... | java | private String getIconPath(CmsObject cms, CmsUser user, IconSize size) {
String userIconPath = (String)user.getAdditionalInfo(USER_IMAGE_INFO);
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(userIconPath)) {
userIconPath += size.equals(IconSize.Big)
? ""
: "?__scale=h:... | [
"private",
"String",
"getIconPath",
"(",
"CmsObject",
"cms",
",",
"CmsUser",
"user",
",",
"IconSize",
"size",
")",
"{",
"String",
"userIconPath",
"=",
"(",
"String",
")",
"user",
".",
"getAdditionalInfo",
"(",
"USER_IMAGE_INFO",
")",
";",
"if",
"(",
"CmsStri... | Returns the ident-icon path for the given user.<p>
@param cms the cms context
@param user the user
@param size IconSize to get icon for
@return the icon path | [
"Returns",
"the",
"ident",
"-",
"icon",
"path",
"for",
"the",
"given",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsUserIconHelper.java#L380-L404 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java | TmdbLists.addItem | public StatusCode addItem(String sessionId, String listId, int mediaId) throws MovieDbException {
"""
This method lets users add new items to a list that they created.
A valid session id is required.
@param sessionId
@param listId
@param mediaId
@return
@throws MovieDbException
"""
return mod... | java | public StatusCode addItem(String sessionId, String listId, int mediaId) throws MovieDbException {
return modifyMovieList(sessionId, listId, mediaId, MethodSub.ADD_ITEM);
} | [
"public",
"StatusCode",
"addItem",
"(",
"String",
"sessionId",
",",
"String",
"listId",
",",
"int",
"mediaId",
")",
"throws",
"MovieDbException",
"{",
"return",
"modifyMovieList",
"(",
"sessionId",
",",
"listId",
",",
"mediaId",
",",
"MethodSub",
".",
"ADD_ITEM"... | This method lets users add new items to a list that they created.
A valid session id is required.
@param sessionId
@param listId
@param mediaId
@return
@throws MovieDbException | [
"This",
"method",
"lets",
"users",
"add",
"new",
"items",
"to",
"a",
"list",
"that",
"they",
"created",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java#L197-L199 |
belaban/JGroups | src/org/jgroups/util/Bits.java | Bits.readLong | public static long readLong(DataInput in) throws IOException {
"""
Reads a variable-length encoded long from an input stream. Note that currently variable-length encoding is <em>not</em>
used (a similar mechanism is used); this will be implemented later.
@param in the input stream
@return the long read from th... | java | public static long readLong(DataInput in) throws IOException {
byte len=in.readByte();
if(len == 0)
return 0;
return makeLong(in, len);
} | [
"public",
"static",
"long",
"readLong",
"(",
"DataInput",
"in",
")",
"throws",
"IOException",
"{",
"byte",
"len",
"=",
"in",
".",
"readByte",
"(",
")",
";",
"if",
"(",
"len",
"==",
"0",
")",
"return",
"0",
";",
"return",
"makeLong",
"(",
"in",
",",
... | Reads a variable-length encoded long from an input stream. Note that currently variable-length encoding is <em>not</em>
used (a similar mechanism is used); this will be implemented later.
@param in the input stream
@return the long read from the input stream
@throws IOException | [
"Reads",
"a",
"variable",
"-",
"length",
"encoded",
"long",
"from",
"an",
"input",
"stream",
".",
"Note",
"that",
"currently",
"variable",
"-",
"length",
"encoding",
"is",
"<em",
">",
"not<",
"/",
"em",
">",
"used",
"(",
"a",
"similar",
"mechanism",
"is"... | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/Bits.java#L262-L267 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/base64/Base64.java | Base64.encodeObject | @Nonnull
public static String encodeObject (@Nonnull final Serializable aSerializableObject,
final int nOptions) throws IOException {
"""
Serializes an object and returns the Base64-encoded version of that
serialized object.
<p>
As of v 2.3, if the object cannot be seriali... | java | @Nonnull
public static String encodeObject (@Nonnull final Serializable aSerializableObject,
final int nOptions) throws IOException
{
ValueEnforcer.notNull (aSerializableObject, "Object");
// ObjectOutputStream -> (GZIP) -> Base64 -> ByteArrayOutputStream
final NonB... | [
"@",
"Nonnull",
"public",
"static",
"String",
"encodeObject",
"(",
"@",
"Nonnull",
"final",
"Serializable",
"aSerializableObject",
",",
"final",
"int",
"nOptions",
")",
"throws",
"IOException",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aSerializableObject",
",",
... | Serializes an object and returns the Base64-encoded version of that
serialized object.
<p>
As of v 2.3, if the object cannot be serialized or there is another error,
the method will throw an IOException. <b>This is new to v2.3!</b> In
earlier versions, it just returned a null value, but in retrospect that's a
pretty po... | [
"Serializes",
"an",
"object",
"and",
"returns",
"the",
"Base64",
"-",
"encoded",
"version",
"of",
"that",
"serialized",
"object",
".",
"<p",
">",
"As",
"of",
"v",
"2",
".",
"3",
"if",
"the",
"object",
"cannot",
"be",
"serialized",
"or",
"there",
"is",
... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/base64/Base64.java#L1602-L1633 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/ipc/RPC.java | RPC.getProxy | public static <V extends VersionedProtocol> V getProxy(Class<V> protocol, InetSocketAddress addr)
throws IOException {
"""
Construct a client-side proxy object with the default SocketFactory
@param protocol
@param addr
@return
@throws IOException
"""
return getProxy(protocol, addr, NetUtils.getDefa... | java | public static <V extends VersionedProtocol> V getProxy(Class<V> protocol, InetSocketAddress addr)
throws IOException {
return getProxy(protocol, addr, NetUtils.getDefaultSocketFactory());
} | [
"public",
"static",
"<",
"V",
"extends",
"VersionedProtocol",
">",
"V",
"getProxy",
"(",
"Class",
"<",
"V",
">",
"protocol",
",",
"InetSocketAddress",
"addr",
")",
"throws",
"IOException",
"{",
"return",
"getProxy",
"(",
"protocol",
",",
"addr",
",",
"NetUti... | Construct a client-side proxy object with the default SocketFactory
@param protocol
@param addr
@return
@throws IOException | [
"Construct",
"a",
"client",
"-",
"side",
"proxy",
"object",
"with",
"the",
"default",
"SocketFactory"
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/ipc/RPC.java#L332-L336 |
wcm-io/wcm-io-wcm | commons/src/main/java/io/wcm/wcm/commons/caching/CacheHeader.java | CacheHeader.setExpiresSeconds | public static void setExpiresSeconds(@NotNull HttpServletResponse response, int seconds) {
"""
Set expires header to given amount of seconds in the future.
@param response Response
@param seconds Seconds to expire
"""
Date expiresDate = DateUtils.addSeconds(new Date(), seconds);
setExpires(response, ... | java | public static void setExpiresSeconds(@NotNull HttpServletResponse response, int seconds) {
Date expiresDate = DateUtils.addSeconds(new Date(), seconds);
setExpires(response, expiresDate);
} | [
"public",
"static",
"void",
"setExpiresSeconds",
"(",
"@",
"NotNull",
"HttpServletResponse",
"response",
",",
"int",
"seconds",
")",
"{",
"Date",
"expiresDate",
"=",
"DateUtils",
".",
"addSeconds",
"(",
"new",
"Date",
"(",
")",
",",
"seconds",
")",
";",
"set... | Set expires header to given amount of seconds in the future.
@param response Response
@param seconds Seconds to expire | [
"Set",
"expires",
"header",
"to",
"given",
"amount",
"of",
"seconds",
"in",
"the",
"future",
"."
] | train | https://github.com/wcm-io/wcm-io-wcm/blob/8eff9434f2f4b6462fdb718f8769ad793c55b8d7/commons/src/main/java/io/wcm/wcm/commons/caching/CacheHeader.java#L232-L235 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/preprocessing/text/KerasTokenizer.java | KerasTokenizer.textsToMatrix | public INDArray textsToMatrix(String[] texts, TokenizerMode mode) {
"""
Turns an array of texts into an ND4J matrix of shape
(number of texts, number of words in vocabulary)
@param texts input texts
@param mode TokenizerMode that controls how to vectorize data
@return resulting matrix representation
"""
... | java | public INDArray textsToMatrix(String[] texts, TokenizerMode mode) {
Integer[][] sequences = textsToSequences(texts);
return sequencesToMatrix(sequences, mode);
} | [
"public",
"INDArray",
"textsToMatrix",
"(",
"String",
"[",
"]",
"texts",
",",
"TokenizerMode",
"mode",
")",
"{",
"Integer",
"[",
"]",
"[",
"]",
"sequences",
"=",
"textsToSequences",
"(",
"texts",
")",
";",
"return",
"sequencesToMatrix",
"(",
"sequences",
","... | Turns an array of texts into an ND4J matrix of shape
(number of texts, number of words in vocabulary)
@param texts input texts
@param mode TokenizerMode that controls how to vectorize data
@return resulting matrix representation | [
"Turns",
"an",
"array",
"of",
"texts",
"into",
"an",
"ND4J",
"matrix",
"of",
"shape",
"(",
"number",
"of",
"texts",
"number",
"of",
"words",
"in",
"vocabulary",
")"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/preprocessing/text/KerasTokenizer.java#L343-L346 |
Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/MasterJournalContext.java | MasterJournalContext.waitForJournalFlush | private void waitForJournalFlush() throws UnavailableException {
"""
Waits for the flush counter to be flushed to the journal. If the counter is
{@link #INVALID_FLUSH_COUNTER}, this is a noop.
"""
if (mFlushCounter == INVALID_FLUSH_COUNTER) {
// Check this before the precondition.
return;
... | java | private void waitForJournalFlush() throws UnavailableException {
if (mFlushCounter == INVALID_FLUSH_COUNTER) {
// Check this before the precondition.
return;
}
RetryPolicy retry = new TimeoutRetry(FLUSH_RETRY_TIMEOUT_MS, FLUSH_RETRY_INTERVAL_MS);
while (retry.attempt()) {
try {
... | [
"private",
"void",
"waitForJournalFlush",
"(",
")",
"throws",
"UnavailableException",
"{",
"if",
"(",
"mFlushCounter",
"==",
"INVALID_FLUSH_COUNTER",
")",
"{",
"// Check this before the precondition.",
"return",
";",
"}",
"RetryPolicy",
"retry",
"=",
"new",
"TimeoutRetr... | Waits for the flush counter to be flushed to the journal. If the counter is
{@link #INVALID_FLUSH_COUNTER}, this is a noop. | [
"Waits",
"for",
"the",
"flush",
"counter",
"to",
"be",
"flushed",
"to",
"the",
"journal",
".",
"If",
"the",
"counter",
"is",
"{"
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/MasterJournalContext.java#L66-L87 |
seam/faces | impl/src/main/java/org/jboss/seam/faces/security/SecurityPhaseListener.java | SecurityPhaseListener.getRestrictedPhaseIds | public PhaseIdType[] getRestrictedPhaseIds(Method restrictAtViewMethod, Annotation annotation) {
"""
Retrieve the default PhaseIdTypes defined by the restrictAtViewMethod in the annotation
@param restrictAtViewMethod
@param annotation
@return PhaseIdTypes from the restrictAtViewMethod, null if empty
"""
... | java | public PhaseIdType[] getRestrictedPhaseIds(Method restrictAtViewMethod, Annotation annotation) {
PhaseIdType[] phaseIds;
try {
phaseIds = (PhaseIdType[]) restrictAtViewMethod.invoke(annotation);
} catch (IllegalAccessException ex) {
throw new IllegalArgumentException("res... | [
"public",
"PhaseIdType",
"[",
"]",
"getRestrictedPhaseIds",
"(",
"Method",
"restrictAtViewMethod",
",",
"Annotation",
"annotation",
")",
"{",
"PhaseIdType",
"[",
"]",
"phaseIds",
";",
"try",
"{",
"phaseIds",
"=",
"(",
"PhaseIdType",
"[",
"]",
")",
"restrictAtVie... | Retrieve the default PhaseIdTypes defined by the restrictAtViewMethod in the annotation
@param restrictAtViewMethod
@param annotation
@return PhaseIdTypes from the restrictAtViewMethod, null if empty | [
"Retrieve",
"the",
"default",
"PhaseIdTypes",
"defined",
"by",
"the",
"restrictAtViewMethod",
"in",
"the",
"annotation"
] | train | https://github.com/seam/faces/blob/2fdedbc7070318c2c58bfffb8a26f1ea1d0ee1e3/impl/src/main/java/org/jboss/seam/faces/security/SecurityPhaseListener.java#L256-L266 |
alkacon/opencms-core | src/org/opencms/util/CmsParameterEscaper.java | CmsParameterEscaper.enableAntiSamy | public void enableAntiSamy(CmsObject cms, String policyPath, Set<String> params) {
"""
Enables the AntiSamy HTML cleaning for some parameters.<p>
@param cms the current CMS context
@param policyPath the policy site path in the VFS
@param params the parameters for which HTML cleaning should be enabled
"""... | java | public void enableAntiSamy(CmsObject cms, String policyPath, Set<String> params) {
m_antiSamy = createAntiSamy(cms, policyPath);
m_cleanHtml = params;
} | [
"public",
"void",
"enableAntiSamy",
"(",
"CmsObject",
"cms",
",",
"String",
"policyPath",
",",
"Set",
"<",
"String",
">",
"params",
")",
"{",
"m_antiSamy",
"=",
"createAntiSamy",
"(",
"cms",
",",
"policyPath",
")",
";",
"m_cleanHtml",
"=",
"params",
";",
"... | Enables the AntiSamy HTML cleaning for some parameters.<p>
@param cms the current CMS context
@param policyPath the policy site path in the VFS
@param params the parameters for which HTML cleaning should be enabled | [
"Enables",
"the",
"AntiSamy",
"HTML",
"cleaning",
"for",
"some",
"parameters",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsParameterEscaper.java#L156-L160 |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/RDBMDistributedLayoutStore.java | RDBMDistributedLayoutStore.getFragmentLayout | @Override
public Document getFragmentLayout(IPerson person, IUserProfile profile) {
"""
Convenience method for fragment activator to obtain raw layouts for fragments during
initialization.
"""
return this._safeGetUserLayout(person, profile);
} | java | @Override
public Document getFragmentLayout(IPerson person, IUserProfile profile) {
return this._safeGetUserLayout(person, profile);
} | [
"@",
"Override",
"public",
"Document",
"getFragmentLayout",
"(",
"IPerson",
"person",
",",
"IUserProfile",
"profile",
")",
"{",
"return",
"this",
".",
"_safeGetUserLayout",
"(",
"person",
",",
"profile",
")",
";",
"}"
] | Convenience method for fragment activator to obtain raw layouts for fragments during
initialization. | [
"Convenience",
"method",
"for",
"fragment",
"activator",
"to",
"obtain",
"raw",
"layouts",
"for",
"fragments",
"during",
"initialization",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/RDBMDistributedLayoutStore.java#L1362-L1366 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagPdf.java | CmsJspTagPdf.pdfTagAction | public static String pdfTagAction(
ServletRequest request,
String format,
String content,
String localeStr,
SortedMap<String, String> params,
String paramEncoding)
throws CmsException {
"""
The implementation of the tag.<p>
@param request the current request
... | java | public static String pdfTagAction(
ServletRequest request,
String format,
String content,
String localeStr,
SortedMap<String, String> params,
String paramEncoding)
throws CmsException {
CmsFlexController controller = CmsFlexController.getController(request);
... | [
"public",
"static",
"String",
"pdfTagAction",
"(",
"ServletRequest",
"request",
",",
"String",
"format",
",",
"String",
"content",
",",
"String",
"localeStr",
",",
"SortedMap",
"<",
"String",
",",
"String",
">",
"params",
",",
"String",
"paramEncoding",
")",
"... | The implementation of the tag.<p>
@param request the current request
@param format the format path
@param content the content path
@param localeStr the name of the locale to include in the PDF link
@param params map of parameters
@param paramEncoding the character encoding to use for URL parameters
@return the link t... | [
"The",
"implementation",
"of",
"the",
"tag",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagPdf.java#L95-L130 |
classgraph/classgraph | src/main/java/io/github/classgraph/ResourceList.java | ResourceList.findDuplicatePaths | public List<Entry<String, ResourceList>> findDuplicatePaths() {
"""
Find duplicate resource paths within this {@link ResourceList}.
@return A {@link List} of {@link Entry} objects for all resources in the classpath and/or module path that
have a non-unique path (i.e. where there are at least two resources with... | java | public List<Entry<String, ResourceList>> findDuplicatePaths() {
final List<Entry<String, ResourceList>> duplicatePaths = new ArrayList<>();
for (final Entry<String, ResourceList> pathAndResourceList : asMap().entrySet()) {
// Find ResourceLists with two or more entries
if (pathAn... | [
"public",
"List",
"<",
"Entry",
"<",
"String",
",",
"ResourceList",
">",
">",
"findDuplicatePaths",
"(",
")",
"{",
"final",
"List",
"<",
"Entry",
"<",
"String",
",",
"ResourceList",
">",
">",
"duplicatePaths",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";"... | Find duplicate resource paths within this {@link ResourceList}.
@return A {@link List} of {@link Entry} objects for all resources in the classpath and/or module path that
have a non-unique path (i.e. where there are at least two resources with the same path). The key of
each returned {@link Entry} is the path (obtaine... | [
"Find",
"duplicate",
"resource",
"paths",
"within",
"this",
"{",
"@link",
"ResourceList",
"}",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ResourceList.java#L245-L261 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/core/Config.java | Config.getInt | public int getInt(String key, int defaultValue) {
"""
Retrieves a configuration value with the given key
@param key The key of the configuration value (e.g. application.name)
@param defaultValue The default value to return of no key is found
@return The configured value as int or the passed defautlValue if th... | java | public int getInt(String key, int defaultValue) {
final String value = this.props.getValue(key);
if (StringUtils.isBlank(value)) {
return defaultValue;
}
return Integer.parseInt(value);
} | [
"public",
"int",
"getInt",
"(",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"final",
"String",
"value",
"=",
"this",
".",
"props",
".",
"getValue",
"(",
"key",
")",
";",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"value",
")",
")",
"{"... | Retrieves a configuration value with the given key
@param key The key of the configuration value (e.g. application.name)
@param defaultValue The default value to return of no key is found
@return The configured value as int or the passed defautlValue if the key is not configured | [
"Retrieves",
"a",
"configuration",
"value",
"with",
"the",
"given",
"key"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/core/Config.java#L221-L228 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.findFieldOrThrowException | private static Field findFieldOrThrowException(Class<?> fieldType, Class<?> where) {
"""
Find field or throw exception.
@param fieldType the field type
@param where the where
@return the field
"""
if (fieldType == null || where == null) {
throw new IllegalArgumentException("fieldTy... | java | private static Field findFieldOrThrowException(Class<?> fieldType, Class<?> where) {
if (fieldType == null || where == null) {
throw new IllegalArgumentException("fieldType and where cannot be null");
}
Field field = null;
for (Field currentField : where.getDeclaredFields()) ... | [
"private",
"static",
"Field",
"findFieldOrThrowException",
"(",
"Class",
"<",
"?",
">",
"fieldType",
",",
"Class",
"<",
"?",
">",
"where",
")",
"{",
"if",
"(",
"fieldType",
"==",
"null",
"||",
"where",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgu... | Find field or throw exception.
@param fieldType the field type
@param where the where
@return the field | [
"Find",
"field",
"or",
"throw",
"exception",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L2277-L2293 |
jbossas/remoting-jmx | src/main/java/org/jboss/remotingjmx/protocol/v1/Common.java | Common.prepareForMarshalling | protected org.jboss.marshalling.Marshaller prepareForMarshalling(final DataOutput dataOutput) throws IOException {
"""
Creates and returns a {@link org.jboss.marshalling.Marshaller} which is ready to be used for marshalling. The
{@link org.jboss.marshalling.Marshaller#start(org.jboss.marshalling.ByteOutput)} will... | java | protected org.jboss.marshalling.Marshaller prepareForMarshalling(final DataOutput dataOutput) throws IOException {
final org.jboss.marshalling.Marshaller marshaller = this.getMarshaller(marshallerFactory);
final OutputStream outputStream = new OutputStream() {
@Override
public vo... | [
"protected",
"org",
".",
"jboss",
".",
"marshalling",
".",
"Marshaller",
"prepareForMarshalling",
"(",
"final",
"DataOutput",
"dataOutput",
")",
"throws",
"IOException",
"{",
"final",
"org",
".",
"jboss",
".",
"marshalling",
".",
"Marshaller",
"marshaller",
"=",
... | Creates and returns a {@link org.jboss.marshalling.Marshaller} which is ready to be used for marshalling. The
{@link org.jboss.marshalling.Marshaller#start(org.jboss.marshalling.ByteOutput)} will be invoked by this method, to use
the passed {@link java.io.DataOutput dataOutput}, before returning the marshaller.
@param... | [
"Creates",
"and",
"returns",
"a",
"{",
"@link",
"org",
".",
"jboss",
".",
"marshalling",
".",
"Marshaller",
"}",
"which",
"is",
"ready",
"to",
"be",
"used",
"for",
"marshalling",
".",
"The",
"{",
"@link",
"org",
".",
"jboss",
".",
"marshalling",
".",
"... | train | https://github.com/jbossas/remoting-jmx/blob/dbc87bfed47e5bb9e37c355a77ca0ae9a6ea1363/src/main/java/org/jboss/remotingjmx/protocol/v1/Common.java#L79-L103 |
threerings/nenya | core/src/main/java/com/threerings/chat/ComicChatOverlay.java | ComicChatOverlay.layoutText | protected Label layoutText (Graphics2D gfx, Font font, String text) {
"""
Get a label formatted as close to the golden ratio as possible for the specified text and
given the standard padding we use on all bubbles.
"""
Label label = _logic.createLabel(text);
label.setFont(font);
// lay... | java | protected Label layoutText (Graphics2D gfx, Font font, String text)
{
Label label = _logic.createLabel(text);
label.setFont(font);
// layout in one line
Rectangle vbounds = _target.getViewBounds();
label.setTargetWidth(vbounds.width - PAD * 2);
label.layout(gfx);
... | [
"protected",
"Label",
"layoutText",
"(",
"Graphics2D",
"gfx",
",",
"Font",
"font",
",",
"String",
"text",
")",
"{",
"Label",
"label",
"=",
"_logic",
".",
"createLabel",
"(",
"text",
")",
";",
"label",
".",
"setFont",
"(",
"font",
")",
";",
"// layout in ... | Get a label formatted as close to the golden ratio as possible for the specified text and
given the standard padding we use on all bubbles. | [
"Get",
"a",
"label",
"formatted",
"as",
"close",
"to",
"the",
"golden",
"ratio",
"as",
"possible",
"for",
"the",
"specified",
"text",
"and",
"given",
"the",
"standard",
"padding",
"we",
"use",
"on",
"all",
"bubbles",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ComicChatOverlay.java#L730-L751 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/misc/ImplCommonOps_DSCC.java | ImplCommonOps_DSCC.addColAppend | public static void addColAppend(double alpha, DMatrixSparseCSC A, int colA, double beta, DMatrixSparseCSC B, int colB,
DMatrixSparseCSC C, @Nullable IGrowArray gw) {
"""
Adds the results of adding a column in A and B as a new column in C.<br>
C(:,end+1) = α*A(:,colA) + &b... | java | public static void addColAppend(double alpha, DMatrixSparseCSC A, int colA, double beta, DMatrixSparseCSC B, int colB,
DMatrixSparseCSC C, @Nullable IGrowArray gw)
{
if( A.numRows != B.numRows || A.numRows != C.numRows)
throw new IllegalArgumentException("Numb... | [
"public",
"static",
"void",
"addColAppend",
"(",
"double",
"alpha",
",",
"DMatrixSparseCSC",
"A",
",",
"int",
"colA",
",",
"double",
"beta",
",",
"DMatrixSparseCSC",
"B",
",",
"int",
"colB",
",",
"DMatrixSparseCSC",
"C",
",",
"@",
"Nullable",
"IGrowArray",
"... | Adds the results of adding a column in A and B as a new column in C.<br>
C(:,end+1) = α*A(:,colA) + β*B(:,colB)
@param alpha scalar
@param A matrix
@param colA column in A
@param beta scalar
@param B matrix
@param colB column in B
@param C Column in C
@param gw workspace | [
"Adds",
"the",
"results",
"of",
"adding",
"a",
"column",
"in",
"A",
"and",
"B",
"as",
"a",
"new",
"column",
"in",
"C",
".",
"<br",
">",
"C",
"(",
":",
"end",
"+",
"1",
")",
"=",
"&alpha",
";",
"*",
"A",
"(",
":",
"colA",
")",
"+",
"&beta",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/misc/ImplCommonOps_DSCC.java#L132-L166 |
HtmlUnit/htmlunit-cssparser | src/main/java/com/gargoylesoftware/css/parser/AbstractCSSParser.java | AbstractCSSParser.intValue | protected int intValue(final char op, final String s) {
"""
Parses the sting into an integer.
@param op the sign char
@param s the string to parse
@return the int value
"""
final int result = Integer.parseInt(s);
if (op == '-') {
return -1 * result;
}
return res... | java | protected int intValue(final char op, final String s) {
final int result = Integer.parseInt(s);
if (op == '-') {
return -1 * result;
}
return result;
} | [
"protected",
"int",
"intValue",
"(",
"final",
"char",
"op",
",",
"final",
"String",
"s",
")",
"{",
"final",
"int",
"result",
"=",
"Integer",
".",
"parseInt",
"(",
"s",
")",
";",
"if",
"(",
"op",
"==",
"'",
"'",
")",
"{",
"return",
"-",
"1",
"*",
... | Parses the sting into an integer.
@param op the sign char
@param s the string to parse
@return the int value | [
"Parses",
"the",
"sting",
"into",
"an",
"integer",
"."
] | train | https://github.com/HtmlUnit/htmlunit-cssparser/blob/384e4170737169b5b4c87c5766495d9b8a6d3866/src/main/java/com/gargoylesoftware/css/parser/AbstractCSSParser.java#L752-L758 |
thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/graphdb/database/idhandling/IDHandler.java | IDHandler.writeRelationType | public static void writeRelationType(WriteBuffer out, long relationTypeId, DirectionID dirID, boolean invisible) {
"""
The edge type is written as follows: [ Invisible & System (2 bit) | Relation-Type-ID (1 bit) | Relation-Type-Count (variable) | Direction-ID (1 bit)]
Would only need 1 bit to store relation-type-... | java | public static void writeRelationType(WriteBuffer out, long relationTypeId, DirectionID dirID, boolean invisible) {
assert relationTypeId > 0 && (relationTypeId << 1) > 0; //Check positive and no-overflow
long strippedId = (IDManager.stripEntireRelationTypePadding(relationTypeId) << 1) + dirID.getDirect... | [
"public",
"static",
"void",
"writeRelationType",
"(",
"WriteBuffer",
"out",
",",
"long",
"relationTypeId",
",",
"DirectionID",
"dirID",
",",
"boolean",
"invisible",
")",
"{",
"assert",
"relationTypeId",
">",
"0",
"&&",
"(",
"relationTypeId",
"<<",
"1",
")",
">... | The edge type is written as follows: [ Invisible & System (2 bit) | Relation-Type-ID (1 bit) | Relation-Type-Count (variable) | Direction-ID (1 bit)]
Would only need 1 bit to store relation-type-id, but using two so we can upper bound.
@param out
@param relationTypeId
@param dirID | [
"The",
"edge",
"type",
"is",
"written",
"as",
"follows",
":",
"[",
"Invisible",
"&",
"System",
"(",
"2",
"bit",
")",
"|",
"Relation",
"-",
"Type",
"-",
"ID",
"(",
"1",
"bit",
")",
"|",
"Relation",
"-",
"Type",
"-",
"Count",
"(",
"variable",
")",
... | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/database/idhandling/IDHandler.java#L103-L108 |
lotaris/rox-client-java | rox-client-java/src/main/java/com/lotaris/rox/core/filters/FilterUtils.java | FilterUtils.isRunnable | public static boolean isRunnable(Method method, String[] filters) {
"""
Define if a test is runnable or not based on a method
@param method The method
@param filters The filters to apply
@return True if the test can be run
"""
// Get the ROX annotations
RoxableTest mAnnotation = method.getAnnotation(R... | java | public static boolean isRunnable(Method method, String[] filters) {
// Get the ROX annotations
RoxableTest mAnnotation = method.getAnnotation(RoxableTest.class);
RoxableTestClass cAnnotation = method.getDeclaringClass().getAnnotation(RoxableTestClass.class);
if (mAnnotation != null || cAnnotation != null) {
... | [
"public",
"static",
"boolean",
"isRunnable",
"(",
"Method",
"method",
",",
"String",
"[",
"]",
"filters",
")",
"{",
"// Get the ROX annotations",
"RoxableTest",
"mAnnotation",
"=",
"method",
".",
"getAnnotation",
"(",
"RoxableTest",
".",
"class",
")",
";",
"Roxa... | Define if a test is runnable or not based on a method
@param method The method
@param filters The filters to apply
@return True if the test can be run | [
"Define",
"if",
"a",
"test",
"is",
"runnable",
"or",
"not",
"based",
"on",
"a",
"method"
] | train | https://github.com/lotaris/rox-client-java/blob/1b33f7560347c382c59a40c4037d175ab8127fde/rox-client-java/src/main/java/com/lotaris/rox/core/filters/FilterUtils.java#L22-L32 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.number_detailedZones_GET | public ArrayList<OvhNumberDetailedZone> number_detailedZones_GET(String axiom, OvhNumberCountryEnum country) throws IOException {
"""
Get all available geographic zone with some details, from a country
REST: GET /telephony/number/detailedZones
@param axiom [required] Enter a part of a city name or a zip for sp... | java | public ArrayList<OvhNumberDetailedZone> number_detailedZones_GET(String axiom, OvhNumberCountryEnum country) throws IOException {
String qPath = "/telephony/number/detailedZones";
StringBuilder sb = path(qPath);
query(sb, "axiom", axiom);
query(sb, "country", country);
String resp = execN(qPath, "GET", sb.toS... | [
"public",
"ArrayList",
"<",
"OvhNumberDetailedZone",
">",
"number_detailedZones_GET",
"(",
"String",
"axiom",
",",
"OvhNumberCountryEnum",
"country",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/number/detailedZones\"",
";",
"StringBuilder",
"s... | Get all available geographic zone with some details, from a country
REST: GET /telephony/number/detailedZones
@param axiom [required] Enter a part of a city name or a zip for specific zne returns
@param country [required] The country | [
"Get",
"all",
"available",
"geographic",
"zone",
"with",
"some",
"details",
"from",
"a",
"country"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8643-L8650 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Geometry.java | Geometry.getAngleFromSSS | public static final double getAngleFromSSS(final double s0, final double s1, final double s2) {
"""
Returns the angle between s0 and s1
http://www.mathsisfun.com/algebra/trig-solving-sss-triangles.html
@param s0
@param s1
@param s2
@return
"""
return Math.acos((((s0 * s0) + (s1 * s1)) - (s2 * s2)... | java | public static final double getAngleFromSSS(final double s0, final double s1, final double s2)
{
return Math.acos((((s0 * s0) + (s1 * s1)) - (s2 * s2)) / (2 * (s0 * s1)));
} | [
"public",
"static",
"final",
"double",
"getAngleFromSSS",
"(",
"final",
"double",
"s0",
",",
"final",
"double",
"s1",
",",
"final",
"double",
"s2",
")",
"{",
"return",
"Math",
".",
"acos",
"(",
"(",
"(",
"(",
"s0",
"*",
"s0",
")",
"+",
"(",
"s1",
"... | Returns the angle between s0 and s1
http://www.mathsisfun.com/algebra/trig-solving-sss-triangles.html
@param s0
@param s1
@param s2
@return | [
"Returns",
"the",
"angle",
"between",
"s0",
"and",
"s1",
"http",
":",
"//",
"www",
".",
"mathsisfun",
".",
"com",
"/",
"algebra",
"/",
"trig",
"-",
"solving",
"-",
"sss",
"-",
"triangles",
".",
"html"
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Geometry.java#L604-L607 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/EntityUtils.java | EntityUtils.spawnEjectedItem | public static void spawnEjectedItem(World world, BlockPos pos, ItemStack itemStack) {
"""
Eject a new item corresponding to the {@link ItemStack}.
@param world the world
@param pos the pos
@param itemStack the item stack
"""
if (itemStack == null || world.isRemote)
return;
float rx = world.rand.ne... | java | public static void spawnEjectedItem(World world, BlockPos pos, ItemStack itemStack)
{
if (itemStack == null || world.isRemote)
return;
float rx = world.rand.nextFloat() * 0.8F + 0.1F;
float ry = world.rand.nextFloat() * 0.8F + 0.1F;
float rz = world.rand.nextFloat() * 0.8F + 0.1F;
EntityItem entityItem ... | [
"public",
"static",
"void",
"spawnEjectedItem",
"(",
"World",
"world",
",",
"BlockPos",
"pos",
",",
"ItemStack",
"itemStack",
")",
"{",
"if",
"(",
"itemStack",
"==",
"null",
"||",
"world",
".",
"isRemote",
")",
"return",
";",
"float",
"rx",
"=",
"world",
... | Eject a new item corresponding to the {@link ItemStack}.
@param world the world
@param pos the pos
@param itemStack the item stack | [
"Eject",
"a",
"new",
"item",
"corresponding",
"to",
"the",
"{",
"@link",
"ItemStack",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/EntityUtils.java#L101-L118 |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/NumberParser.java | NumberParser.parseFloat | public static float parseFloat(final String str, final float def) {
"""
Parse a float from a String, with a default value
@param str
@param def the value to return if the String cannot be parsed
"""
final Float result = parseFloat(str);
if (result == null) {
return def;
... | java | public static float parseFloat(final String str, final float def) {
final Float result = parseFloat(str);
if (result == null) {
return def;
} else {
return result.floatValue();
}
} | [
"public",
"static",
"float",
"parseFloat",
"(",
"final",
"String",
"str",
",",
"final",
"float",
"def",
")",
"{",
"final",
"Float",
"result",
"=",
"parseFloat",
"(",
"str",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"return",
"def",
";",
... | Parse a float from a String, with a default value
@param str
@param def the value to return if the String cannot be parsed | [
"Parse",
"a",
"float",
"from",
"a",
"String",
"with",
"a",
"default",
"value"
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/NumberParser.java#L95-L102 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/dispatcher/DispatcherBase.java | DispatcherBase.obtainLongConfigParameter | protected static long obtainLongConfigParameter(MessageStoreImpl msi, String parameterName, String defaultValue, long minValue, long maxValue) {
"""
Obtains the value of a long integer configuration parameter given its name, the default value
and 'reasonable' minimum and maximum values.
@param msi The Message St... | java | protected static long obtainLongConfigParameter(MessageStoreImpl msi, String parameterName, String defaultValue, long minValue, long maxValue)
{
long value = Long.parseLong(defaultValue);
if (msi != null)
{
String strValue = msi.getProperty(parameterName, defaultValue);
... | [
"protected",
"static",
"long",
"obtainLongConfigParameter",
"(",
"MessageStoreImpl",
"msi",
",",
"String",
"parameterName",
",",
"String",
"defaultValue",
",",
"long",
"minValue",
",",
"long",
"maxValue",
")",
"{",
"long",
"value",
"=",
"Long",
".",
"parseLong",
... | Obtains the value of a long integer configuration parameter given its name, the default value
and 'reasonable' minimum and maximum values.
@param msi The Message Store instance to obtain the parameters (may be null)
@param parameterName The parameter's name
@param defaultValue The default value
@param minValue A reason... | [
"Obtains",
"the",
"value",
"of",
"a",
"long",
"integer",
"configuration",
"parameter",
"given",
"its",
"name",
"the",
"default",
"value",
"and",
"reasonable",
"minimum",
"and",
"maximum",
"values",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/dispatcher/DispatcherBase.java#L82-L114 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.readString | public static String readString(String path, Charset charset) throws IORuntimeException {
"""
读取文件内容
@param path 文件路径
@param charset 字符集
@return 内容
@throws IORuntimeException IO异常
"""
return readString(file(path), charset);
} | java | public static String readString(String path, Charset charset) throws IORuntimeException {
return readString(file(path), charset);
} | [
"public",
"static",
"String",
"readString",
"(",
"String",
"path",
",",
"Charset",
"charset",
")",
"throws",
"IORuntimeException",
"{",
"return",
"readString",
"(",
"file",
"(",
"path",
")",
",",
"charset",
")",
";",
"}"
] | 读取文件内容
@param path 文件路径
@param charset 字符集
@return 内容
@throws IORuntimeException IO异常 | [
"读取文件内容"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2126-L2128 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java | Apptentive.putRatingProviderArg | public static void putRatingProviderArg(String key, String value) {
"""
If there are any properties that your {@link IRatingProvider} implementation requires, populate them here. This
is not currently needed with the Google Play and Amazon Appstore IRatingProviders.
@param key A String
@param value A String... | java | public static void putRatingProviderArg(String key, String value) {
try {
if (ApptentiveInternal.isApptentiveRegistered()) {
ApptentiveInternal.getInstance().putRatingProviderArg(key, value);
}
} catch (Exception e) {
ApptentiveLog.e(CONVERSATION, e, "Exception while putting rating provider arg");
l... | [
"public",
"static",
"void",
"putRatingProviderArg",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"try",
"{",
"if",
"(",
"ApptentiveInternal",
".",
"isApptentiveRegistered",
"(",
")",
")",
"{",
"ApptentiveInternal",
".",
"getInstance",
"(",
")",
".",... | If there are any properties that your {@link IRatingProvider} implementation requires, populate them here. This
is not currently needed with the Google Play and Amazon Appstore IRatingProviders.
@param key A String
@param value A String | [
"If",
"there",
"are",
"any",
"properties",
"that",
"your",
"{",
"@link",
"IRatingProvider",
"}",
"implementation",
"requires",
"populate",
"them",
"here",
".",
"This",
"is",
"not",
"currently",
"needed",
"with",
"the",
"Google",
"Play",
"and",
"Amazon",
"Appst... | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java#L875-L884 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java | SourceToHTMLConverter.convertPackage | public void convertPackage(PackageDoc pd, DocPath outputdir) {
"""
Convert the Classes in the given Package to an HTML.
@param pd the Package to convert.
@param outputdir the name of the directory to output to.
"""
if (pd == null) {
return;
}
ClassDoc[] cds = pd.allClass... | java | public void convertPackage(PackageDoc pd, DocPath outputdir) {
if (pd == null) {
return;
}
ClassDoc[] cds = pd.allClasses();
for (int i = 0; i < cds.length; i++) {
// If -nodeprecated option is set and the class is marked as deprecated,
// do not conve... | [
"public",
"void",
"convertPackage",
"(",
"PackageDoc",
"pd",
",",
"DocPath",
"outputdir",
")",
"{",
"if",
"(",
"pd",
"==",
"null",
")",
"{",
"return",
";",
"}",
"ClassDoc",
"[",
"]",
"cds",
"=",
"pd",
".",
"allClasses",
"(",
")",
";",
"for",
"(",
"... | Convert the Classes in the given Package to an HTML.
@param pd the Package to convert.
@param outputdir the name of the directory to output to. | [
"Convert",
"the",
"Classes",
"in",
"the",
"given",
"Package",
"to",
"an",
"HTML",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java#L122-L135 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.Cosine | public static double Cosine(double[] p, double[] q) {
"""
Gets the Cosine distance between two points.
@param p A point in space.
@param q A point in space.
@return The Cosine distance between x and y.
"""
double sumProduct = 0;
double sumP = 0, sumQ = 0;
for (int i = 0; i < p.len... | java | public static double Cosine(double[] p, double[] q) {
double sumProduct = 0;
double sumP = 0, sumQ = 0;
for (int i = 0; i < p.length; i++) {
sumProduct += p[i] * q[i];
sumP += Math.pow(Math.abs(p[i]), 2);
sumQ += Math.pow(Math.abs(q[i]), 2);
}
... | [
"public",
"static",
"double",
"Cosine",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"sumProduct",
"=",
"0",
";",
"double",
"sumP",
"=",
"0",
",",
"sumQ",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Gets the Cosine distance between two points.
@param p A point in space.
@param q A point in space.
@return The Cosine distance between x and y. | [
"Gets",
"the",
"Cosine",
"distance",
"between",
"two",
"points",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L317-L333 |
SeunMatt/mysql-backup4j | src/main/java/com/smattme/EmailService.java | EmailService.sendMail | boolean sendMail() {
"""
This function will send an email
and add the generated sql file as an attachment
@return boolean
"""
if(!this.isPropertiesSet()) {
logger.debug(LOG_PREFIX + ": Required Mail Properties are not set. Attachments will not be sent");
return false;
... | java | boolean sendMail() {
if(!this.isPropertiesSet()) {
logger.debug(LOG_PREFIX + ": Required Mail Properties are not set. Attachments will not be sent");
return false;
}
Properties prop = new Properties();
prop.put("mail.smtp.auth", true);
prop.put(... | [
"boolean",
"sendMail",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"isPropertiesSet",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"LOG_PREFIX",
"+",
"\": Required Mail Properties are not set. Attachments will not be sent\"",
")",
";",
"return",
"false",
";",
... | This function will send an email
and add the generated sql file as an attachment
@return boolean | [
"This",
"function",
"will",
"send",
"an",
"email",
"and",
"add",
"the",
"generated",
"sql",
"file",
"as",
"an",
"attachment"
] | train | https://github.com/SeunMatt/mysql-backup4j/blob/7e31aac33fe63948d4ad64a053394759457da636/src/main/java/com/smattme/EmailService.java#L112-L176 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.asType | @SuppressWarnings("unchecked")
public static <T> T asType(File f, Class<T> c) {
"""
Converts this File to a {@link groovy.lang.Writable} or delegates to default
{@link DefaultGroovyMethods#asType(java.lang.Object, java.lang.Class)}.
@param f a File
@param c the desired class
@return the converted object
... | java | @SuppressWarnings("unchecked")
public static <T> T asType(File f, Class<T> c) {
if (c == Writable.class) {
return (T) asWritable(f);
}
return DefaultGroovyMethods.asType((Object) f, c);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"asType",
"(",
"File",
"f",
",",
"Class",
"<",
"T",
">",
"c",
")",
"{",
"if",
"(",
"c",
"==",
"Writable",
".",
"class",
")",
"{",
"return",
"(",
"T",
")",... | Converts this File to a {@link groovy.lang.Writable} or delegates to default
{@link DefaultGroovyMethods#asType(java.lang.Object, java.lang.Class)}.
@param f a File
@param c the desired class
@return the converted object
@since 1.0 | [
"Converts",
"this",
"File",
"to",
"a",
"{",
"@link",
"groovy",
".",
"lang",
".",
"Writable",
"}",
"or",
"delegates",
"to",
"default",
"{",
"@link",
"DefaultGroovyMethods#asType",
"(",
"java",
".",
"lang",
".",
"Object",
"java",
".",
"lang",
".",
"Class",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1711-L1717 |
google/closure-compiler | src/com/google/javascript/jscomp/modules/Binding.java | Binding.copy | Binding copy(Node sourceNode, CreatedBy createdBy) {
"""
Copies the binding with a new source node and CreatedBy binding.
"""
checkNotNull(sourceNode);
return new AutoValue_Binding(
metadata(),
sourceNode,
originatingExport(),
isModuleNamespace(),
closureNamespa... | java | Binding copy(Node sourceNode, CreatedBy createdBy) {
checkNotNull(sourceNode);
return new AutoValue_Binding(
metadata(),
sourceNode,
originatingExport(),
isModuleNamespace(),
closureNamespace(),
createdBy);
} | [
"Binding",
"copy",
"(",
"Node",
"sourceNode",
",",
"CreatedBy",
"createdBy",
")",
"{",
"checkNotNull",
"(",
"sourceNode",
")",
";",
"return",
"new",
"AutoValue_Binding",
"(",
"metadata",
"(",
")",
",",
"sourceNode",
",",
"originatingExport",
"(",
")",
",",
"... | Copies the binding with a new source node and CreatedBy binding. | [
"Copies",
"the",
"binding",
"with",
"a",
"new",
"source",
"node",
"and",
"CreatedBy",
"binding",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/modules/Binding.java#L131-L141 |
michel-kraemer/gradle-download-task | src/main/java/de/undercouch/gradle/tasks/download/DownloadAction.java | DownloadAction.makeDestFile | private File makeDestFile(URL src) {
"""
Generates the path to an output file for a given source URL. Creates
all necessary parent directories for the destination file.
@param src the source
@return the path to the output file
"""
if (dest == null) {
throw new IllegalArgumentException("P... | java | private File makeDestFile(URL src) {
if (dest == null) {
throw new IllegalArgumentException("Please provide a download destination");
}
File destFile = dest;
if (destFile.isDirectory()) {
//guess name from URL
String name = src.toString();
... | [
"private",
"File",
"makeDestFile",
"(",
"URL",
"src",
")",
"{",
"if",
"(",
"dest",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Please provide a download destination\"",
")",
";",
"}",
"File",
"destFile",
"=",
"dest",
";",
"if",
... | Generates the path to an output file for a given source URL. Creates
all necessary parent directories for the destination file.
@param src the source
@return the path to the output file | [
"Generates",
"the",
"path",
"to",
"an",
"output",
"file",
"for",
"a",
"given",
"source",
"URL",
".",
"Creates",
"all",
"necessary",
"parent",
"directories",
"for",
"the",
"destination",
"file",
"."
] | train | https://github.com/michel-kraemer/gradle-download-task/blob/a20c7f29c15ccb699700518f860373692148e3fc/src/main/java/de/undercouch/gradle/tasks/download/DownloadAction.java#L517-L539 |
nikolavp/approval | approval-core/src/main/java/com/github/approval/reporters/Reporters.java | Reporters.autoApprove | public Reporter autoApprove() {
"""
A reporter that auto approves every value passed to it.
<p>
This is especially useful when you are making a big change and want to
auto approve a lot of things. You can then use your version control
system(you are using one of those right?) to see a diff
</p>
@return the... | java | public Reporter autoApprove() {
return new Reporter() {
@Override
public void notTheSame(byte[] oldValue, File fileForVerification, byte[] newValue, File fileForApproval) {
autoApprove(fileForVerification, fileForApproval);
}
@Override
... | [
"public",
"Reporter",
"autoApprove",
"(",
")",
"{",
"return",
"new",
"Reporter",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"notTheSame",
"(",
"byte",
"[",
"]",
"oldValue",
",",
"File",
"fileForVerification",
",",
"byte",
"[",
"]",
"newValue",
",",
... | A reporter that auto approves every value passed to it.
<p>
This is especially useful when you are making a big change and want to
auto approve a lot of things. You can then use your version control
system(you are using one of those right?) to see a diff
</p>
@return the auto approving reporter | [
"A",
"reporter",
"that",
"auto",
"approves",
"every",
"value",
"passed",
"to",
"it",
".",
"<p",
">",
"This",
"is",
"especially",
"useful",
"when",
"you",
"are",
"making",
"a",
"big",
"change",
"and",
"want",
"to",
"auto",
"approve",
"a",
"lot",
"of",
"... | train | https://github.com/nikolavp/approval/blob/5e32ecc3bc7f631e94a7049894fdd99a3aa5b1b8/approval-core/src/main/java/com/github/approval/reporters/Reporters.java#L236-L261 |
couchbase/CouchbaseMock | src/main/java/com/couchbase/mock/CouchbaseMock.java | CouchbaseMock.startHarakiriMonitor | public void startHarakiriMonitor(InetSocketAddress address, boolean terminate) throws IOException {
"""
Tell the harakiri monitor to connect to the given address.
@param address The address the monitor should connect to
@param terminate Whether the application should exit when a disconnect is detected on the soc... | java | public void startHarakiriMonitor(InetSocketAddress address, boolean terminate) throws IOException {
if (terminate) {
harakiriMonitor.setTemrinateAction(new Callable() {
@Override
public Object call() throws Exception {
System.exit(1);
... | [
"public",
"void",
"startHarakiriMonitor",
"(",
"InetSocketAddress",
"address",
",",
"boolean",
"terminate",
")",
"throws",
"IOException",
"{",
"if",
"(",
"terminate",
")",
"{",
"harakiriMonitor",
".",
"setTemrinateAction",
"(",
"new",
"Callable",
"(",
")",
"{",
... | Tell the harakiri monitor to connect to the given address.
@param address The address the monitor should connect to
@param terminate Whether the application should exit when a disconnect is detected on the socket
@throws IOException If the monitor could not listen on the given port, or if the monitor is already listeni... | [
"Tell",
"the",
"harakiri",
"monitor",
"to",
"connect",
"to",
"the",
"given",
"address",
"."
] | train | https://github.com/couchbase/CouchbaseMock/blob/2085bbebade1d5b6356480e7bf335139d08383da/src/main/java/com/couchbase/mock/CouchbaseMock.java#L90-L103 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getTagWithServiceResponseAsync | public Observable<ServiceResponse<Tag>> getTagWithServiceResponseAsync(UUID projectId, UUID tagId, GetTagOptionalParameter getTagOptionalParameter) {
"""
Get information about a specific tag.
@param projectId The project this tag belongs to
@param tagId The tag id
@param getTagOptionalParameter the object rep... | java | public Observable<ServiceResponse<Tag>> getTagWithServiceResponseAsync(UUID projectId, UUID tagId, GetTagOptionalParameter getTagOptionalParameter) {
if (projectId == null) {
throw new IllegalArgumentException("Parameter projectId is required and cannot be null.");
}
if (tagId == nul... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Tag",
">",
">",
"getTagWithServiceResponseAsync",
"(",
"UUID",
"projectId",
",",
"UUID",
"tagId",
",",
"GetTagOptionalParameter",
"getTagOptionalParameter",
")",
"{",
"if",
"(",
"projectId",
"==",
"null",
")",
... | Get information about a specific tag.
@param projectId The project this tag belongs to
@param tagId The tag id
@param getTagOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observabl... | [
"Get",
"information",
"about",
"a",
"specific",
"tag",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L822-L835 |
spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/endpoint/DefaultRedirectResolver.java | DefaultRedirectResolver.redirectMatches | protected boolean redirectMatches(String requestedRedirect, String redirectUri) {
"""
Whether the requested redirect URI "matches" the specified redirect URI. For a URL, this implementation tests if
the user requested redirect starts with the registered redirect, so it would have the same host and root path if
i... | java | protected boolean redirectMatches(String requestedRedirect, String redirectUri) {
UriComponents requestedRedirectUri = UriComponentsBuilder.fromUriString(requestedRedirect).build();
UriComponents registeredRedirectUri = UriComponentsBuilder.fromUriString(redirectUri).build();
boolean schemeMatch = isEqual(regist... | [
"protected",
"boolean",
"redirectMatches",
"(",
"String",
"requestedRedirect",
",",
"String",
"redirectUri",
")",
"{",
"UriComponents",
"requestedRedirectUri",
"=",
"UriComponentsBuilder",
".",
"fromUriString",
"(",
"requestedRedirect",
")",
".",
"build",
"(",
")",
";... | Whether the requested redirect URI "matches" the specified redirect URI. For a URL, this implementation tests if
the user requested redirect starts with the registered redirect, so it would have the same host and root path if
it is an HTTP URL. The port, userinfo, query params also matched. Request redirect uri path ca... | [
"Whether",
"the",
"requested",
"redirect",
"URI",
"matches",
"the",
"specified",
"redirect",
"URI",
".",
"For",
"a",
"URL",
"this",
"implementation",
"tests",
"if",
"the",
"user",
"requested",
"redirect",
"starts",
"with",
"the",
"registered",
"redirect",
"so",
... | train | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/endpoint/DefaultRedirectResolver.java#L120-L134 |
Frostman/dropbox4j | src/main/java/ru/frostman/dropbox/api/DropboxClient.java | DropboxClient.getMetadata | public Entry getMetadata(String path, int fileLimit, @Nullable String hash) {
"""
Returns metadata information about specified resource with
checking for its hash with specified max child entries count.
If nothing changes (hash isn't changed) then 304 will returns.
@param path to file or directory
@para... | java | public Entry getMetadata(String path, int fileLimit, @Nullable String hash) {
return getMetadata(path, fileLimit, hash, true);
} | [
"public",
"Entry",
"getMetadata",
"(",
"String",
"path",
",",
"int",
"fileLimit",
",",
"@",
"Nullable",
"String",
"hash",
")",
"{",
"return",
"getMetadata",
"(",
"path",
",",
"fileLimit",
",",
"hash",
",",
"true",
")",
";",
"}"
] | Returns metadata information about specified resource with
checking for its hash with specified max child entries count.
If nothing changes (hash isn't changed) then 304 will returns.
@param path to file or directory
@param fileLimit max child entries count
@param hash to check smth changed
@return metadata... | [
"Returns",
"metadata",
"information",
"about",
"specified",
"resource",
"with",
"checking",
"for",
"its",
"hash",
"with",
"specified",
"max",
"child",
"entries",
"count",
".",
"If",
"nothing",
"changes",
"(",
"hash",
"isn",
"t",
"changed",
")",
"then",
"304",
... | train | https://github.com/Frostman/dropbox4j/blob/774c817e5bf294d0139ecb5ac81399be50ada5e0/src/main/java/ru/frostman/dropbox/api/DropboxClient.java#L150-L152 |
mikereedell/sunrisesunsetlib-java | src/main/java/com/luckycatlabs/sunrisesunset/calculator/SolarEventCalculator.java | SolarEventCalculator.getLongitudeHour | private BigDecimal getLongitudeHour(Calendar date, Boolean isSunrise) {
"""
Computes the longitude time, t in the algorithm.
@return longitudinal time in <code>BigDecimal</code> form.
"""
int offset = 18;
if (isSunrise) {
offset = 6;
}
BigDecimal dividend = BigDec... | java | private BigDecimal getLongitudeHour(Calendar date, Boolean isSunrise) {
int offset = 18;
if (isSunrise) {
offset = 6;
}
BigDecimal dividend = BigDecimal.valueOf(offset).subtract(getBaseLongitudeHour());
BigDecimal addend = divideBy(dividend, BigDecimal.valueOf(24));
... | [
"private",
"BigDecimal",
"getLongitudeHour",
"(",
"Calendar",
"date",
",",
"Boolean",
"isSunrise",
")",
"{",
"int",
"offset",
"=",
"18",
";",
"if",
"(",
"isSunrise",
")",
"{",
"offset",
"=",
"6",
";",
"}",
"BigDecimal",
"dividend",
"=",
"BigDecimal",
".",
... | Computes the longitude time, t in the algorithm.
@return longitudinal time in <code>BigDecimal</code> form. | [
"Computes",
"the",
"longitude",
"time",
"t",
"in",
"the",
"algorithm",
"."
] | train | https://github.com/mikereedell/sunrisesunsetlib-java/blob/6e6de23f1d11429eef58de2541582cbde9b85b92/src/main/java/com/luckycatlabs/sunrisesunset/calculator/SolarEventCalculator.java#L148-L157 |
Bedework/bw-util | bw-util-misc/src/main/java/org/bedework/util/misc/Util.java | Util.equalsString | public static boolean equalsString(final String thisStr, final String thatStr) {
"""
Return true if Strings are equal including possible null
@param thisStr
@param thatStr
@return boolean true for equal
"""
if ((thisStr == null) && (thatStr == null)) {
return true;
}
if (thisStr == null... | java | public static boolean equalsString(final String thisStr, final String thatStr) {
if ((thisStr == null) && (thatStr == null)) {
return true;
}
if (thisStr == null) {
return false;
}
return thisStr.equals(thatStr);
} | [
"public",
"static",
"boolean",
"equalsString",
"(",
"final",
"String",
"thisStr",
",",
"final",
"String",
"thatStr",
")",
"{",
"if",
"(",
"(",
"thisStr",
"==",
"null",
")",
"&&",
"(",
"thatStr",
"==",
"null",
")",
")",
"{",
"return",
"true",
";",
"}",
... | Return true if Strings are equal including possible null
@param thisStr
@param thatStr
@return boolean true for equal | [
"Return",
"true",
"if",
"Strings",
"are",
"equal",
"including",
"possible",
"null"
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-misc/src/main/java/org/bedework/util/misc/Util.java#L623-L633 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java | InodeLockList.lockInodeInternal | private void lockInodeInternal(Inode inode, LockMode mode) {
"""
Locks the next inode without checking or updating the mode.
@param inode the inode to lock
@param mode the mode to lock in
"""
Preconditions.checkState(!endsInInode());
String lastEdgeName = ((EdgeEntry) lastEntry()).getEdge().getName... | java | private void lockInodeInternal(Inode inode, LockMode mode) {
Preconditions.checkState(!endsInInode());
String lastEdgeName = ((EdgeEntry) lastEntry()).getEdge().getName();
Preconditions.checkState(inode.getName().equals(lastEdgeName),
"Expected to lock inode %s but locked inode %s", lastEdgeName, in... | [
"private",
"void",
"lockInodeInternal",
"(",
"Inode",
"inode",
",",
"LockMode",
"mode",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"!",
"endsInInode",
"(",
")",
")",
";",
"String",
"lastEdgeName",
"=",
"(",
"(",
"EdgeEntry",
")",
"lastEntry",
"(",
... | Locks the next inode without checking or updating the mode.
@param inode the inode to lock
@param mode the mode to lock in | [
"Locks",
"the",
"next",
"inode",
"without",
"checking",
"or",
"updating",
"the",
"mode",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java#L91-L99 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/Delete.java | Delete.withExpressionAttributeNames | public Delete withExpressionAttributeNames(java.util.Map<String, String> expressionAttributeNames) {
"""
<p>
One or more substitution tokens for attribute names in an expression.
</p>
@param expressionAttributeNames
One or more substitution tokens for attribute names in an expression.
@return Returns a refe... | java | public Delete withExpressionAttributeNames(java.util.Map<String, String> expressionAttributeNames) {
setExpressionAttributeNames(expressionAttributeNames);
return this;
} | [
"public",
"Delete",
"withExpressionAttributeNames",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"expressionAttributeNames",
")",
"{",
"setExpressionAttributeNames",
"(",
"expressionAttributeNames",
")",
";",
"return",
"this",
";",
"}"
] | <p>
One or more substitution tokens for attribute names in an expression.
</p>
@param expressionAttributeNames
One or more substitution tokens for attribute names in an expression.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"One",
"or",
"more",
"substitution",
"tokens",
"for",
"attribute",
"names",
"in",
"an",
"expression",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/Delete.java#L252-L255 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java | AbstractJsonDeserializer.getDateParam | protected Date getDateParam(String paramName, String errorMessage) throws IOException {
"""
Parses a date from either dd/MM/yyyy or yyyy-MM-dd format. Uses the default parameter inputmap.
@param paramName the name of the parameter containing the date
@param errorMessage the message to put in an error if one... | java | protected Date getDateParam(String paramName, String errorMessage) throws IOException {
return getDateParam(paramName, errorMessage, (Map<String, Object>) inputParams.get());
} | [
"protected",
"Date",
"getDateParam",
"(",
"String",
"paramName",
",",
"String",
"errorMessage",
")",
"throws",
"IOException",
"{",
"return",
"getDateParam",
"(",
"paramName",
",",
"errorMessage",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"inputP... | Parses a date from either dd/MM/yyyy or yyyy-MM-dd format. Uses the default parameter inputmap.
@param paramName the name of the parameter containing the date
@param errorMessage the message to put in an error if one occurs
@return a date object correcponding with the jsonobject
@throws IOException If something wen... | [
"Parses",
"a",
"date",
"from",
"either",
"dd",
"/",
"MM",
"/",
"yyyy",
"or",
"yyyy",
"-",
"MM",
"-",
"dd",
"format",
".",
"Uses",
"the",
"default",
"parameter",
"inputmap",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java#L391-L393 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/impl/BatchKernelImpl.java | BatchKernelImpl.publishEvent | private void publishEvent(WSJobInstance objectToPublish, String eventToPublishTo, String correlationId) {
"""
Publish jms topic if batch jms event is available
@param objectToPublish WSJobInstance
@param eventToPublish
"""
if (eventsPublisher != null) {
eventsPublisher.publishJobInstanc... | java | private void publishEvent(WSJobInstance objectToPublish, String eventToPublishTo, String correlationId) {
if (eventsPublisher != null) {
eventsPublisher.publishJobInstanceEvent(objectToPublish, eventToPublishTo, correlationId);
}
} | [
"private",
"void",
"publishEvent",
"(",
"WSJobInstance",
"objectToPublish",
",",
"String",
"eventToPublishTo",
",",
"String",
"correlationId",
")",
"{",
"if",
"(",
"eventsPublisher",
"!=",
"null",
")",
"{",
"eventsPublisher",
".",
"publishJobInstanceEvent",
"(",
"ob... | Publish jms topic if batch jms event is available
@param objectToPublish WSJobInstance
@param eventToPublish | [
"Publish",
"jms",
"topic",
"if",
"batch",
"jms",
"event",
"is",
"available"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/impl/BatchKernelImpl.java#L306-L310 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPFriendlyURLEntryPersistenceImpl.java | CPFriendlyURLEntryPersistenceImpl.findByG_C_U | @Override
public List<CPFriendlyURLEntry> findByG_C_U(long groupId, long classNameId,
String urlTitle, int start, int end) {
"""
Returns a range of all the cp friendly url entries where groupId = ? and classNameId = ? and urlTitle = ?.
<p>
Useful when paginating results. Returns a maximum of <co... | java | @Override
public List<CPFriendlyURLEntry> findByG_C_U(long groupId, long classNameId,
String urlTitle, int start, int end) {
return findByG_C_U(groupId, classNameId, urlTitle, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPFriendlyURLEntry",
">",
"findByG_C_U",
"(",
"long",
"groupId",
",",
"long",
"classNameId",
",",
"String",
"urlTitle",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByG_C_U",
"(",
"groupId",
",",
... | Returns a range of all the cp friendly url entries where groupId = ? and classNameId = ? and urlTitle = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <co... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"friendly",
"url",
"entries",
"where",
"groupId",
"=",
"?",
";",
"and",
"classNameId",
"=",
"?",
";",
"and",
"urlTitle",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPFriendlyURLEntryPersistenceImpl.java#L2687-L2691 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.suppressMethod | @Deprecated
public static synchronized void suppressMethod(Class<?> clazz, String[] methodNames) {
"""
Suppress multiple methods for a class.
@param clazz The class whose methods will be suppressed.
@param methodNames Methods to suppress in class {@code clazz}.
@deprecated Use {@link #suppress(Metho... | java | @Deprecated
public static synchronized void suppressMethod(Class<?> clazz, String[] methodNames) {
SuppressCode.suppressMethod(clazz, methodNames);
} | [
"@",
"Deprecated",
"public",
"static",
"synchronized",
"void",
"suppressMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"[",
"]",
"methodNames",
")",
"{",
"SuppressCode",
".",
"suppressMethod",
"(",
"clazz",
",",
"methodNames",
")",
";",
"}"
] | Suppress multiple methods for a class.
@param clazz The class whose methods will be suppressed.
@param methodNames Methods to suppress in class {@code clazz}.
@deprecated Use {@link #suppress(Method[])} instead. | [
"Suppress",
"multiple",
"methods",
"for",
"a",
"class",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L1890-L1893 |
jmeetsma/Iglu-Http | src/main/java/org/ijsberg/iglu/server/http/filter/WebAppEntryPoint.java | WebAppEntryPoint.storeSessionDataInCookie | public static void storeSessionDataInCookie(String key, String value, ServletResponse response) {
"""
Stores session id in the root of a cookie
The cookie will expire as soon as the browser closes
@param key
@param value
@param response
"""
Cookie cookie = new Cookie(key, value);
cookie.setPath("/");... | java | public static void storeSessionDataInCookie(String key, String value, ServletResponse response)
{
Cookie cookie = new Cookie(key, value);
cookie.setPath("/");
cookie.setMaxAge(-1);//expire when browser closes
((HttpServletResponse) response).addCookie(cookie);
} | [
"public",
"static",
"void",
"storeSessionDataInCookie",
"(",
"String",
"key",
",",
"String",
"value",
",",
"ServletResponse",
"response",
")",
"{",
"Cookie",
"cookie",
"=",
"new",
"Cookie",
"(",
"key",
",",
"value",
")",
";",
"cookie",
".",
"setPath",
"(",
... | Stores session id in the root of a cookie
The cookie will expire as soon as the browser closes
@param key
@param value
@param response | [
"Stores",
"session",
"id",
"in",
"the",
"root",
"of",
"a",
"cookie",
"The",
"cookie",
"will",
"expire",
"as",
"soon",
"as",
"the",
"browser",
"closes"
] | train | https://github.com/jmeetsma/Iglu-Http/blob/5b5ed3b417285dc79b7aa013bf2340bb5ba1ffbe/src/main/java/org/ijsberg/iglu/server/http/filter/WebAppEntryPoint.java#L162-L168 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.serviceName_configurations_obfuscatedEmails_PUT | public ArrayList<OvhObfuscatedEmails> serviceName_configurations_obfuscatedEmails_PUT(String serviceName, OvhContactAllTypesEnum[] contacts) throws IOException {
"""
Save a new obfuscated emails configuration
REST: PUT /domain/{serviceName}/configurations/obfuscatedEmails
@param contacts [required] Contact typ... | java | public ArrayList<OvhObfuscatedEmails> serviceName_configurations_obfuscatedEmails_PUT(String serviceName, OvhContactAllTypesEnum[] contacts) throws IOException {
String qPath = "/domain/{serviceName}/configurations/obfuscatedEmails";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new Hash... | [
"public",
"ArrayList",
"<",
"OvhObfuscatedEmails",
">",
"serviceName_configurations_obfuscatedEmails_PUT",
"(",
"String",
"serviceName",
",",
"OvhContactAllTypesEnum",
"[",
"]",
"contacts",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/{serviceName}/... | Save a new obfuscated emails configuration
REST: PUT /domain/{serviceName}/configurations/obfuscatedEmails
@param contacts [required] Contact types where obfuscated emails can be activated
@param serviceName [required] The internal name of your domain | [
"Save",
"a",
"new",
"obfuscated",
"emails",
"configuration"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L1591-L1598 |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java | Utils.addToListIfNotExists | public static void addToListIfNotExists(List<String> list, String value) {
"""
Adds a value to the list if does not already exists.
@param list the list
@param value value to add if not exists in the list
"""
boolean found = false;
for (String item : list) {
if (item.equalsIgnor... | java | public static void addToListIfNotExists(List<String> list, String value) {
boolean found = false;
for (String item : list) {
if (item.equalsIgnoreCase(value)) {
found = true;
break;
}
}
if (!found) {
list.add(value);
... | [
"public",
"static",
"void",
"addToListIfNotExists",
"(",
"List",
"<",
"String",
">",
"list",
",",
"String",
"value",
")",
"{",
"boolean",
"found",
"=",
"false",
";",
"for",
"(",
"String",
"item",
":",
"list",
")",
"{",
"if",
"(",
"item",
".",
"equalsIg... | Adds a value to the list if does not already exists.
@param list the list
@param value value to add if not exists in the list | [
"Adds",
"a",
"value",
"to",
"the",
"list",
"if",
"does",
"not",
"already",
"exists",
"."
] | train | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java#L173-L184 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java | PvmExecutionImpl.startWithoutExecuting | public void startWithoutExecuting(Map<String, Object> variables) {
"""
perform starting behavior but don't execute the initial activity
@param variables the variables which are used for the start
"""
initialize();
initializeTimerDeclarations();
fireHistoricProcessStartEvent();
performOperati... | java | public void startWithoutExecuting(Map<String, Object> variables) {
initialize();
initializeTimerDeclarations();
fireHistoricProcessStartEvent();
performOperation(PvmAtomicOperation.FIRE_PROCESS_START);
setActivity(null);
setActivityInstanceId(getId());
// set variables
setVariables(var... | [
"public",
"void",
"startWithoutExecuting",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"variables",
")",
"{",
"initialize",
"(",
")",
";",
"initializeTimerDeclarations",
"(",
")",
";",
"fireHistoricProcessStartEvent",
"(",
")",
";",
"performOperation",
"(",
"... | perform starting behavior but don't execute the initial activity
@param variables the variables which are used for the start | [
"perform",
"starting",
"behavior",
"but",
"don",
"t",
"execute",
"the",
"initial",
"activity"
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java#L255-L266 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/LogFaxClientSpiInterceptor.java | LogFaxClientSpiInterceptor.postMethodInvocation | public final void postMethodInvocation(Method method,Object[] arguments,Object output) {
"""
This function is invoked by the fax client SPI proxy after invoking
the method in the fax client SPI itself.
@param method
The method invoked
@param arguments
The method arguments
@param output
The method ou... | java | public final void postMethodInvocation(Method method,Object[] arguments,Object output)
{
this.logEvent(FaxClientSpiProxyEventType.POST_EVENT_TYPE,method,arguments,output,null);
} | [
"public",
"final",
"void",
"postMethodInvocation",
"(",
"Method",
"method",
",",
"Object",
"[",
"]",
"arguments",
",",
"Object",
"output",
")",
"{",
"this",
".",
"logEvent",
"(",
"FaxClientSpiProxyEventType",
".",
"POST_EVENT_TYPE",
",",
"method",
",",
"argument... | This function is invoked by the fax client SPI proxy after invoking
the method in the fax client SPI itself.
@param method
The method invoked
@param arguments
The method arguments
@param output
The method output | [
"This",
"function",
"is",
"invoked",
"by",
"the",
"fax",
"client",
"SPI",
"proxy",
"after",
"invoking",
"the",
"method",
"in",
"the",
"fax",
"client",
"SPI",
"itself",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/LogFaxClientSpiInterceptor.java#L175-L178 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/AnalyticsContext.java | AnalyticsContext.putDevice | void putDevice(Context context, boolean collectDeviceID) {
"""
Fill this instance with device info from the provided {@link Context}.
"""
Device device = new Device();
String identifier = collectDeviceID ? getDeviceId(context) : traits().anonymousId();
device.put(Device.DEVICE_ID_KEY, identifier);
... | java | void putDevice(Context context, boolean collectDeviceID) {
Device device = new Device();
String identifier = collectDeviceID ? getDeviceId(context) : traits().anonymousId();
device.put(Device.DEVICE_ID_KEY, identifier);
device.put(Device.DEVICE_MANUFACTURER_KEY, Build.MANUFACTURER);
device.put(Devic... | [
"void",
"putDevice",
"(",
"Context",
"context",
",",
"boolean",
"collectDeviceID",
")",
"{",
"Device",
"device",
"=",
"new",
"Device",
"(",
")",
";",
"String",
"identifier",
"=",
"collectDeviceID",
"?",
"getDeviceId",
"(",
"context",
")",
":",
"traits",
"(",... | Fill this instance with device info from the provided {@link Context}. | [
"Fill",
"this",
"instance",
"with",
"device",
"info",
"from",
"the",
"provided",
"{"
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/AnalyticsContext.java#L228-L236 |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/freemarker/Util.java | Util.validateParamsPresence | protected static void validateParamsPresence(Map params, String... keys) {
"""
Will throw {@link IllegalArgumentException} if a key in the map is missing.
If a map does nto have all the passed in keys in it, this method will throw exception.
@param params map with values
@param keys list of keys to check
... | java | protected static void validateParamsPresence(Map params, String... keys) {
for (String name : keys) {
if (!params.containsKey(name)) {
throw new IllegalArgumentException("parameter: '" + name + "' is missing");
}
}
} | [
"protected",
"static",
"void",
"validateParamsPresence",
"(",
"Map",
"params",
",",
"String",
"...",
"keys",
")",
"{",
"for",
"(",
"String",
"name",
":",
"keys",
")",
"{",
"if",
"(",
"!",
"params",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"throw... | Will throw {@link IllegalArgumentException} if a key in the map is missing.
If a map does nto have all the passed in keys in it, this method will throw exception.
@param params map with values
@param keys list of keys to check | [
"Will",
"throw",
"{",
"@link",
"IllegalArgumentException",
"}",
"if",
"a",
"key",
"in",
"the",
"map",
"is",
"missing",
".",
"If",
"a",
"map",
"does",
"nto",
"have",
"all",
"the",
"passed",
"in",
"keys",
"in",
"it",
"this",
"method",
"will",
"throw",
"e... | train | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/freemarker/Util.java#L35-L41 |
BigBadaboom/androidsvg | androidsvg/src/main/java/com/caverock/androidsvg/SimpleAssetResolver.java | SimpleAssetResolver.getAssetAsString | private String getAssetAsString(String url) {
"""
/*
Read the contents of the asset whose name is given by "url" and return it as a String.
"""
InputStream is = null;
try
{
is = assetManager.open(url);
Reader r = new InputStreamReader(is, Charset.forName("UTF-8"));
... | java | private String getAssetAsString(String url)
{
InputStream is = null;
try
{
is = assetManager.open(url);
Reader r = new InputStreamReader(is, Charset.forName("UTF-8"));
char[] buffer = new char[4096];
StringBuilder sb = new StringBuilder();
... | [
"private",
"String",
"getAssetAsString",
"(",
"String",
"url",
")",
"{",
"InputStream",
"is",
"=",
"null",
";",
"try",
"{",
"is",
"=",
"assetManager",
".",
"open",
"(",
"url",
")",
";",
"Reader",
"r",
"=",
"new",
"InputStreamReader",
"(",
"is",
",",
"C... | /*
Read the contents of the asset whose name is given by "url" and return it as a String. | [
"/",
"*",
"Read",
"the",
"contents",
"of",
"the",
"asset",
"whose",
"name",
"is",
"given",
"by",
"url",
"and",
"return",
"it",
"as",
"a",
"String",
"."
] | train | https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SimpleAssetResolver.java#L148-L177 |
jenkinsci/jenkins | core/src/main/java/hudson/scm/RepositoryBrowsers.java | RepositoryBrowsers.createInstance | @Deprecated
public static <T extends RepositoryBrowser>
T createInstance(Class<T> type, StaplerRequest req, String fieldName) throws FormException {
"""
Creates an instance of {@link RepositoryBrowser} from a form submission.
@deprecated since 2008-06-19.
Use {@link #createInstance(Class, StaplerReques... | java | @Deprecated
public static <T extends RepositoryBrowser>
T createInstance(Class<T> type, StaplerRequest req, String fieldName) throws FormException {
List<Descriptor<RepositoryBrowser<?>>> list = filter(type);
String value = req.getParameter(fieldName);
if(value==null || value.equals("aut... | [
"@",
"Deprecated",
"public",
"static",
"<",
"T",
"extends",
"RepositoryBrowser",
">",
"T",
"createInstance",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"StaplerRequest",
"req",
",",
"String",
"fieldName",
")",
"throws",
"FormException",
"{",
"List",
"<",
"Des... | Creates an instance of {@link RepositoryBrowser} from a form submission.
@deprecated since 2008-06-19.
Use {@link #createInstance(Class, StaplerRequest, JSONObject, String)}. | [
"Creates",
"an",
"instance",
"of",
"{",
"@link",
"RepositoryBrowser",
"}",
"from",
"a",
"form",
"submission",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scm/RepositoryBrowsers.java#L69-L81 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.unescapeUriPath | public static void unescapeUriPath(final Reader reader, final Writer writer, final String encoding)
throws IOException {
"""
<p>
Perform am URI path <strong>unescape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
This method will unescape every percen... | java | public static void unescapeUriPath(final Reader reader, final Writer writer, final String encoding)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
if (encoding == null) {
throw new Illegal... | [
"public",
"static",
"void",
"unescapeUriPath",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
",",
"final",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArg... | <p>
Perform am URI path <strong>unescape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input,
even for those characters that do not need to be percent-encoded in this context (unreserved c... | [
"<p",
">",
"Perform",
"am",
"URI",
"path",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"Writer<",
"/",
"tt",
">",
".",
"<",
"/... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L2143-L2156 |
eBay/xcelite | src/main/java/com/ebay/xcelite/Xcelite.java | Xcelite.getSheet | public XceliteSheet getSheet(String sheetName) {
"""
Gets the sheet with the specified index.
@param sheetIndex the sheet name
@return XceliteSheet object
"""
Sheet sheet = workbook.getSheet(sheetName);
if (sheet == null) {
throw new XceliteException(String.format("Could not find sheet nam... | java | public XceliteSheet getSheet(String sheetName) {
Sheet sheet = workbook.getSheet(sheetName);
if (sheet == null) {
throw new XceliteException(String.format("Could not find sheet named \"%s\"", sheetName));
}
return new XceliteSheetImpl(sheet, file);
} | [
"public",
"XceliteSheet",
"getSheet",
"(",
"String",
"sheetName",
")",
"{",
"Sheet",
"sheet",
"=",
"workbook",
".",
"getSheet",
"(",
"sheetName",
")",
";",
"if",
"(",
"sheet",
"==",
"null",
")",
"{",
"throw",
"new",
"XceliteException",
"(",
"String",
".",
... | Gets the sheet with the specified index.
@param sheetIndex the sheet name
@return XceliteSheet object | [
"Gets",
"the",
"sheet",
"with",
"the",
"specified",
"index",
"."
] | train | https://github.com/eBay/xcelite/blob/0362f4cf9c5b8dee73e8ec00a860f0fef0f0c2e1/src/main/java/com/ebay/xcelite/Xcelite.java#L99-L105 |
JodaOrg/joda-convert | src/main/java/org/joda/convert/StringConvert.java | StringConvert.findFromStringMethod | private Method findFromStringMethod(Class<?> cls, String methodName) {
"""
Finds the conversion method.
@param cls the class to find a method for, not null
@param methodName the name of the method to find, not null
@return the method to call, null means use {@code toString}
"""
Method m;
... | java | private Method findFromStringMethod(Class<?> cls, String methodName) {
Method m;
try {
m = cls.getMethod(methodName, String.class);
} catch (NoSuchMethodException ex) {
try {
m = cls.getMethod(methodName, CharSequence.class);
} catch (No... | [
"private",
"Method",
"findFromStringMethod",
"(",
"Class",
"<",
"?",
">",
"cls",
",",
"String",
"methodName",
")",
"{",
"Method",
"m",
";",
"try",
"{",
"m",
"=",
"cls",
".",
"getMethod",
"(",
"methodName",
",",
"String",
".",
"class",
")",
";",
"}",
... | Finds the conversion method.
@param cls the class to find a method for, not null
@param methodName the name of the method to find, not null
@return the method to call, null means use {@code toString} | [
"Finds",
"the",
"conversion",
"method",
"."
] | train | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/StringConvert.java#L816-L831 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/shared/SharedBaseRecordTable.java | SharedBaseRecordTable.setHandle | public FieldList setHandle(Object bookmark, int iHandleType) throws DBException {
"""
Reposition to this record Using this bookmark.
@exception DBException File exception.
"""
this.setCurrentRecord(this.getBaseRecord());
Object[] rgobjEnabledFields = this.getBaseRecord().setEnableFieldListener... | java | public FieldList setHandle(Object bookmark, int iHandleType) throws DBException
{
this.setCurrentRecord(this.getBaseRecord());
Object[] rgobjEnabledFields = this.getBaseRecord().setEnableFieldListeners(false);
try {
Record record = (Record)super.setHandle(bookmark, iHandleType);
... | [
"public",
"FieldList",
"setHandle",
"(",
"Object",
"bookmark",
",",
"int",
"iHandleType",
")",
"throws",
"DBException",
"{",
"this",
".",
"setCurrentRecord",
"(",
"this",
".",
"getBaseRecord",
"(",
")",
")",
";",
"Object",
"[",
"]",
"rgobjEnabledFields",
"=",
... | Reposition to this record Using this bookmark.
@exception DBException File exception. | [
"Reposition",
"to",
"this",
"record",
"Using",
"this",
"bookmark",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/shared/SharedBaseRecordTable.java#L254-L276 |
DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java | BaseBo.tryLockForRead | protected Lock tryLockForRead(long time, TimeUnit unit) throws InterruptedException {
"""
Try to lock the BO for read.
@param time
@param unit
@return the "read"-lock in "lock" state if successful, {@code null} otherwise
@throws InterruptedException
@since 0.10.0
"""
if (time < 0 || unit == null... | java | protected Lock tryLockForRead(long time, TimeUnit unit) throws InterruptedException {
if (time < 0 || unit == null) {
return tryLockForRead();
}
Lock lock = readLock();
return lock.tryLock(time, unit) ? lock : null;
} | [
"protected",
"Lock",
"tryLockForRead",
"(",
"long",
"time",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"time",
"<",
"0",
"||",
"unit",
"==",
"null",
")",
"{",
"return",
"tryLockForRead",
"(",
")",
";",
"}",
"Lock",
"l... | Try to lock the BO for read.
@param time
@param unit
@return the "read"-lock in "lock" state if successful, {@code null} otherwise
@throws InterruptedException
@since 0.10.0 | [
"Try",
"to",
"lock",
"the",
"BO",
"for",
"read",
"."
] | train | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java#L487-L493 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/java/net/AddressCache.java | AddressCache.putUnknownHost | public void putUnknownHost(String hostname, int netId, String detailMessage) {
"""
Records that 'hostname' is known not to have any associated addresses. (I.e. insert a
negative cache entry.)
"""
cache.put(new AddressCacheKey(hostname, netId), new AddressCacheEntry(detailMessage));
} | java | public void putUnknownHost(String hostname, int netId, String detailMessage) {
cache.put(new AddressCacheKey(hostname, netId), new AddressCacheEntry(detailMessage));
} | [
"public",
"void",
"putUnknownHost",
"(",
"String",
"hostname",
",",
"int",
"netId",
",",
"String",
"detailMessage",
")",
"{",
"cache",
".",
"put",
"(",
"new",
"AddressCacheKey",
"(",
"hostname",
",",
"netId",
")",
",",
"new",
"AddressCacheEntry",
"(",
"detai... | Records that 'hostname' is known not to have any associated addresses. (I.e. insert a
negative cache entry.) | [
"Records",
"that",
"hostname",
"is",
"known",
"not",
"to",
"have",
"any",
"associated",
"addresses",
".",
"(",
"I",
".",
"e",
".",
"insert",
"a",
"negative",
"cache",
"entry",
".",
")"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/java/net/AddressCache.java#L125-L127 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/ruts/message/objective/ObjectiveMessageResources.java | ObjectiveMessageResources.findBundleSimply | protected MessageResourceBundle findBundleSimply(String messageName, Locale locale) {
"""
Find The bundle simply (without extends handling), that may be cached. <br>
Returned bundle may have language, country, variant and default language's properties
for the message name and locale, as hierarchy like this:
<pr... | java | protected MessageResourceBundle findBundleSimply(String messageName, Locale locale) {
final Map<Locale, MessageResourceBundle> cachedMessageMap = bundleCacheMap.get(messageName);
if (cachedMessageMap != null) {
final MessageResourceBundle cachedBundle = cachedMessageMap.get(locale);
... | [
"protected",
"MessageResourceBundle",
"findBundleSimply",
"(",
"String",
"messageName",
",",
"Locale",
"locale",
")",
"{",
"final",
"Map",
"<",
"Locale",
",",
"MessageResourceBundle",
">",
"cachedMessageMap",
"=",
"bundleCacheMap",
".",
"get",
"(",
"messageName",
")... | Find The bundle simply (without extends handling), that may be cached. <br>
Returned bundle may have language, country, variant and default language's properties
for the message name and locale, as hierarchy like this:
<pre>
e.g. messageName = foo_message, locale = ja
parent3 : foo_message.properties *last search
... | [
"Find",
"The",
"bundle",
"simply",
"(",
"without",
"extends",
"handling",
")",
"that",
"may",
"be",
"cached",
".",
"<br",
">",
"Returned",
"bundle",
"may",
"have",
"language",
"country",
"variant",
"and",
"default",
"language",
"s",
"properties",
"for",
"the... | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/ruts/message/objective/ObjectiveMessageResources.java#L446-L472 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.