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 |
|---|---|---|---|---|---|---|---|---|---|---|
mlhartme/jasmin | src/main/java/net/oneandone/jasmin/model/Repository.java | Repository.loadLibrary | public void loadLibrary(Resolver resolver, Node base, Node descriptor, Node properties) throws IOException {
"""
Core method for loading. A library is a module or an application
@param base jar file for module, docroot for application
"""
Source source;
Module module;
Library library;
... | java | public void loadLibrary(Resolver resolver, Node base, Node descriptor, Node properties) throws IOException {
Source source;
Module module;
Library library;
File file;
addReload(descriptor);
source = Source.load(properties, base);
library = (Library) Library.TYPE.... | [
"public",
"void",
"loadLibrary",
"(",
"Resolver",
"resolver",
",",
"Node",
"base",
",",
"Node",
"descriptor",
",",
"Node",
"properties",
")",
"throws",
"IOException",
"{",
"Source",
"source",
";",
"Module",
"module",
";",
"Library",
"library",
";",
"File",
"... | Core method for loading. A library is a module or an application
@param base jar file for module, docroot for application | [
"Core",
"method",
"for",
"loading",
".",
"A",
"library",
"is",
"a",
"module",
"or",
"an",
"application"
] | train | https://github.com/mlhartme/jasmin/blob/1c44339a2555ae7ffb7d40fd3a7d80d81c3fc39d/src/main/java/net/oneandone/jasmin/model/Repository.java#L279-L300 |
kiegroup/jbpm | jbpm-query-jpa/src/main/java/org/jbpm/query/jpa/impl/QueryCriteriaUtil.java | QueryCriteriaUtil.createPredicateFromIntersectingCriteriaList | private <R,T> Predicate createPredicateFromIntersectingCriteriaList(CriteriaQuery<R> query, CriteriaBuilder builder, Class<T> queryType, List<QueryCriteria> intersectingCriteriaList, QueryWhere queryWhere ) {
"""
This method is necessary because the AND operator in SQL has precedence over the OR operator.
</p>
... | java | private <R,T> Predicate createPredicateFromIntersectingCriteriaList(CriteriaQuery<R> query, CriteriaBuilder builder, Class<T> queryType, List<QueryCriteria> intersectingCriteriaList, QueryWhere queryWhere ) {
combineIntersectingRangeCriteria(intersectingCriteriaList);
assert intersectingCriteriaList.si... | [
"private",
"<",
"R",
",",
"T",
">",
"Predicate",
"createPredicateFromIntersectingCriteriaList",
"(",
"CriteriaQuery",
"<",
"R",
">",
"query",
",",
"CriteriaBuilder",
"builder",
",",
"Class",
"<",
"T",
">",
"queryType",
",",
"List",
"<",
"QueryCriteria",
">",
"... | This method is necessary because the AND operator in SQL has precedence over the OR operator.
</p>
That means that intersecting criteria should always be grouped together (and processed first, basically), which is essentially
what this method does.
@param query The {@link CriteriaQuery} that is being built
@param inte... | [
"This",
"method",
"is",
"necessary",
"because",
"the",
"AND",
"operator",
"in",
"SQL",
"has",
"precedence",
"over",
"the",
"OR",
"operator",
".",
"<",
"/",
"p",
">",
"That",
"means",
"that",
"intersecting",
"criteria",
"should",
"always",
"be",
"grouped",
... | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-query-jpa/src/main/java/org/jbpm/query/jpa/impl/QueryCriteriaUtil.java#L289-L308 |
apereo/cas | support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSamlObjectBuilder.java | AbstractSamlObjectBuilder.signSamlResponse | public static String signSamlResponse(final String samlResponse, final PrivateKey privateKey, final PublicKey publicKey) {
"""
Sign SAML response.
@param samlResponse the SAML response
@param privateKey the private key
@param publicKey the public key
@return the response
"""
val doc = constr... | java | public static String signSamlResponse(final String samlResponse, final PrivateKey privateKey, final PublicKey publicKey) {
val doc = constructDocumentFromXml(samlResponse);
if (doc != null) {
val signedElement = signSamlElement(doc.getRootElement(),
privateKey, publicKey);
... | [
"public",
"static",
"String",
"signSamlResponse",
"(",
"final",
"String",
"samlResponse",
",",
"final",
"PrivateKey",
"privateKey",
",",
"final",
"PublicKey",
"publicKey",
")",
"{",
"val",
"doc",
"=",
"constructDocumentFromXml",
"(",
"samlResponse",
")",
";",
"if"... | Sign SAML response.
@param samlResponse the SAML response
@param privateKey the private key
@param publicKey the public key
@return the response | [
"Sign",
"SAML",
"response",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSamlObjectBuilder.java#L107-L117 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/activesync/ActiveSyncManager.java | ActiveSyncManager.applyAndJournal | public void applyAndJournal(Supplier<JournalContext> context, AddSyncPointEntry entry) {
"""
Apply AddSyncPoint entry and journal the entry.
@param context journal context
@param entry addSyncPoint entry
"""
try {
apply(entry);
context.get().append(Journal.JournalEntry.newBuilder().setAddSync... | java | public void applyAndJournal(Supplier<JournalContext> context, AddSyncPointEntry entry) {
try {
apply(entry);
context.get().append(Journal.JournalEntry.newBuilder().setAddSyncPoint(entry).build());
} catch (Throwable t) {
ProcessUtils.fatalError(LOG, t, "Failed to apply %s", entry);
throw... | [
"public",
"void",
"applyAndJournal",
"(",
"Supplier",
"<",
"JournalContext",
">",
"context",
",",
"AddSyncPointEntry",
"entry",
")",
"{",
"try",
"{",
"apply",
"(",
"entry",
")",
";",
"context",
".",
"get",
"(",
")",
".",
"append",
"(",
"Journal",
".",
"J... | Apply AddSyncPoint entry and journal the entry.
@param context journal context
@param entry addSyncPoint entry | [
"Apply",
"AddSyncPoint",
"entry",
"and",
"journal",
"the",
"entry",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/activesync/ActiveSyncManager.java#L232-L240 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_lines_number_dslamPort_logs_GET | public ArrayList<OvhDslamPortLog> serviceName_lines_number_dslamPort_logs_GET(String serviceName, String number, Long limit) throws IOException {
"""
Get the logs emitted by the DSLAM for this port
REST: GET /xdsl/{serviceName}/lines/{number}/dslamPort/logs
@param limit [required] [default=50]
@param serviceN... | java | public ArrayList<OvhDslamPortLog> serviceName_lines_number_dslamPort_logs_GET(String serviceName, String number, Long limit) throws IOException {
String qPath = "/xdsl/{serviceName}/lines/{number}/dslamPort/logs";
StringBuilder sb = path(qPath, serviceName, number);
query(sb, "limit", limit);
String resp = exec... | [
"public",
"ArrayList",
"<",
"OvhDslamPortLog",
">",
"serviceName_lines_number_dslamPort_logs_GET",
"(",
"String",
"serviceName",
",",
"String",
"number",
",",
"Long",
"limit",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/{serviceName}/lines/{number}... | Get the logs emitted by the DSLAM for this port
REST: GET /xdsl/{serviceName}/lines/{number}/dslamPort/logs
@param limit [required] [default=50]
@param serviceName [required] The internal name of your XDSL offer
@param number [required] The number of the line | [
"Get",
"the",
"logs",
"emitted",
"by",
"the",
"DSLAM",
"for",
"this",
"port"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L522-L528 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URLConnection.java | URLConnection.lookupContentHandlerClassFor | private ContentHandler lookupContentHandlerClassFor(String contentType)
throws InstantiationException, IllegalAccessException, ClassNotFoundException {
"""
Looks for a content handler in a user-defineable set of places.
By default it looks in sun.net.www.content, but users can define a
vertical-bar delim... | java | private ContentHandler lookupContentHandlerClassFor(String contentType)
throws InstantiationException, IllegalAccessException, ClassNotFoundException {
String contentHandlerClassName = typeToPackageName(contentType);
String contentHandlerPkgPrefixes =getContentHandlerPkgPrefixes();
Str... | [
"private",
"ContentHandler",
"lookupContentHandlerClassFor",
"(",
"String",
"contentType",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessException",
",",
"ClassNotFoundException",
"{",
"String",
"contentHandlerClassName",
"=",
"typeToPackageName",
"(",
"contentTyp... | Looks for a content handler in a user-defineable set of places.
By default it looks in sun.net.www.content, but users can define a
vertical-bar delimited set of class prefixes to search through in
addition by defining the java.content.handler.pkgs property.
The class name must be of the form:
<pre>
{package-prefix}.{ma... | [
"Looks",
"for",
"a",
"content",
"handler",
"in",
"a",
"user",
"-",
"defineable",
"set",
"of",
"places",
".",
"By",
"default",
"it",
"looks",
"in",
"sun",
".",
"net",
".",
"www",
".",
"content",
"but",
"users",
"can",
"define",
"a",
"vertical",
"-",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URLConnection.java#L1299-L1332 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_spla_GET | public ArrayList<Long> serviceName_spla_GET(String serviceName, OvhSplaStatusEnum status, OvhSplaTypeEnum type) throws IOException {
"""
Your own SPLA licenses attached to this dedicated server
REST: GET /dedicated/server/{serviceName}/spla
@param status [required] Filter the value of status property (=)
@par... | java | public ArrayList<Long> serviceName_spla_GET(String serviceName, OvhSplaStatusEnum status, OvhSplaTypeEnum type) throws IOException {
String qPath = "/dedicated/server/{serviceName}/spla";
StringBuilder sb = path(qPath, serviceName);
query(sb, "status", status);
query(sb, "type", type);
String resp = exec(qPat... | [
"public",
"ArrayList",
"<",
"Long",
">",
"serviceName_spla_GET",
"(",
"String",
"serviceName",
",",
"OvhSplaStatusEnum",
"status",
",",
"OvhSplaTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/spla\"",
";",... | Your own SPLA licenses attached to this dedicated server
REST: GET /dedicated/server/{serviceName}/spla
@param status [required] Filter the value of status property (=)
@param type [required] Filter the value of type property (=)
@param serviceName [required] The internal name of your dedicated server | [
"Your",
"own",
"SPLA",
"licenses",
"attached",
"to",
"this",
"dedicated",
"server"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L706-L713 |
marklogic/marklogic-contentpump | mlcp/src/main/java/com/marklogic/contentpump/ImportRecordReader.java | ImportRecordReader.setKey | protected boolean setKey(String uri, int line, int col, boolean encode) {
"""
Apply URI replace option, encode URI if specified, apply URI prefix and
suffix configuration options and set the result as DocumentURI key.
@param uri Source string of document URI.
@param line Line number in the source if applicabl... | java | protected boolean setKey(String uri, int line, int col, boolean encode) {
if (key == null) {
key = new DocumentURIWithSourceInfo(uri, srcId);
}
// apply prefix, suffix and replace for URI
if (uri != null && !uri.isEmpty()) {
uri = URIUtil.applyUriReplace(uri, conf... | [
"protected",
"boolean",
"setKey",
"(",
"String",
"uri",
",",
"int",
"line",
",",
"int",
"col",
",",
"boolean",
"encode",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"key",
"=",
"new",
"DocumentURIWithSourceInfo",
"(",
"uri",
",",
"srcId",
")",
... | Apply URI replace option, encode URI if specified, apply URI prefix and
suffix configuration options and set the result as DocumentURI key.
@param uri Source string of document URI.
@param line Line number in the source if applicable; 0 otherwise.
@param col Column number in the source if applicable; 0 otherwise.
@par... | [
"Apply",
"URI",
"replace",
"option",
"encode",
"URI",
"if",
"specified",
"apply",
"URI",
"prefix",
"and",
"suffix",
"configuration",
"options",
"and",
"set",
"the",
"result",
"as",
"DocumentURI",
"key",
"."
] | train | https://github.com/marklogic/marklogic-contentpump/blob/4c41e4a953301f81a4c655efb2a847603dee8afc/mlcp/src/main/java/com/marklogic/contentpump/ImportRecordReader.java#L75-L106 |
Bedework/bw-util | bw-util-xml/src/main/java/org/bedework/util/xml/XmlEmit.java | XmlEmit.startEmit | public void startEmit(final Writer wtr, final String dtd) throws IOException {
"""
Emit any headers, dtd and namespace declarations
@param wtr
@param dtd
@throws IOException
"""
this.wtr = wtr;
this.dtd = dtd;
} | java | public void startEmit(final Writer wtr, final String dtd) throws IOException {
this.wtr = wtr;
this.dtd = dtd;
} | [
"public",
"void",
"startEmit",
"(",
"final",
"Writer",
"wtr",
",",
"final",
"String",
"dtd",
")",
"throws",
"IOException",
"{",
"this",
".",
"wtr",
"=",
"wtr",
";",
"this",
".",
"dtd",
"=",
"dtd",
";",
"}"
] | Emit any headers, dtd and namespace declarations
@param wtr
@param dtd
@throws IOException | [
"Emit",
"any",
"headers",
"dtd",
"and",
"namespace",
"declarations"
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-xml/src/main/java/org/bedework/util/xml/XmlEmit.java#L176-L179 |
wcm-io/wcm-io-tooling | netbeans/sightly/src/main/java/io/wcm/tooling/netbeans/sightly/completion/classLookup/MemberLookupResolver.java | MemberLookupResolver.getMethodsFromClassLoader | private Set<MemberLookupResult> getMethodsFromClassLoader(String clazzname, String variable) {
"""
Fallback used to load the methods from classloader
@param clazzname
@param variable
@return set with all methods, can be empty
"""
final Set<MemberLookupResult> ret = new LinkedHashSet<>();
try {
... | java | private Set<MemberLookupResult> getMethodsFromClassLoader(String clazzname, String variable) {
final Set<MemberLookupResult> ret = new LinkedHashSet<>();
try {
Class clazz = classPath.getClassLoader(true).loadClass(clazzname);
for (Method method : clazz.getMethods()) {
if (method.getReturnTy... | [
"private",
"Set",
"<",
"MemberLookupResult",
">",
"getMethodsFromClassLoader",
"(",
"String",
"clazzname",
",",
"String",
"variable",
")",
"{",
"final",
"Set",
"<",
"MemberLookupResult",
">",
"ret",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"try",
"{",... | Fallback used to load the methods from classloader
@param clazzname
@param variable
@return set with all methods, can be empty | [
"Fallback",
"used",
"to",
"load",
"the",
"methods",
"from",
"classloader"
] | train | https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/netbeans/sightly/src/main/java/io/wcm/tooling/netbeans/sightly/completion/classLookup/MemberLookupResolver.java#L188-L205 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/Circle.java | Circle.contains | public boolean contains(float x, float y) {
"""
Check if a point is contained by this circle
@param x The x coordinate of the point to check
@param y The y coorindate of the point to check
@return True if the point is contained by this circle
"""
float xDelta = x - getCenterX(), yDelta = y - get... | java | public boolean contains(float x, float y)
{
float xDelta = x - getCenterX(), yDelta = y - getCenterY();
return xDelta * xDelta + yDelta * yDelta < getRadius() * getRadius();
} | [
"public",
"boolean",
"contains",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"float",
"xDelta",
"=",
"x",
"-",
"getCenterX",
"(",
")",
",",
"yDelta",
"=",
"y",
"-",
"getCenterY",
"(",
")",
";",
"return",
"xDelta",
"*",
"xDelta",
"+",
"yDelta",
... | Check if a point is contained by this circle
@param x The x coordinate of the point to check
@param y The y coorindate of the point to check
@return True if the point is contained by this circle | [
"Check",
"if",
"a",
"point",
"is",
"contained",
"by",
"this",
"circle"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/Circle.java#L129-L133 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java | EnvironmentSettingsInner.claimAnyAsync | public Observable<Void> claimAnyAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) {
"""
Claims a random environment for a user in an environment settings.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Accou... | java | public Observable<Void> claimAnyAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) {
return claimAnyWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override... | [
"public",
"Observable",
"<",
"Void",
">",
"claimAnyAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"String",
"environmentSettingName",
")",
"{",
"return",
"claimAnyWithServiceResponseAsync",
"(",
"resourceGroup... | Claims a random environment for a user in an environment settings.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param environmentSettingName The name of the environment Setting.
@throws IllegalArgumentException thrown i... | [
"Claims",
"a",
"random",
"environment",
"for",
"a",
"user",
"in",
"an",
"environment",
"settings",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java#L1133-L1140 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/MkColCommand.java | MkColCommand.addMixins | private void addMixins(Node node, List<String> mixinTypes) {
"""
Adds mixins to node.
@param node node.
@param mixinTypes mixin types.
"""
for (int i = 0; i < mixinTypes.size(); i++)
{
String curMixinType = mixinTypes.get(i);
try
{
node.addMixin(curM... | java | private void addMixins(Node node, List<String> mixinTypes)
{
for (int i = 0; i < mixinTypes.size(); i++)
{
String curMixinType = mixinTypes.get(i);
try
{
node.addMixin(curMixinType);
}
catch (Exception exc)
{
log.err... | [
"private",
"void",
"addMixins",
"(",
"Node",
"node",
",",
"List",
"<",
"String",
">",
"mixinTypes",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mixinTypes",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"String",
"curMixinType",
... | Adds mixins to node.
@param node node.
@param mixinTypes mixin types. | [
"Adds",
"mixins",
"to",
"node",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/MkColCommand.java#L158-L172 |
jdereg/java-util | src/main/java/com/cedarsoftware/util/DeepEquals.java | DeepEquals.nearlyEqual | private static boolean nearlyEqual(double a, double b, double epsilon) {
"""
Correctly handles floating point comparisions. <br>
source: http://floating-point-gui.de/errors/comparison/
@param a first number
@param b second number
@param epsilon double tolerance value
@return true if a and b are ... | java | private static boolean nearlyEqual(double a, double b, double epsilon)
{
final double absA = Math.abs(a);
final double absB = Math.abs(b);
final double diff = Math.abs(a - b);
if (a == b)
{ // shortcut, handles infinities
return true;
}
else if (a... | [
"private",
"static",
"boolean",
"nearlyEqual",
"(",
"double",
"a",
",",
"double",
"b",
",",
"double",
"epsilon",
")",
"{",
"final",
"double",
"absA",
"=",
"Math",
".",
"abs",
"(",
"a",
")",
";",
"final",
"double",
"absB",
"=",
"Math",
".",
"abs",
"("... | Correctly handles floating point comparisions. <br>
source: http://floating-point-gui.de/errors/comparison/
@param a first number
@param b second number
@param epsilon double tolerance value
@return true if a and b are close enough | [
"Correctly",
"handles",
"floating",
"point",
"comparisions",
".",
"<br",
">",
"source",
":",
"http",
":",
"//",
"floating",
"-",
"point",
"-",
"gui",
".",
"de",
"/",
"errors",
"/",
"comparison",
"/"
] | train | https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/DeepEquals.java#L652-L672 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/decompose/UtilDecompositons_ZDRM.java | UtilDecompositons_ZDRM.checkZerosLT | public static ZMatrixRMaj checkZerosLT(ZMatrixRMaj A , int numRows , int numCols) {
"""
Creates a zeros matrix only if A does not already exist. If it does exist it will fill
the lower triangular portion with zeros.
"""
if( A == null ) {
return new ZMatrixRMaj(numRows,numCols);
} ... | java | public static ZMatrixRMaj checkZerosLT(ZMatrixRMaj A , int numRows , int numCols) {
if( A == null ) {
return new ZMatrixRMaj(numRows,numCols);
} else if( numRows != A.numRows || numCols != A.numCols )
throw new IllegalArgumentException("Input is not "+numRows+" x "+numCols+" matr... | [
"public",
"static",
"ZMatrixRMaj",
"checkZerosLT",
"(",
"ZMatrixRMaj",
"A",
",",
"int",
"numRows",
",",
"int",
"numCols",
")",
"{",
"if",
"(",
"A",
"==",
"null",
")",
"{",
"return",
"new",
"ZMatrixRMaj",
"(",
"numRows",
",",
"numCols",
")",
";",
"}",
"... | Creates a zeros matrix only if A does not already exist. If it does exist it will fill
the lower triangular portion with zeros. | [
"Creates",
"a",
"zeros",
"matrix",
"only",
"if",
"A",
"does",
"not",
"already",
"exist",
".",
"If",
"it",
"does",
"exist",
"it",
"will",
"fill",
"the",
"lower",
"triangular",
"portion",
"with",
"zeros",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/decompose/UtilDecompositons_ZDRM.java#L55-L70 |
hawkular/hawkular-apm | api/src/main/java/org/hawkular/apm/api/model/trace/Node.java | Node.findCorrelatedNodes | protected void findCorrelatedNodes(CorrelationIdentifier cid, Set<Node> nodes) {
"""
This method identifies all of the nodes within a trace that
are associated with the supplied correlation identifier.
@param cid The correlation identifier
@param nodes The set of nodes that are associated with the correlation... | java | protected void findCorrelatedNodes(CorrelationIdentifier cid, Set<Node> nodes) {
if (isCorrelated(cid)) {
nodes.add(this);
}
} | [
"protected",
"void",
"findCorrelatedNodes",
"(",
"CorrelationIdentifier",
"cid",
",",
"Set",
"<",
"Node",
">",
"nodes",
")",
"{",
"if",
"(",
"isCorrelated",
"(",
"cid",
")",
")",
"{",
"nodes",
".",
"add",
"(",
"this",
")",
";",
"}",
"}"
] | This method identifies all of the nodes within a trace that
are associated with the supplied correlation identifier.
@param cid The correlation identifier
@param nodes The set of nodes that are associated with the correlation identifier | [
"This",
"method",
"identifies",
"all",
"of",
"the",
"nodes",
"within",
"a",
"trace",
"that",
"are",
"associated",
"with",
"the",
"supplied",
"correlation",
"identifier",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/api/src/main/java/org/hawkular/apm/api/model/trace/Node.java#L360-L364 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/PgCallableStatement.java | PgCallableStatement.checkIndex | protected void checkIndex(int parameterIndex, int type1, int type2, String getName)
throws SQLException {
"""
helperfunction for the getXXX calls to check isFunction and index == 1 Compare BOTH type fields
against the return type.
@param parameterIndex parameter index (1-based)
@param type1 type 1
@par... | java | protected void checkIndex(int parameterIndex, int type1, int type2, String getName)
throws SQLException {
checkIndex(parameterIndex);
if (type1 != this.testReturn[parameterIndex - 1]
&& type2 != this.testReturn[parameterIndex - 1]) {
throw new PSQLException(
GT.tr("Parameter of typ... | [
"protected",
"void",
"checkIndex",
"(",
"int",
"parameterIndex",
",",
"int",
"type1",
",",
"int",
"type2",
",",
"String",
"getName",
")",
"throws",
"SQLException",
"{",
"checkIndex",
"(",
"parameterIndex",
")",
";",
"if",
"(",
"type1",
"!=",
"this",
".",
"... | helperfunction for the getXXX calls to check isFunction and index == 1 Compare BOTH type fields
against the return type.
@param parameterIndex parameter index (1-based)
@param type1 type 1
@param type2 type 2
@param getName getter name
@throws SQLException if something goes wrong | [
"helperfunction",
"for",
"the",
"getXXX",
"calls",
"to",
"check",
"isFunction",
"and",
"index",
"==",
"1",
"Compare",
"BOTH",
"type",
"fields",
"against",
"the",
"return",
"type",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgCallableStatement.java#L361-L372 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java | CommerceNotificationAttachmentPersistenceImpl.findByUuid_C | @Override
public List<CommerceNotificationAttachment> findByUuid_C(String uuid,
long companyId, int start, int end,
OrderByComparator<CommerceNotificationAttachment> orderByComparator) {
"""
Returns an ordered range of all the commerce notification attachments where uuid = ? and companyId = ?.
<p>
... | java | @Override
public List<CommerceNotificationAttachment> findByUuid_C(String uuid,
long companyId, int start, int end,
OrderByComparator<CommerceNotificationAttachment> orderByComparator) {
return findByUuid_C(uuid, companyId, start, end, orderByComparator, true);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceNotificationAttachment",
">",
"findByUuid_C",
"(",
"String",
"uuid",
",",
"long",
"companyId",
",",
"int",
"start",
",",
"int",
"end",
",",
"OrderByComparator",
"<",
"CommerceNotificationAttachment",
">",
"orderByComp... | Returns an ordered range of all the commerce notification attachments where uuid = ? and companyId = ?.
<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</c... | [
"Returns",
"an",
"ordered",
"range",
"of",
"all",
"the",
"commerce",
"notification",
"attachments",
"where",
"uuid",
"=",
"?",
";",
"and",
"companyId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java#L984-L989 |
elastic/elasticsearch-metrics-reporter-java | src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java | ElasticsearchReporter.openConnection | private HttpURLConnection openConnection(String uri, String method) {
"""
Open a new HttpUrlConnection, in case it fails it tries for the next host in the configured list
"""
for (String host : hosts) {
try {
URL templateUrl = new URL("http://" + host + uri);
... | java | private HttpURLConnection openConnection(String uri, String method) {
for (String host : hosts) {
try {
URL templateUrl = new URL("http://" + host + uri);
HttpURLConnection connection = ( HttpURLConnection ) templateUrl.openConnection();
connection.se... | [
"private",
"HttpURLConnection",
"openConnection",
"(",
"String",
"uri",
",",
"String",
"method",
")",
"{",
"for",
"(",
"String",
"host",
":",
"hosts",
")",
"{",
"try",
"{",
"URL",
"templateUrl",
"=",
"new",
"URL",
"(",
"\"http://\"",
"+",
"host",
"+",
"u... | Open a new HttpUrlConnection, in case it fails it tries for the next host in the configured list | [
"Open",
"a",
"new",
"HttpUrlConnection",
"in",
"case",
"it",
"fails",
"it",
"tries",
"for",
"the",
"next",
"host",
"in",
"the",
"configured",
"list"
] | train | https://github.com/elastic/elasticsearch-metrics-reporter-java/blob/4018eaef6fc7721312f7440b2bf5a19699a6cb56/src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java#L436-L456 |
openzipkin-contrib/brave-opentracing | src/main/java/brave/opentracing/BraveSpan.java | BraveSpan.toAnnotation | static String toAnnotation(Map<String, ?> fields) {
"""
Converts a map to a string of form: "key1=value1 key2=value2"
"""
// special-case the "event" field which is similar to the semantics of a zipkin annotation
Object event = fields.get("event");
if (event != null && fields.size() == 1) return ev... | java | static String toAnnotation(Map<String, ?> fields) {
// special-case the "event" field which is similar to the semantics of a zipkin annotation
Object event = fields.get("event");
if (event != null && fields.size() == 1) return event.toString();
return joinOnEqualsSpace(fields);
} | [
"static",
"String",
"toAnnotation",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"fields",
")",
"{",
"// special-case the \"event\" field which is similar to the semantics of a zipkin annotation",
"Object",
"event",
"=",
"fields",
".",
"get",
"(",
"\"event\"",
")",
";",
... | Converts a map to a string of form: "key1=value1 key2=value2" | [
"Converts",
"a",
"map",
"to",
"a",
"string",
"of",
"form",
":",
"key1",
"=",
"value1",
"key2",
"=",
"value2"
] | train | https://github.com/openzipkin-contrib/brave-opentracing/blob/07653ac3a67beb7df71008961051ff03db2b60b7/src/main/java/brave/opentracing/BraveSpan.java#L160-L166 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/HpelJsonFormatter.java | HpelJsonFormatter.addToJSON | static boolean addToJSON(StringBuilder sb, String name, String value, boolean jsonEscapeName, boolean jsonEscapeValue, boolean trim, boolean isFirstField) {
"""
/*
returns true if name value pair was added to the string buffer
"""
// if name or value is null just return
if (name == null || val... | java | static boolean addToJSON(StringBuilder sb, String name, String value, boolean jsonEscapeName, boolean jsonEscapeValue, boolean trim, boolean isFirstField) {
// if name or value is null just return
if (name == null || value == null)
return false;
// add comma if isFirstField == false... | [
"static",
"boolean",
"addToJSON",
"(",
"StringBuilder",
"sb",
",",
"String",
"name",
",",
"String",
"value",
",",
"boolean",
"jsonEscapeName",
",",
"boolean",
"jsonEscapeValue",
",",
"boolean",
"trim",
",",
"boolean",
"isFirstField",
")",
"{",
"// if name or value... | /*
returns true if name value pair was added to the string buffer | [
"/",
"*",
"returns",
"true",
"if",
"name",
"value",
"pair",
"was",
"added",
"to",
"the",
"string",
"buffer"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/HpelJsonFormatter.java#L123-L143 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/Criteria.java | Criteria.addOrderBy | public void addOrderBy(String fieldName, boolean sortAscending) {
"""
Adds a field for orderBy
@param fieldName the field name to be used
@param sortAscending true for ASCENDING, false for DESCENDING
@deprecated use QueryByCriteria#addOrderBy
"""
if (fieldName != null)
{
_ge... | java | public void addOrderBy(String fieldName, boolean sortAscending)
{
if (fieldName != null)
{
_getOrderby().add(new FieldHelper(fieldName, sortAscending));
}
} | [
"public",
"void",
"addOrderBy",
"(",
"String",
"fieldName",
",",
"boolean",
"sortAscending",
")",
"{",
"if",
"(",
"fieldName",
"!=",
"null",
")",
"{",
"_getOrderby",
"(",
")",
".",
"add",
"(",
"new",
"FieldHelper",
"(",
"fieldName",
",",
"sortAscending",
"... | Adds a field for orderBy
@param fieldName the field name to be used
@param sortAscending true for ASCENDING, false for DESCENDING
@deprecated use QueryByCriteria#addOrderBy | [
"Adds",
"a",
"field",
"for",
"orderBy"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/Criteria.java#L572-L578 |
morimekta/utils | io-util/src/main/java/net/morimekta/util/json/JsonWriter.java | JsonWriter.keyLiteral | public JsonWriter keyLiteral(CharSequence key) {
"""
Write the string key without quoting or escaping.
@param key The raw string key.
@return The JSON Writer.
"""
startKey();
if (key == null) {
throw new IllegalArgumentException("Expected map key, but got null.");
}
... | java | public JsonWriter keyLiteral(CharSequence key) {
startKey();
if (key == null) {
throw new IllegalArgumentException("Expected map key, but got null.");
}
writer.write(key.toString());
writer.write(':');
return this;
} | [
"public",
"JsonWriter",
"keyLiteral",
"(",
"CharSequence",
"key",
")",
"{",
"startKey",
"(",
")",
";",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Expected map key, but got null.\"",
")",
";",
"}",
"writer",
".... | Write the string key without quoting or escaping.
@param key The raw string key.
@return The JSON Writer. | [
"Write",
"the",
"string",
"key",
"without",
"quoting",
"or",
"escaping",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/io-util/src/main/java/net/morimekta/util/json/JsonWriter.java#L297-L307 |
apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/DefaultPluginRegistry.java | DefaultPluginRegistry.readPluginFile | protected Plugin readPluginFile(PluginCoordinates coordinates, File pluginFile) throws Exception {
"""
Reads the plugin into an object. This method will fail if the plugin is not valid.
This could happen if the file is not a java archive, or if the plugin spec file is
missing from the archive, etc.
"""
... | java | protected Plugin readPluginFile(PluginCoordinates coordinates, File pluginFile) throws Exception {
try {
PluginClassLoader pluginClassLoader = createPluginClassLoader(pluginFile);
URL specFile = pluginClassLoader.getResource(PluginUtils.PLUGIN_SPEC_PATH);
if (specFile == null... | [
"protected",
"Plugin",
"readPluginFile",
"(",
"PluginCoordinates",
"coordinates",
",",
"File",
"pluginFile",
")",
"throws",
"Exception",
"{",
"try",
"{",
"PluginClassLoader",
"pluginClassLoader",
"=",
"createPluginClassLoader",
"(",
"pluginFile",
")",
";",
"URL",
"spe... | Reads the plugin into an object. This method will fail if the plugin is not valid.
This could happen if the file is not a java archive, or if the plugin spec file is
missing from the archive, etc. | [
"Reads",
"the",
"plugin",
"into",
"an",
"object",
".",
"This",
"method",
"will",
"fail",
"if",
"the",
"plugin",
"is",
"not",
"valid",
".",
"This",
"could",
"happen",
"if",
"the",
"file",
"is",
"not",
"a",
"java",
"archive",
"or",
"if",
"the",
"plugin",... | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/DefaultPluginRegistry.java#L298-L314 |
qos-ch/slf4j | jcl-over-slf4j/src/main/java/org/apache/commons/logging/impl/SLF4JLog.java | SLF4JLog.error | public void error(Object message, Throwable t) {
"""
Converts the first input parameter to String and then delegates to the
wrapped <code>org.slf4j.Logger</code> instance.
@param message
the message to log. Converted to {@link String}
@param t
the exception to log
"""
logger.error(String.valueOf... | java | public void error(Object message, Throwable t) {
logger.error(String.valueOf(message), t);
} | [
"public",
"void",
"error",
"(",
"Object",
"message",
",",
"Throwable",
"t",
")",
"{",
"logger",
".",
"error",
"(",
"String",
".",
"valueOf",
"(",
"message",
")",
",",
"t",
")",
";",
"}"
] | Converts the first input parameter to String and then delegates to the
wrapped <code>org.slf4j.Logger</code> instance.
@param message
the message to log. Converted to {@link String}
@param t
the exception to log | [
"Converts",
"the",
"first",
"input",
"parameter",
"to",
"String",
"and",
"then",
"delegates",
"to",
"the",
"wrapped",
"<code",
">",
"org",
".",
"slf4j",
".",
"Logger<",
"/",
"code",
">",
"instance",
"."
] | train | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/jcl-over-slf4j/src/main/java/org/apache/commons/logging/impl/SLF4JLog.java#L212-L214 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.data_afnicCorporationTrademarkInformation_afnicCorporationTrademarkId_GET | public OvhAfnicCorporationTrademarkContact data_afnicCorporationTrademarkInformation_afnicCorporationTrademarkId_GET(Long afnicCorporationTrademarkId) throws IOException {
"""
Retrieve a corporation trademark information according to Afnic
REST: GET /domain/data/afnicCorporationTrademarkInformation/{afnicCorpor... | java | public OvhAfnicCorporationTrademarkContact data_afnicCorporationTrademarkInformation_afnicCorporationTrademarkId_GET(Long afnicCorporationTrademarkId) throws IOException {
String qPath = "/domain/data/afnicCorporationTrademarkInformation/{afnicCorporationTrademarkId}";
StringBuilder sb = path(qPath, afnicCorporatio... | [
"public",
"OvhAfnicCorporationTrademarkContact",
"data_afnicCorporationTrademarkInformation_afnicCorporationTrademarkId_GET",
"(",
"Long",
"afnicCorporationTrademarkId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/data/afnicCorporationTrademarkInformation/{afnicCo... | Retrieve a corporation trademark information according to Afnic
REST: GET /domain/data/afnicCorporationTrademarkInformation/{afnicCorporationTrademarkId}
@param afnicCorporationTrademarkId [required] Corporation Inpi Information ID | [
"Retrieve",
"a",
"corporation",
"trademark",
"information",
"according",
"to",
"Afnic"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L67-L72 |
dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/Maths.java | Maths.raiseToPower | public static long raiseToPower(int value, int power) {
"""
Calculate the first argument raised to the power of the second.
This method only supports non-negative powers.
@param value The number to be raised.
@param power The exponent (must be positive).
@return {@code value} raised to {@code power}.
"""
... | java | public static long raiseToPower(int value, int power)
{
if (power < 0)
{
throw new IllegalArgumentException("This method does not support negative powers.");
}
long result = 1;
for (int i = 0; i < power; i++)
{
result *= value;
}
... | [
"public",
"static",
"long",
"raiseToPower",
"(",
"int",
"value",
",",
"int",
"power",
")",
"{",
"if",
"(",
"power",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"This method does not support negative powers.\"",
")",
";",
"}",
"long",
... | Calculate the first argument raised to the power of the second.
This method only supports non-negative powers.
@param value The number to be raised.
@param power The exponent (must be positive).
@return {@code value} raised to {@code power}. | [
"Calculate",
"the",
"first",
"argument",
"raised",
"to",
"the",
"power",
"of",
"the",
"second",
".",
"This",
"method",
"only",
"supports",
"non",
"-",
"negative",
"powers",
"."
] | train | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/Maths.java#L111-L123 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/query/algebra/multibuffer/BufferNeeds.java | BufferNeeds.bestRoot | public static int bestRoot(long size, Transaction tx) {
"""
This method considers the various roots of the specified output size (in
blocks), and returns the highest root that is less than the number of
available buffers.
@param size
the size of the output file
@param tx
the tx to execute
@return the high... | java | public static int bestRoot(long size, Transaction tx) {
int avail = tx.bufferMgr().available();
if (avail <= 1)
return 1;
int k = Integer.MAX_VALUE;
double i = 1.0;
while (k > avail) {
i++;
k = (int) Math.ceil(Math.pow(size, 1 / i));
}
return k;
} | [
"public",
"static",
"int",
"bestRoot",
"(",
"long",
"size",
",",
"Transaction",
"tx",
")",
"{",
"int",
"avail",
"=",
"tx",
".",
"bufferMgr",
"(",
")",
".",
"available",
"(",
")",
";",
"if",
"(",
"avail",
"<=",
"1",
")",
"return",
"1",
";",
"int",
... | This method considers the various roots of the specified output size (in
blocks), and returns the highest root that is less than the number of
available buffers.
@param size
the size of the output file
@param tx
the tx to execute
@return the highest number less than the number of available buffers,
that is a root of t... | [
"This",
"method",
"considers",
"the",
"various",
"roots",
"of",
"the",
"specified",
"output",
"size",
"(",
"in",
"blocks",
")",
"and",
"returns",
"the",
"highest",
"root",
"that",
"is",
"less",
"than",
"the",
"number",
"of",
"available",
"buffers",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/query/algebra/multibuffer/BufferNeeds.java#L38-L49 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/Shape.java | Shape.hasVertex | public boolean hasVertex(float x, float y) {
"""
Check if a particular location is a vertex of this polygon
@param x The x coordinate to check
@param y The y coordinate to check
@return True if the cordinates supplied are a vertex of this polygon
"""
if (points.length == 0) {
return fals... | java | public boolean hasVertex(float x, float y) {
if (points.length == 0) {
return false;
}
checkPoints();
for (int i=0;i<points.length;i+=2) {
if ((points[i] == x) && (points[i+1] == y)) {
return true;
}
}
return false;
} | [
"public",
"boolean",
"hasVertex",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"if",
"(",
"points",
".",
"length",
"==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"checkPoints",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<... | Check if a particular location is a vertex of this polygon
@param x The x coordinate to check
@param y The y coordinate to check
@return True if the cordinates supplied are a vertex of this polygon | [
"Check",
"if",
"a",
"particular",
"location",
"is",
"a",
"vertex",
"of",
"this",
"polygon"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/Shape.java#L555-L569 |
sporniket/core | sporniket-core-lang/src/main/java/com/sporniket/libre/lang/functor/FunctorFactory.java | FunctorFactory.instanciateFunctorAsAClassMethodWrapper | public static Functor instanciateFunctorAsAClassMethodWrapper(Class<?> instanceClass, String methodName) throws Exception {
"""
Create a functor without parameter, wrapping a call to another method.
@param instanceClass
class containing the method.
@param methodName
Name of the method, it must exist.
@retur... | java | public static Functor instanciateFunctorAsAClassMethodWrapper(Class<?> instanceClass, String methodName) throws Exception
{
if (null == instanceClass)
{
throw new NullPointerException("instanceClass is null");
}
Method _method = instanceClass.getMethod(methodName, (Class<?>[]) null);
return instanc... | [
"public",
"static",
"Functor",
"instanciateFunctorAsAClassMethodWrapper",
"(",
"Class",
"<",
"?",
">",
"instanceClass",
",",
"String",
"methodName",
")",
"throws",
"Exception",
"{",
"if",
"(",
"null",
"==",
"instanceClass",
")",
"{",
"throw",
"new",
"NullPointerEx... | Create a functor without parameter, wrapping a call to another method.
@param instanceClass
class containing the method.
@param methodName
Name of the method, it must exist.
@return a Functor that call the specified method on the specified instance.
@throws Exception if there is a problem to deal with. | [
"Create",
"a",
"functor",
"without",
"parameter",
"wrapping",
"a",
"call",
"to",
"another",
"method",
"."
] | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-lang/src/main/java/com/sporniket/libre/lang/functor/FunctorFactory.java#L50-L58 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java | AttributeDefinition.addResourceAttributeDescription | public ModelNode addResourceAttributeDescription(final ResourceBundle bundle, final String prefix, final ModelNode resourceDescription) {
"""
Creates a returns a basic model node describing the attribute, after attaching it to the given overall resource
description model node. The node describing the attribute i... | java | public ModelNode addResourceAttributeDescription(final ResourceBundle bundle, final String prefix, final ModelNode resourceDescription) {
final ModelNode attr = getNoTextDescription(false);
attr.get(ModelDescriptionConstants.DESCRIPTION).set(getAttributeTextDescription(bundle, prefix));
final Mo... | [
"public",
"ModelNode",
"addResourceAttributeDescription",
"(",
"final",
"ResourceBundle",
"bundle",
",",
"final",
"String",
"prefix",
",",
"final",
"ModelNode",
"resourceDescription",
")",
"{",
"final",
"ModelNode",
"attr",
"=",
"getNoTextDescription",
"(",
"false",
"... | Creates a returns a basic model node describing the attribute, after attaching it to the given overall resource
description model node. The node describing the attribute is returned to make it easy to perform further
modification.
@param bundle resource bundle to use for text descriptions
@param prefix prefix to prep... | [
"Creates",
"a",
"returns",
"a",
"basic",
"model",
"node",
"describing",
"the",
"attribute",
"after",
"attaching",
"it",
"to",
"the",
"given",
"overall",
"resource",
"description",
"model",
"node",
".",
"The",
"node",
"describing",
"the",
"attribute",
"is",
"re... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java#L774-L784 |
prestodb/presto | presto-hive/src/main/java/com/facebook/presto/hive/metastore/SemiTransactionalHiveMetastore.java | SemiTransactionalHiveMetastore.recursiveDeleteFiles | private static RecursiveDeleteResult recursiveDeleteFiles(HdfsEnvironment hdfsEnvironment, HdfsContext context, Path directory, List<String> filePrefixes, boolean deleteEmptyDirectories) {
"""
Attempt to recursively remove eligible files and/or directories in {@code directory}.
<p>
When {@code filePrefixes} is n... | java | private static RecursiveDeleteResult recursiveDeleteFiles(HdfsEnvironment hdfsEnvironment, HdfsContext context, Path directory, List<String> filePrefixes, boolean deleteEmptyDirectories)
{
FileSystem fileSystem;
try {
fileSystem = hdfsEnvironment.getFileSystem(context, directory);
... | [
"private",
"static",
"RecursiveDeleteResult",
"recursiveDeleteFiles",
"(",
"HdfsEnvironment",
"hdfsEnvironment",
",",
"HdfsContext",
"context",
",",
"Path",
"directory",
",",
"List",
"<",
"String",
">",
"filePrefixes",
",",
"boolean",
"deleteEmptyDirectories",
")",
"{",... | Attempt to recursively remove eligible files and/or directories in {@code directory}.
<p>
When {@code filePrefixes} is not present, all files (but not necessarily directories) will be
ineligible. If all files shall be deleted, you can use an empty string as {@code filePrefixes}.
<p>
When {@code deleteEmptySubDirectory}... | [
"Attempt",
"to",
"recursively",
"remove",
"eligible",
"files",
"and",
"/",
"or",
"directories",
"in",
"{",
"@code",
"directory",
"}",
".",
"<p",
">",
"When",
"{",
"@code",
"filePrefixes",
"}",
"is",
"not",
"present",
"all",
"files",
"(",
"but",
"not",
"n... | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-hive/src/main/java/com/facebook/presto/hive/metastore/SemiTransactionalHiveMetastore.java#L1749-L1766 |
mjiderhamn/classloader-leak-prevention | classloader-leak-prevention/classloader-leak-prevention-servlet/src/main/java/se/jiderhamn/classloader/leak/prevention/ClassLoaderLeakPreventorListener.java | ClassLoaderLeakPreventorListener.getIntInitParameter | protected static int getIntInitParameter(ServletContext servletContext, String parameterName, int defaultValue) {
"""
Parse init parameter for integer value, returning default if not found or invalid
"""
final String parameterString = servletContext.getInitParameter(parameterName);
if(parameterString !... | java | protected static int getIntInitParameter(ServletContext servletContext, String parameterName, int defaultValue) {
final String parameterString = servletContext.getInitParameter(parameterName);
if(parameterString != null && parameterString.trim().length() > 0) {
try {
return Integer.parseInt(parame... | [
"protected",
"static",
"int",
"getIntInitParameter",
"(",
"ServletContext",
"servletContext",
",",
"String",
"parameterName",
",",
"int",
"defaultValue",
")",
"{",
"final",
"String",
"parameterString",
"=",
"servletContext",
".",
"getInitParameter",
"(",
"parameterName"... | Parse init parameter for integer value, returning default if not found or invalid | [
"Parse",
"init",
"parameter",
"for",
"integer",
"value",
"returning",
"default",
"if",
"not",
"found",
"or",
"invalid"
] | train | https://github.com/mjiderhamn/classloader-leak-prevention/blob/eea8e3cef64f8096dbbb87552df0a1bd272bcb63/classloader-leak-prevention/classloader-leak-prevention-servlet/src/main/java/se/jiderhamn/classloader/leak/prevention/ClassLoaderLeakPreventorListener.java#L255-L266 |
Azure/azure-sdk-for-java | redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java | RedisInner.beginCreate | public RedisResourceInner beginCreate(String resourceGroupName, String name, RedisCreateParameters parameters) {
"""
Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param... | java | public RedisResourceInner beginCreate(String resourceGroupName, String name, RedisCreateParameters parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().body();
} | [
"public",
"RedisResourceInner",
"beginCreate",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"RedisCreateParameters",
"parameters",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
",",
"parameters",
")",
... | Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param parameters Parameters supplied to the Create Redis operation.
@throws IllegalArgumentException thrown if parameters fail the ... | [
"Create",
"or",
"replace",
"(",
"overwrite",
"/",
"recreate",
"with",
"potential",
"downtime",
")",
"an",
"existing",
"Redis",
"cache",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java#L412-L414 |
google/j2objc | translator/src/main/java/com/google/devtools/j2objc/javac/JavacParser.java | JavacParser.createEnvironment | private JavacEnvironment createEnvironment(List<File> files, List<JavaFileObject> fileObjects,
boolean processAnnotations) throws IOException {
"""
Creates a javac environment from a collection of files and/or file objects.
"""
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
Diagnos... | java | private JavacEnvironment createEnvironment(List<File> files, List<JavaFileObject> fileObjects,
boolean processAnnotations) throws IOException {
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
StandardJavaFileM... | [
"private",
"JavacEnvironment",
"createEnvironment",
"(",
"List",
"<",
"File",
">",
"files",
",",
"List",
"<",
"JavaFileObject",
">",
"fileObjects",
",",
"boolean",
"processAnnotations",
")",
"throws",
"IOException",
"{",
"JavaCompiler",
"compiler",
"=",
"ToolProvide... | Creates a javac environment from a collection of files and/or file objects. | [
"Creates",
"a",
"javac",
"environment",
"from",
"a",
"collection",
"of",
"files",
"and",
"/",
"or",
"file",
"objects",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/javac/JavacParser.java#L252-L267 |
deeplearning4j/deeplearning4j | datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkExport.java | SparkExport.exportCSVSequenceLocalNoShuffling | public static void exportCSVSequenceLocalNoShuffling(File baseDir, JavaRDD<List<List<Writable>>> sequences)
throws Exception {
"""
Quick and dirty CSV export: one file per sequence, without shuffling
"""
exportCSVSequenceLocalNoShuffling(baseDir, sequences, "", ",", "csv");
} | java | public static void exportCSVSequenceLocalNoShuffling(File baseDir, JavaRDD<List<List<Writable>>> sequences)
throws Exception {
exportCSVSequenceLocalNoShuffling(baseDir, sequences, "", ",", "csv");
} | [
"public",
"static",
"void",
"exportCSVSequenceLocalNoShuffling",
"(",
"File",
"baseDir",
",",
"JavaRDD",
"<",
"List",
"<",
"List",
"<",
"Writable",
">",
">",
">",
"sequences",
")",
"throws",
"Exception",
"{",
"exportCSVSequenceLocalNoShuffling",
"(",
"baseDir",
",... | Quick and dirty CSV export: one file per sequence, without shuffling | [
"Quick",
"and",
"dirty",
"CSV",
"export",
":",
"one",
"file",
"per",
"sequence",
"without",
"shuffling"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkExport.java#L185-L188 |
GistLabs/mechanize | src/main/java/com/gistlabs/mechanize/util/apache/URLEncodedUtils.java | URLEncodedUtils.encPath | static String encPath(final String content, final Charset charset) {
"""
Encode a String using the {@link #PATHSAFE} set of characters.
<p>
Used by URIBuilder to encode path segments.
@param content the string to encode, does not convert space to '+'
@param charset the charset to use
@return the encoded str... | java | static String encPath(final String content, final Charset charset) {
return urlencode(content, charset, PATHSAFE, false);
} | [
"static",
"String",
"encPath",
"(",
"final",
"String",
"content",
",",
"final",
"Charset",
"charset",
")",
"{",
"return",
"urlencode",
"(",
"content",
",",
"charset",
",",
"PATHSAFE",
",",
"false",
")",
";",
"}"
] | Encode a String using the {@link #PATHSAFE} set of characters.
<p>
Used by URIBuilder to encode path segments.
@param content the string to encode, does not convert space to '+'
@param charset the charset to use
@return the encoded string | [
"Encode",
"a",
"String",
"using",
"the",
"{",
"@link",
"#PATHSAFE",
"}",
"set",
"of",
"characters",
".",
"<p",
">",
"Used",
"by",
"URIBuilder",
"to",
"encode",
"path",
"segments",
"."
] | train | https://github.com/GistLabs/mechanize/blob/32ddd0774439a4c08513c05d7ac7416a3899efed/src/main/java/com/gistlabs/mechanize/util/apache/URLEncodedUtils.java#L520-L522 |
fengwenyi/JavaLib | src/main/java/com/fengwenyi/javalib/util/RSAUtil.java | RSAUtil.privateKeyDecrypt | public static String privateKeyDecrypt(String key, String cipherText) throws NoSuchAlgorithmException,
InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
"""
私钥解密
@param key [ellipsis]
@param cipherText [ellipsis]
@return [ellipsis]... | java | public static String privateKeyDecrypt(String key, String cipherText) throws NoSuchAlgorithmException,
InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
PrivateKey privateKey = commonGetPrivatekeyByText(key);
Cipher cipher ... | [
"public",
"static",
"String",
"privateKeyDecrypt",
"(",
"String",
"key",
",",
"String",
"cipherText",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeySpecException",
",",
"NoSuchPaddingException",
",",
"InvalidKeyException",
",",
"BadPaddingException",
",",
"Il... | 私钥解密
@param key [ellipsis]
@param cipherText [ellipsis]
@return [ellipsis]
@throws NoSuchAlgorithmException [ellipsis]
@throws InvalidKeySpecException [ellipsis]
@throws NoSuchPaddingException [ellipsis]
@throws InvalidKeyException [ellipsis]
@throws BadPaddingException [ellipsis]
@throws IllegalBlockSizeException [ell... | [
"私钥解密"
] | train | https://github.com/fengwenyi/JavaLib/blob/14838b13fb11c024e41be766aa3e13ead4be1703/src/main/java/com/fengwenyi/javalib/util/RSAUtil.java#L145-L153 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/ProtoUtils.java | ProtoUtils.getDefaultInstanceMethod | private static MethodRef getDefaultInstanceMethod(Descriptor descriptor) {
"""
Returns the {@link MethodRef} for the generated defaultInstance method.
"""
TypeInfo message = messageRuntimeType(descriptor);
return MethodRef.createStaticMethod(
message, new Method("getDefaultInstance", messag... | java | private static MethodRef getDefaultInstanceMethod(Descriptor descriptor) {
TypeInfo message = messageRuntimeType(descriptor);
return MethodRef.createStaticMethod(
message, new Method("getDefaultInstance", message.type(), NO_METHOD_ARGS))
.asNonNullable();
} | [
"private",
"static",
"MethodRef",
"getDefaultInstanceMethod",
"(",
"Descriptor",
"descriptor",
")",
"{",
"TypeInfo",
"message",
"=",
"messageRuntimeType",
"(",
"descriptor",
")",
";",
"return",
"MethodRef",
".",
"createStaticMethod",
"(",
"message",
",",
"new",
"Met... | Returns the {@link MethodRef} for the generated defaultInstance method. | [
"Returns",
"the",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/ProtoUtils.java#L1253-L1258 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/refer/DependencyResolver.java | DependencyResolver.getOneRequired | public <T> T getOneRequired(Class<T> type, String name) throws ReferenceException {
"""
Gets one required dependency by its name and matching to the specified type.
At least one dependency must present. If the dependency was found it throws a
ReferenceException
@param type the Class type that defined the type... | java | public <T> T getOneRequired(Class<T> type, String name) throws ReferenceException {
Object locator = find(name);
if (locator == null)
throw new ReferenceException(null, name);
return _references.getOneRequired(type, locator);
} | [
"public",
"<",
"T",
">",
"T",
"getOneRequired",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"name",
")",
"throws",
"ReferenceException",
"{",
"Object",
"locator",
"=",
"find",
"(",
"name",
")",
";",
"if",
"(",
"locator",
"==",
"null",
")",
"t... | Gets one required dependency by its name and matching to the specified type.
At least one dependency must present. If the dependency was found it throws a
ReferenceException
@param type the Class type that defined the type of the result.
@param name the dependency name to locate.
@return a dependency reference
@throw... | [
"Gets",
"one",
"required",
"dependency",
"by",
"its",
"name",
"and",
"matching",
"to",
"the",
"specified",
"type",
".",
"At",
"least",
"one",
"dependency",
"must",
"present",
".",
"If",
"the",
"dependency",
"was",
"found",
"it",
"throws",
"a",
"ReferenceExce... | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/refer/DependencyResolver.java#L272-L278 |
alkacon/opencms-core | src/org/opencms/ade/publish/CmsPublishListHelper.java | CmsPublishListHelper.adjustCmsObject | public static CmsObject adjustCmsObject(CmsObject cms, boolean online) throws CmsException {
"""
Initializes a CmsObject based on the given one, but with adjusted project information and configured, such that release and expiration date are ignored.<p>
@param cms the original CmsObject.
@param online true if a... | java | public static CmsObject adjustCmsObject(CmsObject cms, boolean online) throws CmsException {
CmsObject result = OpenCms.initCmsObject(cms);
if (online) {
CmsProject onlineProject = cms.readProject(CmsProject.ONLINE_PROJECT_ID);
result.getRequestContext().setCurrentProject(online... | [
"public",
"static",
"CmsObject",
"adjustCmsObject",
"(",
"CmsObject",
"cms",
",",
"boolean",
"online",
")",
"throws",
"CmsException",
"{",
"CmsObject",
"result",
"=",
"OpenCms",
".",
"initCmsObject",
"(",
"cms",
")",
";",
"if",
"(",
"online",
")",
"{",
"CmsP... | Initializes a CmsObject based on the given one, but with adjusted project information and configured, such that release and expiration date are ignored.<p>
@param cms the original CmsObject.
@param online true if a CmsObject for the Online project should be returned
@return the initialized CmsObject
@throws CmsExcept... | [
"Initializes",
"a",
"CmsObject",
"based",
"on",
"the",
"given",
"one",
"but",
"with",
"adjusted",
"project",
"information",
"and",
"configured",
"such",
"that",
"release",
"and",
"expiration",
"date",
"are",
"ignored",
".",
"<p",
">",
"@param",
"cms",
"the",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/publish/CmsPublishListHelper.java#L56-L65 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceFormatter.java | BaseTraceFormatter.formatMessage | @Override
public String formatMessage(LogRecord logRecord) {
"""
{@inheritDoc} <br />
We override this method because in some JVMs, it is synchronized (why on earth?!?!).
"""
if (System.getSecurityManager() == null) {
return formatMessage(logRecord, logRecord.getParameters(), true);
... | java | @Override
public String formatMessage(LogRecord logRecord) {
if (System.getSecurityManager() == null) {
return formatMessage(logRecord, logRecord.getParameters(), true);
} else {
final LogRecord f_logRecord = logRecord;
return AccessController.doPrivileged(new Pri... | [
"@",
"Override",
"public",
"String",
"formatMessage",
"(",
"LogRecord",
"logRecord",
")",
"{",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"==",
"null",
")",
"{",
"return",
"formatMessage",
"(",
"logRecord",
",",
"logRecord",
".",
"getParameters"... | {@inheritDoc} <br />
We override this method because in some JVMs, it is synchronized (why on earth?!?!). | [
"{"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceFormatter.java#L222-L236 |
landawn/AbacusUtil | src/com/landawn/abacus/util/SQLExecutor.java | SQLExecutor.getDBSequence | public DBSequence getDBSequence(final String tableName, final String seqName, final long startVal, final int seqBufferSize) {
"""
Supports global sequence by db table.
@param tableName
@param seqName
@param startVal
@param seqBufferSize the numbers to allocate/reserve from database table when cached numbers ... | java | public DBSequence getDBSequence(final String tableName, final String seqName, final long startVal, final int seqBufferSize) {
return new DBSequence(this, tableName, seqName, startVal, seqBufferSize);
} | [
"public",
"DBSequence",
"getDBSequence",
"(",
"final",
"String",
"tableName",
",",
"final",
"String",
"seqName",
",",
"final",
"long",
"startVal",
",",
"final",
"int",
"seqBufferSize",
")",
"{",
"return",
"new",
"DBSequence",
"(",
"this",
",",
"tableName",
","... | Supports global sequence by db table.
@param tableName
@param seqName
@param startVal
@param seqBufferSize the numbers to allocate/reserve from database table when cached numbers are used up.
@return | [
"Supports",
"global",
"sequence",
"by",
"db",
"table",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/SQLExecutor.java#L3233-L3235 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/MustBeClosedChecker.java | MustBeClosedChecker.matchNewClass | @Override
public Description matchNewClass(NewClassTree tree, VisitorState state) {
"""
Check that construction of constructors annotated with {@link MustBeClosed} occurs within the
resource variable initializer of a try-with-resources statement.
"""
if (!HAS_MUST_BE_CLOSED_ANNOTATION.matches(tree, stat... | java | @Override
public Description matchNewClass(NewClassTree tree, VisitorState state) {
if (!HAS_MUST_BE_CLOSED_ANNOTATION.matches(tree, state)) {
return NO_MATCH;
}
return matchNewClassOrMethodInvocation(tree, state);
} | [
"@",
"Override",
"public",
"Description",
"matchNewClass",
"(",
"NewClassTree",
"tree",
",",
"VisitorState",
"state",
")",
"{",
"if",
"(",
"!",
"HAS_MUST_BE_CLOSED_ANNOTATION",
".",
"matches",
"(",
"tree",
",",
"state",
")",
")",
"{",
"return",
"NO_MATCH",
";"... | Check that construction of constructors annotated with {@link MustBeClosed} occurs within the
resource variable initializer of a try-with-resources statement. | [
"Check",
"that",
"construction",
"of",
"constructors",
"annotated",
"with",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/MustBeClosedChecker.java#L123-L129 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/AttributeService.java | AttributeService.readAttributes | @SuppressWarnings("unchecked")
public <A extends BasicFileAttributes> A readAttributes(File file, Class<A> type) {
"""
Returns attributes of the given file as an object of the given type.
@throws UnsupportedOperationException if the given attributes type is not supported
"""
AttributeProvider provider... | java | @SuppressWarnings("unchecked")
public <A extends BasicFileAttributes> A readAttributes(File file, Class<A> type) {
AttributeProvider provider = providersByAttributesType.get(type);
if (provider != null) {
return (A) provider.readAttributes(file);
}
throw new UnsupportedOperationException("unsup... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"A",
"extends",
"BasicFileAttributes",
">",
"A",
"readAttributes",
"(",
"File",
"file",
",",
"Class",
"<",
"A",
">",
"type",
")",
"{",
"AttributeProvider",
"provider",
"=",
"providersByAttributes... | Returns attributes of the given file as an object of the given type.
@throws UnsupportedOperationException if the given attributes type is not supported | [
"Returns",
"attributes",
"of",
"the",
"given",
"file",
"as",
"an",
"object",
"of",
"the",
"given",
"type",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/AttributeService.java#L356-L364 |
atomix/copycat | server/src/main/java/io/atomix/copycat/server/storage/compaction/MajorCompactionTask.java | MajorCompactionTask.compactSegment | private void compactSegment(Segment segment, OffsetPredicate predicate, Segment compactSegment) {
"""
Compacts the given segment.
@param segment The segment to compact.
@param compactSegment The segment to which to write the compacted segment.
"""
for (long i = segment.firstIndex(); i <= segment.lastIn... | java | private void compactSegment(Segment segment, OffsetPredicate predicate, Segment compactSegment) {
for (long i = segment.firstIndex(); i <= segment.lastIndex(); i++) {
checkEntry(i, segment, predicate, compactSegment);
}
} | [
"private",
"void",
"compactSegment",
"(",
"Segment",
"segment",
",",
"OffsetPredicate",
"predicate",
",",
"Segment",
"compactSegment",
")",
"{",
"for",
"(",
"long",
"i",
"=",
"segment",
".",
"firstIndex",
"(",
")",
";",
"i",
"<=",
"segment",
".",
"lastIndex"... | Compacts the given segment.
@param segment The segment to compact.
@param compactSegment The segment to which to write the compacted segment. | [
"Compacts",
"the",
"given",
"segment",
"."
] | train | https://github.com/atomix/copycat/blob/c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10/server/src/main/java/io/atomix/copycat/server/storage/compaction/MajorCompactionTask.java#L187-L191 |
Credntia/MVBarcodeReader | mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeCaptureFragment.java | BarcodeCaptureFragment.onTouch | @Override
public boolean onTouch(View v, MotionEvent event) {
"""
Called when a touch event is dispatched to a view. This allows listeners to
get a chance to respond before the target view.
@param v The view the touch event has been dispatched to.
@param event The MotionEvent object containing full in... | java | @Override
public boolean onTouch(View v, MotionEvent event) {
boolean b = scaleGestureDetector.onTouchEvent(event);
boolean c = gestureDetector.onTouchEvent(event);
return b || c || v.onTouchEvent(event);
} | [
"@",
"Override",
"public",
"boolean",
"onTouch",
"(",
"View",
"v",
",",
"MotionEvent",
"event",
")",
"{",
"boolean",
"b",
"=",
"scaleGestureDetector",
".",
"onTouchEvent",
"(",
"event",
")",
";",
"boolean",
"c",
"=",
"gestureDetector",
".",
"onTouchEvent",
"... | Called when a touch event is dispatched to a view. This allows listeners to
get a chance to respond before the target view.
@param v The view the touch event has been dispatched to.
@param event The MotionEvent object containing full information about
the event.
@return True if the listener has consumed the event,... | [
"Called",
"when",
"a",
"touch",
"event",
"is",
"dispatched",
"to",
"a",
"view",
".",
"This",
"allows",
"listeners",
"to",
"get",
"a",
"chance",
"to",
"respond",
"before",
"the",
"target",
"view",
"."
] | train | https://github.com/Credntia/MVBarcodeReader/blob/2a2561f1c3b4d4e3c046a341fbf23a31eabfda8d/mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeCaptureFragment.java#L423-L430 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/lexinduct/vote/VotingLexiconInduction.java | VotingLexiconInduction.getLexiconEntriesFromParses | private static Set<LexiconEntry> getLexiconEntriesFromParses(Collection<CcgParse> parses) {
"""
Gets all of the lexicon entries used in {@code parses}.
@param parses
@return
"""
// Generate candidate lexicon entries from the correct max parses.
Set<LexiconEntry> candidateEntries = Sets.newHashSet()... | java | private static Set<LexiconEntry> getLexiconEntriesFromParses(Collection<CcgParse> parses) {
// Generate candidate lexicon entries from the correct max parses.
Set<LexiconEntry> candidateEntries = Sets.newHashSet();
for (CcgParse correctMaxParse : parses) {
for (LexiconEntryInfo info : correctMaxParse.... | [
"private",
"static",
"Set",
"<",
"LexiconEntry",
">",
"getLexiconEntriesFromParses",
"(",
"Collection",
"<",
"CcgParse",
">",
"parses",
")",
"{",
"// Generate candidate lexicon entries from the correct max parses.",
"Set",
"<",
"LexiconEntry",
">",
"candidateEntries",
"=",
... | Gets all of the lexicon entries used in {@code parses}.
@param parses
@return | [
"Gets",
"all",
"of",
"the",
"lexicon",
"entries",
"used",
"in",
"{",
"@code",
"parses",
"}",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/lexinduct/vote/VotingLexiconInduction.java#L217-L230 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/RandomMatrices_DDRM.java | RandomMatrices_DDRM.insideSpan | public static DMatrixRMaj insideSpan(DMatrixRMaj[] span , double min , double max , Random rand ) {
"""
Creates a random vector that is inside the specified span.
@param span The span the random vector belongs in.
@param rand RNG
@return A random vector within the specified span.
"""
DMatrixRMaj A... | java | public static DMatrixRMaj insideSpan(DMatrixRMaj[] span , double min , double max , Random rand ) {
DMatrixRMaj A = new DMatrixRMaj(span.length,1);
DMatrixRMaj B = new DMatrixRMaj(span[0].getNumElements(),1);
for( int i = 0; i < span.length; i++ ) {
B.set(span[i]);
doub... | [
"public",
"static",
"DMatrixRMaj",
"insideSpan",
"(",
"DMatrixRMaj",
"[",
"]",
"span",
",",
"double",
"min",
",",
"double",
"max",
",",
"Random",
"rand",
")",
"{",
"DMatrixRMaj",
"A",
"=",
"new",
"DMatrixRMaj",
"(",
"span",
".",
"length",
",",
"1",
")",
... | Creates a random vector that is inside the specified span.
@param span The span the random vector belongs in.
@param rand RNG
@return A random vector within the specified span. | [
"Creates",
"a",
"random",
"vector",
"that",
"is",
"inside",
"the",
"specified",
"span",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/RandomMatrices_DDRM.java#L110-L125 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java | CmsGalleryController.categoryTreeToList | private void categoryTreeToList(List<CmsCategoryBean> categoryList, List<CmsCategoryTreeEntry> entries) {
"""
Converts categories tree to a list of info beans.<p>
@param categoryList the category list
@param entries the tree entries
"""
if (entries == null) {
return;
}
... | java | private void categoryTreeToList(List<CmsCategoryBean> categoryList, List<CmsCategoryTreeEntry> entries) {
if (entries == null) {
return;
}
// skipping the root tree entry where the path property is empty
for (CmsCategoryTreeEntry entry : entries) {
CmsCategoryBea... | [
"private",
"void",
"categoryTreeToList",
"(",
"List",
"<",
"CmsCategoryBean",
">",
"categoryList",
",",
"List",
"<",
"CmsCategoryTreeEntry",
">",
"entries",
")",
"{",
"if",
"(",
"entries",
"==",
"null",
")",
"{",
"return",
";",
"}",
"// skipping the root tree en... | Converts categories tree to a list of info beans.<p>
@param categoryList the category list
@param entries the tree entries | [
"Converts",
"categories",
"tree",
"to",
"a",
"list",
"of",
"info",
"beans",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java#L1795-L1806 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/RequestClientOptions.java | RequestClientOptions.createUserAgentMarkerString | private String createUserAgentMarkerString(final String marker, String userAgent) {
"""
Appends the given client marker string to the existing one and returns it.
"""
return marker.contains(userAgent) ? marker : marker + " " + userAgent;
} | java | private String createUserAgentMarkerString(final String marker, String userAgent) {
return marker.contains(userAgent) ? marker : marker + " " + userAgent;
} | [
"private",
"String",
"createUserAgentMarkerString",
"(",
"final",
"String",
"marker",
",",
"String",
"userAgent",
")",
"{",
"return",
"marker",
".",
"contains",
"(",
"userAgent",
")",
"?",
"marker",
":",
"marker",
"+",
"\" \"",
"+",
"userAgent",
";",
"}"
] | Appends the given client marker string to the existing one and returns it. | [
"Appends",
"the",
"given",
"client",
"marker",
"string",
"to",
"the",
"existing",
"one",
"and",
"returns",
"it",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/RequestClientOptions.java#L97-L99 |
jasminb/jsonapi-converter | src/main/java/com/github/jasminb/jsonapi/ResourceConverter.java | ResourceConverter.parseRelationship | private Object parseRelationship(JsonNode relationshipDataNode, Class<?> type)
throws IOException, IllegalAccessException, InstantiationException {
"""
Creates relationship object by consuming provided 'data' node.
@param relationshipDataNode relationship data node
@param type object type
@return created obj... | java | private Object parseRelationship(JsonNode relationshipDataNode, Class<?> type)
throws IOException, IllegalAccessException, InstantiationException {
if (ValidationUtils.isRelationshipParsable(relationshipDataNode)) {
String identifier = createIdentifier(relationshipDataNode);
if (resourceCache.contains(ident... | [
"private",
"Object",
"parseRelationship",
"(",
"JsonNode",
"relationshipDataNode",
",",
"Class",
"<",
"?",
">",
"type",
")",
"throws",
"IOException",
",",
"IllegalAccessException",
",",
"InstantiationException",
"{",
"if",
"(",
"ValidationUtils",
".",
"isRelationshipP... | Creates relationship object by consuming provided 'data' node.
@param relationshipDataNode relationship data node
@param type object type
@return created object or <code>null</code> in case data node is not valid
@throws IOException
@throws IllegalAccessException
@throws InstantiationException | [
"Creates",
"relationship",
"object",
"by",
"consuming",
"provided",
"data",
"node",
"."
] | train | https://github.com/jasminb/jsonapi-converter/blob/73b41c3b9274e70e62b3425071ca8afdc7bddaf6/src/main/java/com/github/jasminb/jsonapi/ResourceConverter.java#L576-L595 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/streaming/JsonTextSequences.java | JsonTextSequences.fromObject | public static HttpResponse fromObject(HttpHeaders headers, @Nullable Object content) {
"""
Creates a new JSON Text Sequences of the specified {@code content}.
@param headers the HTTP headers supposed to send
@param content the object supposed to send as contents
"""
return fromObject(headers, conte... | java | public static HttpResponse fromObject(HttpHeaders headers, @Nullable Object content) {
return fromObject(headers, content, HttpHeaders.EMPTY_HEADERS, defaultMapper);
} | [
"public",
"static",
"HttpResponse",
"fromObject",
"(",
"HttpHeaders",
"headers",
",",
"@",
"Nullable",
"Object",
"content",
")",
"{",
"return",
"fromObject",
"(",
"headers",
",",
"content",
",",
"HttpHeaders",
".",
"EMPTY_HEADERS",
",",
"defaultMapper",
")",
";"... | Creates a new JSON Text Sequences of the specified {@code content}.
@param headers the HTTP headers supposed to send
@param content the object supposed to send as contents | [
"Creates",
"a",
"new",
"JSON",
"Text",
"Sequences",
"of",
"the",
"specified",
"{",
"@code",
"content",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/streaming/JsonTextSequences.java#L228-L230 |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/price/Price.java | Price.createFromNetAmount | @Nonnull
public static Price createFromNetAmount (@Nonnull final ICurrencyValue aNetAmount, @Nonnull final IVATItem aVATItem) {
"""
Create a price from a net amount.
@param aNetAmount
The net amount to use. May not be <code>null</code>.
@param aVATItem
The VAT item to use. May not be <code>null</code>.
@r... | java | @Nonnull
public static Price createFromNetAmount (@Nonnull final ICurrencyValue aNetAmount, @Nonnull final IVATItem aVATItem)
{
return new Price (aNetAmount, aVATItem);
} | [
"@",
"Nonnull",
"public",
"static",
"Price",
"createFromNetAmount",
"(",
"@",
"Nonnull",
"final",
"ICurrencyValue",
"aNetAmount",
",",
"@",
"Nonnull",
"final",
"IVATItem",
"aVATItem",
")",
"{",
"return",
"new",
"Price",
"(",
"aNetAmount",
",",
"aVATItem",
")",
... | Create a price from a net amount.
@param aNetAmount
The net amount to use. May not be <code>null</code>.
@param aVATItem
The VAT item to use. May not be <code>null</code>.
@return The created {@link Price} | [
"Create",
"a",
"price",
"from",
"a",
"net",
"amount",
"."
] | train | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/price/Price.java#L246-L250 |
ManfredTremmel/gwt-bean-validators | gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/constraintvalidators/hv/ModCheckBase.java | ModCheckBase.isValid | public boolean isValid(final CharSequence value, final ConstraintValidatorContext context) {
"""
valid check.
@param value value to check.
@param context constraint validator context
@return true if valid
"""
if (value == null) {
return true;
}
final String valueAsString = value.toStrin... | java | public boolean isValid(final CharSequence value, final ConstraintValidatorContext context) {
if (value == null) {
return true;
}
final String valueAsString = value.toString();
String digitsAsString;
char checkDigit;
try {
digitsAsString = this.extractVerificationString(valueAsString... | [
"public",
"boolean",
"isValid",
"(",
"final",
"CharSequence",
"value",
",",
"final",
"ConstraintValidatorContext",
"context",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"final",
"String",
"valueAsString",
"=",
"value",
... | valid check.
@param value value to check.
@param context constraint validator context
@return true if valid | [
"valid",
"check",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/constraintvalidators/hv/ModCheckBase.java#L63-L87 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/index/hash/HashIndex.java | HashIndex.beforeFirst | @Override
public void beforeFirst(SearchRange searchRange) {
"""
Positions the index before the first index record having the specified
search key. The method hashes the search key to determine the bucket, and
then opens a {@link RecordFile} on the file corresponding to the bucket.
The record file for the pre... | java | @Override
public void beforeFirst(SearchRange searchRange) {
close();
// support the equality query only
if (!searchRange.isSingleValue())
throw new UnsupportedOperationException();
this.searchKey = searchRange.asSearchKey();
int bucket = searchKey.hashCode() % NUM_BUCKETS;
String tblname = ii... | [
"@",
"Override",
"public",
"void",
"beforeFirst",
"(",
"SearchRange",
"searchRange",
")",
"{",
"close",
"(",
")",
";",
"// support the equality query only\r",
"if",
"(",
"!",
"searchRange",
".",
"isSingleValue",
"(",
")",
")",
"throw",
"new",
"UnsupportedOperation... | Positions the index before the first index record having the specified
search key. The method hashes the search key to determine the bucket, and
then opens a {@link RecordFile} on the file corresponding to the bucket.
The record file for the previous bucket (if any) is closed.
@see Index#beforeFirst(SearchRange) | [
"Positions",
"the",
"index",
"before",
"the",
"first",
"index",
"record",
"having",
"the",
"specified",
"search",
"key",
".",
"The",
"method",
"hashes",
"the",
"search",
"key",
"to",
"determine",
"the",
"bucket",
"and",
"then",
"opens",
"a",
"{",
"@link",
... | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/index/hash/HashIndex.java#L123-L142 |
alkacon/opencms-core | src-setup/org/opencms/setup/xml/CmsSetupXmlHelper.java | CmsSetupXmlHelper.getValue | public static String getValue(Document document, String xPath) {
"""
Returns the value in the given xpath of the given xml file.<p>
@param document the xml document
@param xPath the xpath to read (should select a single node or attribute)
@return the value in the given xpath of the given xml file, or <code>... | java | public static String getValue(Document document, String xPath) {
Node node = document.selectSingleNode(xPath);
if (node != null) {
// return the value
return node.getText();
} else {
return null;
}
} | [
"public",
"static",
"String",
"getValue",
"(",
"Document",
"document",
",",
"String",
"xPath",
")",
"{",
"Node",
"node",
"=",
"document",
".",
"selectSingleNode",
"(",
"xPath",
")",
";",
"if",
"(",
"node",
"!=",
"null",
")",
"{",
"// return the value",
"re... | Returns the value in the given xpath of the given xml file.<p>
@param document the xml document
@param xPath the xpath to read (should select a single node or attribute)
@return the value in the given xpath of the given xml file, or <code>null</code> if no matching node | [
"Returns",
"the",
"value",
"in",
"the",
"given",
"xpath",
"of",
"the",
"given",
"xml",
"file",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/xml/CmsSetupXmlHelper.java#L137-L146 |
apache/incubator-gobblin | gobblin-compaction/src/main/java/org/apache/gobblin/compaction/event/CompactionSlaEventHelper.java | CompactionSlaEventHelper.populateState | @Deprecated
public static void populateState(Dataset dataset, Optional<Job> job, FileSystem fs) {
"""
{@link Deprecated} use {@link #getEventSubmitterBuilder(Dataset, Optional, FileSystem)}
"""
dataset.jobProps().setProp(SlaEventKeys.DATASET_URN_KEY, dataset.getUrn());
dataset.jobProps().setProp(SlaE... | java | @Deprecated
public static void populateState(Dataset dataset, Optional<Job> job, FileSystem fs) {
dataset.jobProps().setProp(SlaEventKeys.DATASET_URN_KEY, dataset.getUrn());
dataset.jobProps().setProp(SlaEventKeys.PARTITION_KEY,
dataset.jobProps().getProp(MRCompactor.COMPACTION_JOB_DEST_PARTITION, "")... | [
"@",
"Deprecated",
"public",
"static",
"void",
"populateState",
"(",
"Dataset",
"dataset",
",",
"Optional",
"<",
"Job",
">",
"job",
",",
"FileSystem",
"fs",
")",
"{",
"dataset",
".",
"jobProps",
"(",
")",
".",
"setProp",
"(",
"SlaEventKeys",
".",
"DATASET_... | {@link Deprecated} use {@link #getEventSubmitterBuilder(Dataset, Optional, FileSystem)} | [
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/event/CompactionSlaEventHelper.java#L98-L106 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/Member.java | Member.getTotalDone | public Double getTotalDone(WorkitemFilter filter) {
"""
Return the total done for all workitems owned by this member optionally
filtered.
@param filter Criteria to filter workitems on.
@return total done of selected Workitems.
"""
filter = (filter != null) ? filter : new WorkitemFilter();
... | java | public Double getTotalDone(WorkitemFilter filter) {
filter = (filter != null) ? filter : new WorkitemFilter();
return getSum("OwnedWorkitems", filter, "Actuals.Value");
} | [
"public",
"Double",
"getTotalDone",
"(",
"WorkitemFilter",
"filter",
")",
"{",
"filter",
"=",
"(",
"filter",
"!=",
"null",
")",
"?",
"filter",
":",
"new",
"WorkitemFilter",
"(",
")",
";",
"return",
"getSum",
"(",
"\"OwnedWorkitems\"",
",",
"filter",
",",
"... | Return the total done for all workitems owned by this member optionally
filtered.
@param filter Criteria to filter workitems on.
@return total done of selected Workitems. | [
"Return",
"the",
"total",
"done",
"for",
"all",
"workitems",
"owned",
"by",
"this",
"member",
"optionally",
"filtered",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Member.java#L322-L326 |
dropwizard/dropwizard | dropwizard-util/src/main/java/io/dropwizard/util/Resources.java | Resources.copy | public static void copy(URL from, OutputStream to) throws IOException {
"""
Copies all bytes from a URL to an output stream.
@param from the URL to read from
@param to the output stream
@throws IOException if an I/O error occurs
"""
try (InputStream inputStream = from.openStream()) {
B... | java | public static void copy(URL from, OutputStream to) throws IOException {
try (InputStream inputStream = from.openStream()) {
ByteStreams.copy(inputStream, to);
}
} | [
"public",
"static",
"void",
"copy",
"(",
"URL",
"from",
",",
"OutputStream",
"to",
")",
"throws",
"IOException",
"{",
"try",
"(",
"InputStream",
"inputStream",
"=",
"from",
".",
"openStream",
"(",
")",
")",
"{",
"ByteStreams",
".",
"copy",
"(",
"inputStrea... | Copies all bytes from a URL to an output stream.
@param from the URL to read from
@param to the output stream
@throws IOException if an I/O error occurs | [
"Copies",
"all",
"bytes",
"from",
"a",
"URL",
"to",
"an",
"output",
"stream",
"."
] | train | https://github.com/dropwizard/dropwizard/blob/7ee09a410476b9681e8072ab684788bb440877bd/dropwizard-util/src/main/java/io/dropwizard/util/Resources.java#L71-L75 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceEncryptionProtectorsInner.java | ManagedInstanceEncryptionProtectorsInner.createOrUpdate | public ManagedInstanceEncryptionProtectorInner createOrUpdate(String resourceGroupName, String managedInstanceName, ManagedInstanceEncryptionProtectorInner parameters) {
"""
Updates an existing encryption protector.
@param resourceGroupName The name of the resource group that contains the resource. You can obta... | java | public ManagedInstanceEncryptionProtectorInner createOrUpdate(String resourceGroupName, String managedInstanceName, ManagedInstanceEncryptionProtectorInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).toBlocking().last().body();
} | [
"public",
"ManagedInstanceEncryptionProtectorInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"managedInstanceName",
",",
"ManagedInstanceEncryptionProtectorInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourc... | Updates an existing encryption protector.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param managedInstanceName The name of the managed instance.
@param parameters The requested encryption protector re... | [
"Updates",
"an",
"existing",
"encryption",
"protector",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceEncryptionProtectorsInner.java#L306-L308 |
Netflix/conductor | client/src/main/java/com/netflix/conductor/client/http/WorkflowClient.java | WorkflowClient.terminateWorkflow | public void terminateWorkflow(String workflowId, String reason) {
"""
Terminates the execution of the given workflow instance
@param workflowId the id of the workflow to be terminated
@param reason the reason to be logged and displayed
"""
Preconditions.checkArgument(StringUtils.isNotBlank(work... | java | public void terminateWorkflow(String workflowId, String reason) {
Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "workflow id cannot be blank");
delete(new Object[]{"reason", reason}, "workflow/{workflowId}", workflowId);
} | [
"public",
"void",
"terminateWorkflow",
"(",
"String",
"workflowId",
",",
"String",
"reason",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"workflowId",
")",
",",
"\"workflow id cannot be blank\"",
")",
";",
"delete",
... | Terminates the execution of the given workflow instance
@param workflowId the id of the workflow to be terminated
@param reason the reason to be logged and displayed | [
"Terminates",
"the",
"execution",
"of",
"the",
"given",
"workflow",
"instance"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/client/src/main/java/com/netflix/conductor/client/http/WorkflowClient.java#L333-L336 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.addInlineComment | public void addInlineComment(Element element, DocTree tag, Content htmltree) {
"""
Add the inline comment.
@param element the Element for which the inline comment will be added
@param tag the inline tag to be added
@param htmltree the content tree to which the comment will be added
"""
CommentHelp... | java | public void addInlineComment(Element element, DocTree tag, Content htmltree) {
CommentHelper ch = utils.getCommentHelper(element);
List<? extends DocTree> description = ch.getDescription(configuration, tag);
addCommentTags(element, tag, description, false, false, htmltree);
} | [
"public",
"void",
"addInlineComment",
"(",
"Element",
"element",
",",
"DocTree",
"tag",
",",
"Content",
"htmltree",
")",
"{",
"CommentHelper",
"ch",
"=",
"utils",
".",
"getCommentHelper",
"(",
"element",
")",
";",
"List",
"<",
"?",
"extends",
"DocTree",
">",... | Add the inline comment.
@param element the Element for which the inline comment will be added
@param tag the inline tag to be added
@param htmltree the content tree to which the comment will be added | [
"Add",
"the",
"inline",
"comment",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L1622-L1626 |
BoltsFramework/Bolts-Android | bolts-tasks/src/main/java/bolts/Task.java | Task.continueWhile | public Task<Void> continueWhile(Callable<Boolean> predicate,
Continuation<Void, Task<Void>> continuation, CancellationToken ct) {
"""
Continues a task with the equivalent of a Task-based while loop, where the body of the loop is
a task continuation.
"""
return continueWhile(predicate, continuation, ... | java | public Task<Void> continueWhile(Callable<Boolean> predicate,
Continuation<Void, Task<Void>> continuation, CancellationToken ct) {
return continueWhile(predicate, continuation, IMMEDIATE_EXECUTOR, ct);
} | [
"public",
"Task",
"<",
"Void",
">",
"continueWhile",
"(",
"Callable",
"<",
"Boolean",
">",
"predicate",
",",
"Continuation",
"<",
"Void",
",",
"Task",
"<",
"Void",
">",
">",
"continuation",
",",
"CancellationToken",
"ct",
")",
"{",
"return",
"continueWhile",... | Continues a task with the equivalent of a Task-based while loop, where the body of the loop is
a task continuation. | [
"Continues",
"a",
"task",
"with",
"the",
"equivalent",
"of",
"a",
"Task",
"-",
"based",
"while",
"loop",
"where",
"the",
"body",
"of",
"the",
"loop",
"is",
"a",
"task",
"continuation",
"."
] | train | https://github.com/BoltsFramework/Bolts-Android/blob/54e9cb8bdd4950aa4d418dcbc0ea65414762aef5/bolts-tasks/src/main/java/bolts/Task.java#L585-L588 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getTPDeliveryInfo | public void getTPDeliveryInfo(String API, Callback<Delivery> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on delivery API go <a href="https://wiki.guildwars2.com/wiki/API:2/commerce/delivery">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@... | java | public void getTPDeliveryInfo(String API, Callback<Delivery> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API));
gw2API.getTPDeliveryInfo(API).enqueue(callback);
} | [
"public",
"void",
"getTPDeliveryInfo",
"(",
"String",
"API",
",",
"Callback",
"<",
"Delivery",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ParamType",
".",
"API",
",",
... | For more info on delivery API go <a href="https://wiki.guildwars2.com/wiki/API:2/commerce/delivery">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param API API key
@param callback callback that is ... | [
"For",
"more",
"info",
"on",
"delivery",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"commerce",
"/",
"delivery",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L906-L909 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/util/concurrent/AbstractFuture.java | AbstractFuture.executeListener | private static void executeListener(Runnable runnable, Executor executor, boolean maskExecutorExceptions) {
"""
Submits the given runnable to the given {@link Executor} catching and logging all
{@linkplain RuntimeException runtime exceptions} thrown by the executor.
"""
try {
executor.execute(runnab... | java | private static void executeListener(Runnable runnable, Executor executor, boolean maskExecutorExceptions) {
try {
executor.execute(runnable);
} catch (RuntimeException e) {
if (!maskExecutorExceptions) {
// Caller wants to handle those exceptions
throw e;
}
... | [
"private",
"static",
"void",
"executeListener",
"(",
"Runnable",
"runnable",
",",
"Executor",
"executor",
",",
"boolean",
"maskExecutorExceptions",
")",
"{",
"try",
"{",
"executor",
".",
"execute",
"(",
"runnable",
")",
";",
"}",
"catch",
"(",
"RuntimeException"... | Submits the given runnable to the given {@link Executor} catching and logging all
{@linkplain RuntimeException runtime exceptions} thrown by the executor. | [
"Submits",
"the",
"given",
"runnable",
"to",
"the",
"given",
"{"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/util/concurrent/AbstractFuture.java#L915-L931 |
dhanji/sitebricks | sitebricks/src/main/java/com/google/sitebricks/compiler/HtmlTemplateCompiler.java | HtmlTemplateCompiler.lexicalDescend | private void lexicalDescend(PageCompilingContext pc, Element element, boolean shouldPopScope) {
"""
Complement of HtmlTemplateCompiler#lexicalClimb().
This method pops off the stack of lexical scopes when
we're done processing a sitebricks widget.
"""
//pop form
if ("form".equals(element.tag... | java | private void lexicalDescend(PageCompilingContext pc, Element element, boolean shouldPopScope) {
//pop form
if ("form".equals(element.tagName()))
pc.form = null;
//pop compiler if the scope ends
if (shouldPopScope) {
pc.lexicalScopes.pop();
}
} | [
"private",
"void",
"lexicalDescend",
"(",
"PageCompilingContext",
"pc",
",",
"Element",
"element",
",",
"boolean",
"shouldPopScope",
")",
"{",
"//pop form",
"if",
"(",
"\"form\"",
".",
"equals",
"(",
"element",
".",
"tagName",
"(",
")",
")",
")",
"pc",
".",
... | Complement of HtmlTemplateCompiler#lexicalClimb().
This method pops off the stack of lexical scopes when
we're done processing a sitebricks widget. | [
"Complement",
"of",
"HtmlTemplateCompiler#lexicalClimb",
"()",
".",
"This",
"method",
"pops",
"off",
"the",
"stack",
"of",
"lexical",
"scopes",
"when",
"we",
"re",
"done",
"processing",
"a",
"sitebricks",
"widget",
"."
] | train | https://github.com/dhanji/sitebricks/blob/8682029a78bd48fb8566173d970800499e9e5d97/sitebricks/src/main/java/com/google/sitebricks/compiler/HtmlTemplateCompiler.java#L209-L219 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201902/publisherquerylanguageservice/GetAllLineItems.java | GetAllLineItems.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws IOException {
"""
Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws Remo... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws IOException {
// Get the PublisherQueryLanguageService.
PublisherQueryLanguageServiceInterface pqlService =
adManagerServices.get(session, PublisherQueryLanguageServiceInterface.class);
// Crea... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"IOException",
"{",
"// Get the PublisherQueryLanguageService.",
"PublisherQueryLanguageServiceInterface",
"pqlService",
"=",
"adManagerServ... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors.
@throws IOException if unable to write the response to a file. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201902/publisherquerylanguageservice/GetAllLineItems.java#L59-L105 |
apache/flink | flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/util/SetCache.java | SetCache.getUnsortedGrouping | @SuppressWarnings("unchecked")
public <T> UnsortedGrouping<T> getUnsortedGrouping(int id) {
"""
Returns the cached {@link UnsortedGrouping} for the given ID.
@param id Set ID
@param <T> UnsortedGrouping type
@return Cached UnsortedGrouping
@throws IllegalStateException if the cached set is not an UnsortedG... | java | @SuppressWarnings("unchecked")
public <T> UnsortedGrouping<T> getUnsortedGrouping(int id) {
return verifyType(id, unsortedGroupings.get(id), SetType.UNSORTED_GROUPING);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"UnsortedGrouping",
"<",
"T",
">",
"getUnsortedGrouping",
"(",
"int",
"id",
")",
"{",
"return",
"verifyType",
"(",
"id",
",",
"unsortedGroupings",
".",
"get",
"(",
"id",
")",
",",... | Returns the cached {@link UnsortedGrouping} for the given ID.
@param id Set ID
@param <T> UnsortedGrouping type
@return Cached UnsortedGrouping
@throws IllegalStateException if the cached set is not an UnsortedGrouping | [
"Returns",
"the",
"cached",
"{",
"@link",
"UnsortedGrouping",
"}",
"for",
"the",
"given",
"ID",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/util/SetCache.java#L169-L172 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.appendGroupByClause | protected void appendGroupByClause(List groupByFields, StringBuffer buf) {
"""
Appends the GROUP BY clause for the Query
@param groupByFields
@param buf
"""
if (groupByFields == null || groupByFields.size() == 0)
{
return;
}
buf.append(" GROUP BY ");
... | java | protected void appendGroupByClause(List groupByFields, StringBuffer buf)
{
if (groupByFields == null || groupByFields.size() == 0)
{
return;
}
buf.append(" GROUP BY ");
for (int i = 0; i < groupByFields.size(); i++)
{
FieldHelper cf ... | [
"protected",
"void",
"appendGroupByClause",
"(",
"List",
"groupByFields",
",",
"StringBuffer",
"buf",
")",
"{",
"if",
"(",
"groupByFields",
"==",
"null",
"||",
"groupByFields",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
"buf",
".",
"... | Appends the GROUP BY clause for the Query
@param groupByFields
@param buf | [
"Appends",
"the",
"GROUP",
"BY",
"clause",
"for",
"the",
"Query"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L1520-L1539 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/instance/SimpleSlot.java | SimpleSlot.tryAssignPayload | @Override
public boolean tryAssignPayload(Payload payload) {
"""
Atomically sets the executed vertex, if no vertex has been assigned to this slot so far.
@param payload The vertex to assign to this slot.
@return True, if the vertex was assigned, false, otherwise.
"""
Preconditions.checkNotNull(payload);... | java | @Override
public boolean tryAssignPayload(Payload payload) {
Preconditions.checkNotNull(payload);
// check that we can actually run in this slot
if (isCanceled()) {
return false;
}
// atomically assign the vertex
if (!PAYLOAD_UPDATER.compareAndSet(this, null, payload)) {
return false;
}
// we ... | [
"@",
"Override",
"public",
"boolean",
"tryAssignPayload",
"(",
"Payload",
"payload",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"payload",
")",
";",
"// check that we can actually run in this slot",
"if",
"(",
"isCanceled",
"(",
")",
")",
"{",
"return",
... | Atomically sets the executed vertex, if no vertex has been assigned to this slot so far.
@param payload The vertex to assign to this slot.
@return True, if the vertex was assigned, false, otherwise. | [
"Atomically",
"sets",
"the",
"executed",
"vertex",
"if",
"no",
"vertex",
"has",
"been",
"assigned",
"to",
"this",
"slot",
"so",
"far",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/instance/SimpleSlot.java#L171-L192 |
jenkinsci/jenkins | core/src/main/java/jenkins/model/Jenkins.java | Jenkins.toVersion | private static @CheckForNull VersionNumber toVersion(@CheckForNull String versionString) {
"""
Parses a version string into {@link VersionNumber}, or null if it's not parseable as a version number
(such as when Jenkins is run with "mvn hudson-dev:run")
"""
if (versionString == null) {
retu... | java | private static @CheckForNull VersionNumber toVersion(@CheckForNull String versionString) {
if (versionString == null) {
return null;
}
try {
return new VersionNumber(versionString);
} catch (NumberFormatException e) {
try {
// for non-... | [
"private",
"static",
"@",
"CheckForNull",
"VersionNumber",
"toVersion",
"(",
"@",
"CheckForNull",
"String",
"versionString",
")",
"{",
"if",
"(",
"versionString",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"return",
"new",
"VersionNumber",... | Parses a version string into {@link VersionNumber}, or null if it's not parseable as a version number
(such as when Jenkins is run with "mvn hudson-dev:run") | [
"Parses",
"a",
"version",
"string",
"into",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L5077-L5101 |
alkacon/opencms-core | src/org/opencms/ade/detailpage/CmsDetailPageResourceHandler.java | CmsDetailPageResourceHandler.isValidDetailPage | protected boolean isValidDetailPage(CmsObject cms, CmsResource page, CmsResource detailRes) {
"""
Checks whether the given detail page is valid for the given resource.<p>
@param cms the CMS context
@param page the detail page
@param detailRes the detail resource
@return true if the given detail page is val... | java | protected boolean isValidDetailPage(CmsObject cms, CmsResource page, CmsResource detailRes) {
if (OpenCms.getSystemInfo().isRestrictDetailContents()) {
// in 'restrict detail contents mode', do not allow detail contents from a real site on a detail page of a different real site
CmsSite ... | [
"protected",
"boolean",
"isValidDetailPage",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"page",
",",
"CmsResource",
"detailRes",
")",
"{",
"if",
"(",
"OpenCms",
".",
"getSystemInfo",
"(",
")",
".",
"isRestrictDetailContents",
"(",
")",
")",
"{",
"// in 'restri... | Checks whether the given detail page is valid for the given resource.<p>
@param cms the CMS context
@param page the detail page
@param detailRes the detail resource
@return true if the given detail page is valid | [
"Checks",
"whether",
"the",
"given",
"detail",
"page",
"is",
"valid",
"for",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/detailpage/CmsDetailPageResourceHandler.java#L214-L227 |
imsweb/naaccr-xml | src/main/java/com/imsweb/naaccrxml/PatientXmlWriter.java | PatientXmlWriter.convertSyntaxException | protected NaaccrIOException convertSyntaxException(ConversionException ex) {
"""
We don't want to expose the conversion exceptions, so let's translate them into our own exceptions...
"""
String msg = ex.get("message");
if (msg == null)
msg = ex.getMessage();
NaaccrIOExceptio... | java | protected NaaccrIOException convertSyntaxException(ConversionException ex) {
String msg = ex.get("message");
if (msg == null)
msg = ex.getMessage();
NaaccrIOException e = new NaaccrIOException(msg, ex);
if (ex.get("line number") != null)
e.setLineNumber(Integer.va... | [
"protected",
"NaaccrIOException",
"convertSyntaxException",
"(",
"ConversionException",
"ex",
")",
"{",
"String",
"msg",
"=",
"ex",
".",
"get",
"(",
"\"message\"",
")",
";",
"if",
"(",
"msg",
"==",
"null",
")",
"msg",
"=",
"ex",
".",
"getMessage",
"(",
")"... | We don't want to expose the conversion exceptions, so let's translate them into our own exceptions... | [
"We",
"don",
"t",
"want",
"to",
"expose",
"the",
"conversion",
"exceptions",
"so",
"let",
"s",
"translate",
"them",
"into",
"our",
"own",
"exceptions",
"..."
] | train | https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/PatientXmlWriter.java#L268-L277 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/ScopeSupport.java | ScopeSupport.fillDecoded | protected void fillDecoded(URLItem[] raw, String encoding, boolean scriptProteced, boolean sameAsArray) throws UnsupportedEncodingException {
"""
fill th data from given strut and decode it
@param raw
@param encoding
@throws UnsupportedEncodingException
"""
clear();
String name, value;
// Object curr;
... | java | protected void fillDecoded(URLItem[] raw, String encoding, boolean scriptProteced, boolean sameAsArray) throws UnsupportedEncodingException {
clear();
String name, value;
// Object curr;
for (int i = 0; i < raw.length; i++) {
name = raw[i].getName();
value = raw[i].getValue();
if (raw[i].isUrlEncoded... | [
"protected",
"void",
"fillDecoded",
"(",
"URLItem",
"[",
"]",
"raw",
",",
"String",
"encoding",
",",
"boolean",
"scriptProteced",
",",
"boolean",
"sameAsArray",
")",
"throws",
"UnsupportedEncodingException",
"{",
"clear",
"(",
")",
";",
"String",
"name",
",",
... | fill th data from given strut and decode it
@param raw
@param encoding
@throws UnsupportedEncodingException | [
"fill",
"th",
"data",
"from",
"given",
"strut",
"and",
"decode",
"it"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/ScopeSupport.java#L172-L198 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/auth/OAuth.java | OAuth.getAuthorizationUri | public String getAuthorizationUri(final String redirectUri, final Set<String> scopes, final String state) {
"""
Get the authorization uri, where the user logs in.
@param redirectUri
Uri the user is redirected to, after successful authorization.
This must be the same as specified at the Eve Online developer
p... | java | public String getAuthorizationUri(final String redirectUri, final Set<String> scopes, final String state) {
if (account == null)
throw new IllegalArgumentException("Auth is not set");
if (account.getClientId() == null)
throw new IllegalArgumentException("client_id is not set");
... | [
"public",
"String",
"getAuthorizationUri",
"(",
"final",
"String",
"redirectUri",
",",
"final",
"Set",
"<",
"String",
">",
"scopes",
",",
"final",
"String",
"state",
")",
"{",
"if",
"(",
"account",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",... | Get the authorization uri, where the user logs in.
@param redirectUri
Uri the user is redirected to, after successful authorization.
This must be the same as specified at the Eve Online developer
page.
@param scopes
Scopes of the Eve Online SSO.
@param state
This should be some secret to prevent XRSF, please read:
htt... | [
"Get",
"the",
"authorization",
"uri",
"where",
"the",
"user",
"logs",
"in",
"."
] | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/auth/OAuth.java#L163-L186 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/organization/MemberUpdater.java | MemberUpdater.synchronizeUserOrganizationMembership | public void synchronizeUserOrganizationMembership(DbSession dbSession, UserDto user, ALM alm, Set<String> organizationAlmIds) {
"""
Synchronize organization membership of a user from a list of ALM organization specific ids
Please note that no commit will not be executed.
"""
Set<String> userOrganizationUu... | java | public void synchronizeUserOrganizationMembership(DbSession dbSession, UserDto user, ALM alm, Set<String> organizationAlmIds) {
Set<String> userOrganizationUuids = dbClient.organizationMemberDao().selectOrganizationUuidsByUser(dbSession, user.getId());
Set<String> userOrganizationUuidsWithMembersSyncEnabled = d... | [
"public",
"void",
"synchronizeUserOrganizationMembership",
"(",
"DbSession",
"dbSession",
",",
"UserDto",
"user",
",",
"ALM",
"alm",
",",
"Set",
"<",
"String",
">",
"organizationAlmIds",
")",
"{",
"Set",
"<",
"String",
">",
"userOrganizationUuids",
"=",
"dbClient"... | Synchronize organization membership of a user from a list of ALM organization specific ids
Please note that no commit will not be executed. | [
"Synchronize",
"organization",
"membership",
"of",
"a",
"user",
"from",
"a",
"list",
"of",
"ALM",
"organization",
"specific",
"ids",
"Please",
"note",
"that",
"no",
"commit",
"will",
"not",
"be",
"executed",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/organization/MemberUpdater.java#L110-L133 |
lucee/Lucee | core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java | AbstrCFMLExprTransformer.functionArgument | private Argument functionArgument(Data data, boolean varKeyUpperCase) throws TemplateException {
"""
Liest einen gelableten Funktionsparamter ein <br />
EBNF:<br />
<code>assignOp [":" spaces assignOp];</code>
@return CFXD Element
@throws TemplateException
"""
return functionArgument(data, null, varKeyU... | java | private Argument functionArgument(Data data, boolean varKeyUpperCase) throws TemplateException {
return functionArgument(data, null, varKeyUpperCase);
} | [
"private",
"Argument",
"functionArgument",
"(",
"Data",
"data",
",",
"boolean",
"varKeyUpperCase",
")",
"throws",
"TemplateException",
"{",
"return",
"functionArgument",
"(",
"data",
",",
"null",
",",
"varKeyUpperCase",
")",
";",
"}"
] | Liest einen gelableten Funktionsparamter ein <br />
EBNF:<br />
<code>assignOp [":" spaces assignOp];</code>
@return CFXD Element
@throws TemplateException | [
"Liest",
"einen",
"gelableten",
"Funktionsparamter",
"ein",
"<br",
"/",
">",
"EBNF",
":",
"<br",
"/",
">",
"<code",
">",
"assignOp",
"[",
":",
"spaces",
"assignOp",
"]",
";",
"<",
"/",
"code",
">"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java#L283-L285 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.recoverDeletedKeyAsync | public Observable<KeyBundle> recoverDeletedKeyAsync(String vaultBaseUrl, String keyName) {
"""
Recovers the deleted key to its latest version.
The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An atte... | java | public Observable<KeyBundle> recoverDeletedKeyAsync(String vaultBaseUrl, String keyName) {
return recoverDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName).map(new Func1<ServiceResponse<KeyBundle>, KeyBundle>() {
@Override
public KeyBundle call(ServiceResponse<KeyBundle> response)... | [
"public",
"Observable",
"<",
"KeyBundle",
">",
"recoverDeletedKeyAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
")",
"{",
"return",
"recoverDeletedKeyWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"keyName",
")",
".",
"map",
"(",
"new",
"Func... | Recovers the deleted key to its latest version.
The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete opera... | [
"Recovers",
"the",
"deleted",
"key",
"to",
"its",
"latest",
"version",
".",
"The",
"Recover",
"Deleted",
"Key",
"operation",
"is",
"applicable",
"for",
"deleted",
"keys",
"in",
"soft",
"-",
"delete",
"enabled",
"vaults",
".",
"It",
"recovers",
"the",
"delete... | 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#L3260-L3267 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowController.java | FlowController.saveMessages | protected void saveMessages( HttpServletRequest request, ActionMessages messages ) {
"""
Save the specified messages keys into the appropriate request
attribute for use by the Struts <html:messages> tag (if
messages="true" is set), if any messages are required. Otherwise,
ensure that the request attribut... | java | protected void saveMessages( HttpServletRequest request, ActionMessages messages )
{
// Remove any messages attribute if none are required
if ( messages == null || messages.isEmpty() )
{
request.removeAttribute( Globals.MESSAGE_KEY );
return;
}
// Sa... | [
"protected",
"void",
"saveMessages",
"(",
"HttpServletRequest",
"request",
",",
"ActionMessages",
"messages",
")",
"{",
"// Remove any messages attribute if none are required",
"if",
"(",
"messages",
"==",
"null",
"||",
"messages",
".",
"isEmpty",
"(",
")",
")",
"{",
... | Save the specified messages keys into the appropriate request
attribute for use by the Struts <html:messages> tag (if
messages="true" is set), if any messages are required. Otherwise,
ensure that the request attribute is not created.
Formerly deprecated: This method will be removed without replacement in a futur... | [
"Save",
"the",
"specified",
"messages",
"keys",
"into",
"the",
"appropriate",
"request",
"attribute",
"for",
"use",
"by",
"the",
"Struts",
"<",
";",
"html",
":",
"messages>",
";",
"tag",
"(",
"if",
"messages",
"=",
"true",
"is",
"set",
")",
"if",
"an... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowController.java#L1880-L1893 |
pietermartin/sqlg | sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/Partition.java | Partition.createListSubPartition | private static Partition createListSubPartition(SqlgGraph sqlgGraph, Partition parentPartition, String name, String in) {
"""
Create a list partition on an existing {@link Partition}
@param sqlgGraph
@param parentPartition
@param name
@param in
@return
"""
Preconditions.checkArgument(!parentPart... | java | private static Partition createListSubPartition(SqlgGraph sqlgGraph, Partition parentPartition, String name, String in) {
Preconditions.checkArgument(!parentPartition.getAbstractLabel().getSchema().isSqlgSchema(), "createPartition may not be called for \"%s\"", Topology.SQLG_SCHEMA);
Partition partition... | [
"private",
"static",
"Partition",
"createListSubPartition",
"(",
"SqlgGraph",
"sqlgGraph",
",",
"Partition",
"parentPartition",
",",
"String",
"name",
",",
"String",
"in",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"!",
"parentPartition",
".",
"getAbstrac... | Create a list partition on an existing {@link Partition}
@param sqlgGraph
@param parentPartition
@param name
@param in
@return | [
"Create",
"a",
"list",
"partition",
"on",
"an",
"existing",
"{",
"@link",
"Partition",
"}"
] | train | https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/Partition.java#L395-L402 |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedCollection.java | FileBasedCollection.getFeedDocument | public Feed getFeedDocument() throws AtomException {
"""
Get feed document representing collection.
@throws com.rometools.rome.propono.atom.server.AtomException On error retrieving feed file.
@return Atom Feed representing collection.
"""
InputStream in = null;
synchronized (FileStore.getFi... | java | public Feed getFeedDocument() throws AtomException {
InputStream in = null;
synchronized (FileStore.getFileStore()) {
in = FileStore.getFileStore().getFileInputStream(getFeedPath());
if (in == null) {
in = createDefaultFeedDocument(contextURI + servletPath + "/" +... | [
"public",
"Feed",
"getFeedDocument",
"(",
")",
"throws",
"AtomException",
"{",
"InputStream",
"in",
"=",
"null",
";",
"synchronized",
"(",
"FileStore",
".",
"getFileStore",
"(",
")",
")",
"{",
"in",
"=",
"FileStore",
".",
"getFileStore",
"(",
")",
".",
"ge... | Get feed document representing collection.
@throws com.rometools.rome.propono.atom.server.AtomException On error retrieving feed file.
@return Atom Feed representing collection. | [
"Get",
"feed",
"document",
"representing",
"collection",
"."
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedCollection.java#L130-L145 |
threerings/narya | core/src/main/java/com/threerings/presents/dobj/DObject.java | DObject.removeFromSet | public void removeFromSet (String setName, Comparable<?> key) {
"""
Request to have the specified key removed from the specified DSet.
"""
requestEntryRemove(setName, getSet(setName), key);
} | java | public void removeFromSet (String setName, Comparable<?> key)
{
requestEntryRemove(setName, getSet(setName), key);
} | [
"public",
"void",
"removeFromSet",
"(",
"String",
"setName",
",",
"Comparable",
"<",
"?",
">",
"key",
")",
"{",
"requestEntryRemove",
"(",
"setName",
",",
"getSet",
"(",
"setName",
")",
",",
"key",
")",
";",
"}"
] | Request to have the specified key removed from the specified DSet. | [
"Request",
"to",
"have",
"the",
"specified",
"key",
"removed",
"from",
"the",
"specified",
"DSet",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L283-L286 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/util/MainApplication.java | MainApplication.setProperty | public void setProperty(String strProperty, String strValue) {
"""
Set this property.
@param strProperty The property key.
@param strValue The property value.
"""
if (this.getSystemRecordOwner() != null)
this.getSystemRecordOwner().setProperty(strProperty, strValue); // Note: This is w... | java | public void setProperty(String strProperty, String strValue)
{
if (this.getSystemRecordOwner() != null)
this.getSystemRecordOwner().setProperty(strProperty, strValue); // Note: This is where the user properies are.
super.setProperty(strProperty, strValue);
} | [
"public",
"void",
"setProperty",
"(",
"String",
"strProperty",
",",
"String",
"strValue",
")",
"{",
"if",
"(",
"this",
".",
"getSystemRecordOwner",
"(",
")",
"!=",
"null",
")",
"this",
".",
"getSystemRecordOwner",
"(",
")",
".",
"setProperty",
"(",
"strPrope... | Set this property.
@param strProperty The property key.
@param strValue The property value. | [
"Set",
"this",
"property",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/util/MainApplication.java#L560-L565 |
apache/reef | lang/java/reef-io/src/main/java/org/apache/reef/io/network/group/impl/utils/ScatterEncoder.java | ScatterEncoder.encodeScatterMsgForNode | private byte[] encodeScatterMsgForNode(final TopologySimpleNode node,
final Map<String, byte[]> taskIdToBytes) {
"""
Compute a single byte array message for a node and its children.
Using {@code taskIdToBytes}, we pack all messages for a
{@code TopologySimpleNode} and its... | java | private byte[] encodeScatterMsgForNode(final TopologySimpleNode node,
final Map<String, byte[]> taskIdToBytes) {
try (final ByteArrayOutputStream bstream = new ByteArrayOutputStream();
final DataOutputStream dstream = new DataOutputStream(bstream)) {
// firs... | [
"private",
"byte",
"[",
"]",
"encodeScatterMsgForNode",
"(",
"final",
"TopologySimpleNode",
"node",
",",
"final",
"Map",
"<",
"String",
",",
"byte",
"[",
"]",
">",
"taskIdToBytes",
")",
"{",
"try",
"(",
"final",
"ByteArrayOutputStream",
"bstream",
"=",
"new",
... | Compute a single byte array message for a node and its children.
Using {@code taskIdToBytes}, we pack all messages for a
{@code TopologySimpleNode} and its children into a single byte array.
@param node the target TopologySimpleNode to generate a message for
@param taskIdToBytes map containing byte array of encoded da... | [
"Compute",
"a",
"single",
"byte",
"array",
"message",
"for",
"a",
"node",
"and",
"its",
"children",
".",
"Using",
"{",
"@code",
"taskIdToBytes",
"}",
"we",
"pack",
"all",
"messages",
"for",
"a",
"{",
"@code",
"TopologySimpleNode",
"}",
"and",
"its",
"child... | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-io/src/main/java/org/apache/reef/io/network/group/impl/utils/ScatterEncoder.java#L71-L101 |
ugli/jocote | src/main/java/se/ugli/jocote/lpr/Printer.java | Printer.printFile | public void printFile(final File f, final String hostName, final String printerName, final String documentName) throws IOException {
"""
/*
Print a file to a network host or printer
fileName The path to the file to be printed
hostName The host name or IP address of the print server
printerName The name of the ... | java | public void printFile(final File f, final String hostName, final String printerName, final String documentName) throws IOException {
final byte buffer[] = new byte[1000];
//Send print file
if (!(f.exists() && f.isFile() && f.canRead()))
throw new IOException("Error opening print fil... | [
"public",
"void",
"printFile",
"(",
"final",
"File",
"f",
",",
"final",
"String",
"hostName",
",",
"final",
"String",
"printerName",
",",
"final",
"String",
"documentName",
")",
"throws",
"IOException",
"{",
"final",
"byte",
"buffer",
"[",
"]",
"=",
"new",
... | /*
Print a file to a network host or printer
fileName The path to the file to be printed
hostName The host name or IP address of the print server
printerName The name of the remote queue or the port on the print server
documentName The name of the document as displayed in the spooler of the host | [
"/",
"*",
"Print",
"a",
"file",
"to",
"a",
"network",
"host",
"or",
"printer",
"fileName",
"The",
"path",
"to",
"the",
"file",
"to",
"be",
"printed",
"hostName",
"The",
"host",
"name",
"or",
"IP",
"address",
"of",
"the",
"print",
"server",
"printerName",... | train | https://github.com/ugli/jocote/blob/28c34eb5aadbca6597bf006bb92d4fc340c71b41/src/main/java/se/ugli/jocote/lpr/Printer.java#L110-L126 |
microfocus-idol/java-content-parameter-api | src/main/java/com/hp/autonomy/aci/content/fieldtext/FieldTextBuilder.java | FieldTextBuilder.binaryOperation | private FieldTextBuilder binaryOperation(final String operator, final FieldText fieldText) {
"""
Does the work for the OR, AND, XOR and WHEN methods.
@param operator
@param fieldText
@return
"""
// This should never happen as the AND, OR, XOR and WHEN methods should already have checked this
... | java | private FieldTextBuilder binaryOperation(final String operator, final FieldText fieldText) {
// This should never happen as the AND, OR, XOR and WHEN methods should already have checked this
Validate.isTrue(fieldText != this);
// Optimized case when fieldText is a FieldTextBuilder
if(fi... | [
"private",
"FieldTextBuilder",
"binaryOperation",
"(",
"final",
"String",
"operator",
",",
"final",
"FieldText",
"fieldText",
")",
"{",
"// This should never happen as the AND, OR, XOR and WHEN methods should already have checked this",
"Validate",
".",
"isTrue",
"(",
"fieldText"... | Does the work for the OR, AND, XOR and WHEN methods.
@param operator
@param fieldText
@return | [
"Does",
"the",
"work",
"for",
"the",
"OR",
"AND",
"XOR",
"and",
"WHEN",
"methods",
"."
] | train | https://github.com/microfocus-idol/java-content-parameter-api/blob/8d33dc633f8df2a470a571ac7694e423e7004ad0/src/main/java/com/hp/autonomy/aci/content/fieldtext/FieldTextBuilder.java#L299-L331 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java | SourceLineAnnotation.fromVisitedInstruction | public static SourceLineAnnotation fromVisitedInstruction(BytecodeScanningDetector visitor, int pc) {
"""
Factory method for creating a source line annotation describing the
source line number for the instruction being visited by given visitor.
@param visitor
a BetterVisitor which is visiting the method
@par... | java | public static SourceLineAnnotation fromVisitedInstruction(BytecodeScanningDetector visitor, int pc) {
return fromVisitedInstructionRange(visitor.getClassContext(), visitor, pc, pc);
} | [
"public",
"static",
"SourceLineAnnotation",
"fromVisitedInstruction",
"(",
"BytecodeScanningDetector",
"visitor",
",",
"int",
"pc",
")",
"{",
"return",
"fromVisitedInstructionRange",
"(",
"visitor",
".",
"getClassContext",
"(",
")",
",",
"visitor",
",",
"pc",
",",
"... | Factory method for creating a source line annotation describing the
source line number for the instruction being visited by given visitor.
@param visitor
a BetterVisitor which is visiting the method
@param pc
the bytecode offset of the instruction in the method
@return the SourceLineAnnotation, or null if we do not ha... | [
"Factory",
"method",
"for",
"creating",
"a",
"source",
"line",
"annotation",
"describing",
"the",
"source",
"line",
"number",
"for",
"the",
"instruction",
"being",
"visited",
"by",
"given",
"visitor",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java#L367-L369 |
belaban/JGroups | src/org/jgroups/stack/Configurator.java | Configurator.createProtocol | public static Protocol createProtocol(String prot_spec, ProtocolStack stack) throws Exception {
"""
Creates a new protocol given the protocol specification. Initializes the properties and starts the
up and down handler threads.
@param prot_spec The specification of the protocol. Same convention as for specifying... | java | public static Protocol createProtocol(String prot_spec, ProtocolStack stack) throws Exception {
ProtocolConfiguration config;
Protocol prot;
if(prot_spec == null) throw new Exception("Configurator.createProtocol(): prot_spec is null");
// parse the configuration for this protocol
... | [
"public",
"static",
"Protocol",
"createProtocol",
"(",
"String",
"prot_spec",
",",
"ProtocolStack",
"stack",
")",
"throws",
"Exception",
"{",
"ProtocolConfiguration",
"config",
";",
"Protocol",
"prot",
";",
"if",
"(",
"prot_spec",
"==",
"null",
")",
"throw",
"ne... | Creates a new protocol given the protocol specification. Initializes the properties and starts the
up and down handler threads.
@param prot_spec The specification of the protocol. Same convention as for specifying a protocol stack.
An exception will be thrown if the class cannot be created. Example:
<pre>"VERIFY_SUSPEC... | [
"Creates",
"a",
"new",
"protocol",
"given",
"the",
"protocol",
"specification",
".",
"Initializes",
"the",
"properties",
"and",
"starts",
"the",
"up",
"and",
"down",
"handler",
"threads",
"."
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/stack/Configurator.java#L155-L168 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/svg/Gradient.java | Gradient.genImage | public void genImage() {
"""
Generate the image used for texturing the gradient across shapes
"""
if (image == null) {
ImageBuffer buffer = new ImageBuffer(128,16);
for (int i=0;i<128;i++) {
Color col = getColorAt(i / 128.0f);
for (int j=0;j<16;j++) {
buffer.setRGBA(i, j, col.getRedB... | java | public void genImage() {
if (image == null) {
ImageBuffer buffer = new ImageBuffer(128,16);
for (int i=0;i<128;i++) {
Color col = getColorAt(i / 128.0f);
for (int j=0;j<16;j++) {
buffer.setRGBA(i, j, col.getRedByte(), col.getGreenByte(), col.getBlueByte(), col.getAlphaByte());
}
}
... | [
"public",
"void",
"genImage",
"(",
")",
"{",
"if",
"(",
"image",
"==",
"null",
")",
"{",
"ImageBuffer",
"buffer",
"=",
"new",
"ImageBuffer",
"(",
"128",
",",
"16",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"128",
";",
"i",
"++"... | Generate the image used for texturing the gradient across shapes | [
"Generate",
"the",
"image",
"used",
"for",
"texturing",
"the",
"gradient",
"across",
"shapes"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/svg/Gradient.java#L106-L117 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/expression/CustomFunctions.java | CustomFunctions.join | @SuppressWarnings( {
"""
コレクションの値を結合する。
@param collection 結合対象のコレクション
@param delimiter 区切り文字
@param printer コレクションの要素の値のフォーマッタ
@return 結合した文字列を返す。結合の対象のコレクションがnulの場合、空文字を返す。
@throws NullPointerException {@literal printer is null.}
""""rawtypes", "unchecked"})
public static String join(final Collectio... | java | @SuppressWarnings({"rawtypes", "unchecked"})
public static String join(final Collection<?> collection, final String delimiter, final TextPrinter printer) {
Objects.requireNonNull(printer);
if(collection == null || collection.isEmpty()) {
return "";
}
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"String",
"join",
"(",
"final",
"Collection",
"<",
"?",
">",
"collection",
",",
"final",
"String",
"delimiter",
",",
"final",
"TextPrinter",
"printer",
")",
... | コレクションの値を結合する。
@param collection 結合対象のコレクション
@param delimiter 区切り文字
@param printer コレクションの要素の値のフォーマッタ
@return 結合した文字列を返す。結合の対象のコレクションがnulの場合、空文字を返す。
@throws NullPointerException {@literal printer is null.} | [
"コレクションの値を結合する。"
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/expression/CustomFunctions.java#L128-L142 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/TagsApi.java | TagsApi.updateRelease | public Release updateRelease(Object projectIdOrPath, String tagName, String releaseNotes) throws GitLabApiException {
"""
Updates the release notes of a given release.
<pre><code>GitLab Endpoint: PUT /projects/:id/repository/tags/:tagName/release</code></pre>
@param projectIdOrPath id, path of the project, o... | java | public Release updateRelease(Object projectIdOrPath, String tagName, String releaseNotes) throws GitLabApiException {
Form formData = new GitLabApiForm().withParam("description", releaseNotes);
Response response = put(Response.Status.OK, formData.asMap(),
"projects", getProjectIdOrPath(p... | [
"public",
"Release",
"updateRelease",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"tagName",
",",
"String",
"releaseNotes",
")",
"throws",
"GitLabApiException",
"{",
"Form",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"\"descript... | Updates the release notes of a given release.
<pre><code>GitLab Endpoint: PUT /projects/:id/repository/tags/:tagName/release</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param tagName the name of a tag
@param releaseNotes release notes with markdow... | [
"Updates",
"the",
"release",
"notes",
"of",
"a",
"given",
"release",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/TagsApi.java#L233-L238 |
google/error-prone-javac | src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java | Util.detectJdiExitEvent | public static void detectJdiExitEvent(VirtualMachine vm, Consumer<String> unbiddenExitHandler) {
"""
Monitor the JDI event stream for {@link com.sun.jdi.event.VMDeathEvent}
and {@link com.sun.jdi.event.VMDisconnectEvent}. If encountered, invokes
{@code unbiddenExitHandler}.
@param vm the virtual machine to ch... | java | public static void detectJdiExitEvent(VirtualMachine vm, Consumer<String> unbiddenExitHandler) {
if (vm.canBeModified()) {
new JdiEventHandler(vm, unbiddenExitHandler).start();
}
} | [
"public",
"static",
"void",
"detectJdiExitEvent",
"(",
"VirtualMachine",
"vm",
",",
"Consumer",
"<",
"String",
">",
"unbiddenExitHandler",
")",
"{",
"if",
"(",
"vm",
".",
"canBeModified",
"(",
")",
")",
"{",
"new",
"JdiEventHandler",
"(",
"vm",
",",
"unbidde... | Monitor the JDI event stream for {@link com.sun.jdi.event.VMDeathEvent}
and {@link com.sun.jdi.event.VMDisconnectEvent}. If encountered, invokes
{@code unbiddenExitHandler}.
@param vm the virtual machine to check
@param unbiddenExitHandler the handler, which will accept the exit
information | [
"Monitor",
"the",
"JDI",
"event",
"stream",
"for",
"{",
"@link",
"com",
".",
"sun",
".",
"jdi",
".",
"event",
".",
"VMDeathEvent",
"}",
"and",
"{",
"@link",
"com",
".",
"sun",
".",
"jdi",
".",
"event",
".",
"VMDisconnectEvent",
"}",
".",
"If",
"encou... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java#L213-L217 |
RestComm/jss7 | map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPDialogImpl.java | MAPDialogImpl.getMessageUserDataLengthOnClose | public int getMessageUserDataLengthOnClose(boolean prearrangedEnd) throws MAPException {
"""
Return the MAP message length (in bytes) that will be after encoding if TC-END case This value must not exceed
getMaxUserDataLength() value
@param prearrangedEnd
@return
"""
if (prearrangedEnd)
... | java | public int getMessageUserDataLengthOnClose(boolean prearrangedEnd) throws MAPException {
if (prearrangedEnd)
// we do not send any data in prearrangedEnd dialog termination
return 0;
try {
switch (this.tcapDialog.getState()) {
case InitialReceived:
... | [
"public",
"int",
"getMessageUserDataLengthOnClose",
"(",
"boolean",
"prearrangedEnd",
")",
"throws",
"MAPException",
"{",
"if",
"(",
"prearrangedEnd",
")",
"// we do not send any data in prearrangedEnd dialog termination",
"return",
"0",
";",
"try",
"{",
"switch",
"(",
"t... | Return the MAP message length (in bytes) that will be after encoding if TC-END case This value must not exceed
getMaxUserDataLength() value
@param prearrangedEnd
@return | [
"Return",
"the",
"MAP",
"message",
"length",
"(",
"in",
"bytes",
")",
"that",
"will",
"be",
"after",
"encoding",
"if",
"TC",
"-",
"END",
"case",
"This",
"value",
"must",
"not",
"exceed",
"getMaxUserDataLength",
"()",
"value"
] | train | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPDialogImpl.java#L649-L674 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/BaseField.java | BaseField.setupTablePopup | public ScreenComponent setupTablePopup(ScreenLoc itsLocation, ComponentParent targetScreen, int iDisplayFieldDesc, Rec record, int iDisplayFieldSeq, boolean bIncludeBlankOption) {
"""
Add a popup for the table tied to this field.
@return Return the component or ScreenField that is created for this field.
"""... | java | public ScreenComponent setupTablePopup(ScreenLoc itsLocation, ComponentParent targetScreen, int iDisplayFieldDesc, Rec record, int iDisplayFieldSeq, boolean bIncludeBlankOption)
{
return this.setupTablePopup(itsLocation, targetScreen, this, iDisplayFieldDesc, record, DBConstants.MAIN_KEY_AREA, iDisplayField... | [
"public",
"ScreenComponent",
"setupTablePopup",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"int",
"iDisplayFieldDesc",
",",
"Rec",
"record",
",",
"int",
"iDisplayFieldSeq",
",",
"boolean",
"bIncludeBlankOption",
")",
"{",
"return",
"... | Add a popup for the table tied to this field.
@return Return the component or ScreenField that is created for this field. | [
"Add",
"a",
"popup",
"for",
"the",
"table",
"tied",
"to",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L1193-L1196 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java | AbstractXbaseSemanticSequencer.sequence_XDoWhileExpression | protected void sequence_XDoWhileExpression(ISerializationContext context, XDoWhileExpression semanticObject) {
"""
Contexts:
XExpression returns XDoWhileExpression
XAssignment returns XDoWhileExpression
XAssignment.XBinaryOperation_1_1_0_0_0 returns XDoWhileExpression
XOrExpression returns XDoWhileExpression
... | java | protected void sequence_XDoWhileExpression(ISerializationContext context, XDoWhileExpression semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XABSTRACT_WHILE_EXPRESSION__BODY) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider... | [
"protected",
"void",
"sequence_XDoWhileExpression",
"(",
"ISerializationContext",
"context",
",",
"XDoWhileExpression",
"semanticObject",
")",
"{",
"if",
"(",
"errorAcceptor",
"!=",
"null",
")",
"{",
"if",
"(",
"transientValues",
".",
"isValueTransient",
"(",
"semanti... | Contexts:
XExpression returns XDoWhileExpression
XAssignment returns XDoWhileExpression
XAssignment.XBinaryOperation_1_1_0_0_0 returns XDoWhileExpression
XOrExpression returns XDoWhileExpression
XOrExpression.XBinaryOperation_1_0_0_0 returns XDoWhileExpression
XAndExpression returns XDoWhileExpression
XAndExpression.XB... | [
"Contexts",
":",
"XExpression",
"returns",
"XDoWhileExpression",
"XAssignment",
"returns",
"XDoWhileExpression",
"XAssignment",
".",
"XBinaryOperation_1_1_0_0_0",
"returns",
"XDoWhileExpression",
"XOrExpression",
"returns",
"XDoWhileExpression",
"XOrExpression",
".",
"XBinaryOper... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java#L833-L844 |
timtiemens/secretshare | src/main/java/com/tiemens/secretshare/math/BigIntStringChecksum.java | BigIntStringChecksum.asBigInteger | public BigInteger asBigInteger() {
"""
Return the original BigInteger.
(or throw an exception if something went wrong).
@return BigInteger or throw exception
@throws SecretShareException if the hex is invalid
"""
try
{
return new BigInteger(asHex, HEX_RADIX);
}
... | java | public BigInteger asBigInteger()
{
try
{
return new BigInteger(asHex, HEX_RADIX);
}
catch (NumberFormatException e)
{
throw new SecretShareException("Invalid input='" + asHex + "'", e);
}
} | [
"public",
"BigInteger",
"asBigInteger",
"(",
")",
"{",
"try",
"{",
"return",
"new",
"BigInteger",
"(",
"asHex",
",",
"HEX_RADIX",
")",
";",
"}",
"catch",
"(",
"NumberFormatException",
"e",
")",
"{",
"throw",
"new",
"SecretShareException",
"(",
"\"Invalid input... | Return the original BigInteger.
(or throw an exception if something went wrong).
@return BigInteger or throw exception
@throws SecretShareException if the hex is invalid | [
"Return",
"the",
"original",
"BigInteger",
".",
"(",
"or",
"throw",
"an",
"exception",
"if",
"something",
"went",
"wrong",
")",
"."
] | train | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/math/BigIntStringChecksum.java#L309-L319 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/SortUtils.java | SortUtils.lessThan | public static <T extends Comparable<? super T>> boolean lessThan(final T object, final T other) {
"""
Returns true if object less than other; false otherwise.
@param object
comparable object to test.
@param other
comparable object to test.
@return true if object less than other; false otherwise.
"""
... | java | public static <T extends Comparable<? super T>> boolean lessThan(final T object, final T other) {
return JudgeUtils.lessThan(object, other);
} | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"?",
"super",
"T",
">",
">",
"boolean",
"lessThan",
"(",
"final",
"T",
"object",
",",
"final",
"T",
"other",
")",
"{",
"return",
"JudgeUtils",
".",
"lessThan",
"(",
"object",
",",
"other",
")"... | Returns true if object less than other; false otherwise.
@param object
comparable object to test.
@param other
comparable object to test.
@return true if object less than other; false otherwise. | [
"Returns",
"true",
"if",
"object",
"less",
"than",
"other",
";",
"false",
"otherwise",
"."
] | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/SortUtils.java#L82-L85 |
alkacon/opencms-core | src/org/opencms/util/CmsStringUtil.java | CmsStringUtil.mapAsJson | public static String mapAsJson(Map<String, String> map) {
"""
Encodes a map with string keys and values as a JSON string with the same keys/values.<p>
@param map the input map
@return the JSON data containing the map entries
"""
JSONObject obj = new JSONObject();
for (Map.Entry<String, Str... | java | public static String mapAsJson(Map<String, String> map) {
JSONObject obj = new JSONObject();
for (Map.Entry<String, String> entry : map.entrySet()) {
try {
obj.put(entry.getKey(), entry.getValue());
} catch (JSONException e) {
LOG.error(e.getLocal... | [
"public",
"static",
"String",
"mapAsJson",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"map",
")",
"{",
"JSONObject",
"obj",
"=",
"new",
"JSONObject",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",... | Encodes a map with string keys and values as a JSON string with the same keys/values.<p>
@param map the input map
@return the JSON data containing the map entries | [
"Encodes",
"a",
"map",
"with",
"string",
"keys",
"and",
"values",
"as",
"a",
"JSON",
"string",
"with",
"the",
"same",
"keys",
"/",
"values",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsStringUtil.java#L1290-L1301 |
offbynull/coroutines | instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java | GenericGenerators.tryCatchBlock | public static InsnList tryCatchBlock(TryCatchBlockNode tryCatchBlockNode, Type exceptionType, InsnList tryInsnList,
InsnList catchInsnList) {
"""
Generates instructions for a try-catch block.
@param tryCatchBlockNode try catch block node to populate to with label with relevant information
@param exce... | java | public static InsnList tryCatchBlock(TryCatchBlockNode tryCatchBlockNode, Type exceptionType, InsnList tryInsnList,
InsnList catchInsnList) {
Validate.notNull(tryInsnList);
// exceptionType can be null
Validate.notNull(catchInsnList);
if (exceptionType != null) {
... | [
"public",
"static",
"InsnList",
"tryCatchBlock",
"(",
"TryCatchBlockNode",
"tryCatchBlockNode",
",",
"Type",
"exceptionType",
",",
"InsnList",
"tryInsnList",
",",
"InsnList",
"catchInsnList",
")",
"{",
"Validate",
".",
"notNull",
"(",
"tryInsnList",
")",
";",
"// ex... | Generates instructions for a try-catch block.
@param tryCatchBlockNode try catch block node to populate to with label with relevant information
@param exceptionType exception type to catch ({@code null} means catch any exception)
@param tryInsnList instructions to execute for try block
@param catchInsnList instructions... | [
"Generates",
"instructions",
"for",
"a",
"try",
"-",
"catch",
"block",
"."
] | train | https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L983-L1010 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.