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 |
|---|---|---|---|---|---|---|---|---|---|---|
google/error-prone-javac | src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor6.java | ElementKindVisitor6.visitExecutable | @Override
public R visitExecutable(ExecutableElement e, P p) {
"""
Visits an executable element, dispatching to the visit method
for the specific {@linkplain ElementKind kind} of executable,
{@code CONSTRUCTOR}, {@code INSTANCE_INIT}, {@code METHOD}, or
{@code STATIC_INIT}.
@param e {@inheritDoc}
@param... | java | @Override
public R visitExecutable(ExecutableElement e, P p) {
ElementKind k = e.getKind();
switch(k) {
case CONSTRUCTOR:
return visitExecutableAsConstructor(e, p);
case INSTANCE_INIT:
return visitExecutableAsInstanceInit(e, p);
case METHOD:
... | [
"@",
"Override",
"public",
"R",
"visitExecutable",
"(",
"ExecutableElement",
"e",
",",
"P",
"p",
")",
"{",
"ElementKind",
"k",
"=",
"e",
".",
"getKind",
"(",
")",
";",
"switch",
"(",
"k",
")",
"{",
"case",
"CONSTRUCTOR",
":",
"return",
"visitExecutableAs... | Visits an executable element, dispatching to the visit method
for the specific {@linkplain ElementKind kind} of executable,
{@code CONSTRUCTOR}, {@code INSTANCE_INIT}, {@code METHOD}, or
{@code STATIC_INIT}.
@param e {@inheritDoc}
@param p {@inheritDoc}
@return the result of the kind-specific visit method | [
"Visits",
"an",
"executable",
"element",
"dispatching",
"to",
"the",
"visit",
"method",
"for",
"the",
"specific",
"{",
"@linkplain",
"ElementKind",
"kind",
"}",
"of",
"executable",
"{",
"@code",
"CONSTRUCTOR",
"}",
"{",
"@code",
"INSTANCE_INIT",
"}",
"{",
"@co... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor6.java#L327-L346 |
actframework/actframework | src/main/java/act/data/ApacheMultipartParser.java | ApacheMultipartParser.parseEndOfLine | private int parseEndOfLine(String headerPart, int end) {
"""
Skips bytes until the end of the current line.
@param headerPart The headers, which are being parsed.
@param end Index of the last byte, which has yet been processed.
@return Index of the \r\n sequence, which indicates end of line.
"""
... | java | private int parseEndOfLine(String headerPart, int end) {
int index = end;
for (; ;) {
int offset = headerPart.indexOf('\r', index);
if (offset == -1 || offset + 1 >= headerPart.length()) {
throw new IllegalStateException("Expected headers to be terminated by an em... | [
"private",
"int",
"parseEndOfLine",
"(",
"String",
"headerPart",
",",
"int",
"end",
")",
"{",
"int",
"index",
"=",
"end",
";",
"for",
"(",
";",
";",
")",
"{",
"int",
"offset",
"=",
"headerPart",
".",
"indexOf",
"(",
"'",
"'",
",",
"index",
")",
";"... | Skips bytes until the end of the current line.
@param headerPart The headers, which are being parsed.
@param end Index of the last byte, which has yet been processed.
@return Index of the \r\n sequence, which indicates end of line. | [
"Skips",
"bytes",
"until",
"the",
"end",
"of",
"the",
"current",
"line",
"."
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/data/ApacheMultipartParser.java#L276-L288 |
intellimate/Izou | src/main/java/org/intellimate/izou/system/file/FileManager.java | FileManager.writeToFile | public boolean writeToFile(String defaultFilePath, String realFilePath) {
"""
Writes default file to real file
The default file would be a file that can be packaged along with the code, from which a real file (say a
properties file for example) can be loaded. This is useful because there are files (like property... | java | public boolean writeToFile(String defaultFilePath, String realFilePath) {
try {
Files.copy(Paths.get(defaultFilePath), Paths.get(realFilePath), StandardCopyOption.REPLACE_EXISTING);
return true;
} catch (IOException e) {
error("Unable to write to copy Properties-File"... | [
"public",
"boolean",
"writeToFile",
"(",
"String",
"defaultFilePath",
",",
"String",
"realFilePath",
")",
"{",
"try",
"{",
"Files",
".",
"copy",
"(",
"Paths",
".",
"get",
"(",
"defaultFilePath",
")",
",",
"Paths",
".",
"get",
"(",
"realFilePath",
")",
",",... | Writes default file to real file
The default file would be a file that can be packaged along with the code, from which a real file (say a
properties file for example) can be loaded. This is useful because there are files (like property files0 that
cannot be shipped with the package and have to be created at runtime. To... | [
"Writes",
"default",
"file",
"to",
"real",
"file",
"The",
"default",
"file",
"would",
"be",
"a",
"file",
"that",
"can",
"be",
"packaged",
"along",
"with",
"the",
"code",
"from",
"which",
"a",
"real",
"file",
"(",
"say",
"a",
"properties",
"file",
"for",
... | train | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/system/file/FileManager.java#L95-L103 |
tomgibara/bits | src/main/java/com/tomgibara/bits/Bits.java | Bits.writerTo | public static BitWriter writerTo(BitStore store, Operation operation, int finalPos, int initialPos) {
"""
Creates a {@link BitWriter} that writes its bits to a {@link BitStore}
using a specified {@link Operation}. This method is primarily intended to
assist in implementing a highly adapted {@link BitStore} imple... | java | public static BitWriter writerTo(BitStore store, Operation operation, int finalPos, int initialPos) {
if (store == null) throw new IllegalArgumentException("null store");
if (operation == null) throw new IllegalArgumentException("null operation");
if (finalPos < 0) throw new IllegalArgumentException("negative fin... | [
"public",
"static",
"BitWriter",
"writerTo",
"(",
"BitStore",
"store",
",",
"Operation",
"operation",
",",
"int",
"finalPos",
",",
"int",
"initialPos",
")",
"{",
"if",
"(",
"store",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"null st... | Creates a {@link BitWriter} that writes its bits to a {@link BitStore}
using a specified {@link Operation}. This method is primarily intended to
assist in implementing a highly adapted {@link BitStore} implementation.
Generally {@link BitStore.Op#openWriter(int, int)},
{@link BitStore#openWriter(int, int)}
{@link BitSt... | [
"Creates",
"a",
"{",
"@link",
"BitWriter",
"}",
"that",
"writes",
"its",
"bits",
"to",
"a",
"{",
"@link",
"BitStore",
"}",
"using",
"a",
"specified",
"{",
"@link",
"Operation",
"}",
".",
"This",
"method",
"is",
"primarily",
"intended",
"to",
"assist",
"i... | train | https://github.com/tomgibara/bits/blob/56c32c0a30efd3d7c4e7c6600a0ca39e51eecc97/src/main/java/com/tomgibara/bits/Bits.java#L983-L998 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/protocols/payments/PaymentSession.java | PaymentSession.createFromUrl | public static ListenableFuture<PaymentSession> createFromUrl(final String url, final boolean verifyPki)
throws PaymentProtocolException {
"""
Returns a future that will be notified with a PaymentSession object after it is fetched using the provided url.
url is an address where the {@link Protos.Paymen... | java | public static ListenableFuture<PaymentSession> createFromUrl(final String url, final boolean verifyPki)
throws PaymentProtocolException {
return createFromUrl(url, verifyPki, null);
} | [
"public",
"static",
"ListenableFuture",
"<",
"PaymentSession",
">",
"createFromUrl",
"(",
"final",
"String",
"url",
",",
"final",
"boolean",
"verifyPki",
")",
"throws",
"PaymentProtocolException",
"{",
"return",
"createFromUrl",
"(",
"url",
",",
"verifyPki",
",",
... | Returns a future that will be notified with a PaymentSession object after it is fetched using the provided url.
url is an address where the {@link Protos.PaymentRequest} object may be fetched.
If the payment request object specifies a PKI method, then the system trust store will
be used to verify the signature provided... | [
"Returns",
"a",
"future",
"that",
"will",
"be",
"notified",
"with",
"a",
"PaymentSession",
"object",
"after",
"it",
"is",
"fetched",
"using",
"the",
"provided",
"url",
".",
"url",
"is",
"an",
"address",
"where",
"the",
"{"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/protocols/payments/PaymentSession.java#L149-L152 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.readAccessControlEntry | public CmsAccessControlEntry readAccessControlEntry(CmsDbContext dbc, CmsResource resource, CmsUUID principal)
throws CmsException {
"""
Reads an access control entry from the cms.<p>
The access control entries of a resource are readable by everyone.
@param dbc the current database context
@param resour... | java | public CmsAccessControlEntry readAccessControlEntry(CmsDbContext dbc, CmsResource resource, CmsUUID principal)
throws CmsException {
return getUserDriver(
dbc).readAccessControlEntry(dbc, dbc.currentProject(), resource.getResourceId(), principal);
} | [
"public",
"CmsAccessControlEntry",
"readAccessControlEntry",
"(",
"CmsDbContext",
"dbc",
",",
"CmsResource",
"resource",
",",
"CmsUUID",
"principal",
")",
"throws",
"CmsException",
"{",
"return",
"getUserDriver",
"(",
"dbc",
")",
".",
"readAccessControlEntry",
"(",
"d... | Reads an access control entry from the cms.<p>
The access control entries of a resource are readable by everyone.
@param dbc the current database context
@param resource the resource
@param principal the id of a group or a user any other entity
@return an access control entry that defines the permissions of the entit... | [
"Reads",
"an",
"access",
"control",
"entry",
"from",
"the",
"cms",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L6321-L6326 |
foundation-runtime/monitoring | monitoring-jmx-lib/src/main/java/com/cisco/oss/foundation/monitoring/RMIRegistryManager.java | RMIRegistryManager.isRMIRegistryRunning | public static boolean isRMIRegistryRunning(Configuration configuration, int port) {
"""
Checks if rmiregistry is running on the specified port.
@param port
@return true if rmiregistry is running on the specified port, false
otherwise
"""
try {
final Registry registry = RegistryFinder.g... | java | public static boolean isRMIRegistryRunning(Configuration configuration, int port) {
try {
final Registry registry = RegistryFinder.getInstance().getRegistry(configuration, port);
registry.list();
return true;
} catch (RemoteException ex) {
return false;
... | [
"public",
"static",
"boolean",
"isRMIRegistryRunning",
"(",
"Configuration",
"configuration",
",",
"int",
"port",
")",
"{",
"try",
"{",
"final",
"Registry",
"registry",
"=",
"RegistryFinder",
".",
"getInstance",
"(",
")",
".",
"getRegistry",
"(",
"configuration",
... | Checks if rmiregistry is running on the specified port.
@param port
@return true if rmiregistry is running on the specified port, false
otherwise | [
"Checks",
"if",
"rmiregistry",
"is",
"running",
"on",
"the",
"specified",
"port",
"."
] | train | https://github.com/foundation-runtime/monitoring/blob/a85ec72dc5558f787704fb13d9125a5803403ee5/monitoring-jmx-lib/src/main/java/com/cisco/oss/foundation/monitoring/RMIRegistryManager.java#L45-L55 |
osiam/connector4java | src/main/java/org/osiam/client/OsiamGroupService.java | OsiamGroupService.updateGroup | @Deprecated
Group updateGroup(String id, UpdateGroup updateGroup, AccessToken accessToken) {
"""
See {@link OsiamConnector#updateGroup(String, UpdateGroup, AccessToken)}
@deprecated Updating with PATCH has been removed in OSIAM 3.0. This method is going to go away with version 1.12 or 2.0.
"""
r... | java | @Deprecated
Group updateGroup(String id, UpdateGroup updateGroup, AccessToken accessToken) {
return updateResource(id, updateGroup.getScimConformUpdateGroup(), accessToken);
} | [
"@",
"Deprecated",
"Group",
"updateGroup",
"(",
"String",
"id",
",",
"UpdateGroup",
"updateGroup",
",",
"AccessToken",
"accessToken",
")",
"{",
"return",
"updateResource",
"(",
"id",
",",
"updateGroup",
".",
"getScimConformUpdateGroup",
"(",
")",
",",
"accessToken... | See {@link OsiamConnector#updateGroup(String, UpdateGroup, AccessToken)}
@deprecated Updating with PATCH has been removed in OSIAM 3.0. This method is going to go away with version 1.12 or 2.0. | [
"See",
"{",
"@link",
"OsiamConnector#updateGroup",
"(",
"String",
"UpdateGroup",
"AccessToken",
")",
"}"
] | train | https://github.com/osiam/connector4java/blob/a5e6ae1e706f4889d662a069fe2f3bf8e3848d12/src/main/java/org/osiam/client/OsiamGroupService.java#L86-L89 |
Netflix/zuul | zuul-core/src/main/java/com/netflix/zuul/message/Headers.java | Headers.set | public void set(String name, String value) {
"""
Replace any/all entries with this key, with this single entry.
If value is null, then not added, but any existing header of same name is removed.
@param name
@param value
"""
HeaderName hn = getHeaderName(name);
set(hn, value);
} | java | public void set(String name, String value)
{
HeaderName hn = getHeaderName(name);
set(hn, value);
} | [
"public",
"void",
"set",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"HeaderName",
"hn",
"=",
"getHeaderName",
"(",
"name",
")",
";",
"set",
"(",
"hn",
",",
"value",
")",
";",
"}"
] | Replace any/all entries with this key, with this single entry.
If value is null, then not added, but any existing header of same name is removed.
@param name
@param value | [
"Replace",
"any",
"/",
"all",
"entries",
"with",
"this",
"key",
"with",
"this",
"single",
"entry",
"."
] | train | https://github.com/Netflix/zuul/blob/01bc777cf05e3522d37c9ed902ae13eb38a19692/zuul-core/src/main/java/com/netflix/zuul/message/Headers.java#L146-L150 |
jbundle/jbundle | base/db/client/src/main/java/org/jbundle/base/db/client/ClientDatabase.java | ClientDatabase.getRemoteProperty | public String getRemoteProperty(String strProperty, boolean readIfNotCached) {
"""
Get this property from the remote database.
This does not make a remote call, it just return the property cached on remote db open.
@param strProperty The key to the remote property.
@return The value.
"""
if (m_remot... | java | public String getRemoteProperty(String strProperty, boolean readIfNotCached)
{
if (m_remoteProperties == null)
if (readIfNotCached)
{
try {
this.getRemoteDatabase();
} catch (RemoteException e) {
e.printStackTrace();
... | [
"public",
"String",
"getRemoteProperty",
"(",
"String",
"strProperty",
",",
"boolean",
"readIfNotCached",
")",
"{",
"if",
"(",
"m_remoteProperties",
"==",
"null",
")",
"if",
"(",
"readIfNotCached",
")",
"{",
"try",
"{",
"this",
".",
"getRemoteDatabase",
"(",
"... | Get this property from the remote database.
This does not make a remote call, it just return the property cached on remote db open.
@param strProperty The key to the remote property.
@return The value. | [
"Get",
"this",
"property",
"from",
"the",
"remote",
"database",
".",
"This",
"does",
"not",
"make",
"a",
"remote",
"call",
"it",
"just",
"return",
"the",
"property",
"cached",
"on",
"remote",
"db",
"open",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/db/client/src/main/java/org/jbundle/base/db/client/ClientDatabase.java#L239-L253 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContent.java | CmsXmlContent.removeSurplusValuesInOtherLocales | private void removeSurplusValuesInOtherLocales(String elementPath, int valueCount, Locale sourceLocale) {
"""
Removes all surplus values of locale independent fields in the other locales.<p>
@param elementPath the element path
@param valueCount the value count
@param sourceLocale the source locale
"""
... | java | private void removeSurplusValuesInOtherLocales(String elementPath, int valueCount, Locale sourceLocale) {
for (Locale locale : getLocales()) {
if (locale.equals(sourceLocale)) {
continue;
}
List<I_CmsXmlContentValue> localeValues = getValues(elementPath, loca... | [
"private",
"void",
"removeSurplusValuesInOtherLocales",
"(",
"String",
"elementPath",
",",
"int",
"valueCount",
",",
"Locale",
"sourceLocale",
")",
"{",
"for",
"(",
"Locale",
"locale",
":",
"getLocales",
"(",
")",
")",
"{",
"if",
"(",
"locale",
".",
"equals",
... | Removes all surplus values of locale independent fields in the other locales.<p>
@param elementPath the element path
@param valueCount the value count
@param sourceLocale the source locale | [
"Removes",
"all",
"surplus",
"values",
"of",
"locale",
"independent",
"fields",
"in",
"the",
"other",
"locales",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContent.java#L1093-L1104 |
apache/reef | lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/driver/ResourceManager.java | ResourceManager.onResourceLaunchRequest | void onResourceLaunchRequest(
final ResourceLaunchEvent launchRequest) {
"""
Processes a resource launch request.
@param launchRequest the launch request to be processed.
"""
synchronized (this.theContainers) {
final Container c = this.theContainers.get(launchRequest.getIdentifier());
... | java | void onResourceLaunchRequest(
final ResourceLaunchEvent launchRequest) {
synchronized (this.theContainers) {
final Container c = this.theContainers.get(launchRequest.getIdentifier());
try (final LoggingScope lb = this.loggingScopeFactory
.getNewLoggingScope("ResourceManager.onResource... | [
"void",
"onResourceLaunchRequest",
"(",
"final",
"ResourceLaunchEvent",
"launchRequest",
")",
"{",
"synchronized",
"(",
"this",
".",
"theContainers",
")",
"{",
"final",
"Container",
"c",
"=",
"this",
".",
"theContainers",
".",
"get",
"(",
"launchRequest",
".",
"... | Processes a resource launch request.
@param launchRequest the launch request to be processed. | [
"Processes",
"a",
"resource",
"launch",
"request",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/driver/ResourceManager.java#L157-L188 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/DerivativeIntegralImage.java | DerivativeIntegralImage.kernelDerivX | public static IntegralKernel kernelDerivX( int r , IntegralKernel ret ) {
"""
Creates a kernel for a symmetric box derivative.
@param r Radius of the box. width is 2*r+1
@return Kernel Kernel for derivative.
"""
if( ret == null )
ret = new IntegralKernel(2);
ret.blocks[0].set(-r-1,-r-1,-1,r);
re... | java | public static IntegralKernel kernelDerivX( int r , IntegralKernel ret ) {
if( ret == null )
ret = new IntegralKernel(2);
ret.blocks[0].set(-r-1,-r-1,-1,r);
ret.blocks[1].set(0,-r-1,r,r);
ret.scales[0] = -1;
ret.scales[1] = 1;
return ret;
} | [
"public",
"static",
"IntegralKernel",
"kernelDerivX",
"(",
"int",
"r",
",",
"IntegralKernel",
"ret",
")",
"{",
"if",
"(",
"ret",
"==",
"null",
")",
"ret",
"=",
"new",
"IntegralKernel",
"(",
"2",
")",
";",
"ret",
".",
"blocks",
"[",
"0",
"]",
".",
"se... | Creates a kernel for a symmetric box derivative.
@param r Radius of the box. width is 2*r+1
@return Kernel Kernel for derivative. | [
"Creates",
"a",
"kernel",
"for",
"a",
"symmetric",
"box",
"derivative",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/DerivativeIntegralImage.java#L35-L45 |
mapbox/mapbox-java | services-turf/src/main/java/com/mapbox/turf/TurfClassification.java | TurfClassification.nearestPoint | @NonNull
public static Point nearestPoint(@NonNull Point targetPoint, @NonNull List<Point> points) {
"""
Takes a reference point and a list of {@link Point} geometries and returns the point from the
set point list closest to the reference. This calculation is geodesic.
@param targetPoint the reference point
... | java | @NonNull
public static Point nearestPoint(@NonNull Point targetPoint, @NonNull List<Point> points) {
if (points.isEmpty()) {
return targetPoint;
}
Point nearestPoint = points.get(0);
double minDist = Double.POSITIVE_INFINITY;
for (Point point : points) {
double distanceToPoint = TurfMe... | [
"@",
"NonNull",
"public",
"static",
"Point",
"nearestPoint",
"(",
"@",
"NonNull",
"Point",
"targetPoint",
",",
"@",
"NonNull",
"List",
"<",
"Point",
">",
"points",
")",
"{",
"if",
"(",
"points",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"targetPoint"... | Takes a reference point and a list of {@link Point} geometries and returns the point from the
set point list closest to the reference. This calculation is geodesic.
@param targetPoint the reference point
@param points set list of points to run against the input point
@return the closest point in the set to the re... | [
"Takes",
"a",
"reference",
"point",
"and",
"a",
"list",
"of",
"{",
"@link",
"Point",
"}",
"geometries",
"and",
"returns",
"the",
"point",
"from",
"the",
"set",
"point",
"list",
"closest",
"to",
"the",
"reference",
".",
"This",
"calculation",
"is",
"geodesi... | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-turf/src/main/java/com/mapbox/turf/TurfClassification.java#L30-L45 |
lightoze/gwt-i18n-server | src/main/java/net/lightoze/gwt/i18n/client/LocaleFactory.java | LocaleFactory.put | public static <T extends LocalizableResource> void put(Class<T> cls, T m) {
"""
Populate localization object cache for <em>current</em> locale.
@param cls localization interface class
@param m localization object
@param <T> localization interface class
"""
put(cls, null, m);
} | java | public static <T extends LocalizableResource> void put(Class<T> cls, T m) {
put(cls, null, m);
} | [
"public",
"static",
"<",
"T",
"extends",
"LocalizableResource",
">",
"void",
"put",
"(",
"Class",
"<",
"T",
">",
"cls",
",",
"T",
"m",
")",
"{",
"put",
"(",
"cls",
",",
"null",
",",
"m",
")",
";",
"}"
] | Populate localization object cache for <em>current</em> locale.
@param cls localization interface class
@param m localization object
@param <T> localization interface class | [
"Populate",
"localization",
"object",
"cache",
"for",
"<em",
">",
"current<",
"/",
"em",
">",
"locale",
"."
] | train | https://github.com/lightoze/gwt-i18n-server/blob/96de53288e9bf31721d7b0e2a1d9f7b6ce1a7e83/src/main/java/net/lightoze/gwt/i18n/client/LocaleFactory.java#L83-L85 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.whereEqualTo | @Nonnull
public Query whereEqualTo(@Nonnull String field, @Nullable Object value) {
"""
Creates and returns a new Query with the additional filter that documents must contain the
specified field and the value should be equal to the specified value.
@param field The name of the field to compare.
@param value... | java | @Nonnull
public Query whereEqualTo(@Nonnull String field, @Nullable Object value) {
return whereEqualTo(FieldPath.fromDotSeparatedString(field), value);
} | [
"@",
"Nonnull",
"public",
"Query",
"whereEqualTo",
"(",
"@",
"Nonnull",
"String",
"field",
",",
"@",
"Nullable",
"Object",
"value",
")",
"{",
"return",
"whereEqualTo",
"(",
"FieldPath",
".",
"fromDotSeparatedString",
"(",
"field",
")",
",",
"value",
")",
";"... | Creates and returns a new Query with the additional filter that documents must contain the
specified field and the value should be equal to the specified value.
@param field The name of the field to compare.
@param value The value for comparison.
@return The created Query. | [
"Creates",
"and",
"returns",
"a",
"new",
"Query",
"with",
"the",
"additional",
"filter",
"that",
"documents",
"must",
"contain",
"the",
"specified",
"field",
"and",
"the",
"value",
"should",
"be",
"equal",
"to",
"the",
"specified",
"value",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L416-L419 |
Graylog2/graylog2-server | graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/ast/Rule.java | Rule.registerMetrics | public void registerMetrics(MetricRegistry metricRegistry, String pipelineId, String stageId) {
"""
Register the metrics attached to this pipeline.
@param metricRegistry the registry to add the metrics to
"""
if (id() == null) {
LOG.debug("Not registering metrics for unsaved rule {}", na... | java | public void registerMetrics(MetricRegistry metricRegistry, String pipelineId, String stageId) {
if (id() == null) {
LOG.debug("Not registering metrics for unsaved rule {}", name());
return;
}
if (id() != null) {
globalExecuted = registerGlobalMeter(metricRegis... | [
"public",
"void",
"registerMetrics",
"(",
"MetricRegistry",
"metricRegistry",
",",
"String",
"pipelineId",
",",
"String",
"stageId",
")",
"{",
"if",
"(",
"id",
"(",
")",
"==",
"null",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Not registering metrics for unsaved rul... | Register the metrics attached to this pipeline.
@param metricRegistry the registry to add the metrics to | [
"Register",
"the",
"metrics",
"attached",
"to",
"this",
"pipeline",
"."
] | train | https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/ast/Rule.java#L91-L110 |
tvesalainen/util | util/src/main/java/org/vesalainen/ui/Scaler.java | Scaler.getLevelFor | public ScaleLevel getLevelFor(Font font, FontRenderContext frc, boolean horizontal, double xy) {
"""
Returns highest level where drawn labels don't overlap using identity
transformer
@param font
@param frc
@param horizontal
@param xy Lines constant value
@return
"""
return getLevelFor(font, frc, ... | java | public ScaleLevel getLevelFor(Font font, FontRenderContext frc, boolean horizontal, double xy)
{
return getLevelFor(font, frc, DoubleTransform.identity(), horizontal, xy);
} | [
"public",
"ScaleLevel",
"getLevelFor",
"(",
"Font",
"font",
",",
"FontRenderContext",
"frc",
",",
"boolean",
"horizontal",
",",
"double",
"xy",
")",
"{",
"return",
"getLevelFor",
"(",
"font",
",",
"frc",
",",
"DoubleTransform",
".",
"identity",
"(",
")",
","... | Returns highest level where drawn labels don't overlap using identity
transformer
@param font
@param frc
@param horizontal
@param xy Lines constant value
@return | [
"Returns",
"highest",
"level",
"where",
"drawn",
"labels",
"don",
"t",
"overlap",
"using",
"identity",
"transformer"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/ui/Scaler.java#L135-L138 |
revelytix/spark | spark-spi/src/main/java/spark/spi/util/DateTime.java | DateTime.parseInt | private static int parseInt(Input s) {
"""
Parse an integer from the input, reading up to the first non-numeric character.
"""
if (s.index >= s.len) throw new DateFormatException("unexpected end of input", s.str, s.index);
int result = 0;
while (s.index < s.len) {
char c = s.getChar();
... | java | private static int parseInt(Input s) {
if (s.index >= s.len) throw new DateFormatException("unexpected end of input", s.str, s.index);
int result = 0;
while (s.index < s.len) {
char c = s.getChar();
if (c >= '0' && c <= '9') {
if (result >= Integer.MAX_VALUE / 10) throw new ArithmeticExc... | [
"private",
"static",
"int",
"parseInt",
"(",
"Input",
"s",
")",
"{",
"if",
"(",
"s",
".",
"index",
">=",
"s",
".",
"len",
")",
"throw",
"new",
"DateFormatException",
"(",
"\"unexpected end of input\"",
",",
"s",
".",
"str",
",",
"s",
".",
"index",
")",... | Parse an integer from the input, reading up to the first non-numeric character. | [
"Parse",
"an",
"integer",
"from",
"the",
"input",
"reading",
"up",
"to",
"the",
"first",
"non",
"-",
"numeric",
"character",
"."
] | train | https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-spi/src/main/java/spark/spi/util/DateTime.java#L418-L432 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parseAutoDecompression | private void parseAutoDecompression(Map<Object, Object> props) {
"""
Check the configuration map for the property turning on or off the body
autodecompression code.
@param props
"""
// PK41619 - allow this to be turned off
Object value = props.get(HttpConfigConstants.PROPNAME_AUTODECOMPRESS... | java | private void parseAutoDecompression(Map<Object, Object> props) {
// PK41619 - allow this to be turned off
Object value = props.get(HttpConfigConstants.PROPNAME_AUTODECOMPRESSION);
if (null != value) {
this.bAutoDecompression = convertBoolean(value);
if (TraceComponent.isA... | [
"private",
"void",
"parseAutoDecompression",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"// PK41619 - allow this to be turned off",
"Object",
"value",
"=",
"props",
".",
"get",
"(",
"HttpConfigConstants",
".",
"PROPNAME_AUTODECOMPRESSION",
")",
... | Check the configuration map for the property turning on or off the body
autodecompression code.
@param props | [
"Check",
"the",
"configuration",
"map",
"for",
"the",
"property",
"turning",
"on",
"or",
"off",
"the",
"body",
"autodecompression",
"code",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L1195-L1204 |
sebastiangraf/treetank | interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/PipelineBuilder.java | PipelineBuilder.addRangeExpr | public void addRangeExpr(final INodeReadTrx mTransaction) {
"""
Adds a range expression to the pipeline.
@param mTransaction
Transaction to operate with.
"""
assert getPipeStack().size() >= 2;
final AbsAxis mOperand2 = getPipeStack().pop().getExpr();
final AbsAxis mOperand1 = getP... | java | public void addRangeExpr(final INodeReadTrx mTransaction) {
assert getPipeStack().size() >= 2;
final AbsAxis mOperand2 = getPipeStack().pop().getExpr();
final AbsAxis mOperand1 = getPipeStack().pop().getExpr();
final AbsAxis axis = new RangeAxis(mTransaction, mOperand1, mOperand2);
... | [
"public",
"void",
"addRangeExpr",
"(",
"final",
"INodeReadTrx",
"mTransaction",
")",
"{",
"assert",
"getPipeStack",
"(",
")",
".",
"size",
"(",
")",
">=",
"2",
";",
"final",
"AbsAxis",
"mOperand2",
"=",
"getPipeStack",
"(",
")",
".",
"pop",
"(",
")",
"."... | Adds a range expression to the pipeline.
@param mTransaction
Transaction to operate with. | [
"Adds",
"a",
"range",
"expression",
"to",
"the",
"pipeline",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/PipelineBuilder.java#L645-L658 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/AbstractJaxbMojo.java | AbstractJaxbMojo.warnAboutIncorrectPluginConfiguration | @SuppressWarnings("all")
protected void warnAboutIncorrectPluginConfiguration(final String propertyName, final String description) {
"""
Convenience method to invoke when some plugin configuration is incorrect.
Will output the problem as a warning with some degree of log formatting.
@param propertyName The... | java | @SuppressWarnings("all")
protected void warnAboutIncorrectPluginConfiguration(final String propertyName, final String description) {
final StringBuilder builder = new StringBuilder();
builder.append("\n+=================== [Incorrect Plugin Configuration Detected]\n");
builder.append("|\n")... | [
"@",
"SuppressWarnings",
"(",
"\"all\"",
")",
"protected",
"void",
"warnAboutIncorrectPluginConfiguration",
"(",
"final",
"String",
"propertyName",
",",
"final",
"String",
"description",
")",
"{",
"final",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
... | Convenience method to invoke when some plugin configuration is incorrect.
Will output the problem as a warning with some degree of log formatting.
@param propertyName The name of the problematic property.
@param description The problem description. | [
"Convenience",
"method",
"to",
"invoke",
"when",
"some",
"plugin",
"configuration",
"is",
"incorrect",
".",
"Will",
"output",
"the",
"problem",
"as",
"a",
"warning",
"with",
"some",
"degree",
"of",
"log",
"formatting",
"."
] | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/AbstractJaxbMojo.java#L417-L428 |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/BaasAsset.java | BaasAsset.fetchData | public static RequestToken fetchData(String id, BaasHandler<JsonObject> handler) {
"""
Asynchronously retrieves named assets data,
If the named asset is a document, the document is retrieved
otherwise attached data to the file are returned.
This version of the method uses default priority.
@param id the name... | java | public static RequestToken fetchData(String id, BaasHandler<JsonObject> handler){
return fetchData(id, RequestOptions.DEFAULT, handler);
} | [
"public",
"static",
"RequestToken",
"fetchData",
"(",
"String",
"id",
",",
"BaasHandler",
"<",
"JsonObject",
">",
"handler",
")",
"{",
"return",
"fetchData",
"(",
"id",
",",
"RequestOptions",
".",
"DEFAULT",
",",
"handler",
")",
";",
"}"
] | Asynchronously retrieves named assets data,
If the named asset is a document, the document is retrieved
otherwise attached data to the file are returned.
This version of the method uses default priority.
@param id the name of the asset
@param handler an handler that will be handed the response
@return a request token | [
"Asynchronously",
"retrieves",
"named",
"assets",
"data",
"If",
"the",
"named",
"asset",
"is",
"a",
"document",
"the",
"document",
"is",
"retrieved",
"otherwise",
"attached",
"data",
"to",
"the",
"file",
"are",
"returned",
".",
"This",
"version",
"of",
"the",
... | train | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasAsset.java#L41-L43 |
beders/Resty | src/main/java/us/monoid/util/EncoderUtil.java | EncoderUtil.encodeIfNecessary | public static String encodeIfNecessary(String text, Usage usage, int usedCharacters) {
"""
Shortcut method that encodes the specified text into an encoded-word if the
text has to be encoded.
@param text
text to encode.
@param usage
whether the encoded-word is to be used to replace a text token or
a word en... | java | public static String encodeIfNecessary(String text, Usage usage, int usedCharacters) {
if (hasToBeEncoded(text, usedCharacters))
return encodeEncodedWord(text, usage, usedCharacters);
else
return text;
} | [
"public",
"static",
"String",
"encodeIfNecessary",
"(",
"String",
"text",
",",
"Usage",
"usage",
",",
"int",
"usedCharacters",
")",
"{",
"if",
"(",
"hasToBeEncoded",
"(",
"text",
",",
"usedCharacters",
")",
")",
"return",
"encodeEncodedWord",
"(",
"text",
",",... | Shortcut method that encodes the specified text into an encoded-word if the
text has to be encoded.
@param text
text to encode.
@param usage
whether the encoded-word is to be used to replace a text token or
a word entity (see RFC 822).
@param usedCharacters
number of characters already used up (
<code>0 <= usedCharact... | [
"Shortcut",
"method",
"that",
"encodes",
"the",
"specified",
"text",
"into",
"an",
"encoded",
"-",
"word",
"if",
"the",
"text",
"has",
"to",
"be",
"encoded",
"."
] | train | https://github.com/beders/Resty/blob/4493603e9689c942cc3e53b9c5018010e414a364/src/main/java/us/monoid/util/EncoderUtil.java#L190-L195 |
recommenders/rival | rival-evaluate/src/main/java/net/recommenders/rival/evaluation/strategy/StrategyIO.java | StrategyIO.readLine | public static void readLine(final String line, final Map<Long, List<Pair<Long, Double>>> mapUserRecommendations) {
"""
Read a file from the recommended items file.
@param line The line.
@param mapUserRecommendations The recommendations for the users where
information will be stored into.
"""
Strin... | java | public static void readLine(final String line, final Map<Long, List<Pair<Long, Double>>> mapUserRecommendations) {
String[] toks = line.split("\t");
// mymedialite format: user \t [item:score,item:score,...]
if (line.contains(":") && line.contains(",")) {
Long user = Long.parseLong(t... | [
"public",
"static",
"void",
"readLine",
"(",
"final",
"String",
"line",
",",
"final",
"Map",
"<",
"Long",
",",
"List",
"<",
"Pair",
"<",
"Long",
",",
"Double",
">",
">",
">",
"mapUserRecommendations",
")",
"{",
"String",
"[",
"]",
"toks",
"=",
"line",
... | Read a file from the recommended items file.
@param line The line.
@param mapUserRecommendations The recommendations for the users where
information will be stored into. | [
"Read",
"a",
"file",
"from",
"the",
"recommended",
"items",
"file",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-evaluate/src/main/java/net/recommenders/rival/evaluation/strategy/StrategyIO.java#L43-L71 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsListItem.java | CmsListItem.initContent | protected void initContent() {
"""
This internal helper method creates the actual contents of the widget by combining the decorators and the main widget.<p>
"""
if (m_decoratedPanel != null) {
m_decoratedPanel.removeFromParent();
}
m_decoratedPanel = new CmsSimpleDecoratedP... | java | protected void initContent() {
if (m_decoratedPanel != null) {
m_decoratedPanel.removeFromParent();
}
m_decoratedPanel = new CmsSimpleDecoratedPanel(m_decorationWidth, m_mainWidget, m_decorationWidgets);
m_panel.insert(m_decoratedPanel, 0);
setSmallView(m_smallView);... | [
"protected",
"void",
"initContent",
"(",
")",
"{",
"if",
"(",
"m_decoratedPanel",
"!=",
"null",
")",
"{",
"m_decoratedPanel",
".",
"removeFromParent",
"(",
")",
";",
"}",
"m_decoratedPanel",
"=",
"new",
"CmsSimpleDecoratedPanel",
"(",
"m_decorationWidth",
",",
"... | This internal helper method creates the actual contents of the widget by combining the decorators and the main widget.<p> | [
"This",
"internal",
"helper",
"method",
"creates",
"the",
"actual",
"contents",
"of",
"the",
"widget",
"by",
"combining",
"the",
"decorators",
"and",
"the",
"main",
"widget",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsListItem.java#L636-L644 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/util/ComponentUtil.java | ComponentUtil.toIntAccess | public static int toIntAccess(String access) throws ApplicationException {
"""
cast a strong access definition to the int type
@param access access type
@return int access type
@throws ExpressionException
"""
access = StringUtil.toLowerCase(access.trim());
if (access.equals("package")) return Component.... | java | public static int toIntAccess(String access) throws ApplicationException {
access = StringUtil.toLowerCase(access.trim());
if (access.equals("package")) return Component.ACCESS_PACKAGE;
else if (access.equals("private")) return Component.ACCESS_PRIVATE;
else if (access.equals("public")) return Component.ACCESS_PUBL... | [
"public",
"static",
"int",
"toIntAccess",
"(",
"String",
"access",
")",
"throws",
"ApplicationException",
"{",
"access",
"=",
"StringUtil",
".",
"toLowerCase",
"(",
"access",
".",
"trim",
"(",
")",
")",
";",
"if",
"(",
"access",
".",
"equals",
"(",
"\"pack... | cast a strong access definition to the int type
@param access access type
@return int access type
@throws ExpressionException | [
"cast",
"a",
"strong",
"access",
"definition",
"to",
"the",
"int",
"type"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ComponentUtil.java#L635-L643 |
i-net-software/jlessc | src/com/inet/lib/less/ColorUtils.java | ColorUtils.colorBlending | private static double colorBlending( double color1, double color2, int op ) {
"""
Color blending operation
@param color1 left color
@param color2 right color
@param op blending operation
@return argb color value
"""
long argb1 = Double.doubleToRawLongBits( color1 );
long r1 = ((argb1 >> 3... | java | private static double colorBlending( double color1, double color2, int op ) {
long argb1 = Double.doubleToRawLongBits( color1 );
long r1 = ((argb1 >> 32) & 0xFFFF);
long g1 = ((argb1 >> 16) & 0xFFFF);
long b1 = ((argb1) & 0xFFFF);
long argb2 = Double.doubleToRawLongBits( color2 ... | [
"private",
"static",
"double",
"colorBlending",
"(",
"double",
"color1",
",",
"double",
"color2",
",",
"int",
"op",
")",
"{",
"long",
"argb1",
"=",
"Double",
".",
"doubleToRawLongBits",
"(",
"color1",
")",
";",
"long",
"r1",
"=",
"(",
"(",
"argb1",
">>",... | Color blending operation
@param color1 left color
@param color2 right color
@param op blending operation
@return argb color value | [
"Color",
"blending",
"operation"
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/ColorUtils.java#L524-L541 |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/auth/RequestSigning.java | RequestSigning.constructSignatureForRequestParameters | public static void constructSignatureForRequestParameters(List<NameValuePair> params, String secretKey) {
"""
Signs a set of request parameters.
<p>
Generates additional parameters to represent the timestamp and generated signature.
Uses the supplied pre-shared secret key to generate the signature.
@param pa... | java | public static void constructSignatureForRequestParameters(List<NameValuePair> params, String secretKey) {
constructSignatureForRequestParameters(params, secretKey, System.currentTimeMillis() / 1000);
} | [
"public",
"static",
"void",
"constructSignatureForRequestParameters",
"(",
"List",
"<",
"NameValuePair",
">",
"params",
",",
"String",
"secretKey",
")",
"{",
"constructSignatureForRequestParameters",
"(",
"params",
",",
"secretKey",
",",
"System",
".",
"currentTimeMilli... | Signs a set of request parameters.
<p>
Generates additional parameters to represent the timestamp and generated signature.
Uses the supplied pre-shared secret key to generate the signature.
@param params List of NameValuePair instances containing the query parameters for the request that is to be signed
@param secretK... | [
"Signs",
"a",
"set",
"of",
"request",
"parameters",
".",
"<p",
">",
"Generates",
"additional",
"parameters",
"to",
"represent",
"the",
"timestamp",
"and",
"generated",
"signature",
".",
"Uses",
"the",
"supplied",
"pre",
"-",
"shared",
"secret",
"key",
"to",
... | train | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/auth/RequestSigning.java#L62-L64 |
JOML-CI/JOML | src/org/joml/Matrix3x2d.java | Matrix3x2d.rotateLocal | public Matrix3x2d rotateLocal(double ang, Matrix3x2d dest) {
"""
Pre-multiply a rotation to this matrix by rotating the given amount of radians and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>R</code> the rotation matrix,
then the new matrix will be <code>R... | java | public Matrix3x2d rotateLocal(double ang, Matrix3x2d dest) {
double sin = Math.sin(ang);
double cos = Math.cosFromSin(sin, ang);
double nm00 = cos * m00 - sin * m01;
double nm01 = sin * m00 + cos * m01;
double nm10 = cos * m10 - sin * m11;
double nm11 = sin * m10 + cos * ... | [
"public",
"Matrix3x2d",
"rotateLocal",
"(",
"double",
"ang",
",",
"Matrix3x2d",
"dest",
")",
"{",
"double",
"sin",
"=",
"Math",
".",
"sin",
"(",
"ang",
")",
";",
"double",
"cos",
"=",
"Math",
".",
"cosFromSin",
"(",
"sin",
",",
"ang",
")",
";",
"doub... | Pre-multiply a rotation to this matrix by rotating the given amount of radians and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>R</code> the rotation matrix,
then the new matrix will be <code>R * M</code>. So when transforming a
vector <code>v</code> with the new ma... | [
"Pre",
"-",
"multiply",
"a",
"rotation",
"to",
"this",
"matrix",
"by",
"rotating",
"the",
"given",
"amount",
"of",
"radians",
"and",
"store",
"the",
"result",
"in",
"<code",
">",
"dest<",
"/",
"code",
">",
".",
"<p",
">",
"If",
"<code",
">",
"M<",
"/... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3x2d.java#L1926-L1942 |
liferay/com-liferay-commerce | commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListItemPersistenceImpl.java | CommerceWishListItemPersistenceImpl.findByCW_CPI | @Override
public List<CommerceWishListItem> findByCW_CPI(long commerceWishListId,
String CPInstanceUuid, int start, int end) {
"""
Returns a range of all the commerce wish list items where commerceWishListId = ? and CPInstanceUuid = ?.
<p>
Useful when paginating results. Returns a maximum of <code>e... | java | @Override
public List<CommerceWishListItem> findByCW_CPI(long commerceWishListId,
String CPInstanceUuid, int start, int end) {
return findByCW_CPI(commerceWishListId, CPInstanceUuid, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceWishListItem",
">",
"findByCW_CPI",
"(",
"long",
"commerceWishListId",
",",
"String",
"CPInstanceUuid",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCW_CPI",
"(",
"commerceWishListId",
",",
"... | Returns a range of all the commerce wish list items where commerceWishListId = ? and CPInstanceUuid = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"wish",
"list",
"items",
"where",
"commerceWishListId",
"=",
"?",
";",
"and",
"CPInstanceUuid",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListItemPersistenceImpl.java#L1758-L1762 |
cubedtear/aritzh | aritzh-core/src/main/java/io/github/aritzhack/aritzh/util/IOUtil.java | IOUtil.getAppDir | public static File getAppDir(String name) throws IOException {
"""
Gets a folder to store application data, such as save or config files.
It will be located under:
<ul>
<li>In Windows: {@code %APPDATA%\name}, and if it fails, under {@code System.getProperty("user.home")\name}.</li>
<li>In OSX: under {@code Sys... | java | public static File getAppDir(String name) throws IOException {
String s1 = System.getProperty("user.home", ".");
File file1;
switch (OSUtil.getOs()) {
case WINDOWS:
String s2 = System.getenv("APPDATA");
if (s2 != null) {
file1 = new File(s2, name + '/');
} else {
file1 = new File(s1, na... | [
"public",
"static",
"File",
"getAppDir",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"String",
"s1",
"=",
"System",
".",
"getProperty",
"(",
"\"user.home\"",
",",
"\".\"",
")",
";",
"File",
"file1",
";",
"switch",
"(",
"OSUtil",
".",
"getOs",... | Gets a folder to store application data, such as save or config files.
It will be located under:
<ul>
<li>In Windows: {@code %APPDATA%\name}, and if it fails, under {@code System.getProperty("user.home")\name}.</li>
<li>In OSX: under {@code System.getProperty("user.home")/Library/Application Support/name}.</li>
<li>In ... | [
"Gets",
"a",
"folder",
"to",
"store",
"application",
"data",
"such",
"as",
"save",
"or",
"config",
"files",
".",
"It",
"will",
"be",
"located",
"under",
":",
"<ul",
">",
"<li",
">",
"In",
"Windows",
":",
"{",
"@code",
"%APPDATA%",
"\\",
"name",
"}",
... | train | https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-core/src/main/java/io/github/aritzhack/aritzh/util/IOUtil.java#L140-L167 |
atomix/atomix | protocols/primary-backup/src/main/java/io/atomix/protocols/backup/service/impl/PrimaryBackupServiceContext.java | PrimaryBackupServiceContext.createSession | public PrimaryBackupSession createSession(long sessionId, MemberId memberId) {
"""
Creates a service session.
@param sessionId the session to create
@param memberId the owning node ID
@return the service session
"""
PrimaryBackupSession session = new PrimaryBackupSession(SessionId.from(sessionId), me... | java | public PrimaryBackupSession createSession(long sessionId, MemberId memberId) {
PrimaryBackupSession session = new PrimaryBackupSession(SessionId.from(sessionId), memberId, service.serializer(), this);
if (sessions.putIfAbsent(sessionId, session) == null) {
service.register(session);
}
return sessi... | [
"public",
"PrimaryBackupSession",
"createSession",
"(",
"long",
"sessionId",
",",
"MemberId",
"memberId",
")",
"{",
"PrimaryBackupSession",
"session",
"=",
"new",
"PrimaryBackupSession",
"(",
"SessionId",
".",
"from",
"(",
"sessionId",
")",
",",
"memberId",
",",
"... | Creates a service session.
@param sessionId the session to create
@param memberId the owning node ID
@return the service session | [
"Creates",
"a",
"service",
"session",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/primary-backup/src/main/java/io/atomix/protocols/backup/service/impl/PrimaryBackupServiceContext.java#L519-L525 |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java | PersistentEntityStoreImpl.deleteLinks | private void deleteLinks(@NotNull final PersistentStoreTransaction txn, @NotNull final PersistentEntity entity) {
"""
Deletes all outgoing links of specified entity.
@param entity the entity.
"""
final PersistentEntityId id = entity.getId();
final int entityTypeId = id.getTypeId();
f... | java | private void deleteLinks(@NotNull final PersistentStoreTransaction txn, @NotNull final PersistentEntity entity) {
final PersistentEntityId id = entity.getId();
final int entityTypeId = id.getTypeId();
final long entityLocalId = id.getLocalId();
final Transaction envTxn = txn.getEnvironme... | [
"private",
"void",
"deleteLinks",
"(",
"@",
"NotNull",
"final",
"PersistentStoreTransaction",
"txn",
",",
"@",
"NotNull",
"final",
"PersistentEntity",
"entity",
")",
"{",
"final",
"PersistentEntityId",
"id",
"=",
"entity",
".",
"getId",
"(",
")",
";",
"final",
... | Deletes all outgoing links of specified entity.
@param entity the entity. | [
"Deletes",
"all",
"outgoing",
"links",
"of",
"specified",
"entity",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java#L1543-L1572 |
jblas-project/jblas | src/main/java/org/jblas/Eigen.java | Eigen.symmetricGeneralizedEigenvalues | public static FloatMatrix symmetricGeneralizedEigenvalues(FloatMatrix A, FloatMatrix B) {
"""
Compute generalized eigenvalues of the problem A x = L B x.
@param A symmetric Matrix A. Only the upper triangle will be considered.
@param B symmetric Matrix B. Only the upper triangle will be considered.
@return a ... | java | public static FloatMatrix symmetricGeneralizedEigenvalues(FloatMatrix A, FloatMatrix B) {
A.assertSquare();
B.assertSquare();
FloatMatrix W = new FloatMatrix(A.rows);
SimpleBlas.sygvd(1, 'N', 'U', A.dup(), B.dup(), W);
return W;
} | [
"public",
"static",
"FloatMatrix",
"symmetricGeneralizedEigenvalues",
"(",
"FloatMatrix",
"A",
",",
"FloatMatrix",
"B",
")",
"{",
"A",
".",
"assertSquare",
"(",
")",
";",
"B",
".",
"assertSquare",
"(",
")",
";",
"FloatMatrix",
"W",
"=",
"new",
"FloatMatrix",
... | Compute generalized eigenvalues of the problem A x = L B x.
@param A symmetric Matrix A. Only the upper triangle will be considered.
@param B symmetric Matrix B. Only the upper triangle will be considered.
@return a vector of eigenvalues L. | [
"Compute",
"generalized",
"eigenvalues",
"of",
"the",
"problem",
"A",
"x",
"=",
"L",
"B",
"x",
"."
] | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/Eigen.java#L393-L399 |
looly/hulu | src/main/java/com/xiaoleilu/hulu/Request.java | Request.getDateParam | public static Date getDateParam(String name, Date defaultValue) {
"""
格式:<br>
1、yyyy-MM-dd HH:mm:ss <br>
2、yyyy-MM-dd <br>
3、HH:mm:ss <br>
@param name 参数名
@param defaultValue 当客户端未传参的默认值
@return 获得Date类型请求参数,默认格式:
"""
String param = getParam(name);
return StrUtil.isBlank(param) ? defaultValue : D... | java | public static Date getDateParam(String name, Date defaultValue) {
String param = getParam(name);
return StrUtil.isBlank(param) ? defaultValue : DateUtil.parse(param);
} | [
"public",
"static",
"Date",
"getDateParam",
"(",
"String",
"name",
",",
"Date",
"defaultValue",
")",
"{",
"String",
"param",
"=",
"getParam",
"(",
"name",
")",
";",
"return",
"StrUtil",
".",
"isBlank",
"(",
"param",
")",
"?",
"defaultValue",
":",
"DateUtil... | 格式:<br>
1、yyyy-MM-dd HH:mm:ss <br>
2、yyyy-MM-dd <br>
3、HH:mm:ss <br>
@param name 参数名
@param defaultValue 当客户端未传参的默认值
@return 获得Date类型请求参数,默认格式: | [
"格式:<br",
">",
"1、yyyy",
"-",
"MM",
"-",
"dd",
"HH",
":",
"mm",
":",
"ss",
"<br",
">",
"2、yyyy",
"-",
"MM",
"-",
"dd",
"<br",
">",
"3、HH",
":",
"mm",
":",
"ss",
"<br",
">"
] | train | https://github.com/looly/hulu/blob/4072de684e2e2f28ac8a3a44c0d5a690b289ef28/src/main/java/com/xiaoleilu/hulu/Request.java#L365-L368 |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/appenders/SarlBehaviorUnitSourceAppender.java | SarlBehaviorUnitSourceAppender.newTypeRef | public JvmParameterizedTypeReference newTypeRef(Notifier context, String typeName) {
"""
Find the reference to the type with the given name.
@param context the context for the type reference use
@param typeName the fully qualified name of the type
@return the type reference.
"""
return this.builder.newTyp... | java | public JvmParameterizedTypeReference newTypeRef(Notifier context, String typeName) {
return this.builder.newTypeRef(context, typeName);
} | [
"public",
"JvmParameterizedTypeReference",
"newTypeRef",
"(",
"Notifier",
"context",
",",
"String",
"typeName",
")",
"{",
"return",
"this",
".",
"builder",
".",
"newTypeRef",
"(",
"context",
",",
"typeName",
")",
";",
"}"
] | Find the reference to the type with the given name.
@param context the context for the type reference use
@param typeName the fully qualified name of the type
@return the type reference. | [
"Find",
"the",
"reference",
"to",
"the",
"type",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/appenders/SarlBehaviorUnitSourceAppender.java#L67-L69 |
atomix/atomix | utils/src/main/java/io/atomix/utils/net/Address.java | Address.from | public static Address from(int port) {
"""
Returns an address for the local host and the given port.
@param port the port
@return a new address
"""
try {
InetAddress address = getLocalAddress();
return new Address(address.getHostName(), port);
} catch (UnknownHostException e) {
th... | java | public static Address from(int port) {
try {
InetAddress address = getLocalAddress();
return new Address(address.getHostName(), port);
} catch (UnknownHostException e) {
throw new IllegalArgumentException("Failed to locate host", e);
}
} | [
"public",
"static",
"Address",
"from",
"(",
"int",
"port",
")",
"{",
"try",
"{",
"InetAddress",
"address",
"=",
"getLocalAddress",
"(",
")",
";",
"return",
"new",
"Address",
"(",
"address",
".",
"getHostName",
"(",
")",
",",
"port",
")",
";",
"}",
"cat... | Returns an address for the local host and the given port.
@param port the port
@return a new address | [
"Returns",
"an",
"address",
"for",
"the",
"local",
"host",
"and",
"the",
"given",
"port",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/utils/src/main/java/io/atomix/utils/net/Address.java#L96-L103 |
guardtime/ksi-java-sdk | ksi-common/src/main/java/com/guardtime/ksi/util/Util.java | Util.decodeString | public static String decodeString(byte[] buf, int ofs, int len) throws CharacterCodingException {
"""
Decodes UTF-8 string from the given buffer.
@param buf
the buffer.
@param ofs
offset of the UTF-8 data in the buffer.
@param len
length of the UTF-8 data to decode.
@return The decoded string.
@throws ... | java | public static String decodeString(byte[] buf, int ofs, int len) throws CharacterCodingException {
if (ofs < 0 || len < 0 || ofs + len < 0 || ofs + len > buf.length) {
throw new IndexOutOfBoundsException();
}
CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder().onMalformedI... | [
"public",
"static",
"String",
"decodeString",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"ofs",
",",
"int",
"len",
")",
"throws",
"CharacterCodingException",
"{",
"if",
"(",
"ofs",
"<",
"0",
"||",
"len",
"<",
"0",
"||",
"ofs",
"+",
"len",
"<",
"0",
... | Decodes UTF-8 string from the given buffer.
@param buf
the buffer.
@param ofs
offset of the UTF-8 data in the buffer.
@param len
length of the UTF-8 data to decode.
@return The decoded string.
@throws CharacterCodingException
when the specified data is not in valid UTF-8 format. | [
"Decodes",
"UTF",
"-",
"8",
"string",
"from",
"the",
"given",
"buffer",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-common/src/main/java/com/guardtime/ksi/util/Util.java#L146-L154 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/awt/font/NumericShaper.java | NumericShaper.getContextualShaper | public static NumericShaper getContextualShaper(Set<Range> ranges,
Range defaultContext) {
"""
Returns a contextual shaper for the provided Unicode range(s).
The Latin-1 (EUROPEAN) digits will be converted to the decimal
digits corresponding to the range of the... | java | public static NumericShaper getContextualShaper(Set<Range> ranges,
Range defaultContext) {
if (defaultContext == null) {
throw new NullPointerException();
}
NumericShaper shaper = new NumericShaper(defaultContext, ranges);
s... | [
"public",
"static",
"NumericShaper",
"getContextualShaper",
"(",
"Set",
"<",
"Range",
">",
"ranges",
",",
"Range",
"defaultContext",
")",
"{",
"if",
"(",
"defaultContext",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"N... | Returns a contextual shaper for the provided Unicode range(s).
The Latin-1 (EUROPEAN) digits will be converted to the decimal
digits corresponding to the range of the preceding text, if the
range is one of the provided ranges. The shaper uses {@code
defaultContext} as the starting context.
@param ranges the specified ... | [
"Returns",
"a",
"contextual",
"shaper",
"for",
"the",
"provided",
"Unicode",
"range",
"(",
"s",
")",
".",
"The",
"Latin",
"-",
"1",
"(",
"EUROPEAN",
")",
"digits",
"will",
"be",
"converted",
"to",
"the",
"decimal",
"digits",
"corresponding",
"to",
"the",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/awt/font/NumericShaper.java#L1040-L1048 |
molgenis/molgenis | molgenis-data-postgresql/src/main/java/org/molgenis/data/postgresql/PostgreSqlExceptionTranslator.java | PostgreSqlExceptionTranslator.translateInvalidIntegerException | static MolgenisValidationException translateInvalidIntegerException(PSQLException pSqlException) {
"""
Package private for testability
@param pSqlException PostgreSQL exception
@return translated validation exception
"""
ServerErrorMessage serverErrorMessage = pSqlException.getServerErrorMessage();
... | java | static MolgenisValidationException translateInvalidIntegerException(PSQLException pSqlException) {
ServerErrorMessage serverErrorMessage = pSqlException.getServerErrorMessage();
String message = serverErrorMessage.getMessage();
Matcher matcher =
Pattern.compile("invalid input syntax for \\b(?:type )... | [
"static",
"MolgenisValidationException",
"translateInvalidIntegerException",
"(",
"PSQLException",
"pSqlException",
")",
"{",
"ServerErrorMessage",
"serverErrorMessage",
"=",
"pSqlException",
".",
"getServerErrorMessage",
"(",
")",
";",
"String",
"message",
"=",
"serverErrorM... | Package private for testability
@param pSqlException PostgreSQL exception
@return translated validation exception | [
"Package",
"private",
"for",
"testability"
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data-postgresql/src/main/java/org/molgenis/data/postgresql/PostgreSqlExceptionTranslator.java#L231-L271 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/form/dropdown/OptGroupDropDownChoice.java | OptGroupDropDownChoice.appendOptGroupLabel | private void appendOptGroupLabel(final AppendingStringBuffer buffer, final T optGroup) {
"""
Appends the label of the given opt group object to the given {@link AppendingStringBuffer}
object.
@param buffer
the buffer
@param optGroup
the opt group to append.
"""
buffer.append("\n<optgroup label='")
... | java | private void appendOptGroupLabel(final AppendingStringBuffer buffer, final T optGroup)
{
buffer.append("\n<optgroup label='")
.append(Strings.escapeMarkup(getOptGroupLabel(optGroup))).append("'>");
} | [
"private",
"void",
"appendOptGroupLabel",
"(",
"final",
"AppendingStringBuffer",
"buffer",
",",
"final",
"T",
"optGroup",
")",
"{",
"buffer",
".",
"append",
"(",
"\"\\n<optgroup label='\"",
")",
".",
"append",
"(",
"Strings",
".",
"escapeMarkup",
"(",
"getOptGroup... | Appends the label of the given opt group object to the given {@link AppendingStringBuffer}
object.
@param buffer
the buffer
@param optGroup
the opt group to append. | [
"Appends",
"the",
"label",
"of",
"the",
"given",
"opt",
"group",
"object",
"to",
"the",
"given",
"{",
"@link",
"AppendingStringBuffer",
"}",
"object",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/form/dropdown/OptGroupDropDownChoice.java#L193-L197 |
datacleaner/DataCleaner | desktop/ui/src/main/java/org/datacleaner/panels/result/ProgressInformationPanel.java | ProgressInformationPanel.printStackTrace | protected void printStackTrace(final PrintWriter printWriter, final Throwable throwable) {
"""
Prints stacktraces to the string writer, and investigates the throwable
hierarchy to check if there's any {@link SQLException}s which also has
"next" exceptions.
@param printWriter
@param throwable
"""
... | java | protected void printStackTrace(final PrintWriter printWriter, final Throwable throwable) {
throwable.printStackTrace(printWriter);
Throwable cause = throwable.getCause();
while (cause != null) {
if (cause instanceof SQLException) {
final SQLException nextException = (... | [
"protected",
"void",
"printStackTrace",
"(",
"final",
"PrintWriter",
"printWriter",
",",
"final",
"Throwable",
"throwable",
")",
"{",
"throwable",
".",
"printStackTrace",
"(",
"printWriter",
")",
";",
"Throwable",
"cause",
"=",
"throwable",
".",
"getCause",
"(",
... | Prints stacktraces to the string writer, and investigates the throwable
hierarchy to check if there's any {@link SQLException}s which also has
"next" exceptions.
@param printWriter
@param throwable | [
"Prints",
"stacktraces",
"to",
"the",
"string",
"writer",
"and",
"investigates",
"the",
"throwable",
"hierarchy",
"to",
"check",
"if",
"there",
"s",
"any",
"{",
"@link",
"SQLException",
"}",
"s",
"which",
"also",
"has",
"next",
"exceptions",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/desktop/ui/src/main/java/org/datacleaner/panels/result/ProgressInformationPanel.java#L176-L189 |
apptik/jus | android/jus-android/src/main/java/io/apptik/comm/jus/ui/ImageLoader.java | ImageLoader.isCached | public boolean isCached(String requestUrl, int maxWidth, int maxHeight, ScaleType scaleType) {
"""
Checks if the item is available in the cache.
@param requestUrl The url of the remote image
@param maxWidth The maximum width of the returned image.
@param maxHeight The maximum height of the returned image.
... | java | public boolean isCached(String requestUrl, int maxWidth, int maxHeight, ScaleType scaleType) {
throwIfNotOnMainThread();
String cacheKey = getCacheKey(requestUrl, maxWidth, maxHeight, scaleType);
return imageCache.getBitmap(cacheKey) != null;
} | [
"public",
"boolean",
"isCached",
"(",
"String",
"requestUrl",
",",
"int",
"maxWidth",
",",
"int",
"maxHeight",
",",
"ScaleType",
"scaleType",
")",
"{",
"throwIfNotOnMainThread",
"(",
")",
";",
"String",
"cacheKey",
"=",
"getCacheKey",
"(",
"requestUrl",
",",
"... | Checks if the item is available in the cache.
@param requestUrl The url of the remote image
@param maxWidth The maximum width of the returned image.
@param maxHeight The maximum height of the returned image.
@param scaleType The scaleType of the imageView.
@return True if the item exists in cache, false otherwise. | [
"Checks",
"if",
"the",
"item",
"is",
"available",
"in",
"the",
"cache",
"."
] | train | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/android/jus-android/src/main/java/io/apptik/comm/jus/ui/ImageLoader.java#L222-L227 |
googlemaps/google-maps-services-java | src/main/java/com/google/maps/StaticMapsApi.java | StaticMapsApi.newRequest | public static StaticMapsRequest newRequest(GeoApiContext context, Size size) {
"""
Create a new {@code StaticMapRequest}.
@param context The {@code GeoApiContext} to make this request through.
@param size The size of the static map.
@return Returns a new {@code StaticMapRequest} with configured size.
"""
... | java | public static StaticMapsRequest newRequest(GeoApiContext context, Size size) {
return new StaticMapsRequest(context).size(size);
} | [
"public",
"static",
"StaticMapsRequest",
"newRequest",
"(",
"GeoApiContext",
"context",
",",
"Size",
"size",
")",
"{",
"return",
"new",
"StaticMapsRequest",
"(",
"context",
")",
".",
"size",
"(",
"size",
")",
";",
"}"
] | Create a new {@code StaticMapRequest}.
@param context The {@code GeoApiContext} to make this request through.
@param size The size of the static map.
@return Returns a new {@code StaticMapRequest} with configured size. | [
"Create",
"a",
"new",
"{",
"@code",
"StaticMapRequest",
"}",
"."
] | train | https://github.com/googlemaps/google-maps-services-java/blob/23d20d1930f80e310d856d2da51d72ee0db4476b/src/main/java/com/google/maps/StaticMapsApi.java#L31-L33 |
molgenis/molgenis | molgenis-data-postgresql/src/main/java/org/molgenis/data/postgresql/PostgreSqlQueryGenerator.java | PostgreSqlQueryGenerator.getSqlAddColumn | static String getSqlAddColumn(EntityType entityType, Attribute attr, ColumnMode columnMode) {
"""
Returns SQL string to add a column to an existing table.
@param entityType entity meta data
@param attr attribute
@param columnMode column mode
@return SQL string
"""
StringBuilder sql = new StringBuilde... | java | static String getSqlAddColumn(EntityType entityType, Attribute attr, ColumnMode columnMode) {
StringBuilder sql = new StringBuilder("ALTER TABLE ");
String columnSql = getSqlColumn(entityType, attr, columnMode);
sql.append(getTableName(entityType)).append(" ADD ").append(columnSql);
List<String> sqlTa... | [
"static",
"String",
"getSqlAddColumn",
"(",
"EntityType",
"entityType",
",",
"Attribute",
"attr",
",",
"ColumnMode",
"columnMode",
")",
"{",
"StringBuilder",
"sql",
"=",
"new",
"StringBuilder",
"(",
"\"ALTER TABLE \"",
")",
";",
"String",
"columnSql",
"=",
"getSql... | Returns SQL string to add a column to an existing table.
@param entityType entity meta data
@param attr attribute
@param columnMode column mode
@return SQL string | [
"Returns",
"SQL",
"string",
"to",
"add",
"a",
"column",
"to",
"an",
"existing",
"table",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data-postgresql/src/main/java/org/molgenis/data/postgresql/PostgreSqlQueryGenerator.java#L212-L224 |
virgo47/javasimon | examples/src/main/java/org/javasimon/examples/SimonDataGenerator.java | SimonDataGenerator.addStopwatchSplits | private void addStopwatchSplits(Stopwatch stopwatch, int splitWidth) {
"""
Generate a Simon of type "Stopwatch" and fill it with some Splits.
@param splitWidth Max number of splits per Stopwatch
"""
final int splits = randomInt(splitWidth / 2, splitWidth);
try {
lock.lock();
System.out.print(stopw... | java | private void addStopwatchSplits(Stopwatch stopwatch, int splitWidth) {
final int splits = randomInt(splitWidth / 2, splitWidth);
try {
lock.lock();
System.out.print(stopwatch.getName() + " " + splits + ": ");
for (int i = 0; i < splits; i++) {
System.out.print(addStopwatchSplit(stopwatch) + ",");
}
... | [
"private",
"void",
"addStopwatchSplits",
"(",
"Stopwatch",
"stopwatch",
",",
"int",
"splitWidth",
")",
"{",
"final",
"int",
"splits",
"=",
"randomInt",
"(",
"splitWidth",
"/",
"2",
",",
"splitWidth",
")",
";",
"try",
"{",
"lock",
".",
"lock",
"(",
")",
"... | Generate a Simon of type "Stopwatch" and fill it with some Splits.
@param splitWidth Max number of splits per Stopwatch | [
"Generate",
"a",
"Simon",
"of",
"type",
"Stopwatch",
"and",
"fill",
"it",
"with",
"some",
"Splits",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/examples/src/main/java/org/javasimon/examples/SimonDataGenerator.java#L147-L159 |
antopen/alipay-sdk-java | src/main/java/com/alipay/api/internal/util/XmlUtils.java | XmlUtils.getElement | public static Element getElement(Element parent, String tagName) {
"""
Gets the immediately descendant element from the parent element.
@param parent the parent element in the element tree
@param tagName the specified tag name.
@return immediately descendant element of parent element, NULL otherwise.
"""
... | java | public static Element getElement(Element parent, String tagName) {
List<Element> children = getElements(parent, tagName);
if (children.isEmpty()) {
return null;
} else {
return children.get(0);
}
} | [
"public",
"static",
"Element",
"getElement",
"(",
"Element",
"parent",
",",
"String",
"tagName",
")",
"{",
"List",
"<",
"Element",
">",
"children",
"=",
"getElements",
"(",
"parent",
",",
"tagName",
")",
";",
"if",
"(",
"children",
".",
"isEmpty",
"(",
"... | Gets the immediately descendant element from the parent element.
@param parent the parent element in the element tree
@param tagName the specified tag name.
@return immediately descendant element of parent element, NULL otherwise. | [
"Gets",
"the",
"immediately",
"descendant",
"element",
"from",
"the",
"parent",
"element",
"."
] | train | https://github.com/antopen/alipay-sdk-java/blob/e82aeac7d0239330ee173c7e393596e51e41c1cd/src/main/java/com/alipay/api/internal/util/XmlUtils.java#L246-L254 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static void encodeDesc(Boolean value, byte[] dst, int dstOffset) {
"""
Encodes the given Boolean object into exactly 1 byte for descending
order.
@param value optional Boolean value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array
"""
if (v... | java | public static void encodeDesc(Boolean value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
} else {
dst[dstOffset] = value.booleanValue() ? (byte)127 : (byte)128;
}
} | [
"public",
"static",
"void",
"encodeDesc",
"(",
"Boolean",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_LOW",
";",
"}",
"else",
"{",... | Encodes the given Boolean object into exactly 1 byte for descending
order.
@param value optional Boolean value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array | [
"Encodes",
"the",
"given",
"Boolean",
"object",
"into",
"exactly",
"1",
"byte",
"for",
"descending",
"order",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L221-L227 |
SQiShER/java-object-diff | src/main/java/de/danielbechler/diff/node/DiffNode.java | DiffNode.setParentNode | protected final void setParentNode(final DiffNode parentNode) {
"""
Sets the parent node.
@param parentNode The parent of this node. May be null, if this is a root node.
"""
if (this.parentNode != null && this.parentNode != parentNode)
{
throw new IllegalStateException("The parent of a node cannot be... | java | protected final void setParentNode(final DiffNode parentNode)
{
if (this.parentNode != null && this.parentNode != parentNode)
{
throw new IllegalStateException("The parent of a node cannot be changed, once it's set.");
}
this.parentNode = parentNode;
} | [
"protected",
"final",
"void",
"setParentNode",
"(",
"final",
"DiffNode",
"parentNode",
")",
"{",
"if",
"(",
"this",
".",
"parentNode",
"!=",
"null",
"&&",
"this",
".",
"parentNode",
"!=",
"parentNode",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
... | Sets the parent node.
@param parentNode The parent of this node. May be null, if this is a root node. | [
"Sets",
"the",
"parent",
"node",
"."
] | train | https://github.com/SQiShER/java-object-diff/blob/6f576669d49087f0e825a417cadc3d4c707a4924/src/main/java/de/danielbechler/diff/node/DiffNode.java#L616-L623 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/query/Parser.java | Parser.findMinIfNot | private int findMinIfNot(int a, int b, int notMin) {
"""
finds min choosing a lower bound.
@param a first number
@param b second number
@param notMin lower bound
"""
if (a <= notMin) {
return b;
}
if (b <= notMin) {
return a;
}
retu... | java | private int findMinIfNot(int a, int b, int notMin) {
if (a <= notMin) {
return b;
}
if (b <= notMin) {
return a;
}
return Math.min(a, b);
} | [
"private",
"int",
"findMinIfNot",
"(",
"int",
"a",
",",
"int",
"b",
",",
"int",
"notMin",
")",
"{",
"if",
"(",
"a",
"<=",
"notMin",
")",
"{",
"return",
"b",
";",
"}",
"if",
"(",
"b",
"<=",
"notMin",
")",
"{",
"return",
"a",
";",
"}",
"return",
... | finds min choosing a lower bound.
@param a first number
@param b second number
@param notMin lower bound | [
"finds",
"min",
"choosing",
"a",
"lower",
"bound",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/query/Parser.java#L226-L234 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/MapTileTransitionModel.java | MapTileTransitionModel.updateTile | private void updateTile(Collection<Tile> resolved,
Collection<Tile> toResolve,
Tile tile,
Tile neighbor,
Transition transition) {
"""
Update tile.
@param resolved The resolved tiles.
@param toRes... | java | private void updateTile(Collection<Tile> resolved,
Collection<Tile> toResolve,
Tile tile,
Tile neighbor,
Transition transition)
{
final Iterator<TileRef> iterator = getTiles(transition).iter... | [
"private",
"void",
"updateTile",
"(",
"Collection",
"<",
"Tile",
">",
"resolved",
",",
"Collection",
"<",
"Tile",
">",
"toResolve",
",",
"Tile",
"tile",
",",
"Tile",
"neighbor",
",",
"Transition",
"transition",
")",
"{",
"final",
"Iterator",
"<",
"TileRef",
... | Update tile.
@param resolved The resolved tiles.
@param toResolve Tiles to resolve after.
@param tile The tile placed.
@param neighbor The tile to update.
@param transition The transition to set. | [
"Update",
"tile",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/MapTileTransitionModel.java#L279-L310 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/EpicsApi.java | EpicsApi.assignIssue | public EpicIssue assignIssue(Object groupIdOrPath, Integer epicIid, Integer issueIid) throws GitLabApiException {
"""
Creates an epic - issue association. If the issue in question belongs to another epic
it is unassigned from that epic.
<pre><code>GitLab Endpoint: POST /groups/:id/epics/:epic_iid/issues/:issue... | java | public EpicIssue assignIssue(Object groupIdOrPath, Integer epicIid, Integer issueIid) throws GitLabApiException {
Response response = post(Response.Status.CREATED, (Form)null,
"groups", getGroupIdOrPath(groupIdOrPath), "epics", epicIid, "issues", issueIid);
return (response.readEntity(Ep... | [
"public",
"EpicIssue",
"assignIssue",
"(",
"Object",
"groupIdOrPath",
",",
"Integer",
"epicIid",
",",
"Integer",
"issueIid",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"post",
"(",
"Response",
".",
"Status",
".",
"CREATED",
",",
"(",
... | Creates an epic - issue association. If the issue in question belongs to another epic
it is unassigned from that epic.
<pre><code>GitLab Endpoint: POST /groups/:id/epics/:epic_iid/issues/:issue_id</code></pre>
@param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
@para... | [
"Creates",
"an",
"epic",
"-",
"issue",
"association",
".",
"If",
"the",
"issue",
"in",
"question",
"belongs",
"to",
"another",
"epic",
"it",
"is",
"unassigned",
"from",
"that",
"epic",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/EpicsApi.java#L416-L420 |
google/error-prone | check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java | ASTHelpers.targetType | @Nullable
public static TargetType targetType(VisitorState state) {
"""
Returns the target type of the tree at the given {@link VisitorState}'s path, or else {@code
null}.
<p>For example, the target type of an assignment expression is the variable's type, and the
target type of a return statement is the enc... | java | @Nullable
public static TargetType targetType(VisitorState state) {
if (!(state.getPath().getLeaf() instanceof ExpressionTree)) {
return null;
}
TreePath parent = state.getPath();
ExpressionTree current;
do {
current = (ExpressionTree) parent.getLeaf();
parent = parent.getParentP... | [
"@",
"Nullable",
"public",
"static",
"TargetType",
"targetType",
"(",
"VisitorState",
"state",
")",
"{",
"if",
"(",
"!",
"(",
"state",
".",
"getPath",
"(",
")",
".",
"getLeaf",
"(",
")",
"instanceof",
"ExpressionTree",
")",
")",
"{",
"return",
"null",
";... | Returns the target type of the tree at the given {@link VisitorState}'s path, or else {@code
null}.
<p>For example, the target type of an assignment expression is the variable's type, and the
target type of a return statement is the enclosing method's type. | [
"Returns",
"the",
"target",
"type",
"of",
"the",
"tree",
"at",
"the",
"given",
"{",
"@link",
"VisitorState",
"}",
"s",
"path",
"or",
"else",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java#L1301-L1322 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.wrapKey | public KeyOperationResult wrapKey(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) {
"""
Wraps a symmetric key using a specified key.
The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored i... | java | public KeyOperationResult wrapKey(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) {
return wrapKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).toBlocking().single().body();
} | [
"public",
"KeyOperationResult",
"wrapKey",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"String",
"keyVersion",
",",
"JsonWebKeyEncryptionAlgorithm",
"algorithm",
",",
"byte",
"[",
"]",
"value",
")",
"{",
"return",
"wrapKeyWithServiceResponseAsync",
"... | Wraps a symmetric key using a specified key.
The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can ... | [
"Wraps",
"a",
"symmetric",
"key",
"using",
"a",
"specified",
"key",
".",
"The",
"WRAP",
"operation",
"supports",
"encryption",
"of",
"a",
"symmetric",
"key",
"using",
"a",
"key",
"encryption",
"key",
"that",
"has",
"previously",
"been",
"stored",
"in",
"an",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L2602-L2604 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/workplace/CmsReInitWorkplace.java | CmsReInitWorkplace.actionReport | public void actionReport() throws JspException {
"""
Performs the re-initialization report, will be called by the JSP page.<p>
@throws JspException if including the error JSP element fails
"""
// save initialized instance of this class in request attribute for included sub-elements
getJsp()... | java | public void actionReport() throws JspException {
// save initialized instance of this class in request attribute for included sub-elements
getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
switch (getAction()) {
case ACTION_CONFIRMED:
default:
... | [
"public",
"void",
"actionReport",
"(",
")",
"throws",
"JspException",
"{",
"// save initialized instance of this class in request attribute for included sub-elements",
"getJsp",
"(",
")",
".",
"getRequest",
"(",
")",
".",
"setAttribute",
"(",
"SESSION_WORKPLACE_CLASS",
",",
... | Performs the re-initialization report, will be called by the JSP page.<p>
@throws JspException if including the error JSP element fails | [
"Performs",
"the",
"re",
"-",
"initialization",
"report",
"will",
"be",
"called",
"by",
"the",
"JSP",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/workplace/CmsReInitWorkplace.java#L80-L99 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/form/SigninFormPanel.java | SigninFormPanel.newSigninPanel | protected Component newSigninPanel(final String id, final IModel<T> model) {
"""
Factory method for creating the new {@link SigninPanel} that contains the TextField for the
email and password. This method is invoked in the constructor from the derived classes and
can be overridden so users can provide their own ... | java | protected Component newSigninPanel(final String id, final IModel<T> model)
{
final Component component = new SigninPanel<>(id, model);
return component;
} | [
"protected",
"Component",
"newSigninPanel",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"T",
">",
"model",
")",
"{",
"final",
"Component",
"component",
"=",
"new",
"SigninPanel",
"<>",
"(",
"id",
",",
"model",
")",
";",
"return",
"component"... | Factory method for creating the new {@link SigninPanel} that contains the TextField for the
email and password. This method is invoked in the constructor from the derived classes and
can be overridden so users can provide their own version of a Component that contains the
TextField for the email and password.
@param i... | [
"Factory",
"method",
"for",
"creating",
"the",
"new",
"{",
"@link",
"SigninPanel",
"}",
"that",
"contains",
"the",
"TextField",
"for",
"the",
"email",
"and",
"password",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"deri... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/form/SigninFormPanel.java#L209-L213 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/cellprocessor/constraint/Equals.java | Equals.execute | public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvConstraintViolationException
if value isn't equal to the constant value (or previously encountered value if a constant wasn't
supplied)
"""
if( UNKNOWN.equals(constantValue) ) {
constantValue = val... | java | public Object execute(final Object value, final CsvContext context) {
if( UNKNOWN.equals(constantValue) ) {
constantValue = value; // no constant supplied, so remember the first value encountered
} else {
if( !equals(constantValue, value) ) {
if( constantSupplied ) {
throw new SuperCsvConstraintViola... | [
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"if",
"(",
"UNKNOWN",
".",
"equals",
"(",
"constantValue",
")",
")",
"{",
"constantValue",
"=",
"value",
";",
"// no constant supplied, so remember t... | {@inheritDoc}
@throws SuperCsvConstraintViolationException
if value isn't equal to the constant value (or previously encountered value if a constant wasn't
supplied) | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/constraint/Equals.java#L103-L118 |
XiaoMi/chronos | chronos-server/src/main/java/com/xiaomi/infra/chronos/ChronosServer.java | ChronosServer.initThriftServer | private void initThriftServer() throws TTransportException, FatalChronosException,
ChronosException {
"""
Initialize Thrift server of ChronosServer.
@throws TTransportException when error to initialize thrift server
@throws FatalChronosException when set a smaller timestamp in ZooKeeper
@throws ChronosE... | java | private void initThriftServer() throws TTransportException, FatalChronosException,
ChronosException {
int maxThread = Integer.parseInt(properties.getProperty(MAX_THREAD,
String.valueOf(Integer.MAX_VALUE)));
String serverHost = properties.getProperty(FailoverServer.SERVER_HOST);
int serverPort =... | [
"private",
"void",
"initThriftServer",
"(",
")",
"throws",
"TTransportException",
",",
"FatalChronosException",
",",
"ChronosException",
"{",
"int",
"maxThread",
"=",
"Integer",
".",
"parseInt",
"(",
"properties",
".",
"getProperty",
"(",
"MAX_THREAD",
",",
"String"... | Initialize Thrift server of ChronosServer.
@throws TTransportException when error to initialize thrift server
@throws FatalChronosException when set a smaller timestamp in ZooKeeper
@throws ChronosException when error to set timestamp in ZooKeeper | [
"Initialize",
"Thrift",
"server",
"of",
"ChronosServer",
"."
] | train | https://github.com/XiaoMi/chronos/blob/92e4a30c98947e87aba47ea88c944a56505a4ec0/chronos-server/src/main/java/com/xiaomi/infra/chronos/ChronosServer.java#L90-L108 |
lessthanoptimal/ejml | main/ejml-core/src/org/ejml/ops/ReadMatrixCsv.java | ReadMatrixCsv.readFDRM | public FMatrixRMaj readFDRM(int numRows, int numCols) throws IOException {
"""
Reads in a {@link FMatrixRMaj} from the IO stream where the user specifies the matrix dimensions.
@param numRows Number of rows in the matrix
@param numCols Number of columns in the matrix
@return FMatrixRMaj
@throws IOException
... | java | public FMatrixRMaj readFDRM(int numRows, int numCols) throws IOException {
FMatrixRMaj A = new FMatrixRMaj(numRows,numCols);
for( int i = 0; i < numRows; i++ ) {
List<String> words = extractWords();
if( words == null )
throw new IOException("Too few rows found. ... | [
"public",
"FMatrixRMaj",
"readFDRM",
"(",
"int",
"numRows",
",",
"int",
"numCols",
")",
"throws",
"IOException",
"{",
"FMatrixRMaj",
"A",
"=",
"new",
"FMatrixRMaj",
"(",
"numRows",
",",
"numCols",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"... | Reads in a {@link FMatrixRMaj} from the IO stream where the user specifies the matrix dimensions.
@param numRows Number of rows in the matrix
@param numCols Number of columns in the matrix
@return FMatrixRMaj
@throws IOException | [
"Reads",
"in",
"a",
"{",
"@link",
"FMatrixRMaj",
"}",
"from",
"the",
"IO",
"stream",
"where",
"the",
"user",
"specifies",
"the",
"matrix",
"dimensions",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/ops/ReadMatrixCsv.java#L155-L172 |
aicer/hibiscus-http-client | src/main/java/org/aicer/hibiscus/util/HashGenerator.java | HashGenerator.getSHA1Hash | public static String getSHA1Hash(final String input) throws HibiscusException {
"""
Returns the SHA1 hash of the input string
@param input Input string
@return String The sha1 hash of the input string
@throws HibiscusException
"""
String hashValue = null;
try {
final Message... | java | public static String getSHA1Hash(final String input) throws HibiscusException {
String hashValue = null;
try {
final MessageDigest messageDigest = MessageDigest.getInstance(MESSAGE_DIGEST_ALGORITHM_SHA1);
byte[] sha1Hash = new byte[BYTE_LENGTH_SHA1];
messageDiges... | [
"public",
"static",
"String",
"getSHA1Hash",
"(",
"final",
"String",
"input",
")",
"throws",
"HibiscusException",
"{",
"String",
"hashValue",
"=",
"null",
";",
"try",
"{",
"final",
"MessageDigest",
"messageDigest",
"=",
"MessageDigest",
".",
"getInstance",
"(",
... | Returns the SHA1 hash of the input string
@param input Input string
@return String The sha1 hash of the input string
@throws HibiscusException | [
"Returns",
"the",
"SHA1",
"hash",
"of",
"the",
"input",
"string"
] | train | https://github.com/aicer/hibiscus-http-client/blob/a037e3cf8d4bb862d38a55a090778736a48d67cc/src/main/java/org/aicer/hibiscus/util/HashGenerator.java#L87-L108 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.obtainNewMapTask | public synchronized Task obtainNewMapTask(TaskTrackerStatus tts,
int clusterSize,
int numUniqueHosts
) throws IOException {
"""
Return a MapTask, if appropriate, to run on the given ta... | java | public synchronized Task obtainNewMapTask(TaskTrackerStatus tts,
int clusterSize,
int numUniqueHosts
) throws IOException {
return obtainNewMapTask(tts, clusterSize, numUniqueHosts, any... | [
"public",
"synchronized",
"Task",
"obtainNewMapTask",
"(",
"TaskTrackerStatus",
"tts",
",",
"int",
"clusterSize",
",",
"int",
"numUniqueHosts",
")",
"throws",
"IOException",
"{",
"return",
"obtainNewMapTask",
"(",
"tts",
",",
"clusterSize",
",",
"numUniqueHosts",
",... | Return a MapTask, if appropriate, to run on the given tasktracker | [
"Return",
"a",
"MapTask",
"if",
"appropriate",
"to",
"run",
"on",
"the",
"given",
"tasktracker"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L1390-L1395 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/enhance/EnhanceImageOps.java | EnhanceImageOps.applyTransform | public static void applyTransform(GrayU8 input , int transform[] , GrayU8 output ) {
"""
Applies the transformation table to the provided input image.
@param input Input image.
@param transform Input transformation table.
@param output Output image.
"""
output.reshape(input.width,input.height);
if( B... | java | public static void applyTransform(GrayU8 input , int transform[] , GrayU8 output ) {
output.reshape(input.width,input.height);
if( BoofConcurrency.USE_CONCURRENT ) {
ImplEnhanceHistogram_MT.applyTransform(input, transform, output);
} else {
ImplEnhanceHistogram.applyTransform(input, transform, output);
}... | [
"public",
"static",
"void",
"applyTransform",
"(",
"GrayU8",
"input",
",",
"int",
"transform",
"[",
"]",
",",
"GrayU8",
"output",
")",
"{",
"output",
".",
"reshape",
"(",
"input",
".",
"width",
",",
"input",
".",
"height",
")",
";",
"if",
"(",
"BoofCon... | Applies the transformation table to the provided input image.
@param input Input image.
@param transform Input transformation table.
@param output Output image. | [
"Applies",
"the",
"transformation",
"table",
"to",
"the",
"provided",
"input",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/enhance/EnhanceImageOps.java#L86-L94 |
jqm4gwt/jqm4gwt | library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java | JQMHeader.setLeftButton | public JQMButton setLeftButton(String text, JQMPage page, DataIcon icon) {
"""
Creates a new {@link JQMButton} with the given text and linking to the
given {@link JQMPage} and with the given icon and then sets that button
in the left slot. Any existing right button will be replaced.
@param text
the text for ... | java | public JQMButton setLeftButton(String text, JQMPage page, DataIcon icon) {
if (page == null)
throw new RuntimeException("page cannot be null");
return setLeftButton(text, "#" + page.getId(), icon);
} | [
"public",
"JQMButton",
"setLeftButton",
"(",
"String",
"text",
",",
"JQMPage",
"page",
",",
"DataIcon",
"icon",
")",
"{",
"if",
"(",
"page",
"==",
"null",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"page cannot be null\"",
")",
";",
"return",
"setLeftButt... | Creates a new {@link JQMButton} with the given text and linking to the
given {@link JQMPage} and with the given icon and then sets that button
in the left slot. Any existing right button will be replaced.
@param text
the text for the button
@param page
the optional page for the button to link to, if null then
this but... | [
"Creates",
"a",
"new",
"{",
"@link",
"JQMButton",
"}",
"with",
"the",
"given",
"text",
"and",
"linking",
"to",
"the",
"given",
"{",
"@link",
"JQMPage",
"}",
"and",
"with",
"the",
"given",
"icon",
"and",
"then",
"sets",
"that",
"button",
"in",
"the",
"l... | train | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java#L203-L207 |
landawn/AbacusUtil | src/com/landawn/abacus/util/DateUtil.java | DateUtil.setHours | public static <T extends java.util.Date> T setHours(final T date, final int amount) {
"""
Copied from Apache Commons Lang under Apache License v2.
<br />
Sets the hours field to a date returning a new object. Hours range
from 0-23.
The original {@code Date} is unchanged.
@param date the date, not null
... | java | public static <T extends java.util.Date> T setHours(final T date, final int amount) {
return set(date, Calendar.HOUR_OF_DAY, amount);
} | [
"public",
"static",
"<",
"T",
"extends",
"java",
".",
"util",
".",
"Date",
">",
"T",
"setHours",
"(",
"final",
"T",
"date",
",",
"final",
"int",
"amount",
")",
"{",
"return",
"set",
"(",
"date",
",",
"Calendar",
".",
"HOUR_OF_DAY",
",",
"amount",
")"... | Copied from Apache Commons Lang under Apache License v2.
<br />
Sets the hours field to a date returning a new object. Hours range
from 0-23.
The original {@code Date} is unchanged.
@param date the date, not null
@param amount the amount to set
@return a new {@code Date} set with the specified value
@throws Illega... | [
"Copied",
"from",
"Apache",
"Commons",
"Lang",
"under",
"Apache",
"License",
"v2",
".",
"<br",
"/",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DateUtil.java#L751-L753 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java | AmazonSQSMessagingClientWrapper.getQueueUrl | public GetQueueUrlResult getQueueUrl(GetQueueUrlRequest getQueueUrlRequest) throws JMSException {
"""
Calls <code>getQueueUrl</code> and wraps <code>AmazonClientException</code>
@param getQueueUrlRequest
Container for the necessary parameters to execute the
getQueueUrl service method on AmazonSQS.
@return Th... | java | public GetQueueUrlResult getQueueUrl(GetQueueUrlRequest getQueueUrlRequest) throws JMSException {
try {
prepareRequest(getQueueUrlRequest);
return amazonSQSClient.getQueueUrl(getQueueUrlRequest);
} catch (AmazonClientException e) {
throw handleException(e, "getQueueUr... | [
"public",
"GetQueueUrlResult",
"getQueueUrl",
"(",
"GetQueueUrlRequest",
"getQueueUrlRequest",
")",
"throws",
"JMSException",
"{",
"try",
"{",
"prepareRequest",
"(",
"getQueueUrlRequest",
")",
";",
"return",
"amazonSQSClient",
".",
"getQueueUrl",
"(",
"getQueueUrlRequest"... | Calls <code>getQueueUrl</code> and wraps <code>AmazonClientException</code>
@param getQueueUrlRequest
Container for the necessary parameters to execute the
getQueueUrl service method on AmazonSQS.
@return The response from the GetQueueUrl service method, as returned by
AmazonSQS, which will include queue`s URL
@throws... | [
"Calls",
"<code",
">",
"getQueueUrl<",
"/",
"code",
">",
"and",
"wraps",
"<code",
">",
"AmazonClientException<",
"/",
"code",
">"
] | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java#L291-L298 |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.setItemText | public void setItemText(int index, String text) {
"""
Sets the text associated with the item at a given index.
@param index the index of the item to be set
@param text the item's new text
@throws IndexOutOfBoundsException if the index is out of range
"""
index += getIndexOffset();
listBox... | java | public void setItemText(int index, String text) {
index += getIndexOffset();
listBox.setItemText(index, text);
reload();
} | [
"public",
"void",
"setItemText",
"(",
"int",
"index",
",",
"String",
"text",
")",
"{",
"index",
"+=",
"getIndexOffset",
"(",
")",
";",
"listBox",
".",
"setItemText",
"(",
"index",
",",
"text",
")",
";",
"reload",
"(",
")",
";",
"}"
] | Sets the text associated with the item at a given index.
@param index the index of the item to be set
@param text the item's new text
@throws IndexOutOfBoundsException if the index is out of range | [
"Sets",
"the",
"text",
"associated",
"with",
"the",
"item",
"at",
"a",
"given",
"index",
"."
] | train | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L718-L722 |
triceo/splitlog | splitlog-core/src/main/java/com/github/triceo/splitlog/splitters/exceptions/ExceptionParser.java | ExceptionParser.parseLine | private LineType parseLine(final LineType previousLineType, final String line) throws ExceptionParseException {
"""
Parse one line in the log.
@param previousLineType
Type of the previous line in the log. (The state the automaton
is currently in.)
@param line
Line in question.
@return Identified type of th... | java | private LineType parseLine(final LineType previousLineType, final String line) throws ExceptionParseException {
switch (previousLineType) {
case PRE_START:
return this.parseLine(line, LineType.CAUSE, LineType.PRE_START);
case CAUSE:
case SUB_CAUSE:
... | [
"private",
"LineType",
"parseLine",
"(",
"final",
"LineType",
"previousLineType",
",",
"final",
"String",
"line",
")",
"throws",
"ExceptionParseException",
"{",
"switch",
"(",
"previousLineType",
")",
"{",
"case",
"PRE_START",
":",
"return",
"this",
".",
"parseLin... | Parse one line in the log.
@param previousLineType
Type of the previous line in the log. (The state the automaton
is currently in.)
@param line
Line in question.
@return Identified type of this line.
@throws ExceptionParseException
If parsing of the log file failed. | [
"Parse",
"one",
"line",
"in",
"the",
"log",
"."
] | train | https://github.com/triceo/splitlog/blob/4e1b188e8c814119f5cf7343bbc53917843d68a2/splitlog-core/src/main/java/com/github/triceo/splitlog/splitters/exceptions/ExceptionParser.java#L113-L130 |
neo4j-contrib/neo4j-apoc-procedures | src/main/java/apoc/es/ElasticSearch.java | ElasticSearch.formatQueryUrl | private String formatQueryUrl(String index, String type, String id, Object query) {
"""
Format the query url template according to the parameters.
The format will be /{index}/{type}/{id}?{query} if query is not empty (or null) otherwise the format will be /{index}/{type}/{id}
@param index
@param type
@param ... | java | private String formatQueryUrl(String index, String type, String id, Object query) {
String queryUrl = String.format(fullQueryTemplate,
index == null ? "_all" : index,
type == null ? "_all" : type,
id == null ? "" : id,
toQueryParams(query));
... | [
"private",
"String",
"formatQueryUrl",
"(",
"String",
"index",
",",
"String",
"type",
",",
"String",
"id",
",",
"Object",
"query",
")",
"{",
"String",
"queryUrl",
"=",
"String",
".",
"format",
"(",
"fullQueryTemplate",
",",
"index",
"==",
"null",
"?",
"\"_... | Format the query url template according to the parameters.
The format will be /{index}/{type}/{id}?{query} if query is not empty (or null) otherwise the format will be /{index}/{type}/{id}
@param index
@param type
@param id
@param query
@return | [
"Format",
"the",
"query",
"url",
"template",
"according",
"to",
"the",
"parameters",
".",
"The",
"format",
"will",
"be",
"/",
"{",
"index",
"}",
"/",
"{",
"type",
"}",
"/",
"{",
"id",
"}",
"?",
"{",
"query",
"}",
"if",
"query",
"is",
"not",
"empty"... | train | https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/e8386975d1c512c0e4388a1a61f5496121c04f86/src/main/java/apoc/es/ElasticSearch.java#L91-L99 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/util/PropertyUtils.java | PropertyUtils.getProperty | public static String getProperty(Object bean, String name)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
"""
Return the value of the specified simple property of the specified bean,
with string conversions.
@param bean
Bean whose property is to be extracted
@param name
... | java | public static String getProperty(Object bean, String name)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
String value = null;
// Retrieve the property getter method for the specified property
PropertyDescriptor descriptor = getPropertyDescriptor(bean, name);
if (descrip... | [
"public",
"static",
"String",
"getProperty",
"(",
"Object",
"bean",
",",
"String",
"name",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"String",
"value",
"=",
"null",
";",
"// Retrieve the property getter... | Return the value of the specified simple property of the specified bean,
with string conversions.
@param bean
Bean whose property is to be extracted
@param name
Name of the property to be extracted
@return the value of the specified simple property of the specified bean,
with string conversions.
@exception IllegalAcc... | [
"Return",
"the",
"value",
"of",
"the",
"specified",
"simple",
"property",
"of",
"the",
"specified",
"bean",
"with",
"string",
"conversions",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/util/PropertyUtils.java#L62-L86 |
roboconf/roboconf-platform | core/roboconf-agent/src/main/java/net/roboconf/agent/internal/misc/AgentUtils.java | AgentUtils.changeRoboconfLogLevel | public static void changeRoboconfLogLevel( String logLevel, String etcDir )
throws IOException {
"""
Changes the level of the Roboconf logger.
<p>
This method assumes the default log configuration for a Roboconf
distribution has a certain shape. If a user manually changed the log
configuration (not the level,... | java | public static void changeRoboconfLogLevel( String logLevel, String etcDir )
throws IOException {
if( ! Utils.isEmptyOrWhitespaces( etcDir )) {
File f = new File( etcDir, AgentConstants.KARAF_LOG_CONF_FILE );
if( f.exists()) {
Properties props = Utils.readPropertiesFile( f );
props.put( "log4j.logger.... | [
"public",
"static",
"void",
"changeRoboconfLogLevel",
"(",
"String",
"logLevel",
",",
"String",
"etcDir",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"Utils",
".",
"isEmptyOrWhitespaces",
"(",
"etcDir",
")",
")",
"{",
"File",
"f",
"=",
"new",
"File",
... | Changes the level of the Roboconf logger.
<p>
This method assumes the default log configuration for a Roboconf
distribution has a certain shape. If a user manually changed the log
configuration (not the level, but the logger name, as an example), then
this will not work.
</p> | [
"Changes",
"the",
"level",
"of",
"the",
"Roboconf",
"logger",
".",
"<p",
">",
"This",
"method",
"assumes",
"the",
"default",
"log",
"configuration",
"for",
"a",
"Roboconf",
"distribution",
"has",
"a",
"certain",
"shape",
".",
"If",
"a",
"user",
"manually",
... | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-agent/src/main/java/net/roboconf/agent/internal/misc/AgentUtils.java#L169-L181 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/Logger.java | Logger.error | public void error(final Throwable aThrowable, final String aMessage) {
"""
A convenience method that uses an argument pattern with Throwable first.
@param aThrowable A throwable exception
@param aMessage A message with information about the exception
"""
if (isErrorEnabled()) {
final MD... | java | public void error(final Throwable aThrowable, final String aMessage) {
if (isErrorEnabled()) {
final MDCCloseable closeable = setLineNumber();
if (hasI18nKey(aMessage)) {
if (aThrowable != null) {
myLogger.error(getI18n(aMessage), aThrowable);
... | [
"public",
"void",
"error",
"(",
"final",
"Throwable",
"aThrowable",
",",
"final",
"String",
"aMessage",
")",
"{",
"if",
"(",
"isErrorEnabled",
"(",
")",
")",
"{",
"final",
"MDCCloseable",
"closeable",
"=",
"setLineNumber",
"(",
")",
";",
"if",
"(",
"hasI18... | A convenience method that uses an argument pattern with Throwable first.
@param aThrowable A throwable exception
@param aMessage A message with information about the exception | [
"A",
"convenience",
"method",
"that",
"uses",
"an",
"argument",
"pattern",
"with",
"Throwable",
"first",
"."
] | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/Logger.java#L309-L329 |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java | ReceiveMessageBuilder.namespaces | public T namespaces(Map<String, String> namespaceMappings) {
"""
Sets default namespace declarations on this action builder.
@param namespaceMappings
@return
"""
getXpathVariableExtractor().getNamespaces().putAll(namespaceMappings);
xmlMessageValidationContext.getNamespaces().putAll(namespac... | java | public T namespaces(Map<String, String> namespaceMappings) {
getXpathVariableExtractor().getNamespaces().putAll(namespaceMappings);
xmlMessageValidationContext.getNamespaces().putAll(namespaceMappings);
return self;
} | [
"public",
"T",
"namespaces",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"namespaceMappings",
")",
"{",
"getXpathVariableExtractor",
"(",
")",
".",
"getNamespaces",
"(",
")",
".",
"putAll",
"(",
"namespaceMappings",
")",
";",
"xmlMessageValidationContext",
".... | Sets default namespace declarations on this action builder.
@param namespaceMappings
@return | [
"Sets",
"default",
"namespace",
"declarations",
"on",
"this",
"action",
"builder",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L667-L672 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/IOUtils.java | IOUtils.skipFully | public static void skipFully(final InputStream in, long len) throws IOException {
"""
Similar to readFully(). Skips bytes in a loop.
@param in
The InputStream to skip bytes from
@param len
number of bytes to skip
@throws IOException
if it could not skip requested number of bytes for any reason (including E... | java | public static void skipFully(final InputStream in, long len) throws IOException {
while (len > 0) {
final long ret = in.skip(len);
if (ret < 0) {
throw new IOException("Premeture EOF from inputStream");
}
len -= ret;
}
} | [
"public",
"static",
"void",
"skipFully",
"(",
"final",
"InputStream",
"in",
",",
"long",
"len",
")",
"throws",
"IOException",
"{",
"while",
"(",
"len",
">",
"0",
")",
"{",
"final",
"long",
"ret",
"=",
"in",
".",
"skip",
"(",
"len",
")",
";",
"if",
... | Similar to readFully(). Skips bytes in a loop.
@param in
The InputStream to skip bytes from
@param len
number of bytes to skip
@throws IOException
if it could not skip requested number of bytes for any reason (including EOF) | [
"Similar",
"to",
"readFully",
"()",
".",
"Skips",
"bytes",
"in",
"a",
"loop",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/IOUtils.java#L152-L160 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/partition/impl/PartitionReplicaManager.java | PartitionReplicaManager.checkAndGetPrimaryReplicaOwner | PartitionReplica checkAndGetPrimaryReplicaOwner(int partitionId, int replicaIndex) {
"""
Checks preconditions for replica sync - if we don't know the owner yet, if this node is the owner or not a replica
"""
InternalPartitionImpl partition = partitionStateManager.getPartitionImpl(partitionId);
... | java | PartitionReplica checkAndGetPrimaryReplicaOwner(int partitionId, int replicaIndex) {
InternalPartitionImpl partition = partitionStateManager.getPartitionImpl(partitionId);
PartitionReplica owner = partition.getOwnerReplicaOrNull();
if (owner == null) {
logger.info("Sync replica targe... | [
"PartitionReplica",
"checkAndGetPrimaryReplicaOwner",
"(",
"int",
"partitionId",
",",
"int",
"replicaIndex",
")",
"{",
"InternalPartitionImpl",
"partition",
"=",
"partitionStateManager",
".",
"getPartitionImpl",
"(",
"partitionId",
")",
";",
"PartitionReplica",
"owner",
"... | Checks preconditions for replica sync - if we don't know the owner yet, if this node is the owner or not a replica | [
"Checks",
"preconditions",
"for",
"replica",
"sync",
"-",
"if",
"we",
"don",
"t",
"know",
"the",
"owner",
"yet",
"if",
"this",
"node",
"is",
"the",
"owner",
"or",
"not",
"a",
"replica"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/impl/PartitionReplicaManager.java#L160-L187 |
livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/da/StandardDirectoryAgentServer.java | StandardDirectoryAgentServer.handleUDPSrvReg | protected void handleUDPSrvReg(SrvReg srvReg, InetSocketAddress localAddress, InetSocketAddress remoteAddress) {
"""
Handles unicast UDP SrvReg message arrived to this directory agent.
<br />
This directory agent will reply with an acknowledge containing the result of the registration.
@param srvReg th... | java | protected void handleUDPSrvReg(SrvReg srvReg, InetSocketAddress localAddress, InetSocketAddress remoteAddress)
{
try
{
boolean update = srvReg.isUpdating();
ServiceInfo service = ServiceInfo.from(srvReg);
cacheService(service, update);
udpSrvAck.perfor... | [
"protected",
"void",
"handleUDPSrvReg",
"(",
"SrvReg",
"srvReg",
",",
"InetSocketAddress",
"localAddress",
",",
"InetSocketAddress",
"remoteAddress",
")",
"{",
"try",
"{",
"boolean",
"update",
"=",
"srvReg",
".",
"isUpdating",
"(",
")",
";",
"ServiceInfo",
"servic... | Handles unicast UDP SrvReg message arrived to this directory agent.
<br />
This directory agent will reply with an acknowledge containing the result of the registration.
@param srvReg the SrvReg message to handle
@param localAddress the socket address the message arrived to
@param remoteAddress the socket addr... | [
"Handles",
"unicast",
"UDP",
"SrvReg",
"message",
"arrived",
"to",
"this",
"directory",
"agent",
".",
"<br",
"/",
">",
"This",
"directory",
"agent",
"will",
"reply",
"with",
"an",
"acknowledge",
"containing",
"the",
"result",
"of",
"the",
"registration",
"."
] | train | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/da/StandardDirectoryAgentServer.java#L524-L537 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/WebhooksInner.java | WebhooksInner.updateAsync | public Observable<WebhookInner> updateAsync(String resourceGroupName, String automationAccountName, String webhookName, WebhookUpdateParameters parameters) {
"""
Update the webhook identified by webhook name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the... | java | public Observable<WebhookInner> updateAsync(String resourceGroupName, String automationAccountName, String webhookName, WebhookUpdateParameters parameters) {
return updateWithServiceResponseAsync(resourceGroupName, automationAccountName, webhookName, parameters).map(new Func1<ServiceResponse<WebhookInner>, Webh... | [
"public",
"Observable",
"<",
"WebhookInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"webhookName",
",",
"WebhookUpdateParameters",
"parameters",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"... | Update the webhook identified by webhook name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param webhookName The webhook name.
@param parameters The update parameters for webhook.
@throws IllegalArgumentException thrown if parameters fail ... | [
"Update",
"the",
"webhook",
"identified",
"by",
"webhook",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/WebhooksInner.java#L504-L511 |
phax/ph-oton | ph-oton-jquery/src/main/java/com/helger/html/jquery/JQueryInvocation.java | JQueryInvocation.jqinvoke | @Override
@Nonnull
public JQueryInvocation jqinvoke (@Nonnull @Nonempty final String sMethod) {
"""
Invoke an arbitrary function on this jQuery object.
@param sMethod
The method to be invoked. May neither be <code>null</code> nor
empty.
@return A new jQuery invocation object. Never <code>null</code>.
... | java | @Override
@Nonnull
public JQueryInvocation jqinvoke (@Nonnull @Nonempty final String sMethod)
{
return new JQueryInvocation (this, sMethod);
} | [
"@",
"Override",
"@",
"Nonnull",
"public",
"JQueryInvocation",
"jqinvoke",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sMethod",
")",
"{",
"return",
"new",
"JQueryInvocation",
"(",
"this",
",",
"sMethod",
")",
";",
"}"
] | Invoke an arbitrary function on this jQuery object.
@param sMethod
The method to be invoked. May neither be <code>null</code> nor
empty.
@return A new jQuery invocation object. Never <code>null</code>. | [
"Invoke",
"an",
"arbitrary",
"function",
"on",
"this",
"jQuery",
"object",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-jquery/src/main/java/com/helger/html/jquery/JQueryInvocation.java#L54-L59 |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/InstantiateOperation.java | InstantiateOperation.loadClassByName | private Class<?> loadClassByName(String className) throws TransformationOperationException {
"""
Tries to load the class with the given name. Throws a TransformationOperationException if this is not possible.
"""
Exception e;
if (className.contains(";")) {
try {
Stri... | java | private Class<?> loadClassByName(String className) throws TransformationOperationException {
Exception e;
if (className.contains(";")) {
try {
String[] parts = className.split(";");
ModelDescription description = new ModelDescription();
descrip... | [
"private",
"Class",
"<",
"?",
">",
"loadClassByName",
"(",
"String",
"className",
")",
"throws",
"TransformationOperationException",
"{",
"Exception",
"e",
";",
"if",
"(",
"className",
".",
"contains",
"(",
"\";\"",
")",
")",
"{",
"try",
"{",
"String",
"[",
... | Tries to load the class with the given name. Throws a TransformationOperationException if this is not possible. | [
"Tries",
"to",
"load",
"the",
"class",
"with",
"the",
"given",
"name",
".",
"Throws",
"a",
"TransformationOperationException",
"if",
"this",
"is",
"not",
"possible",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/InstantiateOperation.java#L135-L160 |
elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.newPair | public static DoubleDBIDPair newPair(double val, DBIDRef id) {
"""
Make a DoubleDBIDPair.
@param val double value
@param id ID
@return new pair
"""
return DBIDFactory.FACTORY.newPair(val, id);
} | java | public static DoubleDBIDPair newPair(double val, DBIDRef id) {
return DBIDFactory.FACTORY.newPair(val, id);
} | [
"public",
"static",
"DoubleDBIDPair",
"newPair",
"(",
"double",
"val",
",",
"DBIDRef",
"id",
")",
"{",
"return",
"DBIDFactory",
".",
"FACTORY",
".",
"newPair",
"(",
"val",
",",
"id",
")",
";",
"}"
] | Make a DoubleDBIDPair.
@param val double value
@param id ID
@return new pair | [
"Make",
"a",
"DoubleDBIDPair",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L478-L480 |
qiujuer/Genius-Android | caprice/graphics/src/main/java/net/qiujuer/genius/graphics/Blur.java | Blur.onStackBlurClip | public static Bitmap onStackBlurClip(Bitmap original, int radius) {
"""
StackBlur By Jni Bitmap
in this we will cut the source bitmap to some parts.
We'll deal(blur) with it one by one. This will reduce the memory consumption.
@param original Original Image
@param radius Blur radius
@return Image Bitmap
... | java | public static Bitmap onStackBlurClip(Bitmap original, int radius) {
Bitmap bitmap = checkSource(original, radius);
// Return this none blur
if (radius == 1) {
return bitmap;
}
int h = bitmap.getHeight();
int w = bitmap.getWidth();
final int clipPixe... | [
"public",
"static",
"Bitmap",
"onStackBlurClip",
"(",
"Bitmap",
"original",
",",
"int",
"radius",
")",
"{",
"Bitmap",
"bitmap",
"=",
"checkSource",
"(",
"original",
",",
"radius",
")",
";",
"// Return this none blur",
"if",
"(",
"radius",
"==",
"1",
")",
"{"... | StackBlur By Jni Bitmap
in this we will cut the source bitmap to some parts.
We'll deal(blur) with it one by one. This will reduce the memory consumption.
@param original Original Image
@param radius Blur radius
@return Image Bitmap | [
"StackBlur",
"By",
"Jni",
"Bitmap",
"in",
"this",
"we",
"will",
"cut",
"the",
"source",
"bitmap",
"to",
"some",
"parts",
".",
"We",
"ll",
"deal",
"(",
"blur",
")",
"with",
"it",
"one",
"by",
"one",
".",
"This",
"will",
"reduce",
"the",
"memory",
"con... | train | https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/graphics/src/main/java/net/qiujuer/genius/graphics/Blur.java#L72-L104 |
vRallev/ECC-25519 | ECC-25519-Java/src/main/java/djb/Curve25519.java | Curve25519.divmod | private static final void divmod(byte[] q, byte[] r, int n, byte[] d, int t) {
"""
/* divide r (size n) by d (size t), returning quotient q and remainder r
quotient is size n-t+1, remainder is size t
requires t > 0 && d[t-1] != 0
requires that r[-1] and d[-1] are valid memory locations
q may overlap with r+t
... | java | private static final void divmod(byte[] q, byte[] r, int n, byte[] d, int t) {
int rn = 0;
int dt = ((d[t-1] & 0xFF) << 8);
if (t>1) {
dt |= (d[t-2] & 0xFF);
}
while (n-- >= t) {
int z = (rn << 16) | ((r[n] & 0xFF) << 8);
if (n>0) {
z |= (r[n-1] & 0xFF);
}
z/=dt;
rn += mula_small(r,r, n-... | [
"private",
"static",
"final",
"void",
"divmod",
"(",
"byte",
"[",
"]",
"q",
",",
"byte",
"[",
"]",
"r",
",",
"int",
"n",
",",
"byte",
"[",
"]",
"d",
",",
"int",
"t",
")",
"{",
"int",
"rn",
"=",
"0",
";",
"int",
"dt",
"=",
"(",
"(",
"d",
"... | /* divide r (size n) by d (size t), returning quotient q and remainder r
quotient is size n-t+1, remainder is size t
requires t > 0 && d[t-1] != 0
requires that r[-1] and d[-1] are valid memory locations
q may overlap with r+t | [
"/",
"*",
"divide",
"r",
"(",
"size",
"n",
")",
"by",
"d",
"(",
"size",
"t",
")",
"returning",
"quotient",
"q",
"and",
"remainder",
"r",
"quotient",
"is",
"size",
"n",
"-",
"t",
"+",
"1",
"remainder",
"is",
"size",
"t",
"requires",
"t",
">",
"0",... | train | https://github.com/vRallev/ECC-25519/blob/5c4297933aabfa4fbe7675e36d6d923ffd22e2cb/ECC-25519-Java/src/main/java/djb/Curve25519.java#L335-L354 |
jenkinsci/jenkins | core/src/main/java/hudson/scm/SCM.java | SCM.poll | public final PollingResult poll(AbstractProject<?,?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) throws IOException, InterruptedException {
"""
Convenience method for the caller to handle the backward compatibility between pre 1.345 SCMs.
"""
if (is... | java | public final PollingResult poll(AbstractProject<?,?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) throws IOException, InterruptedException {
if (is1_346OrLater()) {
// This is to work around HUDSON-5827 in a general way.
// don't let t... | [
"public",
"final",
"PollingResult",
"poll",
"(",
"AbstractProject",
"<",
"?",
",",
"?",
">",
"project",
",",
"Launcher",
"launcher",
",",
"FilePath",
"workspace",
",",
"TaskListener",
"listener",
",",
"SCMRevisionState",
"baseline",
")",
"throws",
"IOException",
... | Convenience method for the caller to handle the backward compatibility between pre 1.345 SCMs. | [
"Convenience",
"method",
"for",
"the",
"caller",
"to",
"handle",
"the",
"backward",
"compatibility",
"between",
"pre",
"1",
".",
"345",
"SCMs",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scm/SCM.java#L406-L421 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/util/search/SearcherFactory.java | SearcherFactory.createSearcherElseDefault | public static <T extends Searcher> T createSearcherElseDefault(final SearchType type, final T defaultSearcher) {
"""
Creates an instance of the Searcher interface implementing the searching algorithm based on the SearchType,
otherwise returns the provided default Searcher implementation if a Searcher based on the... | java | public static <T extends Searcher> T createSearcherElseDefault(final SearchType type, final T defaultSearcher) {
try {
return createSearcher(type);
}
catch (IllegalArgumentException ignore) {
return defaultSearcher;
}
} | [
"public",
"static",
"<",
"T",
"extends",
"Searcher",
">",
"T",
"createSearcherElseDefault",
"(",
"final",
"SearchType",
"type",
",",
"final",
"T",
"defaultSearcher",
")",
"{",
"try",
"{",
"return",
"createSearcher",
"(",
"type",
")",
";",
"}",
"catch",
"(",
... | Creates an instance of the Searcher interface implementing the searching algorithm based on the SearchType,
otherwise returns the provided default Searcher implementation if a Searcher based on the specified SearchType
is not available.
@param <T> the Class type of the actual Searcher implementation based on the Searc... | [
"Creates",
"an",
"instance",
"of",
"the",
"Searcher",
"interface",
"implementing",
"the",
"searching",
"algorithm",
"based",
"on",
"the",
"SearchType",
"otherwise",
"returns",
"the",
"provided",
"default",
"Searcher",
"implementation",
"if",
"a",
"Searcher",
"based"... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/search/SearcherFactory.java#L74-L81 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/jaas/modules/ServerCommonLoginModule.java | ServerCommonLoginModule.setCredentials | protected void setCredentials(Subject subject,
String securityName,
String urAuthenticatedId) throws Exception {
"""
Set the relevant Credentials for this login module into the Subject,
and set the credentials for the determined accessId.
@thr... | java | protected void setCredentials(Subject subject,
String securityName,
String urAuthenticatedId) throws Exception {
// Principal principal = new WSPrincipal(securityName, accessId, authMethod);
if (urAuthenticatedId != null && !urAuthentica... | [
"protected",
"void",
"setCredentials",
"(",
"Subject",
"subject",
",",
"String",
"securityName",
",",
"String",
"urAuthenticatedId",
")",
"throws",
"Exception",
"{",
"// Principal principal = new WSPrincipal(securityName, accessId, authMethod);",
"if",
"(",
"urAuthentica... | Set the relevant Credentials for this login module into the Subject,
and set the credentials for the determined accessId.
@throws Exception | [
"Set",
"the",
"relevant",
"Credentials",
"for",
"this",
"login",
"module",
"into",
"the",
"Subject",
"and",
"set",
"the",
"credentials",
"for",
"the",
"determined",
"accessId",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/jaas/modules/ServerCommonLoginModule.java#L137-L149 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/StringSelectionListBinding.java | StringSelectionListBinding.setSelectionList | public final void setSelectionList(Object[] keys, Object[] labels) {
"""
Replace the comboBoxModel in order to use the new keys/labels.
@param keys
array of objects to use as keys.
@param labels
array of objects to use as labels in the comboBox.
"""
selectionListKeys = keys;
selectionList... | java | public final void setSelectionList(Object[] keys, Object[] labels)
{
selectionListKeys = keys;
selectionListLabelMessages = createLabels(getId(), labels);
combobox.setModel(new DefaultComboBoxModel(selectionListLabelMessages));
selectItem(getValue());
} | [
"public",
"final",
"void",
"setSelectionList",
"(",
"Object",
"[",
"]",
"keys",
",",
"Object",
"[",
"]",
"labels",
")",
"{",
"selectionListKeys",
"=",
"keys",
";",
"selectionListLabelMessages",
"=",
"createLabels",
"(",
"getId",
"(",
")",
",",
"labels",
")",... | Replace the comboBoxModel in order to use the new keys/labels.
@param keys
array of objects to use as keys.
@param labels
array of objects to use as labels in the comboBox. | [
"Replace",
"the",
"comboBoxModel",
"in",
"order",
"to",
"use",
"the",
"new",
"keys",
"/",
"labels",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/StringSelectionListBinding.java#L251-L257 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileUtil.java | FileUtil.replaceFile | public static void replaceFile(File src, File target) throws IOException {
"""
Move the src file to the name specified by target.
@param src the source file
@param target the target file
@exception IOException If this operation fails
"""
/* renameTo() has two limitations on Windows platform.
* src.... | java | public static void replaceFile(File src, File target) throws IOException {
/* renameTo() has two limitations on Windows platform.
* src.renameTo(target) fails if
* 1) If target already exists OR
* 2) If target is already open for reading/writing.
*/
if (!src.renameTo(target)) {
int ret... | [
"public",
"static",
"void",
"replaceFile",
"(",
"File",
"src",
",",
"File",
"target",
")",
"throws",
"IOException",
"{",
"/* renameTo() has two limitations on Windows platform.\n * src.renameTo(target) fails if\n * 1) If target already exists OR\n * 2) If target is already op... | Move the src file to the name specified by target.
@param src the source file
@param target the target file
@exception IOException If this operation fails | [
"Move",
"the",
"src",
"file",
"to",
"the",
"name",
"specified",
"by",
"target",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileUtil.java#L915-L935 |
microfocus-idol/java-configuration-impl | src/main/java/com/hp/autonomy/frontend/configuration/ConfigurationUtils.java | ConfigurationUtils.mergeField | public static <F> F mergeField(final F localValue, final F defaultValue) {
"""
Merges a (nullable) simple field on the local config object with a default (nullable) value in the default config object
@param localValue local field value
@param defaultValue default field value
@param <F> the configur... | java | public static <F> F mergeField(final F localValue, final F defaultValue) {
return Optional.ofNullable(localValue).orElse(defaultValue);
} | [
"public",
"static",
"<",
"F",
">",
"F",
"mergeField",
"(",
"final",
"F",
"localValue",
",",
"final",
"F",
"defaultValue",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"localValue",
")",
".",
"orElse",
"(",
"defaultValue",
")",
";",
"}"
] | Merges a (nullable) simple field on the local config object with a default (nullable) value in the default config object
@param localValue local field value
@param defaultValue default field value
@param <F> the configuration object type
@return the merged field value | [
"Merges",
"a",
"(",
"nullable",
")",
"simple",
"field",
"on",
"the",
"local",
"config",
"object",
"with",
"a",
"default",
"(",
"nullable",
")",
"value",
"in",
"the",
"default",
"config",
"object"
] | train | https://github.com/microfocus-idol/java-configuration-impl/blob/cd9d744cacfaaae3c76cacc211e65742bbc7b00a/src/main/java/com/hp/autonomy/frontend/configuration/ConfigurationUtils.java#L42-L44 |
alkacon/opencms-core | src/org/opencms/file/wrapper/CmsObjectWrapper.java | CmsObjectWrapper.moveResource | public void moveResource(String source, String destination) throws CmsException {
"""
Moves a resource to the given destination.<p>
Iterates through all configured resource wrappers till the first returns <code>true</code>.<p>
@see I_CmsResourceWrapper#moveResource(CmsObject, String, String)
@see CmsObject#... | java | public void moveResource(String source, String destination) throws CmsException {
boolean exec = false;
// iterate through all wrappers and call "moveResource" till one does not return false
List<I_CmsResourceWrapper> wrappers = getWrappers();
Iterator<I_CmsResourceWrapper> iter = wrap... | [
"public",
"void",
"moveResource",
"(",
"String",
"source",
",",
"String",
"destination",
")",
"throws",
"CmsException",
"{",
"boolean",
"exec",
"=",
"false",
";",
"// iterate through all wrappers and call \"moveResource\" till one does not return false",
"List",
"<",
"I_Cms... | Moves a resource to the given destination.<p>
Iterates through all configured resource wrappers till the first returns <code>true</code>.<p>
@see I_CmsResourceWrapper#moveResource(CmsObject, String, String)
@see CmsObject#moveResource(String, String)
@param source the name of the resource to move (full path)
@param ... | [
"Moves",
"a",
"resource",
"to",
"the",
"given",
"destination",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/wrapper/CmsObjectWrapper.java#L508-L527 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/ClassPathHelper.java | ClassPathHelper.printClassPathEntries | public static void printClassPathEntries (@Nonnull final PrintStream aPS, @Nonnull final String sItemSeparator) {
"""
Print all class path entries on the passed print stream, using the passed
separator
@param aPS
The print stream to print to. May not be <code>null</code>.
@param sItemSeparator
The separator... | java | public static void printClassPathEntries (@Nonnull final PrintStream aPS, @Nonnull final String sItemSeparator)
{
forAllClassPathEntries (x -> {
aPS.print (x);
aPS.print (sItemSeparator);
});
} | [
"public",
"static",
"void",
"printClassPathEntries",
"(",
"@",
"Nonnull",
"final",
"PrintStream",
"aPS",
",",
"@",
"Nonnull",
"final",
"String",
"sItemSeparator",
")",
"{",
"forAllClassPathEntries",
"(",
"x",
"->",
"{",
"aPS",
".",
"print",
"(",
"x",
")",
";... | Print all class path entries on the passed print stream, using the passed
separator
@param aPS
The print stream to print to. May not be <code>null</code>.
@param sItemSeparator
The separator to be printed between each item. | [
"Print",
"all",
"class",
"path",
"entries",
"on",
"the",
"passed",
"print",
"stream",
"using",
"the",
"passed",
"separator"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/ClassPathHelper.java#L93-L99 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | Types.asSub | public Type asSub(Type t, Symbol sym) {
"""
Return the least specific subtype of t that starts with symbol
sym. If none exists, return null. The least specific subtype
is determined as follows:
<p>If there is exactly one parameterized instance of sym that is a
subtype of t, that parameterized instance is r... | java | public Type asSub(Type t, Symbol sym) {
return asSub.visit(t, sym);
} | [
"public",
"Type",
"asSub",
"(",
"Type",
"t",
",",
"Symbol",
"sym",
")",
"{",
"return",
"asSub",
".",
"visit",
"(",
"t",
",",
"sym",
")",
";",
"}"
] | Return the least specific subtype of t that starts with symbol
sym. If none exists, return null. The least specific subtype
is determined as follows:
<p>If there is exactly one parameterized instance of sym that is a
subtype of t, that parameterized instance is returned.<br>
Otherwise, if the plain type or raw type ... | [
"Return",
"the",
"least",
"specific",
"subtype",
"of",
"t",
"that",
"starts",
"with",
"symbol",
"sym",
".",
"If",
"none",
"exists",
"return",
"null",
".",
"The",
"least",
"specific",
"subtype",
"is",
"determined",
"as",
"follows",
":"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L242-L244 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/interest/FactoryInterestPointAlgs.java | FactoryInterestPointAlgs.harrisPyramid | public static <T extends ImageGray<T>, D extends ImageGray<D>>
FeaturePyramid<T, D> harrisPyramid(int extractRadius,
float detectThreshold,
int maxFeatures,
Class<T> imageType,
Class<D> derivType) {
"""
Creates a {@link FeaturePyramid} which is uses the Harris corne... | java | public static <T extends ImageGray<T>, D extends ImageGray<D>>
FeaturePyramid<T, D> harrisPyramid(int extractRadius,
float detectThreshold,
int maxFeatures,
Class<T> imageType,
Class<D> derivType) {
GradientCornerIntensity<D> harris = FactoryIntensityPointAlg.harris(ex... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"FeaturePyramid",
"<",
"T",
",",
"D",
">",
"harrisPyramid",
"(",
"int",
"extractRadius",
",",
"float",
"detectThreshold",
",",
"int... | Creates a {@link FeaturePyramid} which is uses the Harris corner detector.
@param extractRadius Size of the feature used to detect the corners.
@param detectThreshold Minimum corner intensity required
@param maxFeatures Max number of features that can be found.
@param imageType Type of input image.
@param ... | [
"Creates",
"a",
"{",
"@link",
"FeaturePyramid",
"}",
"which",
"is",
"uses",
"the",
"Harris",
"corner",
"detector",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/interest/FactoryInterestPointAlgs.java#L87-L103 |
lecho/hellocharts-android | hellocharts-library/src/lecho/lib/hellocharts/model/BubbleValue.java | BubbleValue.setTarget | public BubbleValue setTarget(float targetX, float targetY, float targetZ) {
"""
Set target values that should be reached when data animation finish then call {@link Chart#startDataAnimation()}
"""
set(x, y, z);
this.diffX = targetX - originX;
this.diffY = targetY - originY;
this... | java | public BubbleValue setTarget(float targetX, float targetY, float targetZ) {
set(x, y, z);
this.diffX = targetX - originX;
this.diffY = targetY - originY;
this.diffZ = targetZ - originZ;
return this;
} | [
"public",
"BubbleValue",
"setTarget",
"(",
"float",
"targetX",
",",
"float",
"targetY",
",",
"float",
"targetZ",
")",
"{",
"set",
"(",
"x",
",",
"y",
",",
"z",
")",
";",
"this",
".",
"diffX",
"=",
"targetX",
"-",
"originX",
";",
"this",
".",
"diffY",... | Set target values that should be reached when data animation finish then call {@link Chart#startDataAnimation()} | [
"Set",
"target",
"values",
"that",
"should",
"be",
"reached",
"when",
"data",
"animation",
"finish",
"then",
"call",
"{"
] | train | https://github.com/lecho/hellocharts-android/blob/c41419c9afa097452dee823c7eba0e5136aa96bd/hellocharts-library/src/lecho/lib/hellocharts/model/BubbleValue.java#L103-L109 |
eclipse/hawkbit | hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/rsql/PropertyMapper.java | PropertyMapper.addNewMapping | public static void addNewMapping(final Class<?> type, final String property, final String mapping) {
"""
Add new mapping - property name and alias.
@param type
entity type
@param property
alias of property
@param mapping
property name
"""
allowedColmns.computeIfAbsent(type, k -> new HashMap<>()... | java | public static void addNewMapping(final Class<?> type, final String property, final String mapping) {
allowedColmns.computeIfAbsent(type, k -> new HashMap<>());
allowedColmns.get(type).put(property, mapping);
} | [
"public",
"static",
"void",
"addNewMapping",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"String",
"property",
",",
"final",
"String",
"mapping",
")",
"{",
"allowedColmns",
".",
"computeIfAbsent",
"(",
"type",
",",
"k",
"->",
"new",
"HashMa... | Add new mapping - property name and alias.
@param type
entity type
@param property
alias of property
@param mapping
property name | [
"Add",
"new",
"mapping",
"-",
"property",
"name",
"and",
"alias",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/rsql/PropertyMapper.java#L38-L41 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java | HashCodeBuilder.reflectionHashCode | @GwtIncompatible("incompatible method")
public static int reflectionHashCode(final int initialNonZeroOddNumber, final int multiplierNonZeroOddNumber, final Object object,
final boolean testTransients) {
"""
<p>
Uses reflection to build a valid hash code from the fields of {@code object}.
</p>
... | java | @GwtIncompatible("incompatible method")
public static int reflectionHashCode(final int initialNonZeroOddNumber, final int multiplierNonZeroOddNumber, final Object object,
final boolean testTransients) {
return reflectionHashCode(initialNonZeroOddNumber, multiplierNonZeroOddNumber, object, testTr... | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"int",
"reflectionHashCode",
"(",
"final",
"int",
"initialNonZeroOddNumber",
",",
"final",
"int",
"multiplierNonZeroOddNumber",
",",
"final",
"Object",
"object",
",",
"final",
"boolean",
... | <p>
Uses reflection to build a valid hash code from the fields of {@code object}.
</p>
<p>
It uses <code>AccessibleObject.setAccessible</code> to gain access to private fields. This means that it will
throw a security exception if run under a security manager, if the permissions are not set up correctly. It is
also no... | [
"<p",
">",
"Uses",
"reflection",
"to",
"build",
"a",
"valid",
"hash",
"code",
"from",
"the",
"fields",
"of",
"{",
"@code",
"object",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java#L307-L311 |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.setBaselineEstimatedStart | public void setBaselineEstimatedStart(int baselineNumber, Date value) {
"""
Set a baseline value.
@param baselineNumber baseline index (1-10)
@param value baseline value
"""
set(selectField(TaskFieldLists.BASELINE_ESTIMATED_STARTS, baselineNumber), value);
} | java | public void setBaselineEstimatedStart(int baselineNumber, Date value)
{
set(selectField(TaskFieldLists.BASELINE_ESTIMATED_STARTS, baselineNumber), value);
} | [
"public",
"void",
"setBaselineEstimatedStart",
"(",
"int",
"baselineNumber",
",",
"Date",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"TaskFieldLists",
".",
"BASELINE_ESTIMATED_STARTS",
",",
"baselineNumber",
")",
",",
"value",
")",
";",
"}"
] | Set a baseline value.
@param baselineNumber baseline index (1-10)
@param value baseline value | [
"Set",
"a",
"baseline",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4424-L4427 |
networknt/light-4j | http-url/src/main/java/com/networknt/url/QueryString.java | QueryString.applyOnURL | public URL applyOnURL(URL url) {
"""
Apply this url QueryString on the given URL. If a query string already
exists, it is replaced by this one.
@param url the URL to apply this query string.
@return url with query string added
"""
if (url == null) {
return url;
}
try {
... | java | public URL applyOnURL(URL url) {
if (url == null) {
return url;
}
try {
return new URL(applyOnURL(url.toString()));
} catch (MalformedURLException e) {
throw new RuntimeException("Cannot applyl query string to: " + url, e);
}
} | [
"public",
"URL",
"applyOnURL",
"(",
"URL",
"url",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"return",
"url",
";",
"}",
"try",
"{",
"return",
"new",
"URL",
"(",
"applyOnURL",
"(",
"url",
".",
"toString",
"(",
")",
")",
")",
";",
"}",
"... | Apply this url QueryString on the given URL. If a query string already
exists, it is replaced by this one.
@param url the URL to apply this query string.
@return url with query string added | [
"Apply",
"this",
"url",
"QueryString",
"on",
"the",
"given",
"URL",
".",
"If",
"a",
"query",
"string",
"already",
"exists",
"it",
"is",
"replaced",
"by",
"this",
"one",
"."
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/http-url/src/main/java/com/networknt/url/QueryString.java#L182-L191 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/ie/crf/CRFFeatureExporter.java | CRFFeatureExporter.printFeatures | public void printFeatures(String exportFile, Collection<List<IN>> documents) {
"""
Output features from a collection of documents to a file
Format is with one line per token using the following format
word label feat1 feat2 ...
(where each space is actually a tab)
Each document is separated by an empty line
T... | java | public void printFeatures(String exportFile, Collection<List<IN>> documents) {
try {
PrintWriter pw = IOUtils.getPrintWriter(exportFile);
for (List<IN> doc:documents) {
String str = getFeatureString(doc);
pw.println(str);
}
pw.close();
} catch (IOException ex) {
... | [
"public",
"void",
"printFeatures",
"(",
"String",
"exportFile",
",",
"Collection",
"<",
"List",
"<",
"IN",
">",
">",
"documents",
")",
"{",
"try",
"{",
"PrintWriter",
"pw",
"=",
"IOUtils",
".",
"getPrintWriter",
"(",
"exportFile",
")",
";",
"for",
"(",
"... | Output features from a collection of documents to a file
Format is with one line per token using the following format
word label feat1 feat2 ...
(where each space is actually a tab)
Each document is separated by an empty line
This format is suitable for modified crfsgd
@param exportFile file to export the features to
@... | [
"Output",
"features",
"from",
"a",
"collection",
"of",
"documents",
"to",
"a",
"file",
"Format",
"is",
"with",
"one",
"line",
"per",
"token",
"using",
"the",
"following",
"format",
"word",
"label",
"feat1",
"feat2",
"...",
"(",
"where",
"each",
"space",
"i... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/crf/CRFFeatureExporter.java#L143-L154 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGroupVertexIterator.java | ExecutionGroupVertexIterator.allConnectionsFromOtherStage | private boolean allConnectionsFromOtherStage(final ExecutionGroupVertex groupVertex, final boolean forward) {
"""
Checks if for the given group vertex all incoming (if forward is <code>true</code>) or outgoing links (if forward
is <code>false</code>) come from
other stages than the one the given vertex is in.
... | java | private boolean allConnectionsFromOtherStage(final ExecutionGroupVertex groupVertex, final boolean forward) {
if (forward) {
for (int i = 0; i < groupVertex.getNumberOfBackwardLinks(); i++) {
if (this.stage == groupVertex.getBackwardEdge(i).getSourceVertex().getStageNumber()) {
return false;
}
}
... | [
"private",
"boolean",
"allConnectionsFromOtherStage",
"(",
"final",
"ExecutionGroupVertex",
"groupVertex",
",",
"final",
"boolean",
"forward",
")",
"{",
"if",
"(",
"forward",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"groupVertex",
".",
"get... | Checks if for the given group vertex all incoming (if forward is <code>true</code>) or outgoing links (if forward
is <code>false</code>) come from
other stages than the one the given vertex is in.
@param groupVertex
the group vertex to check for
@param forward
<code>true</code> if incoming links should be considered, ... | [
"Checks",
"if",
"for",
"the",
"given",
"group",
"vertex",
"all",
"incoming",
"(",
"if",
"forward",
"is",
"<code",
">",
"true<",
"/",
"code",
">",
")",
"or",
"outgoing",
"links",
"(",
"if",
"forward",
"is",
"<code",
">",
"false<",
"/",
"code",
">",
")... | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGroupVertexIterator.java#L194-L211 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/table/ClassUtils.java | ClassUtils.getAccessorForProperty | public static Accessor getAccessorForProperty(final Class<?> clazz, final String propertyName) {
"""
Create an {@link Accessor} for the given property. A property may be nested using the dot character.
@param clazz
the type containing the property.
@param propertyName
the name of the property.
@return an Ac... | java | public static Accessor getAccessorForProperty(final Class<?> clazz, final String propertyName)
{
int splitPoint = propertyName.indexOf('.');
if (splitPoint > 0)
{
String firstPart = propertyName.substring(0, splitPoint);
String secondPart = propertyName.substring(spli... | [
"public",
"static",
"Accessor",
"getAccessorForProperty",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"String",
"propertyName",
")",
"{",
"int",
"splitPoint",
"=",
"propertyName",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"splitP... | Create an {@link Accessor} for the given property. A property may be nested using the dot character.
@param clazz
the type containing the property.
@param propertyName
the name of the property.
@return an Accessor for the property. | [
"Create",
"an",
"{",
"@link",
"Accessor",
"}",
"for",
"the",
"given",
"property",
".",
"A",
"property",
"may",
"be",
"nested",
"using",
"the",
"dot",
"character",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/table/ClassUtils.java#L139-L149 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.